diff options
-rw-r--r-- | data/Makefile.am | 29 | ||||
-rw-r--r-- | data/com.canonical.indicator.power | 3 | ||||
-rw-r--r-- | data/indicator-power.conf.in | 11 | ||||
-rw-r--r-- | data/indicator-power.desktop.in | 9 | ||||
-rw-r--r-- | data/indicator-power.service.in | 3 | ||||
-rw-r--r-- | debian/changelog | 39 | ||||
-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 | 7 | ||||
-rw-r--r-- | tests/test-device.cc | 24 |
11 files changed, 121 insertions, 34 deletions
diff --git a/data/Makefile.am b/data/Makefile.am index 68cd662..9a4caca 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -10,17 +10,30 @@ indicatorsdir = $(prefix)/share/unity/indicators dist_indicators_DATA = com.canonical.indicator.power # -# the dbus service file +# the upstart job file # -dbus_servicesdir = $(datadir)/dbus-1/services -dbus_services_DATA = indicator-power.service -dbus_services_in = $(dbus_services_DATA:.service=.service.in) -$(dbus_services_DATA): $(dbus_services_in) +upstart_jobsdir = $(datadir)/upstart/sessions +upstart_jobs_DATA = indicator-power.conf +upstart_jobs_in = $(upstart_jobs_DATA:.conf=.conf.in) +$(upstart_jobs_DATA): $(upstart_jobs_in) $(AM_V_GEN) $(SED) -e "s|\@pkglibexecdir\@|$(pkglibexecdir)|" $< > $@ -BUILT_SOURCES += $(dbus_services_DATA) -CLEANFILES += $(dbus_services_DATA) -EXTRA_DIST += $(dbus_services_in) +BUILT_SOURCES += $(upstart_jobs_DATA) +CLEANFILES += $(upstart_jobs_DATA) +EXTRA_DIST += $(upstart_jobs_in) + +# +# the xdg autostart job file +# + +xdg_autostartdir = /etc/xdg/autostart +xdg_autostart_DATA = indicator-power.desktop +xdg_autostart_in = $(xdg_autostart_DATA:.desktop=.desktop.in) +$(xdg_autostart_DATA): $(xdg_autostart_in) + $(AM_V_GEN) $(SED) -e "s|\@pkglibexecdir\@|$(pkglibexecdir)|" $< > $@ +BUILT_SOURCES += $(xdg_autostart_DATA) +CLEANFILES += $(xdg_autostart_DATA) +EXTRA_DIST += $(xdg_autostart_in) # # the gettings 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/data/indicator-power.conf.in b/data/indicator-power.conf.in new file mode 100644 index 0000000..a2bc7aa --- /dev/null +++ b/data/indicator-power.conf.in @@ -0,0 +1,11 @@ +description "Indicator Power Backend" + +# Want to move to indicator-services-[start|end], but that's not all +# there yet. Use the signals that exist today for now. + +start on indicators-loaded or indicator-services-start +stop on desktop-end or indicator-services-end + +respawn + +exec @pkglibexecdir@/indicator-power-service diff --git a/data/indicator-power.desktop.in b/data/indicator-power.desktop.in new file mode 100644 index 0000000..28025a2 --- /dev/null +++ b/data/indicator-power.desktop.in @@ -0,0 +1,9 @@ +[Desktop Entry] +Type=Application +Name=Indicator Power +Exec=@pkglibexecdir@/indicator-power-service +NotShowIn=Unity; +NoDisplay=true +StartupNotify=false +Terminal=false + diff --git a/data/indicator-power.service.in b/data/indicator-power.service.in deleted file mode 100644 index 0702e8b..0000000 --- a/data/indicator-power.service.in +++ /dev/null @@ -1,3 +0,0 @@ -[D-BUS Service] -Name=com.canonical.indicator.power -Exec=@pkglibexecdir@/indicator-power-service diff --git a/debian/changelog b/debian/changelog index 36e3f96..e340616 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,42 @@ +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 ] diff --git a/src/device-provider-upower.c b/src/device-provider-upower.c index ad5bc98..7c12beb 100644 --- a/src/device-provider-upower.c +++ b/src/device-provider-upower.c @@ -288,6 +288,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) @@ -311,6 +327,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 b5227f6..a0c7fd1 100644 --- a/src/service.c +++ b/src/service.c @@ -459,10 +459,13 @@ create_brightness_menuitem (IndicatorPowerService * self) get_brightness_range (self, &lo, &hi); - item = g_menu_item_new ("Brightness", "indicator.brightness"); + item = g_menu_item_new (NULL, "indicator.brightness"); 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; } @@ -695,7 +698,7 @@ 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); + url_dispatch_send("settings:///system/battery", NULL, NULL); } /*** 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); |