mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-17 03:18:07 +00:00
Option to set CCMP server URL in account settings
This commit is contained in:
parent
e23a49fbd3
commit
c672762b63
7 changed files with 69 additions and 0 deletions
|
|
@ -84,6 +84,7 @@ AccountCore::AccountCore(const std::shared_ptr<linphone::Account> &account) : QO
|
|||
? Utils::coreStringToAppString(params->getAudioVideoConferenceFactoryAddress()->asString())
|
||||
: "";
|
||||
mLimeServerUrl = Utils::coreStringToAppString(params->getLimeServerUrl());
|
||||
mCcmpServerUrl = Utils::coreStringToAppString(params->getCcmpServerUrl());
|
||||
|
||||
// Add listener
|
||||
mAccountModel = Utils::makeQObject_ptr<AccountModel>(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<AccountCore> me) {
|
||||
|
|
@ -236,6 +238,10 @@ void AccountCore::setSelf(QSharedPointer<AccountCore> 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<AccountModel> &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<AccountModel> model) const {
|
||||
mustBeInLinphoneThread(getClassName() + Q_FUNC_INFO);
|
||||
model->setMwiServerAddress(mMwiServerAddress);
|
||||
|
|
@ -806,6 +832,7 @@ void AccountCore::writeIntoModel(std::shared_ptr<AccountModel> 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<AccountModel> &model) {
|
|||
onConferenceFactoryAddressChanged(model->getConferenceFactoryAddress());
|
||||
onAudioVideoConferenceFactoryAddressChanged(model->getAudioVideoConferenceFactoryAddress());
|
||||
onLimeServerUrlChanged(model->getLimeServerUrl());
|
||||
onCcmpServerUrlChanged(model->getCcmpServerUrl());
|
||||
onVoicemailAddressChanged(model->getVoicemailAddress());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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<AccountCore> create(const std::shared_ptr<linphone::Account> &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;
|
||||
|
|
|
|||
|
|
@ -493,6 +493,12 @@
|
|||
<extracomment>"URL du serveur d’échange de clés de chiffrement"</extracomment>
|
||||
<translation>Lime server URL</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../view/Page/Layout/Settings/AccountSettingsParametersLayout.qml"/>
|
||||
<source>account_settings_ccmp_server_url_title</source>
|
||||
<extracomment>"URL du serveur CCMP"</extracomment>
|
||||
<translation>CCMP server URL</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>AddParticipantsForm</name>
|
||||
|
|
|
|||
|
|
@ -493,6 +493,12 @@
|
|||
<extracomment>"URL du serveur d’échange de clés de chiffrement"</extracomment>
|
||||
<translation>URL du serveur d’échange de clés de chiffrement</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../../view/Page/Layout/Settings/AccountSettingsParametersLayout.qml"/>
|
||||
<source>account_settings_ccmp_server_url_title</source>
|
||||
<extracomment>"URL du serveur CCMP"</extracomment>
|
||||
<translation>URL du serveur CCMP</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>AddParticipantsForm</name>
|
||||
|
|
|
|||
|
|
@ -606,3 +606,15 @@ bool AccountModel::forwardToVoiceMailInDndPresence() {
|
|||
std::list<std::shared_ptr<linphone::ChatRoom>> 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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -91,6 +91,8 @@ public:
|
|||
std::string configAccountSection();
|
||||
bool forwardToVoiceMailInDndPresence();
|
||||
std::list<std::shared_ptr<linphone::ChatRoom>> getChatRooms();
|
||||
QString getCcmpServerUrl() const;
|
||||
void setCcmpServerUrl(QString value);
|
||||
|
||||
signals:
|
||||
void registrationStateChanged(const std::shared_ptr<linphone::Account> &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);
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue