diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-12-23 09:43:13 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-12-23 09:43:13 +0000 |
commit | 1077c64a9266873957f8f89b967268cfb1ac3a80 (patch) | |
tree | 9c9fd96cf98717c8994a5692d9ecb4b23a20b390 | |
parent | 1fae508391dff859f30011072337233ac64f8400 (diff) | |
download | gnunet-gtk-1077c64a9266873957f8f89b967268cfb1ac3a80.tar.gz gnunet-gtk-1077c64a9266873957f8f89b967268cfb1ac3a80.zip |
-fixing various crashes introduced by recent #1759-related patches, also some major code cleanup
-rw-r--r-- | src/fs/gnunet-fs-gtk-edit_publish_dialog.c | 220 | ||||
-rw-r--r-- | src/fs/gnunet-fs-gtk-edit_publish_dialog.h | 33 | ||||
-rw-r--r-- | src/fs/gnunet-fs-gtk-main_window_adv_pseudonym.c | 78 | ||||
-rw-r--r-- | src/fs/gnunet-fs-gtk-main_window_file_publish.c | 145 |
4 files changed, 268 insertions, 208 deletions
diff --git a/src/fs/gnunet-fs-gtk-edit_publish_dialog.c b/src/fs/gnunet-fs-gtk-edit_publish_dialog.c index 37fe1a2a..05761a87 100644 --- a/src/fs/gnunet-fs-gtk-edit_publish_dialog.c +++ b/src/fs/gnunet-fs-gtk-edit_publish_dialog.c | |||
@@ -30,21 +30,22 @@ | |||
30 | 30 | ||
31 | #define PUBSTATE "edit-publication-state" | 31 | #define PUBSTATE "edit-publication-state" |
32 | 32 | ||
33 | struct edit_publication_state | 33 | struct EditPublicationState |
34 | { | 34 | { |
35 | int *do_index; | 35 | int do_index; |
36 | char **short_fn; | 36 | char *short_fn; |
37 | guint *anonymity_level; | 37 | guint anonymity_level; |
38 | guint *priority; | 38 | guint priority; |
39 | struct GNUNET_FS_FileInformation *fip; | 39 | struct GNUNET_FS_FileInformation *fip; |
40 | gint preview_changed; | 40 | gint preview_changed; |
41 | gboolean allow_no_keywords; | 41 | gboolean allow_no_keywords; |
42 | gboolean is_directory; | 42 | gboolean is_directory; |
43 | GNUNET_FS_GTK_edit_publish_dialog_cb cb; | 43 | GNUNET_FS_GTK_EditPublishDialogCallback cb; |
44 | gchar *root; | 44 | gchar *root; |
45 | gpointer cls; | 45 | gpointer cls; |
46 | }; | 46 | }; |
47 | 47 | ||
48 | |||
48 | static void | 49 | static void |
49 | metadata_selection_changed_cb (GtkTreeSelection * ts, gpointer user_data) | 50 | metadata_selection_changed_cb (GtkTreeSelection * ts, gpointer user_data) |
50 | { | 51 | { |
@@ -67,6 +68,7 @@ metadata_selection_changed_cb (GtkTreeSelection * ts, gpointer user_data) | |||
67 | gtk_tree_selection_get_selected (sel, NULL, NULL)); | 68 | gtk_tree_selection_get_selected (sel, NULL, NULL)); |
68 | } | 69 | } |
69 | 70 | ||
71 | |||
70 | static void | 72 | static void |
71 | keywords_selection_changed_cb (GtkTreeSelection * ts, gpointer user_data) | 73 | keywords_selection_changed_cb (GtkTreeSelection * ts, gpointer user_data) |
72 | { | 74 | { |
@@ -100,7 +102,7 @@ keywords_selection_changed_cb (GtkTreeSelection * ts, gpointer user_data) | |||
100 | 102 | ||
101 | void | 103 | void |
102 | GNUNET_GTK_edit_publication_window_realize_cb (GtkWidget *widget, | 104 | GNUNET_GTK_edit_publication_window_realize_cb (GtkWidget *widget, |
103 | gpointer user_data) | 105 | gpointer user_data) |
104 | { | 106 | { |
105 | GtkBuilder *builder; | 107 | GtkBuilder *builder; |
106 | GtkListStore *metatypes_list; | 108 | GtkListStore *metatypes_list; |
@@ -135,9 +137,10 @@ GNUNET_GTK_edit_publication_window_realize_cb (GtkWidget *widget, | |||
135 | 3, EXTRACTOR_metatype_to_description (type), -1); | 137 | 3, EXTRACTOR_metatype_to_description (type), -1); |
136 | } | 138 | } |
137 | 139 | ||
140 | |||
138 | void | 141 | void |
139 | GNUNET_GTK_edit_publication_add_button_clicked_cb (GtkButton *button, | 142 | GNUNET_GTK_edit_publication_add_button_clicked_cb (GtkButton *button, |
140 | gpointer user_data) | 143 | gpointer user_data) |
141 | { | 144 | { |
142 | GtkBuilder *builder; | 145 | GtkBuilder *builder; |
143 | GtkTreeView *meta_tree; | 146 | GtkTreeView *meta_tree; |
@@ -155,9 +158,10 @@ GNUNET_GTK_edit_publication_add_button_clicked_cb (GtkButton *button, | |||
155 | 2, _("Select a type"), 3, _("Specify a value"), 4, NULL, -1); | 158 | 2, _("Select a type"), 3, _("Specify a value"), 4, NULL, -1); |
156 | } | 159 | } |
157 | 160 | ||
161 | |||
158 | gboolean | 162 | gboolean |
159 | GNUNET_GTK_edit_publication_keyword_entry_key_press_event_cb (GtkWidget *widget, | 163 | GNUNET_GTK_edit_publication_keyword_entry_key_press_event_cb (GtkWidget *widget, |
160 | GdkEventKey *event, gpointer user_data) | 164 | GdkEventKey *event, gpointer user_data) |
161 | { | 165 | { |
162 | GtkBuilder *builder; | 166 | GtkBuilder *builder; |
163 | GtkButton *add_button; | 167 | GtkButton *add_button; |
@@ -173,10 +177,11 @@ GNUNET_GTK_edit_publication_keyword_entry_key_press_event_cb (GtkWidget *widget, | |||
173 | return FALSE; | 177 | return FALSE; |
174 | } | 178 | } |
175 | 179 | ||
180 | |||
176 | void | 181 | void |
177 | GNUNET_GTK_edit_publication_metadata_tree_view_type_renderer_edited_cb ( | 182 | GNUNET_GTK_edit_publication_metadata_tree_view_type_renderer_edited_cb (GtkCellRendererText *renderer, |
178 | GtkCellRendererText *renderer, gchar *path, gchar *new_text, | 183 | gchar *path, gchar *new_text, |
179 | gpointer user_data) | 184 | gpointer user_data) |
180 | { | 185 | { |
181 | GtkBuilder *builder; | 186 | GtkBuilder *builder; |
182 | GtkTreeView *meta_tree; | 187 | GtkTreeView *meta_tree; |
@@ -212,6 +217,7 @@ GNUNET_GTK_edit_publication_metadata_tree_view_type_renderer_edited_cb ( | |||
212 | g_free (description); | 217 | g_free (description); |
213 | } | 218 | } |
214 | 219 | ||
220 | |||
215 | void | 221 | void |
216 | GNUNET_GTK_edit_publication_metadata_tree_view_type_renderer_changed_cb ( | 222 | GNUNET_GTK_edit_publication_metadata_tree_view_type_renderer_changed_cb ( |
217 | GtkCellRendererCombo *combo, gchar *path_string, GtkTreeIter *new_iter, | 223 | GtkCellRendererCombo *combo, gchar *path_string, GtkTreeIter *new_iter, |
@@ -227,6 +233,7 @@ GNUNET_GTK_edit_publication_metadata_tree_view_type_renderer_changed_cb ( | |||
227 | g_object_set_data (G_OBJECT (combo), "selected-type", pass_data); | 233 | g_object_set_data (G_OBJECT (combo), "selected-type", pass_data); |
228 | } | 234 | } |
229 | 235 | ||
236 | |||
230 | void | 237 | void |
231 | GNUNET_GTK_edit_publication_metadata_tree_view_value_renderer_edited_cb ( | 238 | GNUNET_GTK_edit_publication_metadata_tree_view_value_renderer_edited_cb ( |
232 | GtkCellRendererText *renderer, gchar *path, gchar *new_text, | 239 | GtkCellRendererText *renderer, gchar *path, gchar *new_text, |
@@ -243,7 +250,7 @@ GNUNET_GTK_edit_publication_metadata_tree_view_value_renderer_edited_cb ( | |||
243 | char *pos; | 250 | char *pos; |
244 | 251 | ||
245 | GObject *pubwindow; | 252 | GObject *pubwindow; |
246 | struct edit_publication_state *state = NULL; | 253 | struct EditPublicationState *state = NULL; |
247 | 254 | ||
248 | builder = GTK_BUILDER (user_data); | 255 | builder = GTK_BUILDER (user_data); |
249 | meta_tree = GTK_TREE_VIEW (gtk_builder_get_object (builder, | 256 | meta_tree = GTK_TREE_VIEW (gtk_builder_get_object (builder, |
@@ -296,9 +303,10 @@ GNUNET_GTK_edit_publication_metadata_tree_view_value_renderer_edited_cb ( | |||
296 | GNUNET_free_non_null (avalue); | 303 | GNUNET_free_non_null (avalue); |
297 | } | 304 | } |
298 | 305 | ||
306 | |||
299 | void | 307 | void |
300 | GNUNET_GTK_edit_publication_delete_button_clicked_cb (GtkButton *button, | 308 | GNUNET_GTK_edit_publication_delete_button_clicked_cb (GtkButton *button, |
301 | gpointer user_data) | 309 | gpointer user_data) |
302 | { | 310 | { |
303 | GtkTreeView *tv; | 311 | GtkTreeView *tv; |
304 | GtkTreeSelection *sel; | 312 | GtkTreeSelection *sel; |
@@ -319,9 +327,10 @@ GNUNET_GTK_edit_publication_delete_button_clicked_cb (GtkButton *button, | |||
319 | gtk_tree_selection_select_iter (sel, &iter); | 327 | gtk_tree_selection_select_iter (sel, &iter); |
320 | } | 328 | } |
321 | 329 | ||
330 | |||
322 | void | 331 | void |
323 | GNUNET_GTK_edit_publication_keyword_list_add_button_clicked_cb ( | 332 | GNUNET_GTK_edit_publication_keyword_list_add_button_clicked_cb ( |
324 | GtkButton *button, gpointer user_data) | 333 | GtkButton *button, gpointer user_data) |
325 | { | 334 | { |
326 | const char *keyword; | 335 | const char *keyword; |
327 | GtkEntry *entry; | 336 | GtkEntry *entry; |
@@ -348,15 +357,26 @@ GNUNET_GTK_edit_publication_keyword_list_add_button_clicked_cb ( | |||
348 | gtk_entry_set_text (entry, ""); | 357 | gtk_entry_set_text (entry, ""); |
349 | } | 358 | } |
350 | 359 | ||
351 | gboolean | 360 | |
352 | gtk_tree_model_get_item_count_cb (GtkTreeModel *model, GtkTreePath *path, | 361 | static gboolean |
362 | gtk_tree_model_has_items_cb (GtkTreeModel *model, GtkTreePath *path, | ||
353 | GtkTreeIter *iter, gpointer data) | 363 | GtkTreeIter *iter, gpointer data) |
354 | { | 364 | { |
355 | gint *counter = (gint *) data; | 365 | gboolean *val = (gboolean *) data; |
356 | *counter += 1; | 366 | *val = TRUE; |
357 | return FALSE; | 367 | return TRUE; |
358 | } | 368 | } |
359 | 369 | ||
370 | |||
371 | static gboolean | ||
372 | gtk_tree_model_has_items (GtkTreeModel *model) | ||
373 | { | ||
374 | gboolean b = FALSE; | ||
375 | gtk_tree_model_foreach (model, >k_tree_model_has_items_cb, &b); | ||
376 | return b; | ||
377 | } | ||
378 | |||
379 | |||
360 | void | 380 | void |
361 | GNUNET_GTK_edit_publication_keyword_entry_changed_cb (GtkEditable *editable, | 381 | GNUNET_GTK_edit_publication_keyword_entry_changed_cb (GtkEditable *editable, |
362 | gpointer user_data) | 382 | gpointer user_data) |
@@ -380,31 +400,6 @@ GNUNET_GTK_edit_publication_keyword_entry_changed_cb (GtkEditable *editable, | |||
380 | } | 400 | } |
381 | 401 | ||
382 | 402 | ||
383 | gint | ||
384 | gtk_tree_model_get_item_count (GtkTreeModel *model) | ||
385 | { | ||
386 | gint c = 0; | ||
387 | gtk_tree_model_foreach (model, >k_tree_model_get_item_count_cb, &c); | ||
388 | return c; | ||
389 | } | ||
390 | |||
391 | gboolean | ||
392 | gtk_tree_model_has_items_cb (GtkTreeModel *model, GtkTreePath *path, | ||
393 | GtkTreeIter *iter, gpointer data) | ||
394 | { | ||
395 | gboolean *val = (gboolean *) data; | ||
396 | *val = TRUE; | ||
397 | return TRUE; | ||
398 | } | ||
399 | |||
400 | gboolean | ||
401 | gtk_tree_model_has_items (GtkTreeModel *model) | ||
402 | { | ||
403 | gboolean b = FALSE; | ||
404 | gtk_tree_model_foreach (model, >k_tree_model_has_items_cb, &b); | ||
405 | return b; | ||
406 | } | ||
407 | |||
408 | void | 403 | void |
409 | GNUNET_GTK_edit_publication_keyword_list_del_button_clicked_cb ( | 404 | GNUNET_GTK_edit_publication_keyword_list_del_button_clicked_cb ( |
410 | GtkButton *button, gpointer user_data) | 405 | GtkButton *button, gpointer user_data) |
@@ -416,7 +411,7 @@ GNUNET_GTK_edit_publication_keyword_list_del_button_clicked_cb ( | |||
416 | GtkBuilder *builder; | 411 | GtkBuilder *builder; |
417 | GtkWidget *ok; | 412 | GtkWidget *ok; |
418 | GObject *pubwindow; | 413 | GObject *pubwindow; |
419 | struct edit_publication_state *state = NULL; | 414 | struct EditPublicationState *state = NULL; |
420 | builder = GTK_BUILDER (user_data); | 415 | builder = GTK_BUILDER (user_data); |
421 | 416 | ||
422 | tv = GTK_TREE_VIEW (gtk_builder_get_object | 417 | tv = GTK_TREE_VIEW (gtk_builder_get_object |
@@ -448,6 +443,7 @@ GNUNET_GTK_edit_publication_keyword_list_del_button_clicked_cb ( | |||
448 | gtk_widget_set_sensitive (ok, FALSE); | 443 | gtk_widget_set_sensitive (ok, FALSE); |
449 | } | 444 | } |
450 | 445 | ||
446 | |||
451 | void | 447 | void |
452 | GNUNET_GTK_edit_publication_keyword_list_normalize_button_clicked_cb ( | 448 | GNUNET_GTK_edit_publication_keyword_list_normalize_button_clicked_cb ( |
453 | GtkButton *button, gpointer user_data) | 449 | GtkButton *button, gpointer user_data) |
@@ -494,6 +490,7 @@ GNUNET_GTK_edit_publication_keyword_list_normalize_button_clicked_cb ( | |||
494 | g_free (value); | 490 | g_free (value); |
495 | } | 491 | } |
496 | 492 | ||
493 | |||
497 | void | 494 | void |
498 | GNUNET_GTK_edit_publication_normalization_checkbox_toggled_cb ( | 495 | GNUNET_GTK_edit_publication_normalization_checkbox_toggled_cb ( |
499 | GtkToggleButton *button, gpointer user_data) | 496 | GtkToggleButton *button, gpointer user_data) |
@@ -507,6 +504,7 @@ GNUNET_GTK_edit_publication_normalization_checkbox_toggled_cb ( | |||
507 | !gtk_toggle_button_get_active (norm_button)); | 504 | !gtk_toggle_button_get_active (norm_button)); |
508 | } | 505 | } |
509 | 506 | ||
507 | |||
510 | void | 508 | void |
511 | GNUNET_GTK_edit_publication_metadata_preview_file_chooser_button_file_set_cb ( | 509 | GNUNET_GTK_edit_publication_metadata_preview_file_chooser_button_file_set_cb ( |
512 | GtkFileChooserButton *widget, gpointer user_data) | 510 | GtkFileChooserButton *widget, gpointer user_data) |
@@ -515,7 +513,7 @@ GNUNET_GTK_edit_publication_metadata_preview_file_chooser_button_file_set_cb ( | |||
515 | GtkImage *image; | 513 | GtkImage *image; |
516 | GObject *pubwindow; | 514 | GObject *pubwindow; |
517 | GtkBuilder *builder = GTK_BUILDER (user_data); | 515 | GtkBuilder *builder = GTK_BUILDER (user_data); |
518 | struct edit_publication_state *state = NULL; | 516 | struct EditPublicationState *state = NULL; |
519 | 517 | ||
520 | pubwindow = gtk_builder_get_object (builder, | 518 | pubwindow = gtk_builder_get_object (builder, |
521 | "GNUNET_GTK_edit_publication_window"); | 519 | "GNUNET_GTK_edit_publication_window"); |
@@ -535,19 +533,22 @@ GNUNET_GTK_edit_publication_metadata_preview_file_chooser_button_file_set_cb ( | |||
535 | state->preview_changed = GNUNET_YES; | 533 | state->preview_changed = GNUNET_YES; |
536 | } | 534 | } |
537 | 535 | ||
538 | struct fiu_context | 536 | |
537 | struct FileInformationUpdateContext | ||
539 | { | 538 | { |
540 | GtkBuilder *builder; | 539 | GtkBuilder *builder; |
541 | char **short_fn; | 540 | char *short_fn; |
542 | gchar *root; | 541 | gchar *root; |
543 | struct GNUNET_CONTAINER_MetaData *md; | 542 | struct GNUNET_CONTAINER_MetaData *md; |
543 | gboolean allow_no_keywords; | ||
544 | }; | 544 | }; |
545 | 545 | ||
546 | |||
546 | /** | 547 | /** |
547 | * Copy binary meta data from to the new container and also | 548 | * Copy binary meta data from to the new container and also |
548 | * preserve all entries that were not changed. | 549 | * preserve all entries that were not changed. |
549 | * | 550 | * |
550 | * @param cls closure, new meta data container | 551 | * @param cls closure, a 'struct FileInformationUpdateContext' |
551 | * @param plugin_name name of the plugin that produced this value; | 552 | * @param plugin_name name of the plugin that produced this value; |
552 | * special values can be used (i.e. '<zlib>' for zlib being | 553 | * special values can be used (i.e. '<zlib>' for zlib being |
553 | * used in the main libextractor library and yielding | 554 | * used in the main libextractor library and yielding |
@@ -567,7 +568,7 @@ preserve_meta_items (void *cls, const char *plugin_name, | |||
567 | const char *data_mime_type, const char *data, | 568 | const char *data_mime_type, const char *data, |
568 | size_t data_len) | 569 | size_t data_len) |
569 | { | 570 | { |
570 | struct fiu_context *context = (struct fiu_context *) cls; | 571 | struct FileInformationUpdateContext *context = cls; |
571 | GtkBuilder *builder = context->builder; | 572 | GtkBuilder *builder = context->builder; |
572 | struct GNUNET_CONTAINER_MetaData *md = context->md; | 573 | struct GNUNET_CONTAINER_MetaData *md = context->md; |
573 | GtkTreeModel *tm; | 574 | GtkTreeModel *tm; |
@@ -578,7 +579,7 @@ preserve_meta_items (void *cls, const char *plugin_name, | |||
578 | int keep; | 579 | int keep; |
579 | 580 | ||
580 | GObject *pubwindow; | 581 | GObject *pubwindow; |
581 | struct edit_publication_state *state = NULL; | 582 | struct EditPublicationState *state = NULL; |
582 | 583 | ||
583 | pubwindow = gtk_builder_get_object (builder, | 584 | pubwindow = gtk_builder_get_object (builder, |
584 | "GNUNET_GTK_edit_publication_window"); | 585 | "GNUNET_GTK_edit_publication_window"); |
@@ -636,7 +637,7 @@ preserve_meta_items (void *cls, const char *plugin_name, | |||
636 | /** | 637 | /** |
637 | * Function called to update the information in FI. | 638 | * Function called to update the information in FI. |
638 | * | 639 | * |
639 | * @param cls closure (short_fn to update) | 640 | * @param cls closure with a 'struct FileInformationUpdateContext *' |
640 | * @param fi the entry in the publish-structure | 641 | * @param fi the entry in the publish-structure |
641 | * @param length length of the file or directory | 642 | * @param length length of the file or directory |
642 | * @param meta metadata for the file or directory (can be modified) | 643 | * @param meta metadata for the file or directory (can be modified) |
@@ -654,8 +655,8 @@ file_information_update (void *cls, struct GNUNET_FS_FileInformation *fi, | |||
654 | struct GNUNET_FS_BlockOptions *bo, int *do_index, | 655 | struct GNUNET_FS_BlockOptions *bo, int *do_index, |
655 | void **client_info) | 656 | void **client_info) |
656 | { | 657 | { |
657 | struct fiu_context *context = (struct fiu_context *) cls; | 658 | struct FileInformationUpdateContext *context = cls; |
658 | char **short_fn = context->short_fn; | 659 | char **short_fn = &context->short_fn; |
659 | GtkBuilder *builder = context->builder; | 660 | GtkBuilder *builder = context->builder; |
660 | struct GNUNET_CONTAINER_MetaData *nm; | 661 | struct GNUNET_CONTAINER_MetaData *nm; |
661 | GtkTreeModel *tm; | 662 | GtkTreeModel *tm; |
@@ -673,9 +674,8 @@ file_information_update (void *cls, struct GNUNET_FS_FileInformation *fi, | |||
673 | GFile *f; | 674 | GFile *f; |
674 | GFileInfo *finfo; | 675 | GFileInfo *finfo; |
675 | gboolean auto_normalize = FALSE; | 676 | gboolean auto_normalize = FALSE; |
676 | |||
677 | GObject *pubwindow; | 677 | GObject *pubwindow; |
678 | struct edit_publication_state *state = NULL; | 678 | struct EditPublicationState *state = NULL; |
679 | 679 | ||
680 | pubwindow = gtk_builder_get_object (builder, | 680 | pubwindow = gtk_builder_get_object (builder, |
681 | "GNUNET_GTK_edit_publication_window"); | 681 | "GNUNET_GTK_edit_publication_window"); |
@@ -708,13 +708,15 @@ file_information_update (void *cls, struct GNUNET_FS_FileInformation *fi, | |||
708 | "GNUNET_GTK_edit_publication_expiration_year_spin_button")); | 708 | "GNUNET_GTK_edit_publication_expiration_year_spin_button")); |
709 | bo->expiration_time = GNUNET_FS_GTK_get_expiration_time (sb); | 709 | bo->expiration_time = GNUNET_FS_GTK_get_expiration_time (sb); |
710 | 710 | ||
711 | g_free (context->root); | 711 | if (! context->allow_no_keywords) |
712 | context->root = | 712 | { |
713 | g_free (context->root); | ||
714 | context->root = | ||
713 | g_strdup (gtk_entry_get_text (GTK_ENTRY | 715 | g_strdup (gtk_entry_get_text (GTK_ENTRY |
714 | (gtk_builder_get_object | 716 | (gtk_builder_get_object |
715 | (builder, | 717 | (builder, |
716 | "GNUNET_GTK_edit_publication_root_entry")))); | 718 | "GNUNET_GTK_edit_publication_root_entry")))); |
717 | 719 | } | |
718 | /* update URI */ | 720 | /* update URI */ |
719 | if (NULL != (*uri)) | 721 | if (NULL != (*uri)) |
720 | GNUNET_FS_uri_destroy (*uri); | 722 | GNUNET_FS_uri_destroy (*uri); |
@@ -819,13 +821,14 @@ file_information_update (void *cls, struct GNUNET_FS_FileInformation *fi, | |||
819 | return GNUNET_SYSERR; /* only visit top-level item */ | 821 | return GNUNET_SYSERR; /* only visit top-level item */ |
820 | } | 822 | } |
821 | 823 | ||
824 | |||
822 | void | 825 | void |
823 | GNUNET_GTK_edit_publication_cancel_button_clicked_cb ( | 826 | GNUNET_GTK_edit_publication_cancel_button_clicked_cb ( |
824 | GtkButton *button, gpointer user_data) | 827 | GtkButton *button, gpointer user_data) |
825 | { | 828 | { |
826 | GtkBuilder *builder; | 829 | GtkBuilder *builder; |
827 | GObject *pubwindow; | 830 | GObject *pubwindow; |
828 | struct edit_publication_state *state = NULL; | 831 | struct EditPublicationState *state = NULL; |
829 | 832 | ||
830 | builder = GTK_BUILDER (user_data); | 833 | builder = GTK_BUILDER (user_data); |
831 | 834 | ||
@@ -839,20 +842,20 @@ GNUNET_GTK_edit_publication_cancel_button_clicked_cb ( | |||
839 | } | 842 | } |
840 | 843 | ||
841 | state->cb (state->cls, state->do_index, state->short_fn, | 844 | state->cb (state->cls, state->do_index, state->short_fn, |
842 | state->anonymity_level, state->priority, NULL, state->fip, GTK_RESPONSE_CANCEL); | 845 | state->anonymity_level, state->priority, NULL, GTK_RESPONSE_CANCEL); |
843 | g_free (state); | 846 | g_free (state); |
844 | g_object_set_data (pubwindow, PUBSTATE, NULL); | 847 | g_object_set_data (pubwindow, PUBSTATE, NULL); |
845 | gtk_widget_hide (GTK_WIDGET (pubwindow)); | 848 | gtk_widget_hide (GTK_WIDGET (pubwindow)); |
846 | } | 849 | } |
847 | 850 | ||
851 | |||
848 | void | 852 | void |
849 | GNUNET_GTK_edit_publication_confirm_button_clicked_cb ( | 853 | GNUNET_GTK_edit_publication_confirm_button_clicked_cb (GtkButton *button, gpointer user_data) |
850 | GtkButton *button, gpointer user_data) | ||
851 | { | 854 | { |
852 | GtkBuilder *builder; | 855 | GtkBuilder *builder; |
853 | GObject *pubwindow; | 856 | GObject *pubwindow; |
854 | struct edit_publication_state *state = NULL; | 857 | struct EditPublicationState *state; |
855 | struct fiu_context ctx; | 858 | struct FileInformationUpdateContext ctx; |
856 | 859 | ||
857 | builder = GTK_BUILDER (user_data); | 860 | builder = GTK_BUILDER (user_data); |
858 | 861 | ||
@@ -869,30 +872,37 @@ GNUNET_GTK_edit_publication_confirm_button_clicked_cb ( | |||
869 | ctx.short_fn = state->short_fn; | 872 | ctx.short_fn = state->short_fn; |
870 | ctx.root = NULL; | 873 | ctx.root = NULL; |
871 | ctx.md = NULL; | 874 | ctx.md = NULL; |
875 | ctx.allow_no_keywords = state->allow_no_keywords; | ||
872 | 876 | ||
873 | GNUNET_FS_file_information_inspect (state->fip, &file_information_update, &ctx); | 877 | GNUNET_FS_file_information_inspect (state->fip, &file_information_update, &ctx); |
874 | if (!GNUNET_GTK_get_selected_anonymity_level (builder, | 878 | if (!GNUNET_GTK_get_selected_anonymity_level (builder, |
875 | "GNUNET_GTK_edit_publication_anonymity_combobox", state->anonymity_level)) | 879 | "GNUNET_GTK_edit_publication_anonymity_combobox", |
876 | *state->priority = | 880 | &state->anonymity_level)) |
881 | state->priority = | ||
877 | gtk_spin_button_get_value (GTK_SPIN_BUTTON | 882 | gtk_spin_button_get_value (GTK_SPIN_BUTTON |
878 | (gtk_builder_get_object | 883 | (gtk_builder_get_object |
879 | (builder, | 884 | (builder, |
880 | "GNUNET_GTK_edit_publication_priority_spin_button"))); | 885 | "GNUNET_GTK_edit_publication_priority_spin_button"))); |
881 | *state->do_index = | 886 | state->do_index = |
882 | gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON | 887 | gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON |
883 | (gtk_builder_get_object | 888 | (gtk_builder_get_object |
884 | (builder, | 889 | (builder, |
885 | "GNUNET_GTK_edit_publication_index_checkbutton"))); | 890 | "GNUNET_GTK_edit_publication_index_checkbutton"))); |
886 | 891 | ||
887 | 892 | ||
888 | state->cb (state->cls, state->do_index, state->short_fn, | 893 | state->cb (state->cls, |
889 | state->anonymity_level, state->priority, ctx.root, state->fip, | 894 | state->do_index, |
890 | GTK_RESPONSE_OK); | 895 | state->short_fn, |
891 | g_free (state); | 896 | state->anonymity_level, |
897 | state->priority, ctx.root, | ||
898 | GTK_RESPONSE_OK); | ||
899 | GNUNET_free (state->short_fn); | ||
900 | GNUNET_free (state); | ||
892 | g_object_set_data (pubwindow, PUBSTATE, NULL); | 901 | g_object_set_data (pubwindow, PUBSTATE, NULL); |
893 | gtk_widget_hide (GTK_WIDGET (pubwindow)); | 902 | gtk_widget_hide (GTK_WIDGET (pubwindow)); |
894 | } | 903 | } |
895 | 904 | ||
905 | |||
896 | /** | 906 | /** |
897 | * Add each of the keywords to the keyword list store. | 907 | * Add each of the keywords to the keyword list store. |
898 | * | 908 | * |
@@ -912,6 +922,7 @@ add_keyword (void *cls, const char *keyword, int is_mandatory) | |||
912 | return GNUNET_OK; | 922 | return GNUNET_OK; |
913 | } | 923 | } |
914 | 924 | ||
925 | |||
915 | /** | 926 | /** |
916 | * Function called to extract the information from FI. | 927 | * Function called to extract the information from FI. |
917 | * | 928 | * |
@@ -973,7 +984,7 @@ file_information_extract (void *cls, struct GNUNET_FS_FileInformation *fi, | |||
973 | "GNUNET_GTK_edit_publication_expiration_year_spin_button")), | 984 | "GNUNET_GTK_edit_publication_expiration_year_spin_button")), |
974 | year); | 985 | year); |
975 | GNUNET_GTK_select_anonymity_level (builder, | 986 | GNUNET_GTK_select_anonymity_level (builder, |
976 | "GNUNET_GTK_edit_publication_anonymity_combobox", bo->anonymity_level); | 987 | "GNUNET_GTK_edit_publication_anonymity_combobox", bo->anonymity_level); |
977 | gtk_spin_button_set_value (GTK_SPIN_BUTTON | 988 | gtk_spin_button_set_value (GTK_SPIN_BUTTON |
978 | (gtk_builder_get_object | 989 | (gtk_builder_get_object |
979 | (builder, | 990 | (builder, |
@@ -992,16 +1003,21 @@ file_information_extract (void *cls, struct GNUNET_FS_FileInformation *fi, | |||
992 | * Open the dialog to edit file information data. | 1003 | * Open the dialog to edit file information data. |
993 | */ | 1004 | */ |
994 | void | 1005 | void |
995 | GNUNET_FS_GTK_edit_publish_dialog (GtkBuilder *builder, GtkWindow *parent, int *do_index, | 1006 | GNUNET_FS_GTK_edit_publish_dialog (GtkBuilder *builder, |
996 | char **short_fn, guint *anonymity_level, guint *priority, | 1007 | GtkWindow *parent, |
997 | struct GNUNET_FS_FileInformation *fip, gboolean allow_no_keywords, | 1008 | int do_index, |
998 | GNUNET_FS_GTK_edit_publish_dialog_cb cb, gpointer cls) | 1009 | const char *short_fn, |
1010 | uint32_t anonymity_level, | ||
1011 | uint32_t priority, | ||
1012 | struct GNUNET_FS_FileInformation *fip, | ||
1013 | gboolean allow_no_keywords, | ||
1014 | GNUNET_FS_GTK_EditPublishDialogCallback cb, gpointer cls) | ||
999 | { | 1015 | { |
1000 | GtkWidget *dialog; | 1016 | GtkWidget *dialog; |
1001 | GObject *pubwindow; | 1017 | GObject *pubwindow; |
1002 | GtkEntry *entry; | 1018 | GtkEntry *entry; |
1003 | GtkWidget *ok; | 1019 | GtkWidget *ok; |
1004 | struct edit_publication_state *state; | 1020 | struct EditPublicationState *state; |
1005 | 1021 | ||
1006 | GNUNET_FS_GTK_setup_expiration_year_adjustment (builder); | 1022 | GNUNET_FS_GTK_setup_expiration_year_adjustment (builder); |
1007 | if (GNUNET_FS_file_information_is_directory (fip)) | 1023 | if (GNUNET_FS_file_information_is_directory (fip)) |
@@ -1019,9 +1035,9 @@ GNUNET_FS_GTK_edit_publish_dialog (GtkBuilder *builder, GtkWindow *parent, int * | |||
1019 | if (allow_no_keywords) | 1035 | if (allow_no_keywords) |
1020 | { | 1036 | { |
1021 | gtk_widget_hide (GTK_WIDGET (gtk_builder_get_object (builder, | 1037 | gtk_widget_hide (GTK_WIDGET (gtk_builder_get_object (builder, |
1022 | "GNUNET_GTK_edit_publication_root_entry"))); | 1038 | "GNUNET_GTK_edit_publication_root_entry"))); |
1023 | gtk_widget_hide (GTK_WIDGET (gtk_builder_get_object (builder, | 1039 | gtk_widget_hide (GTK_WIDGET (gtk_builder_get_object (builder, |
1024 | "GNUNET_GTK_edit_publication_root_label"))); | 1040 | "GNUNET_GTK_edit_publication_root_label"))); |
1025 | } | 1041 | } |
1026 | gtk_list_store_clear (GTK_LIST_STORE (gtk_builder_get_object ( | 1042 | gtk_list_store_clear (GTK_LIST_STORE (gtk_builder_get_object ( |
1027 | builder, "GNUNET_GTK_publication_keywords_liststore"))); | 1043 | builder, "GNUNET_GTK_publication_keywords_liststore"))); |
@@ -1029,18 +1045,15 @@ GNUNET_FS_GTK_edit_publish_dialog (GtkBuilder *builder, GtkWindow *parent, int * | |||
1029 | builder, "GNUNET_GTK_publication_metadata_liststore"))); | 1045 | builder, "GNUNET_GTK_publication_metadata_liststore"))); |
1030 | 1046 | ||
1031 | GNUNET_FS_file_information_inspect (fip, &file_information_extract, builder); | 1047 | GNUNET_FS_file_information_inspect (fip, &file_information_extract, builder); |
1032 | |||
1033 | dialog = GTK_WIDGET (gtk_builder_get_object (builder, | 1048 | dialog = GTK_WIDGET (gtk_builder_get_object (builder, |
1034 | "GNUNET_GTK_edit_publication_window")); | 1049 | "GNUNET_GTK_edit_publication_window")); |
1035 | 1050 | gtk_window_set_title (GTK_WINDOW (dialog), short_fn); | |
1036 | gtk_window_set_title (GTK_WINDOW (dialog), *short_fn); | ||
1037 | 1051 | ||
1038 | state = g_new0 (struct edit_publication_state, 1); | 1052 | state = GNUNET_malloc (sizeof (struct EditPublicationState)); |
1039 | state->do_index = do_index; | 1053 | state->do_index = do_index; |
1040 | state->short_fn = short_fn; | 1054 | state->short_fn = GNUNET_strdup (short_fn); |
1041 | state->root = NULL; | 1055 | state->anonymity_level = (guint) anonymity_level; |
1042 | state->anonymity_level = anonymity_level; | 1056 | state->priority = (guint) priority; |
1043 | state->priority = priority; | ||
1044 | state->fip = fip; | 1057 | state->fip = fip; |
1045 | state->preview_changed = GNUNET_NO; | 1058 | state->preview_changed = GNUNET_NO; |
1046 | state->allow_no_keywords = allow_no_keywords; | 1059 | state->allow_no_keywords = allow_no_keywords; |
@@ -1052,18 +1065,15 @@ GNUNET_FS_GTK_edit_publish_dialog (GtkBuilder *builder, GtkWindow *parent, int * | |||
1052 | GTK_ENTRY (gtk_builder_get_object | 1065 | GTK_ENTRY (gtk_builder_get_object |
1053 | (builder, "GNUNET_GTK_edit_publication_keyword_entry")); | 1066 | (builder, "GNUNET_GTK_edit_publication_keyword_entry")); |
1054 | gtk_entry_set_text (entry, ""); | 1067 | gtk_entry_set_text (entry, ""); |
1055 | |||
1056 | pubwindow = gtk_builder_get_object (builder, | 1068 | pubwindow = gtk_builder_get_object (builder, |
1057 | "GNUNET_GTK_edit_publication_window"); | 1069 | "GNUNET_GTK_edit_publication_window"); |
1058 | g_object_set_data (pubwindow, PUBSTATE, state); | 1070 | g_object_set_data (pubwindow, PUBSTATE, state); |
1059 | |||
1060 | ok = GTK_WIDGET (gtk_builder_get_object (builder, | 1071 | ok = GTK_WIDGET (gtk_builder_get_object (builder, |
1061 | "GNUNET_GTK_edit_publication_confirm_button")); | 1072 | "GNUNET_GTK_edit_publication_confirm_button")); |
1062 | gtk_widget_set_sensitive (ok, allow_no_keywords ? TRUE : FALSE); | 1073 | gtk_widget_set_sensitive (ok, allow_no_keywords ? TRUE : FALSE); |
1063 | |||
1064 | gtk_window_set_transient_for (GTK_WINDOW (pubwindow), parent); | 1074 | gtk_window_set_transient_for (GTK_WINDOW (pubwindow), parent); |
1065 | |||
1066 | gtk_window_present (GTK_WINDOW (dialog)); | 1075 | gtk_window_present (GTK_WINDOW (dialog)); |
1067 | } | 1076 | } |
1068 | 1077 | ||
1078 | |||
1069 | /* end of gnunet-fs-gtk-edit_publish_dialog.c */ | 1079 | /* end of gnunet-fs-gtk-edit_publish_dialog.c */ |
diff --git a/src/fs/gnunet-fs-gtk-edit_publish_dialog.h b/src/fs/gnunet-fs-gtk-edit_publish_dialog.h index 5473cb42..4d24cd64 100644 --- a/src/fs/gnunet-fs-gtk-edit_publish_dialog.h +++ b/src/fs/gnunet-fs-gtk-edit_publish_dialog.h | |||
@@ -30,20 +30,39 @@ | |||
30 | #include <gnunet/gnunet_fs_service.h> | 30 | #include <gnunet/gnunet_fs_service.h> |
31 | 31 | ||
32 | 32 | ||
33 | /** | ||
34 | * Function called when the edit publish dialog has been closed. | ||
35 | * | ||
36 | * @param cls closure | ||
37 | * @param do_index index flag set? | ||
38 | * @param short_fn short filename | ||
39 | * @param anonymity_level anonymity degree chosen for publishing | ||
40 | * @param priority replication setting (rename!) | ||
41 | * @param root namespace root, NULL for file publishing | ||
42 | * @param ret GTK_RESPONSE_OK if the dialog was closed with "OK" | ||
43 | */ | ||
33 | typedef void | 44 | typedef void |
34 | (*GNUNET_FS_GTK_edit_publish_dialog_cb) (gpointer cls, int *do_index, char **short_fn, | 45 | (*GNUNET_FS_GTK_EditPublishDialogCallback) (gpointer cls, int do_index, |
35 | guint * anonymity_level, guint * priority, gchar *root, | 46 | const char *short_fn, |
36 | struct GNUNET_FS_FileInformation *fip, gint ret); | 47 | guint anonymity_level, |
48 | guint priority, | ||
49 | const char *root, | ||
50 | int ret); | ||
37 | 51 | ||
38 | 52 | ||
39 | /** | 53 | /** |
40 | * Open the dialog to edit file information data. | 54 | * Open the dialog to edit file information data. |
41 | */ | 55 | */ |
42 | void | 56 | void |
43 | GNUNET_FS_GTK_edit_publish_dialog (GtkBuilder *builder, GtkWindow *parent, int *do_index, | 57 | GNUNET_FS_GTK_edit_publish_dialog (GtkBuilder *builder, |
44 | char **short_fn, guint * anonymity_level, guint * priority, | 58 | GtkWindow *parent, |
45 | struct GNUNET_FS_FileInformation *fip, gboolean allow_no_keywords, | 59 | int do_index, |
46 | GNUNET_FS_GTK_edit_publish_dialog_cb cb, gpointer cls); | 60 | const char *short_fn, |
61 | uint32_t anonymity_level, | ||
62 | uint32_t priority, | ||
63 | struct GNUNET_FS_FileInformation *fip, | ||
64 | gboolean allow_no_keywords, | ||
65 | GNUNET_FS_GTK_EditPublishDialogCallback cb, gpointer cls); | ||
47 | 66 | ||
48 | #endif | 67 | #endif |
49 | /* end of gnunet-fs-gtk-edit_publish_dialog.h */ | 68 | /* end of gnunet-fs-gtk-edit_publish_dialog.h */ |
diff --git a/src/fs/gnunet-fs-gtk-main_window_adv_pseudonym.c b/src/fs/gnunet-fs-gtk-main_window_adv_pseudonym.c index 9b76f2ab..77ae7353 100644 --- a/src/fs/gnunet-fs-gtk-main_window_adv_pseudonym.c +++ b/src/fs/gnunet-fs-gtk-main_window_adv_pseudonym.c | |||
@@ -66,20 +66,22 @@ selection_changed_cb (GtkTreeSelection * ts, gpointer user_data) | |||
66 | gtk_widget_set_sensitive (ok_button, FALSE); | 66 | gtk_widget_set_sensitive (ok_button, FALSE); |
67 | } | 67 | } |
68 | 68 | ||
69 | struct namespace_data_struct | 69 | struct NamespaceAdvertisementContext |
70 | { | 70 | { |
71 | struct GNUNET_FS_Namespace *ns; | 71 | struct GNUNET_FS_Namespace *ns; |
72 | int do_index; | 72 | int do_index; |
73 | char *short_fn; | 73 | const char *short_fn; |
74 | guint anonymity_level; | 74 | guint anonymity_level; |
75 | guint priority; | 75 | guint priority; |
76 | gchar *root; | 76 | const char *root; |
77 | struct GNUNET_FS_FileInformation *fip; | ||
77 | }; | 78 | }; |
78 | 79 | ||
80 | |||
79 | /** | 81 | /** |
80 | * Function called on entries in a GNUNET_FS_FileInformation publish-structure. | 82 | * Function called on entries in a GNUNET_FS_FileInformation publish-structure. |
81 | * | 83 | * |
82 | * @param cls closure | 84 | * @param cls closure, a 'struct NamespaceAdvertisementContext *' |
83 | * @param fi the entry in the publish-structure | 85 | * @param fi the entry in the publish-structure |
84 | * @param length length of the file or directory | 86 | * @param length length of the file or directory |
85 | * @param meta metadata for the file or directory (can be modified) | 87 | * @param meta metadata for the file or directory (can be modified) |
@@ -91,41 +93,44 @@ struct namespace_data_struct | |||
91 | * this entry from the directory, GNUNET_SYSERR | 93 | * this entry from the directory, GNUNET_SYSERR |
92 | * to abort the iteration | 94 | * to abort the iteration |
93 | */ | 95 | */ |
94 | int | 96 | static int |
95 | advertise_namespace (void *cls, struct GNUNET_FS_FileInformation *fi, | 97 | advertise_namespace (void *cls, struct GNUNET_FS_FileInformation *fi, |
96 | uint64_t length, struct GNUNET_CONTAINER_MetaData *meta, | 98 | uint64_t length, struct GNUNET_CONTAINER_MetaData *meta, |
97 | struct GNUNET_FS_Uri **uri, struct GNUNET_FS_BlockOptions *bo, | 99 | struct GNUNET_FS_Uri **uri, struct GNUNET_FS_BlockOptions *bo, |
98 | int *do_index, void **client_info) | 100 | int *do_index, void **client_info) |
99 | { | 101 | { |
100 | struct namespace_data_struct *nds; | 102 | struct NamespaceAdvertisementContext *nds = cls; |
101 | nds = (struct namespace_data_struct *) cls; | 103 | |
102 | GNUNET_FS_namespace_advertise (GNUNET_FS_GTK_get_fs_handle (), *uri, | 104 | GNUNET_FS_namespace_advertise (GNUNET_FS_GTK_get_fs_handle (), *uri, |
103 | nds->ns, meta, bo, nds->root, NULL, NULL); | 105 | nds->ns, meta, bo, nds->root, NULL, NULL); |
104 | return GNUNET_SYSERR; | 106 | return GNUNET_SYSERR; |
105 | } | 107 | } |
106 | 108 | ||
107 | void | 109 | |
108 | adv_pseudonym_edit_publish_dialog_cb (gpointer cls, int *do_index, char **short_fn, | 110 | static void |
109 | guint * anonymity_level, guint * priority, gchar *root, | 111 | adv_pseudonym_edit_publish_dialog_cb (gpointer cls, |
110 | struct GNUNET_FS_FileInformation *fip, gint ret) | 112 | int do_index, |
113 | const char *short_fn, | ||
114 | guint anonymity_level, | ||
115 | guint priority, | ||
116 | const char *root, | ||
117 | gint ret) | ||
111 | { | 118 | { |
112 | struct namespace_data_struct *nds; | 119 | struct NamespaceAdvertisementContext *nds = cls; |
113 | nds = (struct namespace_data_struct *) cls; | ||
114 | 120 | ||
115 | if (ret == GTK_RESPONSE_OK) | 121 | if (ret == GTK_RESPONSE_OK) |
116 | { | 122 | { |
117 | nds->do_index = *do_index; | 123 | nds->do_index = do_index; |
118 | nds->short_fn = *short_fn; | 124 | nds->short_fn = short_fn; |
119 | nds->anonymity_level = *anonymity_level; | 125 | nds->anonymity_level = anonymity_level; |
120 | nds->priority = *priority; | 126 | nds->priority = priority; |
121 | nds->root = root; | 127 | nds->root = root; |
122 | GNUNET_FS_file_information_inspect (fip, | 128 | GNUNET_FS_file_information_inspect (nds->fip, |
123 | advertise_namespace, nds); | 129 | &advertise_namespace, nds); |
124 | } | 130 | } |
125 | g_free (nds->root); | ||
126 | GNUNET_FS_namespace_delete (nds->ns, GNUNET_NO); | 131 | GNUNET_FS_namespace_delete (nds->ns, GNUNET_NO); |
127 | g_free (nds); | 132 | GNUNET_FS_file_information_destroy (nds->fip, NULL, NULL); |
128 | GNUNET_FS_file_information_destroy (fip, NULL, NULL); | 133 | GNUNET_free (nds); |
129 | } | 134 | } |
130 | 135 | ||
131 | void | 136 | void |
@@ -141,12 +146,11 @@ GNUNET_GTK_select_pseudonym_dialog_response_cb (GtkDialog *dialog, | |||
141 | struct GNUNET_FS_Namespace *ns; | 146 | struct GNUNET_FS_Namespace *ns; |
142 | struct GNUNET_FS_Namespace *nso; | 147 | struct GNUNET_FS_Namespace *nso; |
143 | GtkWindow *transient; | 148 | GtkWindow *transient; |
144 | struct namespace_data_struct *nds; | 149 | struct NamespaceAdvertisementContext *nds; |
145 | struct GNUNET_FS_FileInformation *fip; | ||
146 | struct GNUNET_CONTAINER_MetaData *meta; | 150 | struct GNUNET_CONTAINER_MetaData *meta; |
147 | builder = GTK_BUILDER (user_data); | ||
148 | struct GNUNET_FS_BlockOptions bo; | 151 | struct GNUNET_FS_BlockOptions bo; |
149 | 152 | ||
153 | builder = GTK_BUILDER (user_data); | ||
150 | ad = GTK_WIDGET (gtk_builder_get_object | 154 | ad = GTK_WIDGET (gtk_builder_get_object |
151 | (builder, "GNUNET_GTK_select_pseudonym_dialog")); | 155 | (builder, "GNUNET_GTK_select_pseudonym_dialog")); |
152 | 156 | ||
@@ -178,7 +182,7 @@ GNUNET_GTK_select_pseudonym_dialog_response_cb (GtkDialog *dialog, | |||
178 | 182 | ||
179 | meta = GNUNET_CONTAINER_meta_data_create (); | 183 | meta = GNUNET_CONTAINER_meta_data_create (); |
180 | 184 | ||
181 | nds = g_new0 (struct namespace_data_struct, 1); | 185 | nds = GNUNET_malloc (sizeof (struct NamespaceAdvertisementContext)); |
182 | nds->ns = ns; | 186 | nds->ns = ns; |
183 | nds->do_index = FALSE; | 187 | nds->do_index = FALSE; |
184 | nds->short_fn = NULL; | 188 | nds->short_fn = NULL; |
@@ -188,14 +192,16 @@ GNUNET_GTK_select_pseudonym_dialog_response_cb (GtkDialog *dialog, | |||
188 | /* This is a bogus fileinfo. It's needed because edit_publish_dialog | 192 | /* This is a bogus fileinfo. It's needed because edit_publish_dialog |
189 | * was written to work with fileinfo, and return a fileinfo. | 193 | * was written to work with fileinfo, and return a fileinfo. |
190 | */ | 194 | */ |
191 | memset (&bo, 0, sizeof (bo)); | 195 | nds->fip = GNUNET_FS_file_information_create_empty_directory (NULL, NULL, |
192 | fip = GNUNET_FS_file_information_create_empty_directory (NULL, NULL, | 196 | NULL, meta, &bo); |
193 | NULL, meta, &bo); | 197 | memset (&bo, 0, sizeof (bo)); |
194 | GNUNET_CONTAINER_meta_data_destroy (meta); | 198 | GNUNET_CONTAINER_meta_data_destroy (meta); |
195 | 199 | GNUNET_FS_GTK_edit_publish_dialog (builder, transient, | |
196 | GNUNET_FS_GTK_edit_publish_dialog (builder, transient, &nds->do_index, | 200 | nds->do_index, |
197 | &nds->short_fn, &nds->anonymity_level, &nds->priority, | 201 | nds->short_fn, |
198 | fip, FALSE, &adv_pseudonym_edit_publish_dialog_cb, nds); | 202 | nds->anonymity_level, |
203 | nds->priority, | ||
204 | nds->fip, FALSE, &adv_pseudonym_edit_publish_dialog_cb, nds); | ||
199 | } | 205 | } |
200 | 206 | ||
201 | void | 207 | void |
diff --git a/src/fs/gnunet-fs-gtk-main_window_file_publish.c b/src/fs/gnunet-fs-gtk-main_window_file_publish.c index 72915041..74e7cf5f 100644 --- a/src/fs/gnunet-fs-gtk-main_window_file_publish.c +++ b/src/fs/gnunet-fs-gtk-main_window_file_publish.c | |||
@@ -278,7 +278,6 @@ add_file_at_iter (gpointer data, const char *filename, const struct GNUNET_FS_Bl | |||
278 | } | 278 | } |
279 | 279 | ||
280 | 280 | ||
281 | |||
282 | /** | 281 | /** |
283 | * Add an empty directory to the tree model. | 282 | * Add an empty directory to the tree model. |
284 | * | 283 | * |
@@ -873,7 +872,6 @@ move_entry (gpointer data, GtkTreeModel * tm, GtkTreeIter * old, GtkTreeIter * n | |||
873 | GtkBuilder *builder; | 872 | GtkBuilder *builder; |
874 | 873 | ||
875 | builder = GTK_BUILDER (data); | 874 | builder = GTK_BUILDER (data); |
876 | |||
877 | gtk_tree_model_get (tm, old, 0, &fsf, 1, &do_index, 2, &short_fn, 3, | 875 | gtk_tree_model_get (tm, old, 0, &fsf, 1, &do_index, 2, &short_fn, 3, |
878 | &anonymity_level, 4, &priority, 5, &fip, -1); | 876 | &anonymity_level, 4, &priority, 5, &fip, -1); |
879 | gtk_tree_store_set (GTK_TREE_STORE (tm), newpos, 0, fsf, 1, do_index, 2, | 877 | gtk_tree_store_set (GTK_TREE_STORE (tm), newpos, 0, fsf, 1, do_index, 2, |
@@ -926,20 +924,21 @@ move_entry (gpointer data, GtkTreeModel * tm, GtkTreeIter * old, GtkTreeIter * n | |||
926 | update_selectivity (data); | 924 | update_selectivity (data); |
927 | } | 925 | } |
928 | 926 | ||
927 | |||
929 | /** | 928 | /** |
930 | * User has changed the "current" identifier for the content in | 929 | * User has changed the "current" identifier for the content in |
931 | * the GtkTreeView. Update the model. | 930 | * the GtkTreeView. Update the model. |
932 | */ | 931 | */ |
933 | void GNUNET_GTK_master_publish_dialog_pseudonym_updates_renderer_edited_cb | 932 | void |
934 | (GtkCellRendererText * renderer, gchar * cpath, gchar * new_text, | 933 | GNUNET_GTK_master_publish_dialog_pseudonym_updates_renderer_edited_cb (GtkCellRendererText * renderer, |
935 | gpointer user_data) | 934 | gchar * cpath, gchar * new_text, |
935 | gpointer user_data) | ||
936 | { | 936 | { |
937 | GtkTreeIter iter; | 937 | GtkTreeIter iter; |
938 | GtkTreeStore *ts; | 938 | GtkTreeStore *ts; |
939 | GtkBuilder *builder; | 939 | GtkBuilder *builder; |
940 | 940 | ||
941 | builder = GTK_BUILDER (user_data); | 941 | builder = GTK_BUILDER (user_data); |
942 | |||
943 | ts = GTK_TREE_STORE (gtk_builder_get_object | 942 | ts = GTK_TREE_STORE (gtk_builder_get_object |
944 | (builder, "GNUNET_GTK_pseudonym_tree_store")); | 943 | (builder, "GNUNET_GTK_pseudonym_tree_store")); |
945 | 944 | ||
@@ -958,16 +957,16 @@ void GNUNET_GTK_master_publish_dialog_pseudonym_updates_renderer_edited_cb | |||
958 | * User has changed the "current" identifier for the content in | 957 | * User has changed the "current" identifier for the content in |
959 | * the GtkTreeView. Update the model. | 958 | * the GtkTreeView. Update the model. |
960 | */ | 959 | */ |
961 | void GNUNET_GTK_master_publish_dialog_pseudonym_identifier_renderer_edited_cb | 960 | void |
962 | (GtkCellRendererText * renderer, gchar * cpath, gchar * new_text, | 961 | GNUNET_GTK_master_publish_dialog_pseudonym_identifier_renderer_edited_cb (GtkCellRendererText * renderer, |
963 | gpointer user_data) | 962 | gchar * cpath, gchar * new_text, |
963 | gpointer user_data) | ||
964 | { | 964 | { |
965 | GtkTreeIter iter; | 965 | GtkTreeIter iter; |
966 | GtkTreeStore *ts; | 966 | GtkTreeStore *ts; |
967 | GtkBuilder *builder; | 967 | GtkBuilder *builder; |
968 | 968 | ||
969 | builder = GTK_BUILDER (user_data); | 969 | builder = GTK_BUILDER (user_data); |
970 | |||
971 | ts = GTK_TREE_STORE (gtk_builder_get_object | 970 | ts = GTK_TREE_STORE (gtk_builder_get_object |
972 | (builder, "GNUNET_GTK_pseudonym_tree_store")); | 971 | (builder, "GNUNET_GTK_pseudonym_tree_store")); |
973 | 972 | ||
@@ -1228,35 +1227,48 @@ GNUNET_GTK_master_publish_dialog_add_button_clicked_cb (GtkWidget * dummy, | |||
1228 | gtk_window_present (GTK_WINDOW (ad)); | 1227 | gtk_window_present (GTK_WINDOW (ad)); |
1229 | } | 1228 | } |
1230 | 1229 | ||
1231 | struct edit_pub_cb_args | 1230 | |
1231 | struct EditPublishContext | ||
1232 | { | 1232 | { |
1233 | GtkTreeModel *tm; | 1233 | GtkTreeModel *tm; |
1234 | GtkTreeIter iter; | 1234 | GtkTreeIter iter; |
1235 | /* FIXME: this indirection madness is not really required any longer. | ||
1236 | * we only need to pass over *tm and iter, everything else can be | ||
1237 | * copied. | ||
1238 | */ | ||
1239 | gchar *short_fn; | ||
1240 | struct GNUNET_FS_FileInformation *fip; | ||
1241 | int do_index; | ||
1242 | guint anonymity_level; | ||
1243 | guint priority; | ||
1244 | }; | 1235 | }; |
1245 | 1236 | ||
1246 | void | 1237 | |
1247 | master_publish_edit_publish_dialog_cb (gpointer cls, int *do_index, char **short_fn, | 1238 | /** |
1248 | guint * anonymity_level, guint * priority, gchar *root, | 1239 | * Function called when the edit publish dialog has been closed. |
1249 | struct GNUNET_FS_FileInformation *fip, gint ret) | 1240 | * |
1241 | * @param cls closure | ||
1242 | * @param do_index index flag set? | ||
1243 | * @param short_fn short filename | ||
1244 | * @param anonymity_level anonymity degree chosen for publishing | ||
1245 | * @param priority replication setting (rename!) | ||
1246 | * @param root always NULL here | ||
1247 | * @param ret GTK_RESPONSE_OK if the dialog was closed with "OK" | ||
1248 | */ | ||
1249 | static void | ||
1250 | master_publish_edit_publish_dialog_cb (gpointer cls, | ||
1251 | int do_index, | ||
1252 | const char *short_fn, | ||
1253 | uint32_t anonymity_level, | ||
1254 | uint32_t priority, | ||
1255 | const char *root, | ||
1256 | gint ret) | ||
1250 | { | 1257 | { |
1251 | struct edit_pub_cb_args *cbargs = (struct edit_pub_cb_args *) cls; | 1258 | struct EditPublishContext *cbargs = cls; |
1259 | |||
1260 | GNUNET_assert (NULL == root); | ||
1252 | if (ret == GTK_RESPONSE_OK) | 1261 | if (ret == GTK_RESPONSE_OK) |
1253 | gtk_tree_store_set (GTK_TREE_STORE (cbargs->tm), &cbargs->iter, | 1262 | gtk_tree_store_set (GTK_TREE_STORE (cbargs->tm), &cbargs->iter, |
1254 | 1, *do_index, 2, *short_fn, 3, *anonymity_level, 4, *priority, -1); | 1263 | 1, do_index, |
1255 | g_free (root); | 1264 | 2, short_fn, |
1256 | g_free (short_fn); | 1265 | 3, (guint) anonymity_level, |
1257 | g_free (cbargs); | 1266 | 4, (guint) priority, |
1267 | -1); | ||
1268 | GNUNET_free (cbargs); | ||
1258 | } | 1269 | } |
1259 | 1270 | ||
1271 | |||
1260 | void | 1272 | void |
1261 | GNUNET_GTK_master_publish_dialog_edit_button_clicked_cb (GtkWidget * dummy, | 1273 | GNUNET_GTK_master_publish_dialog_edit_button_clicked_cb (GtkWidget * dummy, |
1262 | gpointer data) | 1274 | gpointer data) |
@@ -1264,36 +1276,47 @@ GNUNET_GTK_master_publish_dialog_edit_button_clicked_cb (GtkWidget * dummy, | |||
1264 | GtkTreeView *tv; | 1276 | GtkTreeView *tv; |
1265 | GtkTreeModel *tm; | 1277 | GtkTreeModel *tm; |
1266 | GtkTreeSelection *sel; | 1278 | GtkTreeSelection *sel; |
1267 | struct edit_pub_cb_args *cbargs; | 1279 | struct EditPublishContext *cbargs; |
1268 | GtkBuilder *builder; | 1280 | GtkBuilder *builder; |
1269 | GtkWindow *master_pubdialog; | 1281 | GtkWindow *master_pubdialog; |
1282 | gint do_index; | ||
1283 | char *short_fn; | ||
1284 | guint anonymity_level; | ||
1285 | guint priority; | ||
1286 | struct GNUNET_FS_FileInformation *fip; | ||
1270 | 1287 | ||
1271 | builder = GTK_BUILDER (data); | 1288 | builder = GTK_BUILDER (data); |
1272 | |||
1273 | tv = GTK_TREE_VIEW (gtk_builder_get_object | 1289 | tv = GTK_TREE_VIEW (gtk_builder_get_object |
1274 | (builder, | 1290 | (builder, |
1275 | "GNUNET_GTK_master_publish_dialog_file_information_tree_view")); | 1291 | "GNUNET_GTK_master_publish_dialog_file_information_tree_view")); |
1276 | 1292 | ||
1277 | cbargs = g_new0 (struct edit_pub_cb_args, 1); | 1293 | cbargs = GNUNET_malloc (sizeof (struct EditPublishContext)); |
1278 | cbargs->tm = gtk_tree_view_get_model (tv); | 1294 | cbargs->tm = gtk_tree_view_get_model (tv); |
1279 | |||
1280 | master_pubdialog = GTK_WINDOW (gtk_builder_get_object (builder, | 1295 | master_pubdialog = GTK_WINDOW (gtk_builder_get_object (builder, |
1281 | "GNUNET_GTK_master_publish_dialog")); | 1296 | "GNUNET_GTK_master_publish_dialog")); |
1282 | sel = gtk_tree_view_get_selection (tv); | 1297 | sel = gtk_tree_view_get_selection (tv); |
1283 | if (TRUE != gtk_tree_selection_get_selected (sel, &tm, &cbargs->iter)) | 1298 | if (TRUE != gtk_tree_selection_get_selected (sel, &tm, &cbargs->iter)) |
1284 | { | 1299 | { |
1285 | GNUNET_break (0); | 1300 | GNUNET_break (0); |
1286 | g_free (cbargs); | 1301 | GNUNET_free (cbargs); |
1287 | return; | 1302 | return; |
1288 | } | 1303 | } |
1289 | 1304 | ||
1290 | gtk_tree_model_get (tm, &cbargs->iter, 1, &cbargs->do_index, 2, | 1305 | gtk_tree_model_get (tm, &cbargs->iter, |
1291 | &cbargs->short_fn, 3, &cbargs->anonymity_level, 4, &cbargs->priority, | 1306 | 1, &do_index, |
1292 | 5, &cbargs->fip, -1); | 1307 | 2, &short_fn, |
1293 | 1308 | 3, &anonymity_level, | |
1294 | GNUNET_FS_GTK_edit_publish_dialog (builder, master_pubdialog, &cbargs->do_index, | 1309 | 4, &priority, |
1295 | &cbargs->short_fn, &cbargs->anonymity_level, &cbargs->priority, | 1310 | 5, &fip, |
1296 | cbargs->fip, TRUE, &master_publish_edit_publish_dialog_cb, cbargs); | 1311 | -1); |
1312 | /* FIXME: shouldn't this use a fresh builder? */ | ||
1313 | GNUNET_FS_GTK_edit_publish_dialog (builder, master_pubdialog, | ||
1314 | do_index, | ||
1315 | short_fn, | ||
1316 | (uint32_t) anonymity_level, | ||
1317 | (uint32_t) priority, | ||
1318 | fip, | ||
1319 | TRUE, &master_publish_edit_publish_dialog_cb, cbargs); | ||
1297 | } | 1320 | } |
1298 | 1321 | ||
1299 | 1322 | ||
@@ -1320,7 +1343,6 @@ free_fi_row_reference (void *cls, struct GNUNET_FS_FileInformation *fi, | |||
1320 | } | 1343 | } |
1321 | 1344 | ||
1322 | 1345 | ||
1323 | |||
1324 | void | 1346 | void |
1325 | GNUNET_GTK_master_publish_dialog_delete_button_clicked_cb (GtkWidget * dummy, | 1347 | GNUNET_GTK_master_publish_dialog_delete_button_clicked_cb (GtkWidget * dummy, |
1326 | gpointer data) | 1348 | gpointer data) |
@@ -1333,7 +1355,6 @@ GNUNET_GTK_master_publish_dialog_delete_button_clicked_cb (GtkWidget * dummy, | |||
1333 | GtkBuilder *builder; | 1355 | GtkBuilder *builder; |
1334 | 1356 | ||
1335 | builder = GTK_BUILDER (data); | 1357 | builder = GTK_BUILDER (data); |
1336 | |||
1337 | tv = GTK_TREE_VIEW (gtk_builder_get_object | 1358 | tv = GTK_TREE_VIEW (gtk_builder_get_object |
1338 | (builder, | 1359 | (builder, |
1339 | "GNUNET_GTK_master_publish_dialog_file_information_tree_view")); | 1360 | "GNUNET_GTK_master_publish_dialog_file_information_tree_view")); |
@@ -1349,9 +1370,10 @@ GNUNET_GTK_master_publish_dialog_delete_button_clicked_cb (GtkWidget * dummy, | |||
1349 | update_selectivity (data); | 1370 | update_selectivity (data); |
1350 | } | 1371 | } |
1351 | 1372 | ||
1373 | |||
1352 | void | 1374 | void |
1353 | GNUNET_GTK_publish_directory_dialog_response_cb (GtkDialog *dialog, | 1375 | GNUNET_GTK_publish_directory_dialog_response_cb (GtkDialog *dialog, |
1354 | gint response_id, gpointer user_data) | 1376 | gint response_id, gpointer user_data) |
1355 | { | 1377 | { |
1356 | char *filename; | 1378 | char *filename; |
1357 | int do_index; | 1379 | int do_index; |
@@ -1361,10 +1383,8 @@ GNUNET_GTK_publish_directory_dialog_response_cb (GtkDialog *dialog, | |||
1361 | GtkBuilder *builder; | 1383 | GtkBuilder *builder; |
1362 | 1384 | ||
1363 | builder = GTK_BUILDER (user_data); | 1385 | builder = GTK_BUILDER (user_data); |
1364 | |||
1365 | ad = GTK_WIDGET (gtk_builder_get_object (builder, | 1386 | ad = GTK_WIDGET (gtk_builder_get_object (builder, |
1366 | "GNUNET_GTK_publish_directory_dialog")); | 1387 | "GNUNET_GTK_publish_directory_dialog")); |
1367 | |||
1368 | if (response_id == -5) | 1388 | if (response_id == -5) |
1369 | { | 1389 | { |
1370 | filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (ad)); | 1390 | filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (ad)); |
@@ -1637,9 +1657,10 @@ free_file_information_tree_store (GtkTreeModel * tm, GtkTreeIter * iter) | |||
1637 | } | 1657 | } |
1638 | } | 1658 | } |
1639 | 1659 | ||
1660 | |||
1640 | void | 1661 | void |
1641 | GNUNET_GTK_master_publish_dialog_realize_cb (GtkWidget *widget, | 1662 | GNUNET_GTK_master_publish_dialog_realize_cb (GtkWidget *widget, |
1642 | gpointer user_data) | 1663 | gpointer user_data) |
1643 | { | 1664 | { |
1644 | GtkTreeView *tv; | 1665 | GtkTreeView *tv; |
1645 | GtkTreeSelection *sel; | 1666 | GtkTreeSelection *sel; |
@@ -1661,7 +1682,8 @@ GNUNET_GTK_master_publish_dialog_realize_cb (GtkWidget *widget, | |||
1661 | G_CALLBACK (selection_changed_cb), user_data); | 1682 | G_CALLBACK (selection_changed_cb), user_data); |
1662 | } | 1683 | } |
1663 | 1684 | ||
1664 | void | 1685 | |
1686 | static void | ||
1665 | hide_master_publish_dialog (gpointer user_data, gint ret) | 1687 | hide_master_publish_dialog (gpointer user_data, gint ret) |
1666 | { | 1688 | { |
1667 | GtkTreeView *tv, *ptv; | 1689 | GtkTreeView *tv, *ptv; |
@@ -1673,11 +1695,11 @@ hide_master_publish_dialog (gpointer user_data, gint ret) | |||
1673 | gchar *namespace_uid; | 1695 | gchar *namespace_uid; |
1674 | struct GNUNET_FS_FileInformation *fi; | 1696 | struct GNUNET_FS_FileInformation *fi; |
1675 | GtkWidget *ad; | 1697 | GtkWidget *ad; |
1676 | GtkBuilder *builder = GTK_BUILDER (user_data); | 1698 | GtkBuilder *builder; |
1677 | 1699 | ||
1700 | builder = GTK_BUILDER (user_data); | ||
1678 | ad = GTK_WIDGET (gtk_builder_get_object | 1701 | ad = GTK_WIDGET (gtk_builder_get_object |
1679 | (builder, "GNUNET_GTK_master_publish_dialog")); | 1702 | (builder, "GNUNET_GTK_master_publish_dialog")); |
1680 | |||
1681 | ptv = GTK_TREE_VIEW (gtk_builder_get_object | 1703 | ptv = GTK_TREE_VIEW (gtk_builder_get_object |
1682 | (builder, | 1704 | (builder, |
1683 | "GNUNET_GTK_master_publish_dialog_pseudonym_tree_view")); | 1705 | "GNUNET_GTK_master_publish_dialog_pseudonym_tree_view")); |
@@ -1732,35 +1754,40 @@ hide_master_publish_dialog (gpointer user_data, gint ret) | |||
1732 | } | 1754 | } |
1733 | while (TRUE == gtk_tree_model_iter_next (tm, &iter)); | 1755 | while (TRUE == gtk_tree_model_iter_next (tm, &iter)); |
1734 | gtk_tree_store_clear (GTK_TREE_STORE (tm)); | 1756 | gtk_tree_store_clear (GTK_TREE_STORE (tm)); |
1735 | |||
1736 | gtk_widget_hide (ad); | 1757 | gtk_widget_hide (ad); |
1758 | /* FIXME: doesn't this leak everything (builder + window)? | ||
1759 | I think we need to unref the builder here! */ | ||
1737 | } | 1760 | } |
1738 | 1761 | ||
1762 | |||
1739 | void | 1763 | void |
1740 | GNUNET_GTK_master_publish_dialog_execute_button_clicked_cb (GtkButton *button, | 1764 | GNUNET_GTK_master_publish_dialog_execute_button_clicked_cb (GtkButton *button, |
1741 | gpointer user_data) | 1765 | gpointer user_data) |
1742 | { | 1766 | { |
1743 | hide_master_publish_dialog (user_data, GTK_RESPONSE_OK); | 1767 | hide_master_publish_dialog (user_data, GTK_RESPONSE_OK); |
1744 | } | 1768 | } |
1745 | 1769 | ||
1770 | |||
1746 | void | 1771 | void |
1747 | GNUNET_GTK_master_publish_dialog_cancel_button_clicked_cb (GtkButton *button, | 1772 | GNUNET_GTK_master_publish_dialog_cancel_button_clicked_cb (GtkButton *button, |
1748 | gpointer user_data) | 1773 | gpointer user_data) |
1749 | { | 1774 | { |
1750 | hide_master_publish_dialog (user_data, GTK_RESPONSE_CANCEL); | 1775 | hide_master_publish_dialog (user_data, GTK_RESPONSE_CANCEL); |
1751 | } | 1776 | } |
1752 | 1777 | ||
1778 | |||
1753 | gboolean | 1779 | gboolean |
1754 | GNUNET_GTK_master_publish_dialog_delete_event_cb (GtkWidget *widget, | 1780 | GNUNET_GTK_master_publish_dialog_delete_event_cb (GtkWidget *widget, |
1755 | GdkEvent *event, gpointer user_data) | 1781 | GdkEvent *event, gpointer user_data) |
1756 | { | 1782 | { |
1757 | hide_master_publish_dialog (user_data, GTK_RESPONSE_CANCEL); | 1783 | hide_master_publish_dialog (user_data, GTK_RESPONSE_CANCEL); |
1758 | return TRUE; | 1784 | return TRUE; |
1759 | } | 1785 | } |
1760 | 1786 | ||
1787 | |||
1761 | void | 1788 | void |
1762 | GNUNET_GTK_publish_file_dialog_response_cb (GtkDialog *dialog, | 1789 | GNUNET_GTK_publish_file_dialog_response_cb (GtkDialog *dialog, |
1763 | gint response_id, gpointer user_data) | 1790 | gint response_id, gpointer user_data) |
1764 | { | 1791 | { |
1765 | char *filename; | 1792 | char *filename; |
1766 | struct GNUNET_FS_BlockOptions bo; | 1793 | struct GNUNET_FS_BlockOptions bo; |
@@ -1802,6 +1829,7 @@ GNUNET_GTK_publish_file_dialog_response_cb (GtkDialog *dialog, | |||
1802 | gtk_widget_hide (ad); | 1829 | gtk_widget_hide (ad); |
1803 | } | 1830 | } |
1804 | 1831 | ||
1832 | |||
1805 | /** | 1833 | /** |
1806 | */ | 1834 | */ |
1807 | void | 1835 | void |
@@ -1812,10 +1840,8 @@ GNUNET_GTK_main_menu_file_publish_activate_cb (GtkWidget * dummy, gpointer data) | |||
1812 | GtkBuilder *builder; | 1840 | GtkBuilder *builder; |
1813 | 1841 | ||
1814 | builder = GTK_BUILDER (data); | 1842 | builder = GTK_BUILDER (data); |
1815 | |||
1816 | ad = GTK_WIDGET (gtk_builder_get_object | 1843 | ad = GTK_WIDGET (gtk_builder_get_object |
1817 | (builder, "GNUNET_GTK_master_publish_dialog")); | 1844 | (builder, "GNUNET_GTK_master_publish_dialog")); |
1818 | |||
1819 | if (!gtk_widget_get_visible (ad)) | 1845 | if (!gtk_widget_get_visible (ad)) |
1820 | { | 1846 | { |
1821 | ts = GTK_TREE_STORE (gtk_builder_get_object (builder, | 1847 | ts = GTK_TREE_STORE (gtk_builder_get_object (builder, |
@@ -1823,7 +1849,6 @@ GNUNET_GTK_main_menu_file_publish_activate_cb (GtkWidget * dummy, gpointer data) | |||
1823 | GNUNET_FS_namespace_list (GNUNET_FS_GTK_get_fs_handle (), | 1849 | GNUNET_FS_namespace_list (GNUNET_FS_GTK_get_fs_handle (), |
1824 | &add_namespace_to_ts, ts); | 1850 | &add_namespace_to_ts, ts); |
1825 | } | 1851 | } |
1826 | |||
1827 | gtk_window_present (GTK_WINDOW (ad)); | 1852 | gtk_window_present (GTK_WINDOW (ad)); |
1828 | } | 1853 | } |
1829 | 1854 | ||