Show report frames being used, instead of hiding frames that aren't

being used.  It makes for a much cleaner opening of the dialog window.


svn: r639
This commit is contained in:
David Hampton 2001-12-19 18:40:12 +00:00
parent db960a93f7
commit 6a1fc53c15
6 changed files with 73 additions and 47 deletions

View File

@ -379,6 +379,7 @@ class ReportDialog:
"""Set up the format frame of the dialog. This function """Set up the format frame of the dialog. This function
relies on the make_doc_menu() function to do all the hard relies on the make_doc_menu() function to do all the hard
work.""" work."""
self.topDialog.get_widget("format_frame").show()
self.format_menu = self.topDialog.get_widget("format") self.format_menu = self.topDialog.get_widget("format")
self.make_doc_menu() self.make_doc_menu()
@ -389,6 +390,7 @@ class ReportDialog:
the builds a menu of all the available styles for the user to the builds a menu of all the available styles for the user to
choose from.""" choose from."""
self.style_frame = self.topDialog.get_widget("style_frame") self.style_frame = self.topDialog.get_widget("style_frame")
self.style_frame.show()
self.style_menu = self.topDialog.get_widget("style_menu") self.style_menu = self.topDialog.get_widget("style_menu")
# Build the default style set for this report. # Build the default style set for this report.
@ -428,9 +430,8 @@ class ReportDialog:
if pagecount_map: if pagecount_map:
myMenu = utils.build_string_optmenu(pagecount_map, start_text) myMenu = utils.build_string_optmenu(pagecount_map, start_text)
self.pagecount_menu.set_menu(myMenu) self.pagecount_menu.set_menu(myMenu)
else: self.pagecount_menu.show()
self.pagecount_menu.hide() self.pagecount_label.show()
self.pagecount_label.hide()
def setup_html_frame(self): def setup_html_frame(self):
"""Set up the html frame of the dialog. This sole purpose of """Set up the html frame of the dialog. This sole purpose of
@ -445,29 +446,29 @@ class ReportDialog:
this box. *All* of these items are optional, although the this box. *All* of these items are optional, although the
generations fields and the filter combo box are used in most generations fields and the filter combo box are used in most
(but not all) dialog boxes.""" (but not all) dialog boxes."""
self.topDialog.get_widget("options_frame").show()
# Set up the generations spin and page break checkbox # Set up the generations spin and page break checkbox
(use_gen, use_break) = self.get_report_generations() (use_gen, use_break) = self.get_report_generations()
self.generations_spinbox = self.topDialog.get_widget("generations") self.generations_spinbox = self.topDialog.get_widget("generations")
self.pagebreak_checkbox = self.topDialog.get_widget("pagebreak") self.pagebreak_checkbox = self.topDialog.get_widget("pagebreak")
if use_gen: if use_gen:
self.topDialog.get_widget("gen_label").show()
self.generations_spinbox.set_value(use_gen) self.generations_spinbox.set_value(use_gen)
self.generations_spinbox.show()
else: else:
self.topDialog.get_widget("gen_label").hide()
self.generations_spinbox.hide()
use_break = 0 use_break = 0
if not use_break: if use_break:
self.pagebreak_checkbox.hide() self.pagebreak_checkbox.show()
# Now the filter combo # Now the filter combo
self.filter_combo = self.topDialog.get_widget("filter_combo") self.filter_combo = self.topDialog.get_widget("filter_combo")
filter_strings = self.get_report_filter_strings() filter_strings = self.get_report_filter_strings()
if filter_strings: if filter_strings:
self.topDialog.get_widget("filter_label").show()
filter_strings.sort() filter_strings.sort()
self.filter_combo.set_popdown_strings(filter_strings) self.filter_combo.set_popdown_strings(filter_strings)
else: self.filter_combo.show()
self.topDialog.get_widget("filter_label").hide()
self.filter_combo.hide()
# Now the "extra" option menu # Now the "extra" option menu
self.extra_menu_label = self.topDialog.get_widget("extra_menu_label") self.extra_menu_label = self.topDialog.get_widget("extra_menu_label")
@ -475,12 +476,11 @@ class ReportDialog:
(label, extra_map, preset) = self.get_report_extra_menu_map() (label, extra_map, preset) = self.get_report_extra_menu_map()
if extra_map: if extra_map:
self.extra_menu_label.set_text(label) self.extra_menu_label.set_text(label)
self.extra_menu_label.show()
myMenu = utils.build_string_optmenu(extra_map, preset) myMenu = utils.build_string_optmenu(extra_map, preset)
self.extra_menu.set_menu(myMenu) self.extra_menu.set_menu(myMenu)
self.extra_menu.set_sensitive(len(extra_map) > 1) self.extra_menu.set_sensitive(len(extra_map) > 1)
else: self.extra_menu.show()
self.extra_menu_label.hide()
self.extra_menu.hide()
# Now the "extra" text box # Now the "extra" text box
self.extra_textbox_label = self.topDialog.get_widget("extra_textbox_label") self.extra_textbox_label = self.topDialog.get_widget("extra_textbox_label")
@ -488,10 +488,9 @@ class ReportDialog:
(label, string) = self.get_report_extra_textbox_string() (label, string) = self.get_report_extra_textbox_string()
if string: if string:
self.extra_textbox_label.set_text(label) self.extra_textbox_label.set_text(label)
self.extra_textbox_label.show()
self.extra_textbox.insert_defaults(string) self.extra_textbox.insert_defaults(string)
else: self.topDialog.get_widget("extra_scrolledwindow").show()
self.extra_textbox_label.hide()
self.topDialog.get_widget("extra_scrolledwindow").hide()
def setup_other_frames(self): def setup_other_frames(self):
"""Do nothing. This sole purpose of this function is to give """Do nothing. This sole purpose of this function is to give

View File

@ -169,7 +169,7 @@ class GraphVizDialog(ReportDialog):
#------------------------------------------------------------------------ #------------------------------------------------------------------------
def setup_style_frame(self): def setup_style_frame(self):
"""The style frame is not used in this dialog.""" """The style frame is not used in this dialog."""
self.topDialog.get_widget("style_frame").hide() pass
#------------------------------------------------------------------------ #------------------------------------------------------------------------
# #

View File

@ -393,7 +393,7 @@ class IndivSummaryDialog(TextReportDialog):
#------------------------------------------------------------------------ #------------------------------------------------------------------------
def setup_report_options(self): def setup_report_options(self):
"""The 'Report Options' frame is not used in this dialog.""" """The 'Report Options' frame is not used in this dialog."""
self.topDialog.get_widget("options_frame").hide() pass
#------------------------------------------------------------------------ #------------------------------------------------------------------------
# #

View File

@ -926,7 +926,6 @@ class WebReportDialog(ReportDialog):
"""The format frame is not used in this dialog. Hide it, and """The format frame is not used in this dialog. Hide it, and
set the output notebook to always display the html template set the output notebook to always display the html template
page.""" page."""
self.topDialog.get_widget("format_frame").hide()
self.output_notebook.set_page(1) self.output_notebook.set_page(1)
def setup_other_frames(self): def setup_other_frames(self):

View File

@ -124,7 +124,7 @@
<widget> <widget>
<class>GtkFrame</class> <class>GtkFrame</class>
<name>format_frame</name> <name>target_frame</name>
<border_width>4</border_width> <border_width>4</border_width>
<label>Save As</label> <label>Save As</label>
<label_xalign>0</label_xalign> <label_xalign>0</label_xalign>
@ -193,6 +193,7 @@
<class>GtkFrame</class> <class>GtkFrame</class>
<name>format_frame</name> <name>format_frame</name>
<border_width>4</border_width> <border_width>4</border_width>
<visible>False</visible>
<label>Format</label> <label>Format</label>
<label_xalign>0</label_xalign> <label_xalign>0</label_xalign>
<shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type> <shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
@ -217,6 +218,7 @@
<class>GtkFrame</class> <class>GtkFrame</class>
<name>style_frame</name> <name>style_frame</name>
<border_width>4</border_width> <border_width>4</border_width>
<visible>False</visible>
<label>Styles</label> <label>Styles</label>
<label_xalign>0</label_xalign> <label_xalign>0</label_xalign>
<shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type> <shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
@ -403,6 +405,7 @@
<widget> <widget>
<class>GtkLabel</class> <class>GtkLabel</class>
<name>pagecount_label</name> <name>pagecount_label</name>
<visible>False</visible>
<label>Count</label> <label>Count</label>
<justify>GTK_JUSTIFY_CENTER</justify> <justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap> <wrap>False</wrap>
@ -429,6 +432,7 @@
<widget> <widget>
<class>GtkOptionMenu</class> <class>GtkOptionMenu</class>
<name>pagecount_menu</name> <name>pagecount_menu</name>
<visible>False</visible>
<can_focus>True</can_focus> <can_focus>True</can_focus>
<items>Single (scaled) <items>Single (scaled)
</items> </items>
@ -560,6 +564,7 @@
<class>GtkFrame</class> <class>GtkFrame</class>
<name>options_frame</name> <name>options_frame</name>
<border_width>4</border_width> <border_width>4</border_width>
<visible>False</visible>
<label>Report Options</label> <label>Report Options</label>
<label_xalign>0</label_xalign> <label_xalign>0</label_xalign>
<shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type> <shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
@ -582,6 +587,7 @@
<class>GtkCombo</class> <class>GtkCombo</class>
<name>filter_combo</name> <name>filter_combo</name>
<border_width>5</border_width> <border_width>5</border_width>
<visible>False</visible>
<value_in_list>True</value_in_list> <value_in_list>True</value_in_list>
<ok_if_empty>True</ok_if_empty> <ok_if_empty>True</ok_if_empty>
<case_sensitive>False</case_sensitive> <case_sensitive>False</case_sensitive>
@ -618,6 +624,7 @@
<widget> <widget>
<class>GtkLabel</class> <class>GtkLabel</class>
<name>filter_label</name> <name>filter_label</name>
<visible>False</visible>
<label>Filter</label> <label>Filter</label>
<justify>GTK_JUSTIFY_CENTER</justify> <justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap> <wrap>False</wrap>
@ -644,6 +651,7 @@
<widget> <widget>
<class>GtkLabel</class> <class>GtkLabel</class>
<name>gen_label</name> <name>gen_label</name>
<visible>False</visible>
<label>Generations</label> <label>Generations</label>
<justify>GTK_JUSTIFY_CENTER</justify> <justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap> <wrap>False</wrap>
@ -670,6 +678,7 @@
<widget> <widget>
<class>GtkSpinButton</class> <class>GtkSpinButton</class>
<name>generations</name> <name>generations</name>
<visible>False</visible>
<can_focus>True</can_focus> <can_focus>True</can_focus>
<climb_rate>1</climb_rate> <climb_rate>1</climb_rate>
<digits>0</digits> <digits>0</digits>
@ -702,6 +711,7 @@
<widget> <widget>
<class>GtkCheckButton</class> <class>GtkCheckButton</class>
<name>pagebreak</name> <name>pagebreak</name>
<visible>False</visible>
<can_focus>True</can_focus> <can_focus>True</can_focus>
<label>Page break between generations</label> <label>Page break between generations</label>
<active>False</active> <active>False</active>
@ -725,6 +735,7 @@
<widget> <widget>
<class>GtkLabel</class> <class>GtkLabel</class>
<name>extra_menu_label</name> <name>extra_menu_label</name>
<visible>False</visible>
<label></label> <label></label>
<justify>GTK_JUSTIFY_CENTER</justify> <justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap> <wrap>False</wrap>
@ -751,6 +762,7 @@
<widget> <widget>
<class>GtkLabel</class> <class>GtkLabel</class>
<name>extra_textbox_label</name> <name>extra_textbox_label</name>
<visible>False</visible>
<label></label> <label></label>
<justify>GTK_JUSTIFY_CENTER</justify> <justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap> <wrap>False</wrap>
@ -778,6 +790,7 @@
<class>GtkOptionMenu</class> <class>GtkOptionMenu</class>
<name>extra_menu</name> <name>extra_menu</name>
<border_width>5</border_width> <border_width>5</border_width>
<visible>False</visible>
<can_focus>True</can_focus> <can_focus>True</can_focus>
<items>default <items>default
</items> </items>
@ -803,6 +816,7 @@
<name>extra_scrolledwindow</name> <name>extra_scrolledwindow</name>
<border_width>5</border_width> <border_width>5</border_width>
<height>80</height> <height>80</height>
<visible>False</visible>
<hscrollbar_policy>GTK_POLICY_ALWAYS</hscrollbar_policy> <hscrollbar_policy>GTK_POLICY_ALWAYS</hscrollbar_policy>
<vscrollbar_policy>GTK_POLICY_ALWAYS</vscrollbar_policy> <vscrollbar_policy>GTK_POLICY_ALWAYS</vscrollbar_policy>
<hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy> <hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy>

View File

@ -124,7 +124,7 @@
<widget> <widget>
<class>GtkFrame</class> <class>GtkFrame</class>
<name>format_frame</name> <name>target_frame</name>
<border_width>4</border_width> <border_width>4</border_width>
<label>Save As</label> <label>Save As</label>
<label_xalign>0</label_xalign> <label_xalign>0</label_xalign>
@ -193,6 +193,7 @@
<class>GtkFrame</class> <class>GtkFrame</class>
<name>format_frame</name> <name>format_frame</name>
<border_width>4</border_width> <border_width>4</border_width>
<visible>False</visible>
<label>Format</label> <label>Format</label>
<label_xalign>0</label_xalign> <label_xalign>0</label_xalign>
<shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type> <shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
@ -217,6 +218,7 @@
<class>GtkFrame</class> <class>GtkFrame</class>
<name>style_frame</name> <name>style_frame</name>
<border_width>4</border_width> <border_width>4</border_width>
<visible>False</visible>
<label>Styles</label> <label>Styles</label>
<label_xalign>0</label_xalign> <label_xalign>0</label_xalign>
<shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type> <shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
@ -403,6 +405,7 @@
<widget> <widget>
<class>GtkLabel</class> <class>GtkLabel</class>
<name>pagecount_label</name> <name>pagecount_label</name>
<visible>False</visible>
<label>Count</label> <label>Count</label>
<justify>GTK_JUSTIFY_CENTER</justify> <justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap> <wrap>False</wrap>
@ -429,6 +432,7 @@
<widget> <widget>
<class>GtkOptionMenu</class> <class>GtkOptionMenu</class>
<name>pagecount_menu</name> <name>pagecount_menu</name>
<visible>False</visible>
<can_focus>True</can_focus> <can_focus>True</can_focus>
<items>Single (scaled) <items>Single (scaled)
</items> </items>
@ -560,6 +564,7 @@
<class>GtkFrame</class> <class>GtkFrame</class>
<name>options_frame</name> <name>options_frame</name>
<border_width>4</border_width> <border_width>4</border_width>
<visible>False</visible>
<label>Report Options</label> <label>Report Options</label>
<label_xalign>0</label_xalign> <label_xalign>0</label_xalign>
<shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type> <shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
@ -582,6 +587,7 @@
<class>GtkCombo</class> <class>GtkCombo</class>
<name>filter_combo</name> <name>filter_combo</name>
<border_width>5</border_width> <border_width>5</border_width>
<visible>False</visible>
<value_in_list>True</value_in_list> <value_in_list>True</value_in_list>
<ok_if_empty>True</ok_if_empty> <ok_if_empty>True</ok_if_empty>
<case_sensitive>False</case_sensitive> <case_sensitive>False</case_sensitive>
@ -618,6 +624,7 @@
<widget> <widget>
<class>GtkLabel</class> <class>GtkLabel</class>
<name>filter_label</name> <name>filter_label</name>
<visible>False</visible>
<label>Filter</label> <label>Filter</label>
<justify>GTK_JUSTIFY_CENTER</justify> <justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap> <wrap>False</wrap>
@ -644,6 +651,7 @@
<widget> <widget>
<class>GtkLabel</class> <class>GtkLabel</class>
<name>gen_label</name> <name>gen_label</name>
<visible>False</visible>
<label>Generations</label> <label>Generations</label>
<justify>GTK_JUSTIFY_CENTER</justify> <justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap> <wrap>False</wrap>
@ -670,6 +678,7 @@
<widget> <widget>
<class>GtkSpinButton</class> <class>GtkSpinButton</class>
<name>generations</name> <name>generations</name>
<visible>False</visible>
<can_focus>True</can_focus> <can_focus>True</can_focus>
<climb_rate>1</climb_rate> <climb_rate>1</climb_rate>
<digits>0</digits> <digits>0</digits>
@ -725,6 +734,7 @@
<widget> <widget>
<class>GtkCheckButton</class> <class>GtkCheckButton</class>
<name>pagebreak</name> <name>pagebreak</name>
<visible>False</visible>
<can_focus>True</can_focus> <can_focus>True</can_focus>
<label>Page break between generations</label> <label>Page break between generations</label>
<active>False</active> <active>False</active>
@ -748,6 +758,7 @@
<widget> <widget>
<class>GtkLabel</class> <class>GtkLabel</class>
<name>extra_menu_label</name> <name>extra_menu_label</name>
<visible>False</visible>
<label></label> <label></label>
<justify>GTK_JUSTIFY_CENTER</justify> <justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap> <wrap>False</wrap>
@ -771,36 +782,11 @@
</child> </child>
</widget> </widget>
<widget>
<class>GtkLabel</class>
<name>extra_textbox_label</name>
<label></label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>1</xalign>
<yalign>0</yalign>
<xpad>5</xpad>
<ypad>0</ypad>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>4</top_attach>
<bottom_attach>5</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>False</yfill>
</child>
</widget>
<widget> <widget>
<class>GtkOptionMenu</class> <class>GtkOptionMenu</class>
<name>extra_menu</name> <name>extra_menu</name>
<border_width>5</border_width> <border_width>5</border_width>
<visible>False</visible>
<can_focus>True</can_focus> <can_focus>True</can_focus>
<items>default <items>default
</items> </items>
@ -826,6 +812,7 @@
<name>extra_scrolledwindow</name> <name>extra_scrolledwindow</name>
<border_width>5</border_width> <border_width>5</border_width>
<height>80</height> <height>80</height>
<visible>False</visible>
<hscrollbar_policy>GTK_POLICY_ALWAYS</hscrollbar_policy> <hscrollbar_policy>GTK_POLICY_ALWAYS</hscrollbar_policy>
<vscrollbar_policy>GTK_POLICY_ALWAYS</vscrollbar_policy> <vscrollbar_policy>GTK_POLICY_ALWAYS</vscrollbar_policy>
<hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy> <hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy>
@ -853,6 +840,33 @@
<text></text> <text></text>
</widget> </widget>
</widget> </widget>
<widget>
<class>GtkLabel</class>
<name>extra_textbox_label</name>
<visible>False</visible>
<label></label>
<justify>GTK_JUSTIFY_CENTER</justify>
<wrap>False</wrap>
<xalign>1</xalign>
<yalign>0</yalign>
<xpad>5</xpad>
<ypad>0</ypad>
<child>
<left_attach>0</left_attach>
<right_attach>1</right_attach>
<top_attach>4</top_attach>
<bottom_attach>5</bottom_attach>
<xpad>0</xpad>
<ypad>0</ypad>
<xexpand>False</xexpand>
<yexpand>False</yexpand>
<xshrink>False</xshrink>
<yshrink>False</yshrink>
<xfill>True</xfill>
<yfill>True</yfill>
</child>
</widget>
</widget> </widget>
</widget> </widget>