mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Merge from vscode c58aaab8a1cc22a7139b761166a0d4f37d41e998 (#7880)
* Merge from vscode c58aaab8a1cc22a7139b761166a0d4f37d41e998 * fix pipelines * fix strict-null-checks * add missing files
This commit is contained in:
@@ -4,14 +4,14 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { MessageBoxOptions, SaveDialogOptions, OpenDialogOptions, dialog, FileFilter, BrowserWindow } from 'electron';
|
||||
import { MessageBoxOptions, MessageBoxReturnValue, SaveDialogOptions, SaveDialogReturnValue, OpenDialogOptions, OpenDialogReturnValue, dialog, FileFilter, BrowserWindow } from 'electron';
|
||||
import { Queue } from 'vs/base/common/async';
|
||||
import { IStateService } from 'vs/platform/state/node/state';
|
||||
import { isMacintosh } from 'vs/base/common/platform';
|
||||
import { dirname } from 'vs/base/common/path';
|
||||
import { normalizeNFC } from 'vs/base/common/normalization';
|
||||
import { exists } from 'vs/base/node/pfs';
|
||||
import { INativeOpenDialogOptions, MessageBoxReturnValue, SaveDialogReturnValue, OpenDialogReturnValue } from 'vs/platform/dialogs/node/dialogs';
|
||||
import { INativeOpenDialogOptions } from 'vs/platform/dialogs/node/dialogs';
|
||||
import { withNullAsUndefined } from 'vs/base/common/types';
|
||||
import { localize } from 'vs/nls';
|
||||
import { WORKSPACE_FILTER } from 'vs/platform/workspaces/common/workspaces';
|
||||
@@ -139,13 +139,11 @@ export class DialogMainService implements IDialogMainService {
|
||||
|
||||
showMessageBox(options: MessageBoxOptions, window?: BrowserWindow): Promise<MessageBoxReturnValue> {
|
||||
return this.getDialogQueue(window).queue(async () => {
|
||||
return new Promise(resolve => {
|
||||
if (window) {
|
||||
return dialog.showMessageBox(window, options, (response, checkboxChecked) => resolve({ response, checkboxChecked }));
|
||||
}
|
||||
if (window) {
|
||||
return dialog.showMessageBox(window, options);
|
||||
}
|
||||
|
||||
return dialog.showMessageBox(options);
|
||||
});
|
||||
return dialog.showMessageBox(options);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -160,17 +158,16 @@ export class DialogMainService implements IDialogMainService {
|
||||
}
|
||||
|
||||
return this.getDialogQueue(window).queue(async () => {
|
||||
return new Promise<SaveDialogReturnValue>(resolve => {
|
||||
if (window) {
|
||||
dialog.showSaveDialog(window, options, filePath => resolve({ filePath }));
|
||||
} else {
|
||||
dialog.showSaveDialog(options, filePath => resolve({ filePath }));
|
||||
}
|
||||
}).then(result => {
|
||||
result.filePath = normalizePath(result.filePath);
|
||||
let result: SaveDialogReturnValue;
|
||||
if (window) {
|
||||
result = await dialog.showSaveDialog(window, options);
|
||||
} else {
|
||||
result = await dialog.showSaveDialog(options);
|
||||
}
|
||||
|
||||
return result;
|
||||
});
|
||||
result.filePath = normalizePath(result.filePath);
|
||||
|
||||
return result;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -195,17 +192,16 @@ export class DialogMainService implements IDialogMainService {
|
||||
}
|
||||
|
||||
// Show dialog
|
||||
return new Promise<OpenDialogReturnValue>(resolve => {
|
||||
if (window) {
|
||||
dialog.showOpenDialog(window, options, filePaths => resolve({ filePaths }));
|
||||
} else {
|
||||
dialog.showOpenDialog(options, filePaths => resolve({ filePaths }));
|
||||
}
|
||||
}).then(result => {
|
||||
result.filePaths = normalizePaths(result.filePaths);
|
||||
let result: OpenDialogReturnValue;
|
||||
if (window) {
|
||||
result = await dialog.showOpenDialog(window, options);
|
||||
} else {
|
||||
result = await dialog.showOpenDialog(options);
|
||||
}
|
||||
|
||||
return result;
|
||||
});
|
||||
result.filePaths = normalizePaths(result.filePaths);
|
||||
|
||||
return result;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,16 +13,3 @@ export interface INativeOpenDialogOptions {
|
||||
telemetryEventName?: string;
|
||||
telemetryExtraData?: ITelemetryData;
|
||||
}
|
||||
|
||||
export interface MessageBoxReturnValue {
|
||||
response: number;
|
||||
checkboxChecked: boolean;
|
||||
}
|
||||
|
||||
export interface SaveDialogReturnValue {
|
||||
filePath?: string;
|
||||
}
|
||||
|
||||
export interface OpenDialogReturnValue {
|
||||
filePaths?: string[];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user