]> spindle.queued.net Git - midori/commitdiff
Add a preference Show speed dial in new tabs
authorChristian Dywan <christian@twotoasts.de>
Fri, 8 May 2009 01:29:25 +0000 (03:29 +0200)
committerChristian Dywan <christian@twotoasts.de>
Fri, 8 May 2009 01:29:25 +0000 (03:29 +0200)
midori/midori-preferences.c
midori/midori-view.c
midori/midori-websettings.c

index 32c9aaaa8f40cc40efcca43174caffe406474a53..88dc4801f379ba95d7ba280cf1f275005159ef85 100644 (file)
@@ -420,7 +420,9 @@ midori_preferences_set_settings (MidoriPreferences* preferences,
     }
     FILLED_ADD (hbox, 1, 2, 1, 2);
     button = katze_property_proxy (settings, "show-crash-dialog", NULL);
-    SPANNED_ADD (button, 0, 2, 2, 3);
+    INDENTED_ADD (button, 0, 1, 2, 3);
+    button = katze_property_proxy (settings, "speed-dial-in-new-tabs", NULL);
+    INDENTED_ADD (button, 1, 2, 2, 3);
     FRAME_NEW (_("Transfers"));
     TABLE_NEW (2, 2);
     label = katze_property_label (settings, "download-folder");
index 1d33b49c55cfe155e41e78a787af5d93eb24dcb0..468ce66a74129925214cf04f9bf2434fe5b53bd0 100644 (file)
@@ -60,6 +60,7 @@ struct _MidoriView
     GtkWidget* web_view;
     KatzeArray* news_feeds;
 
+    gboolean speed_dial_in_new_tabs;
     gchar* download_manager;
     gchar* news_aggregator;
     gboolean middle_click_opens_selection;
@@ -1612,6 +1613,7 @@ _midori_view_update_settings (MidoriView* view)
     gboolean zoom_text_and_images;
 
     g_object_get (view->settings,
+        "speed-dial-in-new-tabs", &view->speed_dial_in_new_tabs,
         "download-manager", &view->download_manager,
         "news-aggregator", &view->news_aggregator,
         "zoom-text-and-images", &zoom_text_and_images,
@@ -1639,7 +1641,11 @@ midori_view_settings_notify_cb (MidoriWebSettings* settings,
     g_value_init (&value, pspec->value_type);
     g_object_get_property (G_OBJECT (view->settings), name, &value);
 
-    if (name == g_intern_string ("download-manager"))
+    if (name == g_intern_string ("speed-dial-in-new-tabs"))
+    {
+        view->speed_dial_in_new_tabs = g_value_get_boolean (&value);
+    }
+    else if (name == g_intern_string ("download-manager"))
     {
         katze_assign (view->download_manager, g_value_dup_string (&value));
     }
@@ -1903,7 +1909,7 @@ midori_view_set_uri (MidoriView*  view,
         if (!view->web_view)
             midori_view_construct_web_view (view);
 
-        if (!g_strcmp0 (uri, ""))
+        if (view->speed_dial_in_new_tabs && !g_strcmp0 (uri, ""))
         {
             SoupServer* res_server;
             guint port;
index 8681e2c06685f5d67ef1b77b691b37c1834987e0..63f10b6296e162f3e1afd55c3932cb8849810bbe 100644 (file)
@@ -49,6 +49,7 @@ struct _MidoriWebSettings
     MidoriStartup load_on_startup;
     gchar* homepage;
     gboolean show_crash_dialog;
+    gboolean speed_dial_in_new_tabs;
     gchar* download_folder;
     gboolean ask_for_destination_folder;
     gboolean notify_transfer_completed;
@@ -121,6 +122,7 @@ enum
     PROP_LOAD_ON_STARTUP,
     PROP_HOMEPAGE,
     PROP_SHOW_CRASH_DIALOG,
+    PROP_SPEED_DIAL_IN_NEW_TABS,
     PROP_DOWNLOAD_FOLDER,
     PROP_ASK_FOR_DESTINATION_FOLDER,
     PROP_NOTIFY_TRANSFER_COMPLETED,
@@ -571,6 +573,23 @@ midori_web_settings_class_init (MidoriWebSettingsClass* class)
                                      TRUE,
                                      flags));
 
+    /**
+    * MidoriWebSettings:speed-dial-in-new-tabs:
+    *
+    * Show a speed dial page in newly opened tabs.
+    *
+    * Since: 0.1.7
+    */
+    g_object_class_install_property (gobject_class,
+                                     PROP_SPEED_DIAL_IN_NEW_TABS,
+                                     g_param_spec_boolean (
+                                     "speed-dial-in-new-tabs",
+        /* i18n: Speed dial, webpage shortcuts, named for the phone function */
+                                     _("Show speed dial in new tabs"),
+                                     _("Show a speed dial page in newly opened tabs"),
+                                     TRUE,
+                                     flags));
+
     g_object_class_install_property (gobject_class,
                                      PROP_DOWNLOAD_FOLDER,
                                      g_param_spec_string (
@@ -1119,6 +1138,9 @@ midori_web_settings_set_property (GObject*      object,
     case PROP_SHOW_CRASH_DIALOG:
         web_settings->show_crash_dialog = g_value_get_boolean (value);
         break;
+    case PROP_SPEED_DIAL_IN_NEW_TABS:
+        web_settings->speed_dial_in_new_tabs = g_value_get_boolean (value);
+        break;
     case PROP_DOWNLOAD_FOLDER:
         katze_assign (web_settings->download_folder, g_value_dup_string (value));
         break;
@@ -1324,6 +1346,9 @@ midori_web_settings_get_property (GObject*    object,
     case PROP_SHOW_CRASH_DIALOG:
         g_value_set_boolean (value, web_settings->show_crash_dialog);
         break;
+    case PROP_SPEED_DIAL_IN_NEW_TABS:
+        g_value_set_boolean (value, web_settings->speed_dial_in_new_tabs);
+        break;
     case PROP_DOWNLOAD_FOLDER:
         g_value_set_string (value, web_settings->download_folder);
         break;