Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 4b549b2d authored by Jan Grulich's avatar Jan Grulich

Add metered property to general configuration

BUG: 401020
FIXED-IN: 5.15.0
parent 99af6a8a
......@@ -58,14 +58,6 @@ ConnectionWidget::ConnectionWidget(const NetworkManager::ConnectionSettings::Ptr
connect(m_widget->autoconnectVpn, &QCheckBox::toggled, this, &ConnectionWidget::autoVpnToggled);
if (NetworkManager::compareVersion(QLatin1String("1.0.0")) >= 0) {
m_widget->prioritySpin->setEnabled(true);
m_widget->nmVersionWarning->setVisible(false);
} else {
m_widget->prioritySpin->setEnabled(false);
m_widget->nmVersionWarning->setVisible(true);
}
if (settings) {
loadConfig(settings);
}
......@@ -83,6 +75,7 @@ ConnectionWidget::ConnectionWidget(const NetworkManager::ConnectionSettings::Ptr
connect(m_widget->vpnCombobox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &ConnectionWidget::settingChanged);
connect(m_widget->vpnCombobox, &QComboBox::currentTextChanged, this, &ConnectionWidget::settingChanged);
connect(m_widget->prioritySpin, QOverload<int>::of(&QSpinBox::valueChanged), this, &ConnectionWidget::settingChanged);
connect(m_widget->metered, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &ConnectionWidget::settingChanged);
connect(m_widget->pushButtonPermissions, &QPushButton::clicked, this, &ConnectionWidget::openAdvancedPermissions);
}
......@@ -119,11 +112,11 @@ void ConnectionWidget::loadConfig(const NetworkManager::ConnectionSettings::Ptr
m_widget->autoconnect->setChecked(settings->autoconnect());
#if NM_CHECK_VERSION(1, 0, 0)
if (m_widget->prioritySpin->isEnabled()) {
m_widget->prioritySpin->setValue(settings->autoconnectPriority());
}
#endif
m_widget->metered->setCurrentIndex(settings->metered());
}
NMVariantMapMap ConnectionWidget::setting() const
......@@ -154,11 +147,11 @@ NMVariantMapMap ConnectionWidget::setting() const
settings.setZone(zone);
}
#if NM_CHECK_VERSION(1, 0, 0)
if (m_widget->prioritySpin->isEnabled()) {
settings.setAutoconnectPriority(m_widget->prioritySpin->value());
}
#endif
settings.setMetered(static_cast<NetworkManager::ConnectionSettings::Metered>(m_widget->metered->currentIndex()));
return settings.toMap();
}
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment