提交 f9d46f3a 编写于 作者: B Benjamin Pasero

migrate setting properly (for #207)

上级 afe53c73
......@@ -602,9 +602,9 @@ export class WindowsManager implements IWindowsMainService {
restoreWindows = 'all'; // always reopen all windows when an update was applied
} else {
const windowConfig = this.configurationService.getConfiguration<IWindowSettings>('window');
restoreWindows = (windowConfig && windowConfig.restoreWindows) as RestoreWindowsSetting;
restoreWindows = ((windowConfig && windowConfig.restoreWindows) || 'one') as RestoreWindowsSetting;
if (windowConfig && windowConfig.restoreWindows === 'one' /* default */ && windowConfig.reopenFolders) {
if (restoreWindows === 'one' /* default */ && windowConfig.reopenFolders) {
restoreWindows = windowConfig.reopenFolders; // TODO@Ben migration
}
......@@ -654,9 +654,12 @@ export class WindowsManager implements IWindowsMainService {
// let the user settings override how folders are open in a new window or same window unless we are forced
const windowConfig = this.configurationService.getConfiguration<IWindowSettings>('window');
const openFolderInNewWindowConfig = (windowConfig && windowConfig.openFoldersInNewWindow) || 'default' /* default */;
const openFilesInNewWindowConfig = (windowConfig && windowConfig.openFilesInNewWindow) || 'off' /* default */;
let openFolderInNewWindow = (openConfig.preferNewWindow || openConfig.forceNewWindow) && !openConfig.forceReuseWindow;
if (!openConfig.forceNewWindow && !openConfig.forceReuseWindow && windowConfig && (windowConfig.openFoldersInNewWindow === 'on' || windowConfig.openFoldersInNewWindow === 'off')) {
openFolderInNewWindow = (windowConfig.openFoldersInNewWindow === 'on');
if (!openConfig.forceNewWindow && !openConfig.forceReuseWindow && (openFolderInNewWindowConfig === 'on' || openFolderInNewWindowConfig === 'off')) {
openFolderInNewWindow = (openFolderInNewWindowConfig === 'on');
}
// let the user settings override how files are open in a new window or same window unless we are forced (not for extension development though)
......@@ -668,8 +671,8 @@ export class WindowsManager implements IWindowsMainService {
openFilesInNewWindow = true; // only on macOS do we allow to open files in a new window if this is triggered via DOCK context
}
if (!openConfig.cli.extensionDevelopmentPath && windowConfig && (windowConfig.openFilesInNewWindow === 'on' || windowConfig.openFilesInNewWindow === 'off')) {
openFilesInNewWindow = (windowConfig.openFilesInNewWindow === 'on');
if (!openConfig.cli.extensionDevelopmentPath && (openFilesInNewWindowConfig === 'on' || openFilesInNewWindowConfig === 'off')) {
openFilesInNewWindow = (openFilesInNewWindowConfig === 'on');
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册