diff -Nru indicator-power-12.10.6+15.04.20150203~rtm/data/com.canonical.indicator.power indicator-power-12.10.6+15.04.20150213~rtm/data/com.canonical.indicator.power --- indicator-power-12.10.6+15.04.20150203~rtm/data/com.canonical.indicator.power 2015-02-03 16:06:38.000000000 +0000 +++ indicator-power-12.10.6+15.04.20150213~rtm/data/com.canonical.indicator.power 2015-02-13 16:06:34.000000000 +0000 @@ -17,7 +17,7 @@ ObjectPath=/com/canonical/indicator/power/desktop_greeter [phone_greeter] -ObjectPath=/com/canonical/indicator/power/desktop_greeter +ObjectPath=/com/canonical/indicator/power/phone Position=25 [ubiquity] diff -Nru indicator-power-12.10.6+15.04.20150203~rtm/data/com.canonical.indicator.power.Testing.xml indicator-power-12.10.6+15.04.20150213~rtm/data/com.canonical.indicator.power.Testing.xml --- indicator-power-12.10.6+15.04.20150203~rtm/data/com.canonical.indicator.power.Testing.xml 2015-02-03 16:06:38.000000000 +0000 +++ indicator-power-12.10.6+15.04.20150213~rtm/data/com.canonical.indicator.power.Testing.xml 2015-02-13 16:06:34.000000000 +0000 @@ -22,7 +22,7 @@ - The mock battery's state. Possible values: 'charging', 'discharging' (Defualt: 'discharging') + The mock battery's state. Possible values: 'charging', 'discharging' (Default: 'discharging') @@ -30,7 +30,7 @@ - Muntes left until the mock battery finishes charging/dischargin (Default: 30) + Minutes left until the mock battery finishes charging/discharging (Default: 30) diff -Nru indicator-power-12.10.6+15.04.20150203~rtm/debian/changelog indicator-power-12.10.6+15.04.20150213~rtm/debian/changelog --- indicator-power-12.10.6+15.04.20150203~rtm/debian/changelog 2015-02-13 16:11:31.000000000 +0000 +++ indicator-power-12.10.6+15.04.20150213~rtm/debian/changelog 2015-02-13 16:11:32.000000000 +0000 @@ -1,11 +1,35 @@ -indicator-power (12.10.6+15.04.20150203~rtm-0ubuntu1) 14.09; urgency=medium +indicator-power (12.10.6+15.04.20150213~rtm-0ubuntu1) 14.09; urgency=medium + + * + + -- CI Train Bot Fri, 13 Feb 2015 16:06:55 +0000 + +indicator-power (12.10.6+15.04.20150212-0ubuntu1) vivid; urgency=medium + + [ Charles Kerr ] + * Use the new power level icons for a more accurate display of the + battery level. (LP: #1388235) + + -- CI Train Bot Thu, 12 Feb 2015 22:45:30 +0000 + +indicator-power (12.10.6+15.04.20150130-0ubuntu1) vivid; urgency=medium [ Charles Kerr ] * Publish the primary device's state for on the bus. (LP: #1416096) - -- Ubuntu daily release Tue, 03 Feb 2015 16:07:04 +0000 + -- Ubuntu daily release Fri, 30 Jan 2015 22:51:49 +0000 + +indicator-power (12.10.6+15.04.20141203-0ubuntu1) vivid; urgency=low + + [ Charles Kerr ] + * Show the phone menu in the phone greeter. + + [ Christopher Lee ] + * Fix some minor typos in power testing xml file. + + -- Ubuntu daily release Wed, 03 Dec 2014 16:26:04 +0000 -indicator-power (12.10.6+15.04.20141103~rtm-0ubuntu1) 14.09; urgency=low +indicator-power (12.10.6+15.04.20141103-0ubuntu1) vivid; urgency=low [ Sebastien Bacher ] * List missing source for translations diff -Nru indicator-power-12.10.6+15.04.20150203~rtm/src/device.c indicator-power-12.10.6+15.04.20150213~rtm/src/device.c --- indicator-power-12.10.6+15.04.20150203~rtm/src/device.c 2015-02-03 16:06:38.000000000 +0000 +++ indicator-power-12.10.6+15.04.20150213~rtm/src/device.c 2015-02-13 16:06:34.000000000 +0000 @@ -319,7 +319,23 @@ } static const gchar * -get_device_icon_index (gdouble percentage) +get_closest_10_percent_percentage (gdouble percentage) +{ + if (percentage >= 95) return "100"; + if (percentage >= 85) return "090"; + if (percentage >= 75) return "080"; + if (percentage >= 65) return "070"; + if (percentage >= 55) return "060"; + if (percentage >= 45) return "050"; + if (percentage >= 35) return "040"; + if (percentage >= 21) return "030"; /* don't round down to 20: see bug #1388235 */ + if (percentage >= 15) return "020"; + if (percentage >= 5) return "010"; + return "000"; +} + +static const gchar * +get_fallback_device_icon_index (gdouble percentage) { if (percentage >= 90) return "100"; if (percentage >= 70) return "080"; @@ -364,6 +380,7 @@ { const gchar *suffix_str; const gchar *index_str; + const gchar *index_str_2; /* LCOV_EXCL_START */ g_return_val_if_fail (INDICATOR_IS_POWER_DEVICE(device), NULL); @@ -406,9 +423,15 @@ case UP_DEVICE_STATE_CHARGING: suffix_str = get_device_icon_suffix (percentage); - index_str = get_device_icon_index (percentage); + index_str = get_closest_10_percent_percentage (percentage); g_ptr_array_add (names, g_strdup_printf ("%s-%s-charging", kind_str, index_str)); g_ptr_array_add (names, g_strdup_printf ("gpm-%s-%s-charging", kind_str, index_str)); + index_str_2 = get_fallback_device_icon_index (percentage); + if (g_strcmp0 (index_str, index_str_2)) + { + g_ptr_array_add (names, g_strdup_printf ("%s-%s-charging", kind_str, index_str_2)); + g_ptr_array_add (names, g_strdup_printf ("gpm-%s-%s-charging", kind_str, index_str_2)); + } g_ptr_array_add (names, g_strdup_printf ("%s-%s-charging-symbolic", kind_str, suffix_str)); g_ptr_array_add (names, g_strdup_printf ("%s-%s-charging", kind_str, suffix_str)); break; @@ -417,9 +440,15 @@ case UP_DEVICE_STATE_DISCHARGING: case UP_DEVICE_STATE_PENDING_DISCHARGE: suffix_str = get_device_icon_suffix (percentage); - index_str = get_device_icon_index (percentage); + index_str = get_closest_10_percent_percentage (percentage); g_ptr_array_add (names, g_strdup_printf ("%s-%s", kind_str, index_str)); g_ptr_array_add (names, g_strdup_printf ("gpm-%s-%s", kind_str, index_str)); + index_str_2 = get_fallback_device_icon_index (percentage); + if (g_strcmp0 (index_str, index_str_2)) + { + g_ptr_array_add (names, g_strdup_printf ("%s-%s", kind_str, index_str_2)); + g_ptr_array_add (names, g_strdup_printf ("gpm-%s-%s", kind_str, index_str_2)); + } g_ptr_array_add (names, g_strdup_printf ("%s-%s-symbolic", kind_str, suffix_str)); g_ptr_array_add (names, g_strdup_printf ("%s-%s", kind_str, suffix_str)); break; diff -Nru indicator-power-12.10.6+15.04.20150203~rtm/src/service.c indicator-power-12.10.6+15.04.20150213~rtm/src/service.c --- indicator-power-12.10.6+15.04.20150203~rtm/src/service.c 2015-02-03 16:06:51.000000000 +0000 +++ indicator-power-12.10.6+15.04.20150213~rtm/src/service.c 2015-02-13 16:06:34.000000000 +0000 @@ -290,14 +290,14 @@ calculate_device_state_action_state (IndicatorPowerService * self) { const priv_t * const p = self->priv; - const char * str; + UpDeviceState device_state; if (p->primary_device != NULL) - str = device_state_to_string(indicator_power_device_get_state(p->primary_device)); + device_state = indicator_power_device_get_state(p->primary_device); else - str = ""; + device_state = UP_DEVICE_STATE_UNKNOWN; - return g_variant_new_string(str); + return g_variant_new_string(device_state_to_string(device_state)); } static GVariant* diff -Nru indicator-power-12.10.6+15.04.20150203~rtm/tests/manual indicator-power-12.10.6+15.04.20150213~rtm/tests/manual --- indicator-power-12.10.6+15.04.20150203~rtm/tests/manual 2015-02-03 16:06:38.000000000 +0000 +++ indicator-power-12.10.6+15.04.20150213~rtm/tests/manual 2015-02-13 16:06:34.000000000 +0000 @@ -13,7 +13,6 @@ --object-path /com/canonical/indicator/power/Testing \ --method org.freedesktop.DBus.Properties.GetAll \ com.canonical.indicator.power.Testing -({'MockBatteryEnabled': , 'MockBatteryLevel': , 'MockBatteryState': <'discharging'>, 'MockBatteryMinutesLeft': },) Enable the mock battery: @@ -88,6 +87,14 @@
ubuntu-system-settings should be launched to the Battery page
+Test-case indicator-power/low-power-icon +
+
Wait for the system's battery level to drop to 21% (or fake it, see 'Notes on Battery Testing' above)
+
The indicator's icon should use the non-critical coloring (eg, grey)
+
Wait for the system's battery level to drop to 20% (or fake it, see 'Notes on Battery Testing' above)
+
The indicator's icon should use the critical coloring (eg, red)
+
+ Test-case indicator-power/device-brightness-slider
On a device, pull down the power indicator's menu
diff -Nru indicator-power-12.10.6+15.04.20150203~rtm/tests/test-device.cc indicator-power-12.10.6+15.04.20150213~rtm/tests/test-device.cc --- indicator-power-12.10.6+15.04.20150203~rtm/tests/test-device.cc 2015-02-03 16:06:38.000000000 +0000 +++ indicator-power-12.10.6+15.04.20150213~rtm/tests/test-device.cc 2015-02-13 16:06:34.000000000 +0000 @@ -297,7 +297,6 @@ g_object_set (o, INDICATOR_POWER_DEVICE_KIND, kind, INDICATOR_POWER_DEVICE_STATE, UP_DEVICE_STATE_EMPTY, NULL); - g_string_append_printf (expected, "%s-empty-symbolic;", kind_str); g_string_append_printf (expected, "gpm-%s-empty;", kind_str); g_string_append_printf (expected, "gpm-%s-000;", kind_str); @@ -323,7 +322,6 @@ INDICATOR_POWER_DEVICE_STATE, UP_DEVICE_STATE_CHARGING, INDICATOR_POWER_DEVICE_PERCENTAGE, 95.0, NULL); - g_string_append_printf (expected, "%s-100-charging;", kind_str); g_string_append_printf (expected, "gpm-%s-100-charging;", kind_str); g_string_append_printf (expected, "%s-full-charging-symbolic;", kind_str); @@ -336,6 +334,8 @@ INDICATOR_POWER_DEVICE_STATE, UP_DEVICE_STATE_CHARGING, INDICATOR_POWER_DEVICE_PERCENTAGE, 85.0, NULL); + g_string_append_printf (expected, "%s-090-charging;", kind_str); + g_string_append_printf (expected, "gpm-%s-090-charging;", kind_str); g_string_append_printf (expected, "%s-080-charging;", kind_str); g_string_append_printf (expected, "gpm-%s-080-charging;", kind_str); g_string_append_printf (expected, "%s-full-charging-symbolic;", kind_str); @@ -348,6 +348,8 @@ INDICATOR_POWER_DEVICE_STATE, UP_DEVICE_STATE_CHARGING, INDICATOR_POWER_DEVICE_PERCENTAGE, 50.0, NULL); + g_string_append_printf (expected, "%s-050-charging;", kind_str); + g_string_append_printf (expected, "gpm-%s-050-charging;", kind_str); g_string_append_printf (expected, "%s-060-charging;", kind_str); g_string_append_printf (expected, "gpm-%s-060-charging;", kind_str); g_string_append_printf (expected, "%s-good-charging-symbolic;", kind_str); @@ -360,6 +362,8 @@ INDICATOR_POWER_DEVICE_STATE, UP_DEVICE_STATE_CHARGING, INDICATOR_POWER_DEVICE_PERCENTAGE, 25.0, NULL); + g_string_append_printf (expected, "%s-030-charging;", kind_str); + g_string_append_printf (expected, "gpm-%s-030-charging;", kind_str); g_string_append_printf (expected, "%s-020-charging;", kind_str); g_string_append_printf (expected, "gpm-%s-020-charging;", kind_str); g_string_append_printf (expected, "%s-low-charging-symbolic;", kind_str); @@ -372,6 +376,8 @@ INDICATOR_POWER_DEVICE_STATE, UP_DEVICE_STATE_CHARGING, INDICATOR_POWER_DEVICE_PERCENTAGE, 5.0, NULL); + g_string_append_printf (expected, "%s-010-charging;", kind_str); + g_string_append_printf (expected, "gpm-%s-010-charging;", kind_str); g_string_append_printf (expected, "%s-000-charging;", kind_str); g_string_append_printf (expected, "gpm-%s-000-charging;", kind_str); g_string_append_printf (expected, "%s-caution-charging-symbolic;", kind_str); @@ -396,6 +402,8 @@ INDICATOR_POWER_DEVICE_STATE, UP_DEVICE_STATE_DISCHARGING, INDICATOR_POWER_DEVICE_PERCENTAGE, 85.0, NULL); + g_string_append_printf (expected, "%s-090;", kind_str); + g_string_append_printf (expected, "gpm-%s-090;", kind_str); g_string_append_printf (expected, "%s-080;", kind_str); g_string_append_printf (expected, "gpm-%s-080;", kind_str); g_string_append_printf (expected, "%s-full-symbolic;", kind_str); @@ -409,6 +417,8 @@ INDICATOR_POWER_DEVICE_PERCENTAGE, 50.0, INDICATOR_POWER_DEVICE_TIME, guint64(60*60), NULL); + g_string_append_printf (expected, "%s-050;", kind_str); + g_string_append_printf (expected, "gpm-%s-050;", kind_str); g_string_append_printf (expected, "%s-060;", kind_str); g_string_append_printf (expected, "gpm-%s-060;", kind_str); g_string_append_printf (expected, "%s-good-symbolic;", kind_str); @@ -422,6 +432,8 @@ INDICATOR_POWER_DEVICE_PERCENTAGE, 25.0, INDICATOR_POWER_DEVICE_TIME, guint64(60*60), NULL); + g_string_append_printf (expected, "%s-030;", kind_str); + g_string_append_printf (expected, "gpm-%s-030;", kind_str); g_string_append_printf (expected, "%s-020;", kind_str); g_string_append_printf (expected, "gpm-%s-020;", kind_str); g_string_append_printf (expected, "%s-low-symbolic;", kind_str); @@ -435,6 +447,8 @@ INDICATOR_POWER_DEVICE_PERCENTAGE, 25.0, INDICATOR_POWER_DEVICE_TIME, guint64(60*15), NULL); + g_string_append_printf (expected, "%s-030;", kind_str); + g_string_append_printf (expected, "gpm-%s-030;", kind_str); g_string_append_printf (expected, "%s-020;", kind_str); g_string_append_printf (expected, "gpm-%s-020;", kind_str); g_string_append_printf (expected, "%s-low-symbolic;", kind_str); @@ -448,6 +462,8 @@ INDICATOR_POWER_DEVICE_PERCENTAGE, 5.0, INDICATOR_POWER_DEVICE_TIME, guint64(60*60), NULL); + g_string_append_printf (expected, "%s-010;", kind_str); + g_string_append_printf (expected, "gpm-%s-010;", kind_str); g_string_append_printf (expected, "%s-000;", kind_str); g_string_append_printf (expected, "gpm-%s-000;", kind_str); g_string_append_printf (expected, "%s-caution-symbolic;", kind_str); @@ -461,6 +477,8 @@ INDICATOR_POWER_DEVICE_PERCENTAGE, 5.0, INDICATOR_POWER_DEVICE_TIME, guint64(60*15), NULL); + g_string_append_printf (expected, "%s-010;", kind_str); + g_string_append_printf (expected, "gpm-%s-010;", kind_str); g_string_append_printf (expected, "%s-000;", kind_str); g_string_append_printf (expected, "gpm-%s-000;", kind_str); g_string_append_printf (expected, "%s-caution-symbolic;", kind_str);