aboutsummaryrefslogtreecommitdiff
path: root/src/applet-main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/applet-main.c')
-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;
}