From: Craig J. A. <and...@ho...> - 2008-11-30 22:39:00
|
I have a PersonOption field that I would like to populate an EnumeratedListOption or a FilterOption with the following: * Descendent report for (the person selected in PersonOption) only. * Descendent report for (the person selected in PersonOption) and Spouse #1 (F##) * Descendent report for (the person selected in PersonOption) and Spouse #2 (F##) I can make the list option field, but I can't seem to clear it for new data. And I am not sure how to make a new filter (if the option exists). Any help would be great. thanks. Craig A. _________________________________________________________________ Proud to be a PC? Show the world. Download the “I’m a PC” Messenger themepack now. hthttp://clk.atdmt.com/MRT/go/119642558/direct/01/ |
From: Brian M. <br...@gr...> - 2008-11-30 23:01:11
|
Craig, > I have a PersonOption field that I would like to populate an > EnumeratedListOption or a FilterOption with the following: > * Descendent report for (the person selected in > PersonOption) only. > * Descendent report for (the person selected in > PersonOption) and Spouse #1 (F##) > * Descendent report for (the person selected in > PersonOption) and Spouse #2 (F##) > > I can make the list option field, but I can't seem to > clear it for new data. And I am not sure how to make a new > filter (if the option exists). > > Any help would be great. Assuming I understand you correctly, here is what I would do: 1) Use a person option to allow the user to select the main person. 2) Add an enumerated list option which lists the spouses if there are more than one. 3) Handle the "'value-changed'" event from the person option and configure the enumerated list option based on which person is selected. 3a) If the selected person has zero or one spouse, then the enumerated list option is not available (set_available(False)). 3b) If the selected person has two or more spouses, they are listed selectable from the enumerated list option. ~Brian |
From: Craig J. A. <and...@ho...> - 2008-11-30 23:07:14
|
Yep, that is exactly what I want to do, but I don't know how to do the end of #3 - configure the enumerated list option based on which person is selected I can't seem to find a good example... I can always add items to the list, but I don't know how to clear it. thanks. Craig A. > Date: Sun, 30 Nov 2008 15:01:08 -0800 > From: br...@gr... > Subject: Re: [Gramps-devel] How to GUI question > To: gra...@li...; and...@ho... > > Craig, > > > I have a PersonOption field that I would like to populate an > > EnumeratedListOption or a FilterOption with the following: > > * Descendent report for (the person selected in > > PersonOption) only. > > * Descendent report for (the person selected in > > PersonOption) and Spouse #1 (F##) > > * Descendent report for (the person selected in > > PersonOption) and Spouse #2 (F##) > > > > I can make the list option field, but I can't seem to > > clear it for new data. And I am not sure how to make a new > > filter (if the option exists). > > > > Any help would be great. > > Assuming I understand you correctly, here is what I would do: > > 1) Use a person option to allow the user to select the main person. > 2) Add an enumerated list option which lists the spouses if there are more than one. > 3) Handle the "'value-changed'" event from the person option and configure the enumerated list option based on which person is selected. > 3a) If the selected person has zero or one spouse, then the enumerated list option is not available (set_available(False)). > 3b) If the selected person has two or more spouses, they are listed selectable from the enumerated list option. > > ~Brian _________________________________________________________________ Proud to be a PC? Show the world. Download the “I’m a PC” Messenger themepack now. hthttp://clk.atdmt.com/MRT/go/119642558/direct/01/ |
From: Brian M. <br...@gr...> - 2008-11-30 23:13:12
|
> Yep, that is exactly what I want to do, but I don't know > how to do the end of #3 > > - configure the enumerated list option based on which > person is selected > > > > I can't seem to find a good example... I can always > add items to the list, but I don't know how to clear it. The EnumeratedListOption has a clear() function which clears all possible values from the list. I'm pretty sure it works. ~Brian |
From: Craig J. A. <and...@ho...> - 2008-11-30 23:29:12
|
Darn it. using the .clear() meathod only kills the program execution. Well it doesn't stop it entirely... It only stops it for that funciton and then continues... It acts like a 'return' statement... Kind of wierd. Any other ideas? And where should I be looking? _GuiOptions? thanks. Craig A. > Date: Sun, 30 Nov 2008 15:13:10 -0800 > From: br...@gr... > Subject: Re: [Gramps-devel] How to GUI question > To: gra...@li...; and...@ho... > > > Yep, that is exactly what I want to do, but I don't know > > how to do the end of #3 > > > > - configure the enumerated list option based on which > > person is selected > > > > > > > > I can't seem to find a good example... I can always > > add items to the list, but I don't know how to clear it. > > The EnumeratedListOption has a clear() function which clears all possible values from the list. I'm pretty sure it works. > > ~Brian _________________________________________________________________ Windows Live Hotmail now works up to 70% faster. http://windowslive.com/Explore/Hotmail?ocid=TXT_TAGLM_WL_hotmail_acq_faster_112008 |
From: Brian M. <br...@gr...> - 2008-11-30 23:40:48
|
Craig, > Darn it. using the .clear() meathod only kills the program > execution. Well it doesn't stop it entirely... It only > stops it for that funciton and then continues... It acts > like a 'return' statement... Kind of wierd. > > Any other ideas? And where should I be looking? > _GuiOptions? EnumeratedListOption.clear() emits the 'options-changed' event. This event is handled by GuiEnumeratedListOption and triggers GuiEnumeratedListOption.__update_options() to be called. That function should be clearing the GTK widget and redrawing it. At this point, the widget should have no options available. Then you would have to call EnumeratedListOption.add_item() or set_items() to rebuild the widget in the same fashion. So yes, take a look at GuiEnumeratedListOption and make sure it is receiving the signal and that it is working properly. ~Brian |
From: Craig J. A. <and...@ho...> - 2008-11-30 23:11:44
|
Yep, that is exactly what I want to do, but I don't know how to do the end of #3 - configure the enumerated list option based on which person is selected I can't seem to find a good example... I can always add items to the list, but I don't know how to clear it. thanks. Craig A. > Date: Sun, 30 Nov 2008 15:01:08 -0800 > From: br...@gr... > Subject: Re: [Gramps-devel] How to GUI question > To: gra...@li...; and...@ho... > > Craig, > > > I have a PersonOption field that I would like to populate an > > EnumeratedListOption or a FilterOption with the following: > > * Descendent report for (the person selected in > > PersonOption) only. > > * Descendent report for (the person selected in > > PersonOption) and Spouse #1 (F##) > > * Descendent report for (the person selected in > > PersonOption) and Spouse #2 (F##) > > > > I can make the list option field, but I can't seem to > > clear it for new data. And I am not sure how to make a new > > filter (if the option exists). > > > > Any help would be great. > > Assuming I understand you correctly, here is what I would do: > > 1) Use a person option to allow the user to select the main person. > 2) Add an enumerated list option which lists the spouses if there are more than one. > 3) Handle the "'value-changed'" event from the person option and configure the enumerated list option based on which person is selected. > 3a) If the selected person has zero or one spouse, then the enumerated list option is not available (set_available(False)). > 3b) If the selected person has two or more spouses, they are listed selectable from the enumerated list option. > > ~Brian _________________________________________________________________ Windows Live Hotmail now works up to 70% faster. http://windowslive.com/Explore/Hotmail?ocid=TXT_TAGLM_WL_hotmail_acq_faster_112008 |
From: Jérôme <rom...@ya...> - 2008-12-01 09:26:58
|
Hi, For the FilterOption, there is samples : * BookReport.py * CalculateEstimatedDates.py: * Calendar.py * GVRelGraph.py * IndivComplete.py * NarrativeWeb.py * StatisticsChart.py * TimeLine.py * WebCal.py For PersonOption, previous + * AncestorReport.py * AncestorTree.py * DescendReport.py * DescendTree.py * DetAncestralReport.py * DetDescendantReport.py * EndOfLineReport.py * FanChart.py * GVHourGlass.py * IndivComplete.py * KinshipReport.py But I do not exactly know why|when using FilterOption ... PluginUtils/_MenuOptions.py class FilterOption(EnumeratedListOption): """ This class describes an option that provides a list of person filters. Each possible value represents one of the possible filters. """ OK, only for filters on Person. Maybe FilterOption is used when GRAMPS needs to work with all persons (BookReport, NarrativeWeb, StatisticsChart ...) + users can set custom rules on Person. Note, looking at ExportOptions.py (def __define_person_filters), I find more easy to directly use existing rules and filter framework ! http://www.gramps-project.org/bugs/view.php?id=2461 FilterClass = GenericFilterFactory('Person') filter = FilterClass() filter.add_rule(Rules.Person.HasEvent(['Census','','',''])) plist = self.database.get_person_handles(sort_handles=False) ind_list = filter.apply(self.database, plist) > * Descendent report for (the person selected in PersonOption) only. > * Descendent report for (the person selected in PersonOption) and Spouse > #1 (F##) > * Descendent report for (the person selected in PersonOption) and Spouse > #2 (F##) Maybe to set existing rules and to add a choice list (like Generic Filters on reports or Exporter) Jérôme Craig J. Anderson a écrit : > I have a PersonOption field that I would like to populate an > EnumeratedListOption or a FilterOption with the following: > * Descendent report for (the person selected in PersonOption) only. > * Descendent report for (the person selected in PersonOption) and Spouse > #1 (F##) > * Descendent report for (the person selected in PersonOption) and Spouse > #2 (F##) > > I can make the list option field, but I can't seem to clear it for new > data. And I am not sure how to make a new filter (if the option exists). > > Any help would be great. > > thanks. > > Craig A. > > Proud to be a PC? Show the world. Download the “I’m a PC” Messenger > themepack now. Download now. > <http://clk.atdmt.com/MRT/go/119642558/direct/01/> > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > > > ------------------------------------------------------------------------ > > _______________________________________________ > Gramps-devel mailing list > Gra...@li... > https://lists.sourceforge.net/lists/listinfo/gramps-devel |