21
21
import GSettings 1.0
23
import QtQuick.Window 2.1
23
24
import Ubuntu.Components 0.1
24
25
import Ubuntu.Components.ListItems 0.1 as ListItem
26
28
ListItem.Standard {
30
function orientationToSetting (o) {
32
case Qt.PrimaryOrientation:
33
return "PrimaryOrientation";
34
case Qt.LandscapeOrientation:
35
return "LandscapeOrientation";
36
case Qt.PortraitOrientation:
37
return "PortraitOrientation";
38
case Qt.InvertedLandscapeOrientation:
39
return "InvertedLandscapeOrientation";
40
case Qt.InvertedPortraitOrientation:
41
return "InvertedPortraitOrientation";
43
console.warn('Unknown screen orientation');
28
49
iconSource: model.icon
30
51
text: i18n.tr(model.displayName)
33
checked: systemSettings.rotationLock
34
onCheckedChanged: systemSettings.rotationLock = checked
54
objectName: "orientationLockSwitch"
55
checked: systemSettings.orientationLock && systemSettings.orientationLock !== "none"
58
systemSettings.orientationLock = orientationToSetting(Screen.orientation);
60
systemSettings.orientationLock = "none";
38
66
schema.id: "com.ubuntu.touch.system"
40
if (key == "rotationLock")
41
control.checked = value