aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfiaxh <git@lightrise.org>2019-12-17 22:54:08 +0100
committerfiaxh <git@lightrise.org>2019-12-17 23:47:57 +0100
commit97647f9b5251dfc7a5a84d7432a1914fa7ec66b9 (patch)
tree1ae43dde46cb1017f402dadc86214ed6f39a3072
parent11c18cdf72f36a36b52d8305d24418397af21785 (diff)
downloaddino-97647f9b5251dfc7a5a84d7432a1914fa7ec66b9.tar.gz
dino-97647f9b5251dfc7a5a84d7432a1914fa7ec66b9.zip
Add shortcuts window
-rw-r--r--main/CMakeLists.txt1
-rw-r--r--main/data/menu_app.ui6
-rw-r--r--main/data/shortcuts.ui52
-rw-r--r--main/po/dino.pot20
-rw-r--r--main/src/ui/application.vala9
5 files changed, 88 insertions, 0 deletions
diff --git a/main/CMakeLists.txt b/main/CMakeLists.txt
index e6387894..2e9e6632 100644
--- a/main/CMakeLists.txt
+++ b/main/CMakeLists.txt
@@ -61,6 +61,7 @@ set(RESOURCE_LIST
occupant_list_item.ui
search_autocomplete.ui
settings_dialog.ui
+ shortcuts.ui
unified_main_content.ui
unified_window_placeholder.ui
diff --git a/main/data/menu_app.ui b/main/data/menu_app.ui
index eadbc81e..20bd66b6 100644
--- a/main/data/menu_app.ui
+++ b/main/data/menu_app.ui
@@ -11,5 +11,11 @@
<attribute name="label" translatable="yes">Settings</attribute>
</item>
</section>
+ <section>
+ <item>
+ <attribute name="action">app.open_shortcuts</attribute>
+ <attribute name="label" translatable="yes">Keyboard Shortcuts</attribute>
+ </item>
+ </section>
</menu>
</interface>
diff --git a/main/data/shortcuts.ui b/main/data/shortcuts.ui
new file mode 100644
index 00000000..68c71237
--- /dev/null
+++ b/main/data/shortcuts.ui
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <object class="GtkShortcutsWindow" id="shortcuts-window">
+ <property name="modal">True</property>
+ <child>
+ <object class="GtkShortcutsSection">
+ <property name="visible">True</property>
+ <property name="section-name">shortcuts</property>
+ <child>
+ <object class="GtkShortcutsGroup">
+ <property name="visible">True</property>
+ <property name="title" translatable="yes">General</property>
+ <child>
+ <object class="GtkShortcutsShortcut">
+ <property name="visible">True</property>
+ <property name="accelerator">&lt;ctrl&gt;T</property>
+ <property name="title" translatable="yes">Start Conversation</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkShortcutsShortcut">
+ <property name="visible">True</property>
+ <property name="accelerator">&lt;ctrl&gt;G</property>
+ <property name="title" translatable="yes">Join Channel</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child>
+ <object class="GtkShortcutsGroup">
+ <property name="visible">True</property>
+ <property name="title" translatable="yes">Navigation</property>
+ <child>
+ <object class="GtkShortcutsShortcut">
+ <property name="visible">True</property>
+ <property name="accelerator">&lt;ctrl&gt;Tab</property>
+ <property name="title" translatable="yes">Jump to next conversation</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkShortcutsShortcut">
+ <property name="visible">True</property>
+ <property name="accelerator">&lt;ctrl&gt;&lt;Shift&gt;Tab</property>
+ <property name="title" translatable="yes">Jump to previous conversation</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
+</interface>
diff --git a/main/po/dino.pot b/main/po/dino.pot
index 0ccc58e8..f526669d 100644
--- a/main/po/dino.pot
+++ b/main/po/dino.pot
@@ -678,6 +678,10 @@ msgstr ""
msgid "Unencrypted"
msgstr ""
+#: main/data/menu_app.ui:17
+msgid "Keyboard Shortcuts"
+msgstr ""
+
#: main/data/im.dino.Dino.appdata.xml.in:8
msgid "Modern XMPP Chat Client"
msgstr ""
@@ -726,6 +730,22 @@ msgstr ""
msgid "Add Contact"
msgstr ""
+#: main/data/shortcuts.ui:12
+msgid "General"
+msgstr ""
+
+#: main/data/shortcuts.ui:32
+msgid "Navigation"
+msgstr ""
+
+#: main/data/shortcuts.ui:37
+msgid "Jump to next conversation"
+msgstr ""
+
+#: main/data/shortcuts.ui:44
+msgid "Jump to previous conversation"
+msgstr ""
+
#: main/data/global_search.ui:37
msgid "No active search"
msgstr ""
diff --git a/main/src/ui/application.vala b/main/src/ui/application.vala
index f031bf43..0f932d18 100644
--- a/main/src/ui/application.vala
+++ b/main/src/ui/application.vala
@@ -140,6 +140,15 @@ public class Dino.Ui.Application : Gtk.Application, Dino.Application {
loop_conversations_bw_action.activate.connect(() => { window.loop_conversations(true); });
add_action(loop_conversations_bw_action);
set_accels_for_action("app.loop_conversations_bw", new string[]{"<Ctrl><Shift>Tab"});
+
+ SimpleAction open_shortcuts_action = new SimpleAction("open_shortcuts", null);
+ open_shortcuts_action.activate.connect((variant) => {
+ Builder builder = new Builder.from_resource("/im/dino/Dino/shortcuts.ui");
+ var dialog = (ShortcutsWindow) builder.get_object("shortcuts-window");
+ dialog.set_transient_for(get_active_window());
+ dialog.present();
+ });
+ add_action(open_shortcuts_action);
}
public bool use_csd() {