mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-27 17:23:21 -05:00
Merge from master
This commit is contained in:
@@ -50,12 +50,12 @@ import { IStorageService } from 'vs/platform/storage/common/storage';
|
||||
import { ConnectionProfileGroup, IConnectionProfileGroup } from 'sql/platform/connection/common/connectionProfileGroup';
|
||||
import { ConfigurationEditingService } from 'vs/workbench/services/configuration/node/configurationEditingService';
|
||||
import { IWorkspaceConfigurationService } from 'vs/workbench/services/configuration/common/configuration';
|
||||
import { IQuickOpenService } from 'vs/platform/quickOpen/common/quickOpen';
|
||||
import { Event, Emitter } from 'vs/base/common/event';
|
||||
import { IEditorGroupsService } from 'vs/workbench/services/group/common/editorGroupsService';
|
||||
import { EditorPart } from 'vs/workbench/browser/parts/editor/editorPart';
|
||||
import * as statusbar from 'vs/workbench/browser/parts/statusbar/statusbar';
|
||||
import { IStatusbarService } from 'vs/platform/statusbar/common/statusbar';
|
||||
import { IStatusbarService, StatusbarAlignment } from 'vs/platform/statusbar/common/statusbar';
|
||||
import { IQuickInputService } from 'vs/platform/quickinput/common/quickInput';
|
||||
import { IConnectionDialogService } from 'sql/workbench/services/connection/common/connectionDialogService';
|
||||
|
||||
export class ConnectionManagementService extends Disposable implements IConnectionManagementService {
|
||||
@@ -91,7 +91,7 @@ export class ConnectionManagementService extends Disposable implements IConnecti
|
||||
@IWorkspaceConfigurationService private _workspaceConfigurationService: IWorkspaceConfigurationService,
|
||||
@ICredentialsService private _credentialsService: ICredentialsService,
|
||||
@ICapabilitiesService private _capabilitiesService: ICapabilitiesService,
|
||||
@IQuickOpenService private _quickOpenService: IQuickOpenService,
|
||||
@IQuickInputService private _quickInputService: IQuickInputService,
|
||||
@IEditorGroupsService private _editorGroupService: IEditorGroupsService,
|
||||
@IStatusbarService private _statusBarService: IStatusbarService,
|
||||
@IResourceProviderService private _resourceProviderService: IResourceProviderService,
|
||||
@@ -105,7 +105,7 @@ export class ConnectionManagementService extends Disposable implements IConnecti
|
||||
|
||||
// _connectionMemento and _connectionStore are in constructor to enable this class to be more testable
|
||||
if (!this._connectionMemento) {
|
||||
this._connectionMemento = new Memento('ConnectionManagement');
|
||||
this._connectionMemento = new Memento('ConnectionManagement', _storageService);
|
||||
}
|
||||
if (!this._connectionStore) {
|
||||
this._connectionStore = new ConnectionStore(_storageService, this._connectionMemento,
|
||||
@@ -115,7 +115,7 @@ export class ConnectionManagementService extends Disposable implements IConnecti
|
||||
// Register Statusbar item
|
||||
(<statusbar.IStatusbarRegistry>platform.Registry.as(statusbar.Extensions.Statusbar)).registerStatusbarItem(new statusbar.StatusbarItemDescriptor(
|
||||
ConnectionStatusbarItem,
|
||||
statusbar.StatusbarAlignment.RIGHT,
|
||||
StatusbarAlignment.RIGHT,
|
||||
100 /* High Priority */
|
||||
));
|
||||
|
||||
@@ -143,6 +143,10 @@ export class ConnectionManagementService extends Disposable implements IConnecti
|
||||
this.onDisconnect(() => this.refreshEditorTitles());
|
||||
}
|
||||
|
||||
public providerRegistered(providerId: string): boolean {
|
||||
return !!this._providers.get(providerId);
|
||||
}
|
||||
|
||||
// Event Emitters
|
||||
public get onAddConnectionProfile(): Event<IConnectionProfile> {
|
||||
return this._onAddConnectionProfile.event;
|
||||
@@ -587,7 +591,7 @@ export class ConnectionManagementService extends Disposable implements IConnecti
|
||||
if (DashboardInput.profileMatches(profile, editor.connectionProfile)) {
|
||||
editor.connectionProfile.databaseName = profile.databaseName;
|
||||
this._editorService.openEditor(editor)
|
||||
.done(() => {
|
||||
.then(() => {
|
||||
if (!profile.databaseName || Utils.isMaster(profile)) {
|
||||
this._angularEventing.sendAngularEvent(editor.uri, AngularEventType.NAV_SERVER);
|
||||
} else {
|
||||
@@ -1046,7 +1050,7 @@ export class ConnectionManagementService extends Disposable implements IConnecti
|
||||
{ key: nls.localize('connectionService.no', 'No'), value: false }
|
||||
];
|
||||
|
||||
self._quickOpenService.pick(choices.map(x => x.key), { placeHolder: nls.localize('cancelConnectionConfirmation', 'Are you sure you want to cancel this connection?'), ignoreFocusLost: true }).then((choice) => {
|
||||
self._quickInputService.pick(choices.map(x => x.key), { placeHolder: nls.localize('cancelConnectionConfirmation', 'Are you sure you want to cancel this connection?'), ignoreFocusLost: true }).then((choice) => {
|
||||
let confirm = choices.find(x => x.key === choice);
|
||||
resolve(confirm && confirm.value);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user