void CheckIncomingChanges.IUpdateIncomingChanges.Show( string infoText, string actionText, string tooltipText, CheckIncomingChanges.Severity severity) { PlasticNotification.Status status = PlasticNotification.Status.None; if (severity == CheckIncomingChanges.Severity.Info) { status = PlasticNotification.Status.IncomingChanges; } else if (severity == CheckIncomingChanges.Severity.Warning) { status = PlasticNotification.Status.Conflicts; } PlasticPlugin.SetNotificationStatus( mPlasticWindow, status); UpdateData( mNotification, infoText, actionText, tooltipText, status); mHasNotification = true; mPlasticWindow.Repaint(); }
void CheckIncomingChanges.IUpdateIncomingChanges.Show( string infoText, string actionText, string tooltipText, CheckIncomingChanges.Severity severity, CheckIncomingChanges.Action action) { PlasticNotification.Status status = PlasticNotification.Status.None; if (severity == CheckIncomingChanges.Severity.Info) { status = PlasticNotification.Status.IncomingChanges; } else if (severity == CheckIncomingChanges.Severity.Warning) { status = PlasticNotification.Status.Conflicts; } mPlasticWindow.SetNotificationStatus(status); UpdateData( mPanelData, infoText, actionText, tooltipText, severity, action); mIsVisible = true; mPlasticWindow.Repaint(); }
static void DrawEmptyState( Rect rect, bool isCheckedInSuccessful, PlasticNotification.Status notificationStatus, string notificationInfoText, string notificationActionText, Action notificationAction) { if (isCheckedInSuccessful) { DrawTreeViewEmptyState.For( rect, PlasticLocalization.GetString(PlasticLocalization.Name.CheckinCompleted), Images.Name.StepOk); return; } if (notificationStatus != PlasticNotification.Status.None) { DrawTreeViewEmptyState.For( rect, PlasticLocalization.GetString(PlasticLocalization.Name.NoPendingChanges), notificationInfoText, notificationActionText, Images.Name.IconOutOfSync, notificationAction); return; } DrawTreeViewEmptyState.For( rect, PlasticLocalization.GetString(PlasticLocalization.Name.NoPendingChanges)); }
static void DoChangesArea( WorkspaceInfo wkInfo, PendingChangesTreeView changesTreeView, IMergeViewLauncher mergeViewLauncher, IGluonViewSwitcher gluonViewSwitcher, bool isOperationRunning, bool isGluonMode, bool isCheckedInSuccessful, PlasticNotification.Status notificationStatus, string notificationInfoText, string notificationActionText) { GUI.enabled = !isOperationRunning; Rect rect = GUILayoutUtility.GetRect(0, 100000, 0, 100000); changesTreeView.OnGUI(rect); if (changesTreeView.GetTotalItemCount() == 0) { DrawEmptyState( rect, isCheckedInSuccessful, notificationStatus, notificationInfoText, notificationActionText, () => OpenIncomingChangesTab( wkInfo, mergeViewLauncher, gluonViewSwitcher, isGluonMode)); } GUI.enabled = true; }
internal void Clear() { InfoText = string.Empty; ActionText = string.Empty; TooltipText = string.Empty; HasUpdateAction = false; Status = PlasticNotification.Status.None; }
internal void SetNotificationStatus( PlasticNotification.Status status, string infoText, string actionText) { mNotificationStatus = status; mNotificationInfoText = infoText; mNotificationActionText = actionText; }
internal void SetNotificationStatus(PlasticNotification.Status status) { if (status == mNotificationStatus) { return; } mNotificationStatus = status; SetupWindowTitle(); OnNotificationUpdated.Invoke(); }
internal void SetupWindowTitle(PlasticNotification.Status status) { Texture windowIcon = PlasticNotification.GetIcon(status); // The titleContent icon does not update unless we also update the title text // Temporarily doing it by adding space characters string title = UnityConstants.PLASTIC_WINDOW_TITLE; title += String.Concat(Enumerable.Repeat(" ", (int)status)); titleContent = new GUIContent(title, windowIcon); }
static void UpdateData( IncomingChangesNotification data, string infoText, string actionText, string tooltipText, PlasticNotification.Status status) { data.InfoText = infoText; data.ActionText = actionText; data.TooltipText = tooltipText; data.HasUpdateAction = false; data.Status = status; }
internal static void SetNotificationStatus( PlasticWindow plasticWindow, PlasticNotification.Status status) { sNotificationStatus = status; plasticWindow.SetupWindowTitle(status); if (OnNotificationUpdated != null) { OnNotificationUpdated.Invoke(); } }
internal void SetNotificationStatus( PlasticNotification.Status status, string infoText, string actionText) { if (status == mNotificationStatus) { return; } mNotificationStatus = status; SetupWindowTitle(); OnNotificationUpdated.Invoke(); if (mViewSwitcher != null) { mViewSwitcher.PendingChangesTab.SetNotificationStatus( status, infoText, actionText); } }