Daniel Brötzmann pushed to branch master at gajim / gajim


Commits:
a5212aeb by wurstsalat at 2025-06-24T20:48:27+02:00
cfix: Settings: Update value after closing DialogSetting

- - - - -
caca1ab7 by wurstsalat at 2025-06-24T20:55:40+02:00
refactor: Plugins: Replace Pixbuf with Paintable

- - - - -
d7d39599 by wurstsalat at 2025-06-24T20:58:39+02:00
cfix: Plugins: Fix leak

- - - - -


2 changed files:

- gajim/gtk/plugins.py
- gajim/gtk/settings.py


Changes:

=====================================
gajim/gtk/plugins.py
=====================================
@@ -9,7 +9,7 @@
 from pathlib import Path
 
 from gi.repository import Adw
-from gi.repository import GdkPixbuf
+from gi.repository import Gdk
 from gi.repository import Gio
 from gi.repository import GLib
 from gi.repository import Gtk
@@ -93,6 +93,7 @@ def __init__(self) -> None:
         )
 
     def do_unroot(self) -> None:
+        self._disconnect_all()
         app.plugin_repository.disconnect(self)
         self.unregister_events()
         Adw.PreferencesGroup.do_unroot(self)
@@ -361,9 +362,8 @@ def _get_plugin_icon(self) -> Gtk.Image:
         image_name = f"{self._manifest.short_name}.png"
         path = configpaths.get("PLUGINS_IMAGES") / image_name
         if path.exists():
-            image.set_from_pixbuf(
-                GdkPixbuf.Pixbuf.new_from_file_at_size(str(path), 16, 16)
-            )
+            texture = Gdk.Texture.new_from_filename(str(path))
+            image.set_from_paintable(texture)
             return image
 
         plugin = app.plugin_manager.get_plugin(self._manifest.short_name)
@@ -372,9 +372,8 @@ def _get_plugin_icon(self) -> Gtk.Image:
 
         path = Path(plugin.__path__) / image_name
         if path.exists():
-            image.set_from_pixbuf(
-                GdkPixbuf.Pixbuf.new_from_file_at_size(str(path), 16, 16)
-            )
+            texture = Gdk.Texture.new_from_filename(str(path))
+            image.set_from_paintable(texture)
             return image
 
         image.add_css_class("dimmed")


=====================================
gajim/gtk/settings.py
=====================================
@@ -685,9 +685,10 @@ def __init__(self, *args: Any, dialog: Any, **kwargs: Any) 
-> None:
     def show_dialog(self) -> None:
         window = self.get_root()
         assert isinstance(window, Gtk.Root)
-        self._dialog_cls(self.account, window)
+        dialog = self._dialog_cls(self.account, window)
+        dialog.window.connect("close-request", self._on_close)
 
-    def on_destroy(self, *args: Any) -> None:
+    def _on_close(self, *args: Any) -> None:
         self.setting_value.set_text(self.get_setting_value())
 
     def get_setting_value(self) -> str:



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/compare/7f27d7467a0798045a1e852fd696790d7df14929...d7d39599c78da10811c6fa3f2896ff1616c1325f

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/compare/7f27d7467a0798045a1e852fd696790d7df14929...d7d39599c78da10811c6fa3f2896ff1616c1325f
You're receiving this email because of your account on dev.gajim.org.


_______________________________________________
Commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to