aboutsummaryrefslogtreecommitdiff
path: root/src/fs/gnunet-fs-gtk-edit_publish_dialog.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fs/gnunet-fs-gtk-edit_publish_dialog.c')
-rw-r--r--src/fs/gnunet-fs-gtk-edit_publish_dialog.c37
1 files changed, 25 insertions, 12 deletions
diff --git a/src/fs/gnunet-fs-gtk-edit_publish_dialog.c b/src/fs/gnunet-fs-gtk-edit_publish_dialog.c
index 107952bc..a2f537cd 100644
--- a/src/fs/gnunet-fs-gtk-edit_publish_dialog.c
+++ b/src/fs/gnunet-fs-gtk-edit_publish_dialog.c
@@ -98,8 +98,7 @@ struct EditPublicationState
98{ 98{
99 int do_index; 99 int do_index;
100 char *short_fn; 100 char *short_fn;
101 guint anonymity_level; 101 struct GNUNET_FS_BlockOptions bo;
102 guint priority;
103 struct GNUNET_FS_FileInformation *fip; 102 struct GNUNET_FS_FileInformation *fip;
104 gint preview_changed; 103 gint preview_changed;
105 gboolean allow_no_keywords; 104 gboolean allow_no_keywords;
@@ -827,7 +826,7 @@ GNUNET_GTK_edit_publication_cancel_button_clicked_cb (GtkButton * button,
827 } 826 }
828 827
829 state->cb (state->cls, state->do_index, state->short_fn, 828 state->cb (state->cls, state->do_index, state->short_fn,
830 state->anonymity_level, state->priority, NULL, 829 &state->bo, NULL,
831 GTK_RESPONSE_CANCEL); 830 GTK_RESPONSE_CANCEL);
832 g_free (state); 831 g_free (state);
833 g_object_set_data (pubwindow, PUBSTATE, NULL); 832 g_object_set_data (pubwindow, PUBSTATE, NULL);
@@ -843,7 +842,7 @@ GNUNET_GTK_edit_publication_confirm_button_clicked_cb (GtkButton * button,
843 GObject *pubwindow; 842 GObject *pubwindow;
844 struct EditPublicationState *state; 843 struct EditPublicationState *state;
845 struct FileInformationUpdateContext ctx; 844 struct FileInformationUpdateContext ctx;
846 845 gint year;
847 builder = GTK_BUILDER (user_data); 846 builder = GTK_BUILDER (user_data);
848 847
849 pubwindow = 848 pubwindow =
@@ -866,21 +865,30 @@ GNUNET_GTK_edit_publication_confirm_button_clicked_cb (GtkButton * button,
866 state->short_fn = ctx.short_fn; 865 state->short_fn = ctx.short_fn;
867 if (!GNUNET_GTK_get_selected_anonymity_level 866 if (!GNUNET_GTK_get_selected_anonymity_level
868 (builder, "GNUNET_GTK_edit_publication_anonymity_combobox", 867 (builder, "GNUNET_GTK_edit_publication_anonymity_combobox",
869 &state->anonymity_level)) 868 &state->bo.anonymity_level))
870 state->priority = 869 state->bo.content_priority =
871 gtk_spin_button_get_value (GTK_SPIN_BUTTON 870 gtk_spin_button_get_value (GTK_SPIN_BUTTON
872 (gtk_builder_get_object 871 (gtk_builder_get_object
873 (builder, 872 (builder,
874 "GNUNET_GTK_edit_publication_priority_spin_button"))); 873 "GNUNET_GTK_edit_publication_priority_spin_button")));
874 state->bo.replication_level =
875 gtk_spin_button_get_value (GTK_SPIN_BUTTON
876 (gtk_builder_get_object
877 (builder,
878 "GNUNET_GTK_edit_publication_replication_spin_button")));
879
875 state->do_index = 880 state->do_index =
876 gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON 881 gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON
877 (gtk_builder_get_object 882 (gtk_builder_get_object
878 (builder, 883 (builder,
879 "GNUNET_GTK_edit_publication_index_checkbutton"))); 884 "GNUNET_GTK_edit_publication_index_checkbutton")));
880 885 year = gtk_spin_button_get_value (GTK_SPIN_BUTTON
881 886 (gtk_builder_get_object
887 (builder,
888 "GNUNET_GTK_edit_publication_expiration_year_spin_button")));
889 state->bo.expiration_time = GNUNET_FS_year_to_time (year);
882 state->cb (state->cls, state->do_index, state->short_fn, 890 state->cb (state->cls, state->do_index, state->short_fn,
883 state->anonymity_level, state->priority, ctx.root, 891 &state->bo, ctx.root,
884 GTK_RESPONSE_OK); 892 GTK_RESPONSE_OK);
885 GNUNET_free_non_null (state->short_fn); 893 GNUNET_free_non_null (state->short_fn);
886 GNUNET_free (state); 894 GNUNET_free (state);
@@ -888,6 +896,7 @@ GNUNET_GTK_edit_publication_confirm_button_clicked_cb (GtkButton * button,
888 gtk_widget_hide (GTK_WIDGET (pubwindow)); 896 gtk_widget_hide (GTK_WIDGET (pubwindow));
889} 897}
890 898
899
891gboolean 900gboolean
892GNUNET_GTK_edit_publication_window_delete_event_cb (GtkWidget * widget, 901GNUNET_GTK_edit_publication_window_delete_event_cb (GtkWidget * widget,
893 GdkEvent * event, 902 GdkEvent * event,
@@ -991,6 +1000,11 @@ file_information_extract (void *cls, struct GNUNET_FS_FileInformation *fi,
991 (builder, 1000 (builder,
992 "GNUNET_GTK_edit_publication_priority_spin_button")), 1001 "GNUNET_GTK_edit_publication_priority_spin_button")),
993 bo->content_priority); 1002 bo->content_priority);
1003 gtk_spin_button_set_value (GTK_SPIN_BUTTON
1004 (gtk_builder_get_object
1005 (builder,
1006 "GNUNET_GTK_edit_publication_replication_spin_button")),
1007 bo->replication_level);
994 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON 1008 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON
995 (gtk_builder_get_object 1009 (gtk_builder_get_object
996 (builder, 1010 (builder,
@@ -1007,7 +1021,7 @@ file_information_extract (void *cls, struct GNUNET_FS_FileInformation *fi,
1007void 1021void
1008GNUNET_FS_GTK_edit_publish_dialog (GtkBuilder * builder, GtkWindow * parent, 1022GNUNET_FS_GTK_edit_publish_dialog (GtkBuilder * builder, GtkWindow * parent,
1009 int do_index, const char *short_fn, 1023 int do_index, const char *short_fn,
1010 uint32_t anonymity_level, uint32_t priority, 1024 const struct GNUNET_FS_BlockOptions *bo,
1011 struct GNUNET_FS_FileInformation *fip, 1025 struct GNUNET_FS_FileInformation *fip,
1012 gboolean allow_no_keywords, 1026 gboolean allow_no_keywords,
1013 GNUNET_FS_GTK_EditPublishDialogCallback cb, 1027 GNUNET_FS_GTK_EditPublishDialogCallback cb,
@@ -1080,8 +1094,7 @@ GNUNET_FS_GTK_edit_publish_dialog (GtkBuilder * builder, GtkWindow * parent,
1080 state->do_index = do_index; 1094 state->do_index = do_index;
1081 if (NULL != short_fn) 1095 if (NULL != short_fn)
1082 state->short_fn = GNUNET_strdup (short_fn); 1096 state->short_fn = GNUNET_strdup (short_fn);
1083 state->anonymity_level = (guint) anonymity_level; 1097 state->bo = *bo;
1084 state->priority = (guint) priority;
1085 state->fip = fip; 1098 state->fip = fip;
1086 state->preview_changed = GNUNET_NO; 1099 state->preview_changed = GNUNET_NO;
1087 state->allow_no_keywords = allow_no_keywords; 1100 state->allow_no_keywords = allow_no_keywords;