summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Grulich <jgrulich@redhat.com>2017-04-10 06:11:03 (GMT)
committerJan Grulich <jgrulich@redhat.com>2017-04-10 06:11:13 (GMT)
commit47599d8b03e5e7b4978e19acb90da38a01d41aff (patch)
tree1d0035595debb969544647cb1e5f76ae6e437dc2
parentb8d488526cc99107cf3714240deb98b0ceada0a8 (diff)
Set auto-negotiate to true for newly created wired connections
NM switched to opposite value, but using that requires to set speed and duplex type, which is something users don't know and mostly they won't know what to set BUG:378554
-rw-r--r--editor/connectioneditor.cpp9
-rwxr-xr-xkcm/kcm.cpp10
2 files changed, 18 insertions, 1 deletions
diff --git a/editor/connectioneditor.cpp b/editor/connectioneditor.cpp
index e8d31a8..1241b4e 100644
--- a/editor/connectioneditor.cpp
+++ b/editor/connectioneditor.cpp
@@ -317,6 +317,15 @@ void ConnectionEditor::addConnection(QAction* action)
if (type == NetworkManager::ConnectionSettings::Wired || type == NetworkManager::ConnectionSettings::Wireless) {
bool shared = action->property("shared").toBool();
+
+ // Set auto-negotiate to true, NM sets it to false by default, but we used to have this before and also
+ // I don't think it's wise to request users to specify speed and duplex as most of them don't know what is that
+ // and what to set
+ if (type == NetworkManager::ConnectionSettings::Wired) {
+ NetworkManager::WiredSetting::Ptr wiredSetting = connectionSettings->setting(NetworkManager::Setting::Wired).dynamicCast<NetworkManager::WiredSetting>();
+ wiredSetting->setAutoNegotiate(true);
+ }
+
if (shared) {
if (type == NetworkManager::ConnectionSettings::Wireless) {
NetworkManager::WirelessSetting::Ptr wifiSetting = connectionSettings->setting(NetworkManager::Setting::Wireless).dynamicCast<NetworkManager::WirelessSetting>();
diff --git a/kcm/kcm.cpp b/kcm/kcm.cpp
index 4e052c8..a46469b 100755
--- a/kcm/kcm.cpp
+++ b/kcm/kcm.cpp
@@ -41,6 +41,7 @@
#include <NetworkManagerQt/Settings>
#include <NetworkManagerQt/Utils>
#include <NetworkManagerQt/VpnSetting>
+#include <NetworkManagerQt/WiredSetting>
#include <NetworkManagerQt/WirelessSetting>
#include <NetworkManagerQt/WirelessDevice>
@@ -287,6 +288,14 @@ void KCMNetworkmanagement::onRequestCreateConnection(int connectionType, const Q
}
if (type == NetworkManager::ConnectionSettings::Wired || type == NetworkManager::ConnectionSettings::Wireless) {
+ // Set auto-negotiate to true, NM sets it to false by default, but we used to have this before and also
+ // I don't think it's wise to request users to specify speed and duplex as most of them don't know what is that
+ // and what to set
+ if (type == NetworkManager::ConnectionSettings::Wired) {
+ NetworkManager::WiredSetting::Ptr wiredSetting = connectionSettings->setting(NetworkManager::Setting::Wired).dynamicCast<NetworkManager::WiredSetting>();
+ wiredSetting->setAutoNegotiate(true);
+ }
+
if (shared) {
if (type == NetworkManager::ConnectionSettings::Wireless) {
NetworkManager::WirelessSetting::Ptr wifiSetting = connectionSettings->setting(NetworkManager::Setting::Wireless).dynamicCast<NetworkManager::WirelessSetting>();
@@ -312,7 +321,6 @@ void KCMNetworkmanagement::onRequestCreateConnection(int connectionType, const Q
}
}
// Generate new UUID
-
connectionSettings->setUuid(NetworkManager::ConnectionSettings::createNewUuid());
addConnection(connectionSettings);
}