diff options
author | Ted Gould <ted@gould.cx> | 2013-10-29 09:25:02 -0700 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2013-10-29 09:25:02 -0700 |
commit | fb134415e1e0042a00db4008e91adccd7d8eeff2 (patch) | |
tree | 7167a1e3e4fe537daf4f0062a25875806237189e | |
parent | 812ac9a18c469c7a4ad60cd7bb1921eb622d7df9 (diff) | |
parent | 1a9e81a4071d1bd137ca8135a993ad65a91e8ee9 (diff) | |
download | ayatana-indicator-power-fb134415e1e0042a00db4008e91adccd7d8eeff2.tar.gz ayatana-indicator-power-fb134415e1e0042a00db4008e91adccd7d8eeff2.tar.bz2 ayatana-indicator-power-fb134415e1e0042a00db4008e91adccd7d8eeff2.zip |
Updating to trunk
-rw-r--r-- | configure.ac | 3 | ||||
-rw-r--r-- | data/com.canonical.indicator.power | 3 | ||||
-rw-r--r-- | debian/changelog | 93 | ||||
-rw-r--r-- | debian/control | 5 | ||||
-rw-r--r-- | src/device-provider-upower.c | 18 | ||||
-rw-r--r-- | src/device.c | 9 | ||||
-rw-r--r-- | src/ib-brightness-control.c | 3 | ||||
-rw-r--r-- | src/service.c | 32 | ||||
-rw-r--r-- | tests/test-device.cc | 24 |
9 files changed, 152 insertions, 38 deletions
diff --git a/configure.ac b/configure.ac index ba39dec..ca7e793 100644 --- a/configure.ac +++ b/configure.ac @@ -40,7 +40,8 @@ GUDEV_REQUIRED_VERSION=204 PKG_CHECK_MODULES([SERVICE_DEPS],[glib-2.0 >= $GLIB_REQUIRED_VERSION gio-2.0 >= $GIO_REQUIRED_VERSION gio-unix-2.0 >= $GIO_UNIX_REQUIRED_VERSION - gudev-1.0 >= $GUDEV_REQUIRED_VERSION]) + gudev-1.0 >= $GUDEV_REQUIRED_VERSION + url-dispatcher-1]) ########################### # GSETTINGS diff --git a/data/com.canonical.indicator.power b/data/com.canonical.indicator.power index 329728f..65fd646 100644 --- a/data/com.canonical.indicator.power +++ b/data/com.canonical.indicator.power @@ -11,3 +11,6 @@ ObjectPath=/com/canonical/indicator/power/desktop [desktop_greeter] ObjectPath=/com/canonical/indicator/power/desktop_greeter + +[phone_greeter] +ObjectPath=/com/canonical/indicator/power/desktop_greeter diff --git a/debian/changelog b/debian/changelog index 30f05ff..e340616 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,96 @@ +indicator-power (12.10.6+14.04.20131029.1-0ubuntu1) trusty; urgency=low + + [ Sebastien Bacher ] + * Don't leak the g_file_get_contents value, reported by valgrind . + + [ Marcus Tomlinson ] + * Added torch icons to either end of brightness slider. (LP: #1227250) + + [ Ted Gould ] + * Adding a phone_greeter profile. + + [ Ubuntu daily release ] + * Automatic snapshot from revision 210 + + -- Ubuntu daily release <ps-jenkins@lists.canonical.com> Tue, 29 Oct 2013 10:31:03 +0000 + +indicator-power (12.10.6+13.10.20131008-0ubuntu1) saucy; urgency=low + + [ Ted Gould ] + * Adding an additional slash to the settings URL. (LP: #1231444) + + [ Ubuntu daily release ] + * Automatic snapshot from revision 206 + + -- Ubuntu daily release <ps-jenkins@lists.canonical.com> Tue, 08 Oct 2013 02:34:01 +0000 + +indicator-power (12.10.6+13.10.20131004-0ubuntu1) saucy; urgency=low + + [ Charles Kerr ] + * Revert bug #824629 code -- use the correct charge % when deciding + what icon to use. (LP: #1215520, #824629) + * Listen for the "Resuming" signal from upower to refresh devices when + resuming from suspend/hibernate. (LP: #1224931) + + [ Ubuntu daily release ] + * Automatic snapshot from revision 204 + + -- Ubuntu daily release <ps-jenkins@lists.canonical.com> Fri, 04 Oct 2013 02:28:43 +0000 + +indicator-power (12.10.6+13.10.20130918.2-0ubuntu1) saucy; urgency=low + + [ Timo Jyrinki ] + * The dependency url-dispatcher was fixed to not pull in extra packages + on the desktop images, fixing the issue that caused the previous revert + (FFe bug - LP: #1215980) + + [ Ted Gould ] + * Use URL dispatcher to show settings on the phone. + + [ Ubuntu daily release ] + * Automatic snapshot from revision 201 + + -- Ubuntu daily release <ps-jenkins@lists.canonical.com> Wed, 18 Sep 2013 13:57:00 +0000 + +indicator-power (12.10.6+13.10.20130913-0ubuntu2) saucy; urgency=low + + * Revert previous upload since this was bringing quite a few extra and + likely unwanted dependencies on Ubuntu desktop after FeatureFreeze. + + -- Stéphane Graber <stgraber@ubuntu.com> Fri, 13 Sep 2013 21:46:57 -0400 + +indicator-power (12.10.6+13.10.20130913-0ubuntu1) saucy; urgency=low + + [ Charles Kerr ] + * Adds a title in the header's action state. (LP: #1223635) + + [ Ted Gould ] + * Use URL Dispatcher for settings on the phone. + + [ Ubuntu daily release ] + * Automatic snapshot from revision 196 + + -- Ubuntu daily release <ps-jenkins@lists.canonical.com> Fri, 13 Sep 2013 15:15:31 +0000 + +indicator-power (12.10.6+13.10.20130830.2-0ubuntu1) saucy; urgency=low + + [ Sebastien Bacher ] + * don't depends on gnome-control-center, recommends is enough, since + it's only required for the preferences menu item. Let ubuntu-system- + settings replace it as an alternative, that's needed on the touch + image. + * revert previous commit, liburl-dispatcher1 depends on upstart-app- + launch which is in universe, that's blocking indicators from + landing. + + [ Ted Gould ] + * Make settings work on the phone. + + [ Ubuntu daily release ] + * Automatic snapshot from revision 193 + + -- Ubuntu daily release <ps-jenkins@lists.canonical.com> Fri, 30 Aug 2013 10:07:38 +0000 + indicator-power (12.10.6+13.10.20130823-0ubuntu1) saucy; urgency=low [ Charles Kerr ] diff --git a/debian/control b/debian/control index fc1c924..f0ed35e 100644 --- a/debian/control +++ b/debian/control @@ -9,6 +9,7 @@ Build-Depends: debhelper (>= 9), libgtest-dev, libglib2.0-dev (>= 2.36), libgudev-1.0-dev, + liburl-dispatcher1-dev, python, Standards-Version: 3.9.2 Homepage: https://launchpad.net/indicator-power @@ -23,8 +24,8 @@ Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends}, upower, - gnome-control-center (>= 3.1), -Recommends: indicator-applet (>= 0.2) | indicator-renderer, +Recommends: gnome-control-center (>= 3.1) | ubuntu-system-settings, + indicator-applet (>= 0.2) | indicator-renderer, Description: Indicator showing power state. This indicator displays current power management information and gives the user a way to access power management preferences. diff --git a/src/device-provider-upower.c b/src/device-provider-upower.c index 05faeab..1b1b7bd 100644 --- a/src/device-provider-upower.c +++ b/src/device-provider-upower.c @@ -249,6 +249,22 @@ on_upower_device_removed (DbusUPower * unused G_GNUC_UNUSED, } static void +on_upower_resuming (DbusUPower * unused G_GNUC_UNUSED, + gpointer gself) +{ + IndicatorPowerDeviceProviderUPower * self; + GHashTableIter iter; + gpointer object_path; + + self = INDICATOR_POWER_DEVICE_PROVIDER_UPOWER (gself); + + g_debug ("Resumed from hibernate/sleep; queueing all devices for a refresh"); + g_hash_table_iter_init (&iter, self->priv->devices); + while (g_hash_table_iter_next (&iter, &object_path, NULL)) + refresh_device_soon (self, object_path); +} + +static void on_upower_proxy_ready (GObject * source G_GNUC_UNUSED, GAsyncResult * res, gpointer gself) @@ -272,6 +288,8 @@ on_upower_proxy_ready (GObject * source G_GNUC_UNUSED, p = self->priv; p->upower_proxy = proxy; + g_signal_connect (proxy, "resuming", + G_CALLBACK (on_upower_resuming), self); g_signal_connect (proxy, "device-changed", G_CALLBACK (on_upower_device_changed), self); g_signal_connect (proxy, "device-added", diff --git a/src/device.c b/src/device.c index 9dc4647..508a734 100644 --- a/src/device.c +++ b/src/device.c @@ -328,10 +328,7 @@ device_kind_to_string (UpDeviceKind kind) This function's logic differs from GSD's power plugin in some ways: - 1. All charging batteries use the same icon regardless of progress. - <https://bugs.launchpad.net/indicator-power/+bug/824629/comments/7> - - 2. For discharging batteries, we decide whether or not to use the 'caution' + 1. For discharging batteries, we decide whether or not to use the 'caution' icon based on whether or not we have <= 30 minutes remaining, rather than looking at the battery's percentage left. <https://bugs.launchpad.net/indicator-power/+bug/743823> @@ -389,10 +386,6 @@ indicator_power_device_get_icon_names (const IndicatorPowerDevice * device) case UP_DEVICE_STATE_CHARGING: case UP_DEVICE_STATE_PENDING_CHARGE: - /* When charging, always use the same icon regardless of percentage. - <http://bugs.launchpad.net/indicator-power/+bug/824629> */ - percentage = 0; - suffix_str = get_device_icon_suffix (percentage); index_str = get_device_icon_index (percentage); g_ptr_array_add (names, g_strdup_printf ("%s-%s-charging-symbolic", kind_str, suffix_str)); diff --git a/src/ib-brightness-control.c b/src/ib-brightness-control.c index 2b9b79d..4fb6bc5 100644 --- a/src/ib-brightness-control.c +++ b/src/ib-brightness-control.c @@ -52,7 +52,7 @@ ib_brightness_control_new (void) (g_strcmp0 (device_type, "platform") == 0) || (g_strcmp0 (device_type, "raw") == 0)) { path = g_strdup (g_udev_device_get_sysfs_path (device->data)); - g_print ("found: %s\n", path); + g_debug ("found: %s", path); break; } } @@ -126,6 +126,7 @@ ib_brightness_control_get_value_from_file (IbBrightnessControl *self, const gcha g_error_free (error); } else { value = atoi (svalue); + g_free (svalue); } g_free (filename); diff --git a/src/service.c b/src/service.c index 1976332..c70723a 100644 --- a/src/service.c +++ b/src/service.c @@ -22,6 +22,7 @@ #include <glib/gi18n.h> #include <gio/gio.h> +#include <url-dispatcher.h> #include "device.h" #include "device-provider.h" @@ -331,15 +332,13 @@ create_header_state (IndicatorPowerService * self) g_variant_builder_init (&b, G_VARIANT_TYPE("a{sv}")); + g_variant_builder_add (&b, "{sv}", "title", g_variant_new_string (_("Battery"))); + g_variant_builder_add (&b, "{sv}", "visible", g_variant_new_boolean (should_be_visible (self))); if (label != NULL) - { - g_variant_builder_add (&b, "{sv}", "label", g_variant_new_string (label)); - - g_free (label); - } + g_variant_builder_add (&b, "{sv}", "label", g_variant_new_take_string (label)); if (icon != NULL) { @@ -349,12 +348,7 @@ create_header_state (IndicatorPowerService * self) } if (a11y != NULL) - { - g_variant_builder_add (&b, "{sv}", "accessible-desc", - g_variant_new_string (a11y)); - - g_free (a11y); - } + g_variant_builder_add (&b, "{sv}", "accessible-desc", g_variant_new_take_string (a11y)); return g_variant_builder_end (&b); } @@ -469,6 +463,9 @@ create_brightness_menuitem (IndicatorPowerService * self) g_menu_item_set_attribute (item, "x-canonical-type", "s", "com.canonical.unity.slider"); g_menu_item_set_attribute (item, "min-value", "d", brightness_to_percentage (self, lo)); g_menu_item_set_attribute (item, "max-value", "d", brightness_to_percentage (self, hi)); + g_menu_item_set_attribute (item, "min-icon", "s", "torch-off" ); + g_menu_item_set_attribute (item, "max-icon", "s", "torch-on" ); + return item; } @@ -532,7 +529,7 @@ create_phone_settings_section (IndicatorPowerService * self G_GNUC_UNUSED) update_brightness_action_state (self); g_object_unref (item); - g_menu_append (section, _("Battery settings…"), "indicator.activate-settings"); + g_menu_append (section, _("Battery settings…"), "indicator.activate-phone-settings"); return G_MENU_MODEL (section); } @@ -685,8 +682,6 @@ on_settings_activated (GSimpleAction * a G_GNUC_UNUSED, GVariant * param G_GNUC_UNUSED, gpointer gself G_GNUC_UNUSED) { - /* FIXME: unity8 settings */ - execute_command ("gnome-control-center power"); } @@ -698,6 +693,14 @@ on_statistics_activated (GSimpleAction * a G_GNUC_UNUSED, execute_command ("gnome-power-statistics"); } +static void +on_phone_settings_activated (GSimpleAction * a G_GNUC_UNUSED, + GVariant * param G_GNUC_UNUSED, + gpointer gself G_GNUC_UNUSED) +{ + url_dispatch_send("settings:///system/battery", NULL, NULL); +} + /*** **** ***/ @@ -739,6 +742,7 @@ init_gactions (IndicatorPowerService * self) GActionEntry entries[] = { { "activate-settings", on_settings_activated }, + { "activate-phone-settings", on_phone_settings_activated }, { "activate-statistics", on_statistics_activated } }; diff --git a/tests/test-device.cc b/tests/test-device.cc index 0ccd8d1..2762d4a 100644 --- a/tests/test-device.cc +++ b/tests/test-device.cc @@ -318,9 +318,9 @@ TEST_F(DeviceTest, IconNames) INDICATOR_POWER_DEVICE_PERCENTAGE, 95.0, NULL); - g_string_append_printf (expected, "%s-caution-charging-symbolic;", kind_str); - g_string_append_printf (expected, "gpm-%s-000-charging;", kind_str); - g_string_append_printf (expected, "%s-caution-charging", kind_str); + g_string_append_printf (expected, "%s-full-charging-symbolic;", kind_str); + g_string_append_printf (expected, "gpm-%s-100-charging;", kind_str); + g_string_append_printf (expected, "%s-full-charging", kind_str); check_icon_names (device, expected->str); g_string_truncate (expected, 0); @@ -329,9 +329,9 @@ TEST_F(DeviceTest, IconNames) INDICATOR_POWER_DEVICE_STATE, UP_DEVICE_STATE_CHARGING, INDICATOR_POWER_DEVICE_PERCENTAGE, 85.0, NULL); - g_string_append_printf (expected, "%s-caution-charging-symbolic;", kind_str); - g_string_append_printf (expected, "gpm-%s-000-charging;", kind_str); - g_string_append_printf (expected, "%s-caution-charging", kind_str); + g_string_append_printf (expected, "%s-full-charging-symbolic;", kind_str); + g_string_append_printf (expected, "gpm-%s-080-charging;", kind_str); + g_string_append_printf (expected, "%s-full-charging", kind_str); check_icon_names (device, expected->str); g_string_truncate (expected, 0); @@ -340,9 +340,9 @@ TEST_F(DeviceTest, IconNames) INDICATOR_POWER_DEVICE_STATE, UP_DEVICE_STATE_CHARGING, INDICATOR_POWER_DEVICE_PERCENTAGE, 50.0, NULL); - g_string_append_printf (expected, "%s-caution-charging-symbolic;", kind_str); - g_string_append_printf (expected, "gpm-%s-000-charging;", kind_str); - g_string_append_printf (expected, "%s-caution-charging", kind_str); + g_string_append_printf (expected, "%s-good-charging-symbolic;", kind_str); + g_string_append_printf (expected, "gpm-%s-060-charging;", kind_str); + g_string_append_printf (expected, "%s-good-charging", kind_str); check_icon_names (device, expected->str); g_string_truncate (expected, 0); @@ -351,9 +351,9 @@ TEST_F(DeviceTest, IconNames) INDICATOR_POWER_DEVICE_STATE, UP_DEVICE_STATE_CHARGING, INDICATOR_POWER_DEVICE_PERCENTAGE, 25.0, NULL); - g_string_append_printf (expected, "%s-caution-charging-symbolic;", kind_str); - g_string_append_printf (expected, "gpm-%s-000-charging;", kind_str); - g_string_append_printf (expected, "%s-caution-charging", kind_str); + g_string_append_printf (expected, "%s-low-charging-symbolic;", kind_str); + g_string_append_printf (expected, "gpm-%s-020-charging;", kind_str); + g_string_append_printf (expected, "%s-low-charging", kind_str); check_icon_names (device, expected->str); g_string_truncate (expected, 0); |