mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-07-14 14:56:33 +00:00
at first ide startup invoke installation of arduino:avr (#497)
This commit is contained in:
parent
658c19f55b
commit
bfb90a8b4f
@ -11,6 +11,7 @@ import {
|
|||||||
ContextMenuRenderer,
|
ContextMenuRenderer,
|
||||||
FrontendApplication,
|
FrontendApplication,
|
||||||
FrontendApplicationContribution,
|
FrontendApplicationContribution,
|
||||||
|
LocalStorageService,
|
||||||
OpenerService,
|
OpenerService,
|
||||||
StatusBar,
|
StatusBar,
|
||||||
StatusBarAlignment,
|
StatusBarAlignment,
|
||||||
@ -79,6 +80,8 @@ import { FileChangeType } from '@theia/filesystem/lib/browser';
|
|||||||
import { FrontendApplicationStateService } from '@theia/core/lib/browser/frontend-application-state';
|
import { FrontendApplicationStateService } from '@theia/core/lib/browser/frontend-application-state';
|
||||||
import { SketchbookWidgetContribution } from './widgets/sketchbook/sketchbook-widget-contribution';
|
import { SketchbookWidgetContribution } from './widgets/sketchbook/sketchbook-widget-contribution';
|
||||||
|
|
||||||
|
const INIT_AVR_PACKAGES = 'initializedAvrPackages';
|
||||||
|
|
||||||
@injectable()
|
@injectable()
|
||||||
export class ArduinoFrontendContribution
|
export class ArduinoFrontendContribution
|
||||||
implements
|
implements
|
||||||
@ -199,6 +202,9 @@ export class ArduinoFrontendContribution
|
|||||||
@inject(FrontendApplicationStateService)
|
@inject(FrontendApplicationStateService)
|
||||||
protected readonly appStateService: FrontendApplicationStateService;
|
protected readonly appStateService: FrontendApplicationStateService;
|
||||||
|
|
||||||
|
@inject(LocalStorageService)
|
||||||
|
protected readonly localStorageService: LocalStorageService;
|
||||||
|
|
||||||
protected invalidConfigPopup:
|
protected invalidConfigPopup:
|
||||||
| Promise<void | 'No' | 'Yes' | undefined>
|
| Promise<void | 'No' | 'Yes' | undefined>
|
||||||
| undefined;
|
| undefined;
|
||||||
@ -206,6 +212,16 @@ export class ArduinoFrontendContribution
|
|||||||
|
|
||||||
@postConstruct()
|
@postConstruct()
|
||||||
protected async init(): Promise<void> {
|
protected async init(): Promise<void> {
|
||||||
|
const notFirstStartup = await this.localStorageService.getData(
|
||||||
|
INIT_AVR_PACKAGES
|
||||||
|
);
|
||||||
|
if (!notFirstStartup) {
|
||||||
|
await this.localStorageService.setData(INIT_AVR_PACKAGES, true);
|
||||||
|
const avrPackage = await this.boardsService.getBoardPackage({
|
||||||
|
id: 'arduino:avr',
|
||||||
|
});
|
||||||
|
avrPackage && (await this.boardsService.install({ item: avrPackage }));
|
||||||
|
}
|
||||||
if (!window.navigator.onLine) {
|
if (!window.navigator.onLine) {
|
||||||
// tslint:disable-next-line:max-line-length
|
// tslint:disable-next-line:max-line-length
|
||||||
this.messageService.warn(
|
this.messageService.warn(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user