aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKen VanDine <ken.vandine@canonical.com>2011-10-24 12:27:33 -0400
committerKen VanDine <ken.vandine@canonical.com>2011-10-24 12:27:33 -0400
commit36b6a7bd4da4c926473733222f2f2de702a10097 (patch)
tree9d79e10967bac66183706428467818195df0a40a
parent45187581e3231940c482eb1f1dd747884a321b0c (diff)
parent8541fa2fca5e702df025c670f7d03bceb66ca2aa (diff)
downloadayatana-indicator-power-36b6a7bd4da4c926473733222f2f2de702a10097.tar.gz
ayatana-indicator-power-36b6a7bd4da4c926473733222f2f2de702a10097.tar.bz2
ayatana-indicator-power-36b6a7bd4da4c926473733222f2f2de702a10097.zip
releasing version 0.10-0ubuntu1
-rw-r--r--ChangeLog44
-rwxr-xr-xconfigure20
-rw-r--r--configure.ac2
-rw-r--r--debian/changelog13
-rw-r--r--src/indicator-power.c103
5 files changed, 149 insertions, 33 deletions
diff --git a/ChangeLog b/ChangeLog
index d288e95..d06ff29 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,49 @@
# Generated by Makefile. Do not edit.
+2011-10-13 Javier Jardón <javier.jardon@codethink.co.uk>
+
+ 0.10
+
+2011-10-13 Javier Jardón <javier.jardon@codethink.co.uk>
+
+ Do not hardcode icon percentage when discharging
+
+2011-10-13 Javier Jardón <javier.jardon@codethink.co.uk>
+
+ Add support for old name icons
+
+2011-10-13 Javier Jardón <javier.jardon@codethink.co.uk>
+
+ Fix icon creation for UP_DEVICE_STATE_CHARGING state
+
+2011-10-04 Javier Jardón <javier.jardon@codethink.co.uk>
+
+ Only show a red icon when we have less than 30 minutes of battery remainig
+
+ Fixes https://bugs.launchpad.net/indicator-power/+bug/743823
+
+2011-10-03 Javier Jardón <javier.jardon@codethink.co.uk>
+
+ Use battery-with-a-plug when the batttery is fully charged but still on AC
+
+ Fixes https://bugs.launchpad.net/indicator-power/+bug/865342
+
+2011-10-03 Javier Jardón <javier.jardon@codethink.co.uk>
+
+ Show non present batteries in the menu
+
+2011-10-02 Javier Jardón <javier.jardon@codethink.co.uk>
+
+ Add a workaround to fix the case when we get a empty bay as a real battery
+
+2011-09-23 Ken VanDine <ken.vandine@canonical.com>
+
+ Fix POTFILES.in to reflect new gsettings schema filename
+
+2011-09-23 Ken VanDine <ken.vandine@canonical.com>
+
+ fixed filename for gsettings schema
+
2011-09-23 Javier Jardón <javier.jardon@codethink.co.uk>
0.9
diff --git a/configure b/configure
index e371315..a6b91ec 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.68 for indicator-power 0.9.
+# Generated by GNU Autoconf 2.68 for indicator-power 0.10.
#
# Report bugs to <http://bugs.launchpad.net/indicator-power>.
#
@@ -570,8 +570,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='indicator-power'
PACKAGE_TARNAME='indicator-power'
-PACKAGE_VERSION='0.9'
-PACKAGE_STRING='indicator-power 0.9'
+PACKAGE_VERSION='0.10'
+PACKAGE_STRING='indicator-power 0.10'
PACKAGE_BUGREPORT='http://bugs.launchpad.net/indicator-power'
PACKAGE_URL='http://launchpad.net/indicator-power'
@@ -1367,7 +1367,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures indicator-power 0.9 to adapt to many kinds of systems.
+\`configure' configures indicator-power 0.10 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1437,7 +1437,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of indicator-power 0.9:";;
+ short | recursive ) echo "Configuration of indicator-power 0.10:";;
esac
cat <<\_ACEOF
@@ -1568,7 +1568,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-indicator-power configure 0.9
+indicator-power configure 0.10
generated by GNU Autoconf 2.68
Copyright (C) 2010 Free Software Foundation, Inc.
@@ -1846,7 +1846,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by indicator-power $as_me 0.9, which was
+It was created by indicator-power $as_me 0.10, which was
generated by GNU Autoconf 2.68. Invocation command line was
$ $0 $@
@@ -2670,7 +2670,7 @@ fi
# Define the identity of the package.
PACKAGE='indicator-power'
- VERSION='0.9'
+ VERSION='0.10'
cat >>confdefs.h <<_ACEOF
@@ -15119,7 +15119,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by indicator-power $as_me 0.9, which was
+This file was extended by indicator-power $as_me 0.10, which was
generated by GNU Autoconf 2.68. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -15186,7 +15186,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-indicator-power config.status 0.9
+indicator-power config.status 0.10
configured by $0, generated by GNU Autoconf 2.68,
with options \\"\$ac_cs_config\\"
diff --git a/configure.ac b/configure.ac
index 4176d1f..2d42c3c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,5 +1,5 @@
AC_INIT([indicator-power],
- [0.9],
+ [0.10],
[http://bugs.launchpad.net/indicator-power],
[indicator-power],
[http://launchpad.net/indicator-power])
diff --git a/debian/changelog b/debian/changelog
index c00d341..8a563a0 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,16 @@
+indicator-power (0.10-0ubuntu1) precise; urgency=low
+
+ * New upstream release.
+ - Use battery-with-a-plug when the batttery is fully charged but still
+ on AC (LP: #865342)
+ - Only show a red icon when we have less than 30 minutes of battery
+ remaining (LP: #743823)
+ - Fix icon creation for UP_DEVICE_STATE_CHARGING state
+ - support for old name icons
+ - Do not hardcode icon percentage when discharging
+
+ -- Ken VanDine <ken.vandine@canonical.com> Mon, 24 Oct 2011 11:07:54 -0400
+
indicator-power (0.9-0ubuntu2) oneiric; urgency=low
* src/indicator-power.c
diff --git a/src/indicator-power.c b/src/indicator-power.c
index 64392cd..cb684f5 100644
--- a/src/indicator-power.c
+++ b/src/indicator-power.c
@@ -360,35 +360,94 @@ set_accessible_desc (IndicatorPower *self,
priv->accessible_desc = g_strdup (desc);
}
+static const gchar *
+get_icon_percentage_for_status (const gchar *status)
+{
+
+ if (g_strcmp0 (status, "caution") == 0)
+ return "000";
+ else if (g_strcmp0 (status, "low") == 0)
+ return "040";
+ else if (g_strcmp0 (status, "good") == 0)
+ return "080";
+ else
+ return "100";
+}
+
static GIcon*
-get_device_icon (UpDeviceKind kind,
- UpDeviceState state,
- gchar *device_icon)
+build_battery_icon (UpDeviceState state,
+ gchar *suffix_str)
{
GIcon *gicon;
- if (kind == UP_DEVICE_KIND_BATTERY &&
- state == UP_DEVICE_STATE_CHARGING)
+ GString *filename;
+ gchar **iconnames;
+
+ filename = g_string_new (NULL);
+
+ if (state == UP_DEVICE_STATE_FULLY_CHARGED)
+ {
+ g_string_append (filename, "battery-charged;");
+ g_string_append (filename, "battery-full-charged-symbolic;");
+ g_string_append (filename, "battery-full-charged;");
+ g_string_append (filename, "gpm-battery-charged;");
+ g_string_append (filename, "gpm-battery-100-charging;");
+ }
+ else if (state == UP_DEVICE_STATE_CHARGING)
+ {
+ g_string_append (filename, "battery-000-charging;");
+ g_string_append (filename, "battery-caution-charging-symbolic;");
+ g_string_append (filename, "battery-caution-charging;");
+ g_string_append (filename, "gpm-battery-000-charging;");
+ }
+ else if (state == UP_DEVICE_STATE_DISCHARGING)
{
- GString *filename;
- gchar **iconnames;
- const gchar *kind_str;
+ const gchar *percentage = get_icon_percentage_for_status (suffix_str);
+ g_string_append_printf (filename, "battery-%s;", suffix_str);
+ g_string_append_printf (filename, "battery-%s-symbolic;", suffix_str);
+ g_string_append_printf (filename, "battery-%s;", percentage);
+ g_string_append_printf (filename, "gpm-battery-%s;", percentage);
+ }
- kind_str = up_device_kind_to_string (kind);
- filename = g_string_new (NULL);
- g_string_append_printf (filename, "battery-caution-charging-symbolic;");
- g_string_append_printf (filename, "gpm-%s-000-charging;", kind_str);
- g_string_append_printf (filename, "battery-caution-charging;");
+ iconnames = g_strsplit (filename->str, ";", -1);
+ gicon = g_themed_icon_new_from_names (iconnames, -1);
- iconnames = g_strsplit (filename->str, ";", -1);
- gicon = g_themed_icon_new_from_names (iconnames, -1);
+ g_strfreev (iconnames);
+ g_string_free (filename, TRUE);
- g_strfreev (iconnames);
- g_string_free (filename, TRUE);
- }
- else
+ return gicon;
+}
+
+static GIcon*
+get_device_icon (UpDeviceKind kind,
+ UpDeviceState state,
+ guint64 time_sec,
+ gchar *device_icon)
+{
+ GIcon *gicon;
+
+ gicon = g_icon_new_for_string (device_icon, NULL);
+
+ if (kind == UP_DEVICE_KIND_BATTERY &&
+ (state == UP_DEVICE_STATE_FULLY_CHARGED ||
+ state == UP_DEVICE_STATE_CHARGING ||
+ state == UP_DEVICE_STATE_DISCHARGING))
{
- gicon = g_icon_new_for_string (device_icon, NULL);
+ if (state == UP_DEVICE_STATE_FULLY_CHARGED ||
+ state == UP_DEVICE_STATE_CHARGING)
+ {
+ gicon = build_battery_icon (state, NULL);
+ }
+ else if (state == UP_DEVICE_STATE_DISCHARGING)
+ {
+ if ((time_sec > 60 * 30) && /* more than 30 minutes left */
+ (g_strrstr (device_icon, "000") ||
+ g_strrstr (device_icon, "020") ||
+ g_strrstr (device_icon, "caution"))) /* the icon is red */
+ {
+ gicon = build_battery_icon (state, "low");
+ }
+ }
}
return gicon;
@@ -433,7 +492,7 @@ menu_add_device (GtkMenu *menu,
return;
/* Process the data */
- device_gicons = get_device_icon (kind, state, device_icon);
+ device_gicons = get_device_icon (kind, state, time, device_icon);
icon = gtk_image_new_from_gicon (device_gicons,
GTK_ICON_SIZE_SMALL_TOOLBAR);
@@ -664,7 +723,7 @@ put_primary_device (IndicatorPower *self,
g_debug ("%s: got data from object %s", G_STRFUNC, object_path);
/* set icon */
- device_gicons = get_device_icon (kind, state, device_icon);
+ device_gicons = get_device_icon (kind, state, time, device_icon);
gtk_image_set_from_gicon (priv->status_image,
device_gicons,
GTK_ICON_SIZE_LARGE_TOOLBAR);