From 785e15d9fdd9fcfd68fc560c4a1a051d6616ec1a 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 | 142 ++++++++++-------- Linphone/data/languages/en.ts | 142 ++++++++++-------- Linphone/data/languages/fr_FR.ts | 142 ++++++++++-------- Linphone/model/core/CoreModel.cpp | 8 +- Linphone/model/core/CoreModel.hpp | 2 + Linphone/view/Page/Layout/Main/MainLayout.qml | 1 + 7 files changed, 280 insertions(+), 186 deletions(-) diff --git a/Linphone/core/App.cpp b/Linphone/core/App.cpp index 5df64ee6a..e3ba37677 100644 --- a/Linphone/core/App.cpp +++ b/Linphone/core/App.cpp @@ -442,6 +442,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 { @@ -564,6 +579,20 @@ void App::initCore() { if (window) 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 c96bc42ba..88fce5a2d 100644 --- a/Linphone/data/languages/de.ts +++ b/Linphone/data/languages/de.ts @@ -529,68 +529,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 @@ -649,64 +669,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 @@ -907,43 +927,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 @@ -1728,13 +1748,13 @@ ChatCore - + info_toast_deleted_title Deleted - + info_toast_deleted_message_history Message history has been deleted @@ -1825,25 +1845,25 @@ ChatMessage - + chat_message_copy_selection "Copy selection" - + chat_message_copy "Copy" - + chat_message_copied_to_clipboard_title Copied - + chat_message_copied_to_clipboard_toast "to clipboard" @@ -1879,25 +1899,25 @@ - + chat_message_reception_info "Reception info" - + chat_message_reply Reply - + chat_message_forward Forward - + chat_message_delete "Delete" @@ -2077,20 +2097,20 @@ Error - + chat_message_list_encrypted_header_title End to end encrypted chat - + chat_message_list_encrypted_header_message Les messages de cette conversation sont chiffrés de bout en bout. Seul votre correspondant peut les déchiffrer. - + chat_message_is_writing_info %1 is writing… @@ -2246,13 +2266,13 @@ Error ConferenceInfoCore - + information_popup_error_title "Erreur" Fehler - + information_popup_disconnected_account_message "Votre compte est déconnecté" Ihr Konto ist getrennt @@ -3714,78 +3734,78 @@ Error Besprechungen - + searchbar_placeholder_text "Rechercher un contact, appeler %1" Kontakt suchen, %1 anrufen - + searchbar_placeholder_text_chat_feature_enabled "ou envoyer un message …" oder eine Nachricht senden … - - + + contact_presence_status_disable_do_not_disturb "Désactiver ne pas déranger" Nicht stören deaktivieren - + information_popup_error_title Fehler - + no_voicemail_uri_error_message "L'URI de messagerie vocale n'est pas définie." Die Voicemail-URI ist nicht definiert. - + drawer_menu_manage_account Mon compte Mein Konto - + contact_presence_status_enable_do_not_disturb "Activer ne pas déranger" Nicht stören aktivieren - + settings_title Einstellungen - + recordings_title "Enregistrements" Aufnahmen - + help_title "Aide" Hilfe - + help_quit_title "Quitter l'application" App beenden - + quit_app_question "Quitter %1 ?" %1 beenden? - + drawer_menu_add_account "Ajouter un compte" Konto hinzufügen diff --git a/Linphone/data/languages/en.ts b/Linphone/data/languages/en.ts index 9c5149241..19e973de8 100644 --- a/Linphone/data/languages/en.ts +++ b/Linphone/data/languages/en.ts @@ -529,68 +529,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 @@ -649,64 +669,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 @@ -887,43 +907,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 @@ -1690,13 +1710,13 @@ ChatCore - + info_toast_deleted_title Deleted Deleted - + info_toast_deleted_message_history Message history has been deleted Message history has been deleted @@ -1787,25 +1807,25 @@ ChatMessage - + chat_message_copy_selection "Copy selection" Copy selection - + chat_message_copy "Copy" Copy - + chat_message_copied_to_clipboard_title Copied Copied - + chat_message_copied_to_clipboard_toast "to clipboard" in clipboard @@ -1841,25 +1861,25 @@ You replied - + chat_message_reception_info "Reception info" Reception info - + chat_message_reply Reply Reply - + chat_message_forward Forward Forward - + chat_message_delete "Delete" Delete @@ -2039,13 +2059,13 @@ Error Last result reached - + chat_message_list_encrypted_header_title End to end encrypted chat End to end encrypted chat - + chat_message_list_encrypted_header_message Les messages de cette conversation sont chiffrés de bout en bout. Seul votre correspondant peut les déchiffrer. @@ -2053,7 +2073,7 @@ Error Only your correspondent can decrypt them. - + chat_message_is_writing_info %1 is writing… %1 is writing… @@ -2209,13 +2229,13 @@ Only your correspondent can decrypt them. ConferenceInfoCore - + information_popup_error_title "Erreur" Error - + information_popup_disconnected_account_message "Votre compte est déconnecté" Your account is disconnected @@ -3634,78 +3654,78 @@ Expiration : %1 Meetings - + searchbar_placeholder_text "Rechercher un contact, appeler %1" Find contact, call %1 - + searchbar_placeholder_text_chat_feature_enabled "ou envoyer un message …" or send message … - - + + contact_presence_status_disable_do_not_disturb "Désactiver ne pas déranger" Disable do not disturb - + information_popup_error_title Error - + no_voicemail_uri_error_message "L'URI de messagerie vocale n'est pas définie." The voicemail URI is not defined. - + drawer_menu_manage_account Mon compte My account - + contact_presence_status_enable_do_not_disturb "Activer ne pas déranger" Enable do not disturb - + settings_title Settings - + recordings_title "Enregistrements" Records - + help_title "Aide" Help - + help_quit_title "Quitter l'application" Quit the app - + quit_app_question "Quitter %1 ?" Quit %1 ? - + drawer_menu_add_account "Ajouter un compte" Add an account diff --git a/Linphone/data/languages/fr_FR.ts b/Linphone/data/languages/fr_FR.ts index e40fa86ad..fba62c0a5 100644 --- a/Linphone/data/languages/fr_FR.ts +++ b/Linphone/data/languages/fr_FR.ts @@ -529,68 +529,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 + La 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 @@ -649,64 +669,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 @@ -887,43 +907,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é @@ -1690,13 +1710,13 @@ ChatCore - + info_toast_deleted_title Deleted Supprimé - + info_toast_deleted_message_history Message history has been deleted L'historique des messages a été supprimé @@ -1787,25 +1807,25 @@ ChatMessage - + chat_message_copy_selection "Copy selection" Copier la sélection - + chat_message_copy "Copy" Copier - + chat_message_copied_to_clipboard_title Copied Copié - + chat_message_copied_to_clipboard_toast "to clipboard" dans le presse-papiers @@ -1841,25 +1861,25 @@ Vous avez répondu - + chat_message_reception_info "Reception info" Info de réception - + chat_message_reply Reply Répondre - + chat_message_forward Forward Transférer - + chat_message_delete "Delete" Supprimer @@ -2039,13 +2059,13 @@ Error Dernier résultat atteint - + chat_message_list_encrypted_header_title End to end encrypted chat Conversation chiffrée de bout en bout - + chat_message_list_encrypted_header_message Les messages de cette conversation sont chiffrés de bout en bout. Seul votre correspondant peut les déchiffrer. @@ -2053,7 +2073,7 @@ Error en bout. Seul votre correspondant peut les déchiffrer. - + chat_message_is_writing_info %1 is writing… %1 est en train d'écrire… @@ -2209,13 +2229,13 @@ en bout. Seul votre correspondant peut les déchiffrer. ConferenceInfoCore - + information_popup_error_title "Erreur" Erreur - + information_popup_disconnected_account_message "Votre compte est déconnecté" Votre compte est déconnecté @@ -3634,78 +3654,78 @@ Expiration : %1 Réunions - + searchbar_placeholder_text "Rechercher un contact, appeler %1" Rechercher un contact, appeler %1 - + searchbar_placeholder_text_chat_feature_enabled "ou envoyer un message …" ou envoyer un message … - - + + contact_presence_status_disable_do_not_disturb "Désactiver ne pas déranger" Désactiver ne pas déranger - + information_popup_error_title Erreur - + no_voicemail_uri_error_message "L'URI de messagerie vocale n'est pas définie." L'URI de messagerie vocale n'est pas définie. - + drawer_menu_manage_account Mon compte Mon compte - + contact_presence_status_enable_do_not_disturb "Activer ne pas déranger" Activer ne pas déranger - + settings_title Paramètres - + recordings_title "Enregistrements" Enregistrements - + help_title "Aide" Aide - + help_quit_title "Quitter l'application" Quitter l'application - + quit_app_question "Quitter %1 ?" Quitter %1 ? - + drawer_menu_add_account "Ajouter un compte" Ajouter un compte diff --git a/Linphone/model/core/CoreModel.cpp b/Linphone/model/core/CoreModel.cpp index c40856d5e..659db7273 100644 --- a/Linphone/model/core/CoreModel.cpp +++ b/Linphone/model/core/CoreModel.cpp @@ -409,7 +409,7 @@ void CoreModel::onCallStateChanged(const std::shared_ptr &core, linphone::Call::State state, const std::string &message) { if (state == linphone::Call::State::IncomingReceived) { - if (App::getInstance()->getNotifier()) App::getInstance()->getNotifier()->notifyReceivedCall(call); + if (App::getInstance()->getNotifier()) App::getInstance()->getNotifier()->notifyReceivedCall(call); if (!core->getConfig()->getBool(SettingsModel::UiSection, "disable_command_line", false) && !core->getConfig()->getString(SettingsModel::UiSection, "command_line", "").empty()) { QString command = Utils::coreStringToAppString( @@ -464,6 +464,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, @@ -513,14 +515,14 @@ void CoreModel::onMessageReceived(const std::shared_ptr &core, emit unreadNotificationsChanged(); std::list> messages; messages.push_back(message); - if (App::getInstance()->getNotifier()) App::getInstance()->getNotifier()->notifyReceivedMessages(room, messages); + if (App::getInstance()->getNotifier()) App::getInstance()->getNotifier()->notifyReceivedMessages(room, messages); emit messageReceived(core, room, message); } void CoreModel::onMessagesReceived(const std::shared_ptr &core, const std::shared_ptr &room, const std::list> &messages) { emit unreadNotificationsChanged(); - if (App::getInstance()->getNotifier()) App::getInstance()->getNotifier()->notifyReceivedMessages(room, messages); + if (App::getInstance()->getNotifier()) App::getInstance()->getNotifier()->notifyReceivedMessages(room, messages); emit messagesReceived(core, room, messages); } diff --git a/Linphone/model/core/CoreModel.hpp b/Linphone/model/core/CoreModel.hpp index 5a3052e71..5ee59afa7 100644 --- a/Linphone/model/core/CoreModel.hpp +++ b/Linphone/model/core/CoreModel.hpp @@ -66,6 +66,8 @@ public: 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 c262a10d7..073043817 100644 --- a/Linphone/view/Page/Layout/Main/MainLayout.qml +++ b/Linphone/view/Page/Layout/Main/MainLayout.qml @@ -192,6 +192,7 @@ Item { } initButtons() currentIndex = SettingsCpp.getLastActiveTabIndex() + if (currentIndex === -1) currentIndex = 0 } } ColumnLayout {