[gnome-games/wip/exalm/ds: 20/21] nintendo-ds: Add shortcuts to shortcuts window



commit fbc31dfc5999a996dd9ed2e284e743464a324368
Author: Alexander Mikhaylenko <exalm7659 gmail com>
Date:   Sat Jan 19 03:01:21 2019 +0500

    nintendo-ds: Add shortcuts to shortcuts window

 plugins/nintendo-ds/src/nintendo-ds-plugin.vala | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
---
diff --git a/plugins/nintendo-ds/src/nintendo-ds-plugin.vala b/plugins/nintendo-ds/src/nintendo-ds-plugin.vala
index ec8d2519..8b0a91b6 100644
--- a/plugins/nintendo-ds/src/nintendo-ds-plugin.vala
+++ b/plugins/nintendo-ds/src/nintendo-ds-plugin.vala
@@ -24,6 +24,30 @@ private class Games.NintendoDsPlugin : Object, Plugin {
                return { factory };
        }
 
+       public Gtk.ShortcutsGroup? get_shortcuts_group () {
+               var group = Object.new (typeof (Gtk.ShortcutsGroup)) as Gtk.ShortcutsGroup;
+               group.visible = true;
+               group.title = _("Nintendo DS");
+
+               var shortcut = Object.new (typeof (Gtk.ShortcutsShortcut)) as Gtk.ShortcutsShortcut;
+               shortcut.visible = true;
+               shortcut.title = _("Swap screens");
+               shortcut.accelerator = "<ctrl>s";
+               group.add (shortcut);
+
+               var file = File.new_for_uri ("resource:///org/gnome/Games/gesture/stick-symbolic.svg");
+
+               shortcut = Object.new (typeof (Gtk.ShortcutsShortcut)) as Gtk.ShortcutsShortcut;
+               shortcut.visible = true;
+               shortcut.shortcut_type = Gtk.ShortcutType.GESTURE;
+               shortcut.icon = new FileIcon (file);
+               shortcut.title = _("Swap screens");
+               shortcut.subtitle = _("Right analog stick press");
+               group.add (shortcut);
+
+               return group;
+       }
+
        private static Game game_for_uri (Uri uri) throws Error {
                var uid = new FingerprintUid (uri, FINGERPRINT_PREFIX);
                var title = new FilenameTitle (uri);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]