static void ClosePlasticWindow(PlasticWindow window)
        {
            UnRegisterApplicationFocusHandlers(window);

            DisposeNewIncomingChanges(window);

            AvatarImages.Dispose();
        }
Пример #2
0
        static void DisposeNewIncomingChanges(PlasticWindow window)
        {
            NewIncomingChanges.DisposeUpdater(
                window.mDeveloperNewIncomingChangesUpdater,
                window.mGluonNewIncomingChangesUpdater);

            window.mDeveloperNewIncomingChangesUpdater = null;
            window.mGluonNewIncomingChangesUpdater     = null;
        }
Пример #3
0
        static IAutoRefreshView GetPendingChangesView()
        {
            if (!EditorWindow.HasOpenInstances <PlasticWindow>())
            {
                return(null);
            }

            PlasticWindow window = EditorWindow.
                                   GetWindow <PlasticWindow>(null, false);

            return(window.GetPendingChangesView());
        }
Пример #4
0
        internal static void SetNotificationStatus(
            PlasticWindow plasticWindow,
            PlasticNotification.Status status)
        {
            sNotificationStatus = status;

            plasticWindow.SetupWindowTitle(status);

            if (OnNotificationUpdated != null)
            {
                OnNotificationUpdated.Invoke();
            }
        }
Пример #5
0
        static void ShowPlasticWindow(PlasticWindow window)
        {
            EditorWindow dockWindow = FindEditorWindow.ToDock <PlasticWindow>();

            PlasticWindow newPlasticWindow = InstantiateFrom(window);

            if (DockEditorWindow.IsAvailable())
            {
                DockEditorWindow.To(dockWindow, newPlasticWindow);
            }

            newPlasticWindow.Show();

            newPlasticWindow.Focus();
        }
        static PlasticWindow InstantiateFrom(PlasticWindow window)
        {
            PlasticWindow result = Instantiate(window);

            result.mWkInfo          = window.mWkInfo;
            result.mWorkspaceWindow = window.mWorkspaceWindow;
            result.mViewSwitcher    = window.mViewSwitcher;
            result.mCooldownAutoRefreshPendingChangesAction = window.mCooldownAutoRefreshPendingChangesAction;
            result.mDeveloperNewIncomingChangesUpdater      = window.mDeveloperNewIncomingChangesUpdater;
            result.mGluonNewIncomingChangesUpdater          = window.mGluonNewIncomingChangesUpdater;
            result.mException               = window.mException;
            result.mLastUpdateTime          = window.mLastUpdateTime;
            result.mIsGluonMode             = window.mIsGluonMode;
            result.mIncomingChangesNotifier = window.mIncomingChangesNotifier;
            result.mStatusBar               = window.mStatusBar;
            result.mWelcomeView             = window.mWelcomeView;
            return(result);
        }
Пример #7
0
        static void ClosePlasticWindow(PlasticWindow window)
        {
            UnRegisterApplicationFocusHandlers(window);

            PlasticApp.Dispose();

            DrawInspectorOperations.Disable();

            DrawAssetOverlay.Dispose();

            if (window.mEventSenderScheduler != null)
            {
                window.mPingEventLoop.Stop();
                window.mEventSenderScheduler.End();
            }

            DisposeNewIncomingChanges(window);

            AvatarImages.Dispose();
        }
Пример #8
0
        static PlasticWindow InstantiateFrom(PlasticWindow window)
        {
            PlasticWindow result = Instantiate(window);

            result.mWkInfo          = window.mWkInfo;
            result.mWorkspaceWindow = window.mWorkspaceWindow;
            result.mViewSwitcher    = window.mViewSwitcher;
            result.mCooldownAutoRefreshPendingChangesAction = window.mCooldownAutoRefreshPendingChangesAction;
            result.mDeveloperNewIncomingChangesUpdater      = window.mDeveloperNewIncomingChangesUpdater;
            result.mGluonNewIncomingChangesUpdater          = window.mGluonNewIncomingChangesUpdater;
            result.mException      = window.mException;
            result.mLastUpdateTime = window.mLastUpdateTime;
            result.mIsGluonMode    = window.mIsGluonMode;
            result.mIncomingChangesNotificationPanel = window.mIncomingChangesNotificationPanel;
            result.mWelcomeView          = window.mWelcomeView;
            result.mPlasticAPI           = window.mPlasticAPI;
            result.mEventSenderScheduler = window.mEventSenderScheduler;
            result.mPingEventLoop        = window.mPingEventLoop;
            return(result);
        }
Пример #9
0
        static PlasticWindow InstantiateFrom(PlasticWindow window)
        {
            PlasticWindow result = Instantiate(window);

            result.mWkInfo        = window.mWkInfo;
            result.mPlasticClient = window.mPlasticClient;
            result.mViewSwitcher  = window.mViewSwitcher;
            result.mDeveloperNewIncomingChangesUpdater         = window.mDeveloperNewIncomingChangesUpdater;
            result.mDeveloperNewIncomingChangesFromMainUpdater = window.mDeveloperNewIncomingChangesFromMainUpdater;
            result.mGluonNewIncomingChangesUpdater             = window.mGluonNewIncomingChangesUpdater;

            result.mException      = window.mException;
            result.mLastUpdateTime = window.mLastUpdateTime;
            result.mIsGluonMode    = window.mIsGluonMode;
            result.mIncomingChangesNotificationPanel         = window.mIncomingChangesNotificationPanel;
            result.mIncomingChangesFromMainNotificationPanel = window.mIncomingChangesFromMainNotificationPanel;
            result.mWelcomeView          = window.mWelcomeView;
            result.mPlasticAPI           = window.mPlasticAPI;
            result.mEventSenderRestApi   = window.mEventSenderRestApi;
            result.mEventSenderScheduler = window.mEventSenderScheduler;
            result.mPingEventLoop        = window.mPingEventLoop;
            return(result);
        }
Пример #10
0
        static void ShowSettingsContextMenu(
            WorkspaceInfo wkInfo,
            bool isGluonMode)
        {
            GenericMenu menu = new GenericMenu();

            string openToolText = isGluonMode ?
                                  PlasticLocalization.GetString(PlasticLocalization.Name.LaunchGluonButton) :
                                  PlasticLocalization.GetString(PlasticLocalization.Name.LaunchPlasticButton);

            menu.AddItem(
                new GUIContent(openToolText),
                false,
                () => LaunchTool.OpenGUIForMode(wkInfo, isGluonMode));

            PlasticWindow plasticWindow = EditorWindow.GetWindow <PlasticWindow>();

            menu.AddItem(
                new GUIContent(
                    PlasticLocalization.GetString(
                        PlasticLocalization.Name.InviteMembers)),
                false,
                InviteMemberButton_clicked,
                null);

            menu.AddSeparator("");

            menu.AddItem(
                new GUIContent(
                    PlasticLocalization.GetString(
                        PlasticLocalization.Name.Options)),
                false,
                () => SettingsService.OpenProjectSettings(UnityConstants.PROJECT_SETTINGS_MENU_TITLE));

            // If the user has the simplified UI key of type .txt in the Assets folder
            // TODO: Remove when Simplified UI is complete
            if (AssetDatabase.FindAssets("simplifieduikey t:textasset", new[] { "Assets" }).Any())
            {
                menu.AddItem(new GUIContent("Try Simplified UI"),
                             false,
                             TrySimplifiedUIButton_Clicked,
                             null);
            }

            //TODO: Localization
            menu.AddItem(
                new GUIContent(processor.AssetModificationProcessor.ForceCheckout ?
                               PlasticLocalization.GetString(PlasticLocalization.Name.DisableForcedCheckout) :
                               PlasticLocalization.GetString(PlasticLocalization.Name.EnableForcedCheckout)),
                false,
                ForceCheckout_Clicked,
                null);

            menu.AddSeparator("");

            menu.AddItem(
                new GUIContent(
                    PlasticLocalization.GetString(
                        PlasticLocalization.Name.TurnOffPlasticSCM)),
                false,
                TurnOffPlasticButton_Clicked,
                null);

            menu.ShowAsContext();
        }
Пример #11
0
 static void UnRegisterApplicationFocusHandlers(PlasticWindow window)
 {
     EditorWindowFocus.OnApplicationActivated   -= window.OnApplicationActivated;
     EditorWindowFocus.OnApplicationDeactivated -= window.OnApplicationDeactivated;
 }