From 0cdc5de675d492c4df77228cba8deac02e4672ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Jard=C3=B3n?= Date: Thu, 14 Jul 2011 16:19:55 +0200 Subject: Show "X (charged)" if it is fully charged and not discharging --- src/indicator-power.c | 23 ++++++++++++++++------- 1 file 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); + } } } -- cgit v1.2.3