diff options
Diffstat (limited to 'src/plugins/fs/search.c')
-rw-r--r-- | src/plugins/fs/search.c | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/src/plugins/fs/search.c b/src/plugins/fs/search.c index 2fd26f51..f7cc87d4 100644 --- a/src/plugins/fs/search.c +++ b/src/plugins/fs/search.c | |||
@@ -34,6 +34,26 @@ | |||
34 | #include <GNUnet/gnunet_util_crypto.h> | 34 | #include <GNUnet/gnunet_util_crypto.h> |
35 | #include <GNUnet/gnunet_namespace_lib.h> | 35 | #include <GNUnet/gnunet_namespace_lib.h> |
36 | 36 | ||
37 | |||
38 | /** | ||
39 | * The user has edited the search entry. | ||
40 | * Update search button status. | ||
41 | */ | ||
42 | static void on_fssearchSelectionChanged(gpointer signal, | ||
43 | gpointer cls) { | ||
44 | SearchList * list = cls; | ||
45 | GtkTreeSelection * selection; | ||
46 | GtkWidget * downloadButton; | ||
47 | |||
48 | selection = gtk_tree_view_get_selection(list->treeview); | ||
49 | downloadButton | ||
50 | = glade_xml_get_widget(list->searchXML, | ||
51 | "downloadButton"); | ||
52 | gtk_widget_set_sensitive(downloadButton, | ||
53 | gtk_tree_selection_count_selected_rows(selection) > 0); | ||
54 | } | ||
55 | |||
56 | |||
37 | /* **************** FSUI event handling ****************** */ | 57 | /* **************** FSUI event handling ****************** */ |
38 | 58 | ||
39 | /** | 59 | /** |
@@ -221,6 +241,12 @@ fs_search_started(struct FSUI_SearchList * fsui_list, | |||
221 | gtk_tree_selection_set_mode(gtk_tree_view_get_selection(list->treeview), | 241 | gtk_tree_selection_set_mode(gtk_tree_view_get_selection(list->treeview), |
222 | GTK_SELECTION_MULTIPLE); | 242 | GTK_SELECTION_MULTIPLE); |
223 | 243 | ||
244 | g_signal_connect_data(gtk_tree_view_get_selection(list->treeview), | ||
245 | "changed", | ||
246 | G_CALLBACK(&on_fssearchSelectionChanged), | ||
247 | list, | ||
248 | NULL, | ||
249 | 0); | ||
224 | renderer = gtk_cell_renderer_text_new(); | 250 | renderer = gtk_cell_renderer_text_new(); |
225 | col = gtk_tree_view_insert_column_with_attributes(list->treeview, | 251 | col = gtk_tree_view_insert_column_with_attributes(list->treeview, |
226 | -1, | 252 | -1, |
@@ -462,6 +488,25 @@ void fs_search_stopped(SearchList * list) { | |||
462 | 488 | ||
463 | 489 | ||
464 | /** | 490 | /** |
491 | * The user has edited the search entry. | ||
492 | * Update search button status. | ||
493 | */ | ||
494 | void on_fssearchKeywordComboBoxEntry_changed_fs(gpointer dummy2, | ||
495 | GtkWidget * searchEntry) { | ||
496 | const char * searchString; | ||
497 | GtkWidget * searchButton; | ||
498 | |||
499 | searchString = getEntryLineValue(getMainXML(), | ||
500 | "fssearchKeywordComboBoxEntry"); | ||
501 | searchButton | ||
502 | = glade_xml_get_widget(getMainXML(), | ||
503 | "fssearchbutton"); | ||
504 | gtk_widget_set_sensitive(searchButton, | ||
505 | strlen(searchString) > 0); | ||
506 | } | ||
507 | |||
508 | |||
509 | /** | ||
465 | * The user has clicked the "SEARCH" button. | 510 | * The user has clicked the "SEARCH" button. |
466 | * Initiate a search. | 511 | * Initiate a search. |
467 | */ | 512 | */ |