From b7baeea2ab0f999a755226b79242f78a472d5a80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=A6=8C=20=EA=A6=AB=EA=A6=B6=20=EA=A6=8F=EA=A7=80?= =?UTF-8?q?=EA=A6=A6=EA=A6=BF=20=EA=A6=A7=20=EA=A6=AE=20=EA=A6=91=20?= =?UTF-8?q?=EA=A6=A9=20=EA=A6=AD=EA=A7=80?= Date: Thu, 19 Sep 2019 22:15:47 +0800 Subject: Replaced UIs whose replacements are ready in Larva and reorganise logical QML files --- ConfirmPassword.qml | 28 +++++++++++++ CreateProfile.qml | 20 +++++++++ Email.qml | 22 ++++++++++ Home.qml | 6 +++ Login.qml | 40 ++++++++++++------ LoginEmail.qml | 18 +++++++++ LoginPassword.qml | 20 +++++++++ Onboarding.qml | 16 ++++++++ Password.qml | 23 +++++++++++ Profile.qml | 19 +++++++++ assets/arrow-back-24px.svg | 1 - assets/arrow-forward-24px.svg | 1 + assets/email-24px.svg | 1 - assets/lock-24px.svg | 1 - controller.cxx | 10 ++--- kelakon.qrc | 90 +++++++++++++++++------------------------ main.qml | 31 +++++++------- onboarding-1.png | Bin 0 -> 114484 bytes pages/ConfirmPassword.qml | 24 ----------- pages/CreateProfile.qml | 18 --------- pages/CreateProfileForm.ui.qml | 2 + pages/Email.qml | 18 --------- pages/EmailForm.ui.qml | 2 + pages/Home.qml | 7 ---- pages/LoginName.qml | 19 --------- pages/LoginPass.qml | 20 --------- pages/Password.qml | 19 --------- pages/PasswordForm.ui.qml | 2 + pages/Profile.qml | 16 -------- 29 files changed, 263 insertions(+), 231 deletions(-) create mode 100644 ConfirmPassword.qml create mode 100644 CreateProfile.qml create mode 100644 Email.qml create mode 100644 Home.qml create mode 100644 LoginEmail.qml create mode 100644 LoginPassword.qml create mode 100644 Onboarding.qml create mode 100644 Password.qml create mode 100644 Profile.qml delete mode 100644 assets/arrow-back-24px.svg create mode 100644 assets/arrow-forward-24px.svg delete mode 100644 assets/email-24px.svg delete mode 100644 assets/lock-24px.svg create mode 100644 onboarding-1.png delete mode 100644 pages/ConfirmPassword.qml delete mode 100644 pages/CreateProfile.qml delete mode 100644 pages/Email.qml delete mode 100644 pages/Home.qml delete mode 100644 pages/LoginName.qml delete mode 100644 pages/LoginPass.qml delete mode 100644 pages/Password.qml delete mode 100644 pages/Profile.qml diff --git a/ConfirmPassword.qml b/ConfirmPassword.qml new file mode 100644 index 0000000..88618a3 --- /dev/null +++ b/ConfirmPassword.qml @@ -0,0 +1,28 @@ +import QtQuick 2.12 +import KelakonUser 0.1 +import "pages" + +PasswordForm { + backButton { + icon.source: "larva/components/icons/arrow-back-24px.svg" + onClicked: pageView.pop() + } + + userEmail.y: 292 + passImage.source: "larva/components/icons/lock-24px.svg" + instructionLabel.text: qsTr("Re-Enter password") + emailAddressLabel.text: User.name + + passTextField { + placeholderText: qsTr("Re-enter Password") + onTextChanged: + if (passTextField.text == User.password) + createPassButton.enabled = true + } + + createPassButton { + enabled: false + text: qsTr("Confirm password") + onClicked: pageView.push("CreateProfile.qml") + } +} diff --git a/CreateProfile.qml b/CreateProfile.qml new file mode 100644 index 0000000..16176ba --- /dev/null +++ b/CreateProfile.qml @@ -0,0 +1,20 @@ +import QtQuick 2.12 +import KelakonUser 0.1 +import "pages" + +CreateProfileForm { + backButton { + icon.source: "larva/components/icons/arrow-back-24px.svg" + onClicked: pageView.pop() + } + + skipButton.onClicked: pageView.push("Home.qml") + emailImage.source: "larva/components/icons/email-24px.svg" + emailAddressLabel.text: User.emailAddress + startUsingKelakon.onClicked: { + User.name = userNameLabel.text + User.realName = enterFullName.text + onboarding.ticketNew("Kelakon", User.realName + " <" + User.emailAddress + + ">") + } +} diff --git a/Email.qml b/Email.qml new file mode 100644 index 0000000..5ab8953 --- /dev/null +++ b/Email.qml @@ -0,0 +1,22 @@ +import QtQuick 2.12 +import KelakonUser 0.1 +import "pages" + +EmailForm { + backButton { + icon.source: "larva/components/icons/arrow-back-24px.svg" + onClicked: pageView.pop() + } + + emailImage.source: "larva/components/icons/email-24px.svg" + + emailTextField.onTextChanged: { + if (!emailTextField.text || !loginButton.enabled) + loginButton.enabled = !loginButton.enabled + } + + loginButton.onClicked: { + User.emailAddress = emailTextField.text + pageView.push("Password.qml") + } +} diff --git a/Home.qml b/Home.qml new file mode 100644 index 0000000..99448d2 --- /dev/null +++ b/Home.qml @@ -0,0 +1,6 @@ +import QtQuick 2.12 +import "pages" + +HomeForm { + menuButton.onClicked: drawer.visible = !drawer.visible +} diff --git a/Login.qml b/Login.qml index 67e4942..965d9ff 100644 --- a/Login.qml +++ b/Login.qml @@ -1,18 +1,32 @@ import QtQuick 2.12 -import "larva/features" +import QtQuick.Controls 2.12 +import QtQuick.Controls.Material 2.12 +import QtQuick.Layouts 1.12 -OnboardingForm { - signal logIn(string name, string password) - signal ticketNew(string queue, string requestor) - signal ticketSearch(string name) - function pushProfile() { - stackView.push("qrc:/pages/Profile.qml") +Page { + header: ToolBar { + background: Rectangle { + color: "#FAFFFFFF" + } + RowLayout { + ToolButton { + id: toolButton + icon.name: "back-button" + icon.source: "larva/components/icons/arrow-back-24px.svg" + highlighted: true + onClicked: + if (pageView.depth > 1) + pageView.pop() + else + drawer.open() + } + } } - objectName: "login" - width: appWindow.width - height: appWindow.height - logoImage.source: "kelakon-logo.png" - registerButton.onClicked: stackView.push("qrc:/pages/Email.qml") - loginButton.onClicked: stackView.push("qrc:/pages/LoginName.qml") + StackView { + id: contentView + anchors.topMargin: 432 + anchors.fill: parent + initialItem: LoginEmail{} + } } diff --git a/LoginEmail.qml b/LoginEmail.qml new file mode 100644 index 0000000..d699e19 --- /dev/null +++ b/LoginEmail.qml @@ -0,0 +1,18 @@ +import QtQuick 2.12 +import KelakonUser 0.1 +import "larva/features" + +LoginEmailForm { + emailTextField.onTextChanged: { + if (!emailTextField.text || !continueButton.enabled) + continueButton.enabled = !continueButton.enabled + } + + continueButton { + icon.source: "assets/arrow-forward-24px.svg" + onClicked: { + User.name = emailTextField.text + contentView.push("LoginPassword.qml") + } + } +} diff --git a/LoginPassword.qml b/LoginPassword.qml new file mode 100644 index 0000000..5e510d2 --- /dev/null +++ b/LoginPassword.qml @@ -0,0 +1,20 @@ +import QtQuick 2.12 +import KelakonUser 0.1 +import "larva/features" + +LoginPasswordForm { + emailTextLabel.text: User.name + + passwordTextField.onTextChanged: { + if (!passwordTextField.text || !continueButton.enabled) + continueButton.enabled = !continueButton.enabled + } + + continueButton { + icon.source: "assets/arrow-forward-24px.svg" + onClicked: { + User.password = passwordTextField.text + onClicked: onboarding.logIn(User.name, User.password) + } + } +} diff --git a/Onboarding.qml b/Onboarding.qml new file mode 100644 index 0000000..291f3c9 --- /dev/null +++ b/Onboarding.qml @@ -0,0 +1,16 @@ +import QtQuick 2.12 +import "larva/features" + +OnboardingForm { + signal logIn(string name, string password) + signal ticketNew(string queue, string requestor) + signal ticketSearch(string name) + function pushProfile() { + pageView.push("Profile.qml") + } + + objectName: "onboarding" + logoImage.source: "kelakon-logo.png" + registerButton.onClicked: pageView.push("Email.qml") + loginButton.onClicked: pageView.push("Login.qml") +} diff --git a/Password.qml b/Password.qml new file mode 100644 index 0000000..6792c1e --- /dev/null +++ b/Password.qml @@ -0,0 +1,23 @@ +import QtQuick 2.12 +import KelakonUser 0.1 +import "pages" + +PasswordForm { + backButton { + icon.source: "larva/components/icons/arrow-back-24px.svg" + onClicked: pageView.pop() + } + + passImage.source: "larva/components/icons/lock-24px.svg" + emailAddressLabel.text: User.name + + passTextField.onTextChanged: { + if (!passTextField.text || !createPassButton.enabled) + createPassButton.enabled = !createPassButton.enabled + } + + createPassButton.onClicked: { + User.password = passTextField.text + pageView.push("ConfirmPassword.qml") + } +} diff --git a/Profile.qml b/Profile.qml new file mode 100644 index 0000000..d0d258c --- /dev/null +++ b/Profile.qml @@ -0,0 +1,19 @@ +import QtQuick 2.12 +import KelakonUser 0.1 +import "pages" + +CreateProfileForm { + backButton { + icon.source: "larva/components/icons/arrow-back-24px.svg" + onClicked: pageView.pop() + } + titleLabel.text: qsTr("Edit Profile") + skipButton.onClicked: { + onboarding.ticketSearch(User.name) + pageView.push("Home.qml") + } + emailImage.source: "larva/components/icons/email-24px.svg" + enterFullName.text: User.realName + userNameLabel.text: User.name + emailAddressLabel.text: User.emailAddress +} diff --git a/assets/arrow-back-24px.svg b/assets/arrow-back-24px.svg deleted file mode 100644 index 9d5f05f..0000000 --- a/assets/arrow-back-24px.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/assets/arrow-forward-24px.svg b/assets/arrow-forward-24px.svg new file mode 100644 index 0000000..842e7d0 --- /dev/null +++ b/assets/arrow-forward-24px.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/email-24px.svg b/assets/email-24px.svg deleted file mode 100644 index 1ed4686..0000000 --- a/assets/email-24px.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/assets/lock-24px.svg b/assets/lock-24px.svg deleted file mode 100644 index 1dbceea..0000000 --- a/assets/lock-24px.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/controller.cxx b/controller.cxx index c9403dd..82e439d 100644 --- a/controller.cxx +++ b/controller.cxx @@ -14,16 +14,16 @@ Controller::Controller(QObject* parent) : QObject{parent} auto rootObjects = engine->rootObjects(); auto appWindow = rootObjects[0]; - auto loginView = appWindow->findChild("login"); - connect(loginView, SIGNAL(logIn(QString, QString)) + auto onboardingView = appWindow->findChild("onboarding"); + connect(onboardingView, SIGNAL(logIn(QString, QString)) , client, SLOT(logIn(QString, QString))); connect(client, SIGNAL(loggedIn(QString)) , client, SLOT(userShow(QString))); connect(client, SIGNAL(userShown(rtclient_user*)) - , loginView, SLOT(pushProfile())); - connect(loginView, SIGNAL(ticketNew(QString, QString)) + , onboardingView, SLOT(pushProfile())); + connect(onboardingView, SIGNAL(ticketNew(QString, QString)) , client, SLOT(ticketNew(QString, QString))); - connect(loginView, SIGNAL(ticketSearch(QString)) + connect(onboardingView, SIGNAL(ticketSearch(QString)) , client, SLOT(ticketSearch(QString))); using RTClient::User; diff --git a/kelakon.qrc b/kelakon.qrc index 4e22d9e..e216def 100644 --- a/kelakon.qrc +++ b/kelakon.qrc @@ -1,55 +1,39 @@ - - main.qml - Login.qml - larva/features/OnboardingForm.ui.qml - kelakon-logo.png - larva/components/images/onboarding-1.png - pages/Email.qml - pages/EmailForm.ui.qml - assets/arrow-back-24px.svg - pages/Password.qml - pages/PasswordForm.ui.qml - qtquickcontrols2.conf - pages/ExistingLogin.qml - pages/ExistingLoginForm.ui.qml - pages/ConfirmPassword.qml - pages/CreateProfile.qml - pages/CreateProfileForm.ui.qml - pages/TaskForm.ui.qml - pages/TaskList.qml - pages/TaskListForm.ui.qml - assets/photo_camera_24px.svg - pages/Home.qml - pages/HomeForm.ui.qml - assets/menu-24px.svg - assets/check-box-outline-24px.svg - assets/chevron-right-24px.svg - assets/add-24px.svg - assets/profile-24px.svg - pages/Username.qml - pages/UsernameForm.ui.qml - assets/user-24px.svg - assets/email-24px.svg - assets/lock-24px.svg - pages/LoginName.qml - pages/LoginPass.qml - pages/Profile.qml - larva/components/layout/Card.qml - larva/components/layout/CardForm.ui.qml - larva/features/EnterPassword.qml - larva/features/EnterPasswordForm.ui.qml - larva/features/Login.qml - larva/features/LoginEmail.qml - larva/features/LoginEmailForm.ui.qml - larva/features/LoginPassword.qml - larva/features/LoginPasswordForm.ui.qml - larva/features/Onboarding.qml - larva/HomeForm.ui.qml - larva/LICENSE - larva/main.qml - larva/Page1Form.ui.qml - larva/Page2Form.ui.qml - larva/README.md - + + main.qml + Onboarding.qml + larva/features/OnboardingForm.ui.qml + kelakon-logo.png + larva/components/images/onboarding-1.png + Login.qml + larva/components/icons/arrow-back-24px.svg + LoginEmail.qml + larva/features/LoginEmailForm.ui.qml + assets/arrow-forward-24px.svg + larva/components/icons/email-24px.svg + LoginPassword.qml + larva/features/LoginPasswordForm.ui.qml + larva/components/icons/lock-24px.svg + Profile.qml + Email.qml + pages/EmailForm.ui.qml + Password.qml + pages/PasswordForm.ui.qml + ConfirmPassword.qml + CreateProfile.qml + pages/CreateProfileForm.ui.qml + Home.qml + pages/HomeForm.ui.qml + pages/TaskForm.ui.qml + pages/TaskList.qml + pages/TaskListForm.ui.qml + assets/photo_camera_24px.svg + assets/menu-24px.svg + assets/check-box-outline-24px.svg + assets/chevron-right-24px.svg + assets/add-24px.svg + assets/profile-24px.svg + assets/user-24px.svg + qtquickcontrols2.conf + diff --git a/main.qml b/main.qml index 3a550b9..233aa7a 100644 --- a/main.qml +++ b/main.qml @@ -1,23 +1,22 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Controls.Material 2.12 -import QtQuick.Layouts 1.12 -import "larva/features" ApplicationWindow { - id: window - visible: true - width: 360 - height: 640 - title: { - text: qsTr("kelakon") - } + id: window + visible: true + width: 360 + height: 640 + title: { + text: qsTr("kelakon") + } - - StackView { - id: pageView - anchors.fill: parent - - initialItem: Onboarding {} - } + StackView { + property alias onboarding: onboarding + id: pageView + anchors.fill: parent + initialItem: Onboarding { + id: onboarding + } + } } diff --git a/onboarding-1.png b/onboarding-1.png new file mode 100644 index 0000000..dce5270 Binary files /dev/null and b/onboarding-1.png differ diff --git a/pages/ConfirmPassword.qml b/pages/ConfirmPassword.qml deleted file mode 100644 index 6d37be7..0000000 --- a/pages/ConfirmPassword.qml +++ /dev/null @@ -1,24 +0,0 @@ -import QtQuick 2.12 -import KelakonUser 0.1 - -PasswordForm { - width: stackView.width - height: stackView.height - backButton.onClicked: stackView.pop() - userEmail.y: 292 - instructionLabel.text: qsTr("Re-Enter password") - emailAddressLabel.text: User.name - - passTextField { - placeholderText: qsTr("Re-enter Password") - onTextChanged: - if (passTextField.text == User.password) - createPassButton.enabled = true - } - - createPassButton { - enabled: false - text: qsTr("Confirm password") - onClicked: stackView.push("qrc:/pages/CreateProfile.qml") - } -} diff --git a/pages/CreateProfile.qml b/pages/CreateProfile.qml deleted file mode 100644 index 7d499e2..0000000 --- a/pages/CreateProfile.qml +++ /dev/null @@ -1,18 +0,0 @@ -import QtQuick 2.12 -import KelakonUser 0.1 - -CreateProfileForm { - width: stackView.width - height: stackView.height - backButton.onClicked: stackView.pop() - skipButton.onClicked: { - stackView.push("qrc:/pages/Home.qml") - } - emailAddressLabel.text: User.emailAddress - startUsingKelakon.onClicked: { - User.name = userNameLabel.text - User.realName = enterFullName.text - login.ticketNew("Kelakon", User.realName + " <" + User.emailAddress - + ">") - } -} diff --git a/pages/CreateProfileForm.ui.qml b/pages/CreateProfileForm.ui.qml index ac594c8..2eec4d7 100644 --- a/pages/CreateProfileForm.ui.qml +++ b/pages/CreateProfileForm.ui.qml @@ -12,6 +12,7 @@ Rectangle { property alias skipButton: skipButton property alias enterFullName: enterFullName property alias userNameLabel: userNameLabel + property alias emailImage: emailImage property alias emailAddressLabel: emailAddressLabel property alias startUsingKelakon: startUsingKelakon @@ -74,6 +75,7 @@ Rectangle { spacing: 8 Image { + id: emailImage width: 24 height: 24 opacity: 0.54 diff --git a/pages/Email.qml b/pages/Email.qml deleted file mode 100644 index 0919437..0000000 --- a/pages/Email.qml +++ /dev/null @@ -1,18 +0,0 @@ -import QtQuick 2.12 -import KelakonUser 0.1 - -EmailForm { - width: stackView.width - height: stackView.height - backButton.onClicked: stackView.pop() - - emailTextField.onTextChanged: { - if (!emailTextField.text || !loginButton.enabled) - loginButton.enabled = !loginButton.enabled - } - - loginButton.onClicked: { - User.emailAddress = emailTextField.text - stackView.push("qrc:/pages/Password.qml") - } -} diff --git a/pages/EmailForm.ui.qml b/pages/EmailForm.ui.qml index 26f124c..0f22dbc 100644 --- a/pages/EmailForm.ui.qml +++ b/pages/EmailForm.ui.qml @@ -10,6 +10,7 @@ Rectangle { property alias backButton: backButton property alias instructionLabel: instructionLabel + property alias emailImage: emailImage property alias emailTextField: emailTextField property alias loginButton: loginButton @@ -74,6 +75,7 @@ Rectangle { spacing: 8 Image { + id: emailImage width: 24 height: 24 opacity: 0.54 diff --git a/pages/Home.qml b/pages/Home.qml deleted file mode 100644 index 533b1b8..0000000 --- a/pages/Home.qml +++ /dev/null @@ -1,7 +0,0 @@ -import QtQuick 2.12 - -HomeForm { - width: stackView.width - height: stackView.height - menuButton.onClicked: drawer.visible = !drawer.visible -} diff --git a/pages/LoginName.qml b/pages/LoginName.qml deleted file mode 100644 index 9294056..0000000 --- a/pages/LoginName.qml +++ /dev/null @@ -1,19 +0,0 @@ -import QtQuick 2.12 -import KelakonUser 0.1 - -EmailForm { - width: stackView.width - height: stackView.height - backButton.onClicked: stackView.pop() - instructionLabel.text: qsTr("Enter your email") - - emailTextField.onTextChanged: { - if (!emailTextField.text || !loginButton.enabled) - loginButton.enabled = !loginButton.enabled - } - - loginButton.onClicked: { - User.name = emailTextField.text - stackView.push("qrc:/pages/LoginPass.qml") - } -} diff --git a/pages/LoginPass.qml b/pages/LoginPass.qml deleted file mode 100644 index 9e5d2f4..0000000 --- a/pages/LoginPass.qml +++ /dev/null @@ -1,20 +0,0 @@ -import QtQuick 2.12 -import KelakonUser 0.1 - -PasswordForm { - width: stackView.width - height: stackView.height - backButton.onClicked: stackView.pop() - instructionLabel.text: qsTr("Enter password") - emailAddressLabel.text: User.name - - passTextField.onTextChanged: { - if (!passTextField.text || !createPassButton.enabled) - createPassButton.enabled = !createPassButton.enabled - } - - createPassButton.onClicked: { - User.password = passTextField.text - onClicked: login.logIn(User.name, User.password) - } -} diff --git a/pages/Password.qml b/pages/Password.qml deleted file mode 100644 index 0b042c5..0000000 --- a/pages/Password.qml +++ /dev/null @@ -1,19 +0,0 @@ -import QtQuick 2.12 -import KelakonUser 0.1 - -PasswordForm { - width: stackView.width - height: stackView.height - backButton.onClicked: stackView.pop() - emailAddressLabel.text: User.name - - passTextField.onTextChanged: { - if (!passTextField.text || !createPassButton.enabled) - createPassButton.enabled = !createPassButton.enabled - } - - createPassButton.onClicked: { - User.password = passTextField.text - stackView.push("qrc:/pages/ConfirmPassword.qml") - } -} diff --git a/pages/PasswordForm.ui.qml b/pages/PasswordForm.ui.qml index d4849fd..011af8c 100644 --- a/pages/PasswordForm.ui.qml +++ b/pages/PasswordForm.ui.qml @@ -11,6 +11,7 @@ Rectangle { property alias backButton: backButton property alias instructionLabel: instructionLabel property alias userEmail: userEmail + property alias passImage: passImage property alias passTextField: passTextField property alias createPassButton: createPassButton property alias emailAddressLabel: emailAddressLabel @@ -107,6 +108,7 @@ Rectangle { height: 56 Image { + id: passImage width: 24 height: 24 opacity: 0.54 diff --git a/pages/Profile.qml b/pages/Profile.qml deleted file mode 100644 index b72b108..0000000 --- a/pages/Profile.qml +++ /dev/null @@ -1,16 +0,0 @@ -import QtQuick 2.12 -import KelakonUser 0.1 - -CreateProfileForm { - width: stackView.width - height: stackView.height - backButton.onClicked: stackView.pop() - titleLabel.text: qsTr("Edit Profile") - skipButton.onClicked: { - login.ticketSearch(User.name) - stackView.push("qrc:/pages/Home.qml") - } - enterFullName.text: User.realName - userNameLabel.text: User.name - emailAddressLabel.text: User.emailAddress -} -- cgit v1.2.3