1
0
Fork 0
mirror of https://git.jami.net/savoirfairelinux/jami-client-qt.git synced 2025-09-10 03:53:23 +02:00

settings: add auto registration after expired option

Change-Id: Ib29e29f2d61d5684154c0714b5b3d656f99ddcf5
This commit is contained in:
Ming Rui Zhang 2020-11-12 13:49:53 -05:00
parent 1ab09e4af9
commit e4af2bef7e
4 changed files with 30 additions and 0 deletions

View file

@ -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")

View file

@ -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)
{

View file

@ -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);

View file

@ -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