提交 df660488 编写于 作者: C Christof Marti

Hold back new setting (#12387)

上级 570b8d54
......@@ -241,7 +241,6 @@ const configurationValueWhitelist = [
'php.validate.enable',
'php.validate.run',
'workbench.welcome.enabled',
'workbench.startupEditor',
];
export function configurationTelemetry(telemetryService: ITelemetryService, configurationService: IConfigurationService): IDisposable {
......
......@@ -468,14 +468,7 @@ export class Workbench implements IPartService {
}
private openUntitledFile() {
const startupEditor = this.configurationService.lookup('workbench.startupEditor');
if (!startupEditor.user && !startupEditor.workspace) {
const welcomeEnabled = this.configurationService.lookup('workbench.welcome.enabled');
if (welcomeEnabled.value !== undefined && welcomeEnabled.value !== null) {
return !welcomeEnabled.value;
}
}
return startupEditor.value === 'newUntitledFile';
return !this.configurationService.lookup('workbench.welcome.enabled').value;
}
private initServices(): void {
......
......@@ -18,16 +18,10 @@ Registry.as<IConfigurationRegistry>(ConfigurationExtensions.Configuration)
'order': 7,
'title': localize('workbenchConfigurationTitle', "Workbench"),
'properties': {
'workbench.startupEditor': {
'type': 'string',
'enum': ['none', 'welcomePage', 'newUntitledFile'],
'enumDescriptions': [
localize({ comment: ['This is the description for a setting. Values surrounded by single quotes are not to be translated.'], key: 'workbench.startupEditor.none' }, "Start without an editor."),
localize({ comment: ['This is the description for a setting. Values surrounded by single quotes are not to be translated.'], key: 'workbench.startupEditor.welcomePage' }, "Open the Welcome page (default)."),
localize({ comment: ['This is the description for a setting. Values surrounded by single quotes are not to be translated.'], key: 'workbench.startupEditor.newUntitledFile' }, "Open a new untitled file."),
],
'default': 'welcomePage',
'description': localize('workbench.startupEditor', "Controls which editor is shown at startup, if none is restored from the previous session. Select 'none' to start without an editor, 'welcomePage' to open the Welcome page (default), 'newUntitledFile' to open a new untitled file (only when not opening a folder).")
'workbench.welcome.enabled': {
'type': 'boolean',
'default': true,
'description': localize('welcomePage.enabled', "When enabled, will show the Welcome page on startup.")
},
}
});
......
......@@ -42,8 +42,7 @@ import { IStorageService } from "vs/platform/storage/common/storage";
used();
const configurationKey = 'workbench.startupEditor';
const oldConfigurationKey = 'workbench.welcome.enabled';
const configurationKey = 'workbench.welcome.enabled';
const telemetryFrom = 'welcomePage';
export class WelcomePageContribution implements IWorkbenchContribution {
......@@ -77,14 +76,7 @@ export class WelcomePageContribution implements IWorkbenchContribution {
}
function isWelcomePageEnabled(configurationService: IConfigurationService) {
const startupEditor = configurationService.lookup(configurationKey);
if (!startupEditor.user && !startupEditor.workspace) {
const welcomeEnabled = configurationService.lookup(oldConfigurationKey);
if (welcomeEnabled.value !== undefined && welcomeEnabled.value !== null) {
return welcomeEnabled.value;
}
}
return startupEditor.value === 'welcomePage';
return configurationService.lookup(configurationKey).value;
}
export class WelcomePageAction extends Action {
......@@ -217,7 +209,7 @@ class WelcomePage {
showOnStartup.setAttribute('checked', 'checked');
}
showOnStartup.addEventListener('click', e => {
this.configurationEditingService.writeConfiguration(ConfigurationTarget.USER, { key: configurationKey, value: showOnStartup.checked ? 'welcomePage' : 'newUntitledFile' });
this.configurationEditingService.writeConfiguration(ConfigurationTarget.USER, { key: configurationKey, value: showOnStartup.checked });
});
recentlyOpened.then(({ folders }) => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册