fix new chat selection

This commit is contained in:
Gaelle Braud 2025-12-18 10:35:01 +01:00 committed by Gaëlle Braud
parent 78e36bfa88
commit 36fbf44d42
10 changed files with 93 additions and 75 deletions

View file

@ -218,7 +218,7 @@ bool ChatList::addChatInList(QSharedPointer<ChatCore> chatCore) {
if (it == chatList.end()) { if (it == chatList.end()) {
connectItem(chatCore); connectItem(chatCore);
add(chatCore); add(chatCore);
emit chatAdded(); emit chatAdded(chatCore);
return true; return true;
} }
return false; return false;

View file

@ -48,7 +48,7 @@ public:
signals: signals:
void lUpdate(); void lUpdate();
void filterChanged(QString filter); void filterChanged(QString filter);
void chatAdded(); void chatAdded(QSharedPointer<ChatCore> chatCore);
void chatUpdated(); void chatUpdated();
private: private:

View file

@ -45,7 +45,12 @@ void ChatProxy::setSourceModel(QAbstractItemModel *model) {
if (newChatList) { if (newChatList) {
connect(this, &ChatProxy::filterTextChanged, newChatList, connect(this, &ChatProxy::filterTextChanged, newChatList,
[this, newChatList] { emit newChatList->filterChanged(getFilterText()); }); [this, newChatList] { emit newChatList->filterChanged(getFilterText()); });
connect(newChatList, &ChatList::chatAdded, this, [this] { invalidate(); }); connect(newChatList, &ChatList::chatAdded, this, [this](QSharedPointer<ChatCore> chatCore) {
if (chatCore) {
invalidate();
emit chatAdded(new ChatGui(chatCore));
}
});
connect(newChatList, &ChatList::dataChanged, this, [this] { invalidate(); }); connect(newChatList, &ChatList::dataChanged, this, [this] { invalidate(); });
} }
QSortFilterProxyModel::setSourceModel(newChatList); QSortFilterProxyModel::setSourceModel(newChatList);

View file

@ -43,6 +43,9 @@ public:
Q_INVOKABLE int findChatIndex(ChatGui *chatGui); Q_INVOKABLE int findChatIndex(ChatGui *chatGui);
Q_INVOKABLE bool addChatInList(ChatGui *chatGui); Q_INVOKABLE bool addChatInList(ChatGui *chatGui);
signals:
void chatAdded(ChatGui *chat);
protected: protected:
QSharedPointer<ChatList> mList; QSharedPointer<ChatList> mList;
DECLARE_ABSTRACT_OBJECT DECLARE_ABSTRACT_OBJECT

View file

@ -44,7 +44,7 @@ ChatGui *ParticipantInfoProxy::getChat() const {
} }
void ParticipantInfoProxy::setChat(ChatGui *chat) { void ParticipantInfoProxy::setChat(ChatGui *chat) {
lDebug() << "[ParticipantInfoProxy] set current chat " << chat; lDebug() << "[ParticipantInfoProxy] set current chat " << chat << (chat ? chat->mCore->getTitle() : "NULL");
if (mChat != chat) { if (mChat != chat) {
mChat = chat; mChat = chat;
mParticipants->setChatCore(chat ? chat->mCore : nullptr); mParticipants->setChatCore(chat ? chat->mCore : nullptr);

View file

@ -2132,65 +2132,65 @@
<context> <context>
<name>ChatListView</name> <name>ChatListView</name>
<message> <message>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="259"/> <location filename="../../view/Control/Display/Chat/ChatListView.qml" line="265"/>
<source>chat_message_is_writing_info</source> <source>chat_message_is_writing_info</source>
<extracomment>%1 is writing</extracomment> <extracomment>%1 is writing</extracomment>
<translation>%1 schreibt</translation> <translation>%1 schreibt</translation>
</message> </message>
<message> <message>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="261"/> <location filename="../../view/Control/Display/Chat/ChatListView.qml" line="267"/>
<source>chat_message_draft_sending_text</source> <source>chat_message_draft_sending_text</source>
<translation>Entwurf: %1</translation> <translation>Entwurf: %1</translation>
</message> </message>
<message> <message>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="406"/> <location filename="../../view/Control/Display/Chat/ChatListView.qml" line="412"/>
<source>chat_room_delete</source> <source>chat_room_delete</source>
<extracomment>&quot;Delete&quot;</extracomment> <extracomment>&quot;Delete&quot;</extracomment>
<translation>Löschen</translation> <translation>Löschen</translation>
</message> </message>
<message> <message>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="345"/> <location filename="../../view/Control/Display/Chat/ChatListView.qml" line="351"/>
<source>chat_room_mute</source> <source>chat_room_mute</source>
<translation>Stummschalten</translation> <translation>Stummschalten</translation>
</message> </message>
<message> <message>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="344"/> <location filename="../../view/Control/Display/Chat/ChatListView.qml" line="350"/>
<source>chat_room_unmute</source> <source>chat_room_unmute</source>
<extracomment>&quot;Mute&quot;</extracomment> <extracomment>&quot;Mute&quot;</extracomment>
<translation>Stummschaltung aufheben</translation> <translation>Stummschaltung aufheben</translation>
</message> </message>
<message> <message>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="358"/> <location filename="../../view/Control/Display/Chat/ChatListView.qml" line="364"/>
<source>chat_room_mark_as_read</source> <source>chat_room_mark_as_read</source>
<extracomment>&quot;Mark as read&quot;</extracomment> <extracomment>&quot;Mark as read&quot;</extracomment>
<translation>Als gelesen markieren</translation> <translation>Als gelesen markieren</translation>
</message> </message>
<message> <message>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="377"/> <location filename="../../view/Control/Display/Chat/ChatListView.qml" line="383"/>
<source>chat_room_leave</source> <source>chat_room_leave</source>
<extracomment>&quot;leave&quot;</extracomment> <extracomment>&quot;leave&quot;</extracomment>
<translation>Verlassen</translation> <translation>Verlassen</translation>
</message> </message>
<message> <message>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="383"/> <location filename="../../view/Control/Display/Chat/ChatListView.qml" line="389"/>
<source>chat_list_leave_chat_popup_title</source> <source>chat_list_leave_chat_popup_title</source>
<extracomment>leave the conversation ?</extracomment> <extracomment>leave the conversation ?</extracomment>
<translation>Chat verlassen?</translation> <translation>Chat verlassen?</translation>
</message> </message>
<message> <message>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="385"/> <location filename="../../view/Control/Display/Chat/ChatListView.qml" line="391"/>
<source>chat_list_leave_chat_popup_message</source> <source>chat_list_leave_chat_popup_message</source>
<extracomment>You will not be able to send or receive messages in this conversation anymore. Do You want to continue ?</extracomment> <extracomment>You will not be able to send or receive messages in this conversation anymore. Do You want to continue ?</extracomment>
<translation>Sie können in diesem Chat keine Nachrichten mehr senden oder empfangen. Möchten Sie fortfahren?</translation> <translation>Sie können in diesem Chat keine Nachrichten mehr senden oder empfangen. Möchten Sie fortfahren?</translation>
</message> </message>
<message> <message>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="412"/> <location filename="../../view/Control/Display/Chat/ChatListView.qml" line="418"/>
<source>chat_list_delete_chat_popup_title</source> <source>chat_list_delete_chat_popup_title</source>
<extracomment>Delete the conversation ?</extracomment> <extracomment>Delete the conversation ?</extracomment>
<translation>Chat löschen?</translation> <translation>Chat löschen?</translation>
</message> </message>
<message> <message>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="414"/> <location filename="../../view/Control/Display/Chat/ChatListView.qml" line="420"/>
<source>chat_list_delete_chat_popup_message</source> <source>chat_list_delete_chat_popup_message</source>
<extracomment>This conversation and all its messages will be deleted. Do You want to continue ?</extracomment> <extracomment>This conversation and all its messages will be deleted. Do You want to continue ?</extracomment>
<translation>Dieser Chat und alle seine Nachrichten werden gelöscht. Möchten Sie fortfahren?</translation> <translation>Dieser Chat und alle seine Nachrichten werden gelöscht. Möchten Sie fortfahren?</translation>
@ -2606,32 +2606,32 @@ Stellen Sie sicher, dass Sie keine sensiblen Informationen teilen!</translation>
<translation>Keine Chats in der Historie</translation> <translation>Keine Chats in der Historie</translation>
</message> </message>
<message> <message>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="275"/> <location filename="../../view/Page/Main/Chat/ChatPage.qml" line="279"/>
<source>chat_action_start_new_chat</source> <source>chat_action_start_new_chat</source>
<extracomment>&quot;New chat&quot;</extracomment> <extracomment>&quot;New chat&quot;</extracomment>
<translation>Neuer Chat</translation> <translation>Neuer Chat</translation>
</message> </message>
<message> <message>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="313"/> <location filename="../../view/Page/Main/Chat/ChatPage.qml" line="317"/>
<source>chat_start_group_chat_title</source> <source>chat_start_group_chat_title</source>
<extracomment>&quot;Nouveau groupe&quot;</extracomment> <extracomment>&quot;Nouveau groupe&quot;</extracomment>
<translation>Neuer Gruppenchat</translation> <translation>Neuer Gruppenchat</translation>
</message> </message>
<message> <message>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="315"/> <location filename="../../view/Page/Main/Chat/ChatPage.qml" line="319"/>
<source>chat_action_start_group_chat</source> <source>chat_action_start_group_chat</source>
<extracomment>&quot;Créer&quot;</extracomment> <extracomment>&quot;Créer&quot;</extracomment>
<translation>Erstellen</translation> <translation>Erstellen</translation>
</message> </message>
<message> <message>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="331"/> <location filename="../../view/Page/Main/Chat/ChatPage.qml" line="335"/>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="354"/> <location filename="../../view/Page/Main/Chat/ChatPage.qml" line="358"/>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="359"/> <location filename="../../view/Page/Main/Chat/ChatPage.qml" line="363"/>
<source>information_popup_error_title</source> <source>information_popup_error_title</source>
<translation>Fehler</translation> <translation>Fehler</translation>
</message> </message>
<message> <message>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="333"/> <location filename="../../view/Page/Main/Chat/ChatPage.qml" line="337"/>
<source>information_popup_chat_creation_failed_message</source> <source>information_popup_chat_creation_failed_message</source>
<extracomment>&quot;La création a échoué&quot;</extracomment> <extracomment>&quot;La création a échoué&quot;</extracomment>
<translation>Erstellen fehlgeschlagen</translation> <translation>Erstellen fehlgeschlagen</translation>
@ -2642,25 +2642,25 @@ Stellen Sie sicher, dass Sie keine sensiblen Informationen teilen!</translation>
<translation type="obsolete">Der Codec konnte nicht installiert werden.</translation> <translation type="obsolete">Der Codec konnte nicht installiert werden.</translation>
</message> </message>
<message> <message>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="351"/> <location filename="../../view/Page/Main/Chat/ChatPage.qml" line="355"/>
<source>group_chat_error_must_have_name</source> <source>group_chat_error_must_have_name</source>
<extracomment>&quot;Un nom doit être donné au groupe</extracomment> <extracomment>&quot;Un nom doit être donné au groupe</extracomment>
<translation>Für den Gruppenchat muss ein Name festgelegt werden</translation> <translation>Für den Gruppenchat muss ein Name festgelegt werden</translation>
</message> </message>
<message> <message>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="356"/> <location filename="../../view/Page/Main/Chat/ChatPage.qml" line="360"/>
<source>group_chat_error_no_participant</source> <source>group_chat_error_no_participant</source>
<extracomment>&quot;Please select at least one participant</extracomment> <extracomment>&quot;Please select at least one participant</extracomment>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="361"/> <location filename="../../view/Page/Main/Chat/ChatPage.qml" line="365"/>
<source>group_call_error_not_connected</source> <source>group_call_error_not_connected</source>
<extracomment>&quot;Vous n&apos;etes pas connecté&quot;</extracomment> <extracomment>&quot;Vous n&apos;etes pas connecté&quot;</extracomment>
<translation>Sie sind nicht verbunden</translation> <translation>Sie sind nicht verbunden</translation>
</message> </message>
<message> <message>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="367"/> <location filename="../../view/Page/Main/Chat/ChatPage.qml" line="371"/>
<source>chat_creation_in_progress</source> <source>chat_creation_in_progress</source>
<extracomment>Creation de la conversation en cours </extracomment> <extracomment>Creation de la conversation en cours </extracomment>
<translation>Chat-Erstellung ausstehend</translation> <translation>Chat-Erstellung ausstehend</translation>

View file

@ -2095,65 +2095,65 @@
<context> <context>
<name>ChatListView</name> <name>ChatListView</name>
<message> <message>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="259"/> <location filename="../../view/Control/Display/Chat/ChatListView.qml" line="265"/>
<source>chat_message_is_writing_info</source> <source>chat_message_is_writing_info</source>
<extracomment>%1 is writing</extracomment> <extracomment>%1 is writing</extracomment>
<translation>%1 is writing</translation> <translation>%1 is writing</translation>
</message> </message>
<message> <message>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="261"/> <location filename="../../view/Control/Display/Chat/ChatListView.qml" line="267"/>
<source>chat_message_draft_sending_text</source> <source>chat_message_draft_sending_text</source>
<translation>Draft : %1</translation> <translation>Draft : %1</translation>
</message> </message>
<message> <message>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="406"/> <location filename="../../view/Control/Display/Chat/ChatListView.qml" line="412"/>
<source>chat_room_delete</source> <source>chat_room_delete</source>
<extracomment>&quot;Delete&quot;</extracomment> <extracomment>&quot;Delete&quot;</extracomment>
<translation>Delete</translation> <translation>Delete</translation>
</message> </message>
<message> <message>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="345"/> <location filename="../../view/Control/Display/Chat/ChatListView.qml" line="351"/>
<source>chat_room_mute</source> <source>chat_room_mute</source>
<translation>Mute</translation> <translation>Mute</translation>
</message> </message>
<message> <message>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="344"/> <location filename="../../view/Control/Display/Chat/ChatListView.qml" line="350"/>
<source>chat_room_unmute</source> <source>chat_room_unmute</source>
<extracomment>&quot;Mute&quot;</extracomment> <extracomment>&quot;Mute&quot;</extracomment>
<translation>Unmute</translation> <translation>Unmute</translation>
</message> </message>
<message> <message>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="358"/> <location filename="../../view/Control/Display/Chat/ChatListView.qml" line="364"/>
<source>chat_room_mark_as_read</source> <source>chat_room_mark_as_read</source>
<extracomment>&quot;Mark as read&quot;</extracomment> <extracomment>&quot;Mark as read&quot;</extracomment>
<translation>Mark as read</translation> <translation>Mark as read</translation>
</message> </message>
<message> <message>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="377"/> <location filename="../../view/Control/Display/Chat/ChatListView.qml" line="383"/>
<source>chat_room_leave</source> <source>chat_room_leave</source>
<extracomment>&quot;leave&quot;</extracomment> <extracomment>&quot;leave&quot;</extracomment>
<translation>Leave</translation> <translation>Leave</translation>
</message> </message>
<message> <message>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="383"/> <location filename="../../view/Control/Display/Chat/ChatListView.qml" line="389"/>
<source>chat_list_leave_chat_popup_title</source> <source>chat_list_leave_chat_popup_title</source>
<extracomment>leave the conversation ?</extracomment> <extracomment>leave the conversation ?</extracomment>
<translation>Leave the conversation ?</translation> <translation>Leave the conversation ?</translation>
</message> </message>
<message> <message>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="385"/> <location filename="../../view/Control/Display/Chat/ChatListView.qml" line="391"/>
<source>chat_list_leave_chat_popup_message</source> <source>chat_list_leave_chat_popup_message</source>
<extracomment>You will not be able to send or receive messages in this conversation anymore. Do You want to continue ?</extracomment> <extracomment>You will not be able to send or receive messages in this conversation anymore. Do You want to continue ?</extracomment>
<translation>You will not be able to send or receive messages in this conversation anymore. Do You want to continue ?</translation> <translation>You will not be able to send or receive messages in this conversation anymore. Do You want to continue ?</translation>
</message> </message>
<message> <message>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="412"/> <location filename="../../view/Control/Display/Chat/ChatListView.qml" line="418"/>
<source>chat_list_delete_chat_popup_title</source> <source>chat_list_delete_chat_popup_title</source>
<extracomment>Delete the conversation ?</extracomment> <extracomment>Delete the conversation ?</extracomment>
<translation>Delete the conversation ?</translation> <translation>Delete the conversation ?</translation>
</message> </message>
<message> <message>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="414"/> <location filename="../../view/Control/Display/Chat/ChatListView.qml" line="420"/>
<source>chat_list_delete_chat_popup_message</source> <source>chat_list_delete_chat_popup_message</source>
<extracomment>This conversation and all its messages will be deleted. Do You want to continue ?</extracomment> <extracomment>This conversation and all its messages will be deleted. Do You want to continue ?</extracomment>
<translation>This conversation and all its messages will be deleted. Do You want to continue ?</translation> <translation>This conversation and all its messages will be deleted. Do You want to continue ?</translation>
@ -2564,56 +2564,56 @@ Only your correspondent can decrypt them.</translation>
<translation>No conversation in history</translation> <translation>No conversation in history</translation>
</message> </message>
<message> <message>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="275"/> <location filename="../../view/Page/Main/Chat/ChatPage.qml" line="279"/>
<source>chat_action_start_new_chat</source> <source>chat_action_start_new_chat</source>
<extracomment>&quot;New chat&quot;</extracomment> <extracomment>&quot;New chat&quot;</extracomment>
<translation>New conversation</translation> <translation>New conversation</translation>
</message> </message>
<message> <message>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="313"/> <location filename="../../view/Page/Main/Chat/ChatPage.qml" line="317"/>
<source>chat_start_group_chat_title</source> <source>chat_start_group_chat_title</source>
<extracomment>&quot;Nouveau groupe&quot;</extracomment> <extracomment>&quot;Nouveau groupe&quot;</extracomment>
<translation>New group</translation> <translation>New group</translation>
</message> </message>
<message> <message>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="315"/> <location filename="../../view/Page/Main/Chat/ChatPage.qml" line="319"/>
<source>chat_action_start_group_chat</source> <source>chat_action_start_group_chat</source>
<extracomment>&quot;Créer&quot;</extracomment> <extracomment>&quot;Créer&quot;</extracomment>
<translation>Create</translation> <translation>Create</translation>
</message> </message>
<message> <message>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="331"/> <location filename="../../view/Page/Main/Chat/ChatPage.qml" line="335"/>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="354"/> <location filename="../../view/Page/Main/Chat/ChatPage.qml" line="358"/>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="359"/> <location filename="../../view/Page/Main/Chat/ChatPage.qml" line="363"/>
<source>information_popup_error_title</source> <source>information_popup_error_title</source>
<translation>Error</translation> <translation>Error</translation>
</message> </message>
<message> <message>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="333"/> <location filename="../../view/Page/Main/Chat/ChatPage.qml" line="337"/>
<source>information_popup_chat_creation_failed_message</source> <source>information_popup_chat_creation_failed_message</source>
<extracomment>&quot;La création a échoué&quot;</extracomment> <extracomment>&quot;La création a échoué&quot;</extracomment>
<translation>Creation failed</translation> <translation>Creation failed</translation>
</message> </message>
<message> <message>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="351"/> <location filename="../../view/Page/Main/Chat/ChatPage.qml" line="355"/>
<source>group_chat_error_must_have_name</source> <source>group_chat_error_must_have_name</source>
<extracomment>&quot;Un nom doit être donné au groupe</extracomment> <extracomment>&quot;Un nom doit être donné au groupe</extracomment>
<translation>A name must be set for the group</translation> <translation>A name must be set for the group</translation>
</message> </message>
<message> <message>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="356"/> <location filename="../../view/Page/Main/Chat/ChatPage.qml" line="360"/>
<source>group_chat_error_no_participant</source> <source>group_chat_error_no_participant</source>
<extracomment>&quot;Please select at least one participant</extracomment> <extracomment>&quot;Please select at least one participant</extracomment>
<translation>Please select at least one participant</translation> <translation>Please select at least one participant</translation>
</message> </message>
<message> <message>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="361"/> <location filename="../../view/Page/Main/Chat/ChatPage.qml" line="365"/>
<source>group_call_error_not_connected</source> <source>group_call_error_not_connected</source>
<extracomment>&quot;Vous n&apos;etes pas connecté&quot;</extracomment> <extracomment>&quot;Vous n&apos;etes pas connecté&quot;</extracomment>
<translation>You are not connected</translation> <translation>You are not connected</translation>
</message> </message>
<message> <message>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="367"/> <location filename="../../view/Page/Main/Chat/ChatPage.qml" line="371"/>
<source>chat_creation_in_progress</source> <source>chat_creation_in_progress</source>
<extracomment>Creation de la conversation en cours </extracomment> <extracomment>Creation de la conversation en cours </extracomment>
<translation>Chat creation pending</translation> <translation>Chat creation pending</translation>

View file

@ -2090,65 +2090,65 @@
<context> <context>
<name>ChatListView</name> <name>ChatListView</name>
<message> <message>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="259"/> <location filename="../../view/Control/Display/Chat/ChatListView.qml" line="265"/>
<source>chat_message_is_writing_info</source> <source>chat_message_is_writing_info</source>
<extracomment>%1 is writing</extracomment> <extracomment>%1 is writing</extracomment>
<translation>%1 est en train d&apos;écrire</translation> <translation>%1 est en train d&apos;écrire</translation>
</message> </message>
<message> <message>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="261"/> <location filename="../../view/Control/Display/Chat/ChatListView.qml" line="267"/>
<source>chat_message_draft_sending_text</source> <source>chat_message_draft_sending_text</source>
<translation>Brouillon : %1</translation> <translation>Brouillon : %1</translation>
</message> </message>
<message> <message>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="406"/> <location filename="../../view/Control/Display/Chat/ChatListView.qml" line="412"/>
<source>chat_room_delete</source> <source>chat_room_delete</source>
<extracomment>&quot;Delete&quot;</extracomment> <extracomment>&quot;Delete&quot;</extracomment>
<translation>Supprimer</translation> <translation>Supprimer</translation>
</message> </message>
<message> <message>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="345"/> <location filename="../../view/Control/Display/Chat/ChatListView.qml" line="351"/>
<source>chat_room_mute</source> <source>chat_room_mute</source>
<translation>Mettre en sourdine</translation> <translation>Mettre en sourdine</translation>
</message> </message>
<message> <message>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="344"/> <location filename="../../view/Control/Display/Chat/ChatListView.qml" line="350"/>
<source>chat_room_unmute</source> <source>chat_room_unmute</source>
<extracomment>&quot;Mute&quot;</extracomment> <extracomment>&quot;Mute&quot;</extracomment>
<translation>Enlever la sourdine </translation> <translation>Enlever la sourdine </translation>
</message> </message>
<message> <message>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="358"/> <location filename="../../view/Control/Display/Chat/ChatListView.qml" line="364"/>
<source>chat_room_mark_as_read</source> <source>chat_room_mark_as_read</source>
<extracomment>&quot;Mark as read&quot;</extracomment> <extracomment>&quot;Mark as read&quot;</extracomment>
<translation>Marquer comme lu</translation> <translation>Marquer comme lu</translation>
</message> </message>
<message> <message>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="377"/> <location filename="../../view/Control/Display/Chat/ChatListView.qml" line="383"/>
<source>chat_room_leave</source> <source>chat_room_leave</source>
<extracomment>&quot;leave&quot;</extracomment> <extracomment>&quot;leave&quot;</extracomment>
<translation>Quitter la conversation</translation> <translation>Quitter la conversation</translation>
</message> </message>
<message> <message>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="383"/> <location filename="../../view/Control/Display/Chat/ChatListView.qml" line="389"/>
<source>chat_list_leave_chat_popup_title</source> <source>chat_list_leave_chat_popup_title</source>
<extracomment>leave the conversation ?</extracomment> <extracomment>leave the conversation ?</extracomment>
<translation>Quitter la conversation ?</translation> <translation>Quitter la conversation ?</translation>
</message> </message>
<message> <message>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="385"/> <location filename="../../view/Control/Display/Chat/ChatListView.qml" line="391"/>
<source>chat_list_leave_chat_popup_message</source> <source>chat_list_leave_chat_popup_message</source>
<extracomment>You will not be able to send or receive messages in this conversation anymore. Do You want to continue ?</extracomment> <extracomment>You will not be able to send or receive messages in this conversation anymore. Do You want to continue ?</extracomment>
<translation>Vous ne pourrez plus envoyer ou recevoir de messages dans cette conversation. Souhaitez-vous continuer ?</translation> <translation>Vous ne pourrez plus envoyer ou recevoir de messages dans cette conversation. Souhaitez-vous continuer ?</translation>
</message> </message>
<message> <message>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="412"/> <location filename="../../view/Control/Display/Chat/ChatListView.qml" line="418"/>
<source>chat_list_delete_chat_popup_title</source> <source>chat_list_delete_chat_popup_title</source>
<extracomment>Delete the conversation ?</extracomment> <extracomment>Delete the conversation ?</extracomment>
<translation>Supprimer la conversation ?</translation> <translation>Supprimer la conversation ?</translation>
</message> </message>
<message> <message>
<location filename="../../view/Control/Display/Chat/ChatListView.qml" line="414"/> <location filename="../../view/Control/Display/Chat/ChatListView.qml" line="420"/>
<source>chat_list_delete_chat_popup_message</source> <source>chat_list_delete_chat_popup_message</source>
<extracomment>This conversation and all its messages will be deleted. Do You want to continue ?</extracomment> <extracomment>This conversation and all its messages will be deleted. Do You want to continue ?</extracomment>
<translation>La conversation et tous ses messages seront supprimés. Souhaitez-vous continuer ?</translation> <translation>La conversation et tous ses messages seront supprimés. Souhaitez-vous continuer ?</translation>
@ -2559,56 +2559,56 @@ en bout. Seul votre correspondant peut les déchiffrer.</translation>
<translation>Aucune conversation dans votre historique</translation> <translation>Aucune conversation dans votre historique</translation>
</message> </message>
<message> <message>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="275"/> <location filename="../../view/Page/Main/Chat/ChatPage.qml" line="279"/>
<source>chat_action_start_new_chat</source> <source>chat_action_start_new_chat</source>
<extracomment>&quot;New chat&quot;</extracomment> <extracomment>&quot;New chat&quot;</extracomment>
<translation>Nouvelle conversation</translation> <translation>Nouvelle conversation</translation>
</message> </message>
<message> <message>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="313"/> <location filename="../../view/Page/Main/Chat/ChatPage.qml" line="317"/>
<source>chat_start_group_chat_title</source> <source>chat_start_group_chat_title</source>
<extracomment>&quot;Nouveau groupe&quot;</extracomment> <extracomment>&quot;Nouveau groupe&quot;</extracomment>
<translation>Nouveau groupe</translation> <translation>Nouveau groupe</translation>
</message> </message>
<message> <message>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="315"/> <location filename="../../view/Page/Main/Chat/ChatPage.qml" line="319"/>
<source>chat_action_start_group_chat</source> <source>chat_action_start_group_chat</source>
<extracomment>&quot;Créer&quot;</extracomment> <extracomment>&quot;Créer&quot;</extracomment>
<translation>Créer</translation> <translation>Créer</translation>
</message> </message>
<message> <message>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="331"/> <location filename="../../view/Page/Main/Chat/ChatPage.qml" line="335"/>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="354"/> <location filename="../../view/Page/Main/Chat/ChatPage.qml" line="358"/>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="359"/> <location filename="../../view/Page/Main/Chat/ChatPage.qml" line="363"/>
<source>information_popup_error_title</source> <source>information_popup_error_title</source>
<translation>Erreur</translation> <translation>Erreur</translation>
</message> </message>
<message> <message>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="333"/> <location filename="../../view/Page/Main/Chat/ChatPage.qml" line="337"/>
<source>information_popup_chat_creation_failed_message</source> <source>information_popup_chat_creation_failed_message</source>
<extracomment>&quot;La création a échoué&quot;</extracomment> <extracomment>&quot;La création a échoué&quot;</extracomment>
<translation>La création a échoué</translation> <translation>La création a échoué</translation>
</message> </message>
<message> <message>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="351"/> <location filename="../../view/Page/Main/Chat/ChatPage.qml" line="355"/>
<source>group_chat_error_must_have_name</source> <source>group_chat_error_must_have_name</source>
<extracomment>&quot;Un nom doit être donné au groupe</extracomment> <extracomment>&quot;Un nom doit être donné au groupe</extracomment>
<translation>Un nom doit être donné au groupe</translation> <translation>Un nom doit être donné au groupe</translation>
</message> </message>
<message> <message>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="356"/> <location filename="../../view/Page/Main/Chat/ChatPage.qml" line="360"/>
<source>group_chat_error_no_participant</source> <source>group_chat_error_no_participant</source>
<extracomment>&quot;Please select at least one participant</extracomment> <extracomment>&quot;Please select at least one participant</extracomment>
<translation>Veuillez sélectionner au moins un participant</translation> <translation>Veuillez sélectionner au moins un participant</translation>
</message> </message>
<message> <message>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="361"/> <location filename="../../view/Page/Main/Chat/ChatPage.qml" line="365"/>
<source>group_call_error_not_connected</source> <source>group_call_error_not_connected</source>
<extracomment>&quot;Vous n&apos;etes pas connecté&quot;</extracomment> <extracomment>&quot;Vous n&apos;etes pas connecté&quot;</extracomment>
<translation>Vous n&apos;êtes pas connecté</translation> <translation>Vous n&apos;êtes pas connecté</translation>
</message> </message>
<message> <message>
<location filename="../../view/Page/Main/Chat/ChatPage.qml" line="367"/> <location filename="../../view/Page/Main/Chat/ChatPage.qml" line="371"/>
<source>chat_creation_in_progress</source> <source>chat_creation_in_progress</source>
<extracomment>Creation de la conversation en cours </extracomment> <extracomment>Creation de la conversation en cours </extracomment>
<translation>Création de la conversation en cours</translation> <translation>Création de la conversation en cours</translation>

View file

@ -45,7 +45,6 @@ ListView {
} }
onModelAboutToBeReset: { onModelAboutToBeReset: {
loading = true loading = true
} }
onModelReset: { onModelReset: {
loading = false loading = false
@ -56,8 +55,13 @@ ListView {
else if (mainItem.chatToSelect) { else if (mainItem.chatToSelect) {
selectChat(mainItem.chatToSelect) selectChat(mainItem.chatToSelect)
mainItem.chatToSelect = null mainItem.chatToSelect = null
} else {
selectChat(mainItem.currentChatGui)
} }
} }
onChatAdded: (chat) => {
mainItem.chatToSelect = chat
}
onRowsRemoved: { onRowsRemoved: {
var index = mainItem.currentIndex var index = mainItem.currentIndex
mainItem.currentIndex = -1 mainItem.currentIndex = -1
@ -83,7 +87,9 @@ ListView {
function selectChat(chatGui, force) { function selectChat(chatGui, force) {
var index = chatProxy.findChatIndex(chatGui) var index = chatProxy.findChatIndex(chatGui)
// force adding chat to list if not in list for now // force adding chat to list if it already exists
// but has not been added to the list yet because
// it is empty and hide_empty_chatrooms is set
if (index === -1 && force === true && chatGui) { if (index === -1 && force === true && chatGui) {
if (chatProxy.addChatInList(chatGui)) { if (chatProxy.addChatInList(chatGui)) {
var index = chatProxy.findChatIndex(chatGui) var index = chatProxy.findChatIndex(chatGui)

View file

@ -28,7 +28,7 @@ AbstractMainPage {
property var selectedChatGui: null property var selectedChatGui: null
property string remoteAddress property string remoteAddress
onRemoteAddressChanged: console.log("ChatPage : remote address changed :", remoteAddress) onRemoteAddressChanged: console.log("ChatPage : remote address changed :", remoteAddress)
property var remoteChatObj: UtilsCpp.getChatForAddress(remoteAddress) property var remoteChatObj: remoteAddress.length > 0 ? UtilsCpp.getChatForAddress(remoteAddress) : null
property var remoteChat: remoteChatObj ? remoteChatObj.value : null property var remoteChat: remoteChatObj ? remoteChatObj.value : null
signal openChatRequested(ChatGui chat) signal openChatRequested(ChatGui chat)
@ -46,8 +46,6 @@ AbstractMainPage {
UtilsCpp.showInformationPopup(qsTr("info_popup_error_title"), UtilsCpp.showInformationPopup(qsTr("info_popup_error_title"),
//: Chat room creation failed ! //: Chat room creation failed !
qsTr("info_popup_chatroom_creation_failed"), false) qsTr("info_popup_chatroom_creation_failed"), false)
} else if (remoteChat.core.state === LinphoneEnums.ChatRoomState.Created) {
openChatRequested(remoteChat)
} }
} }
} }
@ -78,6 +76,7 @@ AbstractMainPage {
rightPanelStackView.visible: false//listStackView.currentItem && listStackView.currentItem.objectName === "chatListItem" && selectedChatGui !== null rightPanelStackView.visible: false//listStackView.currentItem && listStackView.currentItem.objectName === "chatListItem" && selectedChatGui !== null
onNoItemButtonPressed: goToNewChat() onNoItemButtonPressed: goToNewChat()
signal newChatItemOpen()
showDefaultItem: listStackView.currentItem showDefaultItem: listStackView.currentItem
&& listStackView.currentItem.objectName == "chatListItem" && listStackView.currentItem.objectName == "chatListItem"
@ -88,6 +87,7 @@ AbstractMainPage {
if (listStackView.currentItem if (listStackView.currentItem
&& listStackView.currentItem.objectName != "newChatItem") && listStackView.currentItem.objectName != "newChatItem")
listStackView.push(newChatItem) listStackView.push(newChatItem)
newChatItemOpen()
} }
Dialog { Dialog {
@ -226,6 +226,10 @@ AbstractMainPage {
function onOpenChatRequested(chat) { function onOpenChatRequested(chat) {
chatListView.chatToSelect = chat chatListView.chatToSelect = chat
} }
function onNewChatItemOpen() {
// reset index to clear right panel when opening new conversation
chatListView.currentIndex = -1
}
} }
} }
} }