Beispiel #1
0
        internal static void OpenWorkspaceConfiguration(WorkspaceInfo wkInfo, bool isGluonMode)
        {
            if (ShowDownloadPlasticExeWindow(isGluonMode))
            {
                return;
            }

            mLog.DebugFormat(
                "Opening Workspace Configuration on wkPath '{0}'.",
                wkInfo.ClientPath);

            TrackFeatureUseEvent.For(
                PlasticGui.Plastic.API.GetRepositorySpec(wkInfo),
                TrackFeatureUseEvent.Features.LaunchPartialConfigure);

            Process gluonProcess = ExecuteGUI(
                PlasticInstallPath.GetGluonExePath(),
                string.Format(
                    ToolConstants.Gluon.GUI_WK_CONFIGURATION_ARG,
                    wkInfo.ClientPath),
                ToolConstants.Gluon.GUI_COMMAND_FILE_ARG,
                ToolConstants.Gluon.GUI_COMMAND_FILE,
                mGluonProcessId);

            if (gluonProcess == null)
            {
                return;
            }

            mGluonProcessId = gluonProcess.Id;
        }
        void DoMigrateButton()
        {
            GUI.enabled = !mProgressControls.ProgressData.IsOperationRunning;

            if (NormalButton("Migrate"))
            {
                if (EditorUtility.DisplayDialog(
                        "Collab migration to Plastic SCM",
                        "Are you sure to start the migration process?",
                        PlasticLocalization.GetString(PlasticLocalization.Name.YesButton),
                        PlasticLocalization.GetString(PlasticLocalization.Name.NoButton)))
                {
                    TrackFeatureUseEvent.For(
                        GetEventCloudOrganizationInfo(),
                        TrackFeatureUseEvent.Features.MigrateWorkspace);

                    LaunchMigration(
                        mUnityAccessToken, mProjectPath,
                        mOrganizationName, mRepId,
                        mChangesetId, mBranchId,
                        mAfterWorkspaceMigratedAction,
                        mProgressControls);
                }
                else
                {
                    TrackFeatureUseEvent.For(
                        GetEventCloudOrganizationInfo(),
                        TrackFeatureUseEvent.Features.DoNotMigrateWorkspace);
                }
            }

            GUI.enabled = true;
        }
Beispiel #3
0
        void IDiffTreeViewMenuOperations.SaveRevisionAs()
        {
            TrackFeatureUseEvent.For(
                PlasticGui.Plastic.API.GetRepositorySpec(mWkInfo),
                TrackFeatureUseEvent.Features.SaveRevisionFromDiff);

            ClientDiffInfo clientDiffInfo =
                DiffSelection.GetSelectedDiff(mDiffTreeView);
            RepositorySpec repSpec  = clientDiffInfo.DiffWithMount.Mount.RepSpec;
            RevisionInfo   revision = clientDiffInfo.DiffWithMount.Difference.RevInfo;

            string defaultFileName = DefaultRevisionName.Get(
                Path.GetFileName(clientDiffInfo.DiffWithMount.Difference.Path), revision.Changeset);
            string destinationPath = SaveAction.GetDestinationPath(
                mWkInfo.ClientPath,
                clientDiffInfo.DiffWithMount.Difference.Path,
                defaultFileName);

            if (string.IsNullOrEmpty(destinationPath))
            {
                return;
            }

            SaveRevisionOperation.SaveRevision(
                repSpec,
                destinationPath,
                revision,
                mProgressControls);
        }
Beispiel #4
0
        void IHistoryViewMenuOperations.SaveRevisionAs()
        {
            TrackFeatureUseEvent.For(
                PlasticGui.Plastic.API.GetRepositorySpec(mWkInfo),
                TrackFeatureUseEvent.Features.SaveRevisionFromFileHistory);

            HistoryRevision revision = HistorySelection.
                                       GetSelectedHistoryRevision(mHistoryListView);

            string defaultFileName = DefaultRevisionName.Get(
                Path.GetFileName(mPath), revision.ChangeSet);

            string destinationPath = SaveAction.GetDestinationPath(
                mWkInfo.ClientPath, mPath, defaultFileName);

            if (string.IsNullOrEmpty(destinationPath))
            {
                return;
            }

            SaveRevisionOperation.SaveRevision(
                mRepSpec,
                destinationPath,
                revision,
                mProgressControls);
        }
        void DoCheckInAnywayButton()
        {
            if (!AcceptButton(
                    PlasticLocalization.GetString(
                        PlasticLocalization.Name.CheckinAnyway),
                    30))
            {
                return;
            }

            if (!mSentCheckinAnywayTrackEvent)
            {
                TrackFeatureUseEvent.For(
                    PlasticGui.Plastic.API.GetRepositorySpec(mWkInfo),
                    TrackFeatureUseEvent.Features.PendingChangesCheckinDialogCheckinAnyway);

                mSentCheckinAnywayTrackEvent = true;
            }

            if (UserChoseToNotDisplayWarningAgain && !mSentCheckboxTrackEvent)
            {
                TrackFeatureUseEvent.For(
                    PlasticGui.Plastic.API.GetRepositorySpec(mWkInfo),
                    TrackFeatureUseEvent.Features.PendingChangesCheckinDialogDoNotShowMessageAgain);

                mSentCheckboxTrackEvent = true;
            }

            ApplyButtonAction();
        }
        void DoCloseButton()
        {
            GUI.enabled = !mProgressControls.ProgressData.IsOperationRunning;

            if (NormalButton(PlasticLocalization.GetString(
                                 PlasticLocalization.Name.CloseButton)))
            {
                if (mIsMigrationCompleted)
                {
                    TrackFeatureUseEvent.For(
                        PlasticGui.Plastic.API.GetRepositorySpec(mWorkspaceInfo),
                        TrackFeatureUseEvent.Features.CloseDialogAfterWorkspaceMigration);
                }
                else
                {
                    TrackFeatureUseEvent.For(
                        GetEventCloudOrganizationInfo(),
                        TrackFeatureUseEvent.Features.DoNotMigrateWorkspace);
                }

                CloseButtonAction();
            }

            GUI.enabled = true;
        }
Beispiel #7
0
        void DoCheckinButton()
        {
            GUI.enabled = !string.IsNullOrEmpty(mComment) && !mIsRunningCheckin;

            try
            {
                if (!AcceptButton(PlasticLocalization.GetString(
                                      PlasticLocalization.Name.CheckinButton)))
                {
                    return;
                }
            }
            finally
            {
                if (!mSentCheckinTrackEvent)
                {
                    TrackFeatureUseEvent.For(
                        PlasticGui.Plastic.API.GetRepositorySpec(mWkInfo),
                        TrackFeatureUseEvent.Features.ContextMenuCheckinDialogCheckin);

                    mSentCheckinTrackEvent = true;
                }

                GUI.enabled = true;
            }

            OkButtonWithCheckinAction();
        }
        void CancelButton_Clicked()
        {
            if (!IsExeAvailable.ForMode(mIsGluonMode))
            {
                TrackFeatureUseEvent.For(mRepSpec, mCancelInstallFrom);
            }

            Close();
        }
Beispiel #9
0
 static void OpenBranchListViewAndSendEvent(
     WorkspaceInfo wkInfo,
     ViewSwitcher viewSwitcher)
 {
     viewSwitcher.ShowBranchesView();
     TrackFeatureUseEvent.For(
         PlasticGui.Plastic.API.GetRepositorySpec(wkInfo),
         TrackFeatureUseEvent.Features.OpenBranchesView);
 }
Beispiel #10
0
        internal static void OpenGUIForMode(WorkspaceInfo wkInfo, bool isGluonMode)
        {
            mLog.DebugFormat(
                "Opening GUI on wkPath '{0}'.",
                wkInfo.ClientPath);

            TrackFeatureUseEvent.For(
                Plastic.API.GetRepositorySpec(wkInfo),
                isGluonMode ?
                TrackFeatureUseEvent.Features.LaunchGluonTool :
                TrackFeatureUseEvent.Features.LaunchPlasticTool);

            if (isGluonMode)
            {
                Process gluonProcess = ExecuteGUI(
                    PlasticInstallPath.GetGluonExePath(),
                    string.Format(
                        ToolConstants.Gluon.GUI_WK_EXPLORER_ARG,
                        wkInfo.ClientPath),
                    ToolConstants.Gluon.GUI_COMMAND_FILE_ARG,
                    ToolConstants.Gluon.GUI_COMMAND_FILE,
                    mGluonProcessId);

                if (gluonProcess != null)
                {
                    mGluonProcessId = gluonProcess.Id;
                }

                return;
            }

            if (PlatformIdentifier.IsMac())
            {
                Process plasticProcess = ExecuteGUI(
                    PlasticInstallPath.GetPlasticExePath(),
                    string.Format(
                        ToolConstants.Plastic.GUI_MACOS_WK_EXPLORER_ARG,
                        wkInfo.ClientPath),
                    ToolConstants.Plastic.GUI_MACOS_COMMAND_FILE_ARG,
                    ToolConstants.Plastic.GUI_MACOS_COMMAND_FILE,
                    mPlasticProcessId);

                if (plasticProcess != null)
                {
                    mPlasticProcessId = plasticProcess.Id;
                }

                return;
            }

            ExecuteProcess(
                PlasticInstallPath.GetPlasticExePath(),
                string.Format(
                    ToolConstants.Plastic.GUI_WINDOWS_WK_ARG,
                    wkInfo.ClientPath));
        }
        void DownloadEnterpriseEditionButton_Clicked()
        {
            TrackFeatureUseEvent.For(mRepSpec, mInstallEnterpriseFrom);

            DownloadAndInstallOperation.Run(
                Edition.Enterprise,
                mInstallerFile,
                mProgressControls,
                this);
        }
        void DownloadCloudEditionButton_Clicked()
        {
            TrackFeatureUseEvent.For(mRepSpec, mInstallCloudFrom);

            DownloadAndInstallOperation.Run(
                Edition.Cloud,
                mInstallerFile,
                mProgressControls,
                this);

            EditorApplication.update += CheckForPlasticExe;
        }
Beispiel #13
0
        void IBranchMenuOperations.DeleteBranch()
        {
            RepositorySpec        repSpec          = BranchesSelection.GetSelectedRepository(mBranchesListView);
            List <RepositorySpec> repositories     = BranchesSelection.GetSelectedRepositories(mBranchesListView);
            List <BranchInfo>     branchesToDelete = BranchesSelection.GetSelectedBranches(mBranchesListView);

            mBranchOperations.DeleteBranch(repositories, branchesToDelete, () =>
            {
                TrackFeatureUseEvent.For(
                    repSpec,
                    TrackFeatureUseEvent.Features.DeleteBranch);
            });
        }
Beispiel #14
0
        internal static void OpenBranchExplorer(WorkspaceInfo wkInfo, bool isGluonMode)
        {
            if (ShowDownloadPlasticExeWindow(
                    wkInfo,
                    isGluonMode,
                    TrackFeatureUseEvent.Features.InstallPlasticCloudFromOpenBranchExplorer,
                    TrackFeatureUseEvent.Features.InstallPlasticEnterpriseFromOpenBranchExplorer,
                    TrackFeatureUseEvent.Features.CancelPlasticInstallationFromOpenBranchExplorer))
            {
                return;
            }

            mLog.DebugFormat(
                "Opening Branch Explorer on wkPath '{0}'.",
                wkInfo.ClientPath);

            TrackFeatureUseEvent.For(
                PlasticGui.Plastic.API.GetRepositorySpec(wkInfo),
                TrackFeatureUseEvent.Features.LaunchBranchExplorer);

            if (PlatformIdentifier.IsMac())
            {
                Process plasticProcess = ExecuteGUI(
                    PlasticInstallPath.GetPlasticExePath(),
                    string.Format(
                        ToolConstants.Plastic.GUI_MACOS_BREX_ARG,
                        wkInfo.ClientPath),
                    ToolConstants.Plastic.GUI_MACOS_COMMAND_FILE_ARG,
                    ToolConstants.Plastic.GUI_MACOS_COMMAND_FILE,
                    mPlasticProcessId);

                if (plasticProcess != null)
                {
                    mPlasticProcessId = plasticProcess.Id;
                }

                return;
            }

            Process brexProcess = ExecuteWindowsGUI(
                PlasticInstallPath.GetPlasticExePath(),
                string.Format(
                    ToolConstants.Plastic.GUI_WINDOWS_BREX_ARG,
                    wkInfo.ClientPath),
                mBrexProcessId);

            if (brexProcess != null)
            {
                mBrexProcessId = brexProcess.Id;
            }
        }
        void DoOpenPlasticButton()
        {
            if (!NormalButton("Open Plastic SCM"))
            {
                return;
            }

            TrackFeatureUseEvent.For(
                PlasticGui.Plastic.API.GetRepositorySpec(mWorkspaceInfo),
                TrackFeatureUseEvent.Features.OpenPlasticAfterWorkspaceMigration);

            ((IPlasticDialogCloser)this).CloseDialog();
            ShowWindow.Plastic();
        }
Beispiel #16
0
        void VerifyIfSearchFieldIsRecentlyFocused(SearchField searchField)
        {
            if (searchField.HasFocus() != mIsSearchFieldFocused)
            {
                mIsSearchFieldFocused = !mIsSearchFieldFocused;

                if (mIsSearchFieldFocused)
                {
                    TrackFeatureUseEvent.For(
                        PlasticGui.Plastic.API.GetRepositorySpec(mWkInfo),
                        TrackFeatureUseEvent.Features.ChangesetsViewChangesetsSearchBox);
                }
            }
        }
        void TrackWorkspaceMigrationFinishedFailureEvent(WorkspaceInfo wkInfo)
        {
            if (wkInfo == null)
            {
                TrackFeatureUseEvent.For(
                    GetEventCloudOrganizationInfo(),
                    TrackFeatureUseEvent.Features.WorkspaceMigrationFinishedFailure);
                return;
            }

            TrackFeatureUseEvent.For(
                PlasticGui.Plastic.API.GetRepositorySpec(wkInfo),
                TrackFeatureUseEvent.Features.WorkspaceMigrationFinishedFailure);
        }
Beispiel #18
0
        static void Checkin()
        {
            WorkspaceInfo wkInfo = FindWorkspace.InfoForApplicationPath(
                Application.dataPath,
                PlasticApp.PlasticAPI);

            if (wkInfo != null)
            {
                TrackFeatureUseEvent.For(
                    PlasticGui.Plastic.API.GetRepositorySpec(wkInfo),
                    TrackFeatureUseEvent.Features.ContextMenuCheckinOption);
            }

            ((IAssetMenuOperations)sOperations).Checkin();
        }
Beispiel #19
0
        void UndoForMode(WorkspaceInfo wkInfo, bool isGluonMode)
        {
            TrackFeatureUseEvent.For(
                PlasticGui.Plastic.API.GetRepositorySpec(wkInfo),
                isGluonMode ?
                TrackFeatureUseEvent.Features.PartialUndo :
                TrackFeatureUseEvent.Features.Undo);

            if (isGluonMode)
            {
                PartialUndo();
                return;
            }

            Undo();
        }
Beispiel #20
0
        void CheckinForMode(WorkspaceInfo wkInfo, bool isGluonMode, bool keepItemsLocked)
        {
            TrackFeatureUseEvent.For(
                PlasticGui.Plastic.API.GetRepositorySpec(wkInfo),
                isGluonMode ?
                TrackFeatureUseEvent.Features.PartialCheckin :
                TrackFeatureUseEvent.Features.Checkin);

            if (isGluonMode)
            {
                PartialCheckin(keepItemsLocked);
                return;
            }

            Checkin();
        }
Beispiel #21
0
        void IBranchMenuOperations.SwitchToBranch()
        {
            RepositorySpec repSpec    = BranchesSelection.GetSelectedRepository(mBranchesListView);
            BranchInfo     branchInfo = BranchesSelection.GetSelectedBranch(mBranchesListView);

            mBranchOperations.SwitchToBranch(
                repSpec,
                branchInfo,
                () =>
            {
                TrackFeatureUseEvent.For(
                    repSpec,
                    TrackFeatureUseEvent.Features.SwitchBranch);
                RefreshAsset.UnityAssetDatabase();
            });
        }
Beispiel #22
0
        void IBranchMenuOperations.CreateBranch()
        {
            RepositorySpec repSpec    = BranchesSelection.GetSelectedRepository(mBranchesListView);
            BranchInfo     branchInfo = BranchesSelection.GetSelectedBranch(mBranchesListView);

            BranchCreationData branchCreationData = CreateBranchDialog.CreateBranchFromLastParentBranchChangeset(
                mParentWindow,
                repSpec,
                branchInfo);

            mBranchOperations.CreateBranch(branchCreationData, () =>
            {
                TrackFeatureUseEvent.For(
                    repSpec,
                    TrackFeatureUseEvent.Features.CreateBranch);
            });
        }
Beispiel #23
0
        void IBranchMenuOperations.RenameBranch()
        {
            RepositorySpec repSpec    = BranchesSelection.GetSelectedRepository(mBranchesListView);
            BranchInfo     branchInfo = BranchesSelection.GetSelectedBranch(mBranchesListView);

            BranchRenameData branchRenameData = RenameBranchDialog.GetBranchRenameData(
                repSpec,
                branchInfo,
                mParentWindow);

            mBranchOperations.RenameBranch(branchRenameData, () =>
            {
                TrackFeatureUseEvent.For(
                    repSpec,
                    TrackFeatureUseEvent.Features.RenameBranch);
            });
        }
        void DoCancelButton()
        {
            if (!NormalButton(PlasticLocalization.GetString(
                                  PlasticLocalization.Name.CancelButton)))
            {
                return;
            }

            if (!mSentCancelTrackEvent)
            {
                TrackFeatureUseEvent.For(
                    PlasticGui.Plastic.API.GetRepositorySpec(mWkInfo),
                    TrackFeatureUseEvent.Features.PendingChangesCheckinDialogCancel);

                mSentCancelTrackEvent = true;
            }

            CancelButtonAction();
        }
Beispiel #25
0
        internal static void CheckinForMode(
            WorkspaceInfo wkInfo,
            bool isGluonMode,
            bool keepItemsLocked,
            PlasticGUIClient plasticClient)
        {
            TrackFeatureUseEvent.For(
                Plastic.API.GetRepositorySpec(wkInfo),
                isGluonMode ?
                TrackFeatureUseEvent.Features.PartialCheckin :
                TrackFeatureUseEvent.Features.Checkin);

            if (isGluonMode)
            {
                plasticClient.PartialCheckin(keepItemsLocked);
                return;
            }

            plasticClient.Checkin();
        }
Beispiel #26
0
        void DoSkipMergeTrackingButton(
            List <ClientDiff> diffs,
            bool isSkipMergeTrackingButtonChecked,
            DiffTreeView diffTreeView)
        {
            bool wasChecked = isSkipMergeTrackingButtonChecked;

            GUIContent buttonContent = new GUIContent(
                PlasticLocalization.GetString(
                    PlasticLocalization.Name.SkipDiffMergeTracking));

            GUIStyle buttonStyle = new GUIStyle(EditorStyles.toolbarButton);

            float buttonWidth = buttonStyle.CalcSize(buttonContent).x + 10;

            Rect toggleRect = GUILayoutUtility.GetRect(
                buttonContent, buttonStyle, GUILayout.Width(buttonWidth));

            bool isChecked = GUI.Toggle(
                toggleRect, wasChecked, buttonContent, buttonStyle);

            if (wasChecked == isChecked)
            {
                return;
            }

            // if user just checked the skip merge tracking button
            if (isChecked)
            {
                TrackFeatureUseEvent.For(
                    PlasticGui.Plastic.API.GetRepositorySpec(mWkInfo),
                    TrackFeatureUseEvent.Features.ChangesetViewSkipMergeTrackingButton);
            }

            UpdateDiffTreeView(diffs, isChecked, diffTreeView);

            mIsSkipMergeTrackingButtonChecked = isChecked;
        }
Beispiel #27
0
        static void DoLaunchButtons(
            bool isPlasticExeAvailable,
            WorkspaceInfo wkInfo,
            ViewSwitcher viewSwitcher,
            bool isGluonMode)
        {
            //TODO: Codice - beta: hide the diff button until the behavior is implemented

            /*GUILayout.Button(PlasticLocalization.GetString(
             *  PlasticLocalization.Name.DiffWindowMenuItemDiff),
             *  EditorStyles.toolbarButton,
             *  GUILayout.Width(UnityConstants.REGULAR_BUTTON_WIDTH));*/

            if (viewSwitcher.IsViewSelected(ViewSwitcher.SelectedTab.Changesets))
            {
                viewSwitcher.ChangesetsTab.DrawDateFilter();
            }
            if (viewSwitcher.IsViewSelected(ViewSwitcher.SelectedTab.Branches))
            {
                viewSwitcher.BranchesTab.DrawDateFilter();
            }

            Texture refreshIcon        = Images.GetRefreshIcon();
            string  refreshIconTooltip = PlasticLocalization.GetString(
                PlasticLocalization.Name.RefreshButton);

            if (DrawLaunchButton(refreshIcon, refreshIconTooltip))
            {
                viewSwitcher.RefreshSelectedView();
            }

            if (viewSwitcher.IsViewSelected(ViewSwitcher.SelectedTab.PendingChanges))
            {
                Texture2D icon    = Images.GetImage(Images.Name.IconUndo);
                string    tooltip = PlasticLocalization.GetString(
                    PlasticLocalization.Name.UndoSelectedChanges);

                if (DrawLaunchButton(icon, tooltip))
                {
                    TrackFeatureUseEvent.For(
                        PlasticGui.Plastic.API.GetRepositorySpec(wkInfo),
                        TrackFeatureUseEvent.Features.UndoIconButton);

                    viewSwitcher.PendingChangesTab.UndoForMode(wkInfo, isGluonMode);
                }
            }

            if (isGluonMode)
            {
                string label = PlasticLocalization.GetString(PlasticLocalization.Name.ConfigureGluon);
                if (DrawActionButton.For(label))
                {
                    LaunchTool.OpenWorkspaceConfiguration(wkInfo, isGluonMode);
                }
            }
            else
            {
                Texture2D icon    = Images.GetImage(Images.Name.IconBranch);
                string    tooltip = PlasticLocalization.GetString(PlasticLocalization.Name.Branches);
                if (DrawLaunchButton(icon, tooltip))
                {
                    ShowBranchesContextMenu(
                        wkInfo,
                        viewSwitcher,
                        isGluonMode);
                }
            }

            //TODO: Add settings button tooltip localization
            if (DrawLaunchButton(Images.GetSettingsIcon(), string.Empty))
            {
                ShowSettingsContextMenu(
                    wkInfo,
                    isGluonMode);
            }
        }
Beispiel #28
0
        static void DoLaunchButtons(
            bool isPlasticExeAvailable,
            WorkspaceInfo wkInfo,
            ViewSwitcher viewSwitcher,
            bool isGluonMode)
        {
            //TODO: Codice - beta: hide the diff button until the behavior is implemented

            /*GUILayout.Button(PlasticLocalization.GetString(
             *  PlasticLocalization.Name.DiffWindowMenuItemDiff),
             *  EditorStyles.toolbarButton,
             *  GUILayout.Width(UnityConstants.REGULAR_BUTTON_WIDTH));*/

            if (viewSwitcher.IsViewSelected(ViewSwitcher.SelectedTab.Changesets))
            {
                viewSwitcher.ChangesetsTab.DrawDateFilter();
            }

            var refreshIcon        = Images.GetRefreshIcon();
            var refreshIconTooltip = PlasticLocalization.GetString(
                PlasticLocalization.Name.RefreshButton);

            if (DrawLaunchButton(refreshIcon, refreshIconTooltip))
            {
                viewSwitcher.RefreshSelectedView();
            }

            if (viewSwitcher.IsViewSelected(ViewSwitcher.SelectedTab.PendingChanges))
            {
                var icon    = Images.GetImage(Images.Name.IconUndo);
                var tooltip = PlasticLocalization.GetString(
                    PlasticLocalization.Name.UndoSelectedChanges);

                if (DrawLaunchButton(icon, tooltip))
                {
                    TrackFeatureUseEvent.For(
                        PlasticGui.Plastic.API.GetRepositorySpec(wkInfo),
                        TrackFeatureUseEvent.Features.UndoIconButton);

                    viewSwitcher.PendingChangesTab.UndoForMode(wkInfo, isGluonMode);
                }
            }

            if (isGluonMode)
            {
                var label = PlasticLocalization.GetString(PlasticLocalization.Name.ConfigureGluon);
                if (DrawActionButton.For(label))
                {
                    LaunchTool.OpenWorkspaceConfiguration(wkInfo, isGluonMode);
                }
            }
            else
            {
                var icon    = Images.GetImage(Images.Name.IconBranch);
                var tooltip = PlasticLocalization.GetString(PlasticLocalization.Name.BranchExplorerMenu);
                if (DrawLaunchButton(icon, tooltip))
                {
                    LaunchTool.OpenBranchExplorer(wkInfo, isGluonMode);
                }
            }

            //TODO: Add settings button tooltip localization
            if (DrawLaunchButton(Images.GetSettingsIcon(), string.Empty))
            {
                GenericMenu menu = new GenericMenu();

                string openToolText = isGluonMode ?
                                      PlasticLocalization.GetString(PlasticLocalization.Name.LaunchGluonButton) :
                                      PlasticLocalization.GetString(PlasticLocalization.Name.LaunchPlasticButton);

                menu.AddItem(
                    new GUIContent(openToolText),
                    false,
                    () => LaunchTool.OpenGUIForMode(wkInfo, isGluonMode));

                var plasticWindow = EditorWindow.GetWindow <PlasticWindow>();

                menu.AddItem(
                    new GUIContent(
                        PlasticLocalization.GetString(
                            PlasticLocalization.Name.InviteMembers)),
                    false,
                    InviteMemberButton_clicked,
                    null);

                menu.AddSeparator("");

                menu.AddItem(
                    new GUIContent(
                        PlasticLocalization.GetString(
                            PlasticLocalization.Name.Options)),
                    false,
                    () => PendingChangesOptionsDialog.ChangeOptions(wkInfo, PlasticAssetsProcessor.mPendingChangesTab, plasticWindow));

                // If the user has the simplified UI key of type .txt in the Assets folder
                // TODO: Remove when Simplified UI is complete
                if (AssetDatabase.FindAssets("simplifieduikey t:textasset", new[] { "Assets" }).Any())
                {
                    menu.AddItem(new GUIContent("Try Simplified UI"),
                                 false,
                                 TrySimplifiedUIButton_Clicked,
                                 null);
                }

                //TODO: Localization
                menu.AddItem(
                    new GUIContent(processor.AssetModificationProcessor.ForceCheckout ?
                                   PlasticLocalization.GetString(PlasticLocalization.Name.DisableForcedCheckout) :
                                   PlasticLocalization.GetString(PlasticLocalization.Name.EnableForcedCheckout)),
                    false,
                    ForceCheckout_Clicked,
                    null);

                menu.AddSeparator("");

                menu.AddItem(
                    new GUIContent(
                        PlasticLocalization.GetString(
                            PlasticLocalization.Name.TurnOffPlasticSCM)),
                    false,
                    TurnOffPlasticButton_Clicked,
                    null);

                menu.ShowAsContext();
            }
        }
        void DoOperationsToolbar(
            WorkspaceInfo wkInfo,
            bool isGluonMode,
            GenericMenu advancedDropdownMenu,
            bool isOperationRunning)
        {
            EditorGUILayout.BeginHorizontal();

            using (new GuiEnabled(!isOperationRunning))
            {
                if (mHasPendingCheckinFromPreviousUpdate)
                {
                    mHasPendingCheckinFromPreviousUpdate = false;
                    CheckinChanges(wkInfo, isGluonMode);
                }

                else if (DrawActionButton.ForCommentSection(
                             PlasticLocalization.GetString(
                                 PlasticLocalization.Name.CheckinChanges)))
                {
                    UpdateIsCommentWarningNeeded(CommentText);

                    if (!mIsEmptyCheckinCommentWarningNeeded &&
                        mPendingChanges.HasPendingChanges())
                    {
                        CheckinChanges(wkInfo, isGluonMode);
                    }
                }

                GUILayout.Space(2);

                if (DrawActionButton.ForCommentSection(PlasticLocalization.GetString(
                                                           PlasticLocalization.Name.UndoChanges)))
                {
                    TrackFeatureUseEvent.For(PlasticGui.Plastic.API.GetRepositorySpec(wkInfo),
                                             TrackFeatureUseEvent.Features.UndoTextButton);
                    UndoForMode(wkInfo, isGluonMode);
                }

                if (isGluonMode)
                {
                    mKeepItemsLocked = EditorGUILayout.ToggleLeft(
                        PlasticLocalization.GetString(PlasticLocalization.Name.KeepLocked),
                        mKeepItemsLocked,
                        GUILayout.Width(UnityConstants.EXTRA_LARGE_BUTTON_WIDTH));
                }
                //TODO: Codice - beta: hide the advanced menu until the behavior is implemented

                /*else
                 * {
                 *  var dropDownContent = new GUIContent(string.Empty);
                 *  var dropDownRect = GUILayoutUtility.GetRect(
                 *      dropDownContent, EditorStyles.toolbarDropDown);
                 *
                 *  if (EditorGUI.DropdownButton(dropDownRect, dropDownContent,
                 *          FocusType.Passive, EditorStyles.toolbarDropDown))
                 *      advancedDropdownMenu.DropDown(dropDownRect);
                 * }*/
            }

            EditorGUILayout.EndHorizontal();
        }
        void LaunchMigration(
            string unityAccessToken,
            string projectPath,
            string organizationName,
            RepId repId,
            long changesetId,
            long branchId,
            Action afterWorkspaceMigratedAction,
            ProgressControlsForMigration progressControls)
        {
            string serverName = string.Format(
                "{0}@cloud", organizationName);

            TokenExchangeResponse tokenExchangeResponse = null;

            mWorkspaceInfo = null;

            CreateWorkspaceFromCollab.Progress progress = new CreateWorkspaceFromCollab.Progress();

            BuildProgressSpeedAndRemainingTime.ProgressData progressData =
                new BuildProgressSpeedAndRemainingTime.ProgressData(DateTime.Now);

            IThreadWaiter waiter = ThreadWaiter.GetWaiter(10);

            waiter.Execute(
                /*threadOperationDelegate*/
                delegate
            {
                tokenExchangeResponse = AutoConfig.PlasticCredentials(
                    unityAccessToken,
                    serverName,
                    projectPath);

                if (tokenExchangeResponse.Error != null)
                {
                    return;
                }

                RepositoryInfo repInfo = new BaseCommandsImpl().
                                         GetRepositoryInfo(repId, serverName);

                if (repInfo == null)
                {
                    return;
                }

                repInfo.SetExplicitServer(serverName);

                mWorkspaceInfo = CreateWorkspaceFromCollab.Create(
                    projectPath, repInfo.Name, repInfo,
                    changesetId, branchId,
                    progress);
            },
                /*afterOperationDelegate*/
                delegate
            {
                progressControls.HideProgress();

                if (waiter.Exception != null)
                {
                    DisplayException(progressControls, waiter.Exception);
                    TrackWorkspaceMigrationFinishedFailureEvent(mWorkspaceInfo);
                    return;
                }

                if (tokenExchangeResponse.Error != null)
                {
                    mLog.ErrorFormat(
                        "Unable to get TokenExchangeResponse: {0} [code {1}]",
                        tokenExchangeResponse.Error.Message,
                        tokenExchangeResponse.Error.ErrorCode);
                }

                if (tokenExchangeResponse.Error != null ||
                    mWorkspaceInfo == null)
                {
                    progressControls.ShowError(
                        "Failed to convert your workspace to Plastic SCM");
                    TrackWorkspaceMigrationFinishedFailureEvent(mWorkspaceInfo);
                    return;
                }

                progressControls.ShowSuccess(
                    "Your workspace has been successfully converted to Plastic SCM");

                mIsMigrationCompleted = true;

                TrackFeatureUseEvent.For(
                    PlasticGui.Plastic.API.GetRepositorySpec(mWorkspaceInfo),
                    TrackFeatureUseEvent.Features.WorkspaceMigrationFinishedSuccess);

                afterWorkspaceMigratedAction();
            },
                /*timerTickDelegate*/
                delegate
            {
                UpdateProgress(projectPath, progress, progressControls, progressData);
            });
        }