diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 1c6e9ad64..a7a6b3b14 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,4 +1,6 @@ 2006-11-06 Don Allingham + * src/DataViews/_MediaView.py: cancel drag-n-drop if list is empty + * src/PageView.py: cancel drag-n-drop if list is empty * src/ViewManager.py (ViewManager.about): destroy About dialog after running * src/Editors/_EditPerson.py: Change Unknown Gender dialog to allow diff --git a/gramps2/src/DataViews/_MediaView.py b/gramps2/src/DataViews/_MediaView.py index 4e3b18da0..a82a46d24 100644 --- a/gramps2/src/DataViews/_MediaView.py +++ b/gramps2/src/DataViews/_MediaView.py @@ -130,9 +130,9 @@ class MediaView(PageView.ListView): """ selected_ids = self.selected_handles() - - data = (self.drag_info().drag_type, id(self), selected_ids[0], 0) - sel_data.set(sel_data.target, 8 ,pickle.dumps(data)) + if selected_ids: + data = (self.drag_info().drag_type, id(self), selected_ids[0], 0) + sel_data.set(sel_data.target, 8 ,pickle.dumps(data)) def drag_info(self): return DdTargets.MEDIAOBJ diff --git a/gramps2/src/PageView.py b/gramps2/src/PageView.py index 0239eaa59..f13aa1aa0 100644 --- a/gramps2/src/PageView.py +++ b/gramps2/src/PageView.py @@ -575,9 +575,9 @@ class ListView(BookMarkView): def drag_data_get(self, widget, context, sel_data, info, time): selected_ids = self.selected_handles() - data = (self.drag_info().drag_type, id(self), selected_ids[0], 0) - - sel_data.set(sel_data.target, 8 ,pickle.dumps(data)) + if selected_ids: + data = (self.drag_info().drag_type, id(self), selected_ids[0], 0) + sel_data.set(sel_data.target, 8 ,pickle.dumps(data)) def setup_filter(self): """