aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJavier Jardón <javier.jardon@codethink.co.uk>2011-07-14 16:19:55 +0200
committerJavier Jardón <javier.jardon@codethink.co.uk>2011-07-14 16:19:55 +0200
commit0cdc5de675d492c4df77228cba8deac02e4672ed (patch)
treefbda929d51b77c64a47dff5155d84e9857653829
parentad01db76cb63adb53708cfaf5cf27a1e9989aa4f (diff)
downloadayatana-indicator-power-0cdc5de675d492c4df77228cba8deac02e4672ed.tar.gz
ayatana-indicator-power-0cdc5de675d492c4df77228cba8deac02e4672ed.tar.bz2
ayatana-indicator-power-0cdc5de675d492c4df77228cba8deac02e4672ed.zip
Show "X (charged)" if it is fully charged and not discharging
-rw-r--r--src/indicator-power.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/src/indicator-power.c b/src/indicator-power.c
index 5395cc9..8005c5d 100644
--- a/src/indicator-power.c
+++ b/src/indicator-power.c
@@ -304,13 +304,22 @@ build_device_time_details (const gchar *device_name,
}
else
{
- /* TRANSLATORS: %2 is a percentage value. Note: this string is only
- * used when we don't have a time value */
- *details = g_strdup_printf (_("%s (%.0lf%%)"),
- device_name, percentage);
- *accesible_name = g_strdup (*details);
- *short_details = g_strdup_printf (_("(%.0lf%%)"),
- percentage);
+ if (state == UP_DEVICE_STATE_FULLY_CHARGED)
+ {
+ *details = g_strdup_printf (_("%s (charged)"), device_name);
+ *accesible_name = g_strdup (*details);
+ *short_details = g_strdup (*details);
+ }
+ else
+ {
+ /* TRANSLATORS: %2 is a percentage value. Note: this string is only
+ * used when we don't have a time value */
+ *details = g_strdup_printf (_("%s (%.0lf%%)"),
+ device_name, percentage);
+ *accesible_name = g_strdup (*details);
+ *short_details = g_strdup_printf (_("(%.0lf%%)"),
+ percentage);
+ }
}
}