Commit 64baa79d authored by spiiroin's avatar spiiroin

Merge branch 'jb34061_flipover_setting' into 'master'

Add flipoverGestureEnabled property



See merge request !9
parents 6c3a2f61 c43a07d0
...@@ -47,6 +47,7 @@ static const char *MceDisplayAutoBrightnessEnabled = "/system/osso/dsm/display/a ...@@ -47,6 +47,7 @@ static const char *MceDisplayAutoBrightnessEnabled = "/system/osso/dsm/display/a
static const char *MceDoubleTapMode = "/system/osso/dsm/doubletap/mode"; static const char *MceDoubleTapMode = "/system/osso/dsm/doubletap/mode";
static const char *MceLidSensorEnabled = "/system/osso/dsm/locks/lid_sensor_enabled"; static const char *MceLidSensorEnabled = "/system/osso/dsm/locks/lid_sensor_enabled";
static const char *MceLidSensorFilteringEnabled = "/system/osso/dsm/locks/filter_lid_with_als"; static const char *MceLidSensorFilteringEnabled = "/system/osso/dsm/locks/filter_lid_with_als";
static const char *MceFlipOverGestureEnabled = "/system/osso/dsm/display/flipover_gesture_enabled";
DisplaySettings::DisplaySettings(QObject *parent) DisplaySettings::DisplaySettings(QObject *parent)
: QObject(parent) : QObject(parent)
...@@ -99,6 +100,10 @@ DisplaySettings::DisplaySettings(QObject *parent) ...@@ -99,6 +100,10 @@ DisplaySettings::DisplaySettings(QObject *parent)
result.waitForFinished(); result.waitForFinished();
m_lidSensorFilteringEnabled = result.value().variant().toBool(); m_lidSensorFilteringEnabled = result.value().variant().toBool();
result = m_mceIface->get_config(QDBusObjectPath(MceFlipOverGestureEnabled));
result.waitForFinished();
m_flipoverGestureEnabled = result.value().variant().toBool();
m_mceSignalIface = new ComNokiaMceSignalInterface(MCE_SERVICE, MCE_SIGNAL_PATH, QDBusConnection::systemBus(), this); m_mceSignalIface = new ComNokiaMceSignalInterface(MCE_SERVICE, MCE_SIGNAL_PATH, QDBusConnection::systemBus(), this);
connect(m_mceSignalIface, SIGNAL(config_change_ind(QString,QDBusVariant)), this, SLOT(configChange(QString,QDBusVariant))); connect(m_mceSignalIface, SIGNAL(config_change_ind(QString,QDBusVariant)), this, SLOT(configChange(QString,QDBusVariant)));
} }
...@@ -274,6 +279,19 @@ void DisplaySettings::setLidSensorFilteringEnabled(bool enabled) ...@@ -274,6 +279,19 @@ void DisplaySettings::setLidSensorFilteringEnabled(bool enabled)
emit lidSensorFilteringEnabledChanged(); emit lidSensorFilteringEnabledChanged();
} }
} }
bool DisplaySettings::flipoverGestureEnabled() const
{
return m_flipoverGestureEnabled;
}
void DisplaySettings::setFlipoverGestureEnabled(bool enabled)
{
if (m_flipoverGestureEnabled != enabled) {
m_flipoverGestureEnabled = enabled;
m_mceIface->set_config(QDBusObjectPath(MceFlipOverGestureEnabled), QDBusVariant(enabled));
emit flipoverGestureEnabledChanged();
}
}
void DisplaySettings::configChange(const QString &key, const QDBusVariant &value) void DisplaySettings::configChange(const QString &key, const QDBusVariant &value)
{ {
...@@ -343,5 +361,11 @@ void DisplaySettings::configChange(const QString &key, const QDBusVariant &value ...@@ -343,5 +361,11 @@ void DisplaySettings::configChange(const QString &key, const QDBusVariant &value
m_lidSensorFilteringEnabled = val; m_lidSensorFilteringEnabled = val;
emit lidSensorFilteringEnabledChanged(); emit lidSensorFilteringEnabledChanged();
} }
} else if (key == MceFlipOverGestureEnabled) {
bool val = value.variant().toBool();
if (val != m_flipoverGestureEnabled) {
m_flipoverGestureEnabled = val;
emit flipoverGestureEnabledChanged();
}
} }
} }
...@@ -58,6 +58,7 @@ class DisplaySettings: public QObject ...@@ -58,6 +58,7 @@ class DisplaySettings: public QObject
Q_PROPERTY(QVariant orientationLock READ orientationLock WRITE setOrientationLock NOTIFY orientationLockChanged) Q_PROPERTY(QVariant orientationLock READ orientationLock WRITE setOrientationLock NOTIFY orientationLockChanged)
Q_PROPERTY(bool lidSensorEnabled READ lidSensorEnabled WRITE setLidSensorEnabled NOTIFY lidSensorEnabledChanged) Q_PROPERTY(bool lidSensorEnabled READ lidSensorEnabled WRITE setLidSensorEnabled NOTIFY lidSensorEnabledChanged)
Q_PROPERTY(bool lidSensorFilteringEnabled READ lidSensorFilteringEnabled WRITE setLidSensorFilteringEnabled NOTIFY lidSensorFilteringEnabledChanged) Q_PROPERTY(bool lidSensorFilteringEnabled READ lidSensorFilteringEnabled WRITE setLidSensorFilteringEnabled NOTIFY lidSensorFilteringEnabledChanged)
Q_PROPERTY(bool flipoverGestureEnabled READ flipoverGestureEnabled WRITE setFlipoverGestureEnabled NOTIFY flipoverGestureEnabledChanged)
public: public:
enum DoubleTapMode { enum DoubleTapMode {
...@@ -120,6 +121,9 @@ public: ...@@ -120,6 +121,9 @@ public:
bool lidSensorFilteringEnabled() const; bool lidSensorFilteringEnabled() const;
void setLidSensorFilteringEnabled(bool); void setLidSensorFilteringEnabled(bool);
bool flipoverGestureEnabled() const;
void setFlipoverGestureEnabled(bool);
signals: signals:
void brightnessChanged(); void brightnessChanged();
void dimTimeoutChanged(); void dimTimeoutChanged();
...@@ -133,6 +137,7 @@ signals: ...@@ -133,6 +137,7 @@ signals:
void orientationLockChanged(); void orientationLockChanged();
void lidSensorEnabledChanged(); void lidSensorEnabledChanged();
void lidSensorFilteringEnabledChanged(); void lidSensorFilteringEnabledChanged();
void flipoverGestureEnabledChanged();
private slots: private slots:
void configChange(const QString &key, const QDBusVariant &value); void configChange(const QString &key, const QDBusVariant &value);
...@@ -152,6 +157,7 @@ private: ...@@ -152,6 +157,7 @@ private:
bool m_doubleTapMode; bool m_doubleTapMode;
bool m_lidSensorEnabled; bool m_lidSensorEnabled;
bool m_lidSensorFilteringEnabled; bool m_lidSensorFilteringEnabled;
bool m_flipoverGestureEnabled;
}; };
QML_DECLARE_TYPE(DisplaySettings) QML_DECLARE_TYPE(DisplaySettings)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment