mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-14 17:22:20 -05:00
Display page number, title, and description in wizard page headers (#1766)
This commit is contained in:
@@ -195,6 +195,7 @@ class ButtonImpl implements sqlops.window.modelviewdialog.Button {
|
||||
class WizardPageImpl extends ModelViewPanelImpl implements sqlops.window.modelviewdialog.WizardPage {
|
||||
public customButtons: sqlops.window.modelviewdialog.Button[];
|
||||
private _enabled: boolean = true;
|
||||
private _description: string;
|
||||
|
||||
constructor(public title: string, _extHostModelViewDialog: ExtHostModelViewDialog, _extHostModelView: ExtHostModelViewShape) {
|
||||
super('modelViewWizardPage', _extHostModelViewDialog, _extHostModelView);
|
||||
@@ -216,6 +217,15 @@ class WizardPageImpl extends ModelViewPanelImpl implements sqlops.window.modelvi
|
||||
public set content(content: string) {
|
||||
this._modelViewId = content;
|
||||
}
|
||||
|
||||
public get description(): string {
|
||||
return this._description;
|
||||
}
|
||||
|
||||
public set description(description: string) {
|
||||
this._description = description;
|
||||
this._extHostModelViewDialog.updateWizardPage(this);
|
||||
}
|
||||
}
|
||||
|
||||
export enum WizardPageInfoEventType {
|
||||
@@ -242,6 +252,7 @@ class WizardImpl implements sqlops.window.modelviewdialog.Wizard {
|
||||
public readonly onPageChanged = this._pageChangedEmitter.event;
|
||||
private _navigationValidator: (info: sqlops.window.modelviewdialog.WizardPageChangeInfo) => boolean | Thenable<boolean>;
|
||||
private _message: sqlops.window.modelviewdialog.DialogMessage;
|
||||
private _displayPageTitles: boolean = true;
|
||||
|
||||
constructor(public title: string, private _extHostModelViewDialog: ExtHostModelViewDialog) {
|
||||
this.doneButton = this._extHostModelViewDialog.createButton(DONE_LABEL);
|
||||
@@ -267,6 +278,15 @@ class WizardImpl implements sqlops.window.modelviewdialog.Wizard {
|
||||
this._extHostModelViewDialog.updateWizard(this);
|
||||
}
|
||||
|
||||
public get displayPageTitles(): boolean {
|
||||
return this._displayPageTitles;
|
||||
}
|
||||
|
||||
public set displayPageTitles(value: boolean) {
|
||||
this._displayPageTitles = value;
|
||||
this._extHostModelViewDialog.updateWizard(this);
|
||||
}
|
||||
|
||||
public addPage(page: sqlops.window.modelviewdialog.WizardPage, index?: number): Thenable<void> {
|
||||
return this._extHostModelViewDialog.updateWizardPage(page).then(() => {
|
||||
this._extHostModelViewDialog.addPage(this, page, index);
|
||||
@@ -510,7 +530,8 @@ export class ExtHostModelViewDialog implements ExtHostModelViewDialogShape {
|
||||
content: page.content,
|
||||
customButtons: page.customButtons ? page.customButtons.map(button => this.getHandle(button)) : undefined,
|
||||
enabled: page.enabled,
|
||||
title: page.title
|
||||
title: page.title,
|
||||
description: page.description
|
||||
});
|
||||
}
|
||||
|
||||
@@ -535,7 +556,8 @@ export class ExtHostModelViewDialog implements ExtHostModelViewDialogShape {
|
||||
doneButton: this.getHandle(wizard.doneButton),
|
||||
nextButton: this.getHandle(wizard.nextButton),
|
||||
customButtons: wizard.customButtons ? wizard.customButtons.map(button => this.getHandle(button)) : undefined,
|
||||
message: wizard.message
|
||||
message: wizard.message,
|
||||
displayPageTitles: wizard.displayPageTitles
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -141,6 +141,7 @@ export class MainThreadModelViewDialog implements MainThreadModelViewDialogShape
|
||||
page.title = details.title;
|
||||
page.content = details.content;
|
||||
page.enabled = details.enabled;
|
||||
page.description = details.description;
|
||||
if (details.customButtons !== undefined) {
|
||||
page.customButtons = details.customButtons.map(buttonHandle => this.getButton(buttonHandle));
|
||||
}
|
||||
@@ -165,6 +166,7 @@ export class MainThreadModelViewDialog implements MainThreadModelViewDialogShape
|
||||
}
|
||||
|
||||
wizard.title = details.title;
|
||||
wizard.displayPageTitles = details.displayPageTitles;
|
||||
wizard.pages = details.pages.map(handle => this.getWizardPage(handle));
|
||||
if (details.currentPage !== undefined) {
|
||||
wizard.setCurrentPage(details.currentPage);
|
||||
|
||||
Reference in New Issue
Block a user