mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Switch "Install" to "Download" for downloaded extensions (#22498)
This commit is contained in:
@@ -92,4 +92,7 @@ export const outputLineHeightDescription = localize('notebook.outputLineHeight',
|
|||||||
export const outputFontSizeDescription = localize('notebook.outputFontSize', "Font size for the output text for notebook cells. When set to 0 `#editor.fontSize#` is used. (for VS Code Notebooks only)");
|
export const outputFontSizeDescription = localize('notebook.outputFontSize', "Font size for the output text for notebook cells. When set to 0 `#editor.fontSize#` is used. (for VS Code Notebooks only)");
|
||||||
export const outputFontFamilyDescription = localize('notebook.outputFontFamily', "The font family for the output text for notebook cells. When set to empty, the `#editor.fontFamily#` is used. (for VS Code Notebooks only)");
|
export const outputFontFamilyDescription = localize('notebook.outputFontFamily', "The font family for the output text for notebook cells. When set to empty, the `#editor.fontFamily#` is used. (for VS Code Notebooks only)");
|
||||||
export const experimentalCustomizationDescription = localize('notebook.editorOptions.experimentalCustomization', 'Settings for code editors used in notebooks. This can be used to customize most editor.* settings. (for VS Code Notebooks only)');
|
export const experimentalCustomizationDescription = localize('notebook.editorOptions.experimentalCustomization', 'Settings for code editors used in notebooks. This can be used to customize most editor.* settings. (for VS Code Notebooks only)');
|
||||||
|
export const download = localize('azuredatastudio.download', 'Download');
|
||||||
|
export const downloadTooltip = localize('azuredatastudio.downloadTooltip', "Download this extension from an external source");
|
||||||
|
export const installTooltip = localize('azuredatastudio.installTooltip', "Install this extension");
|
||||||
//#endregion
|
//#endregion
|
||||||
|
|||||||
@@ -268,6 +268,7 @@ export abstract class AbstractInstallAction extends ExtensionAction {
|
|||||||
if (this.extension.state === ExtensionState.Uninstalled && await this.extensionsWorkbenchService.canInstall(this.extension)) {
|
if (this.extension.state === ExtensionState.Uninstalled && await this.extensionsWorkbenchService.canInstall(this.extension)) {
|
||||||
this.enabled = this.installPreReleaseVersion ? this.extension.hasPreReleaseVersion : this.extension.hasReleaseVersion;
|
this.enabled = this.installPreReleaseVersion ? this.extension.hasPreReleaseVersion : this.extension.hasReleaseVersion;
|
||||||
this.updateLabel();
|
this.updateLabel();
|
||||||
|
this.updateTooltip(); // {{SQL CARBON EDIT}} Update tooltip for download extensions
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -360,6 +361,8 @@ export abstract class AbstractInstallAction extends ExtensionAction {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected abstract updateTooltip(): void; // {{SQL CARBON EDIT}} Update tooltip for download extensions
|
||||||
|
|
||||||
protected updateLabel(): void {
|
protected updateLabel(): void {
|
||||||
this.label = this.getLabel();
|
this.label = this.getLabel();
|
||||||
}
|
}
|
||||||
@@ -373,7 +376,7 @@ export abstract class AbstractInstallAction extends ExtensionAction {
|
|||||||
if (this.extension?.hasPreReleaseVersion) {
|
if (this.extension?.hasPreReleaseVersion) {
|
||||||
return primary ? localize('install', "Install") : localize('install release version', "Install Release Version");
|
return primary ? localize('install', "Install") : localize('install release version', "Install Release Version");
|
||||||
}
|
}
|
||||||
return localize('install', "Install");
|
return this.extension?.downloadPage ? locConstants.download : localize('install', "Install"); // {{SQL CARBON EDIT}} Update label for download extensions
|
||||||
}
|
}
|
||||||
|
|
||||||
protected getInstallOptions(): InstallOptions {
|
protected getInstallOptions(): InstallOptions {
|
||||||
@@ -403,6 +406,13 @@ export class InstallAction extends AbstractInstallAction {
|
|||||||
Event.filter(userDataSyncEnablementService.onDidChangeResourceEnablement, e => e[0] === SyncResource.Extensions))(() => this.update()));
|
Event.filter(userDataSyncEnablementService.onDidChangeResourceEnablement, e => e[0] === SyncResource.Extensions))(() => this.update()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// {{SQL CARBON EDIT}} Update tooltip for download extensions
|
||||||
|
protected updateTooltip(): void {
|
||||||
|
this.tooltip = this.extension?.downloadPage ?
|
||||||
|
locConstants.downloadTooltip :
|
||||||
|
locConstants.installTooltip;
|
||||||
|
}
|
||||||
|
|
||||||
override getLabel(primary?: boolean): string {
|
override getLabel(primary?: boolean): string {
|
||||||
const baseLabel = super.getLabel(primary);
|
const baseLabel = super.getLabel(primary);
|
||||||
|
|
||||||
@@ -456,17 +466,26 @@ export class InstallAndSyncAction extends AbstractInstallAction {
|
|||||||
@IExtensionService runtimeExtensionService: IExtensionService,
|
@IExtensionService runtimeExtensionService: IExtensionService,
|
||||||
@IWorkbenchThemeService workbenchThemeService: IWorkbenchThemeService,
|
@IWorkbenchThemeService workbenchThemeService: IWorkbenchThemeService,
|
||||||
@ILabelService labelService: ILabelService,
|
@ILabelService labelService: ILabelService,
|
||||||
@IProductService productService: IProductService,
|
@IProductService private readonly productService: IProductService, // {{SQL CARBON EDIT}} Update label for download extensions
|
||||||
@IUserDataSyncEnablementService private readonly userDataSyncEnablementService: IUserDataSyncEnablementService,
|
@IUserDataSyncEnablementService private readonly userDataSyncEnablementService: IUserDataSyncEnablementService,
|
||||||
@INotificationService readonly localNotificationService: INotificationService // {{SQL CARBON EDIT}}
|
@INotificationService readonly localNotificationService: INotificationService // {{SQL CARBON EDIT}}
|
||||||
) {
|
) {
|
||||||
super('extensions.installAndSync', installPreReleaseVersion, AbstractInstallAction.Class,
|
super('extensions.installAndSync', installPreReleaseVersion, AbstractInstallAction.Class,
|
||||||
extensionsWorkbenchService, instantiationService, runtimeExtensionService, workbenchThemeService, labelService, localNotificationService);
|
extensionsWorkbenchService, instantiationService, runtimeExtensionService, workbenchThemeService, labelService, localNotificationService);
|
||||||
this.tooltip = localize({ key: 'install everywhere tooltip', comment: ['Placeholder is the name of the product. Eg: Azure Data Studio or Azure Data Studio - Insiders'] }, "Install this extension in all your synced {0} instances", productService.nameLong);
|
// {{SQL CARBON EDIT}} Update tooltip for download extensions - this is done in updateTooltip below
|
||||||
|
// this.tooltip = localize({ key: 'install everywhere tooltip', comment: ['Placeholder is the name of the product. Eg: Azure Data Studio or Azure Data Studio - Insiders'] }, "Install this extension in all your synced {0} instances", productService.nameLong);
|
||||||
|
this.updateTooltip();
|
||||||
this._register(Event.any(userDataSyncEnablementService.onDidChangeEnablement,
|
this._register(Event.any(userDataSyncEnablementService.onDidChangeEnablement,
|
||||||
Event.filter(userDataSyncEnablementService.onDidChangeResourceEnablement, e => e[0] === SyncResource.Extensions))(() => this.update()));
|
Event.filter(userDataSyncEnablementService.onDidChangeResourceEnablement, e => e[0] === SyncResource.Extensions))(() => this.update()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// {{SQL CARBON EDIT}} Update tooltip for download extensions
|
||||||
|
protected updateTooltip(): void {
|
||||||
|
this.tooltip = this.extension?.downloadPage ?
|
||||||
|
locConstants.downloadTooltip :
|
||||||
|
localize({ key: 'install everywhere tooltip', comment: ['Placeholder is the name of the product. Eg: Azure Data Studio or Azure Data Studio - Insiders'] }, "Install this extension in all your synced {0} instances", this.productService.nameLong)
|
||||||
|
}
|
||||||
|
|
||||||
protected override async computeAndUpdateEnablement(): Promise<void> {
|
protected override async computeAndUpdateEnablement(): Promise<void> {
|
||||||
await super.computeAndUpdateEnablement();
|
await super.computeAndUpdateEnablement();
|
||||||
if (this.enabled) {
|
if (this.enabled) {
|
||||||
|
|||||||
Reference in New Issue
Block a user