static void DoProcessMergesButton(
            bool isEnabled,
            string processMergesButtonText,
            IncomingChangesViewLogic incomingChangesViewLogic,
            IncomingChangesTreeView incomingChangesTreeView,
            Action afterProcessMergesAction)
        {
            GUI.enabled = isEnabled;

            if (DrawActionButton.For(processMergesButtonText))
            {
                List <IncomingChangeInfo> incomingChanges =
                    incomingChangesViewLogic.GetCheckedChanges();

                incomingChangesTreeView.FillWithMeta(incomingChanges);

                if (incomingChanges.Count == 0)
                {
                    return;
                }

                incomingChangesViewLogic.ProcessMergesForItems(
                    incomingChanges,
                    afterProcessMergesAction);
            }

            GUI.enabled = true;
        }
Beispiel #2
0
        static void DoProcessMergesButton(
            bool isEnabled,
            string processMergesButtonText,
            IncomingChangesViewLogic incomingChangesViewLogic,
            IncomingChangesTreeView incomingChangesTreeView)
        {
            GUI.enabled = isEnabled;

            if (GUILayout.Button(processMergesButtonText,
                                 EditorStyles.toolbarButton))
            {
                List <IncomingChangeInfo> incomingChanges =
                    incomingChangesViewLogic.GetCheckedChanges();

                incomingChangesTreeView.FillWithMeta(incomingChanges);

                if (incomingChanges.Count == 0)
                {
                    return;
                }

                incomingChangesViewLogic.ProcessMergesForItems(
                    incomingChanges,
                    Refresh.UnityAssetDatabase);
            }

            GUI.enabled = true;
        }
Beispiel #3
0
        static void DoRefreshButton(
            bool isEnabled,
            IncomingChangesViewLogic incomingChangesViewLogic)
        {
            GUI.enabled = isEnabled;

            if (GUILayout.Button(new GUIContent(
                                     Images.GetRefreshIcon()), EditorStyles.toolbarButton))
            {
                incomingChangesViewLogic.Refresh();
            }

            GUI.enabled = true;
        }
Beispiel #4
0
        void DoCancelMergesButton(
            bool isEnabled,
            IncomingChangesViewLogic incomingChangesViewLogic)
        {
            GUI.enabled = isEnabled;

            if (DrawActionButton.For(PlasticLocalization.GetString(
                                         PlasticLocalization.Name.CancelButton)))
            {
                incomingChangesViewLogic.Cancel();

                mIsCancelMergesButtonEnabled = false;
            }

            GUI.enabled = true;
        }
        internal IncomingChangesTab(
            WorkspaceInfo wkInfo,
            ViewHost viewHost,
            WorkspaceWindow workspaceWindow,
            NewIncomingChangesUpdater newIncomingChangesUpdater,
            CheckIncomingChanges.IUpdateIncomingChanges updateIncomingChanges,
            StatusBar statusBar,
            EditorWindow parentWindow)
        {
            mWkInfo = wkInfo;
            mNewIncomingChangesUpdater = newIncomingChangesUpdater;
            mParentWindow = parentWindow;
            mStatusBar    = statusBar;

            BuildComponents();

            mProgressControls = new ProgressControlsForViews();

            mCooldownClearUpdateSuccessAction = new CooldownWindowDelayer(
                DelayedClearUpdateSuccess,
                UnityConstants.NOTIFICATION_CLEAR_INTERVAL);

            mErrorsSplitterState = PlasticSplitterGUILayout.InitSplitterState(
                new float[] { 0.75f, 0.25f },
                new int[] { 100, 100 },
                new int[] { 100000, 100000 }
                );

            mErrorDetailsSplitterState = PlasticSplitterGUILayout.InitSplitterState(
                new float[] { 0.60f, 0.40f },
                new int[] { 100, 100 },
                new int[] { 100000, 100000 }
                );

            mIncomingChangesViewLogic = new IncomingChangesViewLogic(
                wkInfo, viewHost, this, new UnityPlasticGuiMessage(parentWindow),
                mProgressControls, updateIncomingChanges,
                workspaceWindow.GluonProgressOperationHandler, workspaceWindow,
                new IncomingChangesViewLogic.ApplyWorkspaceLocalChanges(),
                new IncomingChangesViewLogic.OutOfDateItemsOperations(),
                new IncomingChangesViewLogic.ResolveUserName(),
                new IncomingChangesViewLogic.GetWorkingBranch(),
                NewChangesInWk.Build(wkInfo, new BuildWorkspacekIsRelevantNewChange()),
                null);

            mIncomingChangesViewLogic.Refresh();
        }
        void DoActionsToolbar(
            bool isProcessMergesButtonVisible,
            bool isCancelMergesButtonVisible,
            bool isProcessMergesButtonEnabled,
            bool isCancelMergesButtonEnabled,
            string processMergesButtonText,
            IncomingChangesViewLogic incomingChangesViewLogic,
            IncomingChangesTreeView incomingChangesTreeView,
            ProgressControlsForViews progressControls)
        {
            GUIStyle guiStyle = new GUIStyle();

            guiStyle.margin = new RectOffset(5, 5, 5, 5);

            EditorGUILayout.BeginHorizontal(guiStyle);

            if (isProcessMergesButtonVisible)
            {
                DoProcessMergesButton(
                    isProcessMergesButtonEnabled,
                    processMergesButtonText,
                    incomingChangesViewLogic,
                    incomingChangesTreeView);
            }

            if (isCancelMergesButtonVisible)
            {
                DoCancelMergesButton(
                    isCancelMergesButtonEnabled,
                    incomingChangesViewLogic);
            }

            if (progressControls.IsOperationRunning())
            {
                DrawProgressForViews.ForIndeterminateProgress(
                    progressControls.ProgressData);
            }

            GUILayout.FlexibleSpace();

            DoRefreshButton(
                !progressControls.IsOperationRunning(),
                incomingChangesViewLogic);

            EditorGUILayout.EndHorizontal();
        }
Beispiel #7
0
        void DoCancelMergesButton(
            bool isEnabled,
            IncomingChangesViewLogic incomingChangesViewLogic)
        {
            GUI.enabled = isEnabled;

            if (GUILayout.Button(PlasticLocalization.GetString(
                                     PlasticLocalization.Name.CancelButton),
                                 EditorStyles.toolbarButton,
                                 GUILayout.Width(UnityConstants.REGULAR_BUTTON_WIDTH)))
            {
                incomingChangesViewLogic.Cancel();

                mIsCancelMergesButtonEnabled = false;
            }

            GUI.enabled = true;
        }
Beispiel #8
0
        internal IncomingChangesTab(
            WorkspaceInfo wkInfo,
            ViewHost viewHost,
            PlasticGUIClient plasticClient,
            NewIncomingChangesUpdater newIncomingChangesUpdater,
            CheckIncomingChanges.IUpdateIncomingChanges updateIncomingChanges,
            EditorWindow parentWindow)
        {
            mWkInfo                    = wkInfo;
            mPlasticClient             = plasticClient;
            mNewIncomingChangesUpdater = newIncomingChangesUpdater;
            mParentWindow              = parentWindow;

            BuildComponents();

            mProgressControls = new ProgressControlsForViews();

            mErrorsSplitterState = SplitterGUILayout.InitSplitterState(
                new float[] { 0.75f, 0.25f },
                new int[] { 100, 100 },
                new int[] { 100000, 100000 }
                );

            mErrorDetailsSplitterState = SplitterGUILayout.InitSplitterState(
                new float[] { 0.60f, 0.40f },
                new int[] { 100, 100 },
                new int[] { 100000, 100000 }
                );

            mIncomingChangesViewLogic = new IncomingChangesViewLogic(
                wkInfo, viewHost, this, new UnityPlasticGuiMessage(parentWindow),
                mProgressControls, updateIncomingChanges,
                plasticClient.GluonProgressOperationHandler, plasticClient,
                new IncomingChangesViewLogic.ApplyWorkspaceLocalChanges(),
                new IncomingChangesViewLogic.OutOfDateItemsOperations(),
                new IncomingChangesViewLogic.ResolveUserName(),
                new IncomingChangesViewLogic.GetWorkingBranch(),
                NewChangesInWk.Build(wkInfo, new BuildWorkspacekIsRelevantNewChange()),
                null);

            mIncomingChangesViewLogic.Refresh();
        }
        static bool DoCancelMergesButton(
            bool isEnabled,
            IncomingChangesViewLogic incomingChangesViewLogic)
        {
            bool shouldCancelMergesButtonEnabled = true;

            GUI.enabled = isEnabled;

            if (DrawActionButton.For(PlasticLocalization.GetString(
                                         PlasticLocalization.Name.CancelButton)))
            {
                incomingChangesViewLogic.Cancel();

                shouldCancelMergesButtonEnabled = false;
            }

            GUI.enabled = true;

            return(shouldCancelMergesButtonEnabled);
        }