Disable FIF extra options entry when checkbox is not checked.
git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@1476 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
parent
6ebf6aa2f5
commit
8154ee59c8
@ -1,3 +1,9 @@
|
||||
2007-04-24 Nick Treleaven <nick.treleaven@btinternet.com>
|
||||
|
||||
* src/search.c:
|
||||
Disable FIF extra options entry when checkbox is not checked.
|
||||
|
||||
|
||||
2007-04-23 Nick Treleaven <nick.treleaven@btinternet.com>
|
||||
|
||||
* src/build.c:
|
||||
|
16
src/search.c
16
src/search.c
@ -530,12 +530,11 @@ void search_show_replace_dialog()
|
||||
}
|
||||
|
||||
|
||||
static gboolean on_entry_extra_key_press(GtkWidget *widget, GdkEventKey *event,
|
||||
gpointer user_data)
|
||||
static void on_extra_options_toggled(GtkToggleButton *togglebutton, gpointer user_data)
|
||||
{
|
||||
// enable extra option checkbutton when extra entry is edited
|
||||
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(user_data), TRUE);
|
||||
return FALSE;
|
||||
// disable extra option entry when checkbutton not checked
|
||||
gtk_widget_set_sensitive(GTK_WIDGET(user_data),
|
||||
gtk_toggle_button_get_active(togglebutton));
|
||||
}
|
||||
|
||||
|
||||
@ -682,13 +681,16 @@ void search_show_find_in_files_dialog()
|
||||
entry_extra = gtk_entry_new();
|
||||
if (search_prefs.fif_extra_options)
|
||||
gtk_entry_set_text(GTK_ENTRY(entry_extra), search_prefs.fif_extra_options);
|
||||
gtk_widget_set_sensitive(entry_extra, FALSE);
|
||||
g_object_set_data_full(G_OBJECT(widgets.find_in_files_dialog), "entry_extra",
|
||||
gtk_widget_ref(entry_extra), (GDestroyNotify)gtk_widget_unref);
|
||||
g_signal_connect(G_OBJECT(entry_extra), "key-press-event",
|
||||
G_CALLBACK(on_entry_extra_key_press), check_extra);
|
||||
gtk_tooltips_set_tip(tooltips, entry_extra,
|
||||
_("Other options to pass to Grep"), NULL);
|
||||
|
||||
// enable entry_extra when check_extra is checked
|
||||
g_signal_connect(G_OBJECT(check_extra), "toggled",
|
||||
G_CALLBACK(on_extra_options_toggled), entry_extra);
|
||||
|
||||
hbox = gtk_hbox_new(FALSE, 6);
|
||||
gtk_box_pack_start(GTK_BOX(hbox), check_extra, FALSE, FALSE, 0);
|
||||
gtk_box_pack_start(GTK_BOX(hbox), entry_extra, TRUE, TRUE, 0);
|
||||
|
Loading…
x
Reference in New Issue
Block a user