diff options
Diffstat (limited to 'src/fs/gnunet-fs-gtk-main_window_file_publish.c')
-rw-r--r-- | src/fs/gnunet-fs-gtk-main_window_file_publish.c | 31 |
1 files changed, 20 insertions, 11 deletions
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 da3d6c4d..6791e61b 100644 --- a/src/fs/gnunet-fs-gtk-main_window_file_publish.c +++ b/src/fs/gnunet-fs-gtk-main_window_file_publish.c | |||
@@ -51,6 +51,7 @@ struct MainPublishingDialogContext | |||
51 | 51 | ||
52 | gulong open_directory_handler_id; | 52 | gulong open_directory_handler_id; |
53 | GtkBuilder *open_directory_builder; | 53 | GtkBuilder *open_directory_builder; |
54 | GtkBuilder *open_file_builder; | ||
54 | gulong open_file_handler_id; | 55 | gulong open_file_handler_id; |
55 | }; | 56 | }; |
56 | 57 | ||
@@ -1150,12 +1151,22 @@ GNUNET_GTK_master_publish_dialog_add_button_clicked_cb (GtkWidget * dummy, | |||
1150 | { | 1151 | { |
1151 | GtkWidget *ad; | 1152 | GtkWidget *ad; |
1152 | 1153 | ||
1154 | GtkComboBox *combo; | ||
1155 | GtkTreeModel *anon_treemodel; | ||
1156 | |||
1157 | ctx->open_file_builder = GNUNET_GTK_get_new_builder ("gnunet_fs_gtk_publish_file_dialog.glade", ctx); | ||
1158 | GNUNET_FS_GTK_setup_expiration_year_adjustment (ctx->open_file_builder); | ||
1153 | ad = GTK_WIDGET (gtk_builder_get_object | 1159 | ad = GTK_WIDGET (gtk_builder_get_object |
1154 | (ctx->main_window_builder, "GNUNET_GTK_publish_file_dialog")); | 1160 | (ctx->open_file_builder, "GNUNET_GTK_publish_file_dialog")); |
1155 | GNUNET_FS_GTK_setup_expiration_year_adjustment (ctx->main_window_builder); | ||
1156 | 1161 | ||
1157 | ctx->open_file_handler_id = g_signal_connect (G_OBJECT (ad), "response", G_CALLBACK (GNUNET_GTK_publish_file_dialog_response_cb), ctx); | 1162 | ctx->open_file_handler_id = g_signal_connect (G_OBJECT (ad), "response", G_CALLBACK (GNUNET_GTK_publish_file_dialog_response_cb), ctx); |
1158 | 1163 | ||
1164 | anon_treemodel = GTK_TREE_MODEL (gtk_builder_get_object (ctx->main_window_builder, | ||
1165 | "main_window_search_anonymity_liststore")); | ||
1166 | combo = GTK_COMBO_BOX (gtk_builder_get_object (ctx->open_file_builder, | ||
1167 | "GNUNET_GTK_publish_file_dialog_anonymity_combobox")); | ||
1168 | gtk_combo_box_set_model (combo, anon_treemodel); | ||
1169 | |||
1159 | gtk_window_set_transient_for (GTK_WINDOW (ad), ctx->master_pubdialog); | 1170 | gtk_window_set_transient_for (GTK_WINDOW (ad), ctx->master_pubdialog); |
1160 | 1171 | ||
1161 | gtk_window_present (GTK_WINDOW (ad)); | 1172 | gtk_window_present (GTK_WINDOW (ad)); |
@@ -1709,41 +1720,39 @@ GNUNET_GTK_publish_file_dialog_response_cb (GtkDialog * dialog, | |||
1709 | GtkSpinButton *sb; | 1720 | GtkSpinButton *sb; |
1710 | GtkWidget *ad; | 1721 | GtkWidget *ad; |
1711 | 1722 | ||
1712 | GtkBuilder *builder = ctx->main_window_builder; | ||
1713 | |||
1714 | if (g_signal_handler_is_connected (G_OBJECT (dialog), ctx->open_file_handler_id)) | 1723 | if (g_signal_handler_is_connected (G_OBJECT (dialog), ctx->open_file_handler_id)) |
1715 | g_signal_handler_disconnect (G_OBJECT (dialog), ctx->open_file_handler_id); | 1724 | g_signal_handler_disconnect (G_OBJECT (dialog), ctx->open_file_handler_id); |
1716 | ctx->open_file_handler_id = 0; | 1725 | ctx->open_file_handler_id = 0; |
1717 | 1726 | ||
1718 | ad = GTK_WIDGET (gtk_builder_get_object | 1727 | ad = GTK_WIDGET (gtk_builder_get_object |
1719 | (builder, "GNUNET_GTK_publish_file_dialog")); | 1728 | (ctx->open_file_builder, "GNUNET_GTK_publish_file_dialog")); |
1720 | 1729 | ||
1721 | if (response_id == -5) | 1730 | if (response_id == -5) |
1722 | { | 1731 | { |
1723 | /* OK */ | 1732 | /* OK */ |
1724 | sb = GTK_SPIN_BUTTON (gtk_builder_get_object | 1733 | sb = GTK_SPIN_BUTTON (gtk_builder_get_object |
1725 | (builder, | 1734 | (ctx->open_file_builder, |
1726 | "GNUNET_GTK_publish_file_dialog_expiration_year_spin_button")); | 1735 | "GNUNET_GTK_publish_file_dialog_expiration_year_spin_button")); |
1727 | 1736 | ||
1728 | if (!GNUNET_GTK_get_selected_anonymity_level | 1737 | if (!GNUNET_GTK_get_selected_anonymity_level |
1729 | (builder, "GNUNET_GTK_publish_file_dialog_anonymity_combobox", | 1738 | (ctx->open_file_builder, "GNUNET_GTK_publish_file_dialog_anonymity_combobox", |
1730 | &bo.anonymity_level)) | 1739 | &bo.anonymity_level)) |
1731 | bo.anonymity_level = 1; | 1740 | bo.anonymity_level = 1; |
1732 | bo.content_priority = | 1741 | bo.content_priority = |
1733 | gtk_spin_button_get_value (GTK_SPIN_BUTTON | 1742 | gtk_spin_button_get_value (GTK_SPIN_BUTTON |
1734 | (gtk_builder_get_object | 1743 | (gtk_builder_get_object |
1735 | (builder, | 1744 | (ctx->open_file_builder, |
1736 | "GNUNET_GTK_publish_file_dialog_priority_spin_button"))); | 1745 | "GNUNET_GTK_publish_file_dialog_priority_spin_button"))); |
1737 | bo.expiration_time = GNUNET_FS_GTK_get_expiration_time (sb); | 1746 | bo.expiration_time = GNUNET_FS_GTK_get_expiration_time (sb); |
1738 | bo.replication_level = | 1747 | bo.replication_level = |
1739 | gtk_spin_button_get_value (GTK_SPIN_BUTTON | 1748 | gtk_spin_button_get_value (GTK_SPIN_BUTTON |
1740 | (gtk_builder_get_object | 1749 | (gtk_builder_get_object |
1741 | (builder, | 1750 | (ctx->open_file_builder, |
1742 | "GNUNET_GTK_publish_file_dialog_replication_spin_button"))); | 1751 | "GNUNET_GTK_publish_file_dialog_replication_spin_button"))); |
1743 | do_index = | 1752 | do_index = |
1744 | gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON | 1753 | gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON |
1745 | (gtk_builder_get_object | 1754 | (gtk_builder_get_object |
1746 | (builder, | 1755 | (ctx->open_file_builder, |
1747 | "GNUNET_GTK_publish_file_dialog_do_index_checkbutton"))); | 1756 | "GNUNET_GTK_publish_file_dialog_do_index_checkbutton"))); |
1748 | 1757 | ||
1749 | filename = GNUNET_GTK_filechooser_get_filename_utf8 (GTK_FILE_CHOOSER (ad)); | 1758 | filename = GNUNET_GTK_filechooser_get_filename_utf8 (GTK_FILE_CHOOSER (ad)); |
@@ -1755,7 +1764,7 @@ GNUNET_GTK_publish_file_dialog_response_cb (GtkDialog * dialog, | |||
1755 | { | 1764 | { |
1756 | /* Cancel/Escape/close/etc */ | 1765 | /* Cancel/Escape/close/etc */ |
1757 | } | 1766 | } |
1758 | gtk_widget_hide (ad); | 1767 | gtk_widget_destroy (ad); |
1759 | } | 1768 | } |
1760 | 1769 | ||
1761 | 1770 | ||