mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-11-10 02:48:33 +00:00
Can check if the current window is the first one.
Closes #1070 Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
This commit is contained in:
@@ -43,7 +43,7 @@ export class FirstStartupInstaller extends Contribution {
|
||||
// If arduino:avr installation fails because it's already installed we don't want to retry on next start-up
|
||||
console.error(e);
|
||||
} else {
|
||||
// But if there is any other error (e.g.: no interntet cconnection), we want to retry next time
|
||||
// But if there is any other error (e.g.: no Internet connection), we want to retry next time
|
||||
avrPackageError = e;
|
||||
}
|
||||
}
|
||||
@@ -64,7 +64,7 @@ export class FirstStartupInstaller extends Contribution {
|
||||
// If Arduino_BuiltIn installation fails because it's already installed we don't want to retry on next start-up
|
||||
console.log('error installing core', e);
|
||||
} else {
|
||||
// But if there is any other error (e.g.: no interntet cconnection), we want to retry next time
|
||||
// But if there is any other error (e.g.: no Internet connection), we want to retry next time
|
||||
builtInLibraryError = e;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
import { DefaultWindowService as TheiaDefaultWindowService } from '@theia/core/lib/browser/window/default-window-service';
|
||||
import { ContainerModule } from '@theia/core/shared/inversify';
|
||||
import { DefaultWindowService } from './default-window-service';
|
||||
import { WindowServiceExt } from './window-service-ext';
|
||||
|
||||
export default new ContainerModule((bind, unbind, isBound, rebind) => {
|
||||
bind(DefaultWindowService).toSelf().inSingletonScope();
|
||||
rebind(TheiaDefaultWindowService).toService(DefaultWindowService);
|
||||
bind(WindowServiceExt).toService(DefaultWindowService);
|
||||
});
|
||||
@@ -0,0 +1,17 @@
|
||||
import { DefaultWindowService as TheiaDefaultWindowService } from '@theia/core/lib/browser/window/default-window-service';
|
||||
import { injectable } from '@theia/core/shared/inversify';
|
||||
import { WindowServiceExt } from './window-service-ext';
|
||||
|
||||
@injectable()
|
||||
export class DefaultWindowService
|
||||
extends TheiaDefaultWindowService
|
||||
implements WindowServiceExt
|
||||
{
|
||||
/**
|
||||
* The default implementation always resolves to `true`.
|
||||
* IDE2 does not use it. It's currently an electron-only app.
|
||||
*/
|
||||
async isFirstWindow(): Promise<boolean> {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
export const WindowServiceExt = Symbol('WindowServiceExt');
|
||||
export interface WindowServiceExt {
|
||||
/**
|
||||
* Returns with a promise that resolves to `true` if the current window is the first window.
|
||||
*/
|
||||
isFirstWindow(): Promise<boolean>;
|
||||
}
|
||||
Reference in New Issue
Block a user