Commit ab5bb3aa authored by m2ko's avatar m2ko Committed by eekkelund

Latest tries

parent 05dfe712
#include "glacierauthenticationinput.h"
/*GlacierAuthenticationInput::GlacierAuthenticationInput()
{
}
*/
#ifndef GLACIERAUTHENTICATIONINPUT_H
#define GLACIERAUTHENTICATIONINPUT_H
#include <nemo-devicelock/authenticationinput.h>
class GlacierAuthenticationInput: public NemoDeviceLock::AuthenticationInput
{
Q_OBJECT
public:
explicit GlacierAuthenticationInput(QObject *parent = nullptr)
: NemoDeviceLock::AuthenticationInput(DeviceLock, parent)
{
}
};
#endif // GLACIERAUTHENTICATIONINPUT_H
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
#include <QQmlContext> #include <QQmlContext>
#include "glacierwindowmodel.h" #include "glacierwindowmodel.h"
#include <QScreen> #include <QScreen>
#include "glacierauthenticationinput.h"
int main(int argc, char **argv) int main(int argc, char **argv)
...@@ -62,7 +61,6 @@ int main(int argc, char **argv) ...@@ -62,7 +61,6 @@ int main(int argc, char **argv)
nativeOrientation = app.primaryScreen()->primaryOrientation(); nativeOrientation = app.primaryScreen()->primaryOrientation();
app.engine()->rootContext()->setContextProperty("nativeOrientation", nativeOrientation); app.engine()->rootContext()->setContextProperty("nativeOrientation", nativeOrientation);
qmlRegisterType<GlacierWindowModel>("org.nemomobile.glacier", 1, 0 ,"GlacierWindowModel"); qmlRegisterType<GlacierWindowModel>("org.nemomobile.glacier", 1, 0 ,"GlacierWindowModel");
qmlRegisterType<GlacierAuthenticationInput>("org.nemomobile.glacierauthentication", 1, 0, "GlacierAuthenticationInput");
app.setQmlPath("/usr/share/lipstick-glacier-home-qt5/qml/MainScreen.qml"); app.setQmlPath("/usr/share/lipstick-glacier-home-qt5/qml/MainScreen.qml");
// Give these to the environment inside the lipstick homescreen // Give these to the environment inside the lipstick homescreen
// Fixes a bug where some applications wouldn't launch, eg. terminal or browser // Fixes a bug where some applications wouldn't launch, eg. terminal or browser
......
...@@ -4,9 +4,9 @@ import QtQuick.Controls.Nemo 1.0 ...@@ -4,9 +4,9 @@ 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.glacierauthentication 1.0
import org.nemomobile.lipstick 0.1 import org.nemomobile.lipstick 0.1
import org.nemomobile.devicelock 1.0 import org.nemomobile.devicelock 1.0
import org.nemomobile.dbus 1.0
import "scripts/desktop.js" as Desktop import "scripts/desktop.js" as Desktop
...@@ -20,7 +20,7 @@ Item { ...@@ -20,7 +20,7 @@ Item {
onShouldAuthenticateChanged: { onShouldAuthenticateChanged: {
if (shouldAuthenticate) { if (shouldAuthenticate) {
//console.log("Requesting security code "+ authenticationInput.status) console.log("Requesting security code "+JSON.stringify(authenticationInput))//+ authenticationInput.status)
//authenticationInput.requestSecurityCode() //authenticationInput.requestSecurityCode()
//DeviceLock.authorization.requestChallenge() //DeviceLock.authorization.requestChallenge()
} else { } else {
...@@ -42,18 +42,20 @@ Item { ...@@ -42,18 +42,20 @@ Item {
DeviceLock.authorization.allowedMethods) DeviceLock.authorization.allowedMethods)
} }
}*/ }*/
/*authenticationInput.onAuthenticationUnavailable: {
Authenticator { console.log("Authentication unavailable: "+error)
id: auth
Component.onCompleted: {
console.log("Requesting challenge")
Authorization.requestChallege()
} }
authenticationInput.onFeedback: {
onAuthenticated: { console.log("Feedback: "+feedback)
console.log("Authenticated: "+DeviceLock.state)
} }
authenticationInput.onAuthenticationStarted: {
console.log("Authentication started")
} }
authenticationInput.onAuthenticationEnded: {
console.log("Ended "+confirmed)
}*/
ColumnLayout { ColumnLayout {
anchors.fill: parent anchors.fill: parent
...@@ -108,11 +110,12 @@ Item { ...@@ -108,11 +110,12 @@ Item {
if (numLabel.text !== "Ca" && numLabel.text !== "OK") { if (numLabel.text !== "Ca" && numLabel.text !== "OK") {
//console.log(authenticationInput.Status) //console.log(authenticationInput.Status)
lockCodeField.insert(lockCodeField.cursorPosition, numLabel.text) lockCodeField.insert(lockCodeField.cursorPosition, numLabel.text)
authenticationInput.requestSecurityCode()
} else { } else {
if (numLabel.text === "OK") { if (numLabel.text === "OK") {
console.log("DeviceLockUI: "+auth.availableMethods) console.log("DeviceLockUI: "+JSON.stringify(authenticationInput))
auth.authenticate(Authorization.challengeCode, auth.availableMethods) //auth.authenticate(Authorization.challengeCode, auth.availableMethods)
//authenticationInput.enterSecurityCode(lockCodeField.text) authenticationInput.enterSecurityCode(lockCodeField.text)
//codeEntered(lockCodeField.text) //codeEntered(lockCodeField.text)
lockCodeField.text = "" lockCodeField.text = ""
} else if (numLabel.text === "Ca"){ } else if (numLabel.text === "Ca"){
......
...@@ -3,7 +3,6 @@ import QtQuick 2.6 ...@@ -3,7 +3,6 @@ import QtQuick 2.6
import org.nemomobile.lipstick 0.1 import org.nemomobile.lipstick 0.1
import org.nemomobile.devicelock 1.0 import org.nemomobile.devicelock 1.0
import org.nemomobile.configuration 1.0 import org.nemomobile.configuration 1.0
import org.nemomobile.glacierauthentication 1.0
import "notifications" import "notifications"
...@@ -185,15 +184,27 @@ Image { ...@@ -185,15 +184,27 @@ Image {
console.log("Security code entered: "+authenticationInput.minimumCodeLength) console.log("Security code entered: "+authenticationInput.minimumCodeLength)
} }
authenticationInput: GlacierAuthenticationInput { authenticationInput: DeviceLockAuthenticationInput {
property bool unlocked: DeviceLock.state >= DeviceLock.Locked //property bool unlocked: DeviceLock.state >= DeviceLock.Locked
readonly property bool unlocking: registered
&& DeviceLock.state >= DeviceLock.Locked && DeviceLock.state < DeviceLock.Undefined
registered: true registered: true
active: true
//active: lockscreenVisible() //active: lockscreenVisible()
onUnlockedChanged: console.log("Unlock") // onUnlockedChanged: console.log("Unlock")
onStatusChanged: { onStatusChanged: {
console.log("Status changed") console.log("Status changed")
} }
onUnlockingChanged: {
console.log("Unlock")
if (unlocking) {
DeviceLock.unlock()
} else {
DeviceLock.cancel()
}
}
onAuthenticationUnavailable: { onAuthenticationUnavailable: {
console.log("Authentication unavailable: "+error) console.log("Authentication unavailable: "+error)
} }
......
...@@ -99,17 +99,14 @@ CONFIG += qt link_pkgconfig ...@@ -99,17 +99,14 @@ CONFIG += qt link_pkgconfig
QT += quick compositor QT += quick compositor
DEFINES += QT_COMPOSITOR_QUICK DEFINES += QT_COMPOSITOR_QUICK
HEADERS += \ HEADERS += \
glacierwindowmodel.h \ glacierwindowmodel.h
glacierauthenticationinput.h
QT += dbus QT += dbus
LIBS += -lnemodevicelock LIBS += -lnemodevicelock
MOC_DIR = .moc MOC_DIR = .moc
SOURCES += \ SOURCES += \
main.cpp \ main.cpp \
glacierwindowmodel.cpp \ glacierwindowmodel.cpp
glacierauthenticationinput.cpp
PKGCONFIG += lipstick-qt5 \ PKGCONFIG += lipstick-qt5 \
nemodevicelock nemodevicelock
......
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