add wait cursor when system is loading

This commit is contained in:
Xuan Sang LE 2020-05-21 13:10:35 +02:00
parent a3960766d1
commit 52ac96c18a
2 changed files with 7 additions and 6 deletions

View File

@ -58,7 +58,7 @@ class MarketPlace extends this.OS.GUI.BaseApplication
.then () => @notify __("Package updated") .then () => @notify __("Package updated")
.catch (e) => @error e.toString(), e .catch (e) => @error e.toString(), e
@remoteInstall() @remoteInstall()
.then () => @notify __("Package installed") .then (n) => @notify __("Package installed: {0}", n)
.catch (e) => @error e.toString(), e .catch (e) => @error e.toString(), e
@btremove.set "onbtclick", (e) => @btremove.set "onbtclick", (e) =>
@ -195,8 +195,8 @@ class MarketPlace extends this.OS.GUI.BaseApplication
data: @systemsetting.system.repositories data: @systemsetting.system.repositories
} }
when "install" when "install"
@localInstall().then () => @localInstall().then (n) =>
@notify __("Package installed") @notify __("Package installed: {0}", n)
.catch (e) => @error __("Unable to install package"), e .catch (e) => @error __("Unable to install package"), e
else else
@ -210,7 +210,7 @@ class MarketPlace extends this.OS.GUI.BaseApplication
@_api.blob app.download @_api.blob app.download
.then (data) => .then (data) =>
@install data, app @install data, app
.then () -> resolve() .then (n) -> resolve(n)
.catch (e) -> reject(e) .catch (e) -> reject(e)
.catch (e) -> reject e .catch (e) -> reject e
@ -229,7 +229,7 @@ class MarketPlace extends this.OS.GUI.BaseApplication
idx = apps.indexOf n idx = apps.indexOf n
if idx >= 0 if idx >= 0
@applist.set "selected", idx @applist.set "selected", idx
resolve() resolve(n)
.catch (e) -> reject(e) .catch (e) -> reject(e)
.catch (e) -> reject e .catch (e) -> reject e
.catch (e) -> reject e .catch (e) -> reject e
@ -269,7 +269,6 @@ class MarketPlace extends this.OS.GUI.BaseApplication
v.iconclass = "fa fa-adn" unless v.iconclass or v.icon v.iconclass = "fa fa-adn" unless v.iconclass or v.icon
v.path = pth v.path = pth
@systemsetting.system.packages[v.app] = v @systemsetting.system.packages[v.app] = v
@notify __("Application installed")
@appDetail app_meta @appDetail app_meta
resolve(v.name) resolve(v.name)
.catch (e) -> reject e .catch (e) -> reject e

View File

@ -51,12 +51,14 @@ class PushNotification extends this.OS.GUI.BaseService
@subscribe "loading", (o) => @subscribe "loading", (o) =>
@pending.push o.id @pending.push o.id
$(@_gui.workspace).css "cursor", "wait"
@spin true @spin true
@subscribe "loaded", (o) => @subscribe "loaded", (o) =>
i = @pending.indexOf o.id i = @pending.indexOf o.id
@pending.splice i, 1 if i >= 0 @pending.splice i, 1 if i >= 0
@spin false if @pending.length is 0 @spin false if @pending.length is 0
$(@_gui.workspace).css "cursor", "auto"
@nzone.set "height", "100%" @nzone.set "height", "100%"
@fzone.set "height", "100%" @fzone.set "height", "100%"