summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Login.qml10
-rw-r--r--controller.cxx4
-rw-r--r--pages/ConfirmPassword.qml5
3 files changed, 7 insertions, 12 deletions
diff --git a/Login.qml b/Login.qml
index 17f60d1..b79ec87 100644
--- a/Login.qml
+++ b/Login.qml
@@ -2,14 +2,12 @@ import QtQuick 2.12
LoginForm {
signal logIn(string name, string password)
+ function createProfile() {
+ stackView.push("qrc:/pages/CreateProfile.qml")
+ }
objectName: "login"
width: appWindow.width
height: appWindow.height
-
- emailButton {
- onClicked: {
- stackView.push("qrc:/pages/Email.qml")
- }
- }
+ emailButton.onClicked: stackView.push("qrc:/pages/Email.qml")
}
diff --git a/controller.cxx b/controller.cxx
index 9b471d3..b256a3e 100644
--- a/controller.cxx
+++ b/controller.cxx
@@ -16,10 +16,10 @@ Controller::Controller(QObject* parent) : QObject{parent}
auto loginView = appWindow->findChild<QObject*>("login");
connect(loginView, SIGNAL(logIn(QString, QString)),
worker, SLOT(logIn(QString, QString)));
+ connect(worker, SIGNAL(logged(rt_user*)), loginView, SLOT(createProfile()));
auto user = engine->singletonInstance<User*>(User::typeId);
- connect(worker, SIGNAL(logged(rt_user*))
- , user, SLOT(update(rt_user*)));
+ connect(worker, SIGNAL(logged(rt_user*)), user, SLOT(update(rt_user*)));
thread.start();
}
diff --git a/pages/ConfirmPassword.qml b/pages/ConfirmPassword.qml
index 614891c..37e2ce0 100644
--- a/pages/ConfirmPassword.qml
+++ b/pages/ConfirmPassword.qml
@@ -18,9 +18,6 @@ PasswordForm {
createPassButton {
text: qsTr("Confirm password")
- onClicked: {
- login.logIn(User.name, User.password)
- stackView.push("qrc:/pages/CreateProfile.qml")
- }
+ onClicked: login.logIn(User.name, User.password)
}
}