From be6bf6f2a9ead77a8e2b1ee9e84c9786c5e0c4e7 Mon Sep 17 00:00:00 2001 From: Gaelle Braud Date: Thu, 11 Dec 2025 15:13:11 +0100 Subject: [PATCH] fix account parameters saving + add outbound proxy uri check add outbound proxy uri check before connecting third party account --- Linphone/core/account/AccountCore.cpp | 24 ++-- Linphone/data/languages/de.ts | 107 ++++++++------- Linphone/data/languages/en.ts | 123 ++++++++--------- Linphone/data/languages/fr.ts | 125 ++++++++---------- Linphone/model/account/AccountManager.cpp | 8 +- Linphone/model/account/AccountModel.cpp | 6 +- .../Control/Button/Settings/SwitchSetting.qml | 12 +- .../AccountSettingsParametersLayout.qml | 80 +++++++++-- .../Settings/AdvancedSettingsLayout.qml | 12 +- 9 files changed, 279 insertions(+), 218 deletions(-) diff --git a/Linphone/core/account/AccountCore.cpp b/Linphone/core/account/AccountCore.cpp index 04333796b..c5f6ab8c3 100644 --- a/Linphone/core/account/AccountCore.cpp +++ b/Linphone/core/account/AccountCore.cpp @@ -314,19 +314,19 @@ void AccountCore::reset(const AccountCore &accountCore) { setUnreadNotifications(accountCore.mUnreadNotifications); setUnreadCallNotifications(accountCore.mUnreadCallNotifications); setUnreadMessageNotifications(accountCore.mUnreadMessageNotifications); - setMwiServerAddress(accountCore.mMwiServerAddress); - setVoicemailAddress(accountCore.mVoicemailAddress); - setTransport(accountCore.mTransport); - setRegistrarUri(accountCore.mRegistrarUri); - setOutboundProxyUri(accountCore.mOutboundProxyUri); + onMwiServerAddressChanged(accountCore.mMwiServerAddress); + onVoicemailAddressChanged(accountCore.mVoicemailAddress); + onTransportChanged(accountCore.mTransport); + onRegistrarUriChanged(accountCore.mRegistrarUri); + onOutboundProxyUriChanged(accountCore.mOutboundProxyUri); setStunServer(accountCore.mStunServer); - setIceEnabled(accountCore.mIceEnabled); - setAvpfEnabled(accountCore.mAvpfEnabled); - setBundleModeEnabled(accountCore.mBundleModeEnabled); - setExpire(accountCore.mExpire); - setConferenceFactoryAddress(accountCore.mConferenceFactoryAddress); - setAudioVideoConferenceFactoryAddress(accountCore.mAudioVideoConferenceFactoryAddress); - setLimeServerUrl(accountCore.mLimeServerUrl); + onIceEnabledChanged(accountCore.mIceEnabled); + onAvpfEnabledChanged(accountCore.mAvpfEnabled); + onBundleModeEnabledChanged(accountCore.mBundleModeEnabled); + onExpireChanged(accountCore.mExpire); + onConferenceFactoryAddressChanged(accountCore.mConferenceFactoryAddress); + onAudioVideoConferenceFactoryAddressChanged(accountCore.mAudioVideoConferenceFactoryAddress); + onLimeServerUrlChanged(accountCore.mLimeServerUrl); } const std::shared_ptr &AccountCore::getModel() const { diff --git a/Linphone/data/languages/de.ts b/Linphone/data/languages/de.ts index 2dd126b41..dd5e9b217 100644 --- a/Linphone/data/languages/de.ts +++ b/Linphone/data/languages/de.ts @@ -110,37 +110,43 @@ Das Konto ist bereits verbunden - + + assistant_account_login_outbound_proxy_uri_error + Outbound proxy uri is invalid. Please make sure it matches the following format : sip:host>:<port>;transport=<transport> (:<port> is optional) + + + + assistant_account_login_proxy_address_error "Unable to create proxy address. Please check the domain name." Proxy-Adresse konnte nicht erstellt werden. Bitte überprüfen Sie den Domänenname. - + assistant_account_login_address_configuration_error "Unable to configure address: `%1`." Folgende Adresse konnte nicht konfiguriert werden: `%1`. - + assistant_account_login_params_configuration_error "Unable to configure account settings." Kontoeinstellungen konnten nicht konfiguriert werden. - + assistant_account_login_forbidden_error "Username and password do not match" Benutzername und Passwort stimmen nicht überein - + assistant_account_login_error "Error during connection, please verify your parameters" Fehler bei der Verbindung - + assistant_account_add_error "Unable to add account." Konto konnte nicht hinzugefügt werden. @@ -161,25 +167,25 @@ Serveradresse kann nicht festgelegt werden. Ungültige Adresse aus %1 - + set_outbound_proxy_uri_failed_error_message - Unable to set outbound proxy uri, failed creating address from %1 + Unable to set outbound proxy uri from address %1. Please make sure it matches the following format : sip:host>:<port>;transport=<transport> (:<port> is optional) Ausgehende Proxy-Adresse kann nicht festgelegt werden. Ungültige Adresse aus %1 - + set_conference_factory_address_failed_error_message "Unable to set the conversation server address, failed creating address from %1" Chat-Serveradresse kann nicht festgelegt werden. Ungültige Adresse aus %1 - + set_audio_conference_factory_address_failed_error_message "Unable to set the meeting server address, failed creating address from %1" Meeting-Serveradresse kann nicht festgelegt werden. Ungültige Adresse aus %1 - + set_voicemail_address_failed_error_message Unable to set voicemail address, failed creating address from %1 Anrufbeantworter-Adresse kann nicht festgelegt werden. Ungültige Adresse aus %1 @@ -420,27 +426,26 @@ account_settings_voicemail_uri_title - "URI de messagerie vocale" + "Voicemail address" Voicemail-URI - account_settings_transport_title "Transport" - Transport + Transport - + account_settings_registrar_uri_title Registrar URI - + account_settings_sip_proxy_url_title Ausgehende Proxy-Server-URL - + login_proxy_server_url_tooltip "If this field is filled, the outbound proxy will be enabled automatically. Leave it empty to disable it." Wenn dieses Feld ausgefüllt ist, wird der ausgehende Proxy automatisch aktiviert. Lassen Sie es leer, um ihn zu deaktivieren. @@ -451,49 +456,49 @@ Ausgehender Proxy-Server - + account_settings_stun_server_url_title "Adresse du serveur STUN" STUN-Server-Adresse - + account_settings_enable_ice_title "Activer ICE" ICE aktivieren - + account_settings_avpf_title "AVPF" AVPF - + account_settings_bundle_mode_title "Mode bundle" Bundle-Modus - + account_settings_expire_title "Expiration (en seconde)" Ablaufzeit (in Sekunden) - + account_settings_conference_factory_uri_title "URI du serveur de conversations" Konferenz-Factory-URI - + account_settings_audio_video_conference_factory_uri_title "URI du serveur de réunions" Video-Konferenz-Factory-URI - + account_settings_lime_server_url_title "URL du serveur d’échange de clés de chiffrement" Lime-Server-URL @@ -622,7 +627,7 @@ Erstelle Ende-zu-Ende verschlüsselte Konferenzen und Gruppenrufe - + settings_advanced_hide_fps_title FPS ausblenden @@ -712,80 +717,80 @@ nicht erreichbar - + 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 App-Version anzeigen - + 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 Minimieren - + 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 - + check_for_update Check for update Auf Updates prüfen - + mark_all_read_action Alle als gelesen markieren @@ -2109,65 +2114,65 @@ ChatListView - + chat_message_is_writing_info %1 is writing… %1 schreibt… - + chat_message_draft_sending_text Entwurf: %1 - + chat_room_delete "Delete" Löschen - + chat_room_mute Stummschalten - + chat_room_unmute "Mute" Stummschaltung aufheben - + chat_room_mark_as_read "Mark as read" Als gelesen markieren - + chat_room_leave "leave" Verlassen - + chat_list_leave_chat_popup_title leave the conversation ? Chat verlassen? - + chat_list_leave_chat_popup_message You will not be able to send or receive messages in this conversation anymore. Do You want to continue ? „Sie können in diesem Chat keine Nachrichten mehr senden oder empfangen. Möchten Sie fortfahren? - + chat_list_delete_chat_popup_title Delete the conversation ? Chat löschen? - + chat_list_delete_chat_popup_message This conversation and all its messages will be deleted. Do You want to continue ? Dieser Chat und alle seine Nachrichten werden gelöscht. Möchten Sie fortfahren? diff --git a/Linphone/data/languages/en.ts b/Linphone/data/languages/en.ts index 69ee97bbc..122867c4b 100644 --- a/Linphone/data/languages/en.ts +++ b/Linphone/data/languages/en.ts @@ -110,37 +110,43 @@ The account is already connected - + + assistant_account_login_outbound_proxy_uri_error + Outbound proxy uri is invalid. Please make sure it matches the following format : sip:host>:<port>;transport=<transport> (:<port> is optional) + Outbound proxy uri is invalid. Please make sure it matches the following format : sip:host>:<port>;transport=<transport> (:<port> is optional) + + + assistant_account_login_proxy_address_error "Unable to create proxy address. Please check the domain name." Unable to create proxy address. Please check the domain name. - + assistant_account_login_address_configuration_error "Unable to configure address: `%1`." Unable to configure address: `%1`. - + assistant_account_login_params_configuration_error "Unable to configure account settings." Unable to configure account settings. - + assistant_account_login_forbidden_error "Username and password do not match" Username and password do not match - + assistant_account_login_error "Error during connection, please verify your parameters" Error during connection - + assistant_account_add_error "Unable to add account." Unable to add account. @@ -161,25 +167,25 @@ Unable to set server address, failed creating address from %1 - + set_outbound_proxy_uri_failed_error_message - Unable to set outbound proxy uri, failed creating address from %1 - Unable to set outbound proxy uri, failed creating address from %1 + Unable to set outbound proxy uri from address %1. Please make sure it matches the following format : sip:host>:<port>;transport=<transport> (:<port> is optional) + Unable to set outbound proxy uri from address %1. Please make sure it matches the following format : sip:host>:<port>;transport=<transport> (:<port> is optional) - + set_conference_factory_address_failed_error_message "Unable to set the conversation server address, failed creating address from %1" Unable to set the conversation server address, failed creating address from %1 - + set_audio_conference_factory_address_failed_error_message "Unable to set the meeting server address, failed creating address from %1" Unable to set the meeting server address, failed creating address from %1 - + set_voicemail_address_failed_error_message Unable to set voicemail address, failed creating address from %1 Unable to set voicemail address, failed creating address from %1 @@ -381,20 +387,6 @@ settings_account_title Account settings - - info_popup_invalid_registrar_uri_message - Registrar uri is invalid. Please make sure it matches the following format : sip:<host>:<port>;transport=<transport> (:<port> is optional) - Registrar uri is invalid. Please make sure it matches the following format : sip:<host>:<port>;transport=<transport> (:<port> is optional) - - - info_popup_invalid_outbound_proxy_message - Outbound proxy uri is invalid. Please make sure it matches the following format : sip:<host>:<port>;transport=<transport> (:<port> is optional) - Outbound proxy uri is invalid. Please make sure it matches the following format : sip:<host>:<port>;transport=<transport> (:<port> is optional) - - - info_popup_error_title - Error - information_popup_success_title @@ -420,75 +412,74 @@ account_settings_voicemail_uri_title - "URI de messagerie vocale" + "Voicemail address" Voicemail URI - account_settings_transport_title "Transport" - Transport + Transport - + account_settings_registrar_uri_title Registrar URI - + account_settings_sip_proxy_url_title Outbound SIP Proxy URI - + login_proxy_server_url_tooltip "If this field is filled, the outbound proxy will be enabled automatically. Leave it empty to disable it." If this field is filled, the outbound proxy will be enabled automatically. Leave it empty to disable it. - + account_settings_stun_server_url_title "Adresse du serveur STUN" STUN server address - + account_settings_enable_ice_title "Activer ICE" Enable ICE - + account_settings_avpf_title "AVPF" AVPF - + account_settings_bundle_mode_title "Mode bundle" Bundle mode - + account_settings_expire_title "Expiration (en seconde)" Expiration (in seconds) - + account_settings_conference_factory_uri_title "URI du serveur de conversations" Conference factory URI - + account_settings_audio_video_conference_factory_uri_title "URI du serveur de réunions" Video conference factory uri - + account_settings_lime_server_url_title "URL du serveur d’échange de clés de chiffrement" Lime server URL @@ -617,7 +608,7 @@ Create end to end encrypted meetings and group calls - + settings_advanced_hide_fps_title Hide FPS @@ -707,80 +698,80 @@ 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 - + check_for_update Check for update Check for update - + mark_all_read_action Marquer tout comme lu @@ -2086,65 +2077,65 @@ ChatListView - + chat_message_is_writing_info %1 is writing… %1 is writing… - + chat_message_draft_sending_text Draft : %1 - + chat_room_delete "Delete" Delete - + chat_room_mute Mute - + chat_room_unmute "Mute" Unmute - + chat_room_mark_as_read "Mark as read" Mark as read - + chat_room_leave "leave" Leave - + chat_list_leave_chat_popup_title leave the conversation ? Leave the conversation ? - + chat_list_leave_chat_popup_message You will not be able to send or receive messages in this conversation anymore. Do You want to continue ? You will not be able to send or receive messages in this conversation anymore. Do You want to continue ? - + chat_list_delete_chat_popup_title Delete the conversation ? Delete the conversation ? - + chat_list_delete_chat_popup_message This conversation and all its messages will be deleted. Do You want to continue ? This conversation and all its messages will be deleted. Do You want to continue ? diff --git a/Linphone/data/languages/fr.ts b/Linphone/data/languages/fr.ts index 94e481206..6ac7cc196 100644 --- a/Linphone/data/languages/fr.ts +++ b/Linphone/data/languages/fr.ts @@ -110,37 +110,43 @@ Le compte est déjà connecté - + + assistant_account_login_outbound_proxy_uri_error + Outbound proxy uri is invalid. Please make sure it matches the following format : sip:host>:<port>;transport=<transport> (:<port> is optional) + L'uri du proxy SIP sortant est invalide. Assurez-vous qu'elle corresponde format suivant : sip:host>:<port>;transport=<transport> (:<port> est optionnel) + + + assistant_account_login_proxy_address_error "Unable to create proxy address. Please check the domain name." Impossible de créer l'adresse proxy. Merci de vérifier le nom de domaine. - + assistant_account_login_address_configuration_error "Unable to configure address: `%1`." Impossible de configurer l'adresse : `%1`. - + assistant_account_login_params_configuration_error "Unable to configure account settings." Impossible de configurer les paramètres du compte. - + assistant_account_login_forbidden_error "Username and password do not match" Le couple identifiant mot de passe ne correspond pas - + assistant_account_login_error "Error during connection, please verify your parameters" Erreur durant la connexion, veuillez vérifier vos paramètres - + assistant_account_add_error "Unable to add account." Impossible d'ajouter le compte. @@ -161,25 +167,25 @@ Impossible de définir l'adresse du serveur depuis l'adresse %1 - + set_outbound_proxy_uri_failed_error_message - Unable to set outbound proxy uri, failed creating address from %1 - Impossible de définir l'adresse du proxy sip sortant depuis l'adresse %1 + Unable to set outbound proxy uri from address %1. Please make sure it matches the following format : sip:host>:<port>;transport=<transport> (:<port> is optional) + Impossible de définir l'adresse du proxy sip sortant depuis l'adresse %1. Assurez-vous qu'elle corresponde au format suivant : sip:host>:<port>;transport=<transport> (:<port> est optionnel) - + set_conference_factory_address_failed_error_message "Unable to set the conversation server address, failed creating address from %1" Impossible de définir l'uri du serveur de conversations depuis l'adresse %1 - + set_audio_conference_factory_address_failed_error_message "Unable to set the meeting server address, failed creating address from %1" Impossible de définir l'uri du serveur de réunions depuis l'adresse %1 - + set_voicemail_address_failed_error_message Unable to set voicemail address, failed creating address from %1 Impossible de définir l'adresse de messagerie vocale depuis l'adresse %1 @@ -381,20 +387,6 @@ settings_account_title Paramètres de compte - - info_popup_invalid_registrar_uri_message - Registrar uri is invalid. Please make sure it matches the following format : sip:<host>:<port>;transport=<transport> (:<port> is optional) - La registrar URI est invalide. Veuillez vous assurer qu'elle respecte le format suivant : sip:<host>:<port>;transport=<transport> (:<port> est facultatif) - - - info_popup_invalid_outbound_proxy_message - Outbound proxy uri is invalid. Please make sure it matches the following format : sip:<host>:<port>;transport=<transport> (:<port> is optional) - L'uri du proxy sip sortant est invalide. Veuillez vous assurer qu'elle respecte le format suivant : sip:<host>:<port>;transport=<transport> (:<port> est facultatif) - - - info_popup_error_title - Erreur - information_popup_success_title @@ -420,75 +412,74 @@ account_settings_voicemail_uri_title - "URI de messagerie vocale" - URI de messagerie vocale + "Voicemail address" + URI de la boîte vocale - account_settings_transport_title "Transport" - Transport + Transport - + account_settings_registrar_uri_title Registrar URI - + account_settings_sip_proxy_url_title URL du proxy SIP sortant - + login_proxy_server_url_tooltip "If this field is filled, the outbound proxy will be enabled automatically. Leave it empty to disable it." Si ce champ est rempli, l’outbound proxy sera activé automatiquement. Laissez-le vide pour le désactiver. - + account_settings_stun_server_url_title "Adresse du serveur STUN" Adresse du serveur STUN - + account_settings_enable_ice_title "Activer ICE" Activer ICE - + account_settings_avpf_title "AVPF" AVPF - + account_settings_bundle_mode_title "Mode bundle" Mode bundle - + account_settings_expire_title "Expiration (en seconde)" Expiration (en seconde) - + account_settings_conference_factory_uri_title "URI du serveur de conversations" URI du serveur de conversations - + account_settings_audio_video_conference_factory_uri_title "URI du serveur de réunions" URI du serveur de réunions - + account_settings_lime_server_url_title "URL du serveur d’échange de clés de chiffrement" URL du serveur d’échange de clés de chiffrement @@ -617,7 +608,7 @@ Créer des appels de groupe et conférences chiffré(e)s de bout en bout - + settings_advanced_hide_fps_title Cacher les FPS @@ -707,80 +698,80 @@ 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 - + check_for_update Check for update Rechercher une mise à jour - + mark_all_read_action Marquer tout comme lu @@ -2086,65 +2077,65 @@ ChatListView - + chat_message_is_writing_info %1 is writing… %1 est en train d'écrire… - + chat_message_draft_sending_text Brouillon : %1 - + chat_room_delete "Delete" Supprimer - + chat_room_mute Mettre en sourdine - + chat_room_unmute "Mute" Enlever la sourdine - + chat_room_mark_as_read "Mark as read" Marquer comme lu - + chat_room_leave "leave" Quitter la conversation - + chat_list_leave_chat_popup_title leave the conversation ? Quitter la conversation ? - + chat_list_leave_chat_popup_message You will not be able to send or receive messages in this conversation anymore. Do You want to continue ? Vous ne pourrez plus envoyer ou recevoir de messages dans cette conversation. Souhaitez-vous continuer ? - + chat_list_delete_chat_popup_title Delete the conversation ? Supprimer la conversation ? - + chat_list_delete_chat_popup_message This conversation and all its messages will be deleted. Do You want to continue ? La conversation et tous ses messages seront supprimés. Souhaitez-vous continuer ? diff --git a/Linphone/model/account/AccountManager.cpp b/Linphone/model/account/AccountManager.cpp index 068d87fa1..6f414ecf6 100644 --- a/Linphone/model/account/AccountManager.cpp +++ b/Linphone/model/account/AccountManager.cpp @@ -101,8 +101,14 @@ bool AccountManager::login(QString username, params->setServerAddress(linRegistrarUri); } if (!outboundProxyAddress.isEmpty()) { - auto linOutboundProxyAddress = ToolModel::interpretUrl(outboundProxyAddress); + auto linOutboundProxyAddress = factory->createAddress(Utils::appStringToCoreString(outboundProxyAddress)); if (linOutboundProxyAddress) params->setRoutesAddresses({linOutboundProxyAddress}); + else { + //: Outbound proxy uri is invalid. Please make sure it matches the following format : + //: sip:host>:;transport= (: is optional) + *errorMessage = tr("assistant_account_login_outbound_proxy_uri_error"); + return false; + } } if (!domain.isEmpty()) { identity->setDomain(Utils::appStringToCoreString(domain)); diff --git a/Linphone/model/account/AccountModel.cpp b/Linphone/model/account/AccountModel.cpp index 97715ed58..62d35f0c3 100644 --- a/Linphone/model/account/AccountModel.cpp +++ b/Linphone/model/account/AccountModel.cpp @@ -302,9 +302,11 @@ QString AccountModel::getOutboundProxyUri() const { } void AccountModel::setOutboundProxyUri(QString value) { - auto linOutboundProxyAddress = ToolModel::interpretUrl(value); + auto linOutboundProxyAddress = linphone::Factory::get()->createAddress(Utils::appStringToCoreString(value)); if (!linOutboundProxyAddress) { - //: Unable to set outbound proxy uri, failed creating address from %1 + //: Unable to set outbound proxy uri from address %1. + //: Please make sure it matches the following format : + //: sip:host>:;transport= (: is optional) emit setValueFailed(tr("set_outbound_proxy_uri_failed_error_message").arg(value)); return; } else { diff --git a/Linphone/view/Control/Button/Settings/SwitchSetting.qml b/Linphone/view/Control/Button/Settings/SwitchSetting.qml index af4ca4aa3..bf74d6080 100644 --- a/Linphone/view/Control/Button/Settings/SwitchSetting.qml +++ b/Linphone/view/Control/Button/Settings/SwitchSetting.qml @@ -12,12 +12,10 @@ RowLayout { property var propertyOwner property var propertyOwnerGui property bool enabled: true + property alias checked: switchButton.checked spacing : Utils.getSizeWithScreenRatio(20) - signal checkedChanged(bool checked) - function setChecked(value) { - switchButton.checked = value - } + signal toggled() ColumnLayout { Layout.minimumHeight: Utils.getSizeWithScreenRatio(32) @@ -44,8 +42,10 @@ RowLayout { checked: propertyOwnerGui ? propertyOwnerGui.core[mainItem.propertyName] : propertyOwner ? propertyOwner[mainItem.propertyName] : false enabled: mainItem.enabled - onCheckedChanged: mainItem.checkedChanged(checked) - onToggled: binding.when = true + onToggled: { + binding.when = true + mainItem.toggled() + } implicitHeight: Utils.getSizeWithScreenRatio(30) Accessible.name: "%1 %2".arg(mainItem.titleText).arg(mainItem.subTitleText) } diff --git a/Linphone/view/Page/Layout/Settings/AccountSettingsParametersLayout.qml b/Linphone/view/Page/Layout/Settings/AccountSettingsParametersLayout.qml index 3b87fadb2..c9d0c5dfe 100644 --- a/Linphone/view/Page/Layout/Settings/AccountSettingsParametersLayout.qml +++ b/Linphone/view/Page/Layout/Settings/AccountSettingsParametersLayout.qml @@ -81,7 +81,7 @@ AbstractSettingsLayout { id: voicemailAddressField propertyName: "voicemailAddress" propertyOwnerGui: account - //: "URI de messagerie vocale" + //: "Voicemail address" title: qsTr("account_settings_voicemail_uri_title") Layout.fillWidth: true toValidate: true @@ -105,21 +105,25 @@ AbstractSettingsLayout { ColumnLayout { Layout.fillWidth: true spacing: Utils.getSizeWithScreenRatio(20) - Text { - //: "Transport" - text: qsTr("account_settings_transport_title") - color: DefaultStyle.main2_600 - font: Typography.p2l - } DecoratedTextField { + id: registrarUriField Layout.fillWidth: true //:"Registrar URI" title: qsTr("account_settings_registrar_uri_title") propertyName: "registrarUri" propertyOwnerGui: account toValidate: true + Connections { + enabled: account + target: account.core + function onRegistrarUriChanged() { + if (registrarUriField.text != registrarUriField.propertyOwnerGui.core[registrarUriField.propertyName]) + registrarUriField.text = registrarUriField.propertyOwnerGui.core[registrarUriField.propertyName] + } + } } DecoratedTextField { + id: outboundProxyUriField Layout.fillWidth: true //:"Outbound SIP Proxy URI" title: qsTr("account_settings_sip_proxy_url_title") @@ -128,34 +132,79 @@ AbstractSettingsLayout { //: "If this field is filled, the outbound proxy will be enabled automatically. Leave it empty to disable it." tooltip: qsTr("login_proxy_server_url_tooltip") toValidate: true + Connections { + enabled: account + target: account.core + function onOutboundProxyUriChanged() { + if (outboundProxyUriField.text != outboundProxyUriField.propertyOwnerGui.core[outboundProxyUriField.propertyName]) + outboundProxyUriField.text = outboundProxyUriField.propertyOwnerGui.core[outboundProxyUriField.propertyName] + } + } } DecoratedTextField { + id: stunServerField Layout.fillWidth: true propertyName: "stunServer" propertyOwnerGui: account //: "Adresse du serveur STUN" title: qsTr("account_settings_stun_server_url_title") toValidate: true + Connections { + enabled: account + target: account.core + function onStunServerChanged() { + if (stunServerField.text != stunServerField.propertyOwnerGui.core[stunServerField.propertyName]) + stunServerField.text = stunServerField.propertyOwnerGui.core[stunServerField.propertyName] + } + } } SwitchSetting { + id: iceSwitch //: "Activer ICE" titleText: qsTr("account_settings_enable_ice_title") propertyName: "iceEnabled" propertyOwnerGui: account + Connections { + enabled: account + target: account.core + function onIceEnabledChanged() { + if (iceSwitch.checked != iceSwitch.propertyOwnerGui.core[iceSwitch.propertyName]) + iceSwitch.checked = iceSwitch.propertyOwnerGui.core[iceSwitch.propertyName] + } + } } SwitchSetting { + id: avpfSwitch //: "AVPF" titleText: qsTr("account_settings_avpf_title") propertyName: "avpfEnabled" propertyOwnerGui: account + Connections { + enabled: account + target: account.core + function onAvpfEnabledChanged() { + if (avpfSwitch.checked != avpfSwitch.propertyOwnerGui.core[avpfSwitch.propertyName]) + avpfSwitch.checked = avpfSwitch.propertyOwnerGui.core[avpfSwitch.propertyName] + } + } } SwitchSetting { + id: bundleModeSwitch //: "Mode bundle" titleText: qsTr("account_settings_bundle_mode_title") propertyName: "bundleModeEnabled" propertyOwnerGui: account + Connections { + enabled: account + target: account.core + function onBundleModeEnabledChanged() { + if (bundleModeSwitch.checked != bundleModeSwitch.propertyOwnerGui.core[bundleModeSwitch.propertyName]) + bundleModeSwitch.checked = bundleModeSwitch.propertyOwnerGui.core[bundleModeSwitch.propertyName] + } + } } DecoratedTextField { + id: expireField Layout.fillWidth: true propertyName: "expire" propertyOwnerGui: account @@ -166,6 +215,13 @@ AbstractSettingsLayout { return !isNaN(Number(text)) } toValidate: true + Connections { + target: account.core + function onExpireChanged() { + if (expireField.text != expireField.propertyOwnerGui.core[expireField.propertyName]) + expireField.text = expireField.propertyOwnerGui.core[expireField.propertyName] + } + } } DecoratedTextField { id: conferenceFactoryUriField @@ -174,6 +230,7 @@ AbstractSettingsLayout { title: qsTr("account_settings_conference_factory_uri_title") propertyName: "conferenceFactoryAddress" propertyOwnerGui: account + toValidate: true Connections { target: account.core function onConferenceFactoryAddressChanged() { @@ -181,7 +238,6 @@ AbstractSettingsLayout { conferenceFactoryUriField.text = conferenceFactoryUriField.propertyOwnerGui.core[conferenceFactoryUriField.propertyName] } } - toValidate: true } DecoratedTextField { id: audioVideoConfUriField @@ -200,12 +256,20 @@ AbstractSettingsLayout { } } DecoratedTextField { + id: limeServerUrlField Layout.fillWidth: true //: "URL du serveur d’échange de clés de chiffrement" title: qsTr("account_settings_lime_server_url_title") propertyName: "limeServerUrl" propertyOwnerGui: account toValidate: true + Connections { + target: account.core + function onLimeServerUrlChanged() { + if (limeServerUrlField.text != limeServerUrlField.propertyOwnerGui.core[limeServerUrlField.propertyName]) + limeServerUrlField.text = limeServerUrlField.propertyOwnerGui.core[limeServerUrlField.propertyName] + } + } } } } diff --git a/Linphone/view/Page/Layout/Settings/AdvancedSettingsLayout.qml b/Linphone/view/Page/Layout/Settings/AdvancedSettingsLayout.qml index c48a06830..7ceeec84d 100644 --- a/Linphone/view/Page/Layout/Settings/AdvancedSettingsLayout.qml +++ b/Linphone/view/Page/Layout/Settings/AdvancedSettingsLayout.qml @@ -180,6 +180,7 @@ AbstractSettingsLayout { ColumnLayout { spacing: Utils.getSizeWithScreenRatio(20) ListView { + id: videoCodecList Layout.preferredHeight: contentHeight Layout.fillWidth: true spacing: Utils.getSizeWithScreenRatio(20) @@ -188,7 +189,7 @@ AbstractSettingsLayout { filterType: PayloadTypeProxy.Video | PayloadTypeProxy.NotDownloadable } delegate: SwitchSetting { - width: parent.width + width: videoCodecList.width height: Utils.getSizeWithScreenRatio(32) titleText: Utils.capitalizeFirstLetter(modelData.core.mimeType) subTitleText: modelData.core.encoderDescription @@ -197,6 +198,7 @@ AbstractSettingsLayout { } } ListView { + id: payloadList Layout.preferredHeight: contentHeight Layout.fillWidth: true spacing: Utils.getSizeWithScreenRatio(20) @@ -205,22 +207,22 @@ AbstractSettingsLayout { filterType: PayloadTypeProxy.Video | PayloadTypeProxy.Downloadable } delegate: SwitchSetting { - width: parent.width + width: payloadList.width height: Utils.getSizeWithScreenRatio(32) titleText: Utils.capitalizeFirstLetter(modelData.core.mimeType) subTitleText: modelData.core.encoderDescription - onCheckedChanged: Utils.openCodecOnlineInstallerDialog( + onToggled: Utils.openCodecOnlineInstallerDialog( UtilsCpp.getMainWindow(), modelData.core, function cancelCallBack() { - setChecked(false) + checked = false }, function successCallBack() { videoPayloadTypeProxy.reload() downloadableVideoPayloadTypeProxy.reload() }, function errorCallBack() { - setChecked(false) + checked = false }) } }