[gnome-boxes] app-window: Bind kbd-shortcuts action to windows



commit b1964c84f43e3635d40131f82dcfc812f5b901a2
Author: Zeeshan Ali (Khattak) <zeeshanak gnome org>
Date:   Tue Dec 15 21:30:29 2015 +0000

    app-window: Bind kbd-shortcuts action to windows
    
    This is so that we can launch view-speficic shortcuts help in the
    following patch.

 src/app-window.vala |   10 +++++++++-
 src/app.vala        |   10 +---------
 2 files changed, 10 insertions(+), 10 deletions(-)
---
diff --git a/src/app-window.vala b/src/app-window.vala
index f8a0760..c0a054d 100644
--- a/src/app-window.vala
+++ b/src/app-window.vala
@@ -163,6 +163,14 @@ private class Boxes.AppWindow: Gtk.ApplicationWindow, Boxes.UI {
         }
 
         views = { icon_view, list_view };
+
+        var action = new GLib.SimpleAction ("kbd-shortcuts", null);
+        action.activate.connect (() => {
+            var window = new Boxes.KbdShortcutsWindow ();
+
+            window.show ();
+        });
+        add_action (action);
     }
 
     public void setup_ui () {
@@ -350,7 +358,7 @@ private class Boxes.AppWindow: Gtk.ApplicationWindow, Boxes.UI {
             return true;
         } else if (event.keyval == Gdk.Key.k &&
                    (event.state & default_modifiers) == Gdk.ModifierType.CONTROL_MASK) {
-            App.app.activate_action ("kbd-shortcuts", null);
+            activate_action ("kbd-shortcuts", null);
 
             return true;
         } else if (event.keyval == Gdk.Key.q &&
diff --git a/src/app.vala b/src/app.vala
index 4b40871..b0454cb 100644
--- a/src/app.vala
+++ b/src/app.vala
@@ -80,14 +80,6 @@ private class Boxes.App: Gtk.Application {
         action.activate.connect ((param) => { open_name (param.get_string ()); });
         add_action (action);
 
-        action = new GLib.SimpleAction ("kbd-shortcuts", null);
-        action.activate.connect (() => {
-            var window = new Boxes.KbdShortcutsWindow ();
-
-            window.show ();
-        });
-        add_action (action);
-
         action = new GLib.SimpleAction ("about", null);
         action.activate.connect (() => {
             string[] authors = {
@@ -127,7 +119,7 @@ private class Boxes.App: Gtk.Application {
 
         var menu = new GLib.Menu ();
         menu.append (_("Help"), "app.help");
-        menu.append (_("Keyboard shortcuts"), "app.kbd-shortcuts");
+        menu.append (_("Keyboard shortcuts"), "win.kbd-shortcuts");
         menu.append (_("About"), "app.about");
         menu.append (_("Quit"), "app.quit");
 


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