Commit ebd960a4 authored by Ronan Abhamon's avatar Ronan Abhamon

feat(ui/views/App/Assistant/AssistantUseLinphoneSipAccount): view done

parent e4bbfc82
......@@ -78,8 +78,8 @@
<translation>Password confirmation</translation>
</message>
<message>
<source>createAction</source>
<translation type="unfinished"></translation>
<source>confirmAction</source>
<translation>CREATE</translation>
</message>
</context>
<context>
......@@ -124,6 +124,37 @@
<translation>CREATE A LINPHONE ACCOUNT</translation>
</message>
</context>
<context>
<name>AssistantUseLinphoneSipAccount</name>
<message>
<source>confirmAction</source>
<translation>LOGIN</translation>
</message>
<message>
<source>useLinphoneSipAccountTitle</source>
<translation>USE A LINPHONE ACCOUNT</translation>
</message>
<message>
<source>countryLabel</source>
<translation>Your country</translation>
</message>
<message>
<source>phoneNumberLabel</source>
<translation>Phone number</translation>
</message>
<message>
<source>useUsernameToLogin</source>
<translation>Use username and password rather than your phone number.</translation>
</message>
<message>
<source>usernameLabel</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>passwordLabel</source>
<translation type="unfinished">Password</translation>
</message>
</context>
<context>
<name>AssistantUseOtherSipAccount</name>
<message>
......
......@@ -78,8 +78,8 @@
<translation>Confirmation du mot de passe</translation>
</message>
<message>
<source>createAction</source>
<translation type="unfinished"></translation>
<source>confirmAction</source>
<translation>CREATE</translation>
</message>
</context>
<context>
......@@ -124,6 +124,37 @@
<translation>CRÉER UN COMPTE LINPHONE</translation>
</message>
</context>
<context>
<name>AssistantUseLinphoneSipAccount</name>
<message>
<source>confirmAction</source>
<translation>CONNEXION</translation>
</message>
<message>
<source>useLinphoneSipAccountTitle</source>
<translation>UTILISER UN COMPTE LINPHONE</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>useUsernameToLogin</source>
<translation>Utiliser un nom et mot de passe plutôt que votre numéro de téléphone.</translation>
</message>
<message>
<source>usernameLabel</source>
<translation type="unfinished">Nom d&apos;utilisateur</translation>
</message>
<message>
<source>passwordLabel</source>
<translation type="unfinished">Mot de passe</translation>
</message>
</context>
<context>
<name>AssistantUseOtherSipAccount</name>
<message>
......
......@@ -313,6 +313,7 @@
<file>ui/views/App/Assistant/AssistantCreateLinphoneSipAccount.qml</file>
<file>ui/views/App/Assistant/AssistantFetchRemoteConfiguration.qml</file>
<file>ui/views/App/Assistant/AssistantHome.qml</file>
<file>ui/views/App/Assistant/AssistantUseLinphoneSipAccount.qml</file>
<file>ui/views/App/Assistant/AssistantUseOtherSipAccount.qml</file>
<file>ui/views/App/AssistantWindow.qml</file>
<file>ui/views/App/Calls/AbstractStartingCall.qml</file>
......@@ -340,6 +341,7 @@
<file>ui/views/App/Styles/Assistant/AssistantAbstractViewStyle.qml</file>
<file>ui/views/App/Styles/Assistant/AssistantCreateLinphoneSipAccountStyle.qml</file>
<file>ui/views/App/Styles/Assistant/AssistantHomeStyle.qml</file>
<file>ui/views/App/Styles/Assistant/AssistantUseLinphoneSipAccountStyle.qml</file>
<file>ui/views/App/Styles/AssistantWindowStyle.qml</file>
<file>ui/views/App/Styles/Calls/CallStyle.qml</file>
<file>ui/views/App/Styles/Calls/CallsWindowStyle.qml</file>
......
......@@ -13,26 +13,39 @@ CheckBox {
contentItem: Text {
color: checkBox.down
? CheckBoxTextStyle.color.pressed
: (checkBox.hovered
? CheckBoxTextStyle.color.hovered
: CheckBoxTextStyle.color.normal
)
: (
checkBox.hovered
? CheckBoxTextStyle.color.hovered
: CheckBoxTextStyle.color.normal
)
elide: Text.ElideRight
font: checkBox.font
leftPadding: checkBox.indicator.width + checkBox.spacing
text: checkBox.text
width: parent.width
wrapMode: Text.WordWrap
verticalAlignment: Text.AlignVCenter
}
hoverEnabled: true
indicator: Rectangle {
border.color: checkBox.down
? CheckBoxTextStyle.color.pressed
: (checkBox.hovered
? CheckBoxTextStyle.color.hovered
: CheckBoxTextStyle.color.normal
)
: (
checkBox.hovered
? CheckBoxTextStyle.color.hovered
: CheckBoxTextStyle.color.normal
)
implicitHeight: CheckBoxTextStyle.size
implicitWidth: CheckBoxTextStyle.size
radius: CheckBoxTextStyle.radius
x: checkBox.leftPadding
y: parent.height / 2 - height / 2
......@@ -43,10 +56,13 @@ CheckBox {
? CheckBoxTextStyle.color.hovered
: CheckBoxTextStyle.color.normal
)
height: parent.height - y * 2
width: parent.width - x * 2
radius: CheckBoxTextStyle.radius
visible: checkBox.checked
width: parent.width - x * 2
x: 4 // Fixed, no needed to use style file.
y: 4 // Same thing.
}
......
......@@ -27,7 +27,7 @@ AssistantAbstractView {
mainActionEnabled: country.currentIndex !== -1 &&
phoneNumber.text.length
mainActionLabel: qsTr('createAction')
mainActionLabel: qsTr('confirmAction')
title: view.title
......@@ -83,7 +83,7 @@ AssistantAbstractView {
&& password.text.length
&& passwordConfirmation.text === password.text
mainActionLabel: qsTr('createAction')
mainActionLabel: qsTr('confirmAction')
title: view.title
......
import QtQuick 2.7
import Common 1.0
import App.Styles 1.0
// =============================================================================
AssistantAbstractView {
mainAction: (function () {
console.log('TODO')
})
mainActionEnabled: {
var item = loader.item
return item && item.mainActionEnabled
}
mainActionLabel: qsTr('confirmAction')
title: qsTr('useLinphoneSipAccountTitle')
// ---------------------------------------------------------------------------
// Login with phone number.
// ---------------------------------------------------------------------------
Component {
id: phoneNumberForm
Form {
property bool mainActionEnabled: country.currentIndex !== -1 && phoneNumber.text
orientation: Qt.Vertical
FormLine {
FormGroup {
label: qsTr('countryLabel')
ComboBox {
id: country
}
}
}
FormLine {
FormGroup {
label: qsTr('phoneNumberLabel')
TextField {
id: phoneNumber
}
}
}
}
}
// ---------------------------------------------------------------------------
// Login with email address.
// ---------------------------------------------------------------------------
Component {
id: emailAddressForm
Form {
property bool mainActionEnabled: username.length && password.text
orientation: Qt.Vertical
FormLine {
FormGroup {
label: qsTr('usernameLabel')
TextField {
id: username
}
}
}
FormLine {
FormGroup {
label: qsTr('passwordLabel')
TextField {
id: password
}
}
}
}
}
// ---------------------------------------------------------------------------
Column {
anchors.fill: parent
spacing: AssistantUseLinphoneSipAccountStyle.spacing
Loader {
id: loader
sourceComponent: checkBox.checked ? emailAddressForm : phoneNumberForm
width: parent.width
}
CheckBoxText {
id: checkBox
text: qsTr('useUsernameToLogin')
width: AssistantUseLinphoneSipAccountStyle.checkBox.width
}
}
}
pragma Singleton
import QtQuick 2.7
// =============================================================================
QtObject {
property int spacing: 20
property QtObject checkBox: QtObject {
property int width: 300
}
}
......@@ -8,9 +8,10 @@ singleton AssistantWindowStyle 1.0 AssistantWindowStyle.qml
singleton InviteFriendsWindowStyle 1.0 InviteFriendsWindowStyle.qml
singleton ManageAccountsWindowStyle 1.0 ManageAccountsWindowStyle.qml
singleton AssistantHomeStyle 1.0 Assistant/AssistantHomeStyle.qml
singleton AssistantAbstractViewStyle 1.0 Assistant/AssistantAbstractViewStyle.qml
singleton AssistantCreateLinphoneSipAccountStyle 1.0 Assistant/AssistantCreateLinphoneSipAccountStyle.qml
singleton AssistantHomeStyle 1.0 Assistant/AssistantHomeStyle.qml
singleton AssistantUseLinphoneSipAccountStyle 1.0 Assistant/AssistantUseLinphoneSipAccountStyle.qml
singleton CallStyle 1.0 Calls/CallStyle.qml
singleton CallsWindowStyle 1.0 Calls/CallsWindowStyle.qml
......
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