Changeset 1306
- Timestamp:
- 05/23/07 04:25:16 (2 years ago)
- Files:
-
- gaphor/trunk/gaphor/action.py (modified) (1 diff)
- gaphor/trunk/gaphor/core.py (modified) (1 diff)
- gaphor/trunk/gaphor/ui/mainwindow.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
gaphor/trunk/gaphor/action.py
r1282 r1306 97 97 import gtk 98 98 group = gtk.ActionGroup(name or obj) 99 objtype = type(obj) 99 100 100 101 for attrname in dir(obj): 101 102 try: 102 method = getattr(obj, attrname) 103 # Fetch the methods from the object's type instead of the object 104 # itself. This prevents some desciptors (mainly gaphor.core.inject) 105 # from executing. 106 # Otherwise stuff like dependency resolving (=inject) may kick in 107 # too early. 108 method = getattr(objtype, attrname) 103 109 except: 104 110 continue gaphor/trunk/gaphor/core.py
r1264 r1306 27 27 28 28 def __get__(self, obj, class_=None): 29 """ 30 Resolve a dependency, but only if we're called from an object instance. 31 """ 32 if not obj: 33 return self 29 34 if self._inj is None: 30 35 self._inj = _Application.get_service(self._name) gaphor/trunk/gaphor/ui/mainwindow.py
r1301 r1306 34 34 action_manager = inject('action_manager') 35 35 36 # <old>37 # _('_Edit'), (38 # 'Undo',39 # 'Redo',40 # 'separator',41 # 'EditCopy',42 # 'EditPaste',43 # 'separator',44 # 'ResetToolAfterCreate',45 46 # </old>47 48 36 title = 'Gaphor' 49 37 size = property(lambda s: s.properties.get('ui.window-size', (760, 580))) … … 56 44 <menu action="file"> 57 45 <placeholder name="primary" /> 46 <separator /> 47 <menu action="file-export" /> 48 <menu action="file-import" /> 49 <separator /> 58 50 <placeholder name="secondary" /> 59 51 <placeholder name="ternary" /> … … 116 108 self.action_group = build_action_group(self) 117 109 for name, label in (('file', '_File'), 110 ('file-export', '_Export'), 111 ('file-import', '_Import'), 118 112 ('edit', '_Edit'), 119 113 ('diagram', '_Diagram'),
