gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r3959 - in gnunet-gtk: . src/plugins/fs


From: grothoff
Subject: [GNUnet-SVN] r3959 - in gnunet-gtk: . src/plugins/fs
Date: Sun, 17 Dec 2006 15:03:02 -0800 (PST)

Author: grothoff
Date: 2006-12-17 15:02:59 -0800 (Sun, 17 Dec 2006)
New Revision: 3959

Modified:
   gnunet-gtk/TODO
   gnunet-gtk/src/plugins/fs/download.c
   gnunet-gtk/src/plugins/fs/upload.c
Log:
use tree for download summary

Modified: gnunet-gtk/TODO
===================================================================
--- gnunet-gtk/TODO     2006-12-17 22:12:34 UTC (rev 3958)
+++ gnunet-gtk/TODO     2006-12-17 23:02:59 UTC (rev 3959)
@@ -20,8 +20,8 @@
   * stop download of directory (=> kills pending downloads of files)
   * re-start download of files
     => assertion failure (once for each re-started download)
-- should show upload/download status as tree, not flat list [pre3]
-  (makes recursive nature of aborting upload/download clearer!)
+- investigate #1088 [RC]
+- investigate #1153 [RC]
 
 0.7.2 (goal: re-enable all 0.7.0 features):
 - create custom gtk logger (via memory logger?)

Modified: gnunet-gtk/src/plugins/fs/download.c
===================================================================
--- gnunet-gtk/src/plugins/fs/download.c        2006-12-17 22:12:34 UTC (rev 
3958)
+++ gnunet-gtk/src/plugins/fs/download.c        2006-12-17 23:02:59 UTC (rev 
3959)
@@ -189,6 +189,7 @@
                    FSUI_State state) {
   DownloadList * list;
   GtkTreeIter iter;
+  GtkTreeIter piter;
   GtkTreePath * path;
   unsigned long long size;
   char * size_h;
@@ -205,11 +206,26 @@
         sizeof(DownloadList));
   list->uri = ECRS_dupUri(fi->uri);
   list->filename = STRDUP(filename);
-  /* FIXME: if we have dl_parent,
-     we may not want to just append! */
-  gtk_tree_store_append(download_summary,
-                       &iter,
-                        NULL);
+  if ( (dl_parent != NULL) &&
+       (NULL != (path = 
gtk_tree_row_reference_get_path(dl_parent->summaryViewRowReference) ) ) ) {
+    valid = gtk_tree_model_get_iter(GTK_TREE_MODEL(download_summary),
+                                   &piter,
+                                   path);
+    if (valid) {
+      gtk_tree_store_append(download_summary,
+                           &iter,
+                           &piter);
+    } else {
+      gtk_tree_store_append(download_summary,
+                           &iter,
+                           NULL);
+    }
+    gtk_tree_path_free(path);
+  } else {
+    gtk_tree_store_append(download_summary,
+                         &iter,
+                         NULL);
+  }
   size = ECRS_fileSize(fi->uri);
   size_h = string_get_fancy_byte_size(size);
   sname = &filename[strlen(filename)-1];
@@ -244,7 +260,6 @@
   list->searchViewRowReference = NULL;
   if (sl_parent != NULL) {
     if (dl_parent != NULL) {
-      GtkTreeIter piter;
 
       /* have parent, must be download from
         directory inside of search */

Modified: gnunet-gtk/src/plugins/fs/upload.c
===================================================================
--- gnunet-gtk/src/plugins/fs/upload.c  2006-12-17 22:12:34 UTC (rev 3958)
+++ gnunet-gtk/src/plugins/fs/upload.c  2006-12-17 23:02:59 UTC (rev 3959)
@@ -141,7 +141,8 @@
   GtkTreeIter iter;
   GtkTreePath * path;
   int progress;
-
+  GtkTreeIter par;
+    
   ret = MALLOC(sizeof(UploadList));
   memset(ret,
         0,
@@ -149,14 +150,8 @@
   ret->filename = STRDUP(filename);
   ret->fsui_list = fsui;
   ret->total = total;
-  if (parent == NULL) {
-    gtk_tree_store_append(upload_summary,
-                         &iter,
-                         NULL);
-  } else {
-    GtkTreeIter par;
-
-    path = gtk_tree_row_reference_get_path(parent->summaryViewRowReference);
+  if ( (parent != NULL) &&
+       (NULL != (path = 
gtk_tree_row_reference_get_path(parent->summaryViewRowReference))) ) {
     gtk_tree_model_get_iter(GTK_TREE_MODEL(upload_summary),
                            &par,
                            path);
@@ -164,8 +159,11 @@
     gtk_tree_store_append(upload_summary,
                          &iter,
                          &par);
-  }
-
+  } else {
+    gtk_tree_store_append(upload_summary,
+                         &iter,
+                         NULL);
+  }  
   if (total != 0)
     progress = 100 * completed / total;
   else





reply via email to

[Prev in Thread] Current Thread [Next in Thread]