Log out the app on NodeStopped signal

This commit is contained in:
Sale Djenic 2021-10-17 12:59:26 +02:00 committed by Iuri Matias
parent 48a39e4569
commit 11cdd608f3
5 changed files with 16 additions and 5 deletions

View File

@ -48,7 +48,7 @@ method init*(self: Controller) =
self.events.on(SignalType.NodeStopped.event) do(e:Args):
echo "-NEW-EVENT-- NodeStopped: ", repr(e)
self.events.emit("nodeStopped", Args())
#self.view.onLoggedOut()
self.delegate.emitLogOut()
self.events.on(SignalType.NodeReady.event) do(e:Args):
echo "-NEW-EVENT-- NodeReady: ", repr(e)

View File

@ -87,4 +87,7 @@ method userLoggedIn*[T](self: Module[T]) =
self.delegate.userLoggedIn()
method moveToAppState*[T](self: Module[T]) =
self.view.setAppState(AppState.MainAppState)
self.view.setAppState(AppState.MainAppState)
method emitLogOut*[T](self: Module[T]) =
self.view.emitLogOut()

View File

@ -1,2 +1,5 @@
method userLoggedIn*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")
raise newException(ValueError, "No implementation available")
method emitLogOut*(self: AccessInterface) {.base.} =
raise newException(ValueError, "No implementation available")

View File

@ -40,4 +40,9 @@ QtObject:
QtProperty[int] appState:
read = getAppState
notify = appStateChanged
notify = appStateChanged
proc logOut*(self: View) {.signal.}
proc emitLogOut*(self: View) =
self.logOut()

View File

@ -474,7 +474,7 @@ StatusWindow {
DSM.SignalTransition {
targetState: stateLogin
signal: loginModel.onLoggedOut
signal: startupModule.logOut
}
}
}