/[thuban]/branches/WIP-pyshapelib-bramz/Thuban/UI/tableview.py
ViewVC logotype

Diff of /branches/WIP-pyshapelib-bramz/Thuban/UI/tableview.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1662 by bh, Wed Aug 27 13:51:01 2003 UTC revision 1892 by bh, Thu Oct 30 18:16:53 2003 UTC
# Line 310  class TableFrame(ThubanFrame): Line 310  class TableFrame(ThubanFrame):
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.
# Line 319  class TableFrame(ThubanFrame): Line 324  class TableFrame(ThubanFrame):
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    
# Line 584  class LayerTableFrame(QueryTableFrame): Line 584  class LayerTableFrame(QueryTableFrame):
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          """          """
# Line 595  class LayerTableFrame(QueryTableFrame): Line 602  class LayerTableFrame(QueryTableFrame):
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    

Legend:
Removed from v.1662  
changed lines
  Added in v.1892

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26