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)
|
||||
|
|
|
@ -88,3 +88,6 @@ method userLoggedIn*[T](self: Module[T]) =
|
|||
|
||||
method moveToAppState*[T](self: Module[T]) =
|
||||
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")
|
||||
|
||||
method emitLogOut*(self: AccessInterface) {.base.} =
|
||||
raise newException(ValueError, "No implementation available")
|
||||
|
|
|
@ -41,3 +41,8 @@ QtObject:
|
|||
QtProperty[int] appState:
|
||||
read = getAppState
|
||||
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