diff options
Diffstat (limited to 'src/common/helper.c')
-rw-r--r-- | src/common/helper.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/common/helper.c b/src/common/helper.c index c7f11680..52dfefe3 100644 --- a/src/common/helper.c +++ b/src/common/helper.c | |||
@@ -26,6 +26,7 @@ | |||
26 | 26 | ||
27 | #include "platform.h" | 27 | #include "platform.h" |
28 | #include "gnunetgtk_common.h" | 28 | #include "gnunetgtk_common.h" |
29 | #include "../core/eggtrayicon.h" | ||
29 | #include <GNUnet/gnunet_util_crypto.h> | 30 | #include <GNUnet/gnunet_util_crypto.h> |
30 | #include <GNUnet/gnunet_util_cron.h> | 31 | #include <GNUnet/gnunet_util_cron.h> |
31 | #include <glib.h> | 32 | #include <glib.h> |
@@ -64,6 +65,10 @@ typedef struct Plugin | |||
64 | 65 | ||
65 | static GladeXML *mainXML; | 66 | static GladeXML *mainXML; |
66 | 67 | ||
68 | #if GTK_CHECK_VERSION(2,10,0) | ||
69 | static GtkStatusIcon *trayIcon; | ||
70 | #endif | ||
71 | |||
67 | static char *gladeFile; | 72 | static char *gladeFile; |
68 | 73 | ||
69 | static GdkWindowState main_window_state; | 74 | static GdkWindowState main_window_state; |
@@ -178,6 +183,17 @@ GNUNET_GTK_get_main_glade_XML () | |||
178 | return mainXML; | 183 | return mainXML; |
179 | } | 184 | } |
180 | 185 | ||
186 | /** | ||
187 | * Simple accessor method. | ||
188 | */ | ||
189 | #if GTK_CHECK_VERSION(2,10,0) | ||
190 | GtkStatusIcon * | ||
191 | GNUNET_GTK_get_trayIcon () | ||
192 | { | ||
193 | return trayIcon; | ||
194 | } | ||
195 | #endif | ||
196 | |||
181 | static void | 197 | static void |
182 | connector (const gchar * handler_name, | 198 | connector (const gchar * handler_name, |
183 | GObject * object, | 199 | GObject * object, |
@@ -343,6 +359,10 @@ GNUNET_GTK_initialize_common_library (struct GNUNET_GE_Context *e, | |||
343 | GNUNET_GE_FATAL | GNUNET_GE_USER | | 359 | GNUNET_GE_FATAL | GNUNET_GE_USER | |
344 | GNUNET_GE_IMMEDIATE, "glade_xml_new", | 360 | GNUNET_GE_IMMEDIATE, "glade_xml_new", |
345 | gladeFile); | 361 | gladeFile); |
362 | #if GTK_CHECK_VERSION (2,10,0) | ||
363 | trayIcon = gtk_status_icon_new (); | ||
364 | #endif | ||
365 | initTrayIcon (); | ||
346 | /* load the plugins */ | 366 | /* load the plugins */ |
347 | GNUNET_GC_get_configuration_value_string (cfg, | 367 | GNUNET_GC_get_configuration_value_string (cfg, |
348 | "GNUNET-GTK", | 368 | "GNUNET-GTK", |