diff --git a/linphone-desktop/assets/languages/en.ts b/linphone-desktop/assets/languages/en.ts
index 85c0c8f96..0e5d5f52d 100644
--- a/linphone-desktop/assets/languages/en.ts
+++ b/linphone-desktop/assets/languages/en.ts
@@ -53,17 +53,20 @@
withEmailAddress
WITH AN EMAIL ADDRESS
+
+
+ AssistantCreateLinphoneSipAccountWithEmail
- countryLabel
- Your country
+ createLinphoneSipAccountTitle
+ CREATE A LINPHONE ACCOUNT
- phoneNumberLabel
- Phone number
+ confirmAction
+ CREATE
usernameLabel
- Username (optional)
+ Username
emailLabel
@@ -78,8 +81,27 @@
Password confirmation
- confirmAction
- CREATE
+ passwordConfirmationError
+ The passwords you entered do not match.
+
+
+
+ AssistantCreateLinphoneSipAccountWithPhoneNumber
+
+ createLinphoneSipAccountTitle
+ CREATE A LINPHONE ACCOUNT
+
+
+ countryLabel
+ Your country
+
+
+ phoneNumberLabel
+ Phone number
+
+
+ usernameLabel
+ Username
@@ -166,6 +188,22 @@
requestFailed
Unable to send the request.
+
+ emailStatusMalformed
+ Malformed email.
+
+
+ emailStatusMalformedInvalidCharacters
+ Malformed email or invalid characters.
+
+
+ cannotSendSms
+ Server error: Cannot send sms.
+
+
+ accountAlreadyExists
+ Account already exists.
+
AssistantUseLinphoneSipAccount
@@ -177,6 +215,13 @@
useLinphoneSipAccountTitle
USE A LINPHONE ACCOUNT
+
+ useUsernameToLogin
+ Use username and password rather than your phone number.
+
+
+
+ AssistantUseLinphoneSipAccountWithPhoneNumber
countryLabel
Your country
@@ -185,10 +230,9 @@
phoneNumberLabel
Phone number
-
- useUsernameToLogin
- Use username and password rather than your phone number.
-
+
+
+ AssistantUseLinphoneSipAccountWithUsername
usernameLabel
Username
diff --git a/linphone-desktop/assets/languages/fr.ts b/linphone-desktop/assets/languages/fr.ts
index 8015ab83c..942495ff2 100644
--- a/linphone-desktop/assets/languages/fr.ts
+++ b/linphone-desktop/assets/languages/fr.ts
@@ -53,13 +53,16 @@
withEmailAddress
AVER UNE ADRESSE E-MAIL
+
+
+ AssistantCreateLinphoneSipAccountWithEmail
- countryLabel
- Votre pays
+ createLinphoneSipAccountTitle
+ CRÉER UN COMPTE LINPHONE
- phoneNumberLabel
- Numéro de téléphone
+ confirmAction
+ CRÉER
usernameLabel
@@ -78,8 +81,27 @@
Confirmation du mot de passe
- confirmAction
- CREATE
+ passwordConfirmationError
+ Les mots de passe ne correspondent pas.
+
+
+
+ AssistantCreateLinphoneSipAccountWithPhoneNumber
+
+ createLinphoneSipAccountTitle
+ CRÉER UN COMPTE LINPHONE
+
+
+ countryLabel
+ Votre pays
+
+
+ phoneNumberLabel
+ Numéro de téléphone
+
+
+ usernameLabel
+ Nom d'utilisateur
@@ -166,6 +188,22 @@
loginWithUsernameFailed
La connection a échouée. Merci de vérifier le nom d'utilisateur/mot de passe.
+
+ emailStatusMalformed
+ Adresse malformée.
+
+
+ emailStatusMalformedInvalidCharacters
+ Adresse malformée ou caractères invalides.
+
+
+ cannotSendSms
+ Erreur serveur : impossible d'envoyer un sms.
+
+
+ accountAlreadyExists
+ Le compte existe déjà.
+
AssistantUseLinphoneSipAccount
@@ -177,6 +215,13 @@
useLinphoneSipAccountTitle
UTILISER UN COMPTE LINPHONE
+
+ useUsernameToLogin
+ Utiliser un nom et mot de passe plutôt que votre numéro de téléphone.
+
+
+
+ AssistantUseLinphoneSipAccountWithPhoneNumber
countryLabel
Votre pays
@@ -185,10 +230,9 @@
phoneNumberLabel
Numéro de téléphone
-
- useUsernameToLogin
- Utiliser un nom et mot de passe plutôt que votre numéro de téléphone.
-
+
+
+ AssistantUseLinphoneSipAccountWithUsername
usernameLabel
Nom d'utilisateur
@@ -283,27 +327,27 @@ Url du serveur non configurée.
CodecsViewer
codecMime
-
+ Nom
codecEncoderDescription
-
+ Description
codecEncoderClockRate
-
+ Fréquence (Hz)
codecBitrate
-
+ Débit (Kbit/s)
codecRecvFmtp
-
+ Paramètres
codecStatus
-
+ status
diff --git a/linphone-desktop/resources.qrc b/linphone-desktop/resources.qrc
index 9cfa758bf..92ebf24bd 100644
--- a/linphone-desktop/resources.qrc
+++ b/linphone-desktop/resources.qrc
@@ -327,9 +327,13 @@
ui/views/App/Calls/OutgoingCall.qml
ui/views/App/Main/Assistant/AssistantAbstractView.qml
ui/views/App/Main/Assistant/AssistantCreateLinphoneSipAccount.qml
+ ui/views/App/Main/Assistant/AssistantCreateLinphoneSipAccountWithEmail.qml
+ ui/views/App/Main/Assistant/AssistantCreateLinphoneSipAccountWithPhoneNumber.qml
ui/views/App/Main/Assistant/AssistantFetchRemoteConfiguration.qml
ui/views/App/Main/Assistant/AssistantHome.qml
ui/views/App/Main/Assistant/AssistantUseLinphoneSipAccount.qml
+ ui/views/App/Main/Assistant/AssistantUseLinphoneSipAccountWithPhoneNumber.qml
+ ui/views/App/Main/Assistant/AssistantUseLinphoneSipAccountWithUsername.qml
ui/views/App/Main/Assistant/AssistantUseOtherSipAccount.qml
ui/views/App/Main/Assistant.qml
ui/views/App/Main/ContactEdit.js
diff --git a/linphone-desktop/src/components/assistant/AssistantModel.cpp b/linphone-desktop/src/components/assistant/AssistantModel.cpp
index b7b6a643f..322f409f8 100644
--- a/linphone-desktop/src/components/assistant/AssistantModel.cpp
+++ b/linphone-desktop/src/components/assistant/AssistantModel.cpp
@@ -37,11 +37,22 @@ public:
m_assistant = assistant;
}
- // void onCreateAccount (
- // const shared_ptr &creator,
- // linphone::AccountCreatorStatus status,
- // const string &resp
- // ) override {}
+ void onCreateAccount (
+ const shared_ptr &,
+ linphone::AccountCreatorStatus status,
+ const string &
+ ) override {
+ if (status == linphone::AccountCreatorStatusAccountCreated)
+ emit m_assistant->createStatusChanged("");
+ else {
+ if (status == linphone::AccountCreatorStatusRequestFailed)
+ emit m_assistant->createStatusChanged(tr("requestFailed"));
+ else if (status == linphone::AccountCreatorStatusServerError)
+ emit m_assistant->createStatusChanged(tr("cannotSendSms"));
+ else
+ emit m_assistant->createStatusChanged(tr("accountAlreadyExists"));
+ }
+ }
void onIsAccountExist (
const shared_ptr &creator,
@@ -125,29 +136,22 @@ AssistantModel::AssistantModel (QObject *parent) : QObject(parent) {
// -----------------------------------------------------------------------------
-void AssistantModel::setUsername (const QString &username) {
+void AssistantModel::setEmail (const QString &email) {
shared_ptr config = CoreManager::getInstance()->getCore()->getConfig();
QString error;
- switch (m_account_creator->setUsername(::Utils::qStringToLinphoneString(username))) {
- case linphone::AccountCreatorUsernameStatusOk:
+ switch (m_account_creator->setEmail(::Utils::qStringToLinphoneString(email))) {
+ case linphone::AccountCreatorEmailStatusOk:
break;
- case linphone::AccountCreatorUsernameStatusTooShort:
- error = tr("usernameStatusTooShort").arg(config->getInt("assistant", "username_min_length", 1));
+ case linphone::AccountCreatorEmailStatusMalformed:
+ error = tr("emailStatusMalformed");
break;
- case linphone::AccountCreatorUsernameStatusTooLong:
- error = tr("usernameStatusTooLong").arg(config->getInt("assistant", "username_max_length", -1));
- break;
- case linphone::AccountCreatorUsernameStatusInvalidCharacters:
- error = tr("usernameStatusInvalidCharacters")
- .arg(::Utils::linphoneStringToQString(config->getString("assistant", "username_regex", "")));
- break;
- case linphone::AccountCreatorUsernameStatusInvalid:
- error = tr("usernameStatusInvalid");
+ case linphone::AccountCreatorEmailStatusInvalidCharacters:
+ error = tr("emailStatusMalformedInvalidCharacters");
break;
}
- emit usernameChanged(username, error);
+ emit emailChanged(email, error);
}
void AssistantModel::setPassword (const QString &password) {
@@ -185,8 +189,46 @@ void AssistantModel::setPhoneNumber (const QString &phone_number) {
emit phoneNumberChanged(phone_number, error);
}
+void AssistantModel::setUsername (const QString &username) {
+ shared_ptr config = CoreManager::getInstance()->getCore()->getConfig();
+ QString error;
+
+ switch (m_account_creator->setUsername(::Utils::qStringToLinphoneString(username))) {
+ case linphone::AccountCreatorUsernameStatusOk:
+ break;
+ case linphone::AccountCreatorUsernameStatusTooShort:
+ error = tr("usernameStatusTooShort").arg(config->getInt("assistant", "username_min_length", 1));
+ break;
+ case linphone::AccountCreatorUsernameStatusTooLong:
+ error = tr("usernameStatusTooLong").arg(config->getInt("assistant", "username_max_length", -1));
+ break;
+ case linphone::AccountCreatorUsernameStatusInvalidCharacters:
+ error = tr("usernameStatusInvalidCharacters")
+ .arg(::Utils::linphoneStringToQString(config->getString("assistant", "username_regex", "")));
+ break;
+ case linphone::AccountCreatorUsernameStatusInvalid:
+ error = tr("usernameStatusInvalid");
+ break;
+ }
+
+ emit usernameChanged(username, error);
+}
+
// -----------------------------------------------------------------------------
+void AssistantModel::create () {
+ m_account_creator->createAccount();
+}
+
void AssistantModel::login () {
m_account_creator->isAccountExist();
}
+
+void AssistantModel::reset () {
+ m_account_creator->reset();
+
+ emit emailChanged("", "");
+ emit passwordChanged("", "");
+ emit phoneNumberChanged("", "");
+ emit usernameChanged("", "");
+}
diff --git a/linphone-desktop/src/components/assistant/AssistantModel.hpp b/linphone-desktop/src/components/assistant/AssistantModel.hpp
index b0c33ed7f..f9415e141 100644
--- a/linphone-desktop/src/components/assistant/AssistantModel.hpp
+++ b/linphone-desktop/src/components/assistant/AssistantModel.hpp
@@ -36,17 +36,22 @@ class AssistantModel : public QObject {
public:
AssistantModel (QObject *parent = Q_NULLPTR);
- Q_INVOKABLE void setUsername (const QString &username);
+ Q_INVOKABLE void setEmail (const QString &email);
Q_INVOKABLE void setPassword (const QString &password);
Q_INVOKABLE void setPhoneNumber (const QString &phone_number);
+ Q_INVOKABLE void setUsername (const QString &username);
+ Q_INVOKABLE void create ();
Q_INVOKABLE void login ();
+ Q_INVOKABLE void reset ();
signals:
- void usernameChanged (const QString &username, const QString &error);
+ void emailChanged (const QString &email, const QString &error);
void passwordChanged (const QString &password, const QString &error);
void phoneNumberChanged (const QString &phone_number, const QString &error);
+ void usernameChanged (const QString &username, const QString &error);
+ void createStatusChanged (const QString &error);
void loginStatusChanged (const QString &error);
private:
diff --git a/linphone-desktop/ui/modules/Common/Styles/Form/Placements/FormVGroupStyle.qml b/linphone-desktop/ui/modules/Common/Styles/Form/Placements/FormVGroupStyle.qml
index 1dda212e7..8cf9960d7 100644
--- a/linphone-desktop/ui/modules/Common/Styles/Form/Placements/FormVGroupStyle.qml
+++ b/linphone-desktop/ui/modules/Common/Styles/Form/Placements/FormVGroupStyle.qml
@@ -15,7 +15,7 @@ QtObject {
property QtObject error: QtObject {
property color color: Colors.error
property int fontSize: 10
- property int height: 16
+ property int height: 11
}
property QtObject legend: QtObject {
diff --git a/linphone-desktop/ui/modules/Linphone/Blocks/RequestBlock.qml b/linphone-desktop/ui/modules/Linphone/Blocks/RequestBlock.qml
index dec143cee..a3f551de0 100644
--- a/linphone-desktop/ui/modules/Linphone/Blocks/RequestBlock.qml
+++ b/linphone-desktop/ui/modules/Linphone/Blocks/RequestBlock.qml
@@ -44,13 +44,17 @@ Item {
width: parent.width
horizontalAlignment: Text.AlignHCenter
+ padding: RequestBlockStyle.error.padding
wrapMode: Text.WordWrap
visible: !block.loading
}
BusyIndicator {
- anchors.centerIn: parent
+ anchors {
+ horizontalCenter: parent.horizontalCenter
+ top: parent.top
+ }
height: RequestBlockStyle.loadingIndicator.height
width: RequestBlockStyle.loadingIndicator.width
diff --git a/linphone-desktop/ui/modules/Linphone/Styles/Blocks/RequestBlockStyle.qml b/linphone-desktop/ui/modules/Linphone/Styles/Blocks/RequestBlockStyle.qml
index 8ccebca70..605468e67 100644
--- a/linphone-desktop/ui/modules/Linphone/Styles/Blocks/RequestBlockStyle.qml
+++ b/linphone-desktop/ui/modules/Linphone/Styles/Blocks/RequestBlockStyle.qml
@@ -11,6 +11,7 @@ QtObject {
property QtObject error: QtObject {
property color color: Colors.error
property int fontSize: 11
+ property int padding: 4
}
property QtObject loadingIndicator: QtObject {
diff --git a/linphone-desktop/ui/views/App/Main/Assistant/AssistantAbstractView.qml b/linphone-desktop/ui/views/App/Main/Assistant/AssistantAbstractView.qml
index 240923536..47c40fb23 100644
--- a/linphone-desktop/ui/views/App/Main/Assistant/AssistantAbstractView.qml
+++ b/linphone-desktop/ui/views/App/Main/Assistant/AssistantAbstractView.qml
@@ -61,6 +61,8 @@ Item {
horizontalAlignment: Text.AlignHCenter
width: parent.width
+
+ visible: text.length > 0
}
// -------------------------------------------------------------------------
diff --git a/linphone-desktop/ui/views/App/Main/Assistant/AssistantCreateLinphoneSipAccount.qml b/linphone-desktop/ui/views/App/Main/Assistant/AssistantCreateLinphoneSipAccount.qml
index fb772958f..d7d780470 100644
--- a/linphone-desktop/ui/views/App/Main/Assistant/AssistantCreateLinphoneSipAccount.qml
+++ b/linphone-desktop/ui/views/App/Main/Assistant/AssistantCreateLinphoneSipAccount.qml
@@ -7,133 +7,11 @@ 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('confirmAction')
-
- 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('confirmAction')
-
- 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
- }
- }
- }
- }
- }
- }
-
+ // Menu.
// ---------------------------------------------------------------------------
Column {
@@ -147,7 +25,7 @@ AssistantAbstractView {
height: AssistantCreateLinphoneSipAccountStyle.buttons.button.height
width: parent.width
- onClicked: assistant.pushView(phoneNumberView)
+ onClicked: assistant.pushView('AssistantCreateLinphoneSipAccountWithPhoneNumber')
}
TextButtonA {
@@ -156,7 +34,7 @@ AssistantAbstractView {
height: AssistantCreateLinphoneSipAccountStyle.buttons.button.height
width: parent.width
- onClicked: assistant.pushView(emailAddressView)
+ onClicked: assistant.pushView('AssistantCreateLinphoneSipAccountWithEmail')
}
}
}
diff --git a/linphone-desktop/ui/views/App/Main/Assistant/AssistantCreateLinphoneSipAccountWithEmail.qml b/linphone-desktop/ui/views/App/Main/Assistant/AssistantCreateLinphoneSipAccountWithEmail.qml
new file mode 100644
index 000000000..55bdf2e79
--- /dev/null
+++ b/linphone-desktop/ui/views/App/Main/Assistant/AssistantCreateLinphoneSipAccountWithEmail.qml
@@ -0,0 +1,115 @@
+import QtQuick 2.7
+
+import Common 1.0
+import Linphone 1.0
+
+import App.Styles 1.0
+
+// =============================================================================
+
+AssistantAbstractView {
+ id: view
+
+ property alias emailError: email.error
+ property alias passwordError: password.error
+ property alias usernameError: username.error
+
+ title: qsTr('createLinphoneSipAccountTitle')
+
+ mainAction: requestBlock.execute
+ mainActionEnabled: email.text.length
+ && password.text.length
+ && passwordConfirmation.text === password.text
+ && username.text.length
+ && !emailError.length
+ && !passwordError.length
+ && !requestBlock.loading
+ && !usernameError.length
+ mainActionLabel: qsTr('confirmAction')
+
+ Column {
+ anchors.fill: parent
+
+ Form {
+ dealWithErrors: true
+ orientation: Qt.Vertical
+ width: parent.width
+
+ FormLine {
+ FormGroup {
+ label: qsTr('usernameLabel')
+
+ TextField {
+ id: username
+
+ onTextChanged: assistantModel.setUsername(text)
+ }
+ }
+ }
+
+ FormLine {
+ FormGroup {
+ label: qsTr('emailLabel')
+
+ TextField {
+ id: email
+
+ onTextChanged: assistantModel.setEmail(text)
+ }
+ }
+ }
+
+ FormLine {
+ FormGroup {
+ label: qsTr('passwordLabel')
+
+ TextField {
+ id: password
+
+ onTextChanged: assistantModel.setPassword(text)
+ }
+ }
+ }
+
+ FormLine {
+ FormGroup {
+ label: qsTr('passwordConfirmationLabel')
+
+ TextField {
+ id: passwordConfirmation
+
+ onTextChanged: error = password.text !== text
+ ? qsTr('passwordConfirmationError')
+ : ''
+ }
+ }
+ }
+ }
+
+ RequestBlock {
+ id: requestBlock
+
+ action: assistantModel.create
+ width: parent.width
+ }
+ }
+
+ // ---------------------------------------------------------------------------
+ // Assistant.
+ // ---------------------------------------------------------------------------
+
+ AssistantModel {
+ id: assistantModel
+
+ onEmailChanged: emailError = error
+ onPasswordChanged: passwordError = error
+ onUsernameChanged: usernameError = error
+
+ onCreateStatusChanged: {
+ requestBlock.stop(error)
+ if (!error.length) {
+ // TODO.
+ }
+ }
+ }
+}
diff --git a/linphone-desktop/ui/views/App/Main/Assistant/AssistantCreateLinphoneSipAccountWithPhoneNumber.qml b/linphone-desktop/ui/views/App/Main/Assistant/AssistantCreateLinphoneSipAccountWithPhoneNumber.qml
new file mode 100644
index 000000000..2931ec9b2
--- /dev/null
+++ b/linphone-desktop/ui/views/App/Main/Assistant/AssistantCreateLinphoneSipAccountWithPhoneNumber.qml
@@ -0,0 +1,72 @@
+import QtQuick 2.7
+
+import Common 1.0
+import Linphone 1.0
+
+import App.Styles 1.0
+
+// =============================================================================
+
+AssistantAbstractView {
+ id: view
+
+ property alias usernameError: username.error
+
+ title: qsTr('createLinphoneSipAccountTitle')
+
+ Form {
+ anchors.fill: parent
+
+ dealWithErrors: true
+ 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 {
+ id: username
+
+ onTextChanged: assistantModel.setUsername(text)
+ }
+ }
+ }
+ }
+
+ // ---------------------------------------------------------------------------
+ // Assistant.
+ // ---------------------------------------------------------------------------
+
+ AssistantModel {
+ id: assistantModel
+
+ onUsernameChanged: usernameError = error
+
+ onCreateStatusChanged: {
+ requestBlock.stop(error)
+ if (!error.length) {
+ // TODO.
+ }
+ }
+ }
+}
diff --git a/linphone-desktop/ui/views/App/Main/Assistant/AssistantUseLinphoneSipAccount.qml b/linphone-desktop/ui/views/App/Main/Assistant/AssistantUseLinphoneSipAccount.qml
index 77b54611c..2cf90775b 100644
--- a/linphone-desktop/ui/views/App/Main/Assistant/AssistantUseLinphoneSipAccount.qml
+++ b/linphone-desktop/ui/views/App/Main/Assistant/AssistantUseLinphoneSipAccount.qml
@@ -13,91 +13,10 @@ AssistantAbstractView {
var item = loader.item
return item && item.mainActionEnabled && !requestBlock.loading
}
-
mainActionLabel: qsTr('confirmAction')
title: qsTr('useLinphoneSipAccountTitle')
- // ---------------------------------------------------------------------------
- // Login with phone number.
- // ---------------------------------------------------------------------------
-
- Component {
- id: phoneNumberForm
-
- Form {
- property bool mainActionEnabled: country.currentIndex !== -1 && phoneNumber.text
-
- dealWithErrors: true
- 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 &&
- !usernameError.length &&
- !passwordError.length
-
- property alias usernameError: username.error
- property alias passwordError: password.error
-
- dealWithErrors: true
- orientation: Qt.Vertical
-
- FormLine {
- FormGroup {
- label: qsTr('usernameLabel')
-
- TextField {
- id: username
-
- onTextChanged: assistantModel.setUsername(text)
- }
- }
- }
-
- FormLine {
- FormGroup {
- label: qsTr('passwordLabel')
-
- TextField {
- id: password
-
- onTextChanged: assistantModel.setPassword(text)
- }
- }
- }
- }
- }
-
// ---------------------------------------------------------------------------
Column {
@@ -106,7 +25,9 @@ AssistantAbstractView {
Loader {
id: loader
- sourceComponent: checkBox.checked ? emailAddressForm : phoneNumberForm
+ source: 'AssistantUseLinphoneSipAccountWith' + (
+ checkBox.checked ? 'Username' : 'PhoneNumber'
+ ) + '.qml'
width: parent.width
}
@@ -116,7 +37,10 @@ AssistantAbstractView {
text: qsTr('useUsernameToLogin')
width: AssistantUseLinphoneSipAccountStyle.checkBox.width
- onClicked: requestBlock.stop('')
+ onClicked: {
+ assistantModel.reset()
+ requestBlock.stop('')
+ }
}
RequestBlock {
@@ -127,13 +51,24 @@ AssistantAbstractView {
}
}
+ // ---------------------------------------------------------------------------
+ // Assistant.
// ---------------------------------------------------------------------------
AssistantModel {
id: assistantModel
- onUsernameChanged: loader.item.usernameError = error
- onPasswordChanged: loader.item.passwordError = error
+ onPasswordChanged: {
+ if (checkBox.checked) {
+ loader.item.passwordError = error
+ }
+ }
+
+ onUsernameChanged: {
+ if (checkBox.checked) {
+ loader.item.usernameError = error
+ }
+ }
onLoginStatusChanged: {
requestBlock.stop(error)
diff --git a/linphone-desktop/ui/views/App/Main/Assistant/AssistantUseLinphoneSipAccountWithPhoneNumber.qml b/linphone-desktop/ui/views/App/Main/Assistant/AssistantUseLinphoneSipAccountWithPhoneNumber.qml
new file mode 100644
index 000000000..06f8f605b
--- /dev/null
+++ b/linphone-desktop/ui/views/App/Main/Assistant/AssistantUseLinphoneSipAccountWithPhoneNumber.qml
@@ -0,0 +1,30 @@
+import Common 1.0
+
+// =============================================================================
+
+Form {
+ property bool mainActionEnabled: country.currentIndex !== -1 && phoneNumber.text
+
+ dealWithErrors: true
+ orientation: Qt.Vertical
+
+ FormLine {
+ FormGroup {
+ label: qsTr('countryLabel')
+
+ ComboBox {
+ id: country
+ }
+ }
+ }
+
+ FormLine {
+ FormGroup {
+ label: qsTr('phoneNumberLabel')
+
+ TextField {
+ id: phoneNumber
+ }
+ }
+ }
+}
diff --git a/linphone-desktop/ui/views/App/Main/Assistant/AssistantUseLinphoneSipAccountWithUsername.qml b/linphone-desktop/ui/views/App/Main/Assistant/AssistantUseLinphoneSipAccountWithUsername.qml
new file mode 100644
index 000000000..cfcd3a2b6
--- /dev/null
+++ b/linphone-desktop/ui/views/App/Main/Assistant/AssistantUseLinphoneSipAccountWithUsername.qml
@@ -0,0 +1,40 @@
+import Common 1.0
+
+// =============================================================================
+
+Form {
+ property alias passwordError: password.error
+ property alias usernameError: username.error
+
+ property bool mainActionEnabled: password.text &&
+ username.length &&
+ !passwordError.length &&
+ !usernameError.length
+
+ dealWithErrors: true
+ orientation: Qt.Vertical
+
+ FormLine {
+ FormGroup {
+ label: qsTr('usernameLabel')
+
+ TextField {
+ id: username
+
+ onTextChanged: assistantModel.setUsername(text)
+ }
+ }
+ }
+
+ FormLine {
+ FormGroup {
+ label: qsTr('passwordLabel')
+
+ TextField {
+ id: password
+
+ onTextChanged: assistantModel.setPassword(text)
+ }
+ }
+ }
+}
diff --git a/linphone-desktop/ui/views/App/Styles/Main/Assistant/AssistantHomeStyle.qml b/linphone-desktop/ui/views/App/Styles/Main/Assistant/AssistantHomeStyle.qml
index 5760465a0..d32b1915b 100644
--- a/linphone-desktop/ui/views/App/Styles/Main/Assistant/AssistantHomeStyle.qml
+++ b/linphone-desktop/ui/views/App/Styles/Main/Assistant/AssistantHomeStyle.qml
@@ -12,20 +12,20 @@ QtObject {
property QtObject description: QtObject {
property color color: Colors.g
- property int height: 40
property int fontSize: 10
+ property int height: 40
}
property QtObject title: QtObject {
property color color: Colors.g
- property int height: 40
property int fontSize: 11
+ property int height: 40
}
}
property QtObject buttons: QtObject {
- property int maxWidth: 690
property int height: 90
+ property int maxWidth: 690
property int spacing: 5
}
}
diff --git a/submodules/bzrtp b/submodules/bzrtp
index b5b5e00d4..1d092f58e 160000
--- a/submodules/bzrtp
+++ b/submodules/bzrtp
@@ -1 +1 @@
-Subproject commit b5b5e00d49e000a84e69c473eb9cea7fdf5cab35
+Subproject commit 1d092f58ec8e04c617e2288577cbedfab7bf9e6a
diff --git a/submodules/linphone b/submodules/linphone
index b1ec18f96..a3fbb53b2 160000
--- a/submodules/linphone
+++ b/submodules/linphone
@@ -1 +1 @@
-Subproject commit b1ec18f963eca39cd8f4f8cac379b3c9598297e4
+Subproject commit a3fbb53b246b53f5c19a5a8a6a0b9f7947e9d970