Add DBus interface to OrientationSensor and a persistent configuration
ClosedPublic

Authored by graesslin on Nov 9 2017, 5:06 PM.

Details

Summary

The initial state for user enabled is now read from config. In addition
a DBus interface is provided exporting this property. This allows
KScreen to determine whether automatic screen rotation is available and
whether the user has it enabled or not.

Furthermore KScreen can change the property and this gets stored into
the configuration. Thus KScreen can offer a user interface to
enable/disable automatic screen rotation as well as enabling/disabling
the manual rotation based on the current user settings.

Test Plan

Not yet tested, coded on the system which doesn't have an
orientation sensor

Diff Detail

Repository
R108 KWin
Branch
orientation-sensor-dbus
Lint
No Linters Available
Unit
No Unit Test Coverage
graesslin created this revision.Nov 9 2017, 5:06 PM
Restricted Application added a project: KWin. · View Herald TranscriptNov 9 2017, 5:06 PM
Restricted Application added subscribers: kwin, plasma-devel. · View Herald Transcript
anthonyfieroni added inline comments.
orientation_sensor.cpp
106
m_userEnabled = m_config && m_config->group("OrientationSensor").readEntry("Enabled", true);

?

graesslin added inline comments.Nov 9 2017, 7:14 PM
orientation_sensor.cpp
106

I might want to extend the loadConfig with further options (who knows) and then it wouldn't help any more. Also I find the code easier to read if it's spread around more lines.

Restricted Application edited projects, added Plasma; removed KWin. · View Herald TranscriptDec 5 2017, 4:34 PM
davidedmundson accepted this revision.Dec 5 2017, 4:54 PM
This revision is now accepted and ready to land.Dec 5 2017, 4:54 PM
Restricted Application edited projects, added KWin; removed Plasma. · View Herald TranscriptDec 5 2017, 4:54 PM
This revision was automatically updated to reflect the committed changes.
Restricted Application edited projects, added Plasma; removed KWin. · View Herald TranscriptDec 26 2017, 9:03 PM