* src/ImageSelect.py (item_event): Do nothing if nothing is selected.

* src/EditSource.py (button_press): Return if no data.
* src/Sources.py (drag_data_get): Return if no data.
* src/EditPerson.py (ev_drag_data_get,name_drag_data_get):
Return if no data.
* src/EditPlace.py (url_source_drag_data_get): Properly obtain data;
return if no data.


svn: r4655
This commit is contained in:
Alex Roitman 2005-05-23 02:28:17 +00:00
parent 2d4024eb0e
commit f5131a3b82
6 changed files with 32 additions and 12 deletions

View File

@ -1,3 +1,12 @@
2005-05-22 Alex Roitman <shura@gramps-project.org>
* src/ImageSelect.py (item_event): Do nothing if nothing is selected.
* src/EditSource.py (button_press): Return if no data.
* src/Sources.py (drag_data_get): Return if no data.
* src/EditPerson.py (ev_drag_data_get,name_drag_data_get):
Return if no data.
* src/EditPlace.py (url_source_drag_data_get): Properly obtain data;
return if no data.
2005-05-22 Julio Sanchez <jsanchez@users.sourceforge.net>
* src/po/es.po: Updated translation for filters, tips still pending

View File

@ -828,7 +828,8 @@ class EditPerson:
def name_drag_data_get(self,widget, context, sel_data, info, time):
name = self.ntree.get_selected_objects()
if not name:
return
bits_per = 8; # we're going to pass a string
pickled = pickle.dumps(name[0]);
data = str((DdTargets.NAME.drag_type,self.person.get_handle(),pickled));
@ -900,7 +901,8 @@ class EditPerson:
def ev_drag_data_get(self,widget, context, sel_data, info, time):
ev = self.etree.get_selected_objects()
if not ev:
return
bits_per = 8; # we're going to pass a string
pickled = pickle.dumps(ev[0]);
data = str((DdTargets.EVENT.drag_type,self.person.get_handle(),pickled));

View File

@ -314,11 +314,14 @@ class EditPlace:
self.redraw_url_list()
def url_source_drag_data_get(self,widget, context, sel_data, info, time):
ev = self.web_model.get_selected_objects()[0]
store,node = self.web_list.get_selection().get_selected()
if not node:
return
row = store.get_path(node)
url = self.ulist[row[0]]
bits_per = 8; # we're going to pass a string
pickled = pickle.dumps(ev);
data = str(('url',self.place.get_handle(),pickled));
pickled = pickle.dumps(url)
data = str(('url',self.place.get_handle(),pickled))
sel_data.set(sel_data.target, bits_per, data)
def update_lists(self):

View File

@ -255,16 +255,18 @@ class EditSource:
def button_press(self,obj):
data = self.model.get_selected_objects()
(type,handle) = data[0]
if type == 0:
if not data:
return
(data_type,handle) = data[0]
if data_type == 0:
import EditPerson
person = self.db.get_person_from_handle(handle)
EditPerson.EditPerson(self.parent,person,self.db)
elif type == 1:
elif data_type == 1:
import Marriage
family = self.db.get_family_from_handle(handle)
Marriage.Marriage(self.parent,family,self.db)
elif type == 2:
elif data_type == 2:
import EventEdit
event = self.db.get_event_from_handle(handle)
event_name = event.get_name()
@ -280,11 +282,11 @@ class EditSource:
EventEdit.EventEditor(
self,", ", const.personalEvents, const.personal_events,
event, None, 1, None, None, self.db.readonly)
elif type == 3:
elif data_type == 3:
import EditPlace
place = self.db.get_place_from_handle(handle)
EditPlace.EditPlace(self.parent,place)
elif type == 5:
elif data_type == 5:
import ImageSelect
media = self.db.get_object_from_handle(handle)
ImageSelect.GlobalMediaProperties(self.db,media,self)

View File

@ -291,6 +291,8 @@ class Gallery(ImageSelect):
self.drag_item = widget.get_item_at(self.remember_x,
self.remember_y)
icon_index = self.get_index(widget,event.x,event.y)-1
if icon_index == -1:
return
self.sel_obj = self.dataobj.get_media_list()[icon_index]
if self.drag_item:
widget.drag_begin([DdTargets.MEDIAOBJ.target()]+_drag_targets,

View File

@ -286,6 +286,8 @@ class SourceTab:
def drag_data_get(self,widget, context, sel_data, info, time):
store,node = self.selection.get_selected()
if not node:
return
ev = store.get_value(node,2)
bits_per = 8; # we're going to pass a string