Port plugins to new GajimAppWindow
This commit is contained in:
@@ -23,7 +23,7 @@ from pathlib import Path
|
||||
|
||||
from gi.repository import Gtk
|
||||
|
||||
from gajim.gtk.widgets import GajimAppWindow
|
||||
from gajim.gtk.window import GajimAppWindow
|
||||
from gajim.plugins.helpers import get_builder
|
||||
from gajim.plugins.plugins_i18n import _
|
||||
|
||||
@@ -52,6 +52,8 @@ class ConfigDialog(GajimAppWindow):
|
||||
default_height=400,
|
||||
transient_for=transient,
|
||||
modal=True,
|
||||
add_window_padding=True,
|
||||
header_bar=True,
|
||||
)
|
||||
|
||||
ui_path = Path(__file__).parent
|
||||
@@ -69,9 +71,7 @@ class ConfigDialog(GajimAppWindow):
|
||||
self._connect(self._ui.sub_renderer, "edited", self._on_substitute_edited)
|
||||
self._connect(self._ui.add_button, "clicked", self._on_add_clicked)
|
||||
self._connect(self._ui.remove_button, "clicked", self._on_remove_clicked)
|
||||
self._connect(self.window, "close-request", self._on_close_request)
|
||||
|
||||
self.show()
|
||||
self._connect(self, "close-request", self._on_close_request)
|
||||
|
||||
def _cleanup(self) -> None:
|
||||
del self._plugin
|
||||
|
||||
@@ -27,7 +27,7 @@ from nbxmpp import JID
|
||||
from gajim.common import app
|
||||
from gajim.gtk.alert import ConfirmationAlertDialog
|
||||
from gajim.gtk.util.misc import container_remove_all
|
||||
from gajim.gtk.widgets import GajimAppWindow
|
||||
from gajim.gtk.window import GajimAppWindow
|
||||
from gajim.plugins.plugins_i18n import _
|
||||
|
||||
from openpgp.modules.key_store import KeyData
|
||||
@@ -54,9 +54,11 @@ class KeyDialog(GajimAppWindow):
|
||||
default_height=400,
|
||||
transient_for=transient,
|
||||
modal=True,
|
||||
add_window_padding=True,
|
||||
header_bar=True,
|
||||
)
|
||||
|
||||
self.window.add_css_class("openpgp-key-dialog")
|
||||
self.add_css_class("openpgp-key-dialog")
|
||||
|
||||
self._client = app.get_client(account)
|
||||
|
||||
@@ -75,8 +77,6 @@ class KeyDialog(GajimAppWindow):
|
||||
log.info("Load: %s", key.fingerprint)
|
||||
self._listbox.append(KeyRow(key, self))
|
||||
|
||||
self.show()
|
||||
|
||||
def _cleanup(self) -> None:
|
||||
del self._client
|
||||
del self._listbox
|
||||
|
||||
@@ -26,7 +26,7 @@ from gi.repository import Gtk
|
||||
|
||||
from gajim.common import app
|
||||
from gajim.gtk.util.classes import SignalManager
|
||||
from gajim.gtk.widgets import GajimAppWindow
|
||||
from gajim.gtk.window import GajimAppWindow
|
||||
from gajim.plugins.helpers import get_builder
|
||||
from gajim.plugins.plugins_i18n import _
|
||||
|
||||
@@ -53,6 +53,8 @@ class PGPConfigDialog(GajimAppWindow):
|
||||
default_height=500,
|
||||
transient_for=transient,
|
||||
modal=True,
|
||||
add_window_padding=True,
|
||||
header_bar=True,
|
||||
)
|
||||
|
||||
ui_path = Path(__file__).parent
|
||||
|
||||
@@ -28,7 +28,7 @@ from gi.repository import Gtk
|
||||
from nbxmpp import JID
|
||||
|
||||
from gajim.common import app
|
||||
from gajim.gtk.widgets import GajimAppWindow
|
||||
from gajim.gtk.window import GajimAppWindow
|
||||
from gajim.plugins.helpers import get_builder
|
||||
from gajim.plugins.plugins_i18n import _
|
||||
|
||||
@@ -57,9 +57,11 @@ class KeyDialog(GajimAppWindow):
|
||||
default_width=450,
|
||||
transient_for=transient,
|
||||
modal=True,
|
||||
add_window_padding=True,
|
||||
header_bar=True,
|
||||
)
|
||||
|
||||
self.window.set_resizable(True)
|
||||
self.set_resizable(True)
|
||||
|
||||
self._plugin = plugin
|
||||
self._jid = str(jid)
|
||||
@@ -90,9 +92,7 @@ class KeyDialog(GajimAppWindow):
|
||||
del self._module
|
||||
|
||||
def _choose_key(self, _button: Gtk.Button) -> None:
|
||||
ChooseGPGKeyDialog(
|
||||
self._module.pgp_backend.get_keys(), self.window, self._on_response
|
||||
)
|
||||
ChooseGPGKeyDialog(self._module.pgp_backend.get_keys(), self, self._on_response)
|
||||
|
||||
def _load_key(self) -> None:
|
||||
key_data = self._module.get_contact_key_data(self._jid)
|
||||
@@ -135,11 +135,13 @@ class ChooseGPGKeyDialog(GajimAppWindow):
|
||||
default_height=400,
|
||||
transient_for=transient,
|
||||
modal=True,
|
||||
add_window_padding=True,
|
||||
header_bar=True,
|
||||
)
|
||||
|
||||
secret_keys[_("None")] = _("None")
|
||||
|
||||
self.window.set_resizable(True)
|
||||
self.set_resizable(True)
|
||||
|
||||
self._callback = callback
|
||||
self._selected_key = None
|
||||
|
||||
@@ -23,7 +23,7 @@ from pathlib import Path
|
||||
|
||||
from gi.repository import Gtk
|
||||
|
||||
from gajim.gtk.widgets import GajimAppWindow
|
||||
from gajim.gtk.window import GajimAppWindow
|
||||
from gajim.plugins.helpers import get_builder
|
||||
from gajim.plugins.plugins_i18n import _
|
||||
|
||||
@@ -51,6 +51,8 @@ class ConfigDialog(GajimAppWindow):
|
||||
default_height=400,
|
||||
transient_for=transient,
|
||||
modal=True,
|
||||
add_window_padding=True,
|
||||
header_bar=True,
|
||||
)
|
||||
|
||||
ui_path = Path(__file__).parent
|
||||
@@ -67,7 +69,7 @@ class ConfigDialog(GajimAppWindow):
|
||||
self._connect(self._ui.add_button, "clicked", self._on_add_clicked)
|
||||
self._connect(self._ui.remove_button, "clicked", self._on_remove_clicked)
|
||||
self._connect(self._ui.cellrenderer, "edited", self._on_reply_edited)
|
||||
self._connect(self.window, "close-request", self._on_close_request)
|
||||
self._connect(self, "close-request", self._on_close_request)
|
||||
|
||||
self.show()
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ from gi.repository import Gtk
|
||||
from gajim.common.helpers import play_sound_file
|
||||
from gajim.common.util.status import get_uf_show
|
||||
from gajim.gtk.filechoosers import FileChooserButton
|
||||
from gajim.gtk.widgets import GajimAppWindow
|
||||
from gajim.gtk.window import GajimAppWindow
|
||||
from gajim.plugins.helpers import get_builder
|
||||
from gajim.plugins.plugins_i18n import _
|
||||
|
||||
@@ -87,6 +87,8 @@ class ConfigDialog(GajimAppWindow):
|
||||
default_height=800,
|
||||
transient_for=transient,
|
||||
modal=True,
|
||||
add_window_padding=True,
|
||||
header_bar=True,
|
||||
)
|
||||
|
||||
ui_path = Path(__file__).parent
|
||||
@@ -154,7 +156,7 @@ class ConfigDialog(GajimAppWindow):
|
||||
)
|
||||
self._connect(self._ui.command_entry, "changed", self._on_command_entry_changed)
|
||||
self._connect(self._ui.one_shot_cb, "toggled", self._on_one_shot_cb_toggled)
|
||||
self._connect(self.window, "close-request", self._on_close_request)
|
||||
self._connect(self, "close-request", self._on_close_request)
|
||||
|
||||
file_chooser_button = FileChooserButton()
|
||||
self._connect(file_chooser_button, "path-picked", self._on_sound_file_set)
|
||||
|
||||
Reference in New Issue
Block a user