Changeset 1292

Show
Ignore:
Timestamp:
05/21/07 23:24:40 (2 years ago)
Author:
arj..@yirdis.nl
Message:

minor updates

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • gaphor/trunk/gaphor/diagram/diagramitem.py

    r1266 r1292  
    342342            cls = type(subject) 
    343343 
    344             # find out names of classes, which are superclasses of our 
    345             # subject 
     344            # find out names of classes, which are superclasses of our subject 
    346345            names = set(c.__name__ for c in cls.__mro__ if issubclass(c, Element)) 
    347346 
  • gaphor/trunk/gaphor/ui/diagramtab.py

    r1283 r1292  
    2626            <separator /> 
    2727            <menuitem action="diagram-select-all" /> 
    28             <menuitem action="diagram-deselect-all" /> 
     28            <menuitem action="diagram-unselect-all" /> 
    2929          </menu> 
    3030          <menu action="diagram"> 
     
    153153        self.view.select_all() 
    154154 
    155     @action(name='diagram-deselect-all', label='Des_elect all', 
     155    @action(name='diagram-unselect-all', label='Des_elect all', 
    156156            accel='<Control><Shift>a') 
    157     def deselect_all(self): 
    158         self.view.deselect_all() 
     157    def unselect_all(self): 
     158        self.view.unselect_all() 
    159159         
    160160    @action(name='diagram-delete', stock_id='gtk-delete') 
  • gaphor/trunk/gaphor/ui/diagramtools.py

    r1291 r1292  
    105105class PopupItemTool(ItemTool): 
    106106    """ 
    107     An item tool with the extended ability to display a popup menu on 
     107    An item tool with the ability to display a popup menu on 
    108108    a right mouse click. 
    109109    """ 
    110110 
    111     gui_manager = inject('gui_manager') 
     111    action_manager = inject('action_manager') 
    112112 
    113113    def __init__(self): 
     
    118118            return False 
    119119        if event.button == 3: 
    120             view = context.view 
    121             item = view.focused_item 
    122120            context.ungrab() 
    123             # Display popup menu using after-event signal 
     121            item = context.view.focused_item 
     122 
    124123            if item: 
    125                 popup_menu = item.get_popup_menu() 
    126                 if popup_menu: 
    127                     mainwin = self.gui_manager.main_window 
    128                     mainwin._construct_popup_menu(menu_def=popup_menu, 
    129                                                   event=event) 
     124                menu = self.action_manager.ui_manager.get_widget('item-popup') 
     125                if menu: 
     126                    menu.popup(None, None, None, event.button, event.time) 
    130127        return True 
    131128