From d049d2fc573a417b559e11cc1bc83d121b7efe9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Jard=C3=B3n?= Date: Wed, 29 Jun 2011 17:11:40 +0100 Subject: Add options to the indicator menu As discussed: - Icon only - Time remaining --- src/indicator-power.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/indicator-power.c') 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); -- cgit v1.2.3