mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Merge VS Code 1.21 source code (#1067)
* Initial VS Code 1.21 file copy with patches * A few more merges * Post npm install * Fix batch of build breaks * Fix more build breaks * Fix more build errors * Fix more build breaks * Runtime fixes 1 * Get connection dialog working with some todos * Fix a few packaging issues * Copy several node_modules to package build to fix loader issues * Fix breaks from master * A few more fixes * Make tests pass * First pass of license header updates * Second pass of license header updates * Fix restore dialog issues * Remove add additional themes menu items * fix select box issues where the list doesn't show up * formatting * Fix editor dispose issue * Copy over node modules to correct location on all platforms
This commit is contained in:
@@ -8,12 +8,10 @@
|
||||
import Event, { filterEvent, mapEvent, anyEvent } from 'vs/base/common/event';
|
||||
import { TPromise } from 'vs/base/common/winjs.base';
|
||||
import { IWindowService, IWindowsService, INativeOpenDialogOptions, IEnterWorkspaceResult, IMessageBoxResult, IWindowConfiguration } from 'vs/platform/windows/common/windows';
|
||||
import { remote } from 'electron';
|
||||
import { IRecentlyOpened } from 'vs/platform/history/common/history';
|
||||
import { ICommandAction } from 'vs/platform/actions/common/actions';
|
||||
import { isMacintosh } from 'vs/base/common/platform';
|
||||
import { normalizeNFC } from 'vs/base/common/strings';
|
||||
import { IWorkspaceFolderCreationData } from 'vs/platform/workspaces/common/workspaces';
|
||||
import { ParsedArgs } from 'vs/platform/environment/common/environment';
|
||||
|
||||
export class WindowService implements IWindowService {
|
||||
|
||||
@@ -63,8 +61,8 @@ export class WindowService implements IWindowService {
|
||||
return this.windowsService.pickWorkspaceAndOpen(options);
|
||||
}
|
||||
|
||||
reloadWindow(): TPromise<void> {
|
||||
return this.windowsService.reloadWindow(this.windowId);
|
||||
reloadWindow(args?: ParsedArgs): TPromise<void> {
|
||||
return this.windowsService.reloadWindow(this.windowId, args);
|
||||
}
|
||||
|
||||
openDevTools(): TPromise<void> {
|
||||
@@ -123,42 +121,16 @@ export class WindowService implements IWindowService {
|
||||
return this.windowsService.showWindow(this.windowId);
|
||||
}
|
||||
|
||||
showMessageBox(options: Electron.MessageBoxOptions): number {
|
||||
return remote.dialog.showMessageBox(remote.getCurrentWindow(), options);
|
||||
showMessageBox(options: Electron.MessageBoxOptions): TPromise<IMessageBoxResult> {
|
||||
return this.windowsService.showMessageBox(this.windowId, options);
|
||||
}
|
||||
|
||||
showMessageBoxWithCheckbox(options: Electron.MessageBoxOptions): TPromise<IMessageBoxResult> {
|
||||
return new TPromise((c, e) => {
|
||||
return remote.dialog.showMessageBox(remote.getCurrentWindow(), options, (response: number, checkboxChecked: boolean) => {
|
||||
c({ button: response, checkboxChecked });
|
||||
});
|
||||
});
|
||||
showSaveDialog(options: Electron.SaveDialogOptions): TPromise<string> {
|
||||
return this.windowsService.showSaveDialog(this.windowId, options);
|
||||
}
|
||||
|
||||
showSaveDialog(options: Electron.SaveDialogOptions): string {
|
||||
|
||||
function normalizePath(path: string): string {
|
||||
if (path && isMacintosh) {
|
||||
path = normalizeNFC(path); // normalize paths returned from the OS
|
||||
}
|
||||
|
||||
return path;
|
||||
}
|
||||
|
||||
return normalizePath(remote.dialog.showSaveDialog(remote.getCurrentWindow(), options)); // https://github.com/electron/electron/issues/4936
|
||||
}
|
||||
|
||||
showOpenDialog(options: Electron.OpenDialogOptions): string[] {
|
||||
|
||||
function normalizePaths(paths: string[]): string[] {
|
||||
if (paths && paths.length > 0 && isMacintosh) {
|
||||
paths = paths.map(path => normalizeNFC(path)); // normalize paths returned from the OS
|
||||
}
|
||||
|
||||
return paths;
|
||||
}
|
||||
|
||||
return normalizePaths(remote.dialog.showOpenDialog(remote.getCurrentWindow(), options)); // https://github.com/electron/electron/issues/4936
|
||||
showOpenDialog(options: Electron.OpenDialogOptions): TPromise<string[]> {
|
||||
return this.windowsService.showOpenDialog(this.windowId, options);
|
||||
}
|
||||
|
||||
updateTouchBar(items: ICommandAction[][]): TPromise<void> {
|
||||
|
||||
Reference in New Issue
Block a user