forked from Silverfish/proton-bridge
GODT-1062: Fix lost notification bar when window is closed
This commit is contained in:
committed by
Jakub Cuth
parent
feeb7179f5
commit
fd73ec6861
@ -107,17 +107,21 @@ Item {
|
||||
gui.openMainWindow(false)
|
||||
if (go.isConnectionOK) {
|
||||
if( winMain.updateState=="noInternet") {
|
||||
go.setUpdateState("upToDate")
|
||||
go.updateState = "upToDate"
|
||||
}
|
||||
} else {
|
||||
go.setUpdateState("noInternet")
|
||||
go.updateState = "noInternet"
|
||||
}
|
||||
}
|
||||
|
||||
onSetUpdateState : {
|
||||
onUpdateStateChanged : {
|
||||
// if main window is closed - most probably it is destroyed (see closeMainWindow())
|
||||
if (winMain == null) {
|
||||
return
|
||||
}
|
||||
// once app is outdated prevent from state change
|
||||
if (winMain.updateState != "forceUpdate") {
|
||||
winMain.updateState = updateState
|
||||
winMain.updateState = go.updateState
|
||||
}
|
||||
}
|
||||
|
||||
@ -129,15 +133,14 @@ Item {
|
||||
}
|
||||
|
||||
onNotifyManualUpdate: {
|
||||
go.setUpdateState("oldVersion")
|
||||
go.updateState = "oldVersion"
|
||||
}
|
||||
|
||||
onNotifyManualUpdateRestartNeeded: {
|
||||
if (!winMain.dialogUpdate.visible) {
|
||||
gui.openMainWindow(true)
|
||||
winMain.dialogUpdate.show()
|
||||
}
|
||||
go.setUpdateState("updateRestart")
|
||||
go.updateState = "updateRestart"
|
||||
winMain.dialogUpdate.finished(false)
|
||||
|
||||
// after manual update - just retart immidiatly
|
||||
@ -147,28 +150,25 @@ Item {
|
||||
|
||||
onNotifyManualUpdateError: {
|
||||
if (!winMain.dialogUpdate.visible) {
|
||||
gui.openMainWindow(true)
|
||||
winMain.dialogUpdate.show()
|
||||
}
|
||||
go.setUpdateState("updateError")
|
||||
go.updateState = "updateError"
|
||||
winMain.dialogUpdate.finished(true)
|
||||
}
|
||||
|
||||
onNotifyForceUpdate : {
|
||||
go.setUpdateState("forceUpdate")
|
||||
go.updateState = "forceUpdate"
|
||||
if (!winMain.dialogUpdate.visible) {
|
||||
gui.openMainWindow(true)
|
||||
winMain.dialogUpdate.show()
|
||||
}
|
||||
}
|
||||
|
||||
onNotifySilentUpdateRestartNeeded: {
|
||||
go.setUpdateState("updateRestart")
|
||||
go.updateState = "updateRestart"
|
||||
}
|
||||
|
||||
onNotifySilentUpdateError: {
|
||||
go.setUpdateState("updateError")
|
||||
gui.openMainWindow(true)
|
||||
go.updateState = "updateError"
|
||||
}
|
||||
|
||||
onNotifyLogout : {
|
||||
@ -287,9 +287,17 @@ Item {
|
||||
if (showAndRise) {
|
||||
gui.winMain.showAndRise()
|
||||
}
|
||||
|
||||
// restore update notification bar: trigger updateStateChanged
|
||||
var tmp = go.updateState
|
||||
go.updateState = ""
|
||||
go.updateState = tmp
|
||||
}
|
||||
|
||||
function closeMainWindow () {
|
||||
// Historical reasons: once upon a time there was a report about high GPU
|
||||
// usage on MacOS while bridge is closed. Legends say that destroying
|
||||
// MainWindow solved this.
|
||||
gui.winMain.hide()
|
||||
gui.winMain.destroy(5000)
|
||||
gui.winMain = null
|
||||
|
||||
@ -96,17 +96,17 @@ Item {
|
||||
go.isConnectionOK = isAvailable
|
||||
if (go.isConnectionOK) {
|
||||
if( winMain.updateState==gui.enums.statusNoInternet) {
|
||||
go.setUpdateState(gui.enums.statusUpToDate)
|
||||
go.updateState = gui.enums.statusUpToDate
|
||||
}
|
||||
} else {
|
||||
go.setUpdateState(gui.enums.statusNoInternet)
|
||||
go.updateState = gui.enums.statusNoInternet
|
||||
}
|
||||
}
|
||||
|
||||
onSetUpdateState : {
|
||||
onUpdateStateChanged : {
|
||||
// once app is outdated prevent from state change
|
||||
if (winMain.updateState != "forceUpdate") {
|
||||
winMain.updateState = updateState
|
||||
winMain.updateState = go.updateState
|
||||
}
|
||||
}
|
||||
|
||||
@ -207,14 +207,14 @@ Item {
|
||||
}
|
||||
|
||||
onNotifyManualUpdate: {
|
||||
go.setUpdateState("oldVersion")
|
||||
go.updateState = "oldVersion"
|
||||
}
|
||||
|
||||
onNotifyManualUpdateRestartNeeded: {
|
||||
if (!winMain.dialogUpdate.visible) {
|
||||
winMain.dialogUpdate.show()
|
||||
}
|
||||
go.setUpdateState("updateRestart")
|
||||
go.updateState = "updateRestart"
|
||||
winMain.dialogUpdate.finished(false)
|
||||
|
||||
// after manual update - just retart immidiatly
|
||||
@ -226,23 +226,23 @@ Item {
|
||||
if (!winMain.dialogUpdate.visible) {
|
||||
winMain.dialogUpdate.show()
|
||||
}
|
||||
go.setUpdateState("updateError")
|
||||
go.updateState = "updateError"
|
||||
winMain.dialogUpdate.finished(true)
|
||||
}
|
||||
|
||||
onNotifyForceUpdate : {
|
||||
go.setUpdateState("forceUpdate")
|
||||
go.updateState = "forceUpdate"
|
||||
if (!winMain.dialogUpdate.visible) {
|
||||
winMain.dialogUpdate.show()
|
||||
}
|
||||
}
|
||||
|
||||
onNotifySilentUpdateRestartNeeded: {
|
||||
go.setUpdateState("updateRestart")
|
||||
go.updateState = "updateRestart"
|
||||
}
|
||||
|
||||
onNotifySilentUpdateError: {
|
||||
go.setUpdateState("updateError")
|
||||
go.updateState = "updateError"
|
||||
}
|
||||
|
||||
onNotifyLogout : {
|
||||
|
||||
@ -299,6 +299,7 @@ Window {
|
||||
property string fullversion : "QA.1.0 (d9f8sdf9) 2020-02-19T10:57:23+01:00"
|
||||
property string downloadLink: "https://protonmail.com/download/beta/protonmail-bridge-1.1.5-1.x86_64.rpm;https://www.protonmail.com/downloads/beta/Desktop-Bridge-link1.exe;https://www.protonmail.com/downloads/beta/Desktop-Bridge-link1.exe;https://www.protonmail.com/downloads/beta/Desktop-Bridge-link1.exe;"
|
||||
|
||||
property string updateState
|
||||
property string updateVersion : "QA.1.0"
|
||||
property bool updateCanInstall: true
|
||||
property string updateLandingPage : "https://protonmail.com/bridge/download/"
|
||||
@ -340,7 +341,6 @@ Window {
|
||||
|
||||
signal notifyPortIssue(bool busyPortIMAP, bool busyPortSMTP)
|
||||
signal notifyVersionIsTheLatest()
|
||||
signal setUpdateState(string updateState)
|
||||
signal notifyKeychainRebuild()
|
||||
signal notifyHasNoKeychain()
|
||||
|
||||
|
||||
@ -856,6 +856,7 @@ Window {
|
||||
property string fullversion : "QA.1.0 (d9f8sdf9) 2020-02-19T10:57:23+01:00"
|
||||
property string downloadLink: "https://protonmail.com/download/beta/protonmail-bridge-1.1.5-1.x86_64.rpm;https://www.protonmail.com/downloads/beta/Desktop-Bridge-link1.exe;https://www.protonmail.com/downloads/beta/Desktop-Bridge-link1.exe;https://www.protonmail.com/downloads/beta/Desktop-Bridge-link1.exe;"
|
||||
|
||||
property string updateState
|
||||
property string updateVersion : "q0.1.0"
|
||||
property bool updateCanInstall: true
|
||||
property string updateLandingPage : "https://protonmail.com/import-export/download/"
|
||||
@ -900,7 +901,6 @@ Window {
|
||||
signal showQuit()
|
||||
|
||||
signal notifyVersionIsTheLatest()
|
||||
signal setUpdateState(string updateState)
|
||||
|
||||
signal showMainWin()
|
||||
signal hideMainWin()
|
||||
|
||||
@ -53,6 +53,7 @@ type GoQMLInterface struct {
|
||||
_ string `property:"fullversion"`
|
||||
_ string `property:"downloadLink"`
|
||||
|
||||
_ string `property:"updateState"`
|
||||
_ string `property:"updateVersion"`
|
||||
_ bool `property:"updateCanInstall"`
|
||||
_ string `property:"updateLandingPage"`
|
||||
@ -77,7 +78,6 @@ type GoQMLInterface struct {
|
||||
_ string `property:"versionCheckFailed"`
|
||||
//
|
||||
_ func(isAvailable bool) `signal:"setConnectionStatus"`
|
||||
_ func(updateState string) `signal:"setUpdateState"`
|
||||
_ func() `slot:"checkInternet"`
|
||||
|
||||
_ func() `slot:"setToRestart"`
|
||||
|
||||
@ -50,6 +50,7 @@ type GoQMLInterface struct {
|
||||
_ string `property:"fullversion"`
|
||||
_ string `property:"downloadLink"`
|
||||
|
||||
_ string `property:"updateState"`
|
||||
_ string `property:"updateVersion"`
|
||||
_ bool `property:"updateCanInstall"`
|
||||
_ string `property:"updateLandingPage"`
|
||||
@ -82,9 +83,8 @@ type GoQMLInterface struct {
|
||||
_ float32 `property:"progress"`
|
||||
_ string `property:"progressDescription"`
|
||||
|
||||
_ func(isAvailable bool) `signal:"setConnectionStatus"`
|
||||
_ func(updateState string) `signal:"setUpdateState"`
|
||||
_ func() `slot:"checkInternet"`
|
||||
_ func(isAvailable bool) `signal:"setConnectionStatus"`
|
||||
_ func() `slot:"checkInternet"`
|
||||
|
||||
_ func() `slot:"setToRestart"`
|
||||
|
||||
|
||||
Reference in New Issue
Block a user