* src/gramps.glade: Define handler for the gallery's Edit button.

* src/EditSource.py: Connect callback to the gallery's Edit button.
* src/ImageSelect.py: Remember old photo list.
* src/EditPlace.py: Revert photos on Cancel.
* src/EditPerson.py: Revert photos on Cancel.
* src/Marriage.py: Revert photos on Cancel.


svn: r2783
This commit is contained in:
Alex Roitman
2004-02-06 20:57:01 +00:00
parent 8b2c96cfa0
commit 4b908898fb
7 changed files with 42 additions and 14 deletions

View File

@ -241,13 +241,14 @@ class Gallery(ImageSelect):
_iconlist_refs.append(icon_list)
self.in_event = 0
# Remember arguments
self.path = path;
self.dataobj = dataobj;
self.iconlist = icon_list;
self.root = self.iconlist.root()
self.old_photo_list = self.dataobj.getPhotoList()[:]
# Local object variables
self.y = 0
self.remember_x = -1
@ -257,7 +258,7 @@ class Gallery(ImageSelect):
self.sel = None
self.photo = None
def close(self):
def close(self,ok=0):
self.iconlist.hide()
for a in self.canvas_list.values():
a[0].destroy()
@ -265,6 +266,12 @@ class Gallery(ImageSelect):
a[2].destroy()
self.p_map = None
self.canvas_list = None
# restore old photo list, in case we removed some and then
# hit cancel button or closed the window
if not ok:
if self.old_photo_list is not None:
self.dataobj.setPhotoList(self.old_photo_list)
def on_canvas1_event(self,obj,event):
"""