Diffstat (limited to 'noncore/settings/networksettings/interfaces/interfacesetupimp.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/networksettings/interfaces/interfacesetupimp.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp b/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp index e717d6f..97c05cc 100644 --- a/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp +++ b/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp | |||
@@ -5,25 +5,25 @@ | |||
5 | #include <qdialog.h> | 5 | #include <qdialog.h> |
6 | #include <qcombobox.h> | 6 | #include <qcombobox.h> |
7 | #include <qcheckbox.h> | 7 | #include <qcheckbox.h> |
8 | #include <qlineedit.h> | 8 | #include <qlineedit.h> |
9 | #include <qspinbox.h> | 9 | #include <qspinbox.h> |
10 | #include <qgroupbox.h> | 10 | #include <qgroupbox.h> |
11 | #include <qlabel.h> | 11 | #include <qlabel.h> |
12 | 12 | ||
13 | #include <qmessagebox.h> | 13 | #include <qmessagebox.h> |
14 | 14 | ||
15 | #include <assert.h> | 15 | #include <assert.h> |
16 | 16 | ||
17 | #define DNSSCRIPT "interfacednsscript" | 17 | #define DNSSCRIPT "changedns" |
18 | 18 | ||
19 | /** | 19 | /** |
20 | * Constuctor. Set up the connection and load the first profile. | 20 | * Constuctor. Set up the connection and load the first profile. |
21 | */ | 21 | */ |
22 | InterfaceSetupImp::InterfaceSetupImp(QWidget* parent, const char* name, Interface *i, WFlags fl) : InterfaceSetup(parent, name, fl){ | 22 | InterfaceSetupImp::InterfaceSetupImp(QWidget* parent, const char* name, Interface *i, WFlags fl) : InterfaceSetup(parent, name, fl){ |
23 | assert(parent); | 23 | assert(parent); |
24 | assert(i); | 24 | assert(i); |
25 | interface = i; | 25 | interface = i; |
26 | interfaces = new Interfaces(); | 26 | interfaces = new Interfaces(); |
27 | bool error = false; | 27 | bool error = false; |
28 | if(interfaces->getInterfaceMethod(error) == INTERFACES_LOOPBACK){ | 28 | if(interfaces->getInterfaceMethod(error) == INTERFACES_LOOPBACK){ |
29 | staticGroupBox->hide(); | 29 | staticGroupBox->hide(); |
@@ -67,26 +67,26 @@ bool InterfaceSetupImp::saveSettings(){ | |||
67 | // DHCP | 67 | // DHCP |
68 | if(dhcpCheckBox->isChecked()){ | 68 | if(dhcpCheckBox->isChecked()){ |
69 | interfaces->setInterfaceMethod(INTERFACES_METHOD_DHCP); | 69 | interfaces->setInterfaceMethod(INTERFACES_METHOD_DHCP); |
70 | interfaces->setInterfaceOption("leasehours", QString("%1").arg(leaseTime->value())); | 70 | interfaces->setInterfaceOption("leasehours", QString("%1").arg(leaseTime->value())); |
71 | interfaces->setInterfaceOption("leasetime", QString("%1").arg(leaseTime->value()*60*60)); | 71 | interfaces->setInterfaceOption("leasetime", QString("%1").arg(leaseTime->value()*60*60)); |
72 | } | 72 | } |
73 | else{ | 73 | else{ |
74 | interfaces->setInterfaceMethod("static"); | 74 | interfaces->setInterfaceMethod("static"); |
75 | interfaces->setInterfaceOption("address", ipAddressEdit->text()); | 75 | interfaces->setInterfaceOption("address", ipAddressEdit->text()); |
76 | interfaces->setInterfaceOption("netmask", subnetMaskEdit->text()); | 76 | interfaces->setInterfaceOption("netmask", subnetMaskEdit->text()); |
77 | interfaces->setInterfaceOption("gateway", gatewayEdit->text()); | 77 | interfaces->setInterfaceOption("gateway", gatewayEdit->text()); |
78 | QString dns = firstDNSLineEdit->text() + " " + secondDNSLineEdit->text(); | 78 | QString dns = firstDNSLineEdit->text() + " " + secondDNSLineEdit->text(); |
79 | interfaces->setInterfaceOption("up "DNSSCRIPT" add ", dns); | 79 | interfaces->setInterfaceOption("up "DNSSCRIPT" -a ", dns); |
80 | interfaces->setInterfaceOption("down "DNSSCRIPT" remove ", dns); | 80 | interfaces->setInterfaceOption("down "DNSSCRIPT" -r ", dns); |
81 | } | 81 | } |
82 | 82 | ||
83 | // IP Information | 83 | // IP Information |
84 | interfaces->setAuto(interface->getInterfaceName(), autoStart->isChecked()); | 84 | interfaces->setAuto(interface->getInterfaceName(), autoStart->isChecked()); |
85 | return true; | 85 | return true; |
86 | } | 86 | } |
87 | 87 | ||
88 | /** | 88 | /** |
89 | * The Profile has changed. | 89 | * The Profile has changed. |
90 | * @profile the new profile. | 90 | * @profile the new profile. |
91 | */ | 91 | */ |
92 | void InterfaceSetupImp::setProfile(const QString &profile){ | 92 | void InterfaceSetupImp::setProfile(const QString &profile){ |
@@ -124,25 +124,25 @@ void InterfaceSetupImp::setProfile(const QString &profile){ | |||
124 | if(interfaces->getInterfaceMethod(error) == INTERFACES_METHOD_DHCP) | 124 | if(interfaces->getInterfaceMethod(error) == INTERFACES_METHOD_DHCP) |
125 | dhcpCheckBox->setChecked(true); | 125 | dhcpCheckBox->setChecked(true); |
126 | else | 126 | else |
127 | dhcpCheckBox->setChecked(false); | 127 | dhcpCheckBox->setChecked(false); |
128 | leaseTime->setValue(interfaces->getInterfaceOption("leasehours", error).toInt()); | 128 | leaseTime->setValue(interfaces->getInterfaceOption("leasehours", error).toInt()); |
129 | if(error) | 129 | if(error) |
130 | leaseTime->setValue(interfaces->getInterfaceOption("leasetime", error).toInt()/60/60); | 130 | leaseTime->setValue(interfaces->getInterfaceOption("leasetime", error).toInt()/60/60); |
131 | if(error) | 131 | if(error) |
132 | leaseTime->setValue(24); | 132 | leaseTime->setValue(24); |
133 | 133 | ||
134 | // IP Information | 134 | // IP Information |
135 | autoStart->setChecked(interfaces->isAuto(interface->getInterfaceName())); | 135 | autoStart->setChecked(interfaces->isAuto(interface->getInterfaceName())); |
136 | QString dns = interfaces->getInterfaceOption("up interfacednsscript add", error); | 136 | QString dns = interfaces->getInterfaceOption("up interfacednsscript -a", error); |
137 | if(dns.contains(" ")){ | 137 | if(dns.contains(" ")){ |
138 | firstDNSLineEdit->setText(dns.mid(0, dns.find(" "))); | 138 | firstDNSLineEdit->setText(dns.mid(0, dns.find(" "))); |
139 | secondDNSLineEdit->setText(dns.mid(dns.find(" ")+1, dns.length())); | 139 | secondDNSLineEdit->setText(dns.mid(dns.find(" ")+1, dns.length())); |
140 | } | 140 | } |
141 | ipAddressEdit->setText(interfaces->getInterfaceOption("address", error)); | 141 | ipAddressEdit->setText(interfaces->getInterfaceOption("address", error)); |
142 | subnetMaskEdit->setText(interfaces->getInterfaceOption("netmask", error)); | 142 | subnetMaskEdit->setText(interfaces->getInterfaceOption("netmask", error)); |
143 | gatewayEdit->setText(interfaces->getInterfaceOption("gateway", error)); | 143 | gatewayEdit->setText(interfaces->getInterfaceOption("gateway", error)); |
144 | } | 144 | } |
145 | 145 | ||
146 | 146 | ||
147 | // interfacesetup.cpp | 147 | // interfacesetup.cpp |
148 | 148 | ||