diff options
author | LawnCable <lawncable.tmw2@simonlaux.de> | 2018-05-22 01:32:10 -0400 |
---|---|---|
committer | LawnCable <lawncable.tmw2@simonlaux.de> | 2018-05-22 01:32:10 -0400 |
commit | 4fdd86da90dd811378b153de31da542f9fabb355 (patch) | |
tree | 59f78e5cdf361b9f513c6f3dd5f23639841b5d7e /src/main/status.ts | |
parent | d6ff248cee446218392567296cfcd2fb8723b066 (diff) | |
download | electron-4fdd86da90dd811378b153de31da542f9fabb355.tar.gz electron-4fdd86da90dd811378b153de31da542f9fabb355.tar.bz2 electron-4fdd86da90dd811378b153de31da542f9fabb355.tar.xz electron-4fdd86da90dd811378b153de31da542f9fabb355.zip |
started update logic for windows - only downloads the zip for now
Diffstat (limited to 'src/main/status.ts')
-rw-r--r-- | src/main/status.ts | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/main/status.ts b/src/main/status.ts index ffd6551..537e31b 100644 --- a/src/main/status.ts +++ b/src/main/status.ts @@ -1,8 +1,10 @@ import { mainWindow } from '../main'; +import { dialog } from 'electron'; type STATUS = { progress:number, activity:string, + ActivityIsError:boolean, playing:boolean, } @@ -10,6 +12,7 @@ const status:STATUS = { progress:null, activity:null, playing:false, //Is manaplus starting or started + ActivityIsError:false, } export namespace Status { @@ -23,10 +26,22 @@ export namespace Status { } export function setActivity(value: string){ status.activity=value; + status.ActivityIsError=false; updateStatus(); } - export function setPlaying(value: boolean){ - status.playing=value; + export function removeActivity(value: string){ + status.activity=null; + status.ActivityIsError=false; + updateStatus(); + } + export function showError(title:string, message:string, activityMsg:string=message){ + status.activity = activityMsg; + status.ActivityIsError = true; + updateStatus(); + setTimeout(()=>{dialog.showErrorBox(title, message);},300); + } + export function setPlaying(playing: boolean){ + status.playing=playing; updateStatus(); } export function getStatus():STATUS{ |