diff --git a/Linphone/core/conference/ConferenceCore.cpp b/Linphone/core/conference/ConferenceCore.cpp index e27e34cf1..2b87b2d3d 100644 --- a/Linphone/core/conference/ConferenceCore.cpp +++ b/Linphone/core/conference/ConferenceCore.cpp @@ -65,16 +65,12 @@ void ConferenceCore::setSelf(QSharedPointer me) { mConferenceModelConnection->invokeToCore([this, device]() { setActiveSpeaker(device); }); }); - mConferenceModelConnection->makeConnectToModel(&ConferenceModel::participantDeviceStateChanged, [this]() { - int count = mConferenceModel->getParticipantDeviceCount(); - mConferenceModelConnection->invokeToCore([this, count]() { setParticipantDeviceCount(count); }); - }); - mConferenceModelConnection->makeConnectToModel( &ConferenceModel::conferenceStateChanged, [this](const std::shared_ptr &conference, linphone::Conference::State newState) { - if (newState != linphone::Conference::State::Created) return; - if (!mActiveSpeaker) { + int count = mConferenceModel->getParticipantDeviceCount(); + mConferenceModelConnection->invokeToCore([this, count]() { setParticipantDeviceCount(count); }); + if (newState == linphone::Conference::State::Created && !mActiveSpeaker) { if (auto participantDevice = conference->getActiveSpeakerParticipantDevice()) { auto device = ParticipantDeviceCore::create(participantDevice); mConferenceModelConnection->invokeToCore([this, device]() { setActiveSpeaker(device); }); @@ -89,25 +85,21 @@ void ConferenceCore::setSelf(QSharedPointer me) { } } } - int count = mConferenceModel->getParticipantDeviceCount(); - mConferenceModelConnection->invokeToCore([this, count]() { setParticipantDeviceCount(count); }); }); mConferenceModelConnection->makeConnectToModel( &ConferenceModel::participantDeviceCountChanged, [this](const std::shared_ptr &conference, int count) { - if (!mActiveSpeaker) { - if (auto participantDevice = conference->getActiveSpeakerParticipantDevice()) { - auto device = ParticipantDeviceCore::create(participantDevice); - mConferenceModelConnection->invokeToCore([this, device]() { setActiveSpeaker(device); }); - } else if (conference->getParticipantDeviceList().size() > 1) { - for (auto &device : conference->getParticipantDeviceList()) { - if (!ToolModel::isMe(device->getAddress())) { - auto activeSpeaker = ParticipantDeviceCore::create(device); - mConferenceModelConnection->invokeToCore( - [this, activeSpeaker]() { setActiveSpeaker(activeSpeaker); }); - break; - } + if (auto participantDevice = conference->getActiveSpeakerParticipantDevice()) { + auto device = ParticipantDeviceCore::create(participantDevice); + mConferenceModelConnection->invokeToCore([this, device]() { setActiveSpeaker(device); }); + } else if (conference->getParticipantDeviceList().size() > 1) { + for (auto &device : conference->getParticipantDeviceList()) { + if (!ToolModel::isMe(device->getAddress())) { + auto activeSpeaker = ParticipantDeviceCore::create(device); + mConferenceModelConnection->invokeToCore( + [this, activeSpeaker]() { setActiveSpeaker(activeSpeaker); }); + break; } } } diff --git a/Linphone/core/friend/FriendCore.cpp b/Linphone/core/friend/FriendCore.cpp index 1cc0bff4f..3e3d3d0fa 100644 --- a/Linphone/core/friend/FriendCore.cpp +++ b/Linphone/core/friend/FriendCore.cpp @@ -63,7 +63,7 @@ FriendCore::FriendCore(const std::shared_ptr &contact, bool is } mDefaultAddress = defaultAddress ? Utils::coreStringToAppString(defaultAddress->asStringUriOnly()) : QString(); mDefaultFullAddress = defaultAddress ? Utils::coreStringToAppString(defaultAddress->asString()) : QString(); - qWarning() << mDefaultAddress << " / " << mDefaultFullAddress; + // lDebug() << mDefaultAddress << " / " << mDefaultFullAddress; auto phoneNumbers = contact->getPhoneNumbersWithLabel(); for (auto &phoneNumber : phoneNumbers) { mPhoneNumberList.append( diff --git a/Linphone/core/participant/ParticipantDeviceList.cpp b/Linphone/core/participant/ParticipantDeviceList.cpp index 767e08cbb..a9e5562c9 100644 --- a/Linphone/core/participant/ParticipantDeviceList.cpp +++ b/Linphone/core/participant/ParticipantDeviceList.cpp @@ -128,17 +128,20 @@ void ParticipantDeviceList::setSelf(QSharedPointer me) { auto deviceCore = ParticipantDeviceCore::create(device); mConferenceModelConnection->invokeToCore([this, deviceCore]() { lDebug() << "[ParticipantDeviceList] : add a device"; - this->add(deviceCore); + add(deviceCore); }); }); mConferenceModelConnection->makeConnectToModel( &ConferenceModel::participantDeviceRemoved, - [this](const std::shared_ptr &participantDevice) { - QString uniqueAddress = Utils::coreStringToAppString(participantDevice->getAddress()->asString()); + [this](const std::shared_ptr &conference, + const std::shared_ptr &participantDevice) { + QString uniqueAddress = + Utils::coreStringToAppString(participantDevice->getAddress()->asString().c_str()); auto deviceCore = findDeviceByUniqueAddress(uniqueAddress); mConferenceModelConnection->invokeToCore([this, deviceCore]() { - lDebug() << "[ParticipantDeviceList] : remove a device"; - this->remove(deviceCore); + lDebug() << "[ParticipantDeviceList] : remove a device" << deviceCore; + if (!remove(deviceCore)) + lWarning() << log().arg("Unable to remove") << deviceCore << "as it is not part of the list"; }); }); mConferenceModelConnection->makeConnectToModel( diff --git a/Linphone/model/conference/ConferenceModel.cpp b/Linphone/model/conference/ConferenceModel.cpp index 12fa37cd8..b8ed86568 100644 --- a/Linphone/model/conference/ConferenceModel.cpp +++ b/Linphone/model/conference/ConferenceModel.cpp @@ -200,7 +200,7 @@ void ConferenceModel::onParticipantDeviceRemoved( << participantDevice->isInConference() << "]"; lDebug() << "Me devices : " << conference->getMe()->getDevices().size(); if (participantDevice->screenSharingEnabled()) emit isScreenSharingEnabledChanged(false); - emit participantDeviceRemoved(participantDevice); + emit participantDeviceRemoved(conference, participantDevice); emit participantDeviceCountChanged(conference, getParticipantDeviceCount()); } void ConferenceModel::onParticipantDeviceStateChanged(const std::shared_ptr &conference, diff --git a/Linphone/model/conference/ConferenceModel.hpp b/Linphone/model/conference/ConferenceModel.hpp index 3d8c15a17..c630b4da4 100644 --- a/Linphone/model/conference/ConferenceModel.hpp +++ b/Linphone/model/conference/ConferenceModel.hpp @@ -125,7 +125,8 @@ signals: void participantRemoved(const std::shared_ptr &participant); void participantAdminStatusChanged(const std::shared_ptr &participant); void participantDeviceAdded(const std::shared_ptr &participantDevice); - void participantDeviceRemoved(const std::shared_ptr &participantDevice); + void participantDeviceRemoved(const std::shared_ptr &conference, + const std::shared_ptr &participantDevice); void participantDeviceStateChanged(const std::shared_ptr &conference, const std::shared_ptr &device, linphone::ParticipantDevice::State state); diff --git a/Linphone/view/Control/Container/Call/CallHistoryLayout.qml b/Linphone/view/Control/Container/Call/CallHistoryLayout.qml index e184d5949..f86e1360c 100644 --- a/Linphone/view/Control/Container/Call/CallHistoryLayout.qml +++ b/Linphone/view/Control/Container/Call/CallHistoryLayout.qml @@ -159,7 +159,7 @@ ColumnLayout { if (mainItem.conferenceInfo) { var callsWindow = UtilsCpp.getCallsWindow() callsWindow.setupConference(mainItem.conferenceInfo) - callsWindow.show() + UtilsCpp.smartShowWindow(callsWindow) } } } diff --git a/Linphone/view/Page/Main/Call/CallPage.qml b/Linphone/view/Page/Main/Call/CallPage.qml index 7c6f726dd..c3b3dfa89 100644 --- a/Linphone/view/Page/Main/Call/CallPage.qml +++ b/Linphone/view/Page/Main/Call/CallPage.qml @@ -382,7 +382,7 @@ AbstractMainPage { if (modelData.core.isConference) { var callsWindow = UtilsCpp.getCallsWindow() callsWindow.setupConference(modelData.core.conferenceInfo) - callsWindow.show() + UtilsCpp.smartShowWindow(callsWindow) } else { UtilsCpp.createCall(modelData.core.remoteAddress) diff --git a/Linphone/view/Page/Main/Call/WaitingRoom.qml b/Linphone/view/Page/Main/Call/WaitingRoom.qml index 0171bfb82..476a6b416 100644 --- a/Linphone/view/Page/Main/Call/WaitingRoom.qml +++ b/Linphone/view/Page/Main/Call/WaitingRoom.qml @@ -13,6 +13,7 @@ RowLayout { property ConferenceInfoGui conferenceInfo signal joinConfRequested(string uri) signal cancelJoiningRequested() + signal cancelAfterJoinRequested() RowLayout { Layout.fillWidth: false Layout.fillHeight: false @@ -124,7 +125,7 @@ RowLayout { rightPadding: 20 * DefaultStyle.dp topPadding: 11 * DefaultStyle.dp bottomPadding: 11 * DefaultStyle.dp - text: qsTr("Join") + text: qsTr("Rejoindre") onClicked: { settingsButton.checked = false stackLayout.currentIndex = 1 @@ -137,7 +138,7 @@ RowLayout { rightPadding: 20 * DefaultStyle.dp bottomPadding: 11 * DefaultStyle.dp inversedColors: true - text: qsTr("Cancel") + text: qsTr("Annuler") onClicked: { mainItem.cancelJoiningRequested() } @@ -173,6 +174,20 @@ RowLayout { Layout.preferredWidth: 48 * DefaultStyle.dp Layout.preferredHeight: 48 * DefaultStyle.dp } + Button { + Layout.preferredWidth: 292 * DefaultStyle.dp + Layout.alignment: Qt.AlignHCenter + leftPadding: 20 * DefaultStyle.dp + rightPadding: 20 * DefaultStyle.dp + topPadding: 11 * DefaultStyle.dp + bottomPadding: 11 * DefaultStyle.dp + text: qsTr("Annuler") + onClicked: { + settingsButton.checked = false + stackLayout.currentIndex = 1 + mainItem.cancelAfterJoinRequested() + } + } } } } diff --git a/Linphone/view/Page/Main/Contact/ContactPage.qml b/Linphone/view/Page/Main/Contact/ContactPage.qml index 76619a3ad..29df038f7 100644 --- a/Linphone/view/Page/Main/Contact/ContactPage.qml +++ b/Linphone/view/Page/Main/Contact/ContactPage.qml @@ -404,6 +404,7 @@ AbstractMainPage { font { pixelSize: 29 * DefaultStyle.dp weight: 800 * DefaultStyle.dp + capitalization: Font.Capitalize } } Text { diff --git a/Linphone/view/Page/Main/Meeting/MeetingPage.qml b/Linphone/view/Page/Main/Meeting/MeetingPage.qml index f9c44f8f7..d12058c6f 100644 --- a/Linphone/view/Page/Main/Meeting/MeetingPage.qml +++ b/Linphone/view/Page/Main/Meeting/MeetingPage.qml @@ -855,7 +855,7 @@ AbstractMainPage { console.log(mainItem.selectedConference.core.uri) var callsWindow = UtilsCpp.getCallsWindow() callsWindow.setupConference(mainItem.selectedConference) - callsWindow.show() + UtilsCpp.smartShowWindow(callsWindow) } } Item { Layout.fillHeight: true} diff --git a/Linphone/view/Page/Window/Call/CallsWindow.qml b/Linphone/view/Page/Window/Call/CallsWindow.qml index e1d60a279..78d8fd14f 100644 --- a/Linphone/view/Page/Window/Call/CallsWindow.qml +++ b/Linphone/view/Page/Window/Call/CallsWindow.qml @@ -100,6 +100,9 @@ AbstractWindow { autoCloseWindow.restart() } } else { + if (middleItemStackView.currentItem.objectName === "waitingRoom") { + middleItemStackView.replace(inCallItem) + } mainWindow.call = callsModel.currentCall } } @@ -124,6 +127,9 @@ AbstractWindow { } middleItemStackView.replace(inCallItem) } + function cancelAfterJoin() { + endCall(mainWindow.call) + } Connections { enabled: !!mainWindow.call @@ -830,7 +836,6 @@ AbstractWindow { initialItem: participantListComp onCurrentItemChanged: rightPanel.headerStack.currentIndex = currentItem.Control.StackView.index property list selectedParticipants - signal participantAdded() Connections { target: rightPanel @@ -886,7 +891,6 @@ AbstractWindow { function onValidateRequested() { participantList.model.addAddresses(participantsStack.selectedParticipants) participantsStack.pop() - participantsStack.participantAdded() } } } @@ -980,6 +984,8 @@ AbstractWindow { mainWindow.joinConference(uri, {'microEnabled':microEnabled, 'localVideoEnabled':localVideoEnabled}) } onCancelJoiningRequested: mainWindow.cancelJoinConference() + onCancelAfterJoinRequested: mainWindow.cancelAfterJoin() + } } Component {