diff --git a/linphone-desktop/assets/languages/en.ts b/linphone-desktop/assets/languages/en.ts index 88e8a9ca1..37007ec59 100644 --- a/linphone-desktop/assets/languages/en.ts +++ b/linphone-desktop/assets/languages/en.ts @@ -53,6 +53,34 @@ withEmailAddress WITH AN EMAIL ADDRESS + + countryLabel + Your country + + + phoneNumberLabel + Phone number + + + usernameLabel + Username (optional) + + + emailLabel + Email + + + passwordLabel + Password + + + passwordConfirmationLabel + Password confirmation + + + createAction + + AssistantFetchRemoteConfiguration diff --git a/linphone-desktop/assets/languages/fr.ts b/linphone-desktop/assets/languages/fr.ts index 19a9eee40..c15f49605 100644 --- a/linphone-desktop/assets/languages/fr.ts +++ b/linphone-desktop/assets/languages/fr.ts @@ -53,6 +53,34 @@ withEmailAddress AVER UNE ADRESSE E-MAIL + + countryLabel + Votre pays + + + phoneNumberLabel + Numéro de téléphone + + + usernameLabel + Nom d'utilisateur + + + emailLabel + E-mail + + + passwordLabel + Mot de passe + + + passwordConfirmationLabel + Confirmation du mot de passe + + + createAction + + AssistantFetchRemoteConfiguration diff --git a/linphone-desktop/ui/views/App/Assistant/AssistantCreateLinphoneSipAccount.qml b/linphone-desktop/ui/views/App/Assistant/AssistantCreateLinphoneSipAccount.qml index 54b58d319..8e83bb5e5 100644 --- a/linphone-desktop/ui/views/App/Assistant/AssistantCreateLinphoneSipAccount.qml +++ b/linphone-desktop/ui/views/App/Assistant/AssistantCreateLinphoneSipAccount.qml @@ -7,24 +7,156 @@ import App.Styles 1.0 // ============================================================================= AssistantAbstractView { + id: view + description: qsTr('createLinphoneSipAccountDescription') title: qsTr('createLinphoneSipAccountTitle') + // --------------------------------------------------------------------------- + // Create with phone number. + // --------------------------------------------------------------------------- + + Component { + id: phoneNumberView + + AssistantAbstractView { + mainAction: (function () { + console.log('TODO') + }) + + mainActionEnabled: country.currentIndex !== -1 && + phoneNumber.text.length + + mainActionLabel: qsTr('createAction') + + title: view.title + + Form { + anchors.fill: parent + orientation: Qt.Vertical + + FormLine { + FormGroup { + label: qsTr('countryLabel') + + ComboBox { + id: country + } + } + } + + FormLine { + FormGroup { + label: qsTr('phoneNumberLabel') + + TextField { + id: phoneNumber + } + } + } + + FormLine { + FormGroup { + label: qsTr('usernameLabel') + + TextField {} + } + } + } + } + } + + // --------------------------------------------------------------------------- + // Create with email address. + // --------------------------------------------------------------------------- + + Component { + id: emailAddressView + + AssistantAbstractView { + mainAction: (function () { + console.log('TODO') + }) + + mainActionEnabled: username.text.length + && email.text.length + && password.text.length + && passwordConfirmation.text === password.text + + mainActionLabel: qsTr('createAction') + + title: view.title + + Form { + anchors.fill: parent + orientation: Qt.Vertical + + FormLine { + FormGroup { + label: qsTr('usernameLabel') + + TextField { + id: username + } + } + } + + FormLine { + FormGroup { + label: qsTr('emailLabel') + + TextField { + id: email + } + } + } + + FormLine { + FormGroup { + label: qsTr('passwordLabel') + + TextField { + id: password + } + } + } + + FormLine { + FormGroup { + label: qsTr('passwordConfirmationLabel') + + TextField { + id: passwordConfirmation + } + } + } + } + } + } + + // --------------------------------------------------------------------------- + Column { anchors.centerIn: parent spacing: AssistantCreateLinphoneSipAccountStyle.buttons.spacing width: AssistantCreateLinphoneSipAccountStyle.buttons.button.width TextButtonA { + text: qsTr('withPhoneNumber') + height: AssistantCreateLinphoneSipAccountStyle.buttons.button.height width: parent.width - text: qsTr('withPhoneNumber') + + onClicked: window.pushView(phoneNumberView) } TextButtonA { + text: qsTr('withEmailAddress') + height: AssistantCreateLinphoneSipAccountStyle.buttons.button.height width: parent.width - text: qsTr('withEmailAddress') + + onClicked: window.pushView(emailAddressView) } } } diff --git a/linphone-desktop/ui/views/App/AssistantWindow.qml b/linphone-desktop/ui/views/App/AssistantWindow.qml index 4f6d8852f..b218e477a 100644 --- a/linphone-desktop/ui/views/App/AssistantWindow.qml +++ b/linphone-desktop/ui/views/App/AssistantWindow.qml @@ -2,6 +2,8 @@ import QtQuick 2.7 import QtQuick.Controls 2.0 import QtQuick.Window 2.2 +import Utils 1.0 + import App.Styles 1.0 // ============================================================================= @@ -16,7 +18,11 @@ Window { // --------------------------------------------------------------------------- function pushView (view) { - stack.push(viewsPath + view + '.qml') + stack.push( + Utils.isString(view) + ? viewsPath + view + '.qml' + : view + ) } function popView () { diff --git a/linphone-desktop/ui/views/App/Styles/Assistant/AssistantAbstractViewStyle.qml b/linphone-desktop/ui/views/App/Styles/Assistant/AssistantAbstractViewStyle.qml index 3cdfc3a28..173a26d19 100644 --- a/linphone-desktop/ui/views/App/Styles/Assistant/AssistantAbstractViewStyle.qml +++ b/linphone-desktop/ui/views/App/Styles/Assistant/AssistantAbstractViewStyle.qml @@ -6,7 +6,7 @@ import Common 1.0 // ============================================================================= QtObject { - property int spacing: 20 + property int spacing: 30 property QtObject buttons: QtObject { property int spacing: 10