From d8946d75ac5d6bb3703d86b1540a0b590225fa84 Mon Sep 17 00:00:00 2001 From: Nick Hall Date: Tue, 12 May 2015 20:52:10 +0100 Subject: [PATCH 1/3] Hide place title field in place editor Add option in preferences to display legacy title field. Hide by default. --- gramps/gen/config.py | 1 + gramps/gui/configure.py | 6 ++++++ gramps/gui/editors/editplace.py | 10 +++++++--- gramps/gui/editors/editplaceref.py | 11 ++++++++--- gramps/gui/glade/editplace.glade | 22 +++++++++++----------- gramps/gui/glade/editplaceref.glade | 28 ++++++++++++++-------------- 6 files changed, 47 insertions(+), 31 deletions(-) diff --git a/gramps/gen/config.py b/gramps/gen/config.py index b0920b5aa..68d6352f9 100644 --- a/gramps/gen/config.py +++ b/gramps/gen/config.py @@ -293,6 +293,7 @@ register('preferences.invalid-date-format', "%s") register('preferences.iprefix', 'I%04d') register('preferences.name-format', 1) register('preferences.place-format', 0) +register('preferences.place-title', False) register('preferences.patronimic-surname', False) register('preferences.no-given-text', "[%s]" % _("Missing Given Name")) register('preferences.no-record-text', "[%s]" % _("Missing Record")) diff --git a/gramps/gui/configure.py b/gramps/gui/configure.py index 842def5c7..ec3b7b2d4 100644 --- a/gramps/gui/configure.py +++ b/gramps/gui/configure.py @@ -1013,6 +1013,12 @@ class GrampsPreferences(ConfigureDialog): grid.attach(obox, 1, row, 2, 1) row += 1 + # Legacy place title mode + self.add_checkbox(grid, + _("Display legacy place title field in editors"), + row, 'preferences.place-title', stop=3) + row += 1 + # Age precision: # precision=1 for "year", 2: "year, month" or 3: "year, month, days" obox = Gtk.ComboBoxText() diff --git a/gramps/gui/editors/editplace.py b/gramps/gui/editors/editplace.py index 00486cf09..725a9d96a 100644 --- a/gramps/gui/editors/editplace.py +++ b/gramps/gui/editors/editplace.py @@ -55,6 +55,7 @@ from ..widgets import (MonitoredEntry, PrivacyButton, MonitoredTagList, from gramps.gen.errors import ValidationError from gramps.gen.utils.place import conv_lat_lon from gramps.gen.display.place import displayer as place_displayer +from gramps.gen.config import config from ..dialog import ErrorDialog from ..glade import Glade @@ -105,9 +106,12 @@ class EditPlace(EditPrimary): def _setup_fields(self): - self.title = MonitoredEntry(self.top.get_object("place_title"), - self.obj.set_title, self.obj.get_title, - self.db.readonly) + if config.get('preferences.place-title'): + self.top.get_object("place_title").show() + self.top.get_object("place_title_label").show() + self.title = MonitoredEntry(self.top.get_object("place_title"), + self.obj.set_title, self.obj.get_title, + self.db.readonly) self.name = MonitoredEntry(self.top.get_object("name_entry"), self.obj.set_name, self.obj.get_name, diff --git a/gramps/gui/editors/editplaceref.py b/gramps/gui/editors/editplaceref.py index 6bd1dfd5c..011d534ab 100644 --- a/gramps/gui/editors/editplaceref.py +++ b/gramps/gui/editors/editplaceref.py @@ -35,6 +35,7 @@ from gramps.gen.lib import NoteType from gramps.gen.db import DbTxn from gramps.gen.errors import ValidationError from gramps.gen.utils.place import conv_lat_lon +from gramps.gen.config import config from gramps.gen.const import GRAMPS_LOCALE as glocale _ = glocale.translation.gettext @@ -102,9 +103,13 @@ class EditPlaceRef(EditReference): self.uistate, self.track, self.db.readonly) - self.title = MonitoredEntry(self.top.get_object("place_title"), - self.source.set_title, self.source.get_title, - self.db.readonly) + if config.get('preferences.place-title'): + self.top.get_object("place_title").show() + self.top.get_object("place_title_label").show() + self.title = MonitoredEntry(self.top.get_object("place_title"), + self.source.set_title, + self.source.get_title, + self.db.readonly) self.name = MonitoredEntry(self.top.get_object("name_entry"), self.source.set_name, self.source.get_name, diff --git a/gramps/gui/glade/editplace.glade b/gramps/gui/glade/editplace.glade index 1d3ae4645..a7d400eee 100644 --- a/gramps/gui/glade/editplace.glade +++ b/gramps/gui/glade/editplace.glade @@ -83,14 +83,14 @@ 4 6 - - True + False - 0 + True _Title: True center place_title + 0 0 @@ -101,11 +101,11 @@ True False - 0 L_atitude: True center lat_entry + 0 0 @@ -116,11 +116,11 @@ True False - 0 _Longitude: True center lon_entry + 0 2 @@ -129,8 +129,8 @@ - True True + True Full title of this place. True @@ -145,10 +145,10 @@ True False - 0 _ID: True gid + 0 0 @@ -209,9 +209,9 @@ You can set these values via the Geography View by searching the place, or via a True False - 0 Code: True + 0 False @@ -285,8 +285,8 @@ You can set these values via the Geography View by searching the place, or via a True False - 0 place|Name: + 0 0 @@ -297,8 +297,8 @@ You can set these values via the Geography View by searching the place, or via a True False - 0 Type: + 0 2 @@ -341,8 +341,8 @@ You can set these values via the Geography View by searching the place, or via a True False - 0 Tags: + 0 2 diff --git a/gramps/gui/glade/editplaceref.glade b/gramps/gui/glade/editplaceref.glade index 3fdf2d18d..e0a97c429 100644 --- a/gramps/gui/glade/editplaceref.glade +++ b/gramps/gui/glade/editplaceref.glade @@ -77,12 +77,12 @@ True False - 0 6 3 Reference information True center + 0 @@ -109,11 +109,11 @@ True False - 0 3 _Date: True center + 0 0 @@ -190,13 +190,13 @@ 6 12 - - True + False - 0 + True Title: True center + 0 0 @@ -207,10 +207,10 @@ True False - 0 Name: True center + 0 0 @@ -221,11 +221,11 @@ True False - 0 3 ID: True center + 0 0 @@ -236,9 +236,9 @@ True False - 0 Latitude: True + 0 0 @@ -269,12 +269,12 @@ 500 True False - 0 4 <b>Note:</b> Any changes in the enclosing place information will be reflected in the place itself, for places that it encloses. True fill True + 0 True @@ -293,10 +293,10 @@ True False - 0 Type: True center + 0 2 @@ -307,10 +307,10 @@ True False - 0 Longitude: True center + 0 2 @@ -368,8 +368,8 @@ - True True + True Full title of this place. True @@ -447,9 +447,9 @@ You can set these values via the Geography View by searching the place, or via a True False - 0 Code: True + 0 False @@ -481,8 +481,8 @@ You can set these values via the Geography View by searching the place, or via a True False - 0 Tags: + 0 2 From 0eb027a0952b4273ed3aac8babf0c582ad1d6001 Mon Sep 17 00:00:00 2001 From: Nick Hall Date: Tue, 12 May 2015 21:21:28 +0100 Subject: [PATCH 2/3] Update required gtk version in glade files --- gramps/gui/glade/addmedia.glade | 2 +- gramps/gui/glade/baseselector.glade | 2 +- gramps/gui/glade/book.glade | 2 +- gramps/gui/glade/clipboard.glade | 2 +- gramps/gui/glade/configure.glade | 2 +- gramps/gui/glade/dbman.glade | 2 +- gramps/gui/glade/dialog.glade | 2 +- gramps/gui/glade/editaddress.glade | 2 +- gramps/gui/glade/editattribute.glade | 2 +- gramps/gui/glade/editchildref.glade | 2 +- gramps/gui/glade/editcitation.glade | 2 +- gramps/gui/glade/editdate.glade | 2 +- gramps/gui/glade/editevent.glade | 2 +- gramps/gui/glade/editeventref.glade | 2 +- gramps/gui/glade/editfamily.glade | 2 +- gramps/gui/glade/editldsord.glade | 2 +- gramps/gui/glade/editlink.glade | 2 +- gramps/gui/glade/editlocation.glade | 2 +- gramps/gui/glade/editmedia.glade | 2 +- gramps/gui/glade/editmediaref.glade | 2 +- gramps/gui/glade/editname.glade | 2 +- gramps/gui/glade/editnote.glade | 2 +- gramps/gui/glade/editperson.glade | 2 +- gramps/gui/glade/editpersonref.glade | 2 +- gramps/gui/glade/editplace.glade | 2 +- gramps/gui/glade/editplaceref.glade | 2 +- gramps/gui/glade/editreporef.glade | 2 +- gramps/gui/glade/editrepository.glade | 2 +- gramps/gui/glade/editsource.glade | 2 +- gramps/gui/glade/editurl.glade | 2 +- gramps/gui/glade/grampletpane.glade | 2 +- gramps/gui/glade/mergecitation.glade | 2 +- gramps/gui/glade/mergedata.glade | 2 +- gramps/gui/glade/mergeevent.glade | 2 +- gramps/gui/glade/mergefamily.glade | 2 +- gramps/gui/glade/mergemedia.glade | 2 +- gramps/gui/glade/mergenote.glade | 2 +- gramps/gui/glade/mergeperson.glade | 2 +- gramps/gui/glade/mergeplace.glade | 2 +- gramps/gui/glade/mergerepository.glade | 2 +- gramps/gui/glade/mergesource.glade | 2 +- gramps/gui/glade/papermenu.glade | 2 +- gramps/gui/glade/plugins.glade | 2 +- gramps/gui/glade/reorder.glade | 2 +- gramps/gui/glade/rule.glade | 2 +- gramps/gui/glade/styleeditor.glade | 2 +- gramps/gui/glade/tipofday.glade | 2 +- gramps/gui/glade/updateaddons.glade | 2 +- gramps/plugins/tool/changenames.glade | 2 +- gramps/plugins/tool/changetypes.glade | 2 +- gramps/plugins/tool/check.glade | 2 +- gramps/plugins/tool/eventcmp.glade | 2 +- gramps/plugins/tool/finddupes.glade | 2 +- gramps/plugins/tool/mergecitations.glade | 2 +- gramps/plugins/tool/notrelated.glade | 2 +- gramps/plugins/tool/ownereditor.glade | 2 +- gramps/plugins/tool/patchnames.glade | 2 +- gramps/plugins/tool/phpgedview.glade | 2 +- gramps/plugins/tool/relcalc.glade | 2 +- gramps/plugins/tool/removeunused.glade | 2 +- gramps/plugins/tool/verify.glade | 2 +- 61 files changed, 61 insertions(+), 61 deletions(-) diff --git a/gramps/gui/glade/addmedia.glade b/gramps/gui/glade/addmedia.glade index bdb45f2f9..f9ac11e06 100644 --- a/gramps/gui/glade/addmedia.glade +++ b/gramps/gui/glade/addmedia.glade @@ -1,7 +1,7 @@ - + False diff --git a/gramps/gui/glade/baseselector.glade b/gramps/gui/glade/baseselector.glade index 4f52e23cf..5bcc829d1 100644 --- a/gramps/gui/glade/baseselector.glade +++ b/gramps/gui/glade/baseselector.glade @@ -1,7 +1,7 @@ - + False True diff --git a/gramps/gui/glade/book.glade b/gramps/gui/glade/book.glade index 0c7d2c014..65c717715 100644 --- a/gramps/gui/glade/book.glade +++ b/gramps/gui/glade/book.glade @@ -1,7 +1,7 @@ - + 600 600 diff --git a/gramps/gui/glade/clipboard.glade b/gramps/gui/glade/clipboard.glade index 2237d9b75..1a4c45a02 100644 --- a/gramps/gui/glade/clipboard.glade +++ b/gramps/gui/glade/clipboard.glade @@ -1,7 +1,7 @@ - + False Clipboard diff --git a/gramps/gui/glade/configure.glade b/gramps/gui/glade/configure.glade index e1597d36b..14c107688 100644 --- a/gramps/gui/glade/configure.glade +++ b/gramps/gui/glade/configure.glade @@ -1,7 +1,7 @@ - + True False diff --git a/gramps/gui/glade/dbman.glade b/gramps/gui/glade/dbman.glade index a7931aa78..bd7815154 100644 --- a/gramps/gui/glade/dbman.glade +++ b/gramps/gui/glade/dbman.glade @@ -1,7 +1,7 @@ - + False Revision comment - Gramps diff --git a/gramps/gui/glade/dialog.glade b/gramps/gui/glade/dialog.glade index 9ee495b46..84bf5830d 100644 --- a/gramps/gui/glade/dialog.glade +++ b/gramps/gui/glade/dialog.glade @@ -1,7 +1,7 @@ - + False dialog diff --git a/gramps/gui/glade/editaddress.glade b/gramps/gui/glade/editaddress.glade index 8bfbdc047..a8b0f7ee0 100644 --- a/gramps/gui/glade/editaddress.glade +++ b/gramps/gui/glade/editaddress.glade @@ -1,7 +1,7 @@ - + False diff --git a/gramps/gui/glade/editattribute.glade b/gramps/gui/glade/editattribute.glade index d8e2f1977..7ca9f69d6 100644 --- a/gramps/gui/glade/editattribute.glade +++ b/gramps/gui/glade/editattribute.glade @@ -1,7 +1,7 @@ - + False diff --git a/gramps/gui/glade/editchildref.glade b/gramps/gui/glade/editchildref.glade index f0ce857aa..db4123911 100644 --- a/gramps/gui/glade/editchildref.glade +++ b/gramps/gui/glade/editchildref.glade @@ -1,7 +1,7 @@ - + False 600 diff --git a/gramps/gui/glade/editcitation.glade b/gramps/gui/glade/editcitation.glade index 0d3ca1141..9d761e602 100644 --- a/gramps/gui/glade/editcitation.glade +++ b/gramps/gui/glade/editcitation.glade @@ -1,7 +1,7 @@ - + diff --git a/gramps/gui/glade/editdate.glade b/gramps/gui/glade/editdate.glade index 685fceeb4..28a99bf9e 100644 --- a/gramps/gui/glade/editdate.glade +++ b/gramps/gui/glade/editdate.glade @@ -1,7 +1,7 @@ - + 31 diff --git a/gramps/gui/glade/editevent.glade b/gramps/gui/glade/editevent.glade index 40f273c01..27c710036 100644 --- a/gramps/gui/glade/editevent.glade +++ b/gramps/gui/glade/editevent.glade @@ -1,7 +1,7 @@ - + False diff --git a/gramps/gui/glade/editeventref.glade b/gramps/gui/glade/editeventref.glade index 78ed939b9..5a8bfde2e 100644 --- a/gramps/gui/glade/editeventref.glade +++ b/gramps/gui/glade/editeventref.glade @@ -1,7 +1,7 @@ - + False diff --git a/gramps/gui/glade/editfamily.glade b/gramps/gui/glade/editfamily.glade index adbd8705b..148ff9fd9 100644 --- a/gramps/gui/glade/editfamily.glade +++ b/gramps/gui/glade/editfamily.glade @@ -1,7 +1,7 @@ - + False diff --git a/gramps/gui/glade/editldsord.glade b/gramps/gui/glade/editldsord.glade index 4dea563de..0b72368bc 100644 --- a/gramps/gui/glade/editldsord.glade +++ b/gramps/gui/glade/editldsord.glade @@ -1,7 +1,7 @@ - + diff --git a/gramps/gui/glade/editlink.glade b/gramps/gui/glade/editlink.glade index e6eb4f504..2a686f017 100644 --- a/gramps/gui/glade/editlink.glade +++ b/gramps/gui/glade/editlink.glade @@ -1,7 +1,7 @@ - + False diff --git a/gramps/gui/glade/editlocation.glade b/gramps/gui/glade/editlocation.glade index 0c5e8c4b0..be3535e38 100644 --- a/gramps/gui/glade/editlocation.glade +++ b/gramps/gui/glade/editlocation.glade @@ -1,7 +1,7 @@ - + False diff --git a/gramps/gui/glade/editmedia.glade b/gramps/gui/glade/editmedia.glade index b97e70b26..d2f4b02aa 100644 --- a/gramps/gui/glade/editmedia.glade +++ b/gramps/gui/glade/editmedia.glade @@ -1,7 +1,7 @@ - + False diff --git a/gramps/gui/glade/editmediaref.glade b/gramps/gui/glade/editmediaref.glade index 5e77756b6..871289c80 100644 --- a/gramps/gui/glade/editmediaref.glade +++ b/gramps/gui/glade/editmediaref.glade @@ -1,7 +1,7 @@ - + 100 diff --git a/gramps/gui/glade/editname.glade b/gramps/gui/glade/editname.glade index 1d2c94729..b78427963 100644 --- a/gramps/gui/glade/editname.glade +++ b/gramps/gui/glade/editname.glade @@ -1,7 +1,7 @@ - + False diff --git a/gramps/gui/glade/editnote.glade b/gramps/gui/glade/editnote.glade index 21f92eaed..4028e9679 100644 --- a/gramps/gui/glade/editnote.glade +++ b/gramps/gui/glade/editnote.glade @@ -1,7 +1,7 @@ - + False diff --git a/gramps/gui/glade/editperson.glade b/gramps/gui/glade/editperson.glade index 232afa5d3..4b06b0228 100644 --- a/gramps/gui/glade/editperson.glade +++ b/gramps/gui/glade/editperson.glade @@ -1,7 +1,7 @@ - + True diff --git a/gramps/gui/glade/editpersonref.glade b/gramps/gui/glade/editpersonref.glade index 7e653a33a..e338a6d7a 100644 --- a/gramps/gui/glade/editpersonref.glade +++ b/gramps/gui/glade/editpersonref.glade @@ -1,7 +1,7 @@ - + False diff --git a/gramps/gui/glade/editplace.glade b/gramps/gui/glade/editplace.glade index a7d400eee..bef910a5d 100644 --- a/gramps/gui/glade/editplace.glade +++ b/gramps/gui/glade/editplace.glade @@ -1,7 +1,7 @@ - + False diff --git a/gramps/gui/glade/editplaceref.glade b/gramps/gui/glade/editplaceref.glade index e0a97c429..df14ddc44 100644 --- a/gramps/gui/glade/editplaceref.glade +++ b/gramps/gui/glade/editplaceref.glade @@ -1,7 +1,7 @@ - + False diff --git a/gramps/gui/glade/editreporef.glade b/gramps/gui/glade/editreporef.glade index 72700387f..7db31e9c8 100644 --- a/gramps/gui/glade/editreporef.glade +++ b/gramps/gui/glade/editreporef.glade @@ -1,7 +1,7 @@ - + False diff --git a/gramps/gui/glade/editrepository.glade b/gramps/gui/glade/editrepository.glade index 2b392d17b..7220e6f79 100644 --- a/gramps/gui/glade/editrepository.glade +++ b/gramps/gui/glade/editrepository.glade @@ -1,7 +1,7 @@ - + False diff --git a/gramps/gui/glade/editsource.glade b/gramps/gui/glade/editsource.glade index 90081f9b8..9c2b7433b 100644 --- a/gramps/gui/glade/editsource.glade +++ b/gramps/gui/glade/editsource.glade @@ -1,7 +1,7 @@ - + False diff --git a/gramps/gui/glade/editurl.glade b/gramps/gui/glade/editurl.glade index 97e008bd3..fd7257de2 100644 --- a/gramps/gui/glade/editurl.glade +++ b/gramps/gui/glade/editurl.glade @@ -1,7 +1,7 @@ - + False diff --git a/gramps/gui/glade/grampletpane.glade b/gramps/gui/glade/grampletpane.glade index 5a0bd0394..cf7234af1 100644 --- a/gramps/gui/glade/grampletpane.glade +++ b/gramps/gui/glade/grampletpane.glade @@ -1,7 +1,7 @@ - + False GDK_BUTTON_PRESS_MASK | GDK_STRUCTURE_MASK diff --git a/gramps/gui/glade/mergecitation.glade b/gramps/gui/glade/mergecitation.glade index 046e7590b..e5e7d8c36 100644 --- a/gramps/gui/glade/mergecitation.glade +++ b/gramps/gui/glade/mergecitation.glade @@ -1,7 +1,7 @@ - + False True diff --git a/gramps/gui/glade/mergedata.glade b/gramps/gui/glade/mergedata.glade index c998ed768..cf3f169fa 100644 --- a/gramps/gui/glade/mergedata.glade +++ b/gramps/gui/glade/mergedata.glade @@ -1,7 +1,7 @@ - + False diff --git a/gramps/gui/glade/mergeevent.glade b/gramps/gui/glade/mergeevent.glade index 1d579869f..2fad3a22b 100644 --- a/gramps/gui/glade/mergeevent.glade +++ b/gramps/gui/glade/mergeevent.glade @@ -1,7 +1,7 @@ - + False True diff --git a/gramps/gui/glade/mergefamily.glade b/gramps/gui/glade/mergefamily.glade index e26c628c1..d49be6706 100644 --- a/gramps/gui/glade/mergefamily.glade +++ b/gramps/gui/glade/mergefamily.glade @@ -1,7 +1,7 @@ - + False True diff --git a/gramps/gui/glade/mergemedia.glade b/gramps/gui/glade/mergemedia.glade index 3290220aa..ef06fea53 100644 --- a/gramps/gui/glade/mergemedia.glade +++ b/gramps/gui/glade/mergemedia.glade @@ -1,7 +1,7 @@ - + False True diff --git a/gramps/gui/glade/mergenote.glade b/gramps/gui/glade/mergenote.glade index 501f8f0bd..39c16e037 100644 --- a/gramps/gui/glade/mergenote.glade +++ b/gramps/gui/glade/mergenote.glade @@ -1,7 +1,7 @@ - + False True diff --git a/gramps/gui/glade/mergeperson.glade b/gramps/gui/glade/mergeperson.glade index 0ee703e87..b60f49391 100644 --- a/gramps/gui/glade/mergeperson.glade +++ b/gramps/gui/glade/mergeperson.glade @@ -1,7 +1,7 @@ - + False True diff --git a/gramps/gui/glade/mergeplace.glade b/gramps/gui/glade/mergeplace.glade index 09ca7715f..aea246815 100644 --- a/gramps/gui/glade/mergeplace.glade +++ b/gramps/gui/glade/mergeplace.glade @@ -1,7 +1,7 @@ - + False True diff --git a/gramps/gui/glade/mergerepository.glade b/gramps/gui/glade/mergerepository.glade index e7d7ff600..4e1cf545d 100644 --- a/gramps/gui/glade/mergerepository.glade +++ b/gramps/gui/glade/mergerepository.glade @@ -1,7 +1,7 @@ - + False True diff --git a/gramps/gui/glade/mergesource.glade b/gramps/gui/glade/mergesource.glade index b4ecea0cb..5251c878e 100644 --- a/gramps/gui/glade/mergesource.glade +++ b/gramps/gui/glade/mergesource.glade @@ -1,7 +1,7 @@ - + False True diff --git a/gramps/gui/glade/papermenu.glade b/gramps/gui/glade/papermenu.glade index 5754dc4e1..7c34aa847 100644 --- a/gramps/gui/glade/papermenu.glade +++ b/gramps/gui/glade/papermenu.glade @@ -1,7 +1,7 @@ - + False diff --git a/gramps/gui/glade/plugins.glade b/gramps/gui/glade/plugins.glade index f2a5f829f..c8beb18e6 100644 --- a/gramps/gui/glade/plugins.glade +++ b/gramps/gui/glade/plugins.glade @@ -1,7 +1,7 @@ - + True False diff --git a/gramps/gui/glade/reorder.glade b/gramps/gui/glade/reorder.glade index bfbbf36df..cb56def7f 100644 --- a/gramps/gui/glade/reorder.glade +++ b/gramps/gui/glade/reorder.glade @@ -1,7 +1,7 @@ - + True False diff --git a/gramps/gui/glade/rule.glade b/gramps/gui/glade/rule.glade index f74b21b67..e969b9f9b 100644 --- a/gramps/gui/glade/rule.glade +++ b/gramps/gui/glade/rule.glade @@ -1,7 +1,7 @@ - + False diff --git a/gramps/gui/glade/styleeditor.glade b/gramps/gui/glade/styleeditor.glade index 3d31a1a9a..3e2f6760f 100644 --- a/gramps/gui/glade/styleeditor.glade +++ b/gramps/gui/glade/styleeditor.glade @@ -1,7 +1,7 @@ - + 100 diff --git a/gramps/gui/glade/tipofday.glade b/gramps/gui/glade/tipofday.glade index 7d068b994..753624e1e 100644 --- a/gramps/gui/glade/tipofday.glade +++ b/gramps/gui/glade/tipofday.glade @@ -1,7 +1,7 @@ - + True False diff --git a/gramps/gui/glade/updateaddons.glade b/gramps/gui/glade/updateaddons.glade index 65068e671..2ee99291e 100644 --- a/gramps/gui/glade/updateaddons.glade +++ b/gramps/gui/glade/updateaddons.glade @@ -1,7 +1,7 @@ - + False 5 diff --git a/gramps/plugins/tool/changenames.glade b/gramps/plugins/tool/changenames.glade index 8106f0ecb..cf7ce2dbc 100644 --- a/gramps/plugins/tool/changenames.glade +++ b/gramps/plugins/tool/changenames.glade @@ -1,7 +1,7 @@ - + True False diff --git a/gramps/plugins/tool/changetypes.glade b/gramps/plugins/tool/changetypes.glade index 860461edd..150127582 100644 --- a/gramps/plugins/tool/changetypes.glade +++ b/gramps/plugins/tool/changetypes.glade @@ -1,7 +1,7 @@ - + True False diff --git a/gramps/plugins/tool/check.glade b/gramps/plugins/tool/check.glade index c9c32a09f..c5b206e23 100644 --- a/gramps/plugins/tool/check.glade +++ b/gramps/plugins/tool/check.glade @@ -1,7 +1,7 @@ - + False 450 diff --git a/gramps/plugins/tool/eventcmp.glade b/gramps/plugins/tool/eventcmp.glade index 936f7bb36..0c99bd58c 100644 --- a/gramps/plugins/tool/eventcmp.glade +++ b/gramps/plugins/tool/eventcmp.glade @@ -1,7 +1,7 @@ - + False 500 diff --git a/gramps/plugins/tool/finddupes.glade b/gramps/plugins/tool/finddupes.glade index c54506b4f..6d27af667 100644 --- a/gramps/plugins/tool/finddupes.glade +++ b/gramps/plugins/tool/finddupes.glade @@ -1,7 +1,7 @@ - + diff --git a/gramps/plugins/tool/mergecitations.glade b/gramps/plugins/tool/mergecitations.glade index 476ea5a52..9204e3be6 100644 --- a/gramps/plugins/tool/mergecitations.glade +++ b/gramps/plugins/tool/mergecitations.glade @@ -1,7 +1,7 @@ - + diff --git a/gramps/plugins/tool/notrelated.glade b/gramps/plugins/tool/notrelated.glade index cd5312dbd..a8b5d75a8 100644 --- a/gramps/plugins/tool/notrelated.glade +++ b/gramps/plugins/tool/notrelated.glade @@ -1,7 +1,7 @@ - + False 450 diff --git a/gramps/plugins/tool/ownereditor.glade b/gramps/plugins/tool/ownereditor.glade index 4828da449..d034fe4c5 100644 --- a/gramps/plugins/tool/ownereditor.glade +++ b/gramps/plugins/tool/ownereditor.glade @@ -1,7 +1,7 @@ - + False diff --git a/gramps/plugins/tool/patchnames.glade b/gramps/plugins/tool/patchnames.glade index 627a9297d..9694ecff6 100644 --- a/gramps/plugins/tool/patchnames.glade +++ b/gramps/plugins/tool/patchnames.glade @@ -1,7 +1,7 @@ - + True False diff --git a/gramps/plugins/tool/phpgedview.glade b/gramps/plugins/tool/phpgedview.glade index 66d735d40..f04e57799 100644 --- a/gramps/plugins/tool/phpgedview.glade +++ b/gramps/plugins/tool/phpgedview.glade @@ -1,7 +1,7 @@ - + diff --git a/gramps/plugins/tool/relcalc.glade b/gramps/plugins/tool/relcalc.glade index 86485489f..e2d4dbe83 100644 --- a/gramps/plugins/tool/relcalc.glade +++ b/gramps/plugins/tool/relcalc.glade @@ -1,7 +1,7 @@ - + True False diff --git a/gramps/plugins/tool/removeunused.glade b/gramps/plugins/tool/removeunused.glade index ed7c52e94..825e70988 100644 --- a/gramps/plugins/tool/removeunused.glade +++ b/gramps/plugins/tool/removeunused.glade @@ -1,7 +1,7 @@ - + True False diff --git a/gramps/plugins/tool/verify.glade b/gramps/plugins/tool/verify.glade index d666cdb27..243e3fc49 100644 --- a/gramps/plugins/tool/verify.glade +++ b/gramps/plugins/tool/verify.glade @@ -1,7 +1,7 @@ - + 100 25 From f0bfce68c2bbbea65fa8bacca419956ecedf4160 Mon Sep 17 00:00:00 2001 From: Nick Hall Date: Tue, 12 May 2015 23:00:20 +0100 Subject: [PATCH 3/3] Add a title preview to the place editors --- .../editors/displaytabs/placerefembedlist.py | 6 ++- gramps/gui/editors/editplace.py | 13 ++++- gramps/gui/editors/editplaceref.py | 14 +++++- gramps/gui/glade/editplace.glade | 48 ++++++++++++------ gramps/gui/glade/editplaceref.glade | 50 ++++++++++++------- 5 files changed, 93 insertions(+), 38 deletions(-) diff --git a/gramps/gui/editors/displaytabs/placerefembedlist.py b/gramps/gui/editors/displaytabs/placerefembedlist.py index 39dfb4216..4afbbe136 100644 --- a/gramps/gui/editors/displaytabs/placerefembedlist.py +++ b/gramps/gui/editors/displaytabs/placerefembedlist.py @@ -61,9 +61,10 @@ class PlaceRefEmbedList(EmbeddedList): (_('Date'), 3, 150, TEXT_COL, -1, None), ] - def __init__(self, dbstate, uistate, track, data, handle): + def __init__(self, dbstate, uistate, track, data, handle, callback): self.data = data self.handle = handle + self.callback = callback EmbeddedList.__init__(self, dbstate, uistate, track, _('Enclosed By'), PlaceRefModel, share_button=True, move_buttons=True) @@ -132,6 +133,9 @@ class PlaceRefEmbedList(EmbeddedList): def edit_callback(self, ref, place): self.rebuild() + def post_rebuild(self, prebuildpath): + self.callback() + def handle_extra_type(self, objtype, obj): if obj in self.get_skip_list(self.handle): ErrorDialog(_("Place cycle detected"), diff --git a/gramps/gui/editors/editplace.py b/gramps/gui/editors/editplace.py index 725a9d96a..ce90131c3 100644 --- a/gramps/gui/editors/editplace.py +++ b/gramps/gui/editors/editplace.py @@ -115,7 +115,8 @@ class EditPlace(EditPrimary): self.name = MonitoredEntry(self.top.get_object("name_entry"), self.obj.set_name, self.obj.get_name, - self.db.readonly) + self.db.readonly, + changed=self.name_changed) self.gid = MonitoredEntry(self.top.get_object("gid"), self.obj.set_gramps_id, @@ -167,6 +168,13 @@ class EditPlace(EditPrimary): return ValidationError(_("Invalid longitude (syntax: 18\u00b09'") + _('48.21"E, -18.2412 or -18:9:48.21)')) + def update_title(self): + new_title = place_displayer.display(self.db, self.obj) + self.top.get_object("preview_title").set_text(new_title) + + def name_changed(self, obj): + self.update_title() + def build_menu_names(self, place): return (_('Edit Place'), self.get_menu_title()) @@ -182,7 +190,8 @@ class EditPlace(EditPrimary): self.uistate, self.track, self.obj.get_placeref_list(), - self.obj.handle) + self.obj.handle, + self.update_title) self._add_tab(notebook, self.placeref_list) self.track_ref_for_deletion("placeref_list") diff --git a/gramps/gui/editors/editplaceref.py b/gramps/gui/editors/editplaceref.py index 011d534ab..ec3bf3db9 100644 --- a/gramps/gui/editors/editplaceref.py +++ b/gramps/gui/editors/editplaceref.py @@ -35,6 +35,7 @@ from gramps.gen.lib import NoteType from gramps.gen.db import DbTxn from gramps.gen.errors import ValidationError from gramps.gen.utils.place import conv_lat_lon +from gramps.gen.display.place import displayer as place_displayer from gramps.gen.config import config from gramps.gen.const import GRAMPS_LOCALE as glocale _ = glocale.translation.gettext @@ -113,7 +114,8 @@ class EditPlaceRef(EditReference): self.name = MonitoredEntry(self.top.get_object("name_entry"), self.source.set_name, self.source.get_name, - self.db.readonly) + self.db.readonly, + changed=self.name_changed) self.gid = MonitoredEntry(self.top.get_object("gid"), self.source.set_gramps_id, @@ -165,6 +167,13 @@ class EditPlaceRef(EditReference): return ValidationError(_("Invalid longitude (syntax: 18\u00b09'") + _('48.21"E, -18.2412 or -18:9:48.21)')) + def update_title(self): + new_title = place_displayer.display(self.db, self.source) + self.top.get_object("preview_title").set_text(new_title) + + def name_changed(self, obj): + self.update_title() + def _create_tabbed_pages(self): """ Create the notebook tabs and inserts them into the main @@ -183,7 +192,8 @@ class EditPlaceRef(EditReference): self.uistate, self.track, self.source.get_placeref_list(), - self.source.handle) + self.source.handle, + self.update_title) self._add_tab(notebook, self.placeref_list) self.track_ref_for_deletion("placeref_list") diff --git a/gramps/gui/glade/editplace.glade b/gramps/gui/glade/editplace.glade index bef910a5d..751c80d59 100644 --- a/gramps/gui/glade/editplace.glade +++ b/gramps/gui/glade/editplace.glade @@ -94,7 +94,7 @@ 0 - 0 + 1 @@ -109,7 +109,7 @@ 0 - 2 + 3 @@ -124,7 +124,7 @@ 2 - 2 + 3 @@ -137,7 +137,7 @@ 1 - 0 + 1 4 @@ -152,7 +152,7 @@ 0 - 3 + 4 @@ -167,7 +167,7 @@ You can set these values via the Geography View by searching the place, or via a 1 - 2 + 3 @@ -182,7 +182,7 @@ You can set these values via the Geography View by searching the place, or via a 3 - 2 + 3 @@ -236,7 +236,7 @@ You can set these values via the Geography View by searching the place, or via a 1 - 3 + 4 @@ -266,7 +266,7 @@ You can set these values via the Geography View by searching the place, or via a 4 - 2 + 3 @@ -278,7 +278,7 @@ You can set these values via the Geography View by searching the place, or via a 4 - 3 + 4 @@ -290,7 +290,7 @@ You can set these values via the Geography View by searching the place, or via a 0 - 1 + 2 @@ -302,7 +302,7 @@ You can set these values via the Geography View by searching the place, or via a 2 - 1 + 2 @@ -315,7 +315,7 @@ You can set these values via the Geography View by searching the place, or via a 1 - 1 + 2 @@ -334,7 +334,7 @@ You can set these values via the Geography View by searching the place, or via a 3 - 1 + 2 @@ -346,7 +346,7 @@ You can set these values via the Geography View by searching the place, or via a 2 - 3 + 4 @@ -358,7 +358,23 @@ You can set these values via the Geography View by searching the place, or via a 3 - 3 + 4 + + + + + True + False + 6 + 0 + + + + + + 0 + 0 + 5 diff --git a/gramps/gui/glade/editplaceref.glade b/gramps/gui/glade/editplaceref.glade index df14ddc44..cca7a8dcb 100644 --- a/gramps/gui/glade/editplaceref.glade +++ b/gramps/gui/glade/editplaceref.glade @@ -200,7 +200,7 @@ 0 - 0 + 1 @@ -214,7 +214,7 @@ 0 - 1 + 2 @@ -229,7 +229,7 @@ 0 - 3 + 4 @@ -242,7 +242,7 @@ 0 - 2 + 3 @@ -285,7 +285,7 @@ 0 - 4 + 5 5 @@ -300,7 +300,7 @@ 2 - 1 + 2 @@ -314,7 +314,7 @@ 2 - 2 + 3 @@ -333,7 +333,7 @@ 3 - 1 + 2 @@ -363,7 +363,7 @@ 4 - 2 + 3 @@ -376,7 +376,7 @@ 1 - 0 + 1 4 @@ -390,7 +390,7 @@ 1 - 1 + 2 @@ -405,7 +405,7 @@ You can set these values via the Geography View by searching the place, or via a 1 - 2 + 3 @@ -420,7 +420,7 @@ You can set these values via the Geography View by searching the place, or via a 3 - 2 + 3 @@ -474,7 +474,7 @@ You can set these values via the Geography View by searching the place, or via a 1 - 3 + 4 @@ -486,7 +486,7 @@ You can set these values via the Geography View by searching the place, or via a 2 - 3 + 4 @@ -498,7 +498,7 @@ You can set these values via the Geography View by searching the place, or via a 3 - 3 + 4 @@ -510,7 +510,23 @@ You can set these values via the Geography View by searching the place, or via a 4 - 3 + 4 + + + + + True + False + 6 + 0 + + + + + + 0 + 0 + 5