From c65c5c8c5a444aa85843a5b1a67925f6e0790c06 Mon Sep 17 00:00:00 2001 From: gaelle Date: Tue, 4 Mar 2025 11:34:42 +0100 Subject: [PATCH] fix login error messages in french try to remove ninja compile --- .../linux-desktop-ubuntu-2004.yml | 30 +++++++++---------- Linphone/core/login/LoginPage.cpp | 2 +- Linphone/model/account/AccountManager.cpp | 11 ++++--- 3 files changed, 23 insertions(+), 20 deletions(-) diff --git a/.gitlab-ci-files/linux-desktop-ubuntu-2004.yml b/.gitlab-ci-files/linux-desktop-ubuntu-2004.yml index eb150721..5cf86e4e 100644 --- a/.gitlab-ci-files/linux-desktop-ubuntu-2004.yml +++ b/.gitlab-ci-files/linux-desktop-ubuntu-2004.yml @@ -4,7 +4,7 @@ ubuntu2004-ninja-gcc: rules: - - if: $CI_PIPELINE_SOURCE == "merge_request_event" && $DOCKER_UPDATE == null && $SKIP_LINUX == null + - if: $CI_PIPELINE_SOURCE == "merge_request_event" && $DOCKER_UPDATE == null variables: CMAKE_GENERATOR: Ninja CMAKE_OPTIONS: -DENABLE_PQCRYPTO=ON @@ -18,23 +18,23 @@ ubuntu2004-ninja-gcc: # Nightly ################################################# -ubuntu2004-makefile-gcc: - rules: - - !reference [.rules-merge-request-manual, rules] - - if: $NIGHTLY_MASTER - variables: - CMAKE_GENERATOR: Unix Makefiles - CMAKE_OPTIONS: -DENABLE_PQCRYPTO=ON - CC: gcc - CXX: g++ - ADDITIONAL_BUILD_OPTIONS: -j$MAKEFILE_JOBS - extends: .linux-desktop - <<: *docker_image_platform_and_runner_tag +# ubuntu2004-makefile-gcc: +# rules: +# - !reference [.rules-merge-request-manual, rules] +# - if: $NIGHTLY_MASTER +# variables: +# CMAKE_GENERATOR: Unix Makefiles +# CMAKE_OPTIONS: -DENABLE_PQCRYPTO=ON +# CC: gcc +# CXX: g++ +# ADDITIONAL_BUILD_OPTIONS: -j$MAKEFILE_JOBS +# extends: .linux-desktop +# <<: *docker_image_platform_and_runner_tag ubuntu2004-ninja-clang: rules: - !reference [.rules-merge-request-manual, rules] - - if: $NIGHTLY_MASTER == null + - if: $NIGHTLY_MASTER && $SKIP_LINUX != 1 variables: CMAKE_OPTIONS: -DENABLE_DOC=ON -DENABLE_G729=ON -DENABLE_PQCRYPTO=ON -DENABLE_GPL_THIRD_PARTIES=ON CMAKE_GENERATOR: Ninja @@ -46,7 +46,7 @@ ubuntu2004-ninja-clang: ubuntu2004-ninja-clang-small: rules: - !reference [.rules-merge-request-manual, rules] - - if: $NIGHTLY_MASTER == null + - if: $NIGHTLY_MASTER && $SKIP_LINUX != 1 variables: CMAKE_OPTIONS: -DENABLE_VIDEO=NO -DENABLE_ADVANCED_IM=NO -DENABLE_DB_STORAGE=NO -DENABLE_PQCRYPTO=OFF extends: ubuntu2004-ninja-clang diff --git a/Linphone/core/login/LoginPage.cpp b/Linphone/core/login/LoginPage.cpp index ab1aae1f..05f744e0 100644 --- a/Linphone/core/login/LoginPage.cpp +++ b/Linphone/core/login/LoginPage.cpp @@ -76,7 +76,7 @@ void LoginPage::login(const QString &username, switch (state) { case linphone::RegistrationState::Failed: { if (message.isEmpty()) - setErrorMessage(QString(tr("Le couple identifiant mot de passe ne correspond pas"))); + setErrorMessage(QString(tr("Erreur durant la connexion"))); else setErrorMessage(message); if (accountManager) { diff --git a/Linphone/model/account/AccountManager.cpp b/Linphone/model/account/AccountManager.cpp index 8201d896..17f8ebaa 100644 --- a/Linphone/model/account/AccountManager.cpp +++ b/Linphone/model/account/AccountManager.cpp @@ -105,7 +105,7 @@ bool AccountManager::login(QString username, .arg(QStringLiteral("Unable to set identity address: `%1`.")) .arg(Utils::coreStringToAppString(identity->asStringUriOnly())); *errorMessage = - tr("Unable to set identity address: `%1`.").arg(Utils::coreStringToAppString(identity->asStringUriOnly())); + tr("Impossible de configurer l'adresse : `%1`.").arg(Utils::coreStringToAppString(identity->asStringUriOnly())); return false; } @@ -125,20 +125,23 @@ bool AccountManager::login(QString username, mAccountModel->setSelf(mAccountModel); connect(mAccountModel.get(), &AccountModel::registrationStateChanged, this, [this, authInfo, core](const std::shared_ptr &account, linphone::RegistrationState state, - const std::string &message) { + const std::string &message) { + QString errorMessage = QString::fromStdString(message); if (mAccountModel && account == mAccountModel->getAccount()) { if (state == linphone::RegistrationState::Failed) { connect( mAccountModel.get(), &AccountModel::removed, this, [this]() { mAccountModel = nullptr; }, Qt::SingleShotConnection); - mAccountModel->removeAccount(); + if (account->getError() == linphone::Reason::Forbidden) errorMessage = tr("Le couple identifiant mot de passe ne correspond pas"); + else errorMessage = tr("Erreur durant la connexion"); + mAccountModel->removeAccount(); } else if (state == linphone::RegistrationState::Ok) { core->setDefaultAccount(account); emit mAccountModel->removeListener(); mAccountModel = nullptr; } } - emit registrationStateChanged(state, QString::fromStdString(message)); + emit registrationStateChanged(state, errorMessage); }); auto status = core->addAccount(account); if (status == -1) {