diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index b11cab81e..caee40077 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,6 +1,7 @@ 2005-12-22 Alex Roitman * test/RunAllTests.py: Change header. * src/EventEdit.py: Fix build_ methods. + * src/MediaView.py: Skip empty selections. 2005-12-22 Don Allingham * src/DisplayState.py: window management improvements diff --git a/gramps2/src/MediaView.py b/gramps2/src/MediaView.py index b77270fc9..15c3b1d61 100644 --- a/gramps2/src/MediaView.py +++ b/gramps2/src/MediaView.py @@ -105,6 +105,8 @@ class MediaView(PageView.ListView): def row_change(self,obj): handle = self.first_selected() + if not handle: + return obj = self.dbstate.db.get_object_from_handle(handle) pix = ImgManip.get_thumbnail_image(obj.get_path()) self.image.set_from_pixbuf(pix) @@ -136,7 +138,8 @@ class MediaView(PageView.ListView): def on_double_click(self,obj,event): handle = self.first_selected() - place = self.dbstate.db.get_place_from_handle(handle) + if handle: + place = self.dbstate.db.get_place_from_handle(handle) #EditPlace.EditPlace(place,self.dbstate, self.uistate) def add(self,obj): @@ -147,6 +150,8 @@ class MediaView(PageView.ListView): def remove(self,obj): handle = self.first_selected() + if not handle: + return the_lists = Utils.get_media_referents(handle,self.dbstate.db) ans = ImageSelect.DeleteMediaQuery(handle,self.dbstate.db,the_lists) @@ -163,6 +168,8 @@ class MediaView(PageView.ListView): def edit(self,obj): handle = self.first_selected() + if not handle: + return obj = self.dbstate.db.get_object_from_handle(handle) if obj.get_mime_type():