* src/gramps.glade: People View: Add label for filter text input field.
* src/GenericFilter.py (ProbablyAlive): Add check for input parameter, (HasSourceOf): get handle only once, removed unused code. * src/gramps_main.py: Show label for filter input field. svn: r4313
This commit is contained in:
parent
76c44f2694
commit
ad39f6be25
@ -1,3 +1,9 @@
|
|||||||
|
2005-04-06 Martin Hawlisch <Martin.Hawlisch@gmx.de>
|
||||||
|
* src/gramps.glade: People View: Add label for filter text input field.
|
||||||
|
* src/GenericFilter.py (ProbablyAlive): Add check for input parameter,
|
||||||
|
(HasSourceOf): get handle only once, removed unused code.
|
||||||
|
* src/gramps_main.py: Show label for filter input field.
|
||||||
|
|
||||||
2005-04-06 Richard Taylor <rjt-gramps@thegrindstone.me.uk>
|
2005-04-06 Richard Taylor <rjt-gramps@thegrindstone.me.uk>
|
||||||
* src/GenericFilter.py: added a current year parameter to probably alive rule.
|
* src/GenericFilter.py: added a current year parameter to probably alive rule.
|
||||||
* src/Utils.py: added a current year parameter to probably alive function.
|
* src/Utils.py: added a current year parameter to probably alive function.
|
||||||
|
@ -1724,7 +1724,14 @@ class FamilyWithIncompleteEvent(Rule):
|
|||||||
class ProbablyAlive(Rule):
|
class ProbablyAlive(Rule):
|
||||||
"""People probably alive"""
|
"""People probably alive"""
|
||||||
|
|
||||||
labels = ["On year"]
|
labels = [_("On year:")]
|
||||||
|
|
||||||
|
def prepare(self,db):
|
||||||
|
try:
|
||||||
|
self.current_year = int(self.list[0])
|
||||||
|
except:
|
||||||
|
self.current_year = None
|
||||||
|
print self.current_year
|
||||||
|
|
||||||
def name(self):
|
def name(self):
|
||||||
return 'People probably alive'
|
return 'People probably alive'
|
||||||
@ -1737,12 +1744,8 @@ class ProbablyAlive(Rule):
|
|||||||
|
|
||||||
|
|
||||||
def apply(self,db,p_id):
|
def apply(self,db,p_id):
|
||||||
if len(self.list) == 0:
|
|
||||||
current_year = None
|
|
||||||
else:
|
|
||||||
current_year = int(self.list[0])
|
|
||||||
p = db.get_person_from_handle(p_id)
|
p = db.get_person_from_handle(p_id)
|
||||||
return probably_alive(p,db,current_year)
|
return probably_alive(p,db,self.current_year)
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
# "People marked private"
|
# "People marked private"
|
||||||
@ -1988,7 +1991,7 @@ class HasSourceOf(Rule):
|
|||||||
labels = [ _('Source ID:') ]
|
labels = [ _('Source ID:') ]
|
||||||
|
|
||||||
def prepare(self,db):
|
def prepare(self,db):
|
||||||
self.db = db
|
self.source_handle = db.get_source_from_gramps_id(self.list[0]).get_handle()
|
||||||
|
|
||||||
def name(self):
|
def name(self):
|
||||||
return 'Has source of'
|
return 'Has source of'
|
||||||
@ -2000,23 +2003,9 @@ class HasSourceOf(Rule):
|
|||||||
return _('Matches people who have a particular source')
|
return _('Matches people who have a particular source')
|
||||||
|
|
||||||
def apply(self,db,p_id):
|
def apply(self,db,p_id):
|
||||||
if not self.list[0]:
|
|
||||||
return False
|
|
||||||
|
|
||||||
p = self.db.get_person_from_handle(p_id)
|
p = self.db.get_person_from_handle(p_id)
|
||||||
|
|
||||||
return p.has_source_reference(
|
return p.has_source_reference( self.source_handle)
|
||||||
self.db.get_source_from_gramps_id(self.list[0]).get_handle())
|
|
||||||
|
|
||||||
## if len(p.get_source_references()) > 0:
|
|
||||||
## for src in p.get_source_references():
|
|
||||||
|
|
||||||
## if self.list[0] == \
|
|
||||||
## self.db.get_source_from_handle(
|
|
||||||
## src.get_base_handle()).get_gramps_id():
|
|
||||||
## return True
|
|
||||||
|
|
||||||
## return False
|
|
||||||
|
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
|
@ -1351,6 +1351,27 @@
|
|||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
|
|
||||||
|
<child>
|
||||||
|
<widget class="GtkLabel" id="filter_label">
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="label" translatable="yes"></property>
|
||||||
|
<property name="use_underline">False</property>
|
||||||
|
<property name="use_markup">False</property>
|
||||||
|
<property name="justify">GTK_JUSTIFY_LEFT</property>
|
||||||
|
<property name="wrap">False</property>
|
||||||
|
<property name="selectable">False</property>
|
||||||
|
<property name="xalign">0.5</property>
|
||||||
|
<property name="yalign">0.5</property>
|
||||||
|
<property name="xpad">0</property>
|
||||||
|
<property name="ypad">0</property>
|
||||||
|
</widget>
|
||||||
|
<packing>
|
||||||
|
<property name="padding">0</property>
|
||||||
|
<property name="expand">False</property>
|
||||||
|
<property name="fill">False</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
|
||||||
<child>
|
<child>
|
||||||
<widget class="GtkEntry" id="filter">
|
<widget class="GtkEntry" id="filter">
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
|
@ -289,6 +289,7 @@ class Gramps(GrampsDBCallback.GrampsDBCallback):
|
|||||||
self.toolbar = self.gtop.get_widget("toolbar1")
|
self.toolbar = self.gtop.get_widget("toolbar1")
|
||||||
self.toolbardock = self.gtop.get_widget("dockitem2")
|
self.toolbardock = self.gtop.get_widget("dockitem2")
|
||||||
self.filter_text = self.gtop.get_widget('filter')
|
self.filter_text = self.gtop.get_widget('filter')
|
||||||
|
self.filter_label= self.gtop.get_widget('filter_label')
|
||||||
self.qual_label = self.gtop.get_widget("qual")
|
self.qual_label = self.gtop.get_widget("qual")
|
||||||
self.child_type = self.gtop.get_widget("childtype")
|
self.child_type = self.gtop.get_widget("childtype")
|
||||||
self.spouse_tab = self.gtop.get_widget("lab_or_list")
|
self.spouse_tab = self.gtop.get_widget("lab_or_list")
|
||||||
@ -953,7 +954,7 @@ class Gramps(GrampsDBCallback.GrampsDBCallback):
|
|||||||
all.add_rule(GenericFilter.FamilyWithIncompleteEvent([]))
|
all.add_rule(GenericFilter.FamilyWithIncompleteEvent([]))
|
||||||
filter_list.append(all)
|
filter_list.append(all)
|
||||||
|
|
||||||
all = GenericFilter.GenericFilter()
|
all = GenericFilter.ParamFilter()
|
||||||
all.set_name(_("People probably alive"))
|
all.set_name(_("People probably alive"))
|
||||||
all.add_rule(GenericFilter.ProbablyAlive([]))
|
all.add_rule(GenericFilter.ProbablyAlive([]))
|
||||||
filter_list.append(all)
|
filter_list.append(all)
|
||||||
@ -1604,9 +1605,12 @@ class Gramps(GrampsDBCallback.GrampsDBCallback):
|
|||||||
if qual:
|
if qual:
|
||||||
self.filter_text.show()
|
self.filter_text.show()
|
||||||
self.filter_text.set_sensitive(1)
|
self.filter_text.set_sensitive(1)
|
||||||
|
self.filter_label.show()
|
||||||
|
self.filter_label.set_text(mime_filter.get_rules()[0].labels[0])
|
||||||
else:
|
else:
|
||||||
self.filter_text.hide()
|
self.filter_text.hide()
|
||||||
self.filter_text.set_sensitive(0)
|
self.filter_text.set_sensitive(0)
|
||||||
|
self.filter_label.hide()
|
||||||
|
|
||||||
def new_after_edit(self,epo,val):
|
def new_after_edit(self,epo,val):
|
||||||
self.change_active_person(epo.person)
|
self.change_active_person(epo.person)
|
||||||
|
Loading…
Reference in New Issue
Block a user