Commit b1b19d6d authored by Ronan Abhamon's avatar Ronan Abhamon

feat(ui/views/App/Assistant/AssistantCreateLinphoneSipAccount): supports phone/email forms

parent 81f0f12e
......@@ -53,6 +53,34 @@
<source>withEmailAddress</source>
<translation>WITH AN EMAIL ADDRESS</translation>
</message>
<message>
<source>countryLabel</source>
<translation>Your country</translation>
</message>
<message>
<source>phoneNumberLabel</source>
<translation>Phone number</translation>
</message>
<message>
<source>usernameLabel</source>
<translation>Username (optional)</translation>
</message>
<message>
<source>emailLabel</source>
<translation>Email</translation>
</message>
<message>
<source>passwordLabel</source>
<translation>Password</translation>
</message>
<message>
<source>passwordConfirmationLabel</source>
<translation>Password confirmation</translation>
</message>
<message>
<source>createAction</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>AssistantFetchRemoteConfiguration</name>
......
......@@ -53,6 +53,34 @@
<source>withEmailAddress</source>
<translation>AVER UNE ADRESSE E-MAIL</translation>
</message>
<message>
<source>countryLabel</source>
<translation>Votre pays</translation>
</message>
<message>
<source>phoneNumberLabel</source>
<translation>Numéro de téléphone</translation>
</message>
<message>
<source>usernameLabel</source>
<translation>Nom d&apos;utilisateur</translation>
</message>
<message>
<source>emailLabel</source>
<translation>E-mail</translation>
</message>
<message>
<source>passwordLabel</source>
<translation>Mot de passe</translation>
</message>
<message>
<source>passwordConfirmationLabel</source>
<translation>Confirmation du mot de passe</translation>
</message>
<message>
<source>createAction</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>AssistantFetchRemoteConfiguration</name>
......
......@@ -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)
}
}
}
......@@ -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 () {
......
......@@ -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
......
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