Philipp Hörist pushed to branch master at gajim / gajim
Commits: 8dc8cfbf by Marcin Mielniczuk at 2021-11-29T20:13:38+01:00 Drag & Drop: Show info message if paths are skipped Related to #10544 - - - - - 2 changed files: - gajim/chat_control_base.py - gajim/common/helpers.py Changes: ===================================== gajim/chat_control_base.py ===================================== @@ -965,12 +965,13 @@ def _on_drag_motion(self, *args): self.xml.drop_area.set_no_show_all(False) self.xml.drop_area.show_all() - def drag_data_file_transfer(self, selection): + def drag_data_file_transfer(self, selection: Gtk.SelectionData) -> None: # we may have more than one file dropped uri_splitted = selection.get_uris() for uri in uri_splitted: path = helpers.get_file_path_from_dnd_dropped_uri(uri) if not os.path.isfile(path): # is it a file? + self.add_info_message(_("The following file could not be accessed and was not uploaded: ") + path) continue self._start_filetransfer(path) ===================================== gajim/common/helpers.py ===================================== @@ -352,7 +352,7 @@ def build_command(executable, parameter): command = '%s "%s"' % (executable, parameter) return command -def get_file_path_from_dnd_dropped_uri(uri): +def get_file_path_from_dnd_dropped_uri(uri: str) -> str: path = urllib.parse.unquote(uri) # escape special chars path = path.strip('\r\n\x00') # remove \r\n and NULL # get the path to file View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/8dc8cfbfa8d4ddf111c68495febb91aac5ac10b5 -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/8dc8cfbfa8d4ddf111c68495febb91aac5ac10b5 You're receiving this email because of your account on dev.gajim.org.
_______________________________________________ Commits mailing list Commits@gajim.org https://lists.gajim.org/cgi-bin/listinfo/commits