Exemplo n.º 1
0
        public override void OnGUI(Rect rect)
        {
            GUIStyle collabButtonStyle = "AppCommand";
            var      disable           = EditorApplication.isPlaying;

            using (new EditorGUI.DisabledScope(disable))
            {
                if (m_CurrentState == ToolbarButtonState.Plastic)
                {
                    var icon = GetIconForPlastic(PlasticWindow.HasNotification);
                    EditorGUIUtility.SetIconSize(new Vector2(16, 16));
                    if (GUI.Button(rect, icon, collabButtonStyle))
                    {
                        PlasticWindow.Open();
                    }
                    EditorGUIUtility.SetIconSize(Vector2.zero);
                }
                else
                {
                    var icon = GetIconForState();
                    EditorGUIUtility.SetIconSize(new Vector2(16, 16));
                    if (GUI.Button(rect, icon, collabButtonStyle))
                    {
                        CollaborateWindow.Init();
                    }
                    EditorGUIUtility.SetIconSize(Vector2.zero);
                }
            }
        }
Exemplo n.º 2
0
        void IAssetFilesFilterPatternsMenuOperations.AddFilesFilterPatterns(
            FilterTypes type,
            FilterActions action,
            FilterOperationType operation)
        {
            PlasticWindow plasticWindow = EditorWindow.GetWindow <PlasticWindow>();

            plasticWindow.AddFilesFilterPatterns(type, action, operation);
        }
Exemplo n.º 3
0
        void DoCollabDropDown(Rect rect)
        {
            UpdateCollabToolbarState();
            GUIStyle plasticButtonStyle = "ToolbarButton";
            GUIStyle collabButtonStyle  = "OffsetDropDown";
            bool     openPlastic        = false;
            bool     showPopup          = Toolbar.requestShowCollabToolbar;

            Toolbar.requestShowCollabToolbar = false;

            bool enable = !EditorApplication.isPlaying;

            using (new EditorGUI.DisabledScope(!enable))
            {
                bool animate = m_CollabToolbarState == CollabToolbarState.InProgress;

                EditorGUIUtility.SetIconSize(new Vector2(12, 12));

                if (m_CollabToolbarState == CollabToolbarState.Plastic)
                {
                    GUIContent content = currentCollabContent;
                    content.image = PlasticWindow.GetWindowIcon();

                    Width = kPlasticButtonWidth;
                    if (GUI.Button(rect, content, plasticButtonStyle))
                    {
                        openPlastic = true;
                    }
                }
                else
                {
                    Width = kCollabButtonWidth;
                    if (GetCollabButton().OnGUI(rect, currentCollabContent, animate, collabButtonStyle))
                    {
                        showPopup = true;
                    }
                }
                EditorGUIUtility.SetIconSize(Vector2.zero);
            }

            if (m_CollabToolbarState == CollabToolbarState.Disabled)
            {
                return;
            }

            if (openPlastic)
            {
                PlasticWindow.Open();
            }

            if (showPopup)
            {
                ShowPopup(rect);
            }
        }
Exemplo n.º 4
0
            internal static void IfRepositoryIsEmpty(
                WorkspaceInfo wkInfo,
                string repository,
                bool isGluonWorkspace,
                IPlasticAPI plasticApi,
                IProgressControls progressControls,
                ICreateWorkspaceListener createWorkspaceListener,
                PlasticWindow plasticWindow)
            {
                RepositoryInfo repInfo           = null;
                bool           isEmptyRepository = false;

                progressControls.ShowProgress(string.Empty);

                IThreadWaiter waiter = ThreadWaiter.GetWaiter(10);

                waiter.Execute(
                    /*threadOperationDelegate*/ delegate
                {
                    RepositorySpec repSpec = new SpecGenerator().
                                             GenRepositorySpec(false, repository);

                    repInfo = plasticApi.GetRepositoryInfo(repSpec);

                    isEmptyRepository = IsEmptyRepositoryCondition.
                                        Evaluate(wkInfo, repSpec, plasticApi);
                },
                    /*afterOperationDelegate*/ delegate
                {
                    progressControls.HideProgress();

                    if (waiter.Exception != null)
                    {
                        DisplayException(progressControls, waiter.Exception);
                        return;
                    }

                    if (!SetupCloudProjectId.HasCloudProjectId())
                    {
                        SetupCloudProjectId.ForRepository(repInfo);
                    }

                    if (!isEmptyRepository)
                    {
                        plasticWindow.RefreshWorkspaceUI();
                        AssetMenu.AssetMenuItems.Enable();
                        return;
                    }

                    CheckinPackagesAndProjectSettingsFolders(
                        wkInfo, isGluonWorkspace, plasticApi,
                        progressControls, createWorkspaceListener);
                });
            }
Exemplo n.º 5
0
        PlasticWindow GetPlasticWindow()
        {
            var           windows       = Resources.FindObjectsOfTypeAll <PlasticWindow>();
            PlasticWindow plasticWindow = windows.Length > 0 ? windows[0] : null;

            if (plasticWindow == null)
            {
                plasticWindow = ShowWindow.Plastic();
            }

            return(plasticWindow);
        }
Exemplo n.º 6
0
        internal static PlasticWindow Plastic()
        {
            PlasticWindow window = EditorWindow.GetWindow <PlasticWindow>(
                UnityConstants.PLASTIC_WINDOW_TITLE,
                true,
                mConsoleWindowType,
                mProjectBrowserType);

            SetIcon(
                window,
                Images.GetImage(Images.Name.IconPlasticView));

            return(window);
        }
        static PlasticWindow ShowPlasticWindow(bool disableCollabWhenLoaded)
        {
            PlasticWindow window = EditorWindow.GetWindow <PlasticWindow>(
                UnityConstants.PLASTIC_WINDOW_TITLE,
                true,
                mConsoleWindowType,
                mProjectBrowserType);

            if (disableCollabWhenLoaded)
            {
                window.DisableCollabIfEnabledWhenLoaded();
            }

            window.SetupWindowTitle(false);

            return(window);
        }
Exemplo n.º 8
0
        internal WelcomeView(
            PlasticWindow parentWindow,
            CreateWorkspaceView.ICreateWorkspaceListener createWorkspaceListener,
            PlasticAPI plasticApi,
            CmConnection cmConnection,
            IPlasticWebRestApi plasticWebRestApi)
        {
            mParentWindow            = parentWindow;
            mCreateWorkspaceListener = createWorkspaceListener;
            mPlasticApi        = plasticApi;
            mCmConnection      = cmConnection;
            mPlasticWebRestApi = plasticWebRestApi;

            mGuiMessage        = new UnityPlasticGuiMessage(parentWindow);
            mConfigureProgress = new ProgressControlsForViews();

            mInstallerFile = GetInstallerTmpFileName.ForPlatform();
        }
Exemplo n.º 9
0
        internal CreateWorkspaceView(
            PlasticWindow parentWindow,
            ICreateWorkspaceListener listener,
            PlasticAPI plasticApi,
            IPlasticWebRestApi plasticWebRestApi,
            string workspacePath)
        {
            mParentWindow            = parentWindow;
            mCreateWorkspaceListener = listener;
            mWorkspacePath           = workspacePath;
            mPlasticWebRestApi       = plasticWebRestApi;

            mProgressControls     = new ProgressControlsForViews();
            mWorkspaceOperations  = new WorkspaceOperations(this, mProgressControls);
            mCreateWorkspaceState = CreateWorkspaceViewState.BuildForProjectDefaults();

            Initialize(plasticApi, plasticWebRestApi);
        }
Exemplo n.º 10
0
 internal IncomingChangesNotifier(
     PlasticWindow plasticWindow)
 {
     mPlasticWindow = plasticWindow;
 }
Exemplo n.º 11
0
        void IAssetMenuOperations.ShowPendingChanges()
        {
            PlasticWindow plasticWindow = EditorWindow.GetWindow <PlasticWindow>();

            plasticWindow.ShowPendingChanges();
        }
Exemplo n.º 12
0
        void IAssetMenuOperations.ShowHistory()
        {
            PlasticWindow plasticWindow = EditorWindow.GetWindow <PlasticWindow>();

            plasticWindow.ShowHistory();
        }
Exemplo n.º 13
0
        void IAssetMenuOperations.Undo()
        {
            PlasticWindow plasticWindow = EditorWindow.GetWindow <PlasticWindow>();

            plasticWindow.Undo();
        }
Exemplo n.º 14
0
        void IAssetMenuOperations.Checkout()
        {
            PlasticWindow plasticWindow = EditorWindow.GetWindow <PlasticWindow>();

            plasticWindow.Checkout();
        }
 internal IncomingChangesNotificationPanel(
     PlasticWindow plasticWindow)
 {
     mPlasticWindow = plasticWindow;
 }