diff --git a/src/glade/addmedia.glade b/src/glade/addmedia.glade index f53c9e832..bb621302b 100644 --- a/src/glade/addmedia.glade +++ b/src/glade/addmedia.glade @@ -1,6 +1,7 @@ + 650 @@ -96,7 +97,7 @@ - + True True diff --git a/src/glade/dateedit.glade b/src/glade/dateedit.glade index 81609de2a..2cabd545f 100644 --- a/src/glade/dateedit.glade +++ b/src/glade/dateedit.glade @@ -1,6 +1,7 @@ + 31 @@ -119,7 +120,7 @@ - + True Month-Day of first day of new year (e.g., "1-1", "3-1", "3-25") @@ -500,7 +501,7 @@ - + True True diff --git a/src/glade/editaddress.glade b/src/glade/editaddress.glade index fde84eb9b..35cc0aead 100644 --- a/src/glade/editaddress.glade +++ b/src/glade/editaddress.glade @@ -68,7 +68,7 @@ - + True True @@ -116,7 +116,7 @@ - + True True @@ -163,7 +163,7 @@ - + True True @@ -177,7 +177,7 @@ - + True True @@ -191,7 +191,7 @@ - + True True @@ -205,7 +205,7 @@ - + True True diff --git a/src/glade/editattribute.glade b/src/glade/editattribute.glade index 14e3b7b0e..118dacaad 100644 --- a/src/glade/editattribute.glade +++ b/src/glade/editattribute.glade @@ -1,6 +1,7 @@ + dialog @@ -51,7 +52,7 @@ - + True True diff --git a/src/glade/editevent.glade b/src/glade/editevent.glade index e34118221..3c4e48628 100644 --- a/src/glade/editevent.glade +++ b/src/glade/editevent.glade @@ -113,7 +113,7 @@ - + True True @@ -233,7 +233,7 @@ - + True True diff --git a/src/glade/editeventref.glade b/src/glade/editeventref.glade index 2fee977bd..939e950d3 100644 --- a/src/glade/editeventref.glade +++ b/src/glade/editeventref.glade @@ -343,7 +343,7 @@ - + True True @@ -357,7 +357,7 @@ - + True True diff --git a/src/glade/editfamily.glade b/src/glade/editfamily.glade index e2f633b4c..e1ad6a38a 100644 --- a/src/glade/editfamily.glade +++ b/src/glade/editfamily.glade @@ -1,6 +1,7 @@ + dialog @@ -513,7 +514,7 @@ - + True True diff --git a/src/glade/editlink.glade b/src/glade/editlink.glade index 4689635e7..16c8df2a6 100644 --- a/src/glade/editlink.glade +++ b/src/glade/editlink.glade @@ -1,6 +1,7 @@ + True @@ -67,7 +68,7 @@ - + True True diff --git a/src/glade/editlocation.glade b/src/glade/editlocation.glade index e072bdad9..886840c8e 100644 --- a/src/glade/editlocation.glade +++ b/src/glade/editlocation.glade @@ -1,6 +1,7 @@ + 550 @@ -38,7 +39,7 @@ - + True True @@ -84,7 +85,7 @@ - + True True @@ -114,7 +115,7 @@ - + True True @@ -146,7 +147,7 @@ - + True True @@ -176,7 +177,7 @@ - + True True @@ -207,7 +208,7 @@ - + True True @@ -236,7 +237,7 @@ - + True True @@ -250,7 +251,7 @@ - + True True diff --git a/src/glade/editmedia.glade b/src/glade/editmedia.glade index 6e1fc57c1..8bf167887 100644 --- a/src/glade/editmedia.glade +++ b/src/glade/editmedia.glade @@ -139,7 +139,7 @@ - + True True @@ -153,7 +153,7 @@ - + True True @@ -212,7 +212,7 @@ - + True True diff --git a/src/glade/editmediaref.glade b/src/glade/editmediaref.glade index bcbdd953c..457e3384e 100644 --- a/src/glade/editmediaref.glade +++ b/src/glade/editmediaref.glade @@ -1,6 +1,7 @@ + 600 @@ -317,7 +318,7 @@ - + True True @@ -331,7 +332,7 @@ - + True True @@ -451,7 +452,7 @@ True 12 - + True True diff --git a/src/glade/editname.glade b/src/glade/editname.glade index a07c4ac93..aefc9a1c3 100644 --- a/src/glade/editname.glade +++ b/src/glade/editname.glade @@ -53,7 +53,7 @@ - + True True @@ -81,7 +81,7 @@ - + True True @@ -125,7 +125,7 @@ - + True True @@ -177,7 +177,7 @@ - + True True @@ -201,7 +201,7 @@ - + True True @@ -239,7 +239,7 @@ - + True True @@ -270,7 +270,7 @@ - + True True @@ -451,7 +451,7 @@ True 6 - + True False True diff --git a/src/glade/editnote.glade b/src/glade/editnote.glade index 5b4d4f8d5..662ace34c 100644 --- a/src/glade/editnote.glade +++ b/src/glade/editnote.glade @@ -97,7 +97,7 @@ - + True True diff --git a/src/glade/editperson.glade b/src/glade/editperson.glade index 493bb83a6..dab9f8f59 100644 --- a/src/glade/editperson.glade +++ b/src/glade/editperson.glade @@ -164,7 +164,7 @@ - + True True True @@ -349,7 +349,7 @@ - + True True Prefix: An optional prefix for the family name that is not used in sorting, such as "de" or "van" @@ -365,7 +365,7 @@ Suffix: An optional suffix to the name, such as "Jr." or "III" - + True True Part of the Given name that is the normally used name. @@ -381,7 +381,7 @@ Suffix: An optional suffix to the name, such as "Jr." or "III" - + True True Patronimic: component of a personal name based on the name of one's father, grandfather, .... @@ -416,7 +416,7 @@ Title: A title used to refer to the person, such as 'Dr.' or 'Rev.' - + True True diff --git a/src/glade/editpersonref.glade b/src/glade/editpersonref.glade index 2bcc5acda..34606d34e 100644 --- a/src/glade/editpersonref.glade +++ b/src/glade/editpersonref.glade @@ -1,6 +1,7 @@ + dialog @@ -51,7 +52,7 @@ - + True True diff --git a/src/glade/editplace.glade b/src/glade/editplace.glade index 485a82add..2deda7df4 100644 --- a/src/glade/editplace.glade +++ b/src/glade/editplace.glade @@ -70,7 +70,7 @@ - + True True @@ -97,7 +97,7 @@ - + True True @@ -209,7 +209,7 @@ - + True True @@ -221,7 +221,7 @@ - + True True @@ -235,7 +235,7 @@ - + True True @@ -283,7 +283,7 @@ - + True True @@ -315,7 +315,7 @@ - + True True @@ -345,7 +345,7 @@ - + True True @@ -377,7 +377,7 @@ - + True True @@ -406,7 +406,7 @@ - + True True diff --git a/src/glade/editreporef.glade b/src/glade/editreporef.glade index da77518ee..0a71935ec 100644 --- a/src/glade/editreporef.glade +++ b/src/glade/editreporef.glade @@ -1,6 +1,7 @@ + dialog @@ -107,7 +108,7 @@ - + True True @@ -187,7 +188,7 @@ - + True True @@ -255,7 +256,7 @@ True 12 - + True True diff --git a/src/glade/editrepository.glade b/src/glade/editrepository.glade index ea58dbdfa..91581cc1e 100644 --- a/src/glade/editrepository.glade +++ b/src/glade/editrepository.glade @@ -1,6 +1,7 @@ + dialog @@ -52,7 +53,7 @@ - + True True @@ -91,7 +92,7 @@ - + True True diff --git a/src/glade/editsource.glade b/src/glade/editsource.glade index c158a13ad..acfd869a4 100644 --- a/src/glade/editsource.glade +++ b/src/glade/editsource.glade @@ -1,6 +1,7 @@ + dialog @@ -52,7 +53,7 @@ - + True True True @@ -64,7 +65,7 @@ - + True True @@ -93,7 +94,7 @@ - + True True @@ -106,7 +107,7 @@ - + True True @@ -154,7 +155,7 @@ True 12 - + True True diff --git a/src/glade/editsourceref.glade b/src/glade/editsourceref.glade index 37b4a0525..54f5b1e24 100644 --- a/src/glade/editsourceref.glade +++ b/src/glade/editsourceref.glade @@ -77,7 +77,7 @@ - + True True @@ -280,7 +280,7 @@ - + True True @@ -332,7 +332,7 @@ - + True True @@ -346,7 +346,7 @@ - + True True @@ -379,7 +379,7 @@ True 12 - + True True @@ -418,7 +418,7 @@ - + True True diff --git a/src/glade/editurl.glade b/src/glade/editurl.glade index 89f0152cf..8cb60731e 100644 --- a/src/glade/editurl.glade +++ b/src/glade/editurl.glade @@ -1,6 +1,7 @@ + 600 @@ -98,7 +99,7 @@ - + True True @@ -130,7 +131,7 @@ - + True True diff --git a/src/glade/mergedata.glade b/src/glade/mergedata.glade index 20525802f..05716336c 100644 --- a/src/glade/mergedata.glade +++ b/src/glade/mergedata.glade @@ -1,6 +1,7 @@ + True @@ -37,7 +38,7 @@ 6 6 - + True True diff --git a/src/glade/mergeevent.glade b/src/glade/mergeevent.glade index 1aa557d4b..e98924b9e 100644 --- a/src/glade/mergeevent.glade +++ b/src/glade/mergeevent.glade @@ -1,5 +1,7 @@ + + True 500 diff --git a/src/glade/mergefamily.glade b/src/glade/mergefamily.glade index 7f3814320..bf242fb32 100644 --- a/src/glade/mergefamily.glade +++ b/src/glade/mergefamily.glade @@ -1,5 +1,7 @@ + + True 500 diff --git a/src/glade/mergemedia.glade b/src/glade/mergemedia.glade index 64805a109..042d3e44c 100644 --- a/src/glade/mergemedia.glade +++ b/src/glade/mergemedia.glade @@ -1,5 +1,7 @@ + + True 500 diff --git a/src/glade/mergenote.glade b/src/glade/mergenote.glade index 4a22634e5..9533bb7c9 100644 --- a/src/glade/mergenote.glade +++ b/src/glade/mergenote.glade @@ -1,5 +1,7 @@ + + True 600 diff --git a/src/glade/mergeperson.glade b/src/glade/mergeperson.glade index 49c0d4641..43d1f00e3 100644 --- a/src/glade/mergeperson.glade +++ b/src/glade/mergeperson.glade @@ -1,5 +1,7 @@ + + True 700 diff --git a/src/glade/mergeplace.glade b/src/glade/mergeplace.glade index 8d53fc0ac..f61a8161f 100644 --- a/src/glade/mergeplace.glade +++ b/src/glade/mergeplace.glade @@ -1,5 +1,7 @@ + + True 500 diff --git a/src/glade/mergerepository.glade b/src/glade/mergerepository.glade index c90466c7d..ee91144ec 100644 --- a/src/glade/mergerepository.glade +++ b/src/glade/mergerepository.glade @@ -1,5 +1,7 @@ + + True 500 diff --git a/src/glade/mergesource.glade b/src/glade/mergesource.glade index fc78d7ae4..3d093756d 100644 --- a/src/glade/mergesource.glade +++ b/src/glade/mergesource.glade @@ -1,5 +1,7 @@ + + True 500 diff --git a/src/glade/papermenu.glade b/src/glade/papermenu.glade index ff610e272..a2dcac8ff 100644 --- a/src/glade/papermenu.glade +++ b/src/glade/papermenu.glade @@ -1,6 +1,7 @@ + Paper Settings @@ -90,7 +91,7 @@ - + True False True @@ -105,7 +106,7 @@ - + True False True @@ -299,7 +300,7 @@ - + True True @@ -312,7 +313,7 @@ - + True True @@ -327,7 +328,7 @@ - + True True @@ -342,7 +343,7 @@ - + True True diff --git a/src/glade/rule.glade b/src/glade/rule.glade index 346da5831..c5af68a48 100644 --- a/src/glade/rule.glade +++ b/src/glade/rule.glade @@ -1,6 +1,7 @@ + @@ -274,7 +275,7 @@ - + True True @@ -289,7 +290,7 @@ - + True True diff --git a/src/glade/styleeditor.glade b/src/glade/styleeditor.glade index f18603830..a74c8d6f1 100644 --- a/src/glade/styleeditor.glade +++ b/src/glade/styleeditor.glade @@ -1,6 +1,7 @@ + 400 @@ -221,7 +222,7 @@ - + True True True diff --git a/src/gui/widgets/undoableentry.py b/src/gui/widgets/undoableentry.py index 0545846aa..3282dd0fc 100644 --- a/src/gui/widgets/undoableentry.py +++ b/src/gui/widgets/undoableentry.py @@ -57,7 +57,6 @@ class UndoableInsertEntry(object): #unicode char can have length > 1 as it points in the buffer charlength = len(unicode(text)) self.length = charlength - print text, length, unicode(text)[0], len(unicode(text)) if charlength > 1 or self.text in ("\r", "\n", " "): self.mergeable = False else: diff --git a/src/gui/widgets/validatedmaskedentry.py b/src/gui/widgets/validatedmaskedentry.py index cee8aabdd..9a600354c 100644 --- a/src/gui/widgets/validatedmaskedentry.py +++ b/src/gui/widgets/validatedmaskedentry.py @@ -48,6 +48,7 @@ import pango # #------------------------------------------------------------------------- from Errors import MaskError, ValidationError, WindowActiveError +from gui.widgets.undoableentry import UndoableEntry #------------------------------------------------------------------------- # @@ -563,7 +564,7 @@ INPUT_CHAR_MAP = { (COL_TEXT, COL_OBJECT) = range(2) -class MaskedEntry(gtk.Entry): +class MaskedEntry(UndoableEntry): """ The MaskedEntry is an Entry subclass with additional features. @@ -571,14 +572,18 @@ class MaskedEntry(gtk.Entry): - Mask, force the input to meet certain requirements - IconEntry, allows you to have an icon inside the entry - convenience functions for completion + + Note: Gramps does not use the mask feature at the moment, so that code + path is not tested """ __gtype_name__ = 'MaskedEntry' def __init__(self): - gtk.Entry.__init__(self) + UndoableEntry.__init__(self) - self.connect('insert-text', self._on_insert_text) - self.connect('delete-text', self._on_delete_text) + # connect in UndoableEntry: + #self.connect('insert-text', self._on_insert_text) + #self.connect('delete-text', self._on_delete_text) self.connect_after('grab-focus', self._after_grab_focus) self.connect('changed', self._on_changed) @@ -1140,7 +1145,10 @@ class MaskedEntry(gtk.Entry): # Callbacks def _on_insert_text(self, editable, new, length, position): - if not self._mask or self._block_insert: + if self._block_insert: + return + if not self._mask: + UndoableEntry._on_insert_text(self, editable, new, length, position) return new = unicode(new) pos = self.get_position() @@ -1159,9 +1167,13 @@ class MaskedEntry(gtk.Entry): # Change the text with the new text. self._block_changed = True self._really_delete_text(0, -1) + ### mask not used in Gramps, following should work though + ##UndoableEntry._on_delete_text(self, editable, 0, -1) self._block_changed = False self._really_insert_text(text, 0) + ### mask not used in Gramps, following should work though + ##UndoableEntry._on_insert_text(self, editable, text, len(text),0) # When deleting some text, supose, the entry, at some time is like this: # -------------------------------- @@ -1196,7 +1208,10 @@ class MaskedEntry(gtk.Entry): # start (s at the previous ilustration) def _on_delete_text(self, editable, start, end): - if not self._mask or self._block_delete: + if self._block_delete: + return + if not self._mask: + UndoableEntry._on_delete_text(self, editable, start, end) return self.stop_emission('delete-text') @@ -1207,6 +1222,8 @@ class MaskedEntry(gtk.Entry): and not isinstance(self._mask_validators[start], int) and pos != start): self._on_delete_text(editable, start-1, start) + ### mask not used in Gramps, following should work though + ##UndoableEntry._on_delete_text(self, editable, start-1, start) return field = self._get_field_at_pos(end-1) @@ -1241,8 +1258,12 @@ class MaskedEntry(gtk.Entry): self._block_changed = True self._really_delete_text(0, -1) + ### mask not used in Gramps, following should work though + ##UndoableEntry._on_delete_text(self, editable, 0, -1) self._block_changed = False self._really_insert_text(new_text, 0) + ### mask not used in Gramps, following should work though + ##UndoableEntry._on_insert_text(self, editable, text, len(text),0) # Position the cursor on the right place. self.set_position(new_pos)