dialogs - fill in proper options used elsewhere
This commit is contained in:
parent
d0191db633
commit
71be3b3641
|
@ -851,6 +851,7 @@ export class CodeApplication extends Disposable {
|
||||||
mnemonicButtonLabel(localize({ key: 'open', comment: ['&& denotes a mnemonic'] }, "&&Yes")),
|
mnemonicButtonLabel(localize({ key: 'open', comment: ['&& denotes a mnemonic'] }, "&&Yes")),
|
||||||
mnemonicButtonLabel(localize({ key: 'cancel', comment: ['&& denotes a mnemonic'] }, "&&No")),
|
mnemonicButtonLabel(localize({ key: 'cancel', comment: ['&& denotes a mnemonic'] }, "&&No")),
|
||||||
],
|
],
|
||||||
|
defaultId: 0,
|
||||||
cancelId: 1,
|
cancelId: 1,
|
||||||
message: localize('confirmOpenMessage', "An external application wants to open '{0}' in {1}. Do you want to open this file or folder?", getPathLabel(uri.fsPath, this.environmentMainService), this.productService.nameShort),
|
message: localize('confirmOpenMessage', "An external application wants to open '{0}' in {1}. Do you want to open this file or folder?", getPathLabel(uri.fsPath, this.environmentMainService), this.productService.nameShort),
|
||||||
detail: localize('confirmOpenDetail', "If you did not initiate this request, it may represent an attempted attack on your system. Unless you took an explicit action to initiate this request, you should press 'No'"),
|
detail: localize('confirmOpenDetail', "If you did not initiate this request, it may represent an attempted attack on your system. Unless you took an explicit action to initiate this request, you should press 'No'"),
|
||||||
|
@ -1052,10 +1053,13 @@ export class CodeApplication extends Disposable {
|
||||||
|
|
||||||
if (!timeout) {
|
if (!timeout) {
|
||||||
dialogMainService.showMessageBox({
|
dialogMainService.showMessageBox({
|
||||||
|
title: this.productService.nameLong,
|
||||||
type: 'info',
|
type: 'info',
|
||||||
message: localize('trace.message', "Successfully created trace."),
|
message: localize('trace.message', "Successfully created trace."),
|
||||||
detail: localize('trace.detail', "Please create an issue and manually attach the following file:\n{0}", path),
|
detail: localize('trace.detail', "Please create an issue and manually attach the following file:\n{0}", path),
|
||||||
buttons: [localize('trace.ok', "OK")]
|
buttons: [mnemonicButtonLabel(localize({ key: 'trace.ok', comment: ['&& denotes a mnemonic'] }, "&&OK"))],
|
||||||
|
defaultId: 0,
|
||||||
|
noLink: true
|
||||||
}, withNullAsUndefined(BrowserWindow.getFocusedWindow()));
|
}, withNullAsUndefined(BrowserWindow.getFocusedWindow()));
|
||||||
} else {
|
} else {
|
||||||
this.logService.info(`Tracing: data recorded (after 30s timeout) to ${path}`);
|
this.logService.info(`Tracing: data recorded (after 30s timeout) to ${path}`);
|
||||||
|
|
|
@ -375,6 +375,7 @@ class CodeMain {
|
||||||
buttons: [mnemonicButtonLabel(localize({ key: 'close', comment: ['&& denotes a mnemonic'] }, "&&Close"))],
|
buttons: [mnemonicButtonLabel(localize({ key: 'close', comment: ['&& denotes a mnemonic'] }, "&&Close"))],
|
||||||
message,
|
message,
|
||||||
detail,
|
detail,
|
||||||
|
defaultId: 0,
|
||||||
noLink: true
|
noLink: true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,6 +22,8 @@ import { FileAccess } from 'vs/base/common/network';
|
||||||
import { INativeHostMainService } from 'vs/platform/native/electron-main/nativeHostMainService';
|
import { INativeHostMainService } from 'vs/platform/native/electron-main/nativeHostMainService';
|
||||||
import { IIPCObjectUrl, IProtocolMainService } from 'vs/platform/protocol/electron-main/protocol';
|
import { IIPCObjectUrl, IProtocolMainService } from 'vs/platform/protocol/electron-main/protocol';
|
||||||
import { DisposableStore } from 'vs/base/common/lifecycle';
|
import { DisposableStore } from 'vs/base/common/lifecycle';
|
||||||
|
import { mnemonicButtonLabel } from 'vs/base/common/labels';
|
||||||
|
import { IProductService } from 'vs/platform/product/common/productService';
|
||||||
|
|
||||||
export const IIssueMainService = createDecorator<IIssueMainService>('issueMainService');
|
export const IIssueMainService = createDecorator<IIssueMainService>('issueMainService');
|
||||||
|
|
||||||
|
@ -54,7 +56,8 @@ export class IssueMainService implements ICommonIssueService {
|
||||||
@IDiagnosticsService private readonly diagnosticsService: IDiagnosticsService,
|
@IDiagnosticsService private readonly diagnosticsService: IDiagnosticsService,
|
||||||
@IDialogMainService private readonly dialogMainService: IDialogMainService,
|
@IDialogMainService private readonly dialogMainService: IDialogMainService,
|
||||||
@INativeHostMainService private readonly nativeHostMainService: INativeHostMainService,
|
@INativeHostMainService private readonly nativeHostMainService: INativeHostMainService,
|
||||||
@IProtocolMainService private readonly protocolMainService: IProtocolMainService
|
@IProtocolMainService private readonly protocolMainService: IProtocolMainService,
|
||||||
|
@IProductService private readonly productService: IProductService
|
||||||
) {
|
) {
|
||||||
this.registerListeners();
|
this.registerListeners();
|
||||||
}
|
}
|
||||||
|
@ -99,12 +102,16 @@ export class IssueMainService implements ICommonIssueService {
|
||||||
|
|
||||||
ipcMain.on('vscode:issueReporterClipboard', async event => {
|
ipcMain.on('vscode:issueReporterClipboard', async event => {
|
||||||
const messageOptions = {
|
const messageOptions = {
|
||||||
|
title: this.productService.nameLong,
|
||||||
message: localize('issueReporterWriteToClipboard', "There is too much data to send to GitHub directly. The data will be copied to the clipboard, please paste it into the GitHub issue page that is opened."),
|
message: localize('issueReporterWriteToClipboard', "There is too much data to send to GitHub directly. The data will be copied to the clipboard, please paste it into the GitHub issue page that is opened."),
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
buttons: [
|
buttons: [
|
||||||
localize('ok', "OK"),
|
mnemonicButtonLabel(localize({ key: 'ok', comment: ['&& denotes a mnemonic'] }, "&&OK")),
|
||||||
localize('cancel', "Cancel")
|
mnemonicButtonLabel(localize({ key: 'cancel', comment: ['&& denotes a mnemonic'] }, "&&Cancel")),
|
||||||
]
|
],
|
||||||
|
defaultId: 0,
|
||||||
|
cancelId: 1,
|
||||||
|
noLink: true
|
||||||
};
|
};
|
||||||
|
|
||||||
if (this.issueReporterWindow) {
|
if (this.issueReporterWindow) {
|
||||||
|
@ -120,12 +127,16 @@ export class IssueMainService implements ICommonIssueService {
|
||||||
|
|
||||||
ipcMain.on('vscode:issueReporterConfirmClose', async () => {
|
ipcMain.on('vscode:issueReporterConfirmClose', async () => {
|
||||||
const messageOptions = {
|
const messageOptions = {
|
||||||
|
title: this.productService.nameLong,
|
||||||
message: localize('confirmCloseIssueReporter', "Your input will not be saved. Are you sure you want to close this window?"),
|
message: localize('confirmCloseIssueReporter', "Your input will not be saved. Are you sure you want to close this window?"),
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
buttons: [
|
buttons: [
|
||||||
localize('yes', "Yes"),
|
mnemonicButtonLabel(localize({ key: 'yes', comment: ['&& denotes a mnemonic'] }, "&&Yes")),
|
||||||
localize('cancel', "Cancel")
|
mnemonicButtonLabel(localize({ key: 'cancel', comment: ['&& denotes a mnemonic'] }, "&&Cancel")),
|
||||||
]
|
],
|
||||||
|
defaultId: 0,
|
||||||
|
cancelId: 1,
|
||||||
|
noLink: true
|
||||||
};
|
};
|
||||||
|
|
||||||
if (this.issueReporterWindow) {
|
if (this.issueReporterWindow) {
|
||||||
|
|
|
@ -33,6 +33,7 @@ import { memoize } from 'vs/base/common/decorators';
|
||||||
import { Disposable } from 'vs/base/common/lifecycle';
|
import { Disposable } from 'vs/base/common/lifecycle';
|
||||||
import { ISharedProcess } from 'vs/platform/sharedProcess/node/sharedProcess';
|
import { ISharedProcess } from 'vs/platform/sharedProcess/node/sharedProcess';
|
||||||
import { IThemeMainService } from 'vs/platform/theme/electron-main/themeMainService';
|
import { IThemeMainService } from 'vs/platform/theme/electron-main/themeMainService';
|
||||||
|
import { mnemonicButtonLabel } from 'vs/base/common/labels';
|
||||||
|
|
||||||
export interface INativeHostMainService extends AddFirstParameterToFunctions<ICommonNativeHostService, Promise<unknown> /* only methods, not events */, number | undefined /* window ID */> { }
|
export interface INativeHostMainService extends AddFirstParameterToFunctions<ICommonNativeHostService, Promise<unknown> /* only methods, not events */, number | undefined /* window ID */> { }
|
||||||
|
|
||||||
|
@ -291,9 +292,15 @@ export class NativeHostMainService extends Disposable implements INativeHostMain
|
||||||
}
|
}
|
||||||
|
|
||||||
const { response } = await this.showMessageBox(windowId, {
|
const { response } = await this.showMessageBox(windowId, {
|
||||||
|
title: this.productService.nameLong,
|
||||||
type: 'info',
|
type: 'info',
|
||||||
message: localize('warnEscalation', "{0} will now prompt with 'osascript' for Administrator privileges to install the shell command.", this.productService.nameShort),
|
message: localize('warnEscalation', "{0} will now prompt with 'osascript' for Administrator privileges to install the shell command.", this.productService.nameShort),
|
||||||
buttons: [localize('ok', "OK"), localize('cancel', "Cancel")],
|
buttons: [
|
||||||
|
mnemonicButtonLabel(localize({ key: 'ok', comment: ['&& denotes a mnemonic'] }, "&&OK")),
|
||||||
|
mnemonicButtonLabel(localize({ key: 'cancel', comment: ['&& denotes a mnemonic'] }, "&&Cancel")),
|
||||||
|
],
|
||||||
|
noLink: true,
|
||||||
|
defaultId: 0,
|
||||||
cancelId: 1
|
cancelId: 1
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -317,9 +324,15 @@ export class NativeHostMainService extends Disposable implements INativeHostMain
|
||||||
switch (error.code) {
|
switch (error.code) {
|
||||||
case 'EACCES':
|
case 'EACCES':
|
||||||
const { response } = await this.showMessageBox(windowId, {
|
const { response } = await this.showMessageBox(windowId, {
|
||||||
|
title: this.productService.nameLong,
|
||||||
type: 'info',
|
type: 'info',
|
||||||
message: localize('warnEscalationUninstall', "{0} will now prompt with 'osascript' for Administrator privileges to uninstall the shell command.", this.productService.nameShort),
|
message: localize('warnEscalationUninstall', "{0} will now prompt with 'osascript' for Administrator privileges to uninstall the shell command.", this.productService.nameShort),
|
||||||
buttons: [localize('ok', "OK"), localize('cancel', "Cancel")],
|
buttons: [
|
||||||
|
mnemonicButtonLabel(localize({ key: 'ok', comment: ['&& denotes a mnemonic'] }, "&&OK")),
|
||||||
|
mnemonicButtonLabel(localize({ key: 'cancel', comment: ['&& denotes a mnemonic'] }, "&&Cancel")),
|
||||||
|
],
|
||||||
|
noLink: true,
|
||||||
|
defaultId: 0,
|
||||||
cancelId: 1
|
cancelId: 1
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -604,10 +604,16 @@ export class CodeWindow extends Disposable implements ICodeWindow {
|
||||||
const result = await this.dialogMainService.showMessageBox({
|
const result = await this.dialogMainService.showMessageBox({
|
||||||
title: this.productService.nameLong,
|
title: this.productService.nameLong,
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
buttons: [mnemonicButtonLabel(localize({ key: 'reopen', comment: ['&& denotes a mnemonic'] }, "&&Reopen")), mnemonicButtonLabel(localize({ key: 'wait', comment: ['&& denotes a mnemonic'] }, "&&Keep Waiting")), mnemonicButtonLabel(localize({ key: 'close', comment: ['&& denotes a mnemonic'] }, "&&Close"))],
|
buttons: [
|
||||||
|
mnemonicButtonLabel(localize({ key: 'reopen', comment: ['&& denotes a mnemonic'] }, "&&Reopen")),
|
||||||
|
mnemonicButtonLabel(localize({ key: 'wait', comment: ['&& denotes a mnemonic'] }, "&&Keep Waiting")),
|
||||||
|
mnemonicButtonLabel(localize({ key: 'close', comment: ['&& denotes a mnemonic'] }, "&&Close"))
|
||||||
|
],
|
||||||
message: localize('appStalled', "The window is no longer responding"),
|
message: localize('appStalled', "The window is no longer responding"),
|
||||||
detail: localize('appStalledDetail', "You can reopen or close the window or keep waiting."),
|
detail: localize('appStalledDetail', "You can reopen or close the window or keep waiting."),
|
||||||
noLink: true
|
noLink: true,
|
||||||
|
defaultId: 0,
|
||||||
|
cancelId: 1
|
||||||
}, this._win);
|
}, this._win);
|
||||||
|
|
||||||
if (!this._win) {
|
if (!this._win) {
|
||||||
|
@ -634,10 +640,14 @@ export class CodeWindow extends Disposable implements ICodeWindow {
|
||||||
const result = await this.dialogMainService.showMessageBox({
|
const result = await this.dialogMainService.showMessageBox({
|
||||||
title: this.productService.nameLong,
|
title: this.productService.nameLong,
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
buttons: [mnemonicButtonLabel(localize({ key: 'reopen', comment: ['&& denotes a mnemonic'] }, "&&Reopen")), mnemonicButtonLabel(localize({ key: 'close', comment: ['&& denotes a mnemonic'] }, "&&Close"))],
|
buttons: [
|
||||||
|
mnemonicButtonLabel(localize({ key: 'reopen', comment: ['&& denotes a mnemonic'] }, "&&Reopen")),
|
||||||
|
mnemonicButtonLabel(localize({ key: 'close', comment: ['&& denotes a mnemonic'] }, "&&Close"))
|
||||||
|
],
|
||||||
message,
|
message,
|
||||||
detail: localize('appCrashedDetail', "We are sorry for the inconvenience! You can reopen the window to continue where you left off."),
|
detail: localize('appCrashedDetail', "We are sorry for the inconvenience. You can reopen the window to continue where you left off."),
|
||||||
noLink: true
|
noLink: true,
|
||||||
|
defaultId: 0
|
||||||
}, this._win);
|
}, this._win);
|
||||||
|
|
||||||
if (!this._win) {
|
if (!this._win) {
|
||||||
|
|
|
@ -41,7 +41,7 @@ import { IDialogMainService } from 'vs/platform/dialogs/electron-main/dialogMain
|
||||||
import { assertIsDefined, withNullAsUndefined } from 'vs/base/common/types';
|
import { assertIsDefined, withNullAsUndefined } from 'vs/base/common/types';
|
||||||
import { isWindowsDriveLetter, toSlashes, parseLineAndColumnAware, sanitizeFilePath } from 'vs/base/common/extpath';
|
import { isWindowsDriveLetter, toSlashes, parseLineAndColumnAware, sanitizeFilePath } from 'vs/base/common/extpath';
|
||||||
import { CharCode } from 'vs/base/common/charCode';
|
import { CharCode } from 'vs/base/common/charCode';
|
||||||
import { getPathLabel } from 'vs/base/common/labels';
|
import { getPathLabel, mnemonicButtonLabel } from 'vs/base/common/labels';
|
||||||
import { CancellationToken } from 'vs/base/common/cancellation';
|
import { CancellationToken } from 'vs/base/common/cancellation';
|
||||||
import { IFileService } from 'vs/platform/files/common/files';
|
import { IFileService } from 'vs/platform/files/common/files';
|
||||||
import { cwd } from 'vs/base/common/process';
|
import { cwd } from 'vs/base/common/process';
|
||||||
|
@ -702,7 +702,8 @@ export class WindowsMainService extends Disposable implements IWindowsMainServic
|
||||||
const options: MessageBoxOptions = {
|
const options: MessageBoxOptions = {
|
||||||
title: this.productService.nameLong,
|
title: this.productService.nameLong,
|
||||||
type: 'info',
|
type: 'info',
|
||||||
buttons: [localize('ok', "OK")],
|
buttons: [mnemonicButtonLabel(localize({ key: 'ok', comment: ['&& denotes a mnemonic'] }, "&&OK"))],
|
||||||
|
defaultId: 0,
|
||||||
message: uri.scheme === Schemas.file ? localize('pathNotExistTitle', "Path does not exist") : localize('uriInvalidTitle', "URI can not be opened"),
|
message: uri.scheme === Schemas.file ? localize('pathNotExistTitle', "Path does not exist") : localize('uriInvalidTitle', "URI can not be opened"),
|
||||||
detail: uri.scheme === Schemas.file ?
|
detail: uri.scheme === Schemas.file ?
|
||||||
localize('pathNotExistDetail', "The path '{0}' does not seem to exist anymore on disk.", getPathLabel(uri.fsPath, this.environmentMainService)) :
|
localize('pathNotExistDetail', "The path '{0}' does not seem to exist anymore on disk.", getPathLabel(uri.fsPath, this.environmentMainService)) :
|
||||||
|
|
|
@ -26,6 +26,7 @@ import { withNullAsUndefined } from 'vs/base/common/types';
|
||||||
import { IBackupMainService } from 'vs/platform/backup/electron-main/backup';
|
import { IBackupMainService } from 'vs/platform/backup/electron-main/backup';
|
||||||
import { IDialogMainService } from 'vs/platform/dialogs/electron-main/dialogMainService';
|
import { IDialogMainService } from 'vs/platform/dialogs/electron-main/dialogMainService';
|
||||||
import { findWindowOnWorkspaceOrFolder } from 'vs/platform/windows/electron-main/windowsFinder';
|
import { findWindowOnWorkspaceOrFolder } from 'vs/platform/windows/electron-main/windowsFinder';
|
||||||
|
import { mnemonicButtonLabel } from 'vs/base/common/labels';
|
||||||
|
|
||||||
export const IWorkspacesManagementMainService = createDecorator<IWorkspacesManagementMainService>('workspacesManagementMainService');
|
export const IWorkspacesManagementMainService = createDecorator<IWorkspacesManagementMainService>('workspacesManagementMainService');
|
||||||
|
|
||||||
|
@ -273,10 +274,11 @@ export class WorkspacesManagementMainService extends Disposable implements IWork
|
||||||
const options: MessageBoxOptions = {
|
const options: MessageBoxOptions = {
|
||||||
title: this.productService.nameLong,
|
title: this.productService.nameLong,
|
||||||
type: 'info',
|
type: 'info',
|
||||||
buttons: [localize('ok', "OK")],
|
buttons: [mnemonicButtonLabel(localize({ key: 'ok', comment: ['&& denotes a mnemonic'] }, "&&OK"))],
|
||||||
message: localize('workspaceOpenedMessage', "Unable to save workspace '{0}'", basename(workspacePath)),
|
message: localize('workspaceOpenedMessage', "Unable to save workspace '{0}'", basename(workspacePath)),
|
||||||
detail: localize('workspaceOpenedDetail', "The workspace is already opened in another window. Please close that window first and then try again."),
|
detail: localize('workspaceOpenedDetail', "The workspace is already opened in another window. Please close that window first and then try again."),
|
||||||
noLink: true
|
noLink: true,
|
||||||
|
defaultId: 0
|
||||||
};
|
};
|
||||||
|
|
||||||
await this.dialogMainService.showMessageBox(options, withNullAsUndefined(BrowserWindow.getFocusedWindow()));
|
await this.dialogMainService.showMessageBox(options, withNullAsUndefined(BrowserWindow.getFocusedWindow()));
|
||||||
|
|
Loading…
Reference in a new issue