提交 04398d1c 编写于 作者: B Benjamin Pasero

open workspace: option click to open in new window

上级 1d130910
......@@ -357,7 +357,7 @@ export class CodeMenu {
}
const open = new MenuItem(this.likeAction('workbench.action.files.openFileFolder', { label: this.mnemonicLabel(nls.localize({ key: 'miOpen', comment: ['&& denotes a mnemonic'] }, "&&Open...")), click: (menuItem, win, event) => this.windowsService.pickFileFolderAndOpen({ forceNewWindow: this.isOptionClick(event), telemetryExtraData: { from: telemetryFrom } }) }));
const openWorkspace = new MenuItem(this.likeAction('workbench.action.openWorkspace', { label: this.mnemonicLabel(nls.localize({ key: 'miOpenWorkspace', comment: ['&& denotes a mnemonic'] }, "&&Open Workspace...")), click: () => this.windowsService.openWorkspace() }));
const openWorkspace = new MenuItem(this.likeAction('workbench.action.openWorkspace', { label: this.mnemonicLabel(nls.localize({ key: 'miOpenWorkspace', comment: ['&& denotes a mnemonic'] }, "&&Open Workspace...")), click: (menuItem, win, event) => this.windowsService.openWorkspace(void 0, { forceNewWindow: this.isOptionClick(event) }) }));
const openFolder = new MenuItem(this.likeAction('workbench.action.files.openFolder', { label: this.mnemonicLabel(nls.localize({ key: 'miOpenFolder', comment: ['&& denotes a mnemonic'] }, "Open &&Folder...")), click: (menuItem, win, event) => this.windowsService.pickFolderAndOpen({ forceNewWindow: this.isOptionClick(event), telemetryExtraData: { from: telemetryFrom } }) }));
let openFile: Electron.MenuItem;
......
......@@ -1339,8 +1339,8 @@ export class WindowsManager implements IWindowsMainService {
return result;
}
public openWorkspace(win?: CodeWindow): void {
this.workspacesManager.openWorkspace(win);
public openWorkspace(win?: CodeWindow, options?: { forceNewWindow?: boolean }): void {
this.workspacesManager.openWorkspace(win, options);
}
private onBeforeWindowUnload(e: IWindowUnloadEvent): void {
......@@ -1618,7 +1618,7 @@ class FileDialog {
});
}
public getFileOrFolderPaths(options: IInternalNativeOpenDialogOptions, clb: (paths: string[]) => void): void {
private getFileOrFolderPaths(options: IInternalNativeOpenDialogOptions, clb: (paths: string[]) => void): void {
// Ensure dialog options
if (!options.dialogOptions) {
......@@ -1755,7 +1755,7 @@ class WorkspacesManager {
});
}
public openWorkspace(window = this.windowsMainService.getLastActiveWindow()): void {
public openWorkspace(window = this.windowsMainService.getLastActiveWindow(), options?: { forceNewWindow?: boolean }): void {
let defaultPath: string;
if (window && window.openedWorkspace && !this.workspacesService.isUntitledWorkspace(window.openedWorkspace)) {
defaultPath = dirname(window.openedWorkspace.configPath);
......@@ -1771,7 +1771,8 @@ class WorkspacesManager {
filters: WORKSPACE_FILTER,
properties: ['openFile'],
defaultPath
}
},
forceNewWindow: options && options.forceNewWindow
});
}
......
......@@ -60,7 +60,7 @@ export interface IWindowsMainService {
// methods
ready(initialUserEnv: IProcessEnvironment): void;
reload(win: ICodeWindow, cli?: ParsedArgs): void;
openWorkspace(win?: ICodeWindow): void;
openWorkspace(win?: ICodeWindow, options?: { forceNewWindow?: boolean }): void;
createAndEnterWorkspace(win: ICodeWindow, folderPaths?: string[], path?: string): TPromise<IEnterWorkspaceResult>;
saveAndEnterWorkspace(win: ICodeWindow, path: string): TPromise<IEnterWorkspaceResult>;
closeWorkspace(win: ICodeWindow): void;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册