diff options
author | Philipp Hörist <forenjunkie@chello.at> | 2017-06-09 23:36:15 +0300 |
---|---|---|
committer | Philipp Hörist <forenjunkie@chello.at> | 2017-06-10 00:35:32 +0300 |
commit | c406ebb55cebc3fc5c3d744322da8cc7132169e8 (patch) | |
tree | 9a9dfec8f1d6ce596afd308f337ad1ab29b55046 /httpupload | |
parent | 378964fe205ab43108e64c34d8b90bd3afbbc303 (diff) |
[httpupload] Move method to the top
Diffstat (limited to 'httpupload')
-rw-r--r-- | httpupload/httpupload.py | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/httpupload/httpupload.py b/httpupload/httpupload.py index d538a8c..8d2c178 100644 --- a/httpupload/httpupload.py +++ b/httpupload/httpupload.py @@ -163,6 +163,17 @@ class Base(object): log.info('Encryption is: %s', chat_control.encryption or 'disabled') return chat_control.encryption is not None + def on_file_button_clicked(self, widget, chat_control): + FileChooserDialog( + on_response_ok=lambda widget: self.on_file_dialog_ok(widget, + chat_control), + title_text=_('Choose file to send'), + action=Gtk.FileChooserAction.OPEN, + buttons=(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL, + Gtk.STOCK_OPEN, Gtk.ResponseType.OK), + default_response=Gtk.ResponseType.OK, + transient_for=chat_control.parent_win.window) + def on_file_dialog_ok(self, widget, chat_control): path = widget.get_filename() widget.destroy() @@ -208,17 +219,6 @@ class Base(object): else: self.request_slot(file) - def on_file_button_clicked(self, widget, chat_control): - FileChooserDialog( - on_response_ok=lambda widget: self.on_file_dialog_ok(widget, - chat_control), - title_text=_('Choose file to send'), - action=Gtk.FileChooserAction.OPEN, - buttons=(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL, - Gtk.STOCK_OPEN, Gtk.ResponseType.OK), - default_response=Gtk.ResponseType.OK, - transient_for=chat_control.parent_win.window) - def encrypt_file(self, file): GLib.idle_add(file.progress.label.set_text, _('Encrypting file...')) encryption = file.control.encryption |