def cb_clipboard_uri_received(self, clipboard, targets, data): """Callback for when URIs are received from clipboard""" shred_paths = None if Gdk.atom_intern_static_string('text/uri-list') in targets: # Linux shred_uris = clipboard.wait_for_contents( Gdk.atom_intern_static_string('text/uri-list')).get_uris() shred_paths = FileUtilities.uris_to_paths(shred_uris) elif Gdk.atom_intern_static_string('FileNameW') in targets: # Windows # Use non-GTK+ functions because because GTK+ 2 does not work. shred_paths = Windows.get_clipboard_paths() if shred_paths: GUI.shred_paths(self._window, shred_paths) else: logger.warning(_('No paths found in clipboard.'))
def cb_clipboard_uri_received(self, clipboard, targets, data): """Callback for when URIs are received from clipboard""" shred_paths = None if 'text/uri-list' in targets: # Linux shred_uris = clipboard.wait_for_contents( 'text/uri-list').get_uris() shred_paths = FileUtilities.uris_to_paths(shred_uris) elif 'FileNameW' in targets: # Windows # Use non-GTK+ functions because because GTK+ 2 does not work. shred_paths = Windows.get_clipboard_paths() if shred_paths: self.shred_paths(shred_paths) else: logger.warning(_('No paths found in clipboard.'))
def cb_drag_data_received(widget, _context, _x, _y, data, info, _time): if info == 80: uris = data.get_uris() paths = FileUtilities.uris_to_paths(uris) self.shred_paths(paths)
def cb_drag_data_received(self, widget, context, x, y, selection, target_type, time): if target_type == self.TARGET_TYPE_TEXT: file_uris = selection.get_uris() file_paths = FileUtilities.uris_to_paths(file_uris) self.shred_paths(file_paths)
def cb_drag_data_received(widget, context, x, y, data, info, time): if info == 80: uris = data.get_uris() paths = FileUtilities.uris_to_paths(uris) self.shred_paths(paths)