提交 fae59489 编写于 作者: R Rachel Macfarlane

Update integrity once, not on each window create

上级 6c3c08c4
...@@ -15,6 +15,7 @@ import Severity from 'vs/base/common/severity'; ...@@ -15,6 +15,7 @@ import Severity from 'vs/base/common/severity';
import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage'; import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage';
import { ILifecycleService, LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle'; import { ILifecycleService, LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle';
import { INotificationService } from 'vs/platform/notification/common/notification'; import { INotificationService } from 'vs/platform/notification/common/notification';
import { IWindowsService } from 'vs/platform/windows/common/windows';
interface IStorageData { interface IStorageData {
dontShowPrompt: boolean; dontShowPrompt: boolean;
...@@ -64,7 +65,8 @@ export class IntegrityServiceImpl implements IIntegrityService { ...@@ -64,7 +65,8 @@ export class IntegrityServiceImpl implements IIntegrityService {
constructor( constructor(
@INotificationService private notificationService: INotificationService, @INotificationService private notificationService: INotificationService,
@IStorageService storageService: IStorageService, @IStorageService storageService: IStorageService,
@ILifecycleService private lifecycleService: ILifecycleService @ILifecycleService private lifecycleService: ILifecycleService,
@IWindowsService private windowsService: IWindowsService
) { ) {
this._storage = new IntegrityStorage(storageService); this._storage = new IntegrityStorage(storageService);
...@@ -76,6 +78,8 @@ export class IntegrityServiceImpl implements IIntegrityService { ...@@ -76,6 +78,8 @@ export class IntegrityServiceImpl implements IIntegrityService {
return; return;
} }
this._prompt(); this._prompt();
this.windowsService.updateIntegrity(r.isPure);
}); });
} }
......
...@@ -86,7 +86,7 @@ export class TitlebarPart extends Part implements ITitleService { ...@@ -86,7 +86,7 @@ export class TitlebarPart extends Part implements ITitleService {
) { ) {
super(id, { hasTitle: false }, themeService); super(id, { hasTitle: false }, themeService);
this.properties = { isPure: true, isAdmin: false }; this.properties = { isAdmin: false };
this.activeEditorListeners = []; this.activeEditorListeners = [];
this.registerListeners(); this.registerListeners();
...@@ -193,11 +193,9 @@ export class TitlebarPart extends Part implements ITitleService { ...@@ -193,11 +193,9 @@ export class TitlebarPart extends Part implements ITitleService {
updateProperties(properties: ITitleProperties): void { updateProperties(properties: ITitleProperties): void {
const isAdmin = typeof properties.isAdmin === 'boolean' ? properties.isAdmin : this.properties.isAdmin; const isAdmin = typeof properties.isAdmin === 'boolean' ? properties.isAdmin : this.properties.isAdmin;
const isPure = typeof properties.isPure === 'boolean' ? properties.isPure : this.properties.isPure;
if (isAdmin !== this.properties.isAdmin || isPure !== this.properties.isPure) { if (isAdmin !== this.properties.isAdmin) {
this.properties.isAdmin = isAdmin; this.properties.isAdmin = isAdmin;
this.properties.isPure = isPure;
this.setTitle(this.getWindowTitle()); this.setTitle(this.getWindowTitle());
} }
......
...@@ -37,7 +37,6 @@ import { RunOnceScheduler } from 'vs/base/common/async'; ...@@ -37,7 +37,6 @@ import { RunOnceScheduler } from 'vs/base/common/async';
import { IDisposable, dispose } from 'vs/base/common/lifecycle'; import { IDisposable, dispose } from 'vs/base/common/lifecycle';
import { LifecyclePhase, ILifecycleService } from 'vs/platform/lifecycle/common/lifecycle'; import { LifecyclePhase, ILifecycleService } from 'vs/platform/lifecycle/common/lifecycle';
import { IWorkspaceFolderCreationData } from 'vs/platform/workspaces/common/workspaces'; import { IWorkspaceFolderCreationData } from 'vs/platform/workspaces/common/workspaces';
import { IIntegrityService } from 'vs/platform/integrity/common/integrity';
import { AccessibilitySupport, isRootUser, isWindows, isMacintosh } from 'vs/base/common/platform'; import { AccessibilitySupport, isRootUser, isWindows, isMacintosh } from 'vs/base/common/platform';
import product from 'vs/platform/node/product'; import product from 'vs/platform/node/product';
import { INotificationService } from 'vs/platform/notification/common/notification'; import { INotificationService } from 'vs/platform/notification/common/notification';
...@@ -84,8 +83,7 @@ export class ElectronWindow extends Themable { ...@@ -84,8 +83,7 @@ export class ElectronWindow extends Themable {
@IWorkspaceEditingService private workspaceEditingService: IWorkspaceEditingService, @IWorkspaceEditingService private workspaceEditingService: IWorkspaceEditingService,
@IFileService private fileService: IFileService, @IFileService private fileService: IFileService,
@IMenuService private menuService: IMenuService, @IMenuService private menuService: IMenuService,
@ILifecycleService private lifecycleService: ILifecycleService, @ILifecycleService private lifecycleService: ILifecycleService
@IIntegrityService private integrityService: IIntegrityService
) { ) {
super(themeService); super(themeService);
...@@ -286,12 +284,6 @@ export class ElectronWindow extends Themable { ...@@ -286,12 +284,6 @@ export class ElectronWindow extends Themable {
ipc.send('vscode:workbenchLoaded', this.windowService.getCurrentWindowId()); ipc.send('vscode:workbenchLoaded', this.windowService.getCurrentWindowId());
}); });
// Integrity warning
this.integrityService.isPure().then(res => {
this.titleService.updateProperties({ isPure: res.isPure });
this.windowsService.updateIntegrity(res.isPure);
});
// Root warning // Root warning
this.lifecycleService.when(LifecyclePhase.Running).then(() => { this.lifecycleService.when(LifecyclePhase.Running).then(() => {
let isAdminPromise: Promise<boolean>; let isAdminPromise: Promise<boolean>;
......
...@@ -9,7 +9,6 @@ import { createDecorator } from 'vs/platform/instantiation/common/instantiation' ...@@ -9,7 +9,6 @@ import { createDecorator } from 'vs/platform/instantiation/common/instantiation'
export const ITitleService = createDecorator<ITitleService>('titleService'); export const ITitleService = createDecorator<ITitleService>('titleService');
export interface ITitleProperties { export interface ITitleProperties {
isPure?: boolean;
isAdmin?: boolean; isAdmin?: boolean;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册