Philipp Hörist pushed to branch master at gajim / gajim
Commits:
8564823e by Philipp Hörist at 2025-08-15T13:30:36+02:00
imprv: StartChat: Remember last filter settings
Fixes #12412
- - - - -
2 changed files:
- gajim/gtk/chat_filter.py
- gajim/gtk/start_chat.py
Changes:
=====================================
gajim/gtk/chat_filter.py
=====================================
@@ -118,6 +118,8 @@ def __init__(self) -> None:
self._connect(reset_button, "clicked", self._on_reset_button_clicked)
popover_content.attach(reset_button, 0, 4, 2, 1)
+ self._populate_dropdowns()
+
def do_unroot(self) -> None:
Gtk.Overlay.do_unroot(self)
self._disconnect_all()
@@ -135,6 +137,14 @@ def get_filters(self) -> ChatFilters:
account=account,
)
+ def set_filters(self, filters: ChatFilters) -> None:
+ self._block_signal = True
+ self._chat_type_drop_down.select_key(filters.type)
+ self._roster_groups_drop_down.select_key(filters.group)
+ self._account_drop_down.select_key(filters.account)
+ self._block_signal = False
+ self.emit("filter-changed")
+
def reset(self) -> None:
self._chat_type_drop_down.set_selected(0)
self._roster_groups_drop_down.set_selected(0)
@@ -146,6 +156,9 @@ def _on_menu_button_activated(
if not menu_button.get_active():
return
+ self._populate_dropdowns()
+
+ def _populate_dropdowns(self) -> None:
roster_group_key = self._roster_groups_drop_down.get_selected_key()
account_key = self._account_drop_down.get_selected_key()
=====================================
gajim/gtk/start_chat.py
=====================================
@@ -77,6 +77,9 @@
class StartChatDialog(GajimAppWindow):
+
+ last_chat_filters = ChatFilters()
+
def __init__(
self, initial_jid: str | None = None, initial_message: str | None =
None
) -> None:
@@ -205,6 +208,9 @@ def __init__(
self._ui.search_entry.grab_focus()
log.debug("Loading dialog finished")
+
+ self._chat_filter.set_filters(StartChatDialog.last_chat_filters)
+
self.show()
def _cleanup(self, *args: Any) -> None:
@@ -476,6 +482,8 @@ def _on_infobar_close_clicked(
app.settings.set("show_help_start_chat", False)
def _on_chat_filter_changed(self, chat_filter: ChatFilter) -> None:
+ filters = chat_filter.get_filters()
+ StartChatDialog.last_chat_filters = filters
self._contact_view.set_chat_filter(chat_filter.get_filters())
def _prepare_new_chat(self, item: ContactListItem) -> None:
View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/commit/8564823e46ef6397f45a6211cb6087cf7304b923
--
View it on GitLab:
https://dev.gajim.org/gajim/gajim/-/commit/8564823e46ef6397f45a6211cb6087cf7304b923
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]