]> spindle.queued.net Git - midori/commitdiff
Let private mode inherit preferences
authorChristian Dywan <christian@twotoasts.de>
Wed, 13 Oct 2010 21:41:11 +0000 (23:41 +0200)
committerChristian Dywan <christian@twotoasts.de>
Wed, 13 Oct 2010 21:41:11 +0000 (23:41 +0200)
Private mode should retain most preferences, while menus for
Bookmarks, Tools and Panel are hidden.

App mode now hides the navigationbar by default.

midori/main.c
midori/midori-browser.c
midori/midori-view.c
midori/sokoke.c
midori/sokoke.h

index 5ed6a3575f8de231a2388f2e9306f7e6b0607c78..b3ab80a4b7762fe2d9d885903b6ffa37ec1da66e 100644 (file)
@@ -1732,19 +1732,23 @@ main (int    argc,
             g_free (config_file);
             soup_session_add_feature (session, SOUP_SESSION_FEATURE (jar));
             g_object_unref (jar);
-
         }
         else
+        {
             settings = katze_object_get_object (browser, "settings");
-        g_object_set (settings,
-                      "show-menubar", FALSE,
-                      "show-navigationbar", TRUE,
-                      "show-panel", FALSE,
-                      "toolbar-items", "Back,Forward,ReloadStop,Location",
-                      "homepage", NULL,
-                      "show-statusbar", FALSE,
-                      "enable-developer-extras", FALSE,
-                      NULL);
+            g_object_set (settings,
+                          "show-menubar", FALSE,
+                          "show-navigationbar", FALSE,
+                          "toolbar-items", "Back,Forward,ReloadStop,Location,Homepage",
+                          "homepage", webapp,
+                          "show-statusbar", FALSE,
+                          "enable-developer-extras", FALSE,
+                          NULL);
+        }
+        g_object_set (settings, "show-panel", FALSE, NULL);
+        midori_browser_set_action_visible (browser, "Bookmarks", FALSE);
+        midori_browser_set_action_visible (browser, "Tools", FALSE);
+        midori_browser_set_action_visible (browser, "Panel", FALSE);
         g_object_set (browser, "settings", settings, NULL);
         midori_startup_timer ("Setup config: \t%f");
         g_object_unref (settings);
index 5e777fd54500cbf24a8b81692f1ff0d325bb9651..4b6f18d685e5e5af8480aa0f2826effe54d59df4 100644 (file)
@@ -2138,7 +2138,7 @@ _action_private_browsing_activate (GtkAction*     action,
                                    MidoriBrowser* browser)
 {
     const gchar* uri = midori_browser_get_current_uri (browser);
-    sokoke_spawn_app (uri && *uri ? uri : "about:blank");
+    sokoke_spawn_app (uri && *uri ? uri : "about:blank", TRUE);
 }
 
 static void
@@ -2741,7 +2741,7 @@ midori_browser_open_bookmark (MidoriBrowser* browser,
         uri_fixed = g_strdup (uri);
 
     if (katze_item_get_meta_boolean (item, "app"))
-        sokoke_spawn_app (uri_fixed);
+        sokoke_spawn_app (uri_fixed, FALSE);
     else
     {
         midori_browser_set_current_uri (browser, uri_fixed);
index 0189986116e1aa3948fb1a6cd16cb5a06169aac4..3245aa72b34f20bc5e20973adb6ecd79afc62e9f 100644 (file)
@@ -1785,7 +1785,7 @@ static void
 midori_web_view_menu_web_app_activate_cb (GtkWidget*  widget,
                                           MidoriView* view)
 {
-    sokoke_spawn_app (view->link_uri);
+    sokoke_spawn_app (view->link_uri, FALSE);
 }
 
 static void
index 4add49a77424cad6516a2e9ae7c0d28d779b8f4b..1e6f599bbb52593d8d568e075f29b30c5f946a93 100644 (file)
@@ -487,14 +487,20 @@ sokoke_spawn_program (const gchar* command,
 }
 
 void
-sokoke_spawn_app (const gchar* uri)
+sokoke_spawn_app (const gchar* uri,
+                  gboolean     inherit_config)
 {
     const gchar* executable = sokoke_get_argv (NULL)[0];
     /* "midori"
        "/usr/bin/midori"
        "c:/Program Files/Midori/bin/midori.exe" */
     gchar* quoted = g_shell_quote (executable);
-    gchar* command = g_strconcat (quoted, " -a", NULL);
+    gchar* command;
+    if (inherit_config)
+        command = g_strconcat (quoted, " -c ", sokoke_set_config_dir (NULL),
+                                       " -a", NULL);
+    else
+        command = g_strconcat (quoted, " -a", NULL);
     g_free (quoted);
     sokoke_spawn_program (command, uri);
     g_free (command);
index 2cceee8593dac48827285fc4917ba1b978880cec..bd1a23e7f6edf109cd37571ea515ae7ee48ee008 100644 (file)
@@ -102,7 +102,8 @@ sokoke_spawn_program                    (const gchar* command,
                                          const gchar* argument);
 
 void
-sokoke_spawn_app                        (const gchar*    uri);
+sokoke_spawn_app                        (const gchar*    uri,
+                                         gboolean        inherit_config);
 
 gchar* sokoke_search_uri                (const gchar*    uri,
                                          const gchar*    keywords);