]> spindle.queued.net Git - midori/commitdiff
Add a Preference to disable automatic inline find while typing
authorChristian Dywan <christian@twotoasts.de>
Sun, 1 Mar 2009 18:21:27 +0000 (19:21 +0100)
committerChristian Dywan <christian@twotoasts.de>
Sun, 1 Mar 2009 18:21:27 +0000 (19:21 +0100)
midori/midori-preferences.c
midori/midori-view.c
midori/midori-websettings.c

index bca63a0a9ef42facd7511bb161d1f95243e28edf..072d99d88f93175797d4c95fa680aea14753212e 100644 (file)
@@ -506,6 +506,8 @@ midori_preferences_set_settings (MidoriPreferences* preferences,
     SPANNED_ADD (button, 1, 2, 3, 4);
     button = katze_property_proxy (settings, "zoom-text-and-images", NULL);
     SPANNED_ADD (button, 0, 1, 4, 5);
+    button = katze_property_proxy (settings, "find-while-typing", NULL);
+    SPANNED_ADD (button, 1, 2, 4, 5);
     label = katze_property_label (settings, "location-entry-search");
     INDENTED_ADD (label, 0, 1, 5, 6);
     entry = katze_property_proxy (settings, "location-entry-search", NULL);
index 79869c4a1b96e2a1b4738bc8a864f07110addaa6..5330122a1a73c8352ed20575b3f39725e909611b 100644 (file)
@@ -67,6 +67,7 @@ struct _MidoriView
     gboolean open_tabs_in_the_background;
     gboolean close_buttons_on_tabs;
     MidoriNewPage open_new_pages_in;
+    gboolean find_while_typing;
 
     GtkWidget* menu_item;
     GtkWidget* tab_label;
@@ -817,7 +818,7 @@ gtk_widget_key_press_event_cb (WebKitWebView* web_view,
     if (character == (event->keyval | 0x01000000))
         return FALSE;
 
-    if (!webkit_web_view_can_cut_clipboard (web_view)
+    if (view->find_while_typing && !webkit_web_view_can_cut_clipboard (web_view)
         && !webkit_web_view_can_paste_clipboard (web_view))
     {
         gchar* text = g_strdup_printf ("%c", character);
@@ -1365,6 +1366,7 @@ _midori_view_update_settings (MidoriView* view)
         "open-new-pages-in", &view->open_new_pages_in,
         "middle-click-opens-selection", &view->middle_click_opens_selection,
         "open-tabs-in-the-background", &view->open_tabs_in_the_background,
+        "find-while-typing", &view->find_while_typing,
         NULL);
 
     if (view->web_view)
@@ -1412,6 +1414,10 @@ midori_view_settings_notify_cb (MidoriWebSettings* settings,
     {
         view->open_tabs_in_the_background = g_value_get_boolean (&value);
     }
+    else if (name == g_intern_string ("find-while-typing"))
+    {
+        view->find_while_typing = g_value_get_boolean (&value);
+    }
 
     g_value_unset (&value);
 }
index cf077e22ff269e2672db928a811b55d61e1297e1..319ac612abd7338efada82ad45f1a14d07b65ab7 100644 (file)
@@ -63,6 +63,7 @@ struct _MidoriWebSettings
     gboolean open_popups_in_tabs;
 
     gboolean zoom_text_and_images;
+    gboolean find_while_typing;
     MidoriAcceptCookies accept_cookies;
     gboolean original_cookies_only;
     gint maximum_cookie_age;
@@ -131,6 +132,7 @@ enum
     PROP_ENFORCE_96_DPI,
     PROP_ENABLE_DEVELOPER_EXTRAS,
     PROP_ZOOM_TEXT_AND_IMAGES,
+    PROP_FIND_WHILE_TYPING,
     PROP_ACCEPT_COOKIES,
     PROP_ORIGINAL_COOKIES_ONLY,
     PROP_MAXIMUM_COOKIE_AGE,
@@ -698,6 +700,22 @@ midori_web_settings_class_init (MidoriWebSettingsClass* class)
         "full-content-zoom") ? G_PARAM_READWRITE : G_PARAM_READABLE)
         | G_PARAM_STATIC_STRINGS));
 
+    /**
+    * MidoriWebSettings:find-while-typing:
+    *
+    * Whether to automatically find inline while typing something.
+    *
+    * Since: 0.1.4
+    */
+    g_object_class_install_property (gobject_class,
+                                     PROP_FIND_WHILE_TYPING,
+                                     g_param_spec_boolean (
+                                     "find-while-typing",
+                                     _("Find inline while typing"),
+                                     _("Whether to automatically find inline while typing"),
+                                     TRUE,
+                                     flags));
+
     g_object_class_install_property (gobject_class,
                                      PROP_ACCEPT_COOKIES,
                                      g_param_spec_enum (
@@ -1104,6 +1122,9 @@ midori_web_settings_set_property (GObject*      object,
     case PROP_ZOOM_TEXT_AND_IMAGES:
         web_settings->zoom_text_and_images = g_value_get_boolean (value);
         break;
+    case PROP_FIND_WHILE_TYPING:
+        web_settings->find_while_typing = g_value_get_boolean (value);
+        break;
     case PROP_ACCEPT_COOKIES:
         web_settings->accept_cookies = g_value_get_enum (value);
         break;
@@ -1277,6 +1298,9 @@ midori_web_settings_get_property (GObject*    object,
     case PROP_ZOOM_TEXT_AND_IMAGES:
         g_value_set_boolean (value, web_settings->zoom_text_and_images);
         break;
+    case PROP_FIND_WHILE_TYPING:
+        g_value_set_boolean (value, web_settings->find_while_typing);
+        break;
     case PROP_ACCEPT_COOKIES:
         g_value_set_enum (value, web_settings->accept_cookies);
         break;