[gnome-builder] app: add Ctrl+Q accelerator to quit application



commit 140b49d6e7ff3f8d20e0029387c3b941040a7a88
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Sat Sep 13 16:12:57 2014 -0700

    app: add Ctrl+Q accelerator to quit application
    
    https://bugzilla.gnome.org/show_bug.cgi?id=736636

 src/app/gb-application.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/src/app/gb-application.c b/src/app/gb-application.c
index 1fb66fc..23a71ea 100644
--- a/src/app/gb-application.c
+++ b/src/app/gb-application.c
@@ -205,6 +205,8 @@ gb_application_constructed (GObject *object)
     { "quit", on_quit_activate },
   };
 
+  static const gchar *quit_accels[] = { "<Control>q", NULL };
+
   if (G_OBJECT_CLASS (gb_application_parent_class)->constructed)
     G_OBJECT_CLASS (gb_application_parent_class)->constructed (object);
 
@@ -214,6 +216,9 @@ gb_application_constructed (GObject *object)
                                    object);
   g_application_set_resource_base_path (G_APPLICATION (object),
                                         "/org/gnome/builder");
+
+  gtk_application_set_accels_for_action (GTK_APPLICATION (object),
+                                         "app.quit", quit_accels);
 }
 
 static void


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