From 84cc4768b472f0d32a53bd264ef1af8b58d00a6e Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Thu, 1 Aug 2002 04:16:55 +0000 Subject: [PATCH] Remember image location svn: r1103 --- src/ImageSelect.py | 6 ++++++ src/PlaceView.py | 30 ++++++++++++++++++++---------- 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/src/ImageSelect.py b/src/ImageSelect.py index 5a0319333..5cc6c2509 100644 --- a/src/ImageSelect.py +++ b/src/ImageSelect.py @@ -65,6 +65,8 @@ _ = gettext #------------------------------------------------------------------------- class ImageSelect: + last_path = "" + def __init__(self, path, db, parent): """Creates an edit window. Associates a person with the window.""" self.path = path; @@ -102,6 +104,8 @@ class ImageSelect: "destroy_passed_object" : Utils.destroy_passed_object }) + if ImageSelect.last_path != "": + self.glade.get_widget("photosel").set_default_path(ImageSelect.last_path) window.editable_enters(self.description) window.show() @@ -128,6 +132,8 @@ class ImageSelect: def on_savephoto_clicked(self, obj): """Save the photo in the dataobj object. (Required function)""" filename = self.glade.get_widget("photosel").get_full_path(0) + ImageSelect.last_path = os.path.dirname(filename) + description = self.description.get_text() if os.path.exists(filename) == 0: diff --git a/src/PlaceView.py b/src/PlaceView.py index cefa4ca10..cae09a132 100644 --- a/src/PlaceView.py +++ b/src/PlaceView.py @@ -27,7 +27,6 @@ Handles the place view for GRAMPS. # GTK modules # #------------------------------------------------------------------------- -import GTK import GDK import gnome.ui @@ -110,7 +109,7 @@ class PlaceView: self.place_list.select_row(current_row,0) self.place_list.moveto(current_row) id = self.place_list.get_row_data(current_row) - self.active = self.db.getPlaceMap()[id] + self.active = self.db.getPlace(id) else: self.active = None @@ -119,7 +118,7 @@ class PlaceView: def select_row(self,obj,row,b,c): if row == obj.selection[0]: id = self.place_list.get_row_data(row) - self.active = self.db.getPlaceMap()[id] + self.active = self.db.getPlace(id) def merge(self): if len(self.place_list.selection) != 2: @@ -129,8 +128,8 @@ class PlaceView: import MergeData p1 = self.place_list.get_row_data(self.place_list.selection[0]) p2 = self.place_list.get_row_data(self.place_list.selection[1]) - p1 = self.db.getPlaceMap()[p1] - p2 = self.db.getPlaceMap()[p2] + p1 = self.db.getPlace(p1) + p2 = self.db.getPlace(p2) MergeData.MergePlaces(self.db,p1,p2,self.load_places) def on_button_press_event(self,obj,event): @@ -183,14 +182,25 @@ class PlaceView: index = obj.selection[0] used = 0 - place = self.db.getPlaceMap()[obj.get_row_data(index)] + place = self.db.getPlace(obj.get_row_data(index)) for key in self.db.getPersonKeys(): - p = self.db.getPersonMap()[key] - for event in [p.getBirth(), p.getDeath()] + p.getEventList(): + p = self.db.getPerson[key] + event_list = [p.getBirth(), p.getDeath()] + p.getEventList() + if p.getLdsBaptism(): + event_list.append(p.getLdsBaptism()) + if p.getLdsEndowment(): + event_list.append(p.getLdsEndowment()) + if p.getLdsSeal(): + event_list.append(p.getLdsSeal()) + for event in event_list: if event.getPlace() == place: used = 1 + for f in self.db.getFamilyMap().values(): - for event in f.getEventList(): + event_list = f.getEventList() + if f.getLdsSeal(): + event_list.append(f.getLdsSeal()) + for event in event_list: if event.getPlace() == place: used = 1 @@ -212,7 +222,7 @@ class PlaceView: gnome.ui.GnomeErrorDialog(msg) else: for p in obj.selection: - place = self.db.getPlaceMap()[obj.get_row_data(p)] + place = self.db.getPlace(obj.get_row_data(p)) EditPlace.EditPlace(place,self.db, self.update_display_after_edit)