Ejemplo n.º 1
0
 def get_actions(self):
     extent = self._extent
     items = []
     # Get extent actions.
     actions = action.get_tx_actions(self._extent_grid._db, extent)
     if actions:
         items.extend(actions)
     return items
Ejemplo n.º 2
0
 def get_actions(self):
     db = self._entity_grid._db
     extent = self._extent
     entity = self._entity
     items = []
     # Extent tx actions.
     actions = get_tx_actions(db, extent, self._entity_grid._related)
     if actions:
         if items:
             items.append(None)
         items.extend(actions)
     # Entity view actions.
     actions = get_view_actions(db, entity)
     if actions:
         if items:
             items.append(None)
         items.extend(actions)
     # Entity relationship actions.
     if self._entity_grid.show_relationships_in_menu:
         actions = get_relationship_actions(db, entity)
         if actions:
             if items:
                 items.append(None)
             items.extend(actions)
     # Entity tx actions.
     actions = get_tx_actions(db, entity)
     if actions:
         if items:
             items.append(None)
         items.extend(actions)
     # Tx selectionmethod actions.
     selection_mode = self._entity_grid._view.get_selection().get_mode()
     selection = self._entity_grid.get_selected()
     if selection_mode == gtk.SELECTION_MULTIPLE:
         actions = get_tx_selectionmethod_actions(db, selection)
         if actions:
             if items:
                 items.append(None)
             items.extend(actions)
     return items