Allow multiple file uploads

Fixes #8957
This commit is contained in:
Philipp Hörist 2018-03-17 20:44:14 +01:00
parent a5db65703b
commit 9de427f6fa
1 changed files with 8 additions and 6 deletions

View File

@ -1154,20 +1154,22 @@ class Interface:
action=Gtk.FileChooserAction.OPEN, action=Gtk.FileChooserAction.OPEN,
buttons=(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL, buttons=(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL,
Gtk.STOCK_OPEN, Gtk.ResponseType.OK), Gtk.STOCK_OPEN, Gtk.ResponseType.OK),
select_multiple=True,
default_response=Gtk.ResponseType.OK, default_response=Gtk.ResponseType.OK,
transient_for=chat_control.parent_win.window) transient_for=chat_control.parent_win.window)
@staticmethod @staticmethod
def on_file_dialog_ok(widget, chat_control): def on_file_dialog_ok(widget, chat_control):
path = widget.get_filename() paths = widget.get_filenames()
widget.destroy() widget.destroy()
con = app.connections[chat_control.account] con = app.connections[chat_control.account]
groupchat = chat_control.type_id == message_control.TYPE_GC groupchat = chat_control.type_id == message_control.TYPE_GC
con.check_file_before_transfer(path, for path in paths:
chat_control.encryption, con.check_file_before_transfer(path,
chat_control.contact, chat_control.encryption,
chat_control.session, chat_control.contact,
groupchat) chat_control.session,
groupchat)
def encrypt_file(self, file, callback): def encrypt_file(self, file, callback):
app.nec.push_incoming_event(HTTPUploadProgressEvent( app.nec.push_incoming_event(HTTPUploadProgressEvent(