aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/fs/upload.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/fs/upload.c')
-rw-r--r--src/plugins/fs/upload.c60
1 files changed, 38 insertions, 22 deletions
diff --git a/src/plugins/fs/upload.c b/src/plugins/fs/upload.c
index 486633f4..f718f456 100644
--- a/src/plugins/fs/upload.c
+++ b/src/plugins/fs/upload.c
@@ -1,6 +1,6 @@
1/* 1/*
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 (C) 2005, 2006 Christian Grothoff (and other contributing authors) 3 (C) 2005, 2006, 2008 Christian Grothoff (and other contributing authors)
4 4
5 GNUnet is free software; you can redistribute it and/or modify 5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published 6 it under the terms of the GNU General Public License as published
@@ -86,10 +86,44 @@ fs_upload_complete (UploadList * list, struct GNUNET_ECRS_URI *uri)
86} 86}
87 87
88void 88void
89fs_upload_error (UploadList * list) 89fs_upload_aborted (UploadList * list)
90{ 90{
91 /* FIXME: indicate error in summary dialog! */ 91 GtkTreeIter iter;
92 GtkTreePath *path;
93
92 list->has_terminated = GNUNET_YES; 94 list->has_terminated = GNUNET_YES;
95 list->uri = NULL;
96 path = gtk_tree_row_reference_get_path (list->summaryViewRowReference);
97 gtk_tree_model_get_iter (GTK_TREE_MODEL (upload_summary), &iter, path);
98 gtk_tree_path_free (path);
99 gtk_tree_store_set (upload_summary, &iter,
100 UPLOAD_URISTRING, _("Aborted."),
101 UPLOAD_PROGRESS, 0,
102 -1);
103}
104
105void
106fs_upload_error (UploadList * list, const char * emsg)
107{
108 GtkTreeIter iter;
109 GtkTreePath *path;
110 char *us;
111 size_t len;
112
113 list->has_terminated = GNUNET_YES;
114 list->uri = NULL;
115 len = strlen(_("Error uploading file: `%s'")) + strlen(emsg) + 2;
116 us = GNUNET_malloc(len);
117 GNUNET_snprintf(us, len,
118 _("Error uploading file: `%s'"),
119 emsg);
120 path = gtk_tree_row_reference_get_path (list->summaryViewRowReference);
121 gtk_tree_model_get_iter (GTK_TREE_MODEL (upload_summary), &iter, path);
122 gtk_tree_path_free (path);
123 gtk_tree_store_set (upload_summary, &iter,
124 UPLOAD_URISTRING, us,
125 UPLOAD_PROGRESS, 0, -1);
126 GNUNET_free (us);
93} 127}
94 128
95void 129void
@@ -130,7 +164,7 @@ UploadList *
130fs_upload_started (struct GNUNET_FSUI_UploadList *fsui, 164fs_upload_started (struct GNUNET_FSUI_UploadList *fsui,
131 UploadList * parent, 165 UploadList * parent,
132 const char *filename, 166 const char *filename,
133 struct GNUNET_ECRS_URI *uri, 167 const struct GNUNET_ECRS_URI *uri,
134 unsigned long long total, 168 unsigned long long total,
135 unsigned long long completed, GNUNET_FSUI_State state) 169 unsigned long long completed, GNUNET_FSUI_State state)
136{ 170{
@@ -652,20 +686,6 @@ fsuiCallUploadCallback (GtkTreeModel * model,
652} 686}
653 687
654void 688void
655on_abortUploadButton_clicked_fs (void *unused, GtkWidget * clearButton)
656{
657 GtkTreeSelection *selection;
658 GtkWidget *uploadList;
659
660 uploadList =
661 glade_xml_get_widget (GNUNET_GTK_get_main_glade_XML (),
662 "activeUploadsList");
663 selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (uploadList));
664 GNUNET_GTK_tree_selection_selected_foreach
665 (selection, &fsuiCallUploadCallback, &GNUNET_FSUI_upload_abort);
666}
667
668void
669on_stopUploadButton_clicked_fs (void *unused, GtkWidget * clearButton) 689on_stopUploadButton_clicked_fs (void *unused, GtkWidget * clearButton)
670{ 690{
671 GtkTreeSelection *selection; 691 GtkTreeSelection *selection;
@@ -677,10 +697,6 @@ on_stopUploadButton_clicked_fs (void *unused, GtkWidget * clearButton)
677 selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (uploadList)); 697 selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (uploadList));
678 GNUNET_GTK_tree_selection_selected_foreach 698 GNUNET_GTK_tree_selection_selected_foreach
679 (selection, &fsuiCallUploadCallback, &GNUNET_FSUI_upload_abort); 699 (selection, &fsuiCallUploadCallback, &GNUNET_FSUI_upload_abort);
680 GNUNET_GTK_tree_selection_selected_foreach
681 (selection, &fsuiCallUploadCallback, &GNUNET_FSUI_upload_stop);
682} 700}
683 701
684
685
686/* end of upload.c */ 702/* end of upload.c */