* src/gramps_main.py: pass list of filtered people to find dialog

* src/Find.py: pass list of filtered people to find dialog
* src/po/hu.po: set character set to ISO-8859-2, fix typo

* src/po/hu.po: Hungarian translation


svn: r2149
This commit is contained in:
Don Allingham 2003-09-20 18:21:39 +00:00
parent 9128bda40f
commit 71fc95ba39
3 changed files with 8428 additions and 5 deletions

View File

@ -55,7 +55,7 @@ from gettext import gettext as _
class FindBase: class FindBase:
"""Opens find person dialog for gramps""" """Opens find person dialog for gramps"""
def __init__(self,task,name,db): def __init__(self,task,name,db,valid_map=None):
"""Opens a dialog box instance that allows users to """Opens a dialog box instance that allows users to
search for a person. search for a person.
task - function to call to change the active person""" task - function to call to change the active person"""
@ -79,6 +79,7 @@ class FindBase:
self.list = None self.list = None
self.index = 0 self.index = 0
self.visible = 1 self.visible = 1
self.valid = valid_map
def get_value(self,id): def get_value(self,id):
return id return id
@ -96,6 +97,9 @@ class FindBase:
if id == None: if id == None:
func() func()
continue continue
if self.valid and not self.valid.has_key(id):
func()
continue
if string.find(name.upper(),text) >= 0: if string.find(name.upper(),text) >= 0:
self.back_button.set_sensitive(0) self.back_button.set_sensitive(0)
self.forward_button.set_sensitive(0) self.forward_button.set_sensitive(0)
@ -144,13 +148,13 @@ class FindBase:
class FindPerson(FindBase): class FindPerson(FindBase):
"""Opens a Find Person dialog for GRAMPS""" """Opens a Find Person dialog for GRAMPS"""
def __init__(self,task,db): def __init__(self,task,db,valid_map):
"""Opens a dialog box instance that allows users to """Opens a dialog box instance that allows users to
search for a person. search for a person.
task - function to call to change the active person""" task - function to call to change the active person"""
FindBase.__init__(self,task,_("Find Person"),db) FindBase.__init__(self,task,_("Find Person"),db,valid_map)
self.list = db.personTable.values() self.list = db.personTable.values()
self.list.sort() self.list.sort()

View File

@ -692,7 +692,7 @@ class Gramps:
if self.find_person: if self.find_person:
self.find_person.show() self.find_person.show()
else: else:
self.find_person = Find.FindPerson(self.find_goto_person,self.db) self.find_person = Find.FindPerson(self.find_goto_person,self.db,self.id2col)
def on_findname_activate(self,obj): def on_findname_activate(self,obj):
"""Display the find box""" """Display the find box"""
@ -1658,7 +1658,10 @@ class Gramps:
if not self.model_used.has_key(model) or self.model_used[model] == 0 or not iter: if not self.model_used.has_key(model) or self.model_used[model] == 0 or not iter:
self.model_used[model] = 1 self.model_used[model] = 1
self.apply_filter(model) self.apply_filter(model)
(model,iter) = self.id2col[id] try:
(model,iter) = self.id2col[id]
except:
return
model.selection.unselect_all() model.selection.unselect_all()
model.selection.select_iter(iter); model.selection.select_iter(iter);

8416
gramps2/src/po/hu.po Normal file

File diff suppressed because it is too large Load Diff