Changeset 2229
- Timestamp:
- 02/29/08 04:27:05 (3 months ago)
- Files:
-
- gaphor/trunk/gaphor/__init__.py (modified) (2 diffs)
- gaphor/trunk/gaphor/services/filemanager.py (modified) (4 diffs)
- gaphor/trunk/setup.cfg (modified) (1 diff)
- gaphor/trunk/utils/command/run.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
gaphor/trunk/gaphor/__init__.py
r2134 r2229 27 27 28 28 29 def main(gaphor_file=None):29 def launch(gaphor_file=None): 30 30 """ 31 31 Start the main application by initiating and running … … 37 37 Application.init() 38 38 39 main_window = Application.get_service('gui_manager').main_window 40 action_manager = Application.get_service('action_manager') 39 file_manager = Application.get_service('file_manager') 41 40 if gaphor_file: 42 main_window.set_filename(gaphor_file) 43 action_manager.execute('file-revert') 41 file_manager.load(gaphor_file) 44 42 else: 45 action_manager.execute('file-new') 43 file_manager.new() 44 46 45 Application.run() 47 46 Application.shutdown() 47 48 49 def main(): 50 """ 51 Main from the command line 52 """ 53 import sys 54 if len(sys.argv) > 1: 55 launch(sys.argv[1]) 56 else: 57 launch() 48 58 49 59 gaphor/trunk/gaphor/services/filemanager.py
r2199 r2229 120 120 recent_files = self.properties.get('recent-files', []) 121 121 filename = recent_files[index] 122 self. _load(filename)122 self.load(filename) 123 123 self._app.handle(FileManagerStateChanged(self)) 124 124 … … 153 153 154 154 155 def _load(self, filename):155 def load(self, filename): 156 156 try: 157 157 from gaphor.storage import storage … … 239 239 filename = self._open_dialog('New Gaphor model from template') 240 240 if filename: 241 self. _load(filename)241 self.load(filename) 242 242 243 243 # It's a template: unset filename … … 250 250 filename = self._open_dialog('Open Gaphor model') 251 251 if filename: 252 self. _load(filename)252 self.load(filename) 253 253 self._app.handle(FileManagerStateChanged(self)) 254 254 gaphor/trunk/setup.cfg
r1190 r2229 1 1 2 2 [egg_info] 3 # Point egg_base to compiled sources, cause some sources have to be generated4 # egg_base=build/lib3 #tag_build = .dev 4 #tag_svn_revision = 1 5 5 gaphor/trunk/utils/command/run.py
r1690 r2229 107 107 else: 108 108 print 'Launching Gaphor...' 109 #gaphor.main(self.model)109 del sys.argv[1:] 110 110 starter = load_entry_point('gaphor==%s' % (self.distribution.get_version(),), 'console_scripts', 'gaphor') 111 111
