mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-27 22:33:08 +00:00
94 lines
2.8 KiB
QML
94 lines
2.8 KiB
QML
/********************************************************************
|
|
This file is part of the KDE project.
|
|
|
|
Copyright (C) 2014 Aleix Pol Gonzalez <aleixpol@blue-systems.com>
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation; either version 2 of the License, or
|
|
(at your option) any later version.
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
*********************************************************************/
|
|
|
|
import QtQuick 2.0
|
|
import QtQuick.Controls 1.1
|
|
import org.kde.plasma.core 2.0 as PlasmaCore
|
|
import org.kde.plasma.private.sessions 2.0
|
|
import "../components"
|
|
|
|
Image {
|
|
id: root
|
|
property bool viewVisible: false
|
|
property bool debug: false
|
|
property string notification
|
|
property Item userSelect: null
|
|
property int interfaceVersion: org_kde_plasma_screenlocker_greeter_interfaceVersion ? org_kde_plasma_screenlocker_greeter_interfaceVersion : 0
|
|
signal clearPassword()
|
|
|
|
source: backgroundPath || "../components/artwork/background.png"
|
|
fillMode: Image.PreserveAspectCrop
|
|
asynchronous: true
|
|
|
|
onStatusChanged: {
|
|
if (status == Image.Error) {
|
|
source = "../components/artwork/background.png";
|
|
}
|
|
}
|
|
|
|
LayoutMirroring.enabled: Qt.application.layoutDirection === Qt.RightToLeft
|
|
LayoutMirroring.childrenInherit: true
|
|
|
|
Connections {
|
|
target: authenticator
|
|
onFailed: {
|
|
root.notification = i18nd("plasma_lookandfeel_org.kde.lookandfeel","Unlocking failed");
|
|
}
|
|
onGraceLockedChanged: {
|
|
if (!authenticator.graceLocked) {
|
|
root.notification = "";
|
|
root.clearPassword();
|
|
}
|
|
}
|
|
onMessage: {
|
|
root.notification = msg;
|
|
}
|
|
onError: {
|
|
root.notification = err;
|
|
}
|
|
}
|
|
|
|
SessionsModel {
|
|
id: sessionsModel
|
|
}
|
|
|
|
PlasmaCore.DataSource {
|
|
id: keystateSource
|
|
engine: "keystate"
|
|
connectedSources: "Caps Lock"
|
|
}
|
|
|
|
StackView {
|
|
id: stackView
|
|
anchors.fill: parent
|
|
|
|
initialItem: Loader {
|
|
active: root.viewVisible
|
|
source: "MainBlock.qml"
|
|
}
|
|
}
|
|
|
|
Component.onCompleted: {
|
|
// version support checks
|
|
if (root.interfaceVersion < 1) {
|
|
// ksmserver of 5.4, with greeter of 5.5
|
|
root.viewVisible = true;
|
|
}
|
|
}
|
|
}
|