aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2008-07-19 08:35:53 +0000
committerChristian Grothoff <christian@grothoff.org>2008-07-19 08:35:53 +0000
commit4c1b48d1e8256fbbfed5451bba14c2ab869454a1 (patch)
tree777f0201bf51d7fc64e864a7e6de822f7c30f4e5
parentba617d6703e66149903f22cbb6aaa4283b41c37a (diff)
downloadgnunet-gtk-4c1b48d1e8256fbbfed5451bba14c2ab869454a1.tar.gz
gnunet-gtk-4c1b48d1e8256fbbfed5451bba14c2ab869454a1.zip
show metadata
-rw-r--r--src/plugins/fs/download.c45
1 files changed, 44 insertions, 1 deletions
diff --git a/src/plugins/fs/download.c b/src/plugins/fs/download.c
index 3121e627..18f2e310 100644
--- a/src/plugins/fs/download.c
+++ b/src/plugins/fs/download.c
@@ -227,7 +227,9 @@ fs_download_started (struct GNUNET_FSUI_DownloadList *fsui_dl,
227 DOWNLOAD_HSIZE, size_h, 227 DOWNLOAD_HSIZE, size_h,
228 DOWNLOAD_PROGRESS, progress, 228 DOWNLOAD_PROGRESS, progress,
229 DOWNLOAD_URISTRING, uri_name, 229 DOWNLOAD_URISTRING, uri_name,
230 DOWNLOAD_INTERNAL, list, -1); 230 DOWNLOAD_INTERNAL, list,
231 DOWNLOAD_META_DATA, GNUNET_meta_data_duplicate(fi->meta),
232 -1);
231 GNUNET_free (uri_name); 233 GNUNET_free (uri_name);
232 GNUNET_free (size_h); 234 GNUNET_free (size_h);
233 path = gtk_tree_model_get_path (GTK_TREE_MODEL (download_summary), &iter); 235 path = gtk_tree_model_get_path (GTK_TREE_MODEL (download_summary), &iter);
@@ -429,6 +431,7 @@ fs_download_stopped (DownloadList * list)
429 GtkTreePath *path; 431 GtkTreePath *path;
430 DownloadList *prev; 432 DownloadList *prev;
431 GtkTreeModel *model; 433 GtkTreeModel *model;
434 struct GNUNET_MetaData * meta;
432 435
433 path = gtk_tree_row_reference_get_path (list->summaryViewRowReference); 436 path = gtk_tree_row_reference_get_path (list->summaryViewRowReference);
434 if (path == NULL) 437 if (path == NULL)
@@ -442,6 +445,12 @@ fs_download_stopped (DownloadList * list)
442 gtk_tree_path_free (path); 445 gtk_tree_path_free (path);
443 gtk_tree_row_reference_free (list->summaryViewRowReference); 446 gtk_tree_row_reference_free (list->summaryViewRowReference);
444 list->summaryViewRowReference = NULL; 447 list->summaryViewRowReference = NULL;
448 gtk_tree_model_get(GTK_TREE_MODEL(download_summary),
449 &iter,
450 DOWNLOAD_META_DATA, &meta,
451 -1);
452 if (meta != NULL)
453 GNUNET_meta_data_destroy(meta);
445 gtk_tree_store_remove (download_summary, &iter); 454 gtk_tree_store_remove (download_summary, &iter);
446 } 455 }
447 GNUNET_free (list->filename); 456 GNUNET_free (list->filename);
@@ -936,6 +945,40 @@ on_stopDownload_clicked_fs (void *unused, GtkWidget * dummy)
936} 945}
937 946
938 947
948static void
949fsuiShowMetaDataCallback (GtkTreeModel * model,
950 GtkTreePath * path,
951 GtkTreeIter * iter, gpointer fsui_call)
952{
953 struct GNUNET_MetaData * meta;
954 char * name;
955
956 GNUNET_GE_ASSERT (ectx,
957 model == GTK_TREE_MODEL (download_summary));
958 gtk_tree_model_get (model,
959 iter,
960 DOWNLOAD_META_DATA, &meta,
961 DOWNLOAD_SHORTNAME, &name,
962 -1);
963 if (meta != NULL)
964 open_meta_data_display_dialog(meta, name);
965 GNUNET_free_non_null(name);
966}
967
968void
969on_showDownloadMetaData_clicked_fs (void *unused, GtkWidget * dummy)
970{
971 GtkTreeSelection *selection;
972 GtkWidget *downloadList;
973
974 downloadList =
975 glade_xml_get_widget (GNUNET_GTK_get_main_glade_XML (),
976 "activeDownloadsList");
977 selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (downloadList));
978 GNUNET_GTK_tree_selection_selected_foreach
979 (selection, &fsuiShowMetaDataCallback, NULL);
980}
981
939/** 982/**
940 * Right-click on an active download 983 * Right-click on an active download
941 */ 984 */