try to fix #LINQT-1605 (CI needed to check the result)

fix typo

fix #LINQT-1570 bad username in participants device stickers, use participant address

fix #LINQT-1626 remote address contains gruu in transfered call

fix #LINQT-1621 ensure visible when error visible on form item
This commit is contained in:
Gaelle Braud 2025-01-30 10:06:06 +01:00
parent b056165155
commit 82e4da60ee
16 changed files with 209 additions and 92 deletions

View file

@ -117,8 +117,10 @@ CallCore::CallCore(const std::shared_ptr<linphone::Call> &call) : QObject(nullpt
mRemoteVideoEnabled =
videoDirection == linphone::MediaDirection::SendOnly || videoDirection == linphone::MediaDirection::SendRecv;
mState = LinphoneEnums::fromLinphone(call->getState());
mRemoteAddress = Utils::coreStringToAppString(call->getRemoteAddress()->asStringUriOnly());
mRemoteUsername = Utils::coreStringToAppString(call->getRemoteAddress()->getUsername());
auto remoteAddress = call->getRemoteAddress()->clone();
remoteAddress->clean();
mRemoteAddress = Utils::coreStringToAppString(remoteAddress->asStringUriOnly());
mRemoteUsername = Utils::coreStringToAppString(remoteAddress->getUsername());
auto linphoneFriend = ToolModel::findFriendByAddress(mRemoteAddress);
if (linphoneFriend)
mRemoteName = Utils::coreStringToAppString(
@ -281,7 +283,7 @@ void CallCore::setSelf(QSharedPointer<CallCore> me) {
});
mCallModelConnection->makeConnectToCore(&CallCore::lTransferCallToAnother, [this](QString uri) {
mCallModelConnection->invokeToModel([this, uri]() {
auto linCall = ToolModel::interpretUri(uri);
auto linCall = ToolModel::getCallByRemoteAddress(uri);
if (linCall) mCallModel->transferToAnother(linCall);
});
});

View file

@ -41,7 +41,11 @@ ConferenceCore::ConferenceCore(const std::shared_ptr<linphone::Conference> &conf
mSubject = Utils::coreStringToAppString(conference->getSubject());
mParticipantDeviceCount = conference->getParticipantDeviceList().size();
auto activeSpeaker = conference->getActiveSpeakerParticipantDevice();
if (activeSpeaker) mActiveSpeaker = ParticipantDeviceCore::create(activeSpeaker);
if (activeSpeaker) {
mActiveSpeakerDevice = ParticipantDeviceCore::create(activeSpeaker);
auto participant = conference->findParticipant(activeSpeaker->getAddress());
if (participant) mActiveSpeaker = ParticipantCore::create(participant);
}
mIsLocalScreenSharing = mConferenceModel->isLocalScreenSharing();
mIsScreenSharingEnabled = mConferenceModel->isScreenSharingEnabled();
mIsRecording = conference->isRecording();
@ -59,9 +63,18 @@ void ConferenceCore::setSelf(QSharedPointer<ConferenceCore> me) {
mConferenceModelConnection = SafeConnection<ConferenceCore, ConferenceModel>::create(me, mConferenceModel);
mConferenceModelConnection->makeConnectToModel(
&ConferenceModel::activeSpeakerParticipantDevice,
[this](const std::shared_ptr<linphone::ParticipantDevice> &participantDevice) {
[this](const std::shared_ptr<linphone::Conference> &conference,
const std::shared_ptr<linphone::ParticipantDevice> &participantDevice) {
auto device = ParticipantDeviceCore::create(participantDevice);
mConferenceModelConnection->invokeToCore([this, device]() { setActiveSpeaker(device); });
QSharedPointer<ParticipantCore> participantCore;
if (participantDevice) {
auto participant = conference->findParticipant(participantDevice->getAddress());
if (participant) participantCore = ParticipantCore::create(participant);
}
mConferenceModelConnection->invokeToCore([this, device, participantCore]() {
setActiveSpeaker(participantCore);
setActiveSpeakerDevice(device);
});
});
mConferenceModelConnection->makeConnectToModel(
@ -72,13 +85,24 @@ void ConferenceCore::setSelf(QSharedPointer<ConferenceCore> me) {
if (newState == linphone::Conference::State::Created && !mActiveSpeaker) {
if (auto participantDevice = conference->getActiveSpeakerParticipantDevice()) {
auto device = ParticipantDeviceCore::create(participantDevice);
mConferenceModelConnection->invokeToCore([this, device]() { setActiveSpeaker(device); });
QSharedPointer<ParticipantCore> participantCore;
auto participant = conference->findParticipant(participantDevice->getAddress());
if (participant) participantCore = ParticipantCore::create(participant);
mConferenceModelConnection->invokeToCore([this, device, participantCore]() {
setActiveSpeaker(participantCore);
setActiveSpeakerDevice(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); });
auto activeSpeakerDevice = ParticipantDeviceCore::create(device);
QSharedPointer<ParticipantCore> participantCore;
auto participant = conference->findParticipant(device->getAddress());
if (participant) participantCore = ParticipantCore::create(participant);
mConferenceModelConnection->invokeToCore([this, activeSpeakerDevice, participantCore]() {
setActiveSpeaker(participantCore);
setActiveSpeakerDevice(activeSpeakerDevice);
});
break;
}
}
@ -91,13 +115,25 @@ void ConferenceCore::setSelf(QSharedPointer<ConferenceCore> me) {
[this](const std::shared_ptr<linphone::Conference> &conference, int count) {
if (auto participantDevice = conference->getActiveSpeakerParticipantDevice()) {
auto device = ParticipantDeviceCore::create(participantDevice);
mConferenceModelConnection->invokeToCore([this, device]() { setActiveSpeaker(device); });
QSharedPointer<ParticipantCore> participantCore;
auto participant = conference->findParticipant(participantDevice->getAddress());
if (participant) participantCore = ParticipantCore::create(participant);
setActiveSpeakerDevice(device);
mConferenceModelConnection->invokeToCore([this, device, participantCore]() {
setActiveSpeaker(participantCore);
setActiveSpeakerDevice(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); });
QSharedPointer<ParticipantCore> participantCore;
auto participant = conference->findParticipant(device->getAddress());
if (participant) participantCore = ParticipantCore::create(participant);
mConferenceModelConnection->invokeToCore([this, activeSpeaker, participantCore]() {
setActiveSpeaker(participantCore);
setActiveSpeakerDevice(activeSpeaker);
});
break;
}
}
@ -193,22 +229,34 @@ std::shared_ptr<ConferenceModel> ConferenceCore::getModel() const {
return mConferenceModel;
}
ParticipantDeviceCore *ConferenceCore::getActiveSpeaker() const {
return mActiveSpeaker.get();
ParticipantDeviceCore *ConferenceCore::getActiveSpeakerDevice() const {
return mActiveSpeakerDevice.get();
}
ParticipantDeviceGui *ConferenceCore::getActiveSpeakerGui() const {
return mActiveSpeaker ? new ParticipantDeviceGui(mActiveSpeaker) : nullptr;
ParticipantGui *ConferenceCore::getActiveSpeakerGui() const {
return mActiveSpeaker ? new ParticipantGui(mActiveSpeaker) : nullptr;
}
ParticipantDeviceGui *ConferenceCore::getActiveSpeakerDeviceGui() const {
return mActiveSpeakerDevice ? new ParticipantDeviceGui(mActiveSpeakerDevice) : nullptr;
}
ParticipantGui *ConferenceCore::getMeGui() const {
return new ParticipantGui(mMe);
}
void ConferenceCore::setActiveSpeaker(const QSharedPointer<ParticipantDeviceCore> &device) {
if (mActiveSpeaker != device) {
mActiveSpeaker = device;
lDebug() << "Changing active speaker to " << device->getAddress();
void ConferenceCore::setActiveSpeakerDevice(const QSharedPointer<ParticipantDeviceCore> &device) {
if (mActiveSpeakerDevice != device) {
mActiveSpeakerDevice = device;
log().arg("Changing active speaker device to ").arg(device ? device->getAddress() : "None");
emit activeSpeakerDeviceChanged();
}
}
void ConferenceCore::setActiveSpeaker(const QSharedPointer<ParticipantCore> &participant) {
if (mActiveSpeaker != participant) {
mActiveSpeaker = participant;
log().arg("Changing active speaker to ").arg(participant ? participant->getSipAddress() : "None");
emit activeSpeakerChanged();
}
}

View file

@ -48,7 +48,9 @@ public:
Q_PROPERTY(bool isScreenSharingEnabled MEMBER mIsScreenSharingEnabled WRITE setIsScreenSharingEnabled NOTIFY
isScreenSharingEnabledChanged)
Q_PROPERTY(int participantDeviceCount READ getParticipantDeviceCount NOTIFY participantDeviceCountChanged)
Q_PROPERTY(ParticipantDeviceGui *activeSpeaker READ getActiveSpeakerGui NOTIFY activeSpeakerChanged)
Q_PROPERTY(ParticipantGui *activeSpeaker READ getActiveSpeakerGui NOTIFY activeSpeakerChanged)
Q_PROPERTY(
ParticipantDeviceGui *activeSpeakerDevice READ getActiveSpeakerDeviceGui NOTIFY activeSpeakerDeviceChanged)
Q_PROPERTY(ParticipantGui *me READ getMeGui)
// Should be call from model Thread. Will be automatically in App thread after initialization
@ -69,10 +71,12 @@ public:
bool isRecording() const;
void setRecording(bool recording);
ParticipantDeviceCore *getActiveSpeaker() const;
ParticipantDeviceGui *getActiveSpeakerGui() const;
ParticipantDeviceCore *getActiveSpeakerDevice() const;
ParticipantDeviceGui *getActiveSpeakerDeviceGui() const;
ParticipantGui *getActiveSpeakerGui() const;
void setActiveSpeakerDevice(const QSharedPointer<ParticipantDeviceCore> &device);
void setActiveSpeaker(const QSharedPointer<ParticipantCore> &participant);
ParticipantGui *getMeGui() const;
void setActiveSpeaker(const QSharedPointer<ParticipantDeviceCore> &device);
void setIsReady(bool state);
@ -89,6 +93,7 @@ signals:
void isScreenSharingEnabledChanged();
void participantDeviceCountChanged();
void activeSpeakerChanged();
void activeSpeakerDeviceChanged();
void subjectChanged();
void isRecordingChanged();
@ -97,7 +102,8 @@ signals:
private:
QSharedPointer<SafeConnection<ConferenceCore, ConferenceModel>> mConferenceModelConnection;
std::shared_ptr<ConferenceModel> mConferenceModel;
QSharedPointer<ParticipantDeviceCore> mActiveSpeaker;
QSharedPointer<ParticipantCore> mActiveSpeaker;
QSharedPointer<ParticipantDeviceCore> mActiveSpeakerDevice;
QSharedPointer<ParticipantCore> mMe;
int mParticipantDeviceCount = 0;

View file

@ -42,25 +42,27 @@ ParticipantDeviceCore::ParticipantDeviceCore(const std::shared_ptr<linphone::Par
: QObject(parent) {
App::getInstance()->mEngine->setObjectOwnership(this, QQmlEngine::CppOwnership);
mustBeInLinphoneThread(getClassName());
mName = Utils::coreStringToAppString(device->getName());
auto deviceAddress = device->getAddress();
mUniqueAddress = Utils::coreStringToAppString(deviceAddress->asString());
mAddress = Utils::coreStringToAppString(deviceAddress->asStringUriOnly());
mDisplayName = Utils::coreStringToAppString(deviceAddress->getDisplayName());
if (mDisplayName.isEmpty()) {
mDisplayName = ToolModel::getDisplayName(mAddress);
if (device) {
mName = Utils::coreStringToAppString(device->getName());
auto deviceAddress = device->getAddress();
mUniqueAddress = Utils::coreStringToAppString(deviceAddress->asString());
mAddress = Utils::coreStringToAppString(deviceAddress->asStringUriOnly());
mDisplayName = Utils::coreStringToAppString(deviceAddress->getDisplayName());
if (mDisplayName.isEmpty()) {
mDisplayName = ToolModel::getDisplayName(mAddress);
}
mIsMuted = device->getIsMuted();
mIsSpeaking = device->getIsSpeaking();
mParticipantDeviceModel = Utils::makeQObject_ptr<ParticipantDeviceModel>(device);
mParticipantDeviceModel->setSelf(mParticipantDeviceModel);
mState = LinphoneEnums::fromLinphone(device->getState());
lDebug() << "Address = " << Utils::coreStringToAppString(deviceAddress->asStringUriOnly());
mIsLocal = ToolModel::findAccount(deviceAddress) != nullptr; // TODO set local
mIsVideoEnabled = mParticipantDeviceModel->isVideoEnabled();
mIsPaused = device->getState() == linphone::ParticipantDevice::State::Left ||
device->getState() == linphone::ParticipantDevice::State::OnHold;
}
mIsMuted = device->getIsMuted();
mIsMe = isMe;
mIsSpeaking = device->getIsSpeaking();
mParticipantDeviceModel = Utils::makeQObject_ptr<ParticipantDeviceModel>(device);
mParticipantDeviceModel->setSelf(mParticipantDeviceModel);
mState = LinphoneEnums::fromLinphone(device->getState());
lDebug() << "Address = " << Utils::coreStringToAppString(deviceAddress->asStringUriOnly());
mIsLocal = ToolModel::findAccount(deviceAddress) != nullptr; // TODO set local
mIsVideoEnabled = mParticipantDeviceModel->isVideoEnabled();
mIsPaused = device->getState() == linphone::ParticipantDevice::State::Left ||
device->getState() == linphone::ParticipantDevice::State::OnHold;
}
ParticipantDeviceCore::~ParticipantDeviceCore() {
@ -68,34 +70,39 @@ ParticipantDeviceCore::~ParticipantDeviceCore() {
}
void ParticipantDeviceCore::setSelf(QSharedPointer<ParticipantDeviceCore> me) {
mParticipantDeviceModelConnection =
SafeConnection<ParticipantDeviceCore, ParticipantDeviceModel>::create(me, mParticipantDeviceModel);
mParticipantDeviceModelConnection->makeConnectToModel(
&ParticipantDeviceModel::isSpeakingChanged, [this](bool speaking) {
mParticipantDeviceModelConnection->invokeToCore([this, speaking] { setIsSpeaking(speaking); });
});
mParticipantDeviceModelConnection->makeConnectToModel(&ParticipantDeviceModel::isMutedChanged, [this](bool muted) {
mParticipantDeviceModelConnection->invokeToCore([this, muted] { setIsMuted(muted); });
});
mParticipantDeviceModelConnection->makeConnectToModel(
&ParticipantDeviceModel::stateChanged, [this](LinphoneEnums::ParticipantDeviceState state) {
onStateChanged(state);
mParticipantDeviceModelConnection->invokeToCore(
[this, state, isVideoEnabled = mParticipantDeviceModel->isVideoEnabled()] {
setState(state);
setIsVideoEnabled(isVideoEnabled);
});
});
mParticipantDeviceModelConnection->makeConnectToModel(
&ParticipantDeviceModel::streamCapabilityChanged, [this](linphone::StreamType) {
auto videoEnabled = mParticipantDeviceModel->isVideoEnabled();
mParticipantDeviceModelConnection->invokeToCore([this, videoEnabled] { setIsVideoEnabled(videoEnabled); });
});
mParticipantDeviceModelConnection->makeConnectToModel(
&ParticipantDeviceModel::streamAvailabilityChanged, [this](linphone::StreamType) {
auto videoEnabled = mParticipantDeviceModel->isVideoEnabled();
mParticipantDeviceModelConnection->invokeToCore([this, videoEnabled] { setIsVideoEnabled(videoEnabled); });
});
if (mParticipantDeviceModel) {
mParticipantDeviceModelConnection =
SafeConnection<ParticipantDeviceCore, ParticipantDeviceModel>::create(me, mParticipantDeviceModel);
mParticipantDeviceModelConnection->makeConnectToModel(
&ParticipantDeviceModel::isSpeakingChanged, [this](bool speaking) {
mParticipantDeviceModelConnection->invokeToCore([this, speaking] { setIsSpeaking(speaking); });
});
mParticipantDeviceModelConnection->makeConnectToModel(
&ParticipantDeviceModel::isMutedChanged, [this](bool muted) {
mParticipantDeviceModelConnection->invokeToCore([this, muted] { setIsMuted(muted); });
});
mParticipantDeviceModelConnection->makeConnectToModel(
&ParticipantDeviceModel::stateChanged, [this](LinphoneEnums::ParticipantDeviceState state) {
onStateChanged(state);
mParticipantDeviceModelConnection->invokeToCore(
[this, state, isVideoEnabled = mParticipantDeviceModel->isVideoEnabled()] {
setState(state);
setIsVideoEnabled(isVideoEnabled);
});
});
mParticipantDeviceModelConnection->makeConnectToModel(
&ParticipantDeviceModel::streamCapabilityChanged, [this](linphone::StreamType) {
auto videoEnabled = mParticipantDeviceModel->isVideoEnabled();
mParticipantDeviceModelConnection->invokeToCore(
[this, videoEnabled] { setIsVideoEnabled(videoEnabled); });
});
mParticipantDeviceModelConnection->makeConnectToModel(
&ParticipantDeviceModel::streamAvailabilityChanged, [this](linphone::StreamType) {
auto videoEnabled = mParticipantDeviceModel->isVideoEnabled();
mParticipantDeviceModelConnection->invokeToCore(
[this, videoEnabled] { setIsVideoEnabled(videoEnabled); });
});
}
}
QString ParticipantDeviceCore::getName() const {

View file

@ -173,7 +173,7 @@ void ConferenceModel::onActiveSpeakerParticipantDevice(
const std::shared_ptr<const linphone::ParticipantDevice> &participantDevice) {
lDebug() << "onActiveSpeakerParticipantDevice: " << participantDevice->getAddress()->asString().c_str();
emit activeSpeakerParticipantDevice(conference->getActiveSpeakerParticipantDevice());
emit activeSpeakerParticipantDevice(conference, conference->getActiveSpeakerParticipantDevice());
}
void ConferenceModel::onParticipantAdded(const std::shared_ptr<linphone::Conference> &conference,

View file

@ -120,7 +120,8 @@ private:
const std::shared_ptr<const linphone::AudioDevice> &audioDevice) override;
signals:
void activeSpeakerParticipantDevice(const std::shared_ptr<linphone::ParticipantDevice> &participantDevice);
void activeSpeakerParticipantDevice(const std::shared_ptr<linphone::Conference> &conference,
const std::shared_ptr<linphone::ParticipantDevice> &participantDevice);
void participantAdded(const std::shared_ptr<linphone::Participant> &participant);
void participantRemoved(const std::shared_ptr<const linphone::Participant> &participant);
void participantAdminStatusChanged(const std::shared_ptr<const linphone::Participant> &participant);

View file

@ -50,9 +50,9 @@ std::shared_ptr<linphone::Address> ToolModel::interpretUrl(const QString &addres
return interpretedAddress;
}
std::shared_ptr<linphone::Call> ToolModel::interpretUri(const QString &uri) {
auto remoteAddress = ToolModel::interpretUrl(uri);
if (remoteAddress) return CoreModel::getInstance()->getCore()->getCallByRemoteAddress2(remoteAddress);
std::shared_ptr<linphone::Call> ToolModel::getCallByRemoteAddress(const QString &remoteAddress) {
auto linAddress = ToolModel::interpretUrl(remoteAddress);
if (linAddress) return CoreModel::getInstance()->getCore()->getCallByRemoteAddress2(linAddress);
else return nullptr;
}

View file

@ -35,7 +35,7 @@ public:
~ToolModel();
static std::shared_ptr<linphone::Address> interpretUrl(const QString &address);
static std::shared_ptr<linphone::Call> interpretUri(const QString &uri);
static std::shared_ptr<linphone::Call> getCallByRemoteAddress(const QString &remoteAddress);
static std::shared_ptr<linphone::FriendPhoneNumber> makeLinphoneNumber(const QString &label, const QString &number);
static std::shared_ptr<linphone::AudioDevice> findAudioDevice(const QString &id,
linphone::AudioDevice::Capabilities capability);

View file

@ -22,9 +22,11 @@
#include "core/App.hpp"
#include "core/call/CallGui.hpp"
#include "core/conference/ConferenceCore.hpp"
#include "core/conference/ConferenceInfoCore.hpp"
#include "core/conference/ConferenceInfoGui.hpp"
#include "core/friend/FriendGui.hpp"
#include "core/participant/ParticipantDeviceCore.hpp"
#include "core/path/Paths.hpp"
#include "core/payload-type/DownloadablePayloadTypeCore.hpp"
#include "model/object/VariantObject.hpp"
@ -130,6 +132,30 @@ VariantObject *Utils::findLocalAccountByAddress(const QString &address) {
return data;
}
VariantObject *Utils::findParticipantFromDevice(QString conferenceAddress, QString deviceAddress) {
VariantObject *data = new VariantObject("findParticipantFromDevice");
if (!data) return nullptr;
data->makeRequest([conferenceAddress, deviceAddress]() {
auto linCall = ToolModel::getCallByRemoteAddress(conferenceAddress);
if (linCall) {
auto linConf = linCall->getConference();
if (linConf) {
auto linAddress = ToolModel::interpretUrl(deviceAddress);
if (linAddress) {
auto participant = linConf->findParticipant(linAddress);
if (participant) {
auto participantCore = ParticipantCore::create(participant);
return QVariant::fromValue(new ParticipantGui(participantCore));
}
}
}
}
return QVariant();
});
data->requestValue();
return data;
}
void Utils::createCall(const QString &sipAddress,
QVariantMap options,
LinphoneEnums::MediaEncryption mediaEncryption,

View file

@ -48,6 +48,8 @@ class QQuickWindow;
class VariantObject;
class CallGui;
class ConferenceInfoGui;
class ConferenceCore;
class ParticipantDeviceCore;
class DownloadablePayloadTypeCore;
class Utils : public QObject, public AbstractObject {
@ -62,6 +64,7 @@ public:
Q_INVOKABLE static QString getFamilyNameFromFullName(const QString &fullName);
Q_INVOKABLE static QString getInitials(const QString &username); // Support UTF32
Q_INVOKABLE static VariantObject *findLocalAccountByAddress(const QString &address);
Q_INVOKABLE static VariantObject *findParticipantFromDevice(QString conferenceAddress, QString deviceAddress);
Q_INVOKABLE static void
createCall(const QString &sipAddress,
@ -69,9 +72,9 @@ public:
LinphoneEnums::MediaEncryption mediaEncryption = LinphoneEnums::MediaEncryption::None,
const QString &prepareTransfertAddress = "",
const QHash<QString, QString> &headers = {});
Q_INVOKABLE static void openCallsWindow(CallGui *call);
Q_INVOKABLE static void setupConference(ConferenceInfoGui *confGui);
Q_INVOKABLE static QQuickWindow *getMainWindow();
Q_INVOKABLE static void openCallsWindow(CallGui *call);
Q_INVOKABLE static void showInformationPopup(const QString &title,
const QString &description,
bool isSuccess = true,

View file

@ -42,11 +42,12 @@ Item {
previewEnabled: false
call: mainItem.call
displayAll: !mainItem.conference
participantDevice: mainItem.conference && mainItem.conference.core.activeSpeaker
participantDevice: mainItem.conference && mainItem.conference.core.activeSpeakerDevice
participant: mainItem.conference && mainItem.conference.core.activeSpeaker
property var address: participantDevice && participantDevice.core.address
videoEnabled: (participantDevice && participantDevice.core.videoEnabled) || (!participantDevice && call && call.core.remoteVideoEnabled)
qmlName: 'AS'
securityBreach: !mainItem.conference && mainItem.call?.core.isMismatch
securityBreach: !mainItem.conference && mainItem.call?.core.isMismatch || false
displayPresence: false
Binding {
target: mainItem
@ -77,6 +78,8 @@ Item {
anchors.bottomMargin: 15 * DefaultStyle.dp// Spacing
qmlName: 'S_'+index
visible: parent.visible
property var participantObj: mainItem.call && $modelData ? UtilsCpp.findParticipantFromDevice(mainItem.call.core.remoteAddress, $modelData.core.address) : null
participant: participantObj ? participantObj.value : null
participantDevice: $modelData
displayAll: false
displayPresence: false

View file

@ -3,12 +3,14 @@ import QtQuick.Layouts
import QtQml.Models
import Linphone
import UtilsCpp
// =============================================================================
Mosaic {
id: grid
property alias call: allDevices.currentCall
property ConferenceGui conference: call && call.core.conference || null
property bool videoEnabled: true
property int participantCount: gridModel.count
@ -47,6 +49,8 @@ Mosaic {
displayAll: false
displayPresence: false
participantDevice: avatarCell.currentDevice
property var participantObj: (mainItem.call && avatarCell.currentDevice) ? UtilsCpp.findParticipantFromDevice(mainItem.call.core.remoteAddress, avatarCell.currentDevice.core.address) : null
participant: participantObj ? participantObj.value : null
Component.onCompleted: console.log(qmlName + " is " +(call ? call.core.remoteAddress : currentDevice ? currentDevice.core.address : 'addr_NotDefined'))
}
}

View file

@ -18,6 +18,21 @@ FocusScope{
function clearErrorText() {
errorText.clear()
}
onErrorMessageChanged: if (errorMessage.length > 0) {
var item = mainItem
do {
var parentItem = item.parent
if (parentItem.contentItem) {
if (parentItem.contentY >= mainItem.y)
parentItem.contentY = mainItem.y;
else if (parentItem.contentY+height <= mainItem.y+mainItem.height)
parentItem.contentY = mainItem.y + mainItem.height - height;
}
item = parentItem
} while(item.parent != undefined && parentItem.contentItem === undefined)
}
ColumnLayout {
id: layout
spacing: 5 * DefaultStyle.dp

View file

@ -22,6 +22,7 @@ Item {
property var callState: call && call.core.state || undefined
property AccountGui account: null
property ParticipantDeviceGui participantDevice: null
property ParticipantGui participant: null
property bool displayBorder : participantDevice && participantDevice.core.isSpeaking || false
property alias displayPresence: avatar.displayPresence
property color color: DefaultStyle.grey_600
@ -45,8 +46,8 @@ Item {
property string localName: localNameObj ? localNameObj.value : ""
property string displayName: account
? account.core.displayName
: participantDevice
? participantDevice.core.displayName
: participant
? participant.core.displayName
: call
? previewEnabled
? localName
@ -161,7 +162,6 @@ Item {
ColumnLayout {
spacing: 0
visible: mainItem.displayAll && !mainItem.remoteIsPaused && !mainItem.conference
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: centerItem.bottom
anchors.topMargin: 21 * DefaultStyle.dp
anchors.left: parent.left

View file

@ -19,7 +19,7 @@ LoginLayout {
function onErrorInField(field, errorMessage) {
console.log("set error message", errorMessage)
if (field == "username") usernameItem.errorMessage = errorMessage
else if (field == "password") pwdItem.errorMessage = errorMessage
else if (field == "password") passwordItem.errorMessage = errorMessage
else if (field == "phone") phoneNumberInput.errorMessage = errorMessage
else if (field == "email") emailItem.errorMessage = errorMessage
else otherErrorText.setText(errorMessage)

View file

@ -154,28 +154,30 @@ AbstractSettingsLayout {
id: videoCodecsComponent
ColumnLayout {
spacing: 20 * DefaultStyle.dp
Repeater {
Layout.preferredHeight: implicitHeight
ListView {
Layout.preferredHeight: contentHeight
Layout.fillWidth: true
model: PayloadTypeProxy {
id: videoPayloadTypeProxy
filterType: PayloadTypeProxy.Video | PayloadTypeProxy.NotDownloadable
}
SwitchSetting {
Layout.fillWidth: true
delegate: SwitchSetting {
width: parent.width
titleText: Utils.capitalizeFirstLetter(modelData.core.mimeType)
subTitleText: modelData.core.encoderDescription
propertyName: "enabled"
propertyOwnerGui: modelData
}
}
Repeater {
Layout.preferredHeight: implicitHeight
ListView {
Layout.preferredHeight: contentHeight
Layout.fillWidth: true
model: PayloadTypeProxy {
id: downloadableVideoPayloadTypeProxy
filterType: PayloadTypeProxy.Video | PayloadTypeProxy.Downloadable
}
SwitchSetting {
Layout.fillWidth: true
delegate: SwitchSetting {
width: parent.width
titleText: Utils.capitalizeFirstLetter(modelData.core.mimeType)
subTitleText: modelData.core.encoderDescription
onCheckedChanged: Utils.openCodecOnlineInstallerDialog(