mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-08-23 16:23:55 +02:00
settings: add allow IP auto rewrite option
Change-Id: I09c24f1185b37c728eb9ce1968cca21a99b79452
This commit is contained in:
parent
a31fb6c0d8
commit
37c45c27a5
4 changed files with 39 additions and 0 deletions
|
@ -115,6 +115,7 @@ Item {
|
||||||
property string stunAdress: qsTr("STUN address")
|
property string stunAdress: qsTr("STUN address")
|
||||||
|
|
||||||
// AdvancedPublicAddressSettings
|
// AdvancedPublicAddressSettings
|
||||||
|
property string allowIPAutoRewrite: qsTr("Allow IP Auto Rewrite")
|
||||||
property string publicAddress: qsTr("Public address")
|
property string publicAddress: qsTr("Public address")
|
||||||
property string useCustomAddress: qsTr("Use custom address and port")
|
property string useCustomAddress: qsTr("Use custom address and port")
|
||||||
property string address: qsTr("Address")
|
property string address: qsTr("Address")
|
||||||
|
|
|
@ -552,6 +552,12 @@ SettingsAdapter::getAccountConfig_PublishedPort()
|
||||||
return getAccountConfig().publishedPort;
|
return getAccountConfig().publishedPort;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
SettingsAdapter::getAccountConfig_AllowIPAutoRewrite()
|
||||||
|
{
|
||||||
|
return getAccountConfig().allowIPAutoRewrite;
|
||||||
|
}
|
||||||
|
|
||||||
QString
|
QString
|
||||||
SettingsAdapter::getAccountConfig_Mailbox()
|
SettingsAdapter::getAccountConfig_Mailbox()
|
||||||
{
|
{
|
||||||
|
@ -762,6 +768,15 @@ SettingsAdapter::setUseCustomAddressAndPort(bool state)
|
||||||
lrcInstance_->accountModel().setAccountConfig(lrcInstance_->get_currentAccountId(), confProps);
|
lrcInstance_->accountModel().setAccountConfig(lrcInstance_->get_currentAccountId(), confProps);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
SettingsAdapter::setAllowIPAutoRewrite(bool state)
|
||||||
|
{
|
||||||
|
auto confProps = lrcInstance_->accountModel().getAccountConfig(
|
||||||
|
lrcInstance_->get_currentAccountId());
|
||||||
|
confProps.allowIPAutoRewrite = state;
|
||||||
|
lrcInstance_->accountModel().setAccountConfig(lrcInstance_->get_currentAccountId(), confProps);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
SettingsAdapter::setNameServer(QString text)
|
SettingsAdapter::setNameServer(QString text)
|
||||||
{
|
{
|
||||||
|
|
|
@ -150,6 +150,7 @@ public:
|
||||||
Q_INVOKABLE bool getAccountConfig_PublishedSameAsLocal();
|
Q_INVOKABLE bool getAccountConfig_PublishedSameAsLocal();
|
||||||
Q_INVOKABLE QString getAccountConfig_PublishedAddress();
|
Q_INVOKABLE QString getAccountConfig_PublishedAddress();
|
||||||
Q_INVOKABLE int getAccountConfig_PublishedPort();
|
Q_INVOKABLE int getAccountConfig_PublishedPort();
|
||||||
|
Q_INVOKABLE bool getAccountConfig_AllowIPAutoRewrite();
|
||||||
|
|
||||||
Q_INVOKABLE QString getAccountConfig_Mailbox();
|
Q_INVOKABLE QString getAccountConfig_Mailbox();
|
||||||
|
|
||||||
|
@ -178,6 +179,7 @@ public:
|
||||||
Q_INVOKABLE void setVerifyCertificatesClient(bool state);
|
Q_INVOKABLE void setVerifyCertificatesClient(bool state);
|
||||||
Q_INVOKABLE void setRequireCertificatesIncomingTLS(bool state);
|
Q_INVOKABLE void setRequireCertificatesIncomingTLS(bool state);
|
||||||
Q_INVOKABLE void setUseCustomAddressAndPort(bool state);
|
Q_INVOKABLE void setUseCustomAddressAndPort(bool state);
|
||||||
|
Q_INVOKABLE void setAllowIPAutoRewrite(bool state);
|
||||||
|
|
||||||
Q_INVOKABLE void setNameServer(QString text);
|
Q_INVOKABLE void setNameServer(QString text);
|
||||||
Q_INVOKABLE void setProxyAddress(QString text);
|
Q_INVOKABLE void setProxyAddress(QString text);
|
||||||
|
|
|
@ -35,9 +35,16 @@ ColumnLayout {
|
||||||
property int itemWidth
|
property int itemWidth
|
||||||
|
|
||||||
function updatePublicAddressAccountInfos() {
|
function updatePublicAddressAccountInfos() {
|
||||||
|
checkBoxAllowIPAutoRewrite.checked = SettingsAdapter.getAccountConfig_AllowIPAutoRewrite()
|
||||||
checkBoxCustomAddressPort.checked = !SettingsAdapter.getAccountConfig_PublishedSameAsLocal()
|
checkBoxCustomAddressPort.checked = !SettingsAdapter.getAccountConfig_PublishedSameAsLocal()
|
||||||
lineEditSIPCustomAddress.setText(SettingsAdapter.getAccountConfig_PublishedAddress())
|
lineEditSIPCustomAddress.setText(SettingsAdapter.getAccountConfig_PublishedAddress())
|
||||||
customPortSIPSpinBox.setValue(SettingsAdapter.getAccountConfig_PublishedPort())
|
customPortSIPSpinBox.setValue(SettingsAdapter.getAccountConfig_PublishedPort())
|
||||||
|
|
||||||
|
if (checkBoxAllowIPAutoRewrite.checked) {
|
||||||
|
checkBoxCustomAddressPort.visible = false
|
||||||
|
lineEditSIPCustomAddress.visible = false
|
||||||
|
customPortSIPSpinBox.visible = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
|
@ -58,6 +65,20 @@ ColumnLayout {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.leftMargin: JamiTheme.preferredMarginSize
|
Layout.leftMargin: JamiTheme.preferredMarginSize
|
||||||
|
|
||||||
|
ToggleSwitch {
|
||||||
|
id: checkBoxAllowIPAutoRewrite
|
||||||
|
|
||||||
|
labelText: JamiStrings.allowIPAutoRewrite
|
||||||
|
fontPointSize: JamiTheme.settingsFontSize
|
||||||
|
|
||||||
|
onSwitchToggled: {
|
||||||
|
SettingsAdapter.setAllowIPAutoRewrite(checked)
|
||||||
|
checkBoxCustomAddressPort.visible = !checked
|
||||||
|
lineEditSIPCustomAddress.visible = !checked
|
||||||
|
customPortSIPSpinBox.visible = !checked
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ToggleSwitch {
|
ToggleSwitch {
|
||||||
id: checkBoxCustomAddressPort
|
id: checkBoxCustomAddressPort
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue