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