diff --git a/Linphone/core/account/AccountCore.cpp b/Linphone/core/account/AccountCore.cpp index 04333796b..6cdfff27f 100644 --- a/Linphone/core/account/AccountCore.cpp +++ b/Linphone/core/account/AccountCore.cpp @@ -84,6 +84,7 @@ AccountCore::AccountCore(const std::shared_ptr &account) : QO ? Utils::coreStringToAppString(params->getAudioVideoConferenceFactoryAddress()->asString()) : ""; mLimeServerUrl = Utils::coreStringToAppString(params->getLimeServerUrl()); + mCcmpServerUrl = Utils::coreStringToAppString(params->getCcmpServerUrl()); // Add listener mAccountModel = Utils::makeQObject_ptr(account); // OK @@ -148,6 +149,7 @@ AccountCore::AccountCore(const AccountCore &accountCore) { mConferenceFactoryAddress = accountCore.mConferenceFactoryAddress; mAudioVideoConferenceFactoryAddress = accountCore.mAudioVideoConferenceFactoryAddress; mLimeServerUrl = accountCore.mLimeServerUrl; + mCcmpServerUrl = accountCore.mCcmpServerUrl; } void AccountCore::setSelf(QSharedPointer me) { @@ -236,6 +238,10 @@ void AccountCore::setSelf(QSharedPointer me) { mAccountModelConnection->makeConnectToModel(&AccountModel::limeServerUrlChanged, [this](QString value) { mAccountModelConnection->invokeToCore([this, value]() { onLimeServerUrlChanged(value); }); }); + mAccountModelConnection->makeConnectToModel(&AccountModel::ccmpServerUrlChanged, [this](QString value) { + mAccountModelConnection->invokeToCore([this, value]() { onCcmpServerUrlChanged(value); }); + }); + mAccountModelConnection->makeConnectToModel( &AccountModel::removed, [this]() { mAccountModelConnection->invokeToCore([this]() { emit removed(); }); }); @@ -327,6 +333,7 @@ void AccountCore::reset(const AccountCore &accountCore) { setConferenceFactoryAddress(accountCore.mConferenceFactoryAddress); setAudioVideoConferenceFactoryAddress(accountCore.mAudioVideoConferenceFactoryAddress); setLimeServerUrl(accountCore.mLimeServerUrl); + setCcmpServerUrl(accountCore.mCcmpServerUrl); } const std::shared_ptr &AccountCore::getModel() const { @@ -574,6 +581,10 @@ QString AccountCore::getLimeServerUrl() { return mLimeServerUrl; } +QString AccountCore::getCcmpServerUrl() { + return mCcmpServerUrl; +} + void AccountCore::setMwiServerAddress(QString value) { if (mMwiServerAddress != value) { mMwiServerAddress = value; @@ -678,6 +689,14 @@ void AccountCore::setLimeServerUrl(QString value) { } } +void AccountCore::setCcmpServerUrl(QString value) { + if (mCcmpServerUrl != value) { + mCcmpServerUrl = value; + emit ccmpServerUrlChanged(); + setIsSaved(false); + } +} + bool AccountCore::isSaved() const { return mIsSaved; } @@ -790,6 +809,13 @@ void AccountCore::onLimeServerUrlChanged(QString value) { } } +void AccountCore::onCcmpServerUrlChanged(QString value) { + if (value != mCcmpServerUrl) { + mCcmpServerUrl = value; + emit ccmpServerUrlChanged(); + } +} + void AccountCore::writeIntoModel(std::shared_ptr model) const { mustBeInLinphoneThread(getClassName() + Q_FUNC_INFO); model->setMwiServerAddress(mMwiServerAddress); @@ -806,6 +832,7 @@ void AccountCore::writeIntoModel(std::shared_ptr model) const { model->setConferenceFactoryAddress(mConferenceFactoryAddress); model->setAudioVideoConferenceFactoryAddress(mAudioVideoConferenceFactoryAddress); model->setLimeServerUrl(mLimeServerUrl); + model->setCcmpServerUrl(mCcmpServerUrl); model->setVoicemailAddress(mVoicemailAddress); } @@ -825,6 +852,7 @@ void AccountCore::writeFromModel(const std::shared_ptr &model) { onConferenceFactoryAddressChanged(model->getConferenceFactoryAddress()); onAudioVideoConferenceFactoryAddressChanged(model->getAudioVideoConferenceFactoryAddress()); onLimeServerUrlChanged(model->getLimeServerUrl()); + onCcmpServerUrlChanged(model->getCcmpServerUrl()); onVoicemailAddressChanged(model->getVoicemailAddress()); } diff --git a/Linphone/core/account/AccountCore.hpp b/Linphone/core/account/AccountCore.hpp index fbfd62f2b..badc4f9c3 100644 --- a/Linphone/core/account/AccountCore.hpp +++ b/Linphone/core/account/AccountCore.hpp @@ -84,6 +84,7 @@ public: Q_PROPERTY(LinphoneEnums::Presence explicitPresence MEMBER mExplicitPresence NOTIFY presenceChanged) Q_PROPERTY(QString presenceNote READ getPresenceNote WRITE setPresenceNote NOTIFY presenceChanged) Q_PROPERTY(int maxPresenceNoteSize MEMBER mMaxPresenceNoteSize CONSTANT) + Q_PROPERTY(QString ccmpServerUrl READ getCcmpServerUrl WRITE setCcmpServerUrl NOTIFY ccmpServerUrlChanged) DECLARE_CORE_GET(int, voicemailCount, VoicemailCount) static QSharedPointer create(const std::shared_ptr &account); @@ -143,6 +144,7 @@ public: QString getAudioVideoConferenceFactoryAddress(); QString getLimeServerUrl(); QString getVoicemailAddress(); + QString getCcmpServerUrl(); void setMwiServerAddress(QString value); void setTransport(QString value); @@ -157,6 +159,7 @@ public: void setAudioVideoConferenceFactoryAddress(QString value); void setLimeServerUrl(QString value); void setVoicemailAddress(QString value); + void setCcmpServerUrl(QString value); bool isSaved() const; void setIsSaved(bool saved); @@ -175,6 +178,7 @@ public: void onConferenceFactoryAddressChanged(QString value); void onAudioVideoConferenceFactoryAddressChanged(QString value); void onLimeServerUrlChanged(QString value); + void onCcmpServerUrlChanged(QString value); DECLARE_CORE_GET(bool, showMwi, ShowMwi) @@ -220,6 +224,7 @@ signals: void isSavedChanged(); void voicemailAddressChanged(); void presenceChanged(); + void ccmpServerUrlChanged(); void setValueFailed(const QString &error); @@ -268,6 +273,7 @@ private: QString mAudioVideoConferenceFactoryAddress; QString mLimeServerUrl; QString mVoicemailAddress; + QString mCcmpServerUrl; LinphoneEnums::Presence mPresence = LinphoneEnums::Presence::Undefined; LinphoneEnums::Presence mExplicitPresence; QString mPresenceNote; diff --git a/Linphone/data/languages/en.ts b/Linphone/data/languages/en.ts index e7566ce3d..fc1ffd3fb 100644 --- a/Linphone/data/languages/en.ts +++ b/Linphone/data/languages/en.ts @@ -493,6 +493,12 @@ "URL du serveur d’échange de clés de chiffrement" Lime server URL + + + account_settings_ccmp_server_url_title + "URL du serveur CCMP" + CCMP server URL + AddParticipantsForm diff --git a/Linphone/data/languages/fr.ts b/Linphone/data/languages/fr.ts index 4387486c5..e644676e8 100644 --- a/Linphone/data/languages/fr.ts +++ b/Linphone/data/languages/fr.ts @@ -493,6 +493,12 @@ "URL du serveur d’échange de clés de chiffrement" URL du serveur d’échange de clés de chiffrement + + + account_settings_ccmp_server_url_title + "URL du serveur CCMP" + URL du serveur CCMP + AddParticipantsForm diff --git a/Linphone/model/account/AccountModel.cpp b/Linphone/model/account/AccountModel.cpp index 60df3e702..7852e5d55 100644 --- a/Linphone/model/account/AccountModel.cpp +++ b/Linphone/model/account/AccountModel.cpp @@ -606,3 +606,15 @@ bool AccountModel::forwardToVoiceMailInDndPresence() { std::list> AccountModel::getChatRooms() { return mMonitor->getChatRooms(); } + +QString AccountModel::getCcmpServerUrl() const { + return Utils::coreStringToAppString(mMonitor->getParams()->getCcmpServerUrl()); +} + +void AccountModel::setCcmpServerUrl(QString value) { + mustBeInLinphoneThread(log().arg(Q_FUNC_INFO)); + auto params = mMonitor->getParams()->clone(); + params->setCcmpServerUrl(Utils::appStringToCoreString(value)); + mMonitor->setParams(params); + emit ccmpServerUrlChanged(value); +} diff --git a/Linphone/model/account/AccountModel.hpp b/Linphone/model/account/AccountModel.hpp index 1a3901157..8112632ce 100644 --- a/Linphone/model/account/AccountModel.hpp +++ b/Linphone/model/account/AccountModel.hpp @@ -91,6 +91,8 @@ public: std::string configAccountSection(); bool forwardToVoiceMailInDndPresence(); std::list> getChatRooms(); + QString getCcmpServerUrl() const; + void setCcmpServerUrl(QString value); signals: void registrationStateChanged(const std::shared_ptr &account, @@ -126,6 +128,7 @@ signals: void showMwiChanged(bool show); void voicemailAddressChanged(QString value); void presenceChanged(LinphoneEnums::Presence presence, bool userInitiated); + void ccmpServerUrlChanged(QString value); void setValueFailed(const QString &errorMessage); diff --git a/Linphone/view/Page/Layout/Settings/AccountSettingsParametersLayout.qml b/Linphone/view/Page/Layout/Settings/AccountSettingsParametersLayout.qml index 3b87fadb2..7e43b08f8 100644 --- a/Linphone/view/Page/Layout/Settings/AccountSettingsParametersLayout.qml +++ b/Linphone/view/Page/Layout/Settings/AccountSettingsParametersLayout.qml @@ -207,6 +207,14 @@ AbstractSettingsLayout { propertyOwnerGui: account toValidate: true } + DecoratedTextField { + Layout.fillWidth: true + //: "URL du serveur CCMP" + title: qsTr("account_settings_ccmp_server_url_title") + propertyName: "ccmpServerUrl" + propertyOwnerGui: account + toValidate: true + } } } }