提交 d71cb023 编写于 作者: D Daniel Imms

Adopt appExit -> onExit naming

上级 1af3873a
...@@ -38,9 +38,9 @@ export class BackupMainService implements IBackupMainService { ...@@ -38,9 +38,9 @@ export class BackupMainService implements IBackupMainService {
public getWorkspaceBackupPaths(): string[] { public getWorkspaceBackupPaths(): string[] {
const config = this.configurationService.getConfiguration<IFilesConfiguration>(); const config = this.configurationService.getConfiguration<IFilesConfiguration>();
if (config && config.files && config.files.hotExit === HotExitConfiguration.APP_EXIT_AND_WINDOW_CLOSE) { if (config && config.files && config.files.hotExit === HotExitConfiguration.ON_EXIT_AND_WINDOW_CLOSE) {
// Only non-folder windows are restored on main process launch when // Only non-folder windows are restored on main process launch when
// hot exit is configured as appExitAndWindowClose. // hot exit is configured as onExitAndWindowClose.
return []; return [];
} }
return this.backups.folderWorkspaces.slice(0); // return a copy return this.backups.folderWorkspaces.slice(0); // return a copy
......
...@@ -492,8 +492,8 @@ export const AutoSaveConfiguration = { ...@@ -492,8 +492,8 @@ export const AutoSaveConfiguration = {
export const HotExitConfiguration = { export const HotExitConfiguration = {
OFF: 'off', OFF: 'off',
APP_EXIT: 'appExit', ON_EXIT: 'onExit',
APP_EXIT_AND_WINDOW_CLOSE: 'appExitAndWindowClose' ON_EXIT_AND_WINDOW_CLOSE: 'onExitAndWindowClose'
}; };
export const CONTENT_CHANGE_EVENT_BUFFER_DELAY = 1000; export const CONTENT_CHANGE_EVENT_BUFFER_DELAY = 1000;
......
...@@ -245,9 +245,9 @@ configurationRegistry.registerConfiguration({ ...@@ -245,9 +245,9 @@ configurationRegistry.registerConfiguration({
}, },
'files.hotExit': { 'files.hotExit': {
'type': 'string', 'type': 'string',
'enum': [HotExitConfiguration.OFF, HotExitConfiguration.APP_EXIT, HotExitConfiguration.APP_EXIT_AND_WINDOW_CLOSE], 'enum': [HotExitConfiguration.OFF, HotExitConfiguration.ON_EXIT, HotExitConfiguration.ON_EXIT_AND_WINDOW_CLOSE],
'default': HotExitConfiguration.APP_EXIT, 'default': HotExitConfiguration.ON_EXIT,
'description': nls.localize('hotExit', "Whether hot exit is enabled which allows changes to unsaved files to be remembered between sessions, hiding the prompt t save when exiting the editor. Selecting \"{0}\" means that hot exit will only be triggered when the application is closed (workbench.action.quit command via command pallete, keybinding of menu) and ALL windows with backups will be restored upon next launch. Selecting \"{1}\" will trigger hot exit when any FOLDER window is closed, only NON-FOLDER windows will be restored when the application is restarted (not FOLDER workspaces).", HotExitConfiguration.APP_EXIT, HotExitConfiguration.APP_EXIT_AND_WINDOW_CLOSE) 'description': nls.localize('hotExit', "Whether hot exit is enabled which allows changes to unsaved files to be remembered between sessions, hiding the prompt t save when exiting the editor. Selecting \"{0}\" means that hot exit will only be triggered when the application is closed (workbench.action.quit command via command pallete, keybinding of menu) and ALL windows with backups will be restored upon next launch. Selecting \"{1}\" will trigger hot exit when any FOLDER window is closed, only NON-FOLDER windows will be restored when the application is restarted (not FOLDER workspaces).", HotExitConfiguration.ON_EXIT, HotExitConfiguration.ON_EXIT_AND_WINDOW_CLOSE)
} }
} }
}); });
......
...@@ -186,8 +186,8 @@ export abstract class TextFileService implements ITextFileService { ...@@ -186,8 +186,8 @@ export abstract class TextFileService implements ITextFileService {
let doBackup: boolean; let doBackup: boolean;
switch (reason) { switch (reason) {
case ShutdownReason.CLOSE: case ShutdownReason.CLOSE:
if (this.contextService.hasWorkspace() && this.configuredHotExit === HotExitConfiguration.APP_EXIT_AND_WINDOW_CLOSE) { if (this.contextService.hasWorkspace() && this.configuredHotExit === HotExitConfiguration.ON_EXIT_AND_WINDOW_CLOSE) {
doBackup = true; // backup if a folder is open and appExitAndWindowClose is configured doBackup = true; // backup if a folder is open and onExitAndWindowClose is configured
} else if (windowCount > 1 || platform.isMacintosh) { } else if (windowCount > 1 || platform.isMacintosh) {
doBackup = false; // do not backup if a window is closed that does not cause quitting of the application doBackup = false; // do not backup if a window is closed that does not cause quitting of the application
} else { } else {
...@@ -355,12 +355,12 @@ export abstract class TextFileService implements ITextFileService { ...@@ -355,12 +355,12 @@ export abstract class TextFileService implements ITextFileService {
} }
// Hot exit // Hot exit
const hotExitMode = configuration && configuration.files ? configuration.files.hotExit : HotExitConfiguration.APP_EXIT; const hotExitMode = configuration && configuration.files ? configuration.files.hotExit : HotExitConfiguration.ON_EXIT;
// Handle the legacy case where hot exit was a boolean // Handle the legacy case where hot exit was a boolean
if (<any>hotExitMode === false) { if (<any>hotExitMode === false) {
this.configuredHotExit = HotExitConfiguration.OFF; this.configuredHotExit = HotExitConfiguration.OFF;
} else if (<any>hotExitMode === true) { } else if (<any>hotExitMode === true) {
this.configuredHotExit = HotExitConfiguration.APP_EXIT; this.configuredHotExit = HotExitConfiguration.ON_EXIT;
} else { } else {
this.configuredHotExit = hotExitMode; this.configuredHotExit = hotExitMode;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册