fix system loading handle

This commit is contained in:
Xuan Sang LE
2020-05-21 14:49:55 +02:00
parent 52ac96c18a
commit f1c4201270
4 changed files with 16 additions and 8 deletions

View File

@ -54,6 +54,17 @@ class BaseApplication extends this.OS.GUI.BaseModel
path = "#{@meta().path}/scheme.html"
@.render path
load: (promise) ->
q = @_api.mid()
new Promise (resolve, reject) =>
@_api.loading q, @name
promise.then () =>
@_api.loaded q, @name, "OK"
resolve()
.catch (e) =>
@_api.loaded q, @name, "FAIL"
reject e
bindKey: (k, f) ->
arr = k.split "-"
return unless arr.length is 2

View File

@ -180,17 +180,14 @@ Ant.OS.GUI =
if not Ant.OS.APP[app]
# first load it
Ant.OS.GUI.loadApp(app).then (a) ->
console.log "apploaded"
Ant.OS.PM.createProcess a, Ant.OS.APP[a], args
.catch (e) ->
console.log e
Ant.OS.announcer.osfail __("Unable to launch: {0}", app), e
else
# now launch it
if Ant.OS.APP[app]
Ant.OS.PM.createProcess app, Ant.OS.APP[app], args
.catch (e)->
console.log e
.catch (e) ->
Ant.OS.announcer.osfail __("Unable to launch: {0}", app), e
dock: (app, meta) ->
# dock an application to a dock