diff --git a/gramps/gui/editors/editplace.py b/gramps/gui/editors/editplace.py index 2d76acd17..d872ba238 100644 --- a/gramps/gui/editors/editplace.py +++ b/gramps/gui/editors/editplace.py @@ -52,7 +52,7 @@ from .displaytabs import (PlaceRefEmbedList, PlaceNameEmbedList, GalleryTab, NoteTab, WebEmbedList, PlaceBackRefList) from ..widgets import (MonitoredEntry, PrivacyButton, MonitoredTagList, MonitoredDataType) -from gramps.gen.errors import ValidationError +from gramps.gen.errors import ValidationError, WindowActiveError 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 @@ -119,6 +119,9 @@ class EditPlace(EditPrimary): self.db.readonly, changed=self.name_changed) + edit_button = self.top.get_object("name_button") + edit_button.connect('clicked', self.edit_place_name) + self.gid = MonitoredEntry(self.top.get_object("gid"), self.obj.set_gramps_id, self.obj.get_gramps_id, self.db.readonly) @@ -252,6 +255,18 @@ class EditPlace(EditPrimary): self._setup_notebook_tabs(notebook) + def edit_place_name(self, obj): + try: + from . import EditPlaceName + EditPlaceName(self.dbstate, self.uistate, self.track, + self.obj.get_name(), self.edit_callback) + except WindowActiveError: + return + + def edit_callback(self, obj): + value = self.obj.get_name().get_value() + self.top.get_object("name_entry").set_text(value) + def save(self, *obj): self.ok_button.set_sensitive(False) diff --git a/gramps/gui/editors/editplaceref.py b/gramps/gui/editors/editplaceref.py index 9daddd04a..5238ea0b9 100644 --- a/gramps/gui/editors/editplaceref.py +++ b/gramps/gui/editors/editplaceref.py @@ -33,7 +33,7 @@ from .displaytabs import (PlaceRefEmbedList, PlaceNameEmbedList, GalleryTab, NoteTab, WebEmbedList, PlaceBackRefList) from gramps.gen.lib import NoteType from gramps.gen.db import DbTxn -from gramps.gen.errors import ValidationError +from gramps.gen.errors import ValidationError, WindowActiveError 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 @@ -119,6 +119,9 @@ class EditPlaceRef(EditReference): self.db.readonly, changed=self.name_changed) + edit_button = self.top.get_object("name_button") + edit_button.connect('clicked', self.edit_place_name) + self.gid = MonitoredEntry(self.top.get_object("gid"), self.source.set_gramps_id, self.source.get_gramps_id, self.db.readonly) @@ -253,6 +256,18 @@ class EditPlaceRef(EditReference): self._setup_notebook_tabs(notebook) + def edit_place_name(self, obj): + try: + from . import EditPlaceName + EditPlaceName(self.dbstate, self.uistate, self.track, + self.source.get_name(), self.edit_callback) + except WindowActiveError: + return + + def edit_callback(self, obj): + value = self.source.get_name().get_value() + self.top.get_object("name_entry").set_text(value) + def save(self, *obj): self.ok_button.set_sensitive(False) diff --git a/gramps/gui/glade/editplace.glade b/gramps/gui/glade/editplace.glade index 1ce524081..e99cdc102 100644 --- a/gramps/gui/glade/editplace.glade +++ b/gramps/gui/glade/editplace.glade @@ -304,19 +304,6 @@ You can set these values via the Geography View by searching the place, or via a 2 - - - True - True - The name of this place. - True - - - - 1 - 2 - - True @@ -376,6 +363,50 @@ You can set these values via the Geography View by searching the place, or via a 5 + + + True + False + + + True + True + The name of this place. + True + + + + False + True + 0 + + + + + True + True + True + Invoke place name editor. + + + True + False + gtk-edit + + + + + False + True + 1 + + + + + 1 + 2 + + diff --git a/gramps/gui/glade/editplaceref.glade b/gramps/gui/glade/editplaceref.glade index b476aeea4..64c9ed66c 100644 --- a/gramps/gui/glade/editplaceref.glade +++ b/gramps/gui/glade/editplaceref.glade @@ -386,19 +386,6 @@ 4 - - - True - True - The name of this place. - True - - - - 1 - 2 - - True @@ -534,6 +521,50 @@ You can set these values via the Geography View by searching the place, or via a 5 + + + True + False + + + True + True + The name of this place. + True + + + + False + True + 0 + + + + + True + True + True + + + True + False + Invoke place name editor. + gtk-edit + + + + + False + True + 1 + + + + + 1 + 2 + +