Log out the app on NodeStopped signal
This commit is contained in:
parent
48a39e4569
commit
11cdd608f3
|
@ -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)
|
||||
|
|
|
@ -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()
|
|
@ -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")
|
||||
|
|
|
@ -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()
|
|
@ -474,7 +474,7 @@ StatusWindow {
|
|||
|
||||
DSM.SignalTransition {
|
||||
targetState: stateLogin
|
||||
signal: loginModel.onLoggedOut
|
||||
signal: startupModule.logOut
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue