[gnome-control-center] power: Add better metadata for fake devices
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] power: Add better metadata for fake devices
- Date: Mon, 21 Oct 2013 20:57:03 +0000 (UTC)
commit a8ee1931f569aa5eb2cdc3d48637c7975b857c62
Author: Bastien Nocera <hadess hadess net>
Date: Mon Oct 21 22:51:17 2013 +0200
power: Add better metadata for fake devices
So that libupower-glib doesn't complain about unset but read
properties, we show the correct icons, and have proper names
for the fake keyboard and mouse.
panels/power/cc-power-panel.c | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/panels/power/cc-power-panel.c b/panels/power/cc-power-panel.c
index 56bbf66..223fd86 100644
--- a/panels/power/cc-power-panel.c
+++ b/panels/power/cc-power-panel.c
@@ -674,28 +674,37 @@ up_client_changed (UpClient *client,
device = up_device_new ();
g_object_set (device,
"kind", UP_DEVICE_KIND_MOUSE,
+ "native-path", "dummy:native-path1",
+ "model", "My mouse",
"percentage", 71.0,
"state", UP_DEVICE_STATE_DISCHARGING,
"time-to-empty", 287,
+ "icon-name", "battery-full-symbolic",
NULL);
g_ptr_array_add (priv->devices, device);
device = up_device_new ();
g_object_set (device,
"kind", UP_DEVICE_KIND_KEYBOARD,
- "percentage", 69.0,
+ "native-path", "dummy:native-path2",
+ "model", "My keyboard",
+ "percentage", 59.0,
"state", UP_DEVICE_STATE_DISCHARGING,
"time-to-empty", 250,
+ "icon-name", "battery-good-symbolic",
NULL);
g_ptr_array_add (priv->devices, device);
device = up_device_new ();
g_object_set (device,
"kind", UP_DEVICE_KIND_BATTERY,
+ "native-path", "dummy:native-path3",
+ "model", "Battery from some factory",
"percentage", 100.0,
"state", UP_DEVICE_STATE_FULLY_CHARGED,
"energy", 55.0,
"energy-full", 55.0,
"energy-rate", 15.0,
"time-to-empty", 400,
+ "icon-name", "battery-full-charged-symbolic",
NULL);
g_ptr_array_add (priv->devices, device);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]