Daniel Brötzmann pushed to branch master at gajim / gajim
Commits: 2386ca8e by wurstsalat at 2022-05-14T18:23:29+02:00 feat: Add 'Join Support Chat' help item - - - - - 4 changed files: - gajim/common/const.py - gajim/data/gui/application_menu.ui - gajim/gtk/application.py - gajim/gtk/start_chat.py Changes: ===================================== gajim/common/const.py ===================================== @@ -919,6 +919,7 @@ def is_active(self): GAJIM_FAQ_URI = 'https://dev.gajim.org/gajim/gajim/wikis/help/gajimfaq' GAJIM_WIKI_URI = 'https://dev.gajim.org/gajim/gajim/wikis' +GAJIM_SUPPORT_JID = '[email protected]' URI_SCHEMES = { 'aaa://', ===================================== gajim/data/gui/application_menu.ui ===================================== @@ -55,6 +55,10 @@ <attribute name="label" translatable="yes">FA_Q (Online)</attribute> <attribute name="action">app.faq</attribute> </item> + <item> + <attribute name="label" translatable="yes">Join Support Chat</attribute> + <attribute name="action">app.join-support-chat</attribute> + </item> <item> <attribute name="label" translatable="yes">_Keyboard Shortcuts</attribute> <attribute name="action">app.shortcuts</attribute> ===================================== gajim/gtk/application.py ===================================== @@ -63,6 +63,7 @@ from gajim.common.application import CoreApplication from gajim.common.const import GAJIM_FAQ_URI from gajim.common.const import GAJIM_WIKI_URI +from gajim.common.const import GAJIM_SUPPORT_JID from gajim.common.exceptions import GajimGeneralException from gajim.common.helpers import load_json from gajim.common.helpers import open_uri @@ -393,6 +394,7 @@ def add_actions(self) -> None: ('shortcuts', None, self._on_shortcuts_action), ('features', None, self._on_features_action), ('content', None, self._on_content_action), + ('join-support-chat', None, self._on_join_support_chat), ('about', None, self._on_about_action), ('faq', None, self._on_faq_action), ('ipython', None, self._on_ipython_action), @@ -658,6 +660,11 @@ def _on_content_action(_action: Gio.SimpleAction, _param: Optional[GLib.Variant]) -> None: open_uri(GAJIM_WIKI_URI) + @staticmethod + def _on_join_support_chat(_action: Gio.SimpleAction, + _param: Optional[GLib.Variant]) -> None: + open_window('StartChatDialog', jid=GAJIM_SUPPORT_JID) + @staticmethod def _on_faq_action(_action: Gio.SimpleAction, _param: Optional[GLib.Variant]) -> None: ===================================== gajim/gtk/start_chat.py ===================================== @@ -68,7 +68,7 @@ class Search(IntEnum): class StartChatDialog(Gtk.ApplicationWindow): - def __init__(self) -> None: + def __init__(self, jid: Optional[str] = None) -> None: Gtk.ApplicationWindow.__init__(self) self.set_name('StartChatDialog') self.set_application(app.app) @@ -138,6 +138,9 @@ def __init__(self) -> None: if rows: self._load_contacts(rows) + if jid is not None: + self.set_search_text(jid) + self.select_first_row() self._ui.connect_signals(self) self.show_all() View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/2386ca8e8ebd11fbedbf0f3a528e724e49ec40da -- View it on GitLab: https://dev.gajim.org/gajim/gajim/-/commit/2386ca8e8ebd11fbedbf0f3a528e724e49ec40da You're receiving this email because of your account on dev.gajim.org.
_______________________________________________ Commits mailing list [email protected] https://lists.gajim.org/cgi-bin/listinfo/commits
