From 47644bcc15e2d83004d085962ca10eaf6ee7fc33 Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Wed, 29 Mar 2006 19:26:43 +0000 Subject: [PATCH] enable actiongroups on autoload svn: r6225 --- gramps2/ChangeLog | 2 ++ gramps2/src/ArgHandler.py | 1 - gramps2/src/ViewManager.py | 8 ++++++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index d2a2d3237..8734ce086 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,4 +1,6 @@ 2006-03-29 Don Allingham + * src/ViewManager.py: enable actiongroups if file loaded before + the interface is initialized (command line or autoload) * src/SelectObject.py: Provide images in preview * src/DisplayTabs.py: Add support of SelectObject * src/GenericFilter.py: check for xml file before trying to parse diff --git a/gramps2/src/ArgHandler.py b/gramps2/src/ArgHandler.py index a0bd8dd79..37ac1040c 100644 --- a/gramps2/src/ArgHandler.py +++ b/gramps2/src/ArgHandler.py @@ -229,7 +229,6 @@ class ArgHandler: if filetype in (const.app_gramps, const.app_gramps_xml, const.app_gedcom): - print "Here" return self.vm.open_native(filename,filetype) else: return 0 diff --git a/gramps2/src/ViewManager.py b/gramps2/src/ViewManager.py index 3bf0b69a4..ea45dbfea 100644 --- a/gramps2/src/ViewManager.py +++ b/gramps2/src/ViewManager.py @@ -172,7 +172,8 @@ class ViewManager: self.window = gtk.Window() self.window.set_icon_from_file(const.icon) self.window.connect('destroy', self.quit) - + self.file_loaded = False + try: width = Config.get_width() height = Config.get_height() @@ -262,7 +263,8 @@ class ViewManager: def init_interface(self): self.create_pages() self.change_page(None,None) - self.actiongroup.set_visible(False) + if not self.file_loaded: + self.actiongroup.set_visible(False) self.fileactions.set_sensitive(False) self.do_load_plugins() self.build_tools_menu() @@ -711,6 +713,7 @@ class ViewManager: RecentFiles.recent_files(filename,filetype) self.recent_manager.build() + self.actiongroup.set_visible(True) self.uistate.clear_history() return success @@ -783,6 +786,7 @@ class ViewManager: #self.undo_callback(None) #self.redo_callback(None) #self.goto_active_person() + self.file_loaded = True self.actiongroup.set_visible(True) return True