participant list
This commit is contained in:
parent
2b1a1525e5
commit
80b0880e7e
20 changed files with 570 additions and 333 deletions
|
|
@ -87,7 +87,7 @@ int ParticipantCore::getDeviceCount() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ParticipantCore::isMe() const {
|
bool ParticipantCore::isMe() const {
|
||||||
return true; // Utils::isMe(getSipAddress());
|
return Utils::isMe(mSipAddress);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString ParticipantCore::getSipAddress() const {
|
QString ParticipantCore::getSipAddress() const {
|
||||||
|
|
@ -121,7 +121,7 @@ void ParticipantCore::setCreationTime(const QDateTime &date) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ParticipantCore::getAdminStatus() const {
|
bool ParticipantCore::isAdmin() const {
|
||||||
return mAdminStatus;
|
return mAdminStatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -129,10 +129,10 @@ bool ParticipantCore::isFocus() const {
|
||||||
return mIsFocus;
|
return mIsFocus;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ParticipantCore::setAdminStatus(const bool &status) {
|
void ParticipantCore::setIsAdmin(const bool &status) {
|
||||||
if (status != mAdminStatus) {
|
if (status != mAdminStatus) {
|
||||||
mAdminStatus = status;
|
mAdminStatus = status;
|
||||||
emit adminStatusChanged();
|
emit isAdminChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ class ParticipantCore : public QObject, public AbstractObject {
|
||||||
// Q_PROPERTY(FriendCore *friendCore READ getFriendCore CONSTANT)
|
// Q_PROPERTY(FriendCore *friendCore READ getFriendCore CONSTANT)
|
||||||
Q_PROPERTY(QString sipAddress READ getSipAddress WRITE setSipAddress NOTIFY sipAddressChanged)
|
Q_PROPERTY(QString sipAddress READ getSipAddress WRITE setSipAddress NOTIFY sipAddressChanged)
|
||||||
Q_PROPERTY(QString displayName READ getDisplayName WRITE setDisplayName NOTIFY displayNameChanged)
|
Q_PROPERTY(QString displayName READ getDisplayName WRITE setDisplayName NOTIFY displayNameChanged)
|
||||||
Q_PROPERTY(bool adminStatus READ getAdminStatus WRITE setAdminStatus NOTIFY adminStatusChanged)
|
Q_PROPERTY(bool isAdmin READ isAdmin WRITE setIsAdmin NOTIFY isAdminChanged)
|
||||||
Q_PROPERTY(bool isMe READ isMe CONSTANT)
|
Q_PROPERTY(bool isMe READ isMe CONSTANT)
|
||||||
Q_PROPERTY(QDateTime creationTime READ getCreationTime CONSTANT)
|
Q_PROPERTY(QDateTime creationTime READ getCreationTime CONSTANT)
|
||||||
Q_PROPERTY(bool focus READ isFocus CONSTANT)
|
Q_PROPERTY(bool focus READ isFocus CONSTANT)
|
||||||
|
|
@ -62,7 +62,7 @@ public:
|
||||||
QString getDisplayName() const;
|
QString getDisplayName() const;
|
||||||
QString getSipAddress() const;
|
QString getSipAddress() const;
|
||||||
QDateTime getCreationTime() const;
|
QDateTime getCreationTime() const;
|
||||||
bool getAdminStatus() const;
|
bool isAdmin() const;
|
||||||
bool isFocus() const;
|
bool isFocus() const;
|
||||||
int getSecurityLevel() const;
|
int getSecurityLevel() const;
|
||||||
int getDeviceCount() const;
|
int getDeviceCount() const;
|
||||||
|
|
@ -72,7 +72,7 @@ public:
|
||||||
void setSipAddress(const QString &address);
|
void setSipAddress(const QString &address);
|
||||||
void setDisplayName(const QString &name);
|
void setDisplayName(const QString &name);
|
||||||
void setCreationTime(const QDateTime &date);
|
void setCreationTime(const QDateTime &date);
|
||||||
void setAdminStatus(const bool &status);
|
void setIsAdmin(const bool &status);
|
||||||
void setIsFocus(const bool &focus);
|
void setIsFocus(const bool &focus);
|
||||||
void setSecurityLevel(int level);
|
void setSecurityLevel(int level);
|
||||||
|
|
||||||
|
|
@ -88,10 +88,7 @@ signals:
|
||||||
void securityLevelChanged();
|
void securityLevelChanged();
|
||||||
void deviceSecurityLevelChanged(std::shared_ptr<const linphone::Address> device);
|
void deviceSecurityLevelChanged(std::shared_ptr<const linphone::Address> device);
|
||||||
void sipAddressChanged();
|
void sipAddressChanged();
|
||||||
void updateAdminStatus(
|
void isAdminChanged();
|
||||||
const std::shared_ptr<linphone::Participant> participant,
|
|
||||||
const bool &isAdmin); // Split in two signals in order to sequancialize execution between SDK and GUI
|
|
||||||
void adminStatusChanged();
|
|
||||||
void isFocusChanged();
|
void isFocusChanged();
|
||||||
void deviceCountChanged();
|
void deviceCountChanged();
|
||||||
void invitingChanged();
|
void invitingChanged();
|
||||||
|
|
@ -99,6 +96,7 @@ signals:
|
||||||
void displayNameChanged();
|
void displayNameChanged();
|
||||||
|
|
||||||
void lStartInvitation(const int &secs);
|
void lStartInvitation(const int &secs);
|
||||||
|
void lSetIsAdmin(bool status);
|
||||||
|
|
||||||
void invitationTimeout(ParticipantCore *model);
|
void invitationTimeout(ParticipantCore *model);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@
|
||||||
|
|
||||||
#include "ParticipantDeviceCore.hpp"
|
#include "ParticipantDeviceCore.hpp"
|
||||||
#include "core/App.hpp"
|
#include "core/App.hpp"
|
||||||
|
#include "model/object/VariantObject.hpp"
|
||||||
#include "model/tool/ToolModel.hpp"
|
#include "model/tool/ToolModel.hpp"
|
||||||
#include "tool/Utils.hpp"
|
#include "tool/Utils.hpp"
|
||||||
#include <QQmlApplicationEngine>
|
#include <QQmlApplicationEngine>
|
||||||
|
|
@ -42,16 +43,22 @@ ParticipantDeviceCore::ParticipantDeviceCore(const std::shared_ptr<linphone::Par
|
||||||
App::getInstance()->mEngine->setObjectOwnership(this, QQmlEngine::CppOwnership);
|
App::getInstance()->mEngine->setObjectOwnership(this, QQmlEngine::CppOwnership);
|
||||||
mustBeInLinphoneThread(getClassName());
|
mustBeInLinphoneThread(getClassName());
|
||||||
mName = Utils::coreStringToAppString(device->getName());
|
mName = Utils::coreStringToAppString(device->getName());
|
||||||
mDisplayName = Utils::coreStringToAppString(device->getAddress()->getDisplayName());
|
auto deviceAddress = device->getAddress();
|
||||||
mAddress = Utils::coreStringToAppString(device->getAddress()->asStringUriOnly());
|
mUniqueAddress = Utils::coreStringToAppString(deviceAddress->asString());
|
||||||
|
mAddress = Utils::coreStringToAppString(deviceAddress->asStringUriOnly());
|
||||||
|
mDisplayName = Utils::coreStringToAppString(deviceAddress->getDisplayName());
|
||||||
|
if (mDisplayName.isEmpty()) {
|
||||||
|
auto name = Utils::getDisplayName(mAddress);
|
||||||
|
if (name) mDisplayName = name->getValue().toString();
|
||||||
|
}
|
||||||
mIsMuted = device->getIsMuted();
|
mIsMuted = device->getIsMuted();
|
||||||
mIsMe = isMe;
|
mIsMe = isMe;
|
||||||
mIsSpeaking = device->getIsSpeaking();
|
mIsSpeaking = device->getIsSpeaking();
|
||||||
mParticipantDeviceModel = Utils::makeQObject_ptr<ParticipantDeviceModel>(device);
|
mParticipantDeviceModel = Utils::makeQObject_ptr<ParticipantDeviceModel>(device);
|
||||||
mParticipantDeviceModel->setSelf(mParticipantDeviceModel);
|
mParticipantDeviceModel->setSelf(mParticipantDeviceModel);
|
||||||
mState = LinphoneEnums::fromLinphone(device->getState());
|
mState = LinphoneEnums::fromLinphone(device->getState());
|
||||||
qDebug() << "Address = " << Utils::coreStringToAppString(device->getAddress()->asStringUriOnly());
|
qDebug() << "Address = " << Utils::coreStringToAppString(deviceAddress->asStringUriOnly());
|
||||||
mIsLocal = ToolModel::findAccount(device->getAddress()) != nullptr; // TODO set local
|
mIsLocal = ToolModel::findAccount(deviceAddress) != nullptr; // TODO set local
|
||||||
// mCall = callModel;
|
// mCall = callModel;
|
||||||
// if (mCall) connect(mCall, &CallModel::statusChanged, this, &ParticipantDeviceCore::onCallStatusChanged);
|
// if (mCall) connect(mCall, &CallModel::statusChanged, this, &ParticipantDeviceCore::onCallStatusChanged);
|
||||||
mIsVideoEnabled = mParticipantDeviceModel->isVideoEnabled();
|
mIsVideoEnabled = mParticipantDeviceModel->isVideoEnabled();
|
||||||
|
|
@ -116,6 +123,10 @@ QString ParticipantDeviceCore::getAddress() const {
|
||||||
return mAddress;
|
return mAddress;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString ParticipantDeviceCore::getUniqueAddress() const {
|
||||||
|
return mUniqueAddress;
|
||||||
|
}
|
||||||
|
|
||||||
bool ParticipantDeviceCore::getPaused() const {
|
bool ParticipantDeviceCore::getPaused() const {
|
||||||
return mIsPaused;
|
return mIsPaused;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,7 @@ class ParticipantDeviceCore : public QObject, public AbstractObject {
|
||||||
Q_PROPERTY(QString displayName READ getDisplayName CONSTANT)
|
Q_PROPERTY(QString displayName READ getDisplayName CONSTANT)
|
||||||
Q_PROPERTY(QString name READ getName CONSTANT)
|
Q_PROPERTY(QString name READ getName CONSTANT)
|
||||||
Q_PROPERTY(QString address READ getAddress CONSTANT)
|
Q_PROPERTY(QString address READ getAddress CONSTANT)
|
||||||
|
Q_PROPERTY(QString uniqueAddress READ getUniqueAddress CONSTANT)
|
||||||
Q_PROPERTY(int securityLevel READ getSecurityLevel NOTIFY securityLevelChanged)
|
Q_PROPERTY(int securityLevel READ getSecurityLevel NOTIFY securityLevelChanged)
|
||||||
Q_PROPERTY(time_t timeOfJoining READ getTimeOfJoining CONSTANT)
|
Q_PROPERTY(time_t timeOfJoining READ getTimeOfJoining CONSTANT)
|
||||||
Q_PROPERTY(bool videoEnabled READ isVideoEnabled NOTIFY videoEnabledChanged)
|
Q_PROPERTY(bool videoEnabled READ isVideoEnabled NOTIFY videoEnabledChanged)
|
||||||
|
|
@ -63,6 +64,7 @@ public:
|
||||||
QString getName() const;
|
QString getName() const;
|
||||||
QString getDisplayName() const;
|
QString getDisplayName() const;
|
||||||
QString getAddress() const;
|
QString getAddress() const;
|
||||||
|
QString getUniqueAddress() const;
|
||||||
int getSecurityLevel() const;
|
int getSecurityLevel() const;
|
||||||
time_t getTimeOfJoining() const;
|
time_t getTimeOfJoining() const;
|
||||||
bool isVideoEnabled() const;
|
bool isVideoEnabled() const;
|
||||||
|
|
@ -112,6 +114,7 @@ signals:
|
||||||
private:
|
private:
|
||||||
QString mName;
|
QString mName;
|
||||||
QString mDisplayName;
|
QString mDisplayName;
|
||||||
|
QString mUniqueAddress;
|
||||||
QString mAddress;
|
QString mAddress;
|
||||||
bool mIsMe = false;
|
bool mIsMe = false;
|
||||||
bool mIsLocal = false;
|
bool mIsLocal = false;
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@
|
||||||
#include "core/App.hpp"
|
#include "core/App.hpp"
|
||||||
#include "core/participant/ParticipantDeviceCore.hpp"
|
#include "core/participant/ParticipantDeviceCore.hpp"
|
||||||
#include "core/participant/ParticipantDeviceGui.hpp"
|
#include "core/participant/ParticipantDeviceGui.hpp"
|
||||||
|
#include "tool/Utils.hpp"
|
||||||
|
|
||||||
#include <QQmlApplicationEngine>
|
#include <QQmlApplicationEngine>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
@ -77,6 +78,18 @@ void ParticipantDeviceList::setDevices(QList<QSharedPointer<ParticipantDeviceCor
|
||||||
qDebug() << "[ParticipantDeviceList] : add " << devices.size() << " devices";
|
qDebug() << "[ParticipantDeviceList] : add " << devices.size() << " devices";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QSharedPointer<ParticipantDeviceCore> ParticipantDeviceList::findDeviceByUniqueAddress(const QString &address) {
|
||||||
|
qDebug() << "address to find" << address;
|
||||||
|
auto found = std::find_if(mList.begin(), mList.end(), [address](const QSharedPointer<QObject> &obj) {
|
||||||
|
auto device = qobject_cast<QSharedPointer<ParticipantDeviceCore>>(obj);
|
||||||
|
qDebug() << "address" << device->getUniqueAddress();
|
||||||
|
return device && device->getUniqueAddress() == address;
|
||||||
|
});
|
||||||
|
if (found != mList.end()) {
|
||||||
|
return qobject_cast<QSharedPointer<ParticipantDeviceCore>>(*found);
|
||||||
|
} else return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
void ParticipantDeviceList::setConferenceModel(const std::shared_ptr<ConferenceModel> &conferenceModel) {
|
void ParticipantDeviceList::setConferenceModel(const std::shared_ptr<ConferenceModel> &conferenceModel) {
|
||||||
mustBeInMainThread(log().arg(Q_FUNC_INFO));
|
mustBeInMainThread(log().arg(Q_FUNC_INFO));
|
||||||
mConferenceModel = conferenceModel;
|
mConferenceModel = conferenceModel;
|
||||||
|
|
@ -116,6 +129,16 @@ void ParticipantDeviceList::setSelf(QSharedPointer<ParticipantDeviceList> me) {
|
||||||
this->add(deviceCore);
|
this->add(deviceCore);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
mConferenceModelConnection->makeConnectToModel(
|
||||||
|
&ConferenceModel::participantDeviceRemoved,
|
||||||
|
[this](const std::shared_ptr<const linphone::ParticipantDevice> &participantDevice) {
|
||||||
|
QString uniqueAddress = Utils::coreStringToAppString(participantDevice->getAddress()->asString());
|
||||||
|
auto deviceCore = findDeviceByUniqueAddress(uniqueAddress);
|
||||||
|
mConferenceModelConnection->invokeToCore([this, deviceCore]() {
|
||||||
|
qDebug() << "[ParticipantDeviceList] : remove a device";
|
||||||
|
this->remove(deviceCore);
|
||||||
|
});
|
||||||
|
});
|
||||||
mConferenceModelConnection->makeConnectToModel(
|
mConferenceModelConnection->makeConnectToModel(
|
||||||
&ConferenceModel::conferenceStateChanged, [this](linphone::Conference::State state) {
|
&ConferenceModel::conferenceStateChanged, [this](linphone::Conference::State state) {
|
||||||
qDebug() << "[ParticipantDeviceList] new state = " << (int)state;
|
qDebug() << "[ParticipantDeviceList] new state = " << (int)state;
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,7 @@ public:
|
||||||
QSharedPointer<ParticipantDeviceCore> getMe() const;
|
QSharedPointer<ParticipantDeviceCore> getMe() const;
|
||||||
|
|
||||||
void setDevices(QList<QSharedPointer<ParticipantDeviceCore>> devices);
|
void setDevices(QList<QSharedPointer<ParticipantDeviceCore>> devices);
|
||||||
|
QSharedPointer<ParticipantDeviceCore> findDeviceByUniqueAddress(const QString &address);
|
||||||
void setConferenceModel(const std::shared_ptr<ConferenceModel> &conferenceModel);
|
void setConferenceModel(const std::shared_ptr<ConferenceModel> &conferenceModel);
|
||||||
|
|
||||||
void setSelf(QSharedPointer<ParticipantDeviceList> me);
|
void setSelf(QSharedPointer<ParticipantDeviceList> me);
|
||||||
|
|
|
||||||
|
|
@ -36,55 +36,14 @@ QSharedPointer<ParticipantList> ParticipantList::create() {
|
||||||
return model;
|
return model;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ParticipantList::ParticipantList(ChatRoomModel *chatRoomModel, QObject *parent) : ProxyListModel(parent) {
|
QSharedPointer<ParticipantList> ParticipantList::create(const std::shared_ptr<ConferenceModel> &conferenceModel) {
|
||||||
// if (chatRoomModel) {
|
auto model = create();
|
||||||
// mChatRoomModel = chatRoomModel;
|
model->setConferenceModel(conferenceModel);
|
||||||
|
return model;
|
||||||
// connect(mChatRoomModel, &ChatRoomModel::securityEvent, this, &ParticipantList::onSecurityEvent);
|
}
|
||||||
// connect(mChatRoomModel, &ChatRoomModel::conferenceJoined, this, &ParticipantList::onConferenceJoined);
|
|
||||||
// connect(mChatRoomModel, &ChatRoomModel::participantAdded, this,
|
|
||||||
// QOverload<const std::shared_ptr<const linphone::EventLog> &>::of(
|
|
||||||
// &ParticipantList::onParticipantAdded));
|
|
||||||
// connect(mChatRoomModel, &ChatRoomModel::participantRemoved, this,
|
|
||||||
// QOverload<const std::shared_ptr<const linphone::EventLog> &>::of(
|
|
||||||
// &ParticipantList::onParticipantRemoved));
|
|
||||||
// connect(mChatRoomModel, &ChatRoomModel::participantAdminStatusChanged, this,
|
|
||||||
// QOverload<const std::shared_ptr<const linphone::EventLog> &>::of(
|
|
||||||
// &ParticipantList::onParticipantAdminStatusChanged));
|
|
||||||
// connect(mChatRoomModel, &ChatRoomModel::participantDeviceAdded, this,
|
|
||||||
// &ParticipantList::onParticipantDeviceAdded);
|
|
||||||
// connect(mChatRoomModel, &ChatRoomModel::participantDeviceRemoved, this,
|
|
||||||
// &ParticipantList::onParticipantDeviceRemoved);
|
|
||||||
// connect(mChatRoomModel, &ChatRoomModel::participantRegistrationSubscriptionRequested, this,
|
|
||||||
// &ParticipantList::onParticipantRegistrationSubscriptionRequested);
|
|
||||||
// connect(mChatRoomModel, &ChatRoomModel::participantRegistrationUnsubscriptionRequested, this,
|
|
||||||
// &ParticipantList::onParticipantRegistrationUnsubscriptionRequested);
|
|
||||||
|
|
||||||
// updateParticipants();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// ParticipantList::ParticipantList(ConferenceModel *conferenceModel, QObject *parent) : ListProxy(parent) {
|
|
||||||
// if (conferenceModel) {
|
|
||||||
// mConferenceModel = conferenceModel;
|
|
||||||
|
|
||||||
// connect(mConferenceModel, &ConferenceModel::participantAdded, this,
|
|
||||||
// QOverload<const std::shared_ptr<const linphone::Participant> &>::of(
|
|
||||||
// &ParticipantList::onParticipantAdded));
|
|
||||||
// connect(mConferenceModel, &ConferenceModel::participantRemoved, this,
|
|
||||||
// QOverload<const std::shared_ptr<const linphone::Participant> &>::of(
|
|
||||||
// &ParticipantList::onParticipantRemoved));
|
|
||||||
// connect(mConferenceModel, &ConferenceModel::participantAdminStatusChanged, this,
|
|
||||||
// QOverload<const std::shared_ptr<const linphone::Participant> &>::of(
|
|
||||||
// &ParticipantList::onParticipantAdminStatusChanged));
|
|
||||||
// connect(mConferenceModel, &ConferenceModel::conferenceStateChanged, this,
|
|
||||||
// &ParticipantList::onStateChanged);
|
|
||||||
|
|
||||||
// updateParticipants();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
ParticipantList::ParticipantList(QObject *parent) : ListProxy(parent) {
|
ParticipantList::ParticipantList(QObject *parent) : ListProxy(parent) {
|
||||||
|
App::getInstance()->mEngine->setObjectOwnership(this, QQmlEngine::CppOwnership);
|
||||||
}
|
}
|
||||||
|
|
||||||
ParticipantList::~ParticipantList() {
|
ParticipantList::~ParticipantList() {
|
||||||
|
|
@ -94,11 +53,12 @@ ParticipantList::~ParticipantList() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void ParticipantList::setSelf(QSharedPointer<ParticipantList> me) {
|
void ParticipantList::setSelf(QSharedPointer<ParticipantList> me) {
|
||||||
mModelConnection = QSharedPointer<SafeConnection<ParticipantList, ConferenceModel>>(
|
if (mConferenceModelConnection) mConferenceModelConnection->disconnect();
|
||||||
|
mConferenceModelConnection = QSharedPointer<SafeConnection<ParticipantList, ConferenceModel>>(
|
||||||
new SafeConnection<ParticipantList, ConferenceModel>(me, mConferenceModel), &QObject::deleteLater);
|
new SafeConnection<ParticipantList, ConferenceModel>(me, mConferenceModel), &QObject::deleteLater);
|
||||||
|
if (mConferenceModel) {
|
||||||
mModelConnection->makeConnectToCore(&ParticipantList::lUpdateParticipants, [this] {
|
mConferenceModelConnection->makeConnectToCore(&ParticipantList::lUpdateParticipants, [this] {
|
||||||
mModelConnection->invokeToModel([this]() {
|
mConferenceModelConnection->invokeToModel([this]() {
|
||||||
QList<QSharedPointer<ParticipantCore>> *participantList = new QList<QSharedPointer<ParticipantCore>>();
|
QList<QSharedPointer<ParticipantCore>> *participantList = new QList<QSharedPointer<ParticipantCore>>();
|
||||||
mustBeInLinphoneThread(getClassName());
|
mustBeInLinphoneThread(getClassName());
|
||||||
std::list<std::shared_ptr<linphone::Participant>> participants;
|
std::list<std::shared_ptr<linphone::Participant>> participants;
|
||||||
|
|
@ -107,7 +67,10 @@ void ParticipantList::setSelf(QSharedPointer<ParticipantList> me) {
|
||||||
auto model = ParticipantCore::create(it);
|
auto model = ParticipantCore::create(it);
|
||||||
participantList->push_back(model);
|
participantList->push_back(model);
|
||||||
}
|
}
|
||||||
mModelConnection->invokeToCore([this, participantList]() {
|
auto me = mConferenceModel->getMonitor()->getMe();
|
||||||
|
auto meModel = ParticipantCore::create(me);
|
||||||
|
participantList->push_back(meModel);
|
||||||
|
mConferenceModelConnection->invokeToCore([this, participantList]() {
|
||||||
mustBeInMainThread(getClassName());
|
mustBeInMainThread(getClassName());
|
||||||
resetData();
|
resetData();
|
||||||
add(*participantList);
|
add(*participantList);
|
||||||
|
|
@ -116,11 +79,48 @@ void ParticipantList::setSelf(QSharedPointer<ParticipantList> me) {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
mModelConnection->makeConnectToModel(&ConferenceModel::participantAdded, &ParticipantList::lUpdateParticipants);
|
mConferenceModelConnection->makeConnectToCore(
|
||||||
mModelConnection->makeConnectToModel(&ConferenceModel::participantRemoved, &ParticipantList::lUpdateParticipants);
|
&ParticipantList::lSetParticipantAdminStatus, [this](ParticipantCore *participant, bool status) {
|
||||||
|
auto address = participant->getSipAddress();
|
||||||
|
mConferenceModelConnection->invokeToModel([this, address, status] {
|
||||||
|
auto participants = mConferenceModel->getMonitor()->getParticipantList();
|
||||||
|
for (auto &participant : participants) {
|
||||||
|
if (Utils::coreStringToAppString(participant->getAddress()->asStringUriOnly()) == address) {
|
||||||
|
mConferenceModel->setParticipantAdminStatus(participant, status);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
mConferenceModelConnection->makeConnectToModel(&ConferenceModel::participantAdminStatusChanged,
|
||||||
|
&ParticipantList::lUpdateParticipants);
|
||||||
|
|
||||||
|
mConferenceModelConnection->makeConnectToModel(&ConferenceModel::participantAdded,
|
||||||
|
&ParticipantList::lUpdateParticipants);
|
||||||
|
mConferenceModelConnection->makeConnectToModel(&ConferenceModel::participantRemoved,
|
||||||
|
&ParticipantList::lUpdateParticipants);
|
||||||
|
}
|
||||||
emit lUpdateParticipants();
|
emit lUpdateParticipants();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ParticipantList::setConferenceModel(const std::shared_ptr<ConferenceModel> &conferenceModel) {
|
||||||
|
mustBeInMainThread(log().arg(Q_FUNC_INFO));
|
||||||
|
mConferenceModel = conferenceModel;
|
||||||
|
qDebug() << "[ParticipantList] : set Conference " << mConferenceModel.get();
|
||||||
|
if (mConferenceModelConnection && mConferenceModelConnection->mCore.lock()) { // Unsure to get myself
|
||||||
|
auto oldConnect = mConferenceModelConnection->mCore; // Setself rebuild safepointer
|
||||||
|
setSelf(mConferenceModelConnection->mCore.mQData); // reset connections
|
||||||
|
oldConnect.unlock();
|
||||||
|
}
|
||||||
|
beginResetModel();
|
||||||
|
mList.clear();
|
||||||
|
endResetModel();
|
||||||
|
if (mConferenceModel) {
|
||||||
|
emit lUpdateParticipants();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
QVariant ParticipantList::data(const QModelIndex &index, int role) const {
|
QVariant ParticipantList::data(const QModelIndex &index, int role) const {
|
||||||
int row = index.row();
|
int row = index.row();
|
||||||
if (!index.isValid() || row < 0 || row >= mList.count()) return QVariant();
|
if (!index.isValid() || row < 0 || row >= mList.count()) return QVariant();
|
||||||
|
|
@ -138,48 +138,6 @@ std::list<std::shared_ptr<linphone::Address>> ParticipantList::getParticipants()
|
||||||
return participants;
|
return participants;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString ParticipantList::addressesToString() const {
|
|
||||||
QStringList txt;
|
|
||||||
for (auto item : mList) {
|
|
||||||
auto participant = item.objectCast<ParticipantCore>();
|
|
||||||
if (participant) {
|
|
||||||
|
|
||||||
// chat room yet.
|
|
||||||
txt << participant->getSipAddress();
|
|
||||||
// txt << Utils::toDisplayString(Utils::coreStringToAppString(address->asStringUriOnly()),
|
|
||||||
// CoreModel::getInstance()->getSettingsModel()->getSipDisplayMode());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (txt.size() > 0) txt.removeFirst(); // Remove me
|
|
||||||
return txt.join(", ");
|
|
||||||
}
|
|
||||||
|
|
||||||
QString ParticipantList::displayNamesToString() const {
|
|
||||||
QStringList txt;
|
|
||||||
for (auto item : mList) {
|
|
||||||
auto participant = item.objectCast<ParticipantCore>();
|
|
||||||
if (participant) {
|
|
||||||
QString displayName = participant->getSipAddress();
|
|
||||||
if (displayName != "") txt << displayName;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (txt.size() > 0) txt.removeFirst(); // Remove me
|
|
||||||
return txt.join(", ");
|
|
||||||
}
|
|
||||||
|
|
||||||
QString ParticipantList::usernamesToString() const {
|
|
||||||
QStringList txt;
|
|
||||||
for (auto item : mList) {
|
|
||||||
auto participant = item.objectCast<ParticipantCore>();
|
|
||||||
if (participant) {
|
|
||||||
auto username = participant->getDisplayName();
|
|
||||||
txt << username;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (txt.size() > 0) txt.removeFirst(); // Remove me
|
|
||||||
return txt.join(", ");
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ParticipantList::contains(const QString &address) const {
|
bool ParticipantList::contains(const QString &address) const {
|
||||||
auto testAddress = ToolModel::interpretUrl(address);
|
auto testAddress = ToolModel::interpretUrl(address);
|
||||||
bool exists = false;
|
bool exists = false;
|
||||||
|
|
@ -313,94 +271,95 @@ void ParticipantList::remove(ParticipantCore *participant) {
|
||||||
|
|
||||||
//-------------------------------------------------------------
|
//-------------------------------------------------------------
|
||||||
|
|
||||||
void ParticipantList::setAdminStatus(const std::shared_ptr<linphone::Participant> participant, const bool &isAdmin) {
|
// void ParticipantList::setAdminStatus(const std::shared_ptr<linphone::Participant> participant, const bool &isAdmin) {
|
||||||
// if (mChatRoomModel) mChatRoomModel->getChatRoom()->setParticipantAdminStatus(participant, isAdmin);
|
// // if (mChatRoomModel) mChatRoomModel->getChatRoom()->setParticipantAdminStatus(participant, isAdmin);
|
||||||
// if (mConferenceModel) mConferenceModel->getConference()->setParticipantAdminStatus(participant, isAdmin);
|
// // if (mConferenceModel) mConferenceModel->getConference()->setParticipantAdminStatus(participant, isAdmin);
|
||||||
}
|
// }
|
||||||
|
|
||||||
void ParticipantList::onSecurityEvent(const std::shared_ptr<const linphone::EventLog> &eventLog) {
|
// void ParticipantList::onSecurityEvent(const std::shared_ptr<const linphone::EventLog> &eventLog) {
|
||||||
auto address = eventLog->getParticipantAddress();
|
// auto address = eventLog->getParticipantAddress();
|
||||||
if (address) {
|
// if (address) {
|
||||||
// auto participant = getParticipant(address);
|
// // auto participant = getParticipant(address);
|
||||||
// if (participant) {
|
// // if (participant) {
|
||||||
// emit participant->securityLevelChanged();
|
// // emit participant->securityLevelChanged();
|
||||||
// }
|
// // }
|
||||||
} else {
|
// } else {
|
||||||
address = eventLog->getDeviceAddress();
|
// address = eventLog->getDeviceAddress();
|
||||||
// Looping on all participant ensure to get all devices. Can be optimized if Device address is unique : Gain
|
// // Looping on all participant ensure to get all devices. Can be optimized if Device address is unique : Gain
|
||||||
// 2n operations.
|
// // 2n operations.
|
||||||
if (address) emit deviceSecurityLevelChanged(address);
|
// if (address) emit deviceSecurityLevelChanged(address);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
void ParticipantList::onConferenceJoined() {
|
// void ParticipantList::onConferenceJoined() {
|
||||||
// updateParticipants();
|
// // updateParticipants();
|
||||||
}
|
// }
|
||||||
|
|
||||||
void ParticipantList::onParticipantAdded(const std::shared_ptr<const linphone::EventLog> &eventLog) {
|
// void ParticipantList::onParticipantAdded(const std::shared_ptr<const linphone::EventLog> &eventLog) {
|
||||||
qDebug() << "onParticipantAdded event: " << eventLog->getParticipantAddress()->asString().c_str();
|
// qDebug() << "onParticipantAdded event: " << eventLog->getParticipantAddress()->asString().c_str();
|
||||||
// add(eventLog->getParticipantAddress());
|
// // add(eventLog->getParticipantAddress());
|
||||||
}
|
// }
|
||||||
|
|
||||||
void ParticipantList::onParticipantAdded(const std::shared_ptr<const linphone::Participant> &participant) {
|
// void ParticipantList::onParticipantAdded(const std::shared_ptr<const linphone::Participant> &participant) {
|
||||||
qDebug() << "onParticipantAdded part: " << participant->getAddress()->asString().c_str();
|
// qDebug() << "onParticipantAdded part: " << participant->getAddress()->asString().c_str();
|
||||||
// add(participant);
|
// // add(participant);
|
||||||
}
|
// }
|
||||||
|
|
||||||
void ParticipantList::onParticipantAdded(const std::shared_ptr<const linphone::Address> &address) {
|
// void ParticipantList::onParticipantAdded(const std::shared_ptr<const linphone::Address> &address) {
|
||||||
qDebug() << "onParticipantAdded addr: " << address->asString().c_str();
|
// qDebug() << "onParticipantAdded addr: " << address->asString().c_str();
|
||||||
// add(address);
|
// // add(address);
|
||||||
}
|
// }
|
||||||
|
|
||||||
void ParticipantList::onParticipantRemoved(const std::shared_ptr<const linphone::EventLog> &eventLog) {
|
// void ParticipantList::onParticipantRemoved(const std::shared_ptr<const linphone::EventLog> &eventLog) {
|
||||||
onParticipantRemoved(eventLog->getParticipantAddress());
|
// onParticipantRemoved(eventLog->getParticipantAddress());
|
||||||
}
|
// }
|
||||||
|
|
||||||
void ParticipantList::onParticipantRemoved(const std::shared_ptr<const linphone::Participant> &participant) {
|
// void ParticipantList::onParticipantRemoved(const std::shared_ptr<const linphone::Participant> &participant) {
|
||||||
// auto p = getParticipant(participant);
|
// // auto p = getParticipant(participant);
|
||||||
// if (p) remove(p.get());
|
// // if (p) remove(p.get());
|
||||||
}
|
// }
|
||||||
|
|
||||||
void ParticipantList::onParticipantRemoved(const std::shared_ptr<const linphone::Address> &address) {
|
// void ParticipantList::onParticipantRemoved(const std::shared_ptr<const linphone::Address> &address) {
|
||||||
// auto participant = getParticipant(address);
|
// // auto participant = getParticipant(address);
|
||||||
// if (participant) remove(participant.get());
|
// // if (participant) remove(participant.get());
|
||||||
}
|
// }
|
||||||
|
|
||||||
void ParticipantList::onParticipantAdminStatusChanged(const std::shared_ptr<const linphone::EventLog> &eventLog) {
|
// void ParticipantList::onParticipantAdminStatusChanged(const std::shared_ptr<const linphone::EventLog> &eventLog) {
|
||||||
onParticipantAdminStatusChanged(eventLog->getParticipantAddress());
|
// onParticipantAdminStatusChanged(eventLog->getParticipantAddress());
|
||||||
}
|
// }
|
||||||
void ParticipantList::onParticipantAdminStatusChanged(const std::shared_ptr<const linphone::Participant> &participant) {
|
// void ParticipantList::onParticipantAdminStatusChanged(const std::shared_ptr<const linphone::Participant>
|
||||||
// auto p = getParticipant(participant);
|
// &participant) {
|
||||||
// if (participant) emit p->adminStatusChanged(); // Request to participant to update its status from its data
|
// // auto p = getParticipant(participant);
|
||||||
}
|
// // if (participant) emit p->adminStatusChanged(); // Request to participant to update its status from its data
|
||||||
void ParticipantList::onParticipantAdminStatusChanged(const std::shared_ptr<const linphone::Address> &address) {
|
// }
|
||||||
// auto participant = getParticipant(address);
|
// void ParticipantList::onParticipantAdminStatusChanged(const std::shared_ptr<const linphone::Address> &address) {
|
||||||
// if (participant)
|
// // auto participant = getParticipant(address);
|
||||||
// emit participant->adminStatusChanged(); // Request to participant to update its status from its data
|
// // if (participant)
|
||||||
}
|
// // emit participant->adminStatusChanged(); // Request to participant to update its status from its data
|
||||||
void ParticipantList::onParticipantDeviceAdded(const std::shared_ptr<const linphone::EventLog> &eventLog) {
|
// }
|
||||||
// auto participant = getParticipant(eventLog->getParticipantAddress());
|
// void ParticipantList::onParticipantDeviceAdded(const std::shared_ptr<const linphone::EventLog> &eventLog) {
|
||||||
// if (participant) {
|
// // auto participant = getParticipant(eventLog->getParticipantAddress());
|
||||||
// emit participant->deviceCountChanged();
|
// // if (participant) {
|
||||||
// }
|
// // emit participant->deviceCountChanged();
|
||||||
}
|
// // }
|
||||||
void ParticipantList::onParticipantDeviceRemoved(const std::shared_ptr<const linphone::EventLog> &eventLog) {
|
// }
|
||||||
// auto participant = getParticipant(eventLog->getParticipantAddress());
|
// void ParticipantList::onParticipantDeviceRemoved(const std::shared_ptr<const linphone::EventLog> &eventLog) {
|
||||||
// if (participant) {
|
// // auto participant = getParticipant(eventLog->getParticipantAddress());
|
||||||
// emit participant->deviceCountChanged();
|
// // if (participant) {
|
||||||
// }
|
// // emit participant->deviceCountChanged();
|
||||||
}
|
// // }
|
||||||
void ParticipantList::onParticipantRegistrationSubscriptionRequested(
|
// }
|
||||||
const std::shared_ptr<const linphone::Address> &participantAddress) {
|
// void ParticipantList::onParticipantRegistrationSubscriptionRequested(
|
||||||
}
|
// const std::shared_ptr<const linphone::Address> &participantAddress) {
|
||||||
void ParticipantList::onParticipantRegistrationUnsubscriptionRequested(
|
// }
|
||||||
const std::shared_ptr<const linphone::Address> &participantAddress) {
|
// void ParticipantList::onParticipantRegistrationUnsubscriptionRequested(
|
||||||
}
|
// const std::shared_ptr<const linphone::Address> &participantAddress) {
|
||||||
|
// }
|
||||||
|
|
||||||
void ParticipantList::onStateChanged() {
|
// void ParticipantList::onStateChanged() {
|
||||||
// if (mConferenceModel) {
|
// // if (mConferenceModel) {
|
||||||
// if (mConferenceModel->getConference()->getState() == linphone::Conference::State::Created) {
|
// // if (mConferenceModel->getConference()->getState() == linphone::Conference::State::Created) {
|
||||||
// updateParticipants();
|
// // updateParticipants();
|
||||||
// }
|
// // }
|
||||||
// }
|
// // }
|
||||||
}
|
// }
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,7 @@ class ParticipantList : public ListProxy, public AbstractObject {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
static QSharedPointer<ParticipantList> create();
|
static QSharedPointer<ParticipantList> create();
|
||||||
|
static QSharedPointer<ParticipantList> create(const std::shared_ptr<ConferenceModel> &conferenceModel);
|
||||||
|
|
||||||
// ParticipantList(ChatRoomModel *chatRoomModel, QObject *parent = Q_NULLPTR);
|
// ParticipantList(ChatRoomModel *chatRoomModel, QObject *parent = Q_NULLPTR);
|
||||||
// ParticipantList(ConferenceModel *conferenceModel, QObject *parent = Q_NULLPTR);
|
// ParticipantList(ConferenceModel *conferenceModel, QObject *parent = Q_NULLPTR);
|
||||||
|
|
@ -42,10 +43,6 @@ public:
|
||||||
void setSelf(QSharedPointer<ParticipantList> me);
|
void setSelf(QSharedPointer<ParticipantList> me);
|
||||||
|
|
||||||
// Q_PROPERTY(ChatRoomModel *chatRoomModel READ getChatRoomModel CONSTANT)
|
// Q_PROPERTY(ChatRoomModel *chatRoomModel READ getChatRoomModel CONSTANT)
|
||||||
Q_PROPERTY(QString addressesToString READ addressesToString NOTIFY participantsChanged)
|
|
||||||
Q_PROPERTY(QString displayNamesToString READ displayNamesToString NOTIFY participantsChanged)
|
|
||||||
Q_PROPERTY(QString usernamesToString READ usernamesToString NOTIFY participantsChanged)
|
|
||||||
|
|
||||||
void reset();
|
void reset();
|
||||||
// void updateParticipants(); // Update list from Chat Room
|
// void updateParticipants(); // Update list from Chat Room
|
||||||
// const QSharedPointer<ParticipantCore>
|
// const QSharedPointer<ParticipantCore>
|
||||||
|
|
@ -56,35 +53,32 @@ public:
|
||||||
Q_INVOKABLE void remove(ParticipantCore *participant);
|
Q_INVOKABLE void remove(ParticipantCore *participant);
|
||||||
std::list<std::shared_ptr<linphone::Address>> getParticipants() const;
|
std::list<std::shared_ptr<linphone::Address>> getParticipants() const;
|
||||||
|
|
||||||
Q_INVOKABLE QString addressesToString() const;
|
|
||||||
Q_INVOKABLE QString displayNamesToString() const;
|
|
||||||
Q_INVOKABLE QString usernamesToString() const;
|
|
||||||
|
|
||||||
bool contains(const QString &address) const;
|
bool contains(const QString &address) const;
|
||||||
|
|
||||||
|
void setConferenceModel(const std::shared_ptr<ConferenceModel> &conferenceModel);
|
||||||
|
|
||||||
virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
|
virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
|
||||||
|
|
||||||
public slots:
|
// public slots:
|
||||||
void setAdminStatus(const std::shared_ptr<linphone::Participant> participant, const bool &isAdmin);
|
// void setAdminStatus(const std::shared_ptr<linphone::Participant> participant, const bool &isAdmin);
|
||||||
|
|
||||||
void onSecurityEvent(const std::shared_ptr<const linphone::EventLog> &eventLog);
|
// void onSecurityEvent(const std::shared_ptr<const linphone::EventLog> &eventLog);
|
||||||
void onConferenceJoined();
|
// void onConferenceJoined();
|
||||||
void onParticipantAdded(const std::shared_ptr<const linphone::Participant> &participant);
|
// void onParticipantAdded(const std::shared_ptr<const linphone::Participant> &participant);
|
||||||
void onParticipantAdded(const std::shared_ptr<const linphone::EventLog> &eventLog);
|
// void onParticipantAdded(const std::shared_ptr<const linphone::EventLog> &eventLog);
|
||||||
void onParticipantAdded(const std::shared_ptr<const linphone::Address> &address);
|
// void onParticipantAdded(const std::shared_ptr<const linphone::Address> &address);
|
||||||
void onParticipantRemoved(const std::shared_ptr<const linphone::Participant> &participant);
|
// void onParticipantRemoved(const std::shared_ptr<const linphone::Participant> &participant);
|
||||||
void onParticipantRemoved(const std::shared_ptr<const linphone::EventLog> &eventLog);
|
// void onParticipantRemoved(const std::shared_ptr<const linphone::EventLog> &eventLog);
|
||||||
void onParticipantRemoved(const std::shared_ptr<const linphone::Address> &address);
|
// void onParticipantRemoved(const std::shared_ptr<const linphone::Address> &address);
|
||||||
void onParticipantAdminStatusChanged(const std::shared_ptr<const linphone::Participant> &participant);
|
// void onParticipantAdminStatusChanged(const std::shared_ptr<const linphone::Participant> &participant);
|
||||||
void onParticipantAdminStatusChanged(const std::shared_ptr<const linphone::EventLog> &eventLog);
|
// void onParticipantAdminStatusChanged(const std::shared_ptr<const linphone::EventLog> &eventLog);
|
||||||
void onParticipantAdminStatusChanged(const std::shared_ptr<const linphone::Address> &address);
|
// void onParticipantAdminStatusChanged(const std::shared_ptr<const linphone::Address> &address);
|
||||||
void onParticipantDeviceAdded(const std::shared_ptr<const linphone::EventLog> &eventLog);
|
// void onParticipantDeviceAdded(const std::shared_ptr<const linphone::EventLog> &eventLog);
|
||||||
void onParticipantDeviceRemoved(const std::shared_ptr<const linphone::EventLog> &eventLog);
|
// void onParticipantDeviceRemoved(const std::shared_ptr<const linphone::EventLog> &eventLog);
|
||||||
void
|
// void
|
||||||
onParticipantRegistrationSubscriptionRequested(const std::shared_ptr<const linphone::Address> &participantAddress);
|
// onParticipantRegistrationSubscriptionRequested(const std::shared_ptr<const linphone::Address>
|
||||||
void onParticipantRegistrationUnsubscriptionRequested(
|
// &participantAddress); void onParticipantRegistrationUnsubscriptionRequested( const std::shared_ptr<const
|
||||||
const std::shared_ptr<const linphone::Address> &participantAddress);
|
// linphone::Address> &participantAddress); void onStateChanged();
|
||||||
void onStateChanged();
|
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void securityLevelChanged();
|
void securityLevelChanged();
|
||||||
|
|
@ -92,10 +86,11 @@ signals:
|
||||||
void participantsChanged();
|
void participantsChanged();
|
||||||
|
|
||||||
void lUpdateParticipants();
|
void lUpdateParticipants();
|
||||||
|
void lSetParticipantAdminStatus(ParticipantCore *participant, bool status);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::shared_ptr<ConferenceModel> mConferenceModel;
|
std::shared_ptr<ConferenceModel> mConferenceModel;
|
||||||
QSharedPointer<SafeConnection<ParticipantList, ConferenceModel>> mModelConnection;
|
QSharedPointer<SafeConnection<ParticipantList, ConferenceModel>> mConferenceModelConnection;
|
||||||
|
|
||||||
// ChatRoomModel *mChatRoomModel = nullptr;
|
// ChatRoomModel *mChatRoomModel = nullptr;
|
||||||
// ConferenceCore *mConferenceCore = nullptr;
|
// ConferenceCore *mConferenceCore = nullptr;
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "ParticipantProxy.hpp"
|
#include "ParticipantProxy.hpp"
|
||||||
|
#include "ParticipantList.hpp"
|
||||||
|
|
||||||
// #include "core/conference/ConferenceCore.hpp"
|
// #include "core/conference/ConferenceCore.hpp"
|
||||||
#include "model/core/CoreModel.hpp"
|
#include "model/core/CoreModel.hpp"
|
||||||
|
|
@ -31,19 +32,50 @@
|
||||||
|
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
DEFINE_ABSTRACT_OBJECT(ParticipantProxy)
|
||||||
|
|
||||||
ParticipantProxy::ParticipantProxy(QObject *parent) : SortFilterProxy(parent) {
|
ParticipantProxy::ParticipantProxy(QObject *parent) : SortFilterProxy(parent) {
|
||||||
mList = ParticipantList::create();
|
mParticipants = ParticipantList::create();
|
||||||
setSourceModel(mList.get());
|
|
||||||
connect(this, &ParticipantProxy::chatRoomModelChanged, this, &ParticipantProxy::countChanged);
|
connect(this, &ParticipantProxy::chatRoomModelChanged, this, &ParticipantProxy::countChanged);
|
||||||
connect(this, &ParticipantProxy::conferenceModelChanged, this, &ParticipantProxy::countChanged);
|
connect(this, &ParticipantProxy::conferenceModelChanged, this, &ParticipantProxy::countChanged);
|
||||||
|
setSourceModel(mParticipants.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
ParticipantProxy::~ParticipantProxy() {
|
ParticipantProxy::~ParticipantProxy() {
|
||||||
setSourceModel(nullptr);
|
setSourceModel(nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CallGui *ParticipantProxy::getCurrentCall() const {
|
||||||
|
return mCurrentCall;
|
||||||
|
}
|
||||||
|
|
||||||
|
void ParticipantProxy::setCurrentCall(CallGui *call) {
|
||||||
|
qDebug() << "[ParticipantProxy] set current call " << this << " => " << call;
|
||||||
|
if (mCurrentCall != call) {
|
||||||
|
CallCore *callCore = nullptr;
|
||||||
|
if (mCurrentCall) {
|
||||||
|
callCore = mCurrentCall->getCore();
|
||||||
|
if (callCore) callCore->disconnect(mParticipants.get());
|
||||||
|
callCore = nullptr;
|
||||||
|
}
|
||||||
|
mCurrentCall = call;
|
||||||
|
if (mCurrentCall) callCore = mCurrentCall->getCore();
|
||||||
|
if (callCore) {
|
||||||
|
connect(callCore, &CallCore::conferenceChanged, mParticipants.get(), [this]() {
|
||||||
|
auto conference = mCurrentCall->getCore()->getConferenceCore();
|
||||||
|
qDebug() << "[ParticipantDeviceProxy] set conference " << this << " => " << conference;
|
||||||
|
mParticipants->setConferenceModel(conference ? conference->getModel() : nullptr);
|
||||||
|
// mParticipants->lSetConferenceModel(conference ? conference->getModel() : nullptr);
|
||||||
|
});
|
||||||
|
auto conference = callCore->getConferenceCore();
|
||||||
|
qDebug() << "[ParticipantDeviceProxy] set conference " << this << " => " << conference;
|
||||||
|
mParticipants->setConferenceModel(conference ? conference->getModel() : nullptr);
|
||||||
|
// mParticipants->lSetConferenceModel(conference ? conference->getModel() : nullptr);
|
||||||
|
}
|
||||||
|
emit currentCallChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// ChatRoomModel *ParticipantProxy::getChatRoomModel() const {
|
// ChatRoomModel *ParticipantProxy::getChatRoomModel() const {
|
||||||
// return mChatRoomModel;
|
// return mChatRoomModel;
|
||||||
// }
|
// }
|
||||||
|
|
@ -52,21 +84,6 @@ ParticipantProxy::~ParticipantProxy() {
|
||||||
// return mConferenceModel;
|
// return mConferenceModel;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
QStringList ParticipantProxy::getSipAddresses() const {
|
|
||||||
QStringList participants;
|
|
||||||
for (int i = 0; i < mList->rowCount(); ++i)
|
|
||||||
participants << mList->getAt<ParticipantCore>(i)->getSipAddress();
|
|
||||||
return participants;
|
|
||||||
}
|
|
||||||
|
|
||||||
QVariantList ParticipantProxy::getParticipants() const {
|
|
||||||
QVariantList participants;
|
|
||||||
ParticipantList *list = qobject_cast<ParticipantList *>(sourceModel());
|
|
||||||
for (int i = 0; i < list->rowCount(); ++i)
|
|
||||||
participants << QVariant::fromValue(list->getAt<ParticipantCore>(i).get());
|
|
||||||
return participants;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ParticipantProxy::getShowMe() const {
|
bool ParticipantProxy::getShowMe() const {
|
||||||
return mShowMe;
|
return mShowMe;
|
||||||
}
|
}
|
||||||
|
|
@ -173,10 +190,14 @@ void ParticipantProxy::setShowMe(const bool &show) {
|
||||||
|
|
||||||
void ParticipantProxy::removeParticipant(ParticipantCore *participant) {
|
void ParticipantProxy::removeParticipant(ParticipantCore *participant) {
|
||||||
if (participant) {
|
if (participant) {
|
||||||
mList->remove(participant);
|
mParticipants->remove(participant);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ParticipantProxy::setParticipantAdminStatus(ParticipantCore *participant, bool status) {
|
||||||
|
emit mParticipants->lSetParticipantAdminStatus(participant, status);
|
||||||
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
bool ParticipantProxy::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const {
|
bool ParticipantProxy::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const {
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,9 @@
|
||||||
#define PARTICIPANT_PROXY_H_
|
#define PARTICIPANT_PROXY_H_
|
||||||
|
|
||||||
#include "../proxy/SortFilterProxy.hpp"
|
#include "../proxy/SortFilterProxy.hpp"
|
||||||
|
#include "core/call/CallGui.hpp"
|
||||||
|
#include "tool/AbstractObject.hpp"
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
class ParticipantCore;
|
class ParticipantCore;
|
||||||
|
|
@ -33,23 +36,24 @@ class ConferenceInfoModel;
|
||||||
|
|
||||||
class QWindow;
|
class QWindow;
|
||||||
|
|
||||||
class ParticipantProxy : public SortFilterProxy {
|
class ParticipantProxy : public SortFilterProxy, public AbstractObject {
|
||||||
|
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
Q_PROPERTY(CallGui *currentCall READ getCurrentCall WRITE setCurrentCall NOTIFY currentCallChanged)
|
||||||
Q_PROPERTY(bool showMe READ getShowMe WRITE setShowMe NOTIFY showMeChanged)
|
Q_PROPERTY(bool showMe READ getShowMe WRITE setShowMe NOTIFY showMeChanged)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ParticipantProxy(QObject *parent = Q_NULLPTR);
|
ParticipantProxy(QObject *parent = Q_NULLPTR);
|
||||||
~ParticipantProxy();
|
~ParticipantProxy();
|
||||||
|
|
||||||
|
CallGui *getCurrentCall() const;
|
||||||
|
void setCurrentCall(CallGui *callGui);
|
||||||
|
|
||||||
bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override;
|
bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override;
|
||||||
bool lessThan(const QModelIndex &left, const QModelIndex &right) const override;
|
bool lessThan(const QModelIndex &left, const QModelIndex &right) const override;
|
||||||
|
|
||||||
// ChatRoomModel *getChatRoomModel() const;
|
// ChatRoomModel *getChatRoomModel() const;
|
||||||
// ConferenceModel *getConferenceModel() const;
|
// ConferenceModel *getConferenceModel() const;
|
||||||
Q_INVOKABLE QStringList getSipAddresses() const;
|
|
||||||
Q_INVOKABLE QVariantList getParticipants() const;
|
|
||||||
bool getShowMe() const;
|
bool getShowMe() const;
|
||||||
|
|
||||||
// void setChatRoomModel(ChatRoomModel *chatRoomModel);
|
// void setChatRoomModel(ChatRoomModel *chatRoomModel);
|
||||||
|
|
@ -58,6 +62,7 @@ public:
|
||||||
|
|
||||||
// Q_INVOKABLE void addAddress(const QString &address);
|
// Q_INVOKABLE void addAddress(const QString &address);
|
||||||
Q_INVOKABLE void removeParticipant(ParticipantCore *participant);
|
Q_INVOKABLE void removeParticipant(ParticipantCore *participant);
|
||||||
|
Q_INVOKABLE void setParticipantAdminStatus(ParticipantCore *participant, bool status);
|
||||||
Q_INVOKABLE void setAddresses(ConferenceInfoModel *conferenceInfoModel);
|
Q_INVOKABLE void setAddresses(ConferenceInfoModel *conferenceInfoModel);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
|
@ -68,12 +73,14 @@ signals:
|
||||||
void showMeChanged();
|
void showMeChanged();
|
||||||
void addressAdded(QString sipAddress);
|
void addressAdded(QString sipAddress);
|
||||||
void addressRemoved(QString sipAddress);
|
void addressRemoved(QString sipAddress);
|
||||||
|
void currentCallChanged();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// ChatRoomModel *mChatRoomModel = nullptr;
|
// ChatRoomModel *mChatRoomModel = nullptr;
|
||||||
// ConferenceModel *mConferenceModel = nullptr;
|
|
||||||
bool mShowMe = true;
|
bool mShowMe = true;
|
||||||
QSharedPointer<ParticipantList> mList;
|
CallGui *mCurrentCall = nullptr;
|
||||||
|
QSharedPointer<ParticipantList> mParticipants;
|
||||||
|
DECLARE_ABSTRACT_OBJECT
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // PARTICIPANT_PROXY_H_
|
#endif // PARTICIPANT_PROXY_H_
|
||||||
|
|
|
||||||
|
|
@ -117,6 +117,10 @@ void ConferenceModel::setRecordFile(const std::string &path) {
|
||||||
// return volume;
|
// return volume;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
void ConferenceModel::setParticipantAdminStatus(const std::shared_ptr<linphone::Participant> participant, bool status) {
|
||||||
|
mMonitor->setParticipantAdminStatus(participant, status);
|
||||||
|
}
|
||||||
|
|
||||||
void ConferenceModel::setInputAudioDevice(const std::shared_ptr<linphone::AudioDevice> &device) {
|
void ConferenceModel::setInputAudioDevice(const std::shared_ptr<linphone::AudioDevice> &device) {
|
||||||
mMonitor->setInputAudioDevice(device);
|
mMonitor->setInputAudioDevice(device);
|
||||||
std::string deviceName;
|
std::string deviceName;
|
||||||
|
|
@ -149,12 +153,12 @@ void ConferenceModel::onActiveSpeakerParticipantDevice(
|
||||||
|
|
||||||
void ConferenceModel::onParticipantAdded(const std::shared_ptr<linphone::Conference> &conference,
|
void ConferenceModel::onParticipantAdded(const std::shared_ptr<linphone::Conference> &conference,
|
||||||
const std::shared_ptr<linphone::Participant> &participant) {
|
const std::shared_ptr<linphone::Participant> &participant) {
|
||||||
qDebug() << "onParticipantAdded: " << participant->getAddress()->asString().c_str();
|
// qDebug() << "onParticipantAdded: " << participant->getAddress()->asString().c_str();
|
||||||
emit participantAdded(participant);
|
emit participantAdded(participant);
|
||||||
}
|
}
|
||||||
void ConferenceModel::onParticipantRemoved(const std::shared_ptr<linphone::Conference> &conference,
|
void ConferenceModel::onParticipantRemoved(const std::shared_ptr<linphone::Conference> &conference,
|
||||||
const std::shared_ptr<const linphone::Participant> &participant) {
|
const std::shared_ptr<const linphone::Participant> &participant) {
|
||||||
qDebug() << "onParticipantRemoved";
|
// qDebug() << "onParticipantRemoved";
|
||||||
emit participantRemoved(participant);
|
emit participantRemoved(participant);
|
||||||
}
|
}
|
||||||
void ConferenceModel::onParticipantDeviceAdded(const std::shared_ptr<linphone::Conference> &conference,
|
void ConferenceModel::onParticipantDeviceAdded(const std::shared_ptr<linphone::Conference> &conference,
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,7 @@ public:
|
||||||
void startRecording();
|
void startRecording();
|
||||||
void stopRecording();
|
void stopRecording();
|
||||||
void setRecordFile(const std::string &path);
|
void setRecordFile(const std::string &path);
|
||||||
|
void setParticipantAdminStatus(const std::shared_ptr<linphone::Participant> participant, bool status);
|
||||||
void setInputAudioDevice(const std::shared_ptr<linphone::AudioDevice> &id);
|
void setInputAudioDevice(const std::shared_ptr<linphone::AudioDevice> &id);
|
||||||
std::shared_ptr<const linphone::AudioDevice> getInputAudioDevice() const;
|
std::shared_ptr<const linphone::AudioDevice> getInputAudioDevice() const;
|
||||||
void setOutputAudioDevice(const std::shared_ptr<linphone::AudioDevice> &id);
|
void setOutputAudioDevice(const std::shared_ptr<linphone::AudioDevice> &id);
|
||||||
|
|
|
||||||
|
|
@ -28,8 +28,8 @@ 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) {
|
||||||
assert(mParticipant);
|
|
||||||
mParticipant = linphoneParticipant;
|
mParticipant = linphoneParticipant;
|
||||||
|
assert(mParticipant);
|
||||||
}
|
}
|
||||||
|
|
||||||
ParticipantModel::~ParticipantModel() {
|
ParticipantModel::~ParticipantModel() {
|
||||||
|
|
|
||||||
|
|
@ -1201,15 +1201,5 @@ bool Utils::isMe(const QString &address) {
|
||||||
// QDateTime dateTime(QDateTime::fromString(date, "yyyy-MM-dd hh:mm:ss"));
|
// QDateTime dateTime(QDateTime::fromString(date, "yyyy-MM-dd hh:mm:ss"));
|
||||||
|
|
||||||
// bool Utils::isMe(const QString &address) {
|
// bool Utils::isMe(const QString &address) {
|
||||||
// return !address.isEmpty() ? isMe(Utils::interpretUrl(address)) : false;
|
// return !address.isEmpty() ? isMe(ToolModel::interpretUrl(address)) : false;
|
||||||
// }
|
|
||||||
|
|
||||||
// bool Utils::isMe(const std::shared_ptr<const linphone::Address> &address) {
|
|
||||||
// if (!CoreModel::getInstance()
|
|
||||||
// ->getCore()
|
|
||||||
// ->getDefaultAccount()) { // Default account is selected : Me is all local accounts.
|
|
||||||
// return CoreModel::getInstance()->getAccountSettingsModel()->findAccount(address) != nullptr;
|
|
||||||
// } else
|
|
||||||
// return address ? CoreModel::getInstance()->getAccountSettingsModel()->getUsedSipAddress()->weakEqual(address)
|
|
||||||
// : false;
|
|
||||||
// }
|
// }
|
||||||
|
|
|
||||||
|
|
@ -131,7 +131,6 @@ Window {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
component BottomButton : Button {
|
component BottomButton : Button {
|
||||||
id: bottomButton
|
id: bottomButton
|
||||||
required property string enabledIcon
|
required property string enabledIcon
|
||||||
|
|
@ -379,7 +378,7 @@ Window {
|
||||||
id: rightPanelTitle
|
id: rightPanelTitle
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
width: rightPanel.width
|
width: rightPanel.width
|
||||||
color: DefaultStyle.main2_700
|
color: mainWindow.conference ? DefaultStyle.main1_500_main : DefaultStyle.main2_700
|
||||||
// text: qsTr("Transfert d'appel")
|
// text: qsTr("Transfert d'appel")
|
||||||
font {
|
font {
|
||||||
pixelSize: 16 * DefaultStyle.dp
|
pixelSize: 16 * DefaultStyle.dp
|
||||||
|
|
@ -581,6 +580,28 @@ Window {
|
||||||
call: mainWindow.call
|
call: mainWindow.call
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Component {
|
||||||
|
id: participantListPanel
|
||||||
|
StackLayout {
|
||||||
|
id: participantsStack
|
||||||
|
currentIndex: 0
|
||||||
|
Control.StackView.onActivated: rightPanelTitle.text = qsTr("Participants (%1)").arg(count)
|
||||||
|
onCurrentIndexChanged: {
|
||||||
|
if (index === 0) rightPanelTitle.text = qsTr("Participants (%1)").arg(count)
|
||||||
|
else rightPanelTitle.text = qsTr("Ajouter des participants")
|
||||||
|
}
|
||||||
|
ParticipantList {
|
||||||
|
call: mainWindow.call
|
||||||
|
onCountChanged: if (Control.StackView.status === Control.StackView.Active) {
|
||||||
|
rightPanelTitle.text = qsTr("Participants (%1)").arg(count)
|
||||||
|
}
|
||||||
|
onAddParticipantRequested: participantsStack.currentIndex = 1
|
||||||
|
}
|
||||||
|
AddParticipantLayout {
|
||||||
|
conferenceInfoGui: mainWindow.conferenceInfo
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -783,6 +804,21 @@ Window {
|
||||||
Layout.preferredHeight: 55 * DefaultStyle.dp
|
Layout.preferredHeight: 55 * DefaultStyle.dp
|
||||||
onCheckedChanged: mainWindow.call.core.lSetMicrophoneMuted(!mainWindow.call.core.microphoneMuted)
|
onCheckedChanged: mainWindow.call.core.lSetMicrophoneMuted(!mainWindow.call.core.microphoneMuted)
|
||||||
}
|
}
|
||||||
|
CheckableButton {
|
||||||
|
iconUrl: AppIcons.usersTwo
|
||||||
|
checked: mainWindow.call && mainWindow.call.core.microphoneMuted
|
||||||
|
checkedColor: DefaultStyle.main2_400
|
||||||
|
Layout.preferredWidth: 55 * DefaultStyle.dp
|
||||||
|
Layout.preferredHeight: 55 * DefaultStyle.dp
|
||||||
|
onCheckedChanged: {
|
||||||
|
if (checked) {
|
||||||
|
rightPanel.visible = true
|
||||||
|
rightPanel.replace(participantListPanel)
|
||||||
|
} else {
|
||||||
|
rightPanel.visible = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
PopupButton {
|
PopupButton {
|
||||||
id: moreOptionsButton
|
id: moreOptionsButton
|
||||||
Layout.preferredWidth: 55 * DefaultStyle.dp
|
Layout.preferredWidth: 55 * DefaultStyle.dp
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,9 @@ list(APPEND _LINPHONEAPP_QML_FILES
|
||||||
view/Item/Notification/Notification.qml
|
view/Item/Notification/Notification.qml
|
||||||
view/Item/Notification/NotificationReceivedCall.qml
|
view/Item/Notification/NotificationReceivedCall.qml
|
||||||
|
|
||||||
|
view/Item/Participant/ParticipantDeviceList.qml
|
||||||
|
view/Item/Participant/ParticipantList.qml
|
||||||
|
|
||||||
view/Item/Prototype/CanvasCircle.qml
|
view/Item/Prototype/CanvasCircle.qml
|
||||||
|
|
||||||
view/Item/Contact/Avatar.qml
|
view/Item/Contact/Avatar.qml
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ Control.Button {
|
||||||
property bool inversedColors: false
|
property bool inversedColors: false
|
||||||
property int textSize: 18 * DefaultStyle.dp
|
property int textSize: 18 * DefaultStyle.dp
|
||||||
property int textWeight: 600 * DefaultStyle.dp
|
property int textWeight: 600 * DefaultStyle.dp
|
||||||
|
property color textColor: DefaultStyle.grey_0
|
||||||
property bool underline: false
|
property bool underline: false
|
||||||
property bool shadowEnabled: false
|
property bool shadowEnabled: false
|
||||||
property var contentImageColor
|
property var contentImageColor
|
||||||
|
|
@ -63,6 +64,37 @@ Control.Button {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
component ButtonText: Text {
|
||||||
|
visible: mainItem.text != undefined
|
||||||
|
horizontalAlignment: Text.AlignHCenter
|
||||||
|
verticalAlignment: Text.AlignVCenter
|
||||||
|
width: mainItem.text != undefined ? implicitWidth : 0
|
||||||
|
height: implicitHeight
|
||||||
|
wrapMode: Text.WrapAnywhere
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.fillHeight: true
|
||||||
|
text: mainItem.text
|
||||||
|
maximumLineCount: 1
|
||||||
|
color: inversedColors ? mainItem.color : mainItem.textColor
|
||||||
|
font {
|
||||||
|
pixelSize: mainItem.textSize
|
||||||
|
weight: mainItem.textWeight
|
||||||
|
family: DefaultStyle.defaultFont
|
||||||
|
capitalization: mainItem.capitalization
|
||||||
|
underline: mainItem.underline
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
component ButtonImage: EffectImage {
|
||||||
|
visible: mainItem.icon.source != undefined
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.fillHeight: true
|
||||||
|
imageSource: mainItem.icon.source
|
||||||
|
imageWidth: mainItem.icon.width
|
||||||
|
imageHeight: mainItem.icon.height
|
||||||
|
colorizationColor: mainItem.contentImageColor
|
||||||
|
}
|
||||||
|
|
||||||
contentItem: StackLayout {
|
contentItem: StackLayout {
|
||||||
currentIndex: mainItem.text.length != 0 && mainItem.icon.source != undefined
|
currentIndex: mainItem.text.length != 0 && mainItem.icon.source != undefined
|
||||||
? 0
|
? 0
|
||||||
|
|
@ -74,65 +106,12 @@ Control.Button {
|
||||||
|
|
||||||
width: mainItem.width
|
width: mainItem.width
|
||||||
RowLayout {
|
RowLayout {
|
||||||
spacing: 5 * DefaultStyle.dp
|
spacing: 10 * DefaultStyle.dp
|
||||||
EffectImage {
|
ButtonImage{}
|
||||||
visible: mainItem.icon.source != undefined
|
ButtonText{}
|
||||||
Layout.fillWidth: true
|
|
||||||
Layout.fillHeight: true
|
|
||||||
imageSource: mainItem.icon.source
|
|
||||||
imageWidth: mainItem.icon.width
|
|
||||||
imageHeight: mainItem.icon.height
|
|
||||||
colorizationColor: mainItem.contentImageColor
|
|
||||||
}
|
|
||||||
Text {
|
|
||||||
visible: mainItem.text != undefined
|
|
||||||
horizontalAlignment: Text.AlignHCenter
|
|
||||||
verticalAlignment: Text.AlignVCenter
|
|
||||||
width: mainItem.text != undefined ? implicitWidth : 0
|
|
||||||
height: implicitHeight
|
|
||||||
wrapMode: Text.WrapAnywhere
|
|
||||||
Layout.fillWidth: true
|
|
||||||
Layout.fillHeight: true
|
|
||||||
text: mainItem.text
|
|
||||||
maximumLineCount: 1
|
|
||||||
color: inversedColors ? mainItem.color : DefaultStyle.grey_0
|
|
||||||
font {
|
|
||||||
pixelSize: mainItem.textSize
|
|
||||||
weight: mainItem.textWeight
|
|
||||||
family: DefaultStyle.defaultFont
|
|
||||||
capitalization: mainItem.capitalization
|
|
||||||
underline: mainItem.underline
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Text {
|
|
||||||
horizontalAlignment: Text.AlignHCenter
|
|
||||||
verticalAlignment: Text.AlignVCenter
|
|
||||||
Layout.alignment: Qt.AlignCenter
|
|
||||||
Layout.fillWidth: true
|
|
||||||
Layout.fillHeight: true
|
|
||||||
height: implicitHeight
|
|
||||||
wrapMode: Text.WrapAnywhere
|
|
||||||
text: mainItem.text
|
|
||||||
maximumLineCount: 1
|
|
||||||
color: inversedColors ? mainItem.color : DefaultStyle.grey_0
|
|
||||||
font {
|
|
||||||
pixelSize: mainItem.textSize
|
|
||||||
weight: mainItem.textWeight
|
|
||||||
family: DefaultStyle.defaultFont
|
|
||||||
capitalization: mainItem.capitalization
|
|
||||||
underline: mainItem.underline
|
|
||||||
}
|
|
||||||
}
|
|
||||||
EffectImage {
|
|
||||||
Layout.alignment: Qt.AlignCenter
|
|
||||||
Layout.fillWidth: true
|
|
||||||
Layout.fillHeight: true
|
|
||||||
imageSource: mainItem.icon.source
|
|
||||||
imageWidth: mainItem.icon.width
|
|
||||||
imageHeight: mainItem.icon.height
|
|
||||||
colorizationColor: mainItem.contentImageColor
|
|
||||||
}
|
}
|
||||||
|
ButtonText {}
|
||||||
|
ButtonImage{}
|
||||||
Item {
|
Item {
|
||||||
Layout.fillWidth : true
|
Layout.fillWidth : true
|
||||||
Layout.fillHeight : true
|
Layout.fillHeight : true
|
||||||
|
|
|
||||||
80
Linphone/view/Item/Participant/ParticipantDeviceList.qml
Normal file
80
Linphone/view/Item/Participant/ParticipantDeviceList.qml
Normal file
|
|
@ -0,0 +1,80 @@
|
||||||
|
import QtQuick 2.7
|
||||||
|
import QtQuick.Layouts 1.3
|
||||||
|
|
||||||
|
import Linphone
|
||||||
|
import UtilsCpp 1.0
|
||||||
|
|
||||||
|
ListView {
|
||||||
|
id: mainItem
|
||||||
|
Layout.preferredHeight: contentHeight
|
||||||
|
height: contentHeight
|
||||||
|
visible: contentHeight > 0
|
||||||
|
clip: true
|
||||||
|
rightMargin: 5 * DefaultStyle.dp
|
||||||
|
spacing: 5 * DefaultStyle.dp
|
||||||
|
|
||||||
|
property string searchBarText
|
||||||
|
|
||||||
|
property CallGui call
|
||||||
|
|
||||||
|
property bool hoverEnabled: true
|
||||||
|
// dots popup menu
|
||||||
|
property bool contactMenuVisible: true
|
||||||
|
// call, video call etc menu
|
||||||
|
property bool actionMenuVisible: true
|
||||||
|
property bool initialHeadersVisible: true
|
||||||
|
property bool displayNameCapitalization: true
|
||||||
|
|
||||||
|
property ConferenceInfoGui confInfoGui
|
||||||
|
|
||||||
|
currentIndex: -1
|
||||||
|
|
||||||
|
model: ParticipantDeviceProxy {
|
||||||
|
id: participantDevices
|
||||||
|
currentCall: mainItem.call
|
||||||
|
}
|
||||||
|
|
||||||
|
delegate: Item {
|
||||||
|
height: 56 * DefaultStyle.dp
|
||||||
|
width: mainItem.width
|
||||||
|
|
||||||
|
RowLayout {
|
||||||
|
id: participantDelegate
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.leftMargin: 10 * DefaultStyle.dp
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.rightMargin: 10 * DefaultStyle.dp
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
spacing: 10 * DefaultStyle.dp
|
||||||
|
z: 1
|
||||||
|
Avatar {
|
||||||
|
Layout.preferredWidth: 45 * DefaultStyle.dp
|
||||||
|
Layout.preferredHeight: 45 * DefaultStyle.dp
|
||||||
|
address: modelData.core.address
|
||||||
|
}
|
||||||
|
Text {
|
||||||
|
text: modelData.core.displayName
|
||||||
|
font.pixelSize: 14 * DefaultStyle.dp
|
||||||
|
font.capitalization: mainItem.displayNameCapitalization ? Font.Capitalize : Font.MixedCase
|
||||||
|
maximumLineCount: 1
|
||||||
|
Layout.fillWidth: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// MouseArea {
|
||||||
|
// id: mouseArea
|
||||||
|
// hoverEnabled: mainItem.hoverEnabled
|
||||||
|
// anchors.fill: participantDelegate
|
||||||
|
// height: mainItem.height
|
||||||
|
// Rectangle {
|
||||||
|
// anchors.fill: mouseArea
|
||||||
|
// opacity: 0.7
|
||||||
|
// color: DefaultStyle.main2_100
|
||||||
|
// visible: mouseArea.containsMouse || (!mainItem.multiSelectionEnabled && mainItem.currentIndex === index)
|
||||||
|
// }
|
||||||
|
// onClicked: {
|
||||||
|
// mainItem.currentIndex = index
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
}
|
||||||
125
Linphone/view/Item/Participant/ParticipantList.qml
Normal file
125
Linphone/view/Item/Participant/ParticipantList.qml
Normal file
|
|
@ -0,0 +1,125 @@
|
||||||
|
import QtQuick 2.7
|
||||||
|
import QtQuick.Layouts 1.3
|
||||||
|
|
||||||
|
import Linphone
|
||||||
|
import UtilsCpp 1.0
|
||||||
|
|
||||||
|
ListView {
|
||||||
|
id: mainItem
|
||||||
|
Layout.preferredHeight: contentHeight
|
||||||
|
height: contentHeight
|
||||||
|
visible: contentHeight > 0
|
||||||
|
clip: true
|
||||||
|
rightMargin: 5 * DefaultStyle.dp
|
||||||
|
spacing: 5 * DefaultStyle.dp
|
||||||
|
|
||||||
|
property string searchBarText
|
||||||
|
|
||||||
|
property CallGui call
|
||||||
|
property ParticipantGui me: call.conference ? call.conference.core.me : null
|
||||||
|
property bool isMeAdmin: me ? me.core.isAdmin : false
|
||||||
|
|
||||||
|
property bool hoverEnabled: true
|
||||||
|
// dots popup menu
|
||||||
|
property bool contactMenuVisible: true
|
||||||
|
// call, video call etc menu
|
||||||
|
property bool actionMenuVisible: true
|
||||||
|
property bool initialHeadersVisible: true
|
||||||
|
property bool displayNameCapitalization: true
|
||||||
|
|
||||||
|
property ConferenceInfoGui confInfoGui
|
||||||
|
|
||||||
|
signal addParticipantRequested()
|
||||||
|
|
||||||
|
currentIndex: -1
|
||||||
|
|
||||||
|
model: ParticipantProxy {
|
||||||
|
id: participantModel
|
||||||
|
currentCall: mainItem.call
|
||||||
|
}
|
||||||
|
|
||||||
|
delegate: Item {
|
||||||
|
height: 56 * DefaultStyle.dp
|
||||||
|
width: mainItem.width
|
||||||
|
|
||||||
|
RowLayout {
|
||||||
|
id: participantDelegate
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.leftMargin: 10 * DefaultStyle.dp
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.rightMargin: 10 * DefaultStyle.dp
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
spacing: 10 * DefaultStyle.dp
|
||||||
|
z: 1
|
||||||
|
Avatar {
|
||||||
|
Layout.preferredWidth: 45 * DefaultStyle.dp
|
||||||
|
Layout.preferredHeight: 45 * DefaultStyle.dp
|
||||||
|
address: modelData.core.sipAddress
|
||||||
|
}
|
||||||
|
Text {
|
||||||
|
text: modelData.core.displayName
|
||||||
|
font.pixelSize: 14 * DefaultStyle.dp
|
||||||
|
font.capitalization: mainItem.displayNameCapitalization ? Font.Capitalize : Font.MixedCase
|
||||||
|
maximumLineCount: 1
|
||||||
|
Layout.fillWidth: true
|
||||||
|
}
|
||||||
|
Text {
|
||||||
|
Layout.alignment: Qt.AlignRight
|
||||||
|
visible: modelData.core.isAdmin
|
||||||
|
text: qsTr("Admin")
|
||||||
|
color: DefaultStyle.main2_400
|
||||||
|
font {
|
||||||
|
pixelSize: 12 * DefaultStyle.dp
|
||||||
|
weight: 300 * DefaultStyle.dp
|
||||||
|
}
|
||||||
|
}
|
||||||
|
RowLayout {
|
||||||
|
Layout.alignment: Qt.AlignRight
|
||||||
|
property bool isMe: modelData.core.isMe
|
||||||
|
onIsMeChanged: if (isMe) mainItem.me = modelData
|
||||||
|
enabled: mainItem.isMeAdmin && !modelData.core.isMe
|
||||||
|
opacity: enabled ? 1.0 : 0
|
||||||
|
spacing: 26 * DefaultStyle.dp
|
||||||
|
Switch {
|
||||||
|
Component.onCompleted: if (modelData.core.isAdmin) toggle()
|
||||||
|
onToggled: participantModel.setParticipantAdminStatus(modelData.core, position === 1)
|
||||||
|
}
|
||||||
|
Button {
|
||||||
|
Layout.preferredWidth: 20 * DefaultStyle.dp
|
||||||
|
Layout.preferredHeight: 20 * DefaultStyle.dp
|
||||||
|
color: DefaultStyle.main2_100
|
||||||
|
pressedColor: DefaultStyle.main2_200
|
||||||
|
icon.source: AppIcons.closeX
|
||||||
|
icon.width: 14 * DefaultStyle.dp
|
||||||
|
icon.height: 14 * DefaultStyle.dp
|
||||||
|
onClicked: participantModel.removeParticipant(modelData.core)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
footer: Rectangle {
|
||||||
|
color: DefaultStyle.grey_100
|
||||||
|
visible: mainItem.isMeAdmin
|
||||||
|
height: 74 * DefaultStyle.dp
|
||||||
|
width: mainItem.width
|
||||||
|
Button {
|
||||||
|
anchors.centerIn: parent
|
||||||
|
height: 40 * DefaultStyle.dp
|
||||||
|
icon.source: AppIcons.plusCircle
|
||||||
|
icon.width: 16 * DefaultStyle.dp
|
||||||
|
icon.height: 16 * DefaultStyle.dp
|
||||||
|
contentImageColor: DefaultStyle.main1_500_main
|
||||||
|
text: qsTr("Ajouter des participants")
|
||||||
|
color: DefaultStyle.main1_100
|
||||||
|
textColor: DefaultStyle.main1_500_main
|
||||||
|
textSize: 15 * DefaultStyle.dp
|
||||||
|
textWeight: 600 * DefaultStyle.dp
|
||||||
|
rightPadding: 16 * DefaultStyle.dp
|
||||||
|
leftPadding: 16 * DefaultStyle.dp
|
||||||
|
topPadding: 10 * DefaultStyle.dp
|
||||||
|
bottomPadding: 10 * DefaultStyle.dp
|
||||||
|
onClicked: mainItem.addParticipantRequested()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -2,6 +2,7 @@ pragma Singleton
|
||||||
import QtQuick 2.15
|
import QtQuick 2.15
|
||||||
|
|
||||||
QtObject {
|
QtObject {
|
||||||
|
property color main1_100: "#FFEACB"
|
||||||
property color main1_500_main: "#FE5E00"
|
property color main1_500_main: "#FE5E00"
|
||||||
property color main1_500_main_darker: "#C94C02"
|
property color main1_500_main_darker: "#C94C02"
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue