Changes for gtk3 clipboard to work
svn: r20912
This commit is contained in:
parent
a86b39d078
commit
1c240f9bef
@ -1163,7 +1163,7 @@ class ClipboardListView(object):
|
|||||||
def object_drag_data_get(self, widget, context, sel_data, info, time):
|
def object_drag_data_get(self, widget, context, sel_data, info, time):
|
||||||
tree_selection = widget.get_selection()
|
tree_selection = widget.get_selection()
|
||||||
model, paths = tree_selection.get_selected_rows()
|
model, paths = tree_selection.get_selected_rows()
|
||||||
tgs = context.list_targets()
|
tgs = context.targets
|
||||||
if len(paths) == 1:
|
if len(paths) == 1:
|
||||||
path = paths[0]
|
path = paths[0]
|
||||||
node = model.get_iter(path)
|
node = model.get_iter(path)
|
||||||
@ -1181,7 +1181,7 @@ class ClipboardListView(object):
|
|||||||
time, title=None, value=None, dbid=None,
|
time, title=None, value=None, dbid=None,
|
||||||
dbname=None):
|
dbname=None):
|
||||||
model = widget.get_model()
|
model = widget.get_model()
|
||||||
sel_data = selection.get_data()
|
sel_data = selection.data
|
||||||
# In Windows time is always zero. Until that is fixed, use the seconds
|
# In Windows time is always zero. Until that is fixed, use the seconds
|
||||||
# of the local time to filter out double drops.
|
# of the local time to filter out double drops.
|
||||||
realTime = strftime("%S")
|
realTime = strftime("%S")
|
||||||
@ -1212,7 +1212,7 @@ class ClipboardListView(object):
|
|||||||
if dragtype in self._target_type_to_wrapper_class_map:
|
if dragtype in self._target_type_to_wrapper_class_map:
|
||||||
possible_wrappers = [dragtype]
|
possible_wrappers = [dragtype]
|
||||||
else:
|
else:
|
||||||
tgs = [atm.name() for atm in context.list_targets()]
|
tgs = context.targets
|
||||||
possible_wrappers = [target for target in tgs
|
possible_wrappers = [target for target in tgs
|
||||||
if target in self._target_type_to_wrapper_class_map]
|
if target in self._target_type_to_wrapper_class_map]
|
||||||
|
|
||||||
@ -1246,7 +1246,7 @@ class ClipboardListView(object):
|
|||||||
data = [o.__class__.DRAG_TARGET.drag_type, o, None,
|
data = [o.__class__.DRAG_TARGET.drag_type, o, None,
|
||||||
o._type, o._value, o._dbid, o._dbname]
|
o._type, o._value, o._dbid, o._dbname]
|
||||||
contains = model_contains(model, data)
|
contains = model_contains(model, data)
|
||||||
if context.get_actions() != Gdk.DragAction.MOVE and contains:
|
if context.action != Gdk.DragAction.MOVE and contains:
|
||||||
continue
|
continue
|
||||||
drop_info = widget.get_dest_row_at_pos(x, y)
|
drop_info = widget.get_dest_row_at_pos(x, y)
|
||||||
if drop_info:
|
if drop_info:
|
||||||
@ -1263,7 +1263,7 @@ class ClipboardListView(object):
|
|||||||
# FIXME: there is one bug here: if you multi-select and drop
|
# FIXME: there is one bug here: if you multi-select and drop
|
||||||
# on self, then it moves the first, and copies the rest.
|
# on self, then it moves the first, and copies the rest.
|
||||||
|
|
||||||
if context.get_actions() == Gdk.DragAction.MOVE:
|
if context.action == Gdk.DragAction.MOVE:
|
||||||
context.finish(True, True, time)
|
context.finish(True, True, time)
|
||||||
|
|
||||||
# remember time for double drop workaround.
|
# remember time for double drop workaround.
|
||||||
|
Loading…
Reference in New Issue
Block a user