diff options
Diffstat (limited to 'src/fs/gnunet-fs-gtk_publish-dialog.c')
-rw-r--r-- | src/fs/gnunet-fs-gtk_publish-dialog.c | 300 |
1 files changed, 218 insertions, 82 deletions
diff --git a/src/fs/gnunet-fs-gtk_publish-dialog.c b/src/fs/gnunet-fs-gtk_publish-dialog.c index 73acaf93..57cc865b 100644 --- a/src/fs/gnunet-fs-gtk_publish-dialog.c +++ b/src/fs/gnunet-fs-gtk_publish-dialog.c | |||
@@ -38,6 +38,105 @@ | |||
38 | 38 | ||
39 | 39 | ||
40 | /** | 40 | /** |
41 | * Columns in the publish model. | ||
42 | */ | ||
43 | enum PUBLISH_ModelColumns | ||
44 | { | ||
45 | /** | ||
46 | * A gchararray. | ||
47 | */ | ||
48 | PUBLISH_MC_FILESIZE = 0, | ||
49 | |||
50 | /** | ||
51 | * A gboolean. | ||
52 | */ | ||
53 | PUBLISH_MC_DO_INDEX = 1, | ||
54 | |||
55 | /** | ||
56 | * A gchararray. | ||
57 | */ | ||
58 | PUBLISH_MC_FILENAME = 2, | ||
59 | |||
60 | /** | ||
61 | * A guint. | ||
62 | */ | ||
63 | PUBLISH_MC_ANONYMITY_LEVEL = 3, | ||
64 | |||
65 | /** | ||
66 | * A guint. | ||
67 | */ | ||
68 | PUBLISH_MC_PRIORITY = 4, | ||
69 | |||
70 | /** | ||
71 | * A gpointer. | ||
72 | */ | ||
73 | PUBLISH_MC_FILE_INFORMATION_STRUCT = 5, | ||
74 | |||
75 | /** | ||
76 | * A guint64. | ||
77 | */ | ||
78 | PUBLISH_MC_EXPIRATION_TIME_ABSOLUTE = 6, | ||
79 | |||
80 | /** | ||
81 | * A guint. | ||
82 | */ | ||
83 | PUBLISH_MC_REPLICATION_LEVEL = 7, | ||
84 | }; | ||
85 | |||
86 | |||
87 | /** | ||
88 | * Columns in the pseudonym model. | ||
89 | */ | ||
90 | enum PSEUDONYM_ModelColumns | ||
91 | { | ||
92 | /** | ||
93 | * A gchararray. | ||
94 | */ | ||
95 | PSEUDONYM_MC_LOCAL_NAME = 0, | ||
96 | |||
97 | /** | ||
98 | * A gpointer. | ||
99 | */ | ||
100 | PSEUDONYM_MC_NAMESPACE_HANDLE = 1, | ||
101 | |||
102 | /** | ||
103 | * A gchararray. | ||
104 | */ | ||
105 | PSEUDONYM_MC_LAST_ID = 2, | ||
106 | |||
107 | /** | ||
108 | * A gchararray. | ||
109 | */ | ||
110 | PSEUDONYM_MC_LAST_URI = 3, | ||
111 | |||
112 | /** | ||
113 | * A gpointer. | ||
114 | */ | ||
115 | PSEUDONYM_MC_LAST_META = 4, | ||
116 | |||
117 | /** | ||
118 | * A gchararray. | ||
119 | */ | ||
120 | PSEUDONYM_MC_NEXT_ID = 5, | ||
121 | |||
122 | /** | ||
123 | * A gchararray. | ||
124 | */ | ||
125 | PSEUDONYM_MC_LAST_DESCRIPTION_FROM_META = 6, | ||
126 | |||
127 | /** | ||
128 | * A gboolean. | ||
129 | */ | ||
130 | PSEUDONYM_MC_NEXT_ID_EDITABLE = 7, | ||
131 | |||
132 | /** | ||
133 | * A gboolean. | ||
134 | */ | ||
135 | PSEUDONYM_MC_CURRENT_ID_EDITABLE = 8, | ||
136 | }; | ||
137 | |||
138 | |||
139 | /** | ||
41 | * Context we create when we are scanning a directory. | 140 | * Context we create when we are scanning a directory. |
42 | */ | 141 | */ |
43 | struct AddDirClientContext; | 142 | struct AddDirClientContext; |
@@ -281,7 +380,8 @@ update_selectivity (struct MainPublishingDialogContext *ctx) | |||
281 | ns_ok = GNUNET_YES; | 380 | ns_ok = GNUNET_YES; |
282 | if (gtk_tree_selection_get_selected (ctx->pseudonym_selection, NULL, &iter)) | 381 | if (gtk_tree_selection_get_selected (ctx->pseudonym_selection, NULL, &iter)) |
283 | { | 382 | { |
284 | gtk_tree_model_get (ctx->pseudonym_treemodel, &iter, 2, &namespace_id, -1); | 383 | gtk_tree_model_get (ctx->pseudonym_treemodel, &iter, |
384 | PSEUDONYM_MC_LAST_ID, &namespace_id, -1); | ||
285 | if (namespace_id == NULL) | 385 | if (namespace_id == NULL) |
286 | ns_ok = GNUNET_NO; | 386 | ns_ok = GNUNET_NO; |
287 | else | 387 | else |
@@ -339,7 +439,8 @@ update_selectivity (struct MainPublishingDialogContext *ctx) | |||
339 | is_dir = GNUNET_SYSERR; | 439 | is_dir = GNUNET_SYSERR; |
340 | while (GNUNET_YES != gtk_tree_iter_equals (ctx->file_info_treemodel, &pred, &iter)) | 440 | while (GNUNET_YES != gtk_tree_iter_equals (ctx->file_info_treemodel, &pred, &iter)) |
341 | { | 441 | { |
342 | gtk_tree_model_get (ctx->file_info_treemodel, &pred, 5, &fip, -1); | 442 | gtk_tree_model_get (ctx->file_info_treemodel, &pred, |
443 | PUBLISH_MC_FILE_INFORMATION_STRUCT, &fip, -1); | ||
343 | is_dir = GNUNET_FS_file_information_is_directory (fip); | 444 | is_dir = GNUNET_FS_file_information_is_directory (fip); |
344 | GNUNET_assert (gtk_tree_model_iter_next (ctx->file_info_treemodel, &pred)); | 445 | GNUNET_assert (gtk_tree_model_iter_next (ctx->file_info_treemodel, &pred)); |
345 | } | 446 | } |
@@ -405,15 +506,17 @@ create_dir_at_iter (struct MainPublishingDialogContext *ctx, | |||
405 | (GNUNET_FS_GTK_get_fs_handle (), row_reference, NULL, meta, bo, name); | 506 | (GNUNET_FS_GTK_get_fs_handle (), row_reference, NULL, meta, bo, name); |
406 | GNUNET_CONTAINER_meta_data_destroy (meta); | 507 | GNUNET_CONTAINER_meta_data_destroy (meta); |
407 | gtk_tree_store_set (GTK_TREE_STORE (ctx->file_info_treemodel), pos, | 508 | gtk_tree_store_set (GTK_TREE_STORE (ctx->file_info_treemodel), pos, |
408 | 0, MARKER_DIR_FILE_SIZE, | 509 | PUBLISH_MC_FILESIZE, MARKER_DIR_FILE_SIZE, |
409 | 1, (gboolean) GNUNET_NO, | 510 | PUBLISH_MC_DO_INDEX, (gboolean) GNUNET_NO, |
410 | 2, name, | 511 | PUBLISH_MC_FILENAME, name, |
411 | 3, (guint) bo->anonymity_level, | 512 | PUBLISH_MC_ANONYMITY_LEVEL, (guint) bo->anonymity_level, |
412 | 4, (guint) bo->content_priority, | 513 | PUBLISH_MC_PRIORITY, (guint) bo->content_priority, |
413 | 5, fi, | 514 | PUBLISH_MC_FILE_INFORMATION_STRUCT, fi, |
414 | 6, (guint64) bo->expiration_time.abs_value, | 515 | PUBLISH_MC_EXPIRATION_TIME_ABSOLUTE, |
415 | 7, (guint) bo->replication_level, | 516 | (guint64) bo->expiration_time.abs_value, |
416 | -1); | 517 | PUBLISH_MC_REPLICATION_LEVEL, |
518 | (guint) bo->replication_level, | ||
519 | -1); | ||
417 | update_selectivity (ctx); | 520 | update_selectivity (ctx); |
418 | } | 521 | } |
419 | 522 | ||
@@ -453,25 +556,27 @@ copy_entry (struct MainPublishingDialogContext *ctx, GtkTreeModel * tm, GtkTreeI | |||
453 | char *fsf; | 556 | char *fsf; |
454 | 557 | ||
455 | gtk_tree_model_get (tm, old, | 558 | gtk_tree_model_get (tm, old, |
456 | 0, &fsf, | 559 | PUBLISH_MC_FILESIZE, &fsf, |
457 | 1, &do_index, | 560 | PUBLISH_MC_DO_INDEX, &do_index, |
458 | 2, &short_fn, | 561 | PUBLISH_MC_FILENAME, &short_fn, |
459 | 3, &anonymity_level, | 562 | PUBLISH_MC_ANONYMITY_LEVEL, &anonymity_level, |
460 | 4, &priority, | 563 | PUBLISH_MC_PRIORITY, &priority, |
461 | 5, &fip, | 564 | PUBLISH_MC_FILE_INFORMATION_STRUCT, &fip, |
462 | 6, &expiration_time_abs, | 565 | PUBLISH_MC_EXPIRATION_TIME_ABSOLUTE, |
463 | 7, &replication_level, | 566 | &expiration_time_abs, |
464 | -1); | 567 | PUBLISH_MC_REPLICATION_LEVEL, &replication_level, |
465 | gtk_tree_store_set (GTK_TREE_STORE (tm), newpos, | 568 | -1); |
466 | 0, fsf, | 569 | gtk_tree_store_set (GTK_TREE_STORE (tm), newpos, |
467 | 1, do_index, | 570 | PUBLISH_MC_FILESIZE, fsf, |
468 | 2, short_fn, | 571 | PUBLISH_MC_DO_INDEX, do_index, |
469 | 3, anonymity_level, | 572 | PUBLISH_MC_FILENAME, short_fn, |
470 | 4, priority, | 573 | PUBLISH_MC_ANONYMITY_LEVEL, anonymity_level, |
471 | 5, fip, | 574 | PUBLISH_MC_PRIORITY, priority, |
472 | 6, expiration_time_abs, | 575 | PUBLISH_MC_FILE_INFORMATION_STRUCT, fip, |
473 | 7, replication_level, | 576 | PUBLISH_MC_EXPIRATION_TIME_ABSOLUTE, |
474 | -1); | 577 | expiration_time_abs, |
578 | PUBLISH_MC_REPLICATION_LEVEL, replication_level, | ||
579 | -1); | ||
475 | g_free (short_fn); | 580 | g_free (short_fn); |
476 | g_free (fsf); | 581 | g_free (fsf); |
477 | } | 582 | } |
@@ -548,8 +653,8 @@ GNUNET_GTK_master_publish_dialog_pseudonym_updates_renderer_edited_cb (GtkCellRe | |||
548 | return; | 653 | return; |
549 | } | 654 | } |
550 | gtk_tree_store_set (GTK_TREE_STORE (ctx->pseudonym_treemodel), &iter, | 655 | gtk_tree_store_set (GTK_TREE_STORE (ctx->pseudonym_treemodel), &iter, |
551 | 5, new_text, | 656 | PSEUDONYM_MC_NEXT_ID, new_text, |
552 | -1); | 657 | -1); |
553 | update_selectivity (ctx); | 658 | update_selectivity (ctx); |
554 | } | 659 | } |
555 | 660 | ||
@@ -578,8 +683,8 @@ GNUNET_GTK_master_publish_dialog_pseudonym_identifier_renderer_edited_cb (GtkCel | |||
578 | return; | 683 | return; |
579 | } | 684 | } |
580 | gtk_tree_store_set (GTK_TREE_STORE (ctx->pseudonym_treemodel), &iter, | 685 | gtk_tree_store_set (GTK_TREE_STORE (ctx->pseudonym_treemodel), &iter, |
581 | 2, new_text, | 686 | PSEUDONYM_MC_LAST_ID, new_text, |
582 | -1); | 687 | -1); |
583 | update_selectivity (ctx); | 688 | update_selectivity (ctx); |
584 | } | 689 | } |
585 | 690 | ||
@@ -878,7 +983,8 @@ GNUNET_GTK_master_publish_dialog_delete_button_clicked_cb (GtkWidget * dummy, | |||
878 | GNUNET_assert (gtk_tree_selection_get_selected (ctx->file_info_selection, NULL, &iter)); | 983 | GNUNET_assert (gtk_tree_selection_get_selected (ctx->file_info_selection, NULL, &iter)); |
879 | 984 | ||
880 | /* now delete the subtree */ | 985 | /* now delete the subtree */ |
881 | gtk_tree_model_get (ctx->file_info_treemodel, &iter, 5, &fip, -1); | 986 | gtk_tree_model_get (ctx->file_info_treemodel, &iter, |
987 | PUBLISH_MC_FILE_INFORMATION_STRUCT, &fip, -1); | ||
882 | GNUNET_FS_file_information_destroy (fip, &free_fi_row_reference, NULL); | 988 | GNUNET_FS_file_information_destroy (fip, &free_fi_row_reference, NULL); |
883 | GNUNET_FS_GTK_remove_treestore_subtree (GTK_TREE_STORE (ctx->file_info_treemodel), | 989 | GNUNET_FS_GTK_remove_treestore_subtree (GTK_TREE_STORE (ctx->file_info_treemodel), |
884 | &iter); | 990 | &iter); |
@@ -1058,14 +1164,19 @@ add_item (struct AddDirClientContext *adcc, | |||
1058 | file_size_fancy = GNUNET_STRINGS_byte_size_fancy (fsize); | 1164 | file_size_fancy = GNUNET_STRINGS_byte_size_fancy (fsize); |
1059 | } | 1165 | } |
1060 | gtk_tree_store_set (ts, item_iter, | 1166 | gtk_tree_store_set (ts, item_iter, |
1061 | 0, file_size_fancy, | 1167 | PUBLISH_MC_FILESIZE, file_size_fancy, |
1062 | 1, (gboolean) adcc->directory_scan_do_index, | 1168 | PUBLISH_MC_DO_INDEX, |
1063 | 2, item->short_filename, | 1169 | (gboolean) adcc->directory_scan_do_index, |
1064 | 3, (guint) adcc->directory_scan_bo.anonymity_level, | 1170 | PUBLISH_MC_FILENAME, item->short_filename, |
1065 | 4, (guint) adcc->directory_scan_bo.content_priority, | 1171 | PUBLISH_MC_ANONYMITY_LEVEL, |
1066 | 5, fi, | 1172 | (guint) adcc->directory_scan_bo.anonymity_level, |
1067 | 6, (guint64) adcc->directory_scan_bo.expiration_time.abs_value, | 1173 | PUBLISH_MC_PRIORITY, |
1068 | 7, (guint) adcc->directory_scan_bo.replication_level, -1); | 1174 | (guint) adcc->directory_scan_bo.content_priority, |
1175 | PUBLISH_MC_FILE_INFORMATION_STRUCT, fi, | ||
1176 | PUBLISH_MC_EXPIRATION_TIME_ABSOLUTE, | ||
1177 | (guint64) adcc->directory_scan_bo.expiration_time.abs_value, | ||
1178 | PUBLISH_MC_REPLICATION_LEVEL, | ||
1179 | (guint) adcc->directory_scan_bo.replication_level, -1); | ||
1069 | GNUNET_free (file_size_fancy); | 1180 | GNUNET_free (file_size_fancy); |
1070 | } | 1181 | } |
1071 | 1182 | ||
@@ -1553,13 +1664,15 @@ update_treeview_after_edit (void *cls, struct GNUNET_FS_FileInformation *fi, | |||
1553 | { | 1664 | { |
1554 | struct EditPublishContext *epc = cls; | 1665 | struct EditPublishContext *epc = cls; |
1555 | 1666 | ||
1556 | gtk_tree_store_set (GTK_TREE_STORE (epc->tm), &epc->iter, | 1667 | gtk_tree_store_set (GTK_TREE_STORE (epc->tm), &epc->iter, |
1557 | 1, *do_index, | 1668 | PUBLISH_MC_DO_INDEX, *do_index, |
1558 | 3, (guint) bo->anonymity_level, | 1669 | PUBLISH_MC_ANONYMITY_LEVEL, (guint) bo->anonymity_level, |
1559 | 4, (guint) bo->content_priority, | 1670 | PUBLISH_MC_PRIORITY, (guint) bo->content_priority, |
1560 | 6, (guint64) bo->expiration_time.abs_value, | 1671 | PUBLISH_MC_EXPIRATION_TIME_ABSOLUTE, |
1561 | 7, (guint) bo->replication_level, | 1672 | (guint64) bo->expiration_time.abs_value, |
1562 | -1); | 1673 | PUBLISH_MC_REPLICATION_LEVEL, |
1674 | (guint) bo->replication_level, | ||
1675 | -1); | ||
1563 | return GNUNET_SYSERR; | 1676 | return GNUNET_SYSERR; |
1564 | } | 1677 | } |
1565 | 1678 | ||
@@ -1607,9 +1720,9 @@ GNUNET_GTK_master_publish_dialog_edit_button_clicked_cb (GtkWidget * dummy, | |||
1607 | return; | 1720 | return; |
1608 | } | 1721 | } |
1609 | gtk_tree_model_get (ctx->file_info_treemodel, | 1722 | gtk_tree_model_get (ctx->file_info_treemodel, |
1610 | &epc->iter, | 1723 | &epc->iter, |
1611 | 5, &epc->fip, | 1724 | PUBLISH_MC_FILE_INFORMATION_STRUCT, &epc->fip, |
1612 | -1); | 1725 | -1); |
1613 | GNUNET_FS_GTK_edit_publish_dialog (ctx->master_pubdialog, | 1726 | GNUNET_FS_GTK_edit_publish_dialog (ctx->master_pubdialog, |
1614 | epc->fip, | 1727 | epc->fip, |
1615 | GNUNET_NO, | 1728 | GNUNET_NO, |
@@ -1639,8 +1752,9 @@ get_file_information (GtkTreeModel * tm, GtkTreeIter * iter) | |||
1639 | struct GNUNET_FS_FileInformation *fic; | 1752 | struct GNUNET_FS_FileInformation *fic; |
1640 | GtkTreeIter child; | 1753 | GtkTreeIter child; |
1641 | 1754 | ||
1642 | gtk_tree_model_get (tm, iter, 5, &fi, -1); | 1755 | gtk_tree_model_get (tm, iter, PUBLISH_MC_FILE_INFORMATION_STRUCT, &fi, -1); |
1643 | gtk_tree_store_set (GTK_TREE_STORE (tm), iter, 5, NULL, -1); | 1756 | gtk_tree_store_set (GTK_TREE_STORE (tm), iter, |
1757 | PUBLISH_MC_FILE_INFORMATION_STRUCT, NULL, -1); | ||
1644 | GNUNET_assert (fi != NULL); | 1758 | GNUNET_assert (fi != NULL); |
1645 | if (gtk_tree_model_iter_children (tm, &child, iter)) | 1759 | if (gtk_tree_model_iter_children (tm, &child, iter)) |
1646 | { | 1760 | { |
@@ -1670,9 +1784,9 @@ free_pseudonym_tree_store (GtkTreeModel * tm, GtkTreeIter * iter) | |||
1670 | struct GNUNET_FS_Namespace *ns; | 1784 | struct GNUNET_FS_Namespace *ns; |
1671 | 1785 | ||
1672 | gtk_tree_model_get (tm, iter, | 1786 | gtk_tree_model_get (tm, iter, |
1673 | 1, &ns, | 1787 | PSEUDONYM_MC_NAMESPACE_HANDLE, &ns, |
1674 | 4, &meta, | 1788 | PSEUDONYM_MC_LAST_META, &meta, |
1675 | -1); | 1789 | -1); |
1676 | if (NULL != meta) | 1790 | if (NULL != meta) |
1677 | GNUNET_CONTAINER_meta_data_destroy (meta); | 1791 | GNUNET_CONTAINER_meta_data_destroy (meta); |
1678 | if (NULL != ns) | 1792 | if (NULL != ns) |
@@ -1700,7 +1814,7 @@ free_file_information_tree_store (GtkTreeModel * tm, GtkTreeIter * iter) | |||
1700 | GtkTreeIter child; | 1814 | GtkTreeIter child; |
1701 | struct GNUNET_FS_FileInformation *fip; | 1815 | struct GNUNET_FS_FileInformation *fip; |
1702 | 1816 | ||
1703 | gtk_tree_model_get (tm, iter, 5, &fip, -1); | 1817 | gtk_tree_model_get (tm, iter, PUBLISH_MC_FILE_INFORMATION_STRUCT, &fip, -1); |
1704 | if (NULL != fip) | 1818 | if (NULL != fip) |
1705 | GNUNET_FS_file_information_destroy (fip, NULL, NULL); | 1819 | GNUNET_FS_file_information_destroy (fip, NULL, NULL); |
1706 | /* recursively clean up children */ | 1820 | /* recursively clean up children */ |
@@ -1782,8 +1896,11 @@ GNUNET_GTK_master_publish_dialog_execute_button_clicked_cb (GtkButton * button, | |||
1782 | } | 1896 | } |
1783 | if (TRUE == gtk_tree_selection_get_selected (ctx->pseudonym_selection, NULL, &iter)) | 1897 | if (TRUE == gtk_tree_selection_get_selected (ctx->pseudonym_selection, NULL, &iter)) |
1784 | { | 1898 | { |
1785 | gtk_tree_model_get (ctx->pseudonym_treemodel, &iter, 1, &namespace, 2, &namespace_id, 5, | 1899 | gtk_tree_model_get (ctx->pseudonym_treemodel, &iter, |
1786 | &namespace_uid, -1); | 1900 | PSEUDONYM_MC_NAMESPACE_HANDLE, &namespace, |
1901 | PSEUDONYM_MC_LAST_ID, &namespace_id, | ||
1902 | PSEUDONYM_MC_NEXT_ID, &namespace_uid, | ||
1903 | -1); | ||
1787 | } | 1904 | } |
1788 | else | 1905 | else |
1789 | { | 1906 | { |
@@ -1919,14 +2036,23 @@ add_updateable_to_ts (void *cls, const char *last_id, | |||
1919 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST); | 2036 | GNUNET_CONTAINER_MULTIHASHMAPOPTION_UNIQUE_FAST); |
1920 | /* FIXME-BUG-MAYBE: what if this put fails? Not convinced it cannot... */ | 2037 | /* FIXME-BUG-MAYBE: what if this put fails? Not convinced it cannot... */ |
1921 | desc = GNUNET_FS_GTK_get_description_from_metadata (last_meta, &desc_is_a_dup); | 2038 | desc = GNUNET_FS_GTK_get_description_from_metadata (last_meta, &desc_is_a_dup); |
1922 | gtk_tree_store_insert_with_values (uc->ts, &iter, uc->parent, G_MAXINT, 0, | 2039 | gtk_tree_store_insert_with_values (uc->ts, &iter, uc->parent, G_MAXINT, |
1923 | uc->namespace_name, 1, | 2040 | PSEUDONYM_MC_LOCAL_NAME, |
1924 | GNUNET_FS_namespace_dup (uc->ns), 2, last_id, | 2041 | uc->namespace_name, |
1925 | 3, GNUNET_FS_uri_dup (last_uri), 4, | 2042 | PSEUDONYM_MC_NAMESPACE_HANDLE, |
2043 | GNUNET_FS_namespace_dup (uc->ns), | ||
2044 | PSEUDONYM_MC_LAST_ID, last_id, | ||
2045 | PSEUDONYM_MC_LAST_URI, | ||
2046 | GNUNET_FS_uri_dup (last_uri), | ||
2047 | PSEUDONYM_MC_LAST_META, | ||
1926 | GNUNET_CONTAINER_meta_data_duplicate | 2048 | GNUNET_CONTAINER_meta_data_duplicate |
1927 | (last_meta), 5, "", 6, desc, 7, | 2049 | (last_meta), |
2050 | PSEUDONYM_MC_NEXT_ID, "", | ||
2051 | PSEUDONYM_MC_LAST_DESCRIPTION_FROM_META, | ||
2052 | desc, | ||
2053 | PSEUDONYM_MC_NEXT_ID_EDITABLE, | ||
1928 | TRUE /* update editable (always) */ , | 2054 | TRUE /* update editable (always) */ , |
1929 | 8, FALSE | 2055 | PSEUDONYM_MC_CURRENT_ID_EDITABLE, FALSE |
1930 | /* current not editable (only for top-level) */ | 2056 | /* current not editable (only for top-level) */ |
1931 | , -1); | 2057 | , -1); |
1932 | GNUNET_free_non_null (desc); | 2058 | GNUNET_free_non_null (desc); |
@@ -1942,12 +2068,21 @@ add_updateable_to_ts (void *cls, const char *last_id, | |||
1942 | (strlen (next_id) > 0)) | 2068 | (strlen (next_id) > 0)) |
1943 | { | 2069 | { |
1944 | /* add leaf */ | 2070 | /* add leaf */ |
1945 | gtk_tree_store_insert_with_values (uc->ts, &titer, &iter, G_MAXINT, 0, | 2071 | gtk_tree_store_insert_with_values (uc->ts, &titer, &iter, G_MAXINT, |
1946 | uc->namespace_name, 1, | 2072 | PSEUDONYM_MC_LOCAL_NAME, |
1947 | GNUNET_FS_namespace_dup (uc->ns), 2, | 2073 | uc->namespace_name, |
1948 | next_id, 3, NULL, 4, NULL, 5, "", 6, "", | 2074 | PSEUDONYM_MC_NAMESPACE_HANDLE, |
1949 | 7, TRUE /* update editable (always) */ , | 2075 | GNUNET_FS_namespace_dup (uc->ns), |
1950 | 8, FALSE | 2076 | PSEUDONYM_MC_LAST_ID, next_id, |
2077 | PSEUDONYM_MC_LAST_URI, NULL, | ||
2078 | PSEUDONYM_MC_LAST_META, NULL, | ||
2079 | PSEUDONYM_MC_NEXT_ID, "", | ||
2080 | PSEUDONYM_MC_LAST_DESCRIPTION_FROM_META, | ||
2081 | "", | ||
2082 | PSEUDONYM_MC_NEXT_ID_EDITABLE, | ||
2083 | TRUE /* update editable (always) */ , | ||
2084 | PSEUDONYM_MC_CURRENT_ID_EDITABLE, | ||
2085 | FALSE | ||
1951 | /* current not editable (only for top-level) */ | 2086 | /* current not editable (only for top-level) */ |
1952 | , -1); | 2087 | , -1); |
1953 | } | 2088 | } |
@@ -1975,15 +2110,16 @@ add_namespace_to_ts (void *cls, const char *name, const GNUNET_HashCode * id) | |||
1975 | uc.ns = GNUNET_FS_namespace_create (GNUNET_FS_GTK_get_fs_handle (), name); | 2110 | uc.ns = GNUNET_FS_namespace_create (GNUNET_FS_GTK_get_fs_handle (), name); |
1976 | uc.update_called = GNUNET_NO; | 2111 | uc.update_called = GNUNET_NO; |
1977 | gtk_tree_store_insert_with_values (ts, &iter, NULL, G_MAXINT, | 2112 | gtk_tree_store_insert_with_values (ts, &iter, NULL, G_MAXINT, |
1978 | 0, name, | 2113 | PSEUDONYM_MC_LOCAL_NAME, name, |
1979 | 1, uc.ns, | 2114 | PSEUDONYM_MC_NAMESPACE_HANDLE, uc.ns, |
1980 | 2, NULL /* last-id */ , | 2115 | PSEUDONYM_MC_LAST_ID, NULL, |
1981 | 3, NULL /* last-uri (as string!) */ , | 2116 | PSEUDONYM_MC_LAST_URI, NULL, |
1982 | 4, NULL /* meta */ , | 2117 | PSEUDONYM_MC_LAST_META, NULL, |
1983 | 5, NULL /* next-ID */ , | 2118 | PSEUDONYM_MC_NEXT_ID, NULL, |
1984 | 6, NULL /* last-description */ , | 2119 | PSEUDONYM_MC_LAST_DESCRIPTION_FROM_META, |
1985 | 7, TRUE /* update editable */ , | 2120 | NULL, |
1986 | 8, TRUE /* current editable */ , | 2121 | PSEUDONYM_MC_NEXT_ID_EDITABLE, TRUE, |
2122 | PSEUDONYM_MC_CURRENT_ID_EDITABLE, TRUE, | ||
1987 | -1); | 2123 | -1); |
1988 | uc.seen = GNUNET_CONTAINER_multihashmap_create (128); | 2124 | uc.seen = GNUNET_CONTAINER_multihashmap_create (128); |
1989 | GNUNET_FS_namespace_list_updateable (uc.ns, NULL, &add_updateable_to_ts, &uc); | 2125 | GNUNET_FS_namespace_list_updateable (uc.ns, NULL, &add_updateable_to_ts, &uc); |