gnome-power-manager r3326 - in trunk: . src



Author: rhughes
Date: Wed Mar  4 12:44:56 2009
New Revision: 3326
URL: http://svn.gnome.org/viewvc/gnome-power-manager?rev=3326&view=rev

Log:
2009-03-04  Richard Hughes  <richard hughsie com>

* src/gpm-devicekit.c: (gpm_devicekit_get_object_icon):
Fix up the icon when we are state unknown, and very close to the
charging capacity.
Some batteries like to stop charging before they get tools/100%.

* src/gpm-devicekit.c: (gpm_devicekit_get_object_summary):
Print a less scary warning when the device state is unknown.
This removes one string, and does not add any.


Modified:
   trunk/ChangeLog
   trunk/src/gpm-devicekit.c

Modified: trunk/src/gpm-devicekit.c
==============================================================================
--- trunk/src/gpm-devicekit.c	(original)
+++ trunk/src/gpm-devicekit.c	Wed Mar  4 12:44:56 2009
@@ -109,6 +109,10 @@
 		} else if (obj->state == DKP_DEVICE_STATE_FULLY_CHARGED) {
 			filename = g_strdup_printf ("gpm-%s-charged", prefix);
 
+		} else if (obj->state == DKP_DEVICE_STATE_UNKNOWN && obj->percentage > 95.0f) {
+			egg_warning ("fixing up unknown %f", obj->percentage);
+			filename = g_strdup_printf ("gpm-%s-charged", prefix);
+
 		} else if (obj->state == DKP_DEVICE_STATE_CHARGING) {
 			index_str = gpm_devicekit_get_object_icon_index (obj);
 			filename = g_strdup_printf ("gpm-%s-%s-charging", prefix, index_str);
@@ -231,7 +235,7 @@
 	} else {
 		egg_warning ("in an undefined state we are not charging or "
 			     "discharging and the batteries are also not charged");
-		description = g_strdup (_("Device state could not be read at this time"));
+		description = g_strdup_printf ("%s (%.1f%%)", type_desc, obj->percentage);
 	}
 	return description;
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]