aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/fs/download.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/fs/download.c')
-rw-r--r--src/plugins/fs/download.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/src/plugins/fs/download.c b/src/plugins/fs/download.c
index 0ba02840..ff3f361c 100644
--- a/src/plugins/fs/download.c
+++ b/src/plugins/fs/download.c
@@ -156,7 +156,8 @@ fs_download_started(struct FSUI_DownloadList * fsui_dl,
156 const ECRS_FileInfo * fi, 156 const ECRS_FileInfo * fi,
157 const char * filename, 157 const char * filename,
158 unsigned long long completed, 158 unsigned long long completed,
159 cron_t eta) { 159 cron_t eta,
160 FSUI_State state) {
160 DownloadList * list; 161 DownloadList * list;
161 GtkTreeIter iter; 162 GtkTreeIter iter;
162 GtkTreePath * path; 163 GtkTreePath * path;
@@ -265,6 +266,8 @@ fs_download_started(struct FSUI_DownloadList * fsui_dl,
265 list->fsui_list = fsui_dl; 266 list->fsui_list = fsui_dl;
266 list->total = total; 267 list->total = total;
267 list->is_directory = ECRS_isDirectory(fi->meta); 268 list->is_directory = ECRS_isDirectory(fi->meta);
269 list->has_terminated = ( (state != FSUI_ACTIVE) &&
270 (state != FSUI_PENDING) );
268 list->next = download_head; 271 list->next = download_head;
269 download_head = list; 272 download_head = list;
270 if ( (list->is_directory == YES) && 273 if ( (list->is_directory == YES) &&
@@ -658,7 +661,7 @@ static void * fsui_callback(void * cls) {
658 return NULL; 661 return NULL;
659} 662}
660 663
661static void 664static gboolean
662clearCompletedDownloadCallback(GtkTreeModel * model, 665clearCompletedDownloadCallback(GtkTreeModel * model,
663 GtkTreePath * path, 666 GtkTreePath * path,
664 GtkTreeIter * iter, 667 GtkTreeIter * iter,
@@ -678,21 +681,14 @@ clearCompletedDownloadCallback(GtkTreeModel * model,
678 run_with_save_calls(&fsui_callback, 681 run_with_save_calls(&fsui_callback,
679 &fcbc); 682 &fcbc);
680 } 683 }
684 return FALSE;
681} 685}
682 686
683void on_clearCompletedDownloadsButton_clicked_fs(void * unused, 687void on_clearCompletedDownloadsButton_clicked_fs(void * unused,
684 GtkWidget * clearButton) { 688 GtkWidget * clearButton) {
685 GtkTreeSelection * selection; 689 gtk_tree_model_foreach(GTK_TREE_MODEL(download_summary),
686 GtkWidget * downloadList; 690 &clearCompletedDownloadCallback,
687 691 NULL);
688 downloadList = glade_xml_get_widget(getMainXML(),
689 "activeDownloadsList");
690 selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(downloadList));
691
692 ggc_tree_selection_selected_foreach
693 (selection,
694 &clearCompletedDownloadCallback,
695 NULL);
696} 692}
697 693
698static void 694static void