static ValidationResult ValidateWorkspaceName(string workspaceName) { ValidationResult result = new ValidationResult(); if (string.IsNullOrEmpty(workspaceName)) { result.ErrorMessage = PlasticLocalization.GetString(PlasticLocalization.Name.WorkspaceNameEmpty); result.IsValid = false; return(result); } result.IsValid = true; return(result); }
void BuildComponents() { VisualElement root = rootVisualElement; root.Clear(); InitializeLayoutAndStyles(); mRequireMessageLabel = root.Q <Label>("requireMessage"); mMessageLabel = root.Q <Label>("message"); mDownloadCloudEditionButton = root.Q <Button>("downloadCloudEdition"); mDownloadEnterpriseButton = root.Q <Button>("downloadEnterpriseEdition"); mCancelButton = root.Q <Button>("cancel"); mProgressControlsContainer = root.Q <VisualElement>("progressControlsContainer"); root.Q <Label>("title").text = PlasticLocalization.GetString(PlasticLocalization.Name.InstallPlasticSCM); mDownloadCloudEditionButton.text = PlasticLocalization.GetString(PlasticLocalization.Name.DownloadCloudEdition); mDownloadCloudEditionButton.clicked += DownloadCloudEditionButton_Clicked; if (EditionToken.IsCloudEdition()) { mDownloadEnterpriseButton.AddToClassList("display-none"); DownloadPlasticExeWindow window = GetWindow <DownloadPlasticExeWindow>(); } else { mMessageLabel.text = PlasticLocalization.GetString( PlasticLocalization.Name.WhichVersionInstall); mDownloadEnterpriseButton.text = PlasticLocalization.GetString( PlasticLocalization.Name.DownloadEnterpriseEdition); mDownloadEnterpriseButton.clicked += DownloadEnterpriseEditionButton_Clicked; } mCancelButton.text = PlasticLocalization.GetString(PlasticLocalization.Name.CancelButton); mCancelButton.clicked += CancelButton_Clicked; mProgressControls = new ProgressControlsForDialogs( new VisualElement[] { mDownloadCloudEditionButton, mDownloadEnterpriseButton, mCancelButton }); mProgressControlsContainer.Add(mProgressControls); }
void IncomingChangesViewLogic.IIncomingChangesView.ShowMessage( string message, bool isErrorMessage) { if (isErrorMessage) { mErrorMessageLabelText = message; mIsErrorMessageLabelVisible = true; return; } mMessageLabelText = message; mIsMessageLabelVisible = true; mHasNothingToDownload = message == PlasticLocalization.GetString( PlasticLocalization.Name.MergeNothingToDownloadForIncomingView); }
static void DoMergeLinksArea( MergeLinksListView mergeLinksListView, float width) { GUILayout.Label( PlasticLocalization.GetString( PlasticLocalization.Name.MergeLinkDescriptionColumn), EditorStyles.boldLabel); float desiredTreeHeight = mergeLinksListView.DesiredHeight; Rect treeRect = GUILayoutUtility.GetRect( 0, width, desiredTreeHeight, desiredTreeHeight); mergeLinksListView.OnGUI(treeRect); }
internal static void UpdateAllMenus() { MethodInfo InternalUpdateAllMenus = EditorUtilityType.GetMethod( "Internal_UpdateAllMenus", BindingFlags.Static | BindingFlags.NonPublic); if (InternalUpdateAllMenus == null) { Debug.LogWarning( PlasticLocalization.GetString(PlasticLocalization.Name.ErrorUpdatePlasticSCMMenus)); return; } InternalUpdateAllMenus.Invoke(null, null); }
void CreateButton_Clicked() { if (mProgress != 0) { return; } if (EditorUtility.DisplayDialog(PlasticLocalization.GetString( PlasticLocalization.Name.TurningOffPlasticSCM), PlasticLocalization.GetString(PlasticLocalization.Name.TurnOffPlasticSCMAreYouSure), PlasticLocalization.GetString(PlasticLocalization.Name.YesButton), PlasticLocalization.GetString(PlasticLocalization.Name.NoButton))) { mProgress = 1; } }
internal static string GetExePath() { string title = PlasticLocalization.GetString( PlasticLocalization.Name.BrowseForExecutableFile); string directory = Environment.GetFolderPath( Environment.SpecialFolder.ProgramFiles); string path = EditorUtility.OpenFilePanel(title, directory, null); if (path.Length != 0) return path; return null; }
internal static ResponseType Show( IList <CheckinConflict> conflicts, PlasticLocalization.Name dialogTitle, PlasticLocalization.Name dialogExplanation, PlasticLocalization.Name okButtonCaption, EditorWindow parentWindow) { CheckinConflictsDialog dialog = Create( PlasticLocalization.GetString(dialogTitle), PlasticLocalization.GetString(dialogExplanation), GetConflictsText(conflicts), PlasticLocalization.GetString(okButtonCaption)); return(dialog.RunModal(parentWindow)); }
static RenameBranchDialog Create( RepositorySpec repSpec, BranchInfo branchInfo, ProgressControlsForDialogs progressControls) { var instance = CreateInstance <RenameBranchDialog>(); instance.mRepSpec = repSpec; instance.mBranchInfo = branchInfo; instance.mBranchName = BranchRenameUserInfo.GetShortBranchName(branchInfo.BranchName); instance.mTitle = PlasticLocalization.GetString( PlasticLocalization.Name.RenameBranchTitle); instance.mProgressControls = progressControls; return(instance); }
void DoButtonArea() { using (new EditorGUILayout.HorizontalScope()) { GUILayout.FlexibleSpace(); if (!AcceptButton(PlasticLocalization.GetString( PlasticLocalization.Name.CloseButton))) { return; } CloseButtonAction(); } }
void DoTitleArea() { GUILayout.BeginVertical(); Title(PlasticLocalization.GetString(PlasticLocalization.Name.CreateChildBranchTitle)); GUILayout.Space(5); Paragraph(string.Format("{0} {1}", PlasticLocalization.GetString( PlasticLocalization.Name.CreateChildBranchExplanation), mExplanation)); GUILayout.Space(20); GUILayout.EndVertical(); }
void DoErrorsListArea( ErrorsListView errorsListView, object splitterState) { EditorGUILayout.BeginVertical(); GUILayout.Label( PlasticLocalization.GetString( PlasticLocalization.Name.IncomingChangesCannotBeApplied), EditorStyles.boldLabel); DoErrorsListSplitViewArea( errorsListView, splitterState); EditorGUILayout.EndVertical(); }
internal static void SetCloudProjectId(string projectId) { MethodInfo InternalSetCloudProjectId = PlayerSettingsType.GetMethod( "SetCloudProjectId", BindingFlags.NonPublic | BindingFlags.Static); if (InternalSetCloudProjectId == null) { Debug.LogWarning(PlasticLocalization.GetString( PlasticLocalization.Name.CannotWriteCloudProjectId)); return; } InternalSetCloudProjectId.Invoke( null, new object[] { projectId }); }
void CheckForPlasticExe() { // executable becomes available halfway through the install // we do not want to say install is done too early // when progress control finishes, cancel button will be enabled // then we can check for exe existing if (mCancelButton.enabledSelf && IsExeAvailable.ForMode(mIsGluonMode)) { mMessageLabel.text = "Plastic SCM installed. You can now use the feature."; mCancelButton.text = PlasticLocalization.GetString(PlasticLocalization.Name.CloseButton); mRequireMessageLabel.AddToClassList("display-none"); mDownloadCloudEditionButton.AddToClassList("display-none"); mDownloadEnterpriseButton.AddToClassList("display-none"); } }
public bool AcceptInvalidHostname(string certHostname, string serverHostname) { bool result = false; GUIActionRunner.RunGUIAction(delegate { result = GuiMessage.ShowQuestion( PlasticLocalization.GetString( PlasticLocalization.Name.InvalidCertificateHostnameTitle), PlasticLocalization.GetString( PlasticLocalization.Name.InvalidCertificateHostnameMessage, certHostname, serverHostname), PlasticLocalization.GetString(PlasticLocalization.Name.YesButton)); }); return(result); }
void BuildComponents() { mOpenRevisionMenuItemContent = new GUIContent(PlasticLocalization. GetString(PlasticLocalization.Name.HistoryMenuItemOpen)); mOpenRevisionWithMenuItemContent = new GUIContent(PlasticLocalization. GetString(PlasticLocalization.Name.HistoryMenuItemOpenWith)); mSaveRevisionAsMenuItemContent = new GUIContent(PlasticLocalization. GetString(PlasticLocalization.Name.SaveThisRevisionAs)); mDiffWithPreviousMenuItemContent = new GUIContent(PlasticLocalization. GetString(PlasticLocalization.Name.HistoryMenuItemDiffWithPrevious) + " %d"); mDiffSelectedRevisionsMenuItemContent = new GUIContent(PlasticLocalization. GetString(PlasticLocalization.Name.HistoryMenuItemDiffSelectedRevisions)); mDiffChangesetMenuItemContent = new GUIContent(); mRevertToThisRevisionMenuItemContent = new GUIContent(PlasticLocalization. GetString(PlasticLocalization.Name.HistoryMenuItemRevertToThisRevision)); }
static void InitLocalization() { string language = null; try { language = ClientConfig.Get().GetLanguage(); } catch { language = string.Empty; } Localization.Init(language); PlasticLocalization.SetLanguage(language); }
void DoCancelMergesButton( bool isEnabled, MergeViewLogic mergeViewLogic) { GUI.enabled = isEnabled; if (DrawActionButton.For(PlasticLocalization.GetString( PlasticLocalization.Name.CancelButton))) { mergeViewLogic.Cancel(); mIsCancelMergesButtonEnabled = false; } GUI.enabled = true; }
internal static string ForHistory() { if (PlatformIdentifier.IsWindows()) { return(PlasticLocalization.GetString( PlasticLocalization.Name.UnityHistoryShortcutForWindows)); } if (PlatformIdentifier.IsMac()) { return(PlasticLocalization.GetString( PlasticLocalization.Name.UnityHistoryShortcutForMacOS)); } return(string.Empty); }
void ChangesetsTabButtonGUI() { bool wasChangesetsSelected = IsViewSelected(SelectedTab.Changesets); bool isChangesetsSelected = mChangesetsTabButton. DrawTabButton( PlasticLocalization.GetString(PlasticLocalization.Name.ChangesetsViewTitle), wasChangesetsSelected, mTabButtonWidth); if (isChangesetsSelected) { ShowChangesetsView(); } }
void IncomingChangesTabButtonGUI() { bool wasIncomingChangesSelected = IsViewSelected(SelectedTab.IncomingChanges); bool isIncomingChangesSelected = mIncomingChangesTabButton. DrawTabButton( PlasticLocalization.GetString(PlasticLocalization.Name.IncomingChangesViewTitle), wasIncomingChangesSelected, mTabButtonWidth); if (isIncomingChangesSelected) { ShowIncomingChangesView(); } }
void DoWhatToShowTab() { mCanAutoRefresh = TitleToggle(PlasticLocalization.GetString( PlasticLocalization.Name.PendingChangesAutoRefresh), mCanAutoRefresh); using (new EditorGUILayout.HorizontalScope()) { GUILayout.Space(20); Paragraph(PlasticLocalization.GetString( PlasticLocalization.Name.PendingChangesAutoRefreshExplanation)); } mCanShowPrivateFields = TitleToggle(PlasticLocalization.GetString( PlasticLocalization.Name.PendingChangesShowPrivateFiles), mCanShowPrivateFields); using (new EditorGUILayout.HorizontalScope()) { GUILayout.Space(20); Paragraph(PlasticLocalization.GetString( PlasticLocalization.Name.PendingChangesShowPrivateFilesExplanation)); } mCanShowIgnoredFiles = TitleToggle(PlasticLocalization.GetString( PlasticLocalization.Name.PendingChangesShowIgnoredFiles), mCanShowIgnoredFiles); using (new EditorGUILayout.HorizontalScope()) { GUILayout.Space(20); Paragraph(PlasticLocalization.GetString( PlasticLocalization.Name.PendingChangesShowIgnoredFilesExplanation)); } mCanShowHiddenFiles = TitleToggle(PlasticLocalization.GetString( PlasticLocalization.Name.PendingChangesShowHiddenFiles), mCanShowHiddenFiles); using (new EditorGUILayout.HorizontalScope()) { GUILayout.Space(20); Paragraph(PlasticLocalization.GetString( PlasticLocalization.Name.PendingChangesShowHiddenFilesExplanation)); } mCanShowDeletedFiles = TitleToggle(PlasticLocalization.GetString( PlasticLocalization.Name.PendingChangesShowDeletedFiles), mCanShowDeletedFiles); using (new EditorGUILayout.HorizontalScope()) { GUILayout.Space(20); Paragraph(PlasticLocalization.GetString( PlasticLocalization.Name.PendingChangesShowDeletedFilesExplanation)); } }
static void RunInstaller( string installerPath, ProgressControlsForDialogs progressControls, INotify notify) { progressControls.ProgressData.ProgressPercent = -1; ((IProgressControls)progressControls).ShowProgress( PlasticLocalization.GetString(PlasticLocalization.Name.InstallingProgress)); notify.InstallationStarted(); MacOSConfigWorkaround configWorkaround = new MacOSConfigWorkaround(); IThreadWaiter waiter = ThreadWaiter.GetWaiter(); waiter.Execute( /*threadOperationDelegate*/ delegate { configWorkaround.CreateClientConfigIfNeeded(); Process installerProcess = LaunchInstaller.ForPlatform(installerPath); if (installerProcess != null) { installerProcess.WaitForExit(); } configWorkaround.DeleteClientConfigIfNeeded(); }, /*afterOperationDelegate*/ delegate { notify.InstallationFinished(); ((IProgressControls)progressControls).HideProgress(); if (waiter.Exception != null) { ((IProgressControls)progressControls).ShowError( waiter.Exception.Message); return; } File.Delete(installerPath); }); }
internal void UndoChanges( List <ChangeInfo> changesToUndo, List <ChangeInfo> dependenciesCandidates) { if (CheckEmptyOperation(changesToUndo, HasPendingMergeLinks())) { mProgressControls.ShowWarning( PlasticLocalization.GetString(PlasticLocalization.Name.NoItemsToUndo)); return; } mPendingChangesOperations.Undo( changesToUndo, dependenciesCandidates, mPendingMergeLinks.Count, Refresh.UnityAssetDatabase); }
internal ResponseType RunModal(EditorWindow parentWindow) { InitializeVars(parentWindow); if (UI.RunModal.IsAvailable()) { UI.RunModal.Dialog(this); return(mAnswer); } EditorUtility.DisplayDialog( "Plastic SCM", "The modal dialog is not available in this version and it is required for the Plastic SCM plugin works fine.\n" + "Please contact [email protected] for further info.", PlasticLocalization.GetString(PlasticLocalization.Name.CloseButton)); return(ResponseType.None); }
void DoCheckinButton() { GUI.enabled = !string.IsNullOrEmpty(mComment) && !mIsRunningCheckin; try { if (!AcceptButton(PlasticLocalization.GetString( PlasticLocalization.Name.CheckinButton))) return; } finally { GUI.enabled = true; } OkButtonWithCheckinAction(); }
static void DrawEmptyState( Rect rect, bool isCheckedInSuccessful) { if (isCheckedInSuccessful) { DrawTreeViewEmptyState.For( rect, PlasticLocalization.GetString(PlasticLocalization.Name.CheckinCompleted), Images.Name.StepOk); return; } DrawTreeViewEmptyState.For( rect, PlasticLocalization.GetString(PlasticLocalization.Name.NoPendingChanges)); }
void ShowCheckinSuccess() { bool isTreeViewEmpty = mPendingChangesTreeView.GetSelectedItemCount() == mPendingChangesTreeView.GetTotalItemCount(); if (isTreeViewEmpty) { mIsCheckedInSuccessful = true; mClearCheckinSuccessAction.Ping(); return; } mStatusBar.Notify( PlasticLocalization.GetString(PlasticLocalization.Name.CheckinCompleted), UnityEditor.MessageType.None, Images.Name.StepOk); }
static void DisplayProgress( UpdateOperationStatus status, BuildProgressSpeedAndRemainingTime.ProgressData progressData, string cloudRepository) { string totalProgressMessage = UpdateProgressRender. GetProgressString(status, progressData); float totalProgressPercent = GetProgressBarPercent. ForTransfer(status.UpdatedSize, status.TotalSize) / 100f; EditorUtility.DisplayProgressBar( string.Format("{0} {1}", PlasticLocalization.GetString(PlasticLocalization.Name.DownloadingProgress), cloudRepository), totalProgressMessage, totalProgressPercent); }
void BuildComponents() { this.SetControlText <Label>("signInToPlasticSCM", PlasticLocalization.Name.SignInToPlasticSCM); this.SetControlText <Label>("completeSignInOnBrowser", PlasticLocalization.Name.CompleteSignInOnBrowser); mProgressContainer = this.Q <VisualElement>("progressContainer"); mProgressControls = new UI.Progress.ProgressControlsForDialogs(); mCancelButton = this.Query <Button>("cancelButton").First(); mCancelButton.text = PlasticLocalization.GetString( PlasticLocalization.Name.CancelButton); mCancelButton.clicked += CancelButton_Clicked; }