aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debian/changelog7
-rw-r--r--debian/control2
-rwxr-xr-xdebian/rules9
-rw-r--r--src/ib-brightness-powerd-control.c14
-rw-r--r--src/ib-brightness-powerd-control.h3
-rw-r--r--src/service.c26
6 files changed, 28 insertions, 33 deletions
diff --git a/debian/changelog b/debian/changelog
index 73b9718..14ad040 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+indicator-power (12.10.6+14.10.20140428-0ubuntu1) utopic; urgency=low
+
+ [ Ricardo Salveti de Araujo ]
+ * Updating code to reflect latest powerd dbus API changes
+
+ -- Ubuntu daily release <ps-jenkins@lists.canonical.com> Mon, 28 Apr 2014 23:25:53 +0000
+
indicator-power (12.10.6+14.04.20140411-0ubuntu1) trusty; urgency=low
[ Sebastien Bacher ]
diff --git a/debian/control b/debian/control
index b11fd60..28ab3fd 100644
--- a/debian/control
+++ b/debian/control
@@ -10,7 +10,7 @@ Build-Depends: debhelper (>= 9),
libglib2.0-dev (>= 2.36),
libgudev-1.0-dev,
liburl-dispatcher1-dev,
- python,
+ python:any,
Standards-Version: 3.9.2
Homepage: https://launchpad.net/indicator-power
# If you aren't a member of ~indicator-applet-developers but need to upload
diff --git a/debian/rules b/debian/rules
index 83edd94..36a22d7 100755
--- a/debian/rules
+++ b/debian/rules
@@ -6,12 +6,21 @@
export DPKG_GENSYMBOLS_CHECK_LEVEL=4
+ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
+ TESTS=yes
+else
+ TESTS=no
+endif
+
%:
dh $@ --with autoreconf
override_dh_autoreconf:
NOCONFIGURE=1 dh_autoreconf ./autogen.sh
+override_dh_auto_configure:
+ dh_auto_configure -- --enable-tests=$(TESTS)
+
override_dh_install:
find debian/indicator-power -name \*.la -delete
find debian/indicator-power -name \*.a -delete
diff --git a/src/ib-brightness-powerd-control.c b/src/ib-brightness-powerd-control.c
index 2136fcd..9e8815b 100644
--- a/src/ib-brightness-powerd-control.c
+++ b/src/ib-brightness-powerd-control.c
@@ -19,8 +19,8 @@
#include "ib-brightness-powerd-control.h"
-static gboolean getBrightnessParams(GDBusProxy* powerd_proxy, int *min, int *max,
- int *dflt, gboolean *ab_supported);
+static gboolean getBrightnessParams(GDBusProxy* powerd_proxy, int *dim, int *min,
+ int *max, int *dflt, gboolean *ab_supported);
GDBusProxy*
powerd_get_proxy(brightness_params_t *params)
@@ -46,8 +46,8 @@ powerd_get_proxy(brightness_params_t *params)
return NULL;
}
- ret = getBrightnessParams(powerd_proxy, &(params->min), &(params->max),
- &(params->dflt), &(params->ab_supported));
+ ret = getBrightnessParams(powerd_proxy, &(params->dim), &(params->min),
+ &(params->max), &(params->dflt), &(params->ab_supported));
if (! ret)
{
@@ -61,7 +61,7 @@ powerd_get_proxy(brightness_params_t *params)
static gboolean
-getBrightnessParams(GDBusProxy* powerd_proxy, int *min, int *max, int *dflt, gboolean *ab_supported)
+getBrightnessParams(GDBusProxy* powerd_proxy, int *dim, int *min, int *max, int *dflt, gboolean *ab_supported)
{
GVariant *ret = NULL;
GError *error = NULL;
@@ -84,7 +84,7 @@ getBrightnessParams(GDBusProxy* powerd_proxy, int *min, int *max, int *dflt, gbo
return FALSE;
}
- g_variant_get(ret, "((iiib))", min, max, dflt, ab_supported);
+ g_variant_get(ret, "((iiiib))", dim, min, max, dflt, ab_supported);
g_variant_unref(ret);
return TRUE;
}
@@ -114,6 +114,7 @@ struct _IbBrightnessPowerdControl
GDBusProxy *powerd_proxy;
GCancellable *gcancel;
+ int dim;
int min;
int max;
int dflt; // defalut value
@@ -131,6 +132,7 @@ ib_brightness_powerd_control_new (GDBusProxy* powerd_proxy, brightness_params_t
control->powerd_proxy = powerd_proxy;
control->gcancel = g_cancellable_new();
+ control->dim = params.dim;
control->min = params.min;
control->max = params.max;
control->dflt = params.dflt;
diff --git a/src/ib-brightness-powerd-control.h b/src/ib-brightness-powerd-control.h
index 77f6c8d..95de1f4 100644
--- a/src/ib-brightness-powerd-control.h
+++ b/src/ib-brightness-powerd-control.h
@@ -23,8 +23,9 @@
#include <gio/gio.h>
typedef struct {
- int max;
+ int dim;
int min;
+ int max;
int dflt;
gboolean ab_supported;
} brightness_params_t;
diff --git a/src/service.c b/src/service.c
index 00efe9b..46ad802 100644
--- a/src/service.c
+++ b/src/service.c
@@ -491,24 +491,6 @@ percentage_to_brightness (IndicatorPowerService * self, double percentage)
return (int)(lo + (percentage*(hi-lo)));
}
-static GMenuItem *
-create_brightness_menuitem (IndicatorPowerService * self)
-{
- int lo, hi;
- GMenuItem * item;
-
- get_brightness_range (self, &lo, &hi);
-
- 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;
-}
-
static GVariant *
action_state_for_brightness (IndicatorPowerService * self)
{
@@ -574,18 +556,12 @@ create_desktop_settings_section (IndicatorPowerService * self G_GNUC_UNUSED)
}
static GMenuModel *
-create_phone_settings_section (IndicatorPowerService * self G_GNUC_UNUSED)
+create_phone_settings_section (IndicatorPowerService * self)
{
GMenu * section;
- GMenuItem * item;
section = g_menu_new ();
-
- item = create_brightness_menuitem (self);
- g_menu_append_item (section, item);
update_brightness_action_state (self);
- g_object_unref (item);
-
g_menu_append (section, _("Battery settingsā€¦"), "indicator.activate-phone-settings");
return G_MENU_MODEL (section);