Hide remove participant button for 'me' in conference.

This commit is contained in:
Julien Wadel 2022-12-01 17:39:50 +01:00
parent 985f77c815
commit 1b8b57664c
2 changed files with 41 additions and 28 deletions

View file

@ -11,7 +11,7 @@ import Linphone.Styles 1.0
import Units 1.0
import UtilsCpp 1.0
import 'qrc:/ui/scripts/Utils/utils.js' as Utils
// =============================================================================
ColumnLayout {
@ -114,6 +114,9 @@ ColumnLayout {
colorSet: ParticipantsListViewStyle.removeParticipant,
secure:0,
visible:true,
visibleHandler: function(entry){
return !UtilsCpp.isMe(entry.sipAddress)
},
//: 'Remove this participant from the list' : Tootltip to explain that the action will lead to remove the participant.
tooltipText: qsTr('participantsListRemoveTooltip'),
handler: function (entry) {

View file

@ -122,6 +122,9 @@ ScrollableListView {
backgroundRadius: 90
colorSet: modelData.colorSet
visible: sipAddressesView.actions[index].visible
&& (!sipAddressesView.actions[index].visibleHandler || sipAddressesView.actions[index].visibleHandler({
sipAddress: sipAddressesView.interpretableSipAddress
}))
onClicked: sipAddressesView.actions[index].handler({
sipAddress: sipAddressesView.interpretableSipAddress
@ -285,36 +288,43 @@ ScrollableListView {
id: actionsRepeater
model: sipAddressesView.actions
ActionButton {
isCustom: true
backgroundRadius: 90
colorSet: modelData.colorSet
Item{
height: buttonAction.height
width: buttonAction.width
anchors.verticalCenter: parent.verticalCenter
tooltipText: modelData.tooltipText? modelData.tooltipText:''
visible: sipAddressesView.actions[index].visible
onClicked: {
sipAddressesView.actions[index].handler(contactView.entry)
}
Icon{
visible: modelData.secure>0 &&
(sipAddressesView.actions[index].secureIconVisibleHandler ? sipAddressesView.actions[index].secureIconVisibleHandler({sipAddres:$modelData}) : true)
icon: modelData.secure === 2?'secure_level_2':'secure_level_1'
iconSize: parent.height/2
anchors.top:parent.top
anchors.horizontalCenter: parent.right
}
Loader{
ActionButton {
id: buttonAction
isCustom: true
backgroundRadius: 90
colorSet: modelData.colorSet
anchors.verticalCenter: parent.verticalCenter
anchors.horizontalCenter: parent.horizontalCenter
height: parent.height - 2
width: height
tooltipText: modelData.tooltipText? modelData.tooltipText:''
visible: sipAddressesView.actions[index].visible && (!sipAddressesView.actions[index].visibleHandler || sipAddressesView.actions[index].visibleHandler(contactView.entry))
active: index == actionsRepeater.count -1 && sipAddressesView.showInvitingIndicator && contactView.entry && contactView.entry.inviting
sourceComponent: Component{
BusyIndicator{
color: BusyIndicatorStyle.alternateColor
running: true
onClicked: {
sipAddressesView.actions[index].handler(contactView.entry)
}
Icon{
visible: modelData.secure>0 &&
(sipAddressesView.actions[index].secureIconVisibleHandler ? sipAddressesView.actions[index].secureIconVisibleHandler({sipAddres:$modelData}) : true)
icon: modelData.secure === 2?'secure_level_2':'secure_level_1'
iconSize: parent.height/2
anchors.top:parent.top
anchors.horizontalCenter: parent.right
}
Loader{
anchors.verticalCenter: parent.verticalCenter
anchors.horizontalCenter: parent.horizontalCenter
height: parent.height - 2
width: height
active: index == actionsRepeater.count -1 && sipAddressesView.showInvitingIndicator && contactView.entry && contactView.entry.inviting
sourceComponent: Component{
BusyIndicator{
color: BusyIndicatorStyle.alternateColor
running: true
}
}
}
}