Fixes on Concurrencies, Participants, WaitingRoom layout, joining participant view

This commit is contained in:
Julien Wadel 2024-04-24 17:35:59 +02:00
parent 3c1cde46f7
commit abba6cffaa
7 changed files with 65 additions and 21 deletions

View file

@ -39,9 +39,10 @@ QSharedPointer<ParticipantCore> ParticipantCore::create(const std::shared_ptr<li
} }
ParticipantCore::ParticipantCore(const std::shared_ptr<linphone::Participant> &participant) : QObject(nullptr) { ParticipantCore::ParticipantCore(const std::shared_ptr<linphone::Participant> &participant) : QObject(nullptr) {
mustBeInLinphoneThread(getClassName()); if (participant) mustBeInLinphoneThread(getClassName());
App::getInstance()->mEngine->setObjectOwnership(this, QQmlEngine::CppOwnership); App::getInstance()->mEngine->setObjectOwnership(this, QQmlEngine::CppOwnership);
mParticipantModel = Utils::makeQObject_ptr<ParticipantModel>(participant); mParticipantModel = Utils::makeQObject_ptr<ParticipantModel>(participant);
mParticipantModel->moveToThread(CoreModel::getInstance()->thread());
if (participant) { if (participant) {
mAdminStatus = participant->isAdmin(); mAdminStatus = participant->isAdmin();
mSipAddress = Utils::coreStringToAppString(participant->getAddress()->asStringUriOnly()); mSipAddress = Utils::coreStringToAppString(participant->getAddress()->asStringUriOnly());

View file

@ -137,11 +137,14 @@ std::list<std::shared_ptr<linphone::Address>> ParticipantList::getParticipants()
} }
bool ParticipantList::contains(const QString &address) const { bool ParticipantList::contains(const QString &address) const {
auto testAddress = ToolModel::interpretUrl(address);
bool exists = false; bool exists = false;
for (auto itParticipant = mList.begin(); !exists && itParticipant != mList.end(); ++itParticipant) App::postModelBlock([this, address, &exists, participants = mList]() {
exists = testAddress->weakEqual( auto testAddress = ToolModel::interpretUrl(address);
ToolModel::interpretUrl(itParticipant->objectCast<ParticipantCore>()->getSipAddress())); for (auto itParticipant = participants.begin(); !exists && itParticipant != participants.end(); ++itParticipant)
exists = testAddress->weakEqual(
ToolModel::interpretUrl(itParticipant->objectCast<ParticipantCore>()->getSipAddress()));
});
return exists; return exists;
} }

View file

@ -28,6 +28,7 @@ DEFINE_ABSTRACT_OBJECT(ParticipantModel)
ParticipantModel::ParticipantModel(std::shared_ptr<linphone::Participant> linphoneParticipant, QObject *parent) ParticipantModel::ParticipantModel(std::shared_ptr<linphone::Participant> linphoneParticipant, QObject *parent)
: QObject(parent) { : QObject(parent) {
if (linphoneParticipant) mustBeInLinphoneThread(getClassName());
mParticipant = linphoneParticipant; mParticipant = linphoneParticipant;
} }

View file

@ -732,11 +732,11 @@ Window {
Connections { Connections {
target: rightPanel target: rightPanel
// TODO : chercher comment relier ces infos pour faire le add des participants // TODO : chercher comment relier ces infos pour faire le add des participants
onValidateRequested: { //onValidateRequested: {
participantList.model.addAddresses(participantsStack.selectedParticipants) // participantList.model.addAddresses(participantsStack.selectedParticipants)
participantsStack.pop() // participantsStack.pop()
participantsStack.participantAdded() // participantsStack.participantAdded()
} //}
} }
} }
} }

View file

@ -93,10 +93,11 @@ RowLayout {
ColumnLayout { ColumnLayout {
spacing: 93 * DefaultStyle.dp spacing: 93 * DefaultStyle.dp
ColumnLayout { ColumnLayout {
spacing: 5 * DefaultStyle.dp Layout.topMargin: 54 * DefaultStyle.dp
spacing: 0
Text { Text {
Layout.fillWidth: true Layout.fillWidth: true
text: qsTr("Participer à :\n") text: qsTr("Participer à :")
color: DefaultStyle.grey_0 color: DefaultStyle.grey_0
font { font {
pixelSize: 30 * DefaultStyle.dp pixelSize: 30 * DefaultStyle.dp

View file

@ -52,15 +52,52 @@ Item {
anchors.fill: parent anchors.fill: parent
spacing: 0 spacing: 0
visible: !cameraLoader.active || cameraLoader.status != Loader.Ready || !cameraLoader.item.isReady visible: !cameraLoader.active || cameraLoader.status != Loader.Ready || !cameraLoader.item.isReady
Avatar{ Item{
id: avatar
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
// minSize = 372 => avatar = 142 // minSize = 372 => avatar = 142
Layout.preferredHeight: background.minSize * 142 / 372 Layout.preferredHeight: background.minSize * 142 / 372
Layout.preferredWidth: height Layout.preferredWidth: height
account: mainItem.account Avatar{
call: !mainItem.previewEnabled ? mainItem.call : null id: avatar
address: mainItem.peerAddress anchors.fill: parent
visible: !joiningView.visible
account: mainItem.account
call: !mainItem.previewEnabled ? mainItem.call : null
address: mainItem.peerAddress
}
ColumnLayout{
id: joiningView
anchors.fill: parent
spacing: 0
visible: mainItem.participantDevice && (mainItem.participantDevice.core.state == LinphoneEnums.ParticipantDeviceState.Joining || mainItem.participantDevice.core.state == LinphoneEnums.ParticipantDeviceState.Alerting) || false
Item{
Layout.fillHeight: true
Layout.fillWidth: true
}
BusyIndicator {
Layout.preferredHeight: 27 * DefaultStyle.dp
indicatorColor: DefaultStyle.main2_100
Layout.alignment: Qt.AlignHCenter
indicatorHeight: 42 * DefaultStyle.dp
indicatorWidth: 42 * DefaultStyle.dp
}
Text {
Layout.preferredHeight: 27 * DefaultStyle.dp
Layout.topMargin: 15 * DefaultStyle.dp // (84-27)-42
text: qsTr('rejoint...')
color: DefaultStyle.grey_0
Layout.alignment: Qt.AlignHCenter
horizontalAlignment: Text.AlignHCenter
font {
pixelSize: 20 * DefaultStyle.dp
weight: 500 * DefaultStyle.dp
}
}
Item{
Layout.fillHeight: true
Layout.fillWidth: true
}
}
} }
Text { Text {
Layout.fillWidth: true Layout.fillWidth: true

View file

@ -16,7 +16,8 @@ ColumnLayout {
readonly property string groupName: groupCallName.text readonly property string groupName: groupCallName.text
function clearSelectedParticipants() { function clearSelectedParticipants() {
contactList.selectedContacts.clear() // TODO
//contactList.selectedContacts.clear()
} }
ColumnLayout { ColumnLayout {