Diffstat (limited to 'noncore/net/networksetup/interfaces/interfacesetupimp.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/networksetup/interfaces/interfacesetupimp.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/noncore/net/networksetup/interfaces/interfacesetupimp.cpp b/noncore/net/networksetup/interfaces/interfacesetupimp.cpp index 6587d6f..550e909 100644 --- a/noncore/net/networksetup/interfaces/interfacesetupimp.cpp +++ b/noncore/net/networksetup/interfaces/interfacesetupimp.cpp | |||
@@ -50,25 +50,25 @@ bool InterfaceSetupImp::saveSettings(){ | |||
50 | // eh can't really do anything about it other then return. :-D | 50 | // eh can't really do anything about it other then return. :-D |
51 | if(!interfaces->isInterfaceSet()) | 51 | if(!interfaces->isInterfaceSet()) |
52 | return true; | 52 | return true; |
53 | 53 | ||
54 | bool error = false; | 54 | bool error = false; |
55 | // Loopback case | 55 | // Loopback case |
56 | if(interfaces->getInterfaceMethod(error) == INTERFACES_LOOPBACK){ | 56 | if(interfaces->getInterfaceMethod(error) == INTERFACES_LOOPBACK){ |
57 | interfaces->setAuto(interface->getInterfaceName(), autoStart->isChecked()); | 57 | interfaces->setAuto(interface->getInterfaceName(), autoStart->isChecked()); |
58 | return true; | 58 | return true; |
59 | } | 59 | } |
60 | 60 | ||
61 | if(!dhcpCheckBox->isChecked() && (ipAddressEdit->text().isEmpty() || subnetMaskEdit->text().isEmpty())){ | 61 | if(!dhcpCheckBox->isChecked() && (ipAddressEdit->text().isEmpty() || subnetMaskEdit->text().isEmpty())){ |
62 | QMessageBox::information(this, "Empy Fields.", "Please fill in address, subnet,\n and gateway entries.", "Ok"); | 62 | QMessageBox::information(this, "Not Saved.", "Please fill in address, subnet,\n and gateway entries.", "Ok"); |
63 | return false; | 63 | return false; |
64 | } | 64 | } |
65 | interfaces->removeAllInterfaceOptions(); | 65 | interfaces->removeAllInterfaceOptions(); |
66 | 66 | ||
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"); |
@@ -127,25 +127,25 @@ void InterfaceSetupImp::setProfile(const QString &profile){ | |||
127 | if(interfaces->getInterfaceMethod(error) == INTERFACES_METHOD_DHCP) | 127 | if(interfaces->getInterfaceMethod(error) == INTERFACES_METHOD_DHCP) |
128 | dhcpCheckBox->setChecked(true); | 128 | dhcpCheckBox->setChecked(true); |
129 | else | 129 | else |
130 | dhcpCheckBox->setChecked(false); | 130 | dhcpCheckBox->setChecked(false); |
131 | leaseTime->setValue(interfaces->getInterfaceOption("leasehours", error).toInt()); | 131 | leaseTime->setValue(interfaces->getInterfaceOption("leasehours", error).toInt()); |
132 | if(error) | 132 | if(error) |
133 | leaseTime->setValue(interfaces->getInterfaceOption("leasetime", error).toInt()/60/60); | 133 | leaseTime->setValue(interfaces->getInterfaceOption("leasetime", error).toInt()/60/60); |
134 | if(error) | 134 | if(error) |
135 | leaseTime->setValue(24); | 135 | leaseTime->setValue(24); |
136 | 136 | ||
137 | // IP Information | 137 | // IP Information |
138 | autoStart->setChecked(interfaces->isAuto(interface->getInterfaceName())); | 138 | autoStart->setChecked(interfaces->isAuto(interface->getInterfaceName())); |
139 | QString dns = interfaces->getInterfaceOption("up interfacednsscript -a", error); | 139 | QString dns = interfaces->getInterfaceOption("up "DNSSCRIPT" -a", error); |
140 | if(dns.contains(" ")){ | 140 | if(dns.contains(" ")){ |
141 | firstDNSLineEdit->setText(dns.mid(0, dns.find(" "))); | 141 | firstDNSLineEdit->setText(dns.mid(0, dns.find(" "))); |
142 | secondDNSLineEdit->setText(dns.mid(dns.find(" ")+1, dns.length())); | 142 | secondDNSLineEdit->setText(dns.mid(dns.find(" ")+1, dns.length())); |
143 | } | 143 | } |
144 | ipAddressEdit->setText(interfaces->getInterfaceOption("address", error)); | 144 | ipAddressEdit->setText(interfaces->getInterfaceOption("address", error)); |
145 | subnetMaskEdit->setText(interfaces->getInterfaceOption("netmask", error)); | 145 | subnetMaskEdit->setText(interfaces->getInterfaceOption("netmask", error)); |
146 | gatewayEdit->setText(interfaces->getInterfaceOption("gateway", error)); | 146 | gatewayEdit->setText(interfaces->getInterfaceOption("gateway", error)); |
147 | } | 147 | } |
148 | 148 | ||
149 | 149 | ||
150 | // interfacesetup.cpp | 150 | // interfacesetup.cpp |
151 | 151 | ||