diff options
author | Christian Grothoff <christian@grothoff.org> | 2010-08-07 21:51:50 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2010-08-07 21:51:50 +0000 |
commit | 0bd8759e5614f0bde8d5be333e9542058742524c (patch) | |
tree | 5d3c3e6b2846818ee435013cf162e004c89992e9 | |
parent | cd2b63beb8818417a4ed07a84623b6ff80a5fba3 (diff) | |
download | gnunet-gtk-0bd8759e5614f0bde8d5be333e9542058742524c.tar.gz gnunet-gtk-0bd8759e5614f0bde8d5be333e9542058742524c.zip |
done
-rw-r--r-- | contrib/search_dialog.glade | 33 | ||||
-rw-r--r-- | src/main_window_file_search.c | 34 |
2 files changed, 51 insertions, 16 deletions
diff --git a/contrib/search_dialog.glade b/contrib/search_dialog.glade index 6f05811b..59a6025d 100644 --- a/contrib/search_dialog.glade +++ b/contrib/search_dialog.glade | |||
@@ -2,17 +2,11 @@ | |||
2 | <interface> | 2 | <interface> |
3 | <requires lib="gtk+" version="2.20"/> | 3 | <requires lib="gtk+" version="2.20"/> |
4 | <!-- interface-naming-policy project-wide --> | 4 | <!-- interface-naming-policy project-wide --> |
5 | <object class="GtkListStore" id="GNUNET_GTK_namespace_list_store"> | 5 | <object class="GtkAdjustment" id="GNUNET_GTK_search_anonymity_adjustment"> |
6 | <columns> | 6 | <property name="upper">100000</property> |
7 | <!-- column-name unique_name --> | 7 | <property name="value">1</property> |
8 | <column type="gchararray"/> | 8 | <property name="step_increment">1</property> |
9 | <!-- column-name namespace_root --> | 9 | <property name="page_increment">10</property> |
10 | <column type="gchararray"/> | ||
11 | <!-- column-name nsid --> | ||
12 | <column type="gpointer"/> | ||
13 | <!-- column-name namespace_description --> | ||
14 | <column type="gchararray"/> | ||
15 | </columns> | ||
16 | </object> | 10 | </object> |
17 | <object class="GtkDialog" id="GNUNET_GTK_search_dialog"> | 11 | <object class="GtkDialog" id="GNUNET_GTK_search_dialog"> |
18 | <property name="width_request">500</property> | 12 | <property name="width_request">500</property> |
@@ -106,6 +100,7 @@ | |||
106 | <property name="model">GNUNET_GTK_namespace_list_store</property> | 100 | <property name="model">GNUNET_GTK_namespace_list_store</property> |
107 | <property name="reorderable">True</property> | 101 | <property name="reorderable">True</property> |
108 | <property name="rules_hint">True</property> | 102 | <property name="rules_hint">True</property> |
103 | <signal name="row-activated" handler="GNUNET_GTK_search_dialog_namespace_tree_view_row_activated_cb" swapped="no"/> | ||
109 | <child> | 104 | <child> |
110 | <object class="GtkTreeViewColumn" id="GNUNET_GTK_search_dialog_namespace_name_column"> | 105 | <object class="GtkTreeViewColumn" id="GNUNET_GTK_search_dialog_namespace_name_column"> |
111 | <property name="resizable">True</property> | 106 | <property name="resizable">True</property> |
@@ -207,10 +202,16 @@ | |||
207 | <action-widget response="0">GNUNET_GTK_search_dialog_search_button</action-widget> | 202 | <action-widget response="0">GNUNET_GTK_search_dialog_search_button</action-widget> |
208 | </action-widgets> | 203 | </action-widgets> |
209 | </object> | 204 | </object> |
210 | <object class="GtkAdjustment" id="GNUNET_GTK_search_anonymity_adjustment"> | 205 | <object class="GtkListStore" id="GNUNET_GTK_namespace_list_store"> |
211 | <property name="upper">100000</property> | 206 | <columns> |
212 | <property name="value">1</property> | 207 | <!-- column-name unique_name --> |
213 | <property name="step_increment">1</property> | 208 | <column type="gchararray"/> |
214 | <property name="page_increment">10</property> | 209 | <!-- column-name namespace_root --> |
210 | <column type="gchararray"/> | ||
211 | <!-- column-name nsid --> | ||
212 | <column type="gpointer"/> | ||
213 | <!-- column-name namespace_description --> | ||
214 | <column type="gchararray"/> | ||
215 | </columns> | ||
215 | </object> | 216 | </object> |
216 | </interface> | 217 | </interface> |
diff --git a/src/main_window_file_search.c b/src/main_window_file_search.c index 0de40d62..4911cbcb 100644 --- a/src/main_window_file_search.c +++ b/src/main_window_file_search.c | |||
@@ -30,6 +30,40 @@ | |||
30 | static GtkBuilder *builder; | 30 | static GtkBuilder *builder; |
31 | 31 | ||
32 | 32 | ||
33 | /** | ||
34 | * User double-clicked on namespace or pressed enter; | ||
35 | * move namespace root to the 'keywords' line. | ||
36 | */ | ||
37 | void | ||
38 | GNUNET_GTK_search_dialog_namespace_tree_view_row_activated_cb (GtkTreeView *tree_view, | ||
39 | GtkTreePath *path, | ||
40 | GtkTreeViewColumn *column, | ||
41 | gpointer user_data) | ||
42 | { | ||
43 | GtkTreeModel *ls; | ||
44 | GtkTreeSelection *sel; | ||
45 | GtkEntry *query; | ||
46 | GtkTreeIter iter; | ||
47 | char *root; | ||
48 | |||
49 | query = GTK_ENTRY (gtk_builder_get_object (builder, | ||
50 | "GNUNET_GTK_search_dialog_keyword_entry")); | ||
51 | sel = gtk_tree_view_get_selection (tree_view); | ||
52 | if (TRUE == | ||
53 | gtk_tree_selection_get_selected (sel, | ||
54 | &ls, | ||
55 | &iter)) | ||
56 | { | ||
57 | gtk_tree_model_get (ls, &iter, | ||
58 | 1, &root, | ||
59 | -1); | ||
60 | gtk_entry_set_text (query, | ||
61 | root); | ||
62 | GNUNET_free (root); | ||
63 | } | ||
64 | } | ||
65 | |||
66 | |||
33 | void | 67 | void |
34 | GNUNET_GTK_search_dialog_search_button_clicked_cb (GtkWidget * dummy, | 68 | GNUNET_GTK_search_dialog_search_button_clicked_cb (GtkWidget * dummy, |
35 | gpointer data) | 69 | gpointer data) |