提交 9519a05b 编写于 作者: J Joao Moreno

ipc: remove vscode:openNewWindow

#10587
上级 d3923d18
......@@ -231,12 +231,6 @@ export class WindowsManager implements IWindowsMainService, IWindowEventService
}
});
ipc.on('vscode:openNewWindow', () => {
this.logService.log('IPC#vscode-openNewWindow');
this.openNewWindow();
});
ipc.on('vscode:toggleFullScreen', (event, windowId: number) => {
this.logService.log('IPC#vscode:toggleFullScreen');
......
......@@ -26,6 +26,7 @@ export interface IWindowsService {
// TODO@joao: rename, shouldn't this be openWindow?
windowOpen(paths: string[], forceNewWindow?: boolean): TPromise<void>;
openNewWindow(): TPromise<void>;
}
export const IWindowService = createDecorator<IWindowService>('windowService');
......
......@@ -17,6 +17,7 @@ export interface IWindowsChannel extends IChannel {
call(command: 'toggleDevTools', arg: number): TPromise<void>;
call(command: 'windowOpen', arg: [string[], boolean]): TPromise<void>;
call(command: 'closeFolder', arg: number): TPromise<void>;
call(command: 'openNewWindow'): TPromise<void>;
call(command: string, arg?: any): TPromise<any>;
}
......@@ -33,6 +34,7 @@ export class WindowsChannel implements IWindowsChannel {
case 'toggleDevTools': return this.service.toggleDevTools(arg);
case 'windowOpen': return this.service.windowOpen(arg[0], arg[1]);
case 'closeFolder': return this.service.closeFolder(arg);
case 'openNewWindow': return this.service.openNewWindow();
}
}
}
......@@ -70,4 +72,8 @@ export class WindowsChannelClient implements IWindowsService {
closeFolder(windowId: number): TPromise<void> {
return this.channel.call('closeFolder', windowId);
}
openNewWindow(): TPromise<void> {
return this.channel.call('openNewWindow');
}
}
\ No newline at end of file
......@@ -74,4 +74,9 @@ export class WindowsService implements IWindowsService {
return TPromise.as(null);
}
openNewWindow(): TPromise<void> {
this.windowsMainService.openNewWindow();
return TPromise.as(null);
}
}
\ No newline at end of file
......@@ -139,21 +139,19 @@ export class CloseFolderAction extends Action {
export class NewWindowAction extends Action {
public static ID = 'workbench.action.newWindow';
public static LABEL = nls.localize('newWindow', "New Window");
static ID = 'workbench.action.newWindow';
static LABEL = nls.localize('newWindow', "New Window");
constructor(
id: string,
label: string,
@IWindowIPCService private windowService: IWindowIPCService
@IWindowsService private windowsService: IWindowsService
) {
super(id, label);
}
public run(): TPromise<boolean> {
this.windowService.getWindow().openNew();
return TPromise.as(true);
run(): TPromise<void> {
return this.windowsService.openNewWindow();
}
}
......
......@@ -142,10 +142,6 @@ export class ElectronWindow {
})).then(res => res.some(res => !!res));
}
public openNew(): void {
ipc.send('vscode:openNewWindow'); // handled from browser process
}
public close(): void {
this.win.close();
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册