[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r30411 - in gnunet-gtk/src: fs identity main namestore peer
From: |
gnunet |
Subject: |
[GNUnet-SVN] r30411 - in gnunet-gtk/src: fs identity main namestore peerinfo statistics |
Date: |
Fri, 25 Oct 2013 17:16:16 +0200 |
Author: grothoff
Date: 2013-10-25 17:16:16 +0200 (Fri, 25 Oct 2013)
New Revision: 30411
Modified:
gnunet-gtk/src/fs/gnunet-fs-gtk.c
gnunet-gtk/src/identity/gnunet-identity-gtk.c
gnunet-gtk/src/main/gnunet-gtk.c
gnunet-gtk/src/namestore/gnunet-namestore-gtk.c
gnunet-gtk/src/peerinfo/gnunet-peerinfo-gtk.c
gnunet-gtk/src/statistics/gnunet-statistics-gtk.c
Log:
-do not show tray icons if embedded
Modified: gnunet-gtk/src/fs/gnunet-fs-gtk.c
===================================================================
--- gnunet-gtk/src/fs/gnunet-fs-gtk.c 2013-10-25 14:55:35 UTC (rev 30410)
+++ gnunet-gtk/src/fs/gnunet-fs-gtk.c 2013-10-25 15:16:16 UTC (rev 30411)
@@ -721,7 +721,8 @@
/* setup main window */
maximized = GNUNET_CONFIGURATION_get_value_yesno (main_context.cfg,
- "gnunet-fs-gtk",
"MAIN_WINDOW_MAXIMIZED");
+ "gnunet-fs-gtk",
+ "MAIN_WINDOW_MAXIMIZED");
if (GNUNET_SYSERR == maximized)
maximized = GNUNET_YES;
if ( (GNUNET_NO == maximized) &&
@@ -747,12 +748,12 @@
/* FIXME-GTK3: this can be done within (modern versions of) glade */
gtk_tree_selection_set_mode (gtk_tree_view_get_selection
(main_context.md_treeview),
GTK_SELECTION_MULTIPLE);
+ if (NULL == getenv ("GNUNET_FS_GTK_PLUG"))
+ GNUNET_GTK_tray_icon_create (ml,
+ GTK_WINDOW (main_context.main_window),
+ "gnunet-fs-gtk",
+ "gnunet-fs-gtk");
- GNUNET_GTK_tray_icon_create (ml,
- GTK_WINDOW (main_context.main_window),
- "gnunet-fs-gtk",
- "gnunet-fs-gtk");
-
/* FIXME: should these '1's be here? Maybe better to put them into
* default config files?
*/
Modified: gnunet-gtk/src/identity/gnunet-identity-gtk.c
===================================================================
--- gnunet-gtk/src/identity/gnunet-identity-gtk.c 2013-10-25 14:55:35 UTC
(rev 30410)
+++ gnunet-gtk/src/identity/gnunet-identity-gtk.c 2013-10-25 15:16:16 UTC
(rev 30411)
@@ -521,10 +521,11 @@
-1);
gtk_window_maximize (GTK_WINDOW (main_window));
- GNUNET_GTK_tray_icon_create (ml,
- GTK_WINDOW (main_window),
- "gnunet-gtk" /* FIXME: different icon? */ ,
- "gnunet-identity-gtk");
+ if (NULL == getenv ("GNUNET_IDENTITY_GTK_PLUG"))
+ GNUNET_GTK_tray_icon_create (ml,
+ GTK_WINDOW (main_window),
+ "gnunet-gtk" /* FIXME: different icon? */ ,
+ "gnunet-identity-gtk");
/* make GUI visible */
if (!tray_only)
Modified: gnunet-gtk/src/main/gnunet-gtk.c
===================================================================
--- gnunet-gtk/src/main/gnunet-gtk.c 2013-10-25 14:55:35 UTC (rev 30410)
+++ gnunet-gtk/src/main/gnunet-gtk.c 2013-10-25 15:16:16 UTC (rev 30411)
@@ -29,6 +29,38 @@
#endif
/**
+ * Handle for a plugged in process.
+ */
+struct Plug
+{
+
+ struct Plug *prev;
+
+ struct Plug *next;
+
+ /**
+ * The socket.
+ */
+ GtkWidget *s;
+
+ /**
+ * Name of the binary.
+ */
+ const char *binary;
+
+ /**
+ * Environment variable we set.
+ */
+ const char *env_var;
+
+ /**
+ * Handle to the child process.
+ */
+ struct GNUNET_OS_Process *proc;
+};
+
+
+/**
* Main loop handle.
*/
static struct GNUNET_GTK_MainLoop *ml;
@@ -43,8 +75,18 @@
*/
static int gret;
+/**
+ * Head of plugs.
+ */
+static struct Plug *p_head;
/**
+ * Tail of plugs.
+ */
+static struct Plug *p_tail;
+
+
+/**
* Get an object from the main window.
*
* @param name name of the object
@@ -69,6 +111,20 @@
cleanup_task (void *cls,
const struct GNUNET_SCHEDULER_TaskContext *tc)
{
+ struct Plug *p;
+
+ while (NULL != (p = p_head))
+ {
+ (void) GNUNET_OS_process_kill (p->proc, SIGTERM);
+ GNUNET_break (GNUNET_OK ==
+ GNUNET_OS_process_wait (p->proc));
+ GNUNET_OS_process_destroy (p->proc);
+ p->proc = NULL;
+ GNUNET_CONTAINER_DLL_remove (p_head,
+ p_tail,
+ p);
+ GNUNET_free (p);
+ }
if (NULL == ml)
{
GNUNET_break (0);
@@ -91,33 +147,6 @@
#if HAVE_GTK_GTKX_H
/**
- * Handle for a plugged in process.
- */
-struct Plug
-{
- /**
- * The socket.
- */
- GtkWidget *s;
-
- /**
- * Name of the binary.
- */
- const char *binary;
-
- /**
- * Environment variable we set.
- */
- const char *env_var;
-
- /**
- * Handle to the child process.
- */
- struct GNUNET_OS_Process *proc;
-};
-
-
-/**
* Start the child process for the plug.
*
* @param p plug identification
@@ -165,29 +194,6 @@
/**
- * The socket widget is being deleted, clean up child process.
- *
- * @param sock the widget
- * @param userdata our `struct Plug *`
- * @return FALSE (continue event processing)
- */
-static gboolean
-handle_delete (GtkSocket *sock,
- gpointer userdata)
-{
- struct Plug *p = userdata;
-
- (void) GNUNET_OS_process_kill (p->proc, SIGTERM);
- GNUNET_break (GNUNET_OK ==
- GNUNET_OS_process_wait (p->proc));
- GNUNET_OS_process_destroy (p->proc);
- p->proc = NULL;
- GNUNET_free (p);
- return FALSE;
-}
-
-
-/**
* Embed process in our GUI.
*
* @param container where to embed
@@ -214,12 +220,11 @@
"plug-removed",
G_CALLBACK (handle_remove),
p);
- g_signal_connect (p->s,
- "delete-event",
- G_CALLBACK (handle_delete),
- p);
start_process (p);
gtk_widget_show (p->s);
+ GNUNET_CONTAINER_DLL_insert (p_head,
+ p_tail,
+ p);
}
#endif
@@ -240,6 +245,8 @@
cfg = GNUNET_GTK_main_loop_get_configuration (ml);
if (GNUNET_OK != GNUNET_GTK_main_loop_build_window (ml, NULL))
return;
+ GNUNET_GTK_set_icon_search_path ();
+ GNUNET_GTK_setup_nls ();
main_window = GTK_WIDGET (get_object ("gnunet_gtk_window"));
GNUNET_SCHEDULER_add_delayed (GNUNET_TIME_UNIT_FOREVER_REL,
&cleanup_task, NULL);
@@ -259,10 +266,16 @@
plug ("gnunet_identity_hbox",
"gnunet-identity-gtk",
"GNUNET_IDENTITY_GTK_PLUG");
+#if 0
plug ("gnunet_setup_hbox",
"gnunet-setup",
"GNUNET_SETUP_PLUG");
#endif
+#endif
+ GNUNET_GTK_tray_icon_create (ml,
+ GTK_WINDOW (main_window),
+ "gnunet-fs-gtk",
+ "gnunet-gtk");
gtk_widget_show (main_window);
gtk_window_present (GTK_WINDOW (main_window));
}
Modified: gnunet-gtk/src/namestore/gnunet-namestore-gtk.c
===================================================================
--- gnunet-gtk/src/namestore/gnunet-namestore-gtk.c 2013-10-25 14:55:35 UTC
(rev 30410)
+++ gnunet-gtk/src/namestore/gnunet-namestore-gtk.c 2013-10-25 15:16:16 UTC
(rev 30411)
@@ -2173,7 +2173,6 @@
ml);
return;
}
- GNUNET_assert (NULL != name);
rr = *ctx;
if (NULL == rr)
{
@@ -2201,7 +2200,7 @@
&iter,
path));
gtk_tree_path_free (path);
- if (NULL == ego)
+ if (NULL == name)
{
/* zone was removed, remove from list */
gtk_list_store_remove (zone_liststore,
@@ -2233,6 +2232,8 @@
cfg = GNUNET_GTK_main_loop_get_configuration (ml);
if (GNUNET_OK != GNUNET_GTK_main_loop_build_window (ml, NULL))
return;
+ GNUNET_GTK_set_icon_search_path ();
+ GNUNET_GTK_setup_nls ();
main_window = GTK_WIDGET (get_object ("gnunet_namestore_gtk_dialog"));
main_window = GNUNET_GTK_plug_me ("GNUNET_NAMESTORE_GTK_PLUG",
Modified: gnunet-gtk/src/peerinfo/gnunet-peerinfo-gtk.c
===================================================================
--- gnunet-gtk/src/peerinfo/gnunet-peerinfo-gtk.c 2013-10-25 14:55:35 UTC
(rev 30410)
+++ gnunet-gtk/src/peerinfo/gnunet-peerinfo-gtk.c 2013-10-25 15:16:16 UTC
(rev 30411)
@@ -669,10 +669,11 @@
ls = GTK_LIST_STORE (get_object ("GNUNET_PEERINFO_GTK_list_store"));
GNUNET_assert (NULL != ls);
gtk_window_maximize (GTK_WINDOW (main_window));
- GNUNET_GTK_tray_icon_create (ml,
- GTK_WINDOW (main_window),
- "gnunet-gtk" /* FIXME: different icon? */ ,
- "gnunet-peerinfo-gtk");
+ if (NULL == getenv ("GNUNET_PEERINFO_GTK_PLUG"))
+ GNUNET_GTK_tray_icon_create (ml,
+ GTK_WINDOW (main_window),
+ "gnunet-gtk" /* FIXME: different icon? */ ,
+ "gnunet-peerinfo-gtk");
#if HAVE_LIBUNIQUE
unique_app_watch_window (unique_app, GTK_WINDOW (main_window));
Modified: gnunet-gtk/src/statistics/gnunet-statistics-gtk.c
===================================================================
--- gnunet-gtk/src/statistics/gnunet-statistics-gtk.c 2013-10-25 14:55:35 UTC
(rev 30410)
+++ gnunet-gtk/src/statistics/gnunet-statistics-gtk.c 2013-10-25 15:16:16 UTC
(rev 30411)
@@ -264,10 +264,11 @@
main_window = GNUNET_GTK_plug_me ("GNUNET_STATISTICS_GTK_PLUG",
main_window);
gtk_window_maximize (GTK_WINDOW (main_window));
- GNUNET_GTK_tray_icon_create (ml,
- GTK_WINDOW (main_window),
- "gnunet-gtk" /* FIXME: different icon? */ ,
- "gnunet-statistics-gtk");
+ if (NULL == getenv ("GNUNET_STATISTICS_GTK_PLUG"))
+ GNUNET_GTK_tray_icon_create (ml,
+ GTK_WINDOW (main_window),
+ "gnunet-gtk" /* FIXME: different icon? */ ,
+ "gnunet-statistics-gtk");
create_plot ("GNUNET_STATISTICS_GTK_connectivity_box", connection_data);
create_plot ("GNUNET_STATISTICS_GTK_traffic_box", traffic_data);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r30411 - in gnunet-gtk/src: fs identity main namestore peerinfo statistics,
gnunet <=