diff options
author | Philipp Hörist <philipp@hoerist.com> | 2018-11-11 12:48:43 +0300 |
---|---|---|
committer | Philipp Hörist <philipp@hoerist.com> | 2018-11-11 12:48:43 +0300 |
commit | c2ee1b526150817f10927ff3865b704175bd1cfe (patch) | |
tree | c3104e902dc6b934127477ad60c6ca542523b24d /pgp | |
parent | 2369f11adb5bc4ea224c58fb1f0eb170691ac001 (diff) |
[pgp] Fix filetransfer
Diffstat (limited to 'pgp')
-rw-r--r-- | pgp/pgpplugin.py | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/pgp/pgpplugin.py b/pgp/pgpplugin.py index af7d7f2..82e8e57 100644 --- a/pgp/pgpplugin.py +++ b/pgp/pgpplugin.py @@ -27,12 +27,15 @@ import queue import nbxmpp from gi.repository import GLib -from gajim import dialogs from gajim.common import app from gajim.common.connection_handlers_events import MessageNotSentEvent from gajim.plugins import GajimPlugin from gajim.plugins.plugins_i18n import _ +from gajim.gtk.dialogs import ErrorDialog +from gajim.gtk.dialogs import InformationDialog +from gajim.gtk.dialogs import YesNoDialog + log = logging.getLogger('gajim.plugin_system.oldpgp') ERROR_MSG = '' @@ -108,19 +111,19 @@ class OldPGPPlugin(GajimPlugin): key_id = chat_control.contact.keyID transient = chat_control.parent_win.window authenticated, info = check_state(key_id, account) - dialogs.InformationDialog(authenticated, info, transient) + InformationDialog(authenticated, info, transient) @staticmethod def _before_sendmessage(chat_control): account = chat_control.account if not chat_control.contact.keyID: - dialogs.ErrorDialog( + ErrorDialog( _('No OpenPGP key assigned'), _('No OpenPGP key is assigned to this contact. So you cannot ' 'encrypt messages with OpenPGP.')) chat_control.sendmessage = False elif not app.config.get_per('accounts', account, 'keyid'): - dialogs.ErrorDialog( + ErrorDialog( _('No OpenPGP key assigned'), _('No OpenPGP key is assigned to your account. So you cannot ' 'encrypt messages with OpenPGP.')) @@ -213,7 +216,7 @@ class OldPGPPlugin(GajimPlugin): self._finished_encrypt( obj, msgenc=msgenc, error=error, conn=conn) - dialogs.YesNoDialog( + YesNoDialog( _('Untrusted OpenPGP key'), _('The OpenPGP key used to encrypt this chat is not ' 'trusted. Do you really want to encrypt this ' @@ -269,7 +272,7 @@ class OldPGPPlugin(GajimPlugin): def _encrypt_file_thread(self, file, account, callback): my_key_id = app.config.get_per('accounts', account, 'keyid') - key_list = [file.control.contact.keyID, my_key_id] + key_list = [file.contact.keyID, my_key_id] encrypted = self.get_gpg(account).encrypt_file(file.get_data(), key_list) if not encrypted: @@ -286,8 +289,7 @@ class OldPGPPlugin(GajimPlugin): @staticmethod def _on_file_encryption_error(file, error): - dialogs.ErrorDialog( - _('Error'), error, transient_for=file.control.parent_win.window) + ErrorDialog(_('Error'), error) @staticmethod def cleanup_stanza(obj): |