API improvement & bug fix:

- subscribed global event doesnt unsubcribed when process is killed
- process killall API doesnt work as expected
- improve core API
This commit is contained in:
Dany LE
2021-11-25 01:13:16 +01:00
parent 64094c29d5
commit 0624f421f7
6 changed files with 90 additions and 119 deletions

View File

@ -296,10 +296,6 @@ namespace OS {
this.on("exit", () => this.quit(false));
this.host = this._gui.workspace;
this.dialog = undefined;
this.subscribe("systemlocalechange", (d) => {
this.updateLocale(d.message as string);
return this.update();
});
}
/**
@ -315,11 +311,10 @@ namespace OS {
/**
* Update the model locale
*
* @protected
* @param {string} name
* @memberof BaseModel
*/
protected updateLocale(name: string) {}
updateLocale(name: string) {}
/**
* Render the model's UI
*
@ -532,7 +527,7 @@ namespace OS {
subscribe(e: string, f: (d: API.AnnouncementDataType<any>) => void): void {
return announcer.on(e, f, this);
}
/**
* Open a dialog
*
@ -676,7 +671,11 @@ namespace OS {
*/
update(): void {
if (this.scheme) {
return this.scheme.update();
this.scheme.update();
}
if(this.dialog)
{
this.dialog.update();
}
}