From 735c473b3ce01d96e2590310d860adb08b84f65f Mon Sep 17 00:00:00 2001 From: Gaelle Braud Date: Fri, 21 Nov 2025 15:54:58 +0100 Subject: [PATCH] add unread notification count on class window chat button #LINQT-2138 reset last active window if destroyed --- Linphone/core/chat/ChatCore.cpp | 13 +- Linphone/core/chat/ChatList.cpp | 11 +- Linphone/data/languages/de.ts | 292 +++++++++--------- Linphone/data/languages/en.ts | 292 +++++++++--------- Linphone/data/languages/fr.ts | 292 +++++++++--------- Linphone/view/CMakeLists.txt | 1 + .../view/Control/Container/VerticalTabBar.qml | 19 -- .../Control/Display/Chat/ChatListView.qml | 36 +-- .../Control/Display/UnreadNotification.qml | 42 +++ .../view/Page/Form/Chat/SelectedChatView.qml | 12 + Linphone/view/Page/Window/AbstractWindow.qml | 1 + .../view/Page/Window/Call/CallsWindow.qml | 14 +- 12 files changed, 520 insertions(+), 505 deletions(-) create mode 100644 Linphone/view/Control/Display/UnreadNotification.qml diff --git a/Linphone/core/chat/ChatCore.cpp b/Linphone/core/chat/ChatCore.cpp index 5e8ae5bde..937f69702 100644 --- a/Linphone/core/chat/ChatCore.cpp +++ b/Linphone/core/chat/ChatCore.cpp @@ -235,13 +235,14 @@ void ChatCore::setSelf(QSharedPointer me) { }); mChatModelConnection->makeConnectToCore(&ChatCore::lMarkAsRead, [this]() { - auto mainWindow = Utils::getMainWindow(); - if (mainWindow->isActive()) mChatModelConnection->invokeToModel([this]() { mChatModel->markAsRead(); }); + auto lastActiveWindow = Utils::getLastActiveWindow(); + if (lastActiveWindow && lastActiveWindow->isActive()) + mChatModelConnection->invokeToModel([this]() { mChatModel->markAsRead(); }); else { - connect(mainWindow, &QQuickWindow::activeChanged, this, [this, mainWindow] { - if (mainWindow->isActive()) { - disconnect(mainWindow, &QQuickWindow::activeChanged, this, nullptr); - mChatModelConnection->invokeToModel([this, mainWindow] { mChatModel->markAsRead(); }); + connect(lastActiveWindow, &QQuickWindow::activeChanged, this, [this, lastActiveWindow] { + if (lastActiveWindow->isActive()) { + disconnect(lastActiveWindow, &QQuickWindow::activeChanged, this, nullptr); + mChatModelConnection->invokeToModel([this, lastActiveWindow] { mChatModel->markAsRead(); }); } }); } diff --git a/Linphone/core/chat/ChatList.cpp b/Linphone/core/chat/ChatList.cpp index 69878049b..f98bca9a3 100644 --- a/Linphone/core/chat/ChatList.cpp +++ b/Linphone/core/chat/ChatList.cpp @@ -182,12 +182,11 @@ void ChatList::setSelf(QSharedPointer me) { if (chatRoom->getState() == linphone::ChatRoom::State::Created) { lInfo() << "ChatRoom created, add it to the list" << chatRoom.get(); auto chatCore = ChatCore::create(chatRoom); - mModelConnection->invokeToCore([this, chatCore] { - if (chatCore) { - bool added = addChatInList(chatCore); - if (added) emit chatCreated(new ChatGui(chatCore)); - } - }); + if (chatCore) { + bool added = addChatInList(chatCore); + if (added) + mModelConnection->invokeToCore([this, chatCore] { emit chatCreated(new ChatGui(chatCore)); }); + } } }); diff --git a/Linphone/data/languages/de.ts b/Linphone/data/languages/de.ts index 71b18e576..eb9185f1f 100644 --- a/Linphone/data/languages/de.ts +++ b/Linphone/data/languages/de.ts @@ -25,13 +25,13 @@ AbstractWindow - + contact_dialog_pick_phone_number_or_sip_address_title "Choisissez un numéro ou adresse SIP" Telefonnummer oder SIP-Adresse wählen - + fps_counter %1 FPS @@ -661,134 +661,134 @@ - - + + info_popup_error_title Error Fehler - + info_popup_configuration_failed_message Remote provisioning failed : %1 - + info_popup_error_checking_update An error occured while trying to check update. Please try again later or contact support team. - + info_popup_new_version_download_label - + info_popup_new_version_available_title New version available ! - + info_popup_new_version_available_message A new version of Linphone (%1) is available. %2 - + info_popup_version_up_to_date_title - + info_popup_version_up_to_date_message Your version is up to date - + 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 App-Version anzeigen - + command_line_option_config_to_fetch "Specify the linphone configuration file to be fetched. It will be merged with the current configuration." Abzurufende Linphone-Konfigurationsdatei angeben. Sie wird mit der aktuellen Konfiguration zusammengeführt. - + command_line_option_config_to_fetch_arg "URL, path or file" URL, Pfad oder Datei - + command_line_option_minimized - + command_line_option_log_to_stdout Debug-Informationen auf der Standardausgabe ausgeben - + command_line_option_print_app_logs_only "Print only logs from the application" Nur Anwendungs-Logs ausgeben - + hide_action "Cacher" "Afficher" Ausblenden - + show_action Zeigen - + quit_action "Quitter" Beenden - + check_for_update Check for update - + mark_all_read_action @@ -1527,236 +1527,236 @@ CallsWindow - + call_transfer_in_progress_toast "Transfert en cours, veuillez patienter" Weiterleitung läuft, bitte warten - - + + information_popup_error_title Fehler - + call_transfer_failed_toast "Le transfert d'appel a échoué" Weiterleitung fehlgeschlagen - + conference_error_empty_uri "La conférence n'a pas pu démarrer en raison d'une erreur d'uri." Die Besprechung konnte aufgrund eines URI-Fehlers nicht gestartet werden. - + call_close_window_dialog_title "Terminer tous les appels en cours ?" Alle laufenden Anrufe beenden? - + call_close_window_dialog_message "La fenêtre est sur le point d'être fermée. Cela terminera tous les appels en cours." Das Fenster wird gleich geschlossen. Dies beendet alle laufenden Anrufe. - + call_can_be_trusted_toast "Appareil authentifié" Gerät vertrauenswürdig - + call_dir %1 Anruf - + call_ended Appel terminé Anruf beendet - + conference_paused Meeting paused Besprechung pausiert - + call_paused Call paused Anruf pausiert - + call_srtp_point_to_point_encrypted Appel chiffré de point à point Punkt-zu-Punkt verschlüsselter Anruf - + call_zrtp_sas_validation_required Vérification nécessaire Validierung erforderlich - + call_zrtp_end_to_end_encrypted Appel chiffré de bout en bout Ende-zu-Ende verschlüsselter Anruf - + call_not_encrypted "Appel non chiffré" Unverschlüsselter Anruf - - + + call_waiting_for_encryption_info Waiting for encryption Warten auf Verschlüsselung - + call_paused_by_remote Call paused by remote - + conference_user_is_recording "You are recording the meeting" Sie nehmen die Besprechung auf - + call_user_is_recording "You are recording the call" Sie nehmen den Anruf auf - + conference_remote_is_recording "Someone is recording the meeting" Jemand nimmt die Besprechung auf - + call_remote_recording "%1 is recording the call" %1 nimmt den Anruf auf - + call_stop_recording "Stop recording" Aufnahme stoppen - + add Hinzufügen - + call_transfer_current_call_title "Transférer %1 à…" %1 weiterleiten an… - - + + call_transfer_confirm_dialog_tittle "Confirmer le transfert" Weiterleitung bestätigen - - + + call_transfer_confirm_dialog_message "Vous allez transférer %1 à %2." Sie werden %1 an %2 weiterleiten. - + call_action_start_new_call "Nouvel appel" Neuen Anruf starten - - + + call_action_show_dialer "Pavé numérique" Wähltastatur - + call_action_change_layout "Modifier la disposition" Layout ändern - + call_action_go_to_calls_list "Liste d'appel" Anrufliste - + Merger tous les appels call_action_merge_calls Alle Anrufe zusammenführen - - + + call_action_go_to_settings "Paramètres" Einstellungen - + conference_action_screen_sharing "Partage de votre écran" Bildschirm teilen - + conference_share_link_title Partager le lien de la réunion Besprechungs-Link teilen - + copied Copié Kopiert - + information_popup_meeting_address_copied_to_clipboard Le lien de la réunion a été copié dans le presse-papier Der Besprechungs-Link wurde in die Zwischenablage kopiert - - + + conference_participants_list_title "Participants (%1)" Teilnehmer (%1) - - + + group_call_participant_selected 1 ausgewählter Teilnehmer @@ -1764,194 +1764,194 @@ - + meeting_schedule_add_participants_title Teilnehmer hinzufügen - + call_encryption_title Chiffrement Verschlüsselung - + open_statistic_panel_accessible_name - + conference_user_is_sharing_screen "You are sharing your screen" - + call_stop_screen_sharing "Stop sharing" Stopp - + stop_recording_accessible_name Stop recording Aufnahme stoppen - + stop_screen_sharing_accessible_name "Stop screen sharing" - + call_stats_title Statistiques Statistiken - - + + call_action_end_call "Terminer l'appel" Anruf beenden - - + + call_action_resume_call "Reprendre l'appel" Anruf fortsetzen - - + + call_action_pause_call "Mettre l'appel en pause" Anruf pausieren - - + + call_action_transfer_call "Transférer l'appel" Anruf weiterleiten - - + + call_action_start_new_call_hint "Initier un nouvel appel" Neuen Anruf starten - - + + call_display_call_list_hint "Afficher la liste d'appels" Anrufliste anzeigen - - + + call_deactivate_video_hint "Désactiver la vidéo" "Activer la vidéo" Video deaktivieren - - + + call_activate_video_hint Video aktivieren - - + + call_activate_microphone "Activer le micro" Mikrofon aktivieren - - + + call_deactivate_microphone "Désactiver le micro" Mikrofon stummschalten - - + + call_share_screen_hint Partager l'écran… Bildschirm teilen… - - + + call_open_chat_hint Open chat… - - + + call_rise_hand_hint "Lever la main" Hand heben - - + + call_send_reaction_hint "Envoyer une réaction" Reaktion senden - - + + call_manage_participants_hint "Gérer les participants" Teilnehmer verwalten - - + + call_more_options_hint "Plus d'options…" Weitere Optionen… - + call_action_change_conference_layout "Modifier la disposition" Layout ändern - + call_action_full_screen "Mode Plein écran" Vollbildmodus - + call_action_stop_recording "Terminer l'enregistrement" Aufnahme beenden - + call_action_record "Enregistrer l'appel" Anruf aufnehmen - + call_activate_speaker_hint "Activer le son" Lautsprecher aktivieren - + call_deactivate_speaker_hint "Désactiver le son" Lautsprecher stummschalten @@ -2112,65 +2112,65 @@ ChatListView - + chat_message_is_writing_info %1 is writing… - + chat_message_draft_sending_text - + chat_room_delete "Delete" Löschen - + chat_room_mute - + chat_room_unmute "Mute" - + chat_room_mark_as_read "Mark as read" - + chat_room_leave "leave" - + chat_list_leave_chat_popup_title leave the conversation ? - + chat_list_leave_chat_popup_message You will not be able to send or receive messages in this conversation anymore. Do You want to continue ? - + chat_list_delete_chat_popup_title Delete the conversation ? - + chat_list_delete_chat_popup_message This conversation and all its messages will be deleted. Do You want to continue ? @@ -2453,58 +2453,58 @@ Error ChatMessagesListView - - + + popup_info_find_message_title Find message - + info_popup_no_result_message No result found - + info_popup_first_result_message First result reached - + info_popup_last_result_message Last result reached - + chat_message_list_encrypted_header_title End to end encrypted chat - + unencrypted_conversation_warning This conversation is not encrypted ! - + chat_message_list_encrypted_header_message Messages in this conversation are e2e encrypted. Only your correspondent can decrypt them. - + chat_message_list_not_encrypted_header_message Messages are not end to end encrypted, may sure you don't share any sensitive information ! - + chat_message_is_writing_info %1 is writing… @@ -5828,42 +5828,42 @@ Pour les activer dans un projet commercial, merci de nous contacter. SelectedChatView - + chat_view_group_call_toast_message 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 Konversationen diff --git a/Linphone/data/languages/en.ts b/Linphone/data/languages/en.ts index 7c6dbc717..8d1d26009 100644 --- a/Linphone/data/languages/en.ts +++ b/Linphone/data/languages/en.ts @@ -25,13 +25,13 @@ AbstractWindow - + contact_dialog_pick_phone_number_or_sip_address_title "Choisissez un numéro ou adresse SIP" Choose a SIP number or address - + fps_counter %1 FPS @@ -656,134 +656,134 @@ - - + + info_popup_error_title Error Error - + info_popup_configuration_failed_message Remote provisioning failed : %1 Remote provisioning failed : %1 - + info_popup_error_checking_update An error occured while trying to check update. Please try again later or contact support team. An error occured while trying to check update. Please try again later or contact support team. - + info_popup_new_version_download_label Download it ! - + info_popup_new_version_available_title New version available ! New version available ! - + info_popup_new_version_available_message A new version of Linphone (%1) is available. %2 A new version of Linphone (%1) is available at %1 - + info_popup_version_up_to_date_title Up to date - + info_popup_version_up_to_date_message Your version is up to date Up to date Your version is up to date - + 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 - + check_for_update Check for update Check for update - + mark_all_read_action Marquer tout comme lu @@ -1504,236 +1504,236 @@ CallsWindow - + call_transfer_in_progress_toast "Transfert en cours, veuillez patienter" Transfer in progress, please wait - - + + information_popup_error_title Error - + call_transfer_failed_toast "Le transfert d'appel a échoué" Transfer failed - + conference_error_empty_uri "La conférence n'a pas pu démarrer en raison d'une erreur d'uri." Meeting could start due to URI error. - + call_close_window_dialog_title "Terminer tous les appels en cours ?" End all current calls ? - + call_close_window_dialog_message "La fenêtre est sur le point d'être fermée. Cela terminera tous les appels en cours." The window is about to be closed. This will end all current calls. - + call_can_be_trusted_toast "Appareil authentifié" Device trusted - + call_dir %1 call - + call_ended Appel terminé Call ended - + conference_paused Meeting paused Meeting paused - + call_paused Call paused Call paused - + call_srtp_point_to_point_encrypted Appel chiffré de point à point Point-to-point encrypted call - + call_zrtp_sas_validation_required Vérification nécessaire Validation required - + call_zrtp_end_to_end_encrypted Appel chiffré de bout en bout End-to-end encrypted call - + call_not_encrypted "Appel non chiffré" Unencrypted call - - + + call_waiting_for_encryption_info Waiting for encryption Waiting for encryption - + call_paused_by_remote Call paused by remote Call paused by remote - + conference_user_is_recording "You are recording the meeting" You are recording the meeting - + call_user_is_recording "You are recording the call" You are recording the call - + conference_remote_is_recording "Someone is recording the meeting" Someone is recording the meeting - + call_remote_recording "%1 is recording the call" %1 records the call - + call_stop_recording "Stop recording" Stop recording - + add Add - + call_transfer_current_call_title "Transférer %1 à…" Transfer %1 to… - - + + call_transfer_confirm_dialog_tittle "Confirmer le transfert" Confirm transfer - - + + call_transfer_confirm_dialog_message "Vous allez transférer %1 à %2." You are going to transfer %1 to %2. - + call_action_start_new_call "Nouvel appel" New call - - + + call_action_show_dialer "Pavé numérique" Dialer - + call_action_change_layout "Modifier la disposition" Change layout - + call_action_go_to_calls_list "Liste d'appel" Call list - + Merger tous les appels call_action_merge_calls Merge all calls - - + + call_action_go_to_settings "Paramètres" Settings - + conference_action_screen_sharing "Partage de votre écran" Share your screen - + conference_share_link_title Partager le lien de la réunion Share meeting link - + copied Copié Copied - + information_popup_meeting_address_copied_to_clipboard Le lien de la réunion a été copié dans le presse-papier Meeting link has been copied to the clipboard - - + + conference_participants_list_title "Participants (%1)" Participants (%1) - - + + group_call_participant_selected %1 selected participant @@ -1741,194 +1741,194 @@ - + meeting_schedule_add_participants_title Add participants - + call_encryption_title Chiffrement Encryption - + open_statistic_panel_accessible_name Open statistic panel - + conference_user_is_sharing_screen "You are sharing your screen" You are sharing your screen - + call_stop_screen_sharing "Stop sharing" Stop - + stop_recording_accessible_name Stop recording Stop recording - + stop_screen_sharing_accessible_name "Stop screen sharing" Stop screen sharing - + call_stats_title Statistiques Statistics - - + + call_action_end_call "Terminer l'appel" End call - - + + call_action_resume_call "Reprendre l'appel" Resume call - - + + call_action_pause_call "Mettre l'appel en pause" Pause call - - + + call_action_transfer_call "Transférer l'appel" Transfer call - - + + call_action_start_new_call_hint "Initier un nouvel appel" Start new call - - + + call_display_call_list_hint "Afficher la liste d'appels" View call list - - + + call_deactivate_video_hint "Désactiver la vidéo" "Activer la vidéo" Turn off video - - + + call_activate_video_hint Enable video - - + + call_activate_microphone "Activer le micro" Activate microphone - - + + call_deactivate_microphone "Désactiver le micro" Mute microphone - - + + call_share_screen_hint Partager l'écran… Share screen… - - + + call_open_chat_hint Open chat… Open conversation… - - + + call_rise_hand_hint "Lever la main" Rise hand - - + + call_send_reaction_hint "Envoyer une réaction" Send reaction - - + + call_manage_participants_hint "Gérer les participants" Manage participants - - + + call_more_options_hint "Plus d'options…" More options… - + call_action_change_conference_layout "Modifier la disposition" Change layout - + call_action_full_screen "Mode Plein écran" Full screen mode - + call_action_stop_recording "Terminer l'enregistrement" End recording - + call_action_record "Enregistrer l'appel" Record call - + call_activate_speaker_hint "Activer le son" Activate speaker - + call_deactivate_speaker_hint "Désactiver le son" Mute speaker @@ -2089,65 +2089,65 @@ ChatListView - + chat_message_is_writing_info %1 is writing… %1 is writing… - + chat_message_draft_sending_text Draft : %1 - + chat_room_delete "Delete" Delete - + chat_room_mute Mute - + chat_room_unmute "Mute" Unmute - + chat_room_mark_as_read "Mark as read" Mark as read - + chat_room_leave "leave" Leave - + chat_list_leave_chat_popup_title leave the conversation ? Leave the conversation ? - + chat_list_leave_chat_popup_message You will not be able to send or receive messages in this conversation anymore. Do You want to continue ? You will not be able to send or receive messages in this conversation anymore. Do You want to continue ? - + chat_list_delete_chat_popup_title Delete the conversation ? Delete the conversation ? - + chat_list_delete_chat_popup_message This conversation and all its messages will be deleted. Do You want to continue ? This conversation and all its messages will be deleted. Do You want to continue ? @@ -2425,44 +2425,44 @@ Error ChatMessagesListView - - + + popup_info_find_message_title Find message Find message - + info_popup_no_result_message No result found No result found - + info_popup_first_result_message First result reached First result reached - + info_popup_last_result_message Last result reached Last result reached - + chat_message_list_encrypted_header_title End to end encrypted chat End to end encrypted chat - + unencrypted_conversation_warning This conversation is not encrypted ! This conversation is not encrypted ! - + chat_message_list_encrypted_header_message Messages in this conversation are e2e encrypted. Only your correspondent can decrypt them. @@ -2470,7 +2470,7 @@ Error Only your correspondent can decrypt them. - + chat_message_list_not_encrypted_header_message Messages are not end to end encrypted, may sure you don't share any sensitive information ! @@ -2478,7 +2478,7 @@ Only your correspondent can decrypt them. may sure you don't share any sensitive information ! - + chat_message_is_writing_info %1 is writing… %1 is writing… @@ -5723,42 +5723,42 @@ To enable them in a commercial project, please contact us. SelectedChatView - + chat_view_group_call_toast_message 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 diff --git a/Linphone/data/languages/fr.ts b/Linphone/data/languages/fr.ts index 59750f6c4..1f806520e 100644 --- a/Linphone/data/languages/fr.ts +++ b/Linphone/data/languages/fr.ts @@ -25,13 +25,13 @@ AbstractWindow - + contact_dialog_pick_phone_number_or_sip_address_title "Choisissez un numéro ou adresse SIP" Choisissez un numéro ou adresse SIP - + fps_counter %1 FPS @@ -656,134 +656,134 @@ - - + + info_popup_error_title Error Erreur - + info_popup_configuration_failed_message Remote provisioning failed : %1 La configuration distante a échoué : %1 - + info_popup_error_checking_update An error occured while trying to check update. Please try again later or contact support team. Une erreur est survenue lors de la recherche de mise à jour. Merci de réessayer plus tard ou de contacter l'équipe de support. - + info_popup_new_version_download_label Téléchargez-là ! - + info_popup_new_version_available_title New version available ! Nouvelle version disponible ! - + info_popup_new_version_available_message A new version of Linphone (%1) is available. %2 Une nouvelle version de Linphone (%1) est disponible. %2 - + info_popup_version_up_to_date_title À jour - + info_popup_version_up_to_date_message Your version is up to date Votre version est à jour - + 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 - + check_for_update Check for update Rechercher une mise à jour - + mark_all_read_action Marquer tout comme lu @@ -1504,236 +1504,236 @@ CallsWindow - + call_transfer_in_progress_toast "Transfert en cours, veuillez patienter" Transfert en cours, veuillez patienter - - + + information_popup_error_title Erreur - + call_transfer_failed_toast "Le transfert d'appel a échoué" Le transfert d'appel a échoué - + conference_error_empty_uri "La conférence n'a pas pu démarrer en raison d'une erreur d'uri." La conférence n'a pas pu démarrer en raison d'une erreur d'uri. - + call_close_window_dialog_title "Terminer tous les appels en cours ?" Terminer tous les appels en cours ? - + call_close_window_dialog_message "La fenêtre est sur le point d'être fermée. Cela terminera tous les appels en cours." La fenêtre est sur le point d'être fermée. Cela terminera tous les appels en cours. - + call_can_be_trusted_toast "Appareil authentifié" Appareil authentifié - + call_dir Appel %1 - + call_ended Appel terminé Appel terminé - + conference_paused Meeting paused Réunion mise en pause - + call_paused Call paused Appel mis en pause - + call_srtp_point_to_point_encrypted Appel chiffré de point à point Appel chiffré de point à point - + call_zrtp_sas_validation_required Vérification nécessaire Vérification nécessaire - + call_zrtp_end_to_end_encrypted Appel chiffré de bout en bout Appel chiffré de bout en bout - + call_not_encrypted "Appel non chiffré" Appel non chiffré - - + + call_waiting_for_encryption_info Waiting for encryption En attente de chiffrement - + call_paused_by_remote Call paused by remote Appel mis en pause par votre correspondant - + conference_user_is_recording "You are recording the meeting" Vous enregistrez la réunion - + call_user_is_recording "You are recording the call" Vous enregistrez l'appel - + conference_remote_is_recording "Someone is recording the meeting" Un participant enregistre la réunion - + call_remote_recording "%1 is recording the call" %1 enregistre l'appel - + call_stop_recording "Stop recording" Arrêter l'enregistrement - + add Ajouter - + call_transfer_current_call_title "Transférer %1 à…" Transférer %1 à… - - + + call_transfer_confirm_dialog_tittle "Confirmer le transfert" Confirmer le transfert - - + + call_transfer_confirm_dialog_message "Vous allez transférer %1 à %2." Vous allez transférer %1 à %2. - + call_action_start_new_call "Nouvel appel" Nouvel appel - - + + call_action_show_dialer "Pavé numérique" Pavé numérique - + call_action_change_layout "Modifier la disposition" Modifier la disposition - + call_action_go_to_calls_list "Liste d'appel" Liste d'appel - + Merger tous les appels call_action_merge_calls Merger tous les appels - - + + call_action_go_to_settings "Paramètres" Paramètres - + conference_action_screen_sharing "Partage de votre écran" Partage de votre écran - + conference_share_link_title Partager le lien de la réunion Partager le lien de la réunion - + copied Copié Copié - + information_popup_meeting_address_copied_to_clipboard Le lien de la réunion a été copié dans le presse-papier Le lien de la réunion a été copié dans le presse-papier - - + + conference_participants_list_title "Participants (%1)" Participants (%1) - - + + group_call_participant_selected %1 participant sélectionné @@ -1741,194 +1741,194 @@ - + meeting_schedule_add_participants_title Ajouter des participants - + call_encryption_title Chiffrement Chiffrement - + open_statistic_panel_accessible_name Ouvrir le panneau de statistiques - + conference_user_is_sharing_screen "You are sharing your screen" Vous partagez votre écran - + call_stop_screen_sharing "Stop sharing" Arrêter le partage - + stop_recording_accessible_name Stop recording Arrêter l'enregistrement - + stop_screen_sharing_accessible_name "Stop screen sharing" Arrêter le partage d'écran - + call_stats_title Statistiques Statistiques - - + + call_action_end_call "Terminer l'appel" Terminer l'appel - - + + call_action_resume_call "Reprendre l'appel" Reprendre l'appel - - + + call_action_pause_call "Mettre l'appel en pause" Mettre l'appel en pause - - + + call_action_transfer_call "Transférer l'appel" Transférer l'appel - - + + call_action_start_new_call_hint "Initier un nouvel appel" Initier un nouvel appel - - + + call_display_call_list_hint "Afficher la liste d'appels" Afficher la liste d'appels - - + + call_deactivate_video_hint "Désactiver la vidéo" "Activer la vidéo" Désactiver la vidéo - - + + call_activate_video_hint Activer la vidéo - - + + call_activate_microphone "Activer le micro" Activer le micro - - + + call_deactivate_microphone "Désactiver le micro" Désactiver le micro - - + + call_share_screen_hint Partager l'écran… Partager l'écran… - - + + call_open_chat_hint Open chat… Ouvrir le chat… - - + + call_rise_hand_hint "Lever la main" Lever la main - - + + call_send_reaction_hint "Envoyer une réaction" Envoyer une réaction - - + + call_manage_participants_hint "Gérer les participants" Gérer les participants - - + + call_more_options_hint "Plus d'options…" Plus d'options… - + call_action_change_conference_layout "Modifier la disposition" Modifier la disposition - + call_action_full_screen "Mode Plein écran" Mode Plein écran - + call_action_stop_recording "Terminer l'enregistrement" Terminer l'enregistrement - + call_action_record "Enregistrer l'appel" Enregistrer l'appel - + call_activate_speaker_hint "Activer le son" Activer le son - + call_deactivate_speaker_hint "Désactiver le son" Désactiver le son @@ -2089,65 +2089,65 @@ ChatListView - + chat_message_is_writing_info %1 is writing… %1 est en train d'écrire… - + chat_message_draft_sending_text Brouillon : %1 - + chat_room_delete "Delete" Supprimer - + chat_room_mute Mettre en sourdine - + chat_room_unmute "Mute" Enlever la sourdine - + chat_room_mark_as_read "Mark as read" Marquer comme lu - + chat_room_leave "leave" Quitter la conversation - + chat_list_leave_chat_popup_title leave the conversation ? Quitter la conversation ? - + chat_list_leave_chat_popup_message You will not be able to send or receive messages in this conversation anymore. Do You want to continue ? Vous ne pourrez plus envoyer ou recevoir de messages dans cette conversation. Souhaitez-vous continuer ? - + chat_list_delete_chat_popup_title Delete the conversation ? Supprimer la conversation ? - + chat_list_delete_chat_popup_message This conversation and all its messages will be deleted. Do You want to continue ? La conversation et tous ses messages seront supprimés. Souhaitez-vous continuer ? @@ -2425,44 +2425,44 @@ Error ChatMessagesListView - - + + popup_info_find_message_title Find message Trouver un message - + info_popup_no_result_message No result found Aucun résultat trouvé - + info_popup_first_result_message First result reached Premier résultat atteint - + info_popup_last_result_message Last result reached Dernier résultat atteint - + chat_message_list_encrypted_header_title End to end encrypted chat Conversation chiffrée de bout en bout - + unencrypted_conversation_warning This conversation is not encrypted ! Cette conversation n'est pas chiffrée ! - + chat_message_list_encrypted_header_message Messages in this conversation are e2e encrypted. Only your correspondent can decrypt them. @@ -2470,7 +2470,7 @@ Error en bout. Seul votre correspondant peut les déchiffrer. - + chat_message_list_not_encrypted_header_message Messages are not end to end encrypted, may sure you don't share any sensitive information ! @@ -2478,7 +2478,7 @@ en bout. Seul votre correspondant peut les déchiffrer. assurez-vous de ne pas partager d’informations sensibles ! - + chat_message_is_writing_info %1 is writing… %1 est en train d'écrire… @@ -5723,42 +5723,42 @@ Pour les activer dans un projet commercial, merci de nous contacter. SelectedChatView - + chat_view_group_call_toast_message 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 diff --git a/Linphone/view/CMakeLists.txt b/Linphone/view/CMakeLists.txt index af4931e7f..54d73d826 100644 --- a/Linphone/view/CMakeLists.txt +++ b/Linphone/view/CMakeLists.txt @@ -54,6 +54,7 @@ list(APPEND _LINPHONEAPP_QML_FILES view/Control/Display/TemporaryText.qml view/Control/Display/Text.qml view/Control/Display/ToolTip.qml + view/Control/Display/UnreadNotification.qml view/Control/Display/Call/CallListView.qml view/Control/Display/Call/CallHistoryListView.qml view/Control/Display/Call/CallStatistics.qml diff --git a/Linphone/view/Control/Container/VerticalTabBar.qml b/Linphone/view/Control/Container/VerticalTabBar.qml index 8190fc03a..329ece59e 100644 --- a/Linphone/view/Control/Container/VerticalTabBar.qml +++ b/Linphone/view/Control/Container/VerticalTabBar.qml @@ -35,25 +35,6 @@ Control.TabBar { initButtons() } } - - component UnreadNotification: Rectangle { - property int unread: 0 - visible: unread > 0 - width: Utils.getSizeWithScreenRatio(15) - height: Utils.getSizeWithScreenRatio(15) - radius: width/2 - color: DefaultStyle.danger_500_main - Text{ - id: unreadCount - anchors.fill: parent - verticalAlignment: Text.AlignVCenter - horizontalAlignment: Text.AlignHCenter - color: DefaultStyle.grey_0 - fontSizeMode: Text.Fit - font.pixelSize: Utils.getSizeWithScreenRatio(15) - text: parent.unread > 100 ? '99+' : parent.unread - } - } contentItem: ListView { model: mainItem.contentModel diff --git a/Linphone/view/Control/Display/Chat/ChatListView.qml b/Linphone/view/Control/Display/Chat/ChatListView.qml index d7c34b315..720361d2a 100644 --- a/Linphone/view/Control/Display/Chat/ChatListView.qml +++ b/Linphone/view/Control/Display/Chat/ChatListView.qml @@ -133,40 +133,6 @@ ListView { // So we need to use this variable to switch off all hovered items. property int lastMouseContainsIndex: -1 - component UnreadNotification: Item { - id: unreadNotif - property int unread: 0 - width: Utils.getSizeWithScreenRatio(14) - height: Utils.getSizeWithScreenRatio(14) - visible: unread > 0 - Rectangle { - id: background - anchors.fill: parent - radius: width/2 - color: DefaultStyle.danger_500_main - Text{ - anchors.fill: parent - verticalAlignment: Text.AlignVCenter - horizontalAlignment: Text.AlignHCenter - color: DefaultStyle.grey_0 - fontSizeMode: Text.Fit - font.pixelSize: Utils.getSizeWithScreenRatio(10) - text: parent.unreadNotif > 100 ? '99+' : unreadNotif.unread - } - } - MultiEffect { - id: shadow - anchors.fill: background - source: background - // Crash : https://bugreports.qt.io/browse/QTBUG-124730? - shadowEnabled: true - shadowColor: DefaultStyle.grey_1000 - shadowBlur: 1 - shadowOpacity: 0.15 - z: unreadNotif.z - 1 - } - } - delegate: FocusScope { visible: !mainItem.loading width: mainItem.width @@ -333,6 +299,8 @@ ListView { } UnreadNotification { id: unreadCount + Layout.preferredWidth: Utils.getSizeWithScreenRatio(14) + Layout.preferredHeight: Utils.getSizeWithScreenRatio(14) unread: modelData?.core.unreadMessagesCount || false } EffectImage { diff --git a/Linphone/view/Control/Display/UnreadNotification.qml b/Linphone/view/Control/Display/UnreadNotification.qml new file mode 100644 index 000000000..a99c6ab0c --- /dev/null +++ b/Linphone/view/Control/Display/UnreadNotification.qml @@ -0,0 +1,42 @@ +import QtQuick +import Linphone +import QtQuick.Controls.Basic as Control +import QtQuick.Effects +import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils + +Control.Control { + id: mainItem + property int unread: 0 + width: Utils.getSizeWithScreenRatio(14) + height: Utils.getSizeWithScreenRatio(14) + visible: unread > 0 + background: Item { + anchors.fill: parent + Rectangle { + id: background + anchors.fill: parent + radius: width/2 + color: DefaultStyle.danger_500_main + } + MultiEffect { + id: shadow + anchors.fill: background + source: background + // Crash : https://bugreports.qt.io/browse/QTBUG-124730? + shadowEnabled: true + shadowColor: DefaultStyle.grey_1000 + shadowBlur: 1 + shadowOpacity: 0.15 + z: mainItem.z - 1 + } + } + contentItem: Text { + anchors.fill: parent + verticalAlignment: Text.AlignVCenter + horizontalAlignment: Text.AlignHCenter + color: DefaultStyle.grey_0 + fontSizeMode: Text.Fit + font.pixelSize: Utils.getSizeWithScreenRatio(10) + text: mainItem.unread > 100 ? '99+' : mainItem.unread + } +} \ 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 5043d0c5a..685cdf693 100644 --- a/Linphone/view/Page/Form/Chat/SelectedChatView.qml +++ b/Linphone/view/Page/Form/Chat/SelectedChatView.qml @@ -26,6 +26,18 @@ FocusScope { signal oneOneCall(bool video) signal groupCall() + onActiveFocusChanged: if(activeFocus) { + console.log("selected has active focus, mark as read") + chat.core.lMarkAsRead() + } + MouseArea{ + anchors.fill: parent + onPressed: { + console.log("selected chat view pressed") + forceActiveFocus() + } + } + onOneOneCall: { if (contact) mainWindow.startCallWithContact(contact, video, mainItem) diff --git a/Linphone/view/Page/Window/AbstractWindow.qml b/Linphone/view/Page/Window/AbstractWindow.qml index b8ddc8d2b..d680754d8 100644 --- a/Linphone/view/Page/Window/AbstractWindow.qml +++ b/Linphone/view/Page/Window/AbstractWindow.qml @@ -17,6 +17,7 @@ ApplicationWindow { height: Math.min(Utils.getSizeWithScreenRatio(982), Screen.desktopAvailableHeight) onActiveChanged: if (active) UtilsCpp.setLastActiveWindow(this) + Component.onDestruction: if (UtilsCpp.getLastActiveWindow() === this) UtilsCpp.setLastActiveWindow(null) property bool isFullscreen: visibility == Window.FullScreen onIsFullscreenChanged: DesktopToolsCpp.screenSaverStatus = !isFullscreen diff --git a/Linphone/view/Page/Window/Call/CallsWindow.qml b/Linphone/view/Page/Window/Call/CallsWindow.qml index 5a56d5b79..fb0de7802 100644 --- a/Linphone/view/Page/Window/Call/CallsWindow.qml +++ b/Linphone/view/Page/Window/Call/CallsWindow.qml @@ -22,6 +22,10 @@ AbstractWindow { property ConferenceGui conference: call && call.core.conference || null property bool isConference: call ? call.core.isConference : false + // Chat related to call + property var chatObj: UtilsCpp.getCurrentCallChat(mainWindow.call) + property ChatGui chat: chatObj ? chatObj.value : null + property int conferenceLayout: call && call.core.conferenceVideoLayout || 0 property bool localVideoEnabled: call && call.core.localVideoEnabled property bool remoteVideoEnabled: call && call.core.remoteVideoEnabled @@ -989,6 +993,7 @@ AbstractWindow { Control.Control { objectName: "chatPanel" width: parent.width + Component.onCompleted: chatView.forceActiveFocus() SelectedChatView { id: chatView width: parent.width @@ -998,8 +1003,7 @@ AbstractWindow { event.accepted = true } call: mainWindow.call - property var chatObj: UtilsCpp.getCurrentCallChat(mainWindow.call) - chat: chatObj ? chatObj.value : null + chat: mainWindow.chat } Connections { target: rightPanel.contentLoader @@ -1495,6 +1499,7 @@ AbstractWindow { rightPanel.visible = false } } + } // Chat panel button @@ -1509,6 +1514,11 @@ AbstractWindow { Layout.preferredHeight: Utils.getSizeWithScreenRatio(55) icon.width: Utils.getSizeWithScreenRatio(32) icon.height: Utils.getSizeWithScreenRatio(32) + UnreadNotification { + anchors.top: parent.top + anchors.right: parent.right + unread: mainWindow.chat ? mainWindow.chat.core.unreadMessagesCount : 0 + } onToggled: { if (checked) { rightPanel.visible = true