Commit 2386ca8e authored by Daniel Brötzmann's avatar Daniel Brötzmann
Browse files

feat: Add 'Join Support Chat' help item

parent e8fa5a91
......@@ -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 = 'gajim@conference.gajim.org'
URI_SCHEMES = {
'aaa://',
......
......@@ -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>
......
......@@ -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:
......
......@@ -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()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment