Commit 3a1cbc12 authored by Jonah Brüchert's avatar Jonah Brüchert 🌳

Implement registration ui from mockup

parent 826556a6
Pipeline #6050 passed with stages
in 33 minutes and 41 seconds
......@@ -11,6 +11,7 @@
<file alias="qml/UserProfilePage.qml">src/qml/UserProfilePage.qml</file>
<file alias="qml/RegisterPage.qml">src/qml/RegisterPage.qml</file>
<file alias="qml/FirstStartPage.qml">src/qml/FirstStartPage.qml</file>
<file alias="qml/LoginOrRegisterPage.qml">src/qml/LoginOrRegisterPage.qml</file>
<file alias="qml/elements/SubRequestAcceptSheet.qml">src/qml/elements/SubRequestAcceptSheet.qml</file>
<file alias="qml/elements/RosterAddContactSheet.qml">src/qml/elements/RosterAddContactSheet.qml</file>
......@@ -36,7 +37,6 @@
<file alias="qml/settings/SettingsPage.qml">src/qml/settings/SettingsPage.qml</file>
<file alias="qml/settings/SettingsSheet.qml">src/qml/settings/SettingsSheet.qml</file>
<file alias="qml/settings/ChangePassword.qml">src/qml/settings/ChangePassword.qml</file>
<file alias="qtquickcontrols2.conf">misc/qtquickcontrols2.conf</file>
</qresource>
</RCC>
......@@ -7,71 +7,31 @@ Kirigami.Page {
title: "Kaidan"
ColumnLayout {
// For desktop or tablet devices
Layout.alignment: Qt.AlignCenter
anchors.fill: parent
ColumnLayout {
// For desktop or tablet devices
Image {
source: kaidan.utils.getResourcePath("images/kaidan.svg")
Layout.preferredWidth: Kirigami.Units.gridUnit * 9
Layout.preferredHeight: Kirigami.Units.gridUnit * 9
Layout.alignment: Qt.AlignCenter
Layout.maximumWidth: Kirigami.Units.gridUnit * 25
Image {
source: kaidan.utils.getResourcePath("images/kaidan.svg")
Layout.preferredWidth: Kirigami.Units.gridUnit * 9
Layout.preferredHeight: Kirigami.Units.gridUnit * 9
Layout.alignment: Qt.AlignCenter
fillMode: Image.PreserveAspectFit
mipmap: true
sourceSize: Qt.size(width, height)
Layout.bottomMargin: Kirigami.Units.gridUnit * 5
}
Controls.Label {
text: qsTr("How do you want to start using Kaidan?")
}
/*ColumnLayout {
Controls.Button {
Layout.fillWidth: true
text: "Log in"
onClicked: {
pageStack.defaultColumnWidth = Kirigami.Units.gridUnit * 5000 // display only one page at the time
pageStack.push(registerPage)
}
}
Controls.Button {
Layout.fillWidth: true
text: "Register"
onClicked: {
pageStack.defaultColumnWidth = Kirigami.Units.gridUnit * 5000 // display only one page at the time
pageStack.push(loginPage)
}
}
}*/
fillMode: Image.PreserveAspectFit
mipmap: true
sourceSize: Qt.size(width, height)
Layout.bottomMargin: Kirigami.Units.gridUnit * 5
}
ColumnLayout {
Controls.RadioButton {
id: registerCheck
checked: true
text: qsTr("Create an account")
}
Controls.RadioButton {
id: loginCheck
text: qsTr("Log into my existing account")
}
}
Controls.RoundButton {
Layout.alignment: Qt.AlignRight | Qt.AlignBottom
icon.name: "go-next-symbolic"
onClicked: {
pageStack.defaultColumnWidth = Kirigami.Units.gridUnit * 5000 // display only one page at the time
Kirigami.Heading {
Layout.alignment: Qt.AlignCenter
text: qsTr("Welcome to Kaidan")
}
Controls.ToolButton {
Layout.alignment: Qt.AlignBottom | Qt.AlignRight
icon.name: "go-next-symbolic"
text: qsTr("Let's start")
if (registerCheck.checked)
pageStack.push(registerPage)
else if (loginCheck.checked)
pageStack.push(loginPage)
}
}
onClicked: pageStack.layers.push(qrCodeScannerPage)
}
}
}
/*
* Kaidan - A user-friendly XMPP client for every device!
*
* Copyright (C) 2016-2019 Kaidan developers and contributors
* (see the LICENSE file for a full list of copyright authors)
*
* Kaidan is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* In addition, as a special exception, the author of Kaidan gives
* permission to link the code of its release with the OpenSSL
* project's "OpenSSL" library (or with modified versions of it that
* use the same license as the "OpenSSL" library), and distribute the
* linked executables. You must obey the GNU General Public License in
* all respects for all of the code used other than "OpenSSL". If you
* modify this file, you may extend this exception to your version of
* the file, but you are not obligated to do so. If you do not wish to
* do so, delete this exception statement from your version.
*
* Kaidan is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Kaidan. If not, see <http://www.gnu.org/licenses/>.
*/
import QtQuick 2.0
import QtQuick.Layouts 1.2
import QtQuick.Controls 2.2 as Controls
import org.kde.kirigami 2.2 as Kirigami
Kirigami.Page {
title: qsTr("Do you already have an account?")
ColumnLayout {
anchors.fill: parent
ColumnLayout {
Layout.maximumWidth: Kirigami.Units.gridUnit * 25
Layout.alignment: Qt.AlignHCenter
Controls.RadioButton {
id: registerCheck
checked: false
text: qsTr("Create an account")
onClicked: loginOrRegister(!checked)
}
Controls.RadioButton {
id: loginCheck
text: qsTr("Log into my existing account")
onClicked: loginOrRegister(checked)
}
}
}
function loginOrRegister(login) {
if (login)
pageStack.layers.push(loginPage)
else
pageStack.layers.push(registerPage)
}
}
......@@ -38,14 +38,6 @@ import im.kaidan.kaidan 1.0
Kirigami.Page {
title: qsTr("Log in")
actions.contextualActions: [
Kirigami.Action {
text: qsTr("Log in using a QR-Code")
icon.name: "view-barcode"
onTriggered: pageStack.layers.push(qrCodeScannerPage)
}
]
ColumnLayout {
anchors.fill: parent
......@@ -70,19 +62,13 @@ Kirigami.Page {
id: jidLabel
text: qsTr("Your Jabber-ID:")
}
RowLayout {
Controls.TextField {
id: jidField
text: kaidan.jid
placeholderText: qsTr("user@example.org")
Layout.fillWidth: true
selectByMouse: true
inputMethodHints: Qt.ImhEmailCharactersOnly
}
Controls.Button {
icon.name: "view-barcode"
onClicked: passiveNotification("This should open the QR-Code scanner etc..") // TODO
}
Controls.TextField {
id: jidField
text: kaidan.jid
placeholderText: qsTr("user@example.org")
Layout.fillWidth: true
selectByMouse: true
inputMethodHints: Qt.ImhEmailCharactersOnly
}
// Password field
......
......@@ -29,13 +29,15 @@
*/
import QtQuick 2.0
import QtQuick.Layouts 1.3
import QtQuick.Controls 2.3 as Controls
import QtMultimedia 5.9
import org.kde.kirigami 2.4 as Kirigami
import org.kde.kirigami 2.5 as Kirigami
import im.kaidan.kaidan 1.0
// QR code scanner output and decoding for logging in by a decoded XMPP URI
Kirigami.Page {
id: qrCodeScannerPage
leftPadding: 0
rightPadding: 0
topPadding: 0
......@@ -43,6 +45,7 @@ Kirigami.Page {
title: qsTr("Scan QR code")
// message to be shown if no camera can be found
Kirigami.InlineMessage {
visible: {
......@@ -96,4 +99,26 @@ Kirigami.Page {
focusPointMode: Camera.FocusPointCenter
}
}
Kirigami.InlineMessage {
id: message
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
visible: true
implicitHeight: 100
icon.source: "computer"
text: qsTr("If you are already logged in on another device, scan its QR-Code to automatically transfer your credentials. You will be able to use Kaidan on both devices")
actions: [
Kirigami.Action {
text: qsTr("Skip")
icon.name: "arrow-right"
onTriggered: {
pageStack.layers.push(loginOrRegisterPage)
}
}
]
}
}
......@@ -12,6 +12,32 @@ Kirigami.Page {
interactive: nameField.text !== ""
anchors.fill: parent
ColumnLayout {
ColumnLayout {
id: autoView
Layout.maximumWidth: Kirigami.Units.gridUnit * 25
Layout.alignment: Qt.AlignHCenter
Controls.RadioButton {
text: qsTr("Configure automatically")
icon.name: "dialog-ok-apply"
onClicked: autoView.autoOrAdvanced(checked)
}
Controls.RadioButton {
Layout.alignment: Qt.AlignTop
text: qsTr("Advanced setup")
icon.name: "settings-configure"
onClicked: autoView.autoOrAdvanced(!checked)
}
function autoOrAdvanced(auto) {
if (auto)
view.currentIndex = 3
else
view.currentIndex++
}
}
}
// Name
ColumnLayout {
Kirigami.FormLayout {
......@@ -20,15 +46,14 @@ Kirigami.Page {
placeholderText: qsTr("Jon Doe")
Kirigami.FormData.label: qsTr("Name")
}
Controls.Button {
enabled: nameField.text != ""
text: "Skip details"
icon.name: "emblem-ok-symbolic"
onClicked: view.currentIndex = 2
}
}
RowLayout {
Layout.alignment: Qt.AlignRight | Qt.AlignBottom
Controls.RoundButton {
icon.name: "go-previous-symbolic"
onClicked: view.currentIndex--
}
Controls.RoundButton {
enabled: nameField.text != ""
icon.name: "go-next-symbolic"
......
/*
* Kaidan - A user-friendly XMPP client for every device!
*
* Copyright (C) 2016-2019 Kaidan developers and contributors
* (see the LICENSE file for a full list of copyright authors)
*
* Kaidan is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* In addition, as a special exception, the author of Kaidan gives
* permission to link the code of its release with the OpenSSL
* project's "OpenSSL" library (or with modified versions of it that
* use the same license as the "OpenSSL" library), and distribute the
* linked executables. You must obey the GNU General Public License in
* all respects for all of the code used other than "OpenSSL". If you
* modify this file, you may extend this exception to your version of
* the file, but you are not obligated to do so. If you do not wish to
* do so, delete this exception statement from your version.
*
* Kaidan is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Kaidan. If not, see <http://www.gnu.org/licenses/>.
*/
* Kaidan - A user-friendly XMPP client for every device!
*
* Copyright (C) 2016-2019 Kaidan developers and contributors
* (see the LICENSE file for a full list of copyright authors)
*
* Kaidan is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* In addition, as a special exception, the author of Kaidan gives
* permission to link the code of its release with the OpenSSL
* project's "OpenSSL" library (or with modified versions of it that
* use the same license as the "OpenSSL" library), and distribute the
* linked executables. You must obey the GNU General Public License in
* all respects for all of the code used other than "OpenSSL". If you
* modify this file, you may extend this exception to your version of
* the file, but you are not obligated to do so. If you do not wish to
* do so, delete this exception statement from your version.
*
* Kaidan is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Kaidan. If not, see <http://www.gnu.org/licenses/>.
*/
import QtQuick 2.7
import QtQuick.Controls.Material 2.0
......@@ -75,6 +75,7 @@ Kirigami.ApplicationWindow {
Component {id: settingsPage; SettingsPage {}}
Component {id: qrCodeScannerPage; QrCodeScannerPage {}}
Component {id: userProfilePage; UserProfilePage {}}
Component {id: loginOrRegisterPage; LoginOrRegisterPage {}}
function passiveNotification(text) {
showPassiveNotification(text, "long")
......@@ -90,13 +91,17 @@ Kirigami.ApplicationWindow {
globalDrawer.enabled = false
globalDrawer.visible = false
// push new page
pageStack.push(firstStartPage) // TODO open loginPage if one logged out on purpose
pageStack.push(firstStartPage) // TODO open loginPage if one logged out on purpose
}
function closeLogInPage() {
// toggle global drawer
globalDrawer.enabled = true
// Close all layers created in the first start process
while (pageStack.layers.depth > 1)
pageStack.layers.pop()
// replace page with roster page
pageStack.replace(rosterPage)
if (!Kirigami.Settings.isMobile)
......
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