[gnome-builder] app: wire app.quit action.



commit 39de03765f72df7631ec23c275822b0cc8738ca4
Author: Christian Hergert <christian hergert me>
Date:   Wed Sep 10 01:23:14 2014 -0700

    app: wire app.quit action.

 src/app/gb-application.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/src/app/gb-application.c b/src/app/gb-application.c
index 7df7237..1fb66fc 100644
--- a/src/app/gb-application.c
+++ b/src/app/gb-application.c
@@ -191,11 +191,27 @@ gb_application_startup (GApplication *app)
 }
 
 static void
+on_quit_activate (GSimpleAction *action,
+                  GVariant      *parameter,
+                  gpointer       user_data)
+{
+  g_application_quit (g_application_get_default ());
+}
+
+static void
 gb_application_constructed (GObject *object)
 {
+  static const GActionEntry action_entries[] = {
+    { "quit", on_quit_activate },
+  };
+
   if (G_OBJECT_CLASS (gb_application_parent_class)->constructed)
     G_OBJECT_CLASS (gb_application_parent_class)->constructed (object);
 
+  g_action_map_add_action_entries (G_ACTION_MAP (object),
+                                   action_entries,
+                                   G_N_ELEMENTS (action_entries),
+                                   object);
   g_application_set_resource_base_path (G_APPLICATION (object),
                                         "/org/gnome/builder");
 }


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