mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-22 18:16:43 +00:00
GODT-1029: Fix tray icon not updating under certain conditions
This commit is contained in:
committed by
Jakub Cuth
parent
fd73ec6861
commit
18668aafc9
@ -115,6 +115,38 @@ Item {
|
||||
}
|
||||
|
||||
onUpdateStateChanged : {
|
||||
// Update tray icon if needed
|
||||
switch (go.updateState) {
|
||||
case "internetCheck":
|
||||
break;
|
||||
case "noInternet" :
|
||||
gui.warningFlags |= Style.warnInfoBar
|
||||
break;
|
||||
case "oldVersion":
|
||||
gui.warningFlags |= Style.warnInfoBar
|
||||
break;
|
||||
case "forceUpdate":
|
||||
// Force update should presist once it happened and never be overwritten.
|
||||
// That means that tray icon should allways remain in error state.
|
||||
// But since we have only two sources of error icon in tray (force update
|
||||
// + installation fail) and both are unrecoverable and we do not ever remove
|
||||
// error flag from gui.warningFlags - it is ok to rely on gui.warningFlags and
|
||||
// not on winMain.updateState (which presist forceUpdate)
|
||||
gui.warningFlags |= Style.errorInfoBar
|
||||
break;
|
||||
case "upToDate":
|
||||
gui.warningFlags &= ~Style.warnInfoBar
|
||||
break;
|
||||
case "updateRestart":
|
||||
gui.warningFlags |= Style.warnInfoBar
|
||||
break;
|
||||
case "updateError":
|
||||
gui.warningFlags |= Style.errorInfoBar
|
||||
break;
|
||||
default :
|
||||
break;
|
||||
}
|
||||
|
||||
// if main window is closed - most probably it is destroyed (see closeMainWindow())
|
||||
if (winMain == null) {
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user