Ejemplo n.º 1
0
        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();
        }
Ejemplo n.º 3
0
        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));
        }
Ejemplo n.º 4
0
        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;
        }
Ejemplo n.º 5
0
 internal void Clear()
 {
     InfoText        = string.Empty;
     ActionText      = string.Empty;
     TooltipText     = string.Empty;
     HasUpdateAction = false;
     Status          = PlasticNotification.Status.None;
 }
Ejemplo n.º 6
0
 internal void SetNotificationStatus(
     PlasticNotification.Status status,
     string infoText,
     string actionText)
 {
     mNotificationStatus     = status;
     mNotificationInfoText   = infoText;
     mNotificationActionText = actionText;
 }
Ejemplo n.º 7
0
        internal void SetNotificationStatus(PlasticNotification.Status status)
        {
            if (status == mNotificationStatus)
            {
                return;
            }

            mNotificationStatus = status;
            SetupWindowTitle();
            OnNotificationUpdated.Invoke();
        }
Ejemplo n.º 8
0
        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);
        }
Ejemplo n.º 9
0
 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;
 }
Ejemplo n.º 10
0
        internal static void SetNotificationStatus(
            PlasticWindow plasticWindow,
            PlasticNotification.Status status)
        {
            sNotificationStatus = status;

            plasticWindow.SetupWindowTitle(status);

            if (OnNotificationUpdated != null)
            {
                OnNotificationUpdated.Invoke();
            }
        }
Ejemplo n.º 11
0
        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);
            }
        }