Skip to content
Snippets Groups Projects
Commit e4af2bef authored by Ming Rui Zhang's avatar Ming Rui Zhang
Browse files

settings: add auto registration after expired option

Change-Id: Ib29e29f2d61d5684154c0714b5b3d656f99ddcf5
parent 1ab09e4a
No related branches found
No related tags found
No related merge requests found
......@@ -92,6 +92,7 @@ Item {
// AdvancedConnectivitySettings
property string connectivity: qsTr("Connectivity")
property string autoRegistration: qsTr("Auto Registration After Expired")
property string registrationTimeOut: qsTr("Registration expire timeout (seconds)")
property string networkInterface: qsTr("Network interface")
property string useUPnP: qsTr("Use UPnP")
......
......@@ -318,6 +318,12 @@ SettingsAdapter::getAccountConfig_Password()
return getAccountConfig().password;
}
bool
SettingsAdapter::getAccountConfig_KeepAliveEnabled()
{
return getAccountConfig().keepAliveEnabled;
}
QString
SettingsAdapter::getAccountConfig_RouteSet()
{
......@@ -656,6 +662,14 @@ SettingsAdapter::setEnableProxy(bool state)
LRCInstance::accountModel().setAccountConfig(LRCInstance::getCurrAccId(), confProps);
}
void
SettingsAdapter::setKeepAliveEnabled(bool state)
{
auto confProps = LRCInstance::accountModel().getAccountConfig(LRCInstance::getCurrAccId());
confProps.keepAliveEnabled = state;
LRCInstance::accountModel().setAccountConfig(LRCInstance::getCurrAccId(), confProps);
}
void
SettingsAdapter::setUseUPnP(bool state)
{
......
......@@ -108,6 +108,7 @@ public:
Q_INVOKABLE QString getAccountConfig_Hostname();
Q_INVOKABLE QString getAccountConfig_Password();
Q_INVOKABLE bool getAccountConfig_KeepAliveEnabled();
Q_INVOKABLE QString getAccountConfig_RouteSet();
Q_INVOKABLE QString getAccountConfig_ProxyServer();
Q_INVOKABLE bool getAccountConfig_ProxyEnabled();
......@@ -175,6 +176,7 @@ public:
Q_INVOKABLE void setAutoAnswerCalls(bool state);
Q_INVOKABLE void setEnableRingtone(bool state);
Q_INVOKABLE void setEnableProxy(bool state);
Q_INVOKABLE void setKeepAliveEnabled(bool state);
Q_INVOKABLE void setUseUPnP(bool state);
Q_INVOKABLE void setUseTURN(bool state);
Q_INVOKABLE void setUseSTUN(bool state);
......
......@@ -36,6 +36,7 @@ ColumnLayout {
property bool isSIP
function updateConnectivityAccountInfos() {
autoRegistrationAfterExpired.checked = SettingsAdapter.getAccountConfig_KeepAliveEnabled()
registrationExpireTimeoutSpinBox.setValue(SettingsAdapter.getAccountConfig_Registration_Expire())
networkInterfaceSpinBox.setValue(SettingsAdapter.getAccountConfig_Localport())
checkBoxUPnP.checked = SettingsAdapter.getAccountConfig_UpnpEnabled()
......@@ -64,6 +65,18 @@ ColumnLayout {
Layout.fillWidth: true
Layout.leftMargin: JamiTheme.preferredMarginSize
ToggleSwitch {
id: autoRegistrationAfterExpired
Layout.fillWidth: true
visible: isSIP
labelText: JamiStrings.autoRegistration
fontPointSize: JamiTheme.settingsFontSize
onSwitchToggled: SettingsAdapter.setKeepAliveEnabled(checked)
}
SettingSpinBox {
id: registrationExpireTimeoutSpinBox
visible: isSIP
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment