From ad01db76cb63adb53708cfaf5cf27a1e9989aa4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Jard=C3=B3n?= Date: Thu, 14 Jul 2011 15:13:29 +0200 Subject: Only show the remaining time if it is discharging with less than 12 hours left --- src/indicator-power.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'src/indicator-power.c') diff --git a/src/indicator-power.c b/src/indicator-power.c index ece0531..5395cc9 100644 --- a/src/indicator-power.c +++ b/src/indicator-power.c @@ -287,11 +287,19 @@ build_device_time_details (const gchar *device_name, } else if (state == UP_DEVICE_STATE_DISCHARGING) { - /* TRANSLATORS: %2 is a time string, e.g. "1 hour 5 minutes" */ - *accesible_name = g_strdup_printf (_("%s (%s left (%.0lf%%))"), - device_name, detailed_timestring, percentage); - *details = g_strdup_printf (_("%s (%s left)"), - device_name, short_timestring); + if (time > 43200) /* 12 hours */ + { + *accesible_name = g_strdup_printf (_("%s"), device_name); + *details = g_strdup_printf (_("%s"), device_name); + } + else + { + /* TRANSLATORS: %2 is a time string, e.g. "1 hour 5 minutes" */ + *accesible_name = g_strdup_printf (_("%s (%s left (%.0lf%%))"), + device_name, detailed_timestring, percentage); + *details = g_strdup_printf (_("%s (%s left)"), + device_name, short_timestring); + } } } else -- cgit v1.2.3