def on_drag_data_received(self, widget, context, x, y, data, info, time):
'''????'''
if not data:
return
bx, by = self.iconview.convert_widget_to_bin_window_coords(x, y)
selected = Gtk.TreeView.get_path_at_pos(self.iconview, bx, by)
if not selected:
return
tree_path = selected[0]
if tree_path is None:
return
target_path = self.liststore[tree_path][PATH_COL]
is_dir = self.liststore[tree_path][ISDIR_COL]
if not is_dir or info != TargetInfo.PLAIN_TEXT:
return
filelist_str = data.get_text()
filelist = json.loads(filelist_str)
for file_item in filelist:
if file_item['path'] == target_path:
self.app.toast(_('Error: Move folder to itself!'))
return
for file_item in filelist:
file_item['dest'] = target_path
gutil.async_call(pcs.move, self.app.cookie, self.app.tokens, filelist,
callback=self.parent.reload)
评论列表
文章目录