Example #1
0
        internal HistoryTab(
            WorkspaceInfo wkInfo,
            IWorkspaceWindow workspaceWindow,
            RepositorySpec repSpec,
            NewIncomingChangesUpdater newIncomingChangesUpdater,
            ViewHost viewHost,
            EditorWindow parentWindow,
            bool isGluonMode)
        {
            mWkInfo                    = wkInfo;
            mWorkspaceWindow           = workspaceWindow;
            mRepSpec                   = repSpec;
            mNewIncomingChangesUpdater = newIncomingChangesUpdater;
            mViewHost                  = viewHost;
            mParentWindow              = parentWindow;
            mIsGluonMode               = isGluonMode;

            mGuiMessage = new UnityPlasticGuiMessage(parentWindow);

            BuildComponents(wkInfo, repSpec);

            mProgressControls = new ProgressControlsForViews();

            mHistoryViewLogic = new HistoryViewLogic(
                wkInfo, this, mProgressControls);
        }
Example #2
0
        internal ChangesetsTab(
            WorkspaceInfo wkInfo,
            IWorkspaceWindow workspaceWindow,
            IViewSwitcher viewSwitcher,
            IHistoryViewLauncher historyViewLauncher,
            EditorWindow parentWindow,
            bool isGluonMode)
        {
            mWkInfo       = wkInfo;
            mParentWindow = parentWindow;
            mIsGluonMode  = isGluonMode;

            BuildComponents(
                wkInfo, workspaceWindow, viewSwitcher,
                historyViewLauncher, parentWindow);

            mProgressControls = new ProgressControlsForViews();

            mSplitterState = PlasticSplitterGUILayout.InitSplitterState(
                new float[] { 0.50f, 0.50f },
                new int[] { 100, 100 },
                new int[] { 100000, 100000 }
                );

            ((IRefreshableView)this).Refresh();
        }
Example #3
0
        void DoSetupViewArea(
            bool clientNeedsConfiguration,
            string installerFile,
            GuiMessage.IGuiMessage guiMessage,
            ProgressControlsForViews configureProgress)
        {
            DoTitleLabel();

            GUILayout.Space(STEPS_TOP_MARGIN);

            bool isStep1Completed =
                !clientNeedsConfiguration &&
                !configureProgress.ProgressData.IsOperationRunning;

            DoStepsArea(isStep1Completed, configureProgress.ProgressData);

            GUILayout.Space(BUTTON_MARGIN);

            DoActionButtonsArea(
                isStep1Completed,
                installerFile,
                guiMessage,
                configureProgress);

            DoNotificationArea(configureProgress.ProgressData);
        }
Example #4
0
        internal PendingChangesTab(
            WorkspaceInfo wkInfo,
            PlasticGUIClient plasticClient,
            bool isGluonMode,
            PlasticGui.WorkspaceWindow.PendingChanges.PendingChanges pendingChanges,
            NewIncomingChangesUpdater developerNewIncomingChangesUpdater,
            IHistoryViewLauncher historyViewLauncher,
            IAssetStatusCache assetStatusCache,
            EditorWindow parentWindow)
        {
            mWkInfo        = wkInfo;
            mPlasticClient = plasticClient;
            mIsGluonMode   = isGluonMode;
            mDeveloperNewIncomingChangesUpdater = developerNewIncomingChangesUpdater;
            mPendingChanges      = pendingChanges;
            mHistoryViewLauncher = historyViewLauncher;
            mAssetStatusCache    = assetStatusCache;
            mParentWindow        = parentWindow;

            mNewChangesInWk = NewChangesInWk.Build(
                mWkInfo, new BuildWorkspacekIsRelevantNewChange());

            BuildComponents(plasticClient, parentWindow);

            mProgressControls = new ProgressControlsForViews();

            plasticClient.RegisterPendingChangesGuiControls(
                mProgressControls,
                mPendingChangesTreeView,
                mMergeLinksListView);

            InitIgnoreRulesAndRefreshView(mWkInfo.ClientPath, this);
        }
Example #5
0
        void DoActionsToolbar(
            List <ClientDiff> diffs,
            ProgressControlsForViews progressControls,
            bool isSkipMergeTrackingButtonVisible,
            bool isSkipMergeTrackingButtonChecked,
            SearchField searchField,
            DiffTreeView diffTreeView)
        {
            EditorGUILayout.BeginHorizontal(EditorStyles.toolbar);

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

            GUILayout.FlexibleSpace();

            if (isSkipMergeTrackingButtonVisible)
            {
                DoSkipMergeTrackingButton(
                    diffs,
                    isSkipMergeTrackingButtonChecked,
                    diffTreeView);
            }

            DrawSearchField.For(
                searchField,
                diffTreeView,
                UnityConstants.SEARCH_FIELD_WIDTH);
            VerifyIfSearchFieldIsRecentlyFocused(searchField);

            EditorGUILayout.EndHorizontal();
        }
Example #6
0
        internal ChangesetsTab(
            WorkspaceInfo wkInfo,
            IWorkspaceWindow workspaceWindow,
            IViewSwitcher viewSwitcher,
            IHistoryViewLauncher historyViewLauncher,
            EditorWindow parentWindow,
            bool isGluonMode)
        {
            mWkInfo       = wkInfo;
            mParentWindow = parentWindow;
            mIsGluonMode  = isGluonMode;

            BuildComponents(
                wkInfo, workspaceWindow, viewSwitcher,
                historyViewLauncher, parentWindow);

            mProgressControls = new ProgressControlsForViews();

            mSplitterState = PlasticSplitterGUILayout.InitSplitterState(
                new float[] { 0.50f, 0.50f },
                new int[] { 100, (int)UnityConstants.DIFF_PANEL_MIN_WIDTH },
                new int[] { 100000, 100000 }
                );

            mBorderColor = EditorGUIUtility.isProSkin
                ? (Color) new Color32(35, 35, 35, 255)
                : (Color) new Color32(153, 153, 153, 255);

            ((IRefreshableView)this).Refresh();
        }
Example #7
0
        void DoContentViewArea(
            bool clientNeedsConfiguration,
            bool isCreateWorkspaceButtonClicked,
            string installerFile,
            GuiMessage.IGuiMessage guiMessage,
            ProgressControlsForViews configureProgress)
        {
            GUILayout.BeginVertical();

            GUILayout.Space(TOP_MARGIN);

            if (isCreateWorkspaceButtonClicked)
            {
                GetCreateWorkspaceView().OnGUI();
            }
            else
            {
                DoSetupViewArea(
                    clientNeedsConfiguration,
                    mInstallerFile,
                    mGuiMessage,
                    mConfigureProgress);
            }

            GUILayout.EndVertical();
        }
Example #8
0
        static void DoActionsToolbar(
            IRefreshableView refreshableView,
            ProgressControlsForViews progressControls,
            SearchField searchField,
            HistoryListView listView,
            string viewTitle)
        {
            EditorGUILayout.BeginHorizontal(EditorStyles.toolbar);

            GUILayout.Label(
                viewTitle,
                UnityStyles.HistoryTab.HeaderLabel);

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

            GUILayout.FlexibleSpace();

            DrawSearchField.For(
                searchField,
                listView,
                UnityConstants.SEARCH_FIELD_WIDTH);

            DoRefreshButton(
                refreshableView,
                progressControls.IsOperationRunning());

            EditorGUILayout.EndHorizontal();
        }
Example #9
0
        internal BranchesTab(
            WorkspaceInfo wkInfo,
            IWorkspaceWindow workspaceWindow,
            IViewSwitcher viewSwitcher,
            IMergeViewLauncher mergeViewLauncher,
            IUpdateReport updateReport,
            NewIncomingChangesUpdater developerNewIncomingChangesUpdater,
            EditorWindow parentWindow)
        {
            mWkInfo           = wkInfo;
            mParentWindow     = parentWindow;
            mProgressControls = new ProgressControlsForViews();

            mProgressControls = new ProgressControlsForViews();

            BuildComponents(
                wkInfo,
                workspaceWindow,
                viewSwitcher,
                mergeViewLauncher,
                updateReport,
                developerNewIncomingChangesUpdater,
                parentWindow);

            ((IRefreshableView)this).Refresh();
        }
Example #10
0
        void DoActionsToolbar(
            WorkspaceInfo workspaceInfo,
            bool isGluonMode,
            IRefreshableView refreshableView,
            ProgressControlsForViews progressControls,
            EditorWindow editorWindow)
        {
            EditorGUILayout.BeginHorizontal(EditorStyles.toolbar);

            string checkinHeader = string.Format(
                PlasticLocalization.GetString(PlasticLocalization.Name.CheckinHeader),
                mPendingChangesTreeView.GetSelectedItemCount(),
                mPendingChangesTreeView.GetTotalItemCount());

            GUILayout.Label(checkinHeader, UnityStyles.PendingChangesTab.HeaderLabel);

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

            GUILayout.FlexibleSpace();

            DrawSearchField.For(
                mSearchField,
                mPendingChangesTreeView,
                UnityConstants.SEARCH_FIELD_WIDTH);

            DoRefreshButton(
                refreshableView,
                progressControls.IsOperationRunning());

            EditorGUILayout.EndHorizontal();
        }
        internal static void Run(
            bool isGluonMode,
            ProgressControlsForViews progressControls)
        {
            ((IProgressControls)progressControls).ShowProgress(string.Empty);

            IThreadWaiter waiter = ThreadWaiter.GetWaiter();

            waiter.Execute(
                /*threadOperationDelegate*/ delegate
            {
                Process plasticProcess = LaunchTool.OpenConfigurationForMode(isGluonMode);

                if (plasticProcess != null)
                {
                    plasticProcess.WaitForExit();
                }
            },
                /*afterOperationDelegate*/ delegate
            {
                ((IProgressControls)progressControls).HideProgress();

                if (waiter.Exception == null)
                {
                    return;
                }

                ((IProgressControls)progressControls).ShowError(
                    waiter.Exception.Message);
            });
        }
Example #12
0
        void DoActionButton(
            bool isStep1Completed,
            bool isStep2Completed,
            bool isGluonMode,
            string installerFile,
            GuiMessage.IGuiMessage guiMessage,
            ProgressControlsForViews downloadProgress,
            ProgressControlsForViews configureProgress)
        {
            if (!isStep1Completed)
            {
                DoInstallButton(
                    downloadProgress, guiMessage, installerFile);
                return;
            }

            if (!isStep2Completed)
            {
                DoConfigureButton(
                    isGluonMode, configureProgress);
                return;
            }

            if (GUILayout.Button(PlasticLocalization.GetString(PlasticLocalization.Name.CreateWorkspace),
                                 GUILayout.Width(BUTTON_WIDTH)))
            {
                mIsCreateWorkspaceButtonClicked = true;
            }
        }
Example #13
0
        internal PendingChangesTab(
            WorkspaceInfo wkInfo,
            ViewHost viewHost,
            bool isGluonMode,
            WorkspaceWindow workspaceWindow,
            IViewSwitcher switcher,
            IMergeViewLauncher mergeViewLauncher,
            IHistoryViewLauncher historyViewLauncher,
            PlasticGui.WorkspaceWindow.PendingChanges.PendingChanges pendingChanges,
            NewIncomingChangesUpdater developerNewIncomingChangesUpdater,
            GluonNewIncomingChangesUpdater gluonNewIncomingChangesUpdater,
            IAssetStatusCache assetStatusCache,
            NotificationDrawer notificationDrawer,
            EditorWindow parentWindow)
        {
            mWkInfo              = wkInfo;
            mViewHost            = viewHost;
            mIsGluonMode         = isGluonMode;
            mWorkspaceWindow     = workspaceWindow;
            mHistoryViewLauncher = historyViewLauncher;
            mPendingChanges      = pendingChanges;
            mDeveloperNewIncomingChangesUpdater = developerNewIncomingChangesUpdater;
            mGluonNewIncomingChangesUpdater     = gluonNewIncomingChangesUpdater;
            mAssetStatusCache    = assetStatusCache;
            mNotificationDrawer  = notificationDrawer;
            mParentWindow        = parentWindow;
            mGuiMessage          = new UnityPlasticGuiMessage(parentWindow);
            mMergeViewLauncher   = mergeViewLauncher;
            mCheckedStateManager = new CheckedStateManager();

            mNewChangesInWk = NewChangesInWk.Build(
                mWkInfo,
                new BuildWorkspacekIsRelevantNewChange());

            BuildComponents(isGluonMode, parentWindow);

            mBorderColor = EditorGUIUtility.isProSkin
                ? (Color) new Color32(35, 35, 35, 255)
                : (Color) new Color32(153, 153, 153, 255);

            mProgressControls = new ProgressControlsForViews();

            workspaceWindow.RegisterPendingChangesProgressControls(mProgressControls);

            mPendingChangesOperations = new PendingChangesOperations(
                mWkInfo,
                workspaceWindow,
                switcher,
                mergeViewLauncher,
                this,
                mProgressControls,
                workspaceWindow,
                null,
                null,
                null);

            InitIgnoreRulesAndRefreshView(mWkInfo.ClientPath, this);
        }
Example #14
0
        void DoConfigureButton(ProgressControlsForViews configureProgress)
        {
            bool isAutoLoginRunning = autoLoginState > AutoLogin.State.Running && autoLoginState <= AutoLogin.State.InitializingPlastic;

            GUI.enabled = !(configureProgress.ProgressData.IsOperationRunning || isAutoLoginRunning);

            if (GUILayout.Button(PlasticLocalization.GetString(
                                     PlasticLocalization.Name.LoginOrSignUp),
                                 GUILayout.Width(BUTTON_WIDTH)))
            {
                if (autoLoginState > AutoLogin.State.Off && autoLoginState <= AutoLogin.State.InitializingPlastic)
                {
                    autoLoginState = AutoLogin.State.Running;
                    AutoLogin autoLogin = new AutoLogin();
                    autoLogin.Run();
                    return;
                }

                ((IProgressControls)configureProgress).ShowProgress(string.Empty);

                // Login button defaults to Cloud sign up
                CloudEditionWelcomeWindow.ShowWindow(
                    mPlasticWebRestApi,
                    mCmConnection,
                    this);

                GUIUtility.ExitGUI();
            }

            // If client configuration cannot be determined, keep login button default as Cloud
            // sign in window, but show Enterprise option as well
            if (EditionToken.IsCloudEdition())
            {
                GUILayout.FlexibleSpace();

                var anchorStyle = new GUIStyle(GUI.skin.label);
                anchorStyle.normal.textColor = new Color(0.129f, 0.588f, 0.953f);
                anchorStyle.hover.textColor  = new Color(0.239f, 0.627f, 0.949f);
                anchorStyle.active.textColor = new Color(0.239f, 0.627f, 0.949f);

                if (GUILayout.Button(
                        PlasticLocalization.GetString(
                            PlasticLocalization.Name.NeedEnterprise),
                        anchorStyle,
                        GUILayout.Width(BUTTON_WIDTH),
                        GUILayout.Height(20)))
                {
                    TeamEditionConfigurationWindow.ShowWindow(mPlasticWebRestApi, this);
                }

                GUILayout.Space(BUTTON_MARGIN);
            }

            GUI.enabled = true;
        }
Example #15
0
 void DoActionButtonsArea(
     bool isStep1Completed,
     string installerFile,
     GuiMessage.IGuiMessage guiMessage,
     ProgressControlsForViews configureProgress)
 {
     DoActionButton(
         isStep1Completed,
         installerFile,
         guiMessage,
         configureProgress);
 }
Example #16
0
        internal CreateWorkspaceView(
            EditorWindow parentWindow,
            ICreateWorkspaceListener listener,
            PlasticAPI plasticApi)
        {
            mParentWindow            = parentWindow;
            mCreateWorkspaceListener = listener;
            mProgressControls        = new ProgressControlsForViews();
            mWorkspaceOperations     = new WorkspaceOperations(this, mProgressControls);
            mCreateWorkspaceState    = CreateWorkspaceViewState.BuildForProjectDefaults();

            Initialize(plasticApi);
        }
Example #17
0
        internal void RegisterPendingChangesGuiControls(
            ProgressControlsForViews progressControls,
            PendingChangesTreeView changesTreeView,
            MergeLinksListView mergeLinksListView)
        {
            mProgressControls   = progressControls;
            mChangesTreeView    = changesTreeView;
            mMergeLinksListView = mergeLinksListView;

            mPendingChangesOperations = new PendingChangesOperations(
                mWkInfo, this, mSwitcher, mMergeViewLauncher,
                this, mProgressControls, this, null, null, null);
        }
Example #18
0
        void DoActionsToolbar(
            IRefreshableView refreshableView,
            ProgressControlsForViews progressControls,
            SearchField searchField,
            ChangesetsListView changesetsListView,
            DateFilter dateFilter,
            string changesetsLabelText,
            float showChangesButtonWidth,
            bool wasChangesPanelVisible)
        {
            EditorGUILayout.BeginHorizontal(EditorStyles.toolbar);

            if (!string.IsNullOrEmpty(changesetsLabelText))
            {
                GUILayout.Label(
                    changesetsLabelText,
                    UnityStyles.ChangesetsTab.HeaderLabel);
            }

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

            GUILayout.FlexibleSpace();

            mIsChangesPanelVisible =
                DoShowChangesButton(
                    showChangesButtonWidth,
                    wasChangesPanelVisible);

            GUILayout.Space(2);

            DrawSearchField.For(
                searchField,
                changesetsListView,
                UnityConstants.SEARCH_FIELD_WIDTH);

            DoDateFilter(
                refreshableView,
                dateFilter,
                progressControls.IsOperationRunning());

            DoRefreshButton(
                refreshableView,
                progressControls.IsOperationRunning());

            EditorGUILayout.EndHorizontal();
        }
Example #19
0
        internal IncomingChangesTab(
            WorkspaceInfo wkInfo,
            IWorkspaceWindow workspaceWindow,
            IViewSwitcher switcher,
            NewIncomingChangesUpdater newIncomingChangesUpdater,
            EditorWindow parentWindow)
        {
            mWkInfo                    = wkInfo;
            mWorkspaceWindow           = workspaceWindow;
            mSwitcher                  = switcher;
            mNewIncomingChangesUpdater = newIncomingChangesUpdater;
            mParentWindow              = parentWindow;
            mGuiMessage                = new UnityPlasticGuiMessage();

            BuildComponents(mWkInfo);

            mProgressControls = new ProgressControlsForViews();

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

            PlasticNotifier plasticNotifier = new PlasticNotifier();

            mMergeController = new MergeController(
                mWkInfo,
                null,
                null,
                EnumMergeType.IncomingMerge,
                true,
                plasticNotifier,
                null);

            mMergeViewLogic = new MergeViewLogic(
                mWkInfo,
                EnumMergeType.IncomingMerge,
                true,
                mMergeController,
                plasticNotifier,
                ShowIncomingChangesFrom.NotificationBar,
                null,
                mNewIncomingChangesUpdater,
                null,
                this,
                NewChangesInWk.Build(mWkInfo, new BuildWorkspacekIsRelevantNewChange()),
                mProgressControls,
                null);

            ((IRefreshableView)this).Refresh();
        }
        static void DoActionsToolbar(
            ProgressControlsForViews progressControls)
        {
            EditorGUILayout.BeginHorizontal(EditorStyles.toolbar);

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

            GUILayout.FlexibleSpace();

            EditorGUILayout.EndHorizontal();
        }
Example #21
0
        internal WelcomeView(
            EditorWindow parentWindow,
            CreateWorkspaceView.ICreateWorkspaceListener createWorkspaceListener,
            PlasticAPI plasticApi)
        {
            mParentWindow            = parentWindow;
            mCreateWorkspaceListener = createWorkspaceListener;
            mPlasticApi = plasticApi;

            mGuiMessage        = new UnityPlasticGuiMessage(parentWindow);
            mDownloadProgress  = new ProgressControlsForViews();
            mConfigureProgress = new ProgressControlsForViews();

            mInstallerFile = GetInstallerTmpFileName.ForPlatform();
        }
Example #22
0
        internal DiffPanel(
            WorkspaceInfo wkInfo,
            IWorkspaceWindow workspaceWindow,
            IViewSwitcher viewSwitcher,
            EditorWindow parentWindow)
        {
            mWkInfo          = wkInfo;
            mWorkspaceWindow = workspaceWindow;
            mViewSwitcher    = viewSwitcher;
            mParentWindow    = parentWindow;
            mGuiMessage      = new UnityPlasticGuiMessage(parentWindow);

            BuildComponents();

            mProgressControls = new ProgressControlsForViews();
        }
        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();
        }
Example #24
0
        internal IncomingChangesTab(
            WorkspaceInfo wkInfo,
            IViewSwitcher switcher,
            PlasticGUIClient plasticClient,
            NewIncomingChangesUpdater newIncomingChangesUpdater,
            EditorWindow parentWindow)
        {
            mWkInfo                    = wkInfo;
            mSwitcher                  = switcher;
            mPlasticClient             = plasticClient;
            mNewIncomingChangesUpdater = newIncomingChangesUpdater;
            mParentWindow              = parentWindow;
            mGuiMessage                = new UnityPlasticGuiMessage(parentWindow);

            BuildComponents(mWkInfo);

            mProgressControls = new ProgressControlsForViews();

            PlasticNotifier plasticNotifier = new PlasticNotifier();

            mMergeController = new MergeController(
                mWkInfo,
                null,
                null,
                EnumMergeType.IncomingMerge,
                true,
                plasticNotifier,
                null);

            mMergeViewLogic = new MergeViewLogic(
                mWkInfo,
                EnumMergeType.IncomingMerge,
                true,
                mMergeController,
                plasticNotifier,
                ShowIncomingChangesFrom.NotificationBar,
                null,
                mNewIncomingChangesUpdater,
                null,
                this,
                NewChangesInWk.Build(mWkInfo, new BuildWorkspacekIsRelevantNewChange()),
                mProgressControls,
                null);

            ((IRefreshableView)this).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();
        }
Example #26
0
        void DoActionsToolbar(
            WorkspaceInfo workspaceInfo,
            bool isGluonMode,
            IRefreshableView refreshableView,
            ProgressControlsForViews progressControls,
            EditorWindow editorWindow)
        {
            EditorGUILayout.BeginHorizontal(EditorStyles.toolbar);

            string checkinHeader = string.Format(
                "Checkin {0} of {1} item(s)",
                mPendingChangesTreeView.GetSelectedItemCount(),
                mPendingChangesTreeView.GetTotalItemCount());

            GUILayout.Label(checkinHeader, UnityStyles.PendingChangesTab.HeaderLabel);

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

            GUILayout.FlexibleSpace();

            DrawSearchField.For(
                mSearchField,
                mPendingChangesTreeView,
                UnityConstants.SEARCH_FIELD_WIDTH);

            if (GUILayout.Button(PlasticLocalization.GetString(
                                     PlasticLocalization.Name.Options),
                                 EditorStyles.toolbarButton,
                                 GUILayout.Width(UnityConstants.REGULAR_BUTTON_WIDTH)))
            {
                PendingChangesOptionsDialog.ChangeOptions(
                    workspaceInfo, refreshableView, this, editorWindow);
                GUIUtility.ExitGUI();
            }

            DoRefreshButton(
                refreshableView,
                progressControls.IsOperationRunning());

            EditorGUILayout.EndHorizontal();
        }
Example #27
0
        internal CreateWorkspaceView(
            PlasticWindow parentWindow,
            ICreateWorkspaceListener listener,
            PlasticAPI plasticApi,
            IPlasticWebRestApi plasticWebRestApi,
            string workspacePath)
        {
            mParentWindow            = parentWindow;
            mCreateWorkspaceListener = listener;
            mWorkspacePath           = workspacePath;
            mPlasticWebRestApi       = plasticWebRestApi;

            mProgressControls     = new ProgressControlsForViews();
            mWorkspaceOperations  = new WorkspaceOperations(this, mProgressControls);
            mCreateWorkspaceState = CreateWorkspaceViewState.BuildForProjectDefaults();

            Initialize(plasticApi, plasticWebRestApi);
        }
Example #28
0
        void DoActionsToolbar(
            WorkspaceInfo workspaceInfo,
            bool isGluonMode,
            ProgressControlsForViews progressControls,
            EditorWindow editorWindow)
        {
            EditorGUILayout.BeginHorizontal(EditorStyles.toolbar);

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

            GUILayout.FlexibleSpace();

            EditorGUILayout.EndHorizontal();
        }
Example #29
0
        internal WelcomeView(
            PlasticWindow parentWindow,
            CreateWorkspaceView.ICreateWorkspaceListener createWorkspaceListener,
            PlasticAPI plasticApi,
            CmConnection cmConnection,
            IPlasticWebRestApi plasticWebRestApi)
        {
            mParentWindow            = parentWindow;
            mCreateWorkspaceListener = createWorkspaceListener;
            mPlasticApi        = plasticApi;
            mCmConnection      = cmConnection;
            mPlasticWebRestApi = plasticWebRestApi;

            mGuiMessage        = new UnityPlasticGuiMessage(parentWindow);
            mConfigureProgress = new ProgressControlsForViews();

            mInstallerFile = GetInstallerTmpFileName.ForPlatform();
        }
Example #30
0
        static void DoConfigureButton(
            bool isGluonMode,
            ProgressControlsForViews configureProgress)
        {
            GUI.enabled = !configureProgress.ProgressData.IsOperationRunning;

            if (GUILayout.Button(PlasticLocalization.GetString(PlasticLocalization.Name.LoginOrSignUp),
                                 GUILayout.Width(BUTTON_WIDTH)))
            {
                ConfigurePlasticOperation.Run(
                    isGluonMode,
                    configureProgress);

                GUIUtility.ExitGUI();
            }

            GUI.enabled = true;
        }