Welcome to mirror list, hosted at ThFree Co, Russian Federation.

dev.gajim.org/gajim/gajim-plugins.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Hörist <philipp@hoerist.com>2018-11-11 12:48:43 +0300
committerPhilipp Hörist <philipp@hoerist.com>2018-11-14 00:08:25 +0300
commited9c82a7349616ed640417f65d8f692ab81bab8a (patch)
tree91c05ce0bffaf67872a15856d87280e48d2e1b4d
parent820515fe316e2a182ebc2131c0fb36bead7528ad (diff)
[pgp] Fix filetransfer
-rw-r--r--pgp/pgpplugin.py18
1 files changed, 10 insertions, 8 deletions
diff --git a/pgp/pgpplugin.py b/pgp/pgpplugin.py
index a31c0ac..22cd5b6 100644
--- a/pgp/pgpplugin.py
+++ b/pgp/pgpplugin.py
@@ -25,12 +25,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 = ''
@@ -106,19 +109,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.'))
@@ -211,7 +214,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 '
@@ -267,7 +270,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:
@@ -284,8 +287,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):