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 |
|
|
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: |