diff --git a/src/filetransfers_window.py b/src/filetransfers_window.py index ce512a09de429024e3bfb6fd1bdce413c3d823a4..bb1402b065bc9eca49fa6c37431022ee21a31d60 100644 --- a/src/filetransfers_window.py +++ b/src/filetransfers_window.py @@ -202,6 +202,7 @@ def show_file_send_request(self, account, contact): butt = dialog.add_button(_('Send'), gtk.RESPONSE_OK) butt.set_use_stock(True) dialog.set_default_response(gtk.RESPONSE_OK) + dialog.set_select_multiple(True) # we can select many files to send if last_send_dir and os.path.isdir(last_send_dir): dialog.set_current_folder(last_send_dir) else: @@ -210,12 +211,14 @@ def show_file_send_request(self, account, contact): file_props = {} response = dialog.run() if response == gtk.RESPONSE_OK: - file_path = unicode(dialog.get_filename(), 'utf-8') - (file_dir, file_name) = os.path.split(file_path) + files_path_list = dialog.get_filenames() + dialog.destroy() + for file_path in files_path_list: + if os.path.isfile(file_path): + file_dir = os.path.dirname(file_path) + self.send_file(account, contact, file_path) if file_dir: gajim.config.set('last_send_dir', file_dir) - dialog.destroy() - self.send_file(account, contact, file_path) else: dialog.destroy() @@ -268,7 +271,7 @@ def show_file_request(self, account, contact, file_props): dialog2 = dialogs.ConfirmationDialog(primtext, sectext) if dialog2.get_response() != gtk.RESPONSE_OK: continue - (file_dir, file_name) = os.path.split(file_path) + file_dir = os.path.dirname(file_path) if file_dir: gajim.config.set('last_save_dir', file_dir) file_props['file-name'] = file_path.decode('utf-8')