aboutsummaryrefslogtreecommitdiff
path: root/src/fs/gnunet-fs-gtk-main_window_file_publish.c
diff options
context:
space:
mode:
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.c52
1 files changed, 38 insertions, 14 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 e8b94fd8..1334ca64 100644
--- a/src/fs/gnunet-fs-gtk-main_window_file_publish.c
+++ b/src/fs/gnunet-fs-gtk-main_window_file_publish.c
@@ -263,7 +263,10 @@ add_file_at_iter (gpointer data, const char *filename,
263 file_size_fancy = GNUNET_STRINGS_byte_size_fancy (file_size); 263 file_size_fancy = GNUNET_STRINGS_byte_size_fancy (file_size);
264 gtk_tree_store_set (ts, &pos, 0, file_size_fancy, 1, (gboolean) do_index, 2, 264 gtk_tree_store_set (ts, &pos, 0, file_size_fancy, 1, (gboolean) do_index, 2,
265 short_fn, 3, (guint) bo->anonymity_level, 4, 265 short_fn, 3, (guint) bo->anonymity_level, 4,
266 (guint) bo->content_priority, 5, fi, -1); 266 (guint) bo->content_priority, 5, fi,
267 6, (guint64) bo->expiration_time.abs_value,
268 7, (guint) bo->replication_level,
269 -1);
267 GNUNET_free (file_size_fancy); 270 GNUNET_free (file_size_fancy);
268 update_selectivity (data); 271 update_selectivity (data);
269} 272}
@@ -310,7 +313,10 @@ create_dir_at_iter (gpointer data, const char *name,
310 GNUNET_CONTAINER_meta_data_destroy (meta); 313 GNUNET_CONTAINER_meta_data_destroy (meta);
311 gtk_tree_store_set (ts, pos, 0, MARKER_DIR_FILE_SIZE, 1, (gboolean) GNUNET_NO, 314 gtk_tree_store_set (ts, pos, 0, MARKER_DIR_FILE_SIZE, 1, (gboolean) GNUNET_NO,
312 2, name, 3, (guint) bo->anonymity_level, 4, 315 2, name, 3, (guint) bo->anonymity_level, 4,
313 (guint) bo->content_priority, 5, fi, -1); 316 (guint) bo->content_priority, 5, fi,
317 6, (guint64) bo->expiration_time.abs_value,
318 7, (guint) bo->replication_level,
319 -1);
314 update_selectivity (data); 320 update_selectivity (data);
315} 321}
316 322
@@ -586,7 +592,9 @@ add_entry_to_ts (GtkTreeStore * ts, GtkTreeIter * iter, const char *filename,
586 short_fn = 1 + ss; 592 short_fn = 1 + ss;
587 gtk_tree_store_set (ts, iter, 0, file_size_fancy, 1, (gboolean) do_index, 2, 593 gtk_tree_store_set (ts, iter, 0, file_size_fancy, 1, (gboolean) do_index, 2,
588 short_fn, 3, (guint) bo->anonymity_level, 4, 594 short_fn, 3, (guint) bo->anonymity_level, 4,
589 (guint) bo->content_priority, 5, fi, -1); 595 (guint) bo->content_priority, 5, fi,
596 6, (guint64) bo->expiration_time.abs_value,
597 7, (guint) bo->replication_level, -1);
590 GNUNET_free (file_size_fancy); 598 GNUNET_free (file_size_fancy);
591} 599}
592 600
@@ -842,6 +850,8 @@ move_entry (gpointer data, GtkTreeModel * tm, GtkTreeIter * old,
842 gchar *short_fn; 850 gchar *short_fn;
843 guint anonymity_level; 851 guint anonymity_level;
844 guint priority; 852 guint priority;
853 guint replication_level;
854 guint64 expiration_time_abs;
845 char *fsf; 855 char *fsf;
846 GtkTreePath *path; 856 GtkTreePath *path;
847 GtkTreeSelection *sel; 857 GtkTreeSelection *sel;
@@ -853,10 +863,13 @@ move_entry (gpointer data, GtkTreeModel * tm, GtkTreeIter * old,
853 863
854 builder = GTK_BUILDER (data); 864 builder = GTK_BUILDER (data);
855 gtk_tree_model_get (tm, old, 0, &fsf, 1, &do_index, 2, &short_fn, 3, 865 gtk_tree_model_get (tm, old, 0, &fsf, 1, &do_index, 2, &short_fn, 3,
856 &anonymity_level, 4, &priority, 5, &fip, -1); 866 &anonymity_level, 4, &priority, 5, &fip,
867 6, &expiration_time_abs, 7, &replication_level, -1);
857 gtk_tree_store_set (GTK_TREE_STORE (tm), newpos, 0, fsf, 1, do_index, 2, 868 gtk_tree_store_set (GTK_TREE_STORE (tm), newpos, 0, fsf, 1, do_index, 2,
858 short_fn, 3, (guint) anonymity_level, 4, (guint) priority, 869 short_fn, 3, (guint) anonymity_level, 4, (guint) priority,
859 5, fip, -1); 870 5, fip,
871 6, expiration_time_abs,
872 7, replication_level, -1);
860 sel = NULL; 873 sel = NULL;
861 tv = NULL; 874 tv = NULL;
862 if (dsel == GNUNET_YES) 875 if (dsel == GNUNET_YES)
@@ -1220,16 +1233,15 @@ struct EditPublishContext
1220 * @param cls closure 1233 * @param cls closure
1221 * @param do_index index flag set? 1234 * @param do_index index flag set?
1222 * @param short_fn short filename 1235 * @param short_fn short filename
1223 * @param anonymity_level anonymity degree chosen for publishing 1236 * @param bo block options for publishing
1224 * @param priority replication setting (rename!)
1225 * @param root always NULL here 1237 * @param root always NULL here
1226 * @param ret GTK_RESPONSE_OK if the dialog was closed with "OK" 1238 * @param ret GTK_RESPONSE_OK if the dialog was closed with "OK"
1227 */ 1239 */
1228static void 1240static void
1229master_publish_edit_publish_dialog_cb (gpointer cls, int do_index, 1241master_publish_edit_publish_dialog_cb (gpointer cls, int do_index,
1230 const char *short_fn, 1242 const char *short_fn,
1231 uint32_t anonymity_level, 1243 const struct GNUNET_FS_BlockOptions *bo,
1232 uint32_t priority, const char *root, 1244 const char *root,
1233 gint ret) 1245 gint ret)
1234{ 1246{
1235 struct EditPublishContext *cbargs = cls; 1247 struct EditPublishContext *cbargs = cls;
@@ -1237,8 +1249,11 @@ master_publish_edit_publish_dialog_cb (gpointer cls, int do_index,
1237 GNUNET_assert (NULL == root); 1249 GNUNET_assert (NULL == root);
1238 if (ret == GTK_RESPONSE_OK) 1250 if (ret == GTK_RESPONSE_OK)
1239 gtk_tree_store_set (GTK_TREE_STORE (cbargs->tm), &cbargs->iter, 1, do_index, 1251 gtk_tree_store_set (GTK_TREE_STORE (cbargs->tm), &cbargs->iter, 1, do_index,
1240 2, short_fn, 3, (guint) anonymity_level, 4, 1252 2, short_fn, 3, (guint) bo->anonymity_level, 4,
1241 (guint) priority, -1); 1253 (guint) bo->content_priority,
1254 6, (guint64) bo->expiration_time.abs_value,
1255 7, (guint) bo->replication_level,
1256 -1);
1242 GNUNET_free (cbargs); 1257 GNUNET_free (cbargs);
1243} 1258}
1244 1259
@@ -1258,6 +1273,9 @@ GNUNET_GTK_master_publish_dialog_edit_button_clicked_cb (GtkWidget * dummy,
1258 guint anonymity_level; 1273 guint anonymity_level;
1259 guint priority; 1274 guint priority;
1260 struct GNUNET_FS_FileInformation *fip; 1275 struct GNUNET_FS_FileInformation *fip;
1276 guint64 abs_etime;
1277 guint replication_level;
1278 struct GNUNET_FS_BlockOptions bo;
1261 1279
1262 builder = GTK_BUILDER (data); 1280 builder = GTK_BUILDER (data);
1263 tv = GTK_TREE_VIEW (gtk_builder_get_object 1281 tv = GTK_TREE_VIEW (gtk_builder_get_object
@@ -1278,11 +1296,17 @@ GNUNET_GTK_master_publish_dialog_edit_button_clicked_cb (GtkWidget * dummy,
1278 } 1296 }
1279 1297
1280 gtk_tree_model_get (tm, &cbargs->iter, 1, &do_index, 2, &short_fn, 3, 1298 gtk_tree_model_get (tm, &cbargs->iter, 1, &do_index, 2, &short_fn, 3,
1281 &anonymity_level, 4, &priority, 5, &fip, -1); 1299 &anonymity_level, 4, &priority, 5, &fip,
1300 6, &abs_etime,
1301 7, &replication_level,
1302 -1);
1303 bo.anonymity_level = anonymity_level;
1304 bo.content_priority = priority;
1305 bo.expiration_time.abs_value = (uint64_t) abs_etime;
1306 bo.replication_level = replication_level;
1282 /* FIXME: shouldn't this use a fresh builder? */ 1307 /* FIXME: shouldn't this use a fresh builder? */
1283 GNUNET_FS_GTK_edit_publish_dialog (builder, master_pubdialog, do_index, 1308 GNUNET_FS_GTK_edit_publish_dialog (builder, master_pubdialog, do_index,
1284 short_fn, (uint32_t) anonymity_level, 1309 short_fn, &bo, fip, TRUE,
1285 (uint32_t) priority, fip, TRUE,
1286 &master_publish_edit_publish_dialog_cb, 1310 &master_publish_edit_publish_dialog_cb,
1287 cbargs); 1311 cbargs);
1288} 1312}