From f19f5c68323fca1a04e9a9d35b5de8e0bbaf36fc Mon Sep 17 00:00:00 2001 From: Julien Wadel Date: Mon, 16 Aug 2021 18:36:29 +0200 Subject: [PATCH] Limit conference audio call only for 5 particfiapnts and make a direct call without using conference manager --- .../ui/modules/Common/Dialog/DialogPlus.qml | 4 ---- linphone-app/ui/views/App/Calls/CallsWindow.qml | 1 + .../views/App/Calls/Dialogs/ConferenceManager.qml | 13 +++++++++++++ linphone-app/ui/views/App/Main/Conversation.qml | 9 +++++++-- 4 files changed, 21 insertions(+), 6 deletions(-) diff --git a/linphone-app/ui/modules/Common/Dialog/DialogPlus.qml b/linphone-app/ui/modules/Common/Dialog/DialogPlus.qml index 47e194b1b..d916ec44f 100644 --- a/linphone-app/ui/modules/Common/Dialog/DialogPlus.qml +++ b/linphone-app/ui/modules/Common/Dialog/DialogPlus.qml @@ -30,7 +30,6 @@ Rectangle { : DialogStyle.buttons.rightMargin default property alias _content: content.data - property bool _disableExitStatus readonly property bool contentIsEmpty: { return _content == null || !_content.length @@ -43,10 +42,7 @@ Rectangle { // --------------------------------------------------------------------------- function exit (status) { - if (!_disableExitStatus) { - _disableExitStatus = true exitStatus(status) - } } // --------------------------------------------------------------------------- diff --git a/linphone-app/ui/views/App/Calls/CallsWindow.qml b/linphone-app/ui/views/App/Calls/CallsWindow.qml index 37311ca09..146719414 100644 --- a/linphone-app/ui/views/App/Calls/CallsWindow.qml +++ b/linphone-app/ui/views/App/Calls/CallsWindow.qml @@ -45,6 +45,7 @@ Window { function conferenceManagerResult(exitValue){ + window.detachVirtualWindow(); if(exitValue == 0 && calls.count == 0) close(); } diff --git a/linphone-app/ui/views/App/Calls/Dialogs/ConferenceManager.qml b/linphone-app/ui/views/App/Calls/Dialogs/ConferenceManager.qml index 5772a71f3..7c40255c6 100644 --- a/linphone-app/ui/views/App/Calls/Dialogs/ConferenceManager.qml +++ b/linphone-app/ui/views/App/Calls/Dialogs/ConferenceManager.qml @@ -1,5 +1,6 @@ import QtQuick 2.7 import QtQuick.Layouts 1.3 +import QtQml 2.12 import Common 1.0 import Linphone 1.0 @@ -15,6 +16,7 @@ DialogPlus { readonly property int minParticipants: 1 property ChatRoomModel chatRoomModel // Used to initialize participants + property bool autoCall : false buttons: [ TextButtonA { @@ -38,9 +40,20 @@ DialogPlus { height: ConferenceManagerStyle.height + 30 width: ConferenceManagerStyle.width + + Timer{ + id:delayedExit + onTriggered : exit(1) + interval:1 + } Component.onCompleted: if(chatRoomModel){ conferenceHelperModel.toAdd.addParticipants(chatRoomModel) + if(autoCall) { + conferenceHelperModel.toAdd.update() + visible = false + delayedExit.start() + } } // --------------------------------------------------------------------------- diff --git a/linphone-app/ui/views/App/Main/Conversation.qml b/linphone-app/ui/views/App/Main/Conversation.qml index 793d48435..d19d382dc 100644 --- a/linphone-app/ui/views/App/Main/Conversation.qml +++ b/linphone-app/ui/views/App/Main/Conversation.qml @@ -36,6 +36,7 @@ ColumnLayout { readonly property var _sipAddressObserver: SipAddressesModel.getSipAddressObserver((fullPeerAddress?fullPeerAddress:peerAddress), (fullLocalAddress?fullLocalAddress:localAddress)) property bool haveMoreThanOneParticipants: chatRoomModel ? chatRoomModel.participants.count > 2 : false + property bool haveLessThanMinParticipantsForCall: chatRoomModel ? chatRoomModel.participants.count <= 5 : false // --------------------------------------------------------------------------- @@ -244,10 +245,14 @@ ColumnLayout { ActionButton { icon: 'group_chat' - visible: SettingsModel.outgoingCallsEnabled && conversation.haveMoreThanOneParticipants + visible: SettingsModel.outgoingCallsEnabled && conversation.haveMoreThanOneParticipants && conversation.haveLessThanMinParticipantsForCall //onClicked: CallsListModel.launchAudioCall(conversation.chatRoomModel) - onClicked: Logic.openConferenceManager({chatRoomModel:conversation.chatRoomModel}) + onClicked: Logic.openConferenceManager({chatRoomModel:conversation.chatRoomModel, autoCall:true}) + TooltipArea { + //: "Call all chat room's participants" : tooltip on a button for calling all participant in the current chat room + text: qsTr("groupChatCallButton") + } } }