wizardview: UI refinement

Partially optimized the wizardview related UI code and UI performance.
Note: Since some common components are changed, UI changes in settings
view are also required to keep the original style.

Gitlab: #59
Change-Id: Ib77868bac3a6479700e81f3361b67a8403725661
This commit is contained in:
Ming Rui Zhang
2020-09-03 09:58:01 -04:00
parent 0dd3a39721
commit 346b255c77
25 changed files with 882 additions and 1111 deletions

View File

@@ -38,7 +38,7 @@
<file>src/commoncomponents/DeleteAccountDialog.qml</file>
<file>src/commoncomponents/MessageBox.qml</file>
<file>src/wizardview/WizardView.qml</file>
<file>src/wizardview/components/WelcomePageLayout.qml</file>
<file>src/wizardview/components/WelcomePage.qml</file>
<file>src/wizardview/components/CreateAccountPage.qml</file>
<file>src/wizardview/components/CreateSIPAccountPage.qml</file>
<file>src/wizardview/components/ImportFromBackupPage.qml</file>
@@ -109,5 +109,7 @@
<file>src/commoncomponents/BaseContextMenu.qml</file>
<file>src/mainview/components/AccountPresenceCycle.qml</file>
<file>src/commoncomponents/Scaffold.qml</file>
<file>src/constant/JamiQmlUtils.qml</file>
<file>src/wizardview/components/AccountCreationStepIndicator.qml</file>
</qresource>
</RCC>

View File

@@ -35,8 +35,6 @@
<file>images/icons/ic_arrow_forward_white_48dp_2x.png</file>
<file>images/icons/ic_arrow_tab_next_black_9dp_2x.png</file>
<file>images/icons/ic_arrow_tab_previous_black_9dp_2x.png</file>
<file>images/icons/check_box-24px.svg</file>
<file>images/icons/check_box_outline_blank-24px.svg</file>
<file>images/icons/ic_block_24px.svg</file>
<file>images/icons/delete_forever-24px.svg</file>
<file>images/icons/phone_forwarded-24px.svg</file>

View File

@@ -93,13 +93,14 @@ ApplicationWindow {
title: "Jami"
minimumWidth: 400
minimumWidth: 500
minimumHeight: 600
WizardView {
id: wizardViewForApplicationStart
anchors.fill: parent
onNeedToShowMainViewWindow: {
mainViewLoader.newAddedAccountIndex = accountIndex
if (mainViewLoader.source.toString() !== "qrc:/src/mainview/MainView.qml") {
@@ -146,7 +147,7 @@ ApplicationWindow {
Connections {
target: ClientWrapper.lrcInstance
onRestoreAppRequested: {
function onRestoreAppRequested() {
if (mainViewLoader.item)
mainViewLoader.item.show()
else

View File

@@ -17,7 +17,6 @@
*/
import QtQuick 2.14
import QtQuick.Layouts 1.3
import QtQuick.Controls 2.14
import QtGraphicalEffects 1.15
@@ -31,9 +30,8 @@ Button {
property var pressedColor: undefined
property var outlined: false
Layout.alignment: Qt.AlignCenter
Layout.preferredWidth: 400
Layout.preferredHeight: 36
property var preferredWidth: 400
property var preferredHeight: 36
font.kerning: true
@@ -114,4 +112,4 @@ Button {
}
radius: 4
}
}
}

View File

@@ -48,17 +48,6 @@ TextField {
signal imageClicked
Layout.minimumHeight: fieldLayoutHeight
Layout.preferredHeight: fieldLayoutHeight
Layout.maximumHeight: fieldLayoutHeight
Layout.minimumWidth: fieldLayoutWidth
Layout.maximumWidth: fieldLayoutWidth
Layout.preferredWidth: fieldLayoutWidth
Layout.fillWidth: layoutFillwidth
Layout.alignment: Qt.AlignHCenter
wrapMode: Text.Wrap
readOnly: false
selectByMouse: true

View File

@@ -13,6 +13,7 @@ ColumnLayout{
property string imgBase64: ""
property string fileName: ""
readonly property int preferredWidth: boothWidth + buttonsRowLayout.height
property int boothWidth: 224
signal imageAcquired
@@ -73,27 +74,13 @@ ColumnLayout{
spacing: 0
Layout.maximumWidth: boothWidth
Layout.preferredWidth: boothWidth
Layout.minimumWidth: boothWidth
Layout.maximumHeight: 0
Layout.alignment: Qt.AlignHCenter
Label{
id: avatarLabel
visible: !takePhotoState
Layout.maximumWidth: boothWidth
Layout.preferredWidth: boothWidth
Layout.minimumWidth: boothWidth
Layout.maximumHeight: boothWidth
Layout.preferredHeight: boothWidth
Layout.minimumHeight: boothWidth
Layout.alignment: Qt.AlignHCenter
background: Rectangle {
@@ -140,13 +127,8 @@ ColumnLayout{
focus: visible
Layout.alignment: Qt.AlignHCenter
Layout.maximumWidth: boothWidth
Layout.preferredWidth: boothWidth
Layout.minimumWidth: boothWidth
Layout.maximumHeight: boothWidth
Layout.preferredHeight: boothWidth
Layout.minimumHeight: boothWidth
layer.enabled: true
layer.effect: OpacityMask {
@@ -177,16 +159,15 @@ ColumnLayout{
}
}
RowLayout{
Layout.fillWidth: true
Layout.minimumHeight: 30
Layout.maximumHeight: 30
id: buttonsRowLayout
Item{
Layout.fillWidth: true
Layout.fillHeight: true
}
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter
Layout.preferredHeight: 30
Layout.topMargin: 5
spacing: 15
HoverableButton {
id: takePhotoButton
@@ -195,13 +176,9 @@ ColumnLayout{
property string addPhotoIconUrl: "qrc:/images/icons/round-add_a_photo-24px.svg"
property string refreshIconUrl: "qrc:/images/icons/baseline-refresh-24px.svg"
Layout.maximumWidth: 30
Layout.preferredWidth: 30
Layout.minimumWidth: 30
Layout.minimumHeight: 30
Layout.preferredHeight: 30
Layout.maximumHeight: 30
Layout.alignment: Qt.AlignHCenter
text: ""
font.pointSize: 10
@@ -244,24 +221,12 @@ ColumnLayout{
}
}
Item{
Layout.fillHeight: true
Layout.minimumWidth: 6
Layout.preferredWidth: 6
Layout.maximumWidth: 6
}
HoverableButton {
id: importButton
Layout.maximumWidth: 30
Layout.preferredWidth: 30
Layout.minimumWidth: 30
Layout.minimumHeight: 30
Layout.preferredHeight: 30
Layout.maximumHeight: 30
Layout.alignment: Qt.AlignHCenter
text: ""
font.pointSize: 10
@@ -276,10 +241,5 @@ ColumnLayout{
importFromFileToAvatar_Dialog.open()
}
}
Item{
Layout.fillWidth: true
Layout.fillHeight: true
}
}
}

View File

@@ -0,0 +1,35 @@
/*
* Copyright (C) 2020 by Savoir-faire Linux
* Author: Mingrui Zhang <mingrui.zhang@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/>.
*/
// JamiQmlUtils as a singleton is to provide global property entry
pragma Singleton
import QtQuick 2.14
Item {
TextMetrics {
id: globalTextMetrics
}
function getTextBoundingRect(font, text) {
globalTextMetrics.font = font
globalTextMetrics.text = text
return globalTextMetrics.boundingRect
}
}

View File

@@ -1,4 +1,3 @@
/*
* Copyright (C) 2020 by Savoir-faire Linux
* Author: Mingrui Zhang <mingrui.zhang@savoirfairelinux.com>
@@ -17,21 +16,13 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/*
* JamiTheme as a singleton is to provide global property entry
* https://doc.qt.io/qt-5/qqmlengine.html#qmlRegisterSingletonType-3
*/
// JamiTheme as a singleton is to provide global theme property entry.
pragma Singleton
import QtQuick 2.14
Item {
/*
* Color strings.
*/
// Color strings.
property string hoverColor: "#c7c7c7"
property string pressColor: "#c0c0c0"
property string releaseColor: "#e0e0e0"
@@ -83,9 +74,10 @@ Item {
property string sipInputButtonHoverColor: "#4477aa"
property string sipInputButtonPressColor: "#5588bb"
/*
* Font.
*/
property string accountCreationOtherStepColor: "grey"
property string accountCreationCurrentStepColor: "#28b1ed"
// Font.
property string faddedFontColor: "#c0c0c0"
property string faddedLastInteractionFontColor: "#505050"
@@ -102,10 +94,7 @@ Item {
property int preferredFieldHeight: 32
property int preferredMarginSize: 16
/*
* Place holder text.
*/
// Place holder text.
property string contactSearchBarPlaceHolderConversationText: qsTr("Find or start a conversation")
property string contactSearchBarPlaceHolderInivitionText: qsTr("Search your invitations")

View File

@@ -128,10 +128,12 @@ void registerTypes()
QML_REGISTERTYPE(PhotoboothPreviewRender, 1, 0)
/*
* Adaptors - qmlRegisterSingletonType.
* Adaptors and qml singleton components - qmlRegisterSingletonType.
*/
QML_REGISTERSINGLETONTYPE_URL(QStringLiteral("qrc:/src/constant/JamiTheme.qml"),
JamiTheme, 1, 0);
QML_REGISTERSINGLETONTYPE_URL(QStringLiteral("qrc:/src/constant/JamiQmlUtils.qml"),
JamiQmlUtils, 1, 0);
QML_REGISTERSINGLETONTYPE("net.jami.Models", CallAdapter, 1, 0);
QML_REGISTERSINGLETONTYPE("net.jami.Models", MessagesAdapter, 1, 0);

View File

@@ -418,13 +418,9 @@ ColumnLayout {
MaterialButton {
id: btnRingtoneSIP
Layout.minimumWidth: preferredColumnWidth
Layout.alignment: Qt.AlignCenter
Layout.preferredWidth: preferredColumnWidth
Layout.maximumWidth: preferredColumnWidth
Layout.minimumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.maximumHeight: JamiTheme.preferredFieldHeight
source: "qrc:/images/icons/round-folder-24px.svg"
color: JamiTheme.buttonTintedGrey
@@ -480,8 +476,10 @@ ColumnLayout {
MaterialLineEdit {
id: lineEditVoiceMailDialCode
fieldLayoutWidth: preferredColumnWidth
fieldLayoutHeight: JamiTheme.preferredFieldHeight
Layout.alignment: Qt.AlignCenter
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.preferredWidth: preferredColumnWidth
padding: 8
font.pointSize: JamiTheme.settingsFontSize
@@ -619,12 +617,9 @@ ColumnLayout {
MaterialButton {
id: btnSIPCACert
Layout.minimumWidth: preferredColumnWidth
Layout.alignment: Qt.AlignCenter
Layout.preferredWidth: preferredColumnWidth
Layout.maximumWidth: preferredColumnWidth
Layout.minimumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.maximumHeight: JamiTheme.preferredFieldHeight
source: "qrc:/images/icons/round-folder-24px.svg"
color: JamiTheme.buttonTintedGrey
@@ -651,13 +646,9 @@ ColumnLayout {
MaterialButton {
id: btnSIPUserCert
Layout.minimumWidth: preferredColumnWidth
Layout.alignment: Qt.AlignCenter
Layout.preferredWidth: preferredColumnWidth
Layout.maximumWidth: preferredColumnWidth
Layout.minimumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.maximumHeight: JamiTheme.preferredFieldHeight
source: "qrc:/images/icons/round-folder-24px.svg"
color: JamiTheme.buttonTintedGrey
@@ -684,13 +675,9 @@ ColumnLayout {
MaterialButton {
id: btnSIPPrivateKey
Layout.minimumWidth: preferredColumnWidth
Layout.alignment: Qt.AlignCenter
Layout.preferredWidth: preferredColumnWidth
Layout.maximumWidth: preferredColumnWidth
Layout.minimumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.maximumHeight: JamiTheme.preferredFieldHeight
source: "qrc:/images/icons/round-folder-24px.svg"
color: JamiTheme.buttonTintedGrey
@@ -719,8 +706,10 @@ ColumnLayout {
MaterialLineEdit {
id: lineEditSIPCertPassword
fieldLayoutWidth: preferredColumnWidth
fieldLayoutHeight: JamiTheme.preferredFieldHeight
Layout.alignment: Qt.AlignCenter
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.preferredWidth: preferredColumnWidth
padding: 8
font.pointSize: JamiTheme.settingsFontSize
@@ -853,8 +842,10 @@ ColumnLayout {
MaterialLineEdit {
id: outgoingTLSServerNameLineEdit
fieldLayoutWidth: preferredColumnWidth
fieldLayoutHeight: JamiTheme.preferredFieldHeight
Layout.alignment: Qt.AlignCenter
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.preferredWidth: preferredColumnWidth
padding: 8
font.pointSize: JamiTheme.settingsFontSize
@@ -1059,8 +1050,10 @@ ColumnLayout {
MaterialLineEdit {
id: lineEditTurnAddressSIP
fieldLayoutWidth: preferredColumnWidth
fieldLayoutHeight: JamiTheme.preferredFieldHeight
Layout.alignment: Qt.AlignCenter
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.preferredWidth: preferredColumnWidth
padding: 8
font.pointSize: JamiTheme.settingsFontSize
@@ -1089,8 +1082,10 @@ ColumnLayout {
MaterialLineEdit {
id: lineEditTurnUsernameSIP
fieldLayoutWidth: preferredColumnWidth
fieldLayoutHeight: JamiTheme.preferredFieldHeight
Layout.alignment: Qt.AlignCenter
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.preferredWidth: preferredColumnWidth
padding: 8
font.pointSize: JamiTheme.settingsFontSize
@@ -1118,8 +1113,10 @@ ColumnLayout {
MaterialLineEdit {
id: lineEditTurnPsswdSIP
fieldLayoutWidth: preferredColumnWidth
fieldLayoutHeight: JamiTheme.preferredFieldHeight
Layout.alignment: Qt.AlignCenter
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.preferredWidth: preferredColumnWidth
padding: 8
font.pointSize: JamiTheme.settingsFontSize
@@ -1150,8 +1147,10 @@ ColumnLayout {
MaterialLineEdit {
id: lineEditTurnRealmSIP
fieldLayoutWidth: preferredColumnWidth
fieldLayoutHeight: JamiTheme.preferredFieldHeight
Layout.alignment: Qt.AlignCenter
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.preferredWidth: preferredColumnWidth
padding: 8
font.pointSize: JamiTheme.settingsFontSize
@@ -1195,8 +1194,10 @@ ColumnLayout {
MaterialLineEdit {
id: lineEditSTUNAddressSIP
fieldLayoutWidth: preferredColumnWidth
fieldLayoutHeight: JamiTheme.preferredFieldHeight
Layout.alignment: Qt.AlignCenter
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.preferredWidth: preferredColumnWidth
padding: 8
font.pointSize: JamiTheme.settingsFontSize
@@ -1279,8 +1280,10 @@ ColumnLayout {
MaterialLineEdit {
id: lineEditSIPCustomAddress
fieldLayoutWidth: preferredColumnWidth
fieldLayoutHeight: JamiTheme.preferredFieldHeight
Layout.alignment: Qt.AlignCenter
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.preferredWidth: preferredColumnWidth
padding: 8
font.pointSize: JamiTheme.settingsFontSize

View File

@@ -366,12 +366,9 @@ ColumnLayout {
MaterialButton {
id: btnRingtone
Layout.minimumWidth: preferredColumnWidth
Layout.alignment: Qt.AlignCenter
Layout.preferredWidth: preferredColumnWidth
Layout.maximumWidth: preferredColumnWidth
Layout.minimumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.maximumHeight: JamiTheme.preferredFieldHeight
source: "qrc:/images/icons/round-folder-24px.svg"
color: JamiTheme.buttonTintedGrey
@@ -436,8 +433,10 @@ ColumnLayout {
MaterialLineEdit {
id: lineEditNameServer
fieldLayoutWidth: preferredColumnWidth
fieldLayoutHeight: JamiTheme.preferredFieldHeight
Layout.alignment: Qt.AlignCenter
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.preferredWidth: preferredColumnWidth
padding: 8
font.pointSize: JamiTheme.settingsFontSize
@@ -501,8 +500,10 @@ ColumnLayout {
MaterialLineEdit {
id: lineEditProxy
fieldLayoutWidth: preferredColumnWidth
fieldLayoutHeight: JamiTheme.preferredFieldHeight
Layout.alignment: Qt.AlignCenter
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.preferredWidth: preferredColumnWidth
padding: 8
font.pointSize: JamiTheme.settingsFontSize
@@ -539,8 +540,10 @@ ColumnLayout {
MaterialLineEdit {
id: lineEditBootstrap
fieldLayoutWidth: preferredColumnWidth
fieldLayoutHeight: JamiTheme.preferredFieldHeight
Layout.alignment: Qt.AlignCenter
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.preferredWidth: preferredColumnWidth
padding: 8
font.pointSize: JamiTheme.settingsFontSize
@@ -599,13 +602,9 @@ ColumnLayout {
MaterialButton {
id: btnCACert
Layout.minimumWidth: preferredColumnWidth
Layout.preferredWidth: preferredColumnWidth
Layout.maximumWidth: preferredColumnWidth
Layout.minimumHeight: JamiTheme.preferredFieldHeight
Layout.alignment: Qt.AlignCenter
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.maximumHeight: JamiTheme.preferredFieldHeight
Layout.preferredWidth: preferredColumnWidth
source: "qrc:/images/icons/round-folder-24px.svg"
color: JamiTheme.buttonTintedGrey
@@ -632,13 +631,9 @@ ColumnLayout {
MaterialButton {
id: btnUserCert
Layout.minimumWidth: preferredColumnWidth
Layout.preferredWidth: preferredColumnWidth
Layout.maximumWidth: preferredColumnWidth
Layout.minimumHeight: JamiTheme.preferredFieldHeight
Layout.alignment: Qt.AlignCenter
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.maximumHeight: JamiTheme.preferredFieldHeight
Layout.preferredWidth: preferredColumnWidth
source: "qrc:/images/icons/round-folder-24px.svg"
color: JamiTheme.buttonTintedGrey
@@ -665,13 +660,9 @@ ColumnLayout {
MaterialButton {
id: btnPrivateKey
Layout.minimumWidth: preferredColumnWidth
Layout.preferredWidth: preferredColumnWidth
Layout.maximumWidth: preferredColumnWidth
Layout.minimumHeight: JamiTheme.preferredFieldHeight
Layout.alignment: Qt.AlignCenter
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.maximumHeight: JamiTheme.preferredFieldHeight
Layout.preferredWidth: preferredColumnWidth
source: "qrc:/images/icons/round-folder-24px.svg"
color: JamiTheme.buttonTintedGrey
@@ -699,8 +690,10 @@ ColumnLayout {
MaterialLineEdit {
id: lineEditCertPassword
fieldLayoutWidth: preferredColumnWidth
fieldLayoutHeight: JamiTheme.preferredFieldHeight
Layout.alignment: Qt.AlignCenter
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.preferredWidth: preferredColumnWidth
padding: 8
font.pointSize: JamiTheme.settingsFontSize
@@ -798,8 +791,11 @@ ColumnLayout {
MaterialLineEdit {
id: lineEditTurnAddress
fieldLayoutWidth: preferredColumnWidth
fieldLayoutHeight: JamiTheme.preferredFieldHeight
Layout.alignment: Qt.AlignCenter
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.preferredWidth: preferredColumnWidth
padding: 8
font.pointSize: JamiTheme.settingsFontSize
@@ -832,8 +828,10 @@ ColumnLayout {
MaterialLineEdit {
id: lineEditTurnUsername
fieldLayoutWidth: preferredColumnWidth
fieldLayoutHeight: JamiTheme.preferredFieldHeight
Layout.alignment: Qt.AlignCenter
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.preferredWidth: preferredColumnWidth
padding: 8
font.pointSize: JamiTheme.settingsFontSize
@@ -864,11 +862,13 @@ ColumnLayout {
MaterialLineEdit {
id: lineEditTurnPassword
layer.mipmap: false
fieldLayoutWidth: preferredColumnWidth
fieldLayoutHeight: JamiTheme.preferredFieldHeight
Layout.alignment: Qt.AlignCenter
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.preferredWidth: preferredColumnWidth
padding: 8
layer.mipmap: false
font.pointSize: JamiTheme.settingsFontSize
font.kerning: true
@@ -918,8 +918,10 @@ ColumnLayout {
MaterialLineEdit {
id: lineEditSTUNAddress
fieldLayoutWidth: preferredColumnWidth
fieldLayoutHeight: JamiTheme.preferredFieldHeight
Layout.alignment: Qt.AlignCenter
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.preferredWidth: preferredColumnWidth
padding: 8
font.pointSize: JamiTheme.settingsFontSize

View File

@@ -575,12 +575,9 @@ Rectangle {
MaterialLineEdit {
id: displayNameLineEdit
Layout.maximumWidth: JamiTheme.preferredFieldWidth
Layout.minimumHeight: JamiTheme.preferredFieldHeight
Layout.alignment: Qt.AlignCenter
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.maximumHeight: JamiTheme.preferredFieldHeight
Layout.alignment: Qt.AlignHCenter
Layout.preferredWidth: JamiTheme.preferredFieldWidth
font.pointSize: JamiTheme.textFontSize
font.kerning: true
@@ -704,12 +701,10 @@ Rectangle {
MaterialLineEdit {
id: currentRegisteredID
Layout.minimumWidth: preferredColumnWidth
Layout.preferredWidth: preferredColumnWidth
Layout.maximumWidth: preferredColumnWidth
Layout.minimumHeight: JamiTheme.preferredFieldHeight
Layout.alignment: Qt.AlignCenter
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.maximumHeight: JamiTheme.preferredFieldHeight
Layout.preferredWidth: preferredColumnWidth
placeholderText: { refreshVariable
var result = registeredIdNeedsSet ?
@@ -779,6 +774,10 @@ Rectangle {
MaterialButton {
id: passwdPushButton
Layout.alignment: Qt.AlignHCenter
Layout.preferredWidth: JamiTheme.preferredFieldWidth
Layout.preferredHeight: JamiTheme.preferredFieldHeight
visible: SettingsAdapter.getAccountConfig_Manageruri() === ""
color: JamiTheme.buttonTintedBlack
@@ -786,14 +785,6 @@ Rectangle {
pressedColor: JamiTheme.buttonTintedBlackPressed
outlined: true
Layout.minimumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.maximumHeight: JamiTheme.preferredFieldHeight
Layout.minimumWidth: JamiTheme.preferredFieldWidth
Layout.preferredWidth: JamiTheme.preferredFieldWidth
Layout.maximumWidth: JamiTheme.preferredFieldWidth
Layout.alignment: Qt.AlignHCenter
toolTipText: ClientWrapper.accountAdaptor.hasPassword() ?
qsTr("Change the current password") :
qsTr("Currently no password, press this button to set a password")
@@ -810,6 +801,10 @@ Rectangle {
MaterialButton {
id: btnExportAccount
Layout.alignment: Qt.AlignHCenter
Layout.preferredWidth: JamiTheme.preferredFieldWidth
Layout.preferredHeight: JamiTheme.preferredFieldHeight
visible: SettingsAdapter.getAccountConfig_Manageruri() === ""
color: JamiTheme.buttonTintedBlack
@@ -817,14 +812,6 @@ Rectangle {
pressedColor: JamiTheme.buttonTintedBlackPressed
outlined: true
Layout.minimumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.maximumHeight: JamiTheme.preferredFieldHeight
Layout.minimumWidth: JamiTheme.preferredFieldWidth
Layout.preferredWidth: JamiTheme.preferredFieldWidth
Layout.maximumWidth: JamiTheme.preferredFieldWidth
Layout.alignment: Qt.AlignHCenter
toolTipText: qsTr("Press this button to export account to a .gz file")
text: qsTr("Export Account")
@@ -838,18 +825,14 @@ Rectangle {
MaterialButton {
id: btnDeleteAccount
Layout.alignment: Qt.AlignHCenter
Layout.preferredWidth: JamiTheme.preferredFieldWidth
Layout.preferredHeight: JamiTheme.preferredFieldHeight
color: JamiTheme.buttonTintedRed
hoveredColor: JamiTheme.buttonTintedRedHovered
pressedColor: JamiTheme.buttonTintedRedPressed
Layout.minimumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.maximumHeight: JamiTheme.preferredFieldHeight
Layout.minimumWidth: JamiTheme.preferredFieldWidth
Layout.preferredWidth: JamiTheme.preferredFieldWidth
Layout.maximumWidth: JamiTheme.preferredFieldWidth
Layout.alignment: Qt.AlignHCenter
toolTipText: qsTr("Press this button to delete this account")
text: qsTr("Delete Account")
@@ -918,15 +901,11 @@ Rectangle {
MaterialButton {
id: linkDevPushButton
visible: SettingsAdapter.getAccountConfig_Manageruri() === ""
Layout.minimumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.maximumHeight: JamiTheme.preferredFieldHeight
Layout.minimumWidth: JamiTheme.preferredFieldWidth
Layout.preferredWidth: JamiTheme.preferredFieldWidth
Layout.maximumWidth: JamiTheme.preferredFieldWidth
Layout.alignment: Qt.AlignCenter
Layout.preferredWidth: JamiTheme.preferredFieldWidth
Layout.preferredHeight: JamiTheme.preferredFieldHeight
visible: SettingsAdapter.getAccountConfig_Manageruri() === ""
color: JamiTheme.buttonTintedBlack
hoveredColor: JamiTheme.buttonTintedBlackHovered

View File

@@ -232,12 +232,9 @@ Rectangle {
MaterialLineEdit {
id: displaySIPNameLineEdit
Layout.maximumWidth: JamiTheme.preferredFieldWidth
Layout.minimumHeight: JamiTheme.preferredFieldHeight
Layout.alignment: Qt.AlignCenter
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.maximumHeight: JamiTheme.preferredFieldHeight
Layout.alignment: Qt.AlignHCenter
Layout.preferredWidth: JamiTheme.preferredFieldWidth
font.pointSize: JamiTheme.textFontSize
font.kerning: true
@@ -298,7 +295,9 @@ Rectangle {
MaterialLineEdit {
id: usernameSIP
fieldLayoutWidth: preferredColumnWidth
Layout.alignment: Qt.AlignCenter
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.preferredWidth: preferredColumnWidth
font.pointSize: JamiTheme.settingsFontSize // Albert: buttonSize?
font.kerning: true
@@ -306,10 +305,6 @@ Rectangle {
horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignVCenter
Layout.maximumWidth: preferredColumnWidth
Layout.minimumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.maximumHeight: JamiTheme.preferredFieldHeight
padding: 8
onEditingFinished: {
@@ -333,7 +328,9 @@ Rectangle {
MaterialLineEdit {
id: hostnameSIP
fieldLayoutWidth: preferredColumnWidth
Layout.alignment: Qt.AlignCenter
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.preferredWidth: preferredColumnWidth
font.pointSize: JamiTheme.settingsFontSize
font.kerning: true
@@ -341,10 +338,6 @@ Rectangle {
horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignVCenter
Layout.maximumWidth: preferredColumnWidth
Layout.minimumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.maximumHeight: JamiTheme.preferredFieldHeight
padding: 8
onEditingFinished: {
@@ -368,7 +361,9 @@ Rectangle {
MaterialLineEdit {
id: proxySIP
fieldLayoutWidth: preferredColumnWidth
Layout.alignment: Qt.AlignCenter
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.preferredWidth: preferredColumnWidth
font.pointSize: JamiTheme.settingsFontSize // Albert
font.kerning: true
@@ -376,10 +371,6 @@ Rectangle {
horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignVCenter
Layout.maximumWidth: preferredColumnWidth
Layout.minimumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.maximumHeight: JamiTheme.preferredFieldHeight
padding: 8
onEditingFinished: {
@@ -403,7 +394,9 @@ Rectangle {
MaterialLineEdit {
id: passSIPlineEdit
fieldLayoutWidth: preferredColumnWidth
Layout.alignment: Qt.AlignCenter
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.preferredWidth: preferredColumnWidth
font.pointSize: JamiTheme.settingsFontSize
font.kerning: true
@@ -412,10 +405,6 @@ Rectangle {
horizontalAlignment: Text.AlignLeft
verticalAlignment: Text.AlignVCenter
Layout.maximumWidth: preferredColumnWidth
Layout.minimumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.maximumHeight: JamiTheme.preferredFieldHeight
padding: 8
onEditingFinished: {
@@ -427,19 +416,14 @@ Rectangle {
MaterialButton {
Layout.alignment: Qt.AlignHCenter
Layout.preferredWidth: JamiTheme.preferredFieldWidth
Layout.preferredHeight: JamiTheme.preferredFieldHeight
color: JamiTheme.buttonTintedRed
hoveredColor: JamiTheme.buttonTintedRedHovered
pressedColor: JamiTheme.buttonTintedRedPressed
Layout.alignment: Qt.AlignHCenter
Layout.minimumWidth: JamiTheme.preferredFieldWidth
Layout.preferredWidth: JamiTheme.preferredFieldWidth
Layout.maximumWidth: JamiTheme.preferredFieldWidth
Layout.minimumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.maximumHeight: JamiTheme.preferredFieldHeight
toolTipText: qsTr("Press this button to delete this account")
text: qsTr("Delete Account")

View File

@@ -351,15 +351,9 @@ Rectangle {
MaterialButton {
id: downloadButton
Layout.maximumWidth: preferredColumnWidth
Layout.preferredWidth: preferredColumnWidth
Layout.minimumWidth: preferredColumnWidth
Layout.minimumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.maximumHeight: JamiTheme.preferredFieldHeight
Layout.alignment: Qt.AlignRight
Layout.preferredWidth: preferredColumnWidth
Layout.preferredHeight: JamiTheme.preferredFieldHeight
toolTipText: qsTr("Press to choose download folder path")
text: downloadPath
@@ -518,15 +512,9 @@ Rectangle {
MaterialButton {
id: recordPathButton
Layout.maximumWidth: preferredColumnWidth
Layout.preferredWidth: preferredColumnWidth
Layout.minimumWidth: preferredColumnWidth
Layout.minimumHeight: JamiTheme.preferredFieldHeight
Layout.preferredHeight: JamiTheme.preferredFieldHeight
Layout.maximumHeight: JamiTheme.preferredFieldHeight
Layout.alignment: Qt.AlignRight
Layout.preferredWidth: preferredColumnWidth
Layout.preferredHeight: JamiTheme.preferredFieldHeight
toolTipText: qsTr("Press to choose record folder path")
text: recordPath

View File

@@ -121,8 +121,11 @@ Rectangle {
MaterialButton {
id: installButton
Layout.fillWidth: false
color: JamiTheme.buttonTintedBlack
Layout.alignment: Qt.AlignCenter
Layout.preferredWidth: preferredWidth
Layout.preferredHeight: preferredHeight
color: JamiTheme.buttonTintedBlack
hoveredColor: JamiTheme.buttonTintedBlackHovered
pressedColor: JamiTheme.buttonTintedBlackPressed
outlined: true

View File

@@ -30,7 +30,7 @@ import "../constant"
import "components"
Rectangle {
id: wizardViewWindow
id: root
enum Mode {
CREATE,
@@ -48,6 +48,8 @@ Rectangle {
SEARCHING
}
readonly property int layoutSpacing: 12
property int textFontSize: 9
property int wizardMode: WizardView.CREATE
property int addedAccountIndex: -1
@@ -66,8 +68,6 @@ Rectangle {
signal wizardViewIsClosed
visible: true
anchors.fill: parent
Component.onCompleted: {
changePageQML(controlPanelStackView.welcomePageStackId)
@@ -148,9 +148,6 @@ Rectangle {
registeredNameFoundConnection.enabled = true
} else if (pageIndex == controlPanelStackView.createSIPAccountPageId) {
createSIPAccountPage.initializeOnShowUp()
btnNext.enabled = true
// start photo booth
createSIPAccountPage.startBooth()
} else if (pageIndex == controlPanelStackView.importFromDevicePageId) {
importFromDevicePage.initializeOnShowUp()
} else if (pageIndex == controlPanelStackView.spinnerPageId) {
@@ -158,11 +155,9 @@ Rectangle {
createAccountPage.isToSetPassword_checkState_choosePasswordCheckBox = false
} else if (pageIndex == controlPanelStackView.connectToAccountManagerPageId) {
connectToAccountManagerPage.initializeOnShowUp()
btnNext.enabled = false
} else if (pageIndex == controlPanelStackView.importFromBackupPageId) {
importFromBackupPage.clearAllTextFields()
fileToImport = ""
btnNext.enabled = false
} else if (pageIndex == controlPanelStackView.profilePageId) {
profilePage.initializeOnShowUp()
profilePage.showBottom = showBottom
@@ -203,234 +198,229 @@ Rectangle {
onClicked: forceActiveFocus()
}
ScrollView {
id: frame
clip: true
StackLayout {
id: controlPanelStackView
anchors.fill: parent
StackLayout {
id: controlPanelStackView
currentIndex: welcomePageStackId
height: wizardView.height
width: wizardView.width
currentIndex: welcomePageStackId
property int welcomePageStackId: 0
property int createAccountPageId: 1
property int createSIPAccountPageId: 2
property int importFromBackupPageId: 3
property int backupKeysPageId: 4
property int importFromDevicePageId: 5
property int connectToAccountManagerPageId: 6
property int spinnerPageId: 7
property int profilePageId: 8
property int welcomePageStackId: 0
property int createAccountPageId: 1
property int createSIPAccountPageId: 2
property int importFromBackupPageId: 3
property int backupKeysPageId: 4
property int importFromDevicePageId: 5
property int connectToAccountManagerPageId: 6
property int spinnerPageId: 7
property int profilePageId: 8
WelcomePageLayout {
// welcome page, index 0
id: welcomePage
WelcomePage {
// welcome page, index 0
id: welcomePage
onWelcomePageRedirectPage: {
changePageQML(toPageIndex)
}
onLeavePage: {
wizardViewIsClosed()
}
onWelcomePageRedirectPage: {
changePageQML(toPageIndex)
}
CreateAccountPage {
// create account page, index 1
id: createAccountPage
onLeavePage: {
wizardViewIsClosed()
}
}
onCreateAccount: {
inputParaObject = {}
inputParaObject["password"] = text_passwordEditAlias
ClientWrapper.accountAdaptor.createJamiAccount(
createAccountPage.text_usernameEditAlias,
inputParaObject,
createAccountPage.boothImgBase64,
true)
showBackUp = true
showBottom = true
changePageQML(controlPanelStackView.profilePageId)
CreateAccountPage {
// create account page, index 1
id: createAccountPage
onCreateAccount: {
inputParaObject = {}
inputParaObject["password"] = text_passwordEditAlias
ClientWrapper.accountAdaptor.createJamiAccount(
createAccountPage.text_usernameEditAlias,
inputParaObject,
createAccountPage.boothImgBase64,
true)
showBackUp = true
showBottom = true
changePageQML(controlPanelStackView.profilePageId)
}
onText_usernameEditAliasChanged: {
lookupTimer.restart()
}
onLeavePage: {
changePageQML(controlPanelStackView.welcomePageStackId)
}
Timer {
id: lookupTimer
repeat: false
triggeredOnStart: false
interval: 200
onTriggered: {
registeredName = createAccountPage.text_usernameEditAlias
if (registeredName.length !== 0) {
createAccountPage.nameRegistrationUIState = WizardView.SEARCHING
ClientWrapper.nameDirectory.lookupName("", registeredName)
} else {
createAccountPage.nameRegistrationUIState = WizardView.BLANK
}
}
}
}
onText_usernameEditAliasChanged: {
lookupTimer.restart()
}
CreateSIPAccountPage {
// create SIP account page, index 2
id: createSIPAccountPage
onLeavePage: {
changePageQML(controlPanelStackView.welcomePageStackId)
}
onLeavePage: {
changePageQML(controlPanelStackView.welcomePageStackId)
}
Timer {
id: lookupTimer
onCreateAccount: {
inputParaObject = {}
inputParaObject["hostname"] = createSIPAccountPage.text_sipServernameEditAlias
inputParaObject["username"] = createSIPAccountPage.text_sipUsernameEditAlias
inputParaObject["password"] = createSIPAccountPage.text_sipPasswordEditAlias
inputParaObject["proxy"] = createSIPAccountPage.text_sipProxyEditAlias
createSIPAccountPage.clearAllTextFields()
repeat: false
triggeredOnStart: false
interval: 200
ClientWrapper.accountAdaptor.createSIPAccount(inputParaObject, "")
showBackUp = false
showBottom = false
changePageQML(controlPanelStackView.profilePageId)
controlPanelStackView.profilePage.readyToSaveDetails = true
}
}
onTriggered: {
registeredName = createAccountPage.text_usernameEditAlias
if (registeredName.length !== 0) {
createAccountPage.nameRegistrationUIState = WizardView.SEARCHING
ClientWrapper.nameDirectory.lookupName("", registeredName)
} else {
createAccountPage.nameRegistrationUIState = WizardView.BLANK
ImportFromBackupPage {
// import from backup page, index 3
id: importFromBackupPage
onLeavePage: {
changePageQML(controlPanelStackView.welcomePageStackId)
}
onImportAccount: {
inputParaObject = {}
inputParaObject["archivePath"] = ClientWrapper.utilsAdaptor.getAbsPath(importFromBackupPage.filePath)
inputParaObject["password"] = importFromBackupPage.text_passwordFromBackupEditAlias
importFromBackupPage.clearAllTextFields()
showBackUp = false
showBottom = false
showProfile = true
ClientWrapper.accountAdaptor.createJamiAccount(
"", inputParaObject, "", false)
}
}
BackupKeyPage {
// backup keys page, index 4
id: backupKeysPage
onNeverShowAgainBoxClicked: {
SettingsAdapter.setValue(Settings.NeverShowMeAgain, isChecked)
}
onExport_Btn_FileDialogAccepted: {
if (accepted) {
// is there password? If so, go to password dialog, else, go to following directly
if (ClientWrapper.accountAdaptor.hasPassword()) {
passwordDialog.path = ClientWrapper.utilsAdaptor.getAbsPath(folderDir)
passwordDialog.open()
return
} else {
if (folderDir.length > 0) {
ClientWrapper.accountAdaptor.exportToFile(
ClientWrapper.utilsAdaptor.getCurrAccId(),
ClientWrapper.utilsAdaptor.getAbsPath(folderDir))
}
}
}
changePageQML(controlPanelStackView.welcomePageStackId)
needToShowMainViewWindow(addedAccountIndex)
ClientWrapper.lrcInstance.accountListChanged()
}
CreateSIPAccountPage {
// create SIP account page, index 2
id: createSIPAccountPage
onLeavePage: {
changePageQML(controlPanelStackView.welcomePageStackId)
needToShowMainViewWindow(addedAccountIndex)
ClientWrapper.lrcInstance.accountListChanged()
}
}
onLeavePage: {
ImportFromDevicePage {
// import from device page, index 5
id: importFromDevicePage
onLeavePage: {
changePageQML(controlPanelStackView.welcomePageStackId)
}
onImportAccount: {
inputParaObject = {}
inputParaObject["archivePin"] = importFromDevicePage.text_pinFromDeviceAlias
inputParaObject["password"] = importFromDevicePage.text_passwordFromDeviceAlias
showProfile = true
showBackUp = false
showBottom = false
ClientWrapper.accountAdaptor.createJamiAccount(
"", inputParaObject, "", false)
}
}
ConnectToAccountManagerPage {
// connect to account manager Page, index 6
id: connectToAccountManagerPage
onCreateAccount: {
inputParaObject = {}
inputParaObject["username"]
= connectToAccountManagerPage.text_usernameManagerEditAlias
inputParaObject["password"]
= connectToAccountManagerPage.text_passwordManagerEditAlias
inputParaObject["manager"]
= connectToAccountManagerPage.text_accountManagerEditAlias
ClientWrapper.accountAdaptor.createJAMSAccount(inputParaObject)
}
onLeavePage: {
changePageQML(controlPanelStackView.welcomePageStackId)
}
}
SpinnerPage {
// spinner Page, index 7
id: spinnerPage
}
ProfilePage {
// profile Page, index 8
id: profilePage
function leave() {
if (showBackUp)
changePageQML(controlPanelStackView.backupKeysPageId)
else {
changePageQML(controlPanelStackView.welcomePageStackId)
}
onCreateAccount: {
inputParaObject = {}
inputParaObject["hostname"] = createSIPAccountPage.text_sipServernameEditAlias
inputParaObject["username"] = createSIPAccountPage.text_sipUsernameEditAlias
inputParaObject["password"] = createSIPAccountPage.text_sipPasswordEditAlias
inputParaObject["proxy"] = createSIPAccountPage.text_sipProxyEditAlias
createSIPAccountPage.clearAllTextFields()
ClientWrapper.accountAdaptor.createSIPAccount(inputParaObject, "")
showBackUp = false
showBottom = false
changePageQML(controlPanelStackView.profilePageId)
controlPanelStackView.profilePage.readyToSaveDetails = true
needToShowMainViewWindow(addedAccountIndex)
ClientWrapper.lrcInstance.accountListChanged()
}
}
ImportFromBackupPage {
// import from backup page, index 3
id: importFromBackupPage
onLeavePage: {
changePageQML(controlPanelStackView.welcomePageStackId)
}
onImportAccount: {
inputParaObject = {}
inputParaObject["archivePath"] = ClientWrapper.utilsAdaptor.getAbsPath(importFromBackupPage.filePath)
inputParaObject["password"] = importFromBackupPage.text_passwordFromBackupEditAlias
importFromBackupPage.clearAllTextFields()
showBackUp = false
showBottom = false
showProfile = true
ClientWrapper.accountAdaptor.createJamiAccount(
"", inputParaObject, "", false)
}
onSaveProfile: {
SettingsAdapter.setCurrAccAvatar(profilePage.boothImgBase64)
ClientWrapper.accountAdaptor.setCurrAccDisplayName(profilePage.displayName)
leave()
}
BackupKeyPage {
// backup keys page, index 4
id: backupKeysPage
onNeverShowAgainBoxClicked: {
SettingsAdapter.setValue(Settings.NeverShowMeAgain, isChecked)
}
onExport_Btn_FileDialogAccepted: {
if (accepted) {
// is there password? If so, go to password dialog, else, go to following directly
if (ClientWrapper.accountAdaptor.hasPassword()) {
passwordDialog.path = ClientWrapper.utilsAdaptor.getAbsPath(folderDir)
passwordDialog.open()
return
} else {
if (folderDir.length > 0) {
ClientWrapper.accountAdaptor.exportToFile(
ClientWrapper.utilsAdaptor.getCurrAccId(),
ClientWrapper.utilsAdaptor.getAbsPath(folderDir))
}
}
}
changePageQML(controlPanelStackView.welcomePageStackId)
needToShowMainViewWindow(addedAccountIndex)
ClientWrapper.lrcInstance.accountListChanged()
}
onLeavePage: {
changePageQML(controlPanelStackView.welcomePageStackId)
needToShowMainViewWindow(addedAccountIndex)
ClientWrapper.lrcInstance.accountListChanged()
}
}
ImportFromDevicePage {
// import from device page, index 5
id: importFromDevicePage
onLeavePage: {
changePageQML(controlPanelStackView.welcomePageStackId)
}
onImportAccount: {
inputParaObject = {}
inputParaObject["archivePin"] = importFromDevicePage.text_pinFromDeviceAlias
inputParaObject["password"] = importFromDevicePage.text_passwordFromDeviceAlias
showProfile = true
showBackUp = false
showBottom = false
ClientWrapper.accountAdaptor.createJamiAccount(
"", inputParaObject, "", false)
}
}
ConnectToAccountManagerPage {
// connect to account manager Page, index 6
id: connectToAccountManagerPage
onCreateAccount: {
inputParaObject = {}
inputParaObject["username"]
= connectToAccountManagerPage.text_usernameManagerEditAlias
inputParaObject["password"]
= connectToAccountManagerPage.text_passwordManagerEditAlias
inputParaObject["manager"]
= connectToAccountManagerPage.text_accountManagerEditAlias
ClientWrapper.accountAdaptor.createJAMSAccount(inputParaObject)
}
onLeavePage: {
changePageQML(controlPanelStackView.welcomePageStackId)
}
}
SpinnerPage {
// spinner Page, index 7
id: spinnerPage
}
ProfilePage {
// profile Page, index 8
id: profilePage
function leave() {
if (showBackUp)
changePageQML(controlPanelStackView.backupKeysPageId)
else {
changePageQML(controlPanelStackView.welcomePageStackId)
needToShowMainViewWindow(addedAccountIndex)
ClientWrapper.lrcInstance.accountListChanged()
}
}
onSaveProfile: {
SettingsAdapter.setCurrAccAvatar(profilePage.boothImgBase64)
ClientWrapper.accountAdaptor.setCurrAccDisplayName(profilePage.displayName)
leave()
}
onLeavePage: {
leave()
}
onLeavePage: {
leave()
}
}
}

View File

@@ -0,0 +1,46 @@
/*
* Copyright (C) 2020 by Savoir-faire Linux
* Author: Mingrui Zhang <mingrui.zhang@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"
Row {
id: root
property int steps: 0
property int currentStep: 0
Repeater {
model: steps
Rectangle {
color: {
if (modelData === currentStep - 1)
return JamiTheme.accountCreationCurrentStepColor
return JamiTheme.accountCreationOtherStepColor
}
radius: height / 2
implicitHeight: 12
implicitWidth: 12
}
}
}

View File

@@ -61,36 +61,31 @@ Rectangle {
}
}
anchors.fill: parent
color: JamiTheme.backgroundColor
ColumnLayout {
spacing: 12
spacing: layoutSpacing
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
Layout.preferredWidth: backupBtn.width
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
RowLayout {
spacing: 12
height: 48
spacing: layoutSpacing
anchors.left: backupBtn.left
anchors.right: backupBtn.right
Layout.alignment: Qt.AlignCenter
Layout.preferredWidth: backupBtn.width
Label {
text: qsTr("Backup your account!")
font.pointSize: JamiTheme.textFontSize + 3
}
Label {
Layout.alignment: Qt.AlignRight
text: qsTr("Recommended")
color: "white"
padding: 8
anchors.right: parent.right
background: Rectangle {
color: "#aed581"
@@ -101,24 +96,33 @@ Rectangle {
}
Label {
text: qsTr("This account only exists on this device. If you lost your device or uninstall the application, your account will be deleted. You can backup your account now or later.")
wrapMode: Text.Wrap
anchors.left: backupBtn.left
anchors.right: backupBtn.right
property int preferredHeight: 0
Layout.alignment: Qt.AlignCenter
Layout.preferredWidth: backupBtn.width
Layout.preferredHeight: preferredHeight
text: qsTr("This account only exists on this device. " +
"If you lost your device or uninstall the application, " +
"your account will be deleted. " +
"You can backup your account now or later.")
wrapMode: Text.WordWrap
font.pointSize: JamiTheme.textFontSize
onFontChanged: {
var boundingRect = JamiQmlUtils.getTextBoundingRect(font, text)
preferredHeight = (boundingRect.width / backupBtn.preferredWidth)
* boundingRect.height
}
}
RowLayout {
spacing: 12
height: 48
spacing: layoutSpacing
anchors.right: backupBtn.right
anchors.left: backupBtn.left
Layout.alignment: Qt.AlignCenter
Label {
text: qsTr("Never show me this again")
font.pointSize: JamiTheme.textFontSize
}
@@ -134,6 +138,11 @@ Rectangle {
MaterialButton {
id: backupBtn
Layout.alignment: Qt.AlignCenter
Layout.preferredWidth: preferredWidth
Layout.preferredHeight: preferredHeight
text: qsTr("BACKUP ACCOUNT")
color: JamiTheme.buttonTintedGrey
hoveredColor: JamiTheme.buttonTintedGreyHovered
@@ -146,6 +155,10 @@ Rectangle {
}
MaterialButton {
Layout.alignment: Qt.AlignCenter
Layout.preferredWidth: preferredWidth
Layout.preferredHeight: preferredHeight
text: qsTr("SKIP")
color: JamiTheme.buttonTintedGrey
hoveredColor: JamiTheme.buttonTintedGreyHovered
@@ -157,41 +170,4 @@ Rectangle {
}
}
}
HoverableButton {
id: cancelButton
z: 2
anchors.right: parent.right
anchors.top: parent.top
rightPadding: 90
topPadding: 90
Layout.preferredWidth: 96
Layout.preferredHeight: 96
backgroundColor: "transparent"
onEnterColor: "transparent"
onPressColor: "transparent"
onReleaseColor: "transparent"
onExitColor: "transparent"
buttonImageHeight: 48
buttonImageWidth: 48
source: "qrc:/images/icons/ic_close_white_24dp.png"
radius: 48
baseColor: "#7c7c7c"
toolTipText: qsTr("Close")
Action {
enabled: parent.visible
shortcut: StandardKey.Cancel
onTriggered: leavePage()
}
onClicked: {
leavePage()
}
}
}

View File

@@ -42,38 +42,34 @@ Rectangle {
errorText = ""
}
anchors.fill: parent
color: JamiTheme.backgroundColor
signal leavePage
signal createAccount
ColumnLayout {
spacing: 12
spacing: layoutSpacing
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
Layout.preferredWidth: parent.width
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
RowLayout {
spacing: 12
height: 48
spacing: layoutSpacing
Layout.fillWidth: true
anchors.left: connectBtn.left
anchors.right: connectBtn.right
Layout.alignment: Qt.AlignCenter
Layout.preferredWidth: connectBtn.width
Label {
text: qsTr("Enter URL of management server")
font.pointSize: JamiTheme.textFontSize + 3
}
Label {
Layout.alignment: Qt.AlignRight
text: qsTr("Required")
color: "#ff1f62"
padding: 8
anchors.right: parent.right
background: Rectangle {
color: "#fee4e9"
@@ -86,19 +82,20 @@ Rectangle {
MaterialLineEdit {
id: accountManagerEdit
Layout.preferredHeight: fieldLayoutHeight
Layout.preferredWidth: connectBtn.width
Layout.alignment: Qt.AlignCenter
selectByMouse: true
placeholderText: qsTr("Jami management server URL")
font.pointSize: 10
font.pointSize: 9
font.kerning: true
borderColorMode: MaterialLineEdit.NORMAL
fieldLayoutWidth: connectBtn.width
}
Text {
anchors.left: connectBtn.left
anchors.right: connectBtn.right
Label {
Layout.alignment: Qt.AlignLeft
text: qsTr("Enter your organization credentials")
wrapMode: Text.Wrap
@@ -107,33 +104,42 @@ Rectangle {
MaterialLineEdit {
id: usernameManagerEdit
Layout.preferredHeight: fieldLayoutHeight
Layout.preferredWidth: connectBtn.width
Layout.alignment: Qt.AlignCenter
selectByMouse: true
placeholderText: qsTr("Username")
font.pointSize: 10
font.pointSize: 9
font.kerning: true
borderColorMode: MaterialLineEdit.NORMAL
fieldLayoutWidth: connectBtn.width
}
MaterialLineEdit {
id: passwordManagerEdit
Layout.preferredHeight: fieldLayoutHeight
Layout.preferredWidth: connectBtn.width
Layout.alignment: Qt.AlignCenter
selectByMouse: true
placeholderText: qsTr("Password")
font.pointSize: 10
font.pointSize: 9
font.kerning: true
echoMode: TextInput.Password
borderColorMode: MaterialLineEdit.NORMAL
fieldLayoutWidth: connectBtn.width
}
MaterialButton {
id: connectBtn
Layout.alignment: Qt.AlignCenter
Layout.preferredWidth: preferredWidth
Layout.preferredHeight: preferredHeight
text: qsTr("CONNECT")
enabled: accountManagerEdit.text.length !== 0
&& usernameManagerEdit.text.length !== 0
@@ -149,53 +155,29 @@ Rectangle {
}
Label {
text: errorText
Layout.alignment: Qt.AlignCenter
anchors.left: connectBtn.left
anchors.right: connectBtn.right
Layout.alignment: Qt.AlignHCenter
visible: errorText.length !== 0
text: errorText
font.pointSize: JamiTheme.textFontSize
color: "red"
height: 32
}
}
HoverableButton {
id: cancelButton
z: 2
anchors.right: parent.right
anchors.top: parent.top
rightPadding: 90
topPadding: 90
Layout.preferredWidth: 96
Layout.preferredHeight: 96
backgroundColor: "transparent"
onEnterColor: "transparent"
onPressColor: "transparent"
onReleaseColor: "transparent"
onExitColor: "transparent"
buttonImageHeight: 48
buttonImageWidth: 48
source: "qrc:/images/icons/ic_close_white_24dp.png"
radius: 48
baseColor: "#7c7c7c"
toolTipText: qsTr("Return to welcome page")
Action {
enabled: parent.visible
shortcut: StandardKey.Cancel
onTriggered: leavePage()
}
onClicked: {
leavePage()
MaterialButton {
id: backButton
Layout.alignment: Qt.AlignCenter
Layout.preferredWidth: preferredWidth
Layout.preferredHeight: preferredHeight
text: qsTr("BACK")
color: JamiTheme.buttonTintedGrey
hoveredColor: JamiTheme.buttonTintedGreyHovered
pressedColor: JamiTheme.buttonTintedGreyPressed
outlined: true
onClicked: leavePage()
}
}
}

View File

@@ -48,10 +48,15 @@ Rectangle {
passwordConfirmEdit.clear()
}
anchors.fill: parent
color: JamiTheme.backgroundColor
Shortcut {
context: Qt.ApplicationShortcut
sequence: "Esc"
enabled: !root.activeFocus
onActivated: leavePage()
}
/*
* JamiFileDialog for exporting account
*/
@@ -83,32 +88,33 @@ Rectangle {
StackLayout {
id: createAccountStack
anchors.verticalCenter: root.verticalCenter
anchors.horizontalCenter: root.horizontalCenter
ColumnLayout {
spacing: 12
spacing: layoutSpacing
anchors.verticalCenter: parent.verticalCenter
Layout.preferredWidth: root.width
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
Layout.alignment: Qt.AlignCenter
RowLayout {
spacing: 12
height: 48
spacing: layoutSpacing
Layout.fillWidth: true
anchors.left: usernameEdit.left
Layout.alignment: Qt.AlignCenter
Layout.preferredWidth: usernameEdit.width
Label {
text: qsTr("Choose a username for your account")
text: qsTr("Choose a username")
font.pointSize: JamiTheme.textFontSize + 3
}
Label {
Layout.alignment: Qt.AlignRight
text: qsTr("Recommended")
color: "white"
padding: 8
anchors.right: parent.right
background: Rectangle {
color: "#aed581"
@@ -121,19 +127,32 @@ Rectangle {
MaterialLineEdit {
id: usernameEdit
Layout.topMargin: 15
Layout.preferredHeight: fieldLayoutHeight
Layout.preferredWidth: fieldLayoutWidth
Layout.alignment: Qt.AlignHCenter
selectByMouse: true
placeholderText: qsTr("Choose your username")
font.pointSize: 10
font.pointSize: 9
font.kerning: true
borderColorMode: nameRegistrationUIState === WizardView.BLANK ? MaterialLineEdit.NORMAL
: nameRegistrationUIState >= WizardView.FREE ? MaterialLineEdit.NORMAL : MaterialLineEdit.ERROR
borderColorMode: {
if (nameRegistrationUIState === WizardView.BLANK)
return MaterialLineEdit.NORMAL
else
return nameRegistrationUIState >= WizardView.FREE ?
MaterialLineEdit.NORMAL : MaterialLineEdit.ERROR
}
fieldLayoutWidth: chooseUsernameButton.width
Layout.topMargin: 32
}
Label {
Layout.alignment: Qt.AlignHCenter
visible: text.length !==0
text: {
switch(nameRegistrationUIState){
case WizardView.BLANK:
@@ -146,19 +165,17 @@ Rectangle {
return qsTr("Username already taken")
}
}
anchors.left: usernameEdit.left
anchors.right: usernameEdit.right
Layout.alignment: Qt.AlignHCenter
font.pointSize: JamiTheme.textFontSize
color: "red"
height: 32
}
MaterialButton {
id: chooseUsernameButton
Layout.alignment: Qt.AlignCenter
Layout.preferredWidth: preferredWidth
Layout.preferredHeight: preferredHeight
text: qsTr("CHOOSE USERNAME")
color: nameRegistrationUIState === WizardView.FREE?
JamiTheme.buttonTintedGrey
@@ -172,43 +189,70 @@ Rectangle {
}
}
MaterialButton {
text: qsTr("SKIP CHOOSING USERNAME")
color: JamiTheme.buttonTintedGrey
hoveredColor: JamiTheme.buttonTintedGreyHovered
pressedColor: JamiTheme.buttonTintedGreyPressed
outlined: true
Row {
id: skipAndBackButtonsRow
onClicked: {
createAccountStack.currentIndex = createAccountStack.currentIndex + 1
Layout.alignment: Qt.AlignCenter
Layout.preferredWidth: chooseUsernameButton.preferredWidth
Layout.preferredHeight: chooseUsernameButton.preferredHeight
spacing: layoutSpacing
Repeater {
model: 2
MaterialButton {
width: (skipAndBackButtonsRow.width -
skipAndBackButtonsRow.spacing) / 2
height: skipAndBackButtonsRow.height
text: modelData === 0 ? qsTr("BACK") : qsTr("SKIP")
color: JamiTheme.buttonTintedGrey
hoveredColor: JamiTheme.buttonTintedGreyHovered
pressedColor: JamiTheme.buttonTintedGreyPressed
outlined: true
onClicked: {
if (modelData === 0)
leavePage()
else
createAccountStack.currentIndex =
createAccountStack.currentIndex + 1
}
}
}
}
}
ColumnLayout {
spacing: 12
spacing: layoutSpacing
anchors.verticalCenter: parent.verticalCenter
Layout.preferredWidth: root.width
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
Layout.alignment: Qt.AlignCenter
RowLayout {
spacing: 12
height: 48
spacing: layoutSpacing
anchors.right: createAccountButton.right
anchors.left: createAccountButton.left
Layout.alignment: Qt.AlignCenter
Layout.preferredWidth: usernameEdit.width
Label {
text: qsTr("Encrypt account with password")
text: qsTr("Create a password")
font.pointSize: JamiTheme.textFontSize + 3
Switch {
id: passwordSwitch
anchors.left: parent.right
anchors.verticalCenter: parent.verticalCenter
}
}
Label {
Layout.alignment: Qt.AlignRight
text: qsTr("Optional")
color: "white"
anchors.right: parent.right
padding: 8
background: Rectangle {
@@ -219,147 +263,99 @@ Rectangle {
}
}
RowLayout {
spacing: 12
height: 48
anchors.right: createAccountButton.right
anchors.left: createAccountButton.left
Label {
text: qsTr("Choose a password to encrypt the account key on this device")
font.pointSize: JamiTheme.textFontSize
}
Switch {
id: passwordSwitch
Layout.alignment: Qt.AlignRight
}
}
MaterialLineEdit {
id: passwordEdit
visible: passwordSwitch.checked
fieldLayoutWidth: createAccountButton.width
Layout.preferredHeight: fieldLayoutHeight
Layout.preferredWidth: createAccountButton.width
Layout.alignment: Qt.AlignHCenter
visible: passwordSwitch.checked
selectByMouse: true
echoMode: TextInput.Password
placeholderText: qsTr("Password")
font.pointSize: 10
font.pointSize: 9
font.kerning: true
}
MaterialLineEdit {
id: passwordConfirmEdit
visible: passwordSwitch.checked
fieldLayoutWidth: createAccountButton.width
Layout.preferredHeight: fieldLayoutHeight
Layout.preferredWidth: createAccountButton.width
Layout.alignment: Qt.AlignHCenter
visible: passwordSwitch.checked
selectByMouse: true
echoMode: TextInput.Password
placeholderText: qsTr("Confirm password")
font.pointSize: 10
font.pointSize: 9
font.kerning: true
}
Label {
anchors.right: createAccountButton.right
anchors.left: createAccountButton.left
Layout.alignment: Qt.AlignLeft
Layout.topMargin: 10
Layout.leftMargin: (root.width - createAccountButton.width) / 2
text: qsTr("Note that the password cannot be recovered")
font.pointSize: JamiTheme.textFontSize
}
MaterialButton {
id: createAccountButton
Layout.alignment: Qt.AlignCenter
Layout.topMargin: 10
Layout.preferredWidth: preferredWidth
Layout.preferredHeight: preferredHeight
function checkEnable() {
return !passwordSwitch.checked ||
(passwordEdit.text === passwordConfirmEdit.text
&& passwordEdit.text.length !== 0)
}
text: qsTr("CREATE ACCOUNT")
color: !passwordSwitch.checked ||
(passwordEdit.text === passwordConfirmEdit.text && passwordEdit.text.length !== 0)?
JamiTheme.wizardBlueButtons : JamiTheme.buttonTintedGreyInactive
enabled: checkEnable()
color: checkEnable() ? JamiTheme.wizardBlueButtons :
JamiTheme.buttonTintedGreyInactive
hoveredColor: JamiTheme.buttonTintedBlueHovered
pressedColor: JamiTheme.buttonTintedBluePressed
onClicked: {
createAccount()
createAccountStack.currentIndex = createAccountStack.currentIndex + 1
createAccountStack.currentIndex += 1
}
}
MaterialButton {
id: backButton
Layout.alignment: Qt.AlignCenter
Layout.preferredWidth: preferredWidth
Layout.preferredHeight: preferredHeight
text: qsTr("BACK")
color: JamiTheme.buttonTintedGrey
hoveredColor: JamiTheme.buttonTintedGreyHovered
pressedColor: JamiTheme.buttonTintedGreyPressed
outlined: true
onClicked: createAccountStack.currentIndex -= 1
}
}
}
RowLayout {
spacing: 12
height: 48
anchors.top: createAccountStack.bottom
AccountCreationStepIndicator {
anchors.bottom: root.bottom
anchors.bottomMargin: 30
anchors.horizontalCenter: root.horizontalCenter
Layout.alignment: Qt.AlignHCenter
Rectangle {
color: usernameEdit.visible? JamiTheme.wizardBlueButtons : "grey"
radius: height / 2
height: 12
width: 12
}
Rectangle {
color: createAccountButton.visible? JamiTheme.wizardBlueButtons : "grey"
radius: height / 2
height: 12
width: 12
}
Rectangle {
color: "grey"
radius: height / 2
height: 12
width: 12
}
}
HoverableButton {
id: cancelButton
z: 2
anchors.right: parent.right
anchors.top: parent.top
rightPadding: 90
topPadding: 90
Layout.preferredWidth: 96
Layout.preferredHeight: 96
backgroundColor: "transparent"
onEnterColor: "transparent"
onPressColor: "transparent"
onReleaseColor: "transparent"
onExitColor: "transparent"
buttonImageHeight: 48
buttonImageWidth: 48
source: "qrc:/images/icons/ic_close_white_24dp.png"
radius: 48
baseColor: "#7c7c7c"
toolTipText: qsTr("Return to welcome page")
Shortcut {
sequence: StandardKey.Cancel
enabled: parent.visible
onActivated: leavePage()
}
onClicked: {
leavePage()
}
spacing: layoutSpacing
steps: 3
currentStep: usernameEdit.visible ? 1 : 2
}
}

View File

@@ -23,7 +23,6 @@ import QtQuick.Controls 2.14
import "../../constant"
import "../../commoncomponents"
Rectangle {
id: root
@@ -32,7 +31,7 @@ Rectangle {
property alias text_sipUsernameEditAlias: sipUsernameEdit.text
property alias text_sipPasswordEditAlias: sipPasswordEdit.text
property /*alias*/ var boothImgBase64: null//setSIPAvatarWidget.imgBase64
property var boothImgBase64: null
function initializeOnShowUp() {
clearAllTextFields()
@@ -49,36 +48,33 @@ Rectangle {
signal createAccount
signal leavePage
anchors.fill: parent
color: JamiTheme.backgroundColor
ColumnLayout {
spacing: 12
spacing: layoutSpacing
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
Layout.preferredWidth: createAccountButton.width
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
anchors.centerIn: parent
RowLayout {
spacing: 12
height: 48
spacing: layoutSpacing
anchors.left: createAccountButton.left
anchors.right: createAccountButton.right
Layout.alignment: Qt.AlignCenter
Layout.preferredWidth: createAccountButton.width
Label {
text: qsTr("Configure an existing SIP account")
font.pointSize: JamiTheme.textFontSize + 3
}
Label {
text: qsTr("Required")
color: "#ff1f62"
Layout.alignment: Qt.AlignRight
text: qsTr("Optional")
color: "white"
padding: 8
background: Rectangle {
color: "#fee4e9"
color: "#28b1ed"
radius: 24
anchors.fill: parent
}
@@ -88,58 +84,63 @@ Rectangle {
MaterialLineEdit {
id: sipServernameEdit
fieldLayoutWidth: createAccountButton.width
Layout.alignment: Qt.AlignHCenter
Layout.alignment: Qt.AlignCenter
Layout.preferredHeight: fieldLayoutHeight
Layout.preferredWidth: createAccountButton.width
selectByMouse: true
placeholderText: qsTr("Server")
font.pointSize: 10
font.pointSize: 9
font.kerning: true
}
MaterialLineEdit {
id: sipProxyEdit
fieldLayoutWidth: createAccountButton.width
Layout.alignment: Qt.AlignHCenter
Layout.alignment: Qt.AlignCenter
Layout.preferredHeight: fieldLayoutHeight
Layout.preferredWidth: createAccountButton.width
selectByMouse: true
placeholderText: qsTr("Proxy")
font.pointSize: 10
font.pointSize: 9
font.kerning: true
}
MaterialLineEdit {
id: sipUsernameEdit
fieldLayoutWidth: createAccountButton.width
Layout.alignment: Qt.AlignHCenter
Layout.alignment: Qt.AlignCenter
Layout.preferredHeight: fieldLayoutHeight
Layout.preferredWidth: createAccountButton.width
selectByMouse: true
placeholderText: qsTr("Username")
font.pointSize: 10
font.pointSize: 9
font.kerning: true
}
MaterialLineEdit {
id: sipPasswordEdit
fieldLayoutWidth: createAccountButton.width
Layout.alignment: Qt.AlignHCenter
Layout.alignment: Qt.AlignCenter
Layout.preferredHeight: fieldLayoutHeight
Layout.preferredWidth: createAccountButton.width
selectByMouse: true
echoMode: TextInput.Password
placeholderText: qsTr("Password")
font.pointSize: 10
font.pointSize: 9
font.kerning: true
}
MaterialButton {
id: createAccountButton
Layout.alignment: Qt.AlignCenter
Layout.preferredWidth: preferredWidth
Layout.preferredHeight: preferredHeight
text: qsTr("CREATE SIP ACCOUNT")
color: JamiTheme.wizardBlueButtons
hoveredColor: JamiTheme.buttonTintedBlueHovered
@@ -149,42 +150,21 @@ Rectangle {
createAccount()
}
}
}
HoverableButton {
id: cancelButton
z: 2
MaterialButton {
id: backButton
anchors.right: parent.right
anchors.top: parent.top
Layout.alignment: Qt.AlignCenter
Layout.preferredWidth: createAccountButton.width / 2
Layout.preferredHeight: preferredHeight
rightPadding: 90
topPadding: 90
text: qsTr("BACK")
color: JamiTheme.buttonTintedGrey
hoveredColor: JamiTheme.buttonTintedGreyHovered
pressedColor: JamiTheme.buttonTintedGreyPressed
outlined: true
Layout.preferredWidth: 96
Layout.preferredHeight: 96
backgroundColor: "transparent"
onEnterColor: "transparent"
onPressColor: "transparent"
onReleaseColor: "transparent"
onExitColor: "transparent"
buttonImageHeight: 48
buttonImageWidth: 48
source: "qrc:/images/icons/ic_close_white_24dp.png"
radius: 48
baseColor: "#7c7c7c"
toolTipText: qsTr("Return to welcome page")
Action {
enabled: parent.visible
shortcut: StandardKey.Cancel
onTriggered: leavePage()
}
onClicked: {
leavePage()
onClicked: leavePage()
}
}
}

View File

@@ -59,24 +59,19 @@ Rectangle {
}
}
anchors.fill: parent
color: JamiTheme.backgroundColor
signal leavePage
signal importAccount
ColumnLayout {
spacing: 12
spacing: layoutSpacing
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
anchors.horizontalCenter: root.horizontalCenter
Layout.preferredWidth: parent.width
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
Text {
anchors.left: connectBtn.left
anchors.right: connectBtn.right
Layout.alignment: Qt.AlignCenter
text: qsTr("Import from backup")
font.pointSize: JamiTheme.menuFontSize
@@ -85,6 +80,10 @@ Rectangle {
MaterialButton {
id: fileImportBtn
Layout.alignment: Qt.AlignCenter
Layout.preferredWidth: preferredWidth
Layout.preferredHeight: preferredHeight
text: fileImportBtnText
toolTipText: qsTr("Import your account's archive")
source: "qrc:/images/icons/round-folder-24px.svg"
@@ -92,39 +91,58 @@ Rectangle {
hoveredColor: JamiTheme.buttonTintedGreyHovered
pressedColor: JamiTheme.buttonTintedGreyPressed
onClicked: {
importFromFile_Dialog.open()
}
onClicked: importFromFile_Dialog.open()
}
Text {
anchors.left: connectBtn.left
anchors.right: connectBtn.right
// For multiline text, recursive rearrange warning will show up when
// directly assigning contentHeight to Layout.preferredHeight
property int preferredHeight: layoutSpacing
text: qsTr("You can obtain an archive by clicking on \"Export account\" in the account settings. This will create a .gz file on your device.")
Layout.alignment: Qt.AlignCenter
Layout.preferredWidth: fileImportBtn.width
Layout.preferredHeight: preferredHeight
text: qsTr("You can obtain an archive by clicking on \"Export account\" " +
"in the account settings. " +
"This will create a .gz file on your device.")
wrapMode: Text.Wrap
onTextChanged: {
var boundingRect = JamiQmlUtils.getTextBoundingRect(font, text)
preferredHeight += (boundingRect.width / fileImportBtn.preferredWidth)
* boundingRect.height
}
}
MaterialLineEdit {
id: passwordFromBackupEdit
Layout.preferredHeight: fieldLayoutHeight
Layout.preferredWidth: connectBtn.width
Layout.alignment: Qt.AlignCenter
selectByMouse: true
placeholderText: qsTr("Password")
font.pointSize: 10
font.pointSize: 9
font.kerning: true
echoMode: TextInput.Password
borderColorMode: MaterialLineEdit.NORMAL
fieldLayoutWidth: connectBtn.width
}
MaterialButton {
id: connectBtn
Layout.alignment: Qt.AlignCenter
Layout.preferredWidth: preferredWidth
Layout.preferredHeight: preferredHeight
text: qsTr("CONNECT FROM BACKUP")
color: filePath.length === 0?
color: filePath.length === 0 ?
JamiTheme.buttonTintedGreyInactive : JamiTheme.buttonTintedGrey
enabled: !(filePath.length === 0)
hoveredColor: JamiTheme.buttonTintedGreyHovered
pressedColor: JamiTheme.buttonTintedGreyPressed
@@ -135,53 +153,29 @@ Rectangle {
}
Label {
Layout.alignment: Qt.AlignCenter
visible: errorText.length !== 0
text: errorText
anchors.left: connectBtn.left
anchors.right: connectBtn.right
Layout.alignment: Qt.AlignHCenter
font.pointSize: JamiTheme.textFontSize
color: "red"
height: 32
}
}
HoverableButton {
id: cancelButton
z: 2
anchors.right: parent.right
anchors.top: parent.top
rightPadding: 90
topPadding: 90
Layout.preferredWidth: 96
Layout.preferredHeight: 96
backgroundColor: "transparent"
onEnterColor: "transparent"
onPressColor: "transparent"
onReleaseColor: "transparent"
onExitColor: "transparent"
buttonImageHeight: 48
buttonImageWidth: 48
source: "qrc:/images/icons/ic_close_white_24dp.png"
radius: 48
baseColor: "#7c7c7c"
toolTipText: qsTr("Return to welcome page")
Action {
enabled: parent.visible
shortcut: StandardKey.Cancel
onTriggered: leavePage()
}
onClicked: {
leavePage()
MaterialButton {
id: backButton
Layout.alignment: Qt.AlignCenter
Layout.preferredWidth: connectBtn.width / 2
Layout.preferredHeight: preferredHeight
text: qsTr("BACK")
color: JamiTheme.buttonTintedGrey
hoveredColor: JamiTheme.buttonTintedGreyHovered
pressedColor: JamiTheme.buttonTintedGreyPressed
outlined: true
onClicked: leavePage()
}
}
}

View File

@@ -39,24 +39,20 @@ Rectangle {
passwordFromDevice.clear()
}
anchors.fill: parent
color: JamiTheme.backgroundColor
signal leavePage
signal importAccount
ColumnLayout {
spacing: 12
spacing: layoutSpacing
// Prevent possible anchor loop detected on centerIn.
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
Layout.preferredWidth: parent.width
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
Text {
anchors.left: connectBtn.left
anchors.right: connectBtn.right
Layout.alignment: Qt.AlignCenter
text: qsTr("Enter your main Jami account password")
font.pointSize: JamiTheme.menuFontSize
@@ -65,41 +61,60 @@ Rectangle {
MaterialLineEdit {
id: passwordFromDevice
Layout.preferredHeight: fieldLayoutHeight
Layout.preferredWidth: connectBtn.width
Layout.alignment: Qt.AlignCenter
selectByMouse: true
placeholderText: qsTr("Password")
font.pointSize: 10
font.pointSize: 9
font.kerning: true
echoMode: TextInput.Password
borderColorMode: MaterialLineEdit.NORMAL
fieldLayoutWidth: connectBtn.width
}
Text {
anchors.left: connectBtn.left
anchors.right: connectBtn.right
property int preferredHeight: layoutSpacing
text: qsTr("Enter the PIN from another configured Jami account. Use the \"export Jami account\" feature to obtain a PIN")
Layout.alignment: Qt.AlignCenter
Layout.preferredWidth: connectBtn.width
Layout.preferredHeight: preferredHeight
text: qsTr("Enter the PIN from another configured Jami account. " +
"Use the \"export Jami account\" feature to obtain a PIN")
wrapMode: Text.Wrap
onTextChanged: {
var boundingRect = JamiQmlUtils.getTextBoundingRect(font, text)
preferredHeight += (boundingRect.width / connectBtn.preferredWidth)
* boundingRect.height
}
}
MaterialLineEdit {
id: pinFromDevice
Layout.preferredHeight: fieldLayoutHeight
Layout.preferredWidth: connectBtn.width
Layout.alignment: Qt.AlignCenter
selectByMouse: true
placeholderText: qsTr("PIN")
font.pointSize: 10
font.pointSize: 9
font.kerning: true
borderColorMode: MaterialLineEdit.NORMAL
fieldLayoutWidth: connectBtn.width
}
MaterialButton {
id: connectBtn
Layout.alignment: Qt.AlignCenter
Layout.preferredWidth: preferredWidth
Layout.preferredHeight: preferredHeight
text: qsTr("CONNECT FROM ANOTHER DEVICE")
color: pinFromDevice.text.length === 0?
JamiTheme.buttonTintedGreyInactive : JamiTheme.buttonTintedGrey
@@ -113,53 +128,30 @@ Rectangle {
}
Label {
text: errorText
Layout.alignment: Qt.AlignCenter
anchors.left: connectBtn.left
anchors.right: connectBtn.right
Layout.alignment: Qt.AlignHCenter
visible: errorText.length !== 0
text: errorText
font.pointSize: JamiTheme.textFontSize
color: "red"
height: 32
}
}
HoverableButton {
id: cancelButton
z: 2
anchors.right: parent.right
anchors.top: parent.top
rightPadding: 90
topPadding: 90
Layout.preferredWidth: 96
Layout.preferredHeight: 96
backgroundColor: "transparent"
onEnterColor: "transparent"
onPressColor: "transparent"
onReleaseColor: "transparent"
onExitColor: "transparent"
buttonImageHeight: 48
buttonImageWidth: 48
source: "qrc:/images/icons/ic_close_white_24dp.png"
radius: 48
baseColor: "#7c7c7c"
toolTipText: qsTr("Return to welcome page")
Shortcut {
sequence: StandardKey.Cancel
enabled: parent.visible
onActivated: leavePage()
}
onClicked: {
leavePage()
MaterialButton {
id: backButton
Layout.alignment: Qt.AlignCenter
Layout.preferredWidth: connectBtn.width / 2
Layout.preferredHeight: preferredHeight
text: qsTr("BACK")
color: JamiTheme.buttonTintedGrey
hoveredColor: JamiTheme.buttonTintedGreyHovered
pressedColor: JamiTheme.buttonTintedGreyPressed
outlined: true
onClicked: leavePage()
}
}
}

View File

@@ -36,8 +36,6 @@ Rectangle {
aliasEdit.clear()
}
anchors.fill: parent
color: JamiTheme.backgroundColor
signal leavePage
@@ -49,30 +47,28 @@ Rectangle {
property alias displayName: aliasEdit.text
ColumnLayout {
spacing: 12
spacing: layoutSpacing
width: parent.width
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
Layout.preferredWidth: parent.width
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
RowLayout {
spacing: 12
height: 48
spacing: layoutSpacing
Layout.preferredWidth: saveProfileBtn.width
Layout.alignment: Qt.AlignCenter
Label {
text: qsTr("Profile is only shared with contacts")
font.pointSize: JamiTheme.textFontSize + 3
}
Label {
Layout.alignment: Qt.AlignRight
text: qsTr("Optional")
color: "white"
Layout.alignment: Qt.AlignRight
padding: 8
background: Rectangle {
@@ -86,22 +82,23 @@ Rectangle {
PhotoboothView {
id: setAvatarWidget
Layout.alignment: Qt.AlignHCenter
Layout.alignment: Qt.AlignCenter
Layout.preferredWidth: preferredWidth
Layout.preferredHeight: preferredWidth
Layout.maximumWidth: 256
Layout.preferredWidth: 256
Layout.minimumWidth: 256
Layout.maximumHeight: 256
Layout.preferredHeight: 256
Layout.minimumHeight: 256
boothWidth: 200
}
MaterialLineEdit {
id: aliasEdit
Layout.preferredHeight: fieldLayoutHeight
Layout.preferredWidth: fieldLayoutWidth
Layout.alignment: Qt.AlignCenter
selectByMouse: true
placeholderText: qsTr("Enter your name")
font.pointSize: 10
font.pointSize: 9
font.kerning: true
borderColorMode: MaterialLineEdit.NORMAL
@@ -111,6 +108,11 @@ Rectangle {
MaterialButton {
id: saveProfileBtn
Layout.alignment: Qt.AlignCenter
Layout.preferredWidth: preferredWidth
Layout.preferredHeight: preferredHeight
enabled: readyToSaveDetails
text: enabled? qsTr("Save Profile") : qsTr("Generating account…")
color: enabled? JamiTheme.wizardBlueButtons : JamiTheme.buttonTintedGreyInactive
@@ -123,6 +125,10 @@ Rectangle {
}
MaterialButton {
Layout.alignment: Qt.AlignCenter
Layout.preferredWidth: preferredWidth
Layout.preferredHeight: preferredHeight
text: qsTr("SKIP")
enabled: saveProfileBtn.enabled
color: enabled? JamiTheme.buttonTintedGrey : JamiTheme.buttonTintedGreyInactive
@@ -134,84 +140,15 @@ Rectangle {
leavePage()
}
}
RowLayout {
id: bottomLayout
height: 48
spacing: 12
visible: showBottom
Layout.preferredWidth: saveProfileBtn.width
Layout.topMargin: 12
Layout.alignment: Qt.AlignHCenter
Item {
Layout.fillWidth: true
}
Rectangle {
color: "grey"
radius: height / 2
height: 12
width: 12
}
Rectangle {
color: "grey"
radius: height / 2
height: 12
width: 12
}
Rectangle {
color: JamiTheme.wizardBlueButtons
radius: height / 2
height: 12
width: 12
}
Item {
Layout.fillWidth: true
}
}
}
HoverableButton {
id: cancelButton
z: 2
visible: readyToSaveDetails
AccountCreationStepIndicator {
anchors.bottom: root.bottom
anchors.bottomMargin: 30
anchors.horizontalCenter: root.horizontalCenter
anchors.right: parent.right
anchors.top: parent.top
rightPadding: 90
topPadding: 90
Layout.preferredWidth: 96
Layout.preferredHeight: 96
backgroundColor: "transparent"
onEnterColor: "transparent"
onPressColor: "transparent"
onReleaseColor: "transparent"
onExitColor: "transparent"
buttonImageHeight: 48
buttonImageWidth: 48
source: "qrc:/images/icons/ic_close_white_24dp.png"
radius: 48
baseColor: "#7c7c7c"
toolTipText: qsTr("Close")
Action {
enabled: parent.visible
shortcut: StandardKey.Cancel
onTriggered: leavePage()
}
onClicked: {
leavePage()
}
spacing: layoutSpacing
steps: 3
currentStep: 3
}
}

View File

@@ -26,44 +26,38 @@ import net.jami.Models 1.0
import "../../constant"
import "../../commoncomponents"
ColumnLayout {
anchors.fill: parent
anchors.verticalCenter: parent.verticalCenter
anchors.horizontalCenter: parent.horizontalCenter
Rectangle {
id: root
signal welcomePageRedirectPage(int toPageIndex)
signal leavePage
Item {
// put a spacer to make the buttons closs to the middle
Layout.preferredHeight: 48
Layout.fillWidth: true
Layout.fillHeight: true
}
RowLayout {
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter
Label {
color: JamiTheme.backgroundColor
ColumnLayout {
anchors.centerIn: parent
Text {
id: welcomeLabel
Layout.maximumHeight: 40
Layout.alignment: Qt.AlignCenter
Layout.preferredHeight: contentHeight
text: qsTr("Welcome to")
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
font.pointSize: 30
font.kerning: true
}
}
RowLayout {
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter
Label {
id: welcomeLogo
Layout.alignment: Qt.AlignCenter
Layout.minimumWidth: 100
Layout.minimumHeight: 100
Layout.maximumWidth: 16777215
Layout.maximumHeight: 16777215
Layout.preferredWidth: 300
Layout.preferredHeight: 150
color: "transparent"
background: Image {
id: logoIMG
@@ -72,15 +66,15 @@ ColumnLayout {
mipmap: true
}
}
}
RowLayout {
spacing: 8
Layout.fillWidth: true
Layout.maximumHeight: 36
Layout.alignment: Qt.AlignHCenter
MaterialButton {
id: newAccountButton
Layout.alignment: Qt.AlignCenter
Layout.topMargin: 8
Layout.preferredWidth: preferredWidth
Layout.preferredHeight: preferredHeight
text: qsTr("CREATE A JAMI ACCOUNT")
toolTipText: qsTr("Create new Jami account")
source: "qrc:/images/default_avatar_overlay.svg"
@@ -92,16 +86,15 @@ ColumnLayout {
welcomePageRedirectPage(1)
}
}
}
RowLayout {
spacing: 8
Layout.fillWidth: true
Layout.maximumHeight: 36
Layout.alignment: Qt.AlignHCenter
MaterialButton {
id: fromDeviceButton
Layout.alignment: Qt.AlignCenter
Layout.topMargin: 8
Layout.preferredWidth: preferredWidth
Layout.preferredHeight: preferredHeight
text: qsTr("IMPORT FROM ANOTHER DEVICE")
toolTipText: qsTr("Import account from other device")
source: "qrc:/images/icons/devices-24px.svg"
@@ -113,16 +106,15 @@ ColumnLayout {
welcomePageRedirectPage(5)
}
}
}
RowLayout {
spacing: 8
Layout.fillWidth: true
Layout.maximumHeight: 36
Layout.alignment: Qt.AlignHCenter
MaterialButton {
id: fromBackupButton
Layout.alignment: Qt.AlignCenter
Layout.topMargin: 8
Layout.preferredWidth: preferredWidth
Layout.preferredHeight: preferredHeight
text: qsTr("CONNECT FROM BACKUP")
toolTipText: qsTr("Import account from backup file")
source: "qrc:/images/icons/backup-24px.svg"
@@ -134,16 +126,15 @@ ColumnLayout {
welcomePageRedirectPage(3)
}
}
}
RowLayout {
spacing: 8
Layout.fillWidth: true
Layout.maximumHeight: 36
Layout.alignment: Qt.AlignHCenter
MaterialButton {
id: showAdvancedButton
Layout.alignment: Qt.AlignCenter
Layout.topMargin: 8
Layout.preferredWidth: preferredWidth
Layout.preferredHeight: preferredHeight
text: qsTr("SHOW ADVANCED")
toolTipText: qsTr("Show advanced options")
color: JamiTheme.buttonTintedBlue
@@ -162,15 +153,15 @@ ColumnLayout {
newSIPAccountButton.visible = !newSIPAccountButton.visible
}
}
}
RowLayout {
spacing: 8
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter
Layout.maximumHeight: 36
MaterialButton {
id: connectAccountManagerButton
Layout.alignment: Qt.AlignCenter
Layout.topMargin: 8
Layout.preferredWidth: preferredWidth
Layout.preferredHeight: preferredHeight
visible: false
text: qsTr("CONNECT TO MANAGEMENT SERVER")
@@ -184,14 +175,15 @@ ColumnLayout {
welcomePageRedirectPage(6)
}
}
}
RowLayout {
spacing: 8
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter
Layout.maximumHeight: 36
MaterialButton {
id: newSIPAccountButton
Layout.alignment: Qt.AlignCenter
Layout.topMargin: 8
Layout.preferredWidth: preferredWidth
Layout.preferredHeight: preferredHeight
visible: false
text: qsTr("CREATE A SIP ACCOUNT")
@@ -206,51 +198,4 @@ ColumnLayout {
}
}
}
Item {
// put a spacer to make the buttons closs to the middle
Layout.fillHeight: true
Layout.preferredHeight: 65
Layout.fillWidth: true
}
HoverableButton {
id: cancelButton
z: 2
visible: {
return ClientWrapper.utilsAdaptor.getAccountListSize() > 0
}
anchors.right: parent.right
anchors.top: parent.top
rightPadding: 40
topPadding: 40
Layout.preferredWidth: 96
Layout.preferredHeight: 96
backgroundColor: "transparent"
onEnterColor: "transparent"
onPressColor: "transparent"
onReleaseColor: "transparent"
onExitColor: "transparent"
buttonImageHeight: 48
buttonImageWidth: 48
source: "qrc:/images/icons/ic_close_white_24dp.png"
radius: 48
baseColor: "#7c7c7c"
toolTipText: qsTr("Close")
Action {
enabled: parent.visible
shortcut: StandardKey.Cancel
onTriggered: leavePage()
}
onClicked: {
leavePage()
}
}
}