diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-04-03 14:12:15 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-04-03 14:12:15 +0000 |
commit | 664c08f55700c7bbe99c9d8d85d384fde8764ee9 (patch) | |
tree | 8e5ab509fdf2cd0ea74e5c98e42b1ca82caa7148 | |
parent | 0a4ac14c32c002ef3ed6ea530805ef690619f809 (diff) | |
download | gnunet-gtk-664c08f55700c7bbe99c9d8d85d384fde8764ee9.tar.gz gnunet-gtk-664c08f55700c7bbe99c9d8d85d384fde8764ee9.zip |
changing code to work with recent FS API change
-rw-r--r-- | contrib/Makefile.in | 1 | ||||
-rw-r--r-- | gnunet_gtk_config.h.in | 8 | ||||
-rw-r--r-- | src/edit_publish_dialog.c | 32 | ||||
-rw-r--r-- | src/main_window_adv_pseudonym.c | 20 | ||||
-rw-r--r-- | src/main_window_file_publish.c | 145 |
5 files changed, 72 insertions, 134 deletions
diff --git a/contrib/Makefile.in b/contrib/Makefile.in index fec6570d..3cee7b71 100644 --- a/contrib/Makefile.in +++ b/contrib/Makefile.in | |||
@@ -157,7 +157,6 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ | |||
157 | INSTALL_SCRIPT = @INSTALL_SCRIPT@ | 157 | INSTALL_SCRIPT = @INSTALL_SCRIPT@ |
158 | INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ | 158 | INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ |
159 | INTLLIBS = @INTLLIBS@ | 159 | INTLLIBS = @INTLLIBS@ |
160 | INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ | ||
161 | LD = @LD@ | 160 | LD = @LD@ |
162 | LDFLAGS = @LDFLAGS@ | 161 | LDFLAGS = @LDFLAGS@ |
163 | LIBICONV = @LIBICONV@ | 162 | LIBICONV = @LIBICONV@ |
diff --git a/gnunet_gtk_config.h.in b/gnunet_gtk_config.h.in index 586f96db..80f08570 100644 --- a/gnunet_gtk_config.h.in +++ b/gnunet_gtk_config.h.in | |||
@@ -15,14 +15,6 @@ | |||
15 | /* Define to 1 if you have the <argz.h> header file. */ | 15 | /* Define to 1 if you have the <argz.h> header file. */ |
16 | #undef HAVE_ARGZ_H | 16 | #undef HAVE_ARGZ_H |
17 | 17 | ||
18 | /* Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the | ||
19 | CoreFoundation framework. */ | ||
20 | #undef HAVE_CFLOCALECOPYCURRENT | ||
21 | |||
22 | /* Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in | ||
23 | the CoreFoundation framework. */ | ||
24 | #undef HAVE_CFPREFERENCESCOPYAPPVALUE | ||
25 | |||
26 | /* Define if the GNU dcgettext() function is already present or preinstalled. | 18 | /* Define if the GNU dcgettext() function is already present or preinstalled. |
27 | */ | 19 | */ |
28 | #undef HAVE_DCGETTEXT | 20 | #undef HAVE_DCGETTEXT |
diff --git a/src/edit_publish_dialog.c b/src/edit_publish_dialog.c index 8b695a92..527733b3 100644 --- a/src/edit_publish_dialog.c +++ b/src/edit_publish_dialog.c | |||
@@ -383,10 +383,8 @@ add_meta_item (void *cls, | |||
383 | * @param length length of the file or directory | 383 | * @param length length of the file or directory |
384 | * @param meta metadata for the file or directory (can be modified) | 384 | * @param meta metadata for the file or directory (can be modified) |
385 | * @param uri pointer to the keywords that will be used for this entry (can be modified) | 385 | * @param uri pointer to the keywords that will be used for this entry (can be modified) |
386 | * @param anonymity pointer to selected anonymity level (can be modified) | 386 | * @param bo block options |
387 | * @param priority pointer to selected priority (can be modified) | ||
388 | * @param do_index should we index (can be modified) | 387 | * @param do_index should we index (can be modified) |
389 | * @param expirationTime pointer to selected expiration time (can be modified) | ||
390 | * @param client_info pointer to client context set upon creation (can be modified) | 388 | * @param client_info pointer to client context set upon creation (can be modified) |
391 | * @return GNUNET_SYSERR (aborts after first call) | 389 | * @return GNUNET_SYSERR (aborts after first call) |
392 | */ | 390 | */ |
@@ -396,10 +394,8 @@ file_information_extract (void *cls, | |||
396 | uint64_t length, | 394 | uint64_t length, |
397 | struct GNUNET_CONTAINER_MetaData *meta, | 395 | struct GNUNET_CONTAINER_MetaData *meta, |
398 | struct GNUNET_FS_Uri **uri, | 396 | struct GNUNET_FS_Uri **uri, |
399 | uint32_t *anonymity, | 397 | struct GNUNET_FS_BlockOptions *bo, |
400 | uint32_t *priority, | ||
401 | int *do_index, | 398 | int *do_index, |
402 | struct GNUNET_TIME_Absolute *expirationTime, | ||
403 | void **client_info) | 399 | void **client_info) |
404 | { | 400 | { |
405 | GtkImage *img; | 401 | GtkImage *img; |
@@ -424,7 +420,7 @@ file_information_extract (void *cls, | |||
424 | pixbuf); | 420 | pixbuf); |
425 | } | 421 | } |
426 | } | 422 | } |
427 | tp = expirationTime->abs_value / 1000; /* ms to seconds */ | 423 | tp = bo->expiration_time.abs_value / 1000; /* ms to seconds */ |
428 | t = gmtime (&tp); | 424 | t = gmtime (&tp); |
429 | if (t == NULL) | 425 | if (t == NULL) |
430 | year = 0; | 426 | year = 0; |
@@ -435,10 +431,10 @@ file_information_extract (void *cls, | |||
435 | year); | 431 | year); |
436 | gtk_spin_button_set_value (GTK_SPIN_BUTTON (gtk_builder_get_object (builder, | 432 | gtk_spin_button_set_value (GTK_SPIN_BUTTON (gtk_builder_get_object (builder, |
437 | "GNUNET_GTK_edit_file_information_anonymity_spin_button")), | 433 | "GNUNET_GTK_edit_file_information_anonymity_spin_button")), |
438 | *anonymity); | 434 | bo->anonymity_level); |
439 | gtk_spin_button_set_value (GTK_SPIN_BUTTON (gtk_builder_get_object (builder, | 435 | gtk_spin_button_set_value (GTK_SPIN_BUTTON (gtk_builder_get_object (builder, |
440 | "GNUNET_GTK_edit_file_information_priority_spin_button")), | 436 | "GNUNET_GTK_edit_file_information_priority_spin_button")), |
441 | *priority); | 437 | bo->content_priority); |
442 | gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gtk_builder_get_object (builder, | 438 | gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gtk_builder_get_object (builder, |
443 | "GNUNET_GTK_edit_file_information_index_check_button")), | 439 | "GNUNET_GTK_edit_file_information_index_check_button")), |
444 | *do_index); | 440 | *do_index); |
@@ -538,10 +534,8 @@ preserve_meta_items (void *cls, | |||
538 | * @param length length of the file or directory | 534 | * @param length length of the file or directory |
539 | * @param meta metadata for the file or directory (can be modified) | 535 | * @param meta metadata for the file or directory (can be modified) |
540 | * @param uri pointer to the keywords that will be used for this entry (can be modified) | 536 | * @param uri pointer to the keywords that will be used for this entry (can be modified) |
541 | * @param anonymity pointer to selected anonymity level (can be modified) | 537 | * @param bo block options (can be modified) |
542 | * @param priority pointer to selected priority (can be modified) | ||
543 | * @param do_index should we index (can be modified) | 538 | * @param do_index should we index (can be modified) |
544 | * @param expirationTime pointer to selected expiration time (can be modified) | ||
545 | * @param client_info pointer to client context set upon creation (can be modified) | 539 | * @param client_info pointer to client context set upon creation (can be modified) |
546 | * @return GNUNET_SYSERR (aborts after first call) | 540 | * @return GNUNET_SYSERR (aborts after first call) |
547 | */ | 541 | */ |
@@ -551,10 +545,8 @@ file_information_update (void *cls, | |||
551 | uint64_t length, | 545 | uint64_t length, |
552 | struct GNUNET_CONTAINER_MetaData *meta, | 546 | struct GNUNET_CONTAINER_MetaData *meta, |
553 | struct GNUNET_FS_Uri **uri, | 547 | struct GNUNET_FS_Uri **uri, |
554 | uint32_t *anonymity, | 548 | struct GNUNET_FS_BlockOptions *bo, |
555 | uint32_t *priority, | ||
556 | int *do_index, | 549 | int *do_index, |
557 | struct GNUNET_TIME_Absolute *expirationTime, | ||
558 | void **client_info) | 550 | void **client_info) |
559 | { | 551 | { |
560 | char **short_fn = cls; | 552 | char **short_fn = cls; |
@@ -574,15 +566,15 @@ file_information_update (void *cls, | |||
574 | GFile *f; | 566 | GFile *f; |
575 | GFileInfo *finfo; | 567 | GFileInfo *finfo; |
576 | 568 | ||
577 | *anonymity = gtk_spin_button_get_value (GTK_SPIN_BUTTON (gtk_builder_get_object (builder, | 569 | bo->anonymity_level = gtk_spin_button_get_value (GTK_SPIN_BUTTON (gtk_builder_get_object (builder, |
578 | "GNUNET_GTK_edit_file_information_anonymity_spin_button"))); | 570 | "GNUNET_GTK_edit_file_information_anonymity_spin_button"))); |
579 | *priority = gtk_spin_button_get_value (GTK_SPIN_BUTTON (gtk_builder_get_object (builder, | 571 | bo->content_priority = gtk_spin_button_get_value (GTK_SPIN_BUTTON (gtk_builder_get_object (builder, |
580 | "GNUNET_GTK_edit_file_information_priority_spin_button"))); | 572 | "GNUNET_GTK_edit_file_information_priority_spin_button"))); |
581 | *do_index = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (gtk_builder_get_object (builder, | 573 | *do_index = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (gtk_builder_get_object (builder, |
582 | "GNUNET_GTK_edit_file_information_index_check_button"))); | 574 | "GNUNET_GTK_edit_file_information_index_check_button"))); |
583 | sb =GTK_SPIN_BUTTON (gtk_builder_get_object (builder, | 575 | sb =GTK_SPIN_BUTTON (gtk_builder_get_object (builder, |
584 | "GNUNET_GTK_edit_file_information_expiration_year_spin_button")); | 576 | "GNUNET_GTK_edit_file_information_expiration_year_spin_button")); |
585 | *expirationTime = GNUNET_GTK_get_expiration_time (sb); | 577 | bo->expiration_time = GNUNET_GTK_get_expiration_time (sb); |
586 | /* update URI */ | 578 | /* update URI */ |
587 | if (NULL != (*uri)) | 579 | if (NULL != (*uri)) |
588 | GNUNET_FS_uri_destroy (*uri); | 580 | GNUNET_FS_uri_destroy (*uri); |
diff --git a/src/main_window_adv_pseudonym.c b/src/main_window_adv_pseudonym.c index 4f1ac0e4..7a139332 100644 --- a/src/main_window_adv_pseudonym.c +++ b/src/main_window_adv_pseudonym.c | |||
@@ -400,13 +400,11 @@ GNUNET_GTK_main_menu_file_advertise_pseudonym_activate_cb (GtkWidget * dummy, | |||
400 | GtkTreeSelection *sel; | 400 | GtkTreeSelection *sel; |
401 | GtkTreeModel *tm; | 401 | GtkTreeModel *tm; |
402 | GtkSpinButton *sb; | 402 | GtkSpinButton *sb; |
403 | uint32_t anonymity_level; | 403 | struct GNUNET_FS_BlockOptions bo; |
404 | uint32_t priority; | ||
405 | struct GNUNET_FS_Uri *nxt; | 404 | struct GNUNET_FS_Uri *nxt; |
406 | struct GNUNET_FS_Uri *mrg; | 405 | struct GNUNET_FS_Uri *mrg; |
407 | struct GNUNET_FS_Uri *uri; | 406 | struct GNUNET_FS_Uri *uri; |
408 | struct GNUNET_CONTAINER_MetaData *nm; | 407 | struct GNUNET_CONTAINER_MetaData *nm; |
409 | struct GNUNET_TIME_Absolute expiration; | ||
410 | const char *root; | 408 | const char *root; |
411 | char *value; | 409 | char *value; |
412 | guint ntype; | 410 | guint ntype; |
@@ -560,24 +558,20 @@ GNUNET_GTK_main_menu_file_advertise_pseudonym_activate_cb (GtkWidget * dummy, | |||
560 | } | 558 | } |
561 | while (TRUE == gtk_tree_model_iter_next (tm, &iter)); | 559 | while (TRUE == gtk_tree_model_iter_next (tm, &iter)); |
562 | } | 560 | } |
563 | anonymity_level = gtk_spin_button_get_value (GTK_SPIN_BUTTON (gtk_builder_get_object (builder, | 561 | bo.anonymity_level = gtk_spin_button_get_value (GTK_SPIN_BUTTON (gtk_builder_get_object (builder, |
564 | "GNUNET_GTK_advertise_pseudonym_anonymity_spin_button"))); | 562 | "GNUNET_GTK_advertise_pseudonym_anonymity_spin_button"))); |
565 | priority = gtk_spin_button_get_value (GTK_SPIN_BUTTON (gtk_builder_get_object (builder, | 563 | bo.content_priority = gtk_spin_button_get_value (GTK_SPIN_BUTTON (gtk_builder_get_object (builder, |
566 | "GNUNET_GTK_advertise_pseudonym_priority_spin_button"))); | 564 | "GNUNET_GTK_advertise_pseudonym_priority_spin_button"))); |
567 | sb = GTK_SPIN_BUTTON (gtk_builder_get_object (builder, | 565 | sb = GTK_SPIN_BUTTON (gtk_builder_get_object (builder, |
568 | "GNUNET_GTK_advertise_pseudonym_expiration_year_spin_button")); | 566 | "GNUNET_GTK_advertise_pseudonym_expiration_year_spin_button")); |
569 | expiration = GNUNET_GTK_get_expiration_time (sb); | 567 | bo.expiration_time = GNUNET_GTK_get_expiration_time (sb); |
570 | |||
571 | expiration = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_YEARS); | ||
572 | root = gtk_entry_get_text (GTK_ENTRY (gtk_builder_get_object (builder, | 568 | root = gtk_entry_get_text (GTK_ENTRY (gtk_builder_get_object (builder, |
573 | "GNUNET_GTK_advertise_pseudonym_root_entry"))); | 569 | "GNUNET_GTK_advertise_pseudonym_root_entry"))); |
574 | GNUNET_FS_namespace_advertise (GNUNET_GTK_get_fs_handle (), | 570 | GNUNET_FS_namespace_advertise (GNUNET_GTK_get_fs_handle (), |
575 | uri, | 571 | uri, |
576 | ns, | 572 | ns, |
577 | nm, | 573 | nm, |
578 | anonymity_level, | 574 | &bo, |
579 | priority, | ||
580 | expiration, | ||
581 | root, | 575 | root, |
582 | NULL, NULL); | 576 | NULL, NULL); |
583 | GNUNET_FS_namespace_delete (ns, GNUNET_NO); | 577 | GNUNET_FS_namespace_delete (ns, GNUNET_NO); |
diff --git a/src/main_window_file_publish.c b/src/main_window_file_publish.c index 78a5dd4a..c7ba8cd1 100644 --- a/src/main_window_file_publish.c +++ b/src/main_window_file_publish.c | |||
@@ -196,16 +196,13 @@ update_selectivity () | |||
196 | * Add a file to the tree model. | 196 | * Add a file to the tree model. |
197 | * | 197 | * |
198 | * @param filename file to add | 198 | * @param filename file to add |
199 | * @param anonymity_level anonymity to use | 199 | * @param bo block options to use |
200 | * @param expiration expiration time for the entry | ||
201 | * @param do_index should we index or insert? | 200 | * @param do_index should we index or insert? |
202 | * @param iter parent entry, or NULL for top-level addition | 201 | * @param iter parent entry, or NULL for top-level addition |
203 | */ | 202 | */ |
204 | static void | 203 | static void |
205 | add_file_at_iter (const char *filename, | 204 | add_file_at_iter (const char *filename, |
206 | uint32_t anonymity_level, | 205 | const struct GNUNET_FS_BlockOptions *bo, |
207 | uint32_t priority, | ||
208 | struct GNUNET_TIME_Absolute expiration, | ||
209 | int do_index, | 206 | int do_index, |
210 | GtkTreeIter *iter) | 207 | GtkTreeIter *iter) |
211 | { | 208 | { |
@@ -275,9 +272,7 @@ add_file_at_iter (const char *filename, | |||
275 | ksk_uri, | 272 | ksk_uri, |
276 | meta, | 273 | meta, |
277 | do_index, | 274 | do_index, |
278 | anonymity_level, | 275 | bo); |
279 | priority, | ||
280 | expiration); | ||
281 | GNUNET_CONTAINER_meta_data_destroy (meta); | 276 | GNUNET_CONTAINER_meta_data_destroy (meta); |
282 | GNUNET_FS_uri_destroy (ksk_uri); | 277 | GNUNET_FS_uri_destroy (ksk_uri); |
283 | if (S_ISDIR (sbuf.st_mode)) | 278 | if (S_ISDIR (sbuf.st_mode)) |
@@ -288,8 +283,8 @@ add_file_at_iter (const char *filename, | |||
288 | 0, file_size_fancy, | 283 | 0, file_size_fancy, |
289 | 1, (gboolean) do_index, | 284 | 1, (gboolean) do_index, |
290 | 2, short_fn, | 285 | 2, short_fn, |
291 | 3, (guint)anonymity_level, | 286 | 3, (guint) bo->anonymity_level, |
292 | 4, (guint) priority, | 287 | 4, (guint) bo->content_priority, |
293 | 5, fi, | 288 | 5, fi, |
294 | -1); | 289 | -1); |
295 | GNUNET_free (file_size_fancy); | 290 | GNUNET_free (file_size_fancy); |
@@ -302,14 +297,13 @@ add_file_at_iter (const char *filename, | |||
302 | * Add an empty directory to the tree model. | 297 | * Add an empty directory to the tree model. |
303 | * | 298 | * |
304 | * @param name name for the directory | 299 | * @param name name for the directory |
300 | * @param bo block options | ||
305 | * @param iter parent entry, or NULL for top-level addition | 301 | * @param iter parent entry, or NULL for top-level addition |
306 | * @param pos iterator to set to the location of the new element | 302 | * @param pos iterator to set to the location of the new element |
307 | */ | 303 | */ |
308 | static void | 304 | static void |
309 | create_dir_at_iter (const char *name, | 305 | create_dir_at_iter (const char *name, |
310 | uint32_t anonymity, | 306 | const struct GNUNET_FS_BlockOptions *bo, |
311 | uint32_t priority, | ||
312 | struct GNUNET_TIME_Absolute expiration, | ||
313 | GtkTreeIter *iter, | 307 | GtkTreeIter *iter, |
314 | GtkTreeIter *pos) | 308 | GtkTreeIter *pos) |
315 | { | 309 | { |
@@ -343,16 +337,14 @@ create_dir_at_iter (const char *name, | |||
343 | row_reference, | 337 | row_reference, |
344 | NULL, | 338 | NULL, |
345 | meta, | 339 | meta, |
346 | anonymity, | 340 | bo); |
347 | priority, | ||
348 | expiration); | ||
349 | GNUNET_CONTAINER_meta_data_destroy (meta); | 341 | GNUNET_CONTAINER_meta_data_destroy (meta); |
350 | gtk_tree_store_set (ts, pos, | 342 | gtk_tree_store_set (ts, pos, |
351 | 0, MARKER_DIR_FILE_SIZE, | 343 | 0, MARKER_DIR_FILE_SIZE, |
352 | 1, (gboolean) GNUNET_NO, | 344 | 1, (gboolean) GNUNET_NO, |
353 | 2, name, | 345 | 2, name, |
354 | 3, (guint) anonymity, | 346 | 3, (guint) bo->anonymity_level, |
355 | 4, (guint) priority, | 347 | 4, (guint) bo->content_priority, |
356 | 5, fi, | 348 | 5, fi, |
357 | -1); | 349 | -1); |
358 | update_selectivity (); | 350 | update_selectivity (); |
@@ -451,19 +443,9 @@ struct AddDirContext | |||
451 | struct GNUNET_CONTAINER_MetaData *no_ksk; | 443 | struct GNUNET_CONTAINER_MetaData *no_ksk; |
452 | 444 | ||
453 | /** | 445 | /** |
454 | * Content expiration to use. | 446 | * Block options to use. |
455 | */ | 447 | */ |
456 | struct GNUNET_TIME_Absolute expiration; | 448 | struct GNUNET_FS_BlockOptions bo; |
457 | |||
458 | /** | ||
459 | * Anonymity level to use. | ||
460 | */ | ||
461 | uint32_t anonymity_level; | ||
462 | |||
463 | /** | ||
464 | * Content priority to use. | ||
465 | */ | ||
466 | uint32_t priority; | ||
467 | 449 | ||
468 | /** | 450 | /** |
469 | * Index or insert? | 451 | * Index or insert? |
@@ -633,8 +615,7 @@ remove_keyword (void *cls, | |||
633 | * @param ts tree store to modify | 615 | * @param ts tree store to modify |
634 | * @param iter position in the tree store for this file | 616 | * @param iter position in the tree store for this file |
635 | * @param filename file to add | 617 | * @param filename file to add |
636 | * @param anonymity_level anonymity to use | 618 | * @param bo block options |
637 | * @param expiration expiration time for the entry | ||
638 | * @param do_index should we index or insert? | 619 | * @param do_index should we index or insert? |
639 | * @param md_no_ksk metadata with keywords NOT to add | 620 | * @param md_no_ksk metadata with keywords NOT to add |
640 | * @param meta metadata for the file | 621 | * @param meta metadata for the file |
@@ -643,9 +624,7 @@ static void | |||
643 | add_entry_to_ts (GtkTreeStore *ts, | 624 | add_entry_to_ts (GtkTreeStore *ts, |
644 | GtkTreeIter *iter, | 625 | GtkTreeIter *iter, |
645 | const char *filename, | 626 | const char *filename, |
646 | uint32_t anonymity_level, | 627 | const struct GNUNET_FS_BlockOptions *bo, |
647 | uint32_t priority, | ||
648 | struct GNUNET_TIME_Absolute expiration, | ||
649 | int do_index, | 628 | int do_index, |
650 | struct GNUNET_CONTAINER_MetaData *md_no_ksk, | 629 | struct GNUNET_CONTAINER_MetaData *md_no_ksk, |
651 | struct GNUNET_CONTAINER_MetaData *meta) | 630 | struct GNUNET_CONTAINER_MetaData *meta) |
@@ -705,9 +684,7 @@ add_entry_to_ts (GtkTreeStore *ts, | |||
705 | row_reference, | 684 | row_reference, |
706 | ksk_uri, | 685 | ksk_uri, |
707 | meta, | 686 | meta, |
708 | anonymity_level, | 687 | bo); |
709 | priority, | ||
710 | expiration); | ||
711 | } | 688 | } |
712 | else | 689 | else |
713 | { | 690 | { |
@@ -717,9 +694,7 @@ add_entry_to_ts (GtkTreeStore *ts, | |||
717 | ksk_uri, | 694 | ksk_uri, |
718 | meta, | 695 | meta, |
719 | do_index, | 696 | do_index, |
720 | anonymity_level, | 697 | bo); |
721 | priority, | ||
722 | expiration); | ||
723 | } | 698 | } |
724 | GNUNET_CONTAINER_meta_data_destroy (meta); | 699 | GNUNET_CONTAINER_meta_data_destroy (meta); |
725 | GNUNET_FS_uri_destroy (ksk_uri); | 700 | GNUNET_FS_uri_destroy (ksk_uri); |
@@ -734,8 +709,8 @@ add_entry_to_ts (GtkTreeStore *ts, | |||
734 | 0, file_size_fancy, | 709 | 0, file_size_fancy, |
735 | 1, (gboolean) do_index, | 710 | 1, (gboolean) do_index, |
736 | 2, short_fn, | 711 | 2, short_fn, |
737 | 3, (guint)anonymity_level, | 712 | 3, (guint) bo->anonymity_level, |
738 | 4, (guint) priority, | 713 | 4, (guint) bo->content_priority, |
739 | 5, fi, | 714 | 5, fi, |
740 | -1); | 715 | -1); |
741 | GNUNET_free (file_size_fancy); | 716 | GNUNET_free (file_size_fancy); |
@@ -766,9 +741,7 @@ publish_entry (void *cls, | |||
766 | add_entry_to_ts (adc->ts, | 741 | add_entry_to_ts (adc->ts, |
767 | &pd->iter, | 742 | &pd->iter, |
768 | filename, | 743 | filename, |
769 | adc->anonymity_level, | 744 | &adc->bo, |
770 | adc->priority, | ||
771 | adc->expiration, | ||
772 | adc->do_index, | 745 | adc->do_index, |
773 | adc->no_ksk, | 746 | adc->no_ksk, |
774 | pd->meta); | 747 | pd->meta); |
@@ -921,9 +894,7 @@ scan_directory (void *cls, | |||
921 | add_entry_to_ts (adc->ts, | 894 | add_entry_to_ts (adc->ts, |
922 | &pd->iter, | 895 | &pd->iter, |
923 | filename, | 896 | filename, |
924 | adc->anonymity_level, | 897 | &adc->bo, |
925 | adc->priority, | ||
926 | adc->expiration, | ||
927 | adc->do_index, | 898 | adc->do_index, |
928 | NULL, | 899 | NULL, |
929 | pd->meta); | 900 | pd->meta); |
@@ -942,13 +913,12 @@ scan_directory (void *cls, | |||
942 | * Add a directory to the tree model. | 913 | * Add a directory to the tree model. |
943 | * | 914 | * |
944 | * @param filename directory name to add | 915 | * @param filename directory name to add |
945 | * @param iter parent entry, or NULL for top-level addition | 916 | * @param bo block options |
917 | * @param do_index should we index? | ||
946 | */ | 918 | */ |
947 | static void | 919 | static void |
948 | add_dir (const char *filename, | 920 | add_dir (const char *filename, |
949 | uint32_t anonymity_level, | 921 | const struct GNUNET_FS_BlockOptions *bo, |
950 | uint32_t priority, | ||
951 | struct GNUNET_TIME_Absolute expiration, | ||
952 | int do_index) | 922 | int do_index) |
953 | { | 923 | { |
954 | struct stat sbuf; | 924 | struct stat sbuf; |
@@ -962,9 +932,7 @@ add_dir (const char *filename, | |||
962 | return; | 932 | return; |
963 | } | 933 | } |
964 | memset (&scan_ctx, 0, sizeof (scan_ctx)); | 934 | memset (&scan_ctx, 0, sizeof (scan_ctx)); |
965 | scan_ctx.anonymity_level = anonymity_level; | 935 | scan_ctx.bo = *bo; |
966 | scan_ctx.priority = priority; | ||
967 | scan_ctx.expiration = expiration; | ||
968 | scan_ctx.do_index = do_index; | 936 | scan_ctx.do_index = do_index; |
969 | scan_ctx.ts = GTK_TREE_STORE (gtk_builder_get_object (master_builder, | 937 | scan_ctx.ts = GTK_TREE_STORE (gtk_builder_get_object (master_builder, |
970 | "GNUNET_GTK_file_sharing_publishing_tree_store")); | 938 | "GNUNET_GTK_file_sharing_publishing_tree_store")); |
@@ -1344,6 +1312,7 @@ GNUNET_GTK_master_publish_dialog_new_button_clicked_cb (GtkWidget * dummy, | |||
1344 | GtkTreeSelection *sel; | 1312 | GtkTreeSelection *sel; |
1345 | GtkTreeIter iter; | 1313 | GtkTreeIter iter; |
1346 | GtkTreeIter pos; | 1314 | GtkTreeIter pos; |
1315 | struct GNUNET_FS_BlockOptions bo; | ||
1347 | 1316 | ||
1348 | tv = GTK_TREE_VIEW (gtk_builder_get_object (master_builder, | 1317 | tv = GTK_TREE_VIEW (gtk_builder_get_object (master_builder, |
1349 | "GNUNET_GTK_master_publish_dialog_file_information_tree_view")); | 1318 | "GNUNET_GTK_master_publish_dialog_file_information_tree_view")); |
@@ -1353,21 +1322,21 @@ GNUNET_GTK_master_publish_dialog_new_button_clicked_cb (GtkWidget * dummy, | |||
1353 | * to calling this function (currently we | 1322 | * to calling this function (currently we |
1354 | * use default values for those). | 1323 | * use default values for those). |
1355 | */ | 1324 | */ |
1325 | bo.anonymity_level = 1; | ||
1326 | bo.content_priority = 1000; | ||
1327 | bo.expiration_time = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_YEARS); | ||
1328 | bo.replication_level = 1; | ||
1356 | if (TRUE != gtk_tree_selection_get_selected (sel, | 1329 | if (TRUE != gtk_tree_selection_get_selected (sel, |
1357 | NULL, | 1330 | NULL, |
1358 | &iter)) | 1331 | &iter)) |
1359 | { | 1332 | { |
1360 | create_dir_at_iter ("unnamed/", | 1333 | create_dir_at_iter ("unnamed/", |
1361 | 1 /* anonymity */, | 1334 | &bo, |
1362 | 1000 /* priority */, | ||
1363 | GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_YEARS) /* expiration */, | ||
1364 | NULL, &pos); | 1335 | NULL, &pos); |
1365 | return; | 1336 | return; |
1366 | } | 1337 | } |
1367 | create_dir_at_iter ("unnamed/", | 1338 | create_dir_at_iter ("unnamed/", |
1368 | 1 /* anonymity */, | 1339 | &bo, |
1369 | 1000 /* priority */, | ||
1370 | GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_YEARS) /* expiration */, | ||
1371 | &iter, &pos); | 1340 | &iter, &pos); |
1372 | } | 1341 | } |
1373 | 1342 | ||
@@ -1379,9 +1348,7 @@ GNUNET_GTK_master_publish_dialog_add_button_clicked_cb (GtkWidget * dummy, | |||
1379 | GtkWidget *ad; | 1348 | GtkWidget *ad; |
1380 | GtkBuilder *builder; | 1349 | GtkBuilder *builder; |
1381 | char *filename; | 1350 | char *filename; |
1382 | uint32_t anonymity; | 1351 | struct GNUNET_FS_BlockOptions bo; |
1383 | uint32_t priority; | ||
1384 | struct GNUNET_TIME_Absolute exp; | ||
1385 | int do_index; | 1352 | int do_index; |
1386 | GtkSpinButton *sb; | 1353 | GtkSpinButton *sb; |
1387 | 1354 | ||
@@ -1401,18 +1368,18 @@ GNUNET_GTK_master_publish_dialog_add_button_clicked_cb (GtkWidget * dummy, | |||
1401 | return; | 1368 | return; |
1402 | } | 1369 | } |
1403 | filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER(ad)); | 1370 | filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER(ad)); |
1404 | anonymity = gtk_spin_button_get_value (GTK_SPIN_BUTTON (gtk_builder_get_object (builder, | ||
1405 | "GNUNET_GTK_publish_file_dialog_anonymity_spin_button"))); | ||
1406 | priority = gtk_spin_button_get_value (GTK_SPIN_BUTTON (gtk_builder_get_object (builder, | ||
1407 | "GNUNET_GTK_publish_file_dialog_priority_spin_button"))); | ||
1408 | do_index = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (gtk_builder_get_object (builder, | ||
1409 | "GNUNET_GTK_publish_file_dialog_do_index_checkbutton"))); | ||
1410 | sb = GTK_SPIN_BUTTON (gtk_builder_get_object (builder, | 1371 | sb = GTK_SPIN_BUTTON (gtk_builder_get_object (builder, |
1411 | "GNUNET_GTK_publish_file_dialog_expiration_year_spin_button")); | 1372 | "GNUNET_GTK_publish_file_dialog_expiration_year_spin_button")); |
1412 | exp = GNUNET_GTK_get_expiration_time (sb); | 1373 | bo.anonymity_level = gtk_spin_button_get_value (GTK_SPIN_BUTTON (gtk_builder_get_object (builder, |
1413 | add_file_at_iter (filename, anonymity, | 1374 | "GNUNET_GTK_publish_file_dialog_anonymity_spin_button"))); |
1414 | priority, | 1375 | bo.content_priority = gtk_spin_button_get_value (GTK_SPIN_BUTTON (gtk_builder_get_object (builder, |
1415 | exp, do_index, | 1376 | "GNUNET_GTK_publish_file_dialog_priority_spin_button"))); |
1377 | bo.expiration_time = GNUNET_GTK_get_expiration_time (sb); | ||
1378 | bo.replication_level = 1; /* FIXME... */ | ||
1379 | do_index = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (gtk_builder_get_object (builder, | ||
1380 | "GNUNET_GTK_publish_file_dialog_do_index_checkbutton"))); | ||
1381 | add_file_at_iter (filename, | ||
1382 | &bo, do_index, | ||
1416 | NULL); | 1383 | NULL); |
1417 | gtk_widget_destroy (ad); | 1384 | gtk_widget_destroy (ad); |
1418 | g_object_unref (G_OBJECT (builder)); | 1385 | g_object_unref (G_OBJECT (builder)); |
@@ -1479,10 +1446,8 @@ free_fi_row_reference (void *cls, | |||
1479 | uint64_t length, | 1446 | uint64_t length, |
1480 | struct GNUNET_CONTAINER_MetaData *meta, | 1447 | struct GNUNET_CONTAINER_MetaData *meta, |
1481 | struct GNUNET_FS_Uri **uri, | 1448 | struct GNUNET_FS_Uri **uri, |
1482 | uint32_t *anonymity, | 1449 | struct GNUNET_FS_BlockOptions *bo, |
1483 | uint32_t *priority, | ||
1484 | int *do_index, | 1450 | int *do_index, |
1485 | struct GNUNET_TIME_Absolute *expirationTime, | ||
1486 | void **client_info) | 1451 | void **client_info) |
1487 | { | 1452 | { |
1488 | GtkTreeRowReference *row = *client_info; | 1453 | GtkTreeRowReference *row = *client_info; |
@@ -1538,11 +1503,9 @@ GNUNET_GTK_master_publish_dialog_open_button_clicked_cb (GtkWidget * dummy, | |||
1538 | GtkWidget *ad; | 1503 | GtkWidget *ad; |
1539 | GtkBuilder *builder; | 1504 | GtkBuilder *builder; |
1540 | char *filename; | 1505 | char *filename; |
1541 | uint32_t anonymity; | ||
1542 | uint32_t priority; | ||
1543 | struct GNUNET_TIME_Absolute exp; | ||
1544 | int do_index; | 1506 | int do_index; |
1545 | GtkSpinButton *sb; | 1507 | GtkSpinButton *sb; |
1508 | struct GNUNET_FS_BlockOptions bo; | ||
1546 | 1509 | ||
1547 | builder = GNUNET_GTK_get_new_builder ("publish-directory-dialog.glade"); | 1510 | builder = GNUNET_GTK_get_new_builder ("publish-directory-dialog.glade"); |
1548 | if (builder == NULL) | 1511 | if (builder == NULL) |
@@ -1560,22 +1523,20 @@ GNUNET_GTK_master_publish_dialog_open_button_clicked_cb (GtkWidget * dummy, | |||
1560 | return; | 1523 | return; |
1561 | } | 1524 | } |
1562 | filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER(ad)); | 1525 | filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER(ad)); |
1563 | anonymity = gtk_spin_button_get_value (GTK_SPIN_BUTTON (gtk_builder_get_object (builder, | 1526 | sb = GTK_SPIN_BUTTON (gtk_builder_get_object (builder, |
1564 | "GNUNET_GTK_publish_directory_dialog_anonymity_spin_button"))); | 1527 | "GNUNET_GTK_publish_directory_dialog_expiration_year_spin_button")); |
1565 | priority = gtk_spin_button_get_value (GTK_SPIN_BUTTON (gtk_builder_get_object (builder, | 1528 | bo.anonymity_level = gtk_spin_button_get_value (GTK_SPIN_BUTTON (gtk_builder_get_object (builder, |
1566 | "GNUNET_GTK_publish_directory_dialog_priority_spin_button"))); | 1529 | "GNUNET_GTK_publish_directory_dialog_anonymity_spin_button"))); |
1530 | bo.content_priority = gtk_spin_button_get_value (GTK_SPIN_BUTTON (gtk_builder_get_object (builder, | ||
1531 | "GNUNET_GTK_publish_directory_dialog_priority_spin_button"))); | ||
1532 | bo.expiration_time = GNUNET_GTK_get_expiration_time (sb); | ||
1567 | do_index = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (gtk_builder_get_object (builder, | 1533 | do_index = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (gtk_builder_get_object (builder, |
1568 | "GNUNET_GTK_publish_directory_dialog_do_index_checkbutton"))); | 1534 | "GNUNET_GTK_publish_directory_dialog_do_index_checkbutton"))); |
1569 | sb = GTK_SPIN_BUTTON (gtk_builder_get_object (builder, | 1535 | |
1570 | "GNUNET_GTK_publish_directory_dialog_expiration_year_spin_button")); | ||
1571 | |||
1572 | exp = GNUNET_GTK_get_expiration_time (sb); | ||
1573 | gtk_widget_destroy (ad); | 1536 | gtk_widget_destroy (ad); |
1574 | g_object_unref (G_OBJECT (builder)); | 1537 | g_object_unref (G_OBJECT (builder)); |
1575 | /* FIXME: open progress dialog here... */ | 1538 | /* FIXME: open progress dialog here... */ |
1576 | add_dir (filename, anonymity, priority, | 1539 | add_dir (filename, &bo, do_index); |
1577 | exp, | ||
1578 | do_index); | ||
1579 | g_free (filename); | 1540 | g_free (filename); |
1580 | update_selectivity (); | 1541 | update_selectivity (); |
1581 | } | 1542 | } |