mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-02 17:23:40 -05:00
Merge from vscode 817eb6b0c720a4ecbc13c020afbbebfed667aa09 (#7356)
This commit is contained in:
@@ -15,9 +15,9 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti
|
||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { SIDE_BAR_BACKGROUND } from 'vs/workbench/common/theme';
|
||||
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { IWindowsService } from 'vs/platform/windows/common/windows';
|
||||
import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';
|
||||
import { IThemeService, ITheme } from 'vs/platform/theme/common/themeService';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
|
||||
import * as azdata from 'azdata';
|
||||
import { Button } from 'sql/base/browser/ui/button/button';
|
||||
@@ -30,6 +30,7 @@ import * as TelemetryKeys from 'sql/platform/telemetry/common/telemetryKeys';
|
||||
import { ILogService } from 'vs/platform/log/common/log';
|
||||
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
|
||||
import { ITextResourcePropertiesService } from 'vs/editor/common/services/resourceConfiguration';
|
||||
import { IOpenerService } from 'vs/platform/opener/common/opener';
|
||||
|
||||
// TODO: Make the help link 1) extensible (01/08/2018, https://github.com/Microsoft/azuredatastudio/issues/450)
|
||||
// in case that other non-Azure sign in is to be used
|
||||
@@ -70,10 +71,10 @@ export class FirewallRuleDialog extends Modal {
|
||||
@IContextViewService private _contextViewService: IContextViewService,
|
||||
@ITelemetryService telemetryService: ITelemetryService,
|
||||
@IContextKeyService contextKeyService: IContextKeyService,
|
||||
@IWindowsService private _windowsService: IWindowsService,
|
||||
@IClipboardService clipboardService: IClipboardService,
|
||||
@ILogService logService: ILogService,
|
||||
@ITextResourcePropertiesService textResourcePropertiesService: ITextResourcePropertiesService
|
||||
@ITextResourcePropertiesService textResourcePropertiesService: ITextResourcePropertiesService,
|
||||
@IOpenerService private readonly openerService: IOpenerService
|
||||
) {
|
||||
super(
|
||||
localize('createNewFirewallRule', "Create new firewall rule"),
|
||||
@@ -125,7 +126,7 @@ export class FirewallRuleDialog extends Modal {
|
||||
this._helpLink.setAttribute('href', firewallHelpUri);
|
||||
this._helpLink.innerHTML += localize('firewallRuleHelpDescription', "Learn more about firewall settings");
|
||||
this._helpLink.onclick = () => {
|
||||
this._windowsService.openExternal(firewallHelpUri);
|
||||
this.openerService.open(URI.parse(firewallHelpUri));
|
||||
};
|
||||
|
||||
// Create account picker with event handling
|
||||
|
||||
@@ -12,7 +12,6 @@ import { URI } from 'vs/base/common/uri';
|
||||
import { IConfigurationService, ConfigurationTarget } from 'vs/platform/configuration/common/configuration';
|
||||
import { INotificationService, Severity } from 'vs/platform/notification/common/notification';
|
||||
import { localize } from 'vs/nls';
|
||||
import { IWindowService } from 'vs/platform/windows/common/windows';
|
||||
|
||||
@extHostNamedCustomer(SqlMainContext.MainThreadExtensionManagement)
|
||||
export class MainThreadExtensionManagement extends Disposable implements MainThreadExtensionManagementShape {
|
||||
@@ -23,8 +22,7 @@ export class MainThreadExtensionManagement extends Disposable implements MainThr
|
||||
extHostContext: IExtHostContext,
|
||||
@IExtensionManagementService private _extensionService: IExtensionManagementService,
|
||||
@IConfigurationService private _configurationService: IConfigurationService,
|
||||
@INotificationService private _notificationService: INotificationService,
|
||||
@IWindowService protected readonly _windowService: IWindowService
|
||||
@INotificationService private _notificationService: INotificationService
|
||||
) {
|
||||
super();
|
||||
}
|
||||
@@ -53,9 +51,6 @@ export class MainThreadExtensionManagement extends Disposable implements MainThr
|
||||
this._configurationService.updateValue('workbench.enableObsoleteApiUsageNotification', false, ConfigurationTarget.USER);
|
||||
},
|
||||
isSecondary: true
|
||||
}, {
|
||||
label: localize('devTools', "Open Developer Tools"),
|
||||
run: () => this._windowService.openDevTools()
|
||||
}]);
|
||||
this._obsoleteExtensionApiUsageNotificationShown = true;
|
||||
}
|
||||
|
||||
@@ -12,10 +12,11 @@ import { Task } from 'sql/platform/tasks/browser/tasksRegistry';
|
||||
import { ObjectMetadata } from 'azdata';
|
||||
|
||||
import { Action } from 'vs/base/common/actions';
|
||||
import { IWindowsService } from 'vs/platform/windows/common/windows';
|
||||
import * as nls from 'vs/nls';
|
||||
import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { IInsightsConfig } from 'sql/platform/dashboard/browser/insightRegistry';
|
||||
import { IOpenerService } from 'vs/platform/opener/common/opener';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
|
||||
export interface BaseActionContext {
|
||||
object?: ObjectMetadata;
|
||||
@@ -85,6 +86,6 @@ export class ConfigureDashboardAction extends Task {
|
||||
}
|
||||
|
||||
runTask(accessor: ServicesAccessor): Promise<void> {
|
||||
return accessor.get<IWindowsService>(IWindowsService).openExternal(ConfigureDashboardAction.configHelpUri).then();
|
||||
return accessor.get(IOpenerService).open(URI.parse(ConfigureDashboardAction.configHelpUri)).then();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,28 +4,31 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { Action } from 'vs/base/common/actions';
|
||||
import { IWindowsService } from 'vs/platform/windows/common/windows';
|
||||
import { IOpenerService } from 'vs/platform/opener/common/opener';
|
||||
//tslint:disable-next-line:layering
|
||||
import { ElectronMainService } from 'vs/platform/electron/electron-main/electronMainService';
|
||||
//tslint:disable-next-line:layering
|
||||
import { IElectronService } from 'vs/platform/electron/node/electron';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
|
||||
export class ShowFileInFolderAction extends Action {
|
||||
|
||||
constructor(private path: string, label: string, private windowsService: ElectronMainService) {
|
||||
constructor(private path: string, label: string, @IElectronService private windowsService: ElectronMainService) {
|
||||
super('showItemInFolder.action.id', label);
|
||||
}
|
||||
|
||||
run(): Promise<void> {
|
||||
return this.windowsService.showItemInFolder(this.path);
|
||||
return this.windowsService.showItemInFolder(undefined, this.path);
|
||||
}
|
||||
}
|
||||
|
||||
export class OpenFileInFolderAction extends Action {
|
||||
|
||||
constructor(private path: string, label: string, private windowsService: IWindowsService) {
|
||||
constructor(private path: string, label: string, @IOpenerService private openerService: IOpenerService) {
|
||||
super('showItemInFolder.action.id', label);
|
||||
}
|
||||
|
||||
run() {
|
||||
return this.windowsService.openExternal(this.path);
|
||||
return this.openerService.open(URI.file(this.path));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ import { IInsightOptions } from 'sql/workbench/parts/charts/common/interfaces';
|
||||
import { IFileService } from 'vs/platform/files/common/files';
|
||||
import { IFileDialogService } from 'vs/platform/dialogs/common/dialogs';
|
||||
import { VSBuffer } from 'vs/base/common/buffer';
|
||||
import { IOpenerService } from 'vs/platform/opener/common/opener';
|
||||
|
||||
export interface IChartActionContext {
|
||||
options: IInsightOptions;
|
||||
@@ -142,10 +143,10 @@ export class SaveImageAction extends Action {
|
||||
public static ICON = 'saveAsImage';
|
||||
|
||||
constructor(
|
||||
@IWindowsService private readonly windowsService: IWindowsService,
|
||||
@INotificationService private readonly notificationService: INotificationService,
|
||||
@IFileService private readonly fileService: IFileService,
|
||||
@IFileDialogService private readonly fileDialogService: IFileDialogService
|
||||
@IFileDialogService private readonly fileDialogService: IFileDialogService,
|
||||
@IOpenerService private readonly openerService: IOpenerService
|
||||
) {
|
||||
super(SaveImageAction.ID, SaveImageAction.LABEL, SaveImageAction.ICON);
|
||||
}
|
||||
@@ -168,7 +169,7 @@ export class SaveImageAction extends Action {
|
||||
if (err) {
|
||||
this.notificationService.error(err.message);
|
||||
} else {
|
||||
this.windowsService.openExternal(filePath.toString());
|
||||
this.openerService.open(filePath, { openExternal: true });
|
||||
this.notificationService.notify({
|
||||
severity: Severity.Error,
|
||||
message: localize('chartSaved', "Saved Chart to path: {0}", filePath.toString())
|
||||
|
||||
@@ -35,6 +35,7 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti
|
||||
import { ObjectExplorerActionsContext } from 'sql/workbench/parts/objectExplorer/browser/objectExplorerActions';
|
||||
import { ItemContextKey } from 'sql/workbench/parts/dashboard/browser/widgets/explorer/explorerTreeContext';
|
||||
import { ManageActionContext } from 'sql/workbench/browser/actions';
|
||||
import { IHostService } from 'vs/workbench/services/host/browser/host';
|
||||
import { MarkdownOutputComponent } from 'sql/workbench/parts/notebook/browser/outputs/markdownOutput.component';
|
||||
import { registerCellComponent } from 'sql/platform/notebooks/common/outputRegistry';
|
||||
import { TextCellComponent } from 'sql/workbench/parts/notebook/browser/cellViews/textCell.component';
|
||||
@@ -130,6 +131,7 @@ registerAction({
|
||||
const viewletService = accessor.get(IViewletService);
|
||||
const workspaceEditingService = accessor.get(IWorkspaceEditingService);
|
||||
const windowService = accessor.get(IWindowService);
|
||||
const hostService = accessor.get(IHostService);
|
||||
let folders = [];
|
||||
if (!options.folderPath) {
|
||||
return;
|
||||
@@ -141,7 +143,7 @@ registerAction({
|
||||
return windowService.openWindow([{ folderUri: folders[0] }], { forceNewWindow: options.forceNewWindow });
|
||||
}
|
||||
else {
|
||||
return windowService.reloadWindow();
|
||||
return hostService.reload();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user