示例#1
0
        internal void Checkin()
        {
            List <ChangeInfo> changesToCheckin;
            List <ChangeInfo> dependenciesCandidates;

            mChangesTreeView.GetCheckedChanges(
                false, out changesToCheckin, out dependenciesCandidates);

            if (CheckEmptyOperation(changesToCheckin, HasPendingMergeLinks()))
            {
                mProgressControls.ShowWarning(
                    PlasticLocalization.GetString(PlasticLocalization.Name.NoItemsAreSelected));
                return;
            }

            bool isCancelled;

            SaveAssets.ForChanges(changesToCheckin, out isCancelled);

            if (isCancelled)
            {
                return;
            }

            mPendingChangesOperations.Checkin(
                changesToCheckin,
                dependenciesCandidates,
                CommentText,
                null,
                RefreshAsset.UnityAssetDatabase);
        }
示例#2
0
        void PartialUndoChanges(
            List <ChangeInfo> changesToUndo,
            List <ChangeInfo> dependenciesCandidates)
        {
            if (CheckEmptyOperation(changesToUndo))
            {
                ((IProgressControls)mProgressControls).ShowWarning(
                    PlasticLocalization.GetString(PlasticLocalization.Name.NoItemsToUndo));
                return;
            }

            SaveAssets.ForChangesWithoutConfirmation(changesToUndo);

            UndoUIOperation undoOperation = new UndoUIOperation(
                mWkInfo, mViewHost,
                new LaunchDependenciesDialog(
                    PlasticLocalization.GetString(PlasticLocalization.Name.UndoButton),
                    mParentWindow),
                mProgressControls, mGuiMessage);

            undoOperation.Undo(
                changesToUndo,
                dependenciesCandidates,
                RefreshAsset.UnityAssetDatabase);
        }
示例#3
0
        void IAssetMenuOperations.Undo()
        {
            List <string> selectedPaths = GetSelectedPaths.ForOperation(
                mAssetSelection,
                mAssetStatusCache,
                AssetMenuOperations.Undo);

            SaveAssets.ForPathsWithoutConfirmation(selectedPaths);

            if (mIsGluonMode)
            {
                GluonUndoCheckoutOperation.UndoCheckout(
                    mWkInfo,
                    mViewHost,
                    mProgressControls,
                    mGuiMessage,
                    selectedPaths.ToArray(),
                    false,
                    RefreshAsset.UnityAssetDatabase);
                return;
            }

            UndoCheckoutOperation.Run(
                mWorkspaceWindow,
                null,
                mProgressControls,
                selectedPaths,
                mNewIncomingChangesUpdater,
                RefreshAsset.UnityAssetDatabase);
        }
示例#4
0
        void UndoChanges(
            List <ChangeInfo> changesToUndo,
            List <ChangeInfo> dependenciesCandidates)
        {
            if (CheckEmptyOperation(changesToUndo, HasPendingMergeLinks()))
            {
                ((IProgressControls)mProgressControls).ShowWarning(
                    PlasticLocalization.GetString(PlasticLocalization.Name.NoItemsToUndo));
                return;
            }

            SaveAssets.ForChangesWithoutConfirmation(changesToUndo);

            mPendingChangesOperations.Undo(
                changesToUndo,
                dependenciesCandidates,
                mPendingMergeLinks.Count,
                RefreshAsset.UnityAssetDatabase);
        }
示例#5
0
        void PartialCheckin(bool keepItemsLocked)
        {
            List <ChangeInfo> changesToCheckin;
            List <ChangeInfo> dependenciesCandidates;

            mPendingChangesTreeView.GetCheckedChanges(
                false,
                out changesToCheckin,
                out dependenciesCandidates);

            if (CheckEmptyOperation(changesToCheckin))
            {
                ((IProgressControls)mProgressControls).ShowWarning(
                    PlasticLocalization.GetString(PlasticLocalization.Name.NoItemsAreSelected));
                return;
            }

            bool isCancelled;

            SaveAssets.ForChangesWithConfirmation(changesToCheckin, out isCancelled);

            if (isCancelled)
            {
                return;
            }

            CheckinUIOperation ciOperation = new CheckinUIOperation(
                mWkInfo, mViewHost, mProgressControls, mGuiMessage,
                new LaunchCheckinConflictsDialog(mParentWindow),
                new LaunchDependenciesDialog(
                    PlasticLocalization.GetString(PlasticLocalization.Name.CheckinButton),
                    mParentWindow),
                this, mWorkspaceWindow.GluonProgressOperationHandler);

            ciOperation.Checkin(
                changesToCheckin,
                dependenciesCandidates,
                CommentText,
                keepItemsLocked,
                RefreshAsset.UnityAssetDatabase);
        }
示例#6
0
        /// <summary>
        /// Create the control file for the archive
        /// </summary>
        /// <param name="options"></param>
        /// <returns></returns>
        public string CreateControlFile(Dictionary <string, object> options)
        {
            int majorVersion, minorVersion;

            if (options.ContainsKey("home"))
            {
                majorVersion = 1;
                minorVersion = 2;
            }
            else
            {
                majorVersion = 0;
                minorVersion = 3;
            }

            m_log.InfoFormat("[INVENTORY ARCHIVER]: Creating version {0}.{1} IAR", majorVersion, minorVersion);

            StringWriter  sw  = new StringWriter();
            XmlTextWriter xtw = new XmlTextWriter(sw);

            xtw.Formatting = Formatting.Indented;
            xtw.WriteStartDocument();
            xtw.WriteStartElement("archive");
            xtw.WriteAttributeString("major_version", majorVersion.ToString());
            xtw.WriteAttributeString("minor_version", minorVersion.ToString());

            xtw.WriteElementString("assets_included", SaveAssets.ToString());

            xtw.WriteEndElement();

            xtw.Flush();
            xtw.Close();

            String s = sw.ToString();

            sw.Close();

            return(s);
        }
示例#7
0
        void OkButtonWithCheckinAction()
        {
            bool isCancelled;

            SaveAssets.ForPaths(mPaths, out isCancelled);

            if (isCancelled)
            {
                return;
            }

            mIsRunningCheckin = true;

            mPaths.AddRange(mMetaCache.GetExistingMeta(mPaths));

            if (mIsGluonMode)
            {
                CheckinDialogOperations.CheckinPathsPartial(
                    mWkInfo,
                    mPaths,
                    mComment,
                    mViewHost,
                    this,
                    mGuiMessage,
                    mProgressControls,
                    mGluonViewSwitcher);
                return;
            }

            CheckinDialogOperations.CheckinPaths(
                mWkInfo,
                mPaths,
                mComment,
                mWorkspaceWindow,
                this,
                mGuiMessage,
                mProgressControls,
                mMergeViewLauncher);
        }
        /// <summary>
        /// Create the control file.
        /// </summary>
        /// <returns></returns>
        public string CreateControlFile(ArchiveScenesGroup scenesGroup)
        {
            int majorVersion;
            int minorVersion;

            if (MultiRegionFormat)
            {
                majorVersion = MAX_MAJOR_VERSION;
                minorVersion = 0;
            }
            else
            {
                // To support older versions of OpenSim, we continue to create single-region OARs
                // using the old file format. In the future this format will be discontinued.
                majorVersion = 0;
                minorVersion = 8;
            }
//
//            if (m_options.ContainsKey("version"))
//            {
//                string[] parts = m_options["version"].ToString().Split('.');
//                if (parts.Length >= 1)
//                {
//                    majorVersion = Int32.Parse(parts[0]);
//
//                    if (parts.Length >= 2)
//                        minorVersion = Int32.Parse(parts[1]);
//                }
//            }
//
//            if (majorVersion < MIN_MAJOR_VERSION || majorVersion > MAX_MAJOR_VERSION)
//            {
//                throw new Exception(
//                    string.Format(
//                        "OAR version number for save must be between {0} and {1}",
//                        MIN_MAJOR_VERSION, MAX_MAJOR_VERSION));
//            }
//            else if (majorVersion == MAX_MAJOR_VERSION)
//            {
//                // Force 1.0
//                minorVersion = 0;
//            }
//            else if (majorVersion == MIN_MAJOR_VERSION)
//            {
//                // Force 0.4
//                minorVersion = 4;
//            }

            m_log.InfoFormat("[ARCHIVER]: Creating version {0}.{1} OAR", majorVersion, minorVersion);
            if (majorVersion == 1)
            {
                m_log.WarnFormat("[ARCHIVER]: Please be aware that version 1.0 OARs are not compatible with OpenSim versions prior to 0.7.4. Do not use the --all option if you want to produce a compatible OAR");
            }

            String s;

            using (StringWriter sw = new StringWriter())
            {
                using (XmlTextWriter xtw = new XmlTextWriter(sw))
                {
                    xtw.Formatting = Formatting.Indented;
                    xtw.WriteStartDocument();
                    xtw.WriteStartElement("archive");
                    xtw.WriteAttributeString("major_version", majorVersion.ToString());
                    xtw.WriteAttributeString("minor_version", minorVersion.ToString());

                    xtw.WriteStartElement("creation_info");
                    DateTime now = DateTime.UtcNow;
                    TimeSpan t   = now - new DateTime(1970, 1, 1);
                    xtw.WriteElementString("datetime", ((int)t.TotalSeconds).ToString());
                    if (!MultiRegionFormat)
                    {
                        xtw.WriteElementString("id", m_rootScene.RegionInfo.RegionID.ToString());
                    }
                    xtw.WriteEndElement();

                    xtw.WriteElementString("assets_included", SaveAssets.ToString());

                    if (MultiRegionFormat)
                    {
                        WriteRegionsManifest(scenesGroup, xtw);
                    }
                    else
                    {
                        xtw.WriteStartElement("region_info");
                        WriteRegionInfo(m_rootScene, xtw);
                        xtw.WriteEndElement();
                    }

                    xtw.WriteEndElement();

                    xtw.Flush();
                }

                s = sw.ToString();
            }

            return(s);
        }
示例#9
0
        /// <summary>
        /// Closes the game and saves any necessary data
        /// </summary>
        public void EndGame()
        {
            SaveAssets?.Invoke();

            Game.Exit();
        }