From 39eee892955f816f575ff243442308983f06676f Mon Sep 17 00:00:00 2001 From: Benny Malengier Date: Sat, 25 Aug 2007 14:31:14 +0000 Subject: [PATCH] store last export type svn: r8866 --- ChangeLog | 4 ++++ src/Config/_GrampsConfigKeys.py | 2 ++ src/ExportAssistant.py | 8 ++++++-- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8b7f20586..157ede607 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2007-08-25 Benny Malengier + * src/Config/_GrampsConfigKeys.py : store last export type + * src/ExportAssistant.py : use last export type + 2007-08-25 Brian Matherly * src/ReportBase/_ReportUtils.py: 0001121: Output relationship type correctly in Detailed descendant and ancestor reports (improved) diff --git a/src/Config/_GrampsConfigKeys.py b/src/Config/_GrampsConfigKeys.py index e4ab5f3bd..abc0653ae 100644 --- a/src/Config/_GrampsConfigKeys.py +++ b/src/Config/_GrampsConfigKeys.py @@ -111,6 +111,7 @@ PAPER_PREFERENCE = ('preferences', 'paper-preference', 2) RECENT_FILE = ('paths', 'recent-file', 2) RECENT_IMPORT_DIR = ('paths', 'recent-import-dir', 2) RECENT_EXPORT_DIR = ('paths', 'recent-export-dir', 2) +RECENT_EXPORT_TYPE = ('behavior', 'recent-export-type', 1) NAME_FORMAT = ('preferences', 'name-format', 1) REPORT_DIRECTORY = ('paths', 'report-directory', 2) RESEARCHER_ADDR = ('researcher', 'researcher-addr', 2) @@ -213,6 +214,7 @@ default_value = { RECENT_FILE : '', RECENT_IMPORT_DIR : '', RECENT_EXPORT_DIR : '', + RECENT_EXPORT_TYPE : 1, NAME_FORMAT : 1, REPORT_DIRECTORY : './', RESEARCHER_ADDR : '', diff --git a/src/ExportAssistant.py b/src/ExportAssistant.py index 9c0332ed7..d37c4de92 100644 --- a/src/ExportAssistant.py +++ b/src/ExportAssistant.py @@ -180,6 +180,8 @@ class ExportAssistant(gtk.Assistant, ManagedWindow.ManagedWindow) : tip = gtk.Tooltips() group = None + recent_type = Config.get(Config.RECENT_EXPORT_TYPE) + for ix in range(len(self.exportformats)): title = self.exportformats[ix][1] description= self.exportformats[ix][2] @@ -190,6 +192,8 @@ class ExportAssistant(gtk.Assistant, ManagedWindow.ManagedWindow) : self.format_buttons.append(button) table.attach(button,0,2,2*ix,2*ix+1) tip.set_tip(button,description) + if ix == recent_type : + button.set_active(True) box.add(table) @@ -214,8 +218,6 @@ class ExportAssistant(gtk.Assistant, ManagedWindow.ManagedWindow) : self.append_page(page) self.set_page_header_image(page, self.logo) - ix = self.get_selected_format_index() - self.set_page_title(page, self.exportformats[ix][3][0]) self.set_page_complete(page, False) self.set_page_type(page, gtk.ASSISTANT_PAGE_CONTENT) @@ -240,6 +242,7 @@ class ExportAssistant(gtk.Assistant, ManagedWindow.ManagedWindow) : ''' option = self.get_selected_format_index() vbox = self.get_nth_page(_ExportAssistant_pages['options']) + self.set_page_title(vbox, self.exportformats[option][3][0]) # remove present content of the vbox vbox.foreach(vbox.remove) # add new content @@ -518,6 +521,7 @@ class ExportAssistant(gtk.Assistant, ManagedWindow.ManagedWindow) : sys.getfilesystemencoding()) Config.set(Config.RECENT_EXPORT_DIR,os.path.split(filename)[0]) ix = self.get_selected_format_index() + Config.set(Config.RECENT_EXPORT_TYPE, ix) if self.exportformats[ix][3]: success = self.exportformats[ix][0](self.dbstate.db, filename,self.person,