summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id>2019-09-17 19:52:50 +0800
committerꦌ ꦫꦶ ꦏ꧀ꦦꦿ ꦧ ꦮ ꦑ ꦩ ꦭ꧀ <erik@darapsa.co.id>2019-09-17 19:52:50 +0800
commit3ac6ebbc5243f2b0ddddcfc58ba81eb686fb5aa2 (patch)
tree3ec457122cc34f4ecfcfad2a816deeba4aaa4dc4
parentacf879ebafaa870fc5ef942effa660a08041557e (diff)
Sign up functionality
-rw-r--r--Login.qml25
-rw-r--r--controller.cxx16
-rw-r--r--pages/ConfirmPassword.qml7
-rw-r--r--pages/CreateProfile.qml31
-rw-r--r--pages/CreateProfileForm.ui.qml1
-rw-r--r--pages/Email.qml2
m---------qrtclient0
7 files changed, 74 insertions, 8 deletions
diff --git a/Login.qml b/Login.qml
index d6accbe..1c46157 100644
--- a/Login.qml
+++ b/Login.qml
@@ -2,6 +2,31 @@ import QtQuick 2.12
LoginForm {
signal logIn(string name, string password)
+ signal signUp(
+ string name
+ , string emailAddress
+ , string realName
+ , string nickName
+ , string gecos
+ , int lang
+ , int timeZone
+ , string contactInfo
+ , bool enabled
+ , bool privileged
+ , string password
+ , string comments
+ , string signature
+ , string organization
+ , string address1
+ , string address2
+ , string city
+ , string state
+ , string zip
+ , string country
+ , string homePhone
+ , string workPhone
+ , string mobilePhone
+ , string pagerPhone)
signal search(string name)
function pushProfile() {
stackView.push("qrc:/pages/Profile.qml")
diff --git a/controller.cxx b/controller.cxx
index 26ac9d0..96a1d8f 100644
--- a/controller.cxx
+++ b/controller.cxx
@@ -15,8 +15,20 @@ Controller::Controller(QObject* parent) : QObject{parent}
auto appWindow = rootObjects[0];
auto loginView = appWindow->findChild<QObject*>("login");
- connect(loginView, SIGNAL(logIn(QString, QString)),
- client, SLOT(logIn(QString, QString)));
+ connect(loginView, SIGNAL(logIn(QString, QString))
+ , client, SLOT(logIn(QString, QString)));
+ connect(loginView, SIGNAL(signUp(QString, QString, QString, QString
+ , QString, int, int
+ , QString, bool, bool, QString, QString
+ , QString, QString, QString, QString
+ , QString, QString, QString, QString
+ , QString, QString, QString, QString))
+ , client, SLOT(userNew(QString, QString, QString, QString
+ , QString, int, int
+ , QString, bool, bool, QString, QString
+ , QString, QString, QString, QString
+ , QString, QString, QString, QString
+ , QString, QString, QString, QString)));
connect(client, SIGNAL(logged(rt_user*)), loginView, SLOT(pushProfile()));
connect(loginView, SIGNAL(search(QString)), client, SLOT(search(QString)));
diff --git a/pages/ConfirmPassword.qml b/pages/ConfirmPassword.qml
index 37e2ce0..6d37be7 100644
--- a/pages/ConfirmPassword.qml
+++ b/pages/ConfirmPassword.qml
@@ -12,12 +12,13 @@ PasswordForm {
passTextField {
placeholderText: qsTr("Re-enter Password")
onTextChanged:
- if (!passTextField.text || !createPassButton.enabled)
- createPassButton.enabled = !createPassButton.enabled
+ if (passTextField.text == User.password)
+ createPassButton.enabled = true
}
createPassButton {
+ enabled: false
text: qsTr("Confirm password")
- onClicked: login.logIn(User.name, User.password)
+ onClicked: stackView.push("qrc:/pages/CreateProfile.qml")
}
}
diff --git a/pages/CreateProfile.qml b/pages/CreateProfile.qml
index 483814f..b0b03a1 100644
--- a/pages/CreateProfile.qml
+++ b/pages/CreateProfile.qml
@@ -6,9 +6,36 @@ CreateProfileForm {
height: stackView.height
backButton.onClicked: stackView.pop()
skipButton.onClicked: {
- login.search(User.name)
stackView.push("qrc:/pages/Home.qml")
}
emailAddressLabel.text: User.emailAddress
- enterFullName.text: User.realName
+ startUsingKelakon.onClicked: {
+ User.name = userNameLabel.text
+ User.realName = enterFullName.text
+ login.signUp(
+ User.name
+ , User.emailAddress
+ , User.realName
+ , ""
+ , ""
+ , 0
+ , 0
+ , ""
+ , true
+ , false
+ , User.password
+ , ""
+ , ""
+ , ""
+ , ""
+ , ""
+ , ""
+ , ""
+ , ""
+ , ""
+ , ""
+ , ""
+ , ""
+ , "")
+ }
}
diff --git a/pages/CreateProfileForm.ui.qml b/pages/CreateProfileForm.ui.qml
index 2b1ce91..ab1f828 100644
--- a/pages/CreateProfileForm.ui.qml
+++ b/pages/CreateProfileForm.ui.qml
@@ -12,6 +12,7 @@ Rectangle {
property alias enterFullName: enterFullName
property alias userNameLabel: userNameLabel
property alias emailAddressLabel: emailAddressLabel
+ property alias startUsingKelakon: startUsingKelakon
ToolBar {
id: toolbar
diff --git a/pages/Email.qml b/pages/Email.qml
index a78f655..0919437 100644
--- a/pages/Email.qml
+++ b/pages/Email.qml
@@ -12,7 +12,7 @@ EmailForm {
}
loginButton.onClicked: {
- User.name = emailTextField.text
+ User.emailAddress = emailTextField.text
stackView.push("qrc:/pages/Password.qml")
}
}
diff --git a/qrtclient b/qrtclient
-Subproject 516938ade5b04a03423ca1a7632222510b21224
+Subproject 54ea1894dcfaed86478bab8d00385ae7b5cb2f0