Example #1
0
        static void DoProcessMergesButton(
            bool isEnabled,
            string processMergesButtonText,
            IViewSwitcher switcher,
            IWorkspaceWindow workspaceWindow,
            GuiMessage.IGuiMessage guiMessage,
            MergeViewLogic mergeViewLogic)
        {
            GUI.enabled = isEnabled;

            if (DrawActionButton.For(processMergesButtonText))
            {
                mergeViewLogic.ProcessMerges(
                    workspaceWindow,
                    switcher,
                    guiMessage,
                    new List <string>(),
                    MergeContributorType.MergeContributors,
                    AfterProcessMerges);
            }

            GUI.enabled = true;
        }
Example #2
0
        static void DoProcessMergesButton(
            bool isEnabled,
            string processMergesButtonText,
            IViewSwitcher switcher,
            PlasticGUIClient plasticClient,
            GuiMessage.IGuiMessage guiMessage,
            MergeViewLogic mergeViewLogic)
        {
            GUI.enabled = isEnabled;

            if (DrawActionButton.For(processMergesButtonText))
            {
                mergeViewLogic.ProcessMerges(
                    plasticClient,
                    switcher,
                    guiMessage,
                    new List <string>(),
                    MergeContributorType.MergeContributors,
                    RefreshAsset.UnityAssetDatabase);
            }

            GUI.enabled = true;
        }
Example #3
0
        static bool TryGetPlasticEditionToDownload(
            GuiMessage.IGuiMessage guiMessage,
            out Edition plasticEdition)
        {
            plasticEdition = Edition.Cloud;

            bool isCloudEdition = /*EditionToken.IsCloudEditionForPath(
                                   * ApplicationLocation.GetAppPath());*/false;

            if (isCloudEdition)
            {
                return(true);
            }

            GuiMessage.GuiMessageResponseButton result = guiMessage.ShowQuestion(
                "Plastic SCM",
                "Which version do you want to install?" + Environment.NewLine + Environment.NewLine +
                "* Cloud Edition is intended for for teams who usually work with a Cloud server." + Environment.NewLine +
                "* Enterprise Edition is the choice for teams who work with on-premise servers",
                "Download Cloud Edition",
                "Download Enterprise Edition",
                "Cancel",
                true);

            if (result == GuiMessage.GuiMessageResponseButton.Third)
            {
                return(false);
            }

            if (result == GuiMessage.GuiMessageResponseButton.First)
            {
                return(true);
            }

            plasticEdition = Edition.Enterprise;
            return(true);
        }
Example #4
0
        static void DoInstallButton(
            ProgressControlsForViews downloadProgress,
            GuiMessage.IGuiMessage guiMessage,
            string installerFile)
        {
            GUI.enabled = !downloadProgress.ProgressData.IsOperationRunning;

            if (GUILayout.Button(PlasticLocalization.GetString(PlasticLocalization.Name.InstallPlasticSCM),
                                 GUILayout.Width(BUTTON_WIDTH)))
            {
                Edition plasticEdition;
                if (TryGetPlasticEditionToDownload(
                        guiMessage, out plasticEdition))
                {
                    DownloadAndInstallOperation.Run(
                        plasticEdition, installerFile,
                        downloadProgress);

                    GUIUtility.ExitGUI();
                }
            }

            GUI.enabled = true;
        }
Example #5
0
        void DoActionButtonsArea(
            bool isStep1Completed,
            bool isStep2Completed,
            bool isGluonMode,
            string installerFile,
            GuiMessage.IGuiMessage guiMessage,
            ProgressControlsForViews downloadProgress,
            ProgressControlsForViews configureProgress)
        {
            GUILayout.BeginHorizontal();

            DoActionButton(
                isStep1Completed,
                isStep2Completed,
                isGluonMode,
                installerFile,
                guiMessage,
                downloadProgress,
                configureProgress);

            GUILayout.FlexibleSpace();

            GUILayout.EndHorizontal();
        }
Example #6
0
        static void DoProcessMergesButton(
            bool isEnabled,
            string processMergesButtonText,
            IViewSwitcher switcher,
            PlasticGUIClient plasticClient,
            GuiMessage.IGuiMessage guiMessage,
            MergeViewLogic mergeViewLogic)
        {
            GUI.enabled = isEnabled;

            if (GUILayout.Button(processMergesButtonText,
                                 EditorStyles.toolbarButton))
            {
                mergeViewLogic.ProcessMerges(
                    plasticClient,
                    switcher,
                    guiMessage,
                    new List <string>(),
                    MergeContributorType.MergeContributors,
                    Refresh.UnityAssetDatabase);
            }

            GUI.enabled = true;
        }
Example #7
0
 internal EditorProgressControls(GuiMessage.IGuiMessage guiMessage)
 {
     mGuiMessage = guiMessage;
 }
Example #8
0
        internal static void CheckinPaths(
            WorkspaceInfo wkInfo,
            List <string> paths,
            string comment,
            IWorkspaceWindow workspaceWindow,
            CheckinDialog dialog,
            GuiMessage.IGuiMessage guiMessage,
            IProgressControls progressControls,
            IMergeViewLauncher mergeViewLauncher)
        {
            BaseCommandsImpl baseCommands = new BaseCommandsImpl();

            progressControls.ShowProgress("Checkin in files");

            IThreadWaiter waiter = ThreadWaiter.GetWaiter(50);

            waiter.Execute(
                /*threadOperationDelegate*/ delegate
            {
                CheckinParams ciParams = new CheckinParams();
                ciParams.paths         = paths.ToArray();
                ciParams.comment       = comment;
                ciParams.time          = DateTime.MinValue;
                ciParams.flags         = CheckinFlags.Recurse | CheckinFlags.ProcessSymlinks;

                baseCommands.CheckIn(ciParams);
            },
                /*afterOperationDelegate*/ delegate
            {
                progressControls.HideProgress();
                ((IPlasticDialogCloser)dialog).CloseDialog();

                if (waiter.Exception is CmClientMergeNeededException ||
                    waiter.Exception is CmClientUpdateMergeNeededException)
                {
                    // we need to explicitly call EditorWindow.Close() to ensure
                    // that the dialog is closed before asking the user
                    dialog.Close();

                    if (!UserWantsToShowIncomingView(guiMessage))
                    {
                        return;
                    }

                    ShowIncomingChanges.FromCheckin(
                        wkInfo,
                        mergeViewLauncher,
                        progressControls);

                    return;
                }

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

                workspaceWindow.RefreshView(ViewType.PendingChangesView);
                workspaceWindow.RefreshView(ViewType.HistoryView);
            });
        }