From 4fdd86da90dd811378b153de31da542f9fabb355 Mon Sep 17 00:00:00 2001 From: LawnCable Date: Tue, 22 May 2018 01:32:10 -0400 Subject: started update logic for windows - only downloads the zip for now --- src/main/status.ts | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'src/main/status.ts') 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{ -- cgit v1.2.3-70-g09d2