2786: Add quick undo/redo to all fields

This adds:
  * undoentry instead of entry for all normal entry fields in glade files
  * have maskedentry based on undoentry, so that date changes can be undone :-)
To do: entry fields added in py code is not checked.


svn: r15844
This commit is contained in:
Benny Malengier 2010-08-31 21:11:59 +00:00
parent 19950c616d
commit e9388c3ff7
35 changed files with 142 additions and 90 deletions

View File

@ -1,6 +1,7 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<interface> <interface>
<!-- interface-requires gtk+ 2.12 --> <!-- interface-requires gtk+ 2.12 -->
<!-- interface-requires grampswidgets 0.0 -->
<!-- interface-naming-policy project-wide --> <!-- interface-naming-policy project-wide -->
<object class="GtkDialog" id="addmedia"> <object class="GtkDialog" id="addmedia">
<property name="default_width">650</property> <property name="default_width">650</property>
@ -96,7 +97,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry" id="photoDescription"> <object class="UndoableEntry" id="photoDescription">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property> <property name="invisible_char">&#x25CF;</property>

View File

@ -1,6 +1,7 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<interface> <interface>
<!-- interface-requires gtk+ 2.12 --> <!-- interface-requires gtk+ 2.12 -->
<!-- interface-requires grampswidgets 0.0 -->
<!-- interface-naming-policy toplevel-contextual --> <!-- interface-naming-policy toplevel-contextual -->
<object class="GtkAdjustment" id="adjustment1"> <object class="GtkAdjustment" id="adjustment1">
<property name="upper">31</property> <property name="upper">31</property>
@ -119,7 +120,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry" id="newyear"> <object class="UndoableEntry" id="newyear">
<property name="visible">True</property> <property name="visible">True</property>
<property name="tooltip_text" <property name="tooltip_text"
translatable="yes">Month-Day of first day of new year (e.g., "1-1", "3-1", "3-25")</property> translatable="yes">Month-Day of first day of new year (e.g., "1-1", "3-1", "3-25")</property>
@ -500,7 +501,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry" id="date_text_entry"> <object class="UndoableEntry" id="date_text_entry">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
</object> </object>

View File

@ -68,7 +68,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry" id="city"> <object class="UndoableEntry" id="city">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property> <property name="invisible_char">&#x25CF;</property>
@ -116,7 +116,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry" id="postal"> <object class="UndoableEntry" id="postal">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property> <property name="invisible_char">&#x25CF;</property>
@ -163,7 +163,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry" id="phone"> <object class="UndoableEntry" id="phone">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property> <property name="invisible_char">&#x25CF;</property>
@ -177,7 +177,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry" id="state"> <object class="UndoableEntry" id="state">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property> <property name="invisible_char">&#x25CF;</property>
@ -191,7 +191,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry" id="country"> <object class="UndoableEntry" id="country">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property> <property name="invisible_char">&#x25CF;</property>
@ -205,7 +205,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry" id="street"> <object class="UndoableEntry" id="street">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property> <property name="invisible_char">&#x25CF;</property>

View File

@ -1,6 +1,7 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<interface> <interface>
<!-- interface-requires gtk+ 2.12 --> <!-- interface-requires gtk+ 2.12 -->
<!-- interface-requires grampswidgets 0.0 -->
<!-- interface-naming-policy project-wide --> <!-- interface-naming-policy project-wide -->
<object class="GtkDialog" id="editattribute"> <object class="GtkDialog" id="editattribute">
<property name="type_hint">dialog</property> <property name="type_hint">dialog</property>
@ -51,7 +52,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry" id="attr_value"> <object class="UndoableEntry" id="attr_value">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property> <property name="invisible_char">&#x25CF;</property>

View File

@ -113,7 +113,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry" id="event_description"> <object class="UndoableEntry" id="event_description">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property> <property name="invisible_char">&#x25CF;</property>
@ -233,7 +233,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry" id="gid"> <object class="UndoableEntry" id="gid">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property> <property name="invisible_char">&#x25CF;</property>

View File

@ -343,7 +343,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry" id="gid"> <object class="UndoableEntry" id="gid">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property> <property name="invisible_char">&#x25CF;</property>
@ -357,7 +357,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry" id="eer_description"> <object class="UndoableEntry" id="eer_description">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property> <property name="invisible_char">&#x25CF;</property>

View File

@ -1,6 +1,7 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<interface> <interface>
<!-- interface-requires gtk+ 2.12 --> <!-- interface-requires gtk+ 2.12 -->
<!-- interface-requires grampswidgets 0.0 -->
<!-- interface-naming-policy project-wide --> <!-- interface-naming-policy project-wide -->
<object class="GtkDialog" id="editfamily"> <object class="GtkDialog" id="editfamily">
<property name="type_hint">dialog</property> <property name="type_hint">dialog</property>
@ -513,7 +514,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry" id="gid"> <object class="UndoableEntry" id="gid">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property> <property name="invisible_char">&#x25CF;</property>

View File

@ -1,6 +1,7 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<interface> <interface>
<!-- interface-requires gtk+ 2.12 --> <!-- interface-requires gtk+ 2.12 -->
<!-- interface-requires grampswidgets 0.0 -->
<!-- interface-naming-policy project-wide --> <!-- interface-naming-policy project-wide -->
<object class="GtkDialog" id="editurl"> <object class="GtkDialog" id="editurl">
<property name="modal">True</property> <property name="modal">True</property>
@ -67,7 +68,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry" id="entry1"> <object class="UndoableEntry" id="entry1">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property> <property name="invisible_char">&#x25CF;</property>

View File

@ -1,6 +1,7 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<interface> <interface>
<!-- interface-requires gtk+ 2.12 --> <!-- interface-requires gtk+ 2.12 -->
<!-- interface-requires grampswidgets 0.0 -->
<!-- interface-naming-policy project-wide --> <!-- interface-naming-policy project-wide -->
<object class="GtkDialog" id="editlocation"> <object class="GtkDialog" id="editlocation">
<property name="default_width">550</property> <property name="default_width">550</property>
@ -38,7 +39,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry" id="city"> <object class="UndoableEntry" id="city">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property> <property name="invisible_char">&#x25CF;</property>
@ -84,7 +85,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry" id="parish"> <object class="UndoableEntry" id="parish">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property> <property name="invisible_char">&#x25CF;</property>
@ -114,7 +115,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry" id="county"> <object class="UndoableEntry" id="county">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property> <property name="invisible_char">&#x25CF;</property>
@ -146,7 +147,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry" id="state"> <object class="UndoableEntry" id="state">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property> <property name="invisible_char">&#x25CF;</property>
@ -176,7 +177,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry" id="country"> <object class="UndoableEntry" id="country">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property> <property name="invisible_char">&#x25CF;</property>
@ -207,7 +208,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry" id="postal"> <object class="UndoableEntry" id="postal">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property> <property name="invisible_char">&#x25CF;</property>
@ -236,7 +237,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry" id="phone"> <object class="UndoableEntry" id="phone">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property> <property name="invisible_char">&#x25CF;</property>
@ -250,7 +251,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry" id="street"> <object class="UndoableEntry" id="street">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property> <property name="invisible_char">&#x25CF;</property>

View File

@ -139,7 +139,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry" id="path"> <object class="UndoableEntry" id="path">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property> <property name="invisible_char">&#x25CF;</property>
@ -153,7 +153,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry" id="description"> <object class="UndoableEntry" id="description">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property> <property name="invisible_char">&#x25CF;</property>
@ -212,7 +212,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry" id="gid"> <object class="UndoableEntry" id="gid">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property> <property name="invisible_char">&#x25CF;</property>

View File

@ -1,6 +1,7 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<interface> <interface>
<!-- interface-requires gtk+ 2.12 --> <!-- interface-requires gtk+ 2.12 -->
<!-- interface-requires grampswidgets 0.0 -->
<!-- interface-naming-policy project-wide --> <!-- interface-naming-policy project-wide -->
<object class="GtkDialog" id="editmediaref"> <object class="GtkDialog" id="editmediaref">
<property name="default_width">600</property> <property name="default_width">600</property>
@ -317,7 +318,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry" id="description"> <object class="UndoableEntry" id="description">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property> <property name="invisible_char">&#x25CF;</property>
@ -331,7 +332,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry" id="path"> <object class="UndoableEntry" id="path">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property> <property name="invisible_char">&#x25CF;</property>
@ -451,7 +452,7 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="spacing">12</property> <property name="spacing">12</property>
<child> <child>
<object class="GtkEntry" id="gid"> <object class="UndoableEntry" id="gid">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property> <property name="invisible_char">&#x25CF;</property>

View File

@ -53,7 +53,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry" id="patronymic"> <object class="UndoableEntry" id="patronymic">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property> <property name="invisible_char">&#x25CF;</property>
@ -81,7 +81,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry" id="alt_surname"> <object class="UndoableEntry" id="alt_surname">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property> <property name="invisible_char">&#x25CF;</property>
@ -125,7 +125,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry" id="alt_title"> <object class="UndoableEntry" id="alt_title">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property> <property name="invisible_char">&#x25CF;</property>
@ -177,7 +177,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry" id="alt_prefix"> <object class="UndoableEntry" id="alt_prefix">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property> <property name="invisible_char">&#x25CF;</property>
@ -201,7 +201,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry" id="alt_suffix"> <object class="UndoableEntry" id="alt_suffix">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property> <property name="invisible_char">&#x25CF;</property>
@ -239,7 +239,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry" id="alt_given"> <object class="UndoableEntry" id="alt_given">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property> <property name="invisible_char">&#x25CF;</property>
@ -270,7 +270,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry" id="call"> <object class="UndoableEntry" id="call">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property> <property name="invisible_char">&#x25CF;</property>
@ -451,7 +451,7 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="spacing">6</property> <property name="spacing">6</property>
<child> <child>
<object class="GtkEntry" id="group_as"> <object class="UndoableEntry" id="group_as">
<property name="visible">True</property> <property name="visible">True</property>
<property name="sensitive">False</property> <property name="sensitive">False</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>

View File

@ -97,7 +97,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry" id="id"> <object class="UndoableEntry" id="id">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property> <property name="invisible_char">&#x25CF;</property>

View File

@ -164,7 +164,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry" id="given_name"> <object class="UndoableEntry" id="given_name">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="has_focus">True</property> <property name="has_focus">True</property>
@ -349,7 +349,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry" id="prefixentry"> <object class="UndoableEntry" id="prefixentry">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="tooltip_text" translatable="yes">Prefix: An optional prefix for the family name that is not used in sorting, such as "de" or "van" <property name="tooltip_text" translatable="yes">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"</property>
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry" id="call"> <object class="UndoableEntry" id="call">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="tooltip_text" translatable="yes">Part of the Given name that is the normally used name. </property> <property name="tooltip_text" translatable="yes">Part of the Given name that is the normally used name. </property>
@ -381,7 +381,7 @@ Suffix: An optional suffix to the name, such as "Jr." or "III"</property>
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry" id="patroentry"> <object class="UndoableEntry" id="patroentry">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="tooltip_text" translatable="yes">Patronimic: component of a personal name based on the name of one's father, grandfather, .... <property name="tooltip_text" translatable="yes">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.'</property>
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry" id="gid"> <object class="UndoableEntry" id="gid">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property> <property name="invisible_char">&#x25CF;</property>

View File

@ -1,6 +1,7 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<interface> <interface>
<!-- interface-requires gtk+ 2.12 --> <!-- interface-requires gtk+ 2.12 -->
<!-- interface-requires grampswidgets 0.0 -->
<!-- interface-naming-policy project-wide --> <!-- interface-naming-policy project-wide -->
<object class="GtkDialog" id="pref_edit"> <object class="GtkDialog" id="pref_edit">
<property name="type_hint">dialog</property> <property name="type_hint">dialog</property>
@ -51,7 +52,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry" id="relationship"> <object class="UndoableEntry" id="relationship">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property> <property name="invisible_char">&#x25CF;</property>

View File

@ -70,7 +70,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry" id="place_title"> <object class="UndoableEntry" id="place_title">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property> <property name="invisible_char">&#x25CF;</property>
@ -97,7 +97,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry" id="gid"> <object class="UndoableEntry" id="gid">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property> <property name="invisible_char">&#x25CF;</property>
@ -209,7 +209,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry" id="street"> <object class="UndoableEntry" id="street">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property> <property name="invisible_char">&#x25CF;</property>
@ -221,7 +221,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry" id="city"> <object class="UndoableEntry" id="city">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property> <property name="invisible_char">&#x25CF;</property>
@ -235,7 +235,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry" id="parish"> <object class="UndoableEntry" id="parish">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property> <property name="invisible_char">&#x25CF;</property>
@ -283,7 +283,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry" id="county"> <object class="UndoableEntry" id="county">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property> <property name="invisible_char">&#x25CF;</property>
@ -315,7 +315,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry" id="state"> <object class="UndoableEntry" id="state">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property> <property name="invisible_char">&#x25CF;</property>
@ -345,7 +345,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry" id="country"> <object class="UndoableEntry" id="country">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property> <property name="invisible_char">&#x25CF;</property>
@ -377,7 +377,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry" id="postal"> <object class="UndoableEntry" id="postal">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property> <property name="invisible_char">&#x25CF;</property>
@ -406,7 +406,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry" id="phone"> <object class="UndoableEntry" id="phone">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property> <property name="invisible_char">&#x25CF;</property>

View File

@ -1,6 +1,7 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<interface> <interface>
<!-- interface-requires gtk+ 2.12 --> <!-- interface-requires gtk+ 2.12 -->
<!-- interface-requires grampswidgets 0.0 -->
<!-- interface-naming-policy project-wide --> <!-- interface-naming-policy project-wide -->
<object class="GtkDialog" id="editreporef"> <object class="GtkDialog" id="editreporef">
<property name="type_hint">dialog</property> <property name="type_hint">dialog</property>
@ -107,7 +108,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry" id="call_number"> <object class="UndoableEntry" id="call_number">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property> <property name="invisible_char">&#x25CF;</property>
@ -187,7 +188,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry" id="repo_name"> <object class="UndoableEntry" id="repo_name">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property> <property name="invisible_char">&#x25CF;</property>
@ -255,7 +256,7 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="spacing">12</property> <property name="spacing">12</property>
<child> <child>
<object class="GtkEntry" id="gid"> <object class="UndoableEntry" id="gid">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property> <property name="invisible_char">&#x25CF;</property>

View File

@ -1,6 +1,7 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<interface> <interface>
<!-- interface-requires gtk+ 2.12 --> <!-- interface-requires gtk+ 2.12 -->
<!-- interface-requires grampswidgets 0.0 -->
<!-- interface-naming-policy project-wide --> <!-- interface-naming-policy project-wide -->
<object class="GtkDialog" id="editrepository"> <object class="GtkDialog" id="editrepository">
<property name="type_hint">dialog</property> <property name="type_hint">dialog</property>
@ -52,7 +53,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry" id="repository_name"> <object class="UndoableEntry" id="repository_name">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property> <property name="invisible_char">&#x25CF;</property>
@ -91,7 +92,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry" id="gid"> <object class="UndoableEntry" id="gid">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property> <property name="invisible_char">&#x25CF;</property>

View File

@ -1,6 +1,7 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<interface> <interface>
<!-- interface-requires gtk+ 2.12 --> <!-- interface-requires gtk+ 2.12 -->
<!-- interface-requires grampswidgets 0.0 -->
<!-- interface-naming-policy toplevel-contextual --> <!-- interface-naming-policy toplevel-contextual -->
<object class="GtkDialog" id="editsource"> <object class="GtkDialog" id="editsource">
<property name="type_hint">dialog</property> <property name="type_hint">dialog</property>
@ -52,7 +53,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry" id="source_title"> <object class="UndoableEntry" id="source_title">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="has_focus">True</property> <property name="has_focus">True</property>
@ -64,7 +65,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry" id="author"> <object class="UndoableEntry" id="author">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
</object> </object>
@ -93,7 +94,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry" id="pubinfo"> <object class="UndoableEntry" id="pubinfo">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
</object> </object>
@ -106,7 +107,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry" id="abbrev"> <object class="UndoableEntry" id="abbrev">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
</object> </object>
@ -154,7 +155,7 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="spacing">12</property> <property name="spacing">12</property>
<child> <child>
<object class="GtkEntry" id="gid"> <object class="UndoableEntry" id="gid">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property> <property name="invisible_char">&#x25CF;</property>

View File

@ -77,7 +77,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry" id="volume"> <object class="UndoableEntry" id="volume">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property> <property name="invisible_char">&#x25CF;</property>
@ -280,7 +280,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry" id="author"> <object class="UndoableEntry" id="author">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property> <property name="invisible_char">&#x25CF;</property>
@ -332,7 +332,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry" id="abbrev"> <object class="UndoableEntry" id="abbrev">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property> <property name="invisible_char">&#x25CF;</property>
@ -346,7 +346,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry" id="pub_info"> <object class="UndoableEntry" id="pub_info">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property> <property name="invisible_char">&#x25CF;</property>
@ -379,7 +379,7 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="spacing">12</property> <property name="spacing">12</property>
<child> <child>
<object class="GtkEntry" id="gid"> <object class="UndoableEntry" id="gid">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property> <property name="invisible_char">&#x25CF;</property>
@ -418,7 +418,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry" id="title"> <object class="UndoableEntry" id="title">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property> <property name="invisible_char">&#x25CF;</property>

View File

@ -1,6 +1,7 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<interface> <interface>
<!-- interface-requires gtk+ 2.12 --> <!-- interface-requires gtk+ 2.12 -->
<!-- interface-requires grampswidgets 0.0 -->
<!-- interface-naming-policy project-wide --> <!-- interface-naming-policy project-wide -->
<object class="GtkDialog" id="editurl"> <object class="GtkDialog" id="editurl">
<property name="default_width">600</property> <property name="default_width">600</property>
@ -98,7 +99,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry" id="url_addr"> <object class="UndoableEntry" id="url_addr">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property> <property name="invisible_char">&#x25CF;</property>
@ -130,7 +131,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry" id="url_des"> <object class="UndoableEntry" id="url_des">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="invisible_char">&#x25CF;</property> <property name="invisible_char">&#x25CF;</property>

View File

@ -1,6 +1,7 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<interface> <interface>
<!-- interface-requires gtk+ 2.12 --> <!-- interface-requires gtk+ 2.12 -->
<!-- interface-requires grampswidgets 0.0 -->
<!-- interface-naming-policy toplevel-contextual --> <!-- interface-naming-policy toplevel-contextual -->
<object class="GtkDialog" id="mergeplace"> <object class="GtkDialog" id="mergeplace">
<property name="modal">True</property> <property name="modal">True</property>
@ -37,7 +38,7 @@
<property name="column_spacing">6</property> <property name="column_spacing">6</property>
<property name="row_spacing">6</property> <property name="row_spacing">6</property>
<child> <child>
<object class="GtkEntry" id="title3_text"> <object class="UndoableEntry" id="title3_text">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
</object> </object>

View File

@ -1,5 +1,7 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<interface> <interface>
<!-- interface-requires gtk+ 2.12 -->
<!-- interface-requires grampswidgets 0.0 -->
<object class="GtkDialog" id="mergeevent"> <object class="GtkDialog" id="mergeevent">
<property name="modal">True</property> <property name="modal">True</property>
<property name="default_width">500</property> <property name="default_width">500</property>

View File

@ -1,5 +1,7 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<interface> <interface>
<!-- interface-requires gtk+ 2.12 -->
<!-- interface-requires grampswidgets 0.0 -->
<object class="GtkDialog" id="mergefamily"> <object class="GtkDialog" id="mergefamily">
<property name="modal">True</property> <property name="modal">True</property>
<property name="default_width">500</property> <property name="default_width">500</property>

View File

@ -1,5 +1,7 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<interface> <interface>
<!-- interface-requires gtk+ 2.12 -->
<!-- interface-requires grampswidgets 0.0 -->
<object class="GtkDialog" id="mergeobject"> <object class="GtkDialog" id="mergeobject">
<property name="modal">True</property> <property name="modal">True</property>
<property name="default_width">500</property> <property name="default_width">500</property>

View File

@ -1,5 +1,7 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<interface> <interface>
<!-- interface-requires gtk+ 2.12 -->
<!-- interface-requires grampswidgets 0.0 -->
<object class="GtkDialog" id="mergenote"> <object class="GtkDialog" id="mergenote">
<property name="modal">True</property> <property name="modal">True</property>
<property name="default_width">600</property> <property name="default_width">600</property>

View File

@ -1,5 +1,7 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<interface> <interface>
<!-- interface-requires gtk+ 2.12 -->
<!-- interface-requires grampswidgets 0.0 -->
<object class="GtkDialog" id="mergeperson"> <object class="GtkDialog" id="mergeperson">
<property name="modal">True</property> <property name="modal">True</property>
<property name="default_width">700</property> <property name="default_width">700</property>

View File

@ -1,5 +1,7 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<interface> <interface>
<!-- interface-requires gtk+ 2.12 -->
<!-- interface-requires grampswidgets 0.0 -->
<object class="GtkDialog" id="mergeplace"> <object class="GtkDialog" id="mergeplace">
<property name="modal">True</property> <property name="modal">True</property>
<property name="default_width">500</property> <property name="default_width">500</property>

View File

@ -1,5 +1,7 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<interface> <interface>
<!-- interface-requires gtk+ 2.12 -->
<!-- interface-requires grampswidgets 0.0 -->
<object class="GtkDialog" id="mergerepository"> <object class="GtkDialog" id="mergerepository">
<property name="modal">True</property> <property name="modal">True</property>
<property name="default_width">500</property> <property name="default_width">500</property>

View File

@ -1,5 +1,7 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<interface> <interface>
<!-- interface-requires gtk+ 2.12 -->
<!-- interface-requires grampswidgets 0.0 -->
<object class="GtkDialog" id="mergesource"> <object class="GtkDialog" id="mergesource">
<property name="modal">True</property> <property name="modal">True</property>
<property name="default_width">500</property> <property name="default_width">500</property>

View File

@ -1,6 +1,7 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<interface> <interface>
<!-- interface-requires gtk+ 2.12 --> <!-- interface-requires gtk+ 2.12 -->
<!-- interface-requires grampswidgets 0.0 -->
<!-- interface-naming-policy toplevel-contextual --> <!-- interface-naming-policy toplevel-contextual -->
<object class="GtkWindow" id="papermenu"> <object class="GtkWindow" id="papermenu">
<property name="title" translatable="yes">Paper Settings</property> <property name="title" translatable="yes">Paper Settings</property>
@ -90,7 +91,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry" id="pwidth"> <object class="UndoableEntry" id="pwidth">
<property name="visible">True</property> <property name="visible">True</property>
<property name="sensitive">False</property> <property name="sensitive">False</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
@ -105,7 +106,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry" id="pheight"> <object class="UndoableEntry" id="pheight">
<property name="visible">True</property> <property name="visible">True</property>
<property name="sensitive">False</property> <property name="sensitive">False</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
@ -299,7 +300,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry" id="lmargin"> <object class="UndoableEntry" id="lmargin">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="invisible_char">&#x2022;</property> <property name="invisible_char">&#x2022;</property>
@ -312,7 +313,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry" id="rmargin"> <object class="UndoableEntry" id="rmargin">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="invisible_char">&#x2022;</property> <property name="invisible_char">&#x2022;</property>
@ -327,7 +328,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry" id="tmargin"> <object class="UndoableEntry" id="tmargin">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="invisible_char">&#x2022;</property> <property name="invisible_char">&#x2022;</property>
@ -342,7 +343,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry" id="bmargin"> <object class="UndoableEntry" id="bmargin">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="invisible_char">&#x2022;</property> <property name="invisible_char">&#x2022;</property>

View File

@ -1,6 +1,7 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<interface> <interface>
<!-- interface-requires gtk+ 2.12 --> <!-- interface-requires gtk+ 2.12 -->
<!-- interface-requires grampswidgets 0.0 -->
<!-- interface-naming-policy toplevel-contextual --> <!-- interface-naming-policy toplevel-contextual -->
<object class="GtkListStore" id="model1"> <object class="GtkListStore" id="model1">
<columns> <columns>
@ -274,7 +275,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry" id="filter_name"> <object class="UndoableEntry" id="filter_name">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<signal name="changed" handler="on_filter_name_changed"/> <signal name="changed" handler="on_filter_name_changed"/>
@ -289,7 +290,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry" id="comment"> <object class="UndoableEntry" id="comment">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
</object> </object>

View File

@ -1,6 +1,7 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<interface> <interface>
<!-- interface-requires gtk+ 2.12 --> <!-- interface-requires gtk+ 2.12 -->
<!-- interface-requires grampswidgets 0.0 -->
<!-- interface-naming-policy project-wide --> <!-- interface-naming-policy project-wide -->
<object class="GtkDialog" id="styles"> <object class="GtkDialog" id="styles">
<property name="default_width">400</property> <property name="default_width">400</property>
@ -221,7 +222,7 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkEntry" id="style_name"> <object class="UndoableEntry" id="style_name">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="has_focus">True</property> <property name="has_focus">True</property>

View File

@ -57,7 +57,6 @@ class UndoableInsertEntry(object):
#unicode char can have length > 1 as it points in the buffer #unicode char can have length > 1 as it points in the buffer
charlength = len(unicode(text)) charlength = len(unicode(text))
self.length = charlength self.length = charlength
print text, length, unicode(text)[0], len(unicode(text))
if charlength > 1 or self.text in ("\r", "\n", " "): if charlength > 1 or self.text in ("\r", "\n", " "):
self.mergeable = False self.mergeable = False
else: else:

View File

@ -48,6 +48,7 @@ import pango
# #
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
from Errors import MaskError, ValidationError, WindowActiveError from Errors import MaskError, ValidationError, WindowActiveError
from gui.widgets.undoableentry import UndoableEntry
#------------------------------------------------------------------------- #-------------------------------------------------------------------------
# #
@ -563,7 +564,7 @@ INPUT_CHAR_MAP = {
(COL_TEXT, (COL_TEXT,
COL_OBJECT) = range(2) COL_OBJECT) = range(2)
class MaskedEntry(gtk.Entry): class MaskedEntry(UndoableEntry):
""" """
The MaskedEntry is an Entry subclass with additional features. 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 - Mask, force the input to meet certain requirements
- IconEntry, allows you to have an icon inside the entry - IconEntry, allows you to have an icon inside the entry
- convenience functions for completion - 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' __gtype_name__ = 'MaskedEntry'
def __init__(self): def __init__(self):
gtk.Entry.__init__(self) UndoableEntry.__init__(self)
self.connect('insert-text', self._on_insert_text) # connect in UndoableEntry:
self.connect('delete-text', self._on_delete_text) #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_after('grab-focus', self._after_grab_focus)
self.connect('changed', self._on_changed) self.connect('changed', self._on_changed)
@ -1140,7 +1145,10 @@ class MaskedEntry(gtk.Entry):
# Callbacks # Callbacks
def _on_insert_text(self, editable, new, length, position): 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 return
new = unicode(new) new = unicode(new)
pos = self.get_position() pos = self.get_position()
@ -1159,9 +1167,13 @@ class MaskedEntry(gtk.Entry):
# Change the text with the new text. # Change the text with the new text.
self._block_changed = True self._block_changed = True
self._really_delete_text(0, -1) 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._block_changed = False
self._really_insert_text(text, 0) 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: # 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) # start (s at the previous ilustration)
def _on_delete_text(self, editable, start, end): 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 return
self.stop_emission('delete-text') self.stop_emission('delete-text')
@ -1207,6 +1222,8 @@ class MaskedEntry(gtk.Entry):
and not isinstance(self._mask_validators[start], int) and not isinstance(self._mask_validators[start], int)
and pos != start): and pos != start):
self._on_delete_text(editable, start-1, 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 return
field = self._get_field_at_pos(end-1) field = self._get_field_at_pos(end-1)
@ -1241,8 +1258,12 @@ class MaskedEntry(gtk.Entry):
self._block_changed = True self._block_changed = True
self._really_delete_text(0, -1) 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._block_changed = False
self._really_insert_text(new_text, 0) 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. # Position the cursor on the right place.
self.set_position(new_pos) self.set_position(new_pos)