From: Christian Dywan Date: Tue, 22 May 2012 22:43:49 +0000 (+0200) Subject: Confirm Caret Browsing before enabling it X-Git-Url: https://spindle.queued.net/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=01541da48f323eaa413d5706ed14e4dc6704b963;p=midori Confirm Caret Browsing before enabling it Fixes: https://bugs.launchpad.net/midori/+bug/797923 --- diff --git a/midori/midori-browser.c b/midori/midori-browser.c index d1ae4e82..042a06aa 100644 --- a/midori/midori-browser.c +++ b/midori/midori-browser.c @@ -3483,7 +3483,30 @@ static void _action_caret_browsing_activate (GtkAction* action, MidoriBrowser* browser) { - _("Toggle text cursor navigation"); + gint response; + GtkWidget* dialog; + + if (!katze_object_get_boolean (browser->settings, "enable-caret-browsing")) + { + dialog = gtk_message_dialog_new (GTK_WINDOW (browser), + GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_NO_SEPARATOR, + GTK_MESSAGE_QUESTION, GTK_BUTTONS_NONE, + _("Toggle text cursor navigation")); + gtk_window_set_title (GTK_WINDOW (dialog), _("Toggle text cursor navigation")); + gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog), + _("Pressing F7 toggles Caret Browsing. When active, a text cursor appears in all websites.")); + gtk_dialog_add_buttons (GTK_DIALOG (dialog), + GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, + _("_Enable Caret Browsing"), GTK_RESPONSE_ACCEPT, + NULL); + + response = gtk_dialog_run (GTK_DIALOG (dialog)); + gtk_widget_destroy (dialog); + + if (response != GTK_RESPONSE_ACCEPT) + return; + } + g_object_set (browser->settings, "enable-caret-browsing", !katze_object_get_boolean (browser->settings, "enable-caret-browsing"), NULL); }