aboutsummaryrefslogtreecommitdiff
path: root/src/fs/gnunet-fs-gtk.c
diff options
context:
space:
mode:
authorLRN <lrn1986@gmail.com>2012-11-12 15:57:32 +0000
committerLRN <lrn1986@gmail.com>2012-11-12 15:57:32 +0000
commitf83763e1fd3082128e22a407fb4255c35487d747 (patch)
treec64f23fa67ad366ca0efe83374024ba9804222c9 /src/fs/gnunet-fs-gtk.c
parent0c8188c23093de4946d4a65d51baf4d0e705004a (diff)
downloadgnunet-gtk-f83763e1fd3082128e22a407fb4255c35487d747.tar.gz
gnunet-gtk-f83763e1fd3082128e22a407fb4255c35487d747.zip
Lots of stuff
1) A couple of docfixes 2) More widgets in main window context 3) Main window context is easily gettable from a static variable (2) and (3) fix a crash where widgets are being fetched via "ml" pointer when it's already freed. Main window context lives longer. 4) New download panel This takes most of the new code. Specifically, it gets its own filename suggestion routine. 5) Fix for step-by-step manual directory trees' download (sets de->pde for such cases; without that children can't be properly linked to parents for things like cleanup)
Diffstat (limited to 'src/fs/gnunet-fs-gtk.c')
-rw-r--r--src/fs/gnunet-fs-gtk.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/fs/gnunet-fs-gtk.c b/src/fs/gnunet-fs-gtk.c
index 14765fd2..b88aba49 100644
--- a/src/fs/gnunet-fs-gtk.c
+++ b/src/fs/gnunet-fs-gtk.c
@@ -58,11 +58,22 @@ static struct GNUNET_GTK_MainLoop *ml;
58 */ 58 */
59static struct GNUNET_FS_Handle *fs; 59static struct GNUNET_FS_Handle *fs;
60 60
61/**
62 * Context for main window.
63 */
64static struct GNUNET_GTK_MainWindowContext main_context;
65
61 66
62#if HAVE_LIBUNIQUE 67#if HAVE_LIBUNIQUE
63static UniqueApp *unique_app; 68static UniqueApp *unique_app;
64#endif 69#endif
65 70
71struct GNUNET_GTK_MainWindowContext *
72GNUNET_FS_GTK_get_main_context ()
73{
74 return &main_context;
75}
76
66 77
67/** 78/**
68 * Return handle for file-sharing operations. 79 * Return handle for file-sharing operations.
@@ -373,7 +384,6 @@ run (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
373 unsigned long long window_width; 384 unsigned long long window_width;
374 unsigned long long window_height; 385 unsigned long long window_height;
375 int maximized; 386 int maximized;
376 static struct GNUNET_GTK_MainWindowContext main_context;
377 387
378 ml = cls; 388 ml = cls;
379 /* setup main context */ 389 /* setup main context */
@@ -398,6 +408,15 @@ run (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc)
398 main_context.md_treeview = GTK_TREE_VIEW (GNUNET_FS_GTK_get_main_window_object ("GNUNET_GTK_main_window_metadata_treeview")); 408 main_context.md_treeview = GTK_TREE_VIEW (GNUNET_FS_GTK_get_main_window_object ("GNUNET_GTK_main_window_metadata_treeview"));
399 main_context.ns_callback_registered = GNUNET_NO; 409 main_context.ns_callback_registered = GNUNET_NO;
400 410
411 main_context.download_location_chooser = GTK_FILE_CHOOSER (GNUNET_FS_GTK_get_main_window_object ("GNUNET_GTK_search_frame_download_location_chooser"));
412 main_context.download_name_entry = GTK_ENTRY (GNUNET_FS_GTK_get_main_window_object ("GNUNET_GTK_search_frame_download_filename_entry"));
413 main_context.download_anonymity_combo = GTK_COMBO_BOX (GNUNET_FS_GTK_get_main_window_object ("main_window_download_anonymity_combobox"));
414 main_context.download_recursive_checkbutton = GTK_CHECK_BUTTON (GNUNET_FS_GTK_get_main_window_object ("GNUNET_GTK_search_frame_download_recursive_checkbox"));
415 main_context.download_download_button = GTK_BUTTON (GNUNET_FS_GTK_get_main_window_object ("GNUNET_GTK_search_frame_download_download_hbox"));
416 main_context.download_panel = GTK_VBOX (GNUNET_FS_GTK_get_main_window_object ("GNUNET_GTK_search_frame_download_vbox"));
417
418 main_context.notebook = GTK_NOTEBOOK (GNUNET_FS_GTK_get_main_window_object ("GNUNET_GTK_main_window_notebook"));
419
401 GNUNET_GTK_set_icon_search_path (); 420 GNUNET_GTK_set_icon_search_path ();
402 GNUNET_GTK_setup_nls (); 421 GNUNET_GTK_setup_nls ();
403 422