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


Commits:
24c20a5e by wurstsalat at 2024-10-04T10:36:10+02:00
fix remove account window

- - - - -
db062d7c by wurstsalat at 2024-10-04T10:51:10+02:00
fix adhoc commands window

- - - - -


2 changed files:

- gajim/gtk/adhoc.py
- gajim/gtk/remove_account.py


Changes:

=====================================
gajim/gtk/adhoc.py
=====================================
@@ -34,6 +34,7 @@
 from gajim.gtk.assistant import ProgressPage
 from gajim.gtk.dataform import DataFormWidget
 from gajim.gtk.util import ensure_not_destroyed
+from gajim.gtk.util import iterate_children
 from gajim.gtk.util import MultiLineLabel
 
 log = logging.getLogger('gajim.gtk.adhoc')
@@ -195,6 +196,7 @@ def __init__(self) -> None:
         self._scrolled.get_style_context().add_class('gajim-scrolled')
         self._scrolled.set_max_content_height(400)
         self._scrolled.set_max_content_width(400)
+        self._scrolled.set_propagate_natural_height(True)
         self._scrolled.set_policy(Gtk.PolicyType.NEVER,
                                   Gtk.PolicyType.AUTOMATIC)
         self._treeview = Gtk.TreeView()
@@ -287,7 +289,6 @@ def process_stage(self, stage_data: AdHocCommand) -> None:
     def _show_form(self, form: Node | None) -> None:
         if self._dataform_widget is not None:
             self.remove(self._dataform_widget)
-            self._dataform_widget.destroy()
         if form is None:
             return
         form = dataforms.extend_form(node=form)
@@ -389,7 +390,6 @@ def _show_icon_text(self, show: bool) -> None:
     def _show_form(self, form: Node | None) -> None:
         if self._dataform_widget is not None:
             self.remove(self._dataform_widget)
-            self._dataform_widget.destroy()
         if form is None:
             return
 
@@ -400,7 +400,8 @@ def _show_form(self, form: Node | None) -> None:
         self.append(self._dataform_widget)
 
     def _show_notes(self, notes: list[AdHocCommandNote]):
-        self._notes.foreach(self._remove_note_cell)
+        for note in iterate_children(self._notes):
+            self._notes.remove(note)
 
         for i, note in enumerate(notes):
             if len(notes) > 1:
@@ -431,10 +432,6 @@ def _bump_severity(self, severity: AdHocNoteType):
                 severity == AdHocNoteType.ERROR):
             self._severity = severity
 
-    def _remove_note_cell(self, cell: Gtk.Widget) -> None:
-        self._notes.remove(cell)
-        cell.destroy()
-
     def get_visible_buttons(self) -> list[str]:
         return ['commands']
 


=====================================
gajim/gtk/remove_account.py
=====================================
@@ -11,6 +11,7 @@
 import logging
 
 from gi.repository import Gtk
+from gi.repository import Pango
 from nbxmpp.errors import StanzaError
 from nbxmpp.task import Task
 
@@ -67,8 +68,6 @@ def __init__(self, account: str) -> None:
 
         self._set_remove_from_server_checkbox()
 
-        self.show_all()
-
     @overload
     def get_page(self, name: Literal['remove_choice']) -> RemoveChoice: ...
 
@@ -186,11 +185,10 @@ def __init__(self, account: str) -> None:
             _('_Unregister account from service'))
         self._server.set_halign(Gtk.Align.CENTER)
 
-        self.pack_start(heading, False, True, 0)
-        self.pack_start(label, False, True, 0)
-        self.pack_start(check_label, False, True, 0)
-        self.pack_start(self._server, False, True, 0)
-        self.show_all()
+        self.append(heading)
+        self.append(label)
+        self.append(check_label)
+        self.append(self._server)
 
     @property
     def remove_from_server(self) -> bool:



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/compare/8623b85c10ac6d6ec2ce21ab746c8439b92f3a40...db062d7ca731461200519447b03c2be2c7bd2b24

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/compare/8623b85c10ac6d6ec2ce21ab746c8439b92f3a40...db062d7ca731461200519447b03c2be2c7bd2b24
You're receiving this email because of your account on dev.gajim.org.


_______________________________________________
Commits mailing list -- commits@gajim.org
To unsubscribe send an email to commits-le...@gajim.org

Reply via email to