aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJavier Jardón <javier.jardon@codethink.co.uk>2011-06-29 17:11:40 +0100
committerJavier Jardón <javier.jardon@codethink.co.uk>2011-06-29 17:11:40 +0100
commitd049d2fc573a417b559e11cc1bc83d121b7efe9a (patch)
tree020eeb0058547d1e68717c8221da1f836a05eeb6 /src
parentb701513bdeeea31e2b090fa5f8bb7b5b89c14aca (diff)
downloadayatana-indicator-power-d049d2fc573a417b559e11cc1bc83d121b7efe9a.tar.gz
ayatana-indicator-power-d049d2fc573a417b559e11cc1bc83d121b7efe9a.tar.bz2
ayatana-indicator-power-d049d2fc573a417b559e11cc1bc83d121b7efe9a.zip
Add options to the indicator menu
As discussed: - Icon only - Time remaining
Diffstat (limited to 'src')
-rw-r--r--src/indicator-power.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/indicator-power.c b/src/indicator-power.c
index dedac92..299a1a8 100644
--- a/src/indicator-power.c
+++ b/src/indicator-power.c
@@ -339,6 +339,12 @@ show_info_cb (GtkMenuItem *item,
g_warning ("Couldn't execute command: %s", command);
}
+static void
+option_toggled_cb (GtkCheckMenuItem *item,
+ gpointer user_data)
+{
+ /*TODO*/
+}
static void
show_preferences_cb (GtkMenuItem *item,
@@ -373,6 +379,21 @@ build_menu (IndicatorPower *self)
gtk_menu_shell_append (GTK_MENU_SHELL (priv->menu), item);
}
+ /* options */
+ item = gtk_check_menu_item_new_with_label (_("Icon Only"));
+ g_signal_connect (G_OBJECT (item), "toggled",
+ G_CALLBACK (option_toggled_cb), item);
+ gtk_menu_shell_append (GTK_MENU_SHELL (priv->menu), item);
+
+ item = gtk_check_menu_item_new_with_label (_("Time Remining"));
+ g_signal_connect (G_OBJECT (item), "toggled",
+ G_CALLBACK (option_toggled_cb), item);
+ gtk_menu_shell_append (GTK_MENU_SHELL (priv->menu), item);
+
+ /* separator */
+ item = gtk_separator_menu_item_new ();
+ gtk_menu_shell_append (GTK_MENU_SHELL (priv->menu), item);
+
/* preferences */
item = gtk_image_menu_item_new_with_mnemonic (_("Power Settings ..."));
image = gtk_image_new_from_icon_name (GTK_STOCK_PREFERENCES, GTK_ICON_SIZE_MENU);