ATL-663: Indicate alpha status. Updated the About dialog.

Signed-off-by: Akos Kitta <kittaakos@typefox.io>
This commit is contained in:
Akos Kitta
2020-11-03 16:08:19 +01:00
committed by Akos Kitta
parent 7b364ebe60
commit 874c3efa2c
13 changed files with 114 additions and 49 deletions

View File

@@ -1,25 +0,0 @@
import { injectable, inject, postConstruct } from 'inversify';
import { AboutDialog as TheiaAboutDialog, ABOUT_CONTENT_CLASS } from '@theia/core/lib/browser/about-dialog';
import { ConfigService } from '../../../common/protocol/config-service';
@injectable()
export class AboutDialog extends TheiaAboutDialog {
@inject(ConfigService)
protected readonly configService: ConfigService;
@postConstruct()
protected async init(): Promise<void> {
const [, version] = await Promise.all([super.init(), this.configService.getVersion()]);
if (version) {
const { firstChild } = this.contentNode;
if (firstChild instanceof HTMLElement && firstChild.classList.contains(ABOUT_CONTENT_CLASS)) {
const cliVersion = document.createElement('div');
cliVersion.textContent = version;
firstChild.appendChild(cliVersion);
// TODO: anchor to the commit in the `arduino-cli` repository.
}
}
}
}

View File

@@ -19,7 +19,8 @@ export class CommonFrontendContribution extends TheiaCommonFrontendContribution
CommonCommands.AUTO_SAVE,
CommonCommands.OPEN_PREFERENCES,
CommonCommands.SELECT_ICON_THEME,
CommonCommands.SELECT_COLOR_THEME
CommonCommands.SELECT_COLOR_THEME,
CommonCommands.ABOUT_COMMAND
]) {
registry.unregisterMenuAction(command);
}

View File

@@ -7,6 +7,7 @@ import { ApplicationServer } from '@theia/core/lib/common/application-protocol';
import { FrontendApplication } from '@theia/core/lib/browser/frontend-application';
import { FocusTracker, Widget } from '@theia/core/lib/browser';
import { WorkspaceService as TheiaWorkspaceService } from '@theia/workspace/lib/browser/workspace-service';
import { FrontendApplicationConfigProvider } from '@theia/core/lib/browser/frontend-application-config-provider';
import { ConfigService } from '../../../common/protocol/config-service';
import { SketchesService } from '../../../common/protocol/sketches-service';
import { ArduinoWorkspaceRootResolver } from '../../arduino-workspace-resolver';
@@ -97,8 +98,9 @@ export class WorkspaceService extends TheiaWorkspaceService {
}
protected formatTitle(title?: string): string {
const status = FrontendApplicationConfigProvider.get()['status'];
const version = this.version ? ` ${this.version}` : '';
const name = `${this.applicationName} ${version}`;
const name = `${this.applicationName}${status ? ` ${status}` : ''} ${version}`;
return title ? `${title} | ${name}` : name;
}