From b17bc8cc27d4930102bcbfca123f28bf97bba26e Mon Sep 17 00:00:00 2001 From: Gaelle Braud Date: Mon, 20 Oct 2025 10:46:20 +0200 Subject: [PATCH] Fixes: fix get size with screen ratio function fix chat sending area ui #LINQT-2068 print debug logs in linphone files for futur debugging fix call history details ui when no video conference factory set use remote name of each call if in local conference #LINQT-2058 --- Linphone/core/App.cpp | 4 +- Linphone/core/account/AccountCore.cpp | 7 +- Linphone/core/call/CallList.cpp | 39 ++-- .../core/chat/message/ChatMessageCore.cpp | 6 +- .../content/ChatMessageContentList.cpp | 4 +- .../core/conference/ConferenceInfoList.cpp | 2 +- Linphone/core/notifier/Notifier.cpp | 9 +- Linphone/core/path/Paths.cpp | 2 +- Linphone/core/search/MagicSearchList.cpp | 4 +- Linphone/data/languages/de.ts | 178 +++++++++------- Linphone/data/languages/en.ts | 190 ++++++++++-------- Linphone/data/languages/fr_FR.ts | 190 ++++++++++-------- Linphone/main.cpp | 24 +-- Linphone/model/account/AccountManager.cpp | 30 +-- Linphone/model/auth/OIDCModel.cpp | 20 +- Linphone/model/call/CallModel.cpp | 10 +- .../content/ChatMessageContentModel.cpp | 7 +- Linphone/model/cli/CliModel.cpp | 12 +- Linphone/model/conference/ConferenceModel.cpp | 32 +-- Linphone/model/search/MagicSearchModel.cpp | 8 +- Linphone/model/setting/SettingsModel.cpp | 8 +- .../model/sound-player/SoundPlayerModel.cpp | 4 +- Linphone/model/tool/ToolModel.cpp | 38 ++-- Linphone/model/tool/ToolModel.hpp | 1 + Linphone/tool/Utils.cpp | 14 +- .../tool/accessibility/KeyboardShortcuts.cpp | 4 +- Linphone/tool/file/FileDownloader.cpp | 33 +-- Linphone/tool/file/FileDownloader.hpp | 6 +- Linphone/tool/file/FileExtractor.cpp | 8 +- Linphone/tool/file/FileExtractor.hpp | 6 +- Linphone/view/Control/Button/Button.qml | 2 +- .../Container/Call/CallHistoryLayout.qml | 34 ++-- .../Control/Display/Call/CallListView.qml | 8 +- .../view/Control/Display/Chat/ChatMessage.qml | 140 ++++++------- .../Display/Chat/Emoji/EmojiPicker.qml | 1 + .../Input/Chat/ChatDroppableTextArea.qml | 18 +- Linphone/view/Control/Tool/Helper/utils.js | 4 +- .../view/Page/Form/Chat/SelectedChatView.qml | 35 ---- 38 files changed, 597 insertions(+), 545 deletions(-) diff --git a/Linphone/core/App.cpp b/Linphone/core/App.cpp index f70488ffc..982286d6b 100644 --- a/Linphone/core/App.cpp +++ b/Linphone/core/App.cpp @@ -435,10 +435,10 @@ void App::setSelf(QSharedPointer(me)) { mCliModelConnection->makeConnectToCore(&App::receivedMessage, [this](int, const QByteArray &byteArray) { QString command(byteArray); if (command.isEmpty()) { - lDebug() << log().arg("Check with CliModel for commands"); + lInfo() << log().arg("Check with CliModel for commands"); mCliModelConnection->invokeToModel([]() { CliModel::getInstance()->runProcess(); }); } else { - qInfo() << QStringLiteral("Received command from other application: `%1`.").arg(command); + lInfo() << log().arg("Received command from other application: `%1`.").arg(command); mCliModelConnection->invokeToModel([command]() { CliModel::getInstance()->executeCommand(command); }); } }); diff --git a/Linphone/core/account/AccountCore.cpp b/Linphone/core/account/AccountCore.cpp index 84f4de8d4..04333796b 100644 --- a/Linphone/core/account/AccountCore.cpp +++ b/Linphone/core/account/AccountCore.cpp @@ -60,7 +60,10 @@ AccountCore::AccountCore(const std::shared_ptr &account) : QO mRegisterEnabled = params->registerEnabled(); mMwiServerAddress = params->getMwiServerAddress() ? Utils::coreStringToAppString(params->getMwiServerAddress()->asString()) : ""; - mTransports << "UDP" << "TCP" << "TLS" << "DTLS"; + mTransports << "UDP" + << "TCP" + << "TLS" + << "DTLS"; mTransport = LinphoneEnums::toString(LinphoneEnums::fromLinphone(params->getTransport())); mRegistrarUri = params->getServerAddress() ? Utils::coreStringToAppString(params->getServerAddress()->asString()) : ""; @@ -384,7 +387,7 @@ void AccountCore::onRegistrationStateChanged(const std::shared_ptr #include @@ -96,34 +97,26 @@ void CallList::setSelf(QSharedPointer me) { bool enablingVideo = false; if (currentCall) enablingVideo = currentCall->getCurrentParams()->videoEnabled(); if (!conference) { - auto parameters = core->createConferenceParams(conference); auto audioVideoConfFactoryUri = core->getDefaultAccount()->getParams()->getAudioVideoConferenceFactoryAddress(); - if (audioVideoConfFactoryUri) { - parameters->setConferenceFactoryAddress(audioVideoConfFactoryUri); - parameters->setSubject("Meeting"); + QString subject = audioVideoConfFactoryUri + //: Remote group call + ? tr("remote_group_call") + //: "Local group call" + : tr("local_group_call"); + auto conference = ToolModel::createConference(subject, nullptr); + if (!conference) { + lWarning() << log().arg("Failed to merge calls"); + mModelConnection->invokeToCore([] { + Utils::showInformationPopup(tr("info_popup_error_title"), + //: Failed to merge calls ! + tr("info_popup_merge_calls_failed_message"), false); + }); + return; } else { - parameters->setSubject("Local meeting"); - } - parameters->enableVideo(enablingVideo); - conference = core->createConferenceWithParams(parameters); - } - - std::list> allLinphoneAddresses; - std::list> newCalls; - std::list> runningCallsToAdd; - - for (auto call : currentCalls) { - if (!call->getConference()) { - runningCallsToAdd.push_back(call); + conference->addParticipants(currentCalls); } } - - // 1) Add running calls - if (runningCallsToAdd.size() > 0) { - conference->addParticipants(runningCallsToAdd); - } - // emit lUpdate(); }); }); diff --git a/Linphone/core/chat/message/ChatMessageCore.cpp b/Linphone/core/chat/message/ChatMessageCore.cpp index 39d724a3c..8cbd82dbd 100644 --- a/Linphone/core/chat/message/ChatMessageCore.cpp +++ b/Linphone/core/chat/message/ChatMessageCore.cpp @@ -323,16 +323,16 @@ void ChatMessageCore::setSelf(QSharedPointer me) { mChatMessageModelConnection->makeConnectToModel( &ChatMessageModel::fileTransferRecv, [this](const std::shared_ptr &message, const std::shared_ptr &content, - const std::shared_ptr &buffer) { qDebug() << "transfer received"; }); + const std::shared_ptr &buffer) { lInfo() << log().arg("transfer received"); }); mChatMessageModelConnection->makeConnectToModel( &ChatMessageModel::fileTransferSend, [this](const std::shared_ptr &message, const std::shared_ptr &content, - size_t offset, size_t size) { qDebug() << "transfer send"; }); + size_t offset, size_t size) { lInfo() << log().arg("transfer send"); }); mChatMessageModelConnection->makeConnectToModel( &ChatMessageModel::fileTransferSendChunk, [this](const std::shared_ptr &message, const std::shared_ptr &content, size_t offset, size_t size, - const std::shared_ptr &buffer) { qDebug() << "transfer send chunk"; }); + const std::shared_ptr &buffer) { lInfo() << log().arg("transfer send chunk"); }); mChatMessageModelConnection->makeConnectToModel( &ChatMessageModel::participantImdnStateChanged, [this](const std::shared_ptr &message, diff --git a/Linphone/core/chat/message/content/ChatMessageContentList.cpp b/Linphone/core/chat/message/content/ChatMessageContentList.cpp index 102e9139c..652ab84a4 100644 --- a/Linphone/core/chat/message/content/ChatMessageContentList.cpp +++ b/Linphone/core/chat/message/content/ChatMessageContentList.cpp @@ -139,7 +139,7 @@ void ChatMessageContentList::addFiles(const QStringList &paths) { qint64 fileSize = file.size(); if (fileSize > Constants::FileSizeLimit) { ++nbTooBig; - qWarning() << QString("Unable to send file. (Size limit=%1)").arg(Constants::FileSizeLimit); + lWarning() << log().arg("Unable to send file. (Size limit=%1)").arg(Constants::FileSizeLimit); continue; } auto name = file.fileName().toStdString(); @@ -149,7 +149,7 @@ void ChatMessageContentList::addFiles(const QStringList &paths) { if (mimeType.length() != 2) { ++nbMimeError; lastMimeError = path; - qWarning() << QString("Unable to get supported mime type for: `%1`.").arg(path); + lWarning() << log().arg("Unable to get supported mime type for: `%1`.").arg(path); continue; } content->setType(Utils::appStringToCoreString(mimeType[0])); diff --git a/Linphone/core/conference/ConferenceInfoList.cpp b/Linphone/core/conference/ConferenceInfoList.cpp index cd389468f..40f305284 100644 --- a/Linphone/core/conference/ConferenceInfoList.cpp +++ b/Linphone/core/conference/ConferenceInfoList.cpp @@ -105,7 +105,7 @@ void ConferenceInfoList::setSelf(QSharedPointer me) { &CoreModel::conferenceInfoReceived, [this](const std::shared_ptr &core, const std::shared_ptr &conferenceInfo) { - lDebug() << log().arg("conference info received") << conferenceInfo->getSubject(); + lInfo() << log().arg("conference info received") << conferenceInfo->getSubject(); // We must refresh all the conference infos cause we are not able to determine // which account is concerned by the signal if multiple accounts are connected emit lUpdate(); diff --git a/Linphone/core/notifier/Notifier.cpp b/Linphone/core/notifier/Notifier.cpp index cb732e527..4868f2ebf 100644 --- a/Linphone/core/notifier/Notifier.cpp +++ b/Linphone/core/notifier/Notifier.cpp @@ -282,8 +282,8 @@ void Notifier::notifyReceivedCall(const shared_ptr &call) { auto accountModel = Utils::makeQObject_ptr(account); accountModel->setSelf(accountModel); if (!accountModel->getNotificationsAllowed()) { - qInfo() - << "Notifications have been disabled for this account - not creating a notification for incoming call"; + lInfo() << log().arg( + "Notifications have been disabled for this account - not creating a notification for incoming call"); if (accountModel->forwardToVoiceMailInDndPresence()) { lInfo() << log().arg("Transferring call to voicemail"); auto voicemailAddress = linphone::Factory::get()->createAddress( @@ -341,8 +341,9 @@ void Notifier::notifyReceivedMessages(const std::shared_ptr auto accountModel = Utils::makeQObject_ptr(receiverAccount); accountModel->setSelf(accountModel); if (!accountModel->getNotificationsAllowed()) { - qInfo() << "Notifications have been disabled for this account - not creating a notification for " - "incoming message"; + lInfo() << log().arg( + "Notifications have been disabled for this account - not creating a notification for " + "incoming message"); return; } } diff --git a/Linphone/core/path/Paths.cpp b/Linphone/core/path/Paths.cpp index 4f168430b..94a0ea260 100644 --- a/Linphone/core/path/Paths.cpp +++ b/Linphone/core/path/Paths.cpp @@ -164,7 +164,7 @@ static inline QString getAppRootCaFilePath() { if (Paths::filePathExists(rootca)) { // Packaged return rootca; } else { - qDebug() << "Root ca path does not exist. Create it"; + lInfo() << "Root ca path does not exist. Create it"; QFileInfo rootcaInfo(rootca); if (!rootcaInfo.absoluteDir().exists()) { QDir dataDir(getAppPackageDataDirPath()); diff --git a/Linphone/core/search/MagicSearchList.cpp b/Linphone/core/search/MagicSearchList.cpp index 74fc971f5..bef53989a 100644 --- a/Linphone/core/search/MagicSearchList.cpp +++ b/Linphone/core/search/MagicSearchList.cpp @@ -140,7 +140,7 @@ void MagicSearchList::setSelf(QSharedPointer me) { emit resultsProcessed(); }); }); - qDebug() << log().arg("Initialized"); + lDebug() << log().arg("Initialized"); emit initialized(); }); }); @@ -157,7 +157,7 @@ void MagicSearchList::setResults(const QList> &contac if (!isFriendCore) continue; disconnect(isFriendCore.get()); } - qDebug() << log().arg("SetResults: %1").arg(contacts.size()); + lDebug() << log().arg("SetResults: %1").arg(contacts.size()); resetData(contacts); for (auto it : contacts) { connectContact(it.get()); diff --git a/Linphone/data/languages/de.ts b/Linphone/data/languages/de.ts index 943ee0177..350e3e9d8 100644 --- a/Linphone/data/languages/de.ts +++ b/Linphone/data/languages/de.ts @@ -39,45 +39,45 @@ AccountCore - + drawer_menu_account_connection_status_connected "Connecté" Verbunden - + drawer_menu_account_connection_status_refreshing Aktualisiere… - + drawer_menu_account_connection_status_progress Verbinde… - + drawer_menu_account_connection_status_failed Fehler - + drawer_menu_account_connection_status_cleared Deaktiviert - + manage_account_status_connected_summary "Vous êtes en ligne et joignable." Sie sind online und erreichbar. - + manage_account_status_failed_summary "Erreur de connexion, vérifiez vos paramètres." Verbindungsfehler, überprüfen Sie Ihre Einstellungen. - + manage_account_status_cleared_summary "Compte désactivé, vous ne recevrez ni appel ni message." Konto deaktiviert, Sie erhalten keine Anrufe oder Nachrichten. @@ -634,102 +634,101 @@ App - + remote_provisioning_dialog Voulez-vous télécharger et appliquer la configuration depuis cette adresse ? 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 - + mark_all_read_action - "Mark all as read" @@ -946,7 +945,7 @@ Offline - + meeting_info_join_title "Rejoindre la réunion" Besprechung beitreten @@ -1023,52 +1022,77 @@ Der Besprechungs-Link wurde in die Zwischenablage kopiert + + CallList + + + remote_group_call + Remote group call + + + + + local_group_call + + + + + info_popup_error_title + + + + + info_popup_merge_calls_failed_message + Failed to merge calls ! + + + CallListView - + meeting "Réunion Besprechung - + call "Appel" Anruf - + paused_call_or_meeting "%1 en pause" %1 pausiert - + ongoing_call_or_meeting "%1 en cours" %1 laufend - + transfer_call_name_accessible_name Transfer call %1 - + resume_call_name_accessible_name Resume %1 call - + pause_call_name_accessible_name Pause %1 call - + end_call_name_accessible_name End %1 call @@ -2032,13 +2056,13 @@ ChatDroppableTextArea - + chat_view_send_area_placeholder_text Say something… : placeholder text for sending message text area - + cannot_record_while_in_call_tooltip Cannot record a message while a call is ongoing @@ -2261,13 +2285,13 @@ Error ChatMessageContentModel - + popup_error_title Error - + popup_download_error_message This file was already downloaded and is no more on the server. Your peer have to resend it if you want to get it @@ -4874,36 +4898,36 @@ Error Notifier - + new_call_alert_accessible_name New call from %1 - + new_voice_message 'Voice message received!' : message to warn the user in a notofication for voice messages. - + new_file_message - + new_conference_invitation 'Conference invitation received!' : Notification about receiving an invitation to a conference. - + new_chat_room_messages 'New messages received!' Notification that warn the user of new messages. - + new_message_alert_accessible_name New message on chatroom %1 @@ -4923,102 +4947,102 @@ Error - + oidc_authentication_granted_message Authentication granted - + oidc_authentication_not_authenticated_message Not authenticated - + oidc_authentication_refresh_message Refreshing token - + oidc_authentication_temporary_credentials_message Temporary credentials received - + oidc_authentication_network_error Network error - + oidc_authentication_server_error Server error - + oidc_authentication_token_not_found_error OAuth token not found - + oidc_authentication_token_secret_not_found_error OAuth token secret not found - + oidc_authentication_callback_not_verified_error OAuth callback not verified - + oidc_authentication_request_auth_message Requesting authorization from browser - + oidc_authentication_no_token_found_error - + oidc_authentication_request_token_message Requesting access token - + oidc_authentication_refresh_token_message Refreshing access token - + oidc_authentication_request_authorization_message Requesting authorization - + oidc_authentication_request_temporary_credentials_message Requesting temporary credentials - + oidc_authentication_no_auth_found_in_config_error No authorization endpoint found in OpenID configuration - + oidc_authentication_no_token_found_in_config_error No token endpoint found in OpenID configuration @@ -5690,37 +5714,37 @@ Pour les activer dans un projet commercial, merci de nous contacter. Start a group call ? - + unencrypted_conversation_warning This conversation is not encrypted ! - + reply_to_label Reply to %1 - + shared_medias_title Shared medias - + shared_documents_title Shared documents - + forward_to_title Forward to… - + conversations_title Conversations @@ -5859,38 +5883,38 @@ Pour les activer dans un projet commercial, merci de nous contacter. - + group_call_error_participants_invite - + group_call_error_creation - + voice_recording_duration "Voice recording (%1)" : %1 is the duration formated in mm:ss - + conference_invitation - + conference_invitation_updated - + conference_invitation_cancelled - + unknown_audio_device_name Unbekannter Gerätename diff --git a/Linphone/data/languages/en.ts b/Linphone/data/languages/en.ts index 61dbde307..8b31d3f84 100644 --- a/Linphone/data/languages/en.ts +++ b/Linphone/data/languages/en.ts @@ -39,45 +39,45 @@ AccountCore - + drawer_menu_account_connection_status_connected "Connecté" Connected - + drawer_menu_account_connection_status_refreshing Refreshing… - + drawer_menu_account_connection_status_progress Connecting… - + drawer_menu_account_connection_status_failed Error - + drawer_menu_account_connection_status_cleared Disabled - + manage_account_status_connected_summary "Vous êtes en ligne et joignable." You are online and reachable. - + manage_account_status_failed_summary "Erreur de connexion, vérifiez vos paramètres." Connection error, check your settings. - + manage_account_status_cleared_summary "Compte désactivé, vous ne recevrez ni appel ni message." Account disabled, you will not receive calls or messages. @@ -428,11 +428,6 @@ "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_outbound_proxy_title - "Outbound proxy enabled" - Outbound proxy server enabled - account_settings_stun_server_url_title @@ -634,103 +629,102 @@ App - + remote_provisioning_dialog Voulez-vous télécharger et appliquer la configuration depuis cette adresse ? 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 - + mark_all_read_action - "Mark all as read" - Mark all as read + Marquer tout comme lu @@ -926,7 +920,7 @@ CallHistoryLayout - + meeting_info_join_title "Rejoindre la réunion" Join meeting @@ -1003,52 +997,77 @@ The meeting link has been copied to the clipboard + + CallList + + + remote_group_call + Remote group call + Remote group call + + + + local_group_call + Local group call + + + + info_popup_error_title + Error + + + + info_popup_merge_calls_failed_message + Failed to merge calls ! + Failed to merge calls ! + + CallListView - + meeting "Réunion Meeting - + call "Appel" Call - + paused_call_or_meeting "%1 en pause" %1 paused - + ongoing_call_or_meeting "%1 en cours" Ongoing %1 - + transfer_call_name_accessible_name Transfer call %1 Transfer call %1 - + resume_call_name_accessible_name Resume %1 call Resume %1 call - + pause_call_name_accessible_name Pause %1 call Pause %1 call - + end_call_name_accessible_name End %1 call End %1 call @@ -1994,13 +2013,13 @@ ChatDroppableTextArea - + chat_view_send_area_placeholder_text Say something… : placeholder text for sending message text area Say something… - + cannot_record_while_in_call_tooltip Cannot record a message while a call is ongoing Cannot record a message while a call is ongoing @@ -2223,13 +2242,13 @@ Error ChatMessageContentModel - + popup_error_title Error Error - + popup_download_error_message This file was already downloaded and is no more on the server. Your peer have to resend it if you want to get it This file was already downloaded and is no more on the server. Your peer have to resend it if you want to get it @@ -4771,36 +4790,36 @@ Expiration : %1 Notifier - + new_call_alert_accessible_name New call from %1 New call from %1 - + new_voice_message 'Voice message received!' : message to warn the user in a notofication for voice messages. Voice message received! - + new_file_message File received! - + new_conference_invitation 'Conference invitation received!' : Notification about receiving an invitation to a conference. Conference invitation received ! - + new_chat_room_messages 'New messages received!' Notification that warn the user of new messages. New messages received ! - + new_message_alert_accessible_name New message on chatroom %1 New message on chatroom %1 @@ -4820,102 +4839,102 @@ Expiration : %1 Timeout: Not authenticated - + oidc_authentication_granted_message Authentication granted Authentication granted - + oidc_authentication_not_authenticated_message Not authenticated Not authenticated - + oidc_authentication_refresh_message Refreshing token Refreshing token - + oidc_authentication_temporary_credentials_message Temporary credentials received Temporary credentials received - + oidc_authentication_network_error Network error Network error - + oidc_authentication_server_error Server error Server error - + oidc_authentication_token_not_found_error OAuth token not found OAuth token not found - + oidc_authentication_token_secret_not_found_error OAuth token secret not found OAuth token secret not found - + oidc_authentication_callback_not_verified_error OAuth callback not verified OAuth callback not verified - + oidc_authentication_request_auth_message Requesting authorization from browser Requesting authorization from browser - + oidc_authentication_no_token_found_error No token found - + oidc_authentication_request_token_message Requesting access token Requesting access token - + oidc_authentication_refresh_token_message Refreshing access token Refreshing access token - + oidc_authentication_request_authorization_message Requesting authorization Requesting authorization - + oidc_authentication_request_temporary_credentials_message Requesting temporary credentials Requesting temporary credentials - + oidc_authentication_no_auth_found_in_config_error No authorization endpoint found in OpenID configuration No authorization endpoint found in OpenID configuration - + oidc_authentication_no_token_found_in_config_error No token endpoint found in OpenID configuration No token endpoint found in OpenID configuration @@ -5575,37 +5594,37 @@ To enable them in a commercial project, please contact us. Start a group call ? - + unencrypted_conversation_warning This conversation is not encrypted ! This conversation is not encrypted ! - + reply_to_label Reply to %1 Reply to %1 - + shared_medias_title Shared medias Shared medias - + shared_documents_title Shared documents Shared documents - + forward_to_title Forward to… Froward to… - + conversations_title Conversations Conversations @@ -5658,11 +5677,6 @@ To enable them in a commercial project, please contact us. "Réunions" Meetings - - settings_security_title - "Affichage" "Security" - Security / Encryption - settings_network_title @@ -5744,38 +5758,38 @@ To enable them in a commercial project, please contact us. No default account found, can't create group call - + group_call_error_participants_invite Couldn't invite participants to group call - + group_call_error_creation Group call couldn't be created - + voice_recording_duration "Voice recording (%1)" : %1 is the duration formated in mm:ss Voice recording (%1) - + unknown_audio_device_name Unknown device name - + conference_invitation Meeting invitation - + conference_invitation_cancelled Meeting cancellation - + conference_invitation_updated Meeting modification diff --git a/Linphone/data/languages/fr_FR.ts b/Linphone/data/languages/fr_FR.ts index 49a22d911..ef526f11e 100644 --- a/Linphone/data/languages/fr_FR.ts +++ b/Linphone/data/languages/fr_FR.ts @@ -39,45 +39,45 @@ AccountCore - + drawer_menu_account_connection_status_connected "Connecté" Connecté - + drawer_menu_account_connection_status_refreshing En cours de rafraîchissement… - + drawer_menu_account_connection_status_progress Connexion… - + drawer_menu_account_connection_status_failed Erreur - + drawer_menu_account_connection_status_cleared Désactivé - + manage_account_status_connected_summary "Vous êtes en ligne et joignable." Vous êtes en ligne et joignable. - + manage_account_status_failed_summary "Erreur de connexion, vérifiez vos paramètres." Erreur de connexion, vérifiez vos paramètres. - + manage_account_status_cleared_summary "Compte désactivé, vous ne recevrez ni appel ni message." Compte désactivé, vous ne recevrez ni appel ni message. @@ -428,11 +428,6 @@ "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_outbound_proxy_title - "Outbound proxy enabled" - Serveur mandataire sortant - account_settings_stun_server_url_title @@ -634,103 +629,102 @@ App - + remote_provisioning_dialog Voulez-vous télécharger et appliquer la configuration depuis cette adresse ? 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 - + mark_all_read_action - "Mark all as read" - Marquer tout comme lu + Mark all as read @@ -926,7 +920,7 @@ CallHistoryLayout - + meeting_info_join_title "Rejoindre la réunion" Rejoindre la réunion @@ -1003,52 +997,77 @@ Le lien de la réunion a été copié dans le presse-papier + + CallList + + + remote_group_call + Remote group call + Appel de groupe distant + + + + local_group_call + Appel de groupe local + + + + info_popup_error_title + Erreur + + + + info_popup_merge_calls_failed_message + Failed to merge calls ! + La fusion des appels a échoué ! + + CallListView - + meeting "Réunion Réunion - + call "Appel" Appel - + paused_call_or_meeting "%1 en pause" %1 en pause - + ongoing_call_or_meeting "%1 en cours" %1 en cours - + transfer_call_name_accessible_name Transfer call %1 Transférer l'appel %1 - + resume_call_name_accessible_name Resume %1 call Reprendre l'appel %1 - + pause_call_name_accessible_name Pause %1 call Mettre l'appel %1 en pause - + end_call_name_accessible_name End %1 call Terminer l'appel %1 @@ -1994,13 +2013,13 @@ ChatDroppableTextArea - + chat_view_send_area_placeholder_text Say something… : placeholder text for sending message text area Dites quelque chose… - + cannot_record_while_in_call_tooltip Cannot record a message while a call is ongoing Impossible d'enregistrer un message vocal pendant un appel @@ -2223,13 +2242,13 @@ Error ChatMessageContentModel - + popup_error_title Error Erreur - + popup_download_error_message This file was already downloaded and is no more on the server. Your peer have to resend it if you want to get it Ce fichier a déjà été téléchargé et n'est plus sur le serveur. Votre correspondant devra vous le renvoyer si vous voulez y avoir accès. @@ -4771,36 +4790,36 @@ Expiration : %1 Notifier - + new_call_alert_accessible_name New call from %1 Nouvel appel de %1 - + new_voice_message 'Voice message received!' : message to warn the user in a notofication for voice messages. Message vocal reçu ! - + new_file_message Fichier reçu ! - + new_conference_invitation 'Conference invitation received!' : Notification about receiving an invitation to a conference. Nouvelle invitation à une conférence ! - + new_chat_room_messages 'New messages received!' Notification that warn the user of new messages. Nouveaux messages reçus ! - + new_message_alert_accessible_name New message on chatroom %1 Nouveau message sur la conversation %1 @@ -4820,102 +4839,102 @@ Expiration : %1 Timeout : non authentifié - + oidc_authentication_granted_message Authentication granted Authentification accordée - + oidc_authentication_not_authenticated_message Not authenticated Non authentifié - + oidc_authentication_refresh_message Refreshing token Token en cours de rafraîchissement - + oidc_authentication_temporary_credentials_message Temporary credentials received Identifiants temporaires reçus - + oidc_authentication_network_error Network error Erreur réseau - + oidc_authentication_server_error Server error Erreur de serveur - + oidc_authentication_token_not_found_error OAuth token not found Token OAuth non trouvé - + oidc_authentication_token_secret_not_found_error OAuth token secret not found Token OAuth secret non trouvé - + oidc_authentication_callback_not_verified_error OAuth callback not verified Retour OAuth non vérifié - + oidc_authentication_request_auth_message Requesting authorization from browser En attente d'autorisation du navigateur - + oidc_authentication_no_token_found_error Token non trouvé - + oidc_authentication_request_token_message Requesting access token En attente du token d'accès - + oidc_authentication_refresh_token_message Refreshing access token Token en cours de rafraîchissement - + oidc_authentication_request_authorization_message Requesting authorization Autorisation en cours - + oidc_authentication_request_temporary_credentials_message Requesting temporary credentials En attente d'identifiants temporaires - + oidc_authentication_no_auth_found_in_config_error No authorization endpoint found in OpenID configuration Pas d'autorisation trouvé dans la configuration OpenID - + oidc_authentication_no_token_found_in_config_error No token endpoint found in OpenID configuration Pas de token trouvé dans la configuration OpenID @@ -5575,37 +5594,37 @@ Pour les activer dans un projet commercial, merci de nous contacter.Démarrer un appel de groupe ? - + unencrypted_conversation_warning This conversation is not encrypted ! Cette conversation n'est pas chiffrée ! - + reply_to_label Reply to %1 Réponse à %1 - + shared_medias_title Shared medias Médias partagés - + shared_documents_title Shared documents Documents partagés - + forward_to_title Forward to… Transférer à… - + conversations_title Conversations Conversations @@ -5658,11 +5677,6 @@ Pour les activer dans un projet commercial, merci de nous contacter."Réunions" Réunions - - settings_security_title - "Affichage" "Security" - Sécurité / Chiffrement - settings_network_title @@ -5744,38 +5758,38 @@ Pour les activer dans un projet commercial, merci de nous contacter.Impossible de créer l'appel de groupe, le compte par défaut n'est pas défini - + group_call_error_participants_invite Impossible d'inviter les participants à l'appel de groupe - + group_call_error_creation L'appel de groupe n'a pas pu être créé - + voice_recording_duration "Voice recording (%1)" : %1 is the duration formated in mm:ss Message vocal (%1) - + unknown_audio_device_name Appareil inconnu - + conference_invitation Invitation à une réunion - + conference_invitation_cancelled Annulation d'une réunion - + conference_invitation_updated Modification d'une réunion diff --git a/Linphone/main.cpp b/Linphone/main.cpp index 9b3e65df2..92939ba45 100644 --- a/Linphone/main.cpp +++ b/Linphone/main.cpp @@ -49,19 +49,19 @@ int main(int argc, char *argv[]) { #endif */ // Useful to share camera on Fullscreen (other context) or multiscreens - qDebug() << "[Main] Setting ShareOpenGLContexts"; + lDebug() << "[Main] Setting ShareOpenGLContexts"; QApplication::setAttribute(Qt::AA_ShareOpenGLContexts); - qDebug() << "[Main] Disabling VSync"; + lDebug() << "[Main] Disabling VSync"; // Ignore vertical sync. This way, we avoid blinking on resizes(and other refresh like layouts etc.). auto ignoreVSync = QSurfaceFormat::defaultFormat(); ignoreVSync.setSwapInterval(0); QSurfaceFormat::setDefaultFormat(ignoreVSync); // Disable QML cache. Avoid malformed cache. - qDebug() << "[Main] Disabling QML disk cache"; + lDebug() << "[Main] Disabling QML disk cache"; qputenv("QML_DISABLE_DISK_CACHE", "true"); - qDebug() << "[Main] Setting application to UTF8"; + lDebug() << "[Main] Setting application to UTF8"; setlocale(LC_CTYPE, ".UTF8"); - qDebug() << "[Main] Creating application"; + lDebug() << "[Main] Creating application"; auto app = QSharedPointer::create(argc, argv); #ifdef ACCESSBILITY_WORKAROUND QAccessible::installUpdateHandler(DummyUpdateHandler); @@ -69,29 +69,29 @@ int main(int argc, char *argv[]) { #endif if (app->isSecondary()) { - qDebug() << "[Main] Sending command from secondary application"; + lDebug() << "[Main] Sending command from secondary application"; app->sendCommand(); qInfo() << QStringLiteral("[Main] Running secondary app success. Kill it now."); app->clean(); cleanStream(); return EXIT_SUCCESS; } else { - qDebug() << "[Main] Initializing core for primary application"; + lDebug() << "[Main] Initializing core for primary application"; app->initCore(); - qDebug() << "[Main] Preparing application's connections"; + lDebug() << "[Main] Preparing application's connections"; app->setSelf(app); } int result = 0; do { - qDebug() << "[Main] Sending command from primary application"; + lDebug() << "[Main] Sending command from primary application"; app->sendCommand(); - qInfo() << "[Main] Running application"; + lInfo() << "[Main] Running application"; result = app->exec(); } while (result == (int)App::StatusCode::gRestartCode); QString message = "[Main] Exiting app with the code : " + QString::number(result); - if (!result) qInfo() << message; - else qWarning() << message; + if (!result) lInfo() << message; + else lWarning() << message; app->clean(); app = nullptr; cleanStream(); diff --git a/Linphone/model/account/AccountManager.cpp b/Linphone/model/account/AccountManager.cpp index 044aa8b15..10532bbd3 100644 --- a/Linphone/model/account/AccountManager.cpp +++ b/Linphone/model/account/AccountManager.cpp @@ -189,7 +189,7 @@ void AccountManager::registerNewAccount(const QString &username, const std::shared_ptr &request, const std::string &data) { if (request->getType() == linphone::AccountManagerServicesRequest::Type::AccountCreationRequestToken) { QString verifyTokenUrl = Utils::coreStringToAppString(data); - qDebug() << "[AccountManager] request token succeed" << verifyTokenUrl; + lInfo() << "[AccountManager] request token succeed" << verifyTokenUrl; QDesktopServices::openUrl(verifyTokenUrl); auto creationToken = verifyTokenUrl.mid(verifyTokenUrl.lastIndexOf("/") + 1); @@ -206,7 +206,7 @@ void AccountManager::registerNewAccount(const QString &username, } else if (request->getType() == linphone::AccountManagerServicesRequest::Type:: AccountCreationTokenFromAccountCreationRequestToken) { - qDebug() << "[AccountManager] request token conversion succeed" << data; + lInfo() << "[AccountManager] request token conversion succeed" << data; emit tokenConversionSucceed(Utils::coreStringToAppString(data)); timer.stop(); mAccountManagerServicesModel->createAccountUsingToken(Utils::appStringToCoreString(username), @@ -225,24 +225,24 @@ void AccountManager::registerNewAccount(const QString &username, createdSipIdentityAddress->getDomain() // Domain. )); if (type == RegisterType::Email) { - qDebug() << "[AccountManager] creation succeed, email verification" << registerAddress; + lInfo() << "[AccountManager] creation succeed, email verification" << registerAddress; mAccountManagerServicesModel->linkEmailByEmail( ToolModel::interpretUrl(Utils::coreStringToAppString(data)), Utils::appStringToCoreString(registerAddress)); } else { - qDebug() << "[AccountManager] creation succeed, sms verification" << registerAddress; + lInfo() << "[AccountManager] creation succeed, sms verification" << registerAddress; mAccountManagerServicesModel->linkPhoneNumberBySms( ToolModel::interpretUrl(Utils::coreStringToAppString(data)), Utils::appStringToCoreString(registerAddress)); } } else if (request->getType() == linphone::AccountManagerServicesRequest::Type::SendEmailLinkingCodeByEmail) { - qDebug() << "[AccountManager] send email succeed, link account using code"; + lInfo() << "[AccountManager] send email succeed, link account using code"; emit newAccountCreationSucceed(mCreatedSipAddress, type, registerAddress); mCreatedSipAddress.clear(); } else if (request->getType() == linphone::AccountManagerServicesRequest::Type::SendPhoneNumberLinkingCodeBySms) { - qDebug() << "[AccountManager] send phone number succeed, link account using code"; + lInfo() << "[AccountManager] send phone number succeed, link account using code"; emit newAccountCreationSucceed(mCreatedSipAddress, type, registerAddress); mCreatedSipAddress.clear(); } @@ -252,11 +252,11 @@ void AccountManager::registerNewAccount(const QString &username, [this](const std::shared_ptr &request, int statusCode, const std::string &errorMessage, const std::shared_ptr ¶meterErrors) { if (request->getType() == linphone::AccountManagerServicesRequest::Type::AccountCreationRequestToken) { - qDebug() << "[AccountManager] error creating request token :" << errorMessage; + lInfo() << "[AccountManager] error creating request token :" << errorMessage; emit registerNewAccountFailed(Utils::coreStringToAppString(errorMessage)); } else if (request->getType() == linphone::AccountManagerServicesRequest::Type:: AccountCreationTokenFromAccountCreationRequestToken) { - qDebug() << "[AccountManager] error converting token into creation token :" << errorMessage; + lInfo() << "[AccountManager] error converting token into creation token :" << errorMessage; if (parameterErrors) { timer.stop(); emit registerNewAccountFailed(Utils::coreStringToAppString(errorMessage)); @@ -264,7 +264,7 @@ void AccountManager::registerNewAccount(const QString &username, timer.start(); } } else if (request->getType() == linphone::AccountManagerServicesRequest::Type::CreateAccountUsingToken) { - qDebug() << "[AccountManager] error creating account :" << errorMessage; + lInfo() << "[AccountManager] error creating account :" << errorMessage; if (parameterErrors) { for (const std::string &key : parameterErrors->getKeys()) { emit errorInField(Utils::coreStringToAppString(key), @@ -275,7 +275,7 @@ void AccountManager::registerNewAccount(const QString &username, } } else if (request->getType() == linphone::AccountManagerServicesRequest::Type::SendEmailLinkingCodeByEmail) { - qDebug() << "[AccountManager] error sending code to email" << errorMessage; + lInfo() << "[AccountManager] error sending code to email" << errorMessage; if (parameterErrors) { for (const std::string &key : parameterErrors->getKeys()) { emit errorInField(Utils::coreStringToAppString(key), @@ -286,7 +286,7 @@ void AccountManager::registerNewAccount(const QString &username, } } else if (request->getType() == linphone::AccountManagerServicesRequest::Type::SendPhoneNumberLinkingCodeBySms) { - qDebug() << "[AccountManager] error sending code to phone number" << errorMessage; + lInfo() << "[AccountManager] error sending code to phone number" << errorMessage; if (parameterErrors) { for (const std::string &key : parameterErrors->getKeys()) { emit errorInField(Utils::coreStringToAppString(key), @@ -320,10 +320,10 @@ void AccountManager::linkNewAccountUsingCode(const QString &code, mAccountManagerServicesModel.get(), &AccountManagerServicesModel::requestSuccessfull, this, [this](const std::shared_ptr &request, const std::string &data) { if (request->getType() == linphone::AccountManagerServicesRequest::Type::LinkEmailUsingCode) { - qDebug() << "[AccountManager] link email to account succeed" << data; + lInfo() << "[AccountManager] link email to account succeed" << data; emit linkingNewAccountWithCodeSucceed(); } else if (request->getType() == linphone::AccountManagerServicesRequest::Type::LinkPhoneNumberUsingCode) { - qDebug() << "[AccountManager] link phone number to account succeed" << data; + lInfo() << "[AccountManager] link phone number to account succeed" << data; emit linkingNewAccountWithCodeSucceed(); } }); @@ -332,9 +332,9 @@ void AccountManager::linkNewAccountUsingCode(const QString &code, [this](const std::shared_ptr &request, int statusCode, const std::string &errorMessage, const std::shared_ptr ¶meterErrors) { if (request->getType() == linphone::AccountManagerServicesRequest::Type::LinkEmailUsingCode) { - qDebug() << "[AccountManager] error linking email to account" << errorMessage; + lInfo() << "[AccountManager] error linking email to account" << errorMessage; } else if (request->getType() == linphone::AccountManagerServicesRequest::Type::LinkPhoneNumberUsingCode) { - qDebug() << "[AccountManager] error linking phone number to account" << errorMessage; + lInfo() << "[AccountManager] error linking phone number to account" << errorMessage; } emit linkingNewAccountWithCodeFailed(Utils::coreStringToAppString(errorMessage)); }); diff --git a/Linphone/model/auth/OIDCModel.cpp b/Linphone/model/auth/OIDCModel.cpp index e641f64b4..4f3b04cd9 100644 --- a/Linphone/model/auth/OIDCModel.cpp +++ b/Linphone/model/auth/OIDCModel.cpp @@ -52,7 +52,7 @@ OIDCModel::OIDCModel(const std::shared_ptr &authInfo, QObjec qDebug() << "OIDC Redirect URI Port set to [" << port << "]"; auto replyHandler = new OAuthHttpServerReplyHandler(port, this); if (!replyHandler->isListening()) { - qWarning() << "OAuthHttpServerReplyHandler is not listening on port" << port; + lWarning() << log().arg("OAuthHttpServerReplyHandler is not listening on port") << port; emit requestFailed(tr("OAuthHttpServerReplyHandler is not listening")); emit finished(); return; @@ -99,7 +99,7 @@ OIDCModel::OIDCModel(const std::shared_ptr &authInfo, QObjec mTimeout.setInterval(1000 * 60 * 2); // 2minutes connect(&mTimeout, &QTimer::timeout, [this]() { - qWarning() << log().arg("Timeout reached for OpenID connection."); + lWarning() << log().arg("Timeout reached for OpenID connection."); dynamic_cast(mOidc.replyHandler())->close(); CoreModel::getInstance()->getCore()->abortAuthentication(mAuthInfo); //: Timeout: Not authenticated @@ -108,11 +108,13 @@ OIDCModel::OIDCModel(const std::shared_ptr &authInfo, QObjec }); connect(mOidc.networkAccessManager(), &QNetworkAccessManager::authenticationRequired, [=](QNetworkReply *reply, QAuthenticator *authenticator) { - lDebug() << "authenticationRequired url [" << reply->url() << "]"; + lInfo() << "authenticationRequired url [" << reply->url() << "]"; if (mOidc.clientIdentifierSharedKey().isEmpty() == false) { authenticator->setUser(mOidc.clientIdentifier()); authenticator->setPassword(mOidc.clientIdentifierSharedKey()); - } else lWarning() << "client secret not found for client id [" << mOidc.clientIdentifier() << "]"; + } else + lWarning() << log().arg("client secret not found for client id [") << mOidc.clientIdentifier() + << "]"; }); connect(&mOidc, &QOAuth2AuthorizationCodeFlow::statusChanged, [=](QAbstractOAuth::Status status) { @@ -152,7 +154,7 @@ OIDCModel::OIDCModel(const std::shared_ptr &authInfo, QObjec const QMetaObject metaObject = QAbstractOAuth::staticMetaObject; int index = metaObject.indexOfEnumerator("Error"); QMetaEnum metaEnum = metaObject.enumerator(index); - qWarning() << "RequestFailed:" << metaEnum.valueToKey(static_cast(error)); + lWarning() << log().arg("RequestFailed:") << metaEnum.valueToKey(static_cast(error)); switch (error) { case QAbstractOAuth::Error::NetworkError: //: Network error @@ -213,7 +215,7 @@ OIDCModel::OIDCModel(const std::shared_ptr &authInfo, QObjec } else { mIdToken.clear(); - qWarning() << "No ID Token or Access Token found in the tokens."; + lWarning() << "No ID Token or Access Token found in the tokens."; emit requestFailed(tr("oidc_authentication_no_token_found_error")); emit finished(); } @@ -267,7 +269,7 @@ void OIDCModel::openIdConfigReceived() { if (rootArray.contains("authorization_endpoint")) { mOidc.setAuthorizationUrl(QUrl(rootArray["authorization_endpoint"].toString())); } else { - qWarning() << "No authorization endpoint found in OpenID configuration"; + lWarning() << log().arg("No authorization endpoint found in OpenID configuration"); //: No authorization endpoint found in OpenID configuration emit requestFailed(tr("oidc_authentication_no_auth_found_in_config_error")); emit finished(); @@ -282,7 +284,7 @@ void OIDCModel::openIdConfigReceived() { mAuthInfo->setTokenEndpointUri( Utils::appStringToCoreString(QUrl(rootArray["token_endpoint"].toString()).toString())); } else { - qWarning() << "No token endpoint found in OpenID configuration"; + lWarning() << log().arg("No token endpoint found in OpenID configuration"); //: No token endpoint found in OpenID configuration emit requestFailed(tr("oidc_authentication_no_token_found_in_config_error")); emit finished(); @@ -307,7 +309,7 @@ void OIDCModel::setBearers() { mAuthInfo->setRefreshToken(refreshBearer); } else { - qWarning() << "No refresh token found"; + lWarning() << log().arg("No refresh token found"); } CoreModel::getInstance()->getCore()->addAuthInfo(mAuthInfo); emit CoreModel::getInstance()->bearerAccountAdded(); diff --git a/Linphone/model/call/CallModel.cpp b/Linphone/model/call/CallModel.cpp index f9664cb0c..a753b377e 100644 --- a/Linphone/model/call/CallModel.cpp +++ b/Linphone/model/call/CallModel.cpp @@ -97,7 +97,7 @@ void CallModel::setPaused(bool paused) { void CallModel::transferTo(const std::shared_ptr &address) { mustBeInLinphoneThread(log().arg(Q_FUNC_INFO)); if (mMonitor->transferTo(address) == -1) - qWarning() << log() + lWarning() << log() .arg(QStringLiteral("Unable to transfer: `%1`.")) .arg(Utils::coreStringToAppString(address->asStringUriOnly())); } @@ -105,7 +105,7 @@ void CallModel::transferTo(const std::shared_ptr &address) { void CallModel::transferToAnother(const std::shared_ptr &call) { mustBeInLinphoneThread(log().arg(Q_FUNC_INFO)); if (mMonitor->transferToAnother(call) == -1) - qWarning() << log() + lWarning() << log() .arg(QStringLiteral("Unable to transfer: `%1`.")) .arg(Utils::coreStringToAppString(call->getRemoteAddress()->asStringUriOnly())); } @@ -331,14 +331,14 @@ void CallModel::setVideoSourceDescriptorModel(std::shared_ptrsendDtmf(key); CoreModel::getInstance()->getCore()->playDtmf(key, gDtmfSoundDelay); } void CallModel::updateCallErrorFromReason(linphone::Reason reason) { QString error; - qDebug() << "call Error reason" << (int)reason; + lDebug() << log().arg("call Error reason") << (int)reason; switch (reason) { case linphone::Reason::None: error = ""; @@ -391,7 +391,7 @@ void CallModel::updateCallErrorFromReason(linphone::Reason reason) { break; } - if (!error.isEmpty()) qInfo() << QStringLiteral("Call terminated with error (%1):").arg(error) << this; + if (!error.isEmpty()) lInfo() << log().arg("Call terminated with error (%1):").arg(error) << this; emit errorMessageChanged(error); } diff --git a/Linphone/model/chat/message/content/ChatMessageContentModel.cpp b/Linphone/model/chat/message/content/ChatMessageContentModel.cpp index a373b38f0..be3404643 100644 --- a/Linphone/model/chat/message/content/ChatMessageContentModel.cpp +++ b/Linphone/model/chat/message/content/ChatMessageContentModel.cpp @@ -85,7 +85,7 @@ void ChatMessageContentModel::downloadFile(const QString &name) { case linphone::ChatMessage::State::FileTransferInProgress: return; default: - qWarning() << QStringLiteral("Wrong message state when requesting downloading, state=.") + lWarning() << QStringLiteral("Wrong message state when requesting downloading, state=.") << LinphoneEnums::fromLinphone(mChatMessageModel->getState()); } bool soFarSoGood; @@ -93,12 +93,13 @@ void ChatMessageContentModel::downloadFile(const QString &name) { QStringLiteral("%1%2").arg(App::getInstance()->getSettings()->getDownloadFolder()).arg(name), &soFarSoGood); if (!soFarSoGood) { - qWarning() << QStringLiteral("Unable to create safe file path for: %1.").arg(name); + lWarning() << QStringLiteral("Unable to create safe file path for: %1.").arg(name); return; } mContent->setFilePath(Utils::appStringToCoreString(safeFilePath)); if (!mContent->isFileTransfer()) { + lWarning() << QStringLiteral("file transfer is not available"); Utils::showInformationPopup( //: Error tr("popup_error_title"), @@ -107,7 +108,7 @@ void ChatMessageContentModel::downloadFile(const QString &name) { tr("popup_download_error_message"), false); } else { if (!mChatMessageModel->getMonitor()->downloadContent(mContent)) - qWarning() << QStringLiteral("Unable to download file of entry %1.").arg(name); + lWarning() << QStringLiteral("Unable to download file of entry %1.").arg(name); } } diff --git a/Linphone/model/cli/CliModel.cpp b/Linphone/model/cli/CliModel.cpp index 813a26f42..7989e80cf 100644 --- a/Linphone/model/cli/CliModel.cpp +++ b/Linphone/model/cli/CliModel.cpp @@ -93,7 +93,7 @@ QString CliModel::parseFunctionName(const QString &command, bool isOptional) { // mRegExpFunctionName.indexIn(command.toLower()); // if (mRegExpFunctionName.pos(1) == -1) { if (!match.hasMatch()) { - if (!isOptional) qWarning() << QStringLiteral("Unable to parse function name of command: `%1`.").arg(command); + if (!isOptional) lWarning() << QStringLiteral("Unable to parse function name of command: `%1`.").arg(command); return QString(""); } @@ -102,7 +102,7 @@ QString CliModel::parseFunctionName(const QString &command, bool isOptional) { const QString functionName = texts[1]; if (!mCommands.contains(functionName)) { - if (!isOptional) qWarning() << QStringLiteral("This command doesn't exist: `%1`.").arg(functionName); + if (!isOptional) lWarning() << QStringLiteral("This command doesn't exist: `%1`.").arg(functionName); return QString(""); } @@ -344,7 +344,7 @@ void CliModel::executeCommand(const QString &command) { //, CommandFormat *forma const QString &functionName = parseFunctionName(command, false); const QString configURI = QString(EXECUTABLE_NAME).toLower() + "-config"; if (!functionName.isEmpty()) { // It is a CLI - qInfo() << QStringLiteral("Detecting cli command: `%1`…").arg(command); + lInfo() << log().arg("Detecting cli command: `%1`…").arg(command); QHash args = parseArgs(command); QHash argsToProcess; for (auto it = args.begin(); it != args.end(); ++it) { @@ -410,7 +410,7 @@ void CliModel::executeCommand(const QString &command) { //, CommandFormat *forma address = linphone::Factory::get()->createAddress( Utils::appStringToCoreString(transformedCommand)); // Test if command is an address // if (format) *format = UriFormat; - qInfo() << QStringLiteral("Detecting URI command: `%1`…").arg(command); + lInfo() << log().arg("Detecting URI command: `%1`…").arg(command); QString functionName; if (address) { functionName = Utils::coreStringToAppString(address->getHeader("method")).isEmpty() @@ -429,10 +429,10 @@ void CliModel::executeCommand(const QString &command) { //, CommandFormat *forma } functionName = functionName.toLower(); if (functionName.isEmpty()) { - qWarning() << QStringLiteral("There is no method set in `%1`.").arg(command); + lWarning() << log().arg("There is no method set in `%1`.").arg(command); return; } else if (!mCommands.contains(functionName)) { - qWarning() << QStringLiteral("This command doesn't exist: `%1`.").arg(functionName); + lWarning() << log().arg("This command doesn't exist: `%1`.").arg(functionName); return; } QHash headers; diff --git a/Linphone/model/conference/ConferenceModel.cpp b/Linphone/model/conference/ConferenceModel.cpp index 327a36ba9..8564e0173 100644 --- a/Linphone/model/conference/ConferenceModel.cpp +++ b/Linphone/model/conference/ConferenceModel.cpp @@ -183,20 +183,20 @@ void ConferenceModel::onActiveSpeakerParticipantDevice( void ConferenceModel::onParticipantAdded(const std::shared_ptr &conference, const std::shared_ptr &participant) { - lDebug() << "onParticipant Added" << participant->getAddress()->asStringUriOnly(); + lInfo() << "onParticipant Added" << participant->getAddress()->asStringUriOnly(); emit participantAdded(participant); emit participantDeviceCountChanged(conference, getParticipantDeviceCount()); } void ConferenceModel::onParticipantRemoved(const std::shared_ptr &conference, const std::shared_ptr &participant) { - lDebug() << "onParticipant Removed" << participant->getAddress()->asStringUriOnly(); + lInfo() << "onParticipant Removed" << participant->getAddress()->asStringUriOnly(); emit participantRemoved(participant); emit participantDeviceCountChanged(conference, getParticipantDeviceCount()); } void ConferenceModel::onParticipantDeviceAdded(const std::shared_ptr &conference, const std::shared_ptr &participantDevice) { - lDebug() << "onParticipantDeviceAdded"; - lDebug() << "Me devices : " << conference->getMe()->getDevices().size(); + lInfo() << "onParticipantDeviceAdded"; + lInfo() << "Me devices : " << conference->getMe()->getDevices().size(); if (conference->getMe()->getDevices().size() > 1) for (auto d : conference->getMe()->getDevices()) lDebug() << "\t--> " << d->getAddress()->asString().c_str(); @@ -222,23 +222,23 @@ void ConferenceModel::onParticipantDeviceStateChanged(const std::shared_ptr &conference, const std::shared_ptr &participant) { - lDebug() << "onParticipantAdminStatusChanged"; + lInfo() << "onParticipantAdminStatusChanged"; emit participantAdminStatusChanged(participant); } void ConferenceModel::onParticipantDeviceMediaCapabilityChanged( const std::shared_ptr &conference, const std::shared_ptr &participantDevice) { - lDebug() << "onParticipantDeviceMediaCapabilityChanged: " - << (int)participantDevice->getStreamCapability(linphone::StreamType::Video) - << ". Device: " << participantDevice->getAddress()->asString().c_str(); + lInfo() << "onParticipantDeviceMediaCapabilityChanged: " + << (int)participantDevice->getStreamCapability(linphone::StreamType::Video) + << ". Device: " << participantDevice->getAddress()->asString().c_str(); emit participantDeviceMediaCapabilityChanged(participantDevice); } void ConferenceModel::onParticipantDeviceMediaAvailabilityChanged( const std::shared_ptr &conference, const std::shared_ptr &participantDevice) { - lDebug() << "onParticipantDeviceMediaAvailabilityChanged: " - << (int)participantDevice->getStreamAvailability(linphone::StreamType::Video) - << ". Device: " << participantDevice->getAddress()->asString().c_str(); + lInfo() << "onParticipantDeviceMediaAvailabilityChanged: " + << (int)participantDevice->getStreamAvailability(linphone::StreamType::Video) + << ". Device: " << participantDevice->getAddress()->asString().c_str(); emit participantDeviceMediaAvailabilityChanged(participantDevice); } void ConferenceModel::onParticipantDeviceIsSpeakingChanged( @@ -254,8 +254,8 @@ void ConferenceModel::onParticipantDeviceScreenSharingChanged( const std::shared_ptr &conference, const std::shared_ptr &device, bool enabled) { - qDebug() << "onParticipantDeviceScreenSharingChanged: " << device->getAddress()->asString().c_str() - << ". Enabled:" << enabled; + lInfo() << log().arg("onParticipantDeviceScreenSharingChanged: ") << device->getAddress()->asString().c_str() + << ". Enabled:" << enabled; emit participantDeviceScreenSharingChanged(device, enabled); if (ToolModel::isLocal(mMonitor, device)) { emit isLocalScreenSharingChanged(enabled); @@ -265,7 +265,7 @@ void ConferenceModel::onParticipantDeviceScreenSharingChanged( void ConferenceModel::onStateChanged(const std::shared_ptr &conference, linphone::Conference::State newState) { - lDebug() << log().arg("onStateChanged:") << (int)newState; + lInfo() << log().arg("onStateChanged:") << (int)newState; if (newState == linphone::Conference::State::Created) { emit participantDeviceCountChanged(conference, mMonitor->getParticipantDeviceList().size()); if (mMonitor->getScreenSharingParticipant()) emit isScreenSharingEnabledChanged(true); @@ -275,7 +275,7 @@ void ConferenceModel::onStateChanged(const std::shared_ptr } void ConferenceModel::onSubjectChanged(const std::shared_ptr &conference, const std::string &subject) { - lDebug() << "onSubjectChanged"; + lInfo() << "onSubjectChanged"; emit subjectChanged(subject); } void ConferenceModel::onAudioDeviceChanged(const std::shared_ptr &conference, @@ -286,7 +286,7 @@ void ConferenceModel::onAudioDeviceChanged(const std::shared_ptrgetCall(); std::shared_ptr params = CoreModel::getInstance()->getCore()->createCallParams(call); - lDebug() << log().arg("Old Layout=%1").arg((int)params->getConferenceVideoLayout()); + lInfo() << log().arg("Old Layout=%1").arg((int)params->getConferenceVideoLayout()); if (params->getConferenceVideoLayout() == linphone::Conference::Layout::Grid && params->videoEnabled()) { params->setConferenceVideoLayout(linphone::Conference::Layout::ActiveSpeaker); } diff --git a/Linphone/model/search/MagicSearchModel.cpp b/Linphone/model/search/MagicSearchModel.cpp index b3687dae5..237d9c9d9 100644 --- a/Linphone/model/search/MagicSearchModel.cpp +++ b/Linphone/model/search/MagicSearchModel.cpp @@ -59,7 +59,11 @@ void MagicSearchModel::search(QString filter, // sourceFlags &= ~(int)LinphoneEnums::MagicSearchSource::ChatRooms; // sourceFlags &= ~(int)LinphoneEnums::MagicSearchSource::ConferencesInfo; } - qInfo() << log().arg("Searching ") << filter << " from " << sourceFlags << " with limit " << maxResults; + if (((sourceFlags & (int)LinphoneEnums::MagicSearchSource::RemoteCardDAV) > 0) && + SettingsModel::getInstance()->getCardDAVMinCharResearch() > filter.size()) { + sourceFlags &= ~(int)LinphoneEnums::MagicSearchSource::RemoteCardDAV; + } + lInfo() << log().arg("Searching ") << filter << " from " << sourceFlags << " with limit " << maxResults; mMonitor->getContactsListAsync(filter != "*" ? Utils::appStringToCoreString(filter) : "", "", sourceFlags, LinphoneEnums::toLinphone(aggregation)); } @@ -80,7 +84,7 @@ void MagicSearchModel::setMaxResults(int maxResults) { void MagicSearchModel::onSearchResultsReceived(const std::shared_ptr &magicSearch) { auto results = magicSearch->getLastSearch(); - qInfo() << log().arg("SDK send callback: onSearchResultsReceived : %1 results.").arg(results.size()); + lInfo() << log().arg("SDK send callback: onSearchResultsReceived : %1 results.").arg(results.size()); auto appFriends = ToolModel::getAppFriendList(); auto ldapFriends = ToolModel::getLdapFriendList(); emit searchResultsReceived(results); diff --git a/Linphone/model/setting/SettingsModel.cpp b/Linphone/model/setting/SettingsModel.cpp index aef127cfd..125cbc6cc 100644 --- a/Linphone/model/setting/SettingsModel.cpp +++ b/Linphone/model/setting/SettingsModel.cpp @@ -156,18 +156,18 @@ void SettingsModel::startCaptureGraph() { // Media cards must not be used twice (capture card + call) else we will get latencies issues and bad echo // calibrations in call. if (!getIsInCall() && !mSimpleCaptureGraph) { - qDebug() << log().arg("Starting capture graph [%1]").arg(mCaptureGraphListenerCount); + lDebug() << log().arg("Starting capture graph [%1]").arg(mCaptureGraphListenerCount); createCaptureGraph(); - } else qDebug() << log().arg("Adding capture graph reference [%1]").arg(mCaptureGraphListenerCount); + } else lDebug() << log().arg("Adding capture graph reference [%1]").arg(mCaptureGraphListenerCount); ++mCaptureGraphListenerCount; } void SettingsModel::stopCaptureGraph() { mustBeInLinphoneThread(log().arg(Q_FUNC_INFO)); if (--mCaptureGraphListenerCount == 0) { - qDebug() << log().arg("Stopping capture graph [%1]").arg(mCaptureGraphListenerCount); + lDebug() << log().arg("Stopping capture graph [%1]").arg(mCaptureGraphListenerCount); deleteCaptureGraph(); } else if (mCaptureGraphListenerCount > 0) - qDebug() << log().arg("Removing capture graph reference [%1]").arg(mCaptureGraphListenerCount); + lDebug() << log().arg("Removing capture graph reference [%1]").arg(mCaptureGraphListenerCount); else qCritical() << log().arg("Removing too much capture graph reference [%1]").arg(mCaptureGraphListenerCount); } diff --git a/Linphone/model/sound-player/SoundPlayerModel.cpp b/Linphone/model/sound-player/SoundPlayerModel.cpp index 28bfba8fe..5e09d9649 100644 --- a/Linphone/model/sound-player/SoundPlayerModel.cpp +++ b/Linphone/model/sound-player/SoundPlayerModel.cpp @@ -82,7 +82,7 @@ bool SoundPlayerModel::play(QString source, bool fromStart) { if (source == "") return false; if (fromStart) stop(); if (!open(source)) { - qWarning() << QStringLiteral("Unable to open: `%1`").arg(source); + lWarning() << QStringLiteral("[SoundPlayerModel] %1 Unable to open: `%2`").arg(Q_FUNC_INFO).arg(source); //: Unable to open: `%1` emit errorChanged(QString("sound_player_open_error").arg(source)); return false; @@ -102,7 +102,7 @@ bool SoundPlayerModel::play(QString source, bool fromStart) { void SoundPlayerModel::seek(QString source, int offset) { if (!open(source)) { - qWarning() << QStringLiteral("Unable to open: `%1`").arg(source); + lWarning() << QStringLiteral("[SoundPlayerModel] %1 Unable to open: `%2`").arg(Q_FUNC_INFO).arg(source); //: Unable to open: `%1` emit errorChanged(QString("sound_player_open_error").arg(source)); return; diff --git a/Linphone/model/tool/ToolModel.cpp b/Linphone/model/tool/ToolModel.cpp index c2e69e783..4ec89f5f7 100644 --- a/Linphone/model/tool/ToolModel.cpp +++ b/Linphone/model/tool/ToolModel.cpp @@ -373,7 +373,7 @@ bool ToolModel::createCall(const QString &sipAddress, */ } -bool ToolModel::createGroupCall(QString subject, const std::list &participantAddresses, QString *message) { +std::shared_ptr ToolModel::createConference(QString subject, QString *message) { auto core = CoreModel::getInstance()->getCore(); auto conferenceParams = core->createConferenceParams(nullptr); conferenceParams->enableVideo(true); @@ -381,7 +381,7 @@ bool ToolModel::createGroupCall(QString subject, const std::list &parti if (!account) { qWarning() << "No default account found, can't create group call"; *message = tr("group_call_error_no_account"); - return false; + return nullptr; } conferenceParams->setAccount(account); conferenceParams->setSubject(Utils::appStringToCoreString(subject)); @@ -392,8 +392,13 @@ bool ToolModel::createGroupCall(QString subject, const std::list &parti conferenceParams->enableChat(true); - auto conference = core->createConferenceWithParams(conferenceParams); + return core->createConferenceWithParams(conferenceParams); +} + +bool ToolModel::createGroupCall(QString subject, const std::list &participantAddresses, QString *message) { + auto conference = createConference(subject, message); if (conference) { + auto core = CoreModel::getInstance()->getCore(); auto callParams = core->createCallParams(nullptr); callParams->enableVideo(true); callParams->setVideoDirection(linphone::MediaDirection::RecvOnly); @@ -409,7 +414,7 @@ bool ToolModel::createGroupCall(QString subject, const std::list &parti } } else { qWarning() << "Could not create group call"; - *message = tr("group_call_error_creation"); + if (message->isEmpty()) *message = tr("group_call_error_creation"); } return conference != nullptr; } @@ -534,7 +539,7 @@ QString ToolModel::getMessageFromContent(std::listgetCore()->reloadMsPlugins(""); qInfo() << QStringLiteral("Finished loading downloaded codecs."); @@ -664,11 +670,11 @@ std::shared_ptr ToolModel::lookupCurrentCallChat(std::shared auto localAddress = call->getCallLog()->getLocalAddress(); std::list> participants; participants.push_back(remoteaddress->clone()); - qDebug() << "Looking for chat with local address" << localAddress->asStringUriOnly() << "and participant" - << remoteaddress->asStringUriOnly(); + lInfo() << "[ToolModel] Looking for chat with local address" << localAddress->asStringUriOnly() + << "and participant" << remoteaddress->asStringUriOnly(); auto existingChat = core->searchChatRoom(params, localAddress, nullptr, participants); - if (existingChat) qDebug() << "Found existing chat"; - else qDebug() << "Did not find existing chat"; + if (existingChat) lInfo() << "[ToolModel] Found existing chat"; + else lInfo() << "[ToolModel] Did not find existing chat"; return existingChat; } } @@ -708,11 +714,11 @@ std::shared_ptr ToolModel::lookupChatForAddress(std::shared_ remoteAddress->clean(); participants.push_back(remoteAddress); - qDebug() << "Looking for chat with local address" << localAddress->asStringUriOnly() << "and participant" - << remoteAddress->asStringUriOnly(); + lInfo() << "Looking for chat with local address" << localAddress->asStringUriOnly() << "and participant" + << remoteAddress->asStringUriOnly(); auto existingChat = core->searchChatRoom(params, localAddress, nullptr, participants); - if (existingChat) qDebug() << "Found existing chat"; - else qDebug() << "Did not find existing chat"; + if (existingChat) lInfo() << "Found existing chat"; + else lInfo() << "Did not find existing chat"; return existingChat; } diff --git a/Linphone/model/tool/ToolModel.hpp b/Linphone/model/tool/ToolModel.hpp index b53d066a4..6cc2924fa 100644 --- a/Linphone/model/tool/ToolModel.hpp +++ b/Linphone/model/tool/ToolModel.hpp @@ -65,6 +65,7 @@ public: linphone::MediaEncryption = linphone::MediaEncryption::None, QString *errorMessage = nullptr); + static std::shared_ptr createConference(QString subject, QString *message = nullptr); static bool createGroupCall(QString subject, const std::list &participantAddresses, QString *message = nullptr); diff --git a/Linphone/tool/Utils.cpp b/Linphone/tool/Utils.cpp index cfa390aa4..4d107e58e 100644 --- a/Linphone/tool/Utils.cpp +++ b/Linphone/tool/Utils.cpp @@ -178,7 +178,7 @@ void Utils::createCall(const QString &sipAddress, if (mediaEncryption == LinphoneEnums::MediaEncryption::None) mediaEncryption = App::getInstance()->getSettings()->getMediaEncryption()["id"].value(); - lDebug() << "[Utils] create call with uri :" << sipAddress << mediaEncryption; + lInfo() << "[Utils] create call with uri :" << sipAddress << mediaEncryption; App::postModelAsync([sipAddress, options, mediaEncryption, prepareTransfertAddress, headers]() { QString errorMessage; bool success = ToolModel::createCall(sipAddress, options, prepareTransfertAddress, headers, @@ -1586,15 +1586,15 @@ VariantObject *Utils::getCurrentCallChat(CallGui *call) { auto chatCore = ChatCore::create(linphoneChatRoom); return QVariant::fromValue(new ChatGui(chatCore)); } else { - qDebug() << "Did not find existing chat room, create one"; + lInfo() << "[Utils] Did not find existing chat room, create one"; linphoneChatRoom = ToolModel::createCurrentCallChat(callModel); if (linphoneChatRoom != nullptr) { - qDebug() << "Chatroom created with" << callModel->getRemoteAddress()->asStringUriOnly(); + lInfo() << "[Utils] Chatroom created with" << callModel->getRemoteAddress()->asStringUriOnly(); auto id = linphoneChatRoom->getIdentifier(); auto chatCore = ChatCore::create(linphoneChatRoom); return QVariant::fromValue(new ChatGui(chatCore)); } else { - qWarning() << "Failed to create 1-1 conversation with" + lWarning() << "[Utils] Failed to create 1-1 conversation with" << callModel->getRemoteAddress()->asStringUriOnly() << "!"; data->mConnection->invokeToCore([] { //: Error @@ -1623,14 +1623,14 @@ VariantObject *Utils::getChatForAddress(QString address) { auto chatCore = ChatCore::create(linphoneChatRoom); return QVariant::fromValue(new ChatGui(chatCore)); } else { - qDebug() << "Did not find existing chat room, create one"; + lInfo() << "[Utils] Did not find existing chat room, create one"; linphoneChatRoom = ToolModel::createChatForAddress(linAddr); if (linphoneChatRoom != nullptr) { - qDebug() << "Chatroom created with" << linAddr->asStringUriOnly(); + lInfo() << "[Utils] Chatroom created with" << linAddr->asStringUriOnly(); auto chatCore = ChatCore::create(linphoneChatRoom); return QVariant::fromValue(new ChatGui(chatCore)); } else { - qWarning() << "Failed to create 1-1 conversation with" << linAddr->asStringUriOnly() << "!"; + lWarning() << "[Utils] Failed to create 1-1 conversation with" << linAddr->asStringUriOnly() << "!"; //: Failed to create 1-1 conversation with %1 ! data->mConnection->invokeToCore([] { showInformationPopup(tr("information_popup_error_title"), diff --git a/Linphone/tool/accessibility/KeyboardShortcuts.cpp b/Linphone/tool/accessibility/KeyboardShortcuts.cpp index 5e509c611..b8d681385 100644 --- a/Linphone/tool/accessibility/KeyboardShortcuts.cpp +++ b/Linphone/tool/accessibility/KeyboardShortcuts.cpp @@ -70,7 +70,7 @@ void KeyboardShortcuts::onAcceptCallShortcut() { auto callList = App::getInstance()->getCallList(); auto currentPendingCall = callList->getFirstIncommingPendingCall(); if (!currentPendingCall.isNull()) { - lDebug() << "Accept call with shortcut :" << currentPendingCall; + lInfo() << "Accept call with shortcut :" << currentPendingCall; auto gui = new CallGui(currentPendingCall); Utils::openCallsWindow(gui); currentPendingCall->lAccept(false); @@ -82,7 +82,7 @@ void KeyboardShortcuts::onDeclineCallShortcut() { auto callList = App::getInstance()->getCallList(); auto currentPendingCall = callList->getFirstIncommingPendingCall(); if (!currentPendingCall.isNull()) { - lDebug() << "Dcline call with shortcut :" << currentPendingCall; + lInfo() << "Decline call with shortcut :" << currentPendingCall; currentPendingCall->lDecline(); } } \ No newline at end of file diff --git a/Linphone/tool/file/FileDownloader.cpp b/Linphone/tool/file/FileDownloader.cpp index b6ced2a30..4f6092c0e 100644 --- a/Linphone/tool/file/FileDownloader.cpp +++ b/Linphone/tool/file/FileDownloader.cpp @@ -26,6 +26,8 @@ #include "FileDownloader.hpp" +DEFINE_ABSTRACT_OBJECT(FileDownloader) + // ============================================================================= static QString getDownloadFilePath(const QString &folder, const QUrl &url, const bool &overwrite) { @@ -63,7 +65,7 @@ static bool isHttpRedirect(QNetworkReply *reply) { void FileDownloader::download() { if (mDownloading) { - qWarning() << "Unable to download file. Already downloading!"; + lWarning() << log().arg("Unable to download file. Already downloading!"); return; } setDownloading(true); @@ -102,7 +104,8 @@ bool FileDownloader::remove() { } void FileDownloader::emitOutputError() { - qWarning() << QStringLiteral("Could not write into `%1` (%2).") + lWarning() << log() + .arg("Could not write into `%1` (%2).") .arg(mDestinationFile.fileName()) .arg(mDestinationFile.errorString()); mNetworkReply->abort(); @@ -123,18 +126,18 @@ void FileDownloader::handleDownloadFinished() { if (mNetworkReply->error() != QNetworkReply::NoError) return; if (isHttpRedirect(mNetworkReply)) { - qWarning() << QStringLiteral("Request was redirected."); + lWarning() << log().arg("Request was redirected."); mDestinationFile.remove(); cleanDownloadEnd(); emit downloadFailed(); } else { - qInfo() << QStringLiteral("Download of %1 finished to %2").arg(mUrl.toString(), mDestinationFile.fileName()); + lInfo() << log().arg("Download of %1 finished to %2").arg(mUrl.toString(), mDestinationFile.fileName()); mDestinationFile.close(); cleanDownloadEnd(); QString fileChecksum = Utils::getFileChecksum(mDestinationFile.fileName()); if (mCheckSum.isEmpty() || fileChecksum == mCheckSum) emit downloadFinished(mDestinationFile.fileName()); else { - qCritical() << "File cannot be downloaded : Bad checksum " << fileChecksum; + lCritical() << log().arg("File cannot be downloaded : Bad checksum ") << fileChecksum; mDestinationFile.remove(); emit downloadFailed(); } @@ -143,8 +146,7 @@ void FileDownloader::handleDownloadFinished() { void FileDownloader::handleError(QNetworkReply::NetworkError code) { if (code != QNetworkReply::OperationCanceledError) - qWarning() - << QStringLiteral("Download of %1 failed: %2").arg(mUrl.toString()).arg(mNetworkReply->errorString()); + lWarning() << log().arg("Download of %1 failed: %2").arg(mUrl.toString()).arg(mNetworkReply->errorString()); mDestinationFile.remove(); cleanDownloadEnd(); @@ -155,7 +157,7 @@ void FileDownloader::handleError(QNetworkReply::NetworkError code) { void FileDownloader::handleSslErrors(const QList &sslErrors) { #if QT_CONFIG(ssl) for (const QSslError &error : sslErrors) - qWarning() << QStringLiteral("SSL error: %1").arg(error.errorString()); + lWarning() << log().arg("SSL error: %1").arg(error.errorString()); #else Q_UNUSED(sslErrors); #endif @@ -163,7 +165,7 @@ void FileDownloader::handleSslErrors(const QList &sslErrors) { void FileDownloader::handleTimeout() { if (mReadBytes == mTimeoutReadBytes) { - qWarning() << QStringLiteral("Download of %1 failed: timeout.").arg(mUrl.toString()); + lWarning() << log().arg("Download of %1 failed: timeout.").arg(mUrl.toString()); mNetworkReply->abort(); } else mTimeoutReadBytes = mReadBytes; } @@ -181,15 +183,16 @@ QUrl FileDownloader::getUrl() const { void FileDownloader::setUrl(const QUrl &url) { if (mDownloading) { - qWarning() << QStringLiteral("Unable to set url, a file is downloading."); + lWarning() << log().arg("Unable to set url, a file is downloading."); return; } if (mUrl != url) { mUrl = url; if (!QSslSocket::supportsSsl() && mUrl.scheme() == "https") { - qWarning() << "Https has been requested but SSL is not supported. Fallback to http. Install manually " - "OpenSSL libraries in your PATH."; + lWarning() << log().arg( + "Https has been requested but SSL is not supported. Fallback to http. Install manually " + "OpenSSL libraries in your PATH."); mUrl.setScheme("http"); } emit urlChanged(mUrl); @@ -202,7 +205,7 @@ QString FileDownloader::getDownloadFolder() const { void FileDownloader::setDownloadFolder(const QString &downloadFolder) { if (mDownloading) { - qWarning() << QStringLiteral("Unable to set download folder, a file is downloading."); + lWarning() << log().arg("Unable to set download folder, a file is downloading."); return; } @@ -224,7 +227,7 @@ QString FileDownloader::synchronousDownload(const QUrl &url, const QString &destinationFolder, const bool &overwriteFile) { QString filePath; FileDownloader downloader; - if (url.isRelative()) qWarning() << "FileDownloader: The specified URL is not valid"; + if (url.isRelative()) lWarning() << QStringLiteral("FileDownloader: The specified URL is not valid"); else { bool isOver = false; bool *pIsOver = &isOver; @@ -238,7 +241,7 @@ FileDownloader::synchronousDownload(const QUrl &url, const QString &destinationF filePath = downloader.getDestinationFileName(); if (!QFile::exists(filePath)) { filePath = ""; - qWarning() << "FileDownloader: Cannot download the specified file"; + lWarning() << QStringLiteral("FileDownloader: Cannot download the specified file"); } } } diff --git a/Linphone/tool/file/FileDownloader.hpp b/Linphone/tool/file/FileDownloader.hpp index 35f1cce43..d6b13b56d 100644 --- a/Linphone/tool/file/FileDownloader.hpp +++ b/Linphone/tool/file/FileDownloader.hpp @@ -21,6 +21,8 @@ #ifndef FILE_DOWNLOADER_H_ #define FILE_DOWNLOADER_H_ +#include "tool/AbstractObject.hpp" + #include #include #include @@ -29,7 +31,7 @@ class QSslError; -class FileDownloader : public QObject { +class FileDownloader : public QObject, public AbstractObject { Q_OBJECT; // TODO: Add an error property to use in UI. @@ -121,6 +123,8 @@ private: QTimer mTimeout; static constexpr int DefaultTimeout = 5000; + + DECLARE_ABSTRACT_OBJECT }; #endif // FILE_DOWNLOADER_H_ diff --git a/Linphone/tool/file/FileExtractor.cpp b/Linphone/tool/file/FileExtractor.cpp index 714817832..828694dd9 100644 --- a/Linphone/tool/file/FileExtractor.cpp +++ b/Linphone/tool/file/FileExtractor.cpp @@ -29,6 +29,8 @@ #include "tool/Constants.hpp" #include "tool/Utils.hpp" +DEFINE_ABSTRACT_OBJECT(FileExtractor) + // ============================================================================= using namespace std; @@ -41,7 +43,7 @@ FileExtractor::~FileExtractor() { void FileExtractor::extract() { if (mExtracting) { - qWarning() << "Unable to extract file. Already extracting!"; + lWarning() << log().arg("Unable to extract file. Already extracting!"); return; } setExtracting(true); @@ -117,7 +119,7 @@ QString FileExtractor::getFile() const { void FileExtractor::setFile(const QString &file) { if (mExtracting) { - qWarning() << QStringLiteral("Unable to set file, a file is extracting."); + lWarning() << log().arg("Unable to set file, a file is extracting."); return; } if (mFile != file) { @@ -132,7 +134,7 @@ QString FileExtractor::getExtractFolder() const { void FileExtractor::setExtractFolder(const QString &extractFolder) { if (mExtracting) { - qWarning() << QStringLiteral("Unable to set extract folder, a file is extracting."); + lWarning() << log().arg("Unable to set extract folder, a file is extracting."); return; } if (mExtractFolder != extractFolder) { diff --git a/Linphone/tool/file/FileExtractor.hpp b/Linphone/tool/file/FileExtractor.hpp index 7c28ddcdf..89a84ba3b 100644 --- a/Linphone/tool/file/FileExtractor.hpp +++ b/Linphone/tool/file/FileExtractor.hpp @@ -21,6 +21,8 @@ #ifndef FILE_EXTRACTOR_H_ #define FILE_EXTRACTOR_H_ +#include "tool/AbstractObject.hpp" + #include // ============================================================================= @@ -28,7 +30,7 @@ class QTimer; // Supports only bzip file. -class FileExtractor : public QObject { +class FileExtractor : public QObject, public AbstractObject { Q_OBJECT; @@ -99,6 +101,8 @@ private: qint64 mTotalBytes = 0; QTimer *mTimer = nullptr; + + DECLARE_ABSTRACT_OBJECT }; #endif // FILE_EXTRACTOR_H_ diff --git a/Linphone/view/Control/Button/Button.qml b/Linphone/view/Control/Button/Button.qml index 09d53d333..f29cc86c5 100644 --- a/Linphone/view/Control/Button/Button.qml +++ b/Linphone/view/Control/Button/Button.qml @@ -56,7 +56,7 @@ Control.Button { property var checkedImageColor: style?.image?.checked || Qt.darker(contentImageColor, 1.1) property var pressedImageColor: style?.image?.pressed || Qt.darker(contentImageColor, 1.1) icon.source: style?.iconSource || "" - property color colorizationColor: mainItem.checkable && mainItem.checked ? mainItem.checkedImageColor || mainItem.checkedColor || mainItem.pressedColor : mainItem.pressed ? mainItem.pressedImageColor : mainItem.hovered ? mainItem.hoveredImageColor : mainItem.contentImageColor + property color colorizationColor: mainItem.checkable && mainItem.checked ? mainItem.checkedImageColor : mainItem.pressed ? mainItem.pressedImageColor : mainItem.hovered ? mainItem.hoveredImageColor : mainItem.contentImageColor // Size properties spacing: Utils.getSizeWithScreenRatio(5) property real radius: Math.ceil(height / 2) diff --git a/Linphone/view/Control/Container/Call/CallHistoryLayout.qml b/Linphone/view/Control/Container/Call/CallHistoryLayout.qml index cd67b8fe4..f7c367636 100644 --- a/Linphone/view/Control/Container/Call/CallHistoryLayout.qml +++ b/Linphone/view/Control/Container/Call/CallHistoryLayout.qml @@ -104,27 +104,27 @@ ColumnLayout { } } } + MediumButton { + visible: mainItem.isConference && !SettingsCpp.disableMeetingsFeature + Layout.alignment: Qt.AlignHCenter + //: "Rejoindre la réunion" + text: qsTr("meeting_info_join_title") + style: ButtonStyle.grey + onClicked: { + if (mainItem.conferenceInfo) { + var callsWindow = UtilsCpp.getCallsWindow() + callsWindow.setupConference(mainItem.conferenceInfo) + UtilsCpp.smartShowWindow(callsWindow) + } + } + } RowLayout { Layout.alignment: Qt.AlignHCenter spacing: Math.round(72 * DefaultStyle.dp) Layout.fillWidth: true Layout.preferredHeight: childrenRect.height - MediumButton { - visible: mainItem.isConference && !SettingsCpp.disableMeetingsFeature - Layout.alignment: Qt.AlignHCenter - //: "Rejoindre la réunion" - text: qsTr("meeting_info_join_title") - style: ButtonStyle.grey - onClicked: { - if (mainItem.conferenceInfo) { - var callsWindow = UtilsCpp.getCallsWindow() - callsWindow.setupConference(mainItem.conferenceInfo) - UtilsCpp.smartShowWindow(callsWindow) - } - } - } + visible: !mainItem.isConference LabelButton { - visible: !mainItem.isConference width: Math.round(56 * DefaultStyle.dp) height: Math.round(56 * DefaultStyle.dp) button.icon.width: Math.round(24 * DefaultStyle.dp) @@ -138,7 +138,7 @@ ColumnLayout { } } LabelButton { - visible: !mainItem.isConference && !SettingsCpp.disableChatFeature + visible: !SettingsCpp.disableChatFeature width: Math.round(56 * DefaultStyle.dp) height: Math.round(56 * DefaultStyle.dp) button.icon.width: Math.round(24 * DefaultStyle.dp) @@ -158,7 +158,7 @@ ColumnLayout { } } LabelButton { - visible: !mainItem.isConference && SettingsCpp.videoEnabled + visible: SettingsCpp.videoEnabled width: Math.round(56 * DefaultStyle.dp) height: Math.round(56 * DefaultStyle.dp) button.icon.width: Math.round(24 * DefaultStyle.dp) diff --git a/Linphone/view/Control/Display/Call/CallListView.qml b/Linphone/view/Control/Display/Call/CallListView.qml index ffacb2915..e2451a032 100644 --- a/Linphone/view/Control/Display/Call/CallListView.qml +++ b/Linphone/view/Control/Display/Call/CallListView.qml @@ -4,6 +4,7 @@ import QtQuick.Effects import Linphone import QtQml +import SettingsCpp import UtilsCpp 1.0 import 'qrc:/qt/qml/Linphone/view/Style/buttonStyle.js' as ButtonStyle @@ -29,7 +30,11 @@ ListView { width: mainItem.width height: Math.round(45 * DefaultStyle.dp) property var remoteNameObj: UtilsCpp.getDisplayName(modelData.core.remoteAddress) - property var callName : modelData.core.isConference ? modelData.core.conference.core.subject : remoteNameObj ? remoteNameObj.value : "" + property var callName : (modelData && !SettingsCpp.disableMeetingsFeature && modelData.core.isConference) + ? modelData.core.conference.core.subject + : remoteNameObj + ? remoteNameObj.value + : "" Avatar { id: delegateAvatar Layout.preferredWidth: Math.round(45 * DefaultStyle.dp) @@ -43,7 +48,6 @@ ListView { spacing: 0 Text { id: delegateName - property var remoteNameObj: UtilsCpp.getDisplayName(modelData.core.remoteAddress) text: callInformationItem.callName font.pixelSize: Math.round(14 * DefaultStyle.dp) Layout.fillWidth: true diff --git a/Linphone/view/Control/Display/Chat/ChatMessage.qml b/Linphone/view/Control/Display/Chat/ChatMessage.qml index 93cd2ec8f..cfe29c7df 100644 --- a/Linphone/view/Control/Display/Chat/ChatMessage.qml +++ b/Linphone/view/Control/Display/Chat/ChatMessage.qml @@ -27,9 +27,9 @@ Control.Control { property var msgState: chatMessage ? chatMessage.core.messageState : LinphoneEnums.ChatMessageState.StateIdle hoverEnabled: true property bool linkHovered: false - property real maxWidth: parent?.width || Math.round(300 * DefaultStyle.dp) + property real maxWidth: parent?.width || Utils.getSizeWithScreenRatio(300) - leftPadding: isRemoteMessage ? Math.round(5 * DefaultStyle.dp) : 0 + leftPadding: isRemoteMessage ? Utils.getSizeWithScreenRatio(5) : 0 signal messageDeletionRequested() signal isFileHoveringChanged(bool isFileHovering) @@ -63,11 +63,11 @@ Control.Control { } contentItem: ColumnLayout { - spacing: Math.round(5 * DefaultStyle.dp) + spacing: Utils.getSizeWithScreenRatio(5) Text { id: fromNameText Layout.alignment: Qt.AlignTop - Layout.leftMargin: mainItem.isFromChatGroup ? Math.round(9 * DefaultStyle.dp) + avatar.width : 0 + Layout.leftMargin: mainItem.isFromChatGroup ? Utils.getSizeWithScreenRatio(9) + avatar.width : 0 visible: mainItem.isFromChatGroup && mainItem.isRemoteMessage && mainItem.isFirstMessage && !replyLayout.visible maximumLineCount: 1 width: implicitWidth @@ -81,15 +81,15 @@ Control.Control { } RowLayout { id: forwardLayout - spacing: Math.round(8 * DefaultStyle.dp) + spacing: Utils.getSizeWithScreenRatio(8) visible: mainItem.isForward - Layout.leftMargin: mainItem.isFromChatGroup ? Math.round(9 * DefaultStyle.dp) + avatar.width : 0 + Layout.leftMargin: mainItem.isFromChatGroup ? Utils.getSizeWithScreenRatio(9) + avatar.width : 0 Layout.alignment: mainItem.isRemoteMessage ? Qt.AlignLeft: Qt.AlignRight EffectImage { imageSource: AppIcons.forward colorizationColor: DefaultStyle.main2_500_main - Layout.preferredWidth: Math.round(12 * DefaultStyle.dp) - Layout.preferredHeight: Math.round(12 * DefaultStyle.dp) + Layout.preferredWidth: Utils.getSizeWithScreenRatio(12) + Layout.preferredHeight: Utils.getSizeWithScreenRatio(12) } Text { //: Forwarded @@ -104,20 +104,20 @@ Control.Control { RowLayout { id: replyLayout visible: mainItem.isReply - Layout.leftMargin: mainItem.isFromChatGroup ? Math.round(9 * DefaultStyle.dp) + avatar.width : 0 + Layout.leftMargin: mainItem.isFromChatGroup ? Utils.getSizeWithScreenRatio(9) + avatar.width : 0 layoutDirection: mainItem.isRemoteMessage ? Qt.LeftToRight : Qt.RightToLeft ColumnLayout { - spacing: Math.round(5 * DefaultStyle.dp) + spacing: Utils.getSizeWithScreenRatio(5) RowLayout { id: replyLabel - spacing: Math.round(8 * DefaultStyle.dp) + spacing: Utils.getSizeWithScreenRatio(8) Layout.fillWidth: false Layout.alignment: mainItem.isRemoteMessage ? Qt.AlignLeft : Qt.AlignRight EffectImage { imageSource: AppIcons.reply colorizationColor: DefaultStyle.main2_500_main - Layout.preferredWidth: Math.round(12 * DefaultStyle.dp) - Layout.preferredHeight: Math.round(12 * DefaultStyle.dp) + Layout.preferredWidth: Utils.getSizeWithScreenRatio(12) + Layout.preferredHeight: Utils.getSizeWithScreenRatio(12) } Text { Layout.alignment: mainItem.isRemoteMessage ? Qt.AlignLeft: Qt.AlignRight @@ -143,16 +143,16 @@ Control.Control { id: replyMessage visible: mainItem.replyText !== "" Layout.alignment: mainItem.isRemoteMessage ? Qt.AlignLeft : Qt.AlignRight - spacing: Math.round(5 * DefaultStyle.dp) - topPadding: Math.round(12 * DefaultStyle.dp) - bottomPadding: Math.round(19 * DefaultStyle.dp) - leftPadding: Math.round(18 * DefaultStyle.dp) - rightPadding: Math.round(18 * DefaultStyle.dp) + spacing: Utils.getSizeWithScreenRatio(5) + topPadding: Utils.getSizeWithScreenRatio(12) + bottomPadding: Utils.getSizeWithScreenRatio(19) + leftPadding: Utils.getSizeWithScreenRatio(18) + rightPadding: Utils.getSizeWithScreenRatio(18) Layout.preferredWidth: Math.min(implicitWidth, mainItem.maxWidth - avatar.implicitWidth) background: Rectangle { anchors.fill: parent color: DefaultStyle.grey_200 - radius: Math.round(16 * DefaultStyle.dp) + radius: Utils.getSizeWithScreenRatio(16) } contentItem: Text { Layout.fillWidth: true @@ -172,30 +172,30 @@ Control.Control { z: replyLayout.z + 1 spacing: 0 layoutDirection: mainItem.isRemoteMessage ? Qt.LeftToRight : Qt.RightToLeft - Layout.topMargin: replyMessage.visible ? Math.round(-20 * DefaultStyle.dp) : 0 + Layout.topMargin: replyMessage.visible ? Utils.getSizeWithScreenRatio(-20) : 0 Avatar { id: avatar visible: mainItem.isFromChatGroup && mainItem.isRemoteMessage - Layout.preferredWidth: mainItem.isRemoteMessage ? 26 * DefaultStyle.dp : 0 - Layout.preferredHeight: 26 * DefaultStyle.dp + Layout.preferredWidth: mainItem.isRemoteMessage ? 26 : 0 + Layout.preferredHeight: 26 Layout.alignment: Qt.AlignTop _address: chatMessage ? chatMessage.core.fromAddress : "" } Item { id: bubbleContainer - // Layout.topMargin: isFirstMessage ? 16 * DefaultStyle.dp : 0 - Layout.leftMargin: mainItem.isFromChatGroup ? Math.round(9 * DefaultStyle.dp) : 0 + // Layout.topMargin: isFirstMessage ? 16 : 0 + Layout.leftMargin: mainItem.isFromChatGroup ? Utils.getSizeWithScreenRatio(9) : 0 Layout.preferredHeight: childrenRect.height Layout.preferredWidth: childrenRect.width Control.Control { id: chatBubble - spacing: Math.round(2 * DefaultStyle.dp) - topPadding: Math.round(12 * DefaultStyle.dp) - bottomPadding: Math.round(6 * DefaultStyle.dp) - leftPadding: Math.round(18 * DefaultStyle.dp) - rightPadding: Math.round(18 * DefaultStyle.dp) + spacing: Utils.getSizeWithScreenRatio(2) + topPadding: Utils.getSizeWithScreenRatio(12) + bottomPadding: Utils.getSizeWithScreenRatio(6) + leftPadding: Utils.getSizeWithScreenRatio(18) + rightPadding: Utils.getSizeWithScreenRatio(18) width: Math.min(implicitWidth, mainItem.maxWidth - avatar.implicitWidth) MouseArea { // Default mouse area. Each sub bubble can control the mouse and pass on to the main mouse handler. Child bubble mouse area must cover the entire bubble. @@ -211,31 +211,31 @@ Control.Control { Rectangle { anchors.fill: parent color: mainItem.backgroundColor - radius: Math.round(16 * DefaultStyle.dp) + radius: Utils.getSizeWithScreenRatio(16) } Rectangle { visible: mainItem.isFirstMessage && mainItem.isRemoteMessage anchors.top: parent.top anchors.left: parent.left - width: Math.round(parent.width / 4) - height: Math.round(parent.height / 4) + width: Utils.getSizeWithScreenRatio(parent.width / 4) + height: Utils.getSizeWithScreenRatio(parent.height / 4) color: mainItem.backgroundColor } Rectangle { visible: mainItem.isFirstMessage && !mainItem.isRemoteMessage anchors.bottom: parent.bottom anchors.right: parent.right - width: Math.round(parent.width / 4) - height: Math.round(parent.height / 4) + width: Utils.getSizeWithScreenRatio(parent.width / 4) + height: Utils.getSizeWithScreenRatio(parent.height / 4) color: mainItem.backgroundColor } Rectangle { id: highlightRectangle anchors.fill: parent - radius: Math.round(16 * DefaultStyle.dp) + radius: Utils.getSizeWithScreenRatio(16) color: Qt.lighter(mainItem.backgroundColor, 2) border.color: mainItem.backgroundColor - border.width: Math.round(2 * DefaultStyle.dp) + border.width: Utils.getSizeWithScreenRatio(2) opacity: 0 Behavior on opacity { NumberAnimation { @@ -246,7 +246,7 @@ Control.Control { } } contentItem: ColumnLayout { - spacing: Math.round(5 * DefaultStyle.dp) + spacing: Utils.getSizeWithScreenRatio(5) ChatMessageContent { id: chatBubbleContent Layout.fillWidth: true @@ -263,9 +263,9 @@ Control.Control { Layout.preferredHeight: childrenRect.height Layout.alignment: mainItem.isRemoteMessage ? Qt.AlignLeft : Qt.AlignRight layoutDirection: mainItem.isRemoteMessage ? Qt.RightToLeft : Qt.LeftToRight - spacing: Math.round(7 * DefaultStyle.dp) + spacing: Utils.getSizeWithScreenRatio(7) RowLayout { - spacing: Math.round(3 * DefaultStyle.dp) + spacing: Utils.getSizeWithScreenRatio(3) Layout.preferredHeight: childrenRect.height Text { id: ephemeralTime @@ -281,12 +281,12 @@ Control.Control { visible: mainItem.chatMessage.core.isEphemeral imageSource: AppIcons.clockCountDown colorizationColor: DefaultStyle.main2_500_main - Layout.preferredWidth: visible ? 14 * DefaultStyle.dp : 0 - Layout.preferredHeight: visible ? 14 * DefaultStyle.dp : 0 + Layout.preferredWidth: visible ? 14 : 0 + Layout.preferredHeight: visible ? 14 : 0 } } RowLayout { - spacing: mainItem.isRemoteMessage ? 0 : Math.round(5 * DefaultStyle.dp) + spacing: mainItem.isRemoteMessage ? 0 : Utils.getSizeWithScreenRatio(5) Layout.alignment: Qt.AlignVCenter Layout.preferredHeight: childrenRect.height Text { @@ -301,8 +301,8 @@ Control.Control { EffectImage { // Imdn status icon visible: !mainItem.isRemoteMessage - Layout.preferredWidth: visible ? 14 * DefaultStyle.dp : 0 - Layout.preferredHeight: visible ? 14 * DefaultStyle.dp : 0 + Layout.preferredWidth: visible ? 14 : 0 + Layout.preferredHeight: visible ? 14 : 0 Layout.alignment: Qt.AlignVCenter colorizationColor: DefaultStyle.main1_500_main imageSource: mainItem.msgState === LinphoneEnums.ChatMessageState.StateDelivered @@ -318,8 +318,8 @@ Control.Control { : "" BusyIndicator { anchors.fill: parent - Layout.preferredWidth: visible ? 14 * DefaultStyle.dp : 0 - Layout.preferredHeight: visible ? 14 * DefaultStyle.dp : 0 + Layout.preferredWidth: visible ? 14 : 0 + Layout.preferredHeight: visible ? 14 : 0 visible: mainItem.msgState === LinphoneEnums.ChatMessageState.StateIdle || mainItem.msgState === LinphoneEnums.ChatMessageState.StateInProgress || mainItem.msgState === LinphoneEnums.ChatMessageState.StateFileTransferInProgress @@ -346,30 +346,30 @@ Control.Control { value: chatBubble.right } onClicked: mainItem.showReactionsForMessageRequested() - anchors.topMargin: Math.round(-6 * DefaultStyle.dp) - topPadding: Math.round(8 * DefaultStyle.dp) - bottomPadding: Math.round(8 * DefaultStyle.dp) - leftPadding: Math.round(8 * DefaultStyle.dp) - rightPadding: Math.round(8 * DefaultStyle.dp) + anchors.topMargin: Utils.getSizeWithScreenRatio(-6) + topPadding: Utils.getSizeWithScreenRatio(8) + bottomPadding: Utils.getSizeWithScreenRatio(8) + leftPadding: Utils.getSizeWithScreenRatio(8) + rightPadding: Utils.getSizeWithScreenRatio(8) background: Rectangle { color: DefaultStyle.grey_100 border.color: DefaultStyle.grey_0 - border.width: Math.round(2 * DefaultStyle.dp) - radius: Math.round(20 * DefaultStyle.dp) + border.width: Utils.getSizeWithScreenRatio(2) + radius: Utils.getSizeWithScreenRatio(20) } contentItem: RowLayout { - spacing: Math.round(6 * DefaultStyle.dp) + spacing: Utils.getSizeWithScreenRatio(6) Repeater { id: reactionList model: mainItem.chatMessage ? mainItem.chatMessage.core.reactionsSingleton : [] delegate: RowLayout { - spacing: Math.round(3 * DefaultStyle.dp) + spacing: Utils.getSizeWithScreenRatio(3) Text { text: UtilsCpp.encodeEmojiToQmlRichFormat(modelData.body) textFormat: Text.RichText font { - pixelSize: Math.round(15 * DefaultStyle.dp) - weight: Math.round(400 * DefaultStyle.dp) + pixelSize: Utils.getSizeWithScreenRatio(15) + weight: Utils.getSizeWithScreenRatio(400) } } Text { @@ -389,11 +389,11 @@ Control.Control { RowLayout { id: actionsLayout visible: mainItem.hovered || optionsMenu.hovered || optionsMenu.popup.opened || emojiButton.hovered || emojiButton.popup.opened - Layout.leftMargin: Math.round(8 * DefaultStyle.dp) - Layout.rightMargin: Math.round(8 * DefaultStyle.dp) + Layout.leftMargin: Utils.getSizeWithScreenRatio(8) + Layout.rightMargin: Utils.getSizeWithScreenRatio(8) Layout.alignment: Qt.AlignVCenter // Layout.fillWidth: true - spacing: Math.round(7 * DefaultStyle.dp) + spacing: Utils.getSizeWithScreenRatio(7) layoutDirection: mainItem.isRemoteMessage ? Qt.LeftToRight : Qt.RightToLeft PopupButton { id: optionsMenu @@ -406,7 +406,7 @@ Control.Control { text: qsTr("chat_message_reception_info") icon.source: AppIcons.chatTeardropText Layout.fillWidth: true - Layout.preferredHeight: Math.round(45 * DefaultStyle.dp) + Layout.preferredHeight: Utils.getSizeWithScreenRatio(45) onClicked: { mainItem.showImdnStatusForMessageRequested() optionsMenu.close() @@ -418,7 +418,7 @@ Control.Control { text: qsTr("chat_message_reply") icon.source: AppIcons.reply Layout.fillWidth: true - Layout.preferredHeight: Math.round(45 * DefaultStyle.dp) + Layout.preferredHeight: Utils.getSizeWithScreenRatio(45) onClicked: { mainItem.replyToMessageRequested() optionsMenu.close() @@ -432,9 +432,9 @@ Control.Control { //: "Copy" : qsTr("chat_message_copy") icon.source: AppIcons.copy - // spacing: Math.round(10 * DefaultStyle.dp) + // spacing: Utils.getSizeWithScreenRatio(10) Layout.fillWidth: true - Layout.preferredHeight: Math.round(45 * DefaultStyle.dp) + Layout.preferredHeight: Utils.getSizeWithScreenRatio(45) onClicked: { var success = UtilsCpp.copyToClipboard(chatBubbleContent.selectedText != "" ? chatBubbleContent.selectedText : mainItem.chatMessage.core.text) //: Copied @@ -450,7 +450,7 @@ Control.Control { text: qsTr("chat_message_forward") icon.source: AppIcons.forward Layout.fillWidth: true - Layout.preferredHeight: Math.round(45 * DefaultStyle.dp) + Layout.preferredHeight: Utils.getSizeWithScreenRatio(45) onClicked: { mainItem.forwardMessageRequested() optionsMenu.close() @@ -458,7 +458,7 @@ Control.Control { } Rectangle { Layout.fillWidth: true - Layout.preferredHeight: Math.min(1, Math.round(1 * DefaultStyle.dp)) + Layout.preferredHeight: Math.min(1, Utils.getSizeWithScreenRatio(1)) color: DefaultStyle.main2_400 } IconLabelButton { @@ -466,9 +466,9 @@ Control.Control { //: "Delete" text: qsTr("chat_message_delete") icon.source: AppIcons.trashCan - // spacing: Math.round(10 * DefaultStyle.dp) + // spacing: Utils.getSizeWithScreenRatio(10) Layout.fillWidth: true - Layout.preferredHeight: Math.round(45 * DefaultStyle.dp) + Layout.preferredHeight: Utils.getSizeWithScreenRatio(45) onClicked: { mainItem.messageDeletionRequested() optionsMenu.close() @@ -504,8 +504,8 @@ Control.Control { PopupButton { id: emojiPickerButton icon.source: AppIcons.plusCircle - popup.width: Math.round(393 * DefaultStyle.dp) - popup.height: Math.round(291 * DefaultStyle.dp) + popup.width: Utils.getSizeWithScreenRatio(393) + popup.height: Utils.getSizeWithScreenRatio(291) popup.contentItem: EmojiPicker { id: emojiPicker onEmojiClicked: (emoji) => { diff --git a/Linphone/view/Control/Display/Chat/Emoji/EmojiPicker.qml b/Linphone/view/Control/Display/Chat/Emoji/EmojiPicker.qml index 174990a86..8b6b96808 100644 --- a/Linphone/view/Control/Display/Chat/Emoji/EmojiPicker.qml +++ b/Linphone/view/Control/Display/Chat/Emoji/EmojiPicker.qml @@ -157,6 +157,7 @@ ColumnLayout { id: list width: mainItem.width height: Math.round(250 * DefaultStyle.dp) + Layout.fillWidth: true Layout.fillHeight: true model: mainItem.categories spacing: Math.round(30 * DefaultStyle.dp) diff --git a/Linphone/view/Control/Input/Chat/ChatDroppableTextArea.qml b/Linphone/view/Control/Input/Chat/ChatDroppableTextArea.qml index 03a483ddb..274f453f0 100644 --- a/Linphone/view/Control/Input/Chat/ChatDroppableTextArea.qml +++ b/Linphone/view/Control/Input/Chat/ChatDroppableTextArea.qml @@ -16,7 +16,6 @@ Control.Control { property var textArea property int selectedFilesCount: 0 // property alias cursorPosition: sendingTextArea.cursorPosition - property Popup emojiPicker property bool dropEnabled: true property bool isEphemeral : false @@ -77,14 +76,14 @@ Control.Control { id: textAreaComp RowLayout { spacing: Math.round(16 * DefaultStyle.dp) - BigButton { + PopupButton { id: emojiPickerButton style: ButtonStyle.noBackground - checked: mainItem.emojiPicker?.visible || false icon.source: checked ? AppIcons.closeX : AppIcons.smiley - onPressed: { - if (!checked) mainItem.emojiPicker.open() - else mainItem.emojiPicker.close() + popup.width: Math.round(393 * DefaultStyle.dp) + popup.height: Math.round(291 * DefaultStyle.dp) + popup.contentItem: EmojiPicker { + editor: sendingTextArea } } BigButton { @@ -121,7 +120,9 @@ Control.Control { id: sendingAreaFlickable Layout.preferredHeight: Math.min(Math.round(100 * DefaultStyle.dp), contentHeight) Layout.fillHeight: true + width: sendingControl.width - sendingControl.leftPadding - sendingControl.rightPadding Layout.fillWidth: true + Layout.alignment: Qt.AlignCenter contentHeight: sendingTextArea.contentHeight contentWidth: width @@ -138,8 +139,9 @@ Control.Control { TextArea { id: sendingTextArea + // RectangleTest{anchors.fill: parent} width: sendingAreaFlickable.width - height: sendingAreaFlickable.height + height: implicitHeight// sendingAreaFlickable.height textFormat: TextEdit.AutoText onTextChanged: { mainItem.text = text @@ -180,6 +182,7 @@ Control.Control { RowLayout { id: stackButton spacing: 0 + Layout.preferredHeight: Math.max(recordButton.height, sendMessageButton.height) BigButton { id: recordButton ToolTip.visible: !enabled && hovered @@ -196,6 +199,7 @@ Control.Control { } BigButton { id: sendMessageButton + Layout.preferredHeight: height visible: sendingTextArea.text.length !== 0 || mainItem.selectedFilesCount > 0 style: ButtonStyle.noBackgroundOrange icon.source: AppIcons.paperPlaneRight diff --git a/Linphone/view/Control/Tool/Helper/utils.js b/Linphone/view/Control/Tool/Helper/utils.js index 31cb2a088..d1c1d0cd5 100644 --- a/Linphone/view/Control/Tool/Helper/utils.js +++ b/Linphone/view/Control/Tool/Helper/utils.js @@ -874,5 +874,7 @@ function getSizeWithScreenRatio(size){ if (size == 0) { return size; } - return Math.max(Math.round(size * Linphone.DefaultStyle.dp), 1); + return size > 0 + ? Math.max(Math.round(size * Linphone.DefaultStyle.dp), 1) + : Math.min(Math.round(size * Linphone.DefaultStyle.dp), -1); } \ No newline at end of file diff --git a/Linphone/view/Page/Form/Chat/SelectedChatView.qml b/Linphone/view/Page/Form/Chat/SelectedChatView.qml index ff8a82803..b3ef4e6a1 100644 --- a/Linphone/view/Page/Form/Chat/SelectedChatView.qml +++ b/Linphone/view/Page/Form/Chat/SelectedChatView.qml @@ -295,40 +295,6 @@ FocusScope { contentLoader.panelType = SelectedChatView.PanelType.ForwardToList detailsPanel.visible = true } - - Popup { - id: emojiPickerPopup - y: Math.round(chatMessagesListView.y + chatMessagesListView.height - height - 8*DefaultStyle.dp) - x: Math.round(chatMessagesListView.x + 8*DefaultStyle.dp) - width: Math.round(393 * DefaultStyle.dp) - height: Math.round(291 * DefaultStyle.dp) - visible: false - modal: true - dim: false - closePolicy: Popup.CloseOnReleaseOutside - padding: 10 * DefaultStyle.dp - background: Item { - anchors.fill: parent - Rectangle { - id: buttonBackground - anchors.fill: parent - color: DefaultStyle.grey_0 - radius: Math.round(20 * DefaultStyle.dp) - } - MultiEffect { - anchors.fill: buttonBackground - source: buttonBackground - shadowEnabled: true - shadowColor: DefaultStyle.grey_1000 - shadowBlur: 0.1 - shadowOpacity: 0.5 - } - } - contentItem: EmojiPicker { - id: emojiPicker - editor: messageSender.textArea - } - } } ScrollBar { id: scrollbar @@ -512,7 +478,6 @@ FocusScope { Control.SplitView.minimumHeight: mainItem.chat?.core.isReadOnly ? 0 : Math.round(79 * DefaultStyle.dp) chat: mainItem.chat selectedFilesCount: contents.count - emojiPicker: emojiPickerPopup callOngoing: mainItem.call != null onChatChanged: { if (chat) messageSender.text = mainItem.chat.core.sendingText