Exemplo n.º 1
0
        static void SwitchGuiModeIfUserWants(
            PlasticGUIClient plasticClient,
            GuiMode currentMode, GuiMode selectedMode,
            TreeView changesTreeView,
            EditorWindow editorWindow)
        {
            if (currentMode == selectedMode)
            {
                return;
            }

            bool userConfirmed = SwitchModeConfirmationDialog.SwitchMode(
                currentMode == GuiMode.GluonMode, editorWindow);

            if (!userConfirmed)
            {
                return;
            }

            bool isGluonMode = selectedMode == GuiMode.GluonMode;

            LaunchOperation.UpdateWorkspaceForMode(
                isGluonMode, plasticClient);

            PendingChangesTreeHeaderState.SetMode(
                changesTreeView.multiColumnHeader.state,
                isGluonMode);
        }
Exemplo n.º 2
0
        static void DoOperationsToolbar(
            PlasticGUIClient plasticClient,
            WorkspaceInfo wkInfo,
            bool isGluonMode,
            GenericMenu advancedDropdownMenu,
            bool isOperationRunning)
        {
            EditorGUILayout.BeginHorizontal(EditorStyles.toolbar);

            GUISpace.ForToolbar();

            using (new GuiEnabled(!isOperationRunning))
            {
                using (new GuiEnabled(!plasticClient.IsCommentWarningNeeded))
                {
                    if (DrawActionButton.For("Checkin changes"))
                    {
                        LaunchOperation.CheckinForMode(
                            wkInfo, isGluonMode, plasticClient.KeepItemsLocked,
                            plasticClient);
                    }
                }

                if (DrawActionButton.For("Undo changes"))
                {
                    LaunchOperation.UndoForMode(isGluonMode, plasticClient);
                }

                if (isGluonMode)
                {
                    plasticClient.KeepItemsLocked = EditorGUILayout.ToggleLeft(
                        PlasticLocalization.GetString(PlasticLocalization.Name.KeepLocked),
                        plasticClient.KeepItemsLocked,
                        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);
                 * }*/
            }

            if (plasticClient.IsCommentWarningNeeded)
            {
                GUILayout.Space(5);
                DoCheckinWarningMessage();
            }

            GUILayout.FlexibleSpace();

            EditorGUILayout.EndHorizontal();
        }
Exemplo n.º 3
0
        void IPendingChangesMenuOperations.UndoChanges()
        {
            List <ChangeInfo> changesToUndo = PendingChangesSelection
                                              .GetSelectedChanges(mPendingChangesTreeView);

            List <ChangeInfo> dependenciesCandidates =
                mPendingChangesTreeView.GetDependenciesCandidates(changesToUndo, true);

            LaunchOperation.UndoChangesForMode(
                mIsGluonMode, mPlasticClient, changesToUndo, dependenciesCandidates);
        }
Exemplo n.º 4
0
 private void Grid_Loaded(object sender, RoutedEventArgs e)
 {
     DataContext = new LaunchOperation();
     grMain.BindingGroup.BeginEdit();
 }