From d7dfe986c0c6aa011be5cff0e22671bcde8efac7 Mon Sep 17 00:00:00 2001 From: Julien Wadel Date: Tue, 9 Nov 2021 22:58:54 +0100 Subject: [PATCH] - Forward messages to a contact, a sip address or directly to a timeline. - Fix CI on Qt5_DIR. - Hide reply message preview after sending message. - Fix binding loop on sub-messages. - Reduce spacing size in message. --- .gitlab-ci-files/job-macosx-desktop.yml | 2 +- CHANGELOG.md | 2 +- linphone-app/assets/languages/da.ts | 27 +++++ linphone-app/assets/languages/de.ts | 27 +++++ linphone-app/assets/languages/en.ts | 27 +++++ linphone-app/assets/languages/es.ts | 27 +++++ linphone-app/assets/languages/fr_FR.ts | 27 +++++ linphone-app/assets/languages/hu.ts | 27 +++++ linphone-app/assets/languages/it.ts | 27 +++++ linphone-app/assets/languages/ja.ts | 27 +++++ linphone-app/assets/languages/lt.ts | 27 +++++ linphone-app/assets/languages/pt_BR.ts | 27 +++++ linphone-app/assets/languages/ru.ts | 27 +++++ linphone-app/assets/languages/sv.ts | 27 +++++ linphone-app/assets/languages/tr.ts | 27 +++++ linphone-app/assets/languages/uk.ts | 27 +++++ linphone-app/assets/languages/zh_CN.ts | 27 +++++ linphone-app/resources.qrc | 4 + .../chat-events/ChatMessageModel.cpp | 16 +++ .../chat-events/ChatMessageModel.hpp | 9 ++ .../components/chat-room/ChatRoomModel.cpp | 8 ++ .../components/chat-room/ChatRoomModel.hpp | 3 +- .../chat-room/ChatRoomProxyModel.cpp | 1 + .../chat-room/ChatRoomProxyModel.hpp | 2 + .../search/SearchSipAddressesModel.cpp | 8 +- .../Common/Dialog/DialogDescription.qml | 6 +- .../Common/View/ScrollableListView.qml | 6 +- .../Common/Window/ApplicationWindow.qml | 2 +- .../modules/Common/Window/VirtualWindow.qml | 4 +- .../ui/modules/Common/Window/Window.js | 2 +- .../ui/modules/Common/Window/Window.qml | 2 +- linphone-app/ui/modules/Common/qmldir | 1 + .../ui/modules/Linphone/Chat/Chat.qml | 22 +++- .../modules/Linphone/Chat/ChatDeliveries.qml | 5 +- .../Linphone/Chat/ChatForwardMessage.qml | 61 ++++++++++ .../Linphone/Chat/ChatMessagePreview.qml | 4 + .../Linphone/Chat/ChatReplyMessage.qml | 20 ++-- .../Linphone/Chat/ChatReplyPreview.qml | 5 +- .../ui/modules/Linphone/Chat/FileMessage.qml | 2 + .../modules/Linphone/Chat/IncomingMessage.qml | 2 + .../ui/modules/Linphone/Chat/Message.qml | 15 ++- .../modules/Linphone/Chat/OutgoingMessage.qml | 6 +- .../Linphone/Dialog/SipAddressDialog.qml | 104 ++++++++++++++++++ .../Styles/Chat/ChatForwardMessageStyle.qml | 23 ++++ .../Styles/Dialog/SipAddressDialogStyle.qml | 31 ++++++ .../ui/modules/Linphone/Styles/qmldir | 2 + .../ui/modules/Linphone/Timeline/Timeline.qml | 22 ++-- .../Linphone/View/SipAddressesView.qml | 8 +- linphone-app/ui/modules/Linphone/qmldir | 9 +- 49 files changed, 776 insertions(+), 48 deletions(-) create mode 100644 linphone-app/ui/modules/Linphone/Chat/ChatForwardMessage.qml create mode 100644 linphone-app/ui/modules/Linphone/Dialog/SipAddressDialog.qml create mode 100644 linphone-app/ui/modules/Linphone/Styles/Chat/ChatForwardMessageStyle.qml create mode 100644 linphone-app/ui/modules/Linphone/Styles/Dialog/SipAddressDialogStyle.qml diff --git a/.gitlab-ci-files/job-macosx-desktop.yml b/.gitlab-ci-files/job-macosx-desktop.yml index b6032e737..e7fb734e3 100644 --- a/.gitlab-ci-files/job-macosx-desktop.yml +++ b/.gitlab-ci-files/job-macosx-desktop.yml @@ -5,7 +5,7 @@ .build_all_script: &build_all_script | ccache -s - export Qt5_DIR=/usr/local/opt/qt/lib/cmake + export Qt5_DIR=/usr/local/opt/qt/lib/cmake/Qt5 export PATH=$PATH:/usr/local/opt/qt/bin if [ -d "build" ]; then rm -rf build; fi; mkdir -p build/OUTPUT diff --git a/CHANGELOG.md b/CHANGELOG.md index ce976832f..c4b1c9757 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Added - Features: - * messages features : Reply + * messages features : Reply, forward (to contact, to a SIP address or to a timeline) ## 4.3.2 diff --git a/linphone-app/assets/languages/da.ts b/linphone-app/assets/languages/da.ts index 937dc2639..477a7a151 100644 --- a/linphone-app/assets/languages/da.ts +++ b/linphone-app/assets/languages/da.ts @@ -474,6 +474,11 @@ Server url ikke konfigureret. "Selection copied to clipboard" : when a user copy a text from the menu, this message show up. + + forwardDialogTitle + 'Choose where to forward the message' : Dialog title for choosing where to forward the current message. + + ChatDeliveries @@ -2670,6 +2675,28 @@ Klik her: <a href="%1">%1</a> + + SipAddressDialog + + cancel + ANNULLER + + + contactsSearchPlaceholder + 'Search in contacts' : Placeholder for a search a contact + + + + contactsSearchTooltip + 'Search an address in your contacts or use a custom one.' : tooltip + + + + timelineSelectionHeader + 'Conversations' : header for a selection in conversation list + + + SmartSearchBar diff --git a/linphone-app/assets/languages/de.ts b/linphone-app/assets/languages/de.ts index 21ba52830..94e306494 100644 --- a/linphone-app/assets/languages/de.ts +++ b/linphone-app/assets/languages/de.ts @@ -474,6 +474,11 @@ Server URL ist nicht konfiguriert. "Selection copied to clipboard" : when a user copy a text from the menu, this message show up. + + forwardDialogTitle + 'Choose where to forward the message' : Dialog title for choosing where to forward the current message. + + ChatDeliveries @@ -2670,6 +2675,28 @@ Klicken Sie hier: <a href="%1">%1</a> + + SipAddressDialog + + cancel + ABBRECHEN + + + contactsSearchPlaceholder + 'Search in contacts' : Placeholder for a search a contact + + + + contactsSearchTooltip + 'Search an address in your contacts or use a custom one.' : tooltip + + + + timelineSelectionHeader + 'Conversations' : header for a selection in conversation list + + + SmartSearchBar diff --git a/linphone-app/assets/languages/en.ts b/linphone-app/assets/languages/en.ts index cbd882a41..7f8506010 100644 --- a/linphone-app/assets/languages/en.ts +++ b/linphone-app/assets/languages/en.ts @@ -474,6 +474,11 @@ Server URL not configured. "Selection copied to clipboard" : when a user copy a text from the menu, this message show up. Selection copied to clipboard + + forwardDialogTitle + 'Choose where to forward the message' : Dialog title for choosing where to forward the current message. + Choose where to forward the message + ChatDeliveries @@ -2693,6 +2698,28 @@ Click here: <a href="%1">%1</a> Tunnel + + SipAddressDialog + + cancel + Cancel + + + contactsSearchPlaceholder + 'Search in contacts' : Placeholder for a search a contact + Search in contacts + + + contactsSearchTooltip + 'Search an address in your contacts or use a custom one.' : tooltip + Search an address in your contacts or use a custom one. + + + timelineSelectionHeader + 'Conversations' : header for a selection in conversation list + Conversations + + SmartSearchBar diff --git a/linphone-app/assets/languages/es.ts b/linphone-app/assets/languages/es.ts index 858ffca36..8719c481c 100644 --- a/linphone-app/assets/languages/es.ts +++ b/linphone-app/assets/languages/es.ts @@ -474,6 +474,11 @@ URL del servidor no configurada. "Selection copied to clipboard" : when a user copy a text from the menu, this message show up. + + forwardDialogTitle + 'Choose where to forward the message' : Dialog title for choosing where to forward the current message. + + ChatDeliveries @@ -2670,6 +2675,28 @@ Haga clic aquí: <a href="%1">%1 </a> + + SipAddressDialog + + cancel + CANCELAR + + + contactsSearchPlaceholder + 'Search in contacts' : Placeholder for a search a contact + + + + contactsSearchTooltip + 'Search an address in your contacts or use a custom one.' : tooltip + + + + timelineSelectionHeader + 'Conversations' : header for a selection in conversation list + + + SmartSearchBar diff --git a/linphone-app/assets/languages/fr_FR.ts b/linphone-app/assets/languages/fr_FR.ts index d933a195a..3042fdb4d 100644 --- a/linphone-app/assets/languages/fr_FR.ts +++ b/linphone-app/assets/languages/fr_FR.ts @@ -474,6 +474,11 @@ URL du serveur non configurée. "Selection copied to clipboard" : when a user copy a text from the menu, this message show up. La sélection a été copiée dans le presse-papier + + forwardDialogTitle + 'Choose where to forward the message' : Dialog title for choosing where to forward the current message. + + ChatDeliveries @@ -2670,6 +2675,28 @@ Cliquez ici : <a href="%1">%1</a> Tunnel + + SipAddressDialog + + cancel + + + + contactsSearchPlaceholder + 'Search in contacts' : Placeholder for a search a contact + + + + contactsSearchTooltip + 'Search an address in your contacts or use a custom one.' : tooltip + + + + timelineSelectionHeader + 'Conversations' : header for a selection in conversation list + + + SmartSearchBar diff --git a/linphone-app/assets/languages/hu.ts b/linphone-app/assets/languages/hu.ts index 9f35ae17a..01a1c8d92 100644 --- a/linphone-app/assets/languages/hu.ts +++ b/linphone-app/assets/languages/hu.ts @@ -473,6 +473,11 @@ A kiszolgáló URL-je nincs konfigurálva. "Selection copied to clipboard" : when a user copy a text from the menu, this message show up. A kijelölés a vágólapra másolva + + forwardDialogTitle + 'Choose where to forward the message' : Dialog title for choosing where to forward the current message. + + ChatDeliveries @@ -2660,6 +2665,28 @@ Kattintson ide: <a href="%1">%1</a> Alagút + + SipAddressDialog + + cancel + Mégse + + + contactsSearchPlaceholder + 'Search in contacts' : Placeholder for a search a contact + + + + contactsSearchTooltip + 'Search an address in your contacts or use a custom one.' : tooltip + + + + timelineSelectionHeader + 'Conversations' : header for a selection in conversation list + + + SmartSearchBar diff --git a/linphone-app/assets/languages/it.ts b/linphone-app/assets/languages/it.ts index 848f35fde..c4c544173 100644 --- a/linphone-app/assets/languages/it.ts +++ b/linphone-app/assets/languages/it.ts @@ -474,6 +474,11 @@ URL del server non configurato. "Selection copied to clipboard" : when a user copy a text from the menu, this message show up. + + forwardDialogTitle + 'Choose where to forward the message' : Dialog title for choosing where to forward the current message. + + ChatDeliveries @@ -2670,6 +2675,28 @@ Clicca: <a href="%1">%1</a> + + SipAddressDialog + + cancel + ANNULLA + + + contactsSearchPlaceholder + 'Search in contacts' : Placeholder for a search a contact + + + + contactsSearchTooltip + 'Search an address in your contacts or use a custom one.' : tooltip + + + + timelineSelectionHeader + 'Conversations' : header for a selection in conversation list + + + SmartSearchBar diff --git a/linphone-app/assets/languages/ja.ts b/linphone-app/assets/languages/ja.ts index b94c01e8b..2e54166ec 100644 --- a/linphone-app/assets/languages/ja.ts +++ b/linphone-app/assets/languages/ja.ts @@ -473,6 +473,11 @@ "Selection copied to clipboard" : when a user copy a text from the menu, this message show up. + + forwardDialogTitle + 'Choose where to forward the message' : Dialog title for choosing where to forward the current message. + + ChatDeliveries @@ -2660,6 +2665,28 @@ + + SipAddressDialog + + cancel + キャンセル + + + contactsSearchPlaceholder + 'Search in contacts' : Placeholder for a search a contact + + + + contactsSearchTooltip + 'Search an address in your contacts or use a custom one.' : tooltip + + + + timelineSelectionHeader + 'Conversations' : header for a selection in conversation list + + + SmartSearchBar diff --git a/linphone-app/assets/languages/lt.ts b/linphone-app/assets/languages/lt.ts index 501bf3120..6db8e3881 100644 --- a/linphone-app/assets/languages/lt.ts +++ b/linphone-app/assets/languages/lt.ts @@ -475,6 +475,11 @@ Nesukonfigūruotas serverio url. "Selection copied to clipboard" : when a user copy a text from the menu, this message show up. + + forwardDialogTitle + 'Choose where to forward the message' : Dialog title for choosing where to forward the current message. + + ChatDeliveries @@ -2680,6 +2685,28 @@ Spustelėkite čia: <a href="%1">%1</a> + + SipAddressDialog + + cancel + ATSISAKYTI + + + contactsSearchPlaceholder + 'Search in contacts' : Placeholder for a search a contact + + + + contactsSearchTooltip + 'Search an address in your contacts or use a custom one.' : tooltip + + + + timelineSelectionHeader + 'Conversations' : header for a selection in conversation list + + + SmartSearchBar diff --git a/linphone-app/assets/languages/pt_BR.ts b/linphone-app/assets/languages/pt_BR.ts index 55de11580..a39b43b89 100644 --- a/linphone-app/assets/languages/pt_BR.ts +++ b/linphone-app/assets/languages/pt_BR.ts @@ -474,6 +474,11 @@ URL do servidor não configurado. "Selection copied to clipboard" : when a user copy a text from the menu, this message show up. Seleção copiada para a área de transferência + + forwardDialogTitle + 'Choose where to forward the message' : Dialog title for choosing where to forward the current message. + + ChatDeliveries @@ -2670,6 +2675,28 @@ Clique aqui: <a href="%1">%1 </a> + + SipAddressDialog + + cancel + + + + contactsSearchPlaceholder + 'Search in contacts' : Placeholder for a search a contact + + + + contactsSearchTooltip + 'Search an address in your contacts or use a custom one.' : tooltip + + + + timelineSelectionHeader + 'Conversations' : header for a selection in conversation list + + + SmartSearchBar diff --git a/linphone-app/assets/languages/ru.ts b/linphone-app/assets/languages/ru.ts index 3c220282b..1f250cca5 100644 --- a/linphone-app/assets/languages/ru.ts +++ b/linphone-app/assets/languages/ru.ts @@ -475,6 +475,11 @@ "Selection copied to clipboard" : when a user copy a text from the menu, this message show up. + + forwardDialogTitle + 'Choose where to forward the message' : Dialog title for choosing where to forward the current message. + + ChatDeliveries @@ -2680,6 +2685,28 @@ + + SipAddressDialog + + cancel + ОТМЕНА + + + contactsSearchPlaceholder + 'Search in contacts' : Placeholder for a search a contact + + + + contactsSearchTooltip + 'Search an address in your contacts or use a custom one.' : tooltip + + + + timelineSelectionHeader + 'Conversations' : header for a selection in conversation list + + + SmartSearchBar diff --git a/linphone-app/assets/languages/sv.ts b/linphone-app/assets/languages/sv.ts index 99861de06..9c90d1a3c 100644 --- a/linphone-app/assets/languages/sv.ts +++ b/linphone-app/assets/languages/sv.ts @@ -474,6 +474,11 @@ Serverwebbadressen är inte konfigurerad. "Selection copied to clipboard" : when a user copy a text from the menu, this message show up. + + forwardDialogTitle + 'Choose where to forward the message' : Dialog title for choosing where to forward the current message. + + ChatDeliveries @@ -2670,6 +2675,28 @@ Klicka här: <a href="%1">%1</a> + + SipAddressDialog + + cancel + AVBRYT + + + contactsSearchPlaceholder + 'Search in contacts' : Placeholder for a search a contact + + + + contactsSearchTooltip + 'Search an address in your contacts or use a custom one.' : tooltip + + + + timelineSelectionHeader + 'Conversations' : header for a selection in conversation list + + + SmartSearchBar diff --git a/linphone-app/assets/languages/tr.ts b/linphone-app/assets/languages/tr.ts index 687cf8285..62984611a 100644 --- a/linphone-app/assets/languages/tr.ts +++ b/linphone-app/assets/languages/tr.ts @@ -473,6 +473,11 @@ Sunucu url'si yapılandırılmadı. "Selection copied to clipboard" : when a user copy a text from the menu, this message show up. + + forwardDialogTitle + 'Choose where to forward the message' : Dialog title for choosing where to forward the current message. + + ChatDeliveries @@ -2660,6 +2665,28 @@ Buraya tıklayın: <a href="%1">%1</a> + + SipAddressDialog + + cancel + İPTAL + + + contactsSearchPlaceholder + 'Search in contacts' : Placeholder for a search a contact + + + + contactsSearchTooltip + 'Search an address in your contacts or use a custom one.' : tooltip + + + + timelineSelectionHeader + 'Conversations' : header for a selection in conversation list + + + SmartSearchBar diff --git a/linphone-app/assets/languages/uk.ts b/linphone-app/assets/languages/uk.ts index 6039d55b9..32c34d6ca 100644 --- a/linphone-app/assets/languages/uk.ts +++ b/linphone-app/assets/languages/uk.ts @@ -475,6 +475,11 @@ "Selection copied to clipboard" : when a user copy a text from the menu, this message show up. + + forwardDialogTitle + 'Choose where to forward the message' : Dialog title for choosing where to forward the current message. + + ChatDeliveries @@ -2680,6 +2685,28 @@ + + SipAddressDialog + + cancel + СКАСУВАТИ + + + contactsSearchPlaceholder + 'Search in contacts' : Placeholder for a search a contact + + + + contactsSearchTooltip + 'Search an address in your contacts or use a custom one.' : tooltip + + + + timelineSelectionHeader + 'Conversations' : header for a selection in conversation list + + + SmartSearchBar diff --git a/linphone-app/assets/languages/zh_CN.ts b/linphone-app/assets/languages/zh_CN.ts index b5cbca736..7521b1a74 100644 --- a/linphone-app/assets/languages/zh_CN.ts +++ b/linphone-app/assets/languages/zh_CN.ts @@ -473,6 +473,11 @@ "Selection copied to clipboard" : when a user copy a text from the menu, this message show up. + + forwardDialogTitle + 'Choose where to forward the message' : Dialog title for choosing where to forward the current message. + + ChatDeliveries @@ -2660,6 +2665,28 @@ + + SipAddressDialog + + cancel + 取消 + + + contactsSearchPlaceholder + 'Search in contacts' : Placeholder for a search a contact + + + + contactsSearchTooltip + 'Search an address in your contacts or use a custom one.' : tooltip + + + + timelineSelectionHeader + 'Conversations' : header for a selection in conversation list + + + SmartSearchBar diff --git a/linphone-app/resources.qrc b/linphone-app/resources.qrc index 91269be15..3b9736223 100644 --- a/linphone-app/resources.qrc +++ b/linphone-app/resources.qrc @@ -271,6 +271,7 @@ ui/modules/Linphone/Chat/ChatDeliveries.qml ui/modules/Linphone/Chat/ChatMenu.qml ui/modules/Linphone/Chat/ChatMessagePreview.qml + ui/modules/Linphone/Chat/ChatForwardMessage.qml ui/modules/Linphone/Chat/ChatReplyMessage.qml ui/modules/Linphone/Chat/ChatReplyPreview.qml ui/modules/Linphone/Chat/Event.qml @@ -288,6 +289,7 @@ ui/modules/Linphone/Contact/ContactMessageCounter.qml ui/modules/Linphone/Contact/Contact.qml ui/modules/Linphone/Dialog/OnlineInstallerDialog.qml + ui/modules/Linphone/Dialog/SipAddressDialog.qml ui/modules/Linphone/History/History.qml ui/modules/Linphone/History/History.js ui/modules/Linphone/History/Event.qml @@ -312,6 +314,7 @@ ui/modules/Linphone/Styles/Calls/CallStatisticsStyle.qml ui/modules/Linphone/Styles/Calls/ConferenceControlsStyle.qml ui/modules/Linphone/Styles/Chat/ChatStyle.qml + ui/modules/Linphone/Styles/Chat/ChatForwardMessageStyle.qml ui/modules/Linphone/Styles/Chat/ChatReplyMessageStyle.qml ui/modules/Linphone/Styles/Codecs/CodecsViewerStyle.qml ui/modules/Linphone/Styles/Contact/AvatarStyle.qml @@ -319,6 +322,7 @@ ui/modules/Linphone/Styles/Contact/ContactMessageCounterStyle.qml ui/modules/Linphone/Styles/Contact/ContactStyle.qml ui/modules/Linphone/Styles/Dialog/OnlineInstallerDialogStyle.qml + ui/modules/Linphone/Styles/Dialog/SipAddressDialogStyle.qml ui/modules/Linphone/Styles/History/HistoryStyle.qml ui/modules/Linphone/Styles/Menus/SipAddressesMenuStyle.qml ui/modules/Linphone/Styles/Misc/MessageCounterStyle.qml diff --git a/linphone-app/src/components/chat-events/ChatMessageModel.cpp b/linphone-app/src/components/chat-events/ChatMessageModel.cpp index 237896c7f..1dfd81923 100644 --- a/linphone-app/src/components/chat-events/ChatMessageModel.cpp +++ b/linphone-app/src/components/chat-events/ChatMessageModel.cpp @@ -43,6 +43,7 @@ #include "components/notifier/Notifier.hpp" #include "components/participant-imdn/ParticipantImdnStateListModel.hpp" #include "components/participant-imdn/ParticipantImdnStateProxyModel.hpp" +#include "components/settings/AccountSettingsModel.hpp" #include "components/settings/SettingsModel.hpp" #include "utils/QExifImageHeader.hpp" #include "utils/Utils.hpp" @@ -444,7 +445,22 @@ ChatMessageModel * ChatMessageModel::getReplyChatMessageModel() const{ return mReplyChatMessageModel.get(); } +bool ChatMessageModel::isForward() const{ + return mChatMessage->isForward(); +} +QString ChatMessageModel::getForwardInfo() const{ + return Utils::coreStringToAppString(mChatMessage->getForwardInfo()); +} + +QString ChatMessageModel::getForwardInfoDisplayName() const{ + QString forwardInfo = getForwardInfo(); + auto forwardAddress = Utils::interpretUrl(forwardInfo); + if(!forwardAddress || CoreManager::getInstance()->getAccountSettingsModel()->getUsedSipAddress()->weakEqual(forwardAddress)) + return "";// myself + else + return Utils::getDisplayName(forwardInfo); +} //----------------------------------------------------------------------------------------------------------------------- diff --git a/linphone-app/src/components/chat-events/ChatMessageModel.hpp b/linphone-app/src/components/chat-events/ChatMessageModel.hpp index c31741f2e..1752ca5cd 100644 --- a/linphone-app/src/components/chat-events/ChatMessageModel.hpp +++ b/linphone-app/src/components/chat-events/ChatMessageModel.hpp @@ -160,6 +160,11 @@ public: Q_PROPERTY(bool isReply READ isReply CONSTANT) Q_PROPERTY(ChatMessageModel* replyChatMessageModel READ getReplyChatMessageModel CONSTANT) + Q_PROPERTY(bool isForward READ isForward CONSTANT) + Q_PROPERTY(QString getForwardInfo READ getForwardInfo CONSTANT) + Q_PROPERTY(QString getForwardInfoDisplayName READ getForwardInfoDisplayName CONSTANT) + + std::shared_ptr getChatMessage(); std::shared_ptr getContentModel(std::shared_ptr content); Q_INVOKABLE ContentModel * getContent(int i); @@ -185,6 +190,10 @@ public: bool isReply() const; ChatMessageModel * getReplyChatMessageModel() const; + bool isForward() const; + QString getForwardInfo() const; + QString getForwardInfoDisplayName() const; + //---------------------------------------------------------------------------- void setWasDownloaded(bool wasDownloaded); diff --git a/linphone-app/src/components/chat-room/ChatRoomModel.cpp b/linphone-app/src/components/chat-room/ChatRoomModel.cpp index 26b657a6d..47f922b4f 100644 --- a/linphone-app/src/components/chat-room/ChatRoomModel.cpp +++ b/linphone-app/src/components/chat-room/ChatRoomModel.cpp @@ -682,6 +682,14 @@ void ChatRoomModel::sendFileMessage (const QString &path) { emit messageSent(message); } +void ChatRoomModel::forwardMessage(ChatMessageModel * model){ + if(model){ + shared_ptr _message; + _message = mChatRoom->createForwardMessage(model->getChatMessage()); + _message->send(); + emit messageSent(_message); + } +} // ----------------------------------------------------------------------------- void ChatRoomModel::compose () { diff --git a/linphone-app/src/components/chat-room/ChatRoomModel.hpp b/linphone-app/src/components/chat-room/ChatRoomModel.hpp index c94ebe705..2c49bf2d8 100644 --- a/linphone-app/src/components/chat-room/ChatRoomModel.hpp +++ b/linphone-app/src/components/chat-room/ChatRoomModel.hpp @@ -217,8 +217,9 @@ public: void deleteChatRoom(); Q_INVOKABLE void leaveChatRoom (); Q_INVOKABLE void updateParticipants(const QVariantList& participants); - void sendMessage (const QString &message); + void sendMessage (const QString &message); void sendFileMessage (const QString &path); + Q_INVOKABLE void forwardMessage(ChatMessageModel * model); void compose (); void resetMessageCount (); Q_INVOKABLE void initEntries(); diff --git a/linphone-app/src/components/chat-room/ChatRoomProxyModel.cpp b/linphone-app/src/components/chat-room/ChatRoomProxyModel.cpp index 532b1c672..dc24563ea 100644 --- a/linphone-app/src/components/chat-room/ChatRoomProxyModel.cpp +++ b/linphone-app/src/components/chat-room/ChatRoomProxyModel.cpp @@ -120,6 +120,7 @@ CREATE_PARENT_MODEL_FUNCTION(removeAllEntries) CREATE_PARENT_MODEL_FUNCTION_WITH_PARAM(sendFileMessage, const QString &) CREATE_PARENT_MODEL_FUNCTION_WITH_PARAM(sendMessage, const QString &) +CREATE_PARENT_MODEL_FUNCTION_WITH_PARAM(forwardMessage, ChatMessageModel *) CREATE_PARENT_MODEL_FUNCTION_WITH_PARAM(setReply, ChatMessageModel*) CREATE_PARENT_MODEL_FUNCTION(clearReply) diff --git a/linphone-app/src/components/chat-room/ChatRoomProxyModel.hpp b/linphone-app/src/components/chat-room/ChatRoomProxyModel.hpp index 3a003faea..0b3f16cc7 100644 --- a/linphone-app/src/components/chat-room/ChatRoomProxyModel.hpp +++ b/linphone-app/src/components/chat-room/ChatRoomProxyModel.hpp @@ -64,6 +64,8 @@ public: Q_INVOKABLE void sendFileMessage (const QString &path); + Q_INVOKABLE void forwardMessage(ChatMessageModel * model); + Q_INVOKABLE void compose (const QString& text); Q_INVOKABLE void resetMessageCount(); diff --git a/linphone-app/src/components/search/SearchSipAddressesModel.cpp b/linphone-app/src/components/search/SearchSipAddressesModel.cpp index f6b64973c..869acf771 100644 --- a/linphone-app/src/components/search/SearchSipAddressesModel.cpp +++ b/linphone-app/src/components/search/SearchSipAddressesModel.cpp @@ -112,8 +112,12 @@ void SearchSipAddressesModel::setFilter(const QString& filter){ void SearchSipAddressesModel::searchReceived(std::list> results){ QList > addresses; - for(auto it = results.begin() ; it != results.end() ; ++it) - addresses << std::make_shared((*it)->getFriend(), (*it)->getAddress()); + for(auto it = results.begin() ; it != results.end() ; ++it){ + auto linphoneFriend = (*it)->getFriend(); + auto address = (*it)->getAddress(); + if( linphoneFriend || address) + addresses << std::make_shared(linphoneFriend,address ); + } // Fix crash on Qt 5.15.2 with endResetModel (index out of range). if(mAddresses.size() > 0){// Workaround : remove all beginRemoveRows(QModelIndex(), 0, mAddresses.size()-1); diff --git a/linphone-app/ui/modules/Common/Dialog/DialogDescription.qml b/linphone-app/ui/modules/Common/Dialog/DialogDescription.qml index 76004f32c..4f5a54c35 100644 --- a/linphone-app/ui/modules/Common/Dialog/DialogDescription.qml +++ b/linphone-app/ui/modules/Common/Dialog/DialogDescription.qml @@ -8,10 +8,12 @@ import Common.Styles 1.0 Item { property alias text: description.text + property alias horizontalAlignment: description.horizontalAlignment + property int marginOffset: 0 - height: !text ? DialogStyle.description.verticalMargin : undefined + height: !text ? (DialogStyle.description.verticalMargin + marginOffset) : undefined implicitHeight: text - ? description.implicitHeight + DialogStyle.description.verticalMargin * 2 + ? description.implicitHeight + (DialogStyle.description.verticalMargin + marginOffset) * 2 : 0 Text { diff --git a/linphone-app/ui/modules/Common/View/ScrollableListView.qml b/linphone-app/ui/modules/Common/View/ScrollableListView.qml index 8d30b7975..208a9291e 100644 --- a/linphone-app/ui/modules/Common/View/ScrollableListView.qml +++ b/linphone-app/ui/modules/Common/View/ScrollableListView.qml @@ -9,14 +9,14 @@ ListView { id: view // --------------------------------------------------------------------------- - + ScrollBar.vertical: ForceScrollBar { id: vScrollBar onPressedChanged: pressed ? view.movementStarted() : view.movementEnded() - visible:view.contentHeight > view.height + // ScrollBar.AsNeeded doesn't work. Do it ourself. + policy: (view.contentHeight > view.height ? ScrollBar.AlwaysOn : ScrollBar.AlwaysOff) } - // --------------------------------------------------------------------------- boundsBehavior: Flickable.StopAtBounds diff --git a/linphone-app/ui/modules/Common/Window/ApplicationWindow.qml b/linphone-app/ui/modules/Common/Window/ApplicationWindow.qml index 18f577fde..ac573538f 100644 --- a/linphone-app/ui/modules/Common/Window/ApplicationWindow.qml +++ b/linphone-app/ui/modules/Common/Window/ApplicationWindow.qml @@ -20,7 +20,7 @@ ApplicationWindow { // --------------------------------------------------------------------------- function attachVirtualWindow (component, properties, exitStatusHandler) { - Logic.attachVirtualWindow.call(this, component, properties, exitStatusHandler) + return Logic.attachVirtualWindow.call(this, component, properties, exitStatusHandler) } function detachVirtualWindow () { diff --git a/linphone-app/ui/modules/Common/Window/VirtualWindow.qml b/linphone-app/ui/modules/Common/Window/VirtualWindow.qml index b9f08ddf8..4666554e8 100644 --- a/linphone-app/ui/modules/Common/Window/VirtualWindow.qml +++ b/linphone-app/ui/modules/Common/Window/VirtualWindow.qml @@ -5,6 +5,7 @@ import Common 1.0 import Common.Styles 1.0 import 'Window.js' as Logic +import Linphone 1.0 as M // ============================================================================= StackView{ id:stackView @@ -13,7 +14,6 @@ StackView{ visible:!stackView.empty function setContent(url, properties, exitStatusHandler){ - var isEmpty = stackView.empty; if(properties && properties.virtualWindowHash){ var haveItem = stackView.find(function(item, index) { return item.sourceProperties && item.sourceProperties.virtualWindowHash && item.sourceProperties.virtualWindowHash == properties.virtualWindowHash; @@ -27,7 +27,7 @@ StackView{ }else{ push(page, {"sourceUrl":url, "sourceProperties":properties, "exitStatusHandler":exitStatusHandler, "setData":true, "active":true}); } - return isEmpty; + return stackView.currentItem } function unsetContent () { if(stackView.depth == 1) diff --git a/linphone-app/ui/modules/Common/Window/Window.js b/linphone-app/ui/modules/Common/Window/Window.js index e2ded1b35..a3c8eeae0 100644 --- a/linphone-app/ui/modules/Common/Window/Window.js +++ b/linphone-app/ui/modules/Common/Window/Window.js @@ -31,7 +31,7 @@ // // The exit status handler is optional. function attachVirtualWindow (component, properties, exitStatusHandler) { - virtualWindow.setContent(component, properties, exitStatusHandler); + return virtualWindow.setContent(component, properties, exitStatusHandler); } function detachVirtualWindow () { diff --git a/linphone-app/ui/modules/Common/Window/Window.qml b/linphone-app/ui/modules/Common/Window/Window.qml index 7738053fa..4ec2e30db 100644 --- a/linphone-app/ui/modules/Common/Window/Window.qml +++ b/linphone-app/ui/modules/Common/Window/Window.qml @@ -20,7 +20,7 @@ Window { // --------------------------------------------------------------------------- function attachVirtualWindow (component, properties, exitStatusHandler) { - Logic.attachVirtualWindow.call(this, component, properties, exitStatusHandler) + return Logic.attachVirtualWindow.call(this, component, properties, exitStatusHandler) } function detachVirtualWindow () { diff --git a/linphone-app/ui/modules/Common/qmldir b/linphone-app/ui/modules/Common/qmldir index 9706c5a4d..ccca1aefd 100644 --- a/linphone-app/ui/modules/Common/qmldir +++ b/linphone-app/ui/modules/Common/qmldir @@ -12,6 +12,7 @@ singleton Constants 1.0 Constants/Constants.qml BusyIndicator 1.0 Animations/BusyIndicator.qml +DialogDescription 1.0 Dialog/DialogDescription.qml ConfirmDialog 1.0 Dialog/ConfirmDialog.qml DialogPlus 1.0 Dialog/DialogPlus.qml diff --git a/linphone-app/ui/modules/Linphone/Chat/Chat.qml b/linphone-app/ui/modules/Linphone/Chat/Chat.qml index c4c9fc1e8..11a3022e2 100644 --- a/linphone-app/ui/modules/Linphone/Chat/Chat.qml +++ b/linphone-app/ui/modules/Linphone/Chat/Chat.qml @@ -274,6 +274,25 @@ Rectangle { proxyModel.setReply($chatEntry) container.replyChatMessageModel = $chatEntry } + onForwardClicked:{ + window.attachVirtualWindow(Qt.resolvedUrl('../Dialog/SipAddressDialog.qml') + //: 'Choose where to forward the message' : Dialog title for choosing where to forward the current message. + , {title: qsTr('forwardDialogTitle'), + addressSelectedCallback: function (sipAddress) { + var chat = CallsListModel.createChat(sipAddress) + if(chat){ + chat.forwardMessage($chatEntry) + TimelineListModel.select(chat) + } + }, + chatRoomSelectedCallback: function (chatRoomModel){ + if(chatRoomModel){ + chatRoomModel.forwardMessage($chatEntry) + TimelineListModel.select(chatRoomModel) + } + } + }) + } } } } @@ -399,11 +418,12 @@ Rectangle { chat.bindToEnd = true if(proxyModel.chatRoomModel) { proxyModel.sendMessage(text) - + chatMessagePreview.hide() }else{ console.log("Peer : " +proxyModel.peerAddress+ "/"+chat.model.peerAddress) proxyModel.chatRoomModel = CallsListModel.createChat(proxyModel.peerAddress) proxyModel.sendMessage(text) + chatMessagePreview.hide() } } Component.onCompleted: {text = proxyModel.cachedText; cursorPosition=text.length} diff --git a/linphone-app/ui/modules/Linphone/Chat/ChatDeliveries.qml b/linphone-app/ui/modules/Linphone/Chat/ChatDeliveries.qml index 493dd4b67..30328ff01 100644 --- a/linphone-app/ui/modules/Linphone/Chat/ChatDeliveries.qml +++ b/linphone-app/ui/modules/Linphone/Chat/ChatDeliveries.qml @@ -22,15 +22,14 @@ GridView{ id: deliveryLayout property ChatMessageModel chatMessageModel - - + //height: visible ? ChatStyle.composingText.height*container.proxyModel.composers.length : 0 height: visible ? (ChatStyle.composingText.height-5)*deliveryLayout.model.count : 0 cellWidth: parent.width; cellHeight: ChatStyle.composingText.height-5 visible:false model: ParticipantImdnStateProxyModel{ id: imdnStatesModel - chatMessageModel: deliveryLayout.chatMessageModel + chatMessageModel: deliveryLayout.visible ? deliveryLayout.chatMessageModel: null } function getText(state, displayName, stateChangeTime){ if(state == LinphoneEnums.ChatMessageStateDelivered) diff --git a/linphone-app/ui/modules/Linphone/Chat/ChatForwardMessage.qml b/linphone-app/ui/modules/Linphone/Chat/ChatForwardMessage.qml new file mode 100644 index 000000000..ed095baf0 --- /dev/null +++ b/linphone-app/ui/modules/Linphone/Chat/ChatForwardMessage.qml @@ -0,0 +1,61 @@ +import QtQuick 2.7 +import QtQuick.Layouts 1.3 + +import Clipboard 1.0 +import Common 1.0 +import Linphone 1.0 + +import Common.Styles 1.0 +import Linphone.Styles 1.0 +import TextToSpeech 1.0 +import Utils 1.0 +import Units 1.0 +import UtilsCpp 1.0 +import LinphoneEnums 1.0 + +import ColorsList 1.0 + +import 'Message.js' as Logic + +// ============================================================================= + +Item { + id: mainItem + property ChatMessageModel mainChatMessageModel + property int maxWidth : parent.width + property int fitWidth: headerArea.fitWidth + 7 + ChatForwardMessageStyle.padding * 2 + property int fitHeight: icon.height + property font customFont : SettingsModel.textMessageFont + + width: maxWidth > fitWidth ? fitWidth : maxWidth + height: fitHeight + + ColumnLayout{ + anchors.fill: parent + spacing: 5 + Row{ + id: headerArea + property int fitWidth: icon.width + headerText.implicitWidth + Layout.fillHeight: true + Layout.topMargin: 5 + Icon{ + id: icon + icon: ChatForwardMessageStyle.header.forwardIcon.icon + iconSize: ChatForwardMessageStyle.header.forwardIcon.iconSize + height: iconSize + overwriteColor: ChatForwardMessageStyle.header.color + } + Text{ + id: headerText + height: icon.height + verticalAlignment: Qt.AlignVCenter + property string forwardInfo: mainChatMessageModel.getForwardInfoDisplayName + //: 'Forwarded' : Header on a message that contains a forward. + text: 'Forwarded' + (forwardInfo ? ' : ' +forwardInfo : '') + font.family: mainItem.customFont.family + font.pointSize: Units.dp * (mainItem.customFont.pointSize + ChatForwardMessageStyle.header.pointSizeOffset) + color: ChatForwardMessageStyle.header.color + } + } + } +} diff --git a/linphone-app/ui/modules/Linphone/Chat/ChatMessagePreview.qml b/linphone-app/ui/modules/Linphone/Chat/ChatMessagePreview.qml index b7a15aa38..b87f7985d 100644 --- a/linphone-app/ui/modules/Linphone/Chat/ChatMessagePreview.qml +++ b/linphone-app/ui/modules/Linphone/Chat/ChatMessagePreview.qml @@ -21,6 +21,10 @@ ColumnLayout{ anchors.bottom: parent.bottom height: replyPreview.height + function hide(){ + replyPreview.hide() + } + ChatReplyPreview{ id: replyPreview Layout.fillWidth: true diff --git a/linphone-app/ui/modules/Linphone/Chat/ChatReplyMessage.qml b/linphone-app/ui/modules/Linphone/Chat/ChatReplyMessage.qml index 688e15a9d..78e364301 100644 --- a/linphone-app/ui/modules/Linphone/Chat/ChatReplyMessage.qml +++ b/linphone-app/ui/modules/Linphone/Chat/ChatReplyMessage.qml @@ -24,20 +24,25 @@ Item { property ChatMessageModel chatMessageModel property ChatMessageModel mainChatMessageModel property int maxWidth : parent.width - property int contentWidth: Math.max(usernameReplied.implicitWidth + replyMessage.implicitWidth , headerArea.width) + 7 + ChatReplyMessageStyle.padding * 2 - property int contentHeight: headerArea.height + replyArea.height + property int headerHeight: ChatReplyMessageStyle.header.replyIcon.iconSize + property int replyHeight: (chatMessageModel ? replyMessage.implicitHeight + usernameReplied.implicitHeight + ChatStyle.entry.message.padding * 2 + 3 : 0) + property int fitWidth: Math.max(usernameReplied.implicitWidth + replyMessage.implicitWidth , headerArea.fitWidth) + 7 + ChatReplyMessageStyle.padding * 2 + property int fitHeight: headerHeight + replyHeight + property font customFont : SettingsModel.textMessageFont - width: maxWidth > contentWidth ? contentWidth : maxWidth - + width: maxWidth < 0 || maxWidth > fitWidth ? fitWidth : maxWidth + height: fitHeight onMainChatMessageModelChanged: if( mainChatMessageModel.replyChatMessageModel) chatMessageModel = mainChatMessageModel.replyChatMessageModel + ColumnLayout{ anchors.fill: parent spacing: 5 Row{ id: headerArea - Layout.preferredHeight: icon.height + property int fitWidth: icon.width + headerText.implicitWidth + Layout.preferredHeight: headerHeight Layout.topMargin: 5 Icon{ id: icon @@ -47,7 +52,8 @@ Item { overwriteColor: ChatReplyMessageStyle.header.color } Text{ - height: icon.height + id: headerText + height: parent.height verticalAlignment: Qt.AlignVCenter //: 'Reply' : Header on a message that contains a reply. text: qsTr('headerReply') @@ -60,7 +66,7 @@ Item { Rectangle{ id: replyArea Layout.fillWidth: true - Layout.preferredHeight: (chatMessageModel ? replyMessage.implicitHeight + usernameReplied.implicitHeight + ChatStyle.entry.message.padding : 0) + Layout.fillHeight: true Layout.bottomMargin: ChatStyle.entry.message.padding Layout.leftMargin: 10 Layout.rightMargin: 10 diff --git a/linphone-app/ui/modules/Linphone/Chat/ChatReplyPreview.qml b/linphone-app/ui/modules/Linphone/Chat/ChatReplyPreview.qml index 01df0ddcd..6081ce1bb 100644 --- a/linphone-app/ui/modules/Linphone/Chat/ChatReplyPreview.qml +++ b/linphone-app/ui/modules/Linphone/Chat/ChatReplyPreview.qml @@ -30,6 +30,9 @@ Rectangle{ visible: container.replyChatMessageModel // Remove bottom corners clip: false + function hide(){ + state = 'hidden' + } Rectangle{ anchors.bottom: parent.bottom anchors.left: parent.left @@ -110,7 +113,7 @@ Rectangle{ backgroundRadius: 90 colorSet: ChatStyle.replyPreview.closeButton - onClicked: parent.state = 'hidden' + onClicked: parent.hide() } states: [ State { diff --git a/linphone-app/ui/modules/Linphone/Chat/FileMessage.qml b/linphone-app/ui/modules/Linphone/Chat/FileMessage.qml index ae738fa54..4ece81ab3 100644 --- a/linphone-app/ui/modules/Linphone/Chat/FileMessage.qml +++ b/linphone-app/ui/modules/Linphone/Chat/FileMessage.qml @@ -23,6 +23,7 @@ Row { signal copyAllDone() signal copySelectionDone() + signal forwardClicked() Item { height: ChatStyle.entry.lineHeight @@ -275,6 +276,7 @@ Row { onCopyAllDone: mainRow.copyAllDone() onCopySelectionDone: mainRow.copySelectionDone() + onForwardClicked: mainRow.forwardClicked() } } } diff --git a/linphone-app/ui/modules/Linphone/Chat/IncomingMessage.qml b/linphone-app/ui/modules/Linphone/Chat/IncomingMessage.qml index da6175024..2db23a386 100644 --- a/linphone-app/ui/modules/Linphone/Chat/IncomingMessage.qml +++ b/linphone-app/ui/modules/Linphone/Chat/IncomingMessage.qml @@ -11,6 +11,8 @@ import LinphoneUtils 1.0 RowLayout { id:mainRow + Layout.fillWidth: true + signal copyAllDone() signal copySelectionDone() signal replyClicked() diff --git a/linphone-app/ui/modules/Linphone/Chat/Message.qml b/linphone-app/ui/modules/Linphone/Chat/Message.qml index af0a0f0f8..f6ba959fd 100644 --- a/linphone-app/ui/modules/Linphone/Chat/Message.qml +++ b/linphone-app/ui/modules/Linphone/Chat/Message.qml @@ -40,15 +40,15 @@ Item { // --------------------------------------------------------------------------- implicitHeight: message.contentHeight + - + (replyMessage.visible ? replyMessage.contentHeight + 5 : 0) + + (forwardMessage.visible ? forwardMessage.fitHeight + 5 : 0) + + (replyMessage.visible ? replyMessage.fitHeight + 5 : 0) + (ephemeralTimerRow.visible? message.padding * 4 : message.padding * 2) + (deliveryLayout.visible? deliveryLayout.height : 0) - Rectangle { id: rectangle property int maxWidth: parent.width - property int dataWidth: Math.max(message.implicitWidth + 2*ChatStyle.entry.message.padding + 10, replyMessage.contentWidth) + property int dataWidth: Math.max(Math.max(message.implicitWidth + 2*ChatStyle.entry.message.padding + 10, replyMessage.fitWidth), forwardMessage.fitWidth) height: parent.height - (deliveryLayout.visible? deliveryLayout.height : 0) radius: ChatStyle.entry.message.radius width: ( @@ -88,13 +88,18 @@ Item { Column{ anchors.left: parent.left anchors.right: parent.right - spacing: 5 + spacing: 0 + ChatForwardMessage{ + id: forwardMessage + mainChatMessageModel: $chatEntry + visible: $chatEntry.isForward + maxWidth: container.width + } ChatReplyMessage{ id: replyMessage mainChatMessageModel: $chatEntry visible: $chatEntry.isReply maxWidth: container.width - height: contentHeight } TextEdit { id: message diff --git a/linphone-app/ui/modules/Linphone/Chat/OutgoingMessage.qml b/linphone-app/ui/modules/Linphone/Chat/OutgoingMessage.qml index 8ff3e7ed0..96dc7ec30 100644 --- a/linphone-app/ui/modules/Linphone/Chat/OutgoingMessage.qml +++ b/linphone-app/ui/modules/Linphone/Chat/OutgoingMessage.qml @@ -12,7 +12,8 @@ import Utils 1.0 Item { implicitHeight: message.height - width: parent.width + //width: parent.width + Layout.fillWidth: true signal copyAllDone() signal copySelectionDone() @@ -66,9 +67,10 @@ Item { TooltipArea { id:tooltip + visible: text != '' text: iconId.isError ? qsTr('messageError') - : (iconId.isRead ? qsTr('messageRead') : qsTr('messageDelivered')) + : (iconId.isRead ? qsTr('messageRead') : (isDelivered ? qsTr('messageDelivered') : '')) hoveringCursor : retryAction.visible?Qt.PointingHandCursor:Qt.ArrowCursor } } diff --git a/linphone-app/ui/modules/Linphone/Dialog/SipAddressDialog.qml b/linphone-app/ui/modules/Linphone/Dialog/SipAddressDialog.qml new file mode 100644 index 000000000..db6cd5023 --- /dev/null +++ b/linphone-app/ui/modules/Linphone/Dialog/SipAddressDialog.qml @@ -0,0 +1,104 @@ +import QtQuick 2.7 +import QtQuick.Layouts 1.3 + +import Common 1.0 +import Linphone 1.0 + +import App.Styles 1.0 +import Linphone.Styles 1.0 + +// ============================================================================= + +DialogPlus { + id: mainItem + + property var addressSelectedCallback + property var chatRoomSelectedCallback + + buttons: [ + TextButtonA { + text: qsTr('cancel') + + onClicked: exit(0) + } + ] + + buttonsAlignment: Qt.AlignCenter + + height: SipAddressDialogStyle.height + 30 + width: SipAddressDialogStyle.width + + // --------------------------------------------------------------------------- + + + ColumnLayout { + anchors.fill: parent + spacing: SipAddressDialogStyle.spacing + + SmartSearchBar { + id: smartSearchBar + + Layout.fillWidth: true + Layout.topMargin: SipAddressDialogStyle.spacing + visible: !timeline.isFilterVisible + + showHeader:false + + maxMenuHeight: MainWindowStyle.searchBox.maxHeight + //: 'Search in contacts' : Placeholder for a search a contact + placeholderText: qsTr('contactsSearchPlaceholder') + //: 'Search an address in your contacts or use a custom one.' : tooltip + tooltipText: qsTr('contactsSearchTooltip') + + actions:[{ + colorSet: SipAddressDialogStyle.select, + secure: 0, + visible: true, + secureIconVisibleHandler : function(entry) { + return UtilsCpp.hasCapability(entry.sipAddress, LinphoneEnums.FriendCapabilityLimeX3Dh) + }, + handler: function (entry) { + mainItem.addressSelectedCallback(sipAddress) + exit(1) + }, + }] + + onEntryClicked: { + mainItem.addressSelectedCallback(sipAddress) + exit(1) + } + } + Text { + id: description + Layout.fillWidth: true + + color: SipAddressDialogStyle.list.color + font.pointSize: SipAddressDialogStyle.list.pointSize + horizontalAlignment: Qt.AlignLeft + verticalAlignment: Text.AlignVCenter + wrapMode: Text.WordWrap + //: 'Conversations' : header for a selection in conversation list + text: qsTr('timelineSelectionHeader') + } + + ScrollableListViewField { + Layout.fillHeight: true + Layout.fillWidth: true + + Timeline { + id: timeline + showHistoryButton: false + updateSelectionModels: false + anchors.fill: parent + model: TimelineProxyModel{} + onEntrySelected:{ + console.log(entry) + if( entry ) { + mainItem.chatRoomSelectedCallback(entry.chatRoomModel) + exit(1) + } + } + } + } + } +} diff --git a/linphone-app/ui/modules/Linphone/Styles/Chat/ChatForwardMessageStyle.qml b/linphone-app/ui/modules/Linphone/Styles/Chat/ChatForwardMessageStyle.qml new file mode 100644 index 000000000..2efe4c556 --- /dev/null +++ b/linphone-app/ui/modules/Linphone/Styles/Chat/ChatForwardMessageStyle.qml @@ -0,0 +1,23 @@ +pragma Singleton +import QtQml 2.2 + +import Units 1.0 +import ColorsList 1.0 + +// ============================================================================= + +QtObject { + property string sectionName : 'ChatReplyMessage' + property color color: ColorsList.add(sectionName, 'q').color + property QtObject header: QtObject{ + property color color: ColorsList.add(sectionName+'_header', 'h').color + property int pointSizeOffset: -3 + property QtObject forwardIcon: QtObject{ + property string icon : 'menu_forward_custom' + property int iconSize: 22 + } + } + + property int padding: 8 + +} diff --git a/linphone-app/ui/modules/Linphone/Styles/Dialog/SipAddressDialogStyle.qml b/linphone-app/ui/modules/Linphone/Styles/Dialog/SipAddressDialogStyle.qml new file mode 100644 index 000000000..00cd9a079 --- /dev/null +++ b/linphone-app/ui/modules/Linphone/Styles/Dialog/SipAddressDialogStyle.qml @@ -0,0 +1,31 @@ +pragma Singleton +import QtQml 2.2 +import ColorsList 1.0 +import Units 1.0 +// ============================================================================= + +QtObject { + property string sectionName : 'SipAddressDialog' + property int height: 420 + property int spacing: 10 + property int width: 450 + + property QtObject select: QtObject { + property int iconSize: 36 + property string icon : 'transfer_custom' + property string name : 'select' + property color backgroundNormalColor : ColorsList.addImageColor(sectionName+'_'+name+'_bg_n', icon, 's_n_b_bg').color + property color backgroundHoveredColor : ColorsList.addImageColor(sectionName+'_'+name+'_bg_h', icon, 's_h_b_bg').color + property color backgroundPressedColor : ColorsList.addImageColor(sectionName+'_'+name+'_bg_p', icon, 's_p_b_bg').color + property color foregroundNormalColor : ColorsList.addImageColor(sectionName+'_'+name+'_fg_n', icon, 's_n_b_fg').color + property color foregroundHoveredColor : ColorsList.addImageColor(sectionName+'_'+name+'_fg_h', icon, 's_h_b_fg').color + property color foregroundPressedColor : ColorsList.addImageColor(sectionName+'_'+name+'_fg_p', icon, 's_p_b_fg').color + } + property QtObject searchField: QtObject { + property color color: ColorsList.add(sectionName+'_searchField', 'c').color + } + property QtObject list: QtObject { + property color color: ColorsList.add(sectionName+'_list_title', 'g').color + property int pointSize: Units.dp * 11 + } +} diff --git a/linphone-app/ui/modules/Linphone/Styles/qmldir b/linphone-app/ui/modules/Linphone/Styles/qmldir index 2a2445dc4..98d31211f 100644 --- a/linphone-app/ui/modules/Linphone/Styles/qmldir +++ b/linphone-app/ui/modules/Linphone/Styles/qmldir @@ -10,6 +10,7 @@ singleton CardBlockStyle 1.0 Blocks/CardBlockStyle.qml singleton RequestBlockStyle 1.0 Blocks/RequestBlockStyle.qml singleton ChatStyle 1.0 Chat/ChatStyle.qml +singleton ChatForwardMessageStyle 1.0 Chat/ChatForwardMessageStyle.qml singleton ChatReplyMessageStyle 1.0 Chat/ChatReplyMessageStyle.qml singleton CallControlsStyle 1.0 Calls/CallControlsStyle.qml @@ -25,6 +26,7 @@ singleton ContactMessageCounterStyle 1.0 Contact/ContactMessageCounter singleton ContactStyle 1.0 Contact/ContactStyle.qml singleton OnlineInstallerDialogStyle 1.0 Dialog/OnlineInstallerDialogStyle.qml +singleton SipAddressDialogStyle 1.0 Dialog/SipAddressDialogStyle.qml singleton HistoryStyle 1.0 History/HistoryStyle.qml diff --git a/linphone-app/ui/modules/Linphone/Timeline/Timeline.qml b/linphone-app/ui/modules/Linphone/Timeline/Timeline.qml index 5f5b5c2ab..a01d5fc53 100644 --- a/linphone-app/ui/modules/Linphone/Timeline/Timeline.qml +++ b/linphone-app/ui/modules/Linphone/Timeline/Timeline.qml @@ -20,6 +20,9 @@ Rectangle { property alias model: view.model property string _selectedSipAddress + property bool showHistoryButton : true + property bool updateSelectionModels : true + property bool isFilterVisible: searchView.visible || filterView.visible // --------------------------------------------------------------------------- @@ -46,18 +49,19 @@ Rectangle { timeline.entrySelected('') } } - onSelectedChanged : if(timelineModel) timeline.entrySelected(timelineModel) + onSelectedChanged : if(timelineModel && timeline.updateSelectionModels) timeline.entrySelected(timelineModel) } // ------------------------------------------------------------------------- // Legend. // ------------------------------------------------------------------------- Rectangle { + id: legendArea Layout.fillWidth: true Layout.preferredHeight: TimelineStyle.legend.height Layout.alignment: Qt.AlignTop color: showHistory.containsMouse?TimelineStyle.legend.backgroundColor.hovered:TimelineStyle.legend.backgroundColor.normal - visible:view.count > 0 || searchView.visible || filterView.visible + visible:view.count > 0 || timeline.isFilterVisible MouseArea{// no more showing history id:showHistory @@ -121,6 +125,7 @@ Rectangle { Layout.rightMargin: TimelineStyle.legend.lastRightMargin Layout.fillHeight: true Layout.preferredWidth: TimelineStyle.legend.iconSize + visible: timeline.showHistoryButton onClicked:{ showHistoryRequest() } @@ -246,6 +251,7 @@ Rectangle { ScrollableListView { id: view + property alias updateSelectionModels: timeline.updateSelectionModels Layout.fillHeight: true Layout.fillWidth: true currentIndex: -1 @@ -297,12 +303,14 @@ Rectangle { propagateComposedEvents: true preventStealing: false onClicked: { - //timeline.model.unselectAll() if(mouse.button == Qt.LeftButton){ - if(modelData.selected)// Update selection + if(modelData.selected || !view.updateSelectionModels)// Update selection timeline.entrySelected(modelData) - modelData.selected = true - view.currentIndex = index; + if(view){ + if(view.updateSelectionModels) + modelData.selected = true + view.currentIndex = index; + } }else{ contactTooltip.show() } @@ -312,7 +320,7 @@ Rectangle { Connections{ target:modelData onSelectedChanged:{ - if(selected) { + if(view.updateSelectionModels && selected) { view.currentIndex = index; } } diff --git a/linphone-app/ui/modules/Linphone/View/SipAddressesView.qml b/linphone-app/ui/modules/Linphone/View/SipAddressesView.qml index 4c663feec..c44709839 100644 --- a/linphone-app/ui/modules/Linphone/View/SipAddressesView.qml +++ b/linphone-app/ui/modules/Linphone/View/SipAddressesView.qml @@ -241,11 +241,11 @@ ScrollableListView { Layout.fillWidth: true showContactAddress: sipAddressesView.showContactAddress - entry: $sipAddress + entry: modelData MouseArea { anchors.fill: parent - onClicked: sipAddressesView.entryClicked($sipAddress.sipAddress, index) + onClicked: sipAddressesView.entryClicked(modelData.sipAddress, index) } } @@ -284,11 +284,11 @@ ScrollableListView { tooltipText:modelData.tooltipText?modelData.tooltipText:'' visible: sipAddressesView.actions[index].visible onClicked: { - sipAddressesView.actions[index].handler($sipAddress) + sipAddressesView.actions[index].handler(modelData) } Icon{ visible: modelData.secure>0 && - (sipAddressesView.actions[index].secureIconVisibleHandler ? sipAddressesView.actions[index].secureIconVisibleHandler($sipAddress) : true) + (sipAddressesView.actions[index].secureIconVisibleHandler ? sipAddressesView.actions[index].secureIconVisibleHandler(modelData) : true) icon: 'secure_on' iconSize:15 anchors.right:parent.right diff --git a/linphone-app/ui/modules/Linphone/qmldir b/linphone-app/ui/modules/Linphone/qmldir index 5eae08a7e..5fd04e4e4 100644 --- a/linphone-app/ui/modules/Linphone/qmldir +++ b/linphone-app/ui/modules/Linphone/qmldir @@ -16,17 +16,20 @@ CallStatistics 1.0 Calls/CallStatistics.qml Chat 1.0 Chat/Chat.qml ChatMessagePreview 1.0 Chat/ChatMessagePreview.qml +ChatForwardMessage 1.0 Chat/ChatForwardMessage.qml ChatReplyMessage 1.0 Chat/ChatReplyMessage.qml ChatReplyPreview 1.0 Chat/ChatReplyPreview.qml -History 1.0 History/History.qml - CodecsViewer 1.0 Codecs/CodecsViewer.qml Avatar 1.0 Contact/Avatar.qml Contact 1.0 Contact/Contact.qml ContactDescription 1.0 Contact/ContactDescription.qml +SipAddressDialog 1.0 Dialog/SipAddressDialog.qml + +History 1.0 History/History.qml + SipAddressesMenu 1.0 Menus/SipAddressesMenu.qml MessageCounter 1.0 Misc/MessageCounter.qml @@ -41,4 +44,4 @@ Timeline 1.0 Timeline/Timeline.qml SipAddressesView 1.0 View/SipAddressesView.qml -ParticipantsView 1.0 View/ParticipantsView.qml \ No newline at end of file +ParticipantsView 1.0 View/ParticipantsView.qml