30 |
from interactor import Interactor |
from interactor import Interactor |
31 |
import mainwindow |
import mainwindow |
32 |
|
|
33 |
from messages import SESSION_CHANGED |
from messages import SESSION_REPLACED |
34 |
|
|
35 |
|
|
36 |
|
|
56 |
self.ShowMainWindow() |
self.ShowMainWindow() |
57 |
self.session = None |
self.session = None |
58 |
self.create_session() |
self.create_session() |
59 |
return true |
return True |
60 |
|
|
61 |
def OnExit(self): |
def OnExit(self): |
62 |
"""Clean up code. |
"""Clean up code. |
132 |
also arranges for ShowMainWindow to be called at the appropriate |
also arranges for ShowMainWindow to be called at the appropriate |
133 |
time. |
time. |
134 |
""" |
""" |
135 |
self.top.Show(true) |
self.top.Show(True) |
136 |
|
|
137 |
def CreateMainWindow(self): |
def CreateMainWindow(self): |
138 |
"""Create and return the main window for the application. |
"""Create and return the main window for the application. |
157 |
def SetSession(self, session): |
def SetSession(self, session): |
158 |
"""Make session the new session. |
"""Make session the new session. |
159 |
|
|
160 |
Issue SESSION_CHANGED after self.session has become the new |
Issue SESSION_REPLACED after self.session has become the new |
161 |
session. After the session has been assigned call |
session. After the session has been assigned call |
162 |
self.subscribe_session() with the new session and |
self.subscribe_session() with the new session and |
163 |
self.unsubscribe_session with the old one. |
self.unsubscribe_session with the old one. |
165 |
oldsession = self.session |
oldsession = self.session |
166 |
self.session = session |
self.session = session |
167 |
self.subscribe_session(self.session) |
self.subscribe_session(self.session) |
168 |
self.issue(SESSION_CHANGED) |
self.issue(SESSION_REPLACED) |
169 |
self.interactor.SetSession(session) |
self.interactor.SetSession(session) |
170 |
self.maps_changed() |
self.maps_changed() |
171 |
if oldsession is not None: |
if oldsession is not None: |