aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2011-12-12 15:35:53 +0000
committerChristian Grothoff <christian@grothoff.org>2011-12-12 15:35:53 +0000
commit2286ffb9dbfd8e07f0017a1c20050e6f823e23aa (patch)
treea72520231e6a07c4fecfee7d63e11661dd1dfa4c
parentdcd47d9097d9211f6f7c1d253b8adb4c19f79a91 (diff)
downloadgnunet-gtk-2286ffb9dbfd8e07f0017a1c20050e6f823e23aa.tar.gz
gnunet-gtk-2286ffb9dbfd8e07f0017a1c20050e6f823e23aa.zip
applying patches from #1759 towards making the GUI nicer; specifically, this covers 0004-new-search-bar, 0001-lump-and-tweaks, 2-get-text-from-combo, 3-do-not-use-new-search-tab, 4-fix-search-tab-label, 1-make-tabs-smaller, 2-remove-has-entry, 3-revert-get-text-from-combobox
-rw-r--r--contrib/gnunet_fs_gtk_main_window.glade575
-rw-r--r--contrib/gnunet_fs_gtk_search_tab.glade295
-rw-r--r--src/fs/gnunet-fs-gtk-main_window_view_toggles.c9
-rw-r--r--src/fs/gnunet-fs-gtk.c415
4 files changed, 1077 insertions, 217 deletions
diff --git a/contrib/gnunet_fs_gtk_main_window.glade b/contrib/gnunet_fs_gtk_main_window.glade
index cb0b2766..ac572bb2 100644
--- a/contrib/gnunet_fs_gtk_main_window.glade
+++ b/contrib/gnunet_fs_gtk_main_window.glade
@@ -2,54 +2,54 @@
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="GtkImage" id="image5">
6 <property name="visible">True</property>
7 <property name="stock">gtk-go-down</property>
8 </object>
9 <object class="GtkImage" id="image4">
10 <property name="visible">True</property>
11 <property name="stock">gtk-find</property>
12 </object>
13 <object class="GtkImage" id="image1">
14 <property name="visible">True</property>
15 <property name="stock">gtk-open</property>
16 </object>
17 <object class="GtkImage" id="image3">
18 <property name="visible">True</property>
19 <property name="stock">gtk-new</property>
20 </object>
21 <object class="GtkImage" id="image2">
22 <property name="visible">True</property>
23 <property name="stock">gtk-go-up</property>
24 </object>
25 <object class="GtkWindow" id="GNUNET_GTK_main_window"> 5 <object class="GtkWindow" id="GNUNET_GTK_main_window">
6 <property name="can_focus">False</property>
26 <property name="title" translatable="yes">gnunet-fs-gtk</property> 7 <property name="title" translatable="yes">gnunet-fs-gtk</property>
27 <property name="window_position">center</property> 8 <property name="window_position">center</property>
28 <property name="default_width">700</property> 9 <property name="default_width">700</property>
29 <property name="default_height">500</property> 10 <property name="default_height">500</property>
30 <property name="icon_name">gnunet-gtk</property> 11 <property name="icon_name">gnunet-gtk</property>
31 <signal name="delete-event" handler="GNUNET_GTK_quit_cb" after="yes" swapped="no"/> 12 <signal name="delete-event" handler="GNUNET_GTK_quit_cb" after="yes" swapped="no"/>
13 <signal name="realize" handler="GNUNET_GTK_main_window_realize_cb" swapped="no"/>
32 <child> 14 <child>
33 <object class="GtkVBox" id="GNUNET_GTK_main_window_vbox"> 15 <object class="GtkVBox" id="GNUNET_GTK_main_window_vbox">
34 <property name="visible">True</property> 16 <property name="visible">True</property>
17 <property name="can_focus">False</property>
18 <child>
19 <object class="GtkStatusbar" id="GNUNET_GTK_status_bar">
20 <property name="visible">True</property>
21 <property name="can_focus">False</property>
22 <property name="spacing">2</property>
23 </object>
24 <packing>
25 <property name="expand">False</property>
26 <property name="fill">True</property>
27 <property name="pack_type">end</property>
28 <property name="position">0</property>
29 </packing>
30 </child>
35 <child> 31 <child>
36 <object class="GtkMenuBar" id="GNUNET_GTK_main_menu"> 32 <object class="GtkMenuBar" id="GNUNET_GTK_main_menu">
37 <property name="visible">True</property> 33 <property name="visible">True</property>
34 <property name="can_focus">False</property>
38 <child> 35 <child>
39 <object class="GtkMenuItem" id="GNUNET_GTK_main_menu_file_sharing"> 36 <object class="GtkMenuItem" id="GNUNET_GTK_main_menu_file_sharing">
40 <property name="visible">True</property>
41 <property name="use_action_appearance">False</property> 37 <property name="use_action_appearance">False</property>
38 <property name="visible">True</property>
39 <property name="can_focus">False</property>
42 <property name="label" translatable="yes">_File sharing</property> 40 <property name="label" translatable="yes">_File sharing</property>
43 <property name="use_underline">True</property> 41 <property name="use_underline">True</property>
44 <child type="submenu"> 42 <child type="submenu">
45 <object class="GtkMenu" id="GNUNET_GTK_main_menu_file_sharing_box"> 43 <object class="GtkMenu" id="GNUNET_GTK_main_menu_file_sharing_box">
46 <property name="visible">True</property> 44 <property name="visible">True</property>
45 <property name="can_focus">False</property>
47 <child> 46 <child>
48 <object class="GtkImageMenuItem" id="GNUNET_GTK_main_menu_file_create_pseudonym"> 47 <object class="GtkImageMenuItem" id="GNUNET_GTK_main_menu_file_create_pseudonym">
49 <property name="label" translatable="yes">_Create pseudonym</property> 48 <property name="label" translatable="yes">_Create pseudonym</property>
49 <property name="use_action_appearance">False</property>
50 <property name="visible">True</property> 50 <property name="visible">True</property>
51 <property name="can_focus">False</property>
51 <property name="tooltip_text" translatable="yes">Create a pseudonym for publishing content. Note that you can also publish content anonymously (without using a pseudonym).</property> 52 <property name="tooltip_text" translatable="yes">Create a pseudonym for publishing content. Note that you can also publish content anonymously (without using a pseudonym).</property>
52 <property name="use_action_appearance">False</property>
53 <property name="accel_path">&lt;gnunet-fs-gtk&gt;/File sharing/Create pseudonym</property> 53 <property name="accel_path">&lt;gnunet-fs-gtk&gt;/File sharing/Create pseudonym</property>
54 <property name="use_underline">True</property> 54 <property name="use_underline">True</property>
55 <property name="image">image3</property> 55 <property name="image">image3</property>
@@ -61,8 +61,9 @@
61 <child> 61 <child>
62 <object class="GtkImageMenuItem" id="GNUNET_GTK_main_menu_file_advertise_pseudonym"> 62 <object class="GtkImageMenuItem" id="GNUNET_GTK_main_menu_file_advertise_pseudonym">
63 <property name="label" translatable="yes">_Advertise Pseudonym</property> 63 <property name="label" translatable="yes">_Advertise Pseudonym</property>
64 <property name="visible">True</property>
65 <property name="use_action_appearance">False</property> 64 <property name="use_action_appearance">False</property>
65 <property name="visible">True</property>
66 <property name="can_focus">False</property>
66 <property name="use_underline">True</property> 67 <property name="use_underline">True</property>
67 <property name="image">image6</property> 68 <property name="image">image6</property>
68 <property name="use_stock">False</property> 69 <property name="use_stock">False</property>
@@ -72,9 +73,10 @@
72 <child> 73 <child>
73 <object class="GtkImageMenuItem" id="GNUNET_GTK_main_menu_file_publish"> 74 <object class="GtkImageMenuItem" id="GNUNET_GTK_main_menu_file_publish">
74 <property name="label" translatable="yes">_Publish</property> 75 <property name="label" translatable="yes">_Publish</property>
76 <property name="use_action_appearance">False</property>
75 <property name="visible">True</property> 77 <property name="visible">True</property>
78 <property name="can_focus">False</property>
76 <property name="tooltip_text" translatable="yes">Publish files or directories on GNUnet</property> 79 <property name="tooltip_text" translatable="yes">Publish files or directories on GNUnet</property>
77 <property name="use_action_appearance">False</property>
78 <property name="accel_path">&lt;gnunet-fs-gtk&gt;/File sharing/Publish</property> 80 <property name="accel_path">&lt;gnunet-fs-gtk&gt;/File sharing/Publish</property>
79 <property name="use_underline">True</property> 81 <property name="use_underline">True</property>
80 <property name="image">image2</property> 82 <property name="image">image2</property>
@@ -85,16 +87,18 @@
85 </child> 87 </child>
86 <child> 88 <child>
87 <object class="GtkSeparatorMenuItem" id="GNUNET_GTK_main_menu_file_sep1"> 89 <object class="GtkSeparatorMenuItem" id="GNUNET_GTK_main_menu_file_sep1">
88 <property name="visible">True</property>
89 <property name="use_action_appearance">False</property> 90 <property name="use_action_appearance">False</property>
91 <property name="visible">True</property>
92 <property name="can_focus">False</property>
90 </object> 93 </object>
91 </child> 94 </child>
92 <child> 95 <child>
93 <object class="GtkImageMenuItem" id="GNUNET_GTK_main_menu_file_search"> 96 <object class="GtkImageMenuItem" id="GNUNET_GTK_main_menu_file_search">
94 <property name="label" translatable="yes">_Search</property> 97 <property name="label" translatable="yes">_Search</property>
98 <property name="use_action_appearance">False</property>
95 <property name="visible">True</property> 99 <property name="visible">True</property>
100 <property name="can_focus">False</property>
96 <property name="tooltip_text" translatable="yes">Search GNUnet for files</property> 101 <property name="tooltip_text" translatable="yes">Search GNUnet for files</property>
97 <property name="use_action_appearance">False</property>
98 <property name="accel_path">&lt;gnunet-fs-gtk&gt;/File sharing/Search</property> 102 <property name="accel_path">&lt;gnunet-fs-gtk&gt;/File sharing/Search</property>
99 <property name="use_underline">True</property> 103 <property name="use_underline">True</property>
100 <property name="image">image4</property> 104 <property name="image">image4</property>
@@ -105,16 +109,18 @@
105 </child> 109 </child>
106 <child> 110 <child>
107 <object class="GtkSeparatorMenuItem" id="GNUNET_GTK_main_menu_file_sep2"> 111 <object class="GtkSeparatorMenuItem" id="GNUNET_GTK_main_menu_file_sep2">
108 <property name="visible">True</property>
109 <property name="use_action_appearance">False</property> 112 <property name="use_action_appearance">False</property>
113 <property name="visible">True</property>
114 <property name="can_focus">False</property>
110 </object> 115 </object>
111 </child> 116 </child>
112 <child> 117 <child>
113 <object class="GtkImageMenuItem" id="GNUNET_GTK_main_menu_file_download_uri"> 118 <object class="GtkImageMenuItem" id="GNUNET_GTK_main_menu_file_download_uri">
114 <property name="label" translatable="yes">_Download</property> 119 <property name="label" translatable="yes">_Download</property>
120 <property name="use_action_appearance">False</property>
115 <property name="visible">True</property> 121 <property name="visible">True</property>
122 <property name="can_focus">False</property>
116 <property name="tooltip_text" translatable="yes">Download a file or directory with a known URI.</property> 123 <property name="tooltip_text" translatable="yes">Download a file or directory with a known URI.</property>
117 <property name="use_action_appearance">False</property>
118 <property name="accel_path">&lt;gnunet-fs-gtk&gt;/File sharing/Download</property> 124 <property name="accel_path">&lt;gnunet-fs-gtk&gt;/File sharing/Download</property>
119 <property name="use_underline">True</property> 125 <property name="use_underline">True</property>
120 <property name="image">image5</property> 126 <property name="image">image5</property>
@@ -126,9 +132,10 @@
126 <child> 132 <child>
127 <object class="GtkImageMenuItem" id="GNUNET_GTK_main_menu_file_open_gnunet_directory"> 133 <object class="GtkImageMenuItem" id="GNUNET_GTK_main_menu_file_open_gnunet_directory">
128 <property name="label" translatable="yes">_Open GNUnet directory</property> 134 <property name="label" translatable="yes">_Open GNUnet directory</property>
135 <property name="use_action_appearance">False</property>
129 <property name="visible">True</property> 136 <property name="visible">True</property>
137 <property name="can_focus">False</property>
130 <property name="tooltip_text" translatable="yes">Use this option to browse a GNUnet directory file that has been previously downloaded.</property> 138 <property name="tooltip_text" translatable="yes">Use this option to browse a GNUnet directory file that has been previously downloaded.</property>
131 <property name="use_action_appearance">False</property>
132 <property name="accel_path">&lt;gnunet-fs-gtk&gt;/File sharing/Open directory</property> 139 <property name="accel_path">&lt;gnunet-fs-gtk&gt;/File sharing/Open directory</property>
133 <property name="use_underline">True</property> 140 <property name="use_underline">True</property>
134 <property name="image">image1</property> 141 <property name="image">image1</property>
@@ -139,16 +146,18 @@
139 </child> 146 </child>
140 <child> 147 <child>
141 <object class="GtkSeparatorMenuItem" id="GNUNET_GTK_main_menu_file_sep3"> 148 <object class="GtkSeparatorMenuItem" id="GNUNET_GTK_main_menu_file_sep3">
142 <property name="visible">True</property>
143 <property name="use_action_appearance">False</property> 149 <property name="use_action_appearance">False</property>
150 <property name="visible">True</property>
151 <property name="can_focus">False</property>
144 </object> 152 </object>
145 </child> 153 </child>
146 <child> 154 <child>
147 <object class="GtkImageMenuItem" id="GNUNET_GTK_main_menu_file_quit"> 155 <object class="GtkImageMenuItem" id="GNUNET_GTK_main_menu_file_quit">
148 <property name="label">gtk-quit</property> 156 <property name="label">gtk-quit</property>
157 <property name="use_action_appearance">False</property>
149 <property name="visible">True</property> 158 <property name="visible">True</property>
159 <property name="can_focus">False</property>
150 <property name="tooltip_text" translatable="yes">Exit gnunet-fs-gtk. Active file-sharing operations will resume upon restart.</property> 160 <property name="tooltip_text" translatable="yes">Exit gnunet-fs-gtk. Active file-sharing operations will resume upon restart.</property>
151 <property name="use_action_appearance">False</property>
152 <property name="accel_path">&lt;gnunet-fs-gtk&gt;/Quit</property> 161 <property name="accel_path">&lt;gnunet-fs-gtk&gt;/Quit</property>
153 <property name="use_underline">True</property> 162 <property name="use_underline">True</property>
154 <property name="use_stock">True</property> 163 <property name="use_stock">True</property>
@@ -163,17 +172,20 @@
163 <child> 172 <child>
164 <object class="GtkMenuItem" id="GNUNET_GTK_main_menu_edit"> 173 <object class="GtkMenuItem" id="GNUNET_GTK_main_menu_edit">
165 <property name="use_action_appearance">False</property> 174 <property name="use_action_appearance">False</property>
175 <property name="can_focus">False</property>
166 <property name="label" translatable="yes">_Edit</property> 176 <property name="label" translatable="yes">_Edit</property>
167 <property name="use_underline">True</property> 177 <property name="use_underline">True</property>
168 <child type="submenu"> 178 <child type="submenu">
169 <object class="GtkMenu" id="GNUNET_GTK_main_menu_edit_box"> 179 <object class="GtkMenu" id="GNUNET_GTK_main_menu_edit_box">
170 <property name="visible">True</property> 180 <property name="visible">True</property>
181 <property name="can_focus">False</property>
171 <child> 182 <child>
172 <object class="GtkImageMenuItem" id="GNUNET_GTK_main_menu_edit_preferences"> 183 <object class="GtkImageMenuItem" id="GNUNET_GTK_main_menu_edit_preferences">
173 <property name="label">gtk-preferences</property> 184 <property name="label">gtk-preferences</property>
185 <property name="use_action_appearance">False</property>
174 <property name="visible">True</property> 186 <property name="visible">True</property>
187 <property name="can_focus">False</property>
175 <property name="tooltip_text" translatable="yes">Edit the system configuration.</property> 188 <property name="tooltip_text" translatable="yes">Edit the system configuration.</property>
176 <property name="use_action_appearance">False</property>
177 <property name="accel_path">&lt;gnunet-fs-gtk&gt;/Edit/Preferences</property> 189 <property name="accel_path">&lt;gnunet-fs-gtk&gt;/Edit/Preferences</property>
178 <property name="use_underline">True</property> 190 <property name="use_underline">True</property>
179 <property name="use_stock">True</property> 191 <property name="use_stock">True</property>
@@ -185,18 +197,21 @@
185 </child> 197 </child>
186 <child> 198 <child>
187 <object class="GtkMenuItem" id="GNUNET_GTK_main_menu_view"> 199 <object class="GtkMenuItem" id="GNUNET_GTK_main_menu_view">
188 <property name="visible">True</property>
189 <property name="use_action_appearance">False</property> 200 <property name="use_action_appearance">False</property>
201 <property name="visible">True</property>
202 <property name="can_focus">False</property>
190 <property name="label" translatable="yes">_View</property> 203 <property name="label" translatable="yes">_View</property>
191 <property name="use_underline">True</property> 204 <property name="use_underline">True</property>
192 <child type="submenu"> 205 <child type="submenu">
193 <object class="GtkMenu" id="GNUNET_GTK_main_menu_view_box"> 206 <object class="GtkMenu" id="GNUNET_GTK_main_menu_view_box">
194 <property name="visible">True</property> 207 <property name="visible">True</property>
208 <property name="can_focus">False</property>
195 <child> 209 <child>
196 <object class="GtkCheckMenuItem" id="GNUNET_GTK_main_menu_view_metadata"> 210 <object class="GtkCheckMenuItem" id="GNUNET_GTK_main_menu_view_metadata">
211 <property name="use_action_appearance">False</property>
197 <property name="visible">True</property> 212 <property name="visible">True</property>
213 <property name="can_focus">False</property>
198 <property name="tooltip_text" translatable="yes">Show meta data in main window</property> 214 <property name="tooltip_text" translatable="yes">Show meta data in main window</property>
199 <property name="use_action_appearance">False</property>
200 <property name="label" translatable="yes">Metadata</property> 215 <property name="label" translatable="yes">Metadata</property>
201 <property name="use_underline">True</property> 216 <property name="use_underline">True</property>
202 <property name="active">True</property> 217 <property name="active">True</property>
@@ -205,34 +220,50 @@
205 </child> 220 </child>
206 <child> 221 <child>
207 <object class="GtkCheckMenuItem" id="GNUNET_GTK_main_menu_view_preview"> 222 <object class="GtkCheckMenuItem" id="GNUNET_GTK_main_menu_view_preview">
223 <property name="use_action_appearance">False</property>
208 <property name="visible">True</property> 224 <property name="visible">True</property>
225 <property name="can_focus">False</property>
209 <property name="tooltip_text" translatable="yes">Show preview (when available)</property> 226 <property name="tooltip_text" translatable="yes">Show preview (when available)</property>
210 <property name="use_action_appearance">False</property>
211 <property name="label" translatable="yes">Preview</property> 227 <property name="label" translatable="yes">Preview</property>
212 <property name="use_underline">True</property> 228 <property name="use_underline">True</property>
213 <property name="active">True</property> 229 <property name="active">True</property>
214 <signal name="toggled" handler="GNUNET_GTK_main_menu_view_preview_toggled_cb" swapped="no"/> 230 <signal name="toggled" handler="GNUNET_GTK_main_menu_view_preview_toggled_cb" swapped="no"/>
215 </object> 231 </object>
216 </child> 232 </child>
233 <child>
234 <object class="GtkCheckMenuItem" id="GNUNET_GTK_main_menu_search_preview">
235 <property name="use_action_appearance">False</property>
236 <property name="visible">True</property>
237 <property name="can_focus">False</property>
238 <property name="tooltip_text" translatable="yes">Show search box in main window</property>
239 <property name="label" translatable="yes">Search</property>
240 <property name="use_underline">True</property>
241 <property name="active">True</property>
242 <signal name="toggled" handler="GNUNET_GTK_main_menu_view_search_toggled_cb" swapped="no"/>
243 </object>
244 </child>
217 </object> 245 </object>
218 </child> 246 </child>
219 </object> 247 </object>
220 </child> 248 </child>
221 <child> 249 <child>
222 <object class="GtkMenuItem" id="GNUNET_GTK_main_menu_help"> 250 <object class="GtkMenuItem" id="GNUNET_GTK_main_menu_help">
223 <property name="visible">True</property>
224 <property name="use_action_appearance">False</property> 251 <property name="use_action_appearance">False</property>
252 <property name="visible">True</property>
253 <property name="can_focus">False</property>
225 <property name="label" translatable="yes">_Help</property> 254 <property name="label" translatable="yes">_Help</property>
226 <property name="use_underline">True</property> 255 <property name="use_underline">True</property>
227 <child type="submenu"> 256 <child type="submenu">
228 <object class="GtkMenu" id="GNUNET_GTK_main_menu_help_abou"> 257 <object class="GtkMenu" id="GNUNET_GTK_main_menu_help_abou">
229 <property name="visible">True</property> 258 <property name="visible">True</property>
259 <property name="can_focus">False</property>
230 <child> 260 <child>
231 <object class="GtkImageMenuItem" id="GNUNET_GTK_main_menu_help_about"> 261 <object class="GtkImageMenuItem" id="GNUNET_GTK_main_menu_help_about">
232 <property name="label">gtk-about</property> 262 <property name="label">gtk-about</property>
263 <property name="use_action_appearance">False</property>
233 <property name="visible">True</property> 264 <property name="visible">True</property>
265 <property name="can_focus">False</property>
234 <property name="tooltip_text" translatable="yes">Display information about this version of gnunet-fs-gtk</property> 266 <property name="tooltip_text" translatable="yes">Display information about this version of gnunet-fs-gtk</property>
235 <property name="use_action_appearance">False</property>
236 <property name="accel_path">&lt;gnunet-fs-gtk&gt;/Help/About</property> 267 <property name="accel_path">&lt;gnunet-fs-gtk&gt;/Help/About</property>
237 <property name="use_underline">True</property> 268 <property name="use_underline">True</property>
238 <property name="use_stock">True</property> 269 <property name="use_stock">True</property>
@@ -252,11 +283,13 @@
252 </child> 283 </child>
253 <child> 284 <child>
254 <object class="GtkToolbar" id="GNUNET_GTK_main_window_toolbar"> 285 <object class="GtkToolbar" id="GNUNET_GTK_main_window_toolbar">
286 <property name="can_focus">False</property>
255 <property name="toolbar_style">icons</property> 287 <property name="toolbar_style">icons</property>
256 <child> 288 <child>
257 <object class="GtkToolButton" id="GNUNET_GTK_toolbar_search"> 289 <object class="GtkToolButton" id="GNUNET_GTK_toolbar_search">
258 <property name="visible">True</property>
259 <property name="use_action_appearance">False</property> 290 <property name="use_action_appearance">False</property>
291 <property name="visible">True</property>
292 <property name="can_focus">False</property>
260 <property name="label" translatable="yes">_Search</property> 293 <property name="label" translatable="yes">_Search</property>
261 <property name="use_underline">True</property> 294 <property name="use_underline">True</property>
262 <property name="stock_id">gtk-find</property> 295 <property name="stock_id">gtk-find</property>
@@ -274,13 +307,246 @@
274 </packing> 307 </packing>
275 </child> 308 </child>
276 <child> 309 <child>
310 <object class="GtkHBox" id="main_window_search_hbox">
311 <property name="visible">True</property>
312 <property name="can_focus">False</property>
313 <property name="border_width">3</property>
314 <property name="spacing">4</property>
315 <child>
316 <object class="GtkLabel" id="main_window_search_namespace_label">
317 <property name="visible">True</property>
318 <property name="can_focus">False</property>
319 <property name="label" translatable="yes">Namespace:</property>
320 </object>
321 <packing>
322 <property name="expand">False</property>
323 <property name="fill">False</property>
324 <property name="position">0</property>
325 </packing>
326 </child>
327 <child>
328 <object class="GtkLabel" id="main_window_search_selected_namespace_label">
329 <property name="visible">True</property>
330 <property name="can_focus">False</property>
331 <property name="label">&lt;none&gt;</property>
332 <property name="single_line_mode">True</property>
333 </object>
334 <packing>
335 <property name="expand">False</property>
336 <property name="fill">False</property>
337 <property name="position">1</property>
338 </packing>
339 </child>
340 <child>
341 <object class="GtkAlignment" id="main_window_search_namespace_combobox_alignment">
342 <property name="visible">True</property>
343 <property name="can_focus">False</property>
344 <property name="xscale">0</property>
345 <property name="yscale">0</property>
346 <child>
347 <object class="GtkToggleButton" id="main_window_search_namespace_dropdown_button">
348 <property name="use_action_appearance">False</property>
349 <property name="width_request">21</property>
350 <property name="height_request">21</property>
351 <property name="visible">True</property>
352 <property name="can_focus">True</property>
353 <property name="receives_default">True</property>
354 <property name="events">GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK | GDK_STRUCTURE_MASK</property>
355 <property name="image_position">right</property>
356 <signal name="toggled" handler="main_window_search_namespace_dropdown_button_toggled_cb" swapped="no"/>
357 <signal name="enter-notify-event" handler="main_window_search_namespace_dropdown_button_enter_notify_event_cb" swapped="no"/>
358 <signal name="leave-notify-event" handler="namespace_selector_window_leave_notify_event_cb" swapped="no"/>
359 <child>
360 <object class="GtkArrow" id="arrow1">
361 <property name="visible">True</property>
362 <property name="can_focus">False</property>
363 <property name="arrow_type">down</property>
364 </object>
365 </child>
366 </object>
367 </child>
368 </object>
369 <packing>
370 <property name="expand">False</property>
371 <property name="fill">False</property>
372 <property name="position">2</property>
373 </packing>
374 </child>
375 <child>
376 <placeholder/>
377 </child>
378 <child>
379 <object class="GtkAlignment" id="main_window_search_button_alignment">
380 <property name="visible">True</property>
381 <property name="can_focus">False</property>
382 <property name="yscale">0</property>
383 <child>
384 <object class="GtkButton" id="main_window_search_button">
385 <property name="label" translatable="yes">Find:</property>
386 <property name="use_action_appearance">False</property>
387 <property name="visible">True</property>
388 <property name="can_focus">True</property>
389 <property name="receives_default">True</property>
390 <signal name="clicked" handler="main_window_search_button_clicked_cb" swapped="no"/>
391 </object>
392 </child>
393 </object>
394 <packing>
395 <property name="expand">False</property>
396 <property name="fill">False</property>
397 <property name="position">4</property>
398 </packing>
399 </child>
400 <child>
401 <object class="GtkEntry" id="main_window_search_entry">
402 <property name="visible">True</property>
403 <property name="can_focus">True</property>
404 <property name="invisible_char">●</property>
405 <property name="invisible_char_set">True</property>
406 <property name="primary_icon_stock">gtk-find</property>
407 <property name="primary_icon_activatable">True</property>
408 <property name="secondary_icon_activatable">False</property>
409 <property name="primary_icon_sensitive">True</property>
410 <property name="secondary_icon_sensitive">True</property>
411 </object>
412 <packing>
413 <property name="expand">True</property>
414 <property name="fill">True</property>
415 <property name="position">5</property>
416 </packing>
417 </child>
418 <child>
419 <object class="GtkLabel" id="main_window_search_anonymity_label">
420 <property name="visible">True</property>
421 <property name="can_focus">False</property>
422 <property name="label" translatable="yes">Anonymity:</property>
423 </object>
424 <packing>
425 <property name="expand">False</property>
426 <property name="fill">False</property>
427 <property name="position">6</property>
428 </packing>
429 </child>
430 <child>
431 <object class="GtkAlignment" id="main_window_search_anonymity_combobox_alignment">
432 <property name="visible">True</property>
433 <property name="can_focus">False</property>
434 <property name="yscale">0</property>
435 <child>
436 <object class="GtkComboBox" id="main_window_search_anonymity_combobox">
437 <property name="visible">True</property>
438 <property name="can_focus">False</property>
439 <property name="model">main_window_search_anonymity_liststore</property>
440 <property name="active">1</property>
441 <child>
442 <object class="GtkCellRendererText" id="main_window_search_anonymity_combobox_renderer"/>
443 <attributes>
444 <attribute name="foreground">2</attribute>
445 <attribute name="text">0</attribute>
446 </attributes>
447 </child>
448 <child>
449 <object class="GtkCellRendererText" id="main_window_search_anonymity_combobox_renerer_level"/>
450 <attributes>
451 <attribute name="text">1</attribute>
452 </attributes>
453 </child>
454 </object>
455 </child>
456 </object>
457 <packing>
458 <property name="expand">False</property>
459 <property name="fill">False</property>
460 <property name="position">7</property>
461 </packing>
462 </child>
463 <child>
464 <object class="GtkLabel" id="main_window_search_mime_label">
465 <property name="visible">True</property>
466 <property name="can_focus">False</property>
467 <property name="label" translatable="yes">Type:</property>
468 </object>
469 <packing>
470 <property name="expand">False</property>
471 <property name="fill">False</property>
472 <property name="position">8</property>
473 </packing>
474 </child>
475 <child>
476 <object class="GtkAlignment" id="main_window_search_mime_combobox_alignment">
477 <property name="visible">True</property>
478 <property name="can_focus">False</property>
479 <property name="yscale">0</property>
480 <child>
481 <object class="GtkComboBox" id="main_window_search_mime_combobox">
482 <property name="visible">True</property>
483 <property name="can_focus">False</property>
484 <property name="model">main_window_search_mime_liststore</property>
485 <property name="active">0</property>
486 <child>
487 <object class="GtkCellRendererText" id="main_window_search_mime_renderer_description"/>
488 <attributes>
489 <attribute name="text">1</attribute>
490 </attributes>
491 </child>
492 <child>
493 <object class="GtkCellRendererText" id="main_window_search_mime_renderer_type">
494 <property name="visible">False</property>
495 </object>
496 <attributes>
497 <attribute name="text">0</attribute>
498 </attributes>
499 </child>
500 <child>
501 <object class="GtkCellRendererText" id="main_window_search_mime_renderer_extension"/>
502 <attributes>
503 <attribute name="text">2</attribute>
504 </attributes>
505 </child>
506 <child>
507 <object class="GtkCellRendererText" id="main_window_search_mime_renderer_lossyness">
508 <property name="visible">False</property>
509 </object>
510 <attributes>
511 <attribute name="text">3</attribute>
512 </attributes>
513 </child>
514 <child>
515 <object class="GtkCellRendererText" id="main_window_search_mime_renderer_freedom">
516 <property name="visible">False</property>
517 </object>
518 <attributes>
519 <attribute name="text">4</attribute>
520 </attributes>
521 </child>
522 </object>
523 </child>
524 </object>
525 <packing>
526 <property name="expand">False</property>
527 <property name="fill">False</property>
528 <property name="position">9</property>
529 </packing>
530 </child>
531 </object>
532 <packing>
533 <property name="expand">False</property>
534 <property name="fill">False</property>
535 <property name="position">3</property>
536 </packing>
537 </child>
538 <child>
277 <object class="GtkHBox" id="GNUNET_GTK_main_window_hbox"> 539 <object class="GtkHBox" id="GNUNET_GTK_main_window_hbox">
278 <property name="visible">True</property> 540 <property name="visible">True</property>
541 <property name="can_focus">False</property>
279 <child> 542 <child>
280 <object class="GtkNotebook" id="GNUNET_GTK_main_window_notebook"> 543 <object class="GtkNotebook" id="GNUNET_GTK_main_window_notebook">
281 <property name="visible">True</property> 544 <property name="visible">True</property>
282 <property name="can_focus">True</property> 545 <property name="can_focus">True</property>
283 <property name="scrollable">True</property> 546 <property name="scrollable">True</property>
547 <property name="tab_border">0</property>
548 <property name="tab_hborder">0</property>
549 <property name="tab_vborder">0</property>
284 <signal name="switch-page" handler="GNUNET_GTK_main_window_notebook_switch_page_cb" after="yes" swapped="no"/> 550 <signal name="switch-page" handler="GNUNET_GTK_main_window_notebook_switch_page_cb" after="yes" swapped="no"/>
285 </object> 551 </object>
286 <packing> 552 <packing>
@@ -292,6 +558,7 @@
292 <child> 558 <child>
293 <object class="GtkVSeparator" id="GNUNET_GTK_main_window_separator"> 559 <object class="GtkVSeparator" id="GNUNET_GTK_main_window_separator">
294 <property name="visible">True</property> 560 <property name="visible">True</property>
561 <property name="can_focus">False</property>
295 </object> 562 </object>
296 <packing> 563 <packing>
297 <property name="expand">False</property> 564 <property name="expand">False</property>
@@ -302,12 +569,14 @@
302 <child> 569 <child>
303 <object class="GtkVBox" id="GNUNET_GTK_main_window_extras_vbox"> 570 <object class="GtkVBox" id="GNUNET_GTK_main_window_extras_vbox">
304 <property name="visible">True</property> 571 <property name="visible">True</property>
572 <property name="can_focus">False</property>
305 <child> 573 <child>
306 <object class="GtkImage" id="GNUNET_GTK_main_window_preview_image"> 574 <object class="GtkImage" id="GNUNET_GTK_main_window_preview_image">
307 <property name="width_request">128</property> 575 <property name="width_request">128</property>
308 <property name="height_request">128</property> 576 <property name="height_request">128</property>
309 <property name="visible">True</property> 577 <property name="visible">True</property>
310 <property name="sensitive">False</property> 578 <property name="sensitive">False</property>
579 <property name="can_focus">False</property>
311 <property name="has_tooltip">True</property> 580 <property name="has_tooltip">True</property>
312 <property name="tooltip_text" translatable="yes">Thumbnail associated with the currently selected content</property> 581 <property name="tooltip_text" translatable="yes">Thumbnail associated with the currently selected content</property>
313 <property name="pixel_size">256</property> 582 <property name="pixel_size">256</property>
@@ -389,19 +658,7 @@
389 <packing> 658 <packing>
390 <property name="expand">True</property> 659 <property name="expand">True</property>
391 <property name="fill">True</property> 660 <property name="fill">True</property>
392 <property name="position">3</property> 661 <property name="position">4</property>
393 </packing>
394 </child>
395 <child>
396 <object class="GtkStatusbar" id="GNUNET_GTK_status_bar">
397 <property name="visible">True</property>
398 <property name="spacing">2</property>
399 </object>
400 <packing>
401 <property name="expand">False</property>
402 <property name="fill">True</property>
403 <property name="pack_type">end</property>
404 <property name="position">0</property>
405 </packing> 662 </packing>
406 </child> 663 </child>
407 </object> 664 </object>
@@ -419,6 +676,38 @@
419 <column type="gchararray"/> 676 <column type="gchararray"/>
420 </columns> 677 </columns>
421 </object> 678 </object>
679 <object class="GtkAdjustment" id="adjustment1">
680 <property name="upper">100</property>
681 <property name="step_increment">1</property>
682 <property name="page_increment">10</property>
683 <property name="page_size">10</property>
684 </object>
685 <object class="GtkAdjustment" id="adjustment2">
686 <property name="upper">100</property>
687 <property name="step_increment">1</property>
688 <property name="page_increment">10</property>
689 <property name="page_size">10</property>
690 </object>
691 <object class="GtkImage" id="image3">
692 <property name="visible">True</property>
693 <property name="can_focus">False</property>
694 <property name="stock">gtk-new</property>
695 </object>
696 <object class="GtkImage" id="image4">
697 <property name="visible">True</property>
698 <property name="can_focus">False</property>
699 <property name="stock">gtk-find</property>
700 </object>
701 <object class="GtkImage" id="image5">
702 <property name="visible">True</property>
703 <property name="can_focus">False</property>
704 <property name="stock">gtk-go-down</property>
705 </object>
706 <object class="GtkImage" id="image6">
707 <property name="visible">True</property>
708 <property name="can_focus">False</property>
709 <property name="stock">gtk-index</property>
710 </object>
422 <object class="GtkListStore" id="GNUNET_GTK_peer_info_list_store"> 711 <object class="GtkListStore" id="GNUNET_GTK_peer_info_list_store">
423 <columns> 712 <columns>
424 <!-- column-name peer_identity --> 713 <!-- column-name peer_identity -->
@@ -433,22 +722,6 @@
433 <column type="guint64"/> 722 <column type="guint64"/>
434 </columns> 723 </columns>
435 </object> 724 </object>
436 <object class="GtkImage" id="image6">
437 <property name="visible">True</property>
438 <property name="stock">gtk-index</property>
439 </object>
440 <object class="GtkAdjustment" id="adjustment1">
441 <property name="upper">100</property>
442 <property name="step_increment">1</property>
443 <property name="page_increment">10</property>
444 <property name="page_size">10</property>
445 </object>
446 <object class="GtkAdjustment" id="adjustment2">
447 <property name="upper">100</property>
448 <property name="step_increment">1</property>
449 <property name="page_increment">10</property>
450 <property name="page_size">10</property>
451 </object>
452 <object class="GtkAdjustment" id="adjustment3"> 725 <object class="GtkAdjustment" id="adjustment3">
453 <property name="upper">100</property> 726 <property name="upper">100</property>
454 <property name="step_increment">1</property> 727 <property name="step_increment">1</property>
@@ -461,4 +734,172 @@
461 <property name="page_increment">10</property> 734 <property name="page_increment">10</property>
462 <property name="page_size">10</property> 735 <property name="page_size">10</property>
463 </object> 736 </object>
737 <object class="GtkImage" id="image1">
738 <property name="visible">True</property>
739 <property name="can_focus">False</property>
740 <property name="stock">gtk-open</property>
741 </object>
742 <object class="GtkImage" id="image2">
743 <property name="visible">True</property>
744 <property name="can_focus">False</property>
745 <property name="stock">gtk-go-up</property>
746 </object>
747 <object class="GtkImage" id="image7">
748 <property name="visible">True</property>
749 <property name="can_focus">False</property>
750 <property name="stock">gtk-index</property>
751 </object>
752 <object class="GtkImage" id="image8">
753 <property name="visible">True</property>
754 <property name="can_focus">False</property>
755 <property name="stock">gtk-index</property>
756 </object>
757 <object class="GtkImage" id="image9">
758 <property name="visible">True</property>
759 <property name="can_focus">False</property>
760 <property name="stock">gtk-index</property>
761 </object>
762 <object class="GtkListStore" id="main_window_search_anonymity_liststore">
763 <columns>
764 <!-- column-name Name -->
765 <column type="gchararray"/>
766 <!-- column-name Level -->
767 <column type="guint"/>
768 <!-- column-name Color -->
769 <column type="gchararray"/>
770 </columns>
771 <data>
772 <row>
773 <col id="0" translatable="yes">None</col>
774 <col id="1">0</col>
775 <col id="2" translatable="yes">#AAAA00000000</col>
776 </row>
777 <row>
778 <col id="0" translatable="yes">Normal</col>
779 <col id="1">1</col>
780 <col id="2" translatable="yes">#000000000000</col>
781 </row>
782 <row>
783 <col id="0" translatable="yes">Paranoid</col>
784 <col id="1">10</col>
785 <col id="2" translatable="yes">#0000AAAA0000</col>
786 </row>
787 </data>
788 </object>
789 <object class="GtkListStore" id="main_window_search_mime_liststore">
790 <columns>
791 <!-- column-name MIME -->
792 <column type="gchararray"/>
793 <!-- column-name Type -->
794 <column type="gchararray"/>
795 <!-- column-name Extension -->
796 <column type="gchararray"/>
797 <!-- column-name Lossyness -->
798 <column type="gchararray"/>
799 <!-- column-name Freedom -->
800 <column type="gchararray"/>
801 </columns>
802 <data>
803 <row>
804 <col id="0"> </col>
805 <col id="1" translatable="yes">Any</col>
806 <col id="2" translatable="yes"> </col>
807 <col id="3" translatable="yes"> </col>
808 <col id="4" translatable="yes"> </col>
809 </row>
810 <row>
811 <col id="0">plain/text</col>
812 <col id="1" translatable="yes">Text</col>
813 <col id="2">txt</col>
814 <col id="3" translatable="yes">N/A</col>
815 <col id="4" translatable="yes">N/A</col>
816 </row>
817 <row>
818 <col id="0">application/zip</col>
819 <col id="1" translatable="yes">Zip</col>
820 <col id="2">zip</col>
821 <col id="3" translatable="yes">lossless</col>
822 <col id="4" translatable="yes">free</col>
823 </row>
824 <row>
825 <col id="0">audio/mpeg</col>
826 <col id="1" translatable="yes">MPEG audio</col>
827 <col id="2">mp3, mp2, mpeg</col>
828 <col id="3" translatable="yes">lossy</col>
829 <col id="4" translatable="yes">non-free</col>
830 </row>
831 </data>
832 </object>
833 <object class="GtkSizeGroup" id="enties_and_comboboxes_sizegroup">
834 <property name="mode">vertical</property>
835 <widgets>
836 <widget name="main_window_search_entry"/>
837 <widget name="main_window_search_anonymity_combobox"/>
838 <widget name="main_window_search_mime_combobox"/>
839 </widgets>
840 </object>
841 <object class="GtkTreeStore" id="main_window_search_namespace_treestore">
842 <columns>
843 <!-- column-name Name -->
844 <column type="gchararray"/>
845 <!-- column-name Key -->
846 <column type="gpointer"/>
847 <!-- column-name KeyTextual -->
848 <column type="gchararray"/>
849 <!-- column-name Tooltip -->
850 <column type="gchararray"/>
851 </columns>
852 </object>
853 <object class="GtkWindow" id="namespace_selector_window">
854 <property name="can_focus">False</property>
855 <property name="events">GDK_LEAVE_NOTIFY_MASK | GDK_STRUCTURE_MASK</property>
856 <property name="type">popup</property>
857 <property name="resizable">False</property>
858 <property name="type_hint">dropdown-menu</property>
859 <property name="skip_taskbar_hint">True</property>
860 <property name="skip_pager_hint">True</property>
861 <property name="urgency_hint">True</property>
862 <property name="decorated">False</property>
863 <property name="deletable">False</property>
864 <property name="transient_for">GNUNET_GTK_main_window</property>
865 <property name="mnemonics_visible">False</property>
866 <signal name="leave-notify-event" handler="namespace_selector_window_leave_notify_event_cb" swapped="no"/>
867 <signal name="enter-notify-event" handler="main_window_search_namespace_dropdown_button_enter_notify_event_cb" swapped="no"/>
868 <child>
869 <object class="GtkTreeView" id="namespace_selector_treeview">
870 <property name="visible">True</property>
871 <property name="can_focus">True</property>
872 <property name="model">main_window_search_namespace_treestore</property>
873 <property name="headers_clickable">False</property>
874 <property name="search_column">0</property>
875 <property name="hover_expand">True</property>
876 <property name="tooltip_column">3</property>
877 <signal name="cursor-changed" handler="namespace_selector_treeview_cursor_changed_cb" swapped="no"/>
878 <child>
879 <object class="GtkTreeViewColumn" id="name_column">
880 <property name="sizing">autosize</property>
881 <property name="title" translatable="yes">Name</property>
882 <child>
883 <object class="GtkCellRendererText" id="namespace_selector_name_column_text_cell"/>
884 <attributes>
885 <attribute name="text">0</attribute>
886 </attributes>
887 </child>
888 </object>
889 </child>
890 <child>
891 <object class="GtkTreeViewColumn" id="key_column">
892 <property name="sizing">autosize</property>
893 <property name="title" translatable="yes">Key</property>
894 <child>
895 <object class="GtkCellRendererText" id="namespace_selector_key_column_text_cell"/>
896 <attributes>
897 <attribute name="text">2</attribute>
898 </attributes>
899 </child>
900 </object>
901 </child>
902 </object>
903 </child>
904 </object>
464</interface> 905</interface>
diff --git a/contrib/gnunet_fs_gtk_search_tab.glade b/contrib/gnunet_fs_gtk_search_tab.glade
index 38c0c38d..196a60dc 100644
--- a/contrib/gnunet_fs_gtk_search_tab.glade
+++ b/contrib/gnunet_fs_gtk_search_tab.glade
@@ -35,140 +35,167 @@
35 </columns> 35 </columns>
36 </object> 36 </object>
37 <object class="GtkWindow" id="_search_result_frame_window"> 37 <object class="GtkWindow" id="_search_result_frame_window">
38 <property name="can_focus">False</property>
39 <property name="type">popup</property>
38 <property name="title">You should never see this</property> 40 <property name="title">You should never see this</property>
39 <child> 41 <property name="skip_taskbar_hint">True</property>
40 <object class="GtkScrolledWindow" id="_search_frame_scrolled_window"> 42 <property name="skip_pager_hint">True</property>
41 <property name="height_request">100</property> 43 <property name="focus_on_map">False</property>
42 <property name="visible">True</property> 44 <property name="decorated">False</property>
43 <property name="can_focus">True</property> 45 <property name="deletable">False</property>
44 <property name="hscrollbar_policy">automatic</property>
45 <property name="vscrollbar_policy">automatic</property>
46
47 <child> 46 <child>
48 <object class="GtkTreeView" id="_search_result_frame"> 47 <object class="GtkScrolledWindow" id="_search_frame_scrolled_window">
48 <property name="height_request">100</property>
49 <property name="visible">True</property> 49 <property name="visible">True</property>
50 <property name="can_focus">True</property> 50 <property name="can_focus">True</property>
51 <property name="model">GNUNET_GTK_file_sharing_result_tree_store</property> 51 <property name="hscrollbar_policy">automatic</property>
52 <property name="reorderable">True</property> 52 <property name="vscrollbar_policy">automatic</property>
53 <property name="enable_grid_lines">horizontal</property>
54 <property name="enable_tree_lines">True</property>
55 <child> 53 <child>
56 <object class="GtkTreeViewColumn" id="search_result_description_column"> 54 <object class="GtkTreeView" id="_search_result_frame">
57 <property name="resizable">True</property> 55 <property name="visible">True</property>
58 <property name="sizing">autosize</property> 56 <property name="can_focus">True</property>
59 <property name="title" translatable="yes">Description</property> 57 <property name="model">GNUNET_GTK_file_sharing_result_tree_store</property>
60 <property name="expand">True</property>
61 <property name="clickable">True</property>
62 <property name="reorderable">True</property> 58 <property name="reorderable">True</property>
63 <property name="sort_indicator">True</property> 59 <property name="enable_grid_lines">horizontal</property>
64 <property name="sort_column_id">6</property> 60 <property name="enable_tree_lines">True</property>
65 <child> 61 <child>
66 <object class="GtkCellRendererProgress" id="search_result_description_renderer"/> 62 <object class="GtkTreeViewColumn" id="search_result_description_column">
67 <attributes> 63 <property name="resizable">True</property>
68 <attribute name="cell-background">8</attribute> 64 <property name="sizing">autosize</property>
69 <attribute name="text">6</attribute> 65 <property name="title" translatable="yes">Description</property>
70 <attribute name="value">5</attribute> 66 <property name="expand">True</property>
71 </attributes> 67 <property name="clickable">True</property>
68 <property name="reorderable">True</property>
69 <property name="sort_indicator">True</property>
70 <property name="sort_column_id">6</property>
71 <child>
72 <object class="GtkCellRendererProgress" id="search_result_description_renderer"/>
73 <attributes>
74 <attribute name="cell-background">8</attribute>
75 <attribute name="text">6</attribute>
76 <attribute name="value">5</attribute>
77 </attributes>
78 </child>
79 </object>
72 </child> 80 </child>
73 </object>
74 </child>
75 <child>
76 <object class="GtkTreeViewColumn" id="search_result_mime_column">
77 <property name="sizing">autosize</property>
78 <property name="title" translatable="yes">Format</property>
79 <property name="clickable">True</property>
80 <property name="reorderable">True</property>
81 <property name="sort_indicator">True</property>
82 <property name="sort_column_id">10</property>
83 <child> 81 <child>
84 <object class="GtkCellRendererText" id="search_result_mime_renderer"/> 82 <object class="GtkTreeViewColumn" id="search_result_mime_column">
85 <attributes> 83 <property name="sizing">autosize</property>
86 <attribute name="background">8</attribute> 84 <property name="title" translatable="yes">Format</property>
87 <attribute name="text">10</attribute> 85 <property name="clickable">True</property>
88 </attributes> 86 <property name="reorderable">True</property>
87 <property name="sort_indicator">True</property>
88 <property name="sort_column_id">10</property>
89 <child>
90 <object class="GtkCellRendererText" id="search_result_mime_renderer"/>
91 <attributes>
92 <attribute name="background">8</attribute>
93 <attribute name="text">10</attribute>
94 </attributes>
95 </child>
96 </object>
89 </child> 97 </child>
90 </object>
91 </child>
92 <child>
93 <object class="GtkTreeViewColumn" id="search_result_size_column">
94 <property name="sizing">autosize</property>
95 <property name="title" translatable="yes">Size</property>
96 <property name="reorderable">True</property>
97 <property name="sort_indicator">True</property>
98 <property name="sort_column_id">2</property>
99 <child> 98 <child>
100 <object class="GtkCellRendererProgress" id="search_result_size_renderer"/> 99 <object class="GtkTreeViewColumn" id="search_result_size_column">
101 <attributes> 100 <property name="sizing">autosize</property>
102 <attribute name="cell-background">8</attribute> 101 <property name="title" translatable="yes">Size</property>
103 <attribute name="text">2</attribute> 102 <property name="reorderable">True</property>
104 <attribute name="value">4</attribute> 103 <property name="sort_indicator">True</property>
105 </attributes> 104 <property name="sort_column_id">2</property>
105 <child>
106 <object class="GtkCellRendererProgress" id="search_result_size_renderer"/>
107 <attributes>
108 <attribute name="cell-background">8</attribute>
109 <attribute name="text">2</attribute>
110 <attribute name="value">4</attribute>
111 </attributes>
112 </child>
113 </object>
106 </child> 114 </child>
107 </object>
108 </child>
109 <child>
110 <object class="GtkTreeViewColumn" id="search_result_applicability_column">
111 <property name="sizing">autosize</property>
112 <property name="title">#</property>
113 <property name="reorderable">True</property>
114 <property name="sort_indicator">True</property>
115 <property name="sort_order">descending</property>
116 <property name="sort_column_id">11</property>
117 <child> 115 <child>
118 <object class="GtkCellRendererText" id="search_result_applicability_renderer"/> 116 <object class="GtkTreeViewColumn" id="search_result_applicability_column">
119 <attributes> 117 <property name="sizing">autosize</property>
120 <attribute name="background">8</attribute> 118 <property name="title">#</property>
121 <attribute name="text">11</attribute> 119 <property name="reorderable">True</property>
122 </attributes> 120 <property name="sort_indicator">True</property>
121 <property name="sort_order">descending</property>
122 <property name="sort_column_id">11</property>
123 <child>
124 <object class="GtkCellRendererText" id="search_result_applicability_renderer"/>
125 <attributes>
126 <attribute name="background">8</attribute>
127 <attribute name="text">11</attribute>
128 </attributes>
129 </child>
130 </object>
123 </child> 131 </child>
124 </object>
125 </child>
126 <child>
127 <object class="GtkTreeViewColumn" id="search_result_preview_column">
128 <property name="min_width">128</property>
129 <property name="max_width">128</property>
130 <property name="title" translatable="yes">Preview</property>
131 <property name="reorderable">True</property>
132 <child> 132 <child>
133 <object class="GtkCellRendererPixbuf" id="search_result_preview_renderer"/> 133 <object class="GtkTreeViewColumn" id="search_result_preview_column">
134 <attributes> 134 <property name="min_width">128</property>
135 <attribute name="pixbuf">3</attribute> 135 <property name="max_width">128</property>
136 </attributes> 136 <property name="title" translatable="yes">Preview</property>
137 <property name="reorderable">True</property>
138 <child>
139 <object class="GtkCellRendererPixbuf" id="search_result_preview_renderer"/>
140 <attributes>
141 <attribute name="pixbuf">3</attribute>
142 </attributes>
143 </child>
144 </object>
137 </child> 145 </child>
138 </object> 146 </object>
139 </child> 147 </child>
140 </object> 148 </object>
141 </child> 149 </child>
142 </object> 150 </object>
143 </child>
144 </object>
145 <object class="GtkWindow" id="_search_result_label_window"> 151 <object class="GtkWindow" id="_search_result_label_window">
152 <property name="can_focus">False</property>
153 <property name="type">popup</property>
154 <property name="title" translatable="yes">You shouldn't see this also</property>
155 <property name="type_hint">dock</property>
156 <property name="skip_taskbar_hint">True</property>
157 <property name="skip_pager_hint">True</property>
158 <property name="focus_on_map">False</property>
159 <property name="decorated">False</property>
160 <property name="deletable">False</property>
146 <child> 161 <child>
147 <object class="GtkHBox" id="_search_result_label_hbox"> 162 <object class="GtkHBox" id="_search_result_label_hbox">
148 <property name="visible">True</property> 163 <property name="visible">True</property>
164 <property name="can_focus">False</property>
149 <property name="border_width">5</property> 165 <property name="border_width">5</property>
150 <child> 166 <child>
151 <object class="GtkLabel" id="_search_result_label_window_label"> 167 <object class="GtkLabel" id="_search_result_label_window_label">
152 <property name="height_request">30</property> 168 <property name="height_request">30</property>
153 <property name="visible">True</property> 169 <property name="visible">True</property>
170 <property name="can_focus">False</property>
154 <property name="label" translatable="yes">query</property> 171 <property name="label" translatable="yes">query</property>
155 </object> 172 </object>
156 <packing> 173 <packing>
157 <property name="fill">False</property> 174 <property name="expand">True</property>
175 <property name="fill">True</property>
158 <property name="padding">5</property> 176 <property name="padding">5</property>
159 <property name="position">0</property> 177 <property name="position">0</property>
160 </packing> 178 </packing>
161 </child> 179 </child>
162 <child> 180 <child>
163 <object class="GtkButton" id="_search_result_label_play_button"> 181 <object class="GtkAlignment" id="_search_result_label_play_button_alignment">
164 <property name="can_focus">True</property> 182 <property name="visible">True</property>
165 <property name="receives_default">True</property> 183 <property name="can_focus">False</property>
166 <property name="use_action_appearance">False</property> 184 <property name="xscale">0</property>
185 <property name="yscale">0</property>
167 <child> 186 <child>
168 <object class="GtkImage" id="play_icon_stock_image"> 187 <object class="GtkButton" id="_search_result_label_play_button">
169 <property name="visible">True</property> 188 <property name="use_action_appearance">False</property>
170 <property name="stock">gtk-media-play</property> 189 <property name="can_focus">True</property>
171 <property name="icon-size">2</property> 190 <property name="receives_default">True</property>
191 <child>
192 <object class="GtkImage" id="play_icon_stock_image">
193 <property name="visible">True</property>
194 <property name="can_focus">False</property>
195 <property name="stock">gtk-media-play</property>
196 <property name="icon-size">2</property>
197 </object>
198 </child>
172 </object> 199 </object>
173 </child> 200 </child>
174 </object> 201 </object>
@@ -179,16 +206,25 @@
179 </packing> 206 </packing>
180 </child> 207 </child>
181 <child> 208 <child>
182 <object class="GtkButton" id="_search_result_label_pause_button"> 209 <object class="GtkAlignment" id="_search_result_label_pause_button_alignment">
183 <property name="visible">True</property> 210 <property name="visible">True</property>
184 <property name="can_focus">True</property> 211 <property name="can_focus">False</property>
185 <property name="receives_default">True</property> 212 <property name="xscale">0</property>
186 <property name="use_action_appearance">False</property> 213 <property name="yscale">0</property>
187 <child> 214 <child>
188 <object class="GtkImage" id="pause_icon_stock_image"> 215 <object class="GtkButton" id="_search_result_label_pause_button">
216 <property name="use_action_appearance">False</property>
189 <property name="visible">True</property> 217 <property name="visible">True</property>
190 <property name="stock">gtk-media-pause</property> 218 <property name="can_focus">True</property>
191 <property name="icon-size">2</property> 219 <property name="receives_default">True</property>
220 <child>
221 <object class="GtkImage" id="pause_icon_stock_image">
222 <property name="visible">True</property>
223 <property name="can_focus">False</property>
224 <property name="stock">gtk-media-pause</property>
225 <property name="icon-size">2</property>
226 </object>
227 </child>
192 </object> 228 </object>
193 </child> 229 </child>
194 </object> 230 </object>
@@ -199,15 +235,24 @@
199 </packing> 235 </packing>
200 </child> 236 </child>
201 <child> 237 <child>
202 <object class="GtkButton" id="_search_result_label_clear_button"> 238 <object class="GtkAlignment" id="_search_result_label_clear_button_alignment">
203 <property name="visible">True</property> 239 <property name="visible">True</property>
204 <property name="can_focus">True</property> 240 <property name="can_focus">False</property>
205 <property name="receives_default">True</property> 241 <property name="xscale">0</property>
206 <property name="use_action_appearance">False</property> 242 <property name="yscale">0</property>
207 <child> 243 <child>
208 <object class="GtkImage" id="clear_icon_stock_image"> 244 <object class="GtkButton" id="_search_result_label_clear_button">
245 <property name="use_action_appearance">False</property>
209 <property name="visible">True</property> 246 <property name="visible">True</property>
210 <property name="stock">gtk-clear</property> 247 <property name="can_focus">True</property>
248 <property name="receives_default">True</property>
249 <child>
250 <object class="GtkImage" id="clear_icon_stock_image">
251 <property name="visible">True</property>
252 <property name="can_focus">False</property>
253 <property name="stock">gtk-clear</property>
254 </object>
255 </child>
211 </object> 256 </object>
212 </child> 257 </child>
213 </object> 258 </object>
@@ -219,17 +264,26 @@
219 </packing> 264 </packing>
220 </child> 265 </child>
221 <child> 266 <child>
222 <object class="GtkButton" id="_search_result_label_close_button"> 267 <object class="GtkAlignment" id="_search_result_label_close_button_alignment">
223 <property name="visible">True</property> 268 <property name="visible">True</property>
224 <property name="can_focus">True</property> 269 <property name="can_focus">False</property>
225 <property name="receives_default">True</property> 270 <property name="xscale">0</property>
226 <property name="use_action_appearance">False</property> 271 <property name="yscale">0</property>
227 <property name="relief">half</property>
228 <child> 272 <child>
229 <object class="GtkImage" id="close_icon_stock_image"> 273 <object class="GtkButton" id="_search_result_label_close_button">
274 <property name="use_action_appearance">False</property>
230 <property name="visible">True</property> 275 <property name="visible">True</property>
231 <property name="stock">gtk-close</property> 276 <property name="can_focus">True</property>
232 <property name="icon-size">2</property> 277 <property name="receives_default">True</property>
278 <property name="relief">half</property>
279 <child>
280 <object class="GtkImage" id="close_icon_stock_image">
281 <property name="visible">True</property>
282 <property name="can_focus">False</property>
283 <property name="stock">gtk-close</property>
284 <property name="icon-size">2</property>
285 </object>
286 </child>
233 </object> 287 </object>
234 </child> 288 </child>
235 </object> 289 </object>
@@ -242,4 +296,13 @@
242 </object> 296 </object>
243 </child> 297 </child>
244 </object> 298 </object>
299 <object class="GtkSizeGroup" id="_search_result_label_buttons_size_group">
300 <property name="mode">both</property>
301 <widgets>
302 <widget name="_search_result_label_play_button"/>
303 <widget name="_search_result_label_pause_button"/>
304 <widget name="_search_result_label_clear_button"/>
305 <widget name="_search_result_label_close_button"/>
306 </widgets>
307 </object>
245</interface> 308</interface>
diff --git a/src/fs/gnunet-fs-gtk-main_window_view_toggles.c b/src/fs/gnunet-fs-gtk-main_window_view_toggles.c
index 975a1be4..9b73cac3 100644
--- a/src/fs/gnunet-fs-gtk-main_window_view_toggles.c
+++ b/src/fs/gnunet-fs-gtk-main_window_view_toggles.c
@@ -71,5 +71,14 @@ GNUNET_GTK_main_menu_view_metadata_toggled_cb (GtkWidget * dummy, gpointer data)
71 "GNUNET_GTK_main_menu_view_metadata"); 71 "GNUNET_GTK_main_menu_view_metadata");
72} 72}
73 73
74/**
75 * Preview view is toggled.
76 */
77void
78GNUNET_GTK_main_menu_view_search_toggled_cb (GtkWidget * dummy, gpointer data)
79{
80 toggle_view ("main_window_search_hbox",
81 "GNUNET_GTK_main_menu_search_preview");
82}
74 83
75/* end of gnunet-fs-gtk-main_window_view_toggles.c */ 84/* end of gnunet-fs-gtk-main_window_view_toggles.c */
diff --git a/src/fs/gnunet-fs-gtk.c b/src/fs/gnunet-fs-gtk.c
index 67a7059f..3223ec7b 100644
--- a/src/fs/gnunet-fs-gtk.c
+++ b/src/fs/gnunet-fs-gtk.c
@@ -46,6 +46,7 @@ static struct GNUNET_FS_Handle *fs;
46 */ 46 */
47static struct EXTRACTOR_PluginList *plugins; 47static struct EXTRACTOR_PluginList *plugins;
48 48
49guint namespace_selector_window_leave_timeout_source = 0;
49 50
50/** 51/**
51 * Return handle for file-sharing operations. 52 * Return handle for file-sharing operations.
@@ -129,44 +130,389 @@ void
129GNUNET_GTK_main_menu_file_search_activate_cb (GtkWidget * dummy, gpointer data); 130GNUNET_GTK_main_menu_file_search_activate_cb (GtkWidget * dummy, gpointer data);
130 131
131 132
133void
134main_window_search_namespace_dropdown_button_toggled_cb (GtkToggleButton *togglebutton,
135 gpointer user_data)
136{
137 gboolean active;
138 GtkBuilder *builder = GTK_BUILDER (user_data);
139 GtkWidget *namespace_selector_window;
140 namespace_selector_window = GTK_WIDGET (gtk_builder_get_object (builder, "namespace_selector_window"));
141 g_object_get (G_OBJECT (togglebutton), "active", &active, NULL);
142 if (active)
143 {
144 GtkAllocation togglebutton_allocation;
145 GdkWindow *main_window_gdk;
146 gint mwg_x, mwg_y, tgb_x, tgb_y, popup_x, popup_y;
147
148 gtk_widget_get_allocation (GTK_WIDGET (togglebutton), &togglebutton_allocation);
149
150 main_window_gdk = gtk_widget_get_window (GTK_WIDGET (togglebutton));
151
152 gdk_window_get_origin (main_window_gdk, &mwg_x, &mwg_y);
153
154 /* FIXME: this might become a problem in other window managers,
155 * where reference point is not in the top-left corner.
156 * We want to show the window below the button.
157 */
158 tgb_x = mwg_x + togglebutton_allocation.x;
159 tgb_y = mwg_y + togglebutton_allocation.y;
160 popup_x = tgb_x;
161 popup_y = tgb_y + togglebutton_allocation.height;
162
163 gtk_window_move (GTK_WINDOW (namespace_selector_window), popup_x, popup_y);
164
165 gtk_widget_show (namespace_selector_window);
166 }
167 else
168 gtk_widget_hide (namespace_selector_window);
169}
170
171gboolean
172namespace_selector_window_leave_timeout_cb (gpointer user_data)
173{
174 GtkToggleButton *toggle_button = GTK_TOGGLE_BUTTON (user_data);
175 /* This will eventually hide the namespace selector */
176 gtk_toggle_button_set_active (toggle_button, FALSE);
177 return FALSE;
178}
179
180gboolean
181main_window_search_namespace_dropdown_button_enter_notify_event_cb (
182 GtkWidget *widget, GdkEvent *event, gpointer user_data)
183{
184 if (namespace_selector_window_leave_timeout_source > 0)
185 g_source_remove (namespace_selector_window_leave_timeout_source);
186 return FALSE;
187}
188
189
190gboolean
191namespace_selector_window_leave_notify_event_cb (GtkWidget *widget,
192 GdkEvent *event, gpointer user_data)
193{
194 GtkBuilder *builder;
195 GtkToggleButton *toggle_button;
196 guint timeout_id;
197
198 builder = GTK_BUILDER (user_data);
199
200 toggle_button = GTK_TOGGLE_BUTTON (gtk_builder_get_object (builder, "main_window_search_namespace_dropdown_button"));
201
202 /* Place a timeout to hide the window. It will be cancelled if the cursor
203 * enters the namespace selector window or the toggle button within 100ms.
204 */
205 timeout_id = g_timeout_add (100, &namespace_selector_window_leave_timeout_cb, toggle_button);
206 if (namespace_selector_window_leave_timeout_source > 0)
207 g_source_remove (namespace_selector_window_leave_timeout_source);
208 namespace_selector_window_leave_timeout_source = timeout_id;
209
210 return FALSE;
211}
212
213gboolean
214GNUNET_GTK_get_tree_string (GtkTreeView *treeview, GtkTreePath *treepath,
215 guint column, gchar **value)
216{
217 gboolean ok;
218 GtkTreeModel *model;
219
220 model = gtk_tree_view_get_model (treeview);
221 if (!model)
222 return FALSE;
223
224 GtkTreeIter iter;
225 ok = gtk_tree_model_get_iter (model, &iter, treepath);
226 if (!ok)
227 return FALSE;
228
229 *value = NULL;
230 gtk_tree_model_get (model, &iter, column, value, -1);
231 if (*value == NULL)
232 return FALSE;
233 return TRUE;
234}
235
236gboolean
237get_selected_anonymity_level (GtkBuilder *builder, guint *p_level)
238{
239 GtkComboBox *combo;
240 GtkTreeIter iter;
241 GtkTreeModel *model;
242 guint level;
243
244 combo = GTK_COMBO_BOX(gtk_builder_get_object (builder,
245 "main_window_search_anonymity_combobox"));
246 if (!combo)
247 return FALSE;
248
249 if (!gtk_combo_box_get_active_iter (combo, &iter))
250 return FALSE;
251
252 model = gtk_combo_box_get_model (combo);
253 if (!model)
254 return FALSE;
255
256 gtk_tree_model_get (model, &iter, 1, &level, -1);
257 if (p_level)
258 *p_level = level;
259 return TRUE;
260}
261
262gboolean
263get_selected_namespace_treepath_iter_model_widget (GtkBuilder *builder,
264 GtkTreePath **p_treepath, GtkTreeIter *p_iter, GtkTreeModel **p_model,
265 GtkWidget **p_widget)
266{
267 GtkTreeSelection *selection;
268 GtkTreeModel *model;
269 GList *selected;
270 GtkTreePath *treepath;
271 GtkWidget *widget;
272
273 widget = GTK_WIDGET (gtk_builder_get_object (builder, "namespace_selector_treeview"));
274 if (!widget)
275 return FALSE;
276
277 selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (widget));
278 model = gtk_tree_view_get_model (GTK_TREE_VIEW (widget));
279 if (!selection || !model)
280 return FALSE;
281
282 selected = gtk_tree_selection_get_selected_rows (selection, NULL);
283 if (!selected)
284 return FALSE;
285 if (selected->data == NULL)
286 {
287 g_list_foreach (selected, (GFunc) gtk_tree_path_free, NULL);
288 g_list_free (selected);
289 return FALSE;
290 }
291 /* Free everything except the first path, keep it */
292 treepath = (GtkTreePath *) selected->data;
293 selected = g_list_remove (selected, selected->data);
294 g_list_foreach (selected, (GFunc) gtk_tree_path_free, NULL);
295 g_list_free (selected);
296
297 if (p_iter && !gtk_tree_model_get_iter (model, p_iter, treepath))
298 {
299 gtk_tree_path_free (treepath);
300 return FALSE;
301 }
302 *p_treepath = treepath;
303 if (p_model)
304 *p_model = model;
305 if (p_widget)
306 *p_widget = widget;
307 return TRUE;
308}
309
310void
311namespace_selector_treeview_cursor_changed_cb (GtkWidget *widget,
312 gpointer user_data)
313{
314 GtkBuilder *builder;
315 GtkToggleButton *toggle_button;
316 GtkLabel *sel_namespace_label;
317 gchar *value;
318 GtkTreePath *treepath;
319
320 builder = GTK_BUILDER (user_data);
321
322 if (!get_selected_namespace_treepath_iter_model_widget (builder, &treepath, NULL, NULL, NULL))
323 return;
324
325 toggle_button = GTK_TOGGLE_BUTTON (gtk_builder_get_object (builder, "main_window_search_namespace_dropdown_button"));
326 if (!toggle_button)
327 return;
328
329 sel_namespace_label = GTK_LABEL (gtk_builder_get_object (builder, "main_window_search_selected_namespace_label"));
330 if (!sel_namespace_label)
331 return;
332
333 if (GNUNET_GTK_get_tree_string (GTK_TREE_VIEW (widget), treepath, 0,
334 &value))
335 gtk_label_set_text (sel_namespace_label, value);
336
337 gtk_tree_path_free (treepath);
338
339 /* This will eventually hide the namespace selector */
340 gtk_toggle_button_set_active (toggle_button, FALSE);
341}
342
343void
344main_window_search_button_clicked_cb (GtkButton *button, gpointer user_data)
345{
346 GtkBuilder *builder;
347 GtkTreePath *namespace_treepath = NULL;
348 GtkTreeModel *namespace_model = NULL;
349 GtkComboBox *mime_combo;
350 GtkTreeModel *mime_model;
351 GtkEntry *query_entry;
352 guint anonymity_level;
353 GtkTreeIter iter;
354 const char *entry_keywords;
355 gchar *keywords;
356 gchar *mime_keyword;
357
358 GNUNET_HashCode *nsid = NULL;
359 struct GNUNET_FS_Uri *uri;
360 char *emsg;
361
362 builder = GTK_BUILDER (user_data);
363
364 if (!get_selected_anonymity_level (builder, &anonymity_level))
365 return;
366
367 mime_combo = GTK_COMBO_BOX (GNUNET_FS_GTK_get_main_window_object
368 ("main_window_search_mime_combobox"));
369 mime_model = gtk_combo_box_get_model (mime_combo);
370 if (mime_model && gtk_combo_box_get_active_iter (mime_combo, &iter))
371 {
372 mime_keyword = NULL;
373 gtk_tree_model_get (mime_model, &iter, 0, &mime_keyword, -1);
374 }
375
376 get_selected_namespace_treepath_iter_model_widget (builder,
377 &namespace_treepath, &iter, &namespace_model, NULL);
378
379 query_entry = GTK_ENTRY (gtk_builder_get_object (builder,
380 "main_window_search_entry"));
381
382 entry_keywords = gtk_entry_get_text (query_entry);
383 if (mime_keyword != NULL)
384 {
385 keywords = g_strdup_printf ("%s %s", entry_keywords, mime_keyword);
386 g_free (mime_keyword);
387 }
388 else
389 keywords = g_strdup (entry_keywords);
390 if (namespace_treepath != NULL)
391 gtk_tree_model_get (namespace_model, &iter, 1, &nsid, -1);
392 if (nsid != NULL)
393 {
394 uri = GNUNET_FS_uri_sks_create_from_nsid (nsid, keywords);
395 GNUNET_assert (uri != NULL);
396 }
397 else
398 {
399 emsg = NULL;
400 uri = GNUNET_FS_uri_ksk_create (keywords, &emsg);
401 if (uri == NULL)
402 {
403 GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
404 _("Invalid keyword string `%s': %s"), keywords, emsg);
405 GNUNET_free_non_null (emsg);
406 return;
407 }
408 }
409 GNUNET_FS_search_start (GNUNET_FS_GTK_get_fs_handle (), uri,
410 anonymity_level, GNUNET_FS_SEARCH_OPTION_NONE, NULL);
411
412 g_free (keywords);
413 GNUNET_FS_uri_destroy (uri);
414}
415
132/** 416/**
133 * Add the tab with the 'new' icon for starting a search. 417 * Add pseudonym data to tree store
418 *
419 * @param cls closure (the 'GtkListStore')
420 * @param pseudonym hash code of public key of pseudonym
421 * @param md meta data known about the pseudonym
422 * @param rating the local rating of the pseudonym
423 * @return GNUNET_OK to continue iteration, GNUNET_SYSERR to abort
134 */ 424 */
135static void 425static int
136add_new_tab () 426add_namespace_to_ts (void *cls, const GNUNET_HashCode * pseudonym,
427 const struct GNUNET_CONTAINER_MetaData *md, int rating)
137{ 428{
138 GtkNotebook *notebook; 429 GtkTreeStore *ts = cls;
139 GtkWindow *sf; 430 char *root;
140 gint pages; 431 char *ns_name;
141 GtkBuilder *builder; 432 GNUNET_HashCode *nsid;
142 GtkWidget *label; 433 char *description;
143 GtkWidget *frame; 434 char *uris;
144 435 char *emsg;
145 builder = 436 struct GNUNET_FS_Uri *uri;
146 GNUNET_GTK_get_new_builder ("gnunet_fs_gtk_main_tab_new_frame.glade"); 437 GtkTreeIter iter;
147 438
148 /* load frame */ 439 ns_name =
149 sf = GTK_WINDOW (gtk_builder_get_object (builder, "_main_tab_new_frame")); 440 GNUNET_PSEUDONYM_id_to_name (GNUNET_FS_GTK_get_configuration (),
150 label = gtk_bin_get_child (GTK_BIN (sf)); 441 pseudonym);
151 g_object_ref (G_OBJECT (label)); 442 nsid = GNUNET_malloc (sizeof (GNUNET_HashCode));
152 gtk_container_remove (GTK_CONTAINER (sf), label); 443 *nsid = *pseudonym;
153 gtk_widget_destroy (GTK_WIDGET (sf)); 444 root = NULL;
154 g_object_unref (builder); 445 uris = GNUNET_CONTAINER_meta_data_get_by_type (md, EXTRACTOR_METATYPE_URI);
155 g_signal_connect (G_OBJECT (label), "clicked", 446 if (uris != NULL)
156 G_CALLBACK (&GNUNET_GTK_main_menu_file_search_activate_cb), 447 {
157 NULL); 448 emsg = NULL;
158 449 uri = GNUNET_FS_uri_parse (uris, &emsg);
159 notebook = 450 if (uri == NULL)
160 GTK_NOTEBOOK (GNUNET_FS_GTK_get_main_window_object 451 GNUNET_free (emsg);
161 ("GNUNET_GTK_main_window_notebook")); 452 root = GNUNET_FS_uri_sks_get_content_id (uri);
162 pages = gtk_notebook_get_n_pages (notebook); 453 GNUNET_FS_uri_destroy (uri);
163 frame = gtk_label_new (""); 454 }
164 gtk_widget_show (frame); 455 description =
165 gtk_notebook_append_page (notebook, frame, label); 456 GNUNET_CONTAINER_meta_data_get_first_by_types (md,
166 gtk_notebook_set_current_page (notebook, pages); 457 EXTRACTOR_METATYPE_TITLE,
167 gtk_widget_show (GTK_WIDGET (notebook)); 458 EXTRACTOR_METATYPE_BOOK_TITLE,
459 EXTRACTOR_METATYPE_DESCRIPTION,
460 EXTRACTOR_METATYPE_SUMMARY,
461 EXTRACTOR_METATYPE_ALBUM,
462 EXTRACTOR_METATYPE_COMMENT,
463 EXTRACTOR_METATYPE_SUBJECT,
464 EXTRACTOR_METATYPE_KEYWORDS,
465 -1);
466 gtk_tree_store_insert_with_values (ts, &iter, NULL, G_MAXINT, 0, ns_name, 1,
467 nsid, 2, root, 3, description, -1);
468 GNUNET_free (ns_name);
469 GNUNET_free_non_null (root);
470 GNUNET_free_non_null (description);
471 return GNUNET_OK;
168} 472}
169 473
474void
475GNUNET_GTK_main_window_realize_cb (GtkWidget *widget, gpointer user_data)
476{
477 GtkTreeIter iter;
478 GtkTreeView *namespace_tree;
479 GtkTreeStore *namespace_treestore;
480 GtkBuilder *builder;
481 GtkWidget *namespace_selector_window;
482
483 builder = GTK_BUILDER (user_data);
484
485 namespace_treestore = GTK_TREE_STORE (GNUNET_FS_GTK_get_main_window_object
486 ("main_window_search_namespace_treestore"));
487 namespace_tree = GTK_TREE_VIEW (GNUNET_FS_GTK_get_main_window_object
488 ("namespace_selector_treeview"));
489
490 gtk_tree_store_insert_with_values (namespace_treestore, &iter, NULL,
491 G_MAXINT, 0, "Any", 1, NULL, 2, "", 3,
492 "Do not search in any particular namespace", -1);
493 GNUNET_PSEUDONYM_list_all (GNUNET_FS_GTK_get_configuration (),
494 &add_namespace_to_ts, namespace_treestore);
495
496 /* FIXME: read currently selected namespace from somewhere instead of selecting 0th item */
497 if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL (namespace_treestore), &iter))
498 {
499 gchar *value;
500 GtkLabel *sel_namespace_label;
501 GtkTreePath *treepath = gtk_tree_path_new_first ();
502 gtk_tree_selection_select_iter (gtk_tree_view_get_selection (
503 namespace_tree), &iter);
504 sel_namespace_label = GTK_LABEL (gtk_builder_get_object (builder, "main_window_search_selected_namespace_label"));
505 if (GNUNET_GTK_get_tree_string (namespace_tree, treepath, 0, &value))
506 gtk_label_set_text (sel_namespace_label, value);
507 gtk_tree_path_free (treepath);
508 }
509
510 /* How the window (to trigger certain events) and immediately hide it */
511 namespace_selector_window = GTK_WIDGET (gtk_builder_get_object (builder, "namespace_selector_window"));
512 gtk_widget_show (namespace_selector_window);
513 gtk_widget_hide (namespace_selector_window);
514
515}
170 516
171/** 517/**
172 * Actual main function run right after GNUnet's scheduler 518 * Actual main function run right after GNUnet's scheduler
@@ -201,7 +547,8 @@ run (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
201 GNUNET_FS_OPTIONS_END); 547 GNUNET_FS_OPTIONS_END);
202 if (fs != NULL) 548 if (fs != NULL)
203 { 549 {
204 add_new_tab (); 550 /* Searches are now started from the search bar */
551 /* add_new_tab (); */
205 } 552 }
206 else 553 else
207 { 554 {