Philipp Hörist pushed to branch gtk4 at gajim / gajim


Commits:
d5a89299 by Philipp Hörist at 2024-11-11T00:11:49+01:00
refactor: Convert more popover settings

- - - - -
6c32dd74 by Philipp Hörist at 2024-11-11T00:12:15+01:00
cfix: Fix test

- - - - -


3 changed files:

- gajim/gtk/contact_settings.py
- gajim/gtk/groupchat_settings.py
- test/gtk/ui_test_chat_function_page.py


Changes:

=====================================
gajim/gtk/contact_settings.py
=====================================
@@ -30,11 +30,11 @@ def __init__(self, account: str, jid: JID) -> None:
 
         settings: list[Setting] = [
             Setting(
-                SettingKind.POPOVER,
+                SettingKind.DROPDOWN,
                 _("Send Chat State"),
                 SettingType.CONTACT,
                 "send_chatstate",
-                props={"entries": chat_state},
+                props={"data": chat_state},
             ),
             Setting(
                 SettingKind.SWITCH,


=====================================
gajim/gtk/groupchat_settings.py
=====================================
@@ -50,11 +50,11 @@ def __init__(self, account: str, jid: JID) -> None:
                 "notify_on_all_messages",
             ),
             Setting(
-                SettingKind.POPOVER,
+                SettingKind.DROPDOWN,
                 _("Send Chat State"),
                 SettingType.GROUP_CHAT,
                 "send_chatstate",
-                props={"entries": chat_state},
+                props={"data": chat_state},
             ),
             Setting(
                 SettingKind.SWITCH,
@@ -64,11 +64,11 @@ def __init__(self, account: str, jid: JID) -> None:
                 desc=_("Let others know if you read up to this point"),
             ),
             Setting(
-                SettingKind.POPOVER,
+                SettingKind.DROPDOWN,
                 _("Sync Threshold"),
                 SettingType.GROUP_CHAT,
                 "sync_threshold",
-                props={"entries": THRESHOLD_OPTIONS},
+                props={"data": THRESHOLD_OPTIONS},
             ),
         ]
 


=====================================
test/gtk/ui_test_chat_function_page.py
=====================================
@@ -16,9 +16,9 @@
 
 from gajim.gtk.chat_function_page import ChatFunctionPage
 from gajim.gtk.chat_function_page import FunctionMode
-from gajim.gtk.widgets import DropDownKeyValueItem
+from gajim.gtk.dropdown import GajimDropDown
+from gajim.gtk.dropdown import KeyValueItem
 from gajim.gtk.widgets import GajimAppWindow
-from gajim.gtk.widgets import GajimDropDown
 
 from . import util
 
@@ -58,7 +58,7 @@ def __init__(self):
 
         self._main_box.append(self._chat_function_page)
 
-        drop_down = GajimDropDown({item.name for item in FunctionMode})
+        drop_down = GajimDropDown([item.name for item in FunctionMode])
         drop_down.connect('notify::selected', self._on_function_mode_selected)
         drop_down.set_selected(1)
         self._main_box.append(drop_down)
@@ -67,7 +67,7 @@ def __init__(self):
 
     def _on_function_mode_selected(self, drop_down: GajimDropDown, *args: Any) 
-> None:
         selected_mode = drop_down.get_selected_item()
-        assert isinstance(selected_mode, DropDownKeyValueItem)
+        assert isinstance(selected_mode, KeyValueItem)
         mode = selected_mode.key
         data = FUNCTION_DATA.get(FunctionMode[selected_mode.key])
         files = ['test.txt']



View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/compare/1f7527484638db9a30b2b0dd616d4bf7ea5eadc2...6c32dd7470904fa657253066c89697a4e9885cbe

-- 
View it on GitLab: 
https://dev.gajim.org/gajim/gajim/-/compare/1f7527484638db9a30b2b0dd616d4bf7ea5eadc2...6c32dd7470904fa657253066c89697a4e9885cbe
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