]> spindle.queued.net Git - midori/commitdiff
Store argument vector and display it in about:version
authorChristian Dywan <christian@twotoasts.de>
Tue, 12 Jan 2010 22:22:50 +0000 (23:22 +0100)
committerChristian Dywan <christian@twotoasts.de>
Tue, 12 Jan 2010 22:34:10 +0000 (23:34 +0100)
midori/main.c
midori/midori-view.c
midori/sokoke.c
midori/sokoke.h

index 21f0cc4e51a3cca2c94bcb6233f9f0032e54e627..6537aa8ca76bce525051f5e3f6bc3af7716c904d 100644 (file)
@@ -1763,6 +1763,9 @@ main (int    argc,
     #endif
     #endif
 
+    /* Preserve argument vector */
+    sokoke_get_argv (argv);
+
     /* Parse cli options */
     webapp = NULL;
     config = NULL;
index 30b7c162a302aa4f60e5715229ea9f1c8e8b3c88..22a035718651a9308386169f804cdc33a5f3c2e5 100644 (file)
@@ -3226,6 +3226,8 @@ midori_view_set_uri (MidoriView*  view,
             }
             else if (!strcmp (uri, "about:version"))
             {
+                gchar** argument_vector = sokoke_get_argv (NULL);
+                gchar* command_line = g_strjoinv (" ", argument_vector);
                 gchar* ident = katze_object_get_string (view->settings, "ident-string");
                 #if defined (G_OS_WIN32)
                 gchar* sys_name = g_strdup ("Windows");
@@ -3261,6 +3263,7 @@ midori_view_set_uri (MidoriView*  view,
                     "<img src=\"res://logo-shade.png\" "
                     "style=\"position: absolute; right: 15px; bottom: 15px; z-index: -9;\">"
                     "<table>"
+                    "<tr><td>Command line</td><td>%s</td></tr>"
                     "<tr><td>Midori</td><td>" PACKAGE_VERSION "%s</td></tr>"
                     "<tr><td>WebKitGTK+</td><td>%d.%d.%d (%d.%d.%d)</td></tr>"
                     "<tr><td>GTK+</td><td>%d.%d.%d (%d.%d.%d)</td></tr>"
@@ -3275,6 +3278,7 @@ midori_view_set_uri (MidoriView*  view,
                     "<tr><td>Identification</td><td>%s</td></tr>"
                     "</table>"
                     "</body></html>",
+                    command_line,
                     DEBUGGING,
                     WEBKIT_MAJOR_VERSION,
                     WEBKIT_MINOR_VERSION,
@@ -3293,6 +3297,9 @@ midori_view_set_uri (MidoriView*  view,
                     HAVE_UNIQUE ? "Yes" : "No",
                     HAVE_HILDON ? "Yes" : "No",
                     sys_name, ident);
+                g_free (command_line);
+                g_free (ident);
+                g_free (sys_name);
             }
             else
             {
index db18599717892362b191289d5447b36406c7807d..a9fba3565c3e90e8e10b75fb8aa2f15ff2e1e7dc 100644 (file)
@@ -1384,6 +1384,25 @@ sokoke_find_data_filename (const gchar* filename)
     return g_build_filename (MDATADIR, filename, NULL);
 }
 
+/**
+ * sokoke_get_argv:
+ * @argument_vector: %NULL
+ *
+ * Retrieves the argument vector passed at program startup.
+ *
+ * Return value: the argument vector
+ **/
+gchar**
+sokoke_get_argv (gchar** argument_vector)
+{
+    static gchar** stored_argv = NULL;
+
+    if (!stored_argv)
+        stored_argv = g_strdupv (argument_vector);
+
+    return stored_argv;
+}
+
 #if !WEBKIT_CHECK_VERSION (1, 1, 14)
 static void
 res_server_handler_cb (SoupServer*        res_server,
index 1960650ee6b61bb20962ac9deca5d885842860c6..486dd5cf962f736e49cd4a07efe146a6e0c31407 100644 (file)
@@ -183,6 +183,9 @@ sokoke_find_config_filename             (const gchar*    folder,
 gchar*
 sokoke_find_data_filename               (const gchar*    filename);
 
+gchar**
+sokoke_get_argv                         (gchar**         argument_vector);
+
 #if !WEBKIT_CHECK_VERSION (1, 1, 14)
 SoupServer*
 sokoke_get_res_server                   (void);