Limit conference audio call only for 5 particfiapnts and make a direct call without using conference manager

This commit is contained in:
Julien Wadel 2021-08-16 18:36:29 +02:00
parent a35ca1c13c
commit f19f5c6832
4 changed files with 21 additions and 6 deletions

View file

@ -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)
}
}
// ---------------------------------------------------------------------------

View file

@ -45,6 +45,7 @@ Window {
function conferenceManagerResult(exitValue){
window.detachVirtualWindow();
if(exitValue == 0 && calls.count == 0)
close();
}

View file

@ -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()
}
}
// ---------------------------------------------------------------------------

View file

@ -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")
}
}
}