aboutsummaryrefslogtreecommitdiff
path: root/src/fs
diff options
context:
space:
mode:
Diffstat (limited to 'src/fs')
-rw-r--r--src/fs/gnunet-fs-gtk.c25
-rw-r--r--src/fs/gnunet-fs-gtk_download-save-as.c18
-rw-r--r--src/fs/gnunet-fs-gtk_event-handler.c14
-rw-r--r--src/fs/gnunet-fs-gtk_main-window-view-toggles.c1
4 files changed, 43 insertions, 15 deletions
diff --git a/src/fs/gnunet-fs-gtk.c b/src/fs/gnunet-fs-gtk.c
index 1cd8c70a..9ed2d21b 100644
--- a/src/fs/gnunet-fs-gtk.c
+++ b/src/fs/gnunet-fs-gtk.c
@@ -681,7 +681,8 @@ handle_sks_zone_identity (void *cls,
681 * @param tc scheduler context, unused 681 * @param tc scheduler context, unused
682 */ 682 */
683static void 683static void
684run (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) 684run (void *cls,
685 const struct GNUNET_SCHEDULER_TaskContext *tc)
685{ 686{
686 unsigned long long dl_parallel; 687 unsigned long long dl_parallel;
687 unsigned long long req_parallel; 688 unsigned long long req_parallel;
@@ -777,11 +778,17 @@ run (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
777 /* FIXME: should these '1's be here? Maybe better to put them into 778 /* FIXME: should these '1's be here? Maybe better to put them into
778 * default config files? 779 * default config files?
779 */ 780 */
780 if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_number (main_context.cfg, "gnunet-fs-gtk", 781 if (GNUNET_OK !=
781 "MAX_PARALLEL_DOWNLOADS", &dl_parallel)) 782 GNUNET_CONFIGURATION_get_value_number (main_context.cfg,
783 "gnunet-fs-gtk",
784 "MAX_PARALLEL_DOWNLOADS",
785 &dl_parallel))
782 dl_parallel = DEFAULT_MAX_PARALLEL_DOWNLOADS; 786 dl_parallel = DEFAULT_MAX_PARALLEL_DOWNLOADS;
783 if (GNUNET_OK != GNUNET_CONFIGURATION_get_value_number (main_context.cfg, "gnunet-fs-gtk", 787 if (GNUNET_OK !=
784 "MAX_PARALLEL_REQUESTS", &req_parallel)) 788 GNUNET_CONFIGURATION_get_value_number (main_context.cfg,
789 "gnunet-fs-gtk",
790 "MAX_PARALLEL_REQUESTS",
791 &req_parallel))
785 req_parallel = DEFAULT_MAX_PARALLEL_REQUESTS; 792 req_parallel = DEFAULT_MAX_PARALLEL_REQUESTS;
786 793
787 /* initialize file-sharing */ 794 /* initialize file-sharing */
@@ -798,8 +805,12 @@ run (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
798 GNUNET_GTK_main_loop_quit (cls); 805 GNUNET_GTK_main_loop_quit (cls);
799 return; 806 return;
800 } 807 }
801 arm = GNUNET_ARM_connect (main_context.cfg, &arm_connection_state_change, &main_context); 808 arm = GNUNET_ARM_connect (main_context.cfg,
802 armon = GNUNET_ARM_monitor (main_context.cfg, service_status_change, &main_context); 809 &arm_connection_state_change,
810 &main_context);
811 armon = GNUNET_ARM_monitor (main_context.cfg,
812 &service_status_change,
813 &main_context);
803 main_context.gns = GNUNET_GNS_connect (main_context.cfg); 814 main_context.gns = GNUNET_GNS_connect (main_context.cfg);
804 main_context.identity = GNUNET_IDENTITY_connect (main_context.cfg, NULL, NULL); 815 main_context.identity = GNUNET_IDENTITY_connect (main_context.cfg, NULL, NULL);
805 main_context.id_op = GNUNET_IDENTITY_get (main_context.identity, 816 main_context.id_op = GNUNET_IDENTITY_get (main_context.identity,
diff --git a/src/fs/gnunet-fs-gtk_download-save-as.c b/src/fs/gnunet-fs-gtk_download-save-as.c
index aeb932a5..66c1ed59 100644
--- a/src/fs/gnunet-fs-gtk_download-save-as.c
+++ b/src/fs/gnunet-fs-gtk_download-save-as.c
@@ -56,11 +56,11 @@ struct DownloadAsDialogContext
56 char *dirname; 56 char *dirname;
57 57
58 /** 58 /**
59 * Set to GNUNET_YES if pressing "Save" button should initiate the download 59 * Set to #GNUNET_YES if pressing "Save" button should initiate the download
60 * right away, set to GNUNET_NO if it should only change directory and file 60 * right away, set to #GNUNET_NO if it should only change directory and file
61 * names on the download panel. 61 * names on the download panel.
62 * Popup menu sets it to GNUNET_YES, download panel "Change name" button sets 62 * Popup menu sets it to #GNUNET_YES, download panel "Change name" button sets
63 * it to GNUNET_NO. 63 * it to #GNUNET_NO.
64 */ 64 */
65 int download_directly; 65 int download_directly;
66}; 66};
@@ -189,7 +189,9 @@ GNUNET_GTK_save_as_dialog_response_cb (GtkDialog * dialog,
189 else if (de->sr != NULL && de->sr->tab != NULL && de->sr->rr != NULL) 189 else if (de->sr != NULL && de->sr->tab != NULL && de->sr->rr != NULL)
190 { 190 {
191 /* Update download panel */ 191 /* Update download panel */
192 GNUNET_FS_GTK_set_item_downloaded_name (de->sr->tab->ts, de->sr->rr, de->filename); 192 GNUNET_FS_GTK_set_item_downloaded_name (de->sr->tab->ts,
193 de->sr->rr,
194 de->filename);
193 GNUNET_FS_GTK_free_download_entry (de); 195 GNUNET_FS_GTK_free_download_entry (de);
194 } 196 }
195 /* we were successful, do not remove the directory (if we created one) */ 197 /* we were successful, do not remove the directory (if we created one) */
@@ -198,7 +200,9 @@ GNUNET_GTK_save_as_dialog_response_cb (GtkDialog * dialog,
198 clean_up_download_as_context (dlc); 200 clean_up_download_as_context (dlc);
199} 201}
200 202
201/* FIXME: implement handling for corner cases: 203
204/*
205** FIXME: implement handling for corner cases:
202 * A) Selection changes in search tab while SaveAs dialog is open. 206 * A) Selection changes in search tab while SaveAs dialog is open.
203 * If it's in direct download mode, ignore that; otherwise destroy the dialog. 207 * If it's in direct download mode, ignore that; otherwise destroy the dialog.
204 * B) Download! is pressed in download panel (or the search result is otherwise 208 * B) Download! is pressed in download panel (or the search result is otherwise
@@ -280,6 +284,7 @@ open_saveas_dialog (struct DownloadEntry *de, int download_directly)
280 gtk_window_present (GTK_WINDOW (dlc->dialog)); 284 gtk_window_present (GTK_WINDOW (dlc->dialog));
281} 285}
282 286
287
283/** 288/**
284 * Open the 'save as' dialog for a download. Calls the 'dc->cb' 289 * Open the 'save as' dialog for a download. Calls the 'dc->cb'
285 * continutation when the dialog is complete. Will release the 'dc' 290 * continutation when the dialog is complete. Will release the 'dc'
@@ -294,6 +299,7 @@ GNUNET_FS_GTK_open_download_as_dialog (struct DownloadEntry *de)
294 open_saveas_dialog (de, GNUNET_YES); 299 open_saveas_dialog (de, GNUNET_YES);
295} 300}
296 301
302
297/** 303/**
298 * Open the 'save as' dialog for a download. Calls the 'dc->cb' 304 * Open the 'save as' dialog for a download. Calls the 'dc->cb'
299 * continutation when the dialog is complete. Will release the 'dc' 305 * continutation when the dialog is complete. Will release the 'dc'
diff --git a/src/fs/gnunet-fs-gtk_event-handler.c b/src/fs/gnunet-fs-gtk_event-handler.c
index 2bf54fdd..26577c42 100644
--- a/src/fs/gnunet-fs-gtk_event-handler.c
+++ b/src/fs/gnunet-fs-gtk_event-handler.c
@@ -2908,8 +2908,10 @@ static void
2908mark_download_progress (struct DownloadEntry *de, 2908mark_download_progress (struct DownloadEntry *de,
2909 const char *filename, 2909 const char *filename,
2910 uint64_t size, 2910 uint64_t size,
2911 uint64_t completed, const void *block_data, 2911 uint64_t completed,
2912 uint64_t offset, uint64_t block_size, 2912 const void *block_data,
2913 uint64_t offset,
2914 uint64_t block_size,
2913 unsigned int depth) 2915 unsigned int depth)
2914{ 2916{
2915 GtkTreeIter iter; 2917 GtkTreeIter iter;
@@ -2932,12 +2934,16 @@ mark_download_progress (struct DownloadEntry *de,
2932 a custom CellRenderer... */ 2934 a custom CellRenderer... */
2933 gtk_tree_store_set (de->sr->tab->ts, &iter, 2935 gtk_tree_store_set (de->sr->tab->ts, &iter,
2934 SEARCH_TAB_MC_PERCENT_PROGRESS, (guint) ((size > 0) ? (100 * completed / size) : 100), 2936 SEARCH_TAB_MC_PERCENT_PROGRESS, (guint) ((size > 0) ? (100 * completed / size) : 100),
2937 SEARCH_TAB_MC_PERCENT_AVAILABILITY, (guint) ((size > 0) ? (100 * completed / size) : 100),
2938 SEARCH_TAB_MC_UNKNOWN_AVAILABILITY, (completed ? -1 : 0),
2935 SEARCH_TAB_MC_COMPLETED, completed, 2939 SEARCH_TAB_MC_COMPLETED, completed,
2936 -1); 2940 -1);
2937 } 2941 }
2938 get_download_list_entry (de, &diter); 2942 get_download_list_entry (de, &diter);
2939 gtk_tree_store_set (downloads_treestore, &diter, 2943 gtk_tree_store_set (downloads_treestore, &diter,
2940 SEARCH_TAB_MC_PERCENT_PROGRESS, (guint) ((size > 0) ? (100 * completed / size) : 100), 2944 SEARCH_TAB_MC_PERCENT_PROGRESS, (guint) ((size > 0) ? (100 * completed / size) : 100),
2945 SEARCH_TAB_MC_PERCENT_AVAILABILITY, (guint) ((size > 0) ? (100 * completed / size) : 100),
2946 SEARCH_TAB_MC_UNKNOWN_AVAILABILITY, (completed ? -1 : 0),
2941 SEARCH_TAB_MC_COMPLETED, completed, 2947 SEARCH_TAB_MC_COMPLETED, completed,
2942 -1); 2948 -1);
2943 if (completed < size) 2949 if (completed < size)
@@ -3222,6 +3228,8 @@ setup_download (struct DownloadEntry *de,
3222 SEARCH_TAB_MC_PERCENT_PROGRESS, (guint) ((size > 0) ? (100 * completed / size) : 100), 3228 SEARCH_TAB_MC_PERCENT_PROGRESS, (guint) ((size > 0) ? (100 * completed / size) : 100),
3223 SEARCH_TAB_MC_FILENAME, filename, 3229 SEARCH_TAB_MC_FILENAME, filename,
3224 SEARCH_TAB_MC_STATUS_COLOUR, "blue", 3230 SEARCH_TAB_MC_STATUS_COLOUR, "blue",
3231 SEARCH_TAB_MC_PERCENT_AVAILABILITY, 0,
3232 SEARCH_TAB_MC_UNKNOWN_AVAILABILITY, -1,
3225 SEARCH_TAB_MC_SEARCH_RESULT, de->sr, 3233 SEARCH_TAB_MC_SEARCH_RESULT, de->sr,
3226 SEARCH_TAB_MC_COMPLETED, (guint64) completed, 3234 SEARCH_TAB_MC_COMPLETED, (guint64) completed,
3227 SEARCH_TAB_MC_DOWNLOADED_FILENAME, de->filename, 3235 SEARCH_TAB_MC_DOWNLOADED_FILENAME, de->filename,
@@ -3235,6 +3243,8 @@ setup_download (struct DownloadEntry *de,
3235 SEARCH_TAB_MC_FILENAME, filename, 3243 SEARCH_TAB_MC_FILENAME, filename,
3236 SEARCH_TAB_MC_STATUS_COLOUR, "blue", 3244 SEARCH_TAB_MC_STATUS_COLOUR, "blue",
3237 SEARCH_TAB_MC_SEARCH_RESULT, de->sr, 3245 SEARCH_TAB_MC_SEARCH_RESULT, de->sr,
3246 SEARCH_TAB_MC_PERCENT_AVAILABILITY, 0,
3247 SEARCH_TAB_MC_UNKNOWN_AVAILABILITY, -1,
3238 SEARCH_TAB_MC_COMPLETED, (guint64) completed, 3248 SEARCH_TAB_MC_COMPLETED, (guint64) completed,
3239 SEARCH_TAB_MC_DOWNLOADED_FILENAME, de->filename, 3249 SEARCH_TAB_MC_DOWNLOADED_FILENAME, de->filename,
3240 SEARCH_TAB_MC_DOWNLOADED_ANONYMITY, de->anonymity, 3250 SEARCH_TAB_MC_DOWNLOADED_ANONYMITY, de->anonymity,
diff --git a/src/fs/gnunet-fs-gtk_main-window-view-toggles.c b/src/fs/gnunet-fs-gtk_main-window-view-toggles.c
index f8e1b9c3..ea24ed96 100644
--- a/src/fs/gnunet-fs-gtk_main-window-view-toggles.c
+++ b/src/fs/gnunet-fs-gtk_main-window-view-toggles.c
@@ -119,4 +119,5 @@ GNUNET_GTK_main_menu_view_search_toggled_cb (GtkWidget * dummy,
119 "GNUNET_GTK_main_menu_search_preview"); 119 "GNUNET_GTK_main_menu_search_preview");
120} 120}
121 121
122
122/* end of gnunet-fs-gtk_main-window-view-toggles.c */ 123/* end of gnunet-fs-gtk_main-window-view-toggles.c */