diff options
Diffstat (limited to 'src/fs/gnunet-fs-gtk_main-window-namespace-dropdown.c')
-rw-r--r-- | src/fs/gnunet-fs-gtk_main-window-namespace-dropdown.c | 54 |
1 files changed, 39 insertions, 15 deletions
diff --git a/src/fs/gnunet-fs-gtk_main-window-namespace-dropdown.c b/src/fs/gnunet-fs-gtk_main-window-namespace-dropdown.c index b9b7daaa..b1f7ab59 100644 --- a/src/fs/gnunet-fs-gtk_main-window-namespace-dropdown.c +++ b/src/fs/gnunet-fs-gtk_main-window-namespace-dropdown.c | |||
@@ -150,12 +150,16 @@ commit_changes (struct GNUNET_GTK_MainWindowContext *main_ctx, | |||
150 | main_ctx->selected_ns_row = get_selected_row_from_treeview (tv); | 150 | main_ctx->selected_ns_row = get_selected_row_from_treeview (tv); |
151 | 151 | ||
152 | treepath = gtk_tree_row_reference_get_path (main_ctx->selected_ns_row); | 152 | treepath = gtk_tree_row_reference_get_path (main_ctx->selected_ns_row); |
153 | if (GNUNET_GTK_get_tree_string (tv, treepath, 0, &value)) | 153 | if (GNUNET_GTK_get_tree_string (tv, treepath, |
154 | GNUNET_GTK_FS_MAIN_WINDOW_SEARCH_NAMESPACE_MC_NAME, | ||
155 | &value)) | ||
154 | { | 156 | { |
155 | gtk_label_set_text (main_ctx->search_ns_label, (NULL != value) ? value : ""); | 157 | gtk_label_set_text (main_ctx->search_ns_label, (NULL != value) ? value : ""); |
156 | g_free (value); | 158 | g_free (value); |
157 | } | 159 | } |
158 | if (GNUNET_GTK_get_tree_string (tv, treepath, 2, &value)) | 160 | if (GNUNET_GTK_get_tree_string (tv, treepath, |
161 | GNUNET_GTK_FS_MAIN_WINDOW_SEARCH_NAMESPACE_MC_ROOT, | ||
162 | &value)) | ||
159 | { | 163 | { |
160 | gtk_entry_set_text (main_ctx->search_entry, (NULL != value) ? value : ""); | 164 | gtk_entry_set_text (main_ctx->search_entry, (NULL != value) ? value : ""); |
161 | g_free (value); | 165 | g_free (value); |
@@ -326,11 +330,15 @@ add_namespace_to_ts (void *cls, const GNUNET_HashCode * pseudonym, | |||
326 | } | 330 | } |
327 | description = GNUNET_FS_GTK_get_description_from_metadata (md, &desc_is_a_dup); | 331 | description = GNUNET_FS_GTK_get_description_from_metadata (md, &desc_is_a_dup); |
328 | gtk_tree_store_insert_with_values (ts, &iter, NULL, G_MAXINT, | 332 | gtk_tree_store_insert_with_values (ts, &iter, NULL, G_MAXINT, |
329 | 0, unique_ns_name, | 333 | GNUNET_GTK_FS_MAIN_WINDOW_SEARCH_NAMESPACE_MC_NAME, |
330 | 1, nsid, | 334 | unique_ns_name, |
331 | 2, root, | 335 | GNUNET_GTK_FS_MAIN_WINDOW_SEARCH_NAMESPACE_MC_KEY, |
332 | 3, description, | 336 | nsid, |
333 | -1); | 337 | GNUNET_GTK_FS_MAIN_WINDOW_SEARCH_NAMESPACE_MC_ROOT, |
338 | root, | ||
339 | GNUNET_GTK_FS_MAIN_WINDOW_SEARCH_NAMESPACE_MC_TOOLTIP, | ||
340 | description, | ||
341 | -1); | ||
334 | GNUNET_free (unique_ns_name); | 342 | GNUNET_free (unique_ns_name); |
335 | GNUNET_free_non_null (root); | 343 | GNUNET_free_non_null (root); |
336 | GNUNET_free (description); | 344 | GNUNET_free (description); |
@@ -356,7 +364,10 @@ GNUNET_GTK_main_window_refresh_ns_list (struct GNUNET_GTK_MainWindowContext *mai | |||
356 | { | 364 | { |
357 | if (gtk_tree_model_get_iter (model, &iter, treepath)) | 365 | if (gtk_tree_model_get_iter (model, &iter, treepath)) |
358 | { | 366 | { |
359 | gtk_tree_model_get (model, &iter, 1, &key, -1); | 367 | gtk_tree_model_get (model, &iter, |
368 | GNUNET_GTK_FS_MAIN_WINDOW_SEARCH_NAMESPACE_MC_KEY, | ||
369 | &key, | ||
370 | -1); | ||
360 | } | 371 | } |
361 | } | 372 | } |
362 | gtk_tree_path_free (treepath); | 373 | gtk_tree_path_free (treepath); |
@@ -376,8 +387,9 @@ GNUNET_GTK_main_window_refresh_ns_list (struct GNUNET_GTK_MainWindowContext *mai | |||
376 | while (TRUE) | 387 | while (TRUE) |
377 | { | 388 | { |
378 | gtk_tree_model_get (GTK_TREE_MODEL (main_ctx->search_ns_treestore), &iter, | 389 | gtk_tree_model_get (GTK_TREE_MODEL (main_ctx->search_ns_treestore), &iter, |
379 | 1, &key, | 390 | GNUNET_GTK_FS_MAIN_WINDOW_SEARCH_NAMESPACE_MC_KEY, |
380 | -1); | 391 | &key, |
392 | -1); | ||
381 | GNUNET_free_non_null (key); | 393 | GNUNET_free_non_null (key); |
382 | if (TRUE != gtk_tree_model_iter_next (GTK_TREE_MODEL ( | 394 | if (TRUE != gtk_tree_model_iter_next (GTK_TREE_MODEL ( |
383 | main_ctx->search_ns_treestore), &iter)) | 395 | main_ctx->search_ns_treestore), &iter)) |
@@ -387,7 +399,13 @@ GNUNET_GTK_main_window_refresh_ns_list (struct GNUNET_GTK_MainWindowContext *mai | |||
387 | gtk_tree_store_clear (main_ctx->search_ns_treestore); | 399 | gtk_tree_store_clear (main_ctx->search_ns_treestore); |
388 | 400 | ||
389 | gtk_tree_store_insert_with_values (main_ctx->search_ns_treestore, &iter, NULL, G_MAXINT, | 401 | gtk_tree_store_insert_with_values (main_ctx->search_ns_treestore, &iter, NULL, G_MAXINT, |
390 | 0, "Any", 1, NULL, 2, "", 3, | 402 | GNUNET_GTK_FS_MAIN_WINDOW_SEARCH_NAMESPACE_MC_NAME, |
403 | "Any", | ||
404 | GNUNET_GTK_FS_MAIN_WINDOW_SEARCH_NAMESPACE_MC_KEY, | ||
405 | NULL, | ||
406 | GNUNET_GTK_FS_MAIN_WINDOW_SEARCH_NAMESPACE_MC_ROOT, | ||
407 | "", | ||
408 | GNUNET_GTK_FS_MAIN_WINDOW_SEARCH_NAMESPACE_MC_TOOLTIP, | ||
391 | "Do not search in any particular namespace", | 409 | "Do not search in any particular namespace", |
392 | -1); | 410 | -1); |
393 | 411 | ||
@@ -404,9 +422,11 @@ GNUNET_GTK_main_window_refresh_ns_list (struct GNUNET_GTK_MainWindowContext *mai | |||
404 | while (TRUE) | 422 | while (TRUE) |
405 | { | 423 | { |
406 | gtk_tree_model_get (GTK_TREE_MODEL (main_ctx->search_ns_treestore), &iter, | 424 | gtk_tree_model_get (GTK_TREE_MODEL (main_ctx->search_ns_treestore), &iter, |
407 | 0, &value, | 425 | GNUNET_GTK_FS_MAIN_WINDOW_SEARCH_NAMESPACE_MC_NAME, |
408 | 1, &key, | 426 | &value, |
409 | -1); | 427 | GNUNET_GTK_FS_MAIN_WINDOW_SEARCH_NAMESPACE_MC_KEY, |
428 | &key, | ||
429 | -1); | ||
410 | if (selected_ns_id == NULL) | 430 | if (selected_ns_id == NULL) |
411 | found = TRUE; | 431 | found = TRUE; |
412 | else if (key != NULL && memcmp (key, selected_ns_id, sizeof (GNUNET_HashCode)) == 0) | 432 | else if (key != NULL && memcmp (key, selected_ns_id, sizeof (GNUNET_HashCode)) == 0) |
@@ -423,7 +443,11 @@ GNUNET_GTK_main_window_refresh_ns_list (struct GNUNET_GTK_MainWindowContext *mai | |||
423 | main_ctx->search_ns_treestore), &iter)) | 443 | main_ctx->search_ns_treestore), &iter)) |
424 | { | 444 | { |
425 | gtk_tree_model_get (GTK_TREE_MODEL (main_ctx->search_ns_treestore), &iter, | 445 | gtk_tree_model_get (GTK_TREE_MODEL (main_ctx->search_ns_treestore), &iter, |
426 | 0, &value, 1, &key, -1); | 446 | GNUNET_GTK_FS_MAIN_WINDOW_SEARCH_NAMESPACE_MC_NAME, |
447 | &value, | ||
448 | GNUNET_GTK_FS_MAIN_WINDOW_SEARCH_NAMESPACE_MC_KEY, | ||
449 | &key, | ||
450 | -1); | ||
427 | found = TRUE; | 451 | found = TRUE; |
428 | } | 452 | } |
429 | if (found) | 453 | if (found) |