aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJavier Jardón <javier.jardon@codethink.co.uk>2011-07-01 11:37:31 +0100
committerJavier Jardón <javier.jardon@codethink.co.uk>2011-07-01 11:37:31 +0100
commit6d4b1e00de7fdacbcda48d90090cdd03e2590716 (patch)
tree3d61b2b7d496a1bcbc64d8ed1a844a7ec96e576e
parent353d27d38a5199bad72e9ba98fc1b6b88363cba0 (diff)
downloadayatana-indicator-power-6d4b1e00de7fdacbcda48d90090cdd03e2590716.tar.gz
ayatana-indicator-power-6d4b1e00de7fdacbcda48d90090cdd03e2590716.tar.bz2
ayatana-indicator-power-6d4b1e00de7fdacbcda48d90090cdd03e2590716.zip
Use the short time string in the label
-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 b42e67e..0a7694e 100644
--- a/src/indicator-power.c
+++ b/src/indicator-power.c
@@ -228,6 +228,7 @@ get_primary_device_cb (GObject *source_object,
const gchar *device_name;
gchar *short_timestring = NULL;
gchar *detailed_timestring = NULL;
+ gchar *label_text = NULL;
result = g_dbus_proxy_call_finish (G_DBUS_PROXY (source_object), res, &error);
if (result == NULL)
@@ -267,6 +268,9 @@ get_primary_device_cb (GObject *source_object,
&short_timestring,
&detailed_timestring);
+ label_text = g_strdup_printf(_("%s (%s)"),
+ device_name, short_timestring);
+
if (state == UP_DEVICE_STATE_CHARGING)
{
/* TRANSLATORS: %2 is a time string, e.g. "1 hour 5 minutes" */
@@ -286,10 +290,12 @@ get_primary_device_cb (GObject *source_object,
* used when we don't have a time value */
details = g_strdup_printf(_("%s (%.0lf%%)"),
device_name, percentage);
+ label_text = g_strdup (details);
}
gtk_label_set_label (GTK_LABEL (priv->label),
- details);
+ label_text);
+ g_free (label_text);
g_free (details);
g_free (device_icon);
g_free (short_timestring);