add id and proxy address for third part connection #LINQT-2000

This commit is contained in:
Gaelle Braud 2025-09-22 10:39:48 +02:00
parent 5b7dc1bcc8
commit 8452ecbdfd
9 changed files with 298 additions and 235 deletions

View file

@ -64,22 +64,26 @@ void LoginPage::login(const QString &username,
const QString &password,
QString displayName,
QString domain,
LinphoneEnums::TransportType transportType) {
LinphoneEnums::TransportType transportType,
QString serverAddress,
QString connectionId) {
setErrorMessage("");
App::postModelAsync([=]() {
// Create on Model thread.
AccountManager *accountManager = new AccountManager();
connect(accountManager, &AccountManager::registrationStateChanged, this,
[accountManager, this](linphone::RegistrationState state, QString message) mutable {
[accountManager, this](linphone::RegistrationState state, linphone::Reason reason,
QString message) mutable {
// View thread
setRegistrationState(state);
mBadIds = reason == linphone::Reason::Forbidden;
emit reasonChanged();
switch (state) {
case linphone::RegistrationState::Failed: {
if (message.isEmpty())
//: Erreur durant la connexion
setErrorMessage(tr("default_account_connection_state_error_toast"));
else
setErrorMessage(message);
if (message.isEmpty())
//: Erreur durant la connexion, veuillez vérifier vos paramètres
setErrorMessage(tr("default_account_connection_state_error_toast"));
else setErrorMessage(message);
if (accountManager) {
accountManager->deleteLater();
accountManager = nullptr;
@ -110,9 +114,9 @@ void LoginPage::login(const QString &username,
QString error;
if (!accountManager->login(username, password, displayName, domain, LinphoneEnums::toLinphone(transportType),
&error)) {
&error, serverAddress, connectionId)) {
setErrorMessage(error);
emit accountManager->registrationStateChanged(linphone::RegistrationState::None);
emit accountManager->registrationStateChanged(linphone::RegistrationState::None, linphone::Reason::None);
}
});
}

View file

@ -35,12 +35,15 @@ public:
Q_PROPERTY(linphone::RegistrationState registrationState READ getRegistrationState NOTIFY registrationStateChanged)
Q_PROPERTY(QString errorMessage READ getErrorMessage NOTIFY errorMessageChanged)
Q_PROPERTY(bool badIds MEMBER mBadIds NOTIFY reasonChanged)
Q_INVOKABLE void login(const QString &username,
const QString &password,
QString displayName = QString(),
QString domain = QString(),
LinphoneEnums::TransportType transportType = LinphoneEnums::TransportType::Tls);
LinphoneEnums::TransportType transportType = LinphoneEnums::TransportType::Tls,
QString serverAddress = QString(),
QString connectionId = QString());
linphone::RegistrationState getRegistrationState() const;
void setRegistrationState(linphone::RegistrationState status);
@ -51,10 +54,12 @@ public:
signals:
void registrationStateChanged();
void errorMessageChanged(QString error);
void reasonChanged();
private:
linphone::RegistrationState mRegistrationState = linphone::RegistrationState::None;
QString mErrorMessage;
bool mBadIds = false;
DECLARE_ABSTRACT_OBJECT
};

View file

@ -83,45 +83,45 @@
<context>
<name>AccountManager</name>
<message>
<location filename="../../model/account/AccountManager.cpp" line="84"/>
<location filename="../../model/account/AccountManager.cpp" line="86"/>
<source>assistant_account_login_already_connected_error</source>
<extracomment>&quot;Le compte est déjà connecté&quot;</extracomment>
<extracomment>&quot;The account is already connected&quot;</extracomment>
<translation>Das Konto ist bereits verbunden</translation>
</message>
<message>
<location filename="../../model/account/AccountManager.cpp" line="98"/>
<location filename="../../model/account/AccountManager.cpp" line="104"/>
<source>assistant_account_login_proxy_address_error</source>
<extracomment>&quot;Impossible de créer l&apos;adresse proxy. Merci de vérifier le nom de domaine.&quot;</extracomment>
<extracomment>&quot;Unable to create proxy address. Please check the domain name.&quot;</extracomment>
<translation>Proxy-Adresse konnte nicht erstellt werden. Bitte überprüfen Sie den Domänenname.</translation>
</message>
<message>
<location filename="../../model/account/AccountManager.cpp" line="111"/>
<location filename="../../model/account/AccountManager.cpp" line="117"/>
<source>assistant_account_login_address_configuration_error</source>
<extracomment>&quot;Impossible de configurer l&apos;adresse : `%1`.&quot;</extracomment>
<extracomment>&quot;Unable to configure address: `%1`.&quot;</extracomment>
<translation>Folgende Adresse konnte nicht konfiguriert werden: `%1`.</translation>
</message>
<message>
<location filename="../../model/account/AccountManager.cpp" line="118"/>
<location filename="../../model/account/AccountManager.cpp" line="124"/>
<source>assistant_account_login_params_configuration_error</source>
<extracomment>&quot;Impossible de configurer les paramètres du compte.&quot;</extracomment>
<extracomment>&quot;Unable to configure account settings.&quot;</extracomment>
<translation>Kontoeinstellungen konnten nicht konfiguriert werden.</translation>
</message>
<message>
<location filename="../../model/account/AccountManager.cpp" line="142"/>
<location filename="../../model/account/AccountManager.cpp" line="148"/>
<source>assistant_account_login_forbidden_error</source>
<extracomment>&quot;Le couple identifiant mot de passe ne correspond pas&quot;</extracomment>
<extracomment>&quot;Username and password do not match&quot;</extracomment>
<translation>Benutzername und Passwort stimmen nicht überein</translation>
</message>
<message>
<location filename="../../model/account/AccountManager.cpp" line="144"/>
<location filename="../../model/account/AccountManager.cpp" line="150"/>
<source>assistant_account_login_error</source>
<extracomment>&quot;Erreur durant la connexion&quot;</extracomment>
<extracomment>&quot;Error during connection, please verify your parameters&quot;</extracomment>
<translation>Fehler bei der Verbindung</translation>
</message>
<message>
<location filename="../../model/account/AccountManager.cpp" line="157"/>
<location filename="../../model/account/AccountManager.cpp" line="163"/>
<source>assistant_account_add_error</source>
<extracomment>&quot;Impossible d&apos;ajouter le compte.&quot;</extracomment>
<extracomment>&quot;Unable to add account.&quot;</extracomment>
<translation>Konto konnte nicht hinzugefügt werden.</translation>
</message>
</context>
@ -3783,7 +3783,7 @@ Error</extracomment>
<translation>Link zur Remote-Konfiguration</translation>
</message>
<message>
<location filename="../../core/login/LoginPage.cpp" line="80"/>
<location filename="../../core/login/LoginPage.cpp" line="85"/>
<source>default_account_connection_state_error_toast</source>
<translation>Fehler bei der Verbindung</translation>
</message>
@ -4907,74 +4907,83 @@ Pour les activer dans un projet commercial, merci de nous contacter.</source>
Um sie in einem kommerziellen Projekt zu aktivieren, kontaktieren Sie uns bitte.</translation>
</message>
<message>
<location filename="../../view/Page/Form/Login/SIPLoginPage.qml" line="132"/>
<location filename="../../view/Page/Form/Login/SIPLoginPage.qml" line="131"/>
<source>assistant_third_party_sip_account_create_linphone_account</source>
<extracomment>&quot;Créer un compte linphone&quot;</extracomment>
<translation>Linphone-Konto erstellen</translation>
</message>
<message>
<location filename="../../view/Page/Form/Login/SIPLoginPage.qml" line="144"/>
<location filename="../../view/Page/Form/Login/SIPLoginPage.qml" line="143"/>
<source>assistant_third_party_sip_account_warning_ok</source>
<extracomment>&quot;Je comprends&quot;</extracomment>
<translation>Verstanden</translation>
</message>
<message>
<location filename="../../view/Page/Form/Login/SIPLoginPage.qml" line="182"/>
<location filename="../../view/Page/Form/Login/SIPLoginPage.qml" line="188"/>
<source>username</source>
<extracomment>&quot;Nom d&apos;utilisateur&quot;</extracomment>
<translation>Benutzername</translation>
</message>
<message>
<location filename="../../view/Page/Form/Login/SIPLoginPage.qml" line="195"/>
<location filename="../../view/Page/Form/Login/SIPLoginPage.qml" line="201"/>
<source>password</source>
<translation>Passwort</translation>
</message>
<message>
<location filename="../../view/Page/Form/Login/SIPLoginPage.qml" line="211"/>
<location filename="../../view/Page/Form/Login/SIPLoginPage.qml" line="217"/>
<source>sip_address_domain</source>
<extracomment>&quot;Domaine&quot;</extracomment>
<translation>Domäne</translation>
</message>
<message>
<location filename="../../view/Page/Form/Login/SIPLoginPage.qml" line="232"/>
<location filename="../../view/Page/Form/Login/SIPLoginPage.qml" line="238"/>
<source>sip_address_display_name</source>
<extracomment>Nom d&apos;affichage</extracomment>
<translation>Anzeigename</translation>
</message>
<message>
<location filename="../../view/Page/Form/Login/SIPLoginPage.qml" line="243"/>
<location filename="../../view/Page/Form/Login/SIPLoginPage.qml" line="249"/>
<source>transport</source>
<extracomment>&quot;Transport&quot;</extracomment>
<translation>Transport</translation>
</message>
<message>
<location filename="../../view/Page/Form/Login/SIPLoginPage.qml" line="283"/>
<location filename="../../view/Page/Form/Login/SIPLoginPage.qml" line="290"/>
<source>assistant_account_login</source>
<translation>Anmelden</translation>
</message>
<message>
<location filename="../../view/Page/Form/Login/SIPLoginPage.qml" line="332"/>
<location filename="../../view/Page/Form/Login/SIPLoginPage.qml" line="339"/>
<source>assistant_account_login_missing_username</source>
<translation>Bitte Benutzernamen eingeben</translation>
</message>
<message>
<location filename="../../view/Page/Form/Login/SIPLoginPage.qml" line="334"/>
<location filename="../../view/Page/Form/Login/SIPLoginPage.qml" line="341"/>
<source>assistant_account_login_missing_password</source>
<translation>Bitte Passwort eingeben</translation>
</message>
<message>
<location filename="../../view/Page/Form/Login/SIPLoginPage.qml" line="337"/>
<location filename="../../view/Page/Form/Login/SIPLoginPage.qml" line="344"/>
<source>assistant_account_login_missing_domain</source>
<extracomment>&quot;Veuillez saisir un nom de domaine</extracomment>
<translation>Bitte Domäne eingeben</translation>
</message>
<message>
<location filename="../../view/Page/Form/Login/SIPLoginPage.qml" line="358"/>
<location filename="../../view/Page/Form/Login/SIPLoginPage.qml" line="369"/>
<source>login_server_address</source>
<extracomment>&quot;URL du serveur mandataire&quot;
----------
&quot;Identifiant de connexion (si différent)&quot;</extracomment>
<location filename="../../view/Page/Form/Login/SIPLoginPage.qml" line="366"/>
<source>login_advanced_parameters_label</source>
<extracomment>Advanced parameters</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../view/Page/Form/Login/SIPLoginPage.qml" line="374"/>
<source>login_proxy_server_url</source>
<extracomment>&quot;Proxy server URL&quot;</extracomment>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../../view/Page/Form/Login/SIPLoginPage.qml" line="385"/>
<source>login_id</source>
<extracomment>&quot;Connexion ID (if different)&quot;</extracomment>
<translation type="unfinished"></translation>
</message>
</context>

View file

@ -83,45 +83,45 @@
<context>
<name>AccountManager</name>
<message>
<location filename="../../model/account/AccountManager.cpp" line="84"/>
<location filename="../../model/account/AccountManager.cpp" line="86"/>
<source>assistant_account_login_already_connected_error</source>
<extracomment>&quot;Le compte est déjà connecté&quot;</extracomment>
<extracomment>&quot;The account is already connected&quot;</extracomment>
<translation>The account is already connected</translation>
</message>
<message>
<location filename="../../model/account/AccountManager.cpp" line="98"/>
<location filename="../../model/account/AccountManager.cpp" line="104"/>
<source>assistant_account_login_proxy_address_error</source>
<extracomment>&quot;Impossible de créer l&apos;adresse proxy. Merci de vérifier le nom de domaine.&quot;</extracomment>
<extracomment>&quot;Unable to create proxy address. Please check the domain name.&quot;</extracomment>
<translation>Unable to create proxy address. Please check the domain name.</translation>
</message>
<message>
<location filename="../../model/account/AccountManager.cpp" line="111"/>
<location filename="../../model/account/AccountManager.cpp" line="117"/>
<source>assistant_account_login_address_configuration_error</source>
<extracomment>&quot;Impossible de configurer l&apos;adresse : `%1`.&quot;</extracomment>
<extracomment>&quot;Unable to configure address: `%1`.&quot;</extracomment>
<translation>Unable to configure address: `%1`.</translation>
</message>
<message>
<location filename="../../model/account/AccountManager.cpp" line="118"/>
<location filename="../../model/account/AccountManager.cpp" line="124"/>
<source>assistant_account_login_params_configuration_error</source>
<extracomment>&quot;Impossible de configurer les paramètres du compte.&quot;</extracomment>
<extracomment>&quot;Unable to configure account settings.&quot;</extracomment>
<translation>Unable to configure account settings.</translation>
</message>
<message>
<location filename="../../model/account/AccountManager.cpp" line="142"/>
<location filename="../../model/account/AccountManager.cpp" line="148"/>
<source>assistant_account_login_forbidden_error</source>
<extracomment>&quot;Le couple identifiant mot de passe ne correspond pas&quot;</extracomment>
<extracomment>&quot;Username and password do not match&quot;</extracomment>
<translation>Username and password do not match</translation>
</message>
<message>
<location filename="../../model/account/AccountManager.cpp" line="144"/>
<location filename="../../model/account/AccountManager.cpp" line="150"/>
<source>assistant_account_login_error</source>
<extracomment>&quot;Erreur durant la connexion&quot;</extracomment>
<extracomment>&quot;Error during connection, please verify your parameters&quot;</extracomment>
<translation>Error during connection</translation>
</message>
<message>
<location filename="../../model/account/AccountManager.cpp" line="157"/>
<location filename="../../model/account/AccountManager.cpp" line="163"/>
<source>assistant_account_add_error</source>
<extracomment>&quot;Impossible d&apos;ajouter le compte.&quot;</extracomment>
<extracomment>&quot;Unable to add account.&quot;</extracomment>
<translation>Unable to add account.</translation>
</message>
</context>
@ -3693,7 +3693,7 @@ Expiration : %1</translation>
<translation>Remote provisioning link</translation>
</message>
<message>
<location filename="../../core/login/LoginPage.cpp" line="80"/>
<location filename="../../core/login/LoginPage.cpp" line="85"/>
<source>default_account_connection_state_error_toast</source>
<translation>Error during connection</translation>
</message>
@ -4796,75 +4796,84 @@ These features will be hidden if you use a third-party SIP account.
To enable them in a commercial project, please contact us.</translation>
</message>
<message>
<location filename="../../view/Page/Form/Login/SIPLoginPage.qml" line="132"/>
<location filename="../../view/Page/Form/Login/SIPLoginPage.qml" line="131"/>
<source>assistant_third_party_sip_account_create_linphone_account</source>
<extracomment>&quot;Créer un compte linphone&quot;</extracomment>
<translation>Create a linphone account</translation>
</message>
<message>
<location filename="../../view/Page/Form/Login/SIPLoginPage.qml" line="144"/>
<location filename="../../view/Page/Form/Login/SIPLoginPage.qml" line="143"/>
<source>assistant_third_party_sip_account_warning_ok</source>
<extracomment>&quot;Je comprends&quot;</extracomment>
<translation>I understand</translation>
</message>
<message>
<location filename="../../view/Page/Form/Login/SIPLoginPage.qml" line="182"/>
<location filename="../../view/Page/Form/Login/SIPLoginPage.qml" line="188"/>
<source>username</source>
<extracomment>&quot;Nom d&apos;utilisateur&quot;</extracomment>
<translation>Username</translation>
</message>
<message>
<location filename="../../view/Page/Form/Login/SIPLoginPage.qml" line="195"/>
<location filename="../../view/Page/Form/Login/SIPLoginPage.qml" line="201"/>
<source>password</source>
<translation>Password</translation>
</message>
<message>
<location filename="../../view/Page/Form/Login/SIPLoginPage.qml" line="211"/>
<location filename="../../view/Page/Form/Login/SIPLoginPage.qml" line="217"/>
<source>sip_address_domain</source>
<extracomment>&quot;Domaine&quot;</extracomment>
<translation>Domain</translation>
</message>
<message>
<location filename="../../view/Page/Form/Login/SIPLoginPage.qml" line="232"/>
<location filename="../../view/Page/Form/Login/SIPLoginPage.qml" line="238"/>
<source>sip_address_display_name</source>
<extracomment>Nom d&apos;affichage</extracomment>
<translation>Display name</translation>
</message>
<message>
<location filename="../../view/Page/Form/Login/SIPLoginPage.qml" line="243"/>
<location filename="../../view/Page/Form/Login/SIPLoginPage.qml" line="249"/>
<source>transport</source>
<extracomment>&quot;Transport&quot;</extracomment>
<translation>Transport</translation>
</message>
<message>
<location filename="../../view/Page/Form/Login/SIPLoginPage.qml" line="283"/>
<location filename="../../view/Page/Form/Login/SIPLoginPage.qml" line="290"/>
<source>assistant_account_login</source>
<translation>Connection</translation>
</message>
<message>
<location filename="../../view/Page/Form/Login/SIPLoginPage.qml" line="332"/>
<location filename="../../view/Page/Form/Login/SIPLoginPage.qml" line="339"/>
<source>assistant_account_login_missing_username</source>
<translation>Please enter a username</translation>
</message>
<message>
<location filename="../../view/Page/Form/Login/SIPLoginPage.qml" line="334"/>
<location filename="../../view/Page/Form/Login/SIPLoginPage.qml" line="341"/>
<source>assistant_account_login_missing_password</source>
<translation>Please enter a password</translation>
</message>
<message>
<location filename="../../view/Page/Form/Login/SIPLoginPage.qml" line="337"/>
<location filename="../../view/Page/Form/Login/SIPLoginPage.qml" line="344"/>
<source>assistant_account_login_missing_domain</source>
<extracomment>&quot;Veuillez saisir un nom de domaine</extracomment>
<translation>Please enter a domain</translation>
</message>
<message>
<location filename="../../view/Page/Form/Login/SIPLoginPage.qml" line="358"/>
<location filename="../../view/Page/Form/Login/SIPLoginPage.qml" line="369"/>
<source>login_server_address</source>
<extracomment>&quot;URL du serveur mandataire&quot;
----------
&quot;Identifiant de connexion (si différent)&quot;</extracomment>
<translation type="unfinished"></translation>
<location filename="../../view/Page/Form/Login/SIPLoginPage.qml" line="366"/>
<source>login_advanced_parameters_label</source>
<extracomment>Advanced parameters</extracomment>
<translation>Advanced parameters</translation>
</message>
<message>
<location filename="../../view/Page/Form/Login/SIPLoginPage.qml" line="374"/>
<source>login_proxy_server_url</source>
<extracomment>&quot;Proxy server URL&quot;</extracomment>
<translation>Proxy server URL</translation>
</message>
<message>
<location filename="../../view/Page/Form/Login/SIPLoginPage.qml" line="385"/>
<source>login_id</source>
<extracomment>&quot;Connexion ID (if different)&quot;</extracomment>
<translation>Connexion ID (if different)</translation>
</message>
</context>
<context>

View file

@ -83,45 +83,45 @@
<context>
<name>AccountManager</name>
<message>
<location filename="../../model/account/AccountManager.cpp" line="84"/>
<location filename="../../model/account/AccountManager.cpp" line="86"/>
<source>assistant_account_login_already_connected_error</source>
<extracomment>&quot;Le compte est déjà connecté&quot;</extracomment>
<extracomment>&quot;The account is already connected&quot;</extracomment>
<translation>Le compte est déjà connecté</translation>
</message>
<message>
<location filename="../../model/account/AccountManager.cpp" line="98"/>
<location filename="../../model/account/AccountManager.cpp" line="104"/>
<source>assistant_account_login_proxy_address_error</source>
<extracomment>&quot;Impossible de créer l&apos;adresse proxy. Merci de vérifier le nom de domaine.&quot;</extracomment>
<extracomment>&quot;Unable to create proxy address. Please check the domain name.&quot;</extracomment>
<translation>Impossible de créer l&apos;adresse proxy. Merci de vérifier le nom de domaine.</translation>
</message>
<message>
<location filename="../../model/account/AccountManager.cpp" line="111"/>
<location filename="../../model/account/AccountManager.cpp" line="117"/>
<source>assistant_account_login_address_configuration_error</source>
<extracomment>&quot;Impossible de configurer l&apos;adresse : `%1`.&quot;</extracomment>
<extracomment>&quot;Unable to configure address: `%1`.&quot;</extracomment>
<translation>Impossible de configurer l&apos;adresse : `%1`.</translation>
</message>
<message>
<location filename="../../model/account/AccountManager.cpp" line="118"/>
<location filename="../../model/account/AccountManager.cpp" line="124"/>
<source>assistant_account_login_params_configuration_error</source>
<extracomment>&quot;Impossible de configurer les paramètres du compte.&quot;</extracomment>
<extracomment>&quot;Unable to configure account settings.&quot;</extracomment>
<translation>Impossible de configurer les paramètres du compte.</translation>
</message>
<message>
<location filename="../../model/account/AccountManager.cpp" line="142"/>
<location filename="../../model/account/AccountManager.cpp" line="148"/>
<source>assistant_account_login_forbidden_error</source>
<extracomment>&quot;Le couple identifiant mot de passe ne correspond pas&quot;</extracomment>
<extracomment>&quot;Username and password do not match&quot;</extracomment>
<translation>Le couple identifiant mot de passe ne correspond pas</translation>
</message>
<message>
<location filename="../../model/account/AccountManager.cpp" line="144"/>
<location filename="../../model/account/AccountManager.cpp" line="150"/>
<source>assistant_account_login_error</source>
<extracomment>&quot;Erreur durant la connexion&quot;</extracomment>
<translation>Erreur durant la connexion</translation>
<extracomment>&quot;Error during connection, please verify your parameters&quot;</extracomment>
<translation>Erreur durant la connexion, veuillez vérifier vos paramètres</translation>
</message>
<message>
<location filename="../../model/account/AccountManager.cpp" line="157"/>
<location filename="../../model/account/AccountManager.cpp" line="163"/>
<source>assistant_account_add_error</source>
<extracomment>&quot;Impossible d&apos;ajouter le compte.&quot;</extracomment>
<extracomment>&quot;Unable to add account.&quot;</extracomment>
<translation>Impossible d&apos;ajouter le compte.</translation>
</message>
</context>
@ -3693,7 +3693,7 @@ Expiration : %1</translation>
<translation>Lien de configuration distante</translation>
</message>
<message>
<location filename="../../core/login/LoginPage.cpp" line="80"/>
<location filename="../../core/login/LoginPage.cpp" line="85"/>
<source>default_account_connection_state_error_toast</source>
<translation>Erreur durant la connexion</translation>
</message>
@ -4796,75 +4796,84 @@ Ces fonctionnalités seront masquées si vous utilisez un compte SIP tiers.
Pour les activer dans un projet commercial, merci de nous contacter.</translation>
</message>
<message>
<location filename="../../view/Page/Form/Login/SIPLoginPage.qml" line="132"/>
<location filename="../../view/Page/Form/Login/SIPLoginPage.qml" line="131"/>
<source>assistant_third_party_sip_account_create_linphone_account</source>
<extracomment>&quot;Créer un compte linphone&quot;</extracomment>
<translation>Créer un compte linphone</translation>
</message>
<message>
<location filename="../../view/Page/Form/Login/SIPLoginPage.qml" line="144"/>
<location filename="../../view/Page/Form/Login/SIPLoginPage.qml" line="143"/>
<source>assistant_third_party_sip_account_warning_ok</source>
<extracomment>&quot;Je comprends&quot;</extracomment>
<translation>Je comprends</translation>
</message>
<message>
<location filename="../../view/Page/Form/Login/SIPLoginPage.qml" line="182"/>
<location filename="../../view/Page/Form/Login/SIPLoginPage.qml" line="188"/>
<source>username</source>
<extracomment>&quot;Nom d&apos;utilisateur&quot;</extracomment>
<translation>Nom d&apos;utilisateur</translation>
</message>
<message>
<location filename="../../view/Page/Form/Login/SIPLoginPage.qml" line="195"/>
<location filename="../../view/Page/Form/Login/SIPLoginPage.qml" line="201"/>
<source>password</source>
<translation>Mot de passe</translation>
</message>
<message>
<location filename="../../view/Page/Form/Login/SIPLoginPage.qml" line="211"/>
<location filename="../../view/Page/Form/Login/SIPLoginPage.qml" line="217"/>
<source>sip_address_domain</source>
<extracomment>&quot;Domaine&quot;</extracomment>
<translation>Domaine</translation>
</message>
<message>
<location filename="../../view/Page/Form/Login/SIPLoginPage.qml" line="232"/>
<location filename="../../view/Page/Form/Login/SIPLoginPage.qml" line="238"/>
<source>sip_address_display_name</source>
<extracomment>Nom d&apos;affichage</extracomment>
<translation>Nom d&apos;affichage</translation>
</message>
<message>
<location filename="../../view/Page/Form/Login/SIPLoginPage.qml" line="243"/>
<location filename="../../view/Page/Form/Login/SIPLoginPage.qml" line="249"/>
<source>transport</source>
<extracomment>&quot;Transport&quot;</extracomment>
<translation>Transport</translation>
</message>
<message>
<location filename="../../view/Page/Form/Login/SIPLoginPage.qml" line="283"/>
<location filename="../../view/Page/Form/Login/SIPLoginPage.qml" line="290"/>
<source>assistant_account_login</source>
<translation>Connexion</translation>
</message>
<message>
<location filename="../../view/Page/Form/Login/SIPLoginPage.qml" line="332"/>
<location filename="../../view/Page/Form/Login/SIPLoginPage.qml" line="339"/>
<source>assistant_account_login_missing_username</source>
<translation>Veuillez saisir un nom d&apos;utilisateur</translation>
</message>
<message>
<location filename="../../view/Page/Form/Login/SIPLoginPage.qml" line="334"/>
<location filename="../../view/Page/Form/Login/SIPLoginPage.qml" line="341"/>
<source>assistant_account_login_missing_password</source>
<translation>Veuillez saisir un mot de passe</translation>
</message>
<message>
<location filename="../../view/Page/Form/Login/SIPLoginPage.qml" line="337"/>
<location filename="../../view/Page/Form/Login/SIPLoginPage.qml" line="344"/>
<source>assistant_account_login_missing_domain</source>
<extracomment>&quot;Veuillez saisir un nom de domaine</extracomment>
<translation>Veuillez saisir un nom de domaine</translation>
</message>
<message>
<location filename="../../view/Page/Form/Login/SIPLoginPage.qml" line="358"/>
<location filename="../../view/Page/Form/Login/SIPLoginPage.qml" line="369"/>
<source>login_server_address</source>
<extracomment>&quot;URL du serveur mandataire&quot;
----------
&quot;Identifiant de connexion (si différent)&quot;</extracomment>
<translation type="unfinished"></translation>
<location filename="../../view/Page/Form/Login/SIPLoginPage.qml" line="366"/>
<source>login_advanced_parameters_label</source>
<extracomment>Advanced parameters</extracomment>
<translation>Paramètres avancés</translation>
</message>
<message>
<location filename="../../view/Page/Form/Login/SIPLoginPage.qml" line="374"/>
<source>login_proxy_server_url</source>
<extracomment>&quot;Proxy server URL&quot;</extracomment>
<translation>URI du proxy SIP sortant</translation>
</message>
<message>
<location filename="../../view/Page/Form/Login/SIPLoginPage.qml" line="385"/>
<source>login_id</source>
<extracomment>&quot;Connexion ID (if different)&quot;</extracomment>
<translation>Identifiant de connexion (si différent)</translation>
</message>
</context>
<context>

View file

@ -59,7 +59,9 @@ bool AccountManager::login(QString username,
QString displayName,
QString domain,
linphone::TransportType transportType,
QString *errorMessage) {
QString *errorMessage,
QString serverAddress,
QString connectionId) {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
auto core = CoreModel::getInstance()->getCore();
auto factory = linphone::Factory::get();
@ -80,26 +82,30 @@ bool AccountManager::login(QString username,
auto otherParams = otherAccount->getParams();
if (otherParams->getIdentityAddress()->getUsername() == Utils::appStringToCoreString(username) &&
otherParams->getDomain() == Utils::appStringToCoreString(domain)) {
//: "Le compte est déjà connecté"
//: "The account is already connected"
*errorMessage = tr("assistant_account_login_already_connected_error");
return false;
}
}
if (!displayName.isEmpty()) identity->setDisplayName(Utils::appStringToCoreString(displayName));
if (!serverAddress.isEmpty()) {
auto linServerAddress = ToolModel::interpretUrl(serverAddress);
params->setServerAddress(linServerAddress);
}
if (!domain.isEmpty()) {
identity->setDomain(Utils::appStringToCoreString(domain));
if (QString::compare(domain, "sip.linphone.org")) {
params->setLimeServerUrl("");
auto serverAddress =
auto computedServerAddress =
factory->createAddress(Utils::appStringToCoreString(QStringLiteral("sip:%1").arg(domain)));
if (!serverAddress) {
//: "Impossible de créer l'adresse proxy. Merci de vérifier le nom de domaine."
if (!computedServerAddress) {
//: "Unable to create proxy address. Please check the domain name."
*errorMessage = tr("assistant_account_login_proxy_address_error");
return false;
}
serverAddress->setTransport(transportType);
params->setServerAddress(serverAddress);
computedServerAddress->setTransport(transportType);
params->setServerAddress(computedServerAddress);
}
}
if (params->setIdentityAddress(identity)) {
@ -107,23 +113,23 @@ bool AccountManager::login(QString username,
.arg(QStringLiteral("Unable to set identity address: `%1`."))
.arg(Utils::coreStringToAppString(identity->asStringUriOnly()));
//: "Impossible de configurer l'adresse : `%1`."
//: "Unable to configure address: `%1`."
*errorMessage = tr("assistant_account_login_address_configuration_error")
.arg(Utils::coreStringToAppString(identity->asStringUriOnly()));
return false;
}
if (account->setParams(params)) {
//: "Impossible de configurer les paramètres du compte."
//: "Unable to configure account settings."
*errorMessage = tr("assistant_account_login_params_configuration_error");
return false;
}
auto authInfo = factory->createAuthInfo(Utils::appStringToCoreString(username), // Username.
"", // User ID.
Utils::appStringToCoreString(password), // Password.
"", // HA1.
"", // Realm.
identity->getDomain() // Domain.
auto authInfo = factory->createAuthInfo(Utils::appStringToCoreString(username), // Username.
Utils::appStringToCoreString(connectionId), // User ID.
Utils::appStringToCoreString(password), // Password.
"", // HA1.
"", // Realm.
identity->getDomain() // Domain.
);
core->addAuthInfo(authInfo);
mAccountModel = Utils::makeQObject_ptr<AccountModel>(account);
@ -137,10 +143,10 @@ bool AccountManager::login(QString username,
connect(
mAccountModel.get(), &AccountModel::removed, this, [this]() { mAccountModel = nullptr; },
Qt::SingleShotConnection);
//: "Le couple identifiant mot de passe ne correspond pas"
//: "Username and password do not match"
if (account->getError() == linphone::Reason::Forbidden)
errorMessage = tr("assistant_account_login_forbidden_error");
//: "Erreur durant la connexion"
//: "Error during connection, please verify your parameters"
else errorMessage = tr("assistant_account_login_error");
mAccountModel->removeAccount();
} else if (state == linphone::RegistrationState::Ok) {
@ -149,11 +155,11 @@ bool AccountManager::login(QString username,
mAccountModel = nullptr;
}
}
emit registrationStateChanged(state, errorMessage);
emit registrationStateChanged(state, account->getError(), errorMessage);
});
auto status = core->addAccount(account);
if (status == -1) {
//: "Impossible d'ajouter le compte."
//: "Unable to add account."
*errorMessage = tr("assistant_account_add_error");
core->removeAuthInfo(authInfo);
return false;

View file

@ -41,7 +41,9 @@ public:
QString displayName = QString(),
QString domain = QString(),
linphone::TransportType transportType = linphone::TransportType::Tls,
QString *errorMessage = nullptr);
QString *errorMessage = nullptr,
QString serverAddress = QString(),
QString connectionId = QString());
std::shared_ptr<linphone::Account> createAccount(const QString &assistantFile);
@ -55,7 +57,8 @@ public:
void linkNewAccountUsingCode(const QString &code, RegisterType registerType, const QString &sipAddress);
signals:
void registrationStateChanged(linphone::RegistrationState state, QString message = QString());
void
registrationStateChanged(linphone::RegistrationState state, linphone::Reason reason, QString message = QString());
void newAccountCreationSucceed(QString sipAddress, RegisterType registerType, const QString &registerAddress);
void registerNewAccountFailed(const QString &error);
void tokenConversionSucceed(QString convertedToken);

View file

@ -107,7 +107,6 @@ LoginLayout {
}
text: qsTr("Certaines fonctionnalités telles que les conversations de groupe, les vidéo-conférences, etc… nécessitent un compte %1.\n\nCes fonctionnalités seront masquées si vous utilisez un compte SIP tiers.\n\nPour les activer dans un projet commercial, merci de nous contacter.").arg(applicationName)
}
}
SmallButton {
id: openLinkButton
@ -170,93 +169,101 @@ LoginLayout {
RowLayout {
id: content
width: formFlickable.width - scrollbar.width*2
spacing: Math.round(50 * DefaultStyle.dp)
ColumnLayout {
spacing: Math.round(2 * DefaultStyle.dp)
Layout.preferredWidth: Math.round(360 * DefaultStyle.dp)
Layout.preferredWidth: Math.round(360 * DefaultStyle.dp)
Layout.fillHeight: true
ColumnLayout {
spacing: Math.round(8 * DefaultStyle.dp)
FormItemLayout {
id: username
//: "Nom d'utilisateur"
label: qsTr("username")
mandatory: true
enableErrorText: true
Layout.fillWidth: true
contentItem: TextField {
id: usernameEdit
isError: username.errorTextVisible || errorText.isVisible
Layout.preferredWidth: Math.round(360 * DefaultStyle.dp)
KeyNavigation.down: passwordEdit
}
spacing: Math.round(22 * DefaultStyle.dp)
// alignment item
Item {
Layout.preferredHeight: advancedParametersTitle.implicitHeight
}
FormItemLayout {
id: password
label: qsTr("password")
mandatory: true
enableErrorText: true
Layout.fillWidth: true
contentItem: TextField {
id: passwordEdit
isError: password.errorTextVisible || errorText.isVisible
hidden: true
Layout.preferredWidth: Math.round(360 * DefaultStyle.dp)
KeyNavigation.up: usernameEdit
KeyNavigation.down: domainEdit
}
}
FormItemLayout {
id: domain
//: "Domaine"
label: qsTr("sip_address_domain")
mandatory: true
enableErrorText: true
Layout.fillWidth: true
contentItem: TextField {
id: domainEdit
isError: domain.errorTextVisible
initialText: SettingsCpp.assistantThirdPartySipAccountDomain
Layout.preferredWidth: Math.round(360 * DefaultStyle.dp)
KeyNavigation.up: passwordEdit
KeyNavigation.down: displayName
}
Connections {
target: SettingsCpp
function onAssistantThirdPartySipAccountDomainChanged() {
domainEdit.resetText()
ColumnLayout {
spacing: Math.round(10 * DefaultStyle.dp)
FormItemLayout {
id: username
//: "Nom d'utilisateur"
label: qsTr("username")
mandatory: true
enableErrorText: true
Layout.fillWidth: true
contentItem: TextField {
id: usernameEdit
isError: username.errorTextVisible || (LoginPageCpp.badIds && errorText.isVisible)
Layout.preferredWidth: Math.round(360 * DefaultStyle.dp)
KeyNavigation.down: passwordEdit
}
}
}
FormItemLayout {
//: Nom d'affichage
label: qsTr("sip_address_display_name")
Layout.fillWidth: true
contentItem: TextField {
id: displayName
Layout.preferredWidth: Math.round(360 * DefaultStyle.dp)
KeyNavigation.up: domainEdit
KeyNavigation.down: transportCbox
FormItemLayout {
id: password
label: qsTr("password")
mandatory: true
enableErrorText: true
Layout.fillWidth: true
contentItem: TextField {
id: passwordEdit
isError: password.errorTextVisible || (LoginPageCpp.badIds && errorText.isVisible)
hidden: true
Layout.preferredWidth: Math.round(360 * DefaultStyle.dp)
KeyNavigation.up: usernameEdit
KeyNavigation.down: domainEdit
}
}
}
FormItemLayout {
//: "Transport"
label: qsTr("transport")
Layout.fillWidth: true
contentItem: ComboBox {
id: transportCbox
height: Math.round(49 * DefaultStyle.dp)
width: Math.round(360 * DefaultStyle.dp)
textRole: "text"
valueRole: "value"
model: [
{text: "TCP", value: LinphoneEnums.TransportType.Tcp},
{text: "UDP", value: LinphoneEnums.TransportType.Udp},
{text: "TLS", value: LinphoneEnums.TransportType.Tls},
{text: "DTLS", value: LinphoneEnums.TransportType.Dtls}
]
currentIndex: Utils.findIndex(model, function (entry) {
return entry.text === SettingsCpp.assistantThirdPartySipAccountTransport.toUpperCase()
})
FormItemLayout {
id: domain
//: "Domaine"
label: qsTr("sip_address_domain")
mandatory: true
enableErrorText: true
Layout.fillWidth: true
contentItem: TextField {
id: domainEdit
isError: domain.errorTextVisible
initialText: SettingsCpp.assistantThirdPartySipAccountDomain
Layout.preferredWidth: Math.round(360 * DefaultStyle.dp)
KeyNavigation.up: passwordEdit
KeyNavigation.down: displayName
}
Connections {
target: SettingsCpp
function onAssistantThirdPartySipAccountDomainChanged() {
domainEdit.resetText()
}
}
}
FormItemLayout {
//: Nom d'affichage
label: qsTr("sip_address_display_name")
Layout.fillWidth: true
contentItem: TextField {
id: displayName
Layout.preferredWidth: Math.round(360 * DefaultStyle.dp)
KeyNavigation.up: domainEdit
KeyNavigation.down: transportCbox
}
}
FormItemLayout {
//: "Transport"
label: qsTr("transport")
Layout.fillWidth: true
contentItem: ComboBox {
id: transportCbox
height: Math.round(49 * DefaultStyle.dp)
width: Math.round(360 * DefaultStyle.dp)
textRole: "text"
valueRole: "value"
model: [
{text: "TCP", value: LinphoneEnums.TransportType.Tcp},
{text: "UDP", value: LinphoneEnums.TransportType.Udp},
{text: "TLS", value: LinphoneEnums.TransportType.Tls},
{text: "DTLS", value: LinphoneEnums.TransportType.Dtls}
]
currentIndex: Utils.findIndex(model, function (entry) {
return entry.text === SettingsCpp.assistantThirdPartySipAccountTransport.toUpperCase()
})
}
}
}
}
@ -338,7 +345,8 @@ LoginLayout {
return
}
console.debug("[SIPLoginPage] User: Log in")
LoginPageCpp.login(usernameEdit.text, passwordEdit.text, displayName.text, domainEdit.text, transportCbox.currentValue);
LoginPageCpp.login(usernameEdit.text, passwordEdit.text, displayName.text, domainEdit.text,
transportCbox.currentValue, serverAddressEdit.text, connectionIdEdit.text);
connectionButton.enabled = false
connectionButtonContent.currentIndex = 1
}
@ -349,33 +357,43 @@ LoginLayout {
}
}
ColumnLayout {
Layout.preferredWidth: Math.round(360 * DefaultStyle.dp)
Layout.preferredWidth: Math.round(360 * DefaultStyle.dp)
Layout.fillHeight: true
spacing: Math.round(8 * DefaultStyle.dp)
FormItemLayout {
id: serverAddress
//: "URL du serveur mandataire"
label: qsTr("login_server_address")
Layout.fillWidth: true
contentItem: TextField {
id: serverAddressEdit
Layout.preferredWidth: Math.round(360 * DefaultStyle.dp)
KeyNavigation.down: connectionIdEdit
}
spacing: Math.round(22 * DefaultStyle.dp)
Text {
id: advancedParametersTitle
//: Advanced parameters
text: qsTr("login_advanced_parameters_label")
font: Typography.h3m
}
FormItemLayout {
id: connectionId
//: "Identifiant de connexion (si différent)"
label: qsTr("login_server_address")
Layout.fillWidth: true
contentItem: TextField {
id: connectionIdEdit
Layout.preferredWidth: Math.round(360 * DefaultStyle.dp)
KeyNavigation.up: serverAddressEdit
ColumnLayout {
spacing: Math.round(10 * DefaultStyle.dp)
FormItemLayout {
id: serverAddress
//: "Proxy server URL"
label: qsTr("login_proxy_server_url")
Layout.fillWidth: true
contentItem: TextField {
id: serverAddressEdit
Layout.preferredWidth: Math.round(360 * DefaultStyle.dp)
KeyNavigation.down: connectionIdEdit
}
}
FormItemLayout {
id: connectionId
//: "Connexion ID (if different)"
label: qsTr("login_id")
Layout.fillWidth: true
contentItem: TextField {
id: connectionIdEdit
Layout.preferredWidth: Math.round(360 * DefaultStyle.dp)
KeyNavigation.up: serverAddressEdit
}
}
}
Item{Layout.fillHeight: true}
}
Item{Layout.fillHeight: true}
}
}
}
@ -387,11 +405,11 @@ LoginLayout {
active: true
interactive: true
parent: rootStackView.currentItem
// visible: parent.contentHeight > parent.height
visible: parent.contentHeight > parent.height
policy: Control.ScrollBar.AsNeeded
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.left: parent.left
anchors.right: parent.right
// Layout.leftMargin: Math.round(119 * DefaultStyle.dp)
// anchors.leftMargin: Math.round(119 * DefaultStyle.dp)
// anchors.rightMargin: -8 * DefaultStyle.dp

View file

@ -14,7 +14,7 @@ QtObject {
property font h3m: Qt.font( {
family: DefaultStyle.defaultFont,
pixelSize: Math.round(16 * DefaultStyle.dp),
weight: Math.min(Math.round(800 * DefaultStyle.dp), 1000)
weight: Math.min(Math.round(700 * DefaultStyle.dp), 1000)
})
// Title/H3 - Bloc title