aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2006-12-17 23:02:59 +0000
committerChristian Grothoff <christian@grothoff.org>2006-12-17 23:02:59 +0000
commit67bbc5bad5f8241d2a1e31e9579ac8b2f25debfa (patch)
treef94a0f95825f66316d32aa98e095fa65c172e34f
parent7c88ebd957beb23fdd1657d933a74a8b38c0d9e6 (diff)
downloadgnunet-gtk-67bbc5bad5f8241d2a1e31e9579ac8b2f25debfa.tar.gz
gnunet-gtk-67bbc5bad5f8241d2a1e31e9579ac8b2f25debfa.zip
use tree for download summary
-rw-r--r--TODO4
-rw-r--r--src/plugins/fs/download.c27
-rw-r--r--src/plugins/fs/upload.c20
3 files changed, 32 insertions, 19 deletions
diff --git a/TODO b/TODO
index 7807870f..d879180c 100644
--- a/TODO
+++ b/TODO
@@ -20,8 +20,8 @@ Notes:
20 * stop download of directory (=> kills pending downloads of files) 20 * stop download of directory (=> kills pending downloads of files)
21 * re-start download of files 21 * re-start download of files
22 => assertion failure (once for each re-started download) 22 => assertion failure (once for each re-started download)
23- should show upload/download status as tree, not flat list [pre3] 23- investigate #1088 [RC]
24 (makes recursive nature of aborting upload/download clearer!) 24- investigate #1153 [RC]
25 25
260.7.2 (goal: re-enable all 0.7.0 features): 260.7.2 (goal: re-enable all 0.7.0 features):
27- create custom gtk logger (via memory logger?) 27- create custom gtk logger (via memory logger?)
diff --git a/src/plugins/fs/download.c b/src/plugins/fs/download.c
index 1fd31bfb..9f123578 100644
--- a/src/plugins/fs/download.c
+++ b/src/plugins/fs/download.c
@@ -189,6 +189,7 @@ fs_download_started(struct FSUI_DownloadList * fsui_dl,
189 FSUI_State state) { 189 FSUI_State state) {
190 DownloadList * list; 190 DownloadList * list;
191 GtkTreeIter iter; 191 GtkTreeIter iter;
192 GtkTreeIter piter;
192 GtkTreePath * path; 193 GtkTreePath * path;
193 unsigned long long size; 194 unsigned long long size;
194 char * size_h; 195 char * size_h;
@@ -205,11 +206,26 @@ fs_download_started(struct FSUI_DownloadList * fsui_dl,
205 sizeof(DownloadList)); 206 sizeof(DownloadList));
206 list->uri = ECRS_dupUri(fi->uri); 207 list->uri = ECRS_dupUri(fi->uri);
207 list->filename = STRDUP(filename); 208 list->filename = STRDUP(filename);
208 /* FIXME: if we have dl_parent, 209 if ( (dl_parent != NULL) &&
209 we may not want to just append! */ 210 (NULL != (path = gtk_tree_row_reference_get_path(dl_parent->summaryViewRowReference) ) ) ) {
210 gtk_tree_store_append(download_summary, 211 valid = gtk_tree_model_get_iter(GTK_TREE_MODEL(download_summary),
211 &iter, 212 &piter,
212 NULL); 213 path);
214 if (valid) {
215 gtk_tree_store_append(download_summary,
216 &iter,
217 &piter);
218 } else {
219 gtk_tree_store_append(download_summary,
220 &iter,
221 NULL);
222 }
223 gtk_tree_path_free(path);
224 } else {
225 gtk_tree_store_append(download_summary,
226 &iter,
227 NULL);
228 }
213 size = ECRS_fileSize(fi->uri); 229 size = ECRS_fileSize(fi->uri);
214 size_h = string_get_fancy_byte_size(size); 230 size_h = string_get_fancy_byte_size(size);
215 sname = &filename[strlen(filename)-1]; 231 sname = &filename[strlen(filename)-1];
@@ -244,7 +260,6 @@ fs_download_started(struct FSUI_DownloadList * fsui_dl,
244 list->searchViewRowReference = NULL; 260 list->searchViewRowReference = NULL;
245 if (sl_parent != NULL) { 261 if (sl_parent != NULL) {
246 if (dl_parent != NULL) { 262 if (dl_parent != NULL) {
247 GtkTreeIter piter;
248 263
249 /* have parent, must be download from 264 /* have parent, must be download from
250 directory inside of search */ 265 directory inside of search */
diff --git a/src/plugins/fs/upload.c b/src/plugins/fs/upload.c
index d25e7d94..5ab6d75a 100644
--- a/src/plugins/fs/upload.c
+++ b/src/plugins/fs/upload.c
@@ -141,7 +141,8 @@ fs_upload_started(struct FSUI_UploadList * fsui,
141 GtkTreeIter iter; 141 GtkTreeIter iter;
142 GtkTreePath * path; 142 GtkTreePath * path;
143 int progress; 143 int progress;
144 144 GtkTreeIter par;
145
145 ret = MALLOC(sizeof(UploadList)); 146 ret = MALLOC(sizeof(UploadList));
146 memset(ret, 147 memset(ret,
147 0, 148 0,
@@ -149,14 +150,8 @@ fs_upload_started(struct FSUI_UploadList * fsui,
149 ret->filename = STRDUP(filename); 150 ret->filename = STRDUP(filename);
150 ret->fsui_list = fsui; 151 ret->fsui_list = fsui;
151 ret->total = total; 152 ret->total = total;
152 if (parent == NULL) { 153 if ( (parent != NULL) &&
153 gtk_tree_store_append(upload_summary, 154 (NULL != (path = gtk_tree_row_reference_get_path(parent->summaryViewRowReference))) ) {
154 &iter,
155 NULL);
156 } else {
157 GtkTreeIter par;
158
159 path = gtk_tree_row_reference_get_path(parent->summaryViewRowReference);
160 gtk_tree_model_get_iter(GTK_TREE_MODEL(upload_summary), 155 gtk_tree_model_get_iter(GTK_TREE_MODEL(upload_summary),
161 &par, 156 &par,
162 path); 157 path);
@@ -164,8 +159,11 @@ fs_upload_started(struct FSUI_UploadList * fsui,
164 gtk_tree_store_append(upload_summary, 159 gtk_tree_store_append(upload_summary,
165 &iter, 160 &iter,
166 &par); 161 &par);
167 } 162 } else {
168 163 gtk_tree_store_append(upload_summary,
164 &iter,
165 NULL);
166 }
169 if (total != 0) 167 if (total != 0)
170 progress = 100 * completed / total; 168 progress = 100 * completed / total;
171 else 169 else