Skip to content

Commit

Permalink
Replaced the splash screen with a preload.
Browse files Browse the repository at this point in the history
Added a bare minimum example.

Closes #324
Closes #327
Closes #717
Closes #851

Signed-off-by: Akos Kitta <[email protected]>
  • Loading branch information
Akos Kitta committed Aug 4, 2022
1 parent 3ae53ad commit 334b52b
Show file tree
Hide file tree
Showing 13 changed files with 134 additions and 329 deletions.
1 change: 0 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
"--no-app-auto-install",
"--plugins=local-dir:../plugins",
"--hosted-plugin-inspect=9339",
"--nosplash",
"--content-trace",
"--open-devtools"
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ import {
ElectronMainWindowServiceExt,
electronMainWindowServiceExtPath,
} from '../../../electron-common/electron-main-window-service-ext';
import {
SplashService,
splashServicePath,
} from '../../../electron-common/splash-service';
import { ElectronWindowService } from './electron-window-service';

export default new ContainerModule((bind, unbind, isBound, rebind) => {
Expand All @@ -24,9 +20,4 @@ export default new ContainerModule((bind, unbind, isBound, rebind) => {
)
)
.inSingletonScope();
bind(SplashService)
.toDynamicValue(({ container }) =>
ElectronIpcConnectionProvider.createProxy(container, splashServicePath)
)
.inSingletonScope();
});
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
import {
inject,
injectable,
postConstruct,
} from '@theia/core/shared/inversify';
import * as remote from '@theia/core/electron-shared/@electron/remote';
import { FrontendApplicationStateService } from '@theia/core/lib/browser/frontend-application-state';
import {
ConnectionStatus,
ConnectionStatusService,
} from '@theia/core/lib/browser/connection-status-service';
import { ElectronWindowService as TheiaElectronWindowService } from '@theia/core/lib/electron-browser/window/electron-window-service';
import { SplashService } from '../../../electron-common/splash-service';
import { nls } from '@theia/core/lib/common';
import { ElectronWindowService as TheiaElectronWindowService } from '@theia/core/lib/electron-browser/window/electron-window-service';
import {
inject,
injectable,
postConstruct,
} from '@theia/core/shared/inversify';
import { WindowServiceExt } from '../../../browser/theia/core/window-service-ext';
import { ElectronMainWindowServiceExt } from '../../../electron-common/electron-main-window-service-ext';

Expand All @@ -23,20 +21,14 @@ export class ElectronWindowService
@inject(ConnectionStatusService)
private readonly connectionStatusService: ConnectionStatusService;

@inject(SplashService)
private readonly splashService: SplashService;

@inject(FrontendApplicationStateService)
private readonly appStateService: FrontendApplicationStateService;

@inject(ElectronMainWindowServiceExt)
private readonly mainWindowServiceExt: ElectronMainWindowServiceExt;

@postConstruct()
protected override init(): void {
this.appStateService
.reachedAnyState('initialized_layout')
.then(() => this.splashService.requestClose());
// NOOP
// Does not listen on Theia's `window.zoomLevel` changes.
// TODO: IDE2 must switch to the Theia preferences and drop the custom one.
}

protected shouldUnload(): boolean {
Expand Down
5 changes: 0 additions & 5 deletions arduino-ide-extension/src/electron-common/splash-service.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,8 @@ import {
ElectronMainWindowServiceExt,
electronMainWindowServiceExtPath,
} from '../electron-common/electron-main-window-service-ext';
import {
SplashService,
splashServicePath,
} from '../electron-common/splash-service';
import { ElectronMainWindowServiceExtImpl } from './electron-main-window-service-ext-impl';
import { IDEUpdaterImpl } from './ide-updater/ide-updater-impl';
import { SplashServiceImpl } from './splash/splash-service-impl';
import { ElectronMainApplication } from './theia/electron-main-application';
import { ElectronMainWindowServiceImpl } from './theia/electron-main-window-service';
import { TheiaElectronWindow } from './theia/theia-electron-window';
Expand All @@ -34,17 +29,6 @@ export default new ContainerModule((bind, unbind, isBound, rebind) => {
bind(ElectronMainWindowServiceImpl).toSelf().inSingletonScope();
rebind(ElectronMainWindowService).toService(ElectronMainWindowServiceImpl);

bind(SplashServiceImpl).toSelf().inSingletonScope();
bind(SplashService).toService(SplashServiceImpl);
bind(ElectronConnectionHandler)
.toDynamicValue(
(context) =>
new JsonRpcConnectionHandler(splashServicePath, () =>
context.container.get(SplashService)
)
)
.inSingletonScope();

// IDE updater bindings
bind(IDEUpdaterImpl).toSelf().inSingletonScope();
bind(IDEUpdater).toService(IDEUpdaterImpl);
Expand Down
158 changes: 0 additions & 158 deletions arduino-ide-extension/src/electron-main/splash/splash-screen.ts

This file was deleted.

This file was deleted.

25 changes: 0 additions & 25 deletions arduino-ide-extension/src/electron-main/splash/static/splash.html

This file was deleted.

Binary file not shown.
Loading

0 comments on commit 334b52b

Please sign in to comment.