From 6c1cceed825b4f2686431077e81568c1c9c50171 Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Tue, 17 Dec 2002 05:12:28 +0000 Subject: [PATCH] Hold onto iconlists to keep from crashing while program is active svn: r1224 --- src/ImageSelect.py | 13 ++++++- src/PlaceView.py | 92 +++++++++++++++++++-------------------------- src/gramps.zodb | Bin 13401 -> 13401 bytes 3 files changed, 50 insertions(+), 55 deletions(-) diff --git a/src/ImageSelect.py b/src/ImageSelect.py index b8e7d346e..dfc5c94fd 100644 --- a/src/ImageSelect.py +++ b/src/ImageSelect.py @@ -64,6 +64,9 @@ _IMAGEX = 140 _IMAGEY = 150 _PAD = 5 + +_iconlist_refs = [] + #------------------------------------------------------------------------- # # ImageSelect class @@ -217,6 +220,8 @@ class Gallery(ImageSelect): icon_list.connect("drag_data_get", self.on_photolist_drag_data_get) + _iconlist_refs.append(icon_list) + # Remember arguments self.path = path; self.dataobj = dataobj; @@ -235,9 +240,13 @@ class Gallery(ImageSelect): def close(self): self.iconlist.hide() - self.canvas_list = None + for a in self.canvas_list: + a[0].destroy() + a[1].destroy() + a[2].destroy() + self.p_map = None -# gc.collect() + self.canvas_list = None self.iconlist.destroy() def on_canvas1_event(self,obj,event): diff --git a/src/PlaceView.py b/src/PlaceView.py index 4148283ec..150053405 100644 --- a/src/PlaceView.py +++ b/src/PlaceView.py @@ -142,17 +142,12 @@ class PlaceView: def button_press(self,obj,event): if event.type == gtk.gdk._2BUTTON_PRESS and event.button == 1: - store,iter = self.selection.get_selected() - id = store.get_value(iter,1) - - place = self.db.getPlace(id) - EditPlace.EditPlace(self,place,self.update_display) + mlist = [] + self.selection.selected_foreach(self.blist,mlist) + if mlist: + EditPlace.EditPlace(self,mlist[0],self.update_display) return 1 -# def insert_place(self,place): -# self.place_list.append(place.getDisplayInfo()) -# self.place_list.set_row_data(self.place_list.rows-1,place.getId()) - def new_place_after_edit(self,place): self.db.addPlace(place) self.update(0) @@ -165,57 +160,48 @@ class PlaceView: def on_add_place_clicked(self,obj): EditPlace.EditPlace(self,Place(),self.new_place_after_edit) -# def moveto(self,row): -# self.place_list.unselect_all() -# self.place_list.select_row(row,0) -# self.place_list.moveto(row) - def on_delete_clicked(self,obj): - store,iter = self.selection.get_selected() - if not iter: - return - - id = store.get_value(iter,1) + mlist = [] + self.selection.selected_foreach(self.blist,mlist) - used = 0 - place = self.db.getPlace(id) - for key in self.db.getPersonKeys(): - 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 place in mlist: + for key in self.db.getPersonKeys(): + 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(): - event_list = f.getEventList() - if f.getLdsSeal(): - event_list.append(f.getLdsSeal()) - for event in event_list: - if event.getPlace() == place: - used = 1 + for f in self.db.getFamilyMap().values(): + event_list = f.getEventList() + if f.getLdsSeal(): + event_list.append(f.getLdsSeal()) + for event in event_list: + if event.getPlace() == place: + used = 1 - if used == 1: - ans = EditPlace.DeletePlaceQuery(place,self.db,self.update_display) - QuestionDialog(_('Delete Place'), - _("This place is currently being used. Delete anyway?"), - ans.query_response) - else: - self.db.removePlace(place.getId()) - self.update(0) - Utils.modified() + if used == 1: + ans = EditPlace.DeletePlaceQuery(place,self.db,self.update_display) + QuestionDialog(_('Delete Place'), + _("%s is currently being used.\nDelete anyway?" % place.get_title()), + ans.query_response) + else: + self.db.removePlace(place.getId()) + self.update(0) + Utils.modified() def on_edit_clicked(self,obj): """Display the selected places in the EditPlace display""" - list_store, iter = self.selection.get_selected() - if iter: - id = list_store.get_value(iter,1) - place = self.db.getPlace(id) + mlist = [] + self.selection.selected_foreach(self.blist,mlist) + + for place in mlist: EditPlace.EditPlace(self, place, self.update_display) def blist(self,store,path,iter,list): diff --git a/src/gramps.zodb b/src/gramps.zodb index d7f7a315e2068d8688d71626acb7516bb7ac8f86..ad3e9f9b8b45e0a21955cc38fbf2eb4a35b068a3 100644 GIT binary patch literal 13401 zcmeHNU2I%O6`u9)*g;{FwA3X9E`^6J0<$4;yL~}%R8fZ#XVYedQ&c54_H}lZ_3qx? zYwW$Hl97-wJhVal)Cn(+1giVCp{f)Fv|FIy^3yK=u7rezcrf(E1tEo>3cl~ojPKoz zU79{1f$m7-nfc~BbIzP|=G={x7cYH$pGXQ}`XHv9zrgXZ5Pwf_61Ug`u?J!g#2$z} z5PKl@K z((?+dU_OT4_?|E2^qjOWZ`{KD&wfY<5~tBA+jzb%FFZCUn;6L>MqaepuO<$1J&C`R z{UADd-549+ReBdO5}SZNz+(9azU00=x__MOS2|=TU}puL95%|TS@_rf!l43J_rX^@ z^fmn72=Yb=etk}ELT7pY-~nQR4*)MguenF7az9ZTwoJ-SdWBq=mW8-99roUL1*S;P4dHtDs zU{~}!&J#Bak@=l3^G)Sb%PU(SvAw)gRZoLD8b48f7B9n(Gm1yqF|0FlYLC1X=xko` zrBkhyOQ$D`#HPT@qo>dpble(CDi1a_uIl&FgkJl^OP|7) z5IXOp@9hlaxOE1d=ZQ66uKgLd9P{N0_5zHANZSdMkX-?f_6+H}o%wxTu4d+C@-J$n zEbnDKr`}QPPwKvr?X zk>i!e=OjlQeVu*VV#piHE+Yo4H=F-Z=Mv*O{ZF;7JfL)3z?$b@eXSn6CGv*8qx2>A zC_fTgzKH|m5ewc~p%mDgz3t&3mKOLye#6EF-Y9u#Gg7K5deR02(nh3;!By8Bhwn`J%epBK*eh zi(!&yzAtwGOv4Yvm|v`IN%+LX%^MjJ8C_2s$V2k77&pOTU1uYvX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