diff options
Diffstat (limited to 'src/fs/gnunet-fs-gtk.c')
-rw-r--r-- | src/fs/gnunet-fs-gtk.c | 42 |
1 files changed, 14 insertions, 28 deletions
diff --git a/src/fs/gnunet-fs-gtk.c b/src/fs/gnunet-fs-gtk.c index 0c359d3c..48c8bdab 100644 --- a/src/fs/gnunet-fs-gtk.c +++ b/src/fs/gnunet-fs-gtk.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of GNUnet. | 2 | This file is part of GNUnet. |
3 | (C) 2010 Christian Grothoff (and other contributing authors) | 3 | (C) 2010, 2012 Christian Grothoff (and other contributing authors) |
4 | 4 | ||
5 | GNUnet is free software; you can redistribute it and/or modify | 5 | GNUnet is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published | 6 | it under the terms of the GNU General Public License as published |
@@ -54,8 +54,11 @@ GNUNET_FS_GTK_get_fs_handle () | |||
54 | return fs; | 54 | return fs; |
55 | } | 55 | } |
56 | 56 | ||
57 | |||
57 | /** | 58 | /** |
58 | * Get cfg. | 59 | * Get our configuration. |
60 | * | ||
61 | * @return configuration handle | ||
59 | */ | 62 | */ |
60 | const struct GNUNET_CONFIGURATION_Handle * | 63 | const struct GNUNET_CONFIGURATION_Handle * |
61 | GNUNET_FS_GTK_get_configuration (void) | 64 | GNUNET_FS_GTK_get_configuration (void) |
@@ -98,6 +101,9 @@ shutdown_task (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
98 | 101 | ||
99 | /** | 102 | /** |
100 | * Callback invoked if the application is supposed to exit. | 103 | * Callback invoked if the application is supposed to exit. |
104 | * | ||
105 | * @param object origin of the quit event, unused | ||
106 | * @param user_data global builder instance, unused | ||
101 | */ | 107 | */ |
102 | void | 108 | void |
103 | GNUNET_GTK_quit_cb (GObject * object, gpointer user_data) | 109 | GNUNET_GTK_quit_cb (GObject * object, gpointer user_data) |
@@ -111,6 +117,9 @@ GNUNET_GTK_quit_cb (GObject * object, gpointer user_data) | |||
111 | /** | 117 | /** |
112 | * Actual main function run right after GNUnet's scheduler | 118 | * Actual main function run right after GNUnet's scheduler |
113 | * is initialized. Initializes up GTK and Glade. | 119 | * is initialized. Initializes up GTK and Glade. |
120 | * | ||
121 | * @param cls handle to the main loop ('struct GNUNET_GTK_MainLoop') | ||
122 | * @param tc scheduler context, unused | ||
114 | */ | 123 | */ |
115 | static void | 124 | static void |
116 | run (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 125 | run (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
@@ -139,39 +148,16 @@ run (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
139 | GNUNET_GTK_tray_icon_create (GTK_WINDOW (main_window), | 148 | GNUNET_GTK_tray_icon_create (GTK_WINDOW (main_window), |
140 | "gnunet-gtk" /* FIXME: rename icon? */ , | 149 | "gnunet-gtk" /* FIXME: rename icon? */ , |
141 | "gnunet-fs-gtk"); | 150 | "gnunet-fs-gtk"); |
142 | |||
143 | /* initialize file-sharing */ | 151 | /* initialize file-sharing */ |
144 | fs = GNUNET_FS_start (GNUNET_GTK_main_loop_get_configuration (ml), | 152 | fs = GNUNET_FS_start (GNUNET_GTK_main_loop_get_configuration (ml), |
145 | "gnunet-gtk", &GNUNET_GTK_fs_event_handler, NULL, | 153 | "gnunet-gtk", &GNUNET_GTK_fs_event_handler, NULL, |
146 | GNUNET_FS_FLAGS_NONE /* | GNUNET_FS_FLAGS_PERSISTENCE | | 154 | GNUNET_FS_FLAGS_NONE /* | GNUNET_FS_FLAGS_PERSISTENCE | |
147 | * GNUNET_FS_FLAGS_DO_PROBES */ , | 155 | * GNUNET_FS_FLAGS_DO_PROBES */ , |
148 | GNUNET_FS_OPTIONS_END); | 156 | GNUNET_FS_OPTIONS_END); |
149 | if (fs != NULL) | 157 | if (NULL == fs) |
150 | { | ||
151 | /* Searches are now started from the search bar */ | ||
152 | /* add_new_tab (); */ | ||
153 | } | ||
154 | else | ||
155 | { | 158 | { |
156 | gtk_widget_hide (GTK_WIDGET | 159 | GNUNET_GTK_main_loop_quit (ml); |
157 | (GNUNET_FS_GTK_get_main_window_object | 160 | return; |
158 | ("GNUNET_GTK_main_menu_file_create_pseudonym"))); | ||
159 | gtk_widget_hide (GTK_WIDGET | ||
160 | (GNUNET_FS_GTK_get_main_window_object | ||
161 | ("GNUNET_GTK_main_menu_file_advertise_pseudonym"))); | ||
162 | gtk_widget_hide (GTK_WIDGET | ||
163 | (GNUNET_FS_GTK_get_main_window_object | ||
164 | ("GNUNET_GTK_main_menu_file_publish"))); | ||
165 | gtk_widget_hide (GTK_WIDGET | ||
166 | (GNUNET_FS_GTK_get_main_window_object | ||
167 | ("GNUNET_GTK_main_menu_file_search"))); | ||
168 | gtk_widget_hide (GTK_WIDGET | ||
169 | (GNUNET_FS_GTK_get_main_window_object | ||
170 | ("GNUNET_GTK_main_menu_file_download_uri"))); | ||
171 | gtk_widget_hide (GTK_WIDGET | ||
172 | (GNUNET_FS_GTK_get_main_window_object | ||
173 | ("GNUNET_GTK_main_menu_file_open_gnunet_directory"))); | ||
174 | /* FIXME: set warning in status bar... */ | ||
175 | } | 161 | } |
176 | /* make GUI visible */ | 162 | /* make GUI visible */ |
177 | if (!tray_only) | 163 | if (!tray_only) |