Warning, /plasma/kscreenlocker/kcm/ui/main.qml is written in an unsupported language. File is not indexed.

0001 /*
0002 SPDX-FileCopyrightText: 2020 David Redondo <kde@david-redondo.de>
0003 
0004 SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0005 */
0006 
0007 import QtQuick 2.15
0008 import QtQuick.Controls 2.15 as QQC2
0009 import QtQuick.Layouts 1.15
0010 
0011 import org.kde.kcmutils as KCM
0012 import org.kde.kirigami 2.20 as Kirigami
0013 import org.kde.kquickcontrols 2.0 as KQuickControls
0014 
0015 KCM.SimpleKCM {
0016     id: root
0017 
0018     implicitHeight: Kirigami.Units.gridUnit * 45
0019     implicitWidth: Kirigami.Units.gridUnit * 45
0020 
0021     ColumnLayout {
0022         spacing: 0
0023 
0024         Kirigami.FormLayout {
0025             RowLayout {
0026                 Kirigami.FormData.label: i18n("Lock screen automatically:")
0027                 QQC2.CheckBox {
0028                     text: i18nc("First part of sentence \"Automatically after X minutes\"", "After")
0029                     checked: kcm.settings.autolock
0030                     onToggled: kcm.settings.autolock = checked
0031 
0032                     KCM.SettingStateBinding {
0033                         configObject: kcm.settings
0034                         settingName: "Autolock"
0035                     }
0036                 }
0037 
0038                 QQC2.SpinBox {
0039                     from: 1
0040                     editable: true
0041                     textFromValue: value => i18np("%1 minute", "%1 minutes", value)
0042                     valueFromText: text => parseInt(text)
0043                     value: kcm.settings.timeout
0044                     onValueModified: kcm.settings.timeout = value
0045 
0046                     KCM.SettingStateBinding {
0047                         configObject: kcm.settings
0048                         settingName: "Timeout"
0049                     }
0050                 }
0051             }
0052 
0053             QQC2.CheckBox {
0054                 text: i18nc("@option:check", "After waking from sleep")
0055                 checked: kcm.settings.lockOnResume
0056                 onToggled: kcm.settings.lockOnResume = checked
0057 
0058                 KCM.SettingStateBinding {
0059                     configObject: kcm.settings
0060                     settingName: "LockOnResume"
0061                 }
0062             }
0063 
0064             Item {
0065                 Kirigami.FormData.isSection: true
0066             }
0067 
0068             QQC2.SpinBox {
0069                 Kirigami.FormData.label: i18nc("@label:spinbox", "Allow unlocking without password for:")
0070                 from: 0
0071                 to: 3600
0072                 editable: true
0073                 textFromValue: value => i18np("%1 second", "%1 seconds", value)
0074                 valueFromText: text => parseInt(text)
0075                 value: kcm.settings.lockGrace
0076                 onValueModified: kcm.settings.lockGrace = value
0077 
0078                 KCM.SettingStateBinding {
0079                     configObject: kcm.settings
0080                     settingName: "LockGrace"
0081                 }
0082             }
0083 
0084             Kirigami.Separator {
0085                 Kirigami.FormData.isSection: true
0086             }
0087 
0088             KQuickControls.KeySequenceItem {
0089                 Kirigami.FormData.label: i18n("Keyboard shortcut:")
0090                 keySequence: kcm.settings.shortcut
0091                 onCaptureFinished: kcm.settings.shortcut = keySequence
0092 
0093                 KCM.SettingStateBinding {
0094                     configObject: kcm.settings
0095                     settingName: "shortcut"
0096                 }
0097             }
0098 
0099             Item {
0100                 Kirigami.FormData.isSection: true
0101             }
0102 
0103             QQC2.Button {
0104                 Kirigami.FormData.label: i18n("Appearance:")
0105                 text: i18nc("@action:button", "Configure...")
0106                 icon.name: "preferences-desktop-theme"
0107                 onClicked: kcm.push("Appearance.qml")
0108 
0109                 KCM.SettingHighlighter {
0110                     highlight: !kcm.isDefaultsAppearance
0111                 }
0112             }
0113         }
0114     }
0115 }