From 76a7d7addebeaf540fd157e8199fb3ae4b7d6824 Mon Sep 17 00:00:00 2001 From: Paul Franklin Date: Fri, 17 May 2013 16:11:14 +0000 Subject: [PATCH] 1780: End of Line Report options window - changing Output Format cause change active tab to "report options" This also happens on every other report, of course. (I will commit this to gramps40 when its "code freeze" is over.) svn: r22358 --- gramps/gui/plug/report/_docreportdialog.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/gramps/gui/plug/report/_docreportdialog.py b/gramps/gui/plug/report/_docreportdialog.py index 3140058b7..4fc5e935c 100644 --- a/gramps/gui/plug/report/_docreportdialog.py +++ b/gramps/gui/plug/report/_docreportdialog.py @@ -3,7 +3,7 @@ # # Copyright (C) 2007 Brian G. Matherly # Copyright (C) 2010 Jakim Friant -# Copyright (C) 2012 Paul Franklin +# Copyright (C) 2012-2013 Paul Franklin # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -77,7 +77,7 @@ class DocReportDialog(ReportDialog): def init_interface(self): ReportDialog.init_interface(self) - self.doc_type_changed(self.format_menu) + self.doc_type_changed(self.format_menu, preserve_tab=False) #------------------------------------------------------------------------ # @@ -107,7 +107,7 @@ class DocReportDialog(ReportDialog): self.options.set_document(self.doc) - def doc_type_changed(self, obj): + def doc_type_changed(self, obj, preserve_tab=True): """This routine is called when the user selects a new file format for the report. It adjusts the various dialog sections to reflect the appropriate values for the currently selected @@ -123,6 +123,7 @@ class DocReportDialog(ReportDialog): # Is this to be a printed report or an electronic report # (i.e. a set of web pages) + old_page = self.notebook.get_current_page() if self.firstpage_added: self.notebook.remove_page(0) if docgen_plugin.get_paper_used(): @@ -135,6 +136,8 @@ class DocReportDialog(ReportDialog): self.html_label.set_use_markup(True) self.notebook.insert_page(self.html_table, self.html_label, 0) self.html_table.show_all() + if preserve_tab: + self.notebook.set_current_page(old_page) self.firstpage_added = True ext_val = docgen_plugin.get_extension()