add row to invite any address in a conference

This commit is contained in:
Gaelle Braud 2024-04-02 16:05:12 +02:00 committed by Julien Wadel
parent b6a0ae1c76
commit fd09a79957
3 changed files with 307 additions and 272 deletions

View file

@ -48,6 +48,21 @@ ListView {
signal contactDeletionRequested(FriendGui contact)
signal contactAddedToSelection()
function addContactToSelection(address) {
if (multiSelectionEnabled) {
var indexInSelection = selectedContacts.indexOf(address)
if (indexInSelection == -1) {
selectedContacts.push(address)
contactAddedToSelection()
}
}
}
function removeContactFromSelection(indexInSelection) {
if (indexInSelection != -1) {
selectedContacts.splice(indexInSelection, 1)
}
}
model: MagicSearchProxy {
searchText: searchBarText.length === 0 ? "*" : searchBarText
}
@ -249,11 +264,10 @@ ListView {
if (mainItem.multiSelectionEnabled) {
var indexInSelection = mainItem.selectedContacts.indexOf(modelData.core.defaultAddress)
if (indexInSelection == -1) {
mainItem.selectedContacts.push(modelData.core.defaultAddress)
mainItem.contactAddedToSelection()
mainItem.addContactToSelection(modelData.core.defaultAddress)
}
else {
mainItem.selectedContacts.splice(indexInSelection, 1)
mainItem.removeContactFromSelection(indexInSelection, 1)
}
}
}

View file

@ -111,6 +111,7 @@ ColumnLayout {
}
ContactsList {
id: contactList
visible: contentHeight > 0 || searchbar.text.length > 0
Layout.fillWidth: true
Layout.fillHeight: true
Layout.preferredHeight: contentHeight
@ -119,6 +120,32 @@ ColumnLayout {
confInfoGui: mainItem.conferenceInfoGui
searchBarText: searchbar.text
onContactAddedToSelection: participantList.positionViewAtEnd()
headerPositioning: ListView.InlineHeader
header: MouseArea {
onClicked: contactList.addContactToSelection(sipAddr.text)
visible: searchbar.text.length > 0
height: searchbar.text.length > 0 ? 56 * DefaultStyle.dp : 0
width: contactList.width
RowLayout {
Layout.fillWidth: true
spacing: 10 * DefaultStyle.dp
anchors.verticalCenter: parent.verticalCenter
anchors.leftMargin: 30 * DefaultStyle.dp
anchors.left: parent.left
Avatar {
Layout.preferredWidth: 45 * DefaultStyle.dp
Layout.preferredHeight: 45 * DefaultStyle.dp
address: sipAddr.text
}
ColumnLayout {
Text {
id: sipAddr
text: UtilsCpp.generateLinphoneSipAddress(searchbar.text)
font.pixelSize: 14 * DefaultStyle.dp
}
}
}
}
}
Item {
Layout.fillHeight: true

View file

@ -19,11 +19,12 @@ AbstractMainPage {
onVisibleChanged: if (visible) rightPanelStackView.push(overridenRightPanel, Control.StackView.Immediate)
onSelectedConferenceChanged: {
overridenRightPanelStackView.clear()
if (selectedConference) {
/*if (!overridenRightPanelStackView.currentItem || overridenRightPanelStackView.currentItem.objectName != "meetingDetail") */overridenRightPanelStackView.replace(meetingDetail, Control.StackView.Immediate)
} else {
/*if (overridenRightPanelStackView.currentItem && overridenRightPanelStackView.currentItem.objectName === "meetingDetail")*/ overridenRightPanelStackView.clear()
}
if (!overridenRightPanelStackView.currentItem || overridenRightPanelStackView.currentItem.objectName != "meetingDetail") overridenRightPanelStackView.replace(meetingDetail, Control.StackView.Immediate)
}// else {
/*if (overridenRightPanelStackView.currentItem && overridenRightPanelStackView.currentItem.objectName === "meetingDetail")*/
// }
}
Connections {
@ -161,9 +162,10 @@ AbstractMainPage {
id: overridenRightPanel
Control.StackView {
id: overridenRightPanelStackView
RectangleTest{anchors.fill: parent}
width: 393 * DefaultStyle.dp
height: parent.height
anchors.top: parent.top
// anchors.bottom: parent.bottom
// Layout.fillWidth: false
}
}
@ -240,12 +242,9 @@ AbstractMainPage {
}
Component {
id: editConf
RowLayout {
property bool isCreation
property ConferenceInfoGui conferenceInfoGui
MeetingSetUp {
property bool isCreation
isCreation: parent.isCreation
conferenceInfoGui: parent.conferenceInfoGui
onReturnRequested: {
overridenRightPanelStackView.pop()
}
@ -258,29 +257,24 @@ AbstractMainPage {
}
}
}
}
Component {
id: addParticipants
RowLayout {
AddParticipantsLayout {
id: addParticipantLayout
property Control.StackView container
property ConferenceInfoGui conferenceInfoGui
AddParticipantsLayout {
conferenceInfoGui: parent.conferenceInfoGui
// Layout.fillHeight: true
title: qsTr("Ajouter des participants")
validateButtonText: qsTr("Ajouter")
titleColor: DefaultStyle.main1_500_main
onReturnRequested: {
addParticipantLayout.container.pop()
}
container.pop()
}
}
}
Component {
id: meetingDetail
RowLayout {
visible: mainItem.selectedConference
ColumnLayout {
visible: mainItem.selectedConference
spacing: 25 * DefaultStyle.dp
Section {
content: RowLayout {
@ -301,7 +295,7 @@ AbstractMainPage {
Layout.fillWidth: true
}
Button {
visible: UtilsCpp.isMe(mainItem.selectedConference.core.organizerAddress)
visible: mainItem.selectedConference && UtilsCpp.isMe(mainItem.selectedConference.core.organizerAddress)
Layout.preferredWidth: 24 * DefaultStyle.dp
Layout.preferredHeight: 24 * DefaultStyle.dp
icon.source: AppIcons.pencil
@ -530,7 +524,7 @@ AbstractMainPage {
UtilsCpp.setupConference(mainItem.selectedConference)
}
}
}
Item { Layout.fillHeight: true}
}
}
}