* src/FilterEditor/_FilterEditor.py (close): Override parent's close.
* src/Filters/_FilterMenu.py (build_filter_menu, build_filter_model): Import Custom and System filters when needed. * src/plugins/Calendar.py (get_filters): Import Custom filters when needed. * src/plugins/GraphViz.py (get_report_filters): Import Custom filters when needed. * src/plugins/IndivComplete.py (get_report_filters): Import Custom filters when needed. * src/plugins/NarrativeWeb.py (get_report_filters): Import Custom filters when needed. * src/plugins/StatisticsChart.py (get_report_filters): Import Custom filters when needed. * src/plugins/TimeLine.py (get_report_filters): Import Custom filters when needed. svn: r7231
This commit is contained in:
parent
b7a5d66344
commit
1cb5f1fa9b
15
ChangeLog
15
ChangeLog
@ -1,4 +1,19 @@
|
||||
2006-08-21 Alex Roitman <shura@gramps-project.org>
|
||||
* src/FilterEditor/_FilterEditor.py (close): Override parent's close.
|
||||
* src/Filters/_FilterMenu.py (build_filter_menu,
|
||||
build_filter_model): Import Custom and System filters when needed.
|
||||
* src/plugins/Calendar.py (get_filters): Import Custom
|
||||
filters when needed.
|
||||
* src/plugins/GraphViz.py (get_report_filters): Import Custom
|
||||
filters when needed.
|
||||
* src/plugins/IndivComplete.py (get_report_filters): Import Custom
|
||||
filters when needed.
|
||||
* src/plugins/NarrativeWeb.py (get_report_filters): Import Custom
|
||||
filters when needed.
|
||||
* src/plugins/StatisticsChart.py (get_report_filters): Import Custom
|
||||
filters when needed.
|
||||
* src/plugins/TimeLine.py (get_report_filters): Import Custom
|
||||
filters when needed.
|
||||
* src/plugins/EventCmp.py (__init__): Add custom filters.
|
||||
* src/plugins/ChangeTypes.py (on_apply_clicked): Remove extra
|
||||
unicode conversion.
|
||||
|
@ -94,7 +94,7 @@ class FilterEditor(ManagedWindow.ManagedWindow):
|
||||
self.delete.connect('clicked', self.delete_filter)
|
||||
|
||||
self.connect_button('help', self.help_clicked)
|
||||
self.connect_button('close', self.close_window)
|
||||
self.connect_button('close', self.close)
|
||||
self.connect_button('add', self.add_new_filter)
|
||||
|
||||
self.clist = ListModel.ListModel(
|
||||
@ -123,11 +123,11 @@ class FilterEditor(ManagedWindow.ManagedWindow):
|
||||
self.delete.set_sensitive(False)
|
||||
self.test.set_sensitive(False)
|
||||
|
||||
def close_window(self,obj):
|
||||
def close(self,obj):
|
||||
self.filterdb.save()
|
||||
reload_custom_filters()
|
||||
reload_system_filters()
|
||||
self.close()
|
||||
ManagedWindow.ManagedWindow.close(self,obj)
|
||||
|
||||
def draw_filters(self):
|
||||
self.clist.clear()
|
||||
|
@ -28,19 +28,13 @@
|
||||
import gtk
|
||||
from gettext import gettext as _
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# GRAMPS modules
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
from Filters import SystemFilters, CustomFilters
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
# This is used by plugins to create a menu of available filters
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
def build_filter_menu(local_filters = [], default=""):
|
||||
from Filters import SystemFilters, CustomFilters
|
||||
menu = gtk.Menu()
|
||||
|
||||
for filt in local_filters:
|
||||
@ -69,6 +63,8 @@ def build_filter_menu(local_filters = [], default=""):
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
def build_filter_model(space, local = [], default=""):
|
||||
from Filters import SystemFilters, CustomFilters
|
||||
|
||||
model = gtk.ListStore(str, object)
|
||||
|
||||
flist = local + SystemFilters.get_filters(space) + \
|
||||
|
@ -41,7 +41,7 @@ from PluginUtils import register_report
|
||||
from ReportBase import Report, ReportUtils, ReportOptions, \
|
||||
CATEGORY_DRAW, MODE_GUI, MODE_BKI, MODE_CLI
|
||||
pt2cm = ReportUtils.pt2cm
|
||||
from Filters import CustomFilters, GenericFilter, ParamFilter, Rules
|
||||
from Filters import GenericFilter, ParamFilter, Rules
|
||||
import GrampsLocale
|
||||
import RelLib
|
||||
|
||||
@ -545,6 +545,7 @@ class FilterWidget(Widget):
|
||||
f.add_rule(Rules.Person.HasTextMatchingSubstringOf(['Calendar',0,0]))
|
||||
retval.append(f)
|
||||
|
||||
from Filters import CustomFilters
|
||||
retval.extend(CustomFilters.get_filters('Person'))
|
||||
return retval
|
||||
|
||||
|
@ -43,7 +43,7 @@ import gtk.glade
|
||||
# GRAMPS modules
|
||||
#
|
||||
#------------------------------------------------------------------------
|
||||
from Filters import GenericFilter, build_filter_menu, Rules, CustomFilters
|
||||
from Filters import GenericFilter, build_filter_menu, Rules
|
||||
import ListModel
|
||||
import Sort
|
||||
import Utils
|
||||
@ -162,6 +162,7 @@ class EventComparison(Tool.Tool,ManagedWindow.ManagedWindow):
|
||||
all.add_rule(Rules.Person.Everyone([]))
|
||||
|
||||
the_filters = [all]
|
||||
from Filters import CustomFilters
|
||||
the_filters.extend(CustomFilters.get_filters('Person'))
|
||||
|
||||
self.filter_menu = build_filter_menu(the_filters)
|
||||
|
@ -57,7 +57,7 @@ from ReportBase import Report, ReportUtils, ReportOptions, \
|
||||
CATEGORY_CODE, CATEGORY_DRAW, MODE_GUI, MODE_CLI
|
||||
from ReportBase._ReportDialog import ReportDialog
|
||||
from ReportBase._CommandLineReport import CommandLineReport
|
||||
from Filters import GenericFilter, CustomFilters, Rules
|
||||
from Filters import GenericFilter, Rules
|
||||
import RelLib
|
||||
import DateHandler
|
||||
import const
|
||||
@ -693,6 +693,7 @@ class GraphVizOptions(ReportOptions):
|
||||
com.add_rule(Rules.Person.HasCommonAncestorWith([gramps_id]))
|
||||
|
||||
the_filters = [all,des,ans,com]
|
||||
from Filters import CustomFilters
|
||||
the_filters.extend(CustomFilters.get_filters('Person'))
|
||||
return the_filters
|
||||
|
||||
|
@ -44,7 +44,7 @@ import RelLib
|
||||
import const
|
||||
import Utils
|
||||
import BaseDoc
|
||||
from Filters import GenericFilter, Rules, CustomFilters
|
||||
from Filters import GenericFilter, Rules
|
||||
import DateHandler
|
||||
from PluginUtils import register_report
|
||||
from ReportBase import Report, ReportUtils, ReportOptions, \
|
||||
@ -566,6 +566,7 @@ class IndivCompleteOptions(ReportOptions):
|
||||
com.add_rule(Rules.Person.HasCommonAncestorWith([gramps_id]))
|
||||
|
||||
the_filters = [filt_id,all,des,ans,com]
|
||||
from Filters import CustomFilters
|
||||
the_filters.extend(CustomFilters.get_filters('Person'))
|
||||
return the_filters
|
||||
|
||||
|
@ -67,7 +67,7 @@ import gtk
|
||||
import RelLib
|
||||
import const
|
||||
from GrampsCfg import get_researcher
|
||||
from Filters import GenericFilter, Rules, CustomFilters
|
||||
from Filters import GenericFilter, Rules
|
||||
import Sort
|
||||
from PluginUtils import register_report
|
||||
from ReportBase import Report, ReportUtils, ReportOptions, \
|
||||
@ -2376,6 +2376,7 @@ class WebReportOptions(ReportOptions):
|
||||
com.add_rule(Rules.Person.HasCommonAncestorWith([gramps_id]))
|
||||
|
||||
the_filters = [all,des,df,ans,com]
|
||||
from Filters import CustomFilters
|
||||
the_filters.extend(CustomFilters.get_filters('Person'))
|
||||
return the_filters
|
||||
|
||||
|
@ -56,7 +56,7 @@ import BaseDoc
|
||||
from PluginUtils import register_report
|
||||
from ReportBase import Report, ReportUtils, ReportOptions, \
|
||||
CATEGORY_DRAW, MODE_GUI, MODE_BKI, MODE_CLI
|
||||
from Filters import GenericFilter, Rules, CustomFilters
|
||||
from Filters import GenericFilter, Rules
|
||||
import DateHandler
|
||||
from Utils import ProgressMeter
|
||||
|
||||
@ -859,6 +859,7 @@ class StatisticsChartOptions(ReportOptions):
|
||||
com.add_rule(Rules.Person.HasCommonAncestorWith([gramps_id]))
|
||||
|
||||
the_filters = [all, des, ans, com]
|
||||
from Filters import CustomFilters
|
||||
the_filters.extend(CustomFilters.get_filters('Person'))
|
||||
return the_filters
|
||||
|
||||
|
@ -48,7 +48,7 @@ from ReportBase import Report, ReportUtils, ReportOptions, \
|
||||
CATEGORY_DRAW, MODE_GUI, MODE_BKI, MODE_CLI
|
||||
pt2cm = ReportUtils.pt2cm
|
||||
import BaseDoc
|
||||
from Filters import GenericFilter, Rules, CustomFilters
|
||||
from Filters import GenericFilter, Rules
|
||||
import Sort
|
||||
from QuestionDialog import ErrorDialog
|
||||
import NameDisplay
|
||||
@ -430,6 +430,7 @@ class TimeLineOptions(ReportOptions):
|
||||
com.add_rule(Rules.Person.HasCommonAncestorWith([gramps_id]))
|
||||
|
||||
the_filters = [all,des,ans,com]
|
||||
from Filters import CustomFilters
|
||||
the_filters.extend(CustomFilters.get_filters('Person'))
|
||||
return the_filters
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user