From b701513bdeeea31e2b090fa5f8bb7b5b89c14aca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Jard=C3=B3n?= Date: Wed, 29 Jun 2011 16:43:38 +0100 Subject: Show the power statistics when click on the device menu item --- src/indicator-power.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src') diff --git a/src/indicator-power.c b/src/indicator-power.c index 697f7c6..dedac92 100644 --- a/src/indicator-power.c +++ b/src/indicator-power.c @@ -328,6 +328,18 @@ service_proxy_cb (GObject *object, user_data); } +static void +show_info_cb (GtkMenuItem *item, + gpointer data) +{ + /*TODO: show the statistics of the specific device*/ + const gchar *command = "gnome-power-statistics"; + + if (g_spawn_command_line_async (command, NULL) == FALSE) + g_warning ("Couldn't execute command: %s", command); +} + + static void show_preferences_cb (GtkMenuItem *item, gpointer data) @@ -350,6 +362,8 @@ build_menu (IndicatorPower *self) item = gtk_image_menu_item_new_from_stock ("battery", NULL); gtk_menu_item_set_label (GTK_MENU_ITEM (item), "Battery Remaining: 0:45s"); /*TODO*/ + g_signal_connect (G_OBJECT (item), "activate", + G_CALLBACK (show_info_cb), NULL); gtk_menu_shell_append (GTK_MENU_SHELL (priv->menu), item); /* only do the seporator if we have at least one device */ -- cgit v1.2.3