From b61274ad2c3624b8133d201f9b224c980eb7d79c Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Wed, 12 Nov 2008 16:46:46 -0600 Subject: Connecting in all the different applets, now they can do their own thing. --- src/applet-main.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src') 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 +#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; } -- cgit v1.2.3