autocompletion for surnames

svn: r6234
This commit is contained in:
Don Allingham 2006-03-30 16:29:59 +00:00
parent 0335638bf4
commit da284dad8b
3 changed files with 11 additions and 2 deletions

View File

@ -1,6 +1,9 @@
2006-03-30 Don Allingham <don@gramps-project.org>
* src/Mime/_GnomeMime.py: filter out bad KDE mime type commands
* src/Utils.py: clean up launch routine
* src/Editors/_EditPerson.py: setup autocomp list
* src/GrampsWidgets.py: enable autocompletion on MonitoredEntry if
a list is provided
2006-03-29 Brian Matherly <pez4brian@users.sourceforge.net>
* src/Sort.py: remove use of deprecated functions

View File

@ -54,6 +54,7 @@ import NameDisplay
import DisplayState
import GrampsDisplay
import GrampsWidgets
import AutoComp
from _EditPrimary import EditPrimary
from DisplayTabs import *
@ -189,7 +190,8 @@ class EditPerson(EditPrimary):
self.top.get_widget("surname"),
self.pname.set_surname,
self.pname.get_surname,
self.db.readonly)
self.db.readonly,
autolist=self.db.get_surname_list())
self.gid = GrampsWidgets.MonitoredEntry(
self.top.get_widget("gid"),

View File

@ -258,7 +258,8 @@ class MonitoredCheckbox:
class MonitoredEntry:
def __init__(self,obj,set_val,get_val,read_only=False, changed=None):
def __init__(self,obj,set_val,get_val,read_only=False,
autolist=None, changed=None):
self.obj = obj
self.set_val = set_val
self.get_val = get_val
@ -269,6 +270,9 @@ class MonitoredEntry:
self.obj.connect('changed', self._on_change)
self.obj.set_editable(not read_only)
if autolist:
AutoComp.fill_entry(obj,autolist)
def connect(self,signal,callback):
self.obj.connect(signal,callback)