diff options
Diffstat (limited to 'src/fs/gnunet-fs-gtk.c')
-rw-r--r-- | src/fs/gnunet-fs-gtk.c | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/src/fs/gnunet-fs-gtk.c b/src/fs/gnunet-fs-gtk.c index 2e0f2999..3c485126 100644 --- a/src/fs/gnunet-fs-gtk.c +++ b/src/fs/gnunet-fs-gtk.c | |||
@@ -247,7 +247,7 @@ GNUNET_GTK_get_selected_anonymity_level (GtkBuilder *builder, gchar *combo_name, | |||
247 | GtkTreeModel *model; | 247 | GtkTreeModel *model; |
248 | guint level; | 248 | guint level; |
249 | 249 | ||
250 | combo = GTK_COMBO_BOX(gtk_builder_get_object (builder, combo_name)); | 250 | combo = GTK_COMBO_BOX (gtk_builder_get_object (builder, combo_name)); |
251 | if (!combo) | 251 | if (!combo) |
252 | return FALSE; | 252 | return FALSE; |
253 | 253 | ||
@@ -265,6 +265,38 @@ GNUNET_GTK_get_selected_anonymity_level (GtkBuilder *builder, gchar *combo_name, | |||
265 | } | 265 | } |
266 | 266 | ||
267 | gboolean | 267 | gboolean |
268 | GNUNET_GTK_select_anonymity_level (GtkBuilder *builder, gchar *combo_name, guint sel_level) | ||
269 | { | ||
270 | GtkComboBox *combo; | ||
271 | GtkTreeIter iter; | ||
272 | GtkTreeModel *model; | ||
273 | guint level; | ||
274 | gboolean go_on; | ||
275 | |||
276 | combo = GTK_COMBO_BOX (gtk_builder_get_object (builder, combo_name)); | ||
277 | if (!combo) | ||
278 | return FALSE; | ||
279 | |||
280 | model = gtk_combo_box_get_model (combo); | ||
281 | if (!model) | ||
282 | return FALSE; | ||
283 | |||
284 | for (go_on = gtk_tree_model_get_iter_first (model, &iter); | ||
285 | go_on; | ||
286 | go_on = gtk_tree_model_iter_next (model, &iter)) | ||
287 | { | ||
288 | gboolean is_it = FALSE; | ||
289 | gtk_tree_model_get (model, &iter, 1, &level, -1); | ||
290 | if (level == sel_level) | ||
291 | { | ||
292 | gtk_combo_box_set_active_iter (combo, &iter); | ||
293 | return TRUE; | ||
294 | } | ||
295 | } | ||
296 | return FALSE; | ||
297 | } | ||
298 | |||
299 | gboolean | ||
268 | get_selected_namespace_treepath_iter_model_widget (GtkBuilder *builder, | 300 | get_selected_namespace_treepath_iter_model_widget (GtkBuilder *builder, |
269 | GtkTreePath **p_treepath, GtkTreeIter *p_iter, GtkTreeModel **p_model, | 301 | GtkTreePath **p_treepath, GtkTreeIter *p_iter, GtkTreeModel **p_model, |
270 | GtkWidget **p_widget) | 302 | GtkWidget **p_widget) |