Пример #1
0
        public static Task ChangeSetMove(AssetList assets, string changesetID)
        {
            ChangeSet target = new ChangeSet("", changesetID);

            return(Provider.Internal_ChangeSetMove(assets.ToArray(), target));
        }
Пример #2
0
 static public Task ChangeSetMove(AssetList assets, ChangeSet changeset)
 {
     return(Internal_ChangeSetMove(assets.ToArray(), changeset));
 }
Пример #3
0
 static public bool CheckoutIsValid(AssetList assets)
 {
     return(CheckoutIsValid(assets, CheckoutMode.Exact));
 }
Пример #4
0
 static public Task Revert(AssetList assets, RevertMode mode)
 {
     return(Internal_Revert(assets.ToArray(), mode));
 }
Пример #5
0
 static public Task GetLatest(AssetList assets)
 {
     return(Internal_GetLatest(assets.ToArray()));
 }
Пример #6
0
 static public bool UnlockIsValid(AssetList assets)
 {
     return(Internal_UnlockIsValid(assets.ToArray()));
 }
Пример #7
0
 static public Task Status(AssetList assets, bool recursively)
 {
     return(Internal_Status(assets.ToArray(), recursively));
 }
Пример #8
0
 static public Task Checkout(AssetList assets, CheckoutMode mode)
 {
     return(Checkout(assets, mode, null));
 }
Пример #9
0
 static public Task Checkout(AssetList assets, CheckoutMode mode, ChangeSet changeset)
 {
     return(CheckCallbackAndCheckout(assets, mode, changeset));
 }
Пример #10
0
        private void OnSubmitGUI()
        {
            if (this.submitResultCode != 0x100)
            {
                GUI.enabled = false;
            }
            Event current = Event.current;

            if (current.isKey && (current.keyCode == KeyCode.Escape))
            {
                base.Close();
            }
            GUILayout.Label("Description", EditorStyles.boldLabel, new GUILayoutOption[0]);
            if ((this.taskStatus != null) && (this.taskStatus.resultCode != 0))
            {
                Asset.States[] states = new Asset.States[] { Asset.States.CheckedOutLocal, Asset.States.DeletedLocal, Asset.States.AddedLocal };
                this.assetList = this.taskStatus.assetList.Filter(true, states);
                this.RefreshList();
                this.taskStatus = null;
            }
            else if ((this.taskDesc != null) && (this.taskDesc.resultCode != 0))
            {
                this.description = (this.taskDesc.text.Length <= 0) ? string.Empty : this.taskDesc.text;
                if (this.description.Trim() == "<enter description here>")
                {
                    this.description = string.Empty;
                }
                this.taskDesc = null;
            }
            else if ((this.taskStat != null) && (this.taskStat.resultCode != 0))
            {
                this.assetList = this.taskStat.assetList;
                this.RefreshList();
                this.taskStat = null;
            }
            Task task = ((this.taskStatus == null) || (this.taskStatus.resultCode != 0)) ? (((this.taskDesc == null) || (this.taskDesc.resultCode != 0)) ? (((this.taskStat == null) || (this.taskStat.resultCode != 0)) ? this.taskSubmit : this.taskStat) : this.taskDesc) : this.taskStatus;

            GUI.enabled = ((this.taskDesc == null) || (this.taskDesc.resultCode != 0)) && (this.submitResultCode == 0x100);
            GUILayoutOption[] options = new GUILayoutOption[] { GUILayout.Height(150f) };
            this.description = EditorGUILayout.TextArea(this.description, options).Trim();
            if (this.m_TextAreaControlID == 0)
            {
                this.m_TextAreaControlID = EditorGUIUtility.s_LastControlID;
            }
            if (this.m_TextAreaControlID != 0)
            {
                GUIUtility.keyboardControl        = this.m_TextAreaControlID;
                EditorGUIUtility.editingTextField = true;
            }
            GUI.enabled = true;
            GUILayout.Label("Files", EditorStyles.boldLabel, new GUILayoutOption[0]);
            GUILayout.FlexibleSpace();
            Rect screenRect = new Rect(6f, 206f, base.position.width - 12f, base.position.height - 248f);

            GUILayout.BeginArea(screenRect);
            GUILayoutOption[] optionArray2 = new GUILayoutOption[] { GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(true) };
            GUILayout.Box(string.Empty, optionArray2);
            GUILayout.EndArea();
            this.submitList.OnGUI(new Rect(screenRect.x + 2f, screenRect.y + 2f, screenRect.width - 4f, screenRect.height - 4f), true);
            GUILayout.FlexibleSpace();
            GUILayout.BeginHorizontal(new GUILayoutOption[0]);
            if (this.submitResultCode == 0x100)
            {
                if (task != null)
                {
                    GUIContent content = GUIContent.Temp("Getting info");
                    content.image = WindowPending.StatusWheel.image;
                    GUILayout.Label(content, new GUILayoutOption[0]);
                    content.image = null;
                }
                GUILayout.FlexibleSpace();
                if (GUILayout.Button("Cancel", new GUILayoutOption[0]))
                {
                    this.ResetAndClose();
                }
                GUI.enabled = (task == null) && !string.IsNullOrEmpty(this.description);
                bool flag3 = (current.isKey && current.shift) && (current.keyCode == KeyCode.Return);
                bool flag4 = flag3 && !this.allowSubmit;
                if (Provider.hasChangelistSupport && (GUILayout.Button("Save", new GUILayoutOption[0]) || flag4))
                {
                    this.Save(false);
                }
                if (this.allowSubmit)
                {
                    bool enabled = GUI.enabled;
                    GUI.enabled = ((this.assetList != null) && (this.assetList.Count > 0)) && !string.IsNullOrEmpty(this.description);
                    if (GUILayout.Button("Submit", new GUILayoutOption[0]) || flag3)
                    {
                        this.Save(true);
                    }
                    GUI.enabled = enabled;
                }
            }
            else
            {
                bool flag6 = (this.submitResultCode & 1) != 0;
                GUI.enabled = flag6;
                string text = string.Empty;
                if (flag6)
                {
                    text = "Finished successfully";
                }
                else if (task != null)
                {
                    GUILayout.Label(WindowPending.StatusWheel, new GUILayoutOption[0]);
                    text = task.progressMessage;
                    if (text.Length == 0)
                    {
                        text = "Running...";
                    }
                }
                GUILayout.Label(text, new GUILayoutOption[0]);
                GUILayout.FlexibleSpace();
                if (GUILayout.Button("Close", new GUILayoutOption[0]))
                {
                    this.ResetAndClose();
                }
            }
            GUI.enabled = true;
            GUILayout.EndHorizontal();
            GUILayout.Space(12f);
            if (task != null)
            {
                base.Repaint();
            }
        }
Пример #11
0
 public static void Open(AssetList list, bool submit)
 {
     Open(null, list, submit);
 }
Пример #12
0
 private void DoOpen(AssetList revert)
 {
     this.assetList = revert;
     this.RefreshList();
 }
Пример #13
0
 public AssetList(AssetList src)
 {
 }
        void OnSubmitGUI()
        {
            bool isSubmitting = submitResultCode != kSubmitNotStartedResultCode;

            if (isSubmitting)
            {
                GUI.enabled = false;
            }

            Event evt = Event.current;

            if (evt.isKey && evt.keyCode == KeyCode.Escape)
            {
                Close();
            }

            GUILayout.Label("Description", EditorStyles.boldLabel);

            if (taskStatus != null && taskStatus.resultCode != 0)
            {
                const bool includeFolders = true;
                assetList = taskStatus.assetList.Filter(includeFolders,
                                                        Asset.States.CheckedOutLocal,
                                                        Asset.States.DeletedLocal,
                                                        Asset.States.AddedLocal /*,
                                                                                 * Asset.States.Branch,
                                                                                 * Asset.States.Integrate*/);
                RefreshList();
                taskStatus = null;
            }
            else if (taskDesc != null && taskDesc.resultCode != 0)
            {
                description = taskDesc.text.Length > 0 ? taskDesc.text : c_defaultDescription;
                if (description.Trim() == "<enter description here>")
                {
                    description = string.Empty;
                }
                taskDesc = null;
            }
            else if (taskStat != null && taskStat.resultCode != 0)
            {
                assetList = taskStat.assetList;
                RefreshList();
                taskStat = null;
            }

            Task progressTask = taskStatus != null && taskStatus.resultCode == 0 ? taskStatus :
                                taskDesc != null && taskDesc.resultCode == 0 ? taskDesc :
                                taskStat != null && taskStat.resultCode == 0 ? taskStat : taskSubmit;

            GUI.enabled = (taskDesc == null || taskDesc.resultCode != 0) && submitResultCode == kSubmitNotStartedResultCode;
            {
                description = EditorGUILayout.TextArea(description, GUILayout.Height(150)).Trim();
                if (m_TextAreaControlID == 0)
                {
                    m_TextAreaControlID = EditorGUIUtility.s_LastControlID;
                }
                if (m_TextAreaControlID != 0)
                {
                    EditorGUIUtility.keyboardControl  = m_TextAreaControlID;
                    EditorGUIUtility.editingTextField = true;
                }
            }
            GUI.enabled = true;

            GUILayout.Label("Files", EditorStyles.boldLabel);
            GUILayout.FlexibleSpace();

            // I would use GUIUtility.GetLastRect() here after the box but that seems to have wierd side effects.
            Rect r1 = new Rect(6, 206, position.width - 12, position.height - 248);

            GUILayout.BeginArea(r1);
            GUILayout.Box("", GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(true));
            GUILayout.EndArea();
            submitList.OnGUI(new Rect(r1.x + 2, r1.y + 2, r1.width - 4, r1.height - 4), true);

            GUILayout.FlexibleSpace();
            GUILayout.BeginHorizontal();


            if (submitResultCode == kSubmitNotStartedResultCode)
            {
                if (progressTask != null)
                {
                    // It is possible to have a progressTask for getting description text.
                    GUIContent c = GUIContent.Temp("Getting info");
                    c.image = WindowPending.StatusWheel.image;
                    GUILayout.Label(c);
                    c.image = null;
                }

                GUILayout.FlexibleSpace();

                if (GUILayout.Button("Cancel"))
                {
                    ResetAndClose();
                }

                GUI.enabled = progressTask == null && !string.IsNullOrEmpty(description);

                bool keyboardShortcutActivated = evt.isKey && evt.shift && evt.keyCode == KeyCode.Return;
                bool saveByShortcut            = keyboardShortcutActivated && !allowSubmit;

                if (Provider.hasChangelistSupport && (GUILayout.Button("Save") || saveByShortcut))
                {
                    Save(false);
                }

                if (allowSubmit)
                {
                    bool origEnabled = GUI.enabled;
                    GUI.enabled = assetList != null && assetList.Count > 0 && !string.IsNullOrEmpty(description);

                    if (GUILayout.Button("Submit") || keyboardShortcutActivated)
                    {
                        Save(true);
                    }

                    GUI.enabled = origEnabled;
                }
            }
            else
            {
                // submit finished successfully or running

                bool finished = (submitResultCode & (int)SubmitResult.OK) != 0;
                GUI.enabled = finished;

                string msg = "";
                if (finished)
                {
                    msg = "Finished successfully";
                }
                else if (progressTask != null)
                {
                    GUILayout.Label(WindowPending.StatusWheel);
                    msg = progressTask.progressMessage;
                    if (msg.Length == 0)
                    {
                        msg = "Running...";
                    }
                }

                GUILayout.Label(msg);
                GUILayout.FlexibleSpace();
                if (GUILayout.Button("Close"))
                {
                    ResetAndClose();
                }
            }

            GUI.enabled = true;

            GUILayout.EndHorizontal();
            GUILayout.Space(12);

            if (progressTask != null)
            {
                Repaint();
            }
        }
Пример #15
0
 static public Task Resolve(AssetList assets, ResolveMethod resolveMethod)
 {
     return(Internal_Resolve(assets.ToArray(), resolveMethod));
 }
Пример #16
0
 static public Task Delete(AssetList assets)
 {
     return(Internal_Delete(assets.ToArray()));
 }
Пример #17
0
 static public Task Merge(AssetList assets, MergeMethod method)
 {
     return(Internal_Merge(assets.ToArray(), method));
 }
Пример #18
0
 static public Task Add(AssetList assets, bool recursive)
 {
     return(Internal_Add(assets.ToArray(), recursive));
 }
Пример #19
0
 static public Task Lock(AssetList assets, bool locked)
 {
     return(Internal_Lock(assets.ToArray(), locked));
 }
Пример #20
0
 static public bool SubmitIsValid(ChangeSet changeset, AssetList assets)
 {
     return(Internal_SubmitIsValid(changeset, assets != null ? assets.ToArray() : null));
 }
Пример #21
0
 static public bool RevertIsValid(AssetList assets, RevertMode mode)
 {
     return(Internal_RevertIsValid(assets.ToArray(), mode));
 }
Пример #22
0
 static public Task Status(AssetList assets)
 {
     return(Internal_Status(assets.ToArray(), true));
 }
Пример #23
0
 static public bool GetLatestIsValid(AssetList assets)
 {
     return(Internal_GetLatestIsValid(assets.ToArray()));
 }
Пример #24
0
 static public bool DiffIsValid(AssetList assets)
 {
     return(Internal_DiffIsValid(assets.ToArray()));
 }
Пример #25
0
 static internal Task SetFileMode(AssetList assets, FileMode mode)
 {
     return(Internal_SetFileMode(assets.ToArray(), mode));
 }
Пример #26
0
 static public Task DiffHead(AssetList assets, bool includingMetaFiles)
 {
     return(Internal_DiffHead(assets.ToArray(), includingMetaFiles));
 }
Пример #27
0
        static public Task ChangeSetMove(AssetList assets, string changesetID)
        {
            ChangeSet cl = new ChangeSet("", changesetID);

            return(Internal_ChangeSetMove(assets.ToArray(), cl));
        }
Пример #28
0
 static public bool ResolveIsValid(AssetList assets)
 {
     return(Internal_ResolveIsValid(assets.ToArray()));
 }
Пример #29
0
 static public bool CheckoutIsValid(AssetList assets, CheckoutMode mode)
 {
     return(Internal_CheckoutIsValid(assets.ToArray(), mode));
 }
Пример #30
0
 internal static Task SetFileMode(AssetList assets, FileMode mode)
 {
     return(Provider.Internal_SetFileMode(assets.ToArray(), mode));
 }