From 64f67aa20456b4f6f4bcdba8ad7f12fd6a38d352 Mon Sep 17 00:00:00 2001 From: Nick Hall Date: Wed, 5 Dec 2012 12:32:34 +0000 Subject: [PATCH] Bug fixes svn: r20767 --- gramps/gui/editors/editplace.py | 2 +- gramps/gui/undohistory.py | 2 +- gramps/gui/views/treemodels/locationmodel.py | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/gramps/gui/editors/editplace.py b/gramps/gui/editors/editplace.py index 90ada8f73..7a71b9bb3 100644 --- a/gramps/gui/editors/editplace.py +++ b/gramps/gui/editors/editplace.py @@ -253,7 +253,7 @@ class EditPlace(EditPrimary): with DbTxn(_('Add location'), self.dbstate.db) as trans: for loc_type, name in new_locations: new_location = Location() - new_location.parent = handle + new_location.parent = str(handle) new_location.name = name new_location.set_type(loc_type) handle = self.dbstate.db.add_location(new_location, trans) diff --git a/gramps/gui/undohistory.py b/gramps/gui/undohistory.py index 457128478..a1ea2aabb 100644 --- a/gramps/gui/undohistory.py +++ b/gramps/gui/undohistory.py @@ -119,7 +119,7 @@ class UndoHistory(ManagedWindow): def _selection_changed(self, obj): (model, node) = self.selection.get_selected() - if not node: + if not node or len(self.model) == 1: return path = self.model.get_path(node) start = min(path[0], self.undodb.undo_count) diff --git a/gramps/gui/views/treemodels/locationmodel.py b/gramps/gui/views/treemodels/locationmodel.py index 42dec59a3..06797be45 100644 --- a/gramps/gui/views/treemodels/locationmodel.py +++ b/gramps/gui/views/treemodels/locationmodel.py @@ -153,16 +153,16 @@ class LocationBaseModel(object): return "%012x" % data[6] def column_change(self, data): - return Utils.format_time(data[6]) + return format_time(data[6]) def column_place_name(self, data): return unicode(data[2]) def sort_place_change(self, data): - return "%012x" % data[9] + return "%012x" % data[6] def column_place_change(self, data): - return Utils.format_time(data[9]) + return Utils.format_time(data[6]) #------------------------------------------------------------------------- #