From 7c37b80716a37219856b8ccd890a72627b5b245c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Charette?= Date: Sat, 12 Jan 2008 03:26:44 +0000 Subject: [PATCH] more report changes svn: r9781 --- ChangeLog | 8 ++++ src/PluginUtils/_MenuOptions.py | 13 +++++- src/ReportBase/_BareReportDialog.py | 1 + src/plugins/GVFamilyLines.py | 68 ++++++++++++++++++++--------- 4 files changed, 68 insertions(+), 22 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2d289cae2..552c55f14 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-01-11 Stéphane Charette + * src/ReportBase/_BareReportDialog.py: allow scroll arrows on the + notebook if there are too many tabs to display + * src/plugins/GVFamilyLines.py: context-sensitive control feedback + based on other selected controls + * src/PluginUtils/_MenuOptions.py: define inheritable method that gets + called after all of the controls have been created + 2008-01-11 Benny Malengier * src/glade/gramps.glade: add alt key combo's for buttons diff --git a/src/PluginUtils/_MenuOptions.py b/src/PluginUtils/_MenuOptions.py index 776a855da..0871fcc1b 100644 --- a/src/PluginUtils/_MenuOptions.py +++ b/src/PluginUtils/_MenuOptions.py @@ -1145,7 +1145,18 @@ class MenuOptions: option.make_gui_obj(gtk, dialog) option.add_dialog_category(dialog, category) option.add_tooltip(self.tooltips) - + + # give the reports the opportunity to tweak the + # controls or possibly setup some event connections + self.post_init(dialog) + + def post_init(self, dialog): + """ + Inheritable method to give reports the chance to setup + control event connections. + """ + pass + def parse_user_options(self,dialog): """ Generic method to parse the user options and cache result in options_dict. diff --git a/src/ReportBase/_BareReportDialog.py b/src/ReportBase/_BareReportDialog.py index a1010e326..c830814c3 100644 --- a/src/ReportBase/_BareReportDialog.py +++ b/src/ReportBase/_BareReportDialog.py @@ -151,6 +151,7 @@ class BareReportDialog(ManagedWindow.ManagedWindow): self.setup_style_frame() self.notebook = gtk.Notebook() + self.notebook.set_scrollable(True) self.notebook.set_border_width(6) self.window.vbox.add(self.notebook) diff --git a/src/plugins/GVFamilyLines.py b/src/plugins/GVFamilyLines.py index eb2336579..0f61977f8 100644 --- a/src/plugins/GVFamilyLines.py +++ b/src/plugins/GVFamilyLines.py @@ -153,35 +153,35 @@ class FamilyLinesOptions(MenuReportOptions): colourFamily.set_help( _('The colour to use to display families.')) menu.add_option(category, 'FLcolourFamilies', colourFamily) - limitParents = BooleanOption( _('Limit the number of parents'), False) - limitParents.set_help( _('The maximum number of ancestors to include.')) - menu.add_option(category, 'FLlimitParents', limitParents) + self.limitParents = BooleanOption( _('Limit the number of parents'), False) + self.limitParents.set_help( _('The maximum number of ancestors to include.')) + menu.add_option(category, 'FLlimitParents', self.limitParents) - maxParents = NumberOption( '', 50, 10, 9999) - maxParents.set_help( _('The maximum number of ancestors to include.')) - menu.add_option(category, 'FLmaxParents', maxParents) + self.maxParents = NumberOption( '', 50, 10, 9999) + self.maxParents.set_help( _('The maximum number of ancestors to include.')) + menu.add_option(category, 'FLmaxParents', self.maxParents) - limitChildren = BooleanOption( _('Limit the number of children'), False) - limitChildren.set_help( _('The maximum number of children to include.')) - menu.add_option(category, 'FLlimitChildren', limitChildren) + self.limitChildren = BooleanOption( _('Limit the number of children'), False) + self.limitChildren.set_help( _('The maximum number of children to include.')) + menu.add_option(category, 'FLlimitChildren', self.limitChildren) - maxChildren = NumberOption( '', 50, 10, 9999) - maxChildren.set_help( _('The maximum number of children to include.')) - menu.add_option(category, 'FLmaxChildren', maxChildren) + self.maxChildren = NumberOption( '', 50, 10, 9999) + self.maxChildren.set_help( _('The maximum number of children to include.')) + menu.add_option(category, 'FLmaxChildren', self.maxChildren) # -------------------- category = _('Images') # -------------------- - includeImages = BooleanOption( _('Include thumbnail images of people'), True) - includeImages.set_help( _('The maximum number of children to include.')) - menu.add_option(category, 'FLincludeImages', includeImages) + self.includeImages = BooleanOption( _('Include thumbnail images of people'), True) + self.includeImages.set_help( _('The maximum number of children to include.')) + menu.add_option(category, 'FLincludeImages', self.includeImages) - imageLocation = EnumeratedListOption(_('Thumbnail location'), 0) - imageLocation.add_item(0, _('Above the name')) - imageLocation.add_item(1, _('Beside the name')) - imageLocation.set_help( _('Where the thumbnail image should appear relative to the name')) - menu.add_option(category, 'FLimageOnTheSide', imageLocation) + self.imageLocation = EnumeratedListOption(_('Thumbnail location'), 0) + self.imageLocation.add_item(0, _('Above the name')) + self.imageLocation.add_item(1, _('Beside the name')) + self.imageLocation.set_help( _('Where the thumbnail image should appear relative to the name')) + menu.add_option(category, 'FLimageOnTheSide', self.imageLocation) # --------------------- category = _('Options') @@ -213,7 +213,33 @@ class FamilyLinesOptions(MenuReportOptions): includePrivate = BooleanOption( _('Include private records'), False) includePrivate.set_help( _('Whether to include names, dates, and families that are marked as private.')) menu.add_option(category, 'FLincludePrivate', includePrivate) - + + + def limitChanged(self, button): + self.maxParents.gobj.set_sensitive(self.limitParents.gobj.get_active()) + self.maxChildren.gobj.set_sensitive(self.limitChildren.gobj.get_active()) + + + def imagesChanged(self, button): + self.imageLocation.gobj.set_sensitive(self.includeImages.gobj.get_active()) + + + def post_init(self, dialog): + # this method is called after all of the controls have been + # created, but before the notebook is shown to the user + + # re-order the notebook tabs the way we want +# dialog.notebook. + + self.limitParents.gobj.connect('toggled', self.limitChanged) + self.limitChildren.gobj.connect('toggled', self.limitChanged) + + self.includeImages.gobj.connect('toggled', self.imagesChanged) + + # ensure things are initialized correctly when it first comes up + self.limitChanged(self.limitParents.gobj) + self.imagesChanged(self.includeImages.gobj) + #------------------------------------------------------------------------ #