2007-01-10 Don Allingham <don@gramps-project.org>
* src/GrampsWidgets.py: add support for an "empty" signal on ValidatableMaskedEntry so that we can update the value when the string has been cleared (bug #821) * src/DateEdit.py: catch empty signal (bug #821) svn: r7891
This commit is contained in:
@@ -2033,6 +2033,9 @@ class ValidatableMaskedEntry(MaskedEntry):
|
||||
'validate': (gobject.SIGNAL_RUN_LAST,
|
||||
gobject.TYPE_PYOBJECT,
|
||||
(gobject.TYPE_PYOBJECT,)),
|
||||
'empty': (gobject.SIGNAL_RUN_LAST,
|
||||
gobject.TYPE_PYOBJECT,
|
||||
(gobject.TYPE_PYOBJECT,)),
|
||||
'changed': 'override',
|
||||
}
|
||||
|
||||
@@ -2153,6 +2156,11 @@ class ValidatableMaskedEntry(MaskedEntry):
|
||||
error = self.emit("validate", text)
|
||||
if error:
|
||||
raise error
|
||||
else:
|
||||
error = self.emit("empty", text)
|
||||
if error:
|
||||
raise error
|
||||
|
||||
|
||||
self.set_valid()
|
||||
return text
|
||||
|
||||
Reference in New Issue
Block a user