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 ...@@ -4,9 +4,47 @@ import QtQuick.Controls.Nemo 1.0
import QtQuick.Controls.Styles.Nemo 1.0 import QtQuick.Controls.Styles.Nemo 1.0
import QtQuick.Layouts 1.0 import QtQuick.Layouts 1.0
import org.nemomobile.lipstick 0.1
import org.nemomobile.devicelock 1.0
Item { Item {
id: root 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 { ColumnLayout {
anchors.fill: parent anchors.fill: parent
spacing: 40 spacing: 40
...@@ -34,12 +72,8 @@ Item { ...@@ -34,12 +72,8 @@ Item {
lockCodeField.insert(lockCodeField.cursorPosition, text) lockCodeField.insert(lockCodeField.cursorPosition, text)
} else { } else {
if (text === "OK") { if (text === "OK") {
if(deviceLock.checkCode(lockCodeField.text)) { authenticator.enterLockCode(lockCodeField.text)
deviceLock.setState(0)
lockCodeField.text = ""
} else {
lockCodeField.text = "" lockCodeField.text = ""
}
} else if (text === "Ca"){ } else if (text === "Ca"){
lockCodeField.text = "" lockCodeField.text = ""
} }
......
import QtQuick 2.0 import QtQuick 2.0
import org.nemomobile.lipstick 0.1
import org.nemomobile.devicelock 1.0
Image { Image {
id: lockScreen id: lockScreen
source: "qrc:/qml/images/graphics-wallpaper-home.jpg" source: "qrc:/qml/images/graphics-wallpaper-home.jpg"
visible: LipstickSettings.lockscreenVisible || deviceLock.state === 1
LockscreenClock { LockscreenClock {
id: clock id: clock
...@@ -13,7 +15,7 @@ Image { ...@@ -13,7 +15,7 @@ Image {
right: parent.right right: parent.right
} }
} }
DeviceLock { DeviceLockUI {
id: deviceLockUI id: deviceLockUI
anchors { anchors {
top: clock.bottom top: clock.bottom
...@@ -21,8 +23,9 @@ Image { ...@@ -21,8 +23,9 @@ Image {
} }
height: parent.height-clock.height height: parent.height-clock.height
width: parent.width
visible: deviceLock.state === 1 //visible:
z: 201 z: 201
} }
...@@ -30,4 +33,3 @@ Image { ...@@ -30,4 +33,3 @@ Image {
anchors.fill: parent anchors.fill: parent
} }
} }
...@@ -34,9 +34,12 @@ import QtQuick.Controls 1.0 ...@@ -34,9 +34,12 @@ import QtQuick.Controls 1.0
import QtQuick.Controls.Nemo 1.0 import QtQuick.Controls.Nemo 1.0
import QtQuick.Controls.Styles.Nemo 1.0 import QtQuick.Controls.Styles.Nemo 1.0
import QtQuick.Window 2.1 import QtQuick.Window 2.1
import org.nemomobile.time 1.0 import org.nemomobile.time 1.0
import org.nemomobile.configuration 1.0 import org.nemomobile.configuration 1.0
import org.nemomobile.lipstick 0.1 import org.nemomobile.lipstick 0.1
import org.nemomobile.devicelock 1.0
import "scripts/desktop.js" as Desktop import "scripts/desktop.js" as Desktop
Page { Page {
...@@ -149,6 +152,8 @@ Page { ...@@ -149,6 +152,8 @@ Page {
Lockscreen { Lockscreen {
id: lockScreen id: lockScreen
visible: DeviceLock.state >= DeviceLock.Locked
width: parent.width width: parent.width
height: parent.height height: parent.height
z: 200 z: 200
......
...@@ -24,6 +24,8 @@ ...@@ -24,6 +24,8 @@
import QtQuick 2.0 import QtQuick 2.0
import org.nemomobile.lipstick 0.1 import org.nemomobile.lipstick 0.1
import org.nemomobile.devicelock 1.0
import "compositor" import "compositor"
import "scripts/desktop.js" as Desktop import "scripts/desktop.js" as Desktop
...@@ -133,7 +135,7 @@ Compositor { ...@@ -133,7 +135,7 @@ Compositor {
property real lockThreshold: 0.25 property real lockThreshold: 0.25
property int lockscreenX property int lockscreenX
property int lockscreenY property int lockscreenY
enabled: deviceLock.state === 0 enabled: DeviceLock.state == DeviceLock.Unlocked
onGestureStarted: { onGestureStarted: {
swipeAnimation.stop() swipeAnimation.stop()
......
...@@ -36,7 +36,7 @@ qml.files = qml/MainScreen.qml \ ...@@ -36,7 +36,7 @@ qml.files = qml/MainScreen.qml \
qml/CommonPanel.qml \ qml/CommonPanel.qml \
qml/ShutdownScreen.qml \ qml/ShutdownScreen.qml \
qml/GlacierRotation.qml \ qml/GlacierRotation.qml \
qml/DeviceLock.qml qml/DeviceLockUI.qml
qmlcompositor.path = /usr/share/lipstick-glacier-home-qt5/qml/compositor qmlcompositor.path = /usr/share/lipstick-glacier-home-qt5/qml/compositor
qmlcompositor.files = qml/compositor/WindowWrapperMystic.qml \ qmlcompositor.files = qml/compositor/WindowWrapperMystic.qml \
...@@ -108,8 +108,7 @@ OTHER_FILES += qml/*.qml \ ...@@ -108,8 +108,7 @@ OTHER_FILES += qml/*.qml \
qml/BatteryPanel.qml \ qml/BatteryPanel.qml \
qml/CommonPanel.qml \ qml/CommonPanel.qml \
qml/ShutdownScreen.qml \ qml/ShutdownScreen.qml \
qml/GlacierRotation.qml \ qml/GlacierRotation.qml
qml/DeviceLock.qml
TRANSLATIONS += i18n/glacer-home.ts 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