[gtk+] GtkApplication: install gtk option group



commit 974c8432532c989bfa97832572200b86e7723ea2
Author: Ryan Lortie <desrt desrt ca>
Date:   Thu Feb 6 17:33:44 2014 +0000

    GtkApplication: install gtk option group
    
    Install Gtk's GOptionGroup in GApplication just before commandline
    arguments are parsed.

 gtk/gtkapplication.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkapplication.c b/gtk/gtkapplication.c
index 8d9a432..a0451e9 100644
--- a/gtk/gtkapplication.c
+++ b/gtk/gtkapplication.c
@@ -546,6 +546,16 @@ gtk_application_shutdown (GApplication *g_application)
     ->shutdown (g_application);
 }
 
+static gboolean
+gtk_application_local_command_line (GApplication   *application,
+                                    gchar        ***arguments,
+                                    gint           *exit_status)
+{
+  g_application_add_option_group (application, gtk_get_option_group (FALSE));
+
+  return G_APPLICATION_CLASS (gtk_application_parent_class)->local_command_line (application, arguments, 
exit_status);
+}
+
 static void
 gtk_application_add_platform_data (GApplication    *application,
                                    GVariantBuilder *builder)
@@ -780,6 +790,7 @@ gtk_application_class_init (GtkApplicationClass *class)
   object_class->set_property = gtk_application_set_property;
   object_class->finalize = gtk_application_finalize;
 
+  application_class->local_command_line = gtk_application_local_command_line;
   application_class->add_platform_data = gtk_application_add_platform_data;
   application_class->before_emit = gtk_application_before_emit;
   application_class->after_emit = gtk_application_after_emit;


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