From cdb477853b722ef6c0f9b8f69505463e3c0c6725 Mon Sep 17 00:00:00 2001 From: Gaelle Braud Date: Thu, 31 Jul 2025 14:51:01 +0200 Subject: [PATCH] show error message when remote provisioning failed on start --- Linphone/core/App.cpp | 29 +++++ Linphone/data/languages/de.ts | 88 ++++++++------ Linphone/data/languages/en.ts | 101 ++++++++------- Linphone/data/languages/fr_FR.ts | 115 ++++++++---------- Linphone/model/core/CoreModel.cpp | 2 + Linphone/model/core/CoreModel.hpp | 10 +- Linphone/view/Page/Layout/Main/MainLayout.qml | 1 + 7 files changed, 200 insertions(+), 146 deletions(-) diff --git a/Linphone/core/App.cpp b/Linphone/core/App.cpp index 325d340f9..14a7b5f19 100644 --- a/Linphone/core/App.cpp +++ b/Linphone/core/App.cpp @@ -426,6 +426,21 @@ void App::initCore() { CoreModel::create("", mLinphoneThread); if (mParser->isSet("verbose")) QtLogger::enableVerbose(true); if (mParser->isSet("qt-logs-only")) QtLogger::enableQtOnly(true); + + // Config error message + connect(CoreModel::getInstance().get(), &CoreModel::configuringStatus, this, + [this](const std::shared_ptr &core, linphone::ConfiguringState status, + const std::string &message) { + mustBeInLinphoneThread(log().arg(Q_FUNC_INFO)); + QMetaObject::invokeMethod(thread(), [this, message]() { + mustBeInMainThread(log().arg(Q_FUNC_INFO)); + //: Error + Utils::showInformationPopup( + tr("info_popup_error_title"), + tr("info_popup_configuration_failed_message").arg(Utils::coreStringToAppString(message)), + false); + }); + }); QMetaObject::invokeMethod( mLinphoneThread->getThreadId(), [this, settings = mSettings]() mutable { @@ -546,6 +561,20 @@ void App::initCore() { window->show(); } else lInfo() << log().arg("Stay minimized"); firstOpen = false; + lInfo() << log().arg("Checking remote provisioning"); + if (CoreModel::getInstance()->mConfigStatus == linphone::ConfiguringState::Failed) { + QMetaObject::invokeMethod(thread(), [this]() { + auto message = CoreModel::getInstance()->mConfigMessage; + //: not reachable + if (message.isEmpty()) message = tr("configuration_error_detail"); + mustBeInMainThread(log().arg(Q_FUNC_INFO)); + //: Error + Utils::showInformationPopup( + tr("info_popup_error_title"), + //: Remote provisioning failed : %1 + tr("info_popup_configuration_failed_message").arg(message), false); + }); + } } }, Qt::QueuedConnection); diff --git a/Linphone/data/languages/de.ts b/Linphone/data/languages/de.ts index 7e15a5713..213a76fb9 100644 --- a/Linphone/data/languages/de.ts +++ b/Linphone/data/languages/de.ts @@ -519,68 +519,88 @@ Möchten Sie die Remote-Konfiguration von dieser Adresse herunterladen und anwenden? - + + + info_popup_error_title + Error + + + + + + info_popup_configuration_failed_message + Remote provisioning failed : %1 + + + + + configuration_error_detail + not reachable + + + + application_description "A free and open source SIP video-phone." Ein kostenloses Open-Source SIP Video-Telefon. - + command_line_arg_order "Send an order to the application towards a command line" Kommandozeilen-Befehl an die Anwendung schicken - + command_line_option_show_help Zeige Hilfe - + command_line_option_show_app_version Zeige App-Version - + command_line_option_config_to_fetch "Specify the linphone configuration file to be fetched. It will be merged with the current configuration." Abzurufende Linphone-Konfigurationsdatei angeben. Sie wird mit der aktuellen Konfiguration zusammengeführt. - + command_line_option_config_to_fetch_arg "URL, path or file" URL, Pfad oder Datei - + command_line_option_minimized - + command_line_option_log_to_stdout Debug-Informationen auf der Standardausgabe ausgeben - + command_line_option_print_app_logs_only "Print only logs from the application" Nur Anwendungs-Logs ausgeben - + hide_action "Cacher" "Afficher" Ausblenden - + show_action Zeigen - + quit_action "Quitter" Beenden @@ -639,64 +659,64 @@ Die Aufnahme wurde in der folgenden Datei gespeichert: %1 - - + + call_stats_codec_label "Codec: %1 / %2 kHz" Codec: %1 / %2 kHz - - + + call_stats_bandwidth_label "Bande passante : %1 %2 kbits/s %3 %4 kbits/s" Bandbreite: %1 %2 kbits/s %3 %4 kbits/s - - + + call_stats_loss_rate_label "Taux de perte: %1% %2%" Verlustquote: %1% %2% - + call_stats_jitter_buffer_label "Tampon de gigue: %1 ms" Jitter-Puffer: %1 ms - + call_stats_resolution_label "Définition vidéo : %1 %2 %3 %4" Videoauflösung: %1 %2 %3 %4 - + call_stats_fps_label "FPS : %1 %2 %3 %4" FPS : %1 %2 %3 %4 - + media_encryption_dtls DTLS - + media_encryption_none None - + media_encryption_srtp SRTP - + media_encryption_post_quantum "ZRTP - Post quantique" Post-quantum ZRTP @@ -827,43 +847,43 @@ CallModel - + call_error_user_declined_toast "Le correspondant a décliné l'appel" Der Benutzer hat den Anruf abgelehnt - + call_error_user_not_found_toast "Le correspondant n'a pas été trouvé" Benutzer nicht gefunden - + call_error_user_busy_toast "Le correspondant est occupé" Der Benutzer ist beschäftigt - + call_error_incompatible_media_params_toast "Le correspondant ne peut accepter votre appel." Der Benutzer kann Ihren Anruf nicht annehmen - + call_error_io_error_toast "Service indisponible ou erreur réseau" Dienst nicht verfügbar oder Netzwerkfehler - + call_error_temporarily_unavailable_toast "Temporairement indisponible" Vorübergehend nicht verfügbar - + call_error_server_timeout_toast "Délai d'attente du serveur dépassé" Server-Zeitüberschreitung @@ -1641,13 +1661,13 @@ ConferenceInfoCore - + information_popup_error_title "Erreur" Fehler - + information_popup_disconnected_account_message "Votre compte est déconnecté" Ihr Konto ist getrennt diff --git a/Linphone/data/languages/en.ts b/Linphone/data/languages/en.ts index f70a49972..36e5ddaa9 100644 --- a/Linphone/data/languages/en.ts +++ b/Linphone/data/languages/en.ts @@ -519,68 +519,88 @@ Do you want to download and apply remote provisioning from this address ? - + + + info_popup_error_title + Error + Error + + + + + info_popup_configuration_failed_message + Remote provisioning failed : %1 + Remote provisioning failed : %1 + + + + configuration_error_detail + not reachable + not reachable + + + application_description "A free and open source SIP video-phone." A free and open source SIP video-phone. - + command_line_arg_order "Send an order to the application towards a command line" Send an order to the application towards a command line - + command_line_option_show_help Show this help - + command_line_option_show_app_version Show app version - + command_line_option_config_to_fetch "Specify the linphone configuration file to be fetched. It will be merged with the current configuration." Specify the linphone configuration file to be fetched. It will be merged with the current configuration. - + command_line_option_config_to_fetch_arg "URL, path or file" URL, path or file - + command_line_option_minimized Minimize - + command_line_option_log_to_stdout Log to stdout some debug information while running - + command_line_option_print_app_logs_only "Print only logs from the application" Print only logs from the application - + hide_action "Cacher" "Afficher" Hide - + show_action Show - + quit_action "Quitter" Quit @@ -639,64 +659,64 @@ Recording has been saved in file : %1 - - + + call_stats_codec_label "Codec: %1 / %2 kHz" Codec: %1 / %2 kHz - - + + call_stats_bandwidth_label "Bande passante : %1 %2 kbits/s %3 %4 kbits/s" Bandwidth : %1 %2 kbits/s %3 %4 kbits/s - - + + call_stats_loss_rate_label "Taux de perte: %1% %2%" Loss rate: %1% %2% - + call_stats_jitter_buffer_label "Tampon de gigue: %1 ms" Jitter buffer : %1 ms - + call_stats_resolution_label "Définition vidéo : %1 %2 %3 %4" Video resolution: %1 %2 %3 %4 - + call_stats_fps_label "FPS : %1 %2 %3 %4" FPS : %1 %2 %3 %4 - + media_encryption_dtls DTLS DTLS - + media_encryption_none None None - + media_encryption_srtp SRTP SRTP - + media_encryption_post_quantum "ZRTP - Post quantique" Post quantum ZRTP @@ -827,43 +847,43 @@ CallModel - + call_error_user_declined_toast "Le correspondant a décliné l'appel" User declined the call - + call_error_user_not_found_toast "Le correspondant n'a pas été trouvé" User was not found - + call_error_user_busy_toast "Le correspondant est occupé" User is busy - + call_error_incompatible_media_params_toast "Le correspondant ne peut accepter votre appel." User can't accept your call - + call_error_io_error_toast "Service indisponible ou erreur réseau" Unavailable service or network error - + call_error_temporarily_unavailable_toast "Temporairement indisponible" temporarily unavailable - + call_error_server_timeout_toast "Délai d'attente du serveur dépassé" Server tiemout @@ -1641,13 +1661,13 @@ ConferenceInfoCore - + information_popup_error_title "Erreur" Error - + information_popup_disconnected_account_message "Votre compte est déconnecté" Your account is disconnected @@ -2345,11 +2365,6 @@ Media encryption : %1 Media encryption : %1%2 - - call_stats_media_encryption_zrtp_post_quantum - ZRTP Post Quantique - Post Quantum ZRTP - call_stats_zrtp_cipher_algo @@ -2596,14 +2611,6 @@ Debug - - LinphoneEnums - - media_encryption_post_quantum - "ZRTP - Post quantique" - Post quantum ZRTP - - LoadingPopup diff --git a/Linphone/data/languages/fr_FR.ts b/Linphone/data/languages/fr_FR.ts index c8f69a98b..a9839fb51 100644 --- a/Linphone/data/languages/fr_FR.ts +++ b/Linphone/data/languages/fr_FR.ts @@ -519,68 +519,88 @@ Voulez-vous télécharger et appliquer la configuration depuis cette adresse ? - + + + info_popup_error_title + Error + Erreur + + + + + info_popup_configuration_failed_message + Remote provisioning failed : %1 + Le service de configuration distante a échoué: %1 + + + + configuration_error_detail + not reachable + indisponible + + + application_description "A free and open source SIP video-phone." A free and open source SIP video-phone. - + command_line_arg_order "Send an order to the application towards a command line" Send an order to the application towards a command line - + command_line_option_show_help Show this help - + command_line_option_show_app_version Afficher la version de l'application - + command_line_option_config_to_fetch "Specify the linphone configuration file to be fetched. It will be merged with the current configuration." Specify the linphone configuration file to be fetched. It will be merged with the current configuration. - + command_line_option_config_to_fetch_arg "URL, path or file" URL, path or file - + command_line_option_minimized Minimiser - + command_line_option_log_to_stdout Log to stdout some debug information while running - + command_line_option_print_app_logs_only "Print only logs from the application" Print only logs from the application - + hide_action "Cacher" "Afficher" Cacher - + show_action Afficher - + quit_action "Quitter" Quitter @@ -639,64 +659,64 @@ L'appel a été enregistré dans le fichier : %1 - - + + call_stats_codec_label "Codec: %1 / %2 kHz" Codec: %1 / %2 kHz - - + + call_stats_bandwidth_label "Bande passante : %1 %2 kbits/s %3 %4 kbits/s" Bande passante : %1 %2 kbits/s %3 %4 kbits/s - - + + call_stats_loss_rate_label "Taux de perte: %1% %2%" Taux de perte: %1% %2% - + call_stats_jitter_buffer_label "Tampon de gigue: %1 ms" Tampon de gigue: %1 ms - + call_stats_resolution_label "Définition vidéo : %1 %2 %3 %4" Définition vidéo : %1 %2 %3 %4 - + call_stats_fps_label "FPS : %1 %2 %3 %4" FPS : %1 %2 %3 %4 - + media_encryption_dtls DTLS DTLS - + media_encryption_none None None - + media_encryption_srtp SRTP SRTP - + media_encryption_post_quantum "ZRTP - Post quantique" ZRTP - Post quantique @@ -827,43 +847,43 @@ CallModel - + call_error_user_declined_toast "Le correspondant a décliné l'appel" Le correspondant a décliné l'appel - + call_error_user_not_found_toast "Le correspondant n'a pas été trouvé" Le correspondant n'a pas été trouvé - + call_error_user_busy_toast "Le correspondant est occupé" Le correspondant est occupé - + call_error_incompatible_media_params_toast "Le correspondant ne peut accepter votre appel." Le correspondant ne peut accepter votre appel - + call_error_io_error_toast "Service indisponible ou erreur réseau" Service indisponible ou erreur réseau - + call_error_temporarily_unavailable_toast "Temporairement indisponible" Temporairement indisponible - + call_error_server_timeout_toast "Délai d'attente du serveur dépassé" Délai d'attente du serveur dépassé @@ -1641,13 +1661,13 @@ ConferenceInfoCore - + information_popup_error_title "Erreur" Erreur - + information_popup_disconnected_account_message "Votre compte est déconnecté" Votre compte est déconnecté @@ -2591,29 +2611,6 @@ Débogage - - LinphoneEnums - - media_encryption_dtls - DTLS - DTLS - - - media_encryption_none - None - None - - - media_encryption_srtp - SRTP - SRTP - - - media_encryption_post_quantum - "ZRTP - Post quantique" - ZRTP - Post quantique - - LoadingPopup @@ -4646,10 +4643,6 @@ Pour les activer dans un projet commercial, merci de nous contacter.Honduras Honduras - - Hong Kong - HongKong - DemocraticRepublicOfCongo diff --git a/Linphone/model/core/CoreModel.cpp b/Linphone/model/core/CoreModel.cpp index e4b44375c..fce591bfb 100644 --- a/Linphone/model/core/CoreModel.cpp +++ b/Linphone/model/core/CoreModel.cpp @@ -451,6 +451,8 @@ void CoreModel::onConferenceStateChanged(const std::shared_ptr & void CoreModel::onConfiguringStatus(const std::shared_ptr &core, linphone::ConfiguringState status, const std::string &message) { + mConfigStatus = status; + mConfigMessage = Utils::coreStringToAppString(message); emit configuringStatus(core, status, message); } void CoreModel::onDefaultAccountChanged(const std::shared_ptr &core, diff --git a/Linphone/model/core/CoreModel.hpp b/Linphone/model/core/CoreModel.hpp index 3c4e16be9..a1783b699 100644 --- a/Linphone/model/core/CoreModel.hpp +++ b/Linphone/model/core/CoreModel.hpp @@ -34,8 +34,8 @@ #include "model/cli/CliModel.hpp" #include "model/listener/Listener.hpp" #include "model/logger/LoggerModel.hpp" -#include "tool/AbstractObject.hpp" #include "model/search/MagicSearchModel.hpp" +#include "tool/AbstractObject.hpp" // ============================================================================= @@ -61,11 +61,13 @@ public: void migrate(); void searchInMagicSearch(QString filter, - int sourceFlags, - LinphoneEnums::MagicSearchAggregation aggregation, - int maxResults); + int sourceFlags, + LinphoneEnums::MagicSearchAggregation aggregation, + int maxResults); bool mEnd = false; + linphone::ConfiguringState mConfigStatus; + QString mConfigMessage; std::shared_ptr mCore; std::shared_ptr mLogger; diff --git a/Linphone/view/Page/Layout/Main/MainLayout.qml b/Linphone/view/Page/Layout/Main/MainLayout.qml index e423f2157..365720168 100644 --- a/Linphone/view/Page/Layout/Main/MainLayout.qml +++ b/Linphone/view/Page/Layout/Main/MainLayout.qml @@ -184,6 +184,7 @@ Item { } initButtons() currentIndex = SettingsCpp.getLastActiveTabIndex() + if (currentIndex === -1) currentIndex = 0 } } ColumnLayout {