Clean + fixes

This commit is contained in:
Julien Wadel 2024-04-19 16:39:59 +02:00
parent d4139fddd1
commit 23ddc9ac88
80 changed files with 508 additions and 1028 deletions

View file

@ -79,18 +79,18 @@ App::App(int &argc, char *argv[])
auto ignoreVSync = QSurfaceFormat::defaultFormat(); auto ignoreVSync = QSurfaceFormat::defaultFormat();
ignoreVSync.setSwapInterval(0); ignoreVSync.setSwapInterval(0);
QSurfaceFormat::setDefaultFormat(ignoreVSync); QSurfaceFormat::setDefaultFormat(ignoreVSync);
qInfo() << "Loading Fonts"; lInfo() << "Loading Fonts";
QDirIterator it(":/font/", QDirIterator::Subdirectories); QDirIterator it(":/font/", QDirIterator::Subdirectories);
while (it.hasNext()) { while (it.hasNext()) {
QString ttf = it.next(); QString ttf = it.next();
// qDebug() << ttf; // lDebug()<< ttf;
auto id = QFontDatabase::addApplicationFont(ttf); auto id = QFontDatabase::addApplicationFont(ttf);
} }
//------------------- //-------------------
mLinphoneThread = new Thread(this); mLinphoneThread = new Thread(this);
init(); init();
qInfo() << QStringLiteral("Starting application " APPLICATION_NAME " (bin: " EXECUTABLE_NAME lInfo() << QStringLiteral("Starting application " APPLICATION_NAME " (bin: " EXECUTABLE_NAME
"). Version:%1 Os:%2 Qt:%3") "). Version:%1 Os:%2 Qt:%3")
.arg(applicationVersion()) .arg(applicationVersion())
.arg(Utils::getOsProduct()) .arg(Utils::getOsProduct())
@ -110,7 +110,7 @@ void App::setSelf(QSharedPointer<App>(me)) {
auto callGui = new CallGui(callCore); auto callGui = new CallGui(callCore);
auto win = getCallsWindow(QVariant::fromValue(callGui)); auto win = getCallsWindow(QVariant::fromValue(callGui));
Utils::smartShowWindow(win); Utils::smartShowWindow(win);
qDebug() << "App : call created" << callGui; lDebug() << "App : call created" << callGui;
}); });
}); });
} }
@ -146,7 +146,7 @@ void App::init() {
if (version.majorVersion() == 5 && version.minorVersion() == 9) selectors.push_back("5.9"); if (version.majorVersion() == 5 && version.minorVersion() == 9) selectors.push_back("5.9");
auto selector = new QQmlFileSelector(mEngine, mEngine); auto selector = new QQmlFileSelector(mEngine, mEngine);
selector->setExtraSelectors(selectors); selector->setExtraSelectors(selectors);
qInfo() << log().arg("Activated selectors:") << selector->selector()->allSelectors(); lInfo() << log().arg("Activated selectors:") << selector->selector()->allSelectors();
mEngine->addImportPath(":/"); mEngine->addImportPath(":/");
mEngine->rootContext()->setContextProperty("applicationDirPath", QGuiApplication::applicationDirPath()); mEngine->rootContext()->setContextProperty("applicationDirPath", QGuiApplication::applicationDirPath());
@ -163,7 +163,7 @@ void App::init() {
[this, url](QObject *obj, const QUrl &objUrl) { [this, url](QObject *obj, const QUrl &objUrl) {
if (url == objUrl) { if (url == objUrl) {
if (!obj) { if (!obj) {
qCritical() << log().arg("Main.qml couldn't be load. The app will exit"); lCritical() << log().arg("Main.qml couldn't be load. The app will exit");
exit(-1); exit(-1);
} }
mMainWindow = qobject_cast<QQuickWindow *>(obj); mMainWindow = qobject_cast<QQuickWindow *>(obj);
@ -188,12 +188,12 @@ void App::init() {
if (mParser->isSet("qt-logs-only")) QtLogger::enableQtOnly(true); if (mParser->isSet("qt-logs-only")) QtLogger::enableQtOnly(true);
if (!mLinphoneThread->isRunning()) { if (!mLinphoneThread->isRunning()) {
qDebug() << log().arg("Starting Thread"); lDebug() << log().arg("Starting Thread");
mLinphoneThread->start(); mLinphoneThread->start();
} }
setQuitOnLastWindowClosed(true); // TODO: use settings to set it setQuitOnLastWindowClosed(true); // TODO: use settings to set it
qInfo() << log().arg("Display server : %1").arg(platformName()); lInfo() << log().arg("Display server : %1").arg(platformName());
// mEngine->load(u"qrc:/Linphone/view/Prototype/CameraPrototype.qml"_qs); // mEngine->load(u"qrc:/Linphone/view/Prototype/CameraPrototype.qml"_qs);
} }
@ -258,7 +258,7 @@ void App::clean() {
delete mEngine; delete mEngine;
mEngine = nullptr; mEngine = nullptr;
if (mSettings) { if (mSettings) {
mSettings.reset(); mSettings->deleteLater();
mSettings = nullptr; mSettings = nullptr;
} }
mLinphoneThread->wait(250); mLinphoneThread->wait(250);
@ -296,9 +296,9 @@ bool App::notify(QObject *receiver, QEvent *event) {
try { try {
done = QApplication::notify(receiver, event); done = QApplication::notify(receiver, event);
} catch (const std::exception &ex) { } catch (const std::exception &ex) {
qCritical() << log().arg("Exception has been catch in notify"); lCritical() << log().arg("Exception has been catch in notify");
} catch (...) { } catch (...) {
qCritical() << log().arg("Generic exeption has been catch in notify"); lCritical() << log().arg("Generic exeption has been catch in notify");
} }
return done; return done;
} }
@ -308,14 +308,14 @@ QQuickWindow *App::getCallsWindow(QVariant callGui) {
if (!mCallsWindow) { if (!mCallsWindow) {
const QUrl callUrl("qrc:/Linphone/view/App/CallsWindow.qml"); const QUrl callUrl("qrc:/Linphone/view/App/CallsWindow.qml");
qInfo() << log().arg("Creating subwindow: `%1`.").arg(callUrl.toString()); lInfo() << log().arg("Creating subwindow: `%1`.").arg(callUrl.toString());
QQmlComponent component(mEngine, callUrl); QQmlComponent component(mEngine, callUrl);
if (component.isError()) { if (component.isError()) {
qWarning() << component.errors(); qWarning() << component.errors();
abort(); abort();
} }
qInfo() << log().arg("Subwindow status: `%1`.").arg(component.status()); lInfo() << log().arg("Subwindow status: `%1`.").arg(component.status());
QObject *object = nullptr; QObject *object = nullptr;
// if (!callGui.isNull() && callGui.isValid()) object = component.createWithInitialProperties({{"call", // if (!callGui.isNull() && callGui.isValid()) object = component.createWithInitialProperties({{"call",
@ -323,7 +323,7 @@ QQuickWindow *App::getCallsWindow(QVariant callGui) {
object = component.create(); object = component.create();
Q_ASSERT(object); Q_ASSERT(object);
if (!object) { if (!object) {
qCritical() << log().arg("Calls window could not be created."); lCritical() << log().arg("Calls window could not be created.");
return nullptr; return nullptr;
} }
@ -333,7 +333,7 @@ QQuickWindow *App::getCallsWindow(QVariant callGui) {
auto window = qobject_cast<QQuickWindow *>(object); auto window = qobject_cast<QQuickWindow *>(object);
Q_ASSERT(window); Q_ASSERT(window);
if (!window) { if (!window) {
qCritical() << log().arg("Calls window could not be created."); lCritical() << log().arg("Calls window could not be created.");
return nullptr; return nullptr;
} }
// window->setParent(mMainWindow); // window->setParent(mMainWindow);

View file

@ -125,7 +125,7 @@ void AccountCore::setUnreadNotifications(int unread) {
void AccountCore::onRegistrationStateChanged(const std::shared_ptr<linphone::Account> &account, void AccountCore::onRegistrationStateChanged(const std::shared_ptr<linphone::Account> &account,
linphone::RegistrationState state, linphone::RegistrationState state,
const std::string &message) { const std::string &message) {
qDebug() << log().arg(Q_FUNC_INFO) << (int)state; lDebug() << log().arg(Q_FUNC_INFO) << (int)state;
mRegistrationState = LinphoneEnums::fromLinphone(state); mRegistrationState = LinphoneEnums::fromLinphone(state);
emit registrationStateChanged(Utils::coreStringToAppString(message)); emit registrationStateChanged(Utils::coreStringToAppString(message));
} }

View file

@ -38,7 +38,7 @@ QSharedPointer<CallHistoryCore> CallHistoryCore::create(const std::shared_ptr<li
} }
CallHistoryCore::CallHistoryCore(const std::shared_ptr<linphone::CallLog> &callLog) : QObject(nullptr) { CallHistoryCore::CallHistoryCore(const std::shared_ptr<linphone::CallLog> &callLog) : QObject(nullptr) {
// qDebug() << "[CallHistoryCore] new" << this; // lDebug()<< "[CallHistoryCore] new" << this;
App::getInstance()->mEngine->setObjectOwnership(this, QQmlEngine::CppOwnership); App::getInstance()->mEngine->setObjectOwnership(this, QQmlEngine::CppOwnership);
// Should be call from model Thread // Should be call from model Thread
mustBeInLinphoneThread(getClassName()); mustBeInLinphoneThread(getClassName());
@ -55,7 +55,7 @@ CallHistoryCore::CallHistoryCore(const std::shared_ptr<linphone::CallLog> &callL
} }
CallHistoryCore::~CallHistoryCore() { CallHistoryCore::~CallHistoryCore() {
// qDebug() << "[CallHistoryCore] delete" << this; // lDebug()<< "[CallHistoryCore] delete" << this;
mustBeInMainThread("~" + getClassName()); mustBeInMainThread("~" + getClassName());
} }

View file

@ -24,7 +24,7 @@
DEFINE_ABSTRACT_OBJECT(CallHistoryGui) DEFINE_ABSTRACT_OBJECT(CallHistoryGui)
CallHistoryGui::CallHistoryGui(QSharedPointer<CallHistoryCore> core) { CallHistoryGui::CallHistoryGui(QSharedPointer<CallHistoryCore> core) {
// qDebug() << "[CallHistoryGui] new" << this; // lDebug()<< "[CallHistoryGui] new" << this;
App::getInstance()->mEngine->setObjectOwnership(this, QQmlEngine::JavaScriptOwnership); App::getInstance()->mEngine->setObjectOwnership(this, QQmlEngine::JavaScriptOwnership);
mCore = core; mCore = core;
if (isInLinphoneThread()) moveToThread(App::getInstance()->thread()); if (isInLinphoneThread()) moveToThread(App::getInstance()->thread());
@ -32,7 +32,7 @@ CallHistoryGui::CallHistoryGui(QSharedPointer<CallHistoryCore> core) {
CallHistoryGui::~CallHistoryGui() { CallHistoryGui::~CallHistoryGui() {
mustBeInMainThread("~" + getClassName()); mustBeInMainThread("~" + getClassName());
// qDebug() << "[CallHistoryGui] delete" << this; // lDebug()<< "[CallHistoryGui] delete" << this;
} }
CallHistoryCore *CallHistoryGui::getCore() const { CallHistoryCore *CallHistoryGui::getCore() const {

View file

@ -43,7 +43,7 @@ QSharedPointer<CallCore> CallCore::create(const std::shared_ptr<linphone::Call>
} }
CallCore::CallCore(const std::shared_ptr<linphone::Call> &call) : QObject(nullptr) { CallCore::CallCore(const std::shared_ptr<linphone::Call> &call) : QObject(nullptr) {
qDebug() << "[CallCore] new" << this; lDebug() << "[CallCore] new" << this;
App::getInstance()->mEngine->setObjectOwnership(this, QQmlEngine::CppOwnership); App::getInstance()->mEngine->setObjectOwnership(this, QQmlEngine::CppOwnership);
// Should be call from model Thread // Should be call from model Thread
mustBeInLinphoneThread(getClassName()); mustBeInLinphoneThread(getClassName());
@ -103,7 +103,7 @@ CallCore::CallCore(const std::shared_ptr<linphone::Call> &call) : QObject(nullpt
} }
CallCore::~CallCore() { CallCore::~CallCore() {
qDebug() << "[CallCore] delete" << this; lDebug() << "[CallCore] delete" << this;
mustBeInMainThread("~" + getClassName()); mustBeInMainThread("~" + getClassName());
emit mCallModel->removeListener(); emit mCallModel->removeListener();
} }
@ -366,7 +366,7 @@ bool CallCore::getLocalVideoEnabled() const {
void CallCore::setLocalVideoEnabled(bool enabled) { void CallCore::setLocalVideoEnabled(bool enabled) {
if (mLocalVideoEnabled != enabled) { if (mLocalVideoEnabled != enabled) {
mLocalVideoEnabled = enabled; mLocalVideoEnabled = enabled;
qWarning() << "LocalVideoEnabled: " << mLocalVideoEnabled; lDebug() << "LocalVideoEnabled: " << mLocalVideoEnabled;
emit localVideoEnabledChanged(); emit localVideoEnabledChanged();
} }
} }
@ -406,10 +406,11 @@ QSharedPointer<ConferenceCore> CallCore::getConferenceCore() const {
} }
void CallCore::setConference(const QSharedPointer<ConferenceCore> &conference) { void CallCore::setConference(const QSharedPointer<ConferenceCore> &conference) {
mustBeInMainThread(log().arg(Q_FUNC_INFO));
if (mConference != conference) { if (mConference != conference) {
mConference = conference; mConference = conference;
mIsConference = (mConference != nullptr); mIsConference = (mConference != nullptr);
qDebug() << "[CallCore] Set conference : " << mConference; lDebug() << "[CallCore] Set conference : " << mConference;
emit conferenceChanged(); emit conferenceChanged();
} }
} }

View file

@ -61,7 +61,8 @@ QQuickFramebufferObject::Renderer *CameraGui::createRenderer() const {
lInfo() << log().arg("(%1) Setting Camera to Dummy, %2").arg(mQmlName).arg(getSourceLocation()); lInfo() << log().arg("(%1) Setting Camera to Dummy, %2").arg(mQmlName).arg(getSourceLocation());
QTimer::singleShot(1, this, &CameraGui::isNotReady); QTimer::singleShot(1, this, &CameraGui::isNotReady);
renderer = new CameraDummy(); // Used to fill a renderer to avoid pushing a NULL. renderer = new CameraDummy(); // Used to fill a renderer to avoid pushing a NULL.
if (getSourceLocation() != CorePreview) QTimer::singleShot(1000, this, &CameraGui::requestNewRenderer); /*if (getSourceLocation() != CorePreview)*/ QTimer::singleShot(1000, this, &CameraGui::requestNewRenderer);
// TODO : peut etre enelever le check sur le corepreview
} else QTimer::singleShot(1, this, &CameraGui::isReady); // Hack because of constness of createRenderer() } else QTimer::singleShot(1, this, &CameraGui::isReady); // Hack because of constness of createRenderer()
return renderer; return renderer;
} }

View file

@ -119,7 +119,7 @@ void PreviewManager::unsubscribe(QObject *sender) {
void PreviewManager::activate() { void PreviewManager::activate() {
App::postModelBlock([]() { App::postModelBlock([]() {
qDebug() << "[PreviewManager] Activation"; lDebug() << "[PreviewManager] Activation";
CoreModel::getInstance()->getCore()->enableVideoPreview(true); CoreModel::getInstance()->getCore()->enableVideoPreview(true);
CoreModel::getInstance()->getCore()->iterate(); CoreModel::getInstance()->getCore()->iterate();
}); });
@ -127,7 +127,7 @@ void PreviewManager::activate() {
void PreviewManager::deactivate() { void PreviewManager::deactivate() {
App::postModelBlock([]() { App::postModelBlock([]() {
qDebug() << "[PreviewManager] Deactivation"; lDebug() << "[PreviewManager] Deactivation";
CoreModel::getInstance()->getCore()->enableVideoPreview(false); CoreModel::getInstance()->getCore()->enableVideoPreview(false);
CoreModel::getInstance()->getCore()->iterate(); CoreModel::getInstance()->getCore()->iterate();
}); });

View file

@ -58,9 +58,6 @@ void ConferenceCore::setSelf(QSharedPointer<ConferenceCore> me) {
auto device = ParticipantDeviceCore::create(participantDevice); auto device = ParticipantDeviceCore::create(participantDevice);
mConferenceModelConnection->invokeToCore([this, device]() { setActiveSpeaker(device); }); mConferenceModelConnection->invokeToCore([this, device]() { setActiveSpeaker(device); });
}); });
// mCallModelConnection->makeConnectToCore(&CallCore::lSetMicrophoneMuted, [this](bool isMuted) {
// mCallModelConnection->invokeToModel([this, isMuted]() { mCallModel->setMicrophoneMuted(isMuted); });
// });
} }
bool ConferenceCore::updateLocalParticipant() { // true if changed bool ConferenceCore::updateLocalParticipant() { // true if changed
@ -77,10 +74,7 @@ QDateTime ConferenceCore::getStartDate() const {
Q_INVOKABLE qint64 ConferenceCore::getElapsedSeconds() const { Q_INVOKABLE qint64 ConferenceCore::getElapsedSeconds() const {
return 0; return 0;
} }
// Q_INVOKABLE ParticipantModel *getLocalParticipant() const;
// ParticipantListModel *getParticipantListModel() const;
// std::list<std::shared_ptr<linphone::Participant>>
// getParticipantList() const; // SDK exclude me. We want to get ALL participants.
int ConferenceCore::getParticipantDeviceCount() const { int ConferenceCore::getParticipantDeviceCount() const {
return mParticipantDeviceCount + 1; return mParticipantDeviceCount + 1;
} }
@ -112,7 +106,7 @@ ParticipantGui *ConferenceCore::getMeGui() const {
void ConferenceCore::setActiveSpeaker(const QSharedPointer<ParticipantDeviceCore> &device) { void ConferenceCore::setActiveSpeaker(const QSharedPointer<ParticipantDeviceCore> &device) {
if (mActiveSpeaker != device) { if (mActiveSpeaker != device) {
mActiveSpeaker = device; mActiveSpeaker = device;
qDebug() << "Changing active speaker to " << device->getAddress(); lDebug() << "Changing active speaker to " << device->getAddress();
emit activeSpeakerChanged(); emit activeSpeakerChanged();
} }
} }

View file

@ -56,11 +56,6 @@ public:
QString getSubject() const; QString getSubject() const;
QDateTime getStartDate() const; QDateTime getStartDate() const;
Q_INVOKABLE qint64 getElapsedSeconds() const; Q_INVOKABLE qint64 getElapsedSeconds() const;
// Q_INVOKABLE ParticipantModel *getLocalParticipant() const;
// ParticipantListModel *getParticipantListModel() const;
// std::list<std::shared_ptr<linphone::Participant>>
// getParticipantList() const; // SDK exclude me. We want to get ALL participants.
// void getParticipantDeviceList() const;
int getParticipantDeviceCount() const; int getParticipantDeviceCount() const;
ParticipantDeviceCore *getActiveSpeaker() const; ParticipantDeviceCore *getActiveSpeaker() const;
ParticipantDeviceGui *getActiveSpeakerGui() const; ParticipantDeviceGui *getActiveSpeakerGui() const;

View file

@ -21,6 +21,7 @@
#include "ConferenceGui.hpp" #include "ConferenceGui.hpp"
#include "ConferenceCore.hpp" #include "ConferenceCore.hpp"
#include "core/App.hpp" #include "core/App.hpp"
#include "tool/Utils.hpp"
DEFINE_ABSTRACT_OBJECT(ConferenceGui) DEFINE_ABSTRACT_OBJECT(ConferenceGui)
@ -37,7 +38,7 @@ ConferenceGui::ConferenceGui(QSharedPointer<ConferenceCore> core) {
ConferenceGui::~ConferenceGui() { ConferenceGui::~ConferenceGui() {
mustBeInMainThread("~" + getClassName()); mustBeInMainThread("~" + getClassName());
qDebug() << "[ConferenceGui] delete" << this; lDebug() << "[ConferenceGui] delete" << this;
} }
ConferenceCore *ConferenceGui::getCore() const { ConferenceCore *ConferenceGui::getCore() const {

View file

@ -135,7 +135,6 @@ ConferenceInfoCore::ConferenceInfoCore(const ConferenceInfoCore &conferenceInfoC
ConferenceInfoCore::~ConferenceInfoCore() { ConferenceInfoCore::~ConferenceInfoCore() {
mustBeInMainThread("~" + getClassName()); mustBeInMainThread("~" + getClassName());
mCheckEndTimer.stop();
} }
void ConferenceInfoCore::reset(const ConferenceInfoCore &conf) { void ConferenceInfoCore::reset(const ConferenceInfoCore &conf) {
@ -200,7 +199,7 @@ void ConferenceInfoCore::setSelf(QSharedPointer<ConferenceInfoCore> me) {
mConfInfoModelConnection->invokeToCore([this, state = LinphoneEnums::fromLinphone(state), mConfInfoModelConnection->invokeToCore([this, state = LinphoneEnums::fromLinphone(state),
infoState = LinphoneEnums::fromLinphone(confInfoState), infoState = LinphoneEnums::fromLinphone(confInfoState),
uri] { uri] {
qDebug() << "scheduler state changed" << state; lDebug() << "scheduler state changed" << state;
setConferenceSchedulerState(state); setConferenceSchedulerState(state);
setConferenceInfoState(infoState); setConferenceInfoState(infoState);
if (state == LinphoneEnums::ConferenceSchedulerState::Ready) { if (state == LinphoneEnums::ConferenceSchedulerState::Ready) {
@ -211,7 +210,7 @@ void ConferenceInfoCore::setSelf(QSharedPointer<ConferenceInfoCore> me) {
mConfInfoModelConnection->makeConnectToModel( mConfInfoModelConnection->makeConnectToModel(
&ConferenceInfoModel::invitationsSent, &ConferenceInfoModel::invitationsSent,
[this](const std::list<std::shared_ptr<linphone::Address>> &failedInvitations) { [this](const std::list<std::shared_ptr<linphone::Address>> &failedInvitations) {
qDebug() << "invitations sent"; lDebug() << "invitations sent";
}); });
} else { // Create } else { // Create
mCoreModelConnection = QSharedPointer<SafeConnection<ConferenceInfoCore, CoreModel>>( mCoreModelConnection = QSharedPointer<SafeConnection<ConferenceInfoCore, CoreModel>>(
@ -220,7 +219,7 @@ void ConferenceInfoCore::setSelf(QSharedPointer<ConferenceInfoCore> me) {
&CoreModel::conferenceInfoReceived, &CoreModel::conferenceInfoReceived,
[this](const std::shared_ptr<linphone::Core> &core, [this](const std::shared_ptr<linphone::Core> &core,
const std::shared_ptr<const linphone::ConferenceInfo> &conferenceInfo) { const std::shared_ptr<const linphone::ConferenceInfo> &conferenceInfo) {
qDebug() << "CONF INFO RECEIVED =================="; lDebug() << "CONF INFO RECEIVED ==================";
}); });
} }
} }
@ -484,9 +483,6 @@ LinphoneEnums::ConferenceSchedulerState ConferenceInfoCore::getConferenceSchedul
return mConferenceSchedulerState; return mConferenceSchedulerState;
} }
//------------------------------------------------------------------------------------------------
// Datetime is in Custom (Locale/UTC/System). Convert into UTC for conference info
void ConferenceInfoCore::setIsScheduled(const bool &on) { void ConferenceInfoCore::setIsScheduled(const bool &on) {
if (mIsScheduled != on) { if (mIsScheduled != on) {
mIsScheduled = on; mIsScheduled = on;
@ -497,8 +493,6 @@ void ConferenceInfoCore::setIsScheduled(const bool &on) {
void ConferenceInfoCore::setIsEnded(bool ended) { void ConferenceInfoCore::setIsEnded(bool ended) {
if (mIsEnded != ended) { if (mIsEnded != ended) {
mIsEnded = ended; mIsEnded = ended;
if (mIsEnded) mCheckEndTimer.stop(); // No need to run the timer.
else mCheckEndTimer.start();
emit isEndedChanged(); emit isEndedChanged();
} }
} }
@ -546,8 +540,8 @@ void ConferenceInfoCore::writeIntoModel(std::shared_ptr<ConferenceInfoModel> mod
model->setSubject(mSubject); model->setSubject(mSubject);
if (!mOrganizerAddress.isEmpty()) { if (!mOrganizerAddress.isEmpty()) {
model->setOrganizer(mOrganizerAddress); model->setOrganizer(mOrganizerAddress);
qDebug() << "Use of " << mOrganizerAddress; lDebug() << "Use of " << mOrganizerAddress;
} else qDebug() << "Use of " << model->getOrganizerAddress(); } else lDebug() << "Use of " << model->getOrganizerAddress();
model->setDescription(mDescription); model->setDescription(mDescription);
std::list<std::shared_ptr<linphone::ParticipantInfo>> participantInfos; std::list<std::shared_ptr<linphone::ParticipantInfo>> participantInfos;
for (auto &p : mParticipants) { for (auto &p : mParticipants) {
@ -587,23 +581,24 @@ void ConferenceInfoCore::save() {
if (!linphoneConf->getOrganizer()) linphoneConf->setOrganizer(cleanedClonedAddress); if (!linphoneConf->getOrganizer()) linphoneConf->setOrganizer(cleanedClonedAddress);
if (mOrganizerAddress.isEmpty()) if (mOrganizerAddress.isEmpty())
mOrganizerAddress = Utils::coreStringToAppString(accountAddress->asStringUriOnly()); mOrganizerAddress = Utils::coreStringToAppString(accountAddress->asStringUriOnly());
} else qCritical() << "No contact address"; } else lCritical() << "No contact address";
} else qCritical() << "No default account"; } else lCritical() << "No default account";
mConferenceInfoModel = Utils::makeQObject_ptr<ConferenceInfoModel>(linphoneConf); auto confInfoModel = Utils::makeQObject_ptr<ConferenceInfoModel>(linphoneConf);
setHaveModel(true); auto confSchedulerModel = confInfoModel->getConferenceScheduler();
// mConferenceInfoModel->createConferenceScheduler();
auto confSchedulerModel = mConferenceInfoModel->getConferenceScheduler();
if (!confSchedulerModel) { if (!confSchedulerModel) {
auto confScheduler = CoreModel::getInstance()->getCore()->createConferenceScheduler(); auto confScheduler = CoreModel::getInstance()->getCore()->createConferenceScheduler();
confSchedulerModel = Utils::makeQObject_ptr<ConferenceSchedulerModel>(confScheduler); confSchedulerModel = Utils::makeQObject_ptr<ConferenceSchedulerModel>(confScheduler);
mConferenceInfoModel->setConferenceScheduler(confSchedulerModel); confInfoModel->setConferenceScheduler(confSchedulerModel);
} }
mCoreModelConnection->invokeToCore([this, thisCopy, confSchedulerModel, linphoneConf, confInfoModel]() {
setHaveModel(true);
mConferenceInfoModel = confInfoModel;
mCoreModelConnection->invokeToModel([this, thisCopy, confSchedulerModel, linphoneConf]() {
thisCopy->writeIntoModel(mConferenceInfoModel); thisCopy->writeIntoModel(mConferenceInfoModel);
thisCopy->deleteLater(); thisCopy->deleteLater();
mCoreModelConnection->invokeToCore([this, confSchedulerModel, linphoneConf]() { confSchedulerModel->setInfo(linphoneConf);
setSelf(mCoreModelConnection->mCore); mCoreModelConnection->invokeToCore([this]() { setSelf(mCoreModelConnection->mCore); });
mCoreModelConnection->invokeToModel( });
[this, confSchedulerModel, linphoneConf]() { confSchedulerModel->setInfo(linphoneConf); });
}); });
}); });
} }
@ -625,36 +620,8 @@ void ConferenceInfoCore::undo() {
//------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------
// void ConferenceInfoCore::createConference(const int &securityLevel) {
// CoreModel::getInstance()->getTimelineListModel()->mAutoSelectAfterCreation = false;
// shared_ptr<linphone::Core> core = CoreManager::getInstance()->getCore();
// static std::shared_ptr<linphone::Conference> conference;
// qInfo() << "Conference creation of " << getSubject() << " at " << securityLevel << " security, organized by "
// << getOrganizer() << " for " << getDateTimeSystem().toString();
// qInfo() << "Participants:";
// for (auto p : mConferenceInfoModel->getParticipants())
// qInfo() << "\t" << p->asString().c_str();
// mConferenceScheduler = ConferenceScheduler::create();
// mConferenceScheduler->mSendInvite = mInviteMode;
// connect(mConferenceScheduler.get(), &ConferenceScheduler::invitationsSent, this,
// &ConferenceInfoCore::onInvitationsSent);
// connect(mConferenceScheduler.get(), &ConferenceScheduler::stateChanged, this,
// &ConferenceInfoCore::onConferenceSchedulerStateChanged);
// mConferenceScheduler->getConferenceScheduler()->setInfo(mConferenceInfoModel);
// }
//-------------------------------------------------------------------------------------------------
// void ConferenceInfoCore::onConferenceSchedulerStateChanged(linphone::ConferenceScheduler::State state) {
// qDebug() << "ConferenceInfoCore::onConferenceSchedulerStateChanged: " << (int)state;
// mLastConferenceSchedulerState = state;
// if (state == linphone::ConferenceScheduler::State::Ready) emit conferenceCreated();
// else if (state == linphone::ConferenceScheduler::State::Error) emit conferenceCreationFailed();
// emit conferenceInfoChanged();
// }
void ConferenceInfoCore::onInvitationsSent(const std::list<std::shared_ptr<linphone::Address>> &failedInvitations) { void ConferenceInfoCore::onInvitationsSent(const std::list<std::shared_ptr<linphone::Address>> &failedInvitations) {
qDebug() << "ConferenceInfoCore::onInvitationsSent"; lDebug() << "ConferenceInfoCore::onInvitationsSent";
emit invitationsSent(); emit invitationsSent();
} }

View file

@ -62,9 +62,6 @@ public:
Q_PROPERTY(LinphoneEnums::ConferenceInfoState state READ getConferenceInfoState NOTIFY conferenceInfoStateChanged) Q_PROPERTY(LinphoneEnums::ConferenceInfoState state READ getConferenceInfoState NOTIFY conferenceInfoStateChanged)
Q_PROPERTY(LinphoneEnums::ConferenceSchedulerState schedulerState READ getConferenceSchedulerState NOTIFY Q_PROPERTY(LinphoneEnums::ConferenceSchedulerState schedulerState READ getConferenceSchedulerState NOTIFY
conferenceSchedulerStateChanged) conferenceSchedulerStateChanged)
// Q_PROPERTY(LinphoneEnums::ConferenceSchedulerState conferenceSchedulerState READ getConferenceSchedulerState
// NOTIFY
// conferenceSchedulerStateChanged)
static QSharedPointer<ConferenceInfoCore> create(std::shared_ptr<linphone::ConferenceInfo> conferenceInfo); static QSharedPointer<ConferenceInfoCore> create(std::shared_ptr<linphone::ConferenceInfo> conferenceInfo);
ConferenceInfoCore(std::shared_ptr<linphone::ConferenceInfo> conferenceInfo, QObject *parent = nullptr); ConferenceInfoCore(std::shared_ptr<linphone::ConferenceInfo> conferenceInfo, QObject *parent = nullptr);
@ -94,13 +91,11 @@ public:
void setIsEnded(bool ended); void setIsEnded(bool ended);
bool inviteEnabled() const; bool inviteEnabled() const;
QVariantList getParticipants() const; QVariantList getParticipants() const;
// Q_INVOKABLE QVariantList getAllParticipants() const;
int getParticipantCount() const; int getParticipantCount() const;
TimeZoneModel *getTimeZoneModel() const; TimeZoneModel *getTimeZoneModel() const;
// QString getIcalendarString() const; // QString getIcalendarString() const;
LinphoneEnums::ConferenceInfoState getConferenceInfoState() const; LinphoneEnums::ConferenceInfoState getConferenceInfoState() const;
LinphoneEnums::ConferenceSchedulerState getConferenceSchedulerState() const; LinphoneEnums::ConferenceSchedulerState getConferenceSchedulerState() const;
// LinphoneEnums::ConferenceSchedulerState getConferenceSchedulerState() const;
QString toStartEndDateString(); QString toStartEndDateString();
void setDateTime(const QDateTime &date); void setDateTime(const QDateTime &date);
@ -133,12 +128,6 @@ public:
Q_INVOKABLE void save(); Q_INVOKABLE void save();
Q_INVOKABLE void undo(); Q_INVOKABLE void undo();
// Tools
// Q_INVOKABLE void resetConferenceInfo(); // Recreate a new conference info from factory
// SCHEDULER
// virtual void onConferenceSchedulerStateChanged(linphone::ConferenceScheduler::State state);
virtual void onInvitationsSent(const std::list<std::shared_ptr<linphone::Address>> &failedInvitations); virtual void onInvitationsSent(const std::list<std::shared_ptr<linphone::Address>> &failedInvitations);
Q_INVOKABLE bool isAllDayConf() const; Q_INVOKABLE bool isAllDayConf() const;
@ -160,12 +149,10 @@ signals:
void conferenceInfoStateChanged(); void conferenceInfoStateChanged();
void conferenceSchedulerStateChanged(); void conferenceSchedulerStateChanged();
void timeZoneModelChanged(); void timeZoneModelChanged();
// void conferenceSchedulerStateChanged();
void invitationsSent(); void invitationsSent();
void removed(); void removed();
// void lCreateConference(const int &securityLevel);
void lCancelConferenceInfo(); void lCancelConferenceInfo();
void lDeleteConferenceInfo(); // Remove completly this conference info from DB void lDeleteConferenceInfo(); // Remove completly this conference info from DB
@ -191,11 +178,7 @@ private:
bool mHaveModel = false; bool mHaveModel = false;
bool mIsScheduled; bool mIsScheduled;
bool mIsEnded = false; bool mIsEnded = false;
QTimer mCheckEndTimer;
bool mInviteEnabled = true; bool mInviteEnabled = true;
// bool mRemoveRequested = false; // true if user has request its deletion from DB
// linphone::ConferenceScheduler::State mLastConferenceSchedulerState =
// linphone::ConferenceScheduler::State::Idle; // Workaround for missing getter in scheduler.
DECLARE_ABSTRACT_OBJECT DECLARE_ABSTRACT_OBJECT
}; };

View file

@ -73,40 +73,22 @@ void ConferenceInfoList::setSelf(QSharedPointer<ConferenceInfoList> me) {
}); });
}); });
}); });
// mCoreModelConnection->makeConnectToModel(
// &CoreModel::conferenceInfoReceived,
// [this](const std::shared_ptr<linphone::Core> core,
// const std::shared_ptr<const linphone::ConferenceInfo> &conferenceInfo) {
// auto realConferenceInfo = CoreModel::getInstance()->getCore()->findConferenceInformationFromUri(
// conferenceInfo->getUri()->clone());
// // auto realConferenceInfo = ConferenceInfoModel::findConferenceInfo(conferenceInfo);
// if (realConferenceInfo) {
// auto model = get(realConferenceInfo);
// if (model) {
// // model->setConferenceInfo(realConferenceInfo);
// } else {
// auto confInfo = build(realConferenceInfo);
// if (confInfo) add(confInfo);
// }
// } else
// qWarning() << "No ConferenceInfo have beend found for " << conferenceInfo->getUri()->asString().c_str();
// });
mCoreModelConnection->makeConnectToModel(&CoreModel::defaultAccountChanged, &ConferenceInfoList::lUpdate); mCoreModelConnection->makeConnectToModel(&CoreModel::defaultAccountChanged, &ConferenceInfoList::lUpdate);
mCoreModelConnection->makeConnectToModel(&CoreModel::conferenceInfoReceived, &ConferenceInfoList::lUpdate); mCoreModelConnection->makeConnectToModel(&CoreModel::conferenceInfoReceived, &ConferenceInfoList::lUpdate);
mCoreModelConnection->makeConnectToModel(&CoreModel::conferenceStateChanged, [this] { mCoreModelConnection->makeConnectToModel(&CoreModel::conferenceStateChanged, [this] {
qDebug() << "list: conf state changed"; lDebug() << "list: conf state changed";
lUpdate(); lUpdate();
}); });
mCoreModelConnection->makeConnectToModel( mCoreModelConnection->makeConnectToModel(
&CoreModel::callCreated, [this](const std::shared_ptr<linphone::Call> &call) { &CoreModel::callCreated, [this](const std::shared_ptr<linphone::Call> &call) {
qDebug() << "call created" << Utils::coreStringToAppString(call->getRemoteAddress()->asString()); lDebug() << "call created" << Utils::coreStringToAppString(call->getRemoteAddress()->asString());
}); });
mCoreModelConnection->makeConnectToModel( mCoreModelConnection->makeConnectToModel(
&CoreModel::conferenceInfoReceived, &CoreModel::conferenceInfoReceived,
[this](const std::shared_ptr<linphone::Core> &core, [this](const std::shared_ptr<linphone::Core> &core,
const std::shared_ptr<const linphone::ConferenceInfo> &conferenceInfo) { const std::shared_ptr<const linphone::ConferenceInfo> &conferenceInfo) {
qDebug() << "info received" << conferenceInfo->getOrganizer()->asStringUriOnly() lDebug() << "info received" << conferenceInfo->getOrganizer()->asStringUriOnly()
<< conferenceInfo->getSubject(); << conferenceInfo->getSubject();
}); });
emit lUpdate(); emit lUpdate();
@ -164,14 +146,11 @@ ConferenceInfoList::get(std::shared_ptr<linphone::ConferenceInfo> conferenceInfo
QSharedPointer<ConferenceInfoCore> QSharedPointer<ConferenceInfoCore>
ConferenceInfoList::build(const std::shared_ptr<linphone::ConferenceInfo> &conferenceInfo) const { ConferenceInfoList::build(const std::shared_ptr<linphone::ConferenceInfo> &conferenceInfo) const {
auto me = CoreModel::getInstance()->getCore()->getDefaultAccount()->getParams()->getIdentityAddress(); auto me = CoreModel::getInstance()->getCore()->getDefaultAccount()->getParams()->getIdentityAddress();
// qDebug() << "[CONFERENCEINFOLIST] looking for me " << me->asStringUriOnly();
std::list<std::shared_ptr<linphone::ParticipantInfo>> participants = conferenceInfo->getParticipantInfos(); std::list<std::shared_ptr<linphone::ParticipantInfo>> participants = conferenceInfo->getParticipantInfos();
bool haveMe = conferenceInfo->getOrganizer()->weakEqual(me); bool haveMe = conferenceInfo->getOrganizer()->weakEqual(me);
if (!haveMe) if (!haveMe)
haveMe = (std::find_if(participants.begin(), participants.end(), haveMe = (std::find_if(participants.begin(), participants.end(),
[me](const std::shared_ptr<linphone::ParticipantInfo> &p) { [me](const std::shared_ptr<linphone::ParticipantInfo> &p) {
// qDebug()
// << "[CONFERENCEINFOLIST] participant " << p->getAddress()->asStringUriOnly();
return me->weakEqual(p->getAddress()); return me->weakEqual(p->getAddress());
}) != participants.end()); }) != participants.end());
if (haveMe) { if (haveMe) {
@ -182,10 +161,10 @@ ConferenceInfoList::build(const std::shared_ptr<linphone::ConferenceInfo> &confe
} }
void ConferenceInfoList::remove(const int &row) { void ConferenceInfoList::remove(const int &row) {
// beginRemoveRows(QModelIndex(), row, row); // List is modified asynchronously
// so no need to specify the begin/endRemoveRows
auto item = mList[row].objectCast<ConferenceInfoCore>(); auto item = mList[row].objectCast<ConferenceInfoCore>();
if (item) emit item->lDeleteConferenceInfo(); if (item) emit item->lDeleteConferenceInfo();
// endRemoveRows();
} }
QHash<int, QByteArray> ConferenceInfoList::roleNames() const { QHash<int, QByteArray> ConferenceInfoList::roleNames() const {
@ -227,13 +206,6 @@ int ConferenceInfoList::sort(QList<QSharedPointer<ConferenceInfoCore>> &listToSo
return l->getDateTimeUtc() < r->getDateTimeUtc(); return l->getDateTimeUtc() < r->getDateTimeUtc();
} }
}); });
/*
int count = 0;
for(auto item : listToSort){
auto l = item.objectCast<ConferenceInfoCore>();
qDebug() << count ++ << (l ? l->getDateTimeUtc() : QDateTime::currentDateTimeUtc());
}*/
auto it = std::find(listToSort.begin(), listToSort.end(), nullptr); auto it = std::find(listToSort.begin(), listToSort.end(), nullptr);
// qDebug() << it - listToSort.begin();
return it == listToSort.end() ? -1 : it - listToSort.begin(); return it == listToSort.end() ? -1 : it - listToSort.begin();
} }

View file

@ -32,8 +32,8 @@ class ConferenceInfoCore;
class ConferenceInfoList : public ListProxy, public AbstractObject { class ConferenceInfoList : public ListProxy, public AbstractObject {
Q_OBJECT Q_OBJECT
public: public:
// Create a ConferenceInfoList and make connections to List.
static QSharedPointer<ConferenceInfoList> create(); static QSharedPointer<ConferenceInfoList> create();
// Create a ConferenceInfoCore and make connections to List.
ConferenceInfoList(QObject *parent = Q_NULLPTR); ConferenceInfoList(QObject *parent = Q_NULLPTR);
~ConferenceInfoList(); ~ConferenceInfoList();

View file

@ -77,6 +77,7 @@ bool ConferenceInfoProxy::filterAcceptsRow(int sourceRow, const QModelIndex &sou
if (ciCore) { if (ciCore) {
if (!ciCore->getSubject().contains(mSearchText)) return false; if (!ciCore->getSubject().contains(mSearchText)) return false;
QDateTime currentDateTime = QDateTime::currentDateTimeUtc(); QDateTime currentDateTime = QDateTime::currentDateTimeUtc();
// TODO : use enums
if (mFilterType == 0) { if (mFilterType == 0) {
return true; return true;
} else if (mFilterType == 1) { } else if (mFilterType == 1) {

View file

@ -24,6 +24,8 @@
#include <QDateTime> #include <QDateTime>
#include <QPainter> #include <QPainter>
#include "tool/Utils.hpp"
FPSCounter::FPSCounter(QQuickItem *parent) : QQuickPaintedItem(parent), _currentFPS(0), _cacheCount(0) { FPSCounter::FPSCounter(QQuickItem *parent) : QQuickPaintedItem(parent), _currentFPS(0), _cacheCount(0) {
_times.clear(); _times.clear();
setFlag(QQuickItem::ItemHasContents); setFlag(QQuickItem::ItemHasContents);
@ -42,7 +44,7 @@ void FPSCounter::recalculateFPS() {
int currentCount = _times.length(); int currentCount = _times.length();
_currentFPS = (currentCount + _cacheCount) / 2; _currentFPS = (currentCount + _cacheCount) / 2;
qDebug() << _currentFPS; lDebug() << _currentFPS;
if (currentCount != _cacheCount) fpsChanged(_currentFPS); if (currentCount != _cacheCount) fpsChanged(_currentFPS);
@ -55,7 +57,7 @@ int FPSCounter::fps() const {
void FPSCounter::paint(QPainter *painter) { void FPSCounter::paint(QPainter *painter) {
recalculateFPS(); recalculateFPS();
// qDebug() << __FUNCTION__; // lDebug()<< __FUNCTION__;
QBrush brush(Qt::yellow); QBrush brush(Qt::yellow);
painter->setBrush(brush); painter->setBrush(brush);

View file

@ -155,7 +155,7 @@ void FriendCore::setSelf(QSharedPointer<FriendCore> me) {
}); });
mFriendModelConnection->makeConnectToModel( mFriendModelConnection->makeConnectToModel(
&FriendModel::objectNameChanged, &FriendModel::objectNameChanged,
[this](const QString &objectName) { qDebug() << "object name changed" << objectName; }); [this](const QString &objectName) { lDebug() << "object name changed" << objectName; });
// From GUI // From GUI
mFriendModelConnection->makeConnectToCore(&FriendCore::lSetStarred, [this](bool starred) { mFriendModelConnection->makeConnectToCore(&FriendCore::lSetStarred, [this](bool starred) {
@ -492,18 +492,27 @@ void FriendCore::save() { // Save Values to model
if (contact) break; if (contact) break;
} }
if (contact != nullptr) { if (contact != nullptr) {
mFriendModel = Utils::makeQObject_ptr<FriendModel>(contact); auto friendModel = Utils::makeQObject_ptr<FriendModel>(contact);
mFriendModel->setSelf(mFriendModel); friendModel->setSelf(friendModel);
mCoreModelConnection->invokeToCore([this, thisCopy, friendModel] {
mFriendModel = friendModel;
mCoreModelConnection->invokeToModel([this, thisCopy] {
thisCopy->writeIntoModel(mFriendModel); thisCopy->writeIntoModel(mFriendModel);
thisCopy->deleteLater(); thisCopy->deleteLater();
if (mFriendModelConnection) mFriendModelConnection->invokeToCore([this] { saved(); }); });
else mCoreModelConnection->invokeToCore([this] { saved(); }); saved();
});
} else { } else {
auto contact = core->createFriend(); auto contact = core->createFriend();
mFriendModel = Utils::makeQObject_ptr<FriendModel>(contact); auto friendModel = Utils::makeQObject_ptr<FriendModel>(contact);
mFriendModel->setSelf(mFriendModel); friendModel->setSelf(friendModel);
mCoreModelConnection->invokeToCore([this, thisCopy, friendModel] {
mFriendModel = friendModel;
mCoreModelConnection->invokeToModel([this, thisCopy] {
thisCopy->writeIntoModel(mFriendModel); thisCopy->writeIntoModel(mFriendModel);
thisCopy->deleteLater(); thisCopy->deleteLater();
});
});
bool created = (core->getDefaultFriendList()->addFriend(contact) == linphone::FriendList::Status::OK); bool created = (core->getDefaultFriendList()->addFriend(contact) == linphone::FriendList::Status::OK);
if (created) { if (created) {
core->getDefaultFriendList()->updateSubscriptions(); core->getDefaultFriendList()->updateSubscriptions();

View file

@ -172,7 +172,7 @@ QObject *Notifier::createNotification(Notifier::NotificationType type, QVariantM
engine, &QQmlApplicationEngine::objectCreated, this, engine, &QQmlApplicationEngine::objectCreated, this,
[this, url, screen, engine](QObject *obj, const QUrl &objUrl) { [this, url, screen, engine](QObject *obj, const QUrl &objUrl) {
if (!obj && url == objUrl) { if (!obj && url == objUrl) {
qCritical() << "[App] Notifier.qml couldn't be load."; lCritical() << "[App] Notifier.qml couldn't be load.";
engine->deleteLater(); engine->deleteLater();
exit(-1); exit(-1);
} else { } else {
@ -198,7 +198,7 @@ QObject *Notifier::createNotification(Notifier::NotificationType type, QVariantM
Qt::QueuedConnection); Qt::QueuedConnection);
engine->load(url); engine->load(url);
} }
qInfo() << QStringLiteral("Create notifications:") << wrapperItem; lInfo() << QStringLiteral("Create notifications:") << wrapperItem;
} }
mMutex->unlock(); mMutex->unlock();
@ -249,7 +249,7 @@ void Notifier::deleteNotification(QVariant notification) {
return; return;
} }
qInfo() << QStringLiteral("Delete notification:") << instance; lInfo() << QStringLiteral("Delete notification:") << instance;
instance->setProperty("__valid", true); instance->setProperty("__valid", true);
instance->property(NotificationPropertyTimer).value<QTimer *>()->stop(); instance->property(NotificationPropertyTimer).value<QTimer *>()->stop();
@ -291,7 +291,7 @@ void Notifier::notifyReceivedCall(const shared_ptr<linphone::Call> &call) {
QObject::connect( QObject::connect(
gui->getCore(), &CallCore::statusChanged, notification, gui->getCore(), &CallCore::statusChanged, notification,
[this, notification](LinphoneEnums::CallStatus status) { [this, notification](LinphoneEnums::CallStatus status) {
qInfo() << log().arg("Delete notification on call status : %1").arg(LinphoneEnums::toString(status)); lInfo() << log().arg("Delete notification on call status : %1").arg(LinphoneEnums::toString(status));
deleteNotification(QVariant::fromValue(notification)); deleteNotification(QVariant::fromValue(notification));
}); });
QObject::connect(gui->getCore(), &CallCore::destroyed, notification, QObject::connect(gui->getCore(), &CallCore::destroyed, notification,

View file

@ -39,6 +39,7 @@ QSharedPointer<ParticipantCore> ParticipantCore::create(const std::shared_ptr<li
} }
ParticipantCore::ParticipantCore(const std::shared_ptr<linphone::Participant> &participant) : QObject(nullptr) { ParticipantCore::ParticipantCore(const std::shared_ptr<linphone::Participant> &participant) : QObject(nullptr) {
mustBeInLinphoneThread(getClassName());
App::getInstance()->mEngine->setObjectOwnership(this, QQmlEngine::CppOwnership); App::getInstance()->mEngine->setObjectOwnership(this, QQmlEngine::CppOwnership);
mParticipantModel = Utils::makeQObject_ptr<ParticipantModel>(participant); mParticipantModel = Utils::makeQObject_ptr<ParticipantModel>(participant);
if (participant) { if (participant) {
@ -73,14 +74,8 @@ void ParticipantCore::setSelf(QSharedPointer<ParticipantCore> me) {
mParticipantConnection->makeConnectToCore(&ParticipantCore::lStartInvitation, [this](const int &secs) { mParticipantConnection->makeConnectToCore(&ParticipantCore::lStartInvitation, [this](const int &secs) {
QTimer::singleShot(secs * 1000, this, &ParticipantCore::onEndOfInvitation); QTimer::singleShot(secs * 1000, this, &ParticipantCore::onEndOfInvitation);
}); });
// mParticipantConnection->makeConnectToModel(&ParticipantModel::)
} }
// FriendCore *ParticipantCore::getFriendCore() const {
// return nullptr;
// // return CoreModel::getInstance()->getContactsListModel()->findContactModelFromSipAddress(getSipAddress()).get();
// }
int ParticipantCore::getSecurityLevel() const { int ParticipantCore::getSecurityLevel() const {
return mSecurityLevel; return mSecurityLevel;
} }
@ -160,12 +155,6 @@ void ParticipantCore::onDeviceSecurityLevelChanged(std::shared_ptr<const linphon
emit deviceSecurityLevelChanged(device); emit deviceSecurityLevelChanged(device);
} }
// ParticipantDeviceProxyModel *ParticipantCore::getProxyDevices() {
// ParticipantDeviceProxyModel *devices = new ParticipantDeviceProxyModel();
// devices->setParticipant(this);
// return devices;
// }
QList<QVariant> ParticipantCore::getParticipantDevices() { QList<QVariant> ParticipantCore::getParticipantDevices() {
return mParticipantDevices; return mParticipantDevices;
} }

View file

@ -38,7 +38,6 @@ class ParticipantModel;
class ParticipantCore : public QObject, public AbstractObject { class ParticipantCore : public QObject, public AbstractObject {
Q_OBJECT Q_OBJECT
// 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 isAdmin READ isAdmin WRITE setIsAdmin NOTIFY isAdminChanged) Q_PROPERTY(bool isAdmin READ isAdmin WRITE setIsAdmin NOTIFY isAdminChanged)
@ -49,8 +48,6 @@ class ParticipantCore : public QObject, public AbstractObject {
Q_PROPERTY(int deviceCount READ getDeviceCount NOTIFY deviceCountChanged) Q_PROPERTY(int deviceCount READ getDeviceCount NOTIFY deviceCountChanged)
Q_PROPERTY(QList<QVariant> devices READ getParticipantDevices NOTIFY deviceChanged) Q_PROPERTY(QList<QVariant> devices READ getParticipantDevices NOTIFY deviceChanged)
// Q_PROPERTY(bool inviting READ getInviting NOTIFY invitingChanged)
public: public:
static QSharedPointer<ParticipantCore> create(const std::shared_ptr<linphone::Participant> &participant); static QSharedPointer<ParticipantCore> create(const std::shared_ptr<linphone::Participant> &participant);
ParticipantCore(const std::shared_ptr<linphone::Participant> &participant); ParticipantCore(const std::shared_ptr<linphone::Participant> &participant);
@ -58,7 +55,6 @@ public:
void setSelf(QSharedPointer<ParticipantCore> me); void setSelf(QSharedPointer<ParticipantCore> me);
// FriendCore *getFriendCore() const;
QString getDisplayName() const; QString getDisplayName() const;
QString getSipAddress() const; QString getSipAddress() const;
QDateTime getCreationTime() const; QDateTime getCreationTime() const;
@ -76,7 +72,6 @@ public:
void setIsFocus(const bool &focus); void setIsFocus(const bool &focus);
void setSecurityLevel(int level); void setSecurityLevel(int level);
// Q_INVOKABLE ParticipantDeviceProxy *getProxyDevices();
QList<QVariant> getParticipantDevices(); QList<QVariant> getParticipantDevices();
public slots: public slots:
@ -106,7 +101,6 @@ private:
std::shared_ptr<ParticipantModel> mParticipantModel; std::shared_ptr<ParticipantModel> mParticipantModel;
QSharedPointer<SafeConnection<ParticipantCore, ParticipantModel>> mParticipantConnection; QSharedPointer<SafeConnection<ParticipantCore, ParticipantModel>> mParticipantConnection;
// QSharedPointer<ParticipantDeviceList> mParticipantDevices;
QList<QVariant> mParticipantDevices; QList<QVariant> mParticipantDevices;
QString mDisplayName; QString mDisplayName;

View file

@ -57,12 +57,9 @@ ParticipantDeviceCore::ParticipantDeviceCore(const std::shared_ptr<linphone::Par
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(deviceAddress->asStringUriOnly()); lDebug() << "Address = " << Utils::coreStringToAppString(deviceAddress->asStringUriOnly());
mIsLocal = ToolModel::findAccount(deviceAddress) != nullptr; // TODO set local mIsLocal = ToolModel::findAccount(deviceAddress) != nullptr; // TODO set local
// mCall = callModel;
// if (mCall) connect(mCall, &CallModel::statusChanged, this, &ParticipantDeviceCore::onCallStatusChanged);
mIsVideoEnabled = mParticipantDeviceModel->isVideoEnabled(); mIsVideoEnabled = mParticipantDeviceModel->isVideoEnabled();
// if (mCall && mParticipantDeviceModel) updateIsLocal();
} }
ParticipantDeviceCore::~ParticipantDeviceCore() { ParticipantDeviceCore::~ParticipantDeviceCore() {
@ -185,7 +182,7 @@ void ParticipantDeviceCore::setState(LinphoneEnums::ParticipantDeviceState state
void ParticipantDeviceCore::setIsVideoEnabled(bool enabled) { void ParticipantDeviceCore::setIsVideoEnabled(bool enabled) {
if (mIsVideoEnabled != enabled) { if (mIsVideoEnabled != enabled) {
mIsVideoEnabled = enabled; mIsVideoEnabled = enabled;
qDebug() << log().arg(Q_FUNC_INFO) << getAddress() << mIsVideoEnabled; lDebug() << log().arg(Q_FUNC_INFO) << getAddress() << mIsVideoEnabled;
emit videoEnabledChanged(); emit videoEnabledChanged();
} }
} }
@ -202,26 +199,8 @@ std::shared_ptr<ParticipantDeviceModel> ParticipantDeviceCore::getModel() const
return mParticipantDeviceModel; return mParticipantDeviceModel;
} }
// void ParticipantDeviceCore::updateIsLocal() {
// auto deviceAddress = mParticipantDeviceModel->getAddress();
// auto callAddress = mCall->getConferenceSharedModel()->getConference()->getMe()->getAddress();
// auto gruuAddress =
// CoreManager::getInstance()->getAccountSettingsModel()->findAccount(callAddress)->getContactAddress();
// setIsLocal(deviceAddress->equal(gruuAddress));
// }
// void ParticipantDeviceCore::onSecurityLevelChanged(std::shared_ptr<const linphone::Address> device) {
// if (!device || mParticipantDeviceModel && mParticipantDeviceModel->getAddress()->weakEqual(device))
// emit securityLevelChanged();
// }
// void ParticipantDeviceCore::onCallStatusChanged() {
// if (mCall->getCall()->getState() == linphone::Call::State::StreamsRunning) {
// updateVideoEnabled();
// }
// }
//-------------------------------------------------------------------- //--------------------------------------------------------------------
void ParticipantDeviceCore::onIsSpeakingChanged(const std::shared_ptr<linphone::ParticipantDevice> &participantDevice, void ParticipantDeviceCore::onIsSpeakingChanged(const std::shared_ptr<linphone::ParticipantDevice> &participantDevice,
bool isSpeaking) { bool isSpeaking) {
setIsSpeaking(isSpeaking); setIsSpeaking(isSpeaking);

View file

@ -51,7 +51,6 @@ class ParticipantDeviceCore : public QObject, public AbstractObject {
Q_PROPERTY(LinphoneEnums::ParticipantDeviceState state READ getState WRITE setState NOTIFY stateChanged) Q_PROPERTY(LinphoneEnums::ParticipantDeviceState state READ getState WRITE setState NOTIFY stateChanged)
public: public:
// static QSharedPointer<ParticipantDeviceCore> create(const std::shared_ptr<linphone::ParticipantDevice> &device);
static QSharedPointer<ParticipantDeviceCore> static QSharedPointer<ParticipantDeviceCore>
create(std::shared_ptr<linphone::ParticipantDevice> device, const bool &isMe = false, QObject *parent = nullptr); create(std::shared_ptr<linphone::ParticipantDevice> device, const bool &isMe = false, QObject *parent = nullptr);
@ -97,11 +96,6 @@ public:
bool available, bool available,
linphone::StreamType streamType); linphone::StreamType streamType);
// void updateIsLocal();
// public slots:
// void onSecurityLevelChanged(std::shared_ptr<const linphone::Address> device);
// void onCallStatusChanged();
signals: signals:
void securityLevelChanged(); void securityLevelChanged();
void videoEnabledChanged(); void videoEnabledChanged();

View file

@ -75,14 +75,14 @@ QSharedPointer<ParticipantDeviceCore> ParticipantDeviceList::getMe() const {
void ParticipantDeviceList::setDevices(QList<QSharedPointer<ParticipantDeviceCore>> devices) { void ParticipantDeviceList::setDevices(QList<QSharedPointer<ParticipantDeviceCore>> devices) {
mustBeInMainThread(log().arg(Q_FUNC_INFO)); mustBeInMainThread(log().arg(Q_FUNC_INFO));
add(devices); add(devices);
qDebug() << log().arg("Add %1 devices").arg(devices.size()); lDebug() << log().arg("Add %1 devices").arg(devices.size());
} }
QSharedPointer<ParticipantDeviceCore> ParticipantDeviceList::findDeviceByUniqueAddress(const QString &address) { QSharedPointer<ParticipantDeviceCore> ParticipantDeviceList::findDeviceByUniqueAddress(const QString &address) {
qDebug() << "address to find" << address; lDebug() << "address to find" << address;
auto found = std::find_if(mList.begin(), mList.end(), [address](const QSharedPointer<QObject> &obj) { auto found = std::find_if(mList.begin(), mList.end(), [address](const QSharedPointer<QObject> &obj) {
auto device = qobject_cast<QSharedPointer<ParticipantDeviceCore>>(obj); auto device = qobject_cast<QSharedPointer<ParticipantDeviceCore>>(obj);
qDebug() << "address" << device->getUniqueAddress(); lDebug() << "address" << device->getUniqueAddress();
return device && device->getUniqueAddress() == address; return device && device->getUniqueAddress() == address;
}); });
if (found != mList.end()) { if (found != mList.end()) {
@ -94,7 +94,7 @@ void ParticipantDeviceList::setConferenceModel(const std::shared_ptr<ConferenceM
mustBeInMainThread(log().arg(Q_FUNC_INFO)); mustBeInMainThread(log().arg(Q_FUNC_INFO));
if (mConferenceModel != conferenceModel) { if (mConferenceModel != conferenceModel) {
mConferenceModel = conferenceModel; mConferenceModel = conferenceModel;
qDebug() << log().arg("Set Conference %1").arg((quint64)mConferenceModel.get()); lDebug() << log().arg("Set Conference %1").arg((quint64)mConferenceModel.get());
if (mConferenceModelConnection->mCore.lock()) { // Unsure to get myself if (mConferenceModelConnection->mCore.lock()) { // Unsure to get myself
auto oldConnect = mConferenceModelConnection->mCore; // Setself rebuild safepointer auto oldConnect = mConferenceModelConnection->mCore; // Setself rebuild safepointer
setSelf(mConferenceModelConnection->mCore.mQData); // reset connections setSelf(mConferenceModelConnection->mCore.mQData); // reset connections
@ -104,12 +104,12 @@ void ParticipantDeviceList::setConferenceModel(const std::shared_ptr<ConferenceM
mList.clear(); mList.clear();
endResetModel(); endResetModel();
if (mConferenceModel) { if (mConferenceModel) {
qDebug() << "[ParticipantDeviceList] : request devices"; lDebug() << "[ParticipantDeviceList] : request devices";
mConferenceModelConnection->invokeToModel([this]() { mConferenceModelConnection->invokeToModel([this]() {
qDebug() << "[ParticipantDeviceList] : build devices"; lDebug() << "[ParticipantDeviceList] : build devices";
auto devices = buildDevices(mConferenceModel); auto devices = buildDevices(mConferenceModel);
mConferenceModelConnection->invokeToCore([this, devices]() { mConferenceModelConnection->invokeToCore([this, devices]() {
qDebug() << "[ParticipantDeviceList] : set devices"; lDebug() << "[ParticipantDeviceList] : set devices";
setDevices(devices); setDevices(devices);
}); });
}); });
@ -127,7 +127,7 @@ void ParticipantDeviceList::setSelf(QSharedPointer<ParticipantDeviceList> me) {
[this](const std::shared_ptr<linphone::ParticipantDevice> &device) { [this](const std::shared_ptr<linphone::ParticipantDevice> &device) {
auto deviceCore = ParticipantDeviceCore::create(device); auto deviceCore = ParticipantDeviceCore::create(device);
mConferenceModelConnection->invokeToCore([this, deviceCore]() { mConferenceModelConnection->invokeToCore([this, deviceCore]() {
qDebug() << "[ParticipantDeviceList] : add a device"; lDebug() << "[ParticipantDeviceList] : add a device";
this->add(deviceCore); this->add(deviceCore);
}); });
}); });
@ -137,18 +137,18 @@ void ParticipantDeviceList::setSelf(QSharedPointer<ParticipantDeviceList> me) {
QString uniqueAddress = Utils::coreStringToAppString(participantDevice->getAddress()->asString()); QString uniqueAddress = Utils::coreStringToAppString(participantDevice->getAddress()->asString());
auto deviceCore = findDeviceByUniqueAddress(uniqueAddress); auto deviceCore = findDeviceByUniqueAddress(uniqueAddress);
mConferenceModelConnection->invokeToCore([this, deviceCore]() { mConferenceModelConnection->invokeToCore([this, deviceCore]() {
qDebug() << "[ParticipantDeviceList] : remove a device"; lDebug() << "[ParticipantDeviceList] : remove a device";
this->remove(deviceCore); 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; lDebug() << "[ParticipantDeviceList] new state = " << (int)state;
if (state == linphone::Conference::State::Created) { if (state == linphone::Conference::State::Created) {
qDebug() << "[ParticipantDeviceList] : build devices"; lDebug() << "[ParticipantDeviceList] : build devices";
auto devices = buildDevices(mConferenceModel); auto devices = buildDevices(mConferenceModel);
mConferenceModelConnection->invokeToCore([this, devices]() { mConferenceModelConnection->invokeToCore([this, devices]() {
qDebug() << "[ParticipantDeviceList] : set devices" << devices.size(); lDebug() << "[ParticipantDeviceList] : set devices" << devices.size();
setDevices(devices); setDevices(devices);
}); });
} }

View file

@ -68,12 +68,10 @@ void ParticipantDeviceProxy::setCurrentCall(CallGui *call) {
auto conference = mCurrentCall->getCore()->getConferenceCore(); auto conference = mCurrentCall->getCore()->getConferenceCore();
lDebug() << log().arg("Set conference") << this << " => " << conference; lDebug() << log().arg("Set conference") << this << " => " << conference;
mParticipants->setConferenceModel(conference ? conference->getModel() : nullptr); mParticipants->setConferenceModel(conference ? conference->getModel() : nullptr);
// mParticipants->lSetConferenceModel(conference ? conference->getModel() : nullptr);
}); });
auto conference = callCore->getConferenceCore(); auto conference = callCore->getConferenceCore();
lDebug() << log().arg("Set conference") << this << " => " << conference; lDebug() << log().arg("Set conference") << this << " => " << conference;
mParticipants->setConferenceModel(conference ? conference->getModel() : nullptr); mParticipants->setConferenceModel(conference ? conference->getModel() : nullptr);
// mParticipants->lSetConferenceModel(conference ? conference->getModel() : nullptr);
} }
emit currentCallChanged(); emit currentCallChanged();
} }
@ -87,9 +85,6 @@ ParticipantDeviceGui *ParticipantDeviceProxy::getMe() const {
} }
} }
void ParticipantDeviceProxy::setMe(ParticipantDeviceGui *me) {
}
bool ParticipantDeviceProxy::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const { bool ParticipantDeviceProxy::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const {
return true; return true;
} }
@ -97,8 +92,6 @@ bool ParticipantDeviceProxy::filterAcceptsRow(int sourceRow, const QModelIndex &
bool ParticipantDeviceProxy::lessThan(const QModelIndex &left, const QModelIndex &right) const { bool ParticipantDeviceProxy::lessThan(const QModelIndex &left, const QModelIndex &right) const {
auto deviceA = sourceModel()->data(left).value<ParticipantDeviceGui *>()->getCore(); auto deviceA = sourceModel()->data(left).value<ParticipantDeviceGui *>()->getCore();
auto deviceB = sourceModel()->data(right).value<ParticipantDeviceGui *>()->getCore(); auto deviceB = sourceModel()->data(right).value<ParticipantDeviceGui *>()->getCore();
// auto deviceB = getItemAt<ParticipantDeviceList, ParticipantDeviceGui>(right.row())->getCore();
// return deviceB->isLocal() || !deviceA->isLocal() && deviceB->isMe() || left.row() < right.row();
return deviceB->isMe() || (!deviceB->isMe() && left.row() < right.row()); return deviceB->isMe() || (!deviceB->isMe() && left.row() < right.row());
} }

View file

@ -32,7 +32,7 @@ class ParticipantDeviceGui;
class ParticipantDeviceProxy : public SortFilterProxy, public AbstractObject { class ParticipantDeviceProxy : public SortFilterProxy, public AbstractObject {
Q_OBJECT Q_OBJECT
Q_PROPERTY(CallGui *currentCall READ getCurrentCall WRITE setCurrentCall NOTIFY currentCallChanged) Q_PROPERTY(CallGui *currentCall READ getCurrentCall WRITE setCurrentCall NOTIFY currentCallChanged)
Q_PROPERTY(ParticipantDeviceGui *me READ getMe WRITE setMe NOTIFY meChanged) Q_PROPERTY(ParticipantDeviceGui *me READ getMe NOTIFY meChanged)
public: public:
DECLARE_GUI_OBJECT DECLARE_GUI_OBJECT
@ -43,7 +43,6 @@ public:
void setCurrentCall(CallGui *callGui); void setCurrentCall(CallGui *callGui);
ParticipantDeviceGui *getMe() const; ParticipantDeviceGui *getMe() const;
void setMe(ParticipantDeviceGui *me);
protected: protected:
bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override; bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override;

View file

@ -48,8 +48,6 @@ ParticipantList::ParticipantList(QObject *parent) : ListProxy(parent) {
ParticipantList::~ParticipantList() { ParticipantList::~ParticipantList() {
mList.clear(); mList.clear();
// mChatRoomModel = nullptr;
// mConferenceModel = nullptr;
} }
void ParticipantList::setSelf(QSharedPointer<ParticipantList> me) { void ParticipantList::setSelf(QSharedPointer<ParticipantList> me) {
@ -107,7 +105,7 @@ void ParticipantList::setSelf(QSharedPointer<ParticipantList> me) {
void ParticipantList::setConferenceModel(const std::shared_ptr<ConferenceModel> &conferenceModel) { void ParticipantList::setConferenceModel(const std::shared_ptr<ConferenceModel> &conferenceModel) {
mustBeInMainThread(log().arg(Q_FUNC_INFO)); mustBeInMainThread(log().arg(Q_FUNC_INFO));
mConferenceModel = conferenceModel; mConferenceModel = conferenceModel;
qDebug() << "[ParticipantList] : set Conference " << mConferenceModel.get(); lDebug() << "[ParticipantList] : set Conference " << mConferenceModel.get();
if (mConferenceModelConnection && mConferenceModelConnection->mCore.lock()) { // Unsure to get myself if (mConferenceModelConnection && mConferenceModelConnection->mCore.lock()) { // Unsure to get myself
auto oldConnect = mConferenceModelConnection->mCore; // Setself rebuild safepointer auto oldConnect = mConferenceModelConnection->mCore; // Setself rebuild safepointer
setSelf(mConferenceModelConnection->mCore.mQData); // reset connections setSelf(mConferenceModelConnection->mCore.mQData); // reset connections
@ -147,87 +145,6 @@ bool ParticipantList::contains(const QString &address) const {
return exists; return exists;
} }
// void ParticipantList::updateParticipants() {
// if (/*mChatRoomModel ||*/ mConferenceModel) {
// bool changed = false;
// mConferenceModel->getMonitor()->getParticipantList();
// // auto dbParticipants = (/*mChatRoomModel ? mChatRoomModel->getParticipants() :*/ mConferenceModel->get());
// // Remove left participants
// auto itParticipant = mList.begin();
// while (itParticipant != mList.end()) {
// auto itDbParticipant = dbParticipants.begin();
// while (
// itDbParticipant != dbParticipants.end() &&
// (itParticipant->objectCast<ParticipantCore>()->getParticipant() &&
// !(*itDbParticipant)
// ->getAddress()
// ->weakEqual(itParticipant->objectCast<ParticipantCore>()->getParticipant()->getAddress()) ||
// !itParticipant->objectCast<ParticipantCore>()->getParticipant() &&
// !(*itDbParticipant)
// ->getAddress()
// ->weakEqual(
// Utils::interpretUrl(itParticipant->objectCast<ParticipantCore>()->getSipAddress())))) {
// ++itDbParticipant;
// }
// if (itDbParticipant == dbParticipants.end()) {
// int row = itParticipant - mList.begin();
// if (!changed) emit layoutAboutToBeChanged();
// beginRemoveRows(QModelIndex(), row, row);
// itParticipant = mList.erase(itParticipant);
// endRemoveRows();
// changed = true;
// } else ++itParticipant;
// }
// // Add new
// for (auto dbParticipant : dbParticipants) {
// auto itParticipant = mList.begin();
// while (itParticipant != mList.end() &&
// ((itParticipant->objectCast<ParticipantCore>()->getParticipant() &&
// !dbParticipant->getAddress()->weakEqual(
// itParticipant->objectCast<ParticipantCore>()->getParticipant()->getAddress()))
// || (!itParticipant->objectCast<ParticipantCore>()->getParticipant() &&
// !dbParticipant->getAddress()->weakEqual(
// Utils::interpretUrl(itParticipant->objectCast<ParticipantCore>()->getSipAddress()))))) {
// ++itParticipant;
// }
// if (itParticipant == mList.end()) {
// auto participant = QSharedPointer<ParticipantCore>::create(dbParticipant);
// add(participant);
// changed = true;
// } else if (!itParticipant->objectCast<ParticipantCore>()->getParticipant() ||
// itParticipant->objectCast<ParticipantCore>()->getParticipant() != dbParticipant) {
// itParticipant->objectCast<ParticipantCore>()->setParticipant(dbParticipant);
// changed = true;
// }
// }
// if (changed) {
// emit layoutChanged();
// emit participantsChanged();
// emit countChanged();
// }
// }
// }
// void ParticipantList::add(QSharedPointer<ParticipantCore> participant) {
// int row = mList.count();
// connect(this, &ParticipantList::deviceSecurityLevelChanged, participant.get(),
// &ParticipantCore::onDeviceSecurityLevelChanged);
// connect(this, &ParticipantList::securityLevelChanged, participant.get(), &ParticipantCore::onSecurityLevelChanged);
// connect(participant.get(), &ParticipantCore::updateAdminStatus, this, &ParticipantList::setAdminStatus);
// ProxyListModel::add(participant);
// emit participantsChanged();
// }
// void ParticipantList::add(const std::shared_ptr<const linphone::Participant> &participant) {
// updateParticipants();
// }
// void ParticipantList::add(const std::shared_ptr<const linphone::Address> &participantAddress) {
// add((mChatRoomModel ? mChatRoomModel->getChatRoom()->findParticipant(participantAddress->clone())
// : mConferenceModel->getConference()->findParticipant(participantAddress)));
// }
void ParticipantList::remove(ParticipantCore *participant) { void ParticipantList::remove(ParticipantCore *participant) {
QString address = participant->getSipAddress(); QString address = participant->getSipAddress();
int index = 0; int index = 0;
@ -252,10 +169,6 @@ void ParticipantList::addAddress(const QString &address) {
connect(participant.get(), &ParticipantCore::invitationTimeout, this, &ParticipantList::remove); connect(participant.get(), &ParticipantCore::invitationTimeout, this, &ParticipantList::remove);
participant->setSipAddress(address); participant->setSipAddress(address);
add(participant); add(participant);
// if (mChatRoomModel && mChatRoomModel->getChatRoom()) { // Invite and wait for its creation
// participant->startInvitation();
// mChatRoomModel->getChatRoom()->addParticipant(Utils::interpretUrl(address));
// }
if (mConferenceModel) { if (mConferenceModel) {
std::list<std::shared_ptr<linphone::Call>> runningCallsToAdd; std::list<std::shared_ptr<linphone::Call>> runningCallsToAdd;
mConferenceModelConnection->invokeToModel([this, address] { mConferenceModelConnection->invokeToModel([this, address] {
@ -267,139 +180,8 @@ void ParticipantList::addAddress(const QString &address) {
}); });
if (haveCall == currentCalls.end()) mConferenceModel->addParticipant(addressToInvite); if (haveCall == currentCalls.end()) mConferenceModel->addParticipant(addressToInvite);
}); });
// else {
// runningCallsToAdd.push_back(*haveCall);
// mConferenceModel->addParticipants(runningCallsToAdd);
// }
/*
std::list<std::shared_ptr<linphone::Address>> addressesToInvite;
addressesToInvite.push_back(addressToInvite);
auto callParameters =
CoreManager::getInstance()->getCore()->createCallParams(mConferenceModel->getConference()->getCall());
mConferenceModel->getConference()->inviteParticipants(addressesToInvite, callParameters);*/
} }
emit participant->lStartInvitation(); emit participant->lStartInvitation();
emit countChanged(); emit countChanged();
// emit addressAdded(address);
} }
} }
// const QSharedPointer<ParticipantCore>
// ParticipantList::getParticipant(const std::shared_ptr<const linphone::Address> &address) const {
// if (address) {
// auto itParticipant =
// std::find_if(mList.begin(), mList.end(), [address](const QSharedPointer<QObject> &participant) {
// return
// participant.objectCast<ParticipantCore>()->getParticipant()->getAddress()->weakEqual(address);
// });
// if (itParticipant == mList.end()) return nullptr;
// else return itParticipant->objectCast<ParticipantCore>();
// } else return nullptr;
// }
// const QSharedPointer<ParticipantCore>
// ParticipantList::getParticipant(const std::shared_ptr<const linphone::Participant> &pParticipant) const {
// if (pParticipant) {
// auto itParticipant =
// std::find_if(mList.begin(), mList.end(), [pParticipant](const QSharedPointer<QObject> &participant) {
// return participant.objectCast<ParticipantCore>()->getParticipant() == pParticipant;
// });
// if (itParticipant == mList.end()) return nullptr;
// else return itParticipant->objectCast<ParticipantCore>();
// } else return nullptr;
// }
//-------------------------------------------------------------
// void ParticipantList::setAdminStatus(const std::shared_ptr<linphone::Participant> participant, const bool
// &isAdmin) {
// // if (mChatRoomModel) mChatRoomModel->getChatRoom()->setParticipantAdminStatus(participant, isAdmin);
// // if (mConferenceModel) mConferenceModel->getConference()->setParticipantAdminStatus(participant, isAdmin);
// }
// void ParticipantList::onSecurityEvent(const std::shared_ptr<const linphone::EventLog> &eventLog) {
// auto address = eventLog->getParticipantAddress();
// if (address) {
// // auto participant = getParticipant(address);
// // if (participant) {
// // emit participant->securityLevelChanged();
// // }
// } else {
// address = eventLog->getDeviceAddress();
// // Looping on all participant ensure to get all devices. Can be optimized if Device address is unique : Gain
// // 2n operations.
// if (address) emit deviceSecurityLevelChanged(address);
// }
// }
// void ParticipantList::onConferenceJoined() {
// // updateParticipants();
// }
// void ParticipantList::onParticipantAdded(const std::shared_ptr<const linphone::EventLog> &eventLog) {
// qDebug() << "onParticipantAdded event: " << eventLog->getParticipantAddress()->asString().c_str();
// // add(eventLog->getParticipantAddress());
// }
// void ParticipantList::onParticipantAdded(const std::shared_ptr<const linphone::Participant> &participant) {
// qDebug() << "onParticipantAdded part: " << participant->getAddress()->asString().c_str();
// // add(participant);
// }
// void ParticipantList::onParticipantAdded(const std::shared_ptr<const linphone::Address> &address) {
// qDebug() << "onParticipantAdded addr: " << address->asString().c_str();
// // add(address);
// }
// void ParticipantList::onParticipantRemoved(const std::shared_ptr<const linphone::EventLog> &eventLog) {
// onParticipantRemoved(eventLog->getParticipantAddress());
// }
// void ParticipantList::onParticipantRemoved(const std::shared_ptr<const linphone::Participant> &participant) {
// // auto p = getParticipant(participant);
// // if (p) remove(p.get());
// }
// void ParticipantList::onParticipantRemoved(const std::shared_ptr<const linphone::Address> &address) {
// // auto participant = getParticipant(address);
// // if (participant) remove(participant.get());
// }
// void ParticipantList::onParticipantAdminStatusChanged(const std::shared_ptr<const linphone::EventLog> &eventLog)
// { onParticipantAdminStatusChanged(eventLog->getParticipantAddress());
// }
// void ParticipantList::onParticipantAdminStatusChanged(const std::shared_ptr<const linphone::Participant>
// &participant) {
// // 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);
// // 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());
// // if (participant) {
// // emit participant->deviceCountChanged();
// // }
// }
// void ParticipantList::onParticipantDeviceRemoved(const std::shared_ptr<const linphone::EventLog> &eventLog) {
// // auto participant = getParticipant(eventLog->getParticipantAddress());
// // if (participant) {
// // emit participant->deviceCountChanged();
// // }
// }
// void ParticipantList::onParticipantRegistrationSubscriptionRequested(
// const std::shared_ptr<const linphone::Address> &participantAddress) {
// }
// void ParticipantList::onParticipantRegistrationUnsubscriptionRequested(
// const std::shared_ptr<const linphone::Address> &participantAddress) {
// }
// void ParticipantList::onStateChanged() {
// // if (mConferenceModel) {
// // if (mConferenceModel->getConference()->getState() == linphone::Conference::State::Created) {
// // updateParticipants();
// // }
// // }
// }

View file

@ -45,10 +45,6 @@ public:
// Q_PROPERTY(ChatRoomModel *chatRoomModel READ getChatRoomModel CONSTANT) // Q_PROPERTY(ChatRoomModel *chatRoomModel READ getChatRoomModel CONSTANT)
void reset(); void reset();
// void updateParticipants(); // Update list from Chat Room // void updateParticipants(); // Update list from Chat Room
// const QSharedPointer<ParticipantCore>
// getParticipant(const std::shared_ptr<const linphone::Address> &address) const;
// const QSharedPointer<ParticipantCore> const QSharedPointer<ParticipantCore>
// getParticipant(const std::shared_ptr<const linphone::Participant> &participant) const;
Q_INVOKABLE void remove(ParticipantCore *participant); Q_INVOKABLE void remove(ParticipantCore *participant);
void addAddress(const QString &address); void addAddress(const QString &address);
@ -61,27 +57,6 @@ public:
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:
// void setAdminStatus(const std::shared_ptr<linphone::Participant> participant, const bool &isAdmin);
// void onSecurityEvent(const std::shared_ptr<const linphone::EventLog> &eventLog);
// void onConferenceJoined();
// 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::Address> &address);
// 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::Address> &address);
// 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::Address> &address);
// void onParticipantDeviceAdded(const std::shared_ptr<const linphone::EventLog> &eventLog);
// void onParticipantDeviceRemoved(const std::shared_ptr<const linphone::EventLog> &eventLog);
// void
// onParticipantRegistrationSubscriptionRequested(const std::shared_ptr<const linphone::Address>
// &participantAddress); void onParticipantRegistrationUnsubscriptionRequested( const
// std::shared_ptr<const linphone::Address> &participantAddress); void onStateChanged();
signals: signals:
void securityLevelChanged(); void securityLevelChanged();
void deviceSecurityLevelChanged(std::shared_ptr<const linphone::Address> device); void deviceSecurityLevelChanged(std::shared_ptr<const linphone::Address> device);

View file

@ -50,7 +50,7 @@ CallGui *ParticipantProxy::getCurrentCall() const {
} }
void ParticipantProxy::setCurrentCall(CallGui *call) { void ParticipantProxy::setCurrentCall(CallGui *call) {
qDebug() << "[ParticipantProxy] set current call " << this << " => " << call; lDebug() << "[ParticipantProxy] set current call " << this << " => " << call;
if (mCurrentCall != call) { if (mCurrentCall != call) {
CallCore *callCore = nullptr; CallCore *callCore = nullptr;
if (mCurrentCall) { if (mCurrentCall) {
@ -63,12 +63,12 @@ void ParticipantProxy::setCurrentCall(CallGui *call) {
if (callCore) { if (callCore) {
connect(callCore, &CallCore::conferenceChanged, mParticipants.get(), [this]() { connect(callCore, &CallCore::conferenceChanged, mParticipants.get(), [this]() {
auto conference = mCurrentCall->getCore()->getConferenceCore(); auto conference = mCurrentCall->getCore()->getConferenceCore();
qDebug() << "[ParticipantDeviceProxy] set conference " << this << " => " << conference; lDebug() << "[ParticipantDeviceProxy] set conference " << this << " => " << conference;
mParticipants->setConferenceModel(conference ? conference->getModel() : nullptr); mParticipants->setConferenceModel(conference ? conference->getModel() : nullptr);
// mParticipants->lSetConferenceModel(conference ? conference->getModel() : nullptr); // mParticipants->lSetConferenceModel(conference ? conference->getModel() : nullptr);
}); });
auto conference = callCore->getConferenceCore(); auto conference = callCore->getConferenceCore();
qDebug() << "[ParticipantDeviceProxy] set conference " << this << " => " << conference; lDebug() << "[ParticipantDeviceProxy] set conference " << this << " => " << conference;
mParticipants->setConferenceModel(conference ? conference->getModel() : nullptr); mParticipants->setConferenceModel(conference ? conference->getModel() : nullptr);
// mParticipants->lSetConferenceModel(conference ? conference->getModel() : nullptr); // mParticipants->lSetConferenceModel(conference ? conference->getModel() : nullptr);
} }
@ -76,14 +76,6 @@ void ParticipantProxy::setCurrentCall(CallGui *call) {
} }
} }
// ChatRoomModel *ParticipantProxy::getChatRoomModel() const {
// return mChatRoomModel;
// }
// ConferenceModel *ParticipantProxy::getConferenceModel() const {
// return mConferenceModel;
// }
bool ParticipantProxy::getShowMe() const { bool ParticipantProxy::getShowMe() const {
return mShowMe; return mShowMe;
} }
@ -138,12 +130,6 @@ void ParticipantProxy::setConferenceModel(ConferenceModel *conferenceModel) {
// } // }
} }
void ParticipantProxy::setAddresses(ConferenceInfoModel *conferenceInfoModel) {
// if (conferenceInfoModel && conferenceInfoModel->getConferenceInfo())
// for (auto address : conferenceInfoModel->getConferenceInfo()->getParticipants())
// addAddress(QString::fromStdString(address->asString()));
}
void ParticipantProxy::setShowMe(const bool &show) { void ParticipantProxy::setShowMe(const bool &show) {
if (mShowMe != show) { if (mShowMe != show) {
mShowMe = show; mShowMe = show;

View file

@ -52,11 +52,8 @@ public:
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;
// ConferenceModel *getConferenceModel() const;
bool getShowMe() const; bool getShowMe() const;
// void setChatRoomModel(ChatRoomModel *chatRoomModel);
void setConferenceModel(ConferenceModel *conferenceModel); void setConferenceModel(ConferenceModel *conferenceModel);
void setShowMe(const bool &show); void setShowMe(const bool &show);
@ -64,7 +61,6 @@ public:
Q_INVOKABLE void addAddresses(const QStringList &addresses); Q_INVOKABLE void addAddresses(const QStringList &addresses);
Q_INVOKABLE void removeParticipant(ParticipantCore *participant); Q_INVOKABLE void removeParticipant(ParticipantCore *participant);
Q_INVOKABLE void setParticipantAdminStatus(ParticipantCore *participant, bool status); Q_INVOKABLE void setParticipantAdminStatus(ParticipantCore *participant, bool status);
Q_INVOKABLE void setAddresses(ConferenceInfoModel *conferenceInfoModel);
signals: signals:
void chatRoomModelChanged(); void chatRoomModelChanged();
@ -77,7 +73,6 @@ signals:
void currentCallChanged(); void currentCallChanged();
private: private:
// ChatRoomModel *mChatRoomModel = nullptr;
bool mShowMe = true; bool mShowMe = true;
CallGui *mCurrentCall = nullptr; CallGui *mCurrentCall = nullptr;
QSharedPointer<ParticipantList> mParticipants; QSharedPointer<ParticipantList> mParticipants;

View file

@ -22,6 +22,7 @@
#define _LIST_PROXY_H_ #define _LIST_PROXY_H_
#include "AbstractListProxy.hpp" #include "AbstractListProxy.hpp"
#include "tool/Utils.hpp"
#include <QSharedPointer> #include <QSharedPointer>
// ============================================================================= // =============================================================================
@ -92,7 +93,7 @@ public:
virtual bool remove(QObject *itemToRemove) override { virtual bool remove(QObject *itemToRemove) override {
bool removed = false; bool removed = false;
if (itemToRemove) { if (itemToRemove) {
qInfo() << QStringLiteral("Removing ") << itemToRemove->metaObject()->className() << QStringLiteral(" : ") lInfo() << QStringLiteral("Removing ") << itemToRemove->metaObject()->className() << QStringLiteral(" : ")
<< itemToRemove; << itemToRemove;
int index = 0; int index = 0;
for (auto item : mList) for (auto item : mList)

View file

@ -79,7 +79,7 @@ SingleApplication::SingleApplication(
if (d->memory->create(sizeof(InstancesInfo))) { if (d->memory->create(sizeof(InstancesInfo))) {
// Initialize the shared memory block // Initialize the shared memory block
if (!d->memory->lock()) { if (!d->memory->lock()) {
qCritical() << "SingleApplication: Unable to lock memory block after create."; lCritical() << "SingleApplication: Unable to lock memory block after create.";
abortSafely(); abortSafely();
} }
d->initializeMemoryBlock(); d->initializeMemoryBlock();
@ -87,15 +87,15 @@ SingleApplication::SingleApplication(
if (d->memory->error() == QSharedMemory::AlreadyExists) { if (d->memory->error() == QSharedMemory::AlreadyExists) {
// Attempt to attach to the memory segment // Attempt to attach to the memory segment
if (!d->memory->attach()) { if (!d->memory->attach()) {
qCritical() << "SingleApplication: Unable to attach to shared memory block."; lCritical() << "SingleApplication: Unable to attach to shared memory block.";
abortSafely(); abortSafely();
} }
if (!d->memory->lock()) { if (!d->memory->lock()) {
qCritical() << "SingleApplication: Unable to lock memory block after attach."; lCritical() << "SingleApplication: Unable to lock memory block after attach.";
abortSafely(); abortSafely();
} }
} else { } else {
qCritical() << "SingleApplication: Unable to create block."; lCritical() << "SingleApplication: Unable to create block.";
abortSafely(); abortSafely();
} }
} }
@ -121,12 +121,12 @@ SingleApplication::SingleApplication(
// limits the probability of a collision between two racing apps and // limits the probability of a collision between two racing apps and
// allows the app to initialise faster // allows the app to initialise faster
if (!d->memory->unlock()) { if (!d->memory->unlock()) {
qDebug() << "SingleApplication: Unable to unlock memory for random wait."; lDebug() << "SingleApplication: Unable to unlock memory for random wait.";
qDebug() << d->memory->errorString(); lDebug() << d->memory->errorString();
} }
SingleApplicationPrivate::randomSleep(); SingleApplicationPrivate::randomSleep();
if (!d->memory->lock()) { if (!d->memory->lock()) {
qCritical() << "SingleApplication: Unable to lock memory after random wait."; lCritical() << "SingleApplication: Unable to lock memory after random wait.";
abortSafely(); abortSafely();
} }
} }
@ -134,8 +134,8 @@ SingleApplication::SingleApplication(
if (inst->primary == false) { if (inst->primary == false) {
d->startPrimary(); d->startPrimary();
if (!d->memory->unlock()) { if (!d->memory->unlock()) {
qDebug() << "SingleApplication: Unable to unlock memory after primary start."; lDebug() << "SingleApplication: Unable to unlock memory after primary start.";
qDebug() << d->memory->errorString(); lDebug() << d->memory->errorString();
} }
return; return;
} }
@ -147,15 +147,15 @@ SingleApplication::SingleApplication(
d->connectToPrimary(timeout, SingleApplicationPrivate::SecondaryInstance); d->connectToPrimary(timeout, SingleApplicationPrivate::SecondaryInstance);
} }
if (!d->memory->unlock()) { if (!d->memory->unlock()) {
qDebug() << "SingleApplication: Unable to unlock memory after secondary start."; lDebug() << "SingleApplication: Unable to unlock memory after secondary start.";
qDebug() << d->memory->errorString(); lDebug() << d->memory->errorString();
} }
return; return;
} }
if (!d->memory->unlock()) { if (!d->memory->unlock()) {
qDebug() << "SingleApplication: Unable to unlock memory at end of execution."; lDebug() << "SingleApplication: Unable to unlock memory at end of execution.";
qDebug() << d->memory->errorString(); lDebug() << d->memory->errorString();
} }
d->connectToPrimary(timeout, SingleApplicationPrivate::NewInstance); d->connectToPrimary(timeout, SingleApplicationPrivate::NewInstance);
@ -253,7 +253,7 @@ bool SingleApplication::sendMessage(const QByteArray &message, int timeout, Send
void SingleApplication::abortSafely() { void SingleApplication::abortSafely() {
Q_D(SingleApplication); Q_D(SingleApplication);
qCritical() << "SingleApplication: " << d->memory->error() << d->memory->errorString(); lCritical() << "SingleApplication: " << d->memory->error() << d->memory->errorString();
delete d; delete d;
::exit(EXIT_FAILURE); ::exit(EXIT_FAILURE);
} }

View file

@ -60,8 +60,8 @@ void TimeZoneList::initTimeZones() {
QHash<int, QByteArray> TimeZoneList::roleNames() const { QHash<int, QByteArray> TimeZoneList::roleNames() const {
QHash<int, QByteArray> roles; QHash<int, QByteArray> roles;
roles[Qt::DisplayRole] = "modelData"; roles[Qt::DisplayRole] = "$modelData";
roles[Qt::DisplayRole + 1] = "timeZoneModel"; roles[Qt::DisplayRole + 1] = "$timeZoneModel";
return roles; return roles;
} }

View file

@ -41,7 +41,7 @@ std::shared_ptr<linphone::Account> AccountManager::createAccount(const QString &
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO)); mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
auto core = CoreModel::getInstance()->getCore(); auto core = CoreModel::getInstance()->getCore();
QString assistantPath = "://data/assistant/" + assistantFile; QString assistantPath = "://data/assistant/" + assistantFile;
qInfo() << log().arg(QStringLiteral("Set config on assistant: `%1`.")).arg(assistantPath); lInfo() << log().arg(QStringLiteral("Set config on assistant: `%1`.")).arg(assistantPath);
QFile resource(assistantPath); QFile resource(assistantPath);
auto file = QTemporaryFile::createNativeFile(resource); auto file = QTemporaryFile::createNativeFile(resource);
core->getConfig()->loadFromXmlFile(Utils::appStringToCoreString(file->fileName())); core->getConfig()->loadFromXmlFile(Utils::appStringToCoreString(file->fileName()));

View file

@ -30,7 +30,7 @@ DEFINE_ABSTRACT_OBJECT(CallModel)
CallModel::CallModel(const std::shared_ptr<linphone::Call> &call, QObject *parent) CallModel::CallModel(const std::shared_ptr<linphone::Call> &call, QObject *parent)
: ::Listener<linphone::Call, linphone::CallListener>(call, parent) { : ::Listener<linphone::Call, linphone::CallListener>(call, parent) {
qDebug() << "[CallModel] new" << this; lDebug() << "[CallModel] new" << this;
mustBeInLinphoneThread(getClassName()); mustBeInLinphoneThread(getClassName());
mDurationTimer.setInterval(1000); mDurationTimer.setInterval(1000);
mDurationTimer.setSingleShot(false); mDurationTimer.setSingleShot(false);
@ -297,6 +297,7 @@ void CallModel::changeConferenceVideoLayout(LinphoneEnums::ConferenceLayout layo
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO)); mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
auto coreManager = CoreModel::getInstance(); auto coreManager = CoreModel::getInstance();
// TODO : change layout for grid/active speaker in settings
// if (layout == LinphoneEnums::ConferenceLayout::Grid) // if (layout == LinphoneEnums::ConferenceLayout::Grid)
// coreManager->getSettingsModel()->setCameraMode(coreManager->getSettingsModel()->getGridCameraMode()); // coreManager->getSettingsModel()->setCameraMode(coreManager->getSettingsModel()->getGridCameraMode());
// else // else
@ -322,7 +323,9 @@ void CallModel::updateConferenceVideoLayout() {
// settings->setCameraMode(settings->getGridCameraMode()); // settings->setCameraMode(settings->getGridCameraMode());
// else settings->setCameraMode(settings->getActiveSpeakerCameraMode()); // else settings->setCameraMode(settings->getActiveSpeakerCameraMode());
// } else settings->setCameraMode(settings->getCallCameraMode()); // } else settings->setCameraMode(settings->getCallCameraMode());
qDebug() << "Changing layout from " << mConferenceVideoLayout << " into " << newLayout;
// TODO : change layout for grid/active speaker in settings
lDebug() << "Changing layout from " << mConferenceVideoLayout << " into " << newLayout;
mConferenceVideoLayout = newLayout; mConferenceVideoLayout = newLayout;
emit conferenceVideoLayoutChanged(mConferenceVideoLayout); emit conferenceVideoLayoutChanged(mConferenceVideoLayout);
} }
@ -359,7 +362,7 @@ void CallModel::onInfoMessageReceived(const std::shared_ptr<linphone::Call> &cal
void CallModel::onStateChanged(const std::shared_ptr<linphone::Call> &call, void CallModel::onStateChanged(const std::shared_ptr<linphone::Call> &call,
linphone::Call::State state, linphone::Call::State state,
const std::string &message) { const std::string &message) {
qDebug() << "CallModel::onStateChanged" << (int)state; lDebug() << "CallModel::onStateChanged" << (int)state;
if (state == linphone::Call::State::StreamsRunning) { if (state == linphone::Call::State::StreamsRunning) {
// After UpdatedByRemote, video direction could be changed. // After UpdatedByRemote, video direction could be changed.
auto params = call->getRemoteParams(); auto params = call->getRemoteParams();
@ -376,7 +379,7 @@ void CallModel::onStateChanged(const std::shared_ptr<linphone::Call> &call,
} }
void CallModel::onStatusChanged(const std::shared_ptr<linphone::Call> &call, linphone::Call::Status status) { void CallModel::onStatusChanged(const std::shared_ptr<linphone::Call> &call, linphone::Call::Status status) {
qDebug() << "CallModel::onStatusChanged" << (int)status; lDebug() << "CallModel::onStatusChanged" << (int)status;
emit statusChanged(status); emit statusChanged(status);
} }

View file

@ -50,6 +50,7 @@ std::shared_ptr<ConferenceSchedulerModel> ConferenceInfoModel::getConferenceSche
} }
void ConferenceInfoModel::setConferenceScheduler(const std::shared_ptr<ConferenceSchedulerModel> &model) { void ConferenceInfoModel::setConferenceScheduler(const std::shared_ptr<ConferenceSchedulerModel> &model) {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
if (mConferenceSchedulerModel != model) { if (mConferenceSchedulerModel != model) {
if (mConferenceSchedulerModel) { if (mConferenceSchedulerModel) {
disconnect(mConferenceSchedulerModel.get(), &ConferenceSchedulerModel::stateChanged, this, nullptr); disconnect(mConferenceSchedulerModel.get(), &ConferenceSchedulerModel::stateChanged, this, nullptr);
@ -72,26 +73,32 @@ void ConferenceInfoModel::setConferenceScheduler(const std::shared_ptr<Conferenc
} }
QDateTime ConferenceInfoModel::getDateTime() const { QDateTime ConferenceInfoModel::getDateTime() const {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
return QDateTime::fromMSecsSinceEpoch(mConferenceInfo->getDateTime() * 1000, Qt::LocalTime); return QDateTime::fromMSecsSinceEpoch(mConferenceInfo->getDateTime() * 1000, Qt::LocalTime);
} }
int ConferenceInfoModel::getDuration() const { int ConferenceInfoModel::getDuration() const {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
return mConferenceInfo->getDuration(); return mConferenceInfo->getDuration();
} }
QDateTime ConferenceInfoModel::getEndTime() const { QDateTime ConferenceInfoModel::getEndTime() const {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
return getDateTime().addSecs(mConferenceInfo->getDuration()); return getDateTime().addSecs(mConferenceInfo->getDuration());
} }
QString ConferenceInfoModel::getSubject() const { QString ConferenceInfoModel::getSubject() const {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
return Utils::coreStringToAppString(mConferenceInfo->getSubject()); return Utils::coreStringToAppString(mConferenceInfo->getSubject());
} }
linphone::ConferenceInfo::State ConferenceInfoModel::getState() const { linphone::ConferenceInfo::State ConferenceInfoModel::getState() const {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
return mConferenceInfo->getState(); return mConferenceInfo->getState();
} }
QString ConferenceInfoModel::getOrganizerName() const { QString ConferenceInfoModel::getOrganizerName() const {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
auto organizer = mConferenceInfo->getOrganizer(); auto organizer = mConferenceInfo->getOrganizer();
auto name = Utils::coreStringToAppString(organizer->getDisplayName()); auto name = Utils::coreStringToAppString(organizer->getDisplayName());
if (name.isEmpty()) name = ToolModel::getDisplayName(Utils::coreStringToAppString(organizer->asStringUriOnly())); if (name.isEmpty()) name = ToolModel::getDisplayName(Utils::coreStringToAppString(organizer->asStringUriOnly()));
@ -103,20 +110,25 @@ QString ConferenceInfoModel::getOrganizerAddress() const {
} }
QString ConferenceInfoModel::getDescription() const { QString ConferenceInfoModel::getDescription() const {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
return Utils::coreStringToAppString(mConferenceInfo->getSubject()); return Utils::coreStringToAppString(mConferenceInfo->getSubject());
} }
QString ConferenceInfoModel::getUri() const { QString ConferenceInfoModel::getUri() const {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
if (auto uriAddr = mConferenceInfo->getUri()) { if (auto uriAddr = mConferenceInfo->getUri()) {
return Utils::coreStringToAppString(uriAddr->asString()); return Utils::coreStringToAppString(uriAddr->asString());
} else return QString(); } else return QString();
} }
std::list<std::shared_ptr<linphone::ParticipantInfo>> ConferenceInfoModel::getParticipantInfos() const { std::list<std::shared_ptr<linphone::ParticipantInfo>> ConferenceInfoModel::getParticipantInfos() const {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
return mConferenceInfo->getParticipantInfos(); return mConferenceInfo->getParticipantInfos();
} }
bool ConferenceInfoModel::inviteEnabled() const { bool ConferenceInfoModel::inviteEnabled() const {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
return mInviteEnabled; return mInviteEnabled;
} }
@ -126,16 +138,19 @@ void ConferenceInfoModel::setDateTime(const QDateTime &date) {
} }
void ConferenceInfoModel::setDuration(int duration) { void ConferenceInfoModel::setDuration(int duration) {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
mConferenceInfo->setDuration(duration); mConferenceInfo->setDuration(duration);
emit durationChanged(duration); emit durationChanged(duration);
} }
void ConferenceInfoModel::setSubject(const QString &subject) { void ConferenceInfoModel::setSubject(const QString &subject) {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
mConferenceInfo->setSubject(Utils::appStringToCoreString(subject)); mConferenceInfo->setSubject(Utils::appStringToCoreString(subject));
emit subjectChanged(subject); emit subjectChanged(subject);
} }
void ConferenceInfoModel::setOrganizer(const QString &organizerAddress) { void ConferenceInfoModel::setOrganizer(const QString &organizerAddress) {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
auto linAddr = ToolModel::interpretUrl(organizerAddress); auto linAddr = ToolModel::interpretUrl(organizerAddress);
if (linAddr) { if (linAddr) {
mConferenceInfo->setOrganizer(linAddr); mConferenceInfo->setOrganizer(linAddr);
@ -144,32 +159,38 @@ void ConferenceInfoModel::setOrganizer(const QString &organizerAddress) {
} }
void ConferenceInfoModel::setDescription(const QString &description) { void ConferenceInfoModel::setDescription(const QString &description) {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
mConferenceInfo->setDescription(Utils::appStringToCoreString(description)); mConferenceInfo->setDescription(Utils::appStringToCoreString(description));
emit descriptionChanged(description); emit descriptionChanged(description);
} }
void ConferenceInfoModel::setParticipantInfos( void ConferenceInfoModel::setParticipantInfos(
const std::list<std::shared_ptr<linphone::ParticipantInfo>> &participantInfos) { const std::list<std::shared_ptr<linphone::ParticipantInfo>> &participantInfos) {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
mConferenceInfo->setParticipantInfos(participantInfos); mConferenceInfo->setParticipantInfos(participantInfos);
emit participantsChanged(); emit participantsChanged();
} }
void ConferenceInfoModel::deleteConferenceInfo() { void ConferenceInfoModel::deleteConferenceInfo() {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
CoreModel::getInstance()->getCore()->deleteConferenceInformation(mConferenceInfo); CoreModel::getInstance()->getCore()->deleteConferenceInformation(mConferenceInfo);
emit conferenceInfoDeleted(); emit conferenceInfoDeleted();
} }
void ConferenceInfoModel::cancelConference() { void ConferenceInfoModel::cancelConference() {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
if (!mConferenceSchedulerModel) return; if (!mConferenceSchedulerModel) return;
mConferenceSchedulerModel->cancelConference(mConferenceInfo); mConferenceSchedulerModel->cancelConference(mConferenceInfo);
emit conferenceInfoCanceled(); emit conferenceInfoCanceled();
} }
void ConferenceInfoModel::updateConferenceInfo() { void ConferenceInfoModel::updateConferenceInfo() {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
mConferenceSchedulerModel->setInfo(mConferenceInfo); mConferenceSchedulerModel->setInfo(mConferenceInfo);
} }
void ConferenceInfoModel::enableInvite(bool enable) { void ConferenceInfoModel::enableInvite(bool enable) {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
if (mInviteEnabled != enable) { if (mInviteEnabled != enable) {
mInviteEnabled = enable; mInviteEnabled = enable;
emit inviteEnabledChanged(mInviteEnabled); emit inviteEnabledChanged(mInviteEnabled);

View file

@ -80,9 +80,6 @@ private:
std::shared_ptr<ConferenceSchedulerModel> mConferenceSchedulerModel = nullptr; std::shared_ptr<ConferenceSchedulerModel> mConferenceSchedulerModel = nullptr;
bool mInviteEnabled = true; bool mInviteEnabled = true;
DECLARE_ABSTRACT_OBJECT DECLARE_ABSTRACT_OBJECT
// LINPHONE
//--------------------------------------------------------------------------------
}; };
#endif #endif

View file

@ -37,7 +37,7 @@ std::shared_ptr<ConferenceModel> ConferenceModel::create(const std::shared_ptr<l
ConferenceModel::ConferenceModel(const std::shared_ptr<linphone::Conference> &conference, QObject *parent) ConferenceModel::ConferenceModel(const std::shared_ptr<linphone::Conference> &conference, QObject *parent)
: ::Listener<linphone::Conference, linphone::ConferenceListener>(conference, parent) { : ::Listener<linphone::Conference, linphone::ConferenceListener>(conference, parent) {
mustBeInLinphoneThread(getClassName()); mustBeInLinphoneThread(getClassName());
qDebug() << "[ConferenceModel] new" << this << conference.get(); lDebug() << "[ConferenceModel] new" << this << conference.get();
} }
ConferenceModel::~ConferenceModel() { ConferenceModel::~ConferenceModel() {
@ -53,10 +53,12 @@ void ConferenceModel::setPaused(bool paused) {
} }
void ConferenceModel::removeParticipant(const std::shared_ptr<linphone::Participant> &p) { void ConferenceModel::removeParticipant(const std::shared_ptr<linphone::Participant> &p) {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
mMonitor->removeParticipant(p); mMonitor->removeParticipant(p);
} }
void ConferenceModel::removeParticipant(const std::shared_ptr<linphone::Address> &address) { void ConferenceModel::removeParticipant(const std::shared_ptr<linphone::Address> &address) {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
for (auto &p : mMonitor->getParticipantList()) { for (auto &p : mMonitor->getParticipantList()) {
if (address->asStringUriOnly() == p->getAddress()->asStringUriOnly()) { if (address->asStringUriOnly() == p->getAddress()->asStringUriOnly()) {
mMonitor->removeParticipant(p); mMonitor->removeParticipant(p);
@ -65,6 +67,7 @@ void ConferenceModel::removeParticipant(const std::shared_ptr<linphone::Address>
} }
void ConferenceModel::addParticipant(const std::shared_ptr<linphone::Address> &address) { void ConferenceModel::addParticipant(const std::shared_ptr<linphone::Address> &address) {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
mMonitor->addParticipant(address); mMonitor->addParticipant(address);
} }
@ -95,37 +98,13 @@ void ConferenceModel::setRecordFile(const std::string &path) {
// mMonitor->update(params); // mMonitor->update(params);
} }
// void ConferenceModel::setSpeakerVolumeGain(float gain) {
// mMonitor->setSpeakerVolumeGain(gain);
// emit speakerVolumeGainChanged(gain);
// }
// float ConferenceModel::getSpeakerVolumeGain() const {
// auto gain = mMonitor->getSpeakerVolumeGain();
// if (gain < 0) gain = CoreModel::getInstance()->getCore()->getPlaybackGainDb();
// return gain;
// }
// void ConferenceModel::setMicrophoneVolumeGain(float gain) {
// mMonitor->setMicrophoneVolumeGain(gain);
// emit microphoneVolumeGainChanged(gain);
// }
// float ConferenceModel::getMicrophoneVolumeGain() const {
// auto gain = mMonitor->getMicrophoneVolumeGain();
// return gain;
// }
// float ConferenceModel::getMicrophoneVolume() const {
// auto volume = mMonitor->getRecordVolume();
// return volume;
// }
void ConferenceModel::setParticipantAdminStatus(const std::shared_ptr<linphone::Participant> participant, bool status) { void ConferenceModel::setParticipantAdminStatus(const std::shared_ptr<linphone::Participant> participant, bool status) {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
mMonitor->setParticipantAdminStatus(participant, 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) {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
mMonitor->setInputAudioDevice(device); mMonitor->setInputAudioDevice(device);
std::string deviceName; std::string deviceName;
if (device) deviceName = device->getDeviceName(); if (device) deviceName = device->getDeviceName();
@ -133,10 +112,12 @@ void ConferenceModel::setInputAudioDevice(const std::shared_ptr<linphone::AudioD
} }
std::shared_ptr<const linphone::AudioDevice> ConferenceModel::getInputAudioDevice() const { std::shared_ptr<const linphone::AudioDevice> ConferenceModel::getInputAudioDevice() const {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
return mMonitor->getInputAudioDevice(); return mMonitor->getInputAudioDevice();
} }
void ConferenceModel::setOutputAudioDevice(const std::shared_ptr<linphone::AudioDevice> &device) { void ConferenceModel::setOutputAudioDevice(const std::shared_ptr<linphone::AudioDevice> &device) {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
mMonitor->setOutputAudioDevice(device); mMonitor->setOutputAudioDevice(device);
std::string deviceName; std::string deviceName;
if (device) deviceName = device->getDeviceName(); if (device) deviceName = device->getDeviceName();
@ -144,60 +125,59 @@ void ConferenceModel::setOutputAudioDevice(const std::shared_ptr<linphone::Audio
} }
std::shared_ptr<const linphone::AudioDevice> ConferenceModel::getOutputAudioDevice() const { std::shared_ptr<const linphone::AudioDevice> ConferenceModel::getOutputAudioDevice() const {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
return mMonitor->getOutputAudioDevice(); return mMonitor->getOutputAudioDevice();
} }
void ConferenceModel::onActiveSpeakerParticipantDevice( void ConferenceModel::onActiveSpeakerParticipantDevice(
const std::shared_ptr<linphone::Conference> &conference, const std::shared_ptr<linphone::Conference> &conference,
const std::shared_ptr<const linphone::ParticipantDevice> &participantDevice) { const std::shared_ptr<const linphone::ParticipantDevice> &participantDevice) {
qDebug() << "onActiveSpeakerParticipantDevice: " << participantDevice->getAddress()->asString().c_str(); lDebug() << "onActiveSpeakerParticipantDevice: " << participantDevice->getAddress()->asString().c_str();
emit activeSpeakerParticipantDevice(conference->getActiveSpeakerParticipantDevice()); emit activeSpeakerParticipantDevice(conference->getActiveSpeakerParticipantDevice());
} }
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();
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";
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,
const std::shared_ptr<linphone::ParticipantDevice> &participantDevice) { const std::shared_ptr<linphone::ParticipantDevice> &participantDevice) {
qDebug() << "onParticipantDeviceAdded"; lDebug() << "onParticipantDeviceAdded";
qDebug() << "Me devices : " << conference->getMe()->getDevices().size(); lDebug() << "Me devices : " << conference->getMe()->getDevices().size();
if (conference->getMe()->getDevices().size() > 1) if (conference->getMe()->getDevices().size() > 1)
for (auto d : conference->getMe()->getDevices()) for (auto d : conference->getMe()->getDevices())
qDebug() << "\t--> " << d->getAddress()->asString().c_str(); lDebug() << "\t--> " << d->getAddress()->asString().c_str();
emit participantDeviceAdded(participantDevice); emit participantDeviceAdded(participantDevice);
} }
void ConferenceModel::onParticipantDeviceRemoved( void ConferenceModel::onParticipantDeviceRemoved(
const std::shared_ptr<linphone::Conference> &conference, const std::shared_ptr<linphone::Conference> &conference,
const std::shared_ptr<const linphone::ParticipantDevice> &participantDevice) { const std::shared_ptr<const linphone::ParticipantDevice> &participantDevice) {
qDebug() << "onParticipantDeviceRemoved: " << participantDevice->getAddress()->asString().c_str() << " isInConf?[" lDebug() << "onParticipantDeviceRemoved: " << participantDevice->getAddress()->asString().c_str() << " isInConf?["
<< participantDevice->isInConference() << "]"; << participantDevice->isInConference() << "]";
qDebug() << "Me devices : " << conference->getMe()->getDevices().size(); lDebug() << "Me devices : " << conference->getMe()->getDevices().size();
emit participantDeviceRemoved(participantDevice); emit participantDeviceRemoved(participantDevice);
} }
void ConferenceModel::onParticipantDeviceStateChanged(const std::shared_ptr<linphone::Conference> &conference, void ConferenceModel::onParticipantDeviceStateChanged(const std::shared_ptr<linphone::Conference> &conference,
const std::shared_ptr<const linphone::ParticipantDevice> &device, const std::shared_ptr<const linphone::ParticipantDevice> &device,
linphone::ParticipantDevice::State state) { linphone::ParticipantDevice::State state) {
qDebug() << "onParticipantDeviceStateChanged: " << device->getAddress()->asString().c_str() << " isInConf?[" lDebug() << "onParticipantDeviceStateChanged: " << device->getAddress()->asString().c_str() << " isInConf?["
<< device->isInConference() << "] " << (int)state; << device->isInConference() << "] " << (int)state;
emit participantDeviceStateChanged(conference, device, state); emit participantDeviceStateChanged(conference, device, state);
} }
void ConferenceModel::onParticipantAdminStatusChanged(const std::shared_ptr<linphone::Conference> &conference, void ConferenceModel::onParticipantAdminStatusChanged(const std::shared_ptr<linphone::Conference> &conference,
const std::shared_ptr<const linphone::Participant> &participant) { const std::shared_ptr<const linphone::Participant> &participant) {
qDebug() << "onParticipantAdminStatusChanged"; lDebug() << "onParticipantAdminStatusChanged";
emit participantAdminStatusChanged(participant); emit participantAdminStatusChanged(participant);
} }
void ConferenceModel::onParticipantDeviceMediaCapabilityChanged( void ConferenceModel::onParticipantDeviceMediaCapabilityChanged(
const std::shared_ptr<linphone::Conference> &conference, const std::shared_ptr<linphone::Conference> &conference,
const std::shared_ptr<const linphone::ParticipantDevice> &participantDevice) { const std::shared_ptr<const linphone::ParticipantDevice> &participantDevice) {
qDebug() << "onParticipantDeviceMediaCapabilityChanged: " lDebug() << "onParticipantDeviceMediaCapabilityChanged: "
<< (int)participantDevice->getStreamCapability(linphone::StreamType::Video) << (int)participantDevice->getStreamCapability(linphone::StreamType::Video)
<< ". Device: " << participantDevice->getAddress()->asString().c_str(); << ". Device: " << participantDevice->getAddress()->asString().c_str();
emit participantDeviceMediaCapabilityChanged(participantDevice); emit participantDeviceMediaCapabilityChanged(participantDevice);
@ -205,7 +185,7 @@ void ConferenceModel::onParticipantDeviceMediaCapabilityChanged(
void ConferenceModel::onParticipantDeviceMediaAvailabilityChanged( void ConferenceModel::onParticipantDeviceMediaAvailabilityChanged(
const std::shared_ptr<linphone::Conference> &conference, const std::shared_ptr<linphone::Conference> &conference,
const std::shared_ptr<const linphone::ParticipantDevice> &participantDevice) { const std::shared_ptr<const linphone::ParticipantDevice> &participantDevice) {
qDebug() << "onParticipantDeviceMediaAvailabilityChanged: " lDebug() << "onParticipantDeviceMediaAvailabilityChanged: "
<< (int)participantDevice->getStreamAvailability(linphone::StreamType::Video) << (int)participantDevice->getStreamAvailability(linphone::StreamType::Video)
<< ". Device: " << participantDevice->getAddress()->asString().c_str(); << ". Device: " << participantDevice->getAddress()->asString().c_str();
emit participantDeviceMediaAvailabilityChanged(participantDevice); emit participantDeviceMediaAvailabilityChanged(participantDevice);
@ -214,21 +194,21 @@ void ConferenceModel::onParticipantDeviceIsSpeakingChanged(
const std::shared_ptr<linphone::Conference> &conference, const std::shared_ptr<linphone::Conference> &conference,
const std::shared_ptr<const linphone::ParticipantDevice> &participantDevice, const std::shared_ptr<const linphone::ParticipantDevice> &participantDevice,
bool isSpeaking) { bool isSpeaking) {
// qDebug() << "onParticipantDeviceIsSpeakingChanged: " << participantDevice->getAddress()->asString().c_str() << // lDebug()<< "onParticipantDeviceIsSpeakingChanged: " << participantDevice->getAddress()->asString().c_str() <<
// ". Speaking:" << isSpeaking; // ". Speaking:" << isSpeaking;
emit participantDeviceIsSpeakingChanged(participantDevice, isSpeaking); emit participantDeviceIsSpeakingChanged(participantDevice, isSpeaking);
} }
void ConferenceModel::onStateChanged(const std::shared_ptr<linphone::Conference> &conference, void ConferenceModel::onStateChanged(const std::shared_ptr<linphone::Conference> &conference,
linphone::Conference::State newState) { linphone::Conference::State newState) {
qDebug() << "onStateChanged:" << (int)newState; lDebug() << "onStateChanged:" << (int)newState;
emit conferenceStateChanged(newState); emit conferenceStateChanged(newState);
} }
void ConferenceModel::onSubjectChanged(const std::shared_ptr<linphone::Conference> &conference, void ConferenceModel::onSubjectChanged(const std::shared_ptr<linphone::Conference> &conference,
const std::string &subject) { const std::string &subject) {
qDebug() << "onSubjectChanged"; lDebug() << "onSubjectChanged";
emit subjectChanged(subject); emit subjectChanged(subject);
} }
void ConferenceModel::onAudioDeviceChanged(const std::shared_ptr<linphone::Conference> &conference, void ConferenceModel::onAudioDeviceChanged(const std::shared_ptr<linphone::Conference> &conference,
const std::shared_ptr<const linphone::AudioDevice> &audioDevice) { const std::shared_ptr<const linphone::AudioDevice> &audioDevice) {
qDebug() << "onAudioDeviceChanged is not yet implemented."; lDebug() << "onAudioDeviceChanged is not yet implemented.";
} }

View file

@ -41,6 +41,7 @@ ConferenceSchedulerModel::~ConferenceSchedulerModel() {
} }
QString ConferenceSchedulerModel::getUri() { QString ConferenceSchedulerModel::getUri() {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
auto uriAddr = mMonitor->getInfo() ? mMonitor->getInfo()->getUri() : nullptr; auto uriAddr = mMonitor->getInfo() ? mMonitor->getInfo()->getUri() : nullptr;
if (uriAddr) { if (uriAddr) {
return Utils::coreStringToAppString(uriAddr->asString()); return Utils::coreStringToAppString(uriAddr->asString());
@ -48,10 +49,12 @@ QString ConferenceSchedulerModel::getUri() {
} }
void ConferenceSchedulerModel::setInfo(const std::shared_ptr<linphone::ConferenceInfo> &confInfo) { void ConferenceSchedulerModel::setInfo(const std::shared_ptr<linphone::ConferenceInfo> &confInfo) {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
mMonitor->setInfo(confInfo); mMonitor->setInfo(confInfo);
} }
void ConferenceSchedulerModel::cancelConference(const std::shared_ptr<linphone::ConferenceInfo> &confInfo) { void ConferenceSchedulerModel::cancelConference(const std::shared_ptr<linphone::ConferenceInfo> &confInfo) {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
mMonitor->cancelConference(confInfo); mMonitor->cancelConference(confInfo);
} }

View file

@ -65,7 +65,7 @@ void CoreModel::start() {
mIterateTimer->setInterval(30); mIterateTimer->setInterval(30);
connect(mIterateTimer, &QTimer::timeout, [this]() { connect(mIterateTimer, &QTimer::timeout, [this]() {
static int iterateCount = 0; static int iterateCount = 0;
if (iterateCount != 0) qCritical() << log().arg("Multi Iterate ! "); if (iterateCount != 0) lCritical() << log().arg("Multi Iterate ! ");
++iterateCount; ++iterateCount;
mCore->iterate(); mCore->iterate();
--iterateCount; --iterateCount;
@ -92,6 +92,7 @@ void CoreModel::start() {
mCore->start(); mCore->start();
setPathAfterStart(); setPathAfterStart();
mCore->enableFriendListSubscription(true); mCore->enableFriendListSubscription(true);
// TODO : get this from settings
auto videoPolicy = mCore->getVideoActivationPolicy()->clone(); auto videoPolicy = mCore->getVideoActivationPolicy()->clone();
videoPolicy->setAutomaticallyAccept(true); videoPolicy->setAutomaticallyAccept(true);
videoPolicy->setAutomaticallyInitiate(false); videoPolicy->setAutomaticallyInitiate(false);
@ -124,7 +125,7 @@ void CoreModel::setConfigPath(QString path) {
//------------------------------------------------------------------------------- //-------------------------------------------------------------------------------
#define SET_FACTORY_PATH(TYPE, PATH) \ #define SET_FACTORY_PATH(TYPE, PATH) \
do { \ do { \
qInfo() << QStringLiteral("[CoreModel] Set `%1` factory path: `%2`").arg(#TYPE).arg(PATH); \ lInfo() << QStringLiteral("[CoreModel] Set `%1` factory path: `%2`").arg(#TYPE).arg(PATH); \
factory->set##TYPE##Dir(Utils::appStringToCoreString(PATH)); \ factory->set##TYPE##Dir(Utils::appStringToCoreString(PATH)); \
} while (0); } while (0);
@ -147,16 +148,16 @@ void CoreModel::setPathAfterStart() {
if (mCore->getZrtpSecretsFile().empty() || if (mCore->getZrtpSecretsFile().empty() ||
!Paths::filePathExists(Utils::coreStringToAppString(mCore->getZrtpSecretsFile()), true)) !Paths::filePathExists(Utils::coreStringToAppString(mCore->getZrtpSecretsFile()), true))
mCore->setZrtpSecretsFile(Utils::appStringToCoreString(Paths::getZrtpSecretsFilePath())); mCore->setZrtpSecretsFile(Utils::appStringToCoreString(Paths::getZrtpSecretsFilePath()));
qInfo() << "[CoreModel] Using ZrtpSecrets path : " << QString::fromStdString(mCore->getZrtpSecretsFile()); lInfo() << "[CoreModel] Using ZrtpSecrets path : " << QString::fromStdString(mCore->getZrtpSecretsFile());
// Use application path if Linphone default is not available // Use application path if Linphone default is not available
if (mCore->getUserCertificatesPath().empty() || if (mCore->getUserCertificatesPath().empty() ||
!Paths::filePathExists(Utils::coreStringToAppString(mCore->getUserCertificatesPath()), true)) !Paths::filePathExists(Utils::coreStringToAppString(mCore->getUserCertificatesPath()), true))
mCore->setUserCertificatesPath(Utils::appStringToCoreString(Paths::getUserCertificatesDirPath())); mCore->setUserCertificatesPath(Utils::appStringToCoreString(Paths::getUserCertificatesDirPath()));
qInfo() << "[CoreModel] Using UserCertificate path : " << QString::fromStdString(mCore->getUserCertificatesPath()); lInfo() << "[CoreModel] Using UserCertificate path : " << QString::fromStdString(mCore->getUserCertificatesPath());
// Use application path if Linphone default is not available // Use application path if Linphone default is not available
if (mCore->getRootCa().empty() || !Paths::filePathExists(Utils::coreStringToAppString(mCore->getRootCa()))) if (mCore->getRootCa().empty() || !Paths::filePathExists(Utils::coreStringToAppString(mCore->getRootCa())))
mCore->setRootCa(Utils::appStringToCoreString(Paths::getRootCaFilePath())); mCore->setRootCa(Utils::appStringToCoreString(Paths::getRootCaFilePath()));
qInfo() << "[CoreModel] Using RootCa path : " << QString::fromStdString(mCore->getRootCa()); lInfo() << "[CoreModel] Using RootCa path : " << QString::fromStdString(mCore->getRootCa());
} }
//--------------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------------

View file

@ -36,65 +36,57 @@ ParticipantDeviceModel::~ParticipantDeviceModel() {
} }
QString ParticipantDeviceModel::getName() const { QString ParticipantDeviceModel::getName() const {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
return Utils::coreStringToAppString(mMonitor->getName()); return Utils::coreStringToAppString(mMonitor->getName());
} }
QString ParticipantDeviceModel::getDisplayName() const { QString ParticipantDeviceModel::getDisplayName() const {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
return Utils::coreStringToAppString(mMonitor->getAddress()->getDisplayName()); return Utils::coreStringToAppString(mMonitor->getAddress()->getDisplayName());
} }
int ParticipantDeviceModel::getSecurityLevel() const { int ParticipantDeviceModel::getSecurityLevel() const {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
return (int)mMonitor->getSecurityLevel(); return (int)mMonitor->getSecurityLevel();
} }
time_t ParticipantDeviceModel::getTimeOfJoining() const { time_t ParticipantDeviceModel::getTimeOfJoining() const {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
return mMonitor->getTimeOfJoining(); return mMonitor->getTimeOfJoining();
} }
QString ParticipantDeviceModel::getAddress() const { QString ParticipantDeviceModel::getAddress() const {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
return Utils::coreStringToAppString(mMonitor->getAddress()->asStringUriOnly()); return Utils::coreStringToAppString(mMonitor->getAddress()->asStringUriOnly());
} }
bool ParticipantDeviceModel::getPaused() const { bool ParticipantDeviceModel::getPaused() const {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
return !mMonitor->isInConference() || mMonitor->getState() == linphone::ParticipantDevice::State::OnHold; return !mMonitor->isInConference() || mMonitor->getState() == linphone::ParticipantDevice::State::OnHold;
} }
bool ParticipantDeviceModel::getIsSpeaking() const { bool ParticipantDeviceModel::getIsSpeaking() const {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
return mMonitor->getIsSpeaking(); return mMonitor->getIsSpeaking();
} }
bool ParticipantDeviceModel::getIsMuted() const { bool ParticipantDeviceModel::getIsMuted() const {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
return mMonitor->getIsMuted(); return mMonitor->getIsMuted();
} }
LinphoneEnums::ParticipantDeviceState ParticipantDeviceModel::getState() const { LinphoneEnums::ParticipantDeviceState ParticipantDeviceModel::getState() const {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
return LinphoneEnums::fromLinphone(mMonitor->getState()); return LinphoneEnums::fromLinphone(mMonitor->getState());
} }
bool ParticipantDeviceModel::isVideoEnabled() const { bool ParticipantDeviceModel::isVideoEnabled() const {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
return mMonitor->isInConference() && mMonitor->getStreamAvailability(linphone::StreamType::Video) && return mMonitor->isInConference() && mMonitor->getStreamAvailability(linphone::StreamType::Video) &&
(mMonitor->getStreamCapability(linphone::StreamType::Video) == linphone::MediaDirection::SendRecv || (mMonitor->getStreamCapability(linphone::StreamType::Video) == linphone::MediaDirection::SendRecv ||
mMonitor->getStreamCapability(linphone::StreamType::Video) == linphone::MediaDirection::SendOnly); mMonitor->getStreamCapability(linphone::StreamType::Video) == linphone::MediaDirection::SendOnly);
} }
// void ParticipantDeviceModel::updateIsLocal() {
// auto deviceAddress = mMonitor->getAddress();
// auto callAddress = mCall->getConferenceSharedModel()->getConference()->getMe()->getAddress();
// auto gruuAddress =
// CoreManager::getInstance()->getAccountSettingsModel()->findAccount(callAddress)->getContactAddress();
// setIsLocal(deviceAddress->equal(gruuAddress));
// }
// void ParticipantDeviceModel::onSecurityLevelChanged(std::shared_ptr<const linphone::Address> device) {
// if (!device || mMonitor && mMonitor->getAddress()->weakEqual(device)) emit securityLevelChanged();
// }
// void ParticipantDeviceModel::onCallStatusChanged() {
// if (mCall->getCall()->getState() == linphone::Call::State::StreamsRunning) {
// updateVideoEnabled();
// }
// }
//-------------------------------------------------------------------- //--------------------------------------------------------------------
void ParticipantDeviceModel::onIsSpeakingChanged(const std::shared_ptr<linphone::ParticipantDevice> &participantDevice, void ParticipantDeviceModel::onIsSpeakingChanged(const std::shared_ptr<linphone::ParticipantDevice> &participantDevice,
bool isSpeaking) { bool isSpeaking) {
@ -106,14 +98,14 @@ void ParticipantDeviceModel::onIsMuted(const std::shared_ptr<linphone::Participa
} }
void ParticipantDeviceModel::onStateChanged(const std::shared_ptr<linphone::ParticipantDevice> &participantDevice, void ParticipantDeviceModel::onStateChanged(const std::shared_ptr<linphone::ParticipantDevice> &participantDevice,
linphone::ParticipantDevice::State state) { linphone::ParticipantDevice::State state) {
qDebug() << log().arg(Q_FUNC_INFO) << participantDevice->getAddress()->asStringUriOnly() << (int)state; lDebug() << log().arg(Q_FUNC_INFO) << participantDevice->getAddress()->asStringUriOnly() << (int)state;
emit stateChanged(LinphoneEnums::fromLinphone(state)); emit stateChanged(LinphoneEnums::fromLinphone(state));
} }
void ParticipantDeviceModel::onStreamCapabilityChanged( void ParticipantDeviceModel::onStreamCapabilityChanged(
const std::shared_ptr<linphone::ParticipantDevice> &participantDevice, const std::shared_ptr<linphone::ParticipantDevice> &participantDevice,
linphone::MediaDirection direction, linphone::MediaDirection direction,
linphone::StreamType streamType) { linphone::StreamType streamType) {
qDebug() << log().arg(Q_FUNC_INFO) << participantDevice->getAddress()->asStringUriOnly() << (int)direction lDebug() << log().arg(Q_FUNC_INFO) << participantDevice->getAddress()->asStringUriOnly() << (int)direction
<< (int)streamType; << (int)streamType;
emit streamCapabilityChanged(streamType); emit streamCapabilityChanged(streamType);
} }
@ -121,7 +113,7 @@ void ParticipantDeviceModel::onStreamAvailabilityChanged(
const std::shared_ptr<linphone::ParticipantDevice> &participantDevice, const std::shared_ptr<linphone::ParticipantDevice> &participantDevice,
bool available, bool available,
linphone::StreamType streamType) { linphone::StreamType streamType) {
qDebug() << log().arg(Q_FUNC_INFO) << participantDevice->getAddress()->asStringUriOnly() << available lDebug() << log().arg(Q_FUNC_INFO) << participantDevice->getAddress()->asStringUriOnly() << available
<< (int)streamType; << (int)streamType;
emit streamAvailabilityChanged(streamType); emit streamAvailabilityChanged(streamType);
} }

View file

@ -105,7 +105,7 @@ bool ToolModel::createCall(const QString &sipAddress,
std::shared_ptr<linphone::Address> address = interpretUrl(sipAddress); std::shared_ptr<linphone::Address> address = interpretUrl(sipAddress);
if (!address) { if (!address) {
qCritical() << "[" + QString(gClassName) + "] The calling address is not an interpretable SIP address: " lCritical() << "[" + QString(gClassName) + "] The calling address is not an interpretable SIP address: "
<< sipAddress; << sipAddress;
if (errorMessage) { if (errorMessage) {
*errorMessage = tr("The calling address is not an interpretable SIP address : "); *errorMessage = tr("The calling address is not an interpretable SIP address : ");
@ -181,10 +181,9 @@ bool ToolModel::isMe(const QString &address) {
bool isMe = false; bool isMe = false;
auto linAddr = ToolModel::interpretUrl(address); auto linAddr = ToolModel::interpretUrl(address);
if (!CoreModel::getInstance()->getCore()->getDefaultAccount()) { if (!CoreModel::getInstance()->getCore()->getDefaultAccount()) {
// for (auto &account : CoreModel::getInstance()->getCore()->getAccountList()) { for (auto &account : CoreModel::getInstance()->getCore()->getAccountList()) {
// if (account->getContactAddress()->weakEqual(linAddr)) return true; if (account->getContactAddress()->weakEqual(linAddr)) return true;
// } }
isMe = false;
} else { } else {
auto accountAddr = CoreModel::getInstance()->getCore()->getDefaultAccount()->getContactAddress(); auto accountAddr = CoreModel::getInstance()->getCore()->getDefaultAccount()->getContactAddress();
isMe = linAddr && accountAddr ? accountAddr->weakEqual(linAddr) : false; isMe = linAddr && accountAddr ? accountAddr->weakEqual(linAddr) : false;
@ -192,6 +191,16 @@ bool ToolModel::isMe(const QString &address) {
return isMe; return isMe;
} }
bool ToolModel::isLocal(const QString &address) {
auto linAddr = ToolModel::interpretUrl(address);
if (!CoreModel::getInstance()->getCore()->getDefaultAccount()) {
return false;
} else {
auto accountAddr = CoreModel::getInstance()->getCore()->getDefaultAccount()->getContactAddress();
return linAddr && accountAddr ? accountAddr->weakEqual(linAddr) : false;
}
}
bool ToolModel::isMe(const std::shared_ptr<const linphone::Address> &address) { bool ToolModel::isMe(const std::shared_ptr<const linphone::Address> &address) {
auto currentAccount = CoreModel::getInstance()->getCore()->getDefaultAccount(); auto currentAccount = CoreModel::getInstance()->getCore()->getDefaultAccount();
if (!currentAccount) { // Default account is selected : Me is all local accounts. if (!currentAccount) { // Default account is selected : Me is all local accounts.

View file

@ -39,6 +39,7 @@ public:
static std::shared_ptr<linphone::AudioDevice> findAudioDevice(const QString &id); static std::shared_ptr<linphone::AudioDevice> findAudioDevice(const QString &id);
static std::shared_ptr<linphone::Account> findAccount(const std::shared_ptr<const linphone::Address> &address); static std::shared_ptr<linphone::Account> findAccount(const std::shared_ptr<const linphone::Address> &address);
static bool isMe(const QString &address); static bool isMe(const QString &address);
static bool isLocal(const QString &address);
static bool isMe(const std::shared_ptr<const linphone::Address> &address); static bool isMe(const std::shared_ptr<const linphone::Address> &address);
static bool isLocal(const std::shared_ptr<linphone::Conference> &conference, static bool isLocal(const std::shared_ptr<linphone::Conference> &conference,
const std::shared_ptr<const linphone::ParticipantDevice> &device); const std::shared_ptr<const linphone::ParticipantDevice> &device);

View file

@ -109,6 +109,8 @@ void Utils::createCall(const QString &sipAddress,
}); });
} }
// TODO : change conf info only from qml
// (bug si on est déjà en appel et qu'on lance une conf)
void Utils::setupConference(ConferenceInfoGui *confGui) { void Utils::setupConference(ConferenceInfoGui *confGui) {
if (!confGui) return; if (!confGui) return;
auto window = App::getInstance()->getCallsWindow(QVariant()); auto window = App::getInstance()->getCallsWindow(QVariant());
@ -120,15 +122,6 @@ void Utils::openCallsWindow(CallGui *call) {
if (call) App::getInstance()->getCallsWindow(QVariant::fromValue(call))->show(); if (call) App::getInstance()->getCallsWindow(QVariant::fromValue(call))->show();
} }
void Utils::setCallsWindowCall(CallGui *call) {
if (call) App::getInstance()->setCallsWindowProperty("call", QVariant::fromValue(call));
}
void Utils::setCallsWindowProperty(const QString &id, const QVariant &property) {
const char *idChar = id.toLocal8Bit().data();
App::getInstance()->setCallsWindowProperty(idChar, property);
}
QQuickWindow *Utils::getCallsWindow(CallGui *callGui) { QQuickWindow *Utils::getCallsWindow(CallGui *callGui) {
auto app = App::getInstance(); auto app = App::getInstance();
auto window = app->getCallsWindow(QVariant::fromValue(callGui)); auto window = app->getCallsWindow(QVariant::fromValue(callGui));
@ -1193,6 +1186,11 @@ bool Utils::isMe(const QString &address) {
App::postModelSync([&isMe, address]() { isMe = ToolModel::isMe(address); }); App::postModelSync([&isMe, address]() { isMe = ToolModel::isMe(address); });
return isMe; return isMe;
} }
bool Utils::isLocal(const QString &address) {
bool isLocal = false;
App::postModelSync([&isLocal, address]() { isLocal = ToolModel::isLocal(address); });
return isLocal;
}
// 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) {

View file

@ -64,8 +64,6 @@ public:
const QHash<QString, QString> &headers = {}); const QHash<QString, QString> &headers = {});
Q_INVOKABLE static void openCallsWindow(CallGui *call); Q_INVOKABLE static void openCallsWindow(CallGui *call);
Q_INVOKABLE static void setupConference(ConferenceInfoGui *confGui); Q_INVOKABLE static void setupConference(ConferenceInfoGui *confGui);
Q_INVOKABLE static void setCallsWindowCall(CallGui *call);
Q_INVOKABLE static void setCallsWindowProperty(const QString &id, const QVariant &property);
Q_INVOKABLE static QQuickWindow *getMainWindow(); Q_INVOKABLE static QQuickWindow *getMainWindow();
Q_INVOKABLE static void showInformationPopup(const QString &title, Q_INVOKABLE static void showInformationPopup(const QString &title,
const QString &description, const QString &description,
@ -104,6 +102,7 @@ public:
Q_INVOKABLE static QString findAvatarByAddress(const QString &address); Q_INVOKABLE static QString findAvatarByAddress(const QString &address);
static QString generateSavedFilename(const QString &from, const QString &to); static QString generateSavedFilename(const QString &from, const QString &to);
Q_INVOKABLE static bool isMe(const QString &address); Q_INVOKABLE static bool isMe(const QString &address);
Q_INVOKABLE static bool isLocal(const QString &address);
static QString getCountryName(const QLocale::Territory &p_country); static QString getCountryName(const QLocale::Territory &p_country);
static QString getApplicationProduct(); static QString getApplicationProduct();

View file

@ -31,6 +31,7 @@
#include "ImageProvider.hpp" #include "ImageProvider.hpp"
#include "tool/Constants.hpp" #include "tool/Constants.hpp"
#include "tool/Utils.hpp"
// ============================================================================= // =============================================================================
@ -48,7 +49,7 @@ ImageAsyncImageResponse::ImageAsyncImageResponse(const QString &id, const QSize
filters << "*.png"; filters << "*.png";
QDir imageDir(path); QDir imageDir(path);
if (!imageDir.exists()) { if (!imageDir.exists()) {
qDebug() << QStringLiteral("[ImageProvider] Dir doesn't exist: `%1`.").arg(path); lDebug() << QStringLiteral("[ImageProvider] Dir doesn't exist: `%1`.").arg(path);
emit imageGrabbed(QImage(":/data/image/warning-circle.svg")); emit imageGrabbed(QImage(":/data/image/warning-circle.svg"));
return; return;
} }
@ -65,7 +66,7 @@ ImageAsyncImageResponse::ImageAsyncImageResponse(const QString &id, const QSize
QFile file(mPath); QFile file(mPath);
if (!file.exists()) { if (!file.exists()) {
qDebug() << QStringLiteral("[ImageProvider] File doesn't exist: `%1`.").arg(path + id); lDebug() << QStringLiteral("[ImageProvider] File doesn't exist: `%1`.").arg(path + id);
emit imageGrabbed(QImage(":/data/image/warning-circle.svg")); emit imageGrabbed(QImage(":/data/image/warning-circle.svg"));
return; return;
} }

View file

@ -23,6 +23,7 @@
#include "SafeSharedPointer.hpp" #include "SafeSharedPointer.hpp"
#include "model/core/CoreModel.hpp" #include "model/core/CoreModel.hpp"
#include "tool/Utils.hpp"
#include <QMutex> #include <QMutex>
#include <QObject> #include <QObject>
@ -74,7 +75,7 @@ public:
~SafeConnection() { ~SafeConnection() {
mLocker.lock(); mLocker.lock();
if (mCore.mCountRef != 0 || mModel.mCountRef != 0) if (mCore.mCountRef != 0 || mModel.mCountRef != 0)
qCritical() << "[SafeConnection] Destruction while still having references. CoreRef=" << mCore.mCountRef lCritical() << "[SafeConnection] Destruction while still having references. CoreRef=" << mCore.mCountRef
<< "ModelRef=" << mModel.mCountRef; << "ModelRef=" << mModel.mCountRef;
mCore.reset(); mCore.reset();
mModel.reset(); mModel.reset();

View file

@ -40,7 +40,7 @@ bool Thread::isInLinphoneThread() {
bool Thread::mustBeInLinphoneThread(const QString &context) { bool Thread::mustBeInLinphoneThread(const QString &context) {
bool isLinphoneThread = isInLinphoneThread(); bool isLinphoneThread = isInLinphoneThread();
if (!isLinphoneThread) { // Bracket to easier debugging. if (!isLinphoneThread) { // Bracket to easier debugging.
qCritical() << "[Thread] Not processing in Linphone thread from " << context; lCritical() << "[Thread] Not processing in Linphone thread from " << context;
} }
return isLinphoneThread; return isLinphoneThread;
} }
@ -49,7 +49,7 @@ bool Thread::mustBeInMainThread(const QString &context) {
if (!qApp) return true; if (!qApp) return true;
bool isMainThread = QThread::currentThread() == qApp->thread(); bool isMainThread = QThread::currentThread() == qApp->thread();
if (!isMainThread) { if (!isMainThread) {
qCritical() << "[Thread] Not processing in Main thread from " << context; lCritical() << "[Thread] Not processing in Main thread from " << context;
} }
return isMainThread; return isMainThread;
} }

View file

@ -18,14 +18,12 @@ Window {
property ConferenceInfoGui conferenceInfo property ConferenceInfoGui conferenceInfo
property ConferenceGui conference: call && call.core.conference || null property ConferenceGui conference: call && call.core.conference || null
onConferenceChanged: console.log ("CONFERENCE CHANGED", conference)
property int conferenceLayout: call && call.core.conferenceVideoLayout || 0 property int conferenceLayout: call && call.core.conferenceVideoLayout || 0
property bool callTerminatedByUser: false property bool callTerminatedByUser: false
onCallChanged: { onCallChanged: {
console.log("CALL", call)
// if conference, the main item is only // if conference, the main item is only
// displayed when state is connected // displayed when state is connected
if (call && middleItemStackView.currentItem != inCallItem if (call && middleItemStackView.currentItem != inCallItem
@ -59,12 +57,12 @@ Window {
property int nextY: mainWindow.height property int nextY: mainWindow.height
property list<Popup> popupList property list<Popup> popupList
property int popupCount: popupList.length property int popupCount: popupList.length
spacing: 15 spacing: 15 * DefaultStyle.dp
onPopupCountChanged: { onPopupCountChanged: {
nextY = mainWindow.height nextY = mainWindow.height
for(var i = 0; i < popupCount; ++i) { for(var i = 0; i < popupCount; ++i) {
popupList[i].y = nextY - popupList[i].height popupList[i].y = nextY - popupList[i].height
nextY = nextY - popupList[i].height - 15 nextY = nextY - popupList[i].height - 15 * DefaultStyle.dp
} }
} }
} }
@ -83,7 +81,7 @@ Window {
} }
Connections { Connections {
enabled: call != undefined && call != null enabled: !!call
target: call && call.core target: call && call.core
onRemoteVideoEnabledChanged: console.log("remote video enabled", call.core.remoteVideoEnabled) onRemoteVideoEnabledChanged: console.log("remote video enabled", call.core.remoteVideoEnabled)
onSecurityUpdated: { onSecurityUpdated: {
@ -99,7 +97,6 @@ Window {
property var callState: call && call.core.state property var callState: call && call.core.state
onCallStateChanged: { onCallStateChanged: {
console.log("State:", callState)
if (callState === LinphoneEnums.CallState.Connected) { if (callState === LinphoneEnums.CallState.Connected) {
if (conferenceInfo && middleItemStackView.currentItem != inCallItem) { if (conferenceInfo && middleItemStackView.currentItem != inCallItem) {
middleItemStackView.replace(inCallItem) middleItemStackView.replace(inCallItem)
@ -163,7 +160,6 @@ Window {
CallProxy{ CallProxy{
id: callsModel id: callsModel
onCurrentCallChanged: { onCurrentCallChanged: {
console.log("Current call changed:"+currentCall)
if(currentCall) { if(currentCall) {
mainWindow.call = currentCall mainWindow.call = currentCall
} }
@ -217,6 +213,7 @@ Window {
underlineColor: DefaultStyle.main1_500_main underlineColor: DefaultStyle.main1_500_main
radius: 15 * DefaultStyle.dp radius: 15 * DefaultStyle.dp
contentItem: ColumnLayout { contentItem: ColumnLayout {
spacing: 0
BusyIndicator{ BusyIndicator{
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
} }
@ -245,6 +242,7 @@ Window {
underlineColor: DefaultStyle.danger_500main underlineColor: DefaultStyle.danger_500main
radius: 0 radius: 0
contentItem: ColumnLayout { contentItem: ColumnLayout {
spacing: 0
Text { Text {
text: qsTr("Erreur de transfert") text: qsTr("Erreur de transfert")
} }
@ -346,6 +344,7 @@ Window {
} }
RowLayout { RowLayout {
visible: mainWindow.call && (mainWindow.call.core.recording || mainWindow.call.core.remoteRecording) visible: mainWindow.call && (mainWindow.call.core.recording || mainWindow.call.core.remoteRecording)
spacing: 0
Text { Text {
color: DefaultStyle.danger_500main color: DefaultStyle.danger_500main
font.pixelSize: 14 * DefaultStyle.dp font.pixelSize: 14 * DefaultStyle.dp
@ -378,6 +377,7 @@ Window {
radius: 15 * DefaultStyle.dp radius: 15 * DefaultStyle.dp
} }
contentItem: RowLayout { contentItem: RowLayout {
spacing: 0
Image { Image {
source: AppIcons.trusted source: AppIcons.trusted
Layout.preferredWidth: 24 * DefaultStyle.dp Layout.preferredWidth: 24 * DefaultStyle.dp
@ -400,20 +400,21 @@ Window {
RowLayout { RowLayout {
Layout.fillWidth: true Layout.fillWidth: true
Layout.fillHeight: true Layout.fillHeight: true
spacing: 0
Control.StackView { Control.StackView {
id: middleItemStackView id: middleItemStackView
initialItem: mainWindow.call ? inCallItem : waitingRoom initialItem: mainWindow.call ? inCallItem : waitingRoom
Layout.fillWidth: true Layout.fillWidth: true
Layout.fillHeight: true Layout.fillHeight: true
Layout.margins: 20 * DefaultStyle.dp
} }
OngoingCallRightPanel { OngoingCallRightPanel {
id: rightPanel id: rightPanel
Layout.fillHeight: true Layout.fillHeight: true
Layout.preferredWidth: 393 * DefaultStyle.dp Layout.preferredWidth: 393 * DefaultStyle.dp
Layout.topMargin: 10 * DefaultStyle.dp
Layout.rightMargin: 20 * DefaultStyle.dp // !! Design model is inconsistent
property int currentIndex: 0 property int currentIndex: 0
Layout.rightMargin: 10 * DefaultStyle.dp
visible: false visible: false
function replace(id) { function replace(id) {
rightPanel.customHeaderButtons = null rightPanel.customHeaderButtons = null
@ -439,6 +440,7 @@ Window {
id: dialerPanel id: dialerPanel
ColumnLayout { ColumnLayout {
Control.StackView.onActivated: rightPanel.headerTitleText = qsTr("Dialer") Control.StackView.onActivated: rightPanel.headerTitleText = qsTr("Dialer")
spacing: 0
Item { Item {
Layout.fillWidth: true Layout.fillWidth: true
Layout.fillHeight: true Layout.fillHeight: true
@ -485,6 +487,7 @@ Window {
RoundedBackgroundControl { RoundedBackgroundControl {
Layout.fillWidth: true Layout.fillWidth: true
contentItem: ColumnLayout { contentItem: ColumnLayout {
spacing: 0
Repeater { Repeater {
model: [ model: [
{text: qsTr("Mosaïque"), imgUrl: AppIcons.squaresFour}, {text: qsTr("Mosaïque"), imgUrl: AppIcons.squaresFour},
@ -534,6 +537,7 @@ Window {
id: callsListPanel id: callsListPanel
ColumnLayout { ColumnLayout {
Control.StackView.onActivated: rightPanel.headerTitleText = qsTr("Liste d'appel") Control.StackView.onActivated: rightPanel.headerTitleText = qsTr("Liste d'appel")
spacing: 0
RoundedBackgroundControl { RoundedBackgroundControl {
Layout.fillWidth: true Layout.fillWidth: true
Layout.maximumHeight: rightPanel.height Layout.maximumHeight: rightPanel.height
@ -557,6 +561,7 @@ Window {
anchors.fill: parent anchors.fill: parent
anchors.leftMargin: 10 * DefaultStyle.dp anchors.leftMargin: 10 * DefaultStyle.dp
anchors.rightMargin: 10 * DefaultStyle.dp anchors.rightMargin: 10 * DefaultStyle.dp
spacing: 0
Avatar { Avatar {
id: delegateAvatar id: delegateAvatar
address: modelData.core.peerAddress address: modelData.core.peerAddress
@ -588,10 +593,11 @@ Window {
Layout.alignment: Qt.AlignRight Layout.alignment: Qt.AlignRight
popup.contentItem: ColumnLayout { popup.contentItem: ColumnLayout {
// spacing: 0 spacing: 0
Button { Button {
background: Item {} background: Item {}
contentItem: RowLayout { contentItem: RowLayout {
spacing: 0
Image { Image {
source: modelData.core.state === LinphoneEnums.CallState.Paused source: modelData.core.state === LinphoneEnums.CallState.Paused
|| modelData.core.state === LinphoneEnums.CallState.PausedByRemote || modelData.core.state === LinphoneEnums.CallState.PausedByRemote
@ -622,6 +628,7 @@ Window {
Button { Button {
background: Item {} background: Item {}
contentItem: RowLayout { contentItem: RowLayout {
spacing: 0
EffectImage { EffectImage {
imageSource: AppIcons.endCall imageSource: AppIcons.endCall
colorizationColor: DefaultStyle.danger_500main colorizationColor: DefaultStyle.danger_500main
@ -641,13 +648,6 @@ Window {
} }
} }
} }
// MouseArea{
// anchors.fill: delegateLayout
// onClicked: {
// callsModel.currentCall = modelData
// }
// }
} }
} }
} }
@ -695,6 +695,7 @@ Window {
popup.contentItem: Button { popup.contentItem: Button {
background: Item{} background: Item{}
contentItem: RowLayout { contentItem: RowLayout {
spacing: 0
EffectImage { EffectImage {
colorizationColor: DefaultStyle.main2_600 colorizationColor: DefaultStyle.main2_600
imageSource: AppIcons.shareNetwork imageSource: AppIcons.shareNetwork
@ -794,32 +795,20 @@ Window {
Component { Component {
id: inCallItem id: inCallItem
Item { Item {
Layout.fillWidth: true
implicitWidth: 1059 * DefaultStyle.dp
// implicitHeight: parent.height
Layout.fillHeight: true
Layout.leftMargin: 10 * DefaultStyle.dp
Layout.rightMargin: 10 * DefaultStyle.dp
Layout.alignment: Qt.AlignCenter
/*
background: Rectangle {
anchors.fill: parent
color: DefaultStyle.grey_600
radius: 15 * DefaultStyle.dp
}*/
CallLayout{ CallLayout{
anchors.fill: parent anchors.fill: parent
anchors.leftMargin: 20 * DefaultStyle.dp
anchors.rightMargin: (rightPanel.visible ? 0 : 10) * DefaultStyle.dp // Grid and AS have 10 in right margin (so apply -10 here)
anchors.topMargin: 10 * DefaultStyle.dp
call: mainWindow.call call: mainWindow.call
callTerminatedByUser: mainWindow.callTerminatedByUser callTerminatedByUser: mainWindow.callTerminatedByUser
} }
Component.onCompleted: console.log("New inCallItem " + inCallItem)
} }
} }
RowLayout { RowLayout {
id: bottomButtonsLayout id: bottomButtonsLayout
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
spacing: 20 * DefaultStyle.dp spacing: 58 * DefaultStyle.dp
visible: mainWindow.call && !mainWindow.conferenceInfo visible: mainWindow.call && !mainWindow.conferenceInfo
function refreshLayout() { function refreshLayout() {
@ -875,6 +864,7 @@ Window {
visible: false visible: false
Layout.row: 0 Layout.row: 0
Layout.column: 1 Layout.column: 1
spacing: 10 * DefaultStyle.dp
CheckableButton { CheckableButton {
id: pauseButton id: pauseButton
Layout.preferredWidth: 55 * DefaultStyle.dp Layout.preferredWidth: 55 * DefaultStyle.dp
@ -943,6 +933,7 @@ Window {
|| mainWindow.callState == LinphoneEnums.CallState.OutgoingEarlyMedia || mainWindow.callState == LinphoneEnums.CallState.OutgoingEarlyMedia
|| mainWindow.callState == LinphoneEnums.CallState.IncomingReceived || mainWindow.callState == LinphoneEnums.CallState.IncomingReceived
? bottomButtonsLayout.columns - 1 : 0 ? bottomButtonsLayout.columns - 1 : 0
spacing: 10 * DefaultStyle.dp
CheckableButton { CheckableButton {
id: videoCameraButton id: videoCameraButton
enabled: mainWindow.conferenceInfo || (mainWindow.callState === LinphoneEnums.CallState.Connected || mainWindow.callState === LinphoneEnums.CallState.StreamsRunning) enabled: mainWindow.conferenceInfo || (mainWindow.callState === LinphoneEnums.CallState.Connected || mainWindow.callState === LinphoneEnums.CallState.StreamsRunning)
@ -1021,7 +1012,6 @@ Window {
id: moreOptionsButton id: moreOptionsButton
Layout.preferredWidth: 55 * DefaultStyle.dp Layout.preferredWidth: 55 * DefaultStyle.dp
Layout.preferredHeight: 55 * DefaultStyle.dp Layout.preferredHeight: 55 * DefaultStyle.dp
onEnabledChanged: console.log("========== enabled changed", enabled)
contentImageColor: enabled && !checked ? DefaultStyle.grey_0 : DefaultStyle.grey_500 contentImageColor: enabled && !checked ? DefaultStyle.grey_0 : DefaultStyle.grey_500
icon.source: AppIcons.more icon.source: AppIcons.more
background: Rectangle { background: Rectangle {
@ -1037,7 +1027,6 @@ Window {
Connections { Connections {
target: moreOptionsButton.popup target: moreOptionsButton.popup
onOpened: { onOpened: {
console.log("y", moreOptionsButton.y, moreOptionsButton.popup.y, moreOptionsButton.popup.height)
moreOptionsButton.popup.y = - moreOptionsButton.popup.height - moreOptionsButton.popup.padding moreOptionsButton.popup.y = - moreOptionsButton.popup.height - moreOptionsButton.popup.padding
} }
} }

View file

@ -227,8 +227,6 @@ Item {
contentItem: Image { contentItem: Image {
anchors.fill: parent anchors.fill: parent
width: 24 * DefaultStyle.dp
height: 24 * DefaultStyle.dp
source: AppIcons.phone source: AppIcons.phone
} }
onClicked: { onClicked: {
@ -241,8 +239,6 @@ Item {
background: Item{} background: Item{}
contentItem: Image { contentItem: Image {
anchors.fill: parent anchors.fill: parent
width: 24 * DefaultStyle.dp
height: 24 * DefaultStyle.dp
source: AppIcons.videoCamera source: AppIcons.videoCamera
} }
onClicked: UtilsCpp.createCall(sipAddr.text, {'localVideoEnabled':true}) onClicked: UtilsCpp.createCall(sipAddr.text, {'localVideoEnabled':true})
@ -361,8 +357,6 @@ Item {
StackLayout { StackLayout {
id: mainStackLayout id: mainStackLayout
currentIndex: tabbar.currentIndex currentIndex: tabbar.currentIndex
Layout.fillWidth: true
Layout.fillHeight: true
Layout.topMargin: 24 * DefaultStyle.dp Layout.topMargin: 24 * DefaultStyle.dp
CallPage { CallPage {
id: callPage id: callPage

View file

@ -9,7 +9,6 @@ list(APPEND _LINPHONEAPP_QML_FILES
view/Layout/Call/CallLayout.qml view/Layout/Call/CallLayout.qml
view/Layout/Call/GridLayout.qml view/Layout/Call/GridLayout.qml
view/Layout/Conference/IncallGrid.qml
view/Layout/Contact/ContactLayout.qml view/Layout/Contact/ContactLayout.qml
view/Layout/Meeting/AddParticipantsLayout.qml view/Layout/Meeting/AddParticipantsLayout.qml

View file

@ -7,6 +7,8 @@ import Linphone
Item { Item {
id: mainItem id: mainItem
property color indicatorColor: DefaultStyle.main1_500_main property color indicatorColor: DefaultStyle.main1_500_main
property alias indicatorHeight: busyIndicator.height
property alias indicatorWidth: busyIndicator.width
width: busyIndicator.width width: busyIndicator.width
height: busyIndicator.height height: busyIndicator.height
Control.BusyIndicator { Control.BusyIndicator {

View file

@ -7,6 +7,7 @@ import Linphone
import ConstantsCpp 1.0 import ConstantsCpp 1.0
import UtilsCpp 1.0 import UtilsCpp 1.0
// TODO : spacing
ListView { ListView {
id: mainItem id: mainItem
// width: 400 * DefaultStyle.dp // width: 400 * DefaultStyle.dp
@ -16,8 +17,6 @@ ListView {
clip: true clip: true
property int maxYears: 5 property int maxYears: 5
readonly property var currentDate: new Date() readonly property var currentDate: new Date()
Layout.fillWidth: true
Layout.fillHeight: true
highlightMoveDuration: 100 highlightMoveDuration: 100
property var selectedDate property var selectedDate
@ -25,6 +24,7 @@ ListView {
model: Control.CalendarModel { model: Control.CalendarModel {
id: calendarModel id: calendarModel
from: new Date() from: new Date()
// TODO : dynamically add 5 years
to: new Date(2025, 12, 31) to: new Date(2025, 12, 31)
} }
@ -34,6 +34,7 @@ ListView {
RowLayout { RowLayout {
Layout.fillWidth: true Layout.fillWidth: true
Text { Text {
// TODO (high prio): don't use javascript, C++
text: new Date(model.year, model.month, 15).toLocaleString(Qt.locale(ConstantsCpp.DefaultLocale), 'MMMM yyyy')// 15 because of timezones that can change the date for localeString text: new Date(model.year, model.month, 15).toLocaleString(Qt.locale(ConstantsCpp.DefaultLocale), 'MMMM yyyy')// 15 because of timezones that can change the date for localeString
font { font {
pixelSize: 14 * DefaultStyle.dp pixelSize: 14 * DefaultStyle.dp

View file

@ -31,8 +31,9 @@ Item {
topPadding: 20 * DefaultStyle.dp topPadding: 20 * DefaultStyle.dp
bottomPadding: 25 * DefaultStyle.dp bottomPadding: 25 * DefaultStyle.dp
contentItem: ColumnLayout { contentItem: ColumnLayout {
spacing: 10 * DefaultStyle.dp spacing: 16 * DefaultStyle.dp
RowLayout { RowLayout {
spacing: 0
Text { Text {
text: qsTr("Which channel do you choose?") text: qsTr("Which channel do you choose?")
font { font {
@ -44,6 +45,7 @@ Item {
Button { Button {
Layout.preferredWidth: 24 * DefaultStyle.dp Layout.preferredWidth: 24 * DefaultStyle.dp
Layout.preferredHeight: 24 * DefaultStyle.dp Layout.preferredHeight: 24 * DefaultStyle.dp
Layout.alignment: Qt.AlignVCenter
background: Item{} background: Item{}
icon.source:AppIcons.closeX icon.source:AppIcons.closeX
width: 24 * DefaultStyle.dp width: 24 * DefaultStyle.dp
@ -64,6 +66,7 @@ Item {
} }
Layout.fillWidth: true Layout.fillWidth: true
Layout.preferredHeight: contentHeight Layout.preferredHeight: contentHeight
spacing: 10 * DefaultStyle.dp
delegate: Item { delegate: Item {
width: parent.width width: parent.width
height: 56 * DefaultStyle.dp height: 56 * DefaultStyle.dp
@ -72,9 +75,10 @@ Item {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
spacing: 10 * DefaultStyle.dp spacing: 10 * DefaultStyle.dp
ColumnLayout { ColumnLayout {
spacing: 7 * DefaultStyle.dp
Text { Text {
Layout.leftMargin: 5 * DefaultStyle.dp Layout.leftMargin: 5 * DefaultStyle.dp
text: modelData.label text: modelData.label + " :"
font { font {
pixelSize: 13 * DefaultStyle.dp pixelSize: 13 * DefaultStyle.dp
weight: 700 * DefaultStyle.dp weight: 700 * DefaultStyle.dp
@ -138,19 +142,16 @@ Item {
active: true active: true
interactive: true interactive: true
policy: Control.ScrollBar.AsNeeded policy: Control.ScrollBar.AsNeeded
// Layout.fillWidth: true
anchors.top: parent.top anchors.top: parent.top
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
anchors.right: parent.right anchors.right: parent.right
anchors.rightMargin: 8 * DefaultStyle.dp anchors.rightMargin: 8 * DefaultStyle.dp
// x: mainItem.x + mainItem.width - width
// anchors.left: control.right
} }
ColumnLayout { ColumnLayout {
id: content id: content
width: parent.width width: parent.width
spacing: 25 * DefaultStyle.dp spacing: 32 * DefaultStyle.dp
Button { Button {
visible: mainItem.groupCallVisible visible: mainItem.groupCallVisible
Layout.preferredWidth: 320 * DefaultStyle.dp Layout.preferredWidth: 320 * DefaultStyle.dp
@ -165,6 +166,7 @@ Item {
radius: 50 * DefaultStyle.dp radius: 50 * DefaultStyle.dp
} }
contentItem: RowLayout { contentItem: RowLayout {
spacing: 16 * DefaultStyle.dp
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
Image { Image {
source: AppIcons.groupCall source: AppIcons.groupCall
@ -191,35 +193,8 @@ Item {
} }
onClicked: mainItem.groupCallCreationRequested() onClicked: mainItem.groupCallCreationRequested()
} }
// RowLayout {
// //DEBUG
// visible: searchBar.text.length > 0
// Layout.maximumWidth: parent.width
// Layout.fillWidth: true
// Text {
// text: searchBar.text
// maximumLineCount: 1
// elide: Text.ElideRight
// }
// Item {
// Layout.fillWidth: true
// }
// Button {
// implicitWidth: 30 * DefaultStyle.dp
// implicitHeight: 30 * DefaultStyle.dp
// background: Item {
// visible: false
// }
// icon.source: AppIcons.phone
// width: 20 * DefaultStyle.dp
// height: 20 * DefaultStyle.dp
// onClicked: {
// mainItem.callButtonPressed(searchBar.text)
// }
// }
// }
ColumnLayout { ColumnLayout {
spacing: 18 * DefaultStyle.dp
Text { Text {
text: qsTr("All contacts") text: qsTr("All contacts")
font { font {
@ -247,18 +222,10 @@ Item {
} }
} }
} }
// onContactSelected: (contact) => {
// if (contact.core.allAddresses.length > 1) {
// startCallPopup.contact = contact
// startCallPopup.open()
// } else {
// mainItem.callButtonPressed(contact.core.defaultAddress)
// }
// }
} }
} }
ColumnLayout { ColumnLayout {
spacing: 18 * DefaultStyle.dp
Text { Text {
text: qsTr("Suggestions") text: qsTr("Suggestions")
font { font {
@ -295,20 +262,6 @@ Item {
} }
} }
} }
// onContactSelected: (contact) => {
// if (contact.core.allAddresses.length > 1) {
// startCallPopup.contact = contact
// startCallPopup.open()
// } else {
// var addressToCall = contact.core.defaultAddress.length === 0
// ? contact.core.phoneNumbers.length === 0
// ? ""
// : contact.core.phoneNumbers[0].address
// : contact.core.defaultAddress
// if (addressToCall.length != 0) mainItem.callButtonPressed(addressToCall)
// }
// }
} }
} }
Item { Item {

View file

@ -27,10 +27,11 @@ ColumnLayout {
leftPadding: 25 * DefaultStyle.dp leftPadding: 25 * DefaultStyle.dp
rightPadding: 25 * DefaultStyle.dp rightPadding: 25 * DefaultStyle.dp
contentItem: ColumnLayout { contentItem: ColumnLayout {
spacing: 10 * DefaultStyle.dp spacing: 40 * DefaultStyle.dp
ColumnLayout {
spacing: 12 * DefaultStyle.dp
RowLayout { RowLayout {
Layout.fillWidth: true spacing: 8 * DefaultStyle.dp
EffectImage { EffectImage {
imageSource: AppIcons.speaker imageSource: AppIcons.speaker
colorizationColor: DefaultStyle.main1_500_main colorizationColor: DefaultStyle.main1_500_main
@ -64,8 +65,11 @@ ColumnLayout {
if (mainItem.call) mainItem.call.core.lSetSpeakerVolumeGain(value) if (mainItem.call) mainItem.call.core.lSetSpeakerVolumeGain(value)
} }
} }
}
ColumnLayout {
spacing: 12 * DefaultStyle.dp
RowLayout { RowLayout {
Layout.fillWidth: true spacing: 8 * DefaultStyle.dp
EffectImage { EffectImage {
imageSource: AppIcons.microphone imageSource: AppIcons.microphone
colorizationColor: DefaultStyle.main1_500_main colorizationColor: DefaultStyle.main1_500_main
@ -134,8 +138,11 @@ ColumnLayout {
} }
handle: Item {visible: false} handle: Item {visible: false}
} }
}
ColumnLayout {
spacing: 12 * DefaultStyle.dp
RowLayout { RowLayout {
Layout.fillWidth: true spacing: 8 * DefaultStyle.dp
EffectImage { EffectImage {
imageSource: AppIcons.videoCamera imageSource: AppIcons.videoCamera
colorizationColor: DefaultStyle.main1_500_main colorizationColor: DefaultStyle.main1_500_main
@ -161,6 +168,7 @@ ColumnLayout {
} }
} }
} }
}
Item { Item {
Layout.fillHeight: true Layout.fillHeight: true
} }

View file

@ -46,6 +46,7 @@ ColumnLayout {
} }
} }
contentItem: ColumnLayout { contentItem: ColumnLayout {
spacing: 0
// TODO : replace this by screen preview // TODO : replace this by screen preview
Rectangle { Rectangle {
Layout.fillWidth: true Layout.fillWidth: true
@ -63,6 +64,7 @@ ColumnLayout {
currentIndex: bar.currentIndex currentIndex: bar.currentIndex
ColumnLayout { ColumnLayout {
id: screensLayout id: screensLayout
spacing: 0
property int selectedIndex property int selectedIndex
Repeater { Repeater {
model: 2 //TODO : screensModel model: 2 //TODO : screensModel

View file

@ -51,6 +51,7 @@ Control.Page {
id: headerStack id: headerStack
RowLayout { RowLayout {
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
spacing: 10 * DefaultStyle.dp
Text { Text {
text: mainItem.headerTitleText text: mainItem.headerTitleText
Layout.fillWidth: true Layout.fillWidth: true
@ -82,7 +83,7 @@ Control.Page {
} }
RowLayout { RowLayout {
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
spacing: 5 * DefaultStyle.dp spacing: 10 * DefaultStyle.dp
Button { Button {
background: Item{} background: Item{}
icon.source: AppIcons.leftArrow icon.source: AppIcons.leftArrow
@ -92,12 +93,10 @@ Control.Page {
onClicked: mainItem.returnRequested() onClicked: mainItem.returnRequested()
} }
ColumnLayout { ColumnLayout {
Layout.fillWidth: true spacing: 0
Layout.fillHeight: true
Text { Text {
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
text: mainItem.headerTitleText text: mainItem.headerTitleText
color: DefaultStyle.main1_500_main color: DefaultStyle.main1_500_main
font { font {

View file

@ -19,7 +19,6 @@ RowLayout {
Layout.alignment: Qt.AlignCenter Layout.alignment: Qt.AlignCenter
ColumnLayout { ColumnLayout {
spacing: 31 * DefaultStyle.dp spacing: 31 * DefaultStyle.dp
// Layout.leftMargin: 97 * DefaultStyle.dp
Sticker { Sticker {
id: preview id: preview
previewEnabled: true previewEnabled: true
@ -33,6 +32,7 @@ RowLayout {
} }
RowLayout { RowLayout {
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
spacing: 16 * DefaultStyle.dp
CheckableButton { CheckableButton {
id: videoButton id: videoButton
iconUrl: AppIcons.videoCamera iconUrl: AppIcons.videoCamera

View file

@ -147,11 +147,9 @@ ListView {
RowLayout { RowLayout {
id: actionsRow id: actionsRow
z: 1 z: 1
// visible: mainItem.actionLayoutVisible || friendPopup.visible
// anchors.fill: parent
anchors.right: parent.right anchors.right: parent.right
// anchors.rightMargin: 10 * DefaultStyle.dp
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
spacing: 10 * DefaultStyle.dp // TODO : change when mockup ready
RowLayout{ RowLayout{
visible: mainItem.actionLayoutVisible visible: mainItem.actionLayoutVisible
spacing: 10 * DefaultStyle.dp spacing: 10 * DefaultStyle.dp
@ -260,15 +258,6 @@ ListView {
} }
onClicked: { onClicked: {
mainItem.currentIndex = index mainItem.currentIndex = index
// mainItem.contactSelected(modelData)
// if (mainItem.multiSelectionEnabled && mainItem.confInfoGui) {
// var indexInSelection = mainItem.confInfoGui.core.getParticipantIndex(modelData.core.defaultAddress)
// if (indexInSelection == -1) {
// mainItem.confInfoGui.core.addParticipant(modelData.core.defaultAddress)
// } else {
// mainItem.confInfoGui.core.removeParticipant(indexInSelection)
// }
// }
if (mainItem.multiSelectionEnabled) { if (mainItem.multiSelectionEnabled) {
var indexInSelection = mainItem.selectedContacts.indexOf(modelData.core.defaultAddress) var indexInSelection = mainItem.selectedContacts.indexOf(modelData.core.defaultAddress)
if (indexInSelection == -1) { if (indexInSelection == -1) {

View file

@ -45,6 +45,7 @@ Item {
ColumnLayout { ColumnLayout {
id: noCameraLayout id: noCameraLayout
anchors.centerIn: parent anchors.centerIn: parent
spacing: 0
visible: !cameraLoader.active || cameraLoader.status != Loader.Ready || !cameraLoader.item.isReady visible: !cameraLoader.active || cameraLoader.status != Loader.Ready || !cameraLoader.item.isReady
Avatar{ Avatar{
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter

View file

@ -35,7 +35,7 @@ Popup {
} }
} }
contentItem: RowLayout { contentItem: RowLayout {
spacing: 15 * DefaultStyle.dp spacing: 24 * DefaultStyle.dp
EffectImage { EffectImage {
imageSource: mainItem.isSuccess ? AppIcons.smiley : AppIcons.smileySad imageSource: mainItem.isSuccess ? AppIcons.smiley : AppIcons.smileySad
colorizationColor: mainItem.isSuccess ? DefaultStyle.success_500main : DefaultStyle.danger_500main colorizationColor: mainItem.isSuccess ? DefaultStyle.success_500main : DefaultStyle.danger_500main
@ -50,8 +50,9 @@ Popup {
color: DefaultStyle.main2_200 color: DefaultStyle.main2_200
} }
ColumnLayout { ColumnLayout {
spacing: 2 * DefaultStyle.dp
RowLayout { RowLayout {
Layout.fillWidth: true spacing: 0
Text { Text {
Layout.fillWidth: true Layout.fillWidth: true
text: mainItem.title text: mainItem.title

View file

@ -74,7 +74,7 @@ ListView {
property string previousDateString: previousItem ? UtilsCpp.toDateString(previousItem.core ? previousItem.core.dateTimeUtc : UtilsCpp.getCurrentDateTimeUtc()) : '' property string previousDateString: previousItem ? UtilsCpp.toDateString(previousItem.core ? previousItem.core.dateTimeUtc : UtilsCpp.getCurrentDateTimeUtc()) : ''
property bool isFirst : ListView.previousSection !== ListView.section property bool isFirst : ListView.previousSection !== ListView.section
property int topOffset: (dateDay.visible && !isFirst? 8 * DefaultStyle.dp : 0) property int topOffset: (dateDay.visible && !isFirst? 8 * DefaultStyle.dp : 0)
property var endDateTime: $modelData ? $modelData.core.endDateTime : '' property var endDateTime: $modelData ? $modelData.core.endDateTime : UtilsCpp.getCurrentDateTime()
property var haveModel: $modelData && $modelData.core.haveModel || false property var haveModel: $modelData && $modelData.core.haveModel || false

View file

@ -5,6 +5,7 @@ import QtQuick.Controls as Control
import Linphone import Linphone
import UtilsCpp 1.0 import UtilsCpp 1.0
//TODO : spacing layout
ColumnLayout { ColumnLayout {
id: mainItem id: mainItem
spacing: 8 * DefaultStyle.dp spacing: 8 * DefaultStyle.dp
@ -42,6 +43,7 @@ ColumnLayout {
leftPadding: 16 * DefaultStyle.dp leftPadding: 16 * DefaultStyle.dp
rightPadding: 16 * DefaultStyle.dp rightPadding: 16 * DefaultStyle.dp
contentItem: RowLayout { contentItem: RowLayout {
spacing: 8 * DefaultStyle.dp
EffectImage { EffectImage {
imageSource: checkableButton.icon.source imageSource: checkableButton.icon.source
colorizationColor: checkableButton.checked ? DefaultStyle.grey_0 : DefaultStyle.main1_500_main colorizationColor: checkableButton.checked ? DefaultStyle.grey_0 : DefaultStyle.main1_500_main
@ -60,10 +62,8 @@ ColumnLayout {
} }
RowLayout { RowLayout {
visible: mainItem.isCreation visible: mainItem.isCreation
Layout.fillWidth: true
Layout.topMargin: 20 * DefaultStyle.dp Layout.topMargin: 20 * DefaultStyle.dp
Layout.bottomMargin: 20 * DefaultStyle.dp Layout.bottomMargin: 20 * DefaultStyle.dp
// Layout.alignment: Qt.AlignHCenter
spacing: 18 * DefaultStyle.dp spacing: 18 * DefaultStyle.dp
CheckableButton { CheckableButton {
Layout.preferredWidth: 151 * DefaultStyle.dp Layout.preferredWidth: 151 * DefaultStyle.dp
@ -86,6 +86,7 @@ ColumnLayout {
Section { Section {
visible: mainItem.isCreation visible: mainItem.isCreation
content: RowLayout { content: RowLayout {
spacing: 8 * DefaultStyle.dp
EffectImage { EffectImage {
imageSource: AppIcons.usersThree imageSource: AppIcons.usersThree
colorizationColor: DefaultStyle.main2_600 colorizationColor: DefaultStyle.main2_600
@ -109,6 +110,7 @@ ColumnLayout {
Layout.topMargin: 10 * DefaultStyle.dp Layout.topMargin: 10 * DefaultStyle.dp
content: [ content: [
RowLayout { RowLayout {
spacing: 8 * DefaultStyle.dp
EffectImage { EffectImage {
imageSource: AppIcons.clock imageSource: AppIcons.clock
Layout.preferredWidth: 24 * DefaultStyle.dp Layout.preferredWidth: 24 * DefaultStyle.dp
@ -134,6 +136,7 @@ ColumnLayout {
} }
}, },
RowLayout { RowLayout {
spacing: 8 * DefaultStyle.dp
CalendarComboBox { CalendarComboBox {
id: startDate id: startDate
background.visible: mainItem.isCreation background.visible: mainItem.isCreation
@ -168,11 +171,10 @@ ColumnLayout {
mainItem.conferenceInfoGui.core.dateTime = selectedDateTime//UtilsCpp.createDateTime(startDate.selectedDate, selectedHour, selectedMin) mainItem.conferenceInfoGui.core.dateTime = selectedDateTime//UtilsCpp.createDateTime(startDate.selectedDate, selectedHour, selectedMin)
endHour.selectedDateTime = UtilsCpp.addSecs(selectedDateTime, 3600)//UtilsCpp.createDateTime(selectedDateTime, selectedHour == 23 ? 23 : selectedHour + 1, selectedHour == 23 ? 59 : selectedMin) endHour.selectedDateTime = UtilsCpp.addSecs(selectedDateTime, 3600)//UtilsCpp.createDateTime(selectedDateTime, selectedHour == 23 ? 23 : selectedHour + 1, selectedHour == 23 ? 59 : selectedMin)
} }
// onSelectedHourChanged: mainItem.conferenceInfoGui.core.dateTime = UtilsCpp.createDateTime(startDate.selectedDate, selectedHour, selectedMin)
// onSelectedMinChanged: mainItem.conferenceInfoGui.core.dateTime = UtilsCpp.createDateTime(startDate.selectedDate, selectedHour, selectedMin)
} }
}, },
RowLayout { RowLayout {
spacing: 8 * DefaultStyle.dp
CalendarComboBox { CalendarComboBox {
id: endDate id: endDate
background.visible: mainItem.isCreation background.visible: mainItem.isCreation
@ -344,6 +346,7 @@ ColumnLayout {
} }
Section { Section {
content: RowLayout { content: RowLayout {
spacing: 8 * DefaultStyle.dp
EffectImage { EffectImage {
imageSource: AppIcons.note imageSource: AppIcons.note
colorizationColor: DefaultStyle.main2_600 colorizationColor: DefaultStyle.main2_600
@ -386,6 +389,7 @@ ColumnLayout {
radius: 4 * DefaultStyle.dp radius: 4 * DefaultStyle.dp
} }
contentItem: RowLayout { contentItem: RowLayout {
spacing: 8 * DefaultStyle.dp
EffectImage { EffectImage {
imageSource: AppIcons.usersThree imageSource: AppIcons.usersThree
colorizationColor: DefaultStyle.main2_600 colorizationColor: DefaultStyle.main2_600
@ -415,6 +419,7 @@ ColumnLayout {
width: participantList.width width: participantList.width
RowLayout { RowLayout {
anchors.fill: parent anchors.fill: parent
spacing: 16 * DefaultStyle.dp
Avatar { Avatar {
Layout.preferredWidth: 45 * DefaultStyle.dp Layout.preferredWidth: 45 * DefaultStyle.dp
Layout.preferredHeight: 45 * DefaultStyle.dp Layout.preferredHeight: 45 * DefaultStyle.dp

View file

@ -56,21 +56,5 @@ ListView {
Layout.fillWidth: true 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
// }
// }
} }
} }

View file

@ -78,6 +78,7 @@ ListView {
spacing: 26 * DefaultStyle.dp spacing: 26 * DefaultStyle.dp
Switch { Switch {
Component.onCompleted: if (modelData.core.isAdmin) toggle() Component.onCompleted: if (modelData.core.isAdmin) toggle()
//TODO : Utilser checked et onToggled (pas compris)
onToggled: participantModel.setParticipantAdminStatus(modelData.core, position === 1) onToggled: participantModel.setParticipantAdminStatus(modelData.core, position === 1)
} }
Button { Button {
@ -101,20 +102,20 @@ ListView {
width: mainItem.width width: mainItem.width
Button { Button {
anchors.centerIn: parent anchors.centerIn: parent
leftPadding: 16 * DefaultStyle.dp
rightPadding: 16 * DefaultStyle.dp
topPadding: 10 * DefaultStyle.dp
bottomPadding: 10 * DefaultStyle.dp
height: 40 * DefaultStyle.dp height: 40 * DefaultStyle.dp
icon.source: AppIcons.plusCircle icon.source: AppIcons.plusCircle
icon.width: 16 * DefaultStyle.dp icon.width: 16 * DefaultStyle.dp
icon.height: 16 * DefaultStyle.dp icon.height: 16 * DefaultStyle.dp
contentImageColor: DefaultStyle.main1_500_main contentImageColor: DefaultStyle.main1_500_main
text: qsTr("Ajouter des participants")
color: DefaultStyle.main1_100 color: DefaultStyle.main1_100
text: qsTr("Ajouter des participants")
textColor: DefaultStyle.main1_500_main textColor: DefaultStyle.main1_500_main
textSize: 15 * DefaultStyle.dp textSize: 15 * DefaultStyle.dp
textWeight: 600 * 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() onClicked: mainItem.addParticipantRequested()
} }
} }

View file

@ -9,8 +9,9 @@ Control.ScrollBar {
padding: 0 padding: 0
background: Item{} background: Item{}
contentItem: Rectangle { contentItem: Rectangle {
implicitWidth: 6 implicitWidth: 6 * DefaultStyle.dp
radius: 32 * DefaultStyle.dp radius: 32 * DefaultStyle.dp
// TODO : ask for color names
color: "#D9D9D9" color: "#D9D9D9"
} }
} }

View file

@ -18,6 +18,7 @@ Item{
property ParticipantDeviceProxy participantDevices : ParticipantDeviceProxy { property ParticipantDeviceProxy participantDevices : ParticipantDeviceProxy {
id: allDevices id: allDevices
qmlName: "AS" qmlName: "AS"
onCountChanged: console.log("Device count changed : " +count)
Component.onCompleted: console.log("Loaded : " +allDevices) Component.onCompleted: console.log("Loaded : " +allDevices)
} }
onCallChanged: { onCallChanged: {
@ -27,6 +28,7 @@ Item{
} }
RowLayout{ RowLayout{
anchors.fill: parent anchors.fill: parent
anchors.rightMargin: 10 * DefaultStyle.dp
spacing: 16 * DefaultStyle.dp spacing: 16 * DefaultStyle.dp
Sticker { Sticker {
@ -51,6 +53,7 @@ Item{
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
anchors.top: parent.top anchors.top: parent.top
anchors.topMargin: 30 * DefaultStyle.dp anchors.topMargin: 30 * DefaultStyle.dp
spacing: 0
visible: mainItem.callState === LinphoneEnums.CallState.OutgoingInit visible: mainItem.callState === LinphoneEnums.CallState.OutgoingInit
|| mainItem.callState === LinphoneEnums.CallState.OutgoingProgress || mainItem.callState === LinphoneEnums.CallState.OutgoingProgress
|| mainItem.callState === LinphoneEnums.CallState.OutgoingRinging || mainItem.callState === LinphoneEnums.CallState.OutgoingRinging
@ -59,6 +62,8 @@ Item{
BusyIndicator { BusyIndicator {
indicatorColor: DefaultStyle.main2_100 indicatorColor: DefaultStyle.main2_100
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
indicatorHeight: 30 * DefaultStyle.dp
indicatorWidth: 30 * DefaultStyle.dp
} }
Text { Text {
id: waitingTime id: waitingTime
@ -83,23 +88,27 @@ Item{
Layout.rightMargin: 10 * DefaultStyle.dp Layout.rightMargin: 10 * DefaultStyle.dp
Layout.bottomMargin: 10 * DefaultStyle.dp Layout.bottomMargin: 10 * DefaultStyle.dp
visible: allDevices.count > 2 visible: allDevices.count > 2
spacing: 15 * DefaultStyle.dp //spacing: 15 * DefaultStyle.dp // bugged? First item has twice margins
model: allDevices model: allDevices
snapMode: ListView.SnapOneItem snapMode: ListView.SnapOneItem
clip: true clip: true
delegate: Sticker { delegate: Item{ // Spacing workaround
previewEnabled: index == 0
visible: $modelData && mainItem.callState != LinphoneEnums.CallState.End && mainItem.callState != LinphoneEnums.CallState.Released visible: $modelData && mainItem.callState != LinphoneEnums.CallState.End && mainItem.callState != LinphoneEnums.CallState.Released
&& $modelData.core.address != activeSpeakerSticker.address && $modelData.core.address != activeSpeakerSticker.address
height: visible ? 180 * DefaultStyle.dp : 0 height: visible ? (180 + 15) * DefaultStyle.dp : 0
width: 300 * DefaultStyle.dp width: 300 * DefaultStyle.dp
Sticker {
previewEnabled: index == 0 // before anchors for priority initialization
anchors.fill: parent
anchors.bottomMargin: 15 * DefaultStyle.dp// Spacing
qmlName: 'S_'+index qmlName: 'S_'+index
visible: parent.visible
participantDevice: $modelData participantDevice: $modelData
Component.onCompleted: console.log(qmlName + " is " +($modelData ? $modelData.core.address : "-")) Component.onCompleted: console.log(qmlName + " is " +($modelData ? $modelData.core.address : "-"))
} }
} }
} }
}
Sticker { Sticker {
id: preview id: preview
qmlName: 'P' qmlName: 'P'
@ -110,7 +119,7 @@ Item{
width: 300 * DefaultStyle.dp width: 300 * DefaultStyle.dp
anchors.right: mainItem.right anchors.right: mainItem.right
anchors.bottom: mainItem.bottom anchors.bottom: mainItem.bottom
anchors.rightMargin: 10 * DefaultStyle.dp anchors.rightMargin: 20 * DefaultStyle.dp
anchors.bottomMargin: 10 * DefaultStyle.dp anchors.bottomMargin: 10 * DefaultStyle.dp
//participantDevice: allDevices.me //participantDevice: allDevices.me
videoEnabled: preview.visible && mainItem.call && mainItem.call.core.localVideoEnabled videoEnabled: preview.visible && mainItem.call && mainItem.call.core.localVideoEnabled

View file

@ -11,8 +11,6 @@ import SettingsCpp 1.0
Item { Item {
id: mainItem id: mainItem
anchors.fill: parent
property CallGui call property CallGui call
property bool callTerminatedByUser: false property bool callTerminatedByUser: false
readonly property var callState: call && call.core.state || undefined readonly property var callState: call && call.core.state || undefined
@ -84,7 +82,7 @@ Item {
} }
} }
} }
// TODO : waitingForParticipant
// ColumnLayout { // ColumnLayout {
// id: waitingForParticipant // id: waitingForParticipant
// Text { // Text {

View file

@ -12,6 +12,7 @@ Mosaic {
property bool videoEnabled: true property bool videoEnabled: true
property int participantCount: gridModel.count property int participantCount: gridModel.count
margins: 0
// On grid view, we limit the quality if there are enough participants// The vga mode has been activated from the factory rc // On grid view, we limit the quality if there are enough participants// The vga mode has been activated from the factory rc
//onParticipantCountChanged: participantCount > ConstantsCpp.maxMosaicParticipants ? SettingsModel.setLimitedMosaicQuality() : SettingsModel.setHighMosaicQuality() //onParticipantCountChanged: participantCount > ConstantsCpp.maxMosaicParticipants ? SettingsModel.setLimitedMosaicQuality() : SettingsModel.setHighMosaicQuality()
delegateModel: DelegateModel{ delegateModel: DelegateModel{
@ -29,8 +30,8 @@ Mosaic {
if(index < 0) cameraView.enabled = false // this is a delegate destruction. We need to stop camera before Qt change its currentDevice (and then, let CameraView to delete wrong renderer) if(index < 0) cameraView.enabled = false // this is a delegate destruction. We need to stop camera before Qt change its currentDevice (and then, let CameraView to delete wrong renderer)
} }
height: grid.cellHeight - 10 height: grid.cellHeight - 10 * DefaultStyle.dp
width: grid.cellWidth - 10 width: grid.cellWidth - 10 * DefaultStyle.dp
Sticker { Sticker {
id: cameraView id: cameraView
previewEnabled: index == 0 previewEnabled: index == 0
@ -42,25 +43,6 @@ Mosaic {
participantDevice: avatarCell.currentDevice participantDevice: avatarCell.currentDevice
Component.onCompleted: console.log(qmlName + " is " +(call ? call.core.peerAddress : currentDevice ? currentDevice.core.address : 'addr_NotDefined')) Component.onCompleted: console.log(qmlName + " is " +(call ? call.core.peerAddress : currentDevice ? currentDevice.core.address : 'addr_NotDefined'))
} }
/*
Sticker{
id: cameraView
anchors.fill: parent
cameraQmlName: 'G_'+index
callModel: index >= 0 ? allDevices.callModel : null // do this before to prioritize changing call on remove
deactivateCamera: index <0 || !grid.cameraEnabled || grid.callModel.pausedByUser
currentDevice: gridModel.participantDevices.getAt(index)
isCameraFromDevice: true
isPaused: !isPreview && avatarCell.currentDevice && avatarCell.currentDevice.isPaused
showCloseButton: false
showCustomButton: false
avatarStickerBackgroundColor: isPreview? IncallStyle.container.avatar.stickerPreviewBackgroundColor.color : IncallStyle.container.avatar.stickerBackgroundColor.color
avatarBackgroundColor: IncallStyle.container.avatar.backgroundColor.color
//onCloseRequested: participantDevices.showMe = false
}*/
} }
} }
} }

View file

@ -1,67 +0,0 @@
import QtQuick 2.7
import QtQuick.Layouts 1.3
import QtQml.Models 2.12
import QtGraphicalEffects 1.12
import Common 1.0
import Common.Styles 1.0
import Linphone 1.0
import LinphoneEnums 1.0
import UtilsCpp 1.0
import App.Styles 1.0
import ConstantsCpp 1.0
// Temp
import 'Incall.js' as Logic
import 'qrc:/ui/scripts/Utils/utils.js' as Utils
// =============================================================================
Mosaic {
id: grid
property alias callModel: participantDevices.callModel
property bool videoEnabled: true
property int participantCount: gridModel.count
// On grid view, we limit the quality if there are enough participants// The vga mode has been activated from the factory rc
//onParticipantCountChanged: participantCount > ConstantsCpp.maxMosaicParticipants ? SettingsModel.setLimitedMosaicQuality() : SettingsModel.setHighMosaicQuality()
delegateModel: DelegateModel{
id: gridModel
property ParticipantDeviceProxyModel participantDevices : ParticipantDeviceProxyModel {
id: participantDevices
showMe: true
}
model: participantDevices
delegate: Item{
id: avatarCell
property ParticipantDeviceModel currentDevice: gridModel.participantDevices.getAt(index)
onCurrentDeviceChanged: {
if(index < 0) cameraView.enabled = false // this is a delegate destruction. We need to stop camera before Qt change its currentDevice (and then, let CameraView to delete wrong renderer)
}
height: grid.cellHeight - 10
width: grid.cellWidth - 10
Sticker{
id: cameraView
anchors.fill: parent
cameraQmlName: 'G_'+index
callModel: index >= 0 ? participantDevices.callModel : null // do this before to prioritize changing call on remove
deactivateCamera: index <0 || !grid.videoEnabled || grid.callModel.pausedByUser
currentDevice: gridModel.participantDevices.getAt(index)
isCameraFromDevice: true
isPaused: !isPreview && avatarCell.currentDevice && avatarCell.currentDevice.isPaused
showCloseButton: false
showCustomButton: false
avatarStickerBackgroundColor: isPreview? IncallStyle.container.avatar.stickerPreviewBackgroundColor.color : IncallStyle.container.avatar.stickerBackgroundColor.color
avatarBackgroundColor: IncallStyle.container.avatar.backgroundColor.color
//onCloseRequested: participantDevices.showMe = false
}
}
}
}

View file

@ -7,13 +7,13 @@ import UtilsCpp 1.0
ColumnLayout { ColumnLayout {
id: mainItem id: mainItem
spacing: 15 * DefaultStyle.dp
property string placeHolderText: qsTr("Rechercher des contacts") property string placeHolderText: qsTr("Rechercher des contacts")
property list<string> selectedParticipants: contactList.selectedContacts property list<string> selectedParticipants: contactList.selectedContacts
property int selectedParticipantsCount: selectedParticipants.length property int selectedParticipantsCount: selectedParticipants.length
property ConferenceInfoGui conferenceInfoGui property ConferenceInfoGui conferenceInfoGui
property bool nameGroupCall: false property bool nameGroupCall: false
readonly property string groupName: groupCallName.text readonly property string groupName: groupCallName.text
// Layout.preferredWidth: 362 * DefaultStyle.dp
function clearSelectedParticipants() { function clearSelectedParticipants() {
contactList.selectedContacts.clear() contactList.selectedContacts.clear()
@ -24,6 +24,7 @@ ColumnLayout {
spacing: 5 * DefaultStyle.dp spacing: 5 * DefaultStyle.dp
Layout.rightMargin: 38 * DefaultStyle.dp Layout.rightMargin: 38 * DefaultStyle.dp
RowLayout { RowLayout {
spacing: 0
Text { Text {
font.pixelSize: 13 * DefaultStyle.dp font.pixelSize: 13 * DefaultStyle.dp
font.weight: 700 * DefaultStyle.dp font.weight: 700 * DefaultStyle.dp
@ -56,6 +57,7 @@ ColumnLayout {
width: participantList.width - scrollbar.implicitWidth - 12 * DefaultStyle.dp width: participantList.width - scrollbar.implicitWidth - 12 * DefaultStyle.dp
RowLayout { RowLayout {
anchors.fill: parent anchors.fill: parent
spacing: 10 * DefaultStyle.dp
Avatar { Avatar {
Layout.preferredWidth: 45 * DefaultStyle.dp Layout.preferredWidth: 45 * DefaultStyle.dp
Layout.preferredHeight: 45 * DefaultStyle.dp Layout.preferredHeight: 45 * DefaultStyle.dp
@ -139,6 +141,7 @@ ColumnLayout {
address: sipAddr.text address: sipAddr.text
} }
ColumnLayout { ColumnLayout {
spacing: 0
Text { Text {
id: sipAddr id: sipAddr
text: UtilsCpp.generateLinphoneSipAddress(searchbar.text) text: UtilsCpp.generateLinphoneSipAddress(searchbar.text)

View file

@ -10,6 +10,7 @@ ColumnLayout{
property alias delegateModel: grid.model property alias delegateModel: grid.model
property alias cellHeight: grid.cellHeight property alias cellHeight: grid.cellHeight
property alias cellWidth: grid.cellWidth property alias cellWidth: grid.cellWidth
property alias margins: grid.margin
function appendItem(item){ function appendItem(item){
mainLayout.delegateModel.model.append(item) mainLayout.delegateModel.model.append(item)
@ -52,9 +53,11 @@ ColumnLayout{
onWidthChanged: grid.updateLayout() onWidthChanged: grid.updateLayout()
onHeightChanged: grid.updateLayout() onHeightChanged: grid.updateLayout()
spacing: 0
GridView{ GridView{
id: grid id: grid
property int margin: 10 property int margin: 10 * DefaultStyle.dp
property int itemCount: model.count ? model.count :( model.length ? model.length : 0) property int itemCount: model.count ? model.count :( model.length ? model.length : 0)
property int columns: 1 property int columns: 1
property int rows: 1 property int rows: 1

View file

@ -116,9 +116,9 @@ LoginLayout {
anchors.top: parent.top anchors.top: parent.top
anchors.right: parent.right anchors.right: parent.right
anchors.topMargin: 140 * DefaultStyle.dp anchors.topMargin: 140 * DefaultStyle.dp
anchors.rightMargin: 97.03 * DefaultStyle.dp anchors.rightMargin: 97 * DefaultStyle.dp
width: 476.78 * DefaultStyle.dp width: 477 * DefaultStyle.dp
height: 345.13 * DefaultStyle.dp height: 345 * DefaultStyle.dp
fillMode: Image.PreserveAspectFit fillMode: Image.PreserveAspectFit
source: AppIcons.verif_page_image source: AppIcons.verif_page_image
} }

View file

@ -168,6 +168,7 @@ LoginLayout {
ColumnLayout { ColumnLayout {
spacing: 18 * DefaultStyle.dp spacing: 18 * DefaultStyle.dp
RowLayout { RowLayout {
spacing: 10 * DefaultStyle.dp
CheckBox { CheckBox {
} }
Text { Text {
@ -179,6 +180,7 @@ LoginLayout {
} }
} }
RowLayout { RowLayout {
spacing: 10 * DefaultStyle.dp
CheckBox { CheckBox {
id: termsCheckBox id: termsCheckBox
} }

View file

@ -67,6 +67,7 @@ LoginLayout {
RowLayout { RowLayout {
id: carouselLayout id: carouselLayout
spacing: 76 * DefaultStyle.dp
Image { Image {
id: carouselImg id: carouselImg
// Layout.rightMargin: 40 * DefaultStyle.dp // Layout.rightMargin: 40 * DefaultStyle.dp

View file

@ -135,12 +135,10 @@ Item {
RowLayout { RowLayout {
anchors.fill: parent anchors.fill: parent
//anchors.topMargin: 10 * DefaultStyle.dp
spacing: 0 spacing: 0
ColumnLayout { ColumnLayout {
id: leftPanel id: leftPanel
Layout.preferredWidth: 404 * DefaultStyle.dp Layout.preferredWidth: 404 * DefaultStyle.dp
Layout.fillHeight: true
Layout.fillWidth:false Layout.fillWidth:false
spacing:0 spacing:0
} }
@ -161,12 +159,8 @@ Item {
anchors.fill: parent anchors.fill: parent
ColumnLayout { ColumnLayout {
id: defaultItem id: defaultItem
Layout.fillWidth: true
Layout.fillHeight: true
RowLayout { RowLayout {
Layout.fillHeight: true
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
Item { Item {
Layout.fillWidth: true Layout.fillWidth: true

View file

@ -19,9 +19,7 @@ AbstractMainPage {
property AccountProxy accounts: AccountProxy{id: accountProxy} property AccountProxy accounts: AccountProxy{id: accountProxy}
property AccountGui account: accountProxy.defaultAccount property AccountGui account: accountProxy.defaultAccount
property var state: account && account.core.registrationState || 0 property var state: account && account.core.registrationState || 0
onStateChanged: console.log(state)
property bool isRegistered: account ? account.core.registrationState == LinphoneEnums.RegistrationState.Ok : false property bool isRegistered: account ? account.core.registrationState == LinphoneEnums.RegistrationState.Ok : false
onIsRegisteredChanged: console.log(isRegistered)
property int selectedParticipantsCount property int selectedParticipantsCount
signal startGroupCallRequested() signal startGroupCallRequested()
@ -419,6 +417,7 @@ AbstractMainPage {
Component { Component {
id: groupCallTitle id: groupCallTitle
RowLayout { RowLayout {
spacing: 10 * DefaultStyle.dp
Button { Button {
background: Item{} background: Item{}
icon.source: AppIcons.leftArrow icon.source: AppIcons.leftArrow

View file

@ -66,6 +66,7 @@ AbstractMainPage {
RowLayout { RowLayout {
id: title id: title
spacing: 0
anchors.top: leftPanel.top anchors.top: leftPanel.top
anchors.right: leftPanel.right anchors.right: leftPanel.right
anchors.left: leftPanel.left anchors.left: leftPanel.left
@ -101,6 +102,7 @@ AbstractMainPage {
anchors.left: leftPanel.left anchors.left: leftPanel.left
anchors.bottom: leftPanel.bottom anchors.bottom: leftPanel.bottom
enabled: mainItem.leftPanelEnabled enabled: mainItem.leftPanelEnabled
spacing: 38 * DefaultStyle.dp
SearchBar { SearchBar {
id: searchBar id: searchBar
Layout.leftMargin: leftPanel.leftMargin Layout.leftMargin: leftPanel.leftMargin
@ -140,7 +142,9 @@ AbstractMainPage {
visible: favoriteList.contentHeight > 0 visible: favoriteList.contentHeight > 0
Layout.leftMargin: leftPanel.leftMargin Layout.leftMargin: leftPanel.leftMargin
Layout.rightMargin: leftPanel.rightMargin Layout.rightMargin: leftPanel.rightMargin
spacing: 16 * Defaultstyle.dp
RowLayout { RowLayout {
spacing: 0
Text { Text {
text: qsTr("Favoris") text: qsTr("Favoris")
font { font {
@ -186,8 +190,9 @@ AbstractMainPage {
visible: contactList.count > 0 visible: contactList.count > 0
Layout.leftMargin: leftPanel.leftMargin Layout.leftMargin: leftPanel.leftMargin
Layout.rightMargin: leftPanel.rightMargin Layout.rightMargin: leftPanel.rightMargin
spacing: 16 * Defaultstyle.dp
RowLayout { RowLayout {
Layout.fillWidth: true spacing: 0
Text { Text {
text: qsTr("All contacts") text: qsTr("All contacts")
font { font {

View file

@ -5,6 +5,7 @@ import QtQuick.Controls as Control
import Linphone import Linphone
import UtilsCpp 1.0 import UtilsCpp 1.0
// TODO : spacing
AbstractMainPage { AbstractMainPage {
id: mainItem id: mainItem
noItemButtonText: qsTr("Créer une réunion") noItemButtonText: qsTr("Créer une réunion")
@ -23,17 +24,17 @@ AbstractMainPage {
onSelectedConferenceChanged: { onSelectedConferenceChanged: {
overridenRightPanelStackView.clear() overridenRightPanelStackView.clear()
if (selectedConference) { if (selectedConference) {
if (!overridenRightPanelStackView.currentItem || overridenRightPanelStackView.currentItem.objectName != "meetingDetail") overridenRightPanelStackView.replace(meetingDetail, Control.StackView.Immediate) if (!overridenRightPanelStackView.currentItem || overridenRightPanelStackView.currentItem != meetingDetail) overridenRightPanelStackView.replace(meetingDetail, Control.StackView.Immediate)
} }
} }
Connections { Connections {
target: leftPanelStackView target: leftPanelStackView
onCurrentItemChanged: { onCurrentItemChanged: {
mainItem.showDefaultItem = leftPanelStackView.currentItem.objectName == "listLayout" && mainItem.meetingListCount === 0 mainItem.showDefaultItem = leftPanelStackView.currentItem == listLayout && mainItem.meetingListCount === 0
} }
} }
onMeetingListCountChanged: showDefaultItem = leftPanelStackView.currentItem.objectName == "listLayout" && meetingListCount === 0 onMeetingListCountChanged: showDefaultItem = leftPanelStackView.currentItem == listLayout && meetingListCount === 0
function setUpConference(confInfoGui = null) { function setUpConference(confInfoGui = null) {
var isCreation = !confInfoGui var isCreation = !confInfoGui
@ -126,7 +127,6 @@ AbstractMainPage {
Component { Component {
id: listLayout id: listLayout
ColumnLayout { ColumnLayout {
property string objectName: "listLayout"
spacing: 0 spacing: 0
Control.StackView.onDeactivated: { Control.StackView.onDeactivated: {
mainItem.selectedConference = null mainItem.selectedConference = null
@ -136,7 +136,7 @@ AbstractMainPage {
mainItem.selectedConference = conferenceList.selectedConference mainItem.selectedConference = conferenceList.selectedConference
} }
RowLayout { RowLayout {
visible: leftPanelStackView.currentItem.objectName == "listLayout" visible: leftPanelStackView.currentItem == listLayout
enabled: mainItem.leftPanelEnabled enabled: mainItem.leftPanelEnabled
Layout.rightMargin: 39 * DefaultStyle.dp Layout.rightMargin: 39 * DefaultStyle.dp
spacing: 0 spacing: 0
@ -201,6 +201,7 @@ AbstractMainPage {
Connections { Connections {
target: mainItem target: mainItem
onNewConfCreated: { onNewConfCreated: {
// TODO : manque un connect côté c++
conferenceList.forceUpdate() conferenceList.forceUpdate()
} }
} }
@ -311,13 +312,14 @@ AbstractMainPage {
} }
} }
TextInput { TextField {
Component.onCompleted: text = mainItem.selectedConference.core.subject Component.onCompleted: text = mainItem.selectedConference.core.subject
color: DefaultStyle.main2_600 color: DefaultStyle.main2_600
font { font {
pixelSize: 20 * DefaultStyle.dp pixelSize: 20 * DefaultStyle.dp
weight: 800 * DefaultStyle.dp weight: 800 * DefaultStyle.dp
} }
background: Item{}
Layout.fillWidth: true Layout.fillWidth: true
onActiveFocusChanged: if(activeFocus==true) selectAll() onActiveFocusChanged: if(activeFocus==true) selectAll()
onEditingFinished: mainItem.selectedConference.core.subject = text onEditingFinished: mainItem.selectedConference.core.subject = text
@ -532,6 +534,7 @@ AbstractMainPage {
color: DefaultStyle.main2_600 color: DefaultStyle.main2_600
background: Item{} background: Item{}
onClicked: { onClicked: {
// TODO : voir si c'est en audio only quand on clique sur le lien
UtilsCpp.createCall(mainItem.selectedConference.core.uri) UtilsCpp.createCall(mainItem.selectedConference.core.uri)
} }
} }