feat(appMain): Hide mailserver banner on SIGNAL_MAILSERVER_AVAILABLE

This commit is contained in:
MishkaRogachev 2023-01-18 17:55:23 +04:00 committed by Mikhail Rogachev
parent e0ba80a085
commit b474ef0024
5 changed files with 18 additions and 2 deletions

View File

@ -90,7 +90,8 @@ proc init*(self: Controller) =
let d9 = 9*86400 # 9 days
discard self.settingsService.setDefaultSyncPeriod(d9)
self.events.on("mailserverAvailable") do(e:Args):
self.events.on(SIGNAL_MAILSERVER_AVAILABLE) do(e:Args):
self.delegate.emitMailserverWorking()
echo "MAILSERVER AVAILABLE: ", repr(e)
# We need to take some actions here. This is the only pace where "mailserverAvailable" signal should be handled.
# Do the following, if we really need that.

View File

@ -87,6 +87,9 @@ method emitStoringPasswordError*(self: AccessInterface, errorDescription: string
method emitStoringPasswordSuccess*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method emitMailserverWorking*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
method emitMailserverNotWorking*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")

View File

@ -576,6 +576,9 @@ method emitStoringPasswordError*[T](self: Module[T], errorDescription: string) =
method emitStoringPasswordSuccess*[T](self: Module[T]) =
self.view.emitStoringPasswordSuccess()
method emitMailserverWorking*[T](self: Module[T]) =
self.view.emitMailserverWorking()
method emitMailserverNotWorking*[T](self: Module[T]) =
self.view.emitMailserverNotWorking()

View File

@ -123,11 +123,16 @@ QtObject:
proc emitStoringPasswordSuccess*(self: View) =
self.storingPasswordSuccess()
proc mailserverWorking*(self:View) {.signal.}
proc mailserverNotWorking*(self:View) {.signal.}
proc displayWindowsOsNotification*(self:View, title: string, message: string) {.signal.}
proc emitMailservernotWorking*(self: View) =
proc emitMailserverWorking*(self: View) =
self.mailserverWorking()
proc emitMailserverNotWorking*(self: View) =
self.mailserverNotWorking()
proc activeSection*(self: View): ActiveSection =

View File

@ -68,6 +68,10 @@ Item {
keycardPopup.active = false
}
onMailserverWorking: {
mailserverConnectionBanner.hide()
}
onMailserverNotWorking: {
mailserverConnectionBanner.show()
}