From 55daa2ec2db52941e9da8ee9ca43f8cad541b333 Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Tue, 7 Nov 2006 01:29:15 +0000 Subject: [PATCH] * src/DataViews/_MediaView.py: cancel drag-n-drop if list is empty * src/PageView.py: cancel drag-n-drop if list is empty svn: r7571 --- gramps2/ChangeLog | 2 ++ gramps2/src/DataViews/_MediaView.py | 6 +++--- gramps2/src/PageView.py | 6 +++--- 3 files changed, 8 insertions(+), 6 deletions(-) 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): """