Commit 20f1806b authored by SergeyChupligin's avatar SergeyChupligin Committed by Sergey Chupligin

[devicelock] Update Lockscreen for Sailfish > 2.0.4

parent 2001859d
......@@ -4,9 +4,47 @@ import QtQuick.Controls.Nemo 1.0
import QtQuick.Controls.Styles.Nemo 1.0
import QtQuick.Layouts 1.0
import org.nemomobile.lipstick 0.1
import org.nemomobile.devicelock 1.0
Item {
id: root
property bool shouldAuthenticate: Lipstick.compositor.visible
&& authenticator.availableMethods !== 0
onShouldAuthenticateChanged: {
if (shouldAuthenticate) {
DeviceLock.authorization.requestChallenge()
} else {
authenticator.cancel()
DeviceLock.authorization.relinquishChallenge()
}
}
Component.onCompleted: {
DeviceLock.authorization.requestChallenge()
}
Connections {
target: DeviceLock.authorization
onChallengeIssued: {
authenticator.authenticate(
DeviceLock.authorization.challengeCode,
DeviceLock.authorization.allowedMethods)
}
}
Authenticator {
id: authenticator
onAuthenticated: {
DeviceLock.unlock(authenticationToken)
}
onFeedback: {
console.log('### still locked', feedback, attemptsRemaining)
}
}
ColumnLayout {
anchors.fill: parent
spacing: 40
......@@ -34,12 +72,8 @@ Item {
lockCodeField.insert(lockCodeField.cursorPosition, text)
} else {
if (text === "OK") {
if(deviceLock.checkCode(lockCodeField.text)) {
deviceLock.setState(0)
lockCodeField.text = ""
} else {
authenticator.enterLockCode(lockCodeField.text)
lockCodeField.text = ""
}
} else if (text === "Ca"){
lockCodeField.text = ""
}
......
import QtQuick 2.0
import org.nemomobile.lipstick 0.1
import org.nemomobile.devicelock 1.0
Image {
id: lockScreen
source: "qrc:/qml/images/graphics-wallpaper-home.jpg"
visible: LipstickSettings.lockscreenVisible || deviceLock.state === 1
LockscreenClock {
id: clock
......@@ -13,7 +15,7 @@ Image {
right: parent.right
}
}
DeviceLock {
DeviceLockUI {
id: deviceLockUI
anchors {
top: clock.bottom
......@@ -21,8 +23,9 @@ Image {
}
height: parent.height-clock.height
width: parent.width
visible: deviceLock.state === 1
//visible:
z: 201
}
......@@ -30,4 +33,3 @@ Image {
anchors.fill: parent
}
}
......@@ -34,9 +34,12 @@ import QtQuick.Controls 1.0
import QtQuick.Controls.Nemo 1.0
import QtQuick.Controls.Styles.Nemo 1.0
import QtQuick.Window 2.1
import org.nemomobile.time 1.0
import org.nemomobile.configuration 1.0
import org.nemomobile.lipstick 0.1
import org.nemomobile.devicelock 1.0
import "scripts/desktop.js" as Desktop
Page {
......@@ -149,6 +152,8 @@ Page {
Lockscreen {
id: lockScreen
visible: DeviceLock.state >= DeviceLock.Locked
width: parent.width
height: parent.height
z: 200
......
......@@ -24,6 +24,8 @@
import QtQuick 2.0
import org.nemomobile.lipstick 0.1
import org.nemomobile.devicelock 1.0
import "compositor"
import "scripts/desktop.js" as Desktop
......@@ -133,7 +135,7 @@ Compositor {
property real lockThreshold: 0.25
property int lockscreenX
property int lockscreenY
enabled: deviceLock.state === 0
enabled: DeviceLock.state == DeviceLock.Unlocked
onGestureStarted: {
swipeAnimation.stop()
......
......@@ -36,7 +36,7 @@ qml.files = qml/MainScreen.qml \
qml/CommonPanel.qml \
qml/ShutdownScreen.qml \
qml/GlacierRotation.qml \
qml/DeviceLock.qml
qml/DeviceLockUI.qml
qmlcompositor.path = /usr/share/lipstick-glacier-home-qt5/qml/compositor
qmlcompositor.files = qml/compositor/WindowWrapperMystic.qml \
......@@ -108,8 +108,7 @@ OTHER_FILES += qml/*.qml \
qml/BatteryPanel.qml \
qml/CommonPanel.qml \
qml/ShutdownScreen.qml \
qml/GlacierRotation.qml \
qml/DeviceLock.qml
qml/GlacierRotation.qml
TRANSLATIONS += i18n/glacer-home.ts
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment