diff --git a/Linphone/data/languages/de.ts b/Linphone/data/languages/de.ts index 7d4a3c26d..f744df0cc 100644 --- a/Linphone/data/languages/de.ts +++ b/Linphone/data/languages/de.ts @@ -4500,6 +4500,11 @@ Pour les activer dans un projet commercial, merci de nous contacter. SelectedChatView + + chat_view_group_call_toast_message + "Start a group call ?" + Start a group call ? + chat_view_send_area_placeholder_text @@ -6305,11 +6310,6 @@ Failed to create 1-1 conversation with %1 ! All the messages will be removed from the chat room. Do you want to continue ? Alle Nachrichten werden aus dem Chat entfernt. Möchten Sie fortfahren? - - group_infos_group_call_toast_message - "Start a group call ?" - Start a group call ? - GroupChatInfoParticipants diff --git a/Linphone/data/languages/en.ts b/Linphone/data/languages/en.ts index 418611cf7..a60f8b92a 100644 --- a/Linphone/data/languages/en.ts +++ b/Linphone/data/languages/en.ts @@ -4401,6 +4401,11 @@ To enable them in a commercial project, please contact us. SelectedChatView + + chat_view_group_call_toast_message + "Start a group call ?" + Start a group call ? + Dites quelque chose… Say something… : placeholder text for sending message text area @@ -6314,11 +6319,6 @@ Failed to create 1-1 conversation with %1 ! All the messages will be removed from the chat room. Do you want to continue ? All the messages will be removed from the chat room. Do you want to continue ? - - group_infos_group_call_toast_message - "Start a group call ?" - Start a group call ? - GroupChatInfoParticipants diff --git a/Linphone/data/languages/fr_FR.ts b/Linphone/data/languages/fr_FR.ts index 556f38467..2b9cc0b43 100644 --- a/Linphone/data/languages/fr_FR.ts +++ b/Linphone/data/languages/fr_FR.ts @@ -4401,6 +4401,11 @@ Pour les activer dans un projet commercial, merci de nous contacter. SelectedChatView + + chat_view_group_call_toast_message + "Start a group call ?" + Démarrer un appel de groupe ? + chat_view_send_area_placeholder_text @@ -6211,11 +6216,6 @@ Failed to create 1-1 conversation with %1 ! All the messages will be removed from the chat room. Do you want to continue ? Vous ne recevrez ni pourrez envoyer des messages dans cette conversation, quitter ? - - group_infos_group_call_toast_message - "Start a group call ?" - Démarrer un appel de groupe ? - GroupChatInfoParticipants diff --git a/Linphone/view/Page/Form/Chat/SelectedChatView.qml b/Linphone/view/Page/Form/Chat/SelectedChatView.qml index f70b85e96..11885f143 100644 --- a/Linphone/view/Page/Form/Chat/SelectedChatView.qml +++ b/Linphone/view/Page/Form/Chat/SelectedChatView.qml @@ -12,9 +12,39 @@ import 'qrc:/qt/qml/Linphone/view/Style/buttonStyle.js' as ButtonStyle RowLayout { id: mainItem property ChatGui chat + property var contactObj: chat ? UtilsCpp.findFriendByAddress(mainItem.chat.core.peerAddress) : null + property var contact: contactObj?.value || null property CallGui call property alias callHeaderContent: splitPanel.headerContent spacing: 0 + + signal oneOneCall(bool video) + signal groupCall() + + onOneOneCall: { + if (contact) + mainWindow.startCallWithContact(contact, video, mainItem) + else + UtilsCpp.createCall(mainItem.chat?.core.peerAddress, {'localVideoEnabled':video}) + } + + onGroupCall: { + mainWindow.showConfirmationLambdaPopup(qsTr(""), + qsTr("chat_view_group_call_toast_message"), + "", + function(confirmed) { + if (confirmed) { + const sourceList = mainItem.chat?.core.participants + let addresses = []; + for (let i = 0; i < sourceList.length; ++i) { + const participantGui = sourceList[i] + const participantCore = participantGui.core + addresses.push(participantCore.sipAddress) + } + UtilsCpp.createGroupCall(mainItem.chat?.core.title, addresses) + } + }) + } //onEventChanged: { // TODO : call when all messages read after scroll to unread feature available @@ -59,10 +89,19 @@ RowLayout { BigButton { style: ButtonStyle.noBackground icon.source: AppIcons.phone + onPressed: { + if (mainItem.chat.core.isGroupChat) { + mainItem.groupCall() + } else { + mainItem.oneOneCall(false) + } + } } BigButton { style: ButtonStyle.noBackground icon.source: AppIcons.videoCamera + visible: !mainItem.chat.core.isGroupChat + onPressed: mainItem.oneOneCall(true) } BigButton { style: ButtonStyle.noBackground @@ -269,6 +308,11 @@ RowLayout { anchors.topMargin: Math.round(39 * DefaultStyle.dp) sourceComponent: mainItem.chat.core.isGroupChat ? groupInfoComponent : oneToOneInfoComponent active: detailsPanel.visible + onLoaded: { + if (contentLoader.item) { + contentLoader.item.parentView = mainItem + } + } } Component { diff --git a/Linphone/view/Page/Layout/Chat/GroupConversationInfos.qml b/Linphone/view/Page/Layout/Chat/GroupConversationInfos.qml index dafd59631..2743c29a7 100644 --- a/Linphone/view/Page/Layout/Chat/GroupConversationInfos.qml +++ b/Linphone/view/Page/Layout/Chat/GroupConversationInfos.qml @@ -13,6 +13,7 @@ ColumnLayout { id: mainItem property ChatGui chatGui property var chatCore: chatGui.core + property var parentView spacing: 0 Avatar { @@ -126,23 +127,7 @@ ColumnLayout { button.icon.source: AppIcons.phone //: "Appel" label: qsTr("group_infos_call") - button.onClicked: { - mainWindow.showConfirmationLambdaPopup(qsTr("group_infos_call"), - qsTr("group_infos_group_call_toast_message"), - "", - function(confirmed) { - if (confirmed) { - const sourceList = mainItem.chatCore.participants - let addresses = []; - for (let i = 0; i < sourceList.length; ++i) { - const participantGui = sourceList[i] - const participantCore = participantGui.core - addresses.push(participantCore.sipAddress) - } - UtilsCpp.createGroupCall(mainItem.chatCore.title, addresses) - } - }) - } + button.onClicked: parentView.groupCall() } LabelButton { width: Math.round(56 * DefaultStyle.dp) diff --git a/Linphone/view/Page/Layout/Chat/OneOneConversationInfos.qml b/Linphone/view/Page/Layout/Chat/OneOneConversationInfos.qml index 63b76f80b..70e36a66f 100644 --- a/Linphone/view/Page/Layout/Chat/OneOneConversationInfos.qml +++ b/Linphone/view/Page/Layout/Chat/OneOneConversationInfos.qml @@ -14,6 +14,7 @@ ColumnLayout { property ChatGui chatGui property var chatCore: chatGui.core property var contactObj: chat ? UtilsCpp.findFriendByAddress(mainItem.chatCore.peerAddress) : null + property var parentView spacing: 0 Avatar { @@ -61,9 +62,7 @@ ColumnLayout { button.icon.source: AppIcons.phone //: "Appel" label: qsTr("one_one_infos_call") - button.onClicked: { - mainWindow.startCallWithContact(contactObj.value, false, mainItem) - } + button.onClicked: parentView.oneOneCall(false) } LabelButton { width: Math.round(56 * DefaultStyle.dp)