[openpgp] Adapt to Gajim changes

This commit is contained in:
wurstsalat
2021-10-25 20:24:42 +02:00
parent 94914557e0
commit 765a660c38
2 changed files with 3 additions and 7 deletions

View File

@@ -46,7 +46,7 @@ class KeyWizard(Gtk.Assistant):
self._chat_control = chat_control self._chat_control = chat_control
self.set_application(app.app) self.set_application(app.app)
self.set_transient_for(chat_control.parent_win.window) self.set_transient_for(app.window)
self.set_resizable(True) self.set_resizable(True)
self.set_position(Gtk.WindowPosition.CENTER) self.set_position(Gtk.WindowPosition.CENTER)
@@ -79,8 +79,7 @@ class KeyWizard(Gtk.Assistant):
main_box.remove(sidebar) main_box.remove(sidebar)
def _activate_encryption(self): def _activate_encryption(self):
win = self._chat_control.parent_win.window action = app.window.lookup_action(
action = win.lookup_action(
'set-encryption-%s' % self._chat_control.control_id) 'set-encryption-%s' % self._chat_control.control_id)
action.activate(GLib.Variant("s", self._plugin.encryption_name)) action.activate(GLib.Variant("s", self._plugin.encryption_name))

View File

@@ -15,7 +15,6 @@
# along with OpenPGP Gajim Plugin. If not, see <http://www.gnu.org/licenses/>. # along with OpenPGP Gajim Plugin. If not, see <http://www.gnu.org/licenses/>.
import logging import logging
import os
from pathlib import Path from pathlib import Path
from gi.repository import Gtk from gi.repository import Gtk
@@ -26,7 +25,6 @@ from nbxmpp import JID
from gajim.common import app from gajim.common import app
from gajim.common import ged from gajim.common import ged
from gajim.common import configpaths from gajim.common import configpaths
from gajim.common import helpers
from gajim.common.const import CSSPriority from gajim.common.const import CSSPriority
from gajim.gui.dialogs import ErrorDialog from gajim.gui.dialogs import ErrorDialog
@@ -160,10 +158,9 @@ class OpenPGPPlugin(GajimPlugin):
def on_encryption_button_clicked(chat_control): def on_encryption_button_clicked(chat_control):
account = chat_control.account account = chat_control.account
jid = chat_control.contact.jid jid = chat_control.contact.jid
transient = chat_control.parent_win.window
from openpgp.gtk.key import KeyDialog from openpgp.gtk.key import KeyDialog
KeyDialog(account, jid, transient) KeyDialog(account, jid, app.window)
def _before_sendmessage(self, chat_control): def _before_sendmessage(self, chat_control):
account = chat_control.account account = chat_control.account