~sil2100/ubuntu-system-settings/background_overlay_UI

« back to all changes in this revision

Viewing changes to plugins/security-privacy/PhoneLocking.qml

Set the unlock type in a QSettings file (~/.unity8-greeter-demo). Fixes: https://bugs.launchpad.net/bugs/1218010.

Approved by Sebastien Bacher, PS Jenkins bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
import SystemSettings 1.0
24
24
import Ubuntu.Components 0.1
25
25
import Ubuntu.Components.ListItems 0.1 as ListItem
 
26
import Ubuntu.SystemSettings.SecurityPrivacy 1.0
26
27
 
27
28
ItemPage {
28
29
    title: i18n.tr("Phone locking")
29
30
 
30
 
    GSettings {
31
 
        id: settingsSchema
32
 
        schema.id: "com.ubuntu.touch.system-settings"
 
31
    UbuntuSecurityPrivacyPanel {
 
32
        id: securityPrivacy
33
33
    }
34
34
 
35
35
    Column {
43
43
 
44
44
            text: i18n.tr("Lock security")
45
45
            value: {
46
 
                switch (settingsSchema.unlockMethod) {
47
 
                    case "swipe":
 
46
                switch (securityPrivacy.securityType) {
 
47
                    case UbuntuSecurityPrivacyPanel.Swipe:
48
48
                        return swipe
49
 
                    case "passcode":
 
49
                    case UbuntuSecurityPrivacyPanel.Passcode:
50
50
                        return passcode
51
 
                    case "password":
 
51
                    case UbuntuSecurityPrivacyPanel.Passphrase:
52
52
                        return passphrase
53
53
                }
54
54
            }
57
57
        }
58
58
 
59
59
        ListItem.SingleValue {
60
 
            property bool lockOnSuspend: settingsSchema.unlockMethod !== "swipe"
 
60
            property bool lockOnSuspend: securityPrivacy.securityType !==
 
61
                                            UbuntuSecurityPrivacyPanel.Swipe
61
62
            text: lockOnSuspend ? i18n.tr("Lock when idle")
62
63
                                : i18n.tr("Sleep when idle")
63
64
            value: i18n.tr("1 minute",