aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJavier Jardón <javier.jardon@codethink.co.uk>2011-06-30 17:45:22 +0100
committerJavier Jardón <javier.jardon@codethink.co.uk>2011-06-30 17:45:22 +0100
commit2d3206b7d99711b48b97697397b56bf49e6edbe0 (patch)
tree0e039338a6dcd0a4a3d700b78bfa2af0de15121d
parentad775de47a9c71ee37227bbf952e01f441068489 (diff)
downloadayatana-indicator-power-2d3206b7d99711b48b97697397b56bf49e6edbe0.tar.gz
ayatana-indicator-power-2d3206b7d99711b48b97697397b56bf49e6edbe0.tar.bz2
ayatana-indicator-power-2d3206b7d99711b48b97697397b56bf49e6edbe0.zip
Show the real information about the remaining charge time
-rw-r--r--src/indicator-power.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/indicator-power.c b/src/indicator-power.c
index 59e65ce..6a4945c 100644
--- a/src/indicator-power.c
+++ b/src/indicator-power.c
@@ -261,6 +261,8 @@ get_primary_device_cb (GObject *source_object,
details = g_strdup_printf(_("%.0lf%% charged"),
percentage);
}
+ gtk_label_set_label (GTK_LABEL (priv->label),
+ details);
g_free (details);
g_free (device_icon);
@@ -353,16 +355,8 @@ option_toggled_cb (GtkCheckMenuItem *item,
IndicatorPower *self = INDICATOR_POWER (user_data);
IndicatorPowerPrivate *priv = self->priv;
- if (gtk_check_menu_item_get_active (item))
- {
- g_debug ("Updating username label");
- gtk_label_set_text (priv->label, "0:45 Remaining"); /*TODO*/
- gtk_widget_show (GTK_WIDGET(priv->label));
- }
- else
- {
- gtk_widget_hide (GTK_WIDGET(priv->label));
- }
+ gtk_widget_set_visible (GTK_WIDGET (priv->label),
+ gtk_check_menu_item_get_active (item));
}
static void