* 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
This commit is contained in:
Don Allingham 2006-11-07 01:29:15 +00:00
parent 0b11bd37b1
commit 55daa2ec2d
3 changed files with 8 additions and 6 deletions

View File

@ -1,4 +1,6 @@
2006-11-06 Don Allingham <don@gramps-project.org>
* 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

View File

@ -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

View File

@ -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):
"""