aboutsummaryrefslogtreecommitdiff
path: root/src/indicator-power.c
diff options
context:
space:
mode:
authorJavier Jardón <javier.jardon@codethink.co.uk>2011-07-14 15:13:29 +0200
committerJavier Jardón <javier.jardon@codethink.co.uk>2011-07-14 15:13:29 +0200
commitad01db76cb63adb53708cfaf5cf27a1e9989aa4f (patch)
tree606448497c26c192c34c8cb73994d20dcc87387d /src/indicator-power.c
parentcabdda614d6a6c31e4423a992a02e0cd66357464 (diff)
downloadayatana-indicator-power-ad01db76cb63adb53708cfaf5cf27a1e9989aa4f.tar.gz
ayatana-indicator-power-ad01db76cb63adb53708cfaf5cf27a1e9989aa4f.tar.bz2
ayatana-indicator-power-ad01db76cb63adb53708cfaf5cf27a1e9989aa4f.zip
Only show the remaining time if it is discharging with less than 12 hours left
Diffstat (limited to 'src/indicator-power.c')
-rw-r--r--src/indicator-power.c18
1 files changed, 13 insertions, 5 deletions
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