Network settings

This commit is contained in:
Christophe Deschamps 2024-10-07 08:28:07 +02:00
parent 2b4960882f
commit dc28c4e5cf
7 changed files with 70 additions and 1 deletions

View file

@ -94,6 +94,7 @@ SettingsCore::SettingsCore(QObject *parent) : QObject(parent) {
INIT_CORE_MEMBER(AutoStart, mSettingsModel)
INIT_CORE_MEMBER(ExitOnClose, mSettingsModel)
INIT_CORE_MEMBER(SyncLdapContacts, mSettingsModel)
INIT_CORE_MEMBER(Ipv6Enabled, mSettingsModel)
}
SettingsCore::~SettingsCore() {
@ -331,6 +332,8 @@ void SettingsCore::setSelf(QSharedPointer<SettingsCore> me) {
ExitOnClose)
DEFINE_CORE_GETSET_CONNECT(mSettingsModelConnection, SettingsCore, SettingsModel, mSettingsModel, bool,
syncLdapContacts, SyncLdapContacts)
DEFINE_CORE_GETSET_CONNECT(mSettingsModelConnection, SettingsCore, SettingsModel, mSettingsModel, bool, ipv6Enabled,
Ipv6Enabled)
auto coreModelConnection = QSharedPointer<SafeConnection<SettingsCore, CoreModel>>(
new SafeConnection<SettingsCore, CoreModel>(me, CoreModel::getInstance()), &QObject::deleteLater);

View file

@ -163,6 +163,7 @@ public:
DECLARE_CORE_GETSET(bool, autoStart, AutoStart)
DECLARE_CORE_GETSET(bool, exitOnClose, ExitOnClose)
DECLARE_CORE_GETSET(bool, syncLdapContacts, SyncLdapContacts)
DECLARE_CORE_GETSET_MEMBER(bool, ipv6Enabled, Ipv6Enabled)
signals:

View file

@ -502,6 +502,19 @@ void SettingsModel::enableDnd(bool enableDnd) {
emit dndChanged(enableDnd);
}
bool SettingsModel::getIpv6Enabled() const {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
return CoreModel::getInstance()->getCore()->ipv6Enabled();
}
void SettingsModel::setIpv6Enabled(bool status) {
mustBeInLinphoneThread(log().arg(Q_FUNC_INFO));
if (getIpv6Enabled() != status) {
CoreModel::getInstance()->getCore()->enableIpv6(status);
emit ipv6EnabledChanged(status);
}
}
// =============================================================================
// Carddav storage list
// =============================================================================

View file

@ -149,6 +149,7 @@ public:
DECLARE_GETSET(bool, autoStart, AutoStart)
DECLARE_GETSET(bool, exitOnClose, ExitOnClose)
DECLARE_GETSET(bool, syncLdapContacts, SyncLdapContacts)
DECLARE_GETSET(bool, ipv6Enabled, Ipv6Enabled)
signals:

View file

@ -109,6 +109,7 @@ list(APPEND _LINPHONEAPP_QML_FILES
view/Page/Layout/Settings/LdapSettingsLayout.qml
view/Page/Layout/Settings/CarddavSettingsLayout.qml
view/Page/Layout/Settings/SecuritySettingsLayout.qml
view/Page/Layout/Settings/NetworkSettingsLayout.qml
view/Page/Main/AbstractMainPage.qml
view/Page/Main/Account/AccountListView.qml

View file

@ -15,7 +15,6 @@ AbstractSettingsLayout {
ColumnLayout {
Item {
Layout.preferredWidth: 341 * DefaultStyle.dp
}
}
ColumnLayout {

View file

@ -0,0 +1,51 @@
import QtQuick
import QtQuick.Layouts
import QtQuick.Controls.Basic as Control
import SettingsCpp 1.0
import Linphone
AbstractSettingsLayout {
contentComponent: content
Component {
id: content
ColumnLayout {
spacing: 5 * DefaultStyle.dp
RowLayout {
spacing: 5 * DefaultStyle.dp
ColumnLayout {
Layout.fillWidth: true
spacing: 5 * DefaultStyle.dp
ColumnLayout {
Layout.preferredWidth: 341 * DefaultStyle.dp
Layout.maximumWidth: 341 * DefaultStyle.dp
spacing: 5 * DefaultStyle.dp
Text {
text: qsTr("Réseau")
font: Typography.h4
wrapMode: Text.WordWrap
color: DefaultStyle.main2_600
Layout.fillWidth: true
}
}
Item {
Layout.fillHeight: true
}
}
ColumnLayout {
Layout.rightMargin: 25 * DefaultStyle.dp
Layout.topMargin: 36 * DefaultStyle.dp
Layout.leftMargin: 64 * DefaultStyle.dp
spacing: 40 * DefaultStyle.dp
SwitchSetting {
Layout.fillWidth: true
titleText: qsTr("Autoriser l'IPv6")
propertyName: "ipv6Enabled"
propertyOwner: SettingsCpp
}
}
}
}
}
}