Revision: 5695 http://geany.svn.sourceforge.net/geany/?rev=5695&view=rev Author: ntrel Date: 2011-04-05 16:16:47 +0000 (Tue, 05 Apr 2011)
Log Message: ----------- Don't auto-enable case-sensitive option when enabling regex in Find/Replace dialogs.
Modified Paths: -------------- trunk/ChangeLog trunk/src/search.c
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2011-04-05 15:47:31 UTC (rev 5694) +++ trunk/ChangeLog 2011-04-05 16:16:47 UTC (rev 5695) @@ -2,6 +2,9 @@
* src/templates.c: Remove TEMPLATES_GET_FILENAME() macro. + * src/search.c: + Don't auto-enable case-sensitive option when enabling regex in + Find/Replace dialogs.
2011-04-04 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
Modified: trunk/src/search.c =================================================================== --- trunk/src/search.c 2011-04-05 15:47:31 UTC (rev 5694) +++ trunk/src/search.c 2011-04-05 16:16:47 UTC (rev 5695) @@ -285,7 +285,7 @@ ui_widget_set_tooltip_text(check_regexp, _("Use POSIX-like regular expressions. " "For detailed information about using regular expressions, please read the documentation.")); g_signal_connect(check_regexp, "toggled", - G_CALLBACK(on_find_replace_checkbutton_toggled), GTK_WIDGET(dialog)); + G_CALLBACK(on_find_replace_checkbutton_toggled), dialog);
if (dialog != GTK_DIALOG(find_dlg.dialog)) { @@ -1040,34 +1040,15 @@ gboolean regex_set = gtk_toggle_button_get_active(chk_regexp); GtkWidget *check_word = ui_lookup_widget(dialog, "check_word"); GtkWidget *check_wordstart = ui_lookup_widget(dialog, "check_wordstart"); - GtkToggleButton *check_case = GTK_TOGGLE_BUTTON( - ui_lookup_widget(dialog, "check_case")); GtkWidget *check_escape = ui_lookup_widget(dialog, "check_escape"); gboolean replace = (dialog != find_dlg.dialog); const char *back_button[2] = { "btn_previous" , "check_back" }; - static gboolean case_state[2] = { FALSE, FALSE }; /* state before regex enabled */
/* hide options that don't apply to regex searches */ gtk_widget_set_sensitive(check_escape, ! regex_set); gtk_widget_set_sensitive(ui_lookup_widget(dialog, back_button[replace]), ! regex_set); gtk_widget_set_sensitive(check_word, ! regex_set); gtk_widget_set_sensitive(check_wordstart, ! regex_set); - - if (regex_set) /* regex enabled */ - { - if (GTK_WIDGET_VISIBLE(dialog)) - { - /* Enable case sensitive but remember original case toggle state */ - case_state[replace] = gtk_toggle_button_get_active(check_case); - gtk_toggle_button_set_active(check_case, TRUE); - } - } - else /* regex disabled */ - { - /* If case sensitive is still enabled, revert to what it was before we enabled it */ - if (gtk_toggle_button_get_active(check_case) == TRUE) - gtk_toggle_button_set_active(check_case, case_state[replace]); - } } }
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.