2020-09-08 12:59:34 -04:00
|
|
|
/*
|
2023-02-06 01:47:15 -05:00
|
|
|
* Copyright (C) 2020-2023 Savoir-faire Linux Inc.
|
2020-09-08 12:59:34 -04:00
|
|
|
* Author: Aline Gondim Santos <aline.gondimsantos@savoirfairelinux.com>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2021-09-08 10:31:38 -04:00
|
|
|
import QtQuick
|
|
|
|
import QtQuick.Layouts
|
2021-03-17 14:23:21 -04:00
|
|
|
|
2021-08-23 13:24:08 -04:00
|
|
|
import net.jami.Models 1.1
|
|
|
|
import net.jami.Adapters 1.1
|
|
|
|
import net.jami.Constants 1.1
|
2020-10-06 13:58:44 +02:00
|
|
|
|
2020-09-08 12:59:34 -04:00
|
|
|
import "../../commoncomponents"
|
|
|
|
|
|
|
|
ColumnLayout {
|
|
|
|
id: root
|
|
|
|
|
|
|
|
property int itemWidth
|
|
|
|
property bool isSIP
|
|
|
|
|
|
|
|
ElidedTextLabel {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.preferredHeight: JamiTheme.preferredFieldHeight
|
|
|
|
|
2020-09-11 17:30:46 -04:00
|
|
|
eText: JamiStrings.connectivity
|
2020-09-08 12:59:34 -04:00
|
|
|
fontSize: JamiTheme.headerFontSize
|
|
|
|
maxWidth: width
|
|
|
|
}
|
|
|
|
|
|
|
|
ColumnLayout {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.leftMargin: JamiTheme.preferredMarginSize
|
|
|
|
|
2020-11-12 13:49:53 -05:00
|
|
|
ToggleSwitch {
|
|
|
|
id: autoRegistrationAfterExpired
|
|
|
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
|
|
|
visible: isSIP
|
|
|
|
labelText: JamiStrings.autoRegistration
|
|
|
|
fontPointSize: JamiTheme.settingsFontSize
|
|
|
|
|
2021-08-26 14:57:24 -04:00
|
|
|
checked: CurrentAccount.keepAliveEnabled
|
|
|
|
|
|
|
|
onSwitchToggled: CurrentAccount.keepAliveEnabled = checked
|
2020-11-12 13:49:53 -05:00
|
|
|
}
|
|
|
|
|
2020-09-08 12:59:34 -04:00
|
|
|
SettingSpinBox {
|
|
|
|
id: registrationExpireTimeoutSpinBox
|
2021-08-26 14:57:24 -04:00
|
|
|
|
2020-09-08 12:59:34 -04:00
|
|
|
visible: isSIP
|
|
|
|
|
2021-05-17 09:01:11 -04:00
|
|
|
title: JamiStrings.registrationExpirationTime
|
2020-09-08 12:59:34 -04:00
|
|
|
itemWidth: root.itemWidth
|
|
|
|
bottomValue: 0
|
2021-05-17 09:01:11 -04:00
|
|
|
topValue: 7*24*3600
|
2020-09-08 12:59:34 -04:00
|
|
|
|
2022-08-31 12:01:59 -04:00
|
|
|
valueField: CurrentAccount.registrationExpire
|
2021-08-26 14:57:24 -04:00
|
|
|
|
2022-08-31 12:01:59 -04:00
|
|
|
onNewValue: CurrentAccount.registrationExpire = valueField
|
2020-09-08 12:59:34 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
SettingSpinBox {
|
|
|
|
id: networkInterfaceSpinBox
|
2021-08-26 14:57:24 -04:00
|
|
|
|
2020-09-08 12:59:34 -04:00
|
|
|
visible: isSIP
|
|
|
|
|
2020-09-11 17:30:46 -04:00
|
|
|
title: JamiStrings.networkInterface
|
2020-09-08 12:59:34 -04:00
|
|
|
itemWidth: root.itemWidth
|
|
|
|
bottomValue: 0
|
2021-05-17 09:01:11 -04:00
|
|
|
topValue: 65535
|
2020-09-08 12:59:34 -04:00
|
|
|
|
2021-08-26 14:57:24 -04:00
|
|
|
valueField: CurrentAccount.localPort
|
|
|
|
|
|
|
|
onNewValue: CurrentAccount.localPort = valueField
|
2020-09-08 12:59:34 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
ToggleSwitch {
|
|
|
|
id: checkBoxUPnP
|
|
|
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
2020-09-11 17:30:46 -04:00
|
|
|
labelText: JamiStrings.useUPnP
|
2020-09-08 12:59:34 -04:00
|
|
|
fontPointSize: JamiTheme.settingsFontSize
|
|
|
|
|
2021-08-26 14:57:24 -04:00
|
|
|
checked: CurrentAccount.upnpEnabled
|
|
|
|
|
|
|
|
onSwitchToggled: CurrentAccount.upnpEnabled = checked
|
2020-09-08 12:59:34 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
ToggleSwitch {
|
|
|
|
id: checkBoxTurnEnable
|
|
|
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
2020-09-11 17:30:46 -04:00
|
|
|
labelText: JamiStrings.useTURN
|
2020-09-08 12:59:34 -04:00
|
|
|
fontPointSize: JamiTheme.settingsFontSize
|
|
|
|
|
2021-08-26 14:57:24 -04:00
|
|
|
checked: CurrentAccount.enable_TURN
|
|
|
|
|
|
|
|
onSwitchToggled: CurrentAccount.enable_TURN = checked
|
2020-09-08 12:59:34 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
SettingsMaterialLineEdit {
|
|
|
|
id: lineEditTurnAddress
|
|
|
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.preferredHeight: JamiTheme.preferredFieldHeight
|
2021-08-26 14:57:24 -04:00
|
|
|
|
|
|
|
enabled: checkBoxTurnEnable.checked
|
|
|
|
|
|
|
|
textField: CurrentAccount.server_TURN
|
|
|
|
|
2020-09-08 12:59:34 -04:00
|
|
|
itemWidth: root.itemWidth
|
2020-09-11 17:30:46 -04:00
|
|
|
titleField: JamiStrings.turnAdress
|
2021-08-26 14:57:24 -04:00
|
|
|
|
|
|
|
onEditFinished: CurrentAccount.server_TURN = textField
|
2020-09-08 12:59:34 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
SettingsMaterialLineEdit {
|
|
|
|
id: lineEditTurnUsername
|
|
|
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.preferredHeight: JamiTheme.preferredFieldHeight
|
2021-08-26 14:57:24 -04:00
|
|
|
|
|
|
|
enabled: checkBoxTurnEnable.checked
|
|
|
|
|
|
|
|
textField: CurrentAccount.username_TURN
|
|
|
|
|
2020-09-08 12:59:34 -04:00
|
|
|
itemWidth: root.itemWidth
|
2020-09-11 17:30:46 -04:00
|
|
|
titleField: JamiStrings.turnUsername
|
2021-08-26 14:57:24 -04:00
|
|
|
|
|
|
|
onEditFinished: CurrentAccount.username_TURN = textField
|
2020-09-08 12:59:34 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
SettingsMaterialLineEdit {
|
|
|
|
id: lineEditTurnPassword
|
|
|
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.preferredHeight: JamiTheme.preferredFieldHeight
|
2021-08-26 14:57:24 -04:00
|
|
|
|
|
|
|
enabled: checkBoxTurnEnable.checked
|
|
|
|
|
|
|
|
textField: CurrentAccount.password_TURN
|
|
|
|
|
2020-09-08 12:59:34 -04:00
|
|
|
itemWidth: root.itemWidth
|
2020-09-11 17:30:46 -04:00
|
|
|
titleField: JamiStrings.turnPassword
|
2021-08-26 14:57:24 -04:00
|
|
|
|
|
|
|
onEditFinished: CurrentAccount.password_TURN = textField
|
2020-09-08 12:59:34 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
SettingsMaterialLineEdit {
|
|
|
|
id: lineEditTurnRealmSIP
|
|
|
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.preferredHeight: JamiTheme.preferredFieldHeight
|
2021-08-26 14:57:24 -04:00
|
|
|
|
|
|
|
enabled: checkBoxTurnEnable.checked
|
|
|
|
|
|
|
|
textField: CurrentAccount.realm_TURN
|
|
|
|
|
2020-09-08 12:59:34 -04:00
|
|
|
itemWidth: root.itemWidth
|
2020-09-11 17:30:46 -04:00
|
|
|
titleField: JamiStrings.turnRealm
|
2021-08-26 14:57:24 -04:00
|
|
|
|
|
|
|
onEditFinished: CurrentAccount.realm_TURN = textField
|
2020-09-08 12:59:34 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
ToggleSwitch {
|
|
|
|
id: checkBoxSTUNEnable
|
|
|
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
2020-09-11 17:30:46 -04:00
|
|
|
labelText: JamiStrings.useSTUN
|
2020-09-08 12:59:34 -04:00
|
|
|
fontPointSize: JamiTheme.settingsFontSize
|
|
|
|
|
2021-10-21 10:23:39 -04:00
|
|
|
visible: isSIP
|
2021-08-26 14:57:24 -04:00
|
|
|
checked: CurrentAccount.enable_STUN
|
|
|
|
|
|
|
|
onSwitchToggled: CurrentAccount.enable_STUN = checked
|
2020-09-08 12:59:34 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
SettingsMaterialLineEdit {
|
|
|
|
id: lineEditSTUNAddress
|
|
|
|
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.preferredHeight: JamiTheme.preferredFieldHeight
|
2021-08-26 14:57:24 -04:00
|
|
|
|
|
|
|
enabled: checkBoxSTUNEnable.checked
|
2021-10-21 10:23:39 -04:00
|
|
|
visible: isSIP
|
2021-08-26 14:57:24 -04:00
|
|
|
|
|
|
|
textField: CurrentAccount.server_STUN
|
|
|
|
|
2020-09-08 12:59:34 -04:00
|
|
|
itemWidth: root.itemWidth
|
2020-09-11 17:30:46 -04:00
|
|
|
titleField: JamiStrings.stunAdress
|
2021-08-26 14:57:24 -04:00
|
|
|
|
|
|
|
onEditFinished: CurrentAccount.server_STUN = textField
|
2020-09-08 12:59:34 -04:00
|
|
|
}
|
|
|
|
}
|
2020-10-06 13:58:44 +02:00
|
|
|
}
|