[yelp: 4/4] Merged GtkApplication port, bug #645264



commit 4a57940536963fe71f49efb66d0d5d8f737b0a53
Merge: b9e99ba 4d67a3d
Author: Shaun McCance <shaunm gnome org>
Date:   Thu Apr 7 08:54:56 2011 -0400

    Merged GtkApplication port, bug #645264

 src/yelp-application.c |  331 +++++++++++++++---------------------------------
 src/yelp-application.h |   11 +--
 src/yelp.c             |    2 +-
 3 files changed, 107 insertions(+), 237 deletions(-)
---
diff --cc src/yelp-application.c
index dfb528a,d128a5b..d95c569
--- a/src/yelp-application.c
+++ b/src/yelp-application.c
@@@ -217,14 -197,47 +197,48 @@@ yelp_application_finalize (GObject *obj
  }
  
  
+ static gboolean
+ yelp_application_cmdline (GApplication     *app,
+                           gchar          ***arguments,
+                           gint             *exit_status)
+ {
+     gint i, j;
+     gchar **argv;
+ 
+     argv = *arguments;
+ 
+     for (i = 0; argv[i]; i++) {
+         if (g_str_equal (argv[i], "--editor-mode")) {
+             YelpApplicationPrivate *priv = GET_PRIV (app);
+             priv->editor_mode = TRUE;
+             g_free (argv[i]);
+             for (j = i; argv[j]; j++)
+                 argv[j] = argv[j + 1];
+         }
+     }
+ 
+     return G_APPLICATION_CLASS (yelp_application_parent_class)
+         ->local_command_line (app, arguments, exit_status);
+ }
+ 
  static void
- application_setup (YelpApplication *app)
+ yelp_application_startup (GApplication *application)
  {
+     YelpApplication *app = YELP_APPLICATION (application);
      YelpApplicationPrivate *priv = GET_PRIV (app);
-     YelpSettings *settings = yelp_settings_get_default ();
 +    gchar *keyfile;
+     YelpSettings *settings;
      GtkAction *action;
  
+     g_set_application_name (N_("Help"));
+ 
+     /* chain up */
+     G_APPLICATION_CLASS (yelp_application_parent_class)
+       ->startup (application);
+ 
+     settings = yelp_settings_get_default ();
+     if (priv->editor_mode)
+         yelp_settings_set_editor_mode (settings, TRUE);
      priv->windows_by_document = g_hash_table_new_full (g_str_hash,
                                                         g_str_equal,
                                                         g_free,



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