aboutsummaryrefslogtreecommitdiff
path: root/src/indicator-power.c
diff options
context:
space:
mode:
authorJavier Jardón <javier.jardon@codethink.co.uk>2011-08-11 16:17:29 +0100
committerJavier Jardón <javier.jardon@codethink.co.uk>2011-08-11 16:17:29 +0100
commitb36ac875eec753d2368dad1cf45ab930bc7b52bc (patch)
treed48c7769a02d4e11d2684431175299f3741090fb /src/indicator-power.c
parent329ed974706f08e269fa22a2ab7274cc1dbfc3a8 (diff)
downloadayatana-indicator-power-b36ac875eec753d2368dad1cf45ab930bc7b52bc.tar.gz
ayatana-indicator-power-b36ac875eec753d2368dad1cf45ab930bc7b52bc.tar.bz2
ayatana-indicator-power-b36ac875eec753d2368dad1cf45ab930bc7b52bc.zip
Use a string when the energy source is not present
Use "not present" instead "0%"
Diffstat (limited to 'src/indicator-power.c')
-rw-r--r--src/indicator-power.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/indicator-power.c b/src/indicator-power.c
index bfb625b..e0d8795 100644
--- a/src/indicator-power.c
+++ b/src/indicator-power.c
@@ -315,7 +315,7 @@ build_device_time_details (const gchar *device_name,
*accesible_name = g_strdup (*details);
*short_details = g_strdup (_("(charged)"));
}
- else
+ else if (percentage > 0)
{
/* TRANSLATORS: %2 is a percentage value. Note: this string is only
* used when we don't have a time value */
@@ -325,6 +325,12 @@ build_device_time_details (const gchar *device_name,
*short_details = g_strdup_printf (_("(%.0lf%%)"),
percentage);
}
+ else
+ {
+ *details = g_strdup_printf (_("%s (not present)"), device_name);
+ *accesible_name = g_strdup (*details);
+ *short_details = g_strdup (_("(not present)"));
+ }
}
}