fix account list singleton
fix magic search list thread connection
fix allow calling a connected account
fix magic search flags
fix crash on close settings destruction
magic search thread
meeeting fix time zone
rename settingscore
remove settings from notifier
fix zrtp appearance received call
remove deprecated function; TODO : send invitations when sdk updated
This commit is contained in:
Gaelle Braud 2024-09-07 12:01:32 +02:00
parent 7970cd49f0
commit 3debdf4bb5
47 changed files with 458 additions and 376 deletions

View file

@ -38,7 +38,6 @@
#include "core/account/AccountCore.hpp" #include "core/account/AccountCore.hpp"
#include "core/account/AccountDeviceGui.hpp" #include "core/account/AccountDeviceGui.hpp"
#include "core/account/AccountDeviceProxy.hpp" #include "core/account/AccountDeviceProxy.hpp"
#include "core/account/AccountProxy.hpp"
#include "core/address-books/LdapGui.hpp" #include "core/address-books/LdapGui.hpp"
#include "core/address-books/LdapProxy.hpp" #include "core/address-books/LdapProxy.hpp"
#include "core/call-history/CallHistoryProxy.hpp" #include "core/call-history/CallHistoryProxy.hpp"
@ -415,10 +414,11 @@ void App::initCore() {
mLinphoneThread->getThreadId(), mLinphoneThread->getThreadId(),
[this]() mutable { [this]() mutable {
CoreModel::getInstance()->start(); CoreModel::getInstance()->start();
auto settings = Settings::create(); auto settings = SettingsCore::create();
QMetaObject::invokeMethod(App::getInstance()->thread(), [this, settings]() mutable { QMetaObject::invokeMethod(App::getInstance()->thread(), [this, settings] {
// QML // QML
mEngine = new QQmlApplicationEngine(this); mEngine = new QQmlApplicationEngine(this);
assert(mEngine);
// Provide `+custom` folders for custom components and `5.9` for old components. // Provide `+custom` folders for custom components and `5.9` for old components.
QStringList selectors("custom"); QStringList selectors("custom");
const QVersionNumber &version = QLibraryInfo::version(); const QVersionNumber &version = QLibraryInfo::version();
@ -460,9 +460,11 @@ void App::initCore() {
mEngine->addImageProvider(WindowIconProvider::ProviderId, new WindowIconProvider()); mEngine->addImageProvider(WindowIconProvider::ProviderId, new WindowIconProvider());
// Enable notifications. // Enable notifications.
mNotifier = new Notifier(mEngine, settings); mNotifier = new Notifier(mEngine);
mSettings = settings; mSettings = settings;
settings.reset(); mEngine->setObjectOwnership(mSettings.get(), QQmlEngine::CppOwnership);
mAccountList = AccountList::create();
mCallList = CallList::create();
const QUrl url(u"qrc:/Linphone/view/App/Main.qml"_qs); const QUrl url(u"qrc:/Linphone/view/App/Main.qml"_qs);
QObject::connect( QObject::connect(
@ -479,7 +481,7 @@ void App::initCore() {
} }
}, },
Qt::QueuedConnection); Qt::QueuedConnection);
QObject::connect(mSettings.get(), &Settings::autoStartChanged, [this]() { QObject::connect(mSettings.get(), &SettingsCore::autoStartChanged, [this]() {
mustBeInMainThread(log().arg(Q_FUNC_INFO)); mustBeInMainThread(log().arg(Q_FUNC_INFO));
setAutoStart(mSettings->getAutoStart()); setAutoStart(mSettings->getAutoStart());
}); });
@ -515,9 +517,15 @@ void App::initCppInterfaces() {
"EnumsToStringCpp", 1, 0, "EnumsToStringCpp", "EnumsToStringCpp", 1, 0, "EnumsToStringCpp",
[](QQmlEngine *engine, QJSEngine *) -> QObject * { return new EnumsToString(engine); }); [](QQmlEngine *engine, QJSEngine *) -> QObject * { return new EnumsToString(engine); });
qmlRegisterSingletonType<Settings>( qmlRegisterSingletonType<SettingsCore>(
"SettingsCpp", 1, 0, "SettingsCpp", "SettingsCpp", 1, 0, "SettingsCpp",
[this](QQmlEngine *engine, QJSEngine *) -> QObject * { return mSettings.get(); }); [this](QQmlEngine *engine, QJSEngine *) -> QObject * { return mSettings.get(); });
qmlRegisterSingletonType<AccountList>(
"LinphoneAccountsCpp", 1, 0, "LinphoneAccountsCpp",
[this](QQmlEngine *engine, QJSEngine *) -> QObject * { return mAccountList.get(); });
qmlRegisterSingletonType<CallList>(
"LinphoneCallsCpp", 1, 0, "LinphoneCallsCpp",
[this](QQmlEngine *engine, QJSEngine *) -> QObject * { return mCallList.get(); });
qmlRegisterType<PhoneNumberProxy>(Constants::MainQmlUri, 1, 0, "PhoneNumberProxy"); qmlRegisterType<PhoneNumberProxy>(Constants::MainQmlUri, 1, 0, "PhoneNumberProxy");
qmlRegisterType<VariantObject>(Constants::MainQmlUri, 1, 0, "VariantObject"); qmlRegisterType<VariantObject>(Constants::MainQmlUri, 1, 0, "VariantObject");
@ -530,15 +538,15 @@ void App::initCppInterfaces() {
qmlRegisterType<PhoneNumberProxy>(Constants::MainQmlUri, 1, 0, "PhoneNumberProxy"); qmlRegisterType<PhoneNumberProxy>(Constants::MainQmlUri, 1, 0, "PhoneNumberProxy");
qmlRegisterUncreatableType<PhoneNumber>(Constants::MainQmlUri, 1, 0, "PhoneNumber", QLatin1String("Uncreatable")); qmlRegisterUncreatableType<PhoneNumber>(Constants::MainQmlUri, 1, 0, "PhoneNumber", QLatin1String("Uncreatable"));
qmlRegisterType<AccountProxy>(Constants::MainQmlUri, 1, 0, "AccountProxy");
qmlRegisterType<AccountGui>(Constants::MainQmlUri, 1, 0, "AccountGui"); qmlRegisterType<AccountGui>(Constants::MainQmlUri, 1, 0, "AccountGui");
qmlRegisterType<AccountProxy>(Constants::MainQmlUri, 1, 0, "AccountProxy");
qmlRegisterType<AccountDeviceProxy>(Constants::MainQmlUri, 1, 0, "AccountDeviceProxy"); qmlRegisterType<AccountDeviceProxy>(Constants::MainQmlUri, 1, 0, "AccountDeviceProxy");
qmlRegisterType<AccountDeviceGui>(Constants::MainQmlUri, 1, 0, "AccountDeviceGui"); qmlRegisterType<AccountDeviceGui>(Constants::MainQmlUri, 1, 0, "AccountDeviceGui");
qmlRegisterUncreatableType<AccountCore>(Constants::MainQmlUri, 1, 0, "AccountCore", QLatin1String("Uncreatable")); qmlRegisterUncreatableType<AccountCore>(Constants::MainQmlUri, 1, 0, "AccountCore", QLatin1String("Uncreatable"));
qmlRegisterUncreatableType<CallCore>(Constants::MainQmlUri, 1, 0, "CallCore", QLatin1String("Uncreatable")); qmlRegisterUncreatableType<CallCore>(Constants::MainQmlUri, 1, 0, "CallCore", QLatin1String("Uncreatable"));
qmlRegisterType<CallProxy>(Constants::MainQmlUri, 1, 0, "CallProxy");
qmlRegisterType<CallHistoryProxy>(Constants::MainQmlUri, 1, 0, "CallHistoryProxy"); qmlRegisterType<CallHistoryProxy>(Constants::MainQmlUri, 1, 0, "CallHistoryProxy");
qmlRegisterType<CallGui>(Constants::MainQmlUri, 1, 0, "CallGui"); qmlRegisterType<CallGui>(Constants::MainQmlUri, 1, 0, "CallGui");
qmlRegisterType<CallProxy>(Constants::MainQmlUri, 1, 0, "CallProxy");
qmlRegisterUncreatableType<ConferenceCore>(Constants::MainQmlUri, 1, 0, "ConferenceCore", qmlRegisterUncreatableType<ConferenceCore>(Constants::MainQmlUri, 1, 0, "ConferenceCore",
QLatin1String("Uncreatable")); QLatin1String("Uncreatable"));
qmlRegisterType<ConferenceGui>(Constants::MainQmlUri, 1, 0, "ConferenceGui"); qmlRegisterType<ConferenceGui>(Constants::MainQmlUri, 1, 0, "ConferenceGui");
@ -573,14 +581,10 @@ void App::initCppInterfaces() {
//------------------------------------------------------------ //------------------------------------------------------------
void App::clean() { void App::clean() {
if (mSettings) mSettings.reset();
// Wait 500ms to let time for log te be stored.
// mNotifier destroyed in mEngine deletion as it is its parent
delete mEngine; delete mEngine;
mEngine = nullptr; mEngine = nullptr;
// if (mSettings) { // Wait 500ms to let time for log te be stored.
// mSettings.reset(); // mNotifier destroyed in mEngine deletion as it is its parent
// }
qApp->processEvents(QEventLoop::AllEvents, 500); qApp->processEvents(QEventLoop::AllEvents, 500);
if (mLinphoneThread) { if (mLinphoneThread) {
mLinphoneThread->exit(); mLinphoneThread->exit();
@ -725,6 +729,18 @@ void App::setMainWindow(QQuickWindow *data) {
} }
} }
QSharedPointer<AccountList> App::getAccountList() const {
return mAccountList;
}
QSharedPointer<CallList> App::getCallList() const {
return mCallList;
}
QSharedPointer<SettingsCore> App::getSettings() const {
return mSettings;
}
#ifdef Q_OS_LINUX #ifdef Q_OS_LINUX
QString App::getApplicationPath() const { QString App::getApplicationPath() const {
const QString binPath(QCoreApplication::applicationFilePath()); const QString binPath(QCoreApplication::applicationFilePath());

View file

@ -22,6 +22,8 @@
#include <QQmlApplicationEngine> #include <QQmlApplicationEngine>
#include <QSharedPointer> #include <QSharedPointer>
#include "core/account/AccountProxy.hpp"
#include "core/call/CallProxy.hpp"
#include "core/setting/SettingsCore.hpp" #include "core/setting/SettingsCore.hpp"
#include "core/singleapplication/singleapplication.h" #include "core/singleapplication/singleapplication.h"
#include "model/cli/CliModel.hpp" #include "model/cli/CliModel.hpp"
@ -114,6 +116,9 @@ public:
QQuickWindow *getMainWindow() const; QQuickWindow *getMainWindow() const;
void setMainWindow(QQuickWindow *data); void setMainWindow(QQuickWindow *data);
QSharedPointer<AccountList> getAccountList() const;
QSharedPointer<CallList> getCallList() const;
QSharedPointer<SettingsCore> getSettings() const;
#ifdef Q_OS_LINUX #ifdef Q_OS_LINUX
Q_INVOKABLE void exportDesktopFile(); Q_INVOKABLE void exportDesktopFile();
@ -142,7 +147,9 @@ private:
Notifier *mNotifier = nullptr; Notifier *mNotifier = nullptr;
QQuickWindow *mMainWindow = nullptr; QQuickWindow *mMainWindow = nullptr;
QQuickWindow *mCallsWindow = nullptr; QQuickWindow *mCallsWindow = nullptr;
QSharedPointer<Settings> mSettings; QSharedPointer<SettingsCore> mSettings;
QSharedPointer<AccountList> mAccountList;
QSharedPointer<CallList> mCallList;
QSharedPointer<SafeConnection<App, CoreModel>> mCoreModelConnection; QSharedPointer<SafeConnection<App, CoreModel>> mCoreModelConnection;
QSharedPointer<SafeConnection<App, CliModel>> mCliModelConnection; QSharedPointer<SafeConnection<App, CliModel>> mCliModelConnection;
bool mAutoStart = false; bool mAutoStart = false;

View file

@ -38,6 +38,7 @@ QSharedPointer<AccountList> AccountList::create() {
AccountList::AccountList(QObject *parent) : ListProxy(parent) { AccountList::AccountList(QObject *parent) : ListProxy(parent) {
mustBeInMainThread(getClassName()); mustBeInMainThread(getClassName());
App::getInstance()->mEngine->setObjectOwnership(this, QQmlEngine::CppOwnership);
} }
AccountList::~AccountList() { AccountList::~AccountList() {
@ -84,6 +85,7 @@ void AccountList::setSelf(QSharedPointer<AccountList> me) {
mModelConnection->makeConnectToModel(&CoreModel::accountAdded, &AccountList::lUpdate); mModelConnection->makeConnectToModel(&CoreModel::accountAdded, &AccountList::lUpdate);
lUpdate(); lUpdate();
emit initialized();
} }
QSharedPointer<AccountCore> AccountList::getDefaultAccountCore() const { QSharedPointer<AccountCore> AccountList::getDefaultAccountCore() const {

View file

@ -54,6 +54,7 @@ signals:
void lUpdate(); void lUpdate();
void haveAccountChanged(); void haveAccountChanged();
void defaultAccountChanged(); void defaultAccountChanged();
void initialized();
private: private:
bool mHaveAccount = false; bool mHaveAccount = false;

View file

@ -21,13 +21,10 @@
#include "AccountProxy.hpp" #include "AccountProxy.hpp"
#include "AccountGui.hpp" #include "AccountGui.hpp"
#include "AccountList.hpp" #include "AccountList.hpp"
#include "core/App.hpp"
AccountProxy::AccountProxy(QObject *parent) : SortFilterProxy(parent) { AccountProxy::AccountProxy(QObject *parent) : SortFilterProxy(parent) {
mAccountList = AccountList::create(); setSourceModel(App::getInstance()->getAccountList().get());
connect(mAccountList.get(), &AccountList::countChanged, this, &AccountProxy::resetDefaultAccount);
connect(mAccountList.get(), &AccountList::defaultAccountChanged, this, &AccountProxy::resetDefaultAccount);
connect(mAccountList.get(), &AccountList::haveAccountChanged, this, &AccountProxy::haveAccountChanged);
setSourceModel(mAccountList.get());
sort(0); sort(0);
} }
@ -73,6 +70,20 @@ bool AccountProxy::getHaveAccount() const {
return dynamic_cast<AccountList *>(sourceModel())->getHaveAccount(); return dynamic_cast<AccountList *>(sourceModel())->getHaveAccount();
} }
void AccountProxy::setSourceModel(QAbstractItemModel *model) {
auto oldAccountList = dynamic_cast<AccountList *>(sourceModel());
if (oldAccountList) {
disconnect(oldAccountList);
}
auto newAccountList = dynamic_cast<AccountList *>(model);
if (newAccountList) {
connect(newAccountList, &AccountList::countChanged, this, &AccountProxy::resetDefaultAccount);
connect(newAccountList, &AccountList::defaultAccountChanged, this, &AccountProxy::resetDefaultAccount);
connect(newAccountList, &AccountList::haveAccountChanged, this, &AccountProxy::haveAccountChanged);
}
QSortFilterProxyModel::setSourceModel(model);
}
bool AccountProxy::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const { bool AccountProxy::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const {
bool show = (mFilterText.isEmpty() || mFilterText == "*"); bool show = (mFilterText.isEmpty() || mFilterText == "*");
if (!show) { if (!show) {

View file

@ -49,10 +49,13 @@ public:
bool getHaveAccount() const; bool getHaveAccount() const;
void setSourceModel(QAbstractItemModel *sourceModel) override;
signals: signals:
void filterTextChanged(); void filterTextChanged();
void defaultAccountChanged(); void defaultAccountChanged();
void haveAccountChanged(); void haveAccountChanged();
void initialized();
protected: protected:
virtual bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override; virtual bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const override;
@ -60,7 +63,6 @@ protected:
QString mFilterText; QString mFilterText;
QSharedPointer<AccountCore> mDefaultAccount; // When null, a new UI object is build from List QSharedPointer<AccountCore> mDefaultAccount; // When null, a new UI object is build from List
QSharedPointer<AccountList> mAccountList;
}; };
#endif #endif

View file

@ -44,6 +44,7 @@ QSharedPointer<CallCore> CallList::createCallCore(const std::shared_ptr<linphone
CallList::CallList(QObject *parent) : ListProxy(parent) { CallList::CallList(QObject *parent) : ListProxy(parent) {
mustBeInMainThread(getClassName()); mustBeInMainThread(getClassName());
App::getInstance()->mEngine->setObjectOwnership(this, QQmlEngine::CppOwnership);
} }
CallList::~CallList() { CallList::~CallList() {

View file

@ -21,15 +21,12 @@
#include "CallProxy.hpp" #include "CallProxy.hpp"
#include "CallGui.hpp" #include "CallGui.hpp"
#include "CallList.hpp" #include "CallList.hpp"
#include "core/App.hpp"
DEFINE_ABSTRACT_OBJECT(CallProxy) DEFINE_ABSTRACT_OBJECT(CallProxy)
CallProxy::CallProxy(QObject *parent) : SortFilterProxy(parent) { CallProxy::CallProxy(QObject *parent) : SortFilterProxy(parent) {
mList = CallList::create(); setSourceModel(App::getInstance()->getCallList().get());
connect(mList.get(), &CallList::currentCallChanged, this, &CallProxy::resetCurrentCall);
connect(mList.get(), &CallList::haveCallChanged, this, &CallProxy::haveCallChanged);
connect(this, &CallProxy::lMergeAll, mList.get(), &CallList::lMergeAll);
setSourceModel(mList.get());
sort(0); sort(0);
} }
@ -68,6 +65,20 @@ bool CallProxy::getHaveCall() const {
return dynamic_cast<CallList *>(sourceModel())->getHaveCall(); return dynamic_cast<CallList *>(sourceModel())->getHaveCall();
} }
void CallProxy::setSourceModel(QAbstractItemModel *model) {
auto oldCallList = dynamic_cast<CallList *>(sourceModel());
if (oldCallList) {
disconnect(oldCallList);
}
auto newCallList = dynamic_cast<CallList *>(model);
if (newCallList) {
connect(newCallList, &CallList::currentCallChanged, this, &CallProxy::resetCurrentCall);
connect(newCallList, &CallList::haveCallChanged, this, &CallProxy::haveCallChanged);
connect(this, &CallProxy::lMergeAll, newCallList, &CallList::lMergeAll);
}
QSortFilterProxyModel::setSourceModel(model);
}
bool CallProxy::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const { bool CallProxy::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const {
bool show = (mFilterText.isEmpty() || mFilterText == "*"); bool show = (mFilterText.isEmpty() || mFilterText == "*");
if (!show) { if (!show) {

View file

@ -50,6 +50,8 @@ public:
bool getHaveCall() const; bool getHaveCall() const;
void setSourceModel(QAbstractItemModel *sourceModel) override;
signals: signals:
void lMergeAll(); void lMergeAll();
void filterTextChanged(); void filterTextChanged();
@ -62,7 +64,6 @@ protected:
QString mFilterText; QString mFilterText;
CallGui *mCurrentCall = nullptr; // When null, a new UI object is build from List CallGui *mCurrentCall = nullptr; // When null, a new UI object is build from List
QSharedPointer<CallList> mList;
DECLARE_ABSTRACT_OBJECT DECLARE_ABSTRACT_OBJECT
}; };

View file

@ -574,6 +574,7 @@ void ConferenceInfoCore::save() {
if (CoreModel::getInstance()->getCore()->getDefaultAccount()->getState() != if (CoreModel::getInstance()->getCore()->getDefaultAccount()->getState() !=
linphone::RegistrationState::Ok) { linphone::RegistrationState::Ok) {
Utils::showInformationPopup(tr("Erreur"), tr("Votre compte est déconnecté"), false); Utils::showInformationPopup(tr("Erreur"), tr("Votre compte est déconnecté"), false);
emit saveFailed();
return; return;
} }
auto linphoneConf = auto linphoneConf =

View file

@ -150,6 +150,7 @@ signals:
void conferenceInfoStateChanged(); void conferenceInfoStateChanged();
void conferenceSchedulerStateChanged(); void conferenceSchedulerStateChanged();
void timeZoneModelChanged(); void timeZoneModelChanged();
void saveFailed();
void invitationsSent(); void invitationsSent();
void removed(); void removed();

View file

@ -95,7 +95,7 @@ const QHash<int, Notifier::Notification> Notifier::Notifications = {
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
Notifier::Notifier(QObject *parent, QSharedPointer<Settings> settings) : QObject(parent) { Notifier::Notifier(QObject *parent) : QObject(parent) {
mustBeInMainThread(getClassName()); mustBeInMainThread(getClassName());
const int nComponents = Notifications.size(); const int nComponents = Notifications.size();
mComponents = new QQmlComponent *[nComponents]; mComponents = new QQmlComponent *[nComponents];
@ -113,7 +113,6 @@ Notifier::Notifier(QObject *parent, QSharedPointer<Settings> settings) : QObject
} }
mMutex = new QMutex(); mMutex = new QMutex();
mSettings = settings;
} }
Notifier::~Notifier() { Notifier::~Notifier() {
@ -268,7 +267,8 @@ void Notifier::deleteNotification(QVariant notification) {
// ============================================================================= // =============================================================================
#define CREATE_NOTIFICATION(TYPE, DATA) \ #define CREATE_NOTIFICATION(TYPE, DATA) \
if (mSettings->dndEnabled()) return; \ auto settings = App::getInstance()->getSettings(); \
if (settings && settings->dndEnabled()) return; \
QObject *notification = createNotification(TYPE, DATA); \ QObject *notification = createNotification(TYPE, DATA); \
if (!notification) return; \ if (!notification) return; \
const int timeout = Notifications[TYPE].getTimeout() * 1000; \ const int timeout = Notifications[TYPE].getTimeout() * 1000; \
@ -280,6 +280,8 @@ void Notifier::deleteNotification(QVariant notification) {
void Notifier::notifyReceivedCall(const shared_ptr<linphone::Call> &call) { void Notifier::notifyReceivedCall(const shared_ptr<linphone::Call> &call) {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO)); mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
auto remoteAddress = call->getRemoteAddress();
auto accountSender = ToolModel::findAccount(remoteAddress);
auto account = ToolModel::findAccount(call->getToAddress()); auto account = ToolModel::findAccount(call->getToAddress());
if (account) { if (account) {
auto accountModel = Utils::makeQObject_ptr<AccountModel>(account); auto accountModel = Utils::makeQObject_ptr<AccountModel>(account);

View file

@ -37,7 +37,7 @@ class Notifier : public QObject, public AbstractObject {
Q_OBJECT Q_OBJECT
public: public:
Notifier(QObject *parent = Q_NULLPTR, QSharedPointer<Settings> settings = Q_NULLPTR); Notifier(QObject *parent = Q_NULLPTR);
~Notifier(); ~Notifier();
enum NotificationType { enum NotificationType {
@ -98,7 +98,6 @@ private:
QQmlComponent **mComponents = nullptr; QQmlComponent **mComponents = nullptr;
static const QHash<int, Notification> Notifications; static const QHash<int, Notification> Notifications;
QSharedPointer<Settings> mSettings;
DECLARE_ABSTRACT_OBJECT DECLARE_ABSTRACT_OBJECT
}; };

View file

@ -106,30 +106,6 @@ bool ParticipantProxy::getShowMe() const {
// } // }
// } // }
void ParticipantProxy::setConferenceModel(ConferenceModel *conferenceModel) {
// if (!mConferenceModel || mConferenceModel != conferenceModel) {
// mConferenceModel = conferenceModel;
// if (mConferenceModel) {
// auto participants = mConferenceModel->getParticipantList();
// connect(participants, &ParticipantList::countChanged, this, &ParticipantProxy::countChanged);
// setSourceModel(participants);
// emit participantListChanged();
// for (int i = 0; i < participants->getCount(); ++i) {
// auto participant = participants->getAt<ParticipantCore>(i);
// connect(participant.get(), &ParticipantCore::invitationTimeout, this, &ParticipantProxy::removeModel);
// emit addressAdded(participant->getSipAddress());
// }
// } else if (!sourceModel()) {
// auto model = new ParticipantList((ConferenceModel *)nullptr, this);
// connect(model, &ParticipantList::countChanged, this, &ParticipantProxy::countChanged);
// setSourceModel(model);
// emit participantListChanged();
// }
// sort(0);
// emit conferenceModelChanged();
// }
}
void ParticipantProxy::setShowMe(const bool &show) { void ParticipantProxy::setShowMe(const bool &show) {
if (mShowMe != show) { if (mShowMe != show) {
mShowMe = show; mShowMe = show;

View file

@ -53,8 +53,6 @@ public:
bool lessThan(const QModelIndex &left, const QModelIndex &right) const override; bool lessThan(const QModelIndex &left, const QModelIndex &right) const override;
bool getShowMe() const; bool getShowMe() const;
void setConferenceModel(ConferenceModel *conferenceModel);
void setShowMe(const bool &show); void setShowMe(const bool &show);
Q_INVOKABLE void addAddress(const QString &address); Q_INVOKABLE void addAddress(const QString &address);

View file

@ -41,15 +41,7 @@ MagicSearchList::MagicSearchList(QObject *parent) : ListProxy(parent) {
mustBeInMainThread(getClassName()); mustBeInMainThread(getClassName());
mSourceFlags = (int)linphone::MagicSearch::Source::Friends | (int)linphone::MagicSearch::Source::LdapServers; mSourceFlags = (int)linphone::MagicSearch::Source::Friends | (int)linphone::MagicSearch::Source::LdapServers;
mAggregationFlag = LinphoneEnums::MagicSearchAggregation::Friend; mAggregationFlag = LinphoneEnums::MagicSearchAggregation::Friend;
App::postModelSync([this]() { mSearchFilter = "*";
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
auto linphoneSearch = CoreModel::getInstance()->getCore()->createMagicSearch();
linphoneSearch->setLimitedSearch(false);
mMagicSearch = Utils::makeQObject_ptr<MagicSearchModel>(linphoneSearch);
mMagicSearch->mSourceFlags = mSourceFlags;
mMagicSearch->mAggregationFlag = mAggregationFlag;
mMagicSearch->setSelf(mMagicSearch);
});
} }
MagicSearchList::~MagicSearchList() { MagicSearchList::~MagicSearchList() {
@ -57,50 +49,6 @@ MagicSearchList::~MagicSearchList() {
} }
void MagicSearchList::setSelf(QSharedPointer<MagicSearchList> me) { void MagicSearchList::setSelf(QSharedPointer<MagicSearchList> me) {
mModelConnection = QSharedPointer<SafeConnection<MagicSearchList, MagicSearchModel>>(
new SafeConnection<MagicSearchList, MagicSearchModel>(me, mMagicSearch), &QObject::deleteLater);
mModelConnection->makeConnectToCore(&MagicSearchList::lSearch, [this](QString filter) {
mModelConnection->invokeToModel([this, filter]() { mMagicSearch->search(filter); });
});
mModelConnection->makeConnectToCore(&MagicSearchList::lSetSourceFlags, [this](int flags) {
mModelConnection->invokeToModel([this, flags]() { mMagicSearch->setSourceFlags(flags); });
});
mModelConnection->makeConnectToModel(&MagicSearchModel::sourceFlagsChanged, [this](int flags) {
mModelConnection->invokeToCore([this, flags]() { setSourceFlags(flags); });
});
mModelConnection->makeConnectToModel(
&MagicSearchModel::aggregationFlagChanged, [this](LinphoneEnums::MagicSearchAggregation flag) {
mModelConnection->invokeToCore([this, flag]() { setAggregationFlag(flag); });
});
mModelConnection->makeConnectToModel(
&MagicSearchModel::searchResultsReceived,
[this](const std::list<std::shared_ptr<linphone::SearchResult>> &results) {
auto *contacts = new QList<QSharedPointer<FriendCore>>();
for (auto it : results) {
QSharedPointer<FriendCore> contact;
if (it->getFriend()) {
contact = FriendCore::create(it->getFriend());
contacts->append(contact);
} else if (auto address = it->getAddress()) {
auto linphoneFriend = CoreModel::getInstance()->getCore()->createFriend();
contact = FriendCore::create(linphoneFriend);
contact->setGivenName(Utils::coreStringToAppString(address->asStringUriOnly()));
contact->appendAddress(Utils::coreStringToAppString(address->asStringUriOnly()));
contacts->append(contact);
} else if (!it->getPhoneNumber().empty()) {
auto linphoneFriend = CoreModel::getInstance()->getCore()->createFriend();
contact = FriendCore::create(linphoneFriend);
contact->setGivenName(Utils::coreStringToAppString(it->getPhoneNumber()));
contact->appendPhoneNumber(tr("Phone"), Utils::coreStringToAppString(it->getPhoneNumber()));
contacts->append(contact);
}
}
mModelConnection->invokeToCore([this, contacts]() {
setResults(*contacts);
delete contacts;
});
});
mCoreModelConnection = QSharedPointer<SafeConnection<MagicSearchList, CoreModel>>( mCoreModelConnection = QSharedPointer<SafeConnection<MagicSearchList, CoreModel>>(
new SafeConnection<MagicSearchList, CoreModel>(me, CoreModel::getInstance()), &QObject::deleteLater); new SafeConnection<MagicSearchList, CoreModel>(me, CoreModel::getInstance()), &QObject::deleteLater);
mCoreModelConnection->makeConnectToModel( mCoreModelConnection->makeConnectToModel(
@ -113,13 +61,66 @@ void MagicSearchList::setSelf(QSharedPointer<MagicSearchList> me) {
if (haveContact == mList.end()) { if (haveContact == mList.end()) {
connect(friendCore.get(), &FriendCore::removed, this, qOverload<QObject *>(&MagicSearchList::remove)); connect(friendCore.get(), &FriendCore::removed, this, qOverload<QObject *>(&MagicSearchList::remove));
add(friendCore); add(friendCore);
int index = -1; emit friendCreated(getCount() - 1);
get(friendCore.get(), &index);
if (index != -1) {
emit friendCreated(index);
}
} }
}); });
mCoreModelConnection->invokeToModel([this] {
auto linphoneSearch = CoreModel::getInstance()->getCore()->createMagicSearch();
linphoneSearch->setLimitedSearch(false);
auto magicSearch = Utils::makeQObject_ptr<MagicSearchModel>(linphoneSearch);
mCoreModelConnection->invokeToCore([this, magicSearch] {
mMagicSearch = magicSearch;
mMagicSearch->mSourceFlags = mSourceFlags;
mMagicSearch->mAggregationFlag = mAggregationFlag;
mMagicSearch->setSelf(mMagicSearch);
mModelConnection = QSharedPointer<SafeConnection<MagicSearchList, MagicSearchModel>>(
new SafeConnection<MagicSearchList, MagicSearchModel>(mCoreModelConnection->mCore.mQData, mMagicSearch),
&QObject::deleteLater);
mModelConnection->makeConnectToCore(&MagicSearchList::lSearch, [this](QString filter) {
mModelConnection->invokeToModel([this, filter]() { mMagicSearch->search(filter); });
});
mModelConnection->makeConnectToCore(&MagicSearchList::lSetSourceFlags, [this](int flags) {
mModelConnection->invokeToModel([this, flags]() { mMagicSearch->setSourceFlags(flags); });
});
mModelConnection->makeConnectToModel(&MagicSearchModel::sourceFlagsChanged, [this](int flags) {
mModelConnection->invokeToCore([this, flags]() { setSourceFlags(flags); });
});
mModelConnection->makeConnectToModel(
&MagicSearchModel::aggregationFlagChanged, [this](LinphoneEnums::MagicSearchAggregation flag) {
mModelConnection->invokeToCore([this, flag]() { setAggregationFlag(flag); });
});
mModelConnection->makeConnectToModel(
&MagicSearchModel::searchResultsReceived,
[this](const std::list<std::shared_ptr<linphone::SearchResult>> &results) {
auto *contacts = new QList<QSharedPointer<FriendCore>>();
for (auto it : results) {
QSharedPointer<FriendCore> contact;
if (it->getFriend()) {
contact = FriendCore::create(it->getFriend());
contacts->append(contact);
} else if (auto address = it->getAddress()) {
auto linphoneFriend = CoreModel::getInstance()->getCore()->createFriend();
contact = FriendCore::create(linphoneFriend);
contact->setGivenName(Utils::coreStringToAppString(address->asStringUriOnly()));
contact->appendAddress(Utils::coreStringToAppString(address->asStringUriOnly()));
contacts->append(contact);
} else if (!it->getPhoneNumber().empty()) {
auto linphoneFriend = CoreModel::getInstance()->getCore()->createFriend();
contact = FriendCore::create(linphoneFriend);
contact->setGivenName(Utils::coreStringToAppString(it->getPhoneNumber()));
contact->appendPhoneNumber(tr("Phone"), Utils::coreStringToAppString(it->getPhoneNumber()));
contacts->append(contact);
}
}
mModelConnection->invokeToCore([this, contacts]() {
setResults(*contacts);
delete contacts;
});
});
emit initialized();
emit lSearch(mSearchFilter);
});
});
} }
void MagicSearchList::setResults(const QList<QSharedPointer<FriendCore>> &contacts) { void MagicSearchList::setResults(const QList<QSharedPointer<FriendCore>> &contacts) {
@ -134,6 +135,7 @@ void MagicSearchList::addResult(const QSharedPointer<FriendCore> &contact) {
} }
void MagicSearchList::setSearch(const QString &search) { void MagicSearchList::setSearch(const QString &search) {
mSearchFilter = search;
if (!search.isEmpty()) { if (!search.isEmpty()) {
lSearch(search); lSearch(search);
} else { } else {

View file

@ -52,7 +52,7 @@ public:
virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
int findFriendIndexByAddress(const QString& address); int findFriendIndexByAddress(const QString &address);
signals: signals:
void lSearch(QString filter); void lSearch(QString filter);
@ -64,9 +64,12 @@ signals:
void friendCreated(int index); void friendCreated(int index);
void initialized();
private: private:
int mSourceFlags; int mSourceFlags;
LinphoneEnums::MagicSearchAggregation mAggregationFlag; LinphoneEnums::MagicSearchAggregation mAggregationFlag;
QString mSearchFilter;
std::shared_ptr<MagicSearchModel> mMagicSearch; std::shared_ptr<MagicSearchModel> mMagicSearch;
QSharedPointer<SafeConnection<MagicSearchList, MagicSearchModel>> mModelConnection; QSharedPointer<SafeConnection<MagicSearchList, MagicSearchModel>> mModelConnection;

View file

@ -24,7 +24,9 @@
MagicSearchProxy::MagicSearchProxy(QObject *parent) : SortFilterProxy(parent) { MagicSearchProxy::MagicSearchProxy(QObject *parent) : SortFilterProxy(parent) {
mList = MagicSearchList::create(); mList = MagicSearchList::create();
connect(mList.get(), &MagicSearchList::sourceFlagsChanged, this, &MagicSearchProxy::sourceFlagsChanged); mSourceFlags = (int)LinphoneEnums::MagicSearchSource::Friends | (int)LinphoneEnums::MagicSearchSource::LdapServers;
mAggregationFlag = LinphoneEnums::MagicSearchAggregation::Friend;
(mList.get(), &MagicSearchList::sourceFlagsChanged, this, &MagicSearchProxy::sourceFlagsChanged);
connect(mList.get(), &MagicSearchList::aggregationFlagChanged, this, &MagicSearchProxy::aggregationFlagChanged); connect(mList.get(), &MagicSearchList::aggregationFlagChanged, this, &MagicSearchProxy::aggregationFlagChanged);
connect(mList.get(), &MagicSearchList::friendCreated, this, [this](int index) { connect(mList.get(), &MagicSearchList::friendCreated, this, [this](int index) {
auto proxyIndex = mapFromSource(sourceModel()->index(index, 0)); auto proxyIndex = mapFromSource(sourceModel()->index(index, 0));
@ -33,6 +35,10 @@ MagicSearchProxy::MagicSearchProxy(QObject *parent) : SortFilterProxy(parent) {
setSourceModel(mList.get()); setSourceModel(mList.get());
connect(this, &MagicSearchProxy::forceUpdate, [this] { emit mList->lSearch(mSearchText); }); connect(this, &MagicSearchProxy::forceUpdate, [this] { emit mList->lSearch(mSearchText); });
sort(0); sort(0);
connect(mList.get(), &MagicSearchList::initialized, this, [this] {
emit mList->lSetSourceFlags(mSourceFlags);
emit mList->lSetAggregationFlag(mAggregationFlag);
});
} }
MagicSearchProxy::~MagicSearchProxy() { MagicSearchProxy::~MagicSearchProxy() {
@ -48,23 +54,29 @@ QString MagicSearchProxy::getSearchText() const {
void MagicSearchProxy::setSearchText(const QString &search) { void MagicSearchProxy::setSearchText(const QString &search) {
mSearchText = search; mSearchText = search;
qobject_cast<MagicSearchList *>(sourceModel())->setSearch(mSearchText); mList->setSearch(mSearchText);
} }
int MagicSearchProxy::getSourceFlags() const { int MagicSearchProxy::getSourceFlags() const {
return qobject_cast<MagicSearchList *>(sourceModel())->getSourceFlags(); return mSourceFlags;
} }
void MagicSearchProxy::setSourceFlags(int flags) { void MagicSearchProxy::setSourceFlags(int flags) {
qobject_cast<MagicSearchList *>(sourceModel())->lSetSourceFlags(flags); if (flags != mSourceFlags) {
mSourceFlags = flags;
emit mList->lSetSourceFlags(flags);
}
} }
LinphoneEnums::MagicSearchAggregation MagicSearchProxy::getAggregationFlag() const { LinphoneEnums::MagicSearchAggregation MagicSearchProxy::getAggregationFlag() const {
return qobject_cast<MagicSearchList *>(sourceModel())->getAggregationFlag(); return mAggregationFlag;
} }
void MagicSearchProxy::setAggregationFlag(LinphoneEnums::MagicSearchAggregation flag) { void MagicSearchProxy::setAggregationFlag(LinphoneEnums::MagicSearchAggregation flag) {
qobject_cast<MagicSearchList *>(sourceModel())->lSetAggregationFlag(flag); if (flag != mAggregationFlag) {
mAggregationFlag = flag;
emit mList->lSetAggregationFlag(flag);
}
} }
bool MagicSearchProxy::lessThan(const QModelIndex &left, const QModelIndex &right) const { bool MagicSearchProxy::lessThan(const QModelIndex &left, const QModelIndex &right) const {

View file

@ -60,6 +60,8 @@ signals:
protected: protected:
QString mSearchText; QString mSearchText;
int mSourceFlags;
LinphoneEnums::MagicSearchAggregation mAggregationFlag;
QSharedPointer<MagicSearchList> mList; QSharedPointer<MagicSearchList> mList;
virtual bool lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const override; virtual bool lessThan(const QModelIndex &source_left, const QModelIndex &source_right) const override;
}; };

View file

@ -27,18 +27,18 @@
#include <QUrl> #include <QUrl>
#include <QVariant> #include <QVariant>
DEFINE_ABSTRACT_OBJECT(Settings) DEFINE_ABSTRACT_OBJECT(SettingsCore)
// ============================================================================= // =============================================================================
QSharedPointer<Settings> Settings::create() { QSharedPointer<SettingsCore> SettingsCore::create() {
auto sharedPointer = QSharedPointer<Settings>(new Settings(), &QObject::deleteLater); auto sharedPointer = QSharedPointer<SettingsCore>(new SettingsCore(), &QObject::deleteLater);
sharedPointer->setSelf(sharedPointer); sharedPointer->setSelf(sharedPointer);
sharedPointer->moveToThread(App::getInstance()->thread()); sharedPointer->moveToThread(App::getInstance()->thread());
return sharedPointer; return sharedPointer;
} }
Settings::Settings(QObject *parent) : QObject(parent) { SettingsCore::SettingsCore(QObject *parent) : QObject(parent) {
mustBeInLinphoneThread(getClassName()); mustBeInLinphoneThread(getClassName());
mSettingsModel = Utils::makeQObject_ptr<SettingsModel>(); mSettingsModel = Utils::makeQObject_ptr<SettingsModel>();
@ -93,16 +93,16 @@ Settings::Settings(QObject *parent) : QObject(parent) {
INIT_CORE_MEMBER(AutoStart, mSettingsModel) INIT_CORE_MEMBER(AutoStart, mSettingsModel)
} }
Settings::~Settings() { SettingsCore::~SettingsCore() {
} }
void Settings::setSelf(QSharedPointer<Settings> me) { void SettingsCore::setSelf(QSharedPointer<SettingsCore> me) {
mustBeInLinphoneThread(getClassName()); mustBeInLinphoneThread(getClassName());
mSettingsModelConnection = QSharedPointer<SafeConnection<Settings, SettingsModel>>( mSettingsModelConnection = QSharedPointer<SafeConnection<SettingsCore, SettingsModel>>(
new SafeConnection<Settings, SettingsModel>(me, mSettingsModel), &QObject::deleteLater); new SafeConnection<SettingsCore, SettingsModel>(me, mSettingsModel), &QObject::deleteLater);
// VFS // VFS
mSettingsModelConnection->makeConnectToCore(&Settings::setVfsEnabled, [this](const bool enabled) { mSettingsModelConnection->makeConnectToCore(&SettingsCore::setVfsEnabled, [this](const bool enabled) {
mSettingsModelConnection->invokeToModel([this, enabled]() { mSettingsModel->setVfsEnabled(enabled); }); mSettingsModelConnection->invokeToModel([this, enabled]() { mSettingsModel->setVfsEnabled(enabled); });
}); });
@ -114,7 +114,7 @@ void Settings::setSelf(QSharedPointer<Settings> me) {
}); });
// Video Calls // Video Calls
mSettingsModelConnection->makeConnectToCore(&Settings::setVideoEnabled, [this](const bool enabled) { mSettingsModelConnection->makeConnectToCore(&SettingsCore::setVideoEnabled, [this](const bool enabled) {
mSettingsModelConnection->invokeToModel([this, enabled]() { mSettingsModel->setVideoEnabled(enabled); }); mSettingsModelConnection->invokeToModel([this, enabled]() { mSettingsModel->setVideoEnabled(enabled); });
}); });
@ -126,7 +126,7 @@ void Settings::setSelf(QSharedPointer<Settings> me) {
}); });
// Echo cancelling // Echo cancelling
mSettingsModelConnection->makeConnectToCore(&Settings::setEchoCancellationEnabled, [this](const bool enabled) { mSettingsModelConnection->makeConnectToCore(&SettingsCore::setEchoCancellationEnabled, [this](const bool enabled) {
mSettingsModelConnection->invokeToModel( mSettingsModelConnection->invokeToModel(
[this, enabled]() { mSettingsModel->setEchoCancellationEnabled(enabled); }); [this, enabled]() { mSettingsModel->setEchoCancellationEnabled(enabled); });
}); });
@ -140,7 +140,7 @@ void Settings::setSelf(QSharedPointer<Settings> me) {
}); });
// Auto recording // Auto recording
mSettingsModelConnection->makeConnectToCore(&Settings::setAutomaticallyRecordCallsEnabled, mSettingsModelConnection->makeConnectToCore(&SettingsCore::setAutomaticallyRecordCallsEnabled,
[this](const bool enabled) { [this](const bool enabled) {
mSettingsModelConnection->invokeToModel([this, enabled]() { mSettingsModelConnection->invokeToModel([this, enabled]() {
mSettingsModel->setAutomaticallyRecordCallsEnabled(enabled); mSettingsModel->setAutomaticallyRecordCallsEnabled(enabled);
@ -155,7 +155,7 @@ void Settings::setSelf(QSharedPointer<Settings> me) {
}); });
// Audio device(s) // Audio device(s)
mSettingsModelConnection->makeConnectToCore(&Settings::lSetCaptureDevice, [this](const QString id) { mSettingsModelConnection->makeConnectToCore(&SettingsCore::lSetCaptureDevice, [this](const QString id) {
mSettingsModelConnection->invokeToModel([this, id]() { mSettingsModel->setCaptureDevice(id); }); mSettingsModelConnection->invokeToModel([this, id]() { mSettingsModel->setCaptureDevice(id); });
}); });
mSettingsModelConnection->makeConnectToModel(&SettingsModel::captureDeviceChanged, [this](const QString device) { mSettingsModelConnection->makeConnectToModel(&SettingsModel::captureDeviceChanged, [this](const QString device) {
@ -165,7 +165,7 @@ void Settings::setSelf(QSharedPointer<Settings> me) {
}); });
}); });
mSettingsModelConnection->makeConnectToCore(&Settings::lSetPlaybackDevice, [this](const QString id) { mSettingsModelConnection->makeConnectToCore(&SettingsCore::lSetPlaybackDevice, [this](const QString id) {
mSettingsModelConnection->invokeToModel([this, id]() { mSettingsModel->setPlaybackDevice(id); }); mSettingsModelConnection->invokeToModel([this, id]() { mSettingsModel->setPlaybackDevice(id); });
}); });
@ -176,7 +176,7 @@ void Settings::setSelf(QSharedPointer<Settings> me) {
}); });
}); });
mSettingsModelConnection->makeConnectToCore(&Settings::lSetPlaybackGain, [this](const float value) { mSettingsModelConnection->makeConnectToCore(&SettingsCore::lSetPlaybackGain, [this](const float value) {
mSettingsModelConnection->invokeToModel([this, value]() { mSettingsModel->setPlaybackGain(value); }); mSettingsModelConnection->invokeToModel([this, value]() { mSettingsModel->setPlaybackGain(value); });
}); });
@ -187,7 +187,7 @@ void Settings::setSelf(QSharedPointer<Settings> me) {
}); });
}); });
mSettingsModelConnection->makeConnectToCore(&Settings::lSetCaptureGain, [this](const float value) { mSettingsModelConnection->makeConnectToCore(&SettingsCore::lSetCaptureGain, [this](const float value) {
mSettingsModelConnection->invokeToModel([this, value]() { mSettingsModel->setCaptureGain(value); }); mSettingsModelConnection->invokeToModel([this, value]() { mSettingsModel->setCaptureGain(value); });
}); });
@ -219,7 +219,7 @@ void Settings::setSelf(QSharedPointer<Settings> me) {
}); });
// Video device(s) // Video device(s)
mSettingsModelConnection->makeConnectToCore(&Settings::lSetVideoDevice, [this](const QString id) { mSettingsModelConnection->makeConnectToCore(&SettingsCore::lSetVideoDevice, [this](const QString id) {
mSettingsModelConnection->invokeToModel([this, id]() { mSettingsModel->setVideoDevice(id); }); mSettingsModelConnection->invokeToModel([this, id]() { mSettingsModel->setVideoDevice(id); });
}); });
@ -239,7 +239,7 @@ void Settings::setSelf(QSharedPointer<Settings> me) {
}); });
// Logs // Logs
mSettingsModelConnection->makeConnectToCore(&Settings::setLogsEnabled, [this](const bool status) { mSettingsModelConnection->makeConnectToCore(&SettingsCore::setLogsEnabled, [this](const bool status) {
mSettingsModelConnection->invokeToModel([this, status]() { mSettingsModel->setLogsEnabled(status); }); mSettingsModelConnection->invokeToModel([this, status]() { mSettingsModel->setLogsEnabled(status); });
}); });
@ -250,7 +250,7 @@ void Settings::setSelf(QSharedPointer<Settings> me) {
}); });
}); });
mSettingsModelConnection->makeConnectToCore(&Settings::setFullLogsEnabled, [this](const bool status) { mSettingsModelConnection->makeConnectToCore(&SettingsCore::setFullLogsEnabled, [this](const bool status) {
mSettingsModelConnection->invokeToModel([this, status]() { mSettingsModel->setFullLogsEnabled(status); }); mSettingsModelConnection->invokeToModel([this, status]() { mSettingsModel->setFullLogsEnabled(status); });
}); });
@ -262,7 +262,7 @@ void Settings::setSelf(QSharedPointer<Settings> me) {
}); });
// DND // DND
mSettingsModelConnection->makeConnectToCore(&Settings::lEnableDnd, [this](const bool value) { mSettingsModelConnection->makeConnectToCore(&SettingsCore::lEnableDnd, [this](const bool value) {
mSettingsModelConnection->invokeToModel([this, value]() { mSettingsModel->enableDnd(value); }); mSettingsModelConnection->invokeToModel([this, value]() { mSettingsModel->enableDnd(value); });
}); });
mSettingsModelConnection->makeConnectToModel(&SettingsModel::dndChanged, [this](const bool value) { mSettingsModelConnection->makeConnectToModel(&SettingsModel::dndChanged, [this](const bool value) {
@ -272,44 +272,44 @@ void Settings::setSelf(QSharedPointer<Settings> me) {
}); });
}); });
DEFINE_CORE_GETSET_CONNECT(mSettingsModelConnection, Settings, SettingsModel, mSettingsModel, bool, DEFINE_CORE_GETSET_CONNECT(mSettingsModelConnection, SettingsCore, SettingsModel, mSettingsModel, bool,
disableChatFeature, DisableChatFeature) disableChatFeature, DisableChatFeature)
DEFINE_CORE_GETSET_CONNECT(mSettingsModelConnection, Settings, SettingsModel, mSettingsModel, bool, DEFINE_CORE_GETSET_CONNECT(mSettingsModelConnection, SettingsCore, SettingsModel, mSettingsModel, bool,
disableMeetingsFeature, DisableMeetingsFeature) disableMeetingsFeature, DisableMeetingsFeature)
DEFINE_CORE_GETSET_CONNECT(mSettingsModelConnection, Settings, SettingsModel, mSettingsModel, bool, DEFINE_CORE_GETSET_CONNECT(mSettingsModelConnection, SettingsCore, SettingsModel, mSettingsModel, bool,
disableBroadcastFeature, DisableBroadcastFeature) disableBroadcastFeature, DisableBroadcastFeature)
DEFINE_CORE_GETSET_CONNECT(mSettingsModelConnection, Settings, SettingsModel, mSettingsModel, bool, hideSettings, DEFINE_CORE_GETSET_CONNECT(mSettingsModelConnection, SettingsCore, SettingsModel, mSettingsModel, bool,
HideSettings) hideSettings, HideSettings)
DEFINE_CORE_GETSET_CONNECT(mSettingsModelConnection, Settings, SettingsModel, mSettingsModel, bool, DEFINE_CORE_GETSET_CONNECT(mSettingsModelConnection, SettingsCore, SettingsModel, mSettingsModel, bool,
hideAccountSettings, HideAccountSettings) hideAccountSettings, HideAccountSettings)
DEFINE_CORE_GETSET_CONNECT(mSettingsModelConnection, Settings, SettingsModel, mSettingsModel, bool, DEFINE_CORE_GETSET_CONNECT(mSettingsModelConnection, SettingsCore, SettingsModel, mSettingsModel, bool,
disableCallRecordings, DisableCallRecordings) disableCallRecordings, DisableCallRecordings)
DEFINE_CORE_GETSET_CONNECT(mSettingsModelConnection, Settings, SettingsModel, mSettingsModel, bool, DEFINE_CORE_GETSET_CONNECT(mSettingsModelConnection, SettingsCore, SettingsModel, mSettingsModel, bool,
assistantHideCreateAccount, AssistantHideCreateAccount) assistantHideCreateAccount, AssistantHideCreateAccount)
DEFINE_CORE_GETSET_CONNECT(mSettingsModelConnection, Settings, SettingsModel, mSettingsModel, bool, DEFINE_CORE_GETSET_CONNECT(mSettingsModelConnection, SettingsCore, SettingsModel, mSettingsModel, bool,
assistantHideCreateAccount, AssistantHideCreateAccount) assistantHideCreateAccount, AssistantHideCreateAccount)
DEFINE_CORE_GETSET_CONNECT(mSettingsModelConnection, Settings, SettingsModel, mSettingsModel, bool, DEFINE_CORE_GETSET_CONNECT(mSettingsModelConnection, SettingsCore, SettingsModel, mSettingsModel, bool,
assistantDisableQrCode, AssistantDisableQrCode) assistantDisableQrCode, AssistantDisableQrCode)
DEFINE_CORE_GETSET_CONNECT(mSettingsModelConnection, Settings, SettingsModel, mSettingsModel, bool, DEFINE_CORE_GETSET_CONNECT(mSettingsModelConnection, SettingsCore, SettingsModel, mSettingsModel, bool,
assistantHideThirdPartyAccount, AssistantHideThirdPartyAccount) assistantHideThirdPartyAccount, AssistantHideThirdPartyAccount)
DEFINE_CORE_GETSET_CONNECT(mSettingsModelConnection, Settings, SettingsModel, mSettingsModel, bool, DEFINE_CORE_GETSET_CONNECT(mSettingsModelConnection, SettingsCore, SettingsModel, mSettingsModel, bool,
onlyDisplaySipUriUsername, OnlyDisplaySipUriUsername) onlyDisplaySipUriUsername, OnlyDisplaySipUriUsername)
DEFINE_CORE_GETSET_CONNECT(mSettingsModelConnection, Settings, SettingsModel, mSettingsModel, bool, darkModeAllowed, DEFINE_CORE_GETSET_CONNECT(mSettingsModelConnection, SettingsCore, SettingsModel, mSettingsModel, bool,
DarkModeAllowed) darkModeAllowed, DarkModeAllowed)
DEFINE_CORE_GETSET_CONNECT(mSettingsModelConnection, Settings, SettingsModel, mSettingsModel, int, maxAccount, DEFINE_CORE_GETSET_CONNECT(mSettingsModelConnection, SettingsCore, SettingsModel, mSettingsModel, int, maxAccount,
MaxAccount) MaxAccount)
DEFINE_CORE_GETSET_CONNECT(mSettingsModelConnection, Settings, SettingsModel, mSettingsModel, bool, DEFINE_CORE_GETSET_CONNECT(mSettingsModelConnection, SettingsCore, SettingsModel, mSettingsModel, bool,
assistantGoDirectlyToThirdPartySipAccountLogin, assistantGoDirectlyToThirdPartySipAccountLogin,
AssistantGoDirectlyToThirdPartySipAccountLogin) AssistantGoDirectlyToThirdPartySipAccountLogin)
DEFINE_CORE_GETSET_CONNECT(mSettingsModelConnection, Settings, SettingsModel, mSettingsModel, QString, DEFINE_CORE_GETSET_CONNECT(mSettingsModelConnection, SettingsCore, SettingsModel, mSettingsModel, QString,
assistantThirdPartySipAccountDomain, AssistantThirdPartySipAccountDomain) assistantThirdPartySipAccountDomain, AssistantThirdPartySipAccountDomain)
DEFINE_CORE_GETSET_CONNECT(mSettingsModelConnection, Settings, SettingsModel, mSettingsModel, QString, DEFINE_CORE_GETSET_CONNECT(mSettingsModelConnection, SettingsCore, SettingsModel, mSettingsModel, QString,
assistantThirdPartySipAccountTransport, AssistantThirdPartySipAccountTransport) assistantThirdPartySipAccountTransport, AssistantThirdPartySipAccountTransport)
DEFINE_CORE_GETSET_CONNECT(mSettingsModelConnection, Settings, SettingsModel, mSettingsModel, bool, autoStart, DEFINE_CORE_GETSET_CONNECT(mSettingsModelConnection, SettingsCore, SettingsModel, mSettingsModel, bool, autoStart,
AutoStart) AutoStart)
auto coreModelConnection = QSharedPointer<SafeConnection<Settings, CoreModel>>( auto coreModelConnection = QSharedPointer<SafeConnection<SettingsCore, CoreModel>>(
new SafeConnection<Settings, CoreModel>(me, CoreModel::getInstance()), &QObject::deleteLater); new SafeConnection<SettingsCore, CoreModel>(me, CoreModel::getInstance()), &QObject::deleteLater);
coreModelConnection->makeConnectToModel( coreModelConnection->makeConnectToModel(
&CoreModel::logCollectionUploadStateChanged, [this](auto core, auto state, auto info) { &CoreModel::logCollectionUploadStateChanged, [this](auto core, auto state, auto info) {
@ -323,7 +323,7 @@ void Settings::setSelf(QSharedPointer<Settings> me) {
}); });
} }
QString Settings::getConfigPath(const QCommandLineParser &parser) { QString SettingsCore::getConfigPath(const QCommandLineParser &parser) {
QString filePath = parser.isSet("config") ? parser.value("config") : ""; QString filePath = parser.isSet("config") ? parser.value("config") : "";
QString configPath; QString configPath;
if (!QUrl(filePath).isRelative()) { if (!QUrl(filePath).isRelative()) {
@ -335,52 +335,52 @@ QString Settings::getConfigPath(const QCommandLineParser &parser) {
return configPath; return configPath;
} }
QStringList Settings::getCaptureDevices() const { QStringList SettingsCore::getCaptureDevices() const {
return mCaptureDevices; return mCaptureDevices;
} }
QStringList Settings::getPlaybackDevices() const { QStringList SettingsCore::getPlaybackDevices() const {
return mPlaybackDevices; return mPlaybackDevices;
} }
int Settings::getVideoDeviceIndex() const { int SettingsCore::getVideoDeviceIndex() const {
return mVideoDevices.indexOf(mVideoDevice); return mVideoDevices.indexOf(mVideoDevice);
} }
QStringList Settings::getVideoDevices() const { QStringList SettingsCore::getVideoDevices() const {
return mVideoDevices; return mVideoDevices;
} }
bool Settings::getCaptureGraphRunning() { bool SettingsCore::getCaptureGraphRunning() {
return mCaptureGraphRunning; return mCaptureGraphRunning;
} }
float Settings::getCaptureGain() const { float SettingsCore::getCaptureGain() const {
return mCaptureGain; return mCaptureGain;
} }
float Settings::getPlaybackGain() const { float SettingsCore::getPlaybackGain() const {
return mPlaybackGain; return mPlaybackGain;
} }
QString Settings::getCaptureDevice() const { QString SettingsCore::getCaptureDevice() const {
return mCaptureDevice; return mCaptureDevice;
} }
QString Settings::getPlaybackDevice() const { QString SettingsCore::getPlaybackDevice() const {
return mPlaybackDevice; return mPlaybackDevice;
} }
int Settings::getEchoCancellationCalibration() const { int SettingsCore::getEchoCancellationCalibration() const {
return mEchoCancellationCalibration; return mEchoCancellationCalibration;
} }
bool Settings::getFirstLaunch() const { bool SettingsCore::getFirstLaunch() const {
auto val = mAppSettings.value("firstLaunch", 1).toInt(); auto val = mAppSettings.value("firstLaunch", 1).toInt();
return val; return val;
} }
void Settings::setFirstLaunch(bool first) { void SettingsCore::setFirstLaunch(bool first) {
auto firstLaunch = getFirstLaunch(); auto firstLaunch = getFirstLaunch();
if (firstLaunch != first) { if (firstLaunch != first) {
mAppSettings.setValue("firstLaunch", (int)first); mAppSettings.setValue("firstLaunch", (int)first);
@ -389,7 +389,7 @@ void Settings::setFirstLaunch(bool first) {
} }
} }
void Settings::setLastActiveTabIndex(int index) { void SettingsCore::setLastActiveTabIndex(int index) {
auto lastActiveIndex = getLastActiveTabIndex(); auto lastActiveIndex = getLastActiveTabIndex();
if (lastActiveIndex != index) { if (lastActiveIndex != index) {
mAppSettings.setValue("lastActiveTabIndex", index); mAppSettings.setValue("lastActiveTabIndex", index);
@ -398,11 +398,11 @@ void Settings::setLastActiveTabIndex(int index) {
} }
} }
int Settings::getLastActiveTabIndex() { int SettingsCore::getLastActiveTabIndex() {
return mAppSettings.value("lastActiveTabIndex", 1).toInt(); return mAppSettings.value("lastActiveTabIndex", 1).toInt();
} }
void Settings::setDisplayDeviceCheckConfirmation(bool display) { void SettingsCore::setDisplayDeviceCheckConfirmation(bool display) {
if (getDisplayDeviceCheckConfirmation() != display) { if (getDisplayDeviceCheckConfirmation() != display) {
mAppSettings.setValue("displayDeviceCheckConfirmation", display); mAppSettings.setValue("displayDeviceCheckConfirmation", display);
mAppSettings.sync(); mAppSettings.sync();
@ -410,50 +410,50 @@ void Settings::setDisplayDeviceCheckConfirmation(bool display) {
} }
} }
bool Settings::getDisplayDeviceCheckConfirmation() const { bool SettingsCore::getDisplayDeviceCheckConfirmation() const {
auto val = mAppSettings.value("displayDeviceCheckConfirmation", 1).toInt(); auto val = mAppSettings.value("displayDeviceCheckConfirmation", 1).toInt();
return val; return val;
} }
void Settings::startEchoCancellerCalibration() { void SettingsCore::startEchoCancellerCalibration() {
mSettingsModelConnection->invokeToModel([this]() { mSettingsModel->startEchoCancellerCalibration(); }); mSettingsModelConnection->invokeToModel([this]() { mSettingsModel->startEchoCancellerCalibration(); });
} }
void Settings::accessCallSettings() { void SettingsCore::accessCallSettings() {
mSettingsModelConnection->invokeToModel([this]() { mSettingsModel->accessCallSettings(); }); mSettingsModelConnection->invokeToModel([this]() { mSettingsModel->accessCallSettings(); });
} }
void Settings::closeCallSettings() { void SettingsCore::closeCallSettings() {
mSettingsModelConnection->invokeToModel([this]() { mSettingsModel->closeCallSettings(); }); mSettingsModelConnection->invokeToModel([this]() { mSettingsModel->closeCallSettings(); });
} }
void Settings::updateMicVolume() const { void SettingsCore::updateMicVolume() const {
mSettingsModelConnection->invokeToModel([this]() { mSettingsModel->getMicVolume(); }); mSettingsModelConnection->invokeToModel([this]() { mSettingsModel->getMicVolume(); });
} }
bool Settings::getLogsEnabled() const { bool SettingsCore::getLogsEnabled() const {
return mLogsEnabled; return mLogsEnabled;
} }
bool Settings::getFullLogsEnabled() const { bool SettingsCore::getFullLogsEnabled() const {
return mFullLogsEnabled; return mFullLogsEnabled;
} }
void Settings::cleanLogs() const { void SettingsCore::cleanLogs() const {
mSettingsModelConnection->invokeToModel([this]() { mSettingsModel->cleanLogs(); }); mSettingsModelConnection->invokeToModel([this]() { mSettingsModel->cleanLogs(); });
} }
void Settings::sendLogs() const { void SettingsCore::sendLogs() const {
mSettingsModelConnection->invokeToModel([this]() { mSettingsModel->sendLogs(); }); mSettingsModelConnection->invokeToModel([this]() { mSettingsModel->sendLogs(); });
} }
QString Settings::getLogsEmail() const { QString SettingsCore::getLogsEmail() const {
return mLogsEmail; return mLogsEmail;
} }
QString Settings::getLogsFolder() const { QString SettingsCore::getLogsFolder() const {
return mLogsFolder; return mLogsFolder;
} }
bool Settings::dndEnabled() const { bool SettingsCore::dndEnabled() const {
return mDndEnabled; return mDndEnabled;
} }

View file

@ -18,8 +18,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifndef SETTINGS_H_ #ifndef SETTINGS_CORE_H_
#define SETTINGS_H_ #define SETTINGS_CORE_H_
#include "model/setting/SettingsModel.hpp" #include "model/setting/SettingsModel.hpp"
#include "tool/thread/SafeConnection.hpp" #include "tool/thread/SafeConnection.hpp"
@ -29,7 +29,7 @@
#include <QSettings> #include <QSettings>
#include <QVariantMap> #include <QVariantMap>
class Settings : public QObject, public AbstractObject { class SettingsCore : public QObject, public AbstractObject {
Q_OBJECT Q_OBJECT
// Security // Security
@ -68,11 +68,11 @@ class Settings : public QObject, public AbstractObject {
Q_PROPERTY(bool dnd READ dndEnabled WRITE lEnableDnd NOTIFY dndChanged) Q_PROPERTY(bool dnd READ dndEnabled WRITE lEnableDnd NOTIFY dndChanged)
public: public:
static QSharedPointer<Settings> create(); static QSharedPointer<SettingsCore> create();
Settings(QObject *parent = Q_NULLPTR); SettingsCore(QObject *parent = Q_NULLPTR);
virtual ~Settings(); virtual ~SettingsCore();
void setSelf(QSharedPointer<Settings> me); void setSelf(QSharedPointer<SettingsCore> me);
QString getConfigPath(const QCommandLineParser &parser = QCommandLineParser()); QString getConfigPath(const QCommandLineParser &parser = QCommandLineParser());
@ -256,7 +256,7 @@ private:
bool mDndEnabled; bool mDndEnabled;
QSettings mAppSettings; QSettings mAppSettings;
QSharedPointer<SafeConnection<Settings, SettingsModel>> mSettingsModelConnection; QSharedPointer<SafeConnection<SettingsCore, SettingsModel>> mSettingsModelConnection;
DECLARE_ABSTRACT_OBJECT DECLARE_ABSTRACT_OBJECT
}; };

View file

@ -58,6 +58,13 @@ void TimeZoneList::initTimeZones() {
} }
} }
QHash<int, QByteArray> TimeZoneList::roleNames() const {
QHash<int, QByteArray> roles;
roles[Qt::DisplayRole] = "$modelData";
roles[Qt::DisplayRole + 1] = "$timeZoneModel";
return roles;
}
QVariant TimeZoneList::data(const QModelIndex &index, int role) const { QVariant TimeZoneList::data(const QModelIndex &index, int role) const {
int row = index.row(); int row = index.row();
@ -66,13 +73,17 @@ QVariant TimeZoneList::data(const QModelIndex &index, int role) const {
if (!timeZoneModel) return QVariant(); if (!timeZoneModel) return QVariant();
int offset = timeZoneModel->getStandardTimeOffset() / 3600; int offset = timeZoneModel->getStandardTimeOffset() / 3600;
int absOffset = std::abs(offset); int absOffset = std::abs(offset);
if (role == Qt::DisplayRole + 1) {
return QStringLiteral("(GMT%1%2%3:00) %4 %5") return QVariant::fromValue(new TimeZoneModel(timeZoneModel->getTimeZone()));
.arg(offset >= 0 ? "+" : "-") } else {
.arg(absOffset < 10 ? "0" : "") return QStringLiteral("(GMT%1%2%3:00) %4 %5")
.arg(absOffset) .arg(offset >= 0 ? "+" : "-")
.arg(timeZoneModel->getCountryName()) .arg(absOffset < 10 ? "0" : "")
.arg(timeZoneModel->getTimeZone().comment().isEmpty() ? "" : (" - " + timeZoneModel->getTimeZone().comment())); .arg(absOffset)
.arg(timeZoneModel->getCountryName())
.arg(timeZoneModel->getTimeZone().comment().isEmpty() ? ""
: (" - " + timeZoneModel->getTimeZone().comment()));
}
} }
int TimeZoneList::get(const QTimeZone &timeZone) const { int TimeZoneList::get(const QTimeZone &timeZone) const {

View file

@ -38,6 +38,7 @@ public:
void initTimeZones(); void initTimeZones();
int get(const QTimeZone &timeZone = QTimeZone::systemTimeZone()) const; int get(const QTimeZone &timeZone = QTimeZone::systemTimeZone()) const;
QHash<int, QByteArray> roleNames() const;
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
private: private:

View file

@ -152,7 +152,7 @@ private:
virtual void onAudioDeviceChanged(const std::shared_ptr<linphone::Call> &call, virtual void onAudioDeviceChanged(const std::shared_ptr<linphone::Call> &call,
const std::shared_ptr<linphone::AudioDevice> &audioDevice) override; const std::shared_ptr<linphone::AudioDevice> &audioDevice) override;
virtual void onRemoteRecording(const std::shared_ptr<linphone::Call> &call, bool recording) override; virtual void onRemoteRecording(const std::shared_ptr<linphone::Call> &call, bool recording) override;
virtual void onAuthenticationTokenVerified(const std::shared_ptr<linphone::Call> &call, bool verified); virtual void onAuthenticationTokenVerified(const std::shared_ptr<linphone::Call> &call, bool verified) override;
signals: signals:
void dtmfReceived(const std::shared_ptr<linphone::Call> &call, int dtmf); void dtmfReceived(const std::shared_ptr<linphone::Call> &call, int dtmf);

View file

@ -66,7 +66,8 @@ void ConferenceInfoModel::setConferenceScheduler(const std::shared_ptr<Conferenc
[this](linphone::ConferenceScheduler::State state) { [this](linphone::ConferenceScheduler::State state) {
if (state == linphone::ConferenceScheduler::State::Ready && mInviteEnabled) { if (state == linphone::ConferenceScheduler::State::Ready && mInviteEnabled) {
auto params = CoreModel::getInstance()->getCore()->createDefaultChatRoomParams(); auto params = CoreModel::getInstance()->getCore()->createDefaultChatRoomParams();
mConferenceSchedulerModel->getMonitor()->sendInvitations(params); // TODO : wait for new sdk api to send the invitations again
// mConferenceSchedulerModel->getMonitor()->sendInvitations(params);
} }
emit schedulerStateChanged(state); emit schedulerStateChanged(state);
}); });

View file

@ -128,13 +128,6 @@ bool ToolModel::createCall(const QString &sipAddress,
} }
return false; return false;
} }
for (auto &account : core->getAccountList()) {
if (account->getContactAddress() && account->getContactAddress()->weakEqual(address)) {
if (errorMessage) *errorMessage = tr("The calling address is a connected account.");
lDebug() << "[" + QString(gClassName) + "]" + *errorMessage;
return false;
}
}
if (SettingsModel::dndEnabled( if (SettingsModel::dndEnabled(
core->getConfig())) { // Force tones for outgoing calls when in DND mode (ringback, dtmf, etc ... ) disabled core->getConfig())) { // Force tones for outgoing calls when in DND mode (ringback, dtmf, etc ... ) disabled

View file

@ -7,6 +7,7 @@ import EnumsToStringCpp 1.0
import UtilsCpp 1.0 import UtilsCpp 1.0
import SettingsCpp 1.0 import SettingsCpp 1.0
import DesktopToolsCpp 1.0 import DesktopToolsCpp 1.0
import LinphoneCallsCpp
AppWindow { AppWindow {
id: mainWindow id: mainWindow
@ -24,7 +25,7 @@ AppWindow {
property var transferState: call && call.core.transferState property var transferState: call && call.core.transferState
onCallStateChanged: { onCallStateChanged: {
if (callState === LinphoneEnums.CallState.Connected || callState === LinphoneEnums.CallState.StreamsRunning) { if (callState === LinphoneEnums.CallState.Connected) {
if (middleItemStackView.currentItem.objectName != "inCallItem") { if (middleItemStackView.currentItem.objectName != "inCallItem") {
middleItemStackView.replace(inCallItem) middleItemStackView.replace(inCallItem)
bottomButtonsLayout.visible = true bottomButtonsLayout.visible = true
@ -613,6 +614,7 @@ AppWindow {
closeButtonVisible: false closeButtonVisible: false
roundedBottom: true roundedBottom: true
visible: parent.visible visible: parent.visible
currentCall: callsModel.currentCall
leftPadding: 40 * DefaultStyle.dp leftPadding: 40 * DefaultStyle.dp
rightPadding: 40 * DefaultStyle.dp rightPadding: 40 * DefaultStyle.dp
topPadding: 41 * DefaultStyle.dp topPadding: 41 * DefaultStyle.dp
@ -743,7 +745,7 @@ AppWindow {
Layout.maximumHeight: rightPanel.height Layout.maximumHeight: rightPanel.height
visible: callList.contentHeight > 0 visible: callList.contentHeight > 0
leftPadding: 16 * DefaultStyle.dp leftPadding: 16 * DefaultStyle.dp
rightPadding: 16 * DefaultStyle.dp rightPadding: 6 * DefaultStyle.dp
topPadding: 15 * DefaultStyle.dp topPadding: 15 * DefaultStyle.dp
bottomPadding: 16 * DefaultStyle.dp bottomPadding: 16 * DefaultStyle.dp
@ -754,7 +756,9 @@ AppWindow {
contentItem: ListView { contentItem: ListView {
id: callList id: callList
model: callsModel model: CallProxy {
id: callProxy
}
implicitHeight: contentHeight// Math.min(contentHeight, rightPanel.height) implicitHeight: contentHeight// Math.min(contentHeight, rightPanel.height)
spacing: 15 * DefaultStyle.dp spacing: 15 * DefaultStyle.dp
clip: true clip: true
@ -800,6 +804,7 @@ AppWindow {
id: listCallOptionsButton id: listCallOptionsButton
Layout.preferredWidth: 24 * DefaultStyle.dp Layout.preferredWidth: 24 * DefaultStyle.dp
Layout.preferredHeight: 24 * DefaultStyle.dp Layout.preferredHeight: 24 * DefaultStyle.dp
Layout.rightMargin: 10 * DefaultStyle.dp
popup.contentItem: ColumnLayout { popup.contentItem: ColumnLayout {
spacing: 0 spacing: 0

View file

@ -11,6 +11,7 @@ import QtQuick.Effects
import Linphone import Linphone
import UtilsCpp import UtilsCpp
import SettingsCpp import SettingsCpp
import LinphoneAccountsCpp
Item { Item {
id: mainItem id: mainItem
@ -65,10 +66,11 @@ Item {
openContextualMenuComponent(page) openContextualMenuComponent(page)
} }
AccountProxy { AccountProxy {
id: accountProxy id: accountProxy
onDefaultAccountChanged: if (tabbar.currentIndex === 0 && defaultAccount) defaultAccount.core.lResetMissedCalls() onDefaultAccountChanged: if (tabbar.currentIndex === 0 && defaultAccount) defaultAccount.core.lResetMissedCalls()
} }
CallProxy { CallProxy {
id: callsModel id: callsModel
} }
@ -79,7 +81,7 @@ Item {
id: currentCallNotif id: currentCallNotif
background: Item{} background: Item{}
closePolicy: Control.Popup.NoAutoClose closePolicy: Control.Popup.NoAutoClose
visible: currentCall visible: currentCall
&& currentCall.core.state != LinphoneEnums.CallState.Idle && currentCall.core.state != LinphoneEnums.CallState.Idle
&& currentCall.core.state != LinphoneEnums.CallState.IncomingReceived && currentCall.core.state != LinphoneEnums.CallState.IncomingReceived
&& currentCall.core.state != LinphoneEnums.CallState.PushIncomingReceived && currentCall.core.state != LinphoneEnums.CallState.PushIncomingReceived
@ -444,7 +446,6 @@ Item {
popup.contentItem: ColumnLayout { popup.contentItem: ColumnLayout {
Accounts { Accounts {
id: accounts id: accounts
accountProxy: accountProxy
onAddAccountRequest: mainItem.addAccountRequest() onAddAccountRequest: mainItem.addAccountRequest()
onEditAccount: function(account) { onEditAccount: function(account) {
avatarButton.popup.close() avatarButton.popup.close()

View file

@ -5,6 +5,7 @@ import QtQuick.Controls
import Linphone import Linphone
import UtilsCpp 1.0 import UtilsCpp 1.0
import SettingsCpp 1.0 import SettingsCpp 1.0
import LinphoneAccountsCpp
AppWindow { AppWindow {
id: mainWindow id: mainWindow
@ -62,9 +63,11 @@ AppWindow {
} }
} }
AccountProxy { AccountProxy {
id: accountProxy id: accountProxy
onInitialized: initStackViewItem()
} }
StackView { StackView {
id: mainWindowStackView id: mainWindowStackView
anchors.fill: parent anchors.fill: parent

View file

@ -7,6 +7,7 @@ import QtQuick.Dialogs
import Linphone import Linphone
import UtilsCpp import UtilsCpp
import SettingsCpp import SettingsCpp
import LinphoneAccountsCpp
Item { Item {
id: mainItem id: mainItem
@ -16,7 +17,7 @@ Item {
readonly property int leftPadding: 32 * DefaultStyle.dp readonly property int leftPadding: 32 * DefaultStyle.dp
readonly property int rightPadding: 32 * DefaultStyle.dp readonly property int rightPadding: 32 * DefaultStyle.dp
readonly property int spacing: 16 * DefaultStyle.dp readonly property int spacing: 16 * DefaultStyle.dp
property AccountProxy accountProxy property AccountProxy accountProxy
signal addAccountRequest() signal addAccountRequest()
signal editAccount(AccountGui account) signal editAccount(AccountGui account)
@ -37,7 +38,7 @@ Item {
Layout.preferredHeight: contentHeight Layout.preferredHeight: contentHeight
Layout.fillWidth: true Layout.fillWidth: true
spacing: mainItem.spacing spacing: mainItem.spacing
model: mainItem.accountProxy model: LinphoneAccountsCpp
delegate: Contact{ delegate: Contact{
id: contactItem id: contactItem
width: list.width width: list.width

View file

@ -62,8 +62,10 @@ FocusScope {
ColumnLayout { ColumnLayout {
id: content id: content
width: parent.width
spacing: 32 * DefaultStyle.dp spacing: 32 * DefaultStyle.dp
anchors.left: parent.left
anchors.right: parent.right
anchors.rightMargin: 39 * DefaultStyle.dp
Button { Button {
id: grouCallButton id: grouCallButton
visible: mainItem.groupCallVisible && !SettingsCpp.disableMeetingsFeature visible: mainItem.groupCallVisible && !SettingsCpp.disableMeetingsFeature
@ -111,7 +113,6 @@ FocusScope {
} }
ColumnLayout { ColumnLayout {
spacing: 18 * DefaultStyle.dp spacing: 18 * DefaultStyle.dp
Layout.rightMargin: 39 * DefaultStyle.dp
Text { Text {
text: qsTr("All contacts") text: qsTr("All contacts")
font { font {

View file

@ -4,6 +4,7 @@ import QtQuick.Effects
import QtQuick.Controls as Control import QtQuick.Controls as Control
import Linphone import Linphone
import UtilsCpp 1.0 import UtilsCpp 1.0
import LinphoneAccountsCpp
RowLayout { RowLayout {
id: mainItem id: mainItem
@ -29,7 +30,7 @@ RowLayout {
displayAll: false displayAll: false
displayPresence: false displayPresence: false
mutedStatus: microButton.checked mutedStatus: microButton.checked
AccountProxy{ AccountProxy {
id: accounts id: accounts
} }
account: accounts.findAccountByAddress(mainItem.localAddress) account: accounts.findAccountByAddress(mainItem.localAddress)

View file

@ -173,7 +173,7 @@ Control.ComboBox {
visible: source != "" visible: source != ""
width: visible ? 20 * DefaultStyle.dp : 0 width: visible ? 20 * DefaultStyle.dp : 0
sourceSize.width: 20 * DefaultStyle.dp sourceSize.width: 20 * DefaultStyle.dp
source: modelData && modelData.img ? modelData.img : "" source: typeof(modelData) != "undefined" && modelData.img ? modelData.img : ""
fillMode: Image.PreserveAspectFit fillMode: Image.PreserveAspectFit
anchors.left: parent.left anchors.left: parent.left
anchors.leftMargin: visible ? 10 * DefaultStyle.dp : 0 anchors.leftMargin: visible ? 10 * DefaultStyle.dp : 0
@ -181,11 +181,13 @@ Control.ComboBox {
} }
Text { Text {
text: modelData text: typeof(modelData) != "undefined"
? modelData.text ? modelData.text
? modelData.text ? modelData.text
: modelData : modelData
: "" : $modelData
? $modelData
: ""
elide: Text.ElideRight elide: Text.ElideRight
maximumLineCount: 1 maximumLineCount: 1
wrapMode: Text.WrapAnywhere wrapMode: Text.WrapAnywhere

View file

@ -265,7 +265,7 @@ RightPanelLayout {
} }
TextField { TextField {
id: addressTextField id: addressTextField
onTextEdited: { onEditingFinished: {
if (text.length != 0) mainItem.contact.core.setAddressAt(index, qsTr("Adresse SIP"), text) if (text.length != 0) mainItem.contact.core.setAddressAt(index, qsTr("Adresse SIP"), text)
} }
property string _initialText: modelData.address property string _initialText: modelData.address

View file

@ -132,7 +132,7 @@ ListView {
RowLayout { RowLayout {
id: contactDelegate id: contactDelegate
anchors.left: initial.visible ? initial.right : parent.left anchors.left: initial.visible ? initial.right : parent.left
anchors.right: actionsRow.left anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
spacing: 10 * DefaultStyle.dp spacing: 10 * DefaultStyle.dp
z: 1 z: 1
@ -162,127 +162,128 @@ ListView {
function onSelectedContactCountChanged(){ isSelectedCheck.visible = (mainItem.selectedContacts.indexOf(modelData.core.defaultAddress) != -1)} function onSelectedContactCountChanged(){ isSelectedCheck.visible = (mainItem.selectedContacts.indexOf(modelData.core.defaultAddress) != -1)}
} }
} }
Item{Layout.fillWidth: true}
RowLayout {
id: actionsRow
z: 1
// anchors.right: parent.right
Layout.rightMargin: 5 * DefaultStyle.dp
// anchors.verticalCenter: parent.verticalCenter
spacing: 10 * DefaultStyle.dp // TODO : change when mockup ready
RowLayout{
id: actionButtons
visible: mainItem.actionLayoutVisible
spacing: 10 * DefaultStyle.dp
Button {
id: callButton
Layout.preferredWidth: 45 * DefaultStyle.dp
Layout.preferredHeight: 45 * DefaultStyle.dp
icon.width: 24 * DefaultStyle.dp
icon.height: 24 * DefaultStyle.dp
icon.source: AppIcons.phone
focus: visible
contentImageColor: DefaultStyle.main2_500main
background: Rectangle {
anchors.fill: parent
radius: 40 * DefaultStyle.dp
color: DefaultStyle.main2_200
}
onClicked: UtilsCpp.createCall(modelData.core.defaultAddress)
KeyNavigation.right: chatButton
KeyNavigation.left: chatButton
}
Button {
id: chatButton
Layout.preferredWidth: 45 * DefaultStyle.dp
Layout.preferredHeight: 45 * DefaultStyle.dp
icon.width: 24 * DefaultStyle.dp
icon.height: 24 * DefaultStyle.dp
icon.source: AppIcons.chatTeardropText
focus: visible && !callButton.visible
contentImageColor: DefaultStyle.main2_500main
background: Rectangle {
anchors.fill: parent
radius: 40 * DefaultStyle.dp
color: DefaultStyle.main2_200
}
KeyNavigation.right: callButton
KeyNavigation.left: callButton
}
}
PopupButton {
id: friendPopup
z: 1
// Layout.rightMargin: 13 * DefaultStyle.dp
Layout.alignment: Qt.AlignVCenter
popup.x: 0
popup.padding: 10 * DefaultStyle.dp
hoverEnabled: mainItem.hoverEnabled
visible: mainItem.contactMenuVisible && (contactArea.containsMouse || hovered || popup.opened) && (!mainItem.delegateButtons || mainItem.delegateButtons.length === 0)
popup.contentItem: ColumnLayout {
Button {
text: modelData.core.starred ? qsTr("Enlever des favoris") : qsTr("Mettre en favori")
background: Item{}
icon.source: modelData.core.starred ? AppIcons.heartFill : AppIcons.heart
icon.width: 24 * DefaultStyle.dp
icon.height: 24 * DefaultStyle.dp
spacing: 10 * DefaultStyle.dp
textSize: 14 * DefaultStyle.dp
textWeight: 400 * DefaultStyle.dp
textColor: DefaultStyle.main2_500main
contentImageColor: modelData.core.starred ? DefaultStyle.danger_500main : DefaultStyle.main2_600
onClicked: {
modelData.core.lSetStarred(!modelData.core.starred)
friendPopup.close()
}
}
Button {
text: qsTr("Partager")
background: Item{}
icon.source: AppIcons.shareNetwork
icon.width: 24 * DefaultStyle.dp
icon.height: 24 * DefaultStyle.dp
spacing: 10 * DefaultStyle.dp
textSize: 14 * DefaultStyle.dp
textWeight: 400 * DefaultStyle.dp
textColor: DefaultStyle.main2_500main
onClicked: {
var vcard = modelData.core.getVCard()
var username = modelData.core.givenName + modelData.core.familyName
var filepath = UtilsCpp.createVCardFile(username, vcard)
if (filepath == "") UtilsCpp.showInformationPopup(qsTr("Erreur"), qsTr("La création du fichier vcard a échoué"), false)
else mainWindow.showInformationPopup(qsTr("VCard créée"), qsTr("VCard du contact enregistrée dans %1").arg(filepath))
UtilsCpp.shareByEmail(qsTr("Partage de contact"), vcard, filepath)
}
}
Button {
text: qsTr("Supprimer")
background: Item{}
icon.source: AppIcons.trashCan
icon.width: 24 * DefaultStyle.dp
icon.height: 24 * DefaultStyle.dp
spacing: 10 * DefaultStyle.dp
textSize: 14 * DefaultStyle.dp
textWeight: 400 * DefaultStyle.dp
textColor: DefaultStyle.danger_500main
contentImageColor: DefaultStyle.danger_500main
onClicked: {
mainItem.contactDeletionRequested(modelData)
friendPopup.close()
}
}
}
}
}
} }
RowLayout {
id: actionsRow
z: 1
anchors.right: parent.right
anchors.rightMargin: 5 * DefaultStyle.dp
anchors.verticalCenter: parent.verticalCenter
spacing: 10 * DefaultStyle.dp // TODO : change when mockup ready
RowLayout{
id: actionButtons
visible: mainItem.actionLayoutVisible
spacing: 10 * DefaultStyle.dp
Button {
id: callButton
Layout.preferredWidth: 45 * DefaultStyle.dp
Layout.preferredHeight: 45 * DefaultStyle.dp
icon.width: 24 * DefaultStyle.dp
icon.height: 24 * DefaultStyle.dp
icon.source: AppIcons.phone
focus: visible
contentImageColor: DefaultStyle.main2_500main
background: Rectangle {
anchors.fill: parent
radius: 40 * DefaultStyle.dp
color: DefaultStyle.main2_200
}
onClicked: UtilsCpp.createCall(modelData.core.defaultAddress)
KeyNavigation.right: chatButton
KeyNavigation.left: chatButton
}
Button {
id: chatButton
Layout.preferredWidth: 45 * DefaultStyle.dp
Layout.preferredHeight: 45 * DefaultStyle.dp
icon.width: 24 * DefaultStyle.dp
icon.height: 24 * DefaultStyle.dp
icon.source: AppIcons.chatTeardropText
focus: visible && !callButton.visible
contentImageColor: DefaultStyle.main2_500main
background: Rectangle {
anchors.fill: parent
radius: 40 * DefaultStyle.dp
color: DefaultStyle.main2_200
}
KeyNavigation.right: callButton
KeyNavigation.left: callButton
}
}
PopupButton {
id: friendPopup
z: 1
// Layout.rightMargin: 13 * DefaultStyle.dp
Layout.alignment: Qt.AlignVCenter
popup.x: 0
popup.padding: 10 * DefaultStyle.dp
hoverEnabled: mainItem.hoverEnabled
visible: mainItem.contactMenuVisible && (contactArea.containsMouse || hovered || popup.opened) && (!mainItem.delegateButtons || mainItem.delegateButtons.length === 0)
popup.contentItem: ColumnLayout {
Button {
text: modelData.core.starred ? qsTr("Enlever des favoris") : qsTr("Mettre en favori")
background: Item{}
icon.source: modelData.core.starred ? AppIcons.heartFill : AppIcons.heart
icon.width: 24 * DefaultStyle.dp
icon.height: 24 * DefaultStyle.dp
spacing: 10 * DefaultStyle.dp
textSize: 14 * DefaultStyle.dp
textWeight: 400 * DefaultStyle.dp
textColor: DefaultStyle.main2_500main
contentImageColor: modelData.core.starred ? DefaultStyle.danger_500main : DefaultStyle.main2_600
onClicked: {
modelData.core.lSetStarred(!modelData.core.starred)
friendPopup.close()
}
}
Button {
text: qsTr("Partager")
background: Item{}
icon.source: AppIcons.shareNetwork
icon.width: 24 * DefaultStyle.dp
icon.height: 24 * DefaultStyle.dp
spacing: 10 * DefaultStyle.dp
textSize: 14 * DefaultStyle.dp
textWeight: 400 * DefaultStyle.dp
textColor: DefaultStyle.main2_500main
onClicked: {
var vcard = modelData.core.getVCard()
var username = modelData.core.givenName + modelData.core.familyName
var filepath = UtilsCpp.createVCardFile(username, vcard)
if (filepath == "") UtilsCpp.showInformationPopup(qsTr("Erreur"), qsTr("La création du fichier vcard a échoué"), false)
else mainWindow.showInformationPopup(qsTr("VCard créée"), qsTr("VCard du contact enregistrée dans %1").arg(filepath))
UtilsCpp.shareByEmail(qsTr("Partage de contact"), vcard, filepath)
}
}
Button {
text: qsTr("Supprimer")
background: Item{}
icon.source: AppIcons.trashCan
icon.width: 24 * DefaultStyle.dp
icon.height: 24 * DefaultStyle.dp
spacing: 10 * DefaultStyle.dp
textSize: 14 * DefaultStyle.dp
textWeight: 400 * DefaultStyle.dp
textColor: DefaultStyle.danger_500main
contentImageColor: DefaultStyle.danger_500main
onClicked: {
mainItem.contactDeletionRequested(modelData)
friendPopup.close()
}
}
}
}
}
MouseArea { MouseArea {
id: contactArea id: contactArea
enabled: mainItem.selectionEnabled enabled: mainItem.selectionEnabled
hoverEnabled: mainItem.hoverEnabled hoverEnabled: mainItem.hoverEnabled
anchors.fill: itemDelegate anchors.fill: contactDelegate
height: mainItem.height height: mainItem.height
acceptedButtons: Qt.AllButtons acceptedButtons: Qt.AllButtons
z: -1 z: -1

View file

@ -163,7 +163,7 @@ Item {
} }
ColumnLayout { ColumnLayout {
spacing: 0 spacing: 0
visible: mainItem.displayAll && !mainItem.remoteIsPaused visible: mainItem.displayAll && !mainItem.remoteIsPaused && !mainItem.conference
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
anchors.top: centerItem.bottom anchors.top: centerItem.bottom
anchors.topMargin: 21 * DefaultStyle.dp anchors.topMargin: 21 * DefaultStyle.dp

View file

@ -29,8 +29,8 @@ Popup {
signal rejected() signal rejected()
contentItem: FocusScope { contentItem: FocusScope {
width: child.implicitWidth implicitWidth: child.implicitWidth
height: child.implicitHeight implicitHeight: child.implicitHeight
onVisibleChanged: { onVisibleChanged: {
if(visible) forceActiveFocus() if(visible) forceActiveFocus()
} }

View file

@ -89,8 +89,8 @@ Notification {
imageHeight: 32 * DefaultStyle.dp imageHeight: 32 * DefaultStyle.dp
} }
onClicked: { onClicked: {
mainItem.call.core.lAccept(false)
UtilsCpp.openCallsWindow(mainItem.call) UtilsCpp.openCallsWindow(mainItem.call)
mainItem.call.core.lAccept(false)
} }
} }
Button { Button {

View file

@ -4,27 +4,27 @@ import QtQuick.Layouts as Layout
import QtQuick.Effects import QtQuick.Effects
import Linphone import Linphone
import UtilsCpp import UtilsCpp
import LinphoneCallsCpp
Control.Popup { Control.Popup {
id: mainItem id: mainItem
property bool closeButtonVisible: true
property bool roundedBottom: false
closePolicy: Control.Popup.CloseOnEscape closePolicy: Control.Popup.CloseOnEscape
leftPadding: 72 * DefaultStyle.dp leftPadding: 72 * DefaultStyle.dp
rightPadding: 72 * DefaultStyle.dp rightPadding: 72 * DefaultStyle.dp
topPadding: 41 * DefaultStyle.dp topPadding: 41 * DefaultStyle.dp
bottomPadding: 18 * DefaultStyle.dp bottomPadding: 18 * DefaultStyle.dp
onOpened: numPad.forceActiveFocus() property bool closeButtonVisible: true
signal buttonPressed(string text) property bool roundedBottom: false
property var currentCall
onButtonPressed: (text) => { onButtonPressed: (text) => {
if (callsModel.currentCall) callsModel.currentCall.core.lSendDtmf(text) if (currentCall) currentCall.core.lSendDtmf(text)
else UtilsCpp.playDtmf(text) else UtilsCpp.playDtmf(text)
} }
onOpened: numPad.forceActiveFocus()
signal buttonPressed(string text)
signal launchCall() signal launchCall()
signal wipe() signal wipe()
CallProxy{
id: callsModel
}
background: Item { background: Item {
anchors.fill: parent anchors.fill: parent
Rectangle { Rectangle {

View file

@ -7,6 +7,7 @@ import Linphone
import EnumsToStringCpp 1.0 import EnumsToStringCpp 1.0
import UtilsCpp 1.0 import UtilsCpp 1.0
import SettingsCpp 1.0 import SettingsCpp 1.0
import LinphoneAccountsCpp
// ============================================================================= // =============================================================================
Item{ Item{
@ -111,6 +112,7 @@ Item{
call: mainItem.call call: mainItem.call
width: mainStackView.width width: mainStackView.width
height: mainStackView.height height: mainStackView.height
displayAll: !mainItem.conference
participantDevice: mainItem.conference && mainItem.conference.core.activeSpeaker participantDevice: mainItem.conference && mainItem.conference.core.activeSpeaker
property var address: participantDevice && participantDevice.core.address property var address: participantDevice && participantDevice.core.address
videoEnabled: (participantDevice && participantDevice.core.videoEnabled) || (!participantDevice && call && call.core.remoteVideoEnabled) videoEnabled: (participantDevice && participantDevice.core.videoEnabled) || (!participantDevice && call && call.core.remoteVideoEnabled)
@ -168,7 +170,8 @@ Item{
anchors.bottomMargin: 10 * DefaultStyle.dp anchors.bottomMargin: 10 * DefaultStyle.dp
videoEnabled: preview.visible && mainItem.call && mainItem.call.core.localVideoEnabled videoEnabled: preview.visible && mainItem.call && mainItem.call.core.localVideoEnabled
onVideoEnabledChanged: console.log("P : " +videoEnabled + " / " +visible +" / " +mainItem.call) onVideoEnabledChanged: console.log("P : " +videoEnabled + " / " +visible +" / " +mainItem.call)
property AccountProxy accounts: AccountProxy{id: accountProxy} property AccountProxy accounts: AccountProxy {id: accountProxy
}
account: accountProxy.findAccountByAddress(mainItem.localAddress) account: accountProxy.findAccountByAddress(mainItem.localAddress)
call: mainItem.call call: mainItem.call
displayAll: false displayAll: false

View file

@ -3,6 +3,7 @@ import QtQuick.Layouts
import QtQml.Models import QtQml.Models
import Linphone import Linphone
import LinphoneAccountsCpp
// ============================================================================= // =============================================================================
@ -22,7 +23,8 @@ Mosaic {
qmlName: "G" qmlName: "G"
Component.onCompleted: console.log("Loaded : " +allDevices + " = " +allDevices.count) Component.onCompleted: console.log("Loaded : " +allDevices + " = " +allDevices.count)
} }
property AccountProxy accounts: AccountProxy{id: accountProxy} property AccountProxy accounts: AccountProxy {id: accountProxy
}
model: grid.call && grid.call.core.isConference ? participantDevices: [0,1] model: grid.call && grid.call.core.isConference ? participantDevices: [0,1]
delegate: Item{ delegate: Item{
id: avatarCell id: avatarCell

View file

@ -5,11 +5,12 @@ import QtQuick.Controls as Control
import Linphone import Linphone
import UtilsCpp 1.0 import UtilsCpp 1.0
import SettingsCpp 1.0 import SettingsCpp 1.0
import LinphoneAccountsCpp
AbstractMasterDetailPage { AbstractMasterDetailPage {
layoutsPath: "qrc:/Linphone/view/App/Layout/Account" layoutsPath: "qrc:/Linphone/view/App/Layout/Account"
titleText: qsTr("Mon compte") titleText: qsTr("Mon compte")
property AccountProxy accounts: AccountProxy{id: accountProxy} property AccountProxy accounts: AccountProxy {id: accountProxy}
property AccountGui account: accountProxy.defaultAccount property AccountGui account: accountProxy.defaultAccount
signal accountRemoved() signal accountRemoved()
families: [ families: [

View file

@ -5,6 +5,7 @@ import QtQuick.Controls as Control
import Linphone import Linphone
import UtilsCpp import UtilsCpp
import SettingsCpp import SettingsCpp
import LinphoneAccountsCpp
AbstractMainPage { AbstractMainPage {
id: mainItem id: mainItem
@ -17,7 +18,7 @@ AbstractMainPage {
//Group call properties //Group call properties
property ConferenceInfoGui confInfoGui property ConferenceInfoGui confInfoGui
property AccountProxy accounts: AccountProxy{id: accountProxy} property AccountProxy accounts: AccountProxy {id: accountProxy}
property AccountGui account: accountProxy.defaultAccount property AccountGui account: accountProxy.defaultAccount
property var state: account && account.core.registrationState || 0 property var state: account && account.core.registrationState || 0
property bool isRegistered: account ? account.core.registrationState == LinphoneEnums.RegistrationState.Ok : false property bool isRegistered: account ? account.core.registrationState == LinphoneEnums.RegistrationState.Ok : false

View file

@ -136,7 +136,7 @@ AbstractMainPage {
spacing: 0 spacing: 0
RowLayout { RowLayout {
enabled: mainItem.leftPanelEnabled enabled: mainItem.leftPanelEnabled
Layout.rightMargin: 39 * DefaultStyle.dp Layout.rightMargin: 38 * DefaultStyle.dp
spacing: 0 spacing: 0
Text { Text {
Layout.fillWidth: true Layout.fillWidth: true
@ -163,7 +163,7 @@ AbstractMainPage {
id: searchBar id: searchBar
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 18 * DefaultStyle.dp Layout.topMargin: 18 * DefaultStyle.dp
Layout.rightMargin: 39 * DefaultStyle.dp Layout.rightMargin: 38 * DefaultStyle.dp
placeholderText: qsTr("Rechercher une réunion") placeholderText: qsTr("Rechercher une réunion")
KeyNavigation.up: conferenceList KeyNavigation.up: conferenceList
KeyNavigation.down: conferenceList KeyNavigation.down: conferenceList
@ -231,9 +231,8 @@ AbstractMainPage {
property bool isCreation property bool isCreation
ColumnLayout { ColumnLayout {
spacing: 33 * DefaultStyle.dp spacing: 33 * DefaultStyle.dp
anchors.fill: parent
RowLayout { RowLayout {
width: 320 * DefaultStyle.dp
Layout.rightMargin: 35 * DefaultStyle.dp Layout.rightMargin: 35 * DefaultStyle.dp
spacing: 5 * DefaultStyle.dp spacing: 5 * DefaultStyle.dp
Button { Button {
@ -263,6 +262,7 @@ AbstractMainPage {
} }
Layout.fillWidth: true Layout.fillWidth: true
} }
Item {Layout.fillWidth: true}
Button { Button {
id: createButton id: createButton
Layout.preferredWidth: 57 * DefaultStyle.dp Layout.preferredWidth: 57 * DefaultStyle.dp
@ -317,6 +317,10 @@ AbstractMainPage {
} }
createConfLayout.enabled = meetingSetup.conferenceInfoGui.core.schedulerState != LinphoneEnums.ConferenceSchedulerState.AllocationPending createConfLayout.enabled = meetingSetup.conferenceInfoGui.core.schedulerState != LinphoneEnums.ConferenceSchedulerState.AllocationPending
} }
function onSaveFailed() {
var mainWin = UtilsCpp.getMainWindow()
mainWin.closeLoadingPopup()
}
} }
onSaveSucceed: { onSaveSucceed: {
leftPanelStackView.pop() leftPanelStackView.pop()

View file

@ -3,12 +3,13 @@ import QtQuick.Layouts 1.0
import QtQuick.Controls as Control import QtQuick.Controls as Control
import Linphone import Linphone
import UtilsCpp 1.0 import UtilsCpp 1.0
import LinphoneAccountsCpp
// Snippet // Snippet
ListView{ ListView{
id: mainItem id: mainItem
model: AccountProxy{} model: AccountProxy {}
function printObject(o) { function printObject(o) {
var out = ''; var out = '';
for (var p in o) { for (var p in o) {

View file

@ -3,6 +3,8 @@ import QtQuick.Layouts 1.0
import QtQuick.Controls as Control import QtQuick.Controls as Control
import Linphone import Linphone
import UtilsCpp 1.0 import UtilsCpp 1.0
import LinphoneAccountsCpp
import LinphoneCallsCpp
// Snippet // Snippet
Window { Window {
@ -21,7 +23,6 @@ Window {
onCallChanged: console.log('New Call:' +call) onCallChanged: console.log('New Call:' +call)
onClosing: { onClosing: {
accountStatus.defaultAccount = accountStatus accountStatus.defaultAccount = accountStatus
accountLayout.accounts = null
gc() gc()
} }
Component.onDestruction: gc() Component.onDestruction: gc()
@ -39,8 +40,8 @@ Window {
ListView{ ListView{
id: callList id: callList
anchors.fill: parent anchors.fill: parent
model: CallProxy{ model: CallProxy {
id: callsModel id: callProxy
onCountChanged: console.log("count:"+count) onCountChanged: console.log("count:"+count)
} }
delegate: RectangleTest{ delegate: RectangleTest{
@ -57,7 +58,7 @@ Window {
anchors.fill: parent anchors.fill: parent
onClicked: { onClicked: {
//modelData.core.lSetPaused(false) //modelData.core.lSetPaused(false)
callsModel.currentCall = modelData callProxy.currentCall = modelData
} }
} }
} }
@ -69,7 +70,7 @@ Window {
RowLayout { RowLayout {
id: accountLayout id: accountLayout
Layout.fillWidth: true Layout.fillWidth: true
property AccountProxy accounts: AccountProxy{id: accountProxy} property AccountProxy accounts: AccountProxy {id: accountProxy}
property var haveAccountVar: UtilsCpp.haveAccount() property var haveAccountVar: UtilsCpp.haveAccount()
property var haveAccount: haveAccountVar ? haveAccountVar.value : false property var haveAccount: haveAccountVar ? haveAccountVar.value : false
onHaveAccountChanged: { onHaveAccountChanged: {
@ -87,7 +88,7 @@ Window {
ListView{ ListView{
id: accountList id: accountList
Layout.fillHeight: true Layout.fillHeight: true
model: AccountProxy{} model: AccountProxy {}
delegate:Rectangle{ delegate:Rectangle{
color: "#11111111" color: "#11111111"
height: 20 height: 20

@ -1 +1 @@
Subproject commit 09ec61ae54e4f972ac00bf5b20dd48e4aad867b1 Subproject commit 7f93384a7206b754c1f550751a633ab1e8fee076