diff options
Diffstat (limited to 'src/statistics/gnunet-statistics-gtk.c')
-rw-r--r-- | src/statistics/gnunet-statistics-gtk.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/statistics/gnunet-statistics-gtk.c b/src/statistics/gnunet-statistics-gtk.c index df42e978..cac4452f 100644 --- a/src/statistics/gnunet-statistics-gtk.c +++ b/src/statistics/gnunet-statistics-gtk.c | |||
@@ -30,6 +30,8 @@ | |||
30 | #include <cairo.h> | 30 | #include <cairo.h> |
31 | #include "gtk_statistics.h" | 31 | #include "gtk_statistics.h" |
32 | 32 | ||
33 | #include <gtk/gtkx.h> | ||
34 | |||
33 | #define MAX_HISTORY 1280 | 35 | #define MAX_HISTORY 1280 |
34 | 36 | ||
35 | 37 | ||
@@ -239,6 +241,7 @@ static void | |||
239 | run (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | 241 | run (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) |
240 | { | 242 | { |
241 | GtkWidget *main_window; | 243 | GtkWidget *main_window; |
244 | char *plugid; | ||
242 | 245 | ||
243 | ml = cls; | 246 | ml = cls; |
244 | 247 | ||
@@ -261,6 +264,24 @@ run (void *cls, const struct GNUNET_SCHEDULER_TaskContext *tc) | |||
261 | 264 | ||
262 | /* setup main window */ | 265 | /* setup main window */ |
263 | main_window = GTK_WIDGET (get_object ("GNUNET_STATISTICS_GTK_main_window")); | 266 | main_window = GTK_WIDGET (get_object ("GNUNET_STATISTICS_GTK_main_window")); |
267 | if (NULL != (plugid = getenv ("GNUNET_STATISTICS_GTK_PLUG"))) | ||
268 | { | ||
269 | GtkWidget *plug; | ||
270 | GtkWidget *child; | ||
271 | unsigned long long id; | ||
272 | |||
273 | if (1 == sscanf (plugid, | ||
274 | "%llu", | ||
275 | &id)) | ||
276 | { | ||
277 | plug = gtk_plug_new ((Window) id); | ||
278 | child = gtk_bin_get_child (GTK_BIN (main_window)); | ||
279 | gtk_widget_reparent (child, | ||
280 | plug); | ||
281 | gtk_widget_destroy (main_window); | ||
282 | main_window = plug; | ||
283 | } | ||
284 | } | ||
264 | gtk_window_maximize (GTK_WINDOW (main_window)); | 285 | gtk_window_maximize (GTK_WINDOW (main_window)); |
265 | GNUNET_GTK_tray_icon_create (ml, | 286 | GNUNET_GTK_tray_icon_create (ml, |
266 | GTK_WINDOW (main_window), | 287 | GTK_WINDOW (main_window), |