310 |
self.session = self.app.Session() |
self.session = self.app.Session() |
311 |
self.session.Subscribe(TABLE_REMOVED, self.close_on_table_removed) |
self.session.Subscribe(TABLE_REMOVED, self.close_on_table_removed) |
312 |
|
|
313 |
|
def OnDestroy(self, event): |
314 |
|
"""Extend inherited method to unsubscribe messages""" |
315 |
|
self.app.Unsubscribe(SESSION_REPLACED, self.close_on_session_replaced) |
316 |
|
self.session.Unsubscribe(TABLE_REMOVED, self.close_on_table_removed) |
317 |
|
ThubanFrame.OnDestroy(self, event) |
318 |
|
|
319 |
def make_grid(self, table): |
def make_grid(self, table): |
320 |
"""Return the table grid to use in the frame. |
"""Return the table grid to use in the frame. |
324 |
""" |
""" |
325 |
return TableGrid(self, table) |
return TableGrid(self, table) |
326 |
|
|
|
def OnClose(self, event): |
|
|
self.app.Unsubscribe(SESSION_REPLACED, self.close_on_session_replaced) |
|
|
self.session.Unsubscribe(TABLE_REMOVED, self.close_on_table_removed) |
|
|
ThubanFrame.OnClose(self, event) |
|
|
|
|
327 |
def close_on_session_replaced(self, *args): |
def close_on_session_replaced(self, *args): |
328 |
"""Subscriber for the SESSION_REPLACED messages. |
"""Subscriber for the SESSION_REPLACED messages. |
329 |
|
|
584 |
for i in sel: |
for i in sel: |
585 |
self.grid.SelectRowById(i, True) |
self.grid.SelectRowById(i, True) |
586 |
|
|
587 |
|
def OnDestroy(self, event): |
588 |
|
"""Extend inherited method to unsubscribe messages""" |
589 |
|
self.parent.Unsubscribe(SHAPES_SELECTED, self.select_shapes) |
590 |
|
self.grid.Unsubscribe(ROW_SELECTED, self.rows_selected) |
591 |
|
self.map.Unsubscribe(MAP_LAYERS_REMOVED, self.map_layers_removed) |
592 |
|
QueryTableFrame.OnDestroy(self, event) |
593 |
|
|
594 |
def make_grid(self, table): |
def make_grid(self, table): |
595 |
"""Override the derived method to return a LayerTableGrid. |
"""Override the derived method to return a LayerTableGrid. |
596 |
""" |
""" |
602 |
""" |
""" |
603 |
return dict([(i, 0) for i in self.parent.SelectedShapes()]) |
return dict([(i, 0) for i in self.parent.SelectedShapes()]) |
604 |
|
|
|
def OnClose(self, event): |
|
|
"""Override the derived method to first unsubscribed.""" |
|
|
self.parent.Unsubscribe(SHAPES_SELECTED, self.select_shapes) |
|
|
self.grid.Unsubscribe(ROW_SELECTED, self.rows_selected) |
|
|
self.map.Unsubscribe(MAP_LAYERS_REMOVED, self.map_layers_removed) |
|
|
QueryTableFrame.OnClose(self, event) |
|
|
|
|
605 |
def select_shapes(self, layer, shapes): |
def select_shapes(self, layer, shapes): |
606 |
"""Subscribed to the SHAPES_SELECTED message. |
"""Subscribed to the SHAPES_SELECTED message. |
607 |
|
|