gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r34539 - gnunet-gtk/src/fs


From: gnunet
Subject: [GNUnet-SVN] r34539 - gnunet-gtk/src/fs
Date: Fri, 12 Dec 2014 01:05:10 +0100

Author: grothoff
Date: 2014-12-12 01:05:10 +0100 (Fri, 12 Dec 2014)
New Revision: 34539

Modified:
   gnunet-gtk/src/fs/gnunet-fs-gtk.c
   gnunet-gtk/src/fs/gnunet-fs-gtk_download-save-as.c
   gnunet-gtk/src/fs/gnunet-fs-gtk_event-handler.c
   gnunet-gtk/src/fs/gnunet-fs-gtk_main-window-view-toggles.c
Log:
fix #3497, plus indentation fixes

Modified: gnunet-gtk/src/fs/gnunet-fs-gtk.c
===================================================================
--- gnunet-gtk/src/fs/gnunet-fs-gtk.c   2014-12-12 00:03:49 UTC (rev 34538)
+++ gnunet-gtk/src/fs/gnunet-fs-gtk.c   2014-12-12 00:05:10 UTC (rev 34539)
@@ -681,7 +681,8 @@
  * @param tc scheduler context, unused
  */
 static void
-run (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
+run (void *cls,
+     const struct GNUNET_SCHEDULER_TaskContext *tc)
 {
   unsigned long long dl_parallel;
   unsigned long long req_parallel;
@@ -777,11 +778,17 @@
   /* FIXME: should these '1's be here? Maybe better to put them into
    * default config files?
    */
-  if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_number (main_context.cfg, 
"gnunet-fs-gtk",
-      "MAX_PARALLEL_DOWNLOADS", &dl_parallel))
+  if (GNUNET_OK !=
+      GNUNET_CONFIGURATION_get_value_number (main_context.cfg,
+                                             "gnunet-fs-gtk",
+                                             "MAX_PARALLEL_DOWNLOADS",
+                                             &dl_parallel))
     dl_parallel = DEFAULT_MAX_PARALLEL_DOWNLOADS;
-  if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_number (main_context.cfg, 
"gnunet-fs-gtk",
-      "MAX_PARALLEL_REQUESTS", &req_parallel))
+  if (GNUNET_OK !=
+      GNUNET_CONFIGURATION_get_value_number (main_context.cfg,
+                                             "gnunet-fs-gtk",
+                                             "MAX_PARALLEL_REQUESTS",
+                                             &req_parallel))
     req_parallel = DEFAULT_MAX_PARALLEL_REQUESTS;
 
   /* initialize file-sharing */
@@ -798,8 +805,12 @@
     GNUNET_GTK_main_loop_quit (cls);
     return;
   }
-  arm = GNUNET_ARM_connect (main_context.cfg, &arm_connection_state_change, 
&main_context);
-  armon = GNUNET_ARM_monitor (main_context.cfg, service_status_change, 
&main_context);
+  arm = GNUNET_ARM_connect (main_context.cfg,
+                            &arm_connection_state_change,
+                            &main_context);
+  armon = GNUNET_ARM_monitor (main_context.cfg,
+                              &service_status_change,
+                              &main_context);
   main_context.gns = GNUNET_GNS_connect (main_context.cfg);
   main_context.identity = GNUNET_IDENTITY_connect (main_context.cfg, NULL, 
NULL);
   main_context.id_op = GNUNET_IDENTITY_get (main_context.identity,

Modified: gnunet-gtk/src/fs/gnunet-fs-gtk_download-save-as.c
===================================================================
--- gnunet-gtk/src/fs/gnunet-fs-gtk_download-save-as.c  2014-12-12 00:03:49 UTC 
(rev 34538)
+++ gnunet-gtk/src/fs/gnunet-fs-gtk_download-save-as.c  2014-12-12 00:05:10 UTC 
(rev 34539)
@@ -56,11 +56,11 @@
   char *dirname;
 
   /**
-   * Set to GNUNET_YES if pressing "Save" button should initiate the download
-   * right away, set to GNUNET_NO if it should only change directory and file
+   * Set to #GNUNET_YES if pressing "Save" button should initiate the download
+   * right away, set to #GNUNET_NO if it should only change directory and file
    * names on the download panel.
-   * Popup menu sets it to GNUNET_YES, download panel "Change name" button sets
-   * it to GNUNET_NO.
+   * Popup menu sets it to #GNUNET_YES, download panel "Change name" button 
sets
+   * it to #GNUNET_NO.
    */
   int download_directly;
 };
@@ -189,7 +189,9 @@
   else if (de->sr != NULL && de->sr->tab != NULL && de->sr->rr != NULL)
   {
     /* Update download panel */
-    GNUNET_FS_GTK_set_item_downloaded_name (de->sr->tab->ts, de->sr->rr, 
de->filename);
+    GNUNET_FS_GTK_set_item_downloaded_name (de->sr->tab->ts,
+                                            de->sr->rr,
+                                            de->filename);
     GNUNET_FS_GTK_free_download_entry (de);
   }
   /* we were successful, do not remove the directory (if we created one) */
@@ -198,7 +200,9 @@
   clean_up_download_as_context (dlc);
 }
 
-/* FIXME: implement handling for corner cases:
+
+/*
+** FIXME: implement handling for corner cases:
  * A) Selection changes in search tab while SaveAs dialog is open.
  *    If it's in direct download mode, ignore that; otherwise destroy the 
dialog.
  * B) Download! is pressed in download panel (or the search result is otherwise
@@ -280,6 +284,7 @@
   gtk_window_present (GTK_WINDOW (dlc->dialog));
 }
 
+
 /**
  * Open the 'save as' dialog for a download.  Calls the 'dc->cb'
  * continutation when the dialog is complete.  Will release the 'dc'
@@ -294,6 +299,7 @@
   open_saveas_dialog (de, GNUNET_YES);
 }
 
+
 /**
  * Open the 'save as' dialog for a download.  Calls the 'dc->cb'
  * continutation when the dialog is complete.  Will release the 'dc'

Modified: gnunet-gtk/src/fs/gnunet-fs-gtk_event-handler.c
===================================================================
--- gnunet-gtk/src/fs/gnunet-fs-gtk_event-handler.c     2014-12-12 00:03:49 UTC 
(rev 34538)
+++ gnunet-gtk/src/fs/gnunet-fs-gtk_event-handler.c     2014-12-12 00:05:10 UTC 
(rev 34539)
@@ -2908,8 +2908,10 @@
 mark_download_progress (struct DownloadEntry *de,
                        const char *filename,
                        uint64_t size,
-                        uint64_t completed, const void *block_data,
-                        uint64_t offset, uint64_t block_size,
+                        uint64_t completed,
+                        const void *block_data,
+                        uint64_t offset,
+                        uint64_t block_size,
                         unsigned int depth)
 {
   GtkTreeIter iter;
@@ -2932,12 +2934,16 @@
        a custom CellRenderer... */
     gtk_tree_store_set (de->sr->tab->ts, &iter,
                         SEARCH_TAB_MC_PERCENT_PROGRESS, (guint) ((size > 0) ?  
(100 * completed / size) : 100),
+                        SEARCH_TAB_MC_PERCENT_AVAILABILITY, (guint) ((size > 
0) ?  (100 * completed / size) : 100),
+                        SEARCH_TAB_MC_UNKNOWN_AVAILABILITY, (completed ? -1 : 
0),
                         SEARCH_TAB_MC_COMPLETED, completed,
                         -1);
   }
   get_download_list_entry (de, &diter);
   gtk_tree_store_set (downloads_treestore, &diter,
                       SEARCH_TAB_MC_PERCENT_PROGRESS, (guint) ((size > 0) ?  
(100 * completed / size) : 100),
+                      SEARCH_TAB_MC_PERCENT_AVAILABILITY, (guint) ((size > 0) 
?  (100 * completed / size) : 100),
+                      SEARCH_TAB_MC_UNKNOWN_AVAILABILITY, (completed ? -1 : 0),
                       SEARCH_TAB_MC_COMPLETED, completed,
                       -1);
   if (completed < size)
@@ -3222,6 +3228,8 @@
                       SEARCH_TAB_MC_PERCENT_PROGRESS, (guint) ((size > 0) ? 
(100 * completed / size) : 100),
                       SEARCH_TAB_MC_FILENAME, filename,
                       SEARCH_TAB_MC_STATUS_COLOUR, "blue",
+                      SEARCH_TAB_MC_PERCENT_AVAILABILITY, 0,
+                     SEARCH_TAB_MC_UNKNOWN_AVAILABILITY, -1,
                       SEARCH_TAB_MC_SEARCH_RESULT, de->sr,
                       SEARCH_TAB_MC_COMPLETED, (guint64) completed,
                       SEARCH_TAB_MC_DOWNLOADED_FILENAME, de->filename,
@@ -3235,6 +3243,8 @@
                       SEARCH_TAB_MC_FILENAME, filename,
                       SEARCH_TAB_MC_STATUS_COLOUR, "blue",
                       SEARCH_TAB_MC_SEARCH_RESULT, de->sr,
+                      SEARCH_TAB_MC_PERCENT_AVAILABILITY, 0,
+                     SEARCH_TAB_MC_UNKNOWN_AVAILABILITY, -1,
                       SEARCH_TAB_MC_COMPLETED, (guint64) completed,
                       SEARCH_TAB_MC_DOWNLOADED_FILENAME, de->filename,
                       SEARCH_TAB_MC_DOWNLOADED_ANONYMITY, de->anonymity,

Modified: gnunet-gtk/src/fs/gnunet-fs-gtk_main-window-view-toggles.c
===================================================================
--- gnunet-gtk/src/fs/gnunet-fs-gtk_main-window-view-toggles.c  2014-12-12 
00:03:49 UTC (rev 34538)
+++ gnunet-gtk/src/fs/gnunet-fs-gtk_main-window-view-toggles.c  2014-12-12 
00:05:10 UTC (rev 34539)
@@ -119,4 +119,5 @@
                "GNUNET_GTK_main_menu_search_preview");
 }
 
+
 /* end of gnunet-fs-gtk_main-window-view-toggles.c */




reply via email to

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