diff options
Diffstat (limited to 'src/fs/gnunet-fs-gtk-edit_publish_dialog.c')
-rw-r--r-- | src/fs/gnunet-fs-gtk-edit_publish_dialog.c | 90 |
1 files changed, 0 insertions, 90 deletions
diff --git a/src/fs/gnunet-fs-gtk-edit_publish_dialog.c b/src/fs/gnunet-fs-gtk-edit_publish_dialog.c index f4ea52a4..980696b1 100644 --- a/src/fs/gnunet-fs-gtk-edit_publish_dialog.c +++ b/src/fs/gnunet-fs-gtk-edit_publish_dialog.c | |||
@@ -145,12 +145,6 @@ keywords_selection_changed_cb (GtkTreeSelection * ts, gpointer user_data) | |||
145 | 145 | ||
146 | gtk_widget_set_sensitive (button, | 146 | gtk_widget_set_sensitive (button, |
147 | gtk_tree_selection_get_selected (sel, NULL, NULL)); | 147 | gtk_tree_selection_get_selected (sel, NULL, NULL)); |
148 | button = | ||
149 | GTK_WIDGET (gtk_builder_get_object | ||
150 | (builder, | ||
151 | "GNUNET_GTK_edit_publication_keyword_list_normalize_button")); | ||
152 | gtk_widget_set_sensitive (button, | ||
153 | gtk_tree_selection_get_selected (sel, NULL, NULL)); | ||
154 | } | 148 | } |
155 | 149 | ||
156 | 150 | ||
@@ -485,67 +479,6 @@ GNUNET_GTK_edit_publication_keyword_list_del_button_clicked_cb ( | |||
485 | 479 | ||
486 | 480 | ||
487 | void | 481 | void |
488 | GNUNET_GTK_edit_publication_keyword_list_normalize_button_clicked_cb ( | ||
489 | GtkButton *button, gpointer user_data) | ||
490 | { | ||
491 | GtkTreeView *tv; | ||
492 | GtkTreeSelection *sel; | ||
493 | GtkTreeModel *tm; | ||
494 | GtkTreeIter iter, inserted; | ||
495 | gchar *value; | ||
496 | struct GNUNET_FS_Uri *uri; | ||
497 | struct GNUNET_FS_Uri *nuri; | ||
498 | char *nvalue; | ||
499 | char *emsg; | ||
500 | GtkBuilder *builder; | ||
501 | builder = GTK_BUILDER (user_data); | ||
502 | |||
503 | tv = GTK_TREE_VIEW (gtk_builder_get_object | ||
504 | (builder, | ||
505 | "GNUNET_GTK_edit_publication_keyword_list_tree_view")); | ||
506 | sel = gtk_tree_view_get_selection (tv); | ||
507 | if (TRUE != gtk_tree_selection_get_selected (sel, &tm, &iter)) | ||
508 | return; | ||
509 | gtk_tree_model_get (tm, &iter, 0, &value, -1); | ||
510 | emsg = NULL; | ||
511 | uri = GNUNET_FS_uri_ksk_create (value, &emsg); | ||
512 | if (uri == NULL) | ||
513 | { | ||
514 | GNUNET_break (0); | ||
515 | GNUNET_free (emsg); | ||
516 | g_free (value); | ||
517 | return; | ||
518 | } | ||
519 | nuri = GNUNET_FS_uri_ksk_canonicalize (uri); | ||
520 | nvalue = GNUNET_FS_uri_ksk_to_string_fancy (nuri); | ||
521 | |||
522 | if (strcmp (value, nvalue) != 0) | ||
523 | { | ||
524 | gtk_list_store_insert_after (GTK_LIST_STORE (tm), &inserted, &iter); | ||
525 | gtk_list_store_set (GTK_LIST_STORE (tm), &inserted, 0, nvalue, -1); | ||
526 | } | ||
527 | GNUNET_FS_uri_destroy (nuri); | ||
528 | GNUNET_FS_uri_destroy (uri); | ||
529 | GNUNET_free (nvalue); | ||
530 | g_free (value); | ||
531 | } | ||
532 | |||
533 | |||
534 | void | ||
535 | GNUNET_GTK_edit_publication_normalization_checkbox_toggled_cb ( | ||
536 | GtkToggleButton *button, gpointer user_data) | ||
537 | { | ||
538 | GtkBuilder *builder; | ||
539 | GtkToggleButton *norm_button; | ||
540 | builder = GTK_BUILDER (user_data); | ||
541 | norm_button = GTK_TOGGLE_BUTTON (gtk_builder_get_object (builder, | ||
542 | "GNUNET_GTK_edit_publication_keyword_list_normalize_button")); | ||
543 | gtk_widget_set_sensitive (GTK_WIDGET (norm_button), | ||
544 | !gtk_toggle_button_get_active (norm_button)); | ||
545 | } | ||
546 | |||
547 | |||
548 | void | ||
549 | GNUNET_GTK_edit_publication_metadata_preview_file_chooser_button_file_set_cb ( | 482 | GNUNET_GTK_edit_publication_metadata_preview_file_chooser_button_file_set_cb ( |
550 | GtkFileChooserButton *widget, gpointer user_data) | 483 | GtkFileChooserButton *widget, gpointer user_data) |
551 | { | 484 | { |
@@ -714,7 +647,6 @@ file_information_update (void *cls, struct GNUNET_FS_FileInformation *fi, | |||
714 | const char *mime; | 647 | const char *mime; |
715 | GFile *f; | 648 | GFile *f; |
716 | GFileInfo *finfo; | 649 | GFileInfo *finfo; |
717 | gboolean auto_normalize = FALSE; | ||
718 | GObject *pubwindow; | 650 | GObject *pubwindow; |
719 | struct EditPublicationState *state = NULL; | 651 | struct EditPublicationState *state = NULL; |
720 | 652 | ||
@@ -740,10 +672,6 @@ file_information_update (void *cls, struct GNUNET_FS_FileInformation *fi, | |||
740 | (gtk_builder_get_object | 672 | (gtk_builder_get_object |
741 | (builder, | 673 | (builder, |
742 | "GNUNET_GTK_edit_publication_index_checkbutton"))); | 674 | "GNUNET_GTK_edit_publication_index_checkbutton"))); |
743 | auto_normalize = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON | ||
744 | (gtk_builder_get_object | ||
745 | (builder, | ||
746 | "GNUNET_GTK_edit_publication_normalization_checkbox"))); | ||
747 | sb = GTK_SPIN_BUTTON (gtk_builder_get_object | 675 | sb = GTK_SPIN_BUTTON (gtk_builder_get_object |
748 | (builder, | 676 | (builder, |
749 | "GNUNET_GTK_edit_publication_expiration_year_spin_button")); | 677 | "GNUNET_GTK_edit_publication_expiration_year_spin_button")); |
@@ -778,24 +706,6 @@ file_information_update (void *cls, struct GNUNET_FS_FileInformation *fi, | |||
778 | if (NULL != *uri) | 706 | if (NULL != *uri) |
779 | GNUNET_FS_uri_destroy (*uri); | 707 | GNUNET_FS_uri_destroy (*uri); |
780 | *uri = mrg; | 708 | *uri = mrg; |
781 | if (auto_normalize) | ||
782 | { | ||
783 | char *emsg = NULL; | ||
784 | struct GNUNET_FS_Uri *nuri; | ||
785 | |||
786 | nuri = GNUNET_FS_uri_ksk_create (value, &emsg); | ||
787 | if (nuri == NULL) | ||
788 | GNUNET_free_non_null (emsg); | ||
789 | else | ||
790 | { | ||
791 | nxt = GNUNET_FS_uri_ksk_canonicalize (nuri); | ||
792 | mrg = GNUNET_FS_uri_ksk_merge (nxt, *uri); | ||
793 | GNUNET_FS_uri_destroy (nxt); | ||
794 | if (NULL != *uri) | ||
795 | GNUNET_FS_uri_destroy (*uri); | ||
796 | *uri = mrg; | ||
797 | } | ||
798 | } | ||
799 | g_free (value); | 709 | g_free (value); |
800 | } | 710 | } |
801 | while (TRUE == gtk_tree_model_iter_next (tm, &iter)); | 711 | while (TRUE == gtk_tree_model_iter_next (tm, &iter)); |