static void DoProcessMergesButton( bool isEnabled, string processMergesButtonText, IViewSwitcher switcher, IWorkspaceWindow workspaceWindow, GuiMessage.IGuiMessage guiMessage, MergeViewLogic mergeViewLogic, Action afterProcessMergesAction) { GUI.enabled = isEnabled; if (DrawActionButton.For(processMergesButtonText)) { mergeViewLogic.ProcessMerges( workspaceWindow, switcher, guiMessage, new List <string>(), MergeContributorType.MergeContributors, afterProcessMergesAction, null); } GUI.enabled = true; }
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(); }
static CheckinDialog Create( WorkspaceInfo wkInfo, List<string> paths, IAssetStatusCache assetStatusCache, MetaCache metaCache, bool isGluonMode, ProgressControlsForDialogs progressControls, IWorkspaceWindow workspaceWindow, ViewHost viewHost, GuiMessage.IGuiMessage guiMessage, IMergeViewLauncher mergeViewLauncher, IGluonViewSwitcher gluonViewSwitcher) { var instance = CreateInstance<CheckinDialog>(); instance.IsResizable = true; instance.minSize = new Vector2(520, 370); instance.mWkInfo = wkInfo; instance.mPaths = paths; instance.mAssetStatusCache = assetStatusCache; instance.mMetaCache = metaCache; instance.mIsGluonMode = isGluonMode; instance.mProgressControls = progressControls; instance.mWorkspaceWindow = workspaceWindow; instance.mViewHost = viewHost; instance.mGuiMessage = guiMessage; instance.mMergeViewLauncher = mergeViewLauncher; instance.mGluonViewSwitcher = gluonViewSwitcher; instance.mEnterKeyAction = instance.OkButtonAction; instance.mEscapeKeyAction = instance.CancelButtonAction; return instance; }
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); }
internal AssetOperations( WorkspaceInfo wkInfo, IWorkspaceWindow workspaceWindow, IViewSwitcher viewSwitcher, IHistoryViewLauncher historyViewLauncher, ViewHost viewHost, NewIncomingChangesUpdater newIncomingChangesUpdater, IAssetStatusCache assetStatusCache, IMergeViewLauncher mergeViewLauncher, IGluonViewSwitcher gluonViewSwitcher, EditorWindow parentWindow, IAssetSelection assetSelection, bool isGluonMode) { mWkInfo = wkInfo; mWorkspaceWindow = workspaceWindow; mViewSwitcher = viewSwitcher; mHistoryViewLauncher = historyViewLauncher; mViewHost = viewHost; mNewIncomingChangesUpdater = newIncomingChangesUpdater; mAssetStatusCache = assetStatusCache; mMergeViewLauncher = mergeViewLauncher; mGluonViewSwitcher = gluonViewSwitcher; mAssetSelection = assetSelection; mIsGluonMode = isGluonMode; mParentWindow = parentWindow; mGuiMessage = new UnityPlasticGuiMessage(parentWindow); mProgressControls = new EditorProgressControls(mGuiMessage); }
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(); }
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(); }
internal static bool CheckinPaths( WorkspaceInfo wkInfo, List<string> paths, IAssetStatusCache assetStatusCache, bool isGluonMode, EditorWindow parentWindow, IWorkspaceWindow workspaceWindow, ViewHost viewHost, GuiMessage.IGuiMessage guiMessage, IMergeViewLauncher mergeViewLauncher, IGluonViewSwitcher gluonViewSwitcher) { MetaCache metaCache = new MetaCache(); metaCache.Build(paths); CheckinDialog dialog = Create( wkInfo, paths, assetStatusCache, metaCache, isGluonMode, new ProgressControlsForDialogs(), workspaceWindow, viewHost, guiMessage, mergeViewLauncher, gluonViewSwitcher); return dialog.RunModal(parentWindow) == ResponseType.Ok; }
void DoActionsToolbar( bool isProcessMergesButtonVisible, bool isCancelMergesButtonVisible, bool isProcessMergesButtonEnabled, bool isCancelMergesButtonEnabled, string processMergesButtonText, bool hasPendingDirectoryConflictsCount, bool isOperationRunning, IWorkspaceWindow workspaceWindow, MergeViewLogic mergeViewLogic, ProgressControlsForViews.Data progressData) { GUIStyle guiStyle = new GUIStyle(); guiStyle.margin = new RectOffset(5, 5, 5, 5); EditorGUILayout.BeginHorizontal(guiStyle); if (isProcessMergesButtonVisible) { DoProcessMergesButton( isProcessMergesButtonEnabled && !hasPendingDirectoryConflictsCount, processMergesButtonText, mSwitcher, workspaceWindow, mGuiMessage, mergeViewLogic); } if (isCancelMergesButtonVisible) { DoCancelMergesButton( isCancelMergesButtonEnabled, mergeViewLogic); } if (hasPendingDirectoryConflictsCount) { GUILayout.Space(5); DoWarningMessage(); } if (isOperationRunning) { DrawProgressForViews.ForIndeterminateProgress( progressData); } GUILayout.FlexibleSpace(); DoRefreshButton( !isOperationRunning, mergeViewLogic); EditorGUILayout.EndHorizontal(); }
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(); }
private void MyEvents_OnStartup(object Sender, ExtenderEventArgs e) { ExtendedPropertyList properties = null;; ExtenderMenuItems menuItem; //MyApp.SystemSettings.WorkstationInfo.Touch.CompanyLogoPosition = 1; properties = (ExtendedPropertyList)e.get_data(); //this property will only be available in the backoffice if (properties.PropertyExists("ChildWindow")) { generalChildWindow = (IChildWindow)properties.get_Value("ChildWindow"); } //this property will only be available in the backoffice if (properties.PropertyExists("WorkspaceWindow")) { generalWorkspaceWindow = (IWorkspaceWindow)properties.get_Value("WorkspaceWindow"); } //this property will be available in both backoffice and frontoffice if (properties.PropertyExists("DialogWindow")) { generalDialogWindow = (IDialogWindow)properties.get_Value("DialogWindow"); } // CUSTOM MENUS // Definir os menus menuItem = new ExtenderMenuItems(); var childItems = menuItem.Add("miExtensibilidade", "&Extensibilidade").ChildItems; childItems.Add("miXItem1", "Item &1"); childItems.Add("miXItem2", "Item &2"); // // COM mandatories object oMenuItem = menuItem; properties.set_Value("ExtenderMenuItems", ref oMenuItem); //Use this property if you want Sage Retail to rebuild the permissions tree... //object rebuildPermissionsTree = true; //properties.set_Value("RebuildPermissionsTree", rebuildPermissionsTree); object oProps = properties; e.result.set_data(ref oProps); menuItem = null; }
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(); }
void BuildComponents( WorkspaceInfo wkInfo, IWorkspaceWindow workspaceWindow, IViewSwitcher viewSwitcher, IMergeViewLauncher mergeViewLauncher, IUpdateReport updateReport, NewIncomingChangesUpdater developerNewIncomingChangesUpdater, EditorWindow parentWindow) { mSearchField = new SearchField(); mSearchField.downOrUpArrowKeyPressed += SearchField_OnDownOrUpArrowKeyPressed; DateFilter.Type dateFilterType = EnumPopupSetting <DateFilter.Type> .Load( UnityConstants.BRANCHES_DATE_FILTER_SETTING_NAME, DateFilter.Type.LastMonth); mDateFilter = new DateFilter(dateFilterType); BranchesListHeaderState headerState = BranchesListHeaderState.GetDefault(); TreeHeaderSettings.Load(headerState, UnityConstants.BRANCHES_TABLE_SETTINGS_NAME, (int)BranchesListColumn.CreationDate, false); mBranchesListView = new BranchesListView( headerState, BranchesListHeaderState.GetColumnNames(), new BranchesViewMenu(this), sizeChangedAction: OnBranchesListViewSizeChanged); mBranchesListView.Reload(); mBranchOperations = new BranchOperations( wkInfo, workspaceWindow, viewSwitcher, mergeViewLauncher, this, ViewType.BranchesView, mProgressControls, updateReport, new ContinueWithPendingChangesQuestionerBuilder(viewSwitcher, parentWindow), developerNewIncomingChangesUpdater); }
internal DiffPanel( WorkspaceInfo wkInfo, IWorkspaceWindow workspaceWindow, IViewSwitcher viewSwitcher, IHistoryViewLauncher historyViewLauncher, EditorWindow parentWindow, bool isGluonMode) { mWkInfo = wkInfo; mWorkspaceWindow = workspaceWindow; mViewSwitcher = viewSwitcher; mHistoryViewLauncher = historyViewLauncher; mParentWindow = parentWindow; mGuiMessage = new UnityPlasticGuiMessage(parentWindow); mIsGluonMode = isGluonMode; BuildComponents(); mProgressControls = new ProgressControlsForViews(); }
void BuildComponents( WorkspaceInfo wkInfo, IWorkspaceWindow workspaceWindow, IViewSwitcher viewSwitcher, IHistoryViewLauncher historyViewLauncher, EditorWindow parentWindow) { mSearchField = new SearchField(); mSearchField.downOrUpArrowKeyPressed += SearchField_OnDownOrUpArrowKeyPressed; DateFilter.Type dateFilterType = EnumPopupSetting <DateFilter.Type> .Load( UnityConstants.CHANGESETS_DATE_FILTER_SETTING_NAME, DateFilter.Type.LastMonth); mDateFilter = new DateFilter(dateFilterType); ChangesetsListHeaderState headerState = ChangesetsListHeaderState.GetDefault(); TreeHeaderSettings.Load(headerState, UnityConstants.CHANGESETS_TABLE_SETTINGS_NAME, (int)ChangesetsListColumn.CreationDate, false); mChangesetsListView = new ChangesetsListView( headerState, ChangesetsListHeaderState.GetColumnNames(), new ChangesetsViewMenu(this, this, mIsGluonMode), sizeChangedAction: OnChangesetsListViewSizeChanged, selectionChangedAction: OnSelectionChanged, doubleClickAction: ((IChangesetMenuOperations)this).DiffChangeset); mChangesetsListView.Reload(); mIsChangesPanelVisible = BoolSetting.Load( UnityConstants.CHANGESETS_SHOW_CHANGES_SETTING_NAME, true); mDiffPanel = new DiffPanel( wkInfo, workspaceWindow, viewSwitcher, historyViewLauncher, parentWindow, mIsGluonMode); }
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, RefreshAsset.UnityAssetDatabase); } GUI.enabled = true; }
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); }); }
private void MyEvents_OnStartup(object Sender, ExtenderEventArgs e) { ExtendedPropertyList properties = null;; ExtenderMenuItems menuItem; //APIEngine.SystemSettings.WorkstationInfo.Touch.CompanyLogoPosition = 1; properties = (ExtendedPropertyList)e.get_data(); //this property will only be available in the backoffice if (properties.PropertyExists("ChildWindow")) { generalChildWindow = (IChildWindow2)properties.get_Value("ChildWindow"); } //this property will only be available in the backoffice if (properties.PropertyExists("WorkspaceWindow")) { generalWorkspaceWindow = (IWorkspaceWindow)properties.get_Value("WorkspaceWindow"); } //this property will be available in both backoffice and frontoffice if (properties.PropertyExists("DialogWindow")) { generalDialogWindow = (IDialogWindow)properties.get_Value("DialogWindow"); } //this property will be available in both backoffice and frontoffice if (properties.PropertyExists("UITransactionManager")) { generalUITransactionManager = (IUITransaction)properties.get_Value("UITransactionManager"); } //this property will be available in both backoffice and frontoffice if (properties.PropertyExists("UIMasterTableManager")) { generalUIMasterTableManager = (IUIMasterTable)properties.get_Value("UIMasterTableManager"); } if (properties.PropertyExists("UIMenuManager")) { generalUIMenuManager = (IUIMenu)properties.get_Value("UIMenuManager"); } // CUSTOM MENUS // Definir os menus // Botão simples menuItem = new ExtenderMenuItems(); var simpleButton = menuItem.Add("miSimpleButton", "Exemplo de janela"); // Colocar o caminho para o icone. // Não usar os nomes de ficheiro da Sage em: // TARGETDIR\Icons50c // TARGETDIR\Images var myTargetDir = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetModules()[0].FullyQualifiedName); myTargetDir = System.IO.Path.Combine(myTargetDir, "Icons"); simpleButton.PictureName = System.IO.Path.Combine(myTargetDir, "icon-sample-01.png"); var simpleButton2 = menuItem.Add("miSimpleButton1", "Exemplo 2 de janela"); simpleButton2.PictureName = System.IO.Path.Combine(myTargetDir, "icon-sample-02.png"); // Botão com submenu var parentButton = menuItem.Add("miComplexButton", "Grupo"); var parentBtn1 = parentButton.ChildItems.Add("miComplexButtonItem1", "Clique aqui para ver uma mensagem do Grupo!"); parentBtn1.PictureName = System.IO.Path.Combine(myTargetDir, "icon-sample-03.png"); //menuItem.Add("miItemView", "Alterar Artigos"); var parentButton2 = menuItem.Add("miComplexButton2", "Grupo"); var child1 = parentButton2.ChildItems.Add("miComplexButtonItem2", "SubGrupo"); var childItem1 = child1.ChildItems.Add("miComplexButtonItem3", "Clique aqui para ver uma mensagem do SubGrupo!", "miComplexButtonItem3"); childItem1.PictureName = System.IO.Path.Combine(myTargetDir, "icon-sample-03.png"); var childItem2 = child1.ChildItems.Add("miComplexButtonItem4", "Clique aqui para ver outra mensagem do SubGrupo!", "miComplexButtonItem3"); childItem2.PictureName = System.IO.Path.Combine(myTargetDir, "icon-save.ico"); // Custom Functions // Remember, all functions declared here will not recorded on physical base AddMyFunction("XFunctionA", "PTG"); AddMyFunction("XPosDisplay", "PTG"); // // COM mandatories object oMenuItem = menuItem; properties.set_Value("ExtenderMenuItems", ref oMenuItem); //Change RibbonTab Title object oRibbonCaption = "My caption"; properties.set_Value("RibbonCaption", ref oRibbonCaption); //Use this property if you want Sage Retail to rebuild the permissions tree... //object rebuildPermissionsTree = true; //properties.set_Value("RebuildPermissionsTree", rebuildPermissionsTree); object oProps = properties; e.result.set_data(ref oProps); menuItem = null; }
void DoActionsToolbar( bool isMessageLabelVisible, bool hasNothingToDownload, bool isErrorMessageLabelVisible, bool isProcessMergesButtonVisible, bool isCancelMergesButtonVisible, bool isProcessMergesButtonEnabled, bool isCancelMergesButtonEnabled, string processMergesButtonText, bool hasPendingDirectoryConflictsCount, bool isOperationRunning, IWorkspaceWindow workspaceWindow, MergeViewLogic mergeViewLogic, ProgressControlsForViews.Data progressData) { Rect result = GUILayoutUtility.GetRect(mParentWindow.position.width, 1); EditorGUI.DrawRect(result, UnityStyles.Colors.BarBorder); EditorGUILayout.BeginVertical(UnityStyles.IncomingChangesTab.ActionToolbar); GUILayout.FlexibleSpace(); EditorGUILayout.BeginHorizontal(); if (!isOperationRunning) { DoActionsToolbarMessage( isMessageLabelVisible, hasNothingToDownload, isErrorMessageLabelVisible); if (isProcessMergesButtonVisible) { DoProcessMergesButton( isProcessMergesButtonEnabled && !hasPendingDirectoryConflictsCount, processMergesButtonText, mSwitcher, workspaceWindow, mGuiMessage, mergeViewLogic); } if (isCancelMergesButtonVisible) { DoCancelMergesButton( isCancelMergesButtonEnabled, mergeViewLogic); } if (hasPendingDirectoryConflictsCount) { GUILayout.Space(5); DoWarningMessage(); } } else { DrawProgressForViews.ForIndeterminateProgress( progressData); } GUILayout.FlexibleSpace(); EditorGUILayout.EndHorizontal(); GUILayout.FlexibleSpace(); EditorGUILayout.EndVertical(); }