aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@canonical.com>2008-11-12 16:46:46 -0600
committerTed Gould <ted@canonical.com>2008-11-12 16:46:46 -0600
commitb61274ad2c3624b8133d201f9b224c980eb7d79c (patch)
tree1092cfdc1b3e2f7bc1884e4d398030af29fbfb98
parent6a2c99b70e71d1d405df2edc8eac27f882e03e2e (diff)
downloadlibayatana-indicator-b61274ad2c3624b8133d201f9b224c980eb7d79c.tar.gz
libayatana-indicator-b61274ad2c3624b8133d201f9b224c980eb7d79c.tar.bz2
libayatana-indicator-b61274ad2c3624b8133d201f9b224c980eb7d79c.zip
Connecting in all the different applets, now they can do their own thing.
-rw-r--r--src/applet-main.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/applet-main.c b/src/applet-main.c
index dc24c75..690c7ed 100644
--- a/src/applet-main.c
+++ b/src/applet-main.c
@@ -1,6 +1,11 @@
#include <panel-applet.h>
+#include "indicator-audio.h"
+#include "indicator-messages.h"
+#include "indicator-network.h"
+#include "indicator-power.h"
+#include "indicator-system.h"
static gboolean applet_fill_cb (PanelApplet * applet, const gchar * iid, gpointer data);
@@ -14,6 +19,17 @@ PANEL_APPLET_BONOBO_FACTORY ("OAFIID:GNOME_IndicatorApplet_Factory",
"indicator-applet", "0",
applet_fill_cb, NULL);
+typedef GtkWidget * (*menuitem_func) (void);
+
+menuitem_func indicators[] = {
+ indicator_audio_menuitem,
+ indicator_messages_menuitem,
+ indicator_network_menuitem,
+ indicator_power_menuitem,
+ indicator_system_menuitem,
+ NULL
+};
+
/*************
* init function
* ***********/
@@ -21,6 +37,7 @@ PANEL_APPLET_BONOBO_FACTORY ("OAFIID:GNOME_IndicatorApplet_Factory",
static gboolean
applet_fill_cb (PanelApplet * applet, const gchar * iid, gpointer data)
{
+ int i;
GtkWidget * menubar = gtk_menu_bar_new();
gtk_widget_set_name (menubar, "indicator-applet-menubar");
gtk_container_add(GTK_CONTAINER(applet), menubar);
@@ -30,6 +47,13 @@ applet_fill_cb (PanelApplet * applet, const gchar * iid, gpointer data)
gtk_menu_shell_append(GTK_MENU_SHELL(menubar), item);
gtk_widget_show(item);
+ for (i = 0; indicators[i] != NULL; i++) {
+ GtkWidget * item = indicators[i]();
+ if (item == NULL) continue;
+ gtk_menu_shell_append(GTK_MENU_SHELL(menubar), item);
+ gtk_widget_show(item);
+ }
+
gtk_widget_show(GTK_WIDGET(applet));
return TRUE;
}