8057: Remove auto-update of place titles

This commit is contained in:
Nick Hall 2015-01-23 19:52:41 +00:00
parent 28bc8ba590
commit 3a0f699fae
2 changed files with 3 additions and 18 deletions

View File

@ -58,10 +58,9 @@ class PlaceRefEmbedList(EmbeddedList):
(_('Date'), 3, 150, TEXT_COL, -1, None), (_('Date'), 3, 150, TEXT_COL, -1, None),
] ]
def __init__(self, dbstate, uistate, track, data, handle, callback): def __init__(self, dbstate, uistate, track, data, handle):
self.data = data self.data = data
self.handle = handle self.handle = handle
self.callback = callback
EmbeddedList.__init__(self, dbstate, uistate, track, EmbeddedList.__init__(self, dbstate, uistate, track,
_('Enclosed By'), PlaceRefModel, _('Enclosed By'), PlaceRefModel,
move_buttons=True) move_buttons=True)
@ -99,7 +98,3 @@ class PlaceRefEmbedList(EmbeddedList):
def edit_callback(self, name): def edit_callback(self, name):
self.rebuild() self.rebuild()
def post_rebuild(self, prebuildpath):
if prebuildpath is not None:
self.callback()

View File

@ -113,8 +113,7 @@ class EditPlace(EditPrimary):
self.name = MonitoredEntry(self.top.get_object("name_entry"), self.name = MonitoredEntry(self.top.get_object("name_entry"),
self.obj.set_name, self.obj.get_name, 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.gid = MonitoredEntry(self.top.get_object("gid"),
self.obj.set_gramps_id, self.obj.set_gramps_id,
@ -166,14 +165,6 @@ class EditPlace(EditPrimary):
return ValidationError(_("Invalid longitude (syntax: 18\u00b09'") + return ValidationError(_("Invalid longitude (syntax: 18\u00b09'") +
_('48.21"E, -18.2412 or -18:9:48.21)')) _('48.21"E, -18.2412 or -18:9:48.21)'))
def update_title(self):
new_name = ', '.join(get_location_list(self.db, self.obj))
self.top.get_object("place_title").set_text(new_name)
self.obj.set_title(new_name)
def name_changed(self, obj):
self.update_title()
def build_menu_names(self, place): def build_menu_names(self, place):
return (_('Edit Place'), self.get_menu_title()) return (_('Edit Place'), self.get_menu_title())
@ -189,8 +180,7 @@ class EditPlace(EditPrimary):
self.uistate, self.uistate,
self.track, self.track,
self.obj.get_placeref_list(), self.obj.get_placeref_list(),
self.obj.handle, self.obj.handle)
self.update_title)
self._add_tab(notebook, self.placeref_list) self._add_tab(notebook, self.placeref_list)
self.track_ref_for_deletion("placeref_list") self.track_ref_for_deletion("placeref_list")