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, isGluonMode, parentWindow); mProgressControls = new ProgressControlsForViews(); plasticClient.RegisterPendingChangesGuiControls( mProgressControls, mPendingChangesTreeView, mMergeLinksListView); InitIgnoreRulesAndRefreshView(mWkInfo.ClientPath, this); }
internal static void For( PlasticGUIClient plasticClient, float width, bool isOperationRunning) { using (new GuiEnabled(!isOperationRunning)) { EditorGUILayout.BeginHorizontal(); Rect textAreaRect = BuildTextAreaRect( plasticClient.CommentText, width); EditorGUI.BeginChangeCheck(); plasticClient.CommentText = DoTextArea( plasticClient.CommentText ?? string.Empty, plasticClient.ForceToShowComment, textAreaRect); plasticClient.ForceToShowComment = false; if (EditorGUI.EndChangeCheck()) { OnTextAreaChanged(plasticClient, plasticClient.CommentText); } if (string.IsNullOrEmpty(plasticClient.CommentText)) { DoPlaceholderIfNeeded(PlasticLocalization.GetString( PlasticLocalization.Name.CheckinComment), textAreaRect); } EditorGUILayout.EndHorizontal(); } }
void BuildComponents( PlasticGUIClient plasticClient, bool isGluonMode, EditorWindow plasticWindow) { mHelpPanel = new HelpPanel(plasticWindow); mAdvancedDropdownMenu = new GenericMenu(); mAdvancedDropdownMenu.AddItem(new GUIContent( PlasticLocalization.GetString(PlasticLocalization.Name.UndoUnchangedButton)), false, () => { }); mSearchField = new SearchField(); mSearchField.downOrUpArrowKeyPressed += SearchField_OnDownOrUpArrowKeyPressed; PendingChangesTreeHeaderState headerState = PendingChangesTreeHeaderState.GetDefault(isGluonMode); TreeHeaderSettings.Load(headerState, UnityConstants.PENDING_CHANGES_TABLE_SETTINGS_NAME, (int)PendingChangesTreeColumn.Item, true); mPendingChangesTreeView = new PendingChangesTreeView( mWkInfo, mIsGluonMode, headerState, PendingChangesTreeHeaderState.GetColumnNames(), new PendingChangesViewMenu(this, this, this, this), mAssetStatusCache); mPendingChangesTreeView.Reload(); mMergeLinksListView = new MergeLinksListView(); mMergeLinksListView.Reload(); }
internal static void For( PlasticGUIClient plasticClient, OperationProgressData operationProgressData, float width) { EditorGUILayout.BeginVertical( EditorStyles.helpBox, GUILayout.Height(60)); GUILayout.Label( operationProgressData.ProgressHeader ?? string.Empty, EditorStyles.miniLabel); DoProgressBar( operationProgressData.TotalProgressMessage, (float)operationProgressData.TotalProgressPercent, operationProgressData.CanCancelProgress, width); if (operationProgressData.CanCancelProgress) { DoCancelButton(plasticClient); } if (operationProgressData.ShowCurrentBlock) { GUILayout.Space(6); DoProgressBar( operationProgressData.CurrentBlockProgressMessage, (float)operationProgressData.CurrentBlockProgressPercent, operationProgressData.CanCancelProgress, width); } EditorGUILayout.EndVertical(); }
static void DoIncomingChangesArea( PlasticGUIClient plasticClient, IncomingChangesTreeView incomingChangesTreeView, PendingConflictsLabelData pendingConflictsLabelData, string changesToApplySummaryLabelText, string messageLabelText, bool isMessageLabelVisible, bool isOperationRunning) { EditorGUILayout.BeginVertical(); DoPendingConflictsAndChangesToApplyLabel( pendingConflictsLabelData, changesToApplySummaryLabelText); DoIncomingChangesTreeViewArea( incomingChangesTreeView, isOperationRunning); if (isMessageLabelVisible) { DoInfoMessageArea(messageLabelText); } EditorGUILayout.EndVertical(); }
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(); }
internal UpdateProgress( UpdateNotifier notifier, string wkPath, string title, PlasticGUIClient guiClient) { mNotifier = notifier; mWkPath = wkPath; mGuiClient = guiClient; mGuiClient.Progress.ProgressHeader = title; mGuiClient.Progress.CanCancelProgress = false; }
internal static void UpdateWorkspaceForMode( bool isGluonMode, PlasticGUIClient plasticClient) { if (isGluonMode) { plasticClient.PartialUpdateWorkspace(); return; } plasticClient.UpdateWorkspace(); }
internal static void UndoForMode( bool isGluonMode, PlasticGUIClient plasticClient) { if (isGluonMode) { plasticClient.PartialUndo(); return; } plasticClient.Undo(); }
void DoActionsToolbar( bool isProcessMergesButtonVisible, bool isCancelMergesButtonVisible, bool isProcessMergesButtonEnabled, bool isCancelMergesButtonEnabled, string processMergesButtonText, bool hasPendingDirectoryConflictsCount, bool isOperationRunning, PlasticGUIClient plasticClient, MergeViewLogic mergeViewLogic, ProgressControlsForViews.Data progressData) { EditorGUILayout.BeginHorizontal(EditorStyles.toolbar); if (isProcessMergesButtonVisible) { DoProcessMergesButton( isProcessMergesButtonEnabled && !hasPendingDirectoryConflictsCount, processMergesButtonText, mSwitcher, mPlasticClient, mGuiMessage, mergeViewLogic); } if (isCancelMergesButtonVisible) { DoCancelMergesButton( isCancelMergesButtonEnabled, mergeViewLogic); } if (hasPendingDirectoryConflictsCount) { GUILayout.Space(5); DoWarningMessage(); } if (isOperationRunning) { DrawProgressForViews.ForIndeterminateProgress( progressData); } GUILayout.FlexibleSpace(); DoRefreshButton( !isOperationRunning, plasticClient, mergeViewLogic); EditorGUILayout.EndHorizontal(); }
internal static void CheckinForMode( bool isGluonMode, bool keepItemsLocked, PlasticGUIClient plasticClient) { if (isGluonMode) { plasticClient.PartialCheckin(keepItemsLocked); return; } plasticClient.Checkin(); }
internal UpdateProgress( UpdateNotifier notifier, string wkPath, string title, PlasticGUIClient guiClient) { mNotifier = notifier; mWkPath = wkPath; mGuiClient = guiClient; mProgressData = new BuildProgressSpeedAndRemainingTime.ProgressData(DateTime.Now); mGuiClient.Progress.ProgressHeader = title; mGuiClient.Progress.CanCancelProgress = false; }
static void DoRefreshButton( bool isEnabled, PlasticGUIClient plasticClient, MergeViewLogic mergeViewLogic) { GUI.enabled = isEnabled; if (GUILayout.Button(new GUIContent( Images.GetRefreshIcon()), EditorStyles.toolbarButton)) { mergeViewLogic.Refresh(); } GUI.enabled = true; }
internal static void UndoChangesForMode( bool isGluonMode, PlasticGUIClient plasticClient, List <ChangeInfo> changesToUndo, List <ChangeInfo> dependenciesCandidates) { if (isGluonMode) { plasticClient.PartialUndoChanges( changesToUndo, dependenciesCandidates); return; } plasticClient.UndoChanges( changesToUndo, dependenciesCandidates); }
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(); }
internal CheckinProgress(WorkspaceInfo wkInfo, PlasticGUIClient guiClient) { mWkInfo = wkInfo; mGuiClient = guiClient; mGuiClient.Progress.CanCancelProgress = true; mProgressRender = new CheckinUploadProgressRender( PlasticLocalization.GetString( PlasticLocalization.Name.CheckinProgressMultiThreadUploading), PlasticLocalization.GetString( PlasticLocalization.Name.CheckinProgressMultiThreadNumOfBlocks), PlasticLocalization.GetString(PlasticLocalization.Name.CheckinProgressUploadingFiles), PlasticLocalization.GetString( PlasticLocalization.Name.CheckinProgressUploadingFileData), PlasticLocalization.GetString(PlasticLocalization.Name.CheckinProgressOf)); }
static void DoFileConflictsArea( PlasticGUIClient plasticClient, IncomingChangesTreeView incomingChangesTreeView, MergeTreeResult conflicts, MergeSolvedFileConflicts solvedConflicts, MountPointWithPath mount, bool isOperationRunning) { DoConflictsHeader( conflicts, solvedConflicts, mount); DoConflictsTree( incomingChangesTreeView, isOperationRunning); }
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 void DoCancelButton( PlasticGUIClient plasticClient) { Rect beginRect = GUILayoutUtility.GetLastRect(); Rect endRect = GUILayoutUtility.GetLastRect(); float freeVerticalSpace = endRect.yMax - beginRect.yMin; Rect cancelButtonRect = new Rect( endRect.xMax - UnityConstants.CANCEL_BUTTON_SIZE + 1, beginRect.yMin + (freeVerticalSpace - UnityConstants.CANCEL_BUTTON_SIZE) / 2, UnityConstants.CANCEL_BUTTON_SIZE, UnityConstants.CANCEL_BUTTON_SIZE); if (!GUI.Button(cancelButtonRect, GUIContent.none, UnityStyles.CancelButton)) { return; } plasticClient.CancelCurrentOperation(); }
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(); }
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, Refresh.UnityAssetDatabase); } GUI.enabled = true; }
internal UpdateProgress(PlasticGUIClient guiClient) { mGuiClient = guiClient; }
internal ProgressOperationHandler(PlasticGUIClient guiClient) { mGuiClient = guiClient; }
internal CheckinProgress(PlasticGUIClient guiClient) { mGuiClient = guiClient; }
internal GenericProgress(PlasticGUIClient guiClient) { mGuiClient = guiClient; mGuiClient.Progress.CanCancelProgress = false; }
public static void SetPlasticGUIClient(PlasticGUIClient plasticGUIClient) { mPlasticClient = plasticGUIClient; }
static void OnTextAreaChanged(PlasticGUIClient plasticClient, string text) { plasticClient.UpdateIsCommentWarningNeeded(text); }
internal ProgressOperationHandler(WorkspaceInfo wkInfo, PlasticGUIClient guiClient) { mWkInfo = wkInfo; mGuiClient = guiClient; }