From 1b8b57664c94813a1039b219bda93acaf051bdc6 Mon Sep 17 00:00:00 2001 From: Julien Wadel Date: Thu, 1 Dec 2022 17:39:50 +0100 Subject: [PATCH] Hide remove participant button for 'me' in conference. --- .../Linphone/View/ParticipantsListView.qml | 5 +- .../Linphone/View/ParticipantsView.qml | 64 +++++++++++-------- 2 files changed, 41 insertions(+), 28 deletions(-) diff --git a/linphone-app/ui/modules/Linphone/View/ParticipantsListView.qml b/linphone-app/ui/modules/Linphone/View/ParticipantsListView.qml index e76785ca2..d6cfbd9cd 100644 --- a/linphone-app/ui/modules/Linphone/View/ParticipantsListView.qml +++ b/linphone-app/ui/modules/Linphone/View/ParticipantsListView.qml @@ -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) { diff --git a/linphone-app/ui/modules/Linphone/View/ParticipantsView.qml b/linphone-app/ui/modules/Linphone/View/ParticipantsView.qml index f38c0b85b..697114204 100644 --- a/linphone-app/ui/modules/Linphone/View/ParticipantsView.qml +++ b/linphone-app/ui/modules/Linphone/View/ParticipantsView.qml @@ -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 + } } } }