internal static void EnableForWorkspace() { if (sIsEnabledForWorkspace) { return; } WorkspaceInfo wkInfo = FindWorkspace.InfoForApplicationPath( Application.dataPath, PlasticApp.PlasticAPI); if (wkInfo == null) { return; } sIsEnabledForWorkspace = true; PlasticApp.SetWorkspace(wkInfo); AssetStatusCache = new AssetStatusCache( wkInfo, PlasticApp.PlasticAPI.IsGluonWorkspace(wkInfo)); AssetMenuItems.Enable(); AssetsProcessors.Enable(); DrawAssetOverlay.Enable(); DrawInspectorOperations.Enable(); }
void UpdateProgress() { if (mProgress == 0) { return; } mProgressBar.style.display = DisplayStyle.Flex; if (mProgress == 1) { mProgressBar.value = 20f; mProgressBar.title = mProgressBar.value.ToString() + "%"; mTurnedOffLabel.text = PlasticLocalization.GetString( PlasticLocalization.Name.TurnOffPlasticSCMClosingWindow); mPlasticWindow = Resources.FindObjectsOfTypeAll <PlasticWindow>().First(); mPlasticWindow.Close(); mProgress = 2; return; } if (mProgress == 2) { mProgressBar.value = 50f; mProgressBar.title = mProgressBar.value.ToString() + "%"; mTurnedOffLabel.text = PlasticLocalization.GetString( PlasticLocalization.Name.TurnOffPlasticSCMCleaning); SetupCloudProjectId.SetCloudProjectId(""); mProgress = 3; return; } if (mProgress == 3) { mProgressBar.value = 75f; mProgressBar.title = mProgressBar.value.ToString() + "%"; mTurnedOffLabel.text = PlasticLocalization.GetString( PlasticLocalization.Name.TurnOffPlasticSCMDeleting); WorkspaceInfo workspaceInfo = FindWorkspace.InfoForApplicationPath( Application.dataPath, PlasticApp.PlasticAPI); Plastic.API.RemoveWorkspace(workspaceInfo); DrawInspectorOperations.Disable(); DrawSceneOperations.Disable(); mProgress = 4; return; } if (mProgress == 4) { mProgressBar.value = 100f; mProgressBar.title = mProgressBar.value.ToString() + "%"; mTurnedOffLabel.text = PlasticLocalization.GetString( PlasticLocalization.Name.Done); mProgress = 9999; return; } }
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(); }
internal static void Disable() { try { PlasticApp.Dispose(); if (!sIsEnabledForWorkspace) { return; } AssetsProcessors.Disable(); AssetMenuItems.Disable(); DrawAssetOverlay.Disable(); DrawInspectorOperations.Disable(); } finally { sIsEnabled = false; sIsEnabledForWorkspace = false; } }
internal void InitializePlastic() { if (mForceToOpen) { mForceToOpen = false; return; } try { if (UnityConfigurationChecker.NeedsConfiguration()) { return; } mWkInfo = FindWorkspace.InfoForApplicationPath( Application.dataPath, mPlasticAPI); if (mWkInfo == null) { return; } MonoFileSystemWatcher.IsEnabled = true; SetupCloudProjectIdIfNeeded(mWkInfo, mPlasticAPI); DisableVCSIfEnabled(mWkInfo.ClientPath); mIsGluonMode = mPlasticAPI.IsGluonWorkspace(mWkInfo); IAssetStatusCache assetStatusCache = new AssetStatusCache( mWkInfo, mIsGluonMode, RepaintProjectWindow); AssetsProcessors.Enable( mPlasticAPI, assetStatusCache); if (mEventSenderScheduler != null) { mPingEventLoop.SetWorkspace(mWkInfo); ((IPlasticWebRestApi)mPlasticWebRestApi).SetToken( CmConnection.Get().BuildWebApiTokenForCloudEditionDefaultUser()); } InitializeNewIncomingChanges(mWkInfo, mIsGluonMode); ViewHost viewHost = new ViewHost(); PlasticGui.WorkspaceWindow.PendingChanges.PendingChanges pendingChanges = new PlasticGui.WorkspaceWindow.PendingChanges.PendingChanges(mWkInfo); mViewSwitcher = new ViewSwitcher( mWkInfo, viewHost, mIsGluonMode, pendingChanges, mDeveloperNewIncomingChangesUpdater, mGluonNewIncomingChangesUpdater, mIncomingChangesNotifier, assetStatusCache, mStatusBar, this); mCooldownAutoRefreshPendingChangesAction = new CooldownWindowDelayer( mViewSwitcher.AutoRefreshPendingChangesView, UnityConstants.AUTO_REFRESH_PENDING_CHANGES_DELAYED_INTERVAL); mWorkspaceWindow = new WorkspaceWindow( mWkInfo, viewHost, mViewSwitcher, mViewSwitcher, mDeveloperNewIncomingChangesUpdater, this); mViewSwitcher.SetWorkspaceWindow(mWorkspaceWindow); mViewSwitcher.ShowInitialView(); UnityStyles.Initialize(Repaint); AssetOperations.IAssetSelection inspectorAssetSelection = new InspectorAssetSelection(); AssetOperations.IAssetSelection projectViewAssetSelection = new ProjectViewAssetSelection(); AssetOperations inspectorAssetOperations = new AssetOperations( mWkInfo, mWorkspaceWindow, mViewSwitcher, mViewSwitcher, viewHost, mDeveloperNewIncomingChangesUpdater, assetStatusCache, mViewSwitcher, mViewSwitcher, this, inspectorAssetSelection, mIsGluonMode); mAssetOperations = new AssetOperations( mWkInfo, mWorkspaceWindow, mViewSwitcher, mViewSwitcher, viewHost, mDeveloperNewIncomingChangesUpdater, assetStatusCache, mViewSwitcher, mViewSwitcher, this, projectViewAssetSelection, mIsGluonMode); DrawInspectorOperations.Enable( inspectorAssetOperations, assetStatusCache, inspectorAssetSelection); DrawAssetOverlay.Initialize( assetStatusCache, RepaintProjectWindow); mLastUpdateTime = EditorApplication.timeSinceStartup; mViewSwitcher.ShowBranchesViewIfNeeded(); } catch (Exception ex) { mException = ex; ExceptionsHandler.HandleException("InitializePlastic", ex); } }
internal void InitializePlastic() { if (mForceToOpen) { mForceToOpen = false; return; } try { if (UnityConfigurationChecker.NeedsConfiguration()) { return; } mWkInfo = FindWorkspace.InfoForApplicationPath( Application.dataPath, PlasticApp.PlasticAPI); if (mWkInfo == null) { return; } PlasticPlugin.EnableForWorkspace(); SetupCloudProjectIdIfNeeded(mWkInfo, PlasticApp.PlasticAPI); DisableVCSIfEnabled(mWkInfo.ClientPath); mIsGluonMode = PlasticApp.PlasticAPI.IsGluonWorkspace(mWkInfo); InitializeNewIncomingChanges(mWkInfo, mIsGluonMode); ViewHost viewHost = new ViewHost(); PlasticGui.WorkspaceWindow.PendingChanges.PendingChanges pendingChanges = new PlasticGui.WorkspaceWindow.PendingChanges.PendingChanges(mWkInfo); mViewSwitcher = new ViewSwitcher( mWkInfo, viewHost, mIsGluonMode, pendingChanges, mDeveloperNewIncomingChangesUpdater, mGluonNewIncomingChangesUpdater, mIncomingChangesNotifier, PlasticPlugin.AssetStatusCache, mStatusBar, this); mCooldownAutoRefreshPendingChangesAction = new CooldownWindowDelayer( mViewSwitcher.AutoRefreshPendingChangesView, UnityConstants.AUTO_REFRESH_PENDING_CHANGES_DELAYED_INTERVAL); mWorkspaceWindow = new WorkspaceWindow( mWkInfo, viewHost, mViewSwitcher, mViewSwitcher, mDeveloperNewIncomingChangesUpdater, this); mViewSwitcher.SetWorkspaceWindow(mWorkspaceWindow); mViewSwitcher.ShowInitialView(); UnityStyles.Initialize(Repaint); AssetOperations.IAssetSelection projectViewAssetSelection = new ProjectViewAssetSelection(); mAssetOperations = new AssetOperations( mWkInfo, mWorkspaceWindow, mViewSwitcher, mViewSwitcher, viewHost, mDeveloperNewIncomingChangesUpdater, PlasticPlugin.AssetStatusCache, mViewSwitcher, mViewSwitcher, this, projectViewAssetSelection, mIsGluonMode); DrawInspectorOperations.BuildOperations( mWkInfo, mWorkspaceWindow, mViewSwitcher, mViewSwitcher, viewHost, mDeveloperNewIncomingChangesUpdater, mViewSwitcher, mViewSwitcher, this, mIsGluonMode); DrawSceneOperations.Initialize( mWorkspaceWindow, viewHost, mDeveloperNewIncomingChangesUpdater, mIsGluonMode); mLastUpdateTime = EditorApplication.timeSinceStartup; mViewSwitcher.ShowBranchesViewIfNeeded(); } catch (Exception ex) { mException = ex; ExceptionsHandler.HandleException("InitializePlastic", ex); } }
void InitializePlastic() { if (mForceToOpen) { mForceToOpen = false; return; } try { if (UnityConfigurationChecker.NeedsConfiguration()) { return; } mWkInfo = FindWorkspace.InfoForApplicationPath( Application.dataPath, mPlasticAPI); if (mWkInfo == null) { AssetMenuItems.Disable(); return; } // SetupCloudProjectId.ForWorkspace(mWkInfo, mPlasticAPI); DisableVCSIfEnabled(mWkInfo.ClientPath); mIsGluonMode = mPlasticAPI.IsGluonWorkspace(mWkInfo); IAssetStatusCache assetStatusCache = new AssetStatusCache( mWkInfo, mIsGluonMode, RepaintProjectWindow); AssetsProcessors.Enable( mPlasticAPI, assetStatusCache); mPingEventLoop.SetWorkspace(mWkInfo); mEventSenderRestApi.SetToken(BuildToken.FromServerProfile( ClientConfig.Get().GetDefaultProfile())); InitializeNewIncomingChanges(mWkInfo, mIsGluonMode); ViewHost viewHost = new ViewHost(); PlasticGui.WorkspaceWindow.PendingChanges.PendingChanges pendingChanges = new PlasticGui.WorkspaceWindow.PendingChanges.PendingChanges(mWkInfo); mViewSwitcher = new ViewSwitcher( mWkInfo, viewHost, mIsGluonMode, pendingChanges, mDeveloperNewIncomingChangesUpdater, mGluonNewIncomingChangesUpdater, mIncomingChangesNotificationPanel, assetStatusCache, this); mPlasticClient = new PlasticGUIClient( mWkInfo, mViewSwitcher, mViewSwitcher, viewHost, pendingChanges, mDeveloperNewIncomingChangesUpdater, mGluonNewIncomingChangesUpdater, this, new UnityPlasticGuiMessage(this)); mViewSwitcher.SetPlasticGUIClient(mPlasticClient); mViewSwitcher.ShowInitialView(); UnityStyles.Initialize(Repaint); AssetOperations.IAssetSelection inspectorAssetSelection = new InspectorAssetSelection(); AssetOperations.IAssetSelection projectViewAssetSelection = new ProjectViewAssetSelection(); AssetOperations inspectorAssetOperations = new AssetOperations( mWkInfo, mPlasticClient, mViewSwitcher, mViewSwitcher, viewHost, mDeveloperNewIncomingChangesUpdater, assetStatusCache, mViewSwitcher, mViewSwitcher, this, inspectorAssetSelection, mIsGluonMode); AssetOperations projectViewAssetOperations = new AssetOperations( mWkInfo, mPlasticClient, mViewSwitcher, mViewSwitcher, viewHost, mDeveloperNewIncomingChangesUpdater, assetStatusCache, mViewSwitcher, mViewSwitcher, this, projectViewAssetSelection, mIsGluonMode); AssetMenuItems.Enable( projectViewAssetOperations, assetStatusCache, projectViewAssetSelection); DrawInspectorOperations.Enable( inspectorAssetOperations, assetStatusCache, inspectorAssetSelection); DrawAssetOverlay.Initialize( assetStatusCache, RepaintProjectWindow); AutoCommitOperation.SetPlasticGUIClient(mPlasticClient); mLastUpdateTime = EditorApplication.timeSinceStartup; } catch (Exception ex) { mException = ex; ExceptionsHandler.HandleException("InitializePlastic", ex); } }