aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJavier Jardón <javier.jardon@codethink.co.uk>2011-06-29 16:43:38 +0100
committerJavier Jardón <javier.jardon@codethink.co.uk>2011-06-29 16:43:38 +0100
commitb701513bdeeea31e2b090fa5f8bb7b5b89c14aca (patch)
treee4f962bafb7b1ecedf1a0907610c843a4a9904ce /src
parentb1d0f0e0a01b958f179845bac8b43ba742961ab6 (diff)
downloadayatana-indicator-power-b701513bdeeea31e2b090fa5f8bb7b5b89c14aca.tar.gz
ayatana-indicator-power-b701513bdeeea31e2b090fa5f8bb7b5b89c14aca.tar.bz2
ayatana-indicator-power-b701513bdeeea31e2b090fa5f8bb7b5b89c14aca.zip
Show the power statistics when click on the device menu item
Diffstat (limited to 'src')
-rw-r--r--src/indicator-power.c14
1 files changed, 14 insertions, 0 deletions
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
@@ -329,6 +329,18 @@ service_proxy_cb (GObject *object,
}
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 */