2020-08-04 20:54:02 -04:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2020 by Savoir-faire Linux
|
|
|
|
* Author: Yang Wang <yang.wang@savoirfairelinux.com>
|
|
|
|
*
|
|
|
|
* This program 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.
|
|
|
|
*
|
|
|
|
* This program 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 this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
import QtQuick 2.14
|
|
|
|
import QtQuick.Layouts 1.3
|
|
|
|
import QtQuick.Controls 2.14
|
|
|
|
|
|
|
|
import "../../constant"
|
|
|
|
import "../../commoncomponents"
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
id: root
|
|
|
|
|
|
|
|
function initializeOnShowUp() {
|
|
|
|
clearAllTextFields()
|
|
|
|
boothImgBase64 = ""
|
|
|
|
readyToSaveDetails = false
|
|
|
|
}
|
|
|
|
|
|
|
|
function clearAllTextFields() {
|
|
|
|
aliasEdit.clear()
|
|
|
|
}
|
|
|
|
|
|
|
|
color: JamiTheme.backgroundColor
|
|
|
|
|
|
|
|
signal leavePage
|
|
|
|
signal saveProfile
|
|
|
|
|
|
|
|
property var readyToSaveDetails: false
|
|
|
|
property var showBottom: false
|
|
|
|
property alias boothImgBase64: setAvatarWidget.imgBase64
|
|
|
|
property alias displayName: aliasEdit.text
|
|
|
|
|
|
|
|
ColumnLayout {
|
2020-09-03 09:58:01 -04:00
|
|
|
spacing: layoutSpacing
|
2020-08-04 20:54:02 -04:00
|
|
|
|
2020-09-03 09:58:01 -04:00
|
|
|
width: parent.width
|
2020-08-04 20:54:02 -04:00
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
|
|
|
|
RowLayout {
|
2020-09-03 09:58:01 -04:00
|
|
|
spacing: layoutSpacing
|
2020-08-04 20:54:02 -04:00
|
|
|
|
|
|
|
Layout.preferredWidth: saveProfileBtn.width
|
2020-09-03 09:58:01 -04:00
|
|
|
Layout.alignment: Qt.AlignCenter
|
2020-08-04 20:54:02 -04:00
|
|
|
|
|
|
|
Label {
|
|
|
|
text: qsTr("Profile is only shared with contacts")
|
|
|
|
font.pointSize: JamiTheme.textFontSize + 3
|
|
|
|
}
|
|
|
|
|
|
|
|
Label {
|
2020-09-03 09:58:01 -04:00
|
|
|
Layout.alignment: Qt.AlignRight
|
|
|
|
|
2020-08-04 20:54:02 -04:00
|
|
|
text: qsTr("Optional")
|
|
|
|
color: "white"
|
|
|
|
padding: 8
|
|
|
|
|
|
|
|
background: Rectangle {
|
|
|
|
color: "#28b1ed"
|
|
|
|
radius: 24
|
|
|
|
anchors.fill: parent
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
PhotoboothView {
|
|
|
|
id: setAvatarWidget
|
|
|
|
|
2020-09-03 09:58:01 -04:00
|
|
|
Layout.alignment: Qt.AlignCenter
|
|
|
|
Layout.preferredWidth: preferredWidth
|
|
|
|
Layout.preferredHeight: preferredWidth
|
2020-08-04 20:54:02 -04:00
|
|
|
|
2020-09-03 09:58:01 -04:00
|
|
|
boothWidth: 200
|
2020-08-04 20:54:02 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
MaterialLineEdit {
|
|
|
|
id: aliasEdit
|
|
|
|
|
2020-09-03 09:58:01 -04:00
|
|
|
Layout.preferredHeight: fieldLayoutHeight
|
|
|
|
Layout.preferredWidth: fieldLayoutWidth
|
|
|
|
Layout.alignment: Qt.AlignCenter
|
|
|
|
|
2020-08-04 20:54:02 -04:00
|
|
|
selectByMouse: true
|
|
|
|
placeholderText: qsTr("Enter your name")
|
2020-09-03 09:58:01 -04:00
|
|
|
font.pointSize: 9
|
2020-08-04 20:54:02 -04:00
|
|
|
font.kerning: true
|
|
|
|
|
|
|
|
borderColorMode: MaterialLineEdit.NORMAL
|
|
|
|
|
|
|
|
fieldLayoutWidth: saveProfileBtn.width
|
|
|
|
}
|
|
|
|
|
|
|
|
MaterialButton {
|
|
|
|
id: saveProfileBtn
|
2020-09-03 09:58:01 -04:00
|
|
|
|
|
|
|
Layout.alignment: Qt.AlignCenter
|
|
|
|
Layout.preferredWidth: preferredWidth
|
|
|
|
Layout.preferredHeight: preferredHeight
|
|
|
|
|
2020-08-04 20:54:02 -04:00
|
|
|
enabled: readyToSaveDetails
|
|
|
|
text: enabled? qsTr("Save Profile") : qsTr("Generating account…")
|
|
|
|
color: enabled? JamiTheme.wizardBlueButtons : JamiTheme.buttonTintedGreyInactive
|
2020-08-25 21:12:14 -04:00
|
|
|
hoveredColor: JamiTheme.buttonTintedBlueHovered
|
|
|
|
pressedColor: JamiTheme.buttonTintedBluePressed
|
2020-08-04 20:54:02 -04:00
|
|
|
|
|
|
|
onClicked: {
|
|
|
|
saveProfile()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
MaterialButton {
|
2020-09-03 09:58:01 -04:00
|
|
|
Layout.alignment: Qt.AlignCenter
|
|
|
|
Layout.preferredWidth: preferredWidth
|
|
|
|
Layout.preferredHeight: preferredHeight
|
|
|
|
|
2020-08-04 20:54:02 -04:00
|
|
|
text: qsTr("SKIP")
|
|
|
|
enabled: saveProfileBtn.enabled
|
|
|
|
color: enabled? JamiTheme.buttonTintedGrey : JamiTheme.buttonTintedGreyInactive
|
2020-08-25 21:12:14 -04:00
|
|
|
hoveredColor: JamiTheme.buttonTintedGreyHovered
|
|
|
|
pressedColor: JamiTheme.buttonTintedGreyPressed
|
2020-08-04 20:54:02 -04:00
|
|
|
outlined: true
|
|
|
|
|
|
|
|
onClicked: {
|
|
|
|
leavePage()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-09-03 09:58:01 -04:00
|
|
|
AccountCreationStepIndicator {
|
|
|
|
anchors.bottom: root.bottom
|
|
|
|
anchors.bottomMargin: 30
|
|
|
|
anchors.horizontalCenter: root.horizontalCenter
|
2020-08-04 20:54:02 -04:00
|
|
|
|
2020-09-03 09:58:01 -04:00
|
|
|
spacing: layoutSpacing
|
|
|
|
steps: 3
|
|
|
|
currentStep: 3
|
2020-08-04 20:54:02 -04:00
|
|
|
}
|
|
|
|
}
|