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();
ignoreVSync.setSwapInterval(0);
QSurfaceFormat::setDefaultFormat(ignoreVSync);
qInfo() << "Loading Fonts";
lInfo() << "Loading Fonts";
QDirIterator it(":/font/", QDirIterator::Subdirectories);
while (it.hasNext()) {
QString ttf = it.next();
// qDebug() << ttf;
// lDebug()<< ttf;
auto id = QFontDatabase::addApplicationFont(ttf);
}
//-------------------
mLinphoneThread = new Thread(this);
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")
.arg(applicationVersion())
.arg(Utils::getOsProduct())
@ -110,7 +110,7 @@ void App::setSelf(QSharedPointer<App>(me)) {
auto callGui = new CallGui(callCore);
auto win = getCallsWindow(QVariant::fromValue(callGui));
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");
auto selector = new QQmlFileSelector(mEngine, mEngine);
selector->setExtraSelectors(selectors);
qInfo() << log().arg("Activated selectors:") << selector->selector()->allSelectors();
lInfo() << log().arg("Activated selectors:") << selector->selector()->allSelectors();
mEngine->addImportPath(":/");
mEngine->rootContext()->setContextProperty("applicationDirPath", QGuiApplication::applicationDirPath());
@ -163,7 +163,7 @@ void App::init() {
[this, url](QObject *obj, const QUrl &objUrl) {
if (url == objUrl) {
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);
}
mMainWindow = qobject_cast<QQuickWindow *>(obj);
@ -188,12 +188,12 @@ void App::init() {
if (mParser->isSet("qt-logs-only")) QtLogger::enableQtOnly(true);
if (!mLinphoneThread->isRunning()) {
qDebug() << log().arg("Starting Thread");
lDebug() << log().arg("Starting Thread");
mLinphoneThread->start();
}
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);
}
@ -258,7 +258,7 @@ void App::clean() {
delete mEngine;
mEngine = nullptr;
if (mSettings) {
mSettings.reset();
mSettings->deleteLater();
mSettings = nullptr;
}
mLinphoneThread->wait(250);
@ -296,9 +296,9 @@ bool App::notify(QObject *receiver, QEvent *event) {
try {
done = QApplication::notify(receiver, event);
} catch (const std::exception &ex) {
qCritical() << log().arg("Exception has been catch in notify");
lCritical() << log().arg("Exception has been catch in notify");
} catch (...) {
qCritical() << log().arg("Generic exeption has been catch in notify");
lCritical() << log().arg("Generic exeption has been catch in notify");
}
return done;
}
@ -308,14 +308,14 @@ QQuickWindow *App::getCallsWindow(QVariant callGui) {
if (!mCallsWindow) {
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);
if (component.isError()) {
qWarning() << component.errors();
abort();
}
qInfo() << log().arg("Subwindow status: `%1`.").arg(component.status());
lInfo() << log().arg("Subwindow status: `%1`.").arg(component.status());
QObject *object = nullptr;
// if (!callGui.isNull() && callGui.isValid()) object = component.createWithInitialProperties({{"call",
@ -323,7 +323,7 @@ QQuickWindow *App::getCallsWindow(QVariant callGui) {
object = component.create();
Q_ASSERT(object);
if (!object) {
qCritical() << log().arg("Calls window could not be created.");
lCritical() << log().arg("Calls window could not be created.");
return nullptr;
}
@ -333,7 +333,7 @@ QQuickWindow *App::getCallsWindow(QVariant callGui) {
auto window = qobject_cast<QQuickWindow *>(object);
Q_ASSERT(window);
if (!window) {
qCritical() << log().arg("Calls window could not be created.");
lCritical() << log().arg("Calls window could not be created.");
return nullptr;
}
// window->setParent(mMainWindow);

View file

@ -125,7 +125,7 @@ void AccountCore::setUnreadNotifications(int unread) {
void AccountCore::onRegistrationStateChanged(const std::shared_ptr<linphone::Account> &account,
linphone::RegistrationState state,
const std::string &message) {
qDebug() << log().arg(Q_FUNC_INFO) << (int)state;
lDebug() << log().arg(Q_FUNC_INFO) << (int)state;
mRegistrationState = LinphoneEnums::fromLinphone(state);
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) {
// qDebug() << "[CallHistoryCore] new" << this;
// lDebug()<< "[CallHistoryCore] new" << this;
App::getInstance()->mEngine->setObjectOwnership(this, QQmlEngine::CppOwnership);
// Should be call from model Thread
mustBeInLinphoneThread(getClassName());
@ -55,7 +55,7 @@ CallHistoryCore::CallHistoryCore(const std::shared_ptr<linphone::CallLog> &callL
}
CallHistoryCore::~CallHistoryCore() {
// qDebug() << "[CallHistoryCore] delete" << this;
// lDebug()<< "[CallHistoryCore] delete" << this;
mustBeInMainThread("~" + getClassName());
}

View file

@ -24,7 +24,7 @@
DEFINE_ABSTRACT_OBJECT(CallHistoryGui)
CallHistoryGui::CallHistoryGui(QSharedPointer<CallHistoryCore> core) {
// qDebug() << "[CallHistoryGui] new" << this;
// lDebug()<< "[CallHistoryGui] new" << this;
App::getInstance()->mEngine->setObjectOwnership(this, QQmlEngine::JavaScriptOwnership);
mCore = core;
if (isInLinphoneThread()) moveToThread(App::getInstance()->thread());
@ -32,7 +32,7 @@ CallHistoryGui::CallHistoryGui(QSharedPointer<CallHistoryCore> core) {
CallHistoryGui::~CallHistoryGui() {
mustBeInMainThread("~" + getClassName());
// qDebug() << "[CallHistoryGui] delete" << this;
// lDebug()<< "[CallHistoryGui] delete" << this;
}
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) {
qDebug() << "[CallCore] new" << this;
lDebug() << "[CallCore] new" << this;
App::getInstance()->mEngine->setObjectOwnership(this, QQmlEngine::CppOwnership);
// Should be call from model Thread
mustBeInLinphoneThread(getClassName());
@ -103,7 +103,7 @@ CallCore::CallCore(const std::shared_ptr<linphone::Call> &call) : QObject(nullpt
}
CallCore::~CallCore() {
qDebug() << "[CallCore] delete" << this;
lDebug() << "[CallCore] delete" << this;
mustBeInMainThread("~" + getClassName());
emit mCallModel->removeListener();
}
@ -366,7 +366,7 @@ bool CallCore::getLocalVideoEnabled() const {
void CallCore::setLocalVideoEnabled(bool enabled) {
if (mLocalVideoEnabled != enabled) {
mLocalVideoEnabled = enabled;
qWarning() << "LocalVideoEnabled: " << mLocalVideoEnabled;
lDebug() << "LocalVideoEnabled: " << mLocalVideoEnabled;
emit localVideoEnabledChanged();
}
}
@ -406,10 +406,11 @@ QSharedPointer<ConferenceCore> CallCore::getConferenceCore() const {
}
void CallCore::setConference(const QSharedPointer<ConferenceCore> &conference) {
mustBeInMainThread(log().arg(Q_FUNC_INFO));
if (mConference != conference) {
mConference = conference;
mIsConference = (mConference != nullptr);
qDebug() << "[CallCore] Set conference : " << mConference;
lDebug() << "[CallCore] Set conference : " << mConference;
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());
QTimer::singleShot(1, this, &CameraGui::isNotReady);
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()
return renderer;
}

View file

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

View file

@ -58,9 +58,6 @@ void ConferenceCore::setSelf(QSharedPointer<ConferenceCore> me) {
auto device = ParticipantDeviceCore::create(participantDevice);
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
@ -77,10 +74,7 @@ QDateTime ConferenceCore::getStartDate() const {
Q_INVOKABLE qint64 ConferenceCore::getElapsedSeconds() const {
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 {
return mParticipantDeviceCount + 1;
}
@ -112,7 +106,7 @@ ParticipantGui *ConferenceCore::getMeGui() const {
void ConferenceCore::setActiveSpeaker(const QSharedPointer<ParticipantDeviceCore> &device) {
if (mActiveSpeaker != device) {
mActiveSpeaker = device;
qDebug() << "Changing active speaker to " << device->getAddress();
lDebug() << "Changing active speaker to " << device->getAddress();
emit activeSpeakerChanged();
}
}

View file

@ -56,11 +56,6 @@ public:
QString getSubject() const;
QDateTime getStartDate() 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;
ParticipantDeviceCore *getActiveSpeaker() const;
ParticipantDeviceGui *getActiveSpeakerGui() const;

View file

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

View file

@ -135,7 +135,6 @@ ConferenceInfoCore::ConferenceInfoCore(const ConferenceInfoCore &conferenceInfoC
ConferenceInfoCore::~ConferenceInfoCore() {
mustBeInMainThread("~" + getClassName());
mCheckEndTimer.stop();
}
void ConferenceInfoCore::reset(const ConferenceInfoCore &conf) {
@ -200,7 +199,7 @@ void ConferenceInfoCore::setSelf(QSharedPointer<ConferenceInfoCore> me) {
mConfInfoModelConnection->invokeToCore([this, state = LinphoneEnums::fromLinphone(state),
infoState = LinphoneEnums::fromLinphone(confInfoState),
uri] {
qDebug() << "scheduler state changed" << state;
lDebug() << "scheduler state changed" << state;
setConferenceSchedulerState(state);
setConferenceInfoState(infoState);
if (state == LinphoneEnums::ConferenceSchedulerState::Ready) {
@ -211,7 +210,7 @@ void ConferenceInfoCore::setSelf(QSharedPointer<ConferenceInfoCore> me) {
mConfInfoModelConnection->makeConnectToModel(
&ConferenceInfoModel::invitationsSent,
[this](const std::list<std::shared_ptr<linphone::Address>> &failedInvitations) {
qDebug() << "invitations sent";
lDebug() << "invitations sent";
});
} else { // Create
mCoreModelConnection = QSharedPointer<SafeConnection<ConferenceInfoCore, CoreModel>>(
@ -220,7 +219,7 @@ void ConferenceInfoCore::setSelf(QSharedPointer<ConferenceInfoCore> me) {
&CoreModel::conferenceInfoReceived,
[this](const std::shared_ptr<linphone::Core> &core,
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;
}
//------------------------------------------------------------------------------------------------
// Datetime is in Custom (Locale/UTC/System). Convert into UTC for conference info
void ConferenceInfoCore::setIsScheduled(const bool &on) {
if (mIsScheduled != on) {
mIsScheduled = on;
@ -497,8 +493,6 @@ void ConferenceInfoCore::setIsScheduled(const bool &on) {
void ConferenceInfoCore::setIsEnded(bool ended) {
if (mIsEnded != ended) {
mIsEnded = ended;
if (mIsEnded) mCheckEndTimer.stop(); // No need to run the timer.
else mCheckEndTimer.start();
emit isEndedChanged();
}
}
@ -546,8 +540,8 @@ void ConferenceInfoCore::writeIntoModel(std::shared_ptr<ConferenceInfoModel> mod
model->setSubject(mSubject);
if (!mOrganizerAddress.isEmpty()) {
model->setOrganizer(mOrganizerAddress);
qDebug() << "Use of " << mOrganizerAddress;
} else qDebug() << "Use of " << model->getOrganizerAddress();
lDebug() << "Use of " << mOrganizerAddress;
} else lDebug() << "Use of " << model->getOrganizerAddress();
model->setDescription(mDescription);
std::list<std::shared_ptr<linphone::ParticipantInfo>> participantInfos;
for (auto &p : mParticipants) {
@ -587,23 +581,24 @@ void ConferenceInfoCore::save() {
if (!linphoneConf->getOrganizer()) linphoneConf->setOrganizer(cleanedClonedAddress);
if (mOrganizerAddress.isEmpty())
mOrganizerAddress = Utils::coreStringToAppString(accountAddress->asStringUriOnly());
} else qCritical() << "No contact address";
} else qCritical() << "No default account";
mConferenceInfoModel = Utils::makeQObject_ptr<ConferenceInfoModel>(linphoneConf);
setHaveModel(true);
// mConferenceInfoModel->createConferenceScheduler();
auto confSchedulerModel = mConferenceInfoModel->getConferenceScheduler();
} else lCritical() << "No contact address";
} else lCritical() << "No default account";
auto confInfoModel = Utils::makeQObject_ptr<ConferenceInfoModel>(linphoneConf);
auto confSchedulerModel = confInfoModel->getConferenceScheduler();
if (!confSchedulerModel) {
auto confScheduler = CoreModel::getInstance()->getCore()->createConferenceScheduler();
confSchedulerModel = Utils::makeQObject_ptr<ConferenceSchedulerModel>(confScheduler);
mConferenceInfoModel->setConferenceScheduler(confSchedulerModel);
confInfoModel->setConferenceScheduler(confSchedulerModel);
}
thisCopy->writeIntoModel(mConferenceInfoModel);
thisCopy->deleteLater();
mCoreModelConnection->invokeToCore([this, confSchedulerModel, linphoneConf]() {
setSelf(mCoreModelConnection->mCore);
mCoreModelConnection->invokeToModel(
[this, confSchedulerModel, linphoneConf]() { confSchedulerModel->setInfo(linphoneConf); });
mCoreModelConnection->invokeToCore([this, thisCopy, confSchedulerModel, linphoneConf, confInfoModel]() {
setHaveModel(true);
mConferenceInfoModel = confInfoModel;
mCoreModelConnection->invokeToModel([this, thisCopy, confSchedulerModel, linphoneConf]() {
thisCopy->writeIntoModel(mConferenceInfoModel);
thisCopy->deleteLater();
confSchedulerModel->setInfo(linphoneConf);
mCoreModelConnection->invokeToCore([this]() { setSelf(mCoreModelConnection->mCore); });
});
});
});
}
@ -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) {
qDebug() << "ConferenceInfoCore::onInvitationsSent";
lDebug() << "ConferenceInfoCore::onInvitationsSent";
emit invitationsSent();
}

View file

@ -62,9 +62,6 @@ public:
Q_PROPERTY(LinphoneEnums::ConferenceInfoState state READ getConferenceInfoState NOTIFY conferenceInfoStateChanged)
Q_PROPERTY(LinphoneEnums::ConferenceSchedulerState schedulerState READ getConferenceSchedulerState NOTIFY
conferenceSchedulerStateChanged)
// Q_PROPERTY(LinphoneEnums::ConferenceSchedulerState conferenceSchedulerState READ getConferenceSchedulerState
// NOTIFY
// conferenceSchedulerStateChanged)
static QSharedPointer<ConferenceInfoCore> create(std::shared_ptr<linphone::ConferenceInfo> conferenceInfo);
ConferenceInfoCore(std::shared_ptr<linphone::ConferenceInfo> conferenceInfo, QObject *parent = nullptr);
@ -94,13 +91,11 @@ public:
void setIsEnded(bool ended);
bool inviteEnabled() const;
QVariantList getParticipants() const;
// Q_INVOKABLE QVariantList getAllParticipants() const;
int getParticipantCount() const;
TimeZoneModel *getTimeZoneModel() const;
// QString getIcalendarString() const;
LinphoneEnums::ConferenceInfoState getConferenceInfoState() const;
LinphoneEnums::ConferenceSchedulerState getConferenceSchedulerState() const;
// LinphoneEnums::ConferenceSchedulerState getConferenceSchedulerState() const;
QString toStartEndDateString();
void setDateTime(const QDateTime &date);
@ -133,12 +128,6 @@ public:
Q_INVOKABLE void save();
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);
Q_INVOKABLE bool isAllDayConf() const;
@ -160,12 +149,10 @@ signals:
void conferenceInfoStateChanged();
void conferenceSchedulerStateChanged();
void timeZoneModelChanged();
// void conferenceSchedulerStateChanged();
void invitationsSent();
void removed();
// void lCreateConference(const int &securityLevel);
void lCancelConferenceInfo();
void lDeleteConferenceInfo(); // Remove completly this conference info from DB
@ -191,11 +178,7 @@ private:
bool mHaveModel = false;
bool mIsScheduled;
bool mIsEnded = false;
QTimer mCheckEndTimer;
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
};

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::conferenceInfoReceived, &ConferenceInfoList::lUpdate);
mCoreModelConnection->makeConnectToModel(&CoreModel::conferenceStateChanged, [this] {
qDebug() << "list: conf state changed";
lDebug() << "list: conf state changed";
lUpdate();
});
mCoreModelConnection->makeConnectToModel(
&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(
&CoreModel::conferenceInfoReceived,
[this](const std::shared_ptr<linphone::Core> &core,
const std::shared_ptr<const linphone::ConferenceInfo> &conferenceInfo) {
qDebug() << "info received" << conferenceInfo->getOrganizer()->asStringUriOnly()
lDebug() << "info received" << conferenceInfo->getOrganizer()->asStringUriOnly()
<< conferenceInfo->getSubject();
});
emit lUpdate();
@ -164,14 +146,11 @@ ConferenceInfoList::get(std::shared_ptr<linphone::ConferenceInfo> conferenceInfo
QSharedPointer<ConferenceInfoCore>
ConferenceInfoList::build(const std::shared_ptr<linphone::ConferenceInfo> &conferenceInfo) const {
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();
bool haveMe = conferenceInfo->getOrganizer()->weakEqual(me);
if (!haveMe)
haveMe = (std::find_if(participants.begin(), participants.end(),
[me](const std::shared_ptr<linphone::ParticipantInfo> &p) {
// qDebug()
// << "[CONFERENCEINFOLIST] participant " << p->getAddress()->asStringUriOnly();
return me->weakEqual(p->getAddress());
}) != participants.end());
if (haveMe) {
@ -182,10 +161,10 @@ ConferenceInfoList::build(const std::shared_ptr<linphone::ConferenceInfo> &confe
}
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>();
if (item) emit item->lDeleteConferenceInfo();
// endRemoveRows();
}
QHash<int, QByteArray> ConferenceInfoList::roleNames() const {
@ -227,13 +206,6 @@ int ConferenceInfoList::sort(QList<QSharedPointer<ConferenceInfoCore>> &listToSo
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);
// qDebug() << it - listToSort.begin();
return it == listToSort.end() ? -1 : it - listToSort.begin();
}

View file

@ -32,17 +32,17 @@ class ConferenceInfoCore;
class ConferenceInfoList : public ListProxy, public AbstractObject {
Q_OBJECT
public:
// Create a ConferenceInfoList and make connections to List.
static QSharedPointer<ConferenceInfoList> create();
// Create a ConferenceInfoCore and make connections to List.
ConferenceInfoList(QObject *parent = Q_NULLPTR);
~ConferenceInfoList();
void setSelf(QSharedPointer<ConferenceInfoList> me);
bool haveCurrentDate()const;
bool haveCurrentDate() const;
void setHaveCurrentDate(bool have);
void updateHaveCurrentDate();
int getCurrentDateIndex() const;
void setCurrentDateIndex(int index);
@ -54,7 +54,7 @@ public:
QHash<int, QByteArray> roleNames() const override;
virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
static int sort(QList<QSharedPointer<ConferenceInfoCore>> &listToSort); // return the index of null item.
static int sort(QList<QSharedPointer<ConferenceInfoCore>> &listToSort); // return the index of null item.
signals:
void lUpdate();

View file

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

View file

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

View file

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

View file

@ -172,7 +172,7 @@ QObject *Notifier::createNotification(Notifier::NotificationType type, QVariantM
engine, &QQmlApplicationEngine::objectCreated, this,
[this, url, screen, engine](QObject *obj, const QUrl &objUrl) {
if (!obj && url == objUrl) {
qCritical() << "[App] Notifier.qml couldn't be load.";
lCritical() << "[App] Notifier.qml couldn't be load.";
engine->deleteLater();
exit(-1);
} else {
@ -198,7 +198,7 @@ QObject *Notifier::createNotification(Notifier::NotificationType type, QVariantM
Qt::QueuedConnection);
engine->load(url);
}
qInfo() << QStringLiteral("Create notifications:") << wrapperItem;
lInfo() << QStringLiteral("Create notifications:") << wrapperItem;
}
mMutex->unlock();
@ -249,7 +249,7 @@ void Notifier::deleteNotification(QVariant notification) {
return;
}
qInfo() << QStringLiteral("Delete notification:") << instance;
lInfo() << QStringLiteral("Delete notification:") << instance;
instance->setProperty("__valid", true);
instance->property(NotificationPropertyTimer).value<QTimer *>()->stop();
@ -291,7 +291,7 @@ void Notifier::notifyReceivedCall(const shared_ptr<linphone::Call> &call) {
QObject::connect(
gui->getCore(), &CallCore::statusChanged, notification,
[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));
});
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) {
mustBeInLinphoneThread(getClassName());
App::getInstance()->mEngine->setObjectOwnership(this, QQmlEngine::CppOwnership);
mParticipantModel = Utils::makeQObject_ptr<ParticipantModel>(participant);
if (participant) {
@ -73,14 +74,8 @@ void ParticipantCore::setSelf(QSharedPointer<ParticipantCore> me) {
mParticipantConnection->makeConnectToCore(&ParticipantCore::lStartInvitation, [this](const int &secs) {
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 {
return mSecurityLevel;
}
@ -160,12 +155,6 @@ void ParticipantCore::onDeviceSecurityLevelChanged(std::shared_ptr<const linphon
emit deviceSecurityLevelChanged(device);
}
// ParticipantDeviceProxyModel *ParticipantCore::getProxyDevices() {
// ParticipantDeviceProxyModel *devices = new ParticipantDeviceProxyModel();
// devices->setParticipant(this);
// return devices;
// }
QList<QVariant> ParticipantCore::getParticipantDevices() {
return mParticipantDevices;
}

View file

@ -38,7 +38,6 @@ class ParticipantModel;
class ParticipantCore : public QObject, public AbstractObject {
Q_OBJECT
// Q_PROPERTY(FriendCore *friendCore READ getFriendCore CONSTANT)
Q_PROPERTY(QString sipAddress READ getSipAddress WRITE setSipAddress NOTIFY sipAddressChanged)
Q_PROPERTY(QString displayName READ getDisplayName WRITE setDisplayName NOTIFY displayNameChanged)
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(QList<QVariant> devices READ getParticipantDevices NOTIFY deviceChanged)
// Q_PROPERTY(bool inviting READ getInviting NOTIFY invitingChanged)
public:
static QSharedPointer<ParticipantCore> create(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);
// FriendCore *getFriendCore() const;
QString getDisplayName() const;
QString getSipAddress() const;
QDateTime getCreationTime() const;
@ -76,7 +72,6 @@ public:
void setIsFocus(const bool &focus);
void setSecurityLevel(int level);
// Q_INVOKABLE ParticipantDeviceProxy *getProxyDevices();
QList<QVariant> getParticipantDevices();
public slots:
@ -106,7 +101,6 @@ private:
std::shared_ptr<ParticipantModel> mParticipantModel;
QSharedPointer<SafeConnection<ParticipantCore, ParticipantModel>> mParticipantConnection;
// QSharedPointer<ParticipantDeviceList> mParticipantDevices;
QList<QVariant> mParticipantDevices;
QString mDisplayName;

View file

@ -57,12 +57,9 @@ ParticipantDeviceCore::ParticipantDeviceCore(const std::shared_ptr<linphone::Par
mParticipantDeviceModel = Utils::makeQObject_ptr<ParticipantDeviceModel>(device);
mParticipantDeviceModel->setSelf(mParticipantDeviceModel);
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
// mCall = callModel;
// if (mCall) connect(mCall, &CallModel::statusChanged, this, &ParticipantDeviceCore::onCallStatusChanged);
mIsVideoEnabled = mParticipantDeviceModel->isVideoEnabled();
// if (mCall && mParticipantDeviceModel) updateIsLocal();
}
ParticipantDeviceCore::~ParticipantDeviceCore() {
@ -185,7 +182,7 @@ void ParticipantDeviceCore::setState(LinphoneEnums::ParticipantDeviceState state
void ParticipantDeviceCore::setIsVideoEnabled(bool enabled) {
if (mIsVideoEnabled != enabled) {
mIsVideoEnabled = enabled;
qDebug() << log().arg(Q_FUNC_INFO) << getAddress() << mIsVideoEnabled;
lDebug() << log().arg(Q_FUNC_INFO) << getAddress() << mIsVideoEnabled;
emit videoEnabledChanged();
}
}
@ -202,26 +199,8 @@ std::shared_ptr<ParticipantDeviceModel> ParticipantDeviceCore::getModel() const
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,
bool 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)
public:
// static QSharedPointer<ParticipantDeviceCore> create(const std::shared_ptr<linphone::ParticipantDevice> &device);
static QSharedPointer<ParticipantDeviceCore>
create(std::shared_ptr<linphone::ParticipantDevice> device, const bool &isMe = false, QObject *parent = nullptr);
@ -97,11 +96,6 @@ public:
bool available,
linphone::StreamType streamType);
// void updateIsLocal();
// public slots:
// void onSecurityLevelChanged(std::shared_ptr<const linphone::Address> device);
// void onCallStatusChanged();
signals:
void securityLevelChanged();
void videoEnabledChanged();

View file

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

View file

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

View file

@ -32,7 +32,7 @@ class ParticipantDeviceGui;
class ParticipantDeviceProxy : public SortFilterProxy, public AbstractObject {
Q_OBJECT
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:
DECLARE_GUI_OBJECT
@ -43,7 +43,6 @@ public:
void setCurrentCall(CallGui *callGui);
ParticipantDeviceGui *getMe() const;
void setMe(ParticipantDeviceGui *me);
protected:
bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override;

View file

@ -48,8 +48,6 @@ ParticipantList::ParticipantList(QObject *parent) : ListProxy(parent) {
ParticipantList::~ParticipantList() {
mList.clear();
// mChatRoomModel = nullptr;
// mConferenceModel = nullptr;
}
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) {
mustBeInMainThread(log().arg(Q_FUNC_INFO));
mConferenceModel = conferenceModel;
qDebug() << "[ParticipantList] : set Conference " << mConferenceModel.get();
lDebug() << "[ParticipantList] : set Conference " << mConferenceModel.get();
if (mConferenceModelConnection && mConferenceModelConnection->mCore.lock()) { // Unsure to get myself
auto oldConnect = mConferenceModelConnection->mCore; // Setself rebuild safepointer
setSelf(mConferenceModelConnection->mCore.mQData); // reset connections
@ -147,87 +145,6 @@ bool ParticipantList::contains(const QString &address) const {
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) {
QString address = participant->getSipAddress();
int index = 0;
@ -252,10 +169,6 @@ void ParticipantList::addAddress(const QString &address) {
connect(participant.get(), &ParticipantCore::invitationTimeout, this, &ParticipantList::remove);
participant->setSipAddress(address);
add(participant);
// if (mChatRoomModel && mChatRoomModel->getChatRoom()) { // Invite and wait for its creation
// participant->startInvitation();
// mChatRoomModel->getChatRoom()->addParticipant(Utils::interpretUrl(address));
// }
if (mConferenceModel) {
std::list<std::shared_ptr<linphone::Call>> runningCallsToAdd;
mConferenceModelConnection->invokeToModel([this, address] {
@ -267,139 +180,8 @@ void ParticipantList::addAddress(const QString &address) {
});
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 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)
void reset();
// 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);
void addAddress(const QString &address);
@ -61,27 +57,6 @@ public:
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:
void securityLevelChanged();
void deviceSecurityLevelChanged(std::shared_ptr<const linphone::Address> device);

View file

@ -50,7 +50,7 @@ CallGui *ParticipantProxy::getCurrentCall() const {
}
void ParticipantProxy::setCurrentCall(CallGui *call) {
qDebug() << "[ParticipantProxy] set current call " << this << " => " << call;
lDebug() << "[ParticipantProxy] set current call " << this << " => " << call;
if (mCurrentCall != call) {
CallCore *callCore = nullptr;
if (mCurrentCall) {
@ -63,12 +63,12 @@ void ParticipantProxy::setCurrentCall(CallGui *call) {
if (callCore) {
connect(callCore, &CallCore::conferenceChanged, mParticipants.get(), [this]() {
auto conference = mCurrentCall->getCore()->getConferenceCore();
qDebug() << "[ParticipantDeviceProxy] set conference " << this << " => " << conference;
lDebug() << "[ParticipantDeviceProxy] set conference " << this << " => " << conference;
mParticipants->setConferenceModel(conference ? conference->getModel() : nullptr);
// mParticipants->lSetConferenceModel(conference ? conference->getModel() : nullptr);
});
auto conference = callCore->getConferenceCore();
qDebug() << "[ParticipantDeviceProxy] set conference " << this << " => " << conference;
lDebug() << "[ParticipantDeviceProxy] set conference " << this << " => " << conference;
mParticipants->setConferenceModel(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 {
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) {
if (mShowMe != show) {
mShowMe = show;

View file

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

View file

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

View file

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

View file

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

View file

@ -41,7 +41,7 @@ std::shared_ptr<linphone::Account> AccountManager::createAccount(const QString &
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
auto core = CoreModel::getInstance()->getCore();
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);
auto file = QTemporaryFile::createNativeFile(resource);
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)
: ::Listener<linphone::Call, linphone::CallListener>(call, parent) {
qDebug() << "[CallModel] new" << this;
lDebug() << "[CallModel] new" << this;
mustBeInLinphoneThread(getClassName());
mDurationTimer.setInterval(1000);
mDurationTimer.setSingleShot(false);
@ -297,6 +297,7 @@ void CallModel::changeConferenceVideoLayout(LinphoneEnums::ConferenceLayout layo
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
auto coreManager = CoreModel::getInstance();
// TODO : change layout for grid/active speaker in settings
// if (layout == LinphoneEnums::ConferenceLayout::Grid)
// coreManager->getSettingsModel()->setCameraMode(coreManager->getSettingsModel()->getGridCameraMode());
// else
@ -322,7 +323,9 @@ void CallModel::updateConferenceVideoLayout() {
// settings->setCameraMode(settings->getGridCameraMode());
// else settings->setCameraMode(settings->getActiveSpeakerCameraMode());
// } 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;
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,
linphone::Call::State state,
const std::string &message) {
qDebug() << "CallModel::onStateChanged" << (int)state;
lDebug() << "CallModel::onStateChanged" << (int)state;
if (state == linphone::Call::State::StreamsRunning) {
// After UpdatedByRemote, video direction could be changed.
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) {
qDebug() << "CallModel::onStatusChanged" << (int)status;
lDebug() << "CallModel::onStatusChanged" << (int)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) {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
if (mConferenceSchedulerModel != model) {
if (mConferenceSchedulerModel) {
disconnect(mConferenceSchedulerModel.get(), &ConferenceSchedulerModel::stateChanged, this, nullptr);
@ -72,26 +73,32 @@ void ConferenceInfoModel::setConferenceScheduler(const std::shared_ptr<Conferenc
}
QDateTime ConferenceInfoModel::getDateTime() const {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
return QDateTime::fromMSecsSinceEpoch(mConferenceInfo->getDateTime() * 1000, Qt::LocalTime);
}
int ConferenceInfoModel::getDuration() const {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
return mConferenceInfo->getDuration();
}
QDateTime ConferenceInfoModel::getEndTime() const {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
return getDateTime().addSecs(mConferenceInfo->getDuration());
}
QString ConferenceInfoModel::getSubject() const {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
return Utils::coreStringToAppString(mConferenceInfo->getSubject());
}
linphone::ConferenceInfo::State ConferenceInfoModel::getState() const {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
return mConferenceInfo->getState();
}
QString ConferenceInfoModel::getOrganizerName() const {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
auto organizer = mConferenceInfo->getOrganizer();
auto name = Utils::coreStringToAppString(organizer->getDisplayName());
if (name.isEmpty()) name = ToolModel::getDisplayName(Utils::coreStringToAppString(organizer->asStringUriOnly()));
@ -103,20 +110,25 @@ QString ConferenceInfoModel::getOrganizerAddress() const {
}
QString ConferenceInfoModel::getDescription() const {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
return Utils::coreStringToAppString(mConferenceInfo->getSubject());
}
QString ConferenceInfoModel::getUri() const {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
if (auto uriAddr = mConferenceInfo->getUri()) {
return Utils::coreStringToAppString(uriAddr->asString());
} else return QString();
}
std::list<std::shared_ptr<linphone::ParticipantInfo>> ConferenceInfoModel::getParticipantInfos() const {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
return mConferenceInfo->getParticipantInfos();
}
bool ConferenceInfoModel::inviteEnabled() const {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
return mInviteEnabled;
}
@ -126,16 +138,19 @@ void ConferenceInfoModel::setDateTime(const QDateTime &date) {
}
void ConferenceInfoModel::setDuration(int duration) {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
mConferenceInfo->setDuration(duration);
emit durationChanged(duration);
}
void ConferenceInfoModel::setSubject(const QString &subject) {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
mConferenceInfo->setSubject(Utils::appStringToCoreString(subject));
emit subjectChanged(subject);
}
void ConferenceInfoModel::setOrganizer(const QString &organizerAddress) {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
auto linAddr = ToolModel::interpretUrl(organizerAddress);
if (linAddr) {
mConferenceInfo->setOrganizer(linAddr);
@ -144,32 +159,38 @@ void ConferenceInfoModel::setOrganizer(const QString &organizerAddress) {
}
void ConferenceInfoModel::setDescription(const QString &description) {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
mConferenceInfo->setDescription(Utils::appStringToCoreString(description));
emit descriptionChanged(description);
}
void ConferenceInfoModel::setParticipantInfos(
const std::list<std::shared_ptr<linphone::ParticipantInfo>> &participantInfos) {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
mConferenceInfo->setParticipantInfos(participantInfos);
emit participantsChanged();
}
void ConferenceInfoModel::deleteConferenceInfo() {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
CoreModel::getInstance()->getCore()->deleteConferenceInformation(mConferenceInfo);
emit conferenceInfoDeleted();
}
void ConferenceInfoModel::cancelConference() {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
if (!mConferenceSchedulerModel) return;
mConferenceSchedulerModel->cancelConference(mConferenceInfo);
emit conferenceInfoCanceled();
}
void ConferenceInfoModel::updateConferenceInfo() {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
mConferenceSchedulerModel->setInfo(mConferenceInfo);
}
void ConferenceInfoModel::enableInvite(bool enable) {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
if (mInviteEnabled != enable) {
mInviteEnabled = enable;
emit inviteEnabledChanged(mInviteEnabled);

View file

@ -80,9 +80,6 @@ private:
std::shared_ptr<ConferenceSchedulerModel> mConferenceSchedulerModel = nullptr;
bool mInviteEnabled = true;
DECLARE_ABSTRACT_OBJECT
// LINPHONE
//--------------------------------------------------------------------------------
};
#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)
: ::Listener<linphone::Conference, linphone::ConferenceListener>(conference, parent) {
mustBeInLinphoneThread(getClassName());
qDebug() << "[ConferenceModel] new" << this << conference.get();
lDebug() << "[ConferenceModel] new" << this << conference.get();
}
ConferenceModel::~ConferenceModel() {
@ -53,10 +53,12 @@ void ConferenceModel::setPaused(bool paused) {
}
void ConferenceModel::removeParticipant(const std::shared_ptr<linphone::Participant> &p) {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
mMonitor->removeParticipant(p);
}
void ConferenceModel::removeParticipant(const std::shared_ptr<linphone::Address> &address) {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
for (auto &p : mMonitor->getParticipantList()) {
if (address->asStringUriOnly() == p->getAddress()->asStringUriOnly()) {
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) {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
mMonitor->addParticipant(address);
}
@ -95,37 +98,13 @@ void ConferenceModel::setRecordFile(const std::string &path) {
// 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) {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
mMonitor->setParticipantAdminStatus(participant, status);
}
void ConferenceModel::setInputAudioDevice(const std::shared_ptr<linphone::AudioDevice> &device) {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
mMonitor->setInputAudioDevice(device);
std::string deviceName;
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 {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
return mMonitor->getInputAudioDevice();
}
void ConferenceModel::setOutputAudioDevice(const std::shared_ptr<linphone::AudioDevice> &device) {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
mMonitor->setOutputAudioDevice(device);
std::string deviceName;
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 {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
return mMonitor->getOutputAudioDevice();
}
void ConferenceModel::onActiveSpeakerParticipantDevice(
const std::shared_ptr<linphone::Conference> &conference,
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());
}
void ConferenceModel::onParticipantAdded(const std::shared_ptr<linphone::Conference> &conference,
const std::shared_ptr<linphone::Participant> &participant) {
// qDebug() << "onParticipantAdded: " << participant->getAddress()->asString().c_str();
emit participantAdded(participant);
}
void ConferenceModel::onParticipantRemoved(const std::shared_ptr<linphone::Conference> &conference,
const std::shared_ptr<const linphone::Participant> &participant) {
// qDebug() << "onParticipantRemoved";
emit participantRemoved(participant);
}
void ConferenceModel::onParticipantDeviceAdded(const std::shared_ptr<linphone::Conference> &conference,
const std::shared_ptr<linphone::ParticipantDevice> &participantDevice) {
qDebug() << "onParticipantDeviceAdded";
qDebug() << "Me devices : " << conference->getMe()->getDevices().size();
lDebug() << "onParticipantDeviceAdded";
lDebug() << "Me devices : " << conference->getMe()->getDevices().size();
if (conference->getMe()->getDevices().size() > 1)
for (auto d : conference->getMe()->getDevices())
qDebug() << "\t--> " << d->getAddress()->asString().c_str();
lDebug() << "\t--> " << d->getAddress()->asString().c_str();
emit participantDeviceAdded(participantDevice);
}
void ConferenceModel::onParticipantDeviceRemoved(
const std::shared_ptr<linphone::Conference> &conference,
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() << "]";
qDebug() << "Me devices : " << conference->getMe()->getDevices().size();
lDebug() << "Me devices : " << conference->getMe()->getDevices().size();
emit participantDeviceRemoved(participantDevice);
}
void ConferenceModel::onParticipantDeviceStateChanged(const std::shared_ptr<linphone::Conference> &conference,
const std::shared_ptr<const linphone::ParticipantDevice> &device,
linphone::ParticipantDevice::State state) {
qDebug() << "onParticipantDeviceStateChanged: " << device->getAddress()->asString().c_str() << " isInConf?["
lDebug() << "onParticipantDeviceStateChanged: " << device->getAddress()->asString().c_str() << " isInConf?["
<< device->isInConference() << "] " << (int)state;
emit participantDeviceStateChanged(conference, device, state);
}
void ConferenceModel::onParticipantAdminStatusChanged(const std::shared_ptr<linphone::Conference> &conference,
const std::shared_ptr<const linphone::Participant> &participant) {
qDebug() << "onParticipantAdminStatusChanged";
lDebug() << "onParticipantAdminStatusChanged";
emit participantAdminStatusChanged(participant);
}
void ConferenceModel::onParticipantDeviceMediaCapabilityChanged(
const std::shared_ptr<linphone::Conference> &conference,
const std::shared_ptr<const linphone::ParticipantDevice> &participantDevice) {
qDebug() << "onParticipantDeviceMediaCapabilityChanged: "
lDebug() << "onParticipantDeviceMediaCapabilityChanged: "
<< (int)participantDevice->getStreamCapability(linphone::StreamType::Video)
<< ". Device: " << participantDevice->getAddress()->asString().c_str();
emit participantDeviceMediaCapabilityChanged(participantDevice);
@ -205,7 +185,7 @@ void ConferenceModel::onParticipantDeviceMediaCapabilityChanged(
void ConferenceModel::onParticipantDeviceMediaAvailabilityChanged(
const std::shared_ptr<linphone::Conference> &conference,
const std::shared_ptr<const linphone::ParticipantDevice> &participantDevice) {
qDebug() << "onParticipantDeviceMediaAvailabilityChanged: "
lDebug() << "onParticipantDeviceMediaAvailabilityChanged: "
<< (int)participantDevice->getStreamAvailability(linphone::StreamType::Video)
<< ". Device: " << participantDevice->getAddress()->asString().c_str();
emit participantDeviceMediaAvailabilityChanged(participantDevice);
@ -214,21 +194,21 @@ void ConferenceModel::onParticipantDeviceIsSpeakingChanged(
const std::shared_ptr<linphone::Conference> &conference,
const std::shared_ptr<const linphone::ParticipantDevice> &participantDevice,
bool isSpeaking) {
// qDebug() << "onParticipantDeviceIsSpeakingChanged: " << participantDevice->getAddress()->asString().c_str() <<
// lDebug()<< "onParticipantDeviceIsSpeakingChanged: " << participantDevice->getAddress()->asString().c_str() <<
// ". Speaking:" << isSpeaking;
emit participantDeviceIsSpeakingChanged(participantDevice, isSpeaking);
}
void ConferenceModel::onStateChanged(const std::shared_ptr<linphone::Conference> &conference,
linphone::Conference::State newState) {
qDebug() << "onStateChanged:" << (int)newState;
lDebug() << "onStateChanged:" << (int)newState;
emit conferenceStateChanged(newState);
}
void ConferenceModel::onSubjectChanged(const std::shared_ptr<linphone::Conference> &conference,
const std::string &subject) {
qDebug() << "onSubjectChanged";
lDebug() << "onSubjectChanged";
emit subjectChanged(subject);
}
void ConferenceModel::onAudioDeviceChanged(const std::shared_ptr<linphone::Conference> &conference,
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() {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
auto uriAddr = mMonitor->getInfo() ? mMonitor->getInfo()->getUri() : nullptr;
if (uriAddr) {
return Utils::coreStringToAppString(uriAddr->asString());
@ -48,10 +49,12 @@ QString ConferenceSchedulerModel::getUri() {
}
void ConferenceSchedulerModel::setInfo(const std::shared_ptr<linphone::ConferenceInfo> &confInfo) {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
mMonitor->setInfo(confInfo);
}
void ConferenceSchedulerModel::cancelConference(const std::shared_ptr<linphone::ConferenceInfo> &confInfo) {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
mMonitor->cancelConference(confInfo);
}

View file

@ -65,7 +65,7 @@ void CoreModel::start() {
mIterateTimer->setInterval(30);
connect(mIterateTimer, &QTimer::timeout, [this]() {
static int iterateCount = 0;
if (iterateCount != 0) qCritical() << log().arg("Multi Iterate ! ");
if (iterateCount != 0) lCritical() << log().arg("Multi Iterate ! ");
++iterateCount;
mCore->iterate();
--iterateCount;
@ -92,6 +92,7 @@ void CoreModel::start() {
mCore->start();
setPathAfterStart();
mCore->enableFriendListSubscription(true);
// TODO : get this from settings
auto videoPolicy = mCore->getVideoActivationPolicy()->clone();
videoPolicy->setAutomaticallyAccept(true);
videoPolicy->setAutomaticallyInitiate(false);
@ -124,7 +125,7 @@ void CoreModel::setConfigPath(QString path) {
//-------------------------------------------------------------------------------
#define SET_FACTORY_PATH(TYPE, PATH) \
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)); \
} while (0);
@ -147,16 +148,16 @@ void CoreModel::setPathAfterStart() {
if (mCore->getZrtpSecretsFile().empty() ||
!Paths::filePathExists(Utils::coreStringToAppString(mCore->getZrtpSecretsFile()), true))
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
if (mCore->getUserCertificatesPath().empty() ||
!Paths::filePathExists(Utils::coreStringToAppString(mCore->getUserCertificatesPath()), true))
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
if (mCore->getRootCa().empty() || !Paths::filePathExists(Utils::coreStringToAppString(mCore->getRootCa())))
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 {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
return Utils::coreStringToAppString(mMonitor->getName());
}
QString ParticipantDeviceModel::getDisplayName() const {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
return Utils::coreStringToAppString(mMonitor->getAddress()->getDisplayName());
}
int ParticipantDeviceModel::getSecurityLevel() const {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
return (int)mMonitor->getSecurityLevel();
}
time_t ParticipantDeviceModel::getTimeOfJoining() const {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
return mMonitor->getTimeOfJoining();
}
QString ParticipantDeviceModel::getAddress() const {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
return Utils::coreStringToAppString(mMonitor->getAddress()->asStringUriOnly());
}
bool ParticipantDeviceModel::getPaused() const {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
return !mMonitor->isInConference() || mMonitor->getState() == linphone::ParticipantDevice::State::OnHold;
}
bool ParticipantDeviceModel::getIsSpeaking() const {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
return mMonitor->getIsSpeaking();
}
bool ParticipantDeviceModel::getIsMuted() const {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
return mMonitor->getIsMuted();
}
LinphoneEnums::ParticipantDeviceState ParticipantDeviceModel::getState() const {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
return LinphoneEnums::fromLinphone(mMonitor->getState());
}
bool ParticipantDeviceModel::isVideoEnabled() const {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
return mMonitor->isInConference() && mMonitor->getStreamAvailability(linphone::StreamType::Video) &&
(mMonitor->getStreamCapability(linphone::StreamType::Video) == linphone::MediaDirection::SendRecv ||
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,
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,
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));
}
void ParticipantDeviceModel::onStreamCapabilityChanged(
const std::shared_ptr<linphone::ParticipantDevice> &participantDevice,
linphone::MediaDirection direction,
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;
emit streamCapabilityChanged(streamType);
}
@ -121,7 +113,7 @@ void ParticipantDeviceModel::onStreamAvailabilityChanged(
const std::shared_ptr<linphone::ParticipantDevice> &participantDevice,
bool available,
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;
emit streamAvailabilityChanged(streamType);
}

View file

@ -105,7 +105,7 @@ bool ToolModel::createCall(const QString &sipAddress,
std::shared_ptr<linphone::Address> address = interpretUrl(sipAddress);
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;
if (errorMessage) {
*errorMessage = tr("The calling address is not an interpretable SIP address : ");
@ -181,10 +181,9 @@ bool ToolModel::isMe(const QString &address) {
bool isMe = false;
auto linAddr = ToolModel::interpretUrl(address);
if (!CoreModel::getInstance()->getCore()->getDefaultAccount()) {
// for (auto &account : CoreModel::getInstance()->getCore()->getAccountList()) {
// if (account->getContactAddress()->weakEqual(linAddr)) return true;
// }
isMe = false;
for (auto &account : CoreModel::getInstance()->getCore()->getAccountList()) {
if (account->getContactAddress()->weakEqual(linAddr)) return true;
}
} else {
auto accountAddr = CoreModel::getInstance()->getCore()->getDefaultAccount()->getContactAddress();
isMe = linAddr && accountAddr ? accountAddr->weakEqual(linAddr) : false;
@ -192,6 +191,16 @@ bool ToolModel::isMe(const QString &address) {
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) {
auto currentAccount = CoreModel::getInstance()->getCore()->getDefaultAccount();
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::Account> findAccount(const std::shared_ptr<const linphone::Address> &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 isLocal(const std::shared_ptr<linphone::Conference> &conference,
const std::shared_ptr<const linphone::ParticipantDevice> &device);
@ -47,11 +48,11 @@ public:
static QString getDisplayName(QString address);
static bool createCall(const QString &sipAddress,
const QVariantMap &options = {},
const QString &prepareTransfertAddress = "",
const QHash<QString, QString> &headers = {},
linphone::MediaEncryption = linphone::MediaEncryption::None,
QString *errorMessage = nullptr);
const QVariantMap &options = {},
const QString &prepareTransfertAddress = "",
const QHash<QString, QString> &headers = {},
linphone::MediaEncryption = linphone::MediaEncryption::None,
QString *errorMessage = nullptr);
private:
DECLARE_ABSTRACT_OBJECT

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) {
if (!confGui) return;
auto window = App::getInstance()->getCallsWindow(QVariant());
@ -120,15 +122,6 @@ void Utils::openCallsWindow(CallGui *call) {
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) {
auto app = App::getInstance();
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); });
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"));
// bool Utils::isMe(const QString &address) {

View file

@ -64,8 +64,6 @@ public:
const QHash<QString, QString> &headers = {});
Q_INVOKABLE static void openCallsWindow(CallGui *call);
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 void showInformationPopup(const QString &title,
const QString &description,
@ -104,6 +102,7 @@ public:
Q_INVOKABLE static QString findAvatarByAddress(const QString &address);
static QString generateSavedFilename(const QString &from, const QString &to);
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 getApplicationProduct();

View file

@ -31,6 +31,7 @@
#include "ImageProvider.hpp"
#include "tool/Constants.hpp"
#include "tool/Utils.hpp"
// =============================================================================
@ -48,7 +49,7 @@ ImageAsyncImageResponse::ImageAsyncImageResponse(const QString &id, const QSize
filters << "*.png";
QDir imageDir(path);
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"));
return;
}
@ -65,7 +66,7 @@ ImageAsyncImageResponse::ImageAsyncImageResponse(const QString &id, const QSize
QFile file(mPath);
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"));
return;
}

View file

@ -23,6 +23,7 @@
#include "SafeSharedPointer.hpp"
#include "model/core/CoreModel.hpp"
#include "tool/Utils.hpp"
#include <QMutex>
#include <QObject>
@ -74,7 +75,7 @@ public:
~SafeConnection() {
mLocker.lock();
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;
mCore.reset();
mModel.reset();

View file

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

View file

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

View file

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

View file

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

View file

@ -7,6 +7,8 @@ import Linphone
Item {
id: mainItem
property color indicatorColor: DefaultStyle.main1_500_main
property alias indicatorHeight: busyIndicator.height
property alias indicatorWidth: busyIndicator.width
width: busyIndicator.width
height: busyIndicator.height
Control.BusyIndicator {
@ -20,13 +22,13 @@ Item {
imageSource: AppIcons.busyIndicator
colorizationColor: mainItem.indicatorColor
RotationAnimator {
target: busyImage
running: busyIndicator.running
from: 0
to: 360
loops: Animation.Infinite
duration: 15000
}
target: busyImage
running: busyIndicator.running
from: 0
to: 360
loops: Animation.Infinite
duration: 15000
}
}
}
}
}

View file

@ -117,8 +117,8 @@ Control.Button {
ButtonText {}
ButtonImage{}
Item {
Layout.fillWidth : true
Layout.fillHeight : true
Layout.fillWidth: true
Layout.fillHeight: true
}
}
}

View file

@ -7,6 +7,7 @@ import Linphone
import ConstantsCpp 1.0
import UtilsCpp 1.0
// TODO : spacing
ListView {
id: mainItem
// width: 400 * DefaultStyle.dp
@ -16,8 +17,6 @@ ListView {
clip: true
property int maxYears: 5
readonly property var currentDate: new Date()
Layout.fillWidth: true
Layout.fillHeight: true
highlightMoveDuration: 100
property var selectedDate
@ -25,6 +24,7 @@ ListView {
model: Control.CalendarModel {
id: calendarModel
from: new Date()
// TODO : dynamically add 5 years
to: new Date(2025, 12, 31)
}
@ -34,6 +34,7 @@ ListView {
RowLayout {
Layout.fillWidth: true
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
font {
pixelSize: 14 * DefaultStyle.dp

View file

@ -31,8 +31,9 @@ Item {
topPadding: 20 * DefaultStyle.dp
bottomPadding: 25 * DefaultStyle.dp
contentItem: ColumnLayout {
spacing: 10 * DefaultStyle.dp
spacing: 16 * DefaultStyle.dp
RowLayout {
spacing: 0
Text {
text: qsTr("Which channel do you choose?")
font {
@ -44,6 +45,7 @@ Item {
Button {
Layout.preferredWidth: 24 * DefaultStyle.dp
Layout.preferredHeight: 24 * DefaultStyle.dp
Layout.alignment: Qt.AlignVCenter
background: Item{}
icon.source:AppIcons.closeX
width: 24 * DefaultStyle.dp
@ -64,6 +66,7 @@ Item {
}
Layout.fillWidth: true
Layout.preferredHeight: contentHeight
spacing: 10 * DefaultStyle.dp
delegate: Item {
width: parent.width
height: 56 * DefaultStyle.dp
@ -72,9 +75,10 @@ Item {
anchors.verticalCenter: parent.verticalCenter
spacing: 10 * DefaultStyle.dp
ColumnLayout {
spacing: 7 * DefaultStyle.dp
Text {
Layout.leftMargin: 5 * DefaultStyle.dp
text: modelData.label
text: modelData.label + " :"
font {
pixelSize: 13 * DefaultStyle.dp
weight: 700 * DefaultStyle.dp
@ -138,19 +142,16 @@ Item {
active: true
interactive: true
policy: Control.ScrollBar.AsNeeded
// Layout.fillWidth: true
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.right: parent.right
anchors.rightMargin: 8 * DefaultStyle.dp
// x: mainItem.x + mainItem.width - width
// anchors.left: control.right
}
ColumnLayout {
id: content
width: parent.width
spacing: 25 * DefaultStyle.dp
spacing: 32 * DefaultStyle.dp
Button {
visible: mainItem.groupCallVisible
Layout.preferredWidth: 320 * DefaultStyle.dp
@ -165,6 +166,7 @@ Item {
radius: 50 * DefaultStyle.dp
}
contentItem: RowLayout {
spacing: 16 * DefaultStyle.dp
anchors.verticalCenter: parent.verticalCenter
Image {
source: AppIcons.groupCall
@ -191,35 +193,8 @@ Item {
}
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 {
spacing: 18 * DefaultStyle.dp
Text {
text: qsTr("All contacts")
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 {
spacing: 18 * DefaultStyle.dp
Text {
text: qsTr("Suggestions")
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 {

View file

@ -27,136 +27,144 @@ ColumnLayout {
leftPadding: 25 * DefaultStyle.dp
rightPadding: 25 * DefaultStyle.dp
contentItem: ColumnLayout {
spacing: 10 * DefaultStyle.dp
RowLayout {
Layout.fillWidth: true
EffectImage {
imageSource: AppIcons.speaker
colorizationColor: DefaultStyle.main1_500_main
Layout.preferredWidth: 24 * DefaultStyle.dp
Layout.preferredHeight: 24 * DefaultStyle.dp
imageWidth: 24 * DefaultStyle.dp
imageHeight: 24 * DefaultStyle.dp
}
Text {
text: qsTr("Haut-parleurs")
Layout.fillWidth: true
}
}
ComboBox {
id: outputAudioDeviceCBox
Layout.fillWidth: true
Layout.preferredWidth: parent.width
Layout.preferredHeight: 49 * DefaultStyle.dp
model: SettingsCpp.outputAudioDevicesList
onCurrentTextChanged: {
if (mainItem.call) mainItem.call.core.lSetOutputAudioDevice(currentText)
}
}
Slider {
id: speakerVolume
Layout.fillWidth: true
from: 0.0
to: 1.0
value: mainItem.call ? mainItem.call.core.speakerVolumeGain : 0.5
onMoved: {
if (mainItem.call) mainItem.call.core.lSetSpeakerVolumeGain(value)
}
}
RowLayout {
Layout.fillWidth: true
EffectImage {
imageSource: AppIcons.microphone
colorizationColor: DefaultStyle.main1_500_main
Layout.preferredWidth: 24 * DefaultStyle.dp
Layout.preferredHeight: 24 * DefaultStyle.dp
imageWidth: 24 * DefaultStyle.dp
imageHeight: 24 * DefaultStyle.dp
}
Text {
text: qsTr("Microphone")
Layout.fillWidth: true
}
}
ComboBox {
id: inputAudioDeviceCBox
Layout.fillWidth: true
Layout.preferredWidth: parent.width
Layout.preferredHeight: 49 * DefaultStyle.dp
model: SettingsCpp.inputAudioDevicesList
onCurrentTextChanged: {
if (mainItem.call) mainItem.call.core.lSetInputAudioDevice(currentText)
}
}
Slider {
id: microVolume
Layout.fillWidth: true
from: 0.0
to: 1.0
value: mainItem.call ? mainItem.call.core.microphoneVolumeGain : 0.5
onMoved: {
if (mainItem.call) mainItem.call.core.lSetMicrophoneVolumeGain(value)
}
}
Timer {
interval: 50
repeat: true
running: mainItem.call || false
onTriggered: audioTestSlider.value = (mainItem.call && mainItem.call.core.microVolume)
}
Slider {
id: audioTestSlider
Layout.fillWidth: true
enabled: false
Layout.preferredHeight: 10 * DefaultStyle.dp
background: Rectangle {
x: audioTestSlider.leftPadding
y: audioTestSlider.topPadding + audioTestSlider.availableHeight / 2 - height / 2
implicitWidth: 200 * DefaultStyle.dp
implicitHeight: 10 * DefaultStyle.dp
width: audioTestSlider.availableWidth
height: implicitHeight
radius: 2 * DefaultStyle.dp
color: "#D9D9D9"
Rectangle {
width: audioTestSlider.visualPosition * parent.width
height: parent.height
gradient: Gradient {
orientation: Gradient.Horizontal
GradientStop { position: 0.0; color: "#6FF88D" }
GradientStop { position: 1.0; color: "#00D916" }
}
radius: 2 * DefaultStyle.dp
spacing: 40 * DefaultStyle.dp
ColumnLayout {
spacing: 12 * DefaultStyle.dp
RowLayout {
spacing: 8 * DefaultStyle.dp
EffectImage {
imageSource: AppIcons.speaker
colorizationColor: DefaultStyle.main1_500_main
Layout.preferredWidth: 24 * DefaultStyle.dp
Layout.preferredHeight: 24 * DefaultStyle.dp
imageWidth: 24 * DefaultStyle.dp
imageHeight: 24 * DefaultStyle.dp
}
Text {
text: qsTr("Haut-parleurs")
Layout.fillWidth: true
}
}
handle: Item {visible: false}
}
RowLayout {
Layout.fillWidth: true
EffectImage {
imageSource: AppIcons.videoCamera
colorizationColor: DefaultStyle.main1_500_main
Layout.preferredWidth: 24 * DefaultStyle.dp
Layout.preferredHeight: 24 * DefaultStyle.dp
imageWidth: 24 * DefaultStyle.dp
imageHeight: 24 * DefaultStyle.dp
}
Text {
text: qsTr("Caméra")
ComboBox {
id: outputAudioDeviceCBox
Layout.fillWidth: true
Layout.preferredWidth: parent.width
Layout.preferredHeight: 49 * DefaultStyle.dp
model: SettingsCpp.outputAudioDevicesList
onCurrentTextChanged: {
if (mainItem.call) mainItem.call.core.lSetOutputAudioDevice(currentText)
}
}
Slider {
id: speakerVolume
Layout.fillWidth: true
from: 0.0
to: 1.0
value: mainItem.call ? mainItem.call.core.speakerVolumeGain : 0.5
onMoved: {
if (mainItem.call) mainItem.call.core.lSetSpeakerVolumeGain(value)
}
}
}
ComboBox {
Layout.fillWidth: true
Layout.preferredWidth: parent.width
Layout.preferredHeight: 49 * DefaultStyle.dp
model: SettingsCpp.videoDevicesList
currentIndex: SettingsCpp.currentVideoDeviceIndex
onCurrentTextChanged: {
SettingsCpp.lSetVideoDevice(currentText)
ColumnLayout {
spacing: 12 * DefaultStyle.dp
RowLayout {
spacing: 8 * DefaultStyle.dp
EffectImage {
imageSource: AppIcons.microphone
colorizationColor: DefaultStyle.main1_500_main
Layout.preferredWidth: 24 * DefaultStyle.dp
Layout.preferredHeight: 24 * DefaultStyle.dp
imageWidth: 24 * DefaultStyle.dp
imageHeight: 24 * DefaultStyle.dp
}
Text {
text: qsTr("Microphone")
Layout.fillWidth: true
}
}
ComboBox {
id: inputAudioDeviceCBox
Layout.fillWidth: true
Layout.preferredWidth: parent.width
Layout.preferredHeight: 49 * DefaultStyle.dp
model: SettingsCpp.inputAudioDevicesList
onCurrentTextChanged: {
if (mainItem.call) mainItem.call.core.lSetInputAudioDevice(currentText)
}
}
Slider {
id: microVolume
Layout.fillWidth: true
from: 0.0
to: 1.0
value: mainItem.call ? mainItem.call.core.microphoneVolumeGain : 0.5
onMoved: {
if (mainItem.call) mainItem.call.core.lSetMicrophoneVolumeGain(value)
}
}
Timer {
interval: 50
repeat: true
running: mainItem.call || false
onTriggered: audioTestSlider.value = (mainItem.call && mainItem.call.core.microVolume)
}
Slider {
id: audioTestSlider
Layout.fillWidth: true
enabled: false
Layout.preferredHeight: 10 * DefaultStyle.dp
background: Rectangle {
x: audioTestSlider.leftPadding
y: audioTestSlider.topPadding + audioTestSlider.availableHeight / 2 - height / 2
implicitWidth: 200 * DefaultStyle.dp
implicitHeight: 10 * DefaultStyle.dp
width: audioTestSlider.availableWidth
height: implicitHeight
radius: 2 * DefaultStyle.dp
color: "#D9D9D9"
Rectangle {
width: audioTestSlider.visualPosition * parent.width
height: parent.height
gradient: Gradient {
orientation: Gradient.Horizontal
GradientStop { position: 0.0; color: "#6FF88D" }
GradientStop { position: 1.0; color: "#00D916" }
}
radius: 2 * DefaultStyle.dp
}
}
handle: Item {visible: false}
}
}
ColumnLayout {
spacing: 12 * DefaultStyle.dp
RowLayout {
spacing: 8 * DefaultStyle.dp
EffectImage {
imageSource: AppIcons.videoCamera
colorizationColor: DefaultStyle.main1_500_main
Layout.preferredWidth: 24 * DefaultStyle.dp
Layout.preferredHeight: 24 * DefaultStyle.dp
imageWidth: 24 * DefaultStyle.dp
imageHeight: 24 * DefaultStyle.dp
}
Text {
text: qsTr("Caméra")
Layout.fillWidth: true
}
}
ComboBox {
Layout.fillWidth: true
Layout.preferredWidth: parent.width
Layout.preferredHeight: 49 * DefaultStyle.dp
model: SettingsCpp.videoDevicesList
currentIndex: SettingsCpp.currentVideoDeviceIndex
onCurrentTextChanged: {
SettingsCpp.lSetVideoDevice(currentText)
}
}
}
}

View file

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

View file

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

View file

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

View file

@ -147,11 +147,9 @@ ListView {
RowLayout {
id: actionsRow
z: 1
// visible: mainItem.actionLayoutVisible || friendPopup.visible
// anchors.fill: parent
anchors.right: parent.right
// anchors.rightMargin: 10 * DefaultStyle.dp
anchors.verticalCenter: parent.verticalCenter
spacing: 10 * DefaultStyle.dp // TODO : change when mockup ready
RowLayout{
visible: mainItem.actionLayoutVisible
spacing: 10 * DefaultStyle.dp
@ -260,15 +258,6 @@ ListView {
}
onClicked: {
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) {
var indexInSelection = mainItem.selectedContacts.indexOf(modelData.core.defaultAddress)
if (indexInSelection == -1) {

View file

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

View file

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

View file

@ -74,7 +74,7 @@ ListView {
property string previousDateString: previousItem ? UtilsCpp.toDateString(previousItem.core ? previousItem.core.dateTimeUtc : UtilsCpp.getCurrentDateTimeUtc()) : ''
property bool isFirst : ListView.previousSection !== ListView.section
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

View file

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

View file

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

View file

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

View file

@ -20,7 +20,7 @@ Control.Switch {
Rectangle {
anchors.verticalCenter: parent.verticalCenter
property int margin: 4 * DefaultStyle.dp
x: mainItem.checked ? parent.width - width - margin : margin
x: mainItem.checked ? parent.width - width - margin : margin
width: 12 * DefaultStyle.dp
height: 12 * DefaultStyle.dp
radius: 10 * DefaultStyle.dp

View file

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

View file

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

View file

@ -12,6 +12,7 @@ Mosaic {
property bool videoEnabled: true
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
//onParticipantCountChanged: participantCount > ConstantsCpp.maxMosaicParticipants ? SettingsModel.setLimitedMosaicQuality() : SettingsModel.setHighMosaicQuality()
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)
}
height: grid.cellHeight - 10
width: grid.cellWidth - 10
height: grid.cellHeight - 10 * DefaultStyle.dp
width: grid.cellWidth - 10 * DefaultStyle.dp
Sticker {
id: cameraView
previewEnabled: index == 0
@ -42,25 +43,6 @@ Mosaic {
participantDevice: avatarCell.currentDevice
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 {
id: mainItem
spacing: 15 * DefaultStyle.dp
property string placeHolderText: qsTr("Rechercher des contacts")
property list<string> selectedParticipants: contactList.selectedContacts
property int selectedParticipantsCount: selectedParticipants.length
property ConferenceInfoGui conferenceInfoGui
property bool nameGroupCall: false
readonly property string groupName: groupCallName.text
// Layout.preferredWidth: 362 * DefaultStyle.dp
function clearSelectedParticipants() {
contactList.selectedContacts.clear()
@ -24,6 +24,7 @@ ColumnLayout {
spacing: 5 * DefaultStyle.dp
Layout.rightMargin: 38 * DefaultStyle.dp
RowLayout {
spacing: 0
Text {
font.pixelSize: 13 * DefaultStyle.dp
font.weight: 700 * DefaultStyle.dp
@ -56,6 +57,7 @@ ColumnLayout {
width: participantList.width - scrollbar.implicitWidth - 12 * DefaultStyle.dp
RowLayout {
anchors.fill: parent
spacing: 10 * DefaultStyle.dp
Avatar {
Layout.preferredWidth: 45 * DefaultStyle.dp
Layout.preferredHeight: 45 * DefaultStyle.dp
@ -139,6 +141,7 @@ ColumnLayout {
address: sipAddr.text
}
ColumnLayout {
spacing: 0
Text {
id: sipAddr
text: UtilsCpp.generateLinphoneSipAddress(searchbar.text)

View file

@ -10,6 +10,7 @@ ColumnLayout{
property alias delegateModel: grid.model
property alias cellHeight: grid.cellHeight
property alias cellWidth: grid.cellWidth
property alias margins: grid.margin
function appendItem(item){
mainLayout.delegateModel.model.append(item)
@ -52,9 +53,11 @@ ColumnLayout{
onWidthChanged: grid.updateLayout()
onHeightChanged: grid.updateLayout()
spacing: 0
GridView{
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 columns: 1
property int rows: 1

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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