on xenial help sign in
Proxy inactivity timeout values from gsettings into Unity.Screen
commit02d36e4ca4d5bbc81a8670497c7be501dbe128b8 authorAlberto Aguirre <alberto.aguirre@canonical.com> dateFri 15 Aug 2014, 12:44 (12 years ago) parent5613e47
2 files changed+17−1
debian/control+1−1 plugins/Powerd/Powerd.cpp+16
debian/control+1−1
@@ -166,7 +166,7 @@ Architecture: any
166166Multi-Arch: same
167167Pre-Depends: ${misc:Pre-Depends},
168168Depends: accountsservice-ubuntu-schemas,
169− gsettings-ubuntu-schemas,
169+ gsettings-ubuntu-schemas (>= 0.0.3),
170170 libhardware2,
171171 libunity-core-6.0-9,
172172 pay-service,
plugins/Powerd/Powerd.cpp+16
@@ -25,6 +25,18 @@ void autoBrightnessChanged(GSettings *settings, const gchar *key, QDBusInterface
2525 unityScreen->asyncCall("userAutobrightnessEnable", QVariant(value));
2626}
2727
28+void activityTimeoutChanged(GSettings *settings, const gchar *key, QDBusInterface *unityScreen)
29+{
30+ int value = g_settings_get_uint(settings, key);
31+ unityScreen->asyncCall("setInactivityTimeouts", QVariant(value), QVariant(-1));
32+}
33+
34+void dimTimeoutChanged(GSettings *settings, const gchar *key, QDBusInterface *unityScreen)
35+{
36+ int value = g_settings_get_uint(settings, key);
37+ unityScreen->asyncCall("setInactivityTimeouts", QVariant(-1), QVariant(value));
38+}
39+
2840Powerd::Powerd(QObject* parent)
2941 : QObject(parent),
3042 unityScreen(NULL)
@@ -43,7 +55,11 @@ Powerd::Powerd(QObject* parent)
4355
4456 systemSettings = g_settings_new("com.ubuntu.touch.system");
4557 g_signal_connect(systemSettings, "changed::auto-brightness", G_CALLBACK(autoBrightnessChanged), unityScreen);
58+ g_signal_connect(systemSettings, "changed::activity-timeout", G_CALLBACK(activityTimeoutChanged), unityScreen);
59+ g_signal_connect(systemSettings, "changed::dim-timeout", G_CALLBACK(dimTimeoutChanged), unityScreen);
4660 autoBrightnessChanged(systemSettings, "auto-brightness", unityScreen);
61+ activityTimeoutChanged(systemSettings, "activity-timeout", unityScreen);
62+ dimTimeoutChanged(systemSettings, "dim-timeout", unityScreen);
4763}
4864
4965Powerd::~Powerd()