author | benmeyer <benmeyer> | 2002-12-16 21:48:37 (UTC) |
---|---|---|
committer | benmeyer <benmeyer> | 2002-12-16 21:48:37 (UTC) |
commit | 9cb9007f211c22349e3183ba20bb7f817d811005 (patch) (unidiff) | |
tree | 71d929282b4edfff101ef208d6ab4d1512b20960 /noncore/settings/networksettings/interfaces/interfacesetupimp.cpp | |
parent | 05ee76167ad314aea710966e7c93b124da252a95 (diff) | |
download | opie-9cb9007f211c22349e3183ba20bb7f817d811005.zip opie-9cb9007f211c22349e3183ba20bb7f817d811005.tar.gz opie-9cb9007f211c22349e3183ba20bb7f817d811005.tar.bz2 |
Remove the lease time requst. Wasn't realy needed and was uneccessary
Diffstat (limited to 'noncore/settings/networksettings/interfaces/interfacesetupimp.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings/interfaces/interfacesetupimp.cpp | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp b/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp index 4818e37..56bbe93 100644 --- a/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp +++ b/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp | |||
@@ -41,29 +41,26 @@ bool InterfaceSetupImp::saveSettings(){ | |||
41 | if(interfaces.getInterfaceMethod(error) == INTERFACES_LOOPBACK){ | 41 | if(interfaces.getInterfaceMethod(error) == INTERFACES_LOOPBACK){ |
42 | interfaces.setAuto(interface->getInterfaceName(), autoStart->isChecked()); | 42 | interfaces.setAuto(interface->getInterfaceName(), autoStart->isChecked()); |
43 | return true; | 43 | return true; |
44 | } | 44 | } |
45 | 45 | ||
46 | if(!dhcpCheckBox->isChecked() && (ipAddressEdit->text().isEmpty() || subnetMaskEdit->text().isEmpty())){ | 46 | if(!dhcpCheckBox->isChecked() && (ipAddressEdit->text().isEmpty() || subnetMaskEdit->text().isEmpty())){ |
47 | QMessageBox::information(this, "Not Saved.", "Please fill in the IP address and\n subnet entries.", QMessageBox::Ok); | 47 | QMessageBox::information(this, "Not Saved.", "Please fill in the IP address and\n subnet entries.", QMessageBox::Ok); |
48 | return false; | 48 | return false; |
49 | } | 49 | } |
50 | interfaces.removeAllInterfaceOptions(); | 50 | interfaces.removeAllInterfaceOptions(); |
51 | 51 | ||
52 | // DHCP | 52 | // DHCP |
53 | if(dhcpCheckBox->isChecked()){ | 53 | if(dhcpCheckBox->isChecked()) |
54 | interfaces.setInterfaceMethod(INTERFACES_METHOD_DHCP); | 54 | interfaces.setInterfaceMethod(INTERFACES_METHOD_DHCP); |
55 | interfaces.setInterfaceOption("leasehours", QString("%1").arg(leaseTime->value())); | ||
56 | interfaces.setInterfaceOption("leasetime", QString("%1").arg(leaseTime->value()*60*60)); | ||
57 | } | ||
58 | else{ | 55 | else{ |
59 | interfaces.setInterfaceMethod("static"); | 56 | interfaces.setInterfaceMethod("static"); |
60 | interfaces.setInterfaceOption("address", ipAddressEdit->text()); | 57 | interfaces.setInterfaceOption("address", ipAddressEdit->text()); |
61 | interfaces.setInterfaceOption("netmask", subnetMaskEdit->text()); | 58 | interfaces.setInterfaceOption("netmask", subnetMaskEdit->text()); |
62 | interfaces.setInterfaceOption("gateway", gatewayEdit->text()); | 59 | interfaces.setInterfaceOption("gateway", gatewayEdit->text()); |
63 | if(!firstDNSLineEdit->text().isEmpty() || !secondDNSLineEdit->text().isEmpty()){ | 60 | if(!firstDNSLineEdit->text().isEmpty() || !secondDNSLineEdit->text().isEmpty()){ |
64 | QString dns = firstDNSLineEdit->text() + " " + secondDNSLineEdit->text(); | 61 | QString dns = firstDNSLineEdit->text() + " " + secondDNSLineEdit->text(); |
65 | interfaces.setInterfaceOption("up "DNSSCRIPT" -a ", dns); | 62 | interfaces.setInterfaceOption("up "DNSSCRIPT" -a ", dns); |
66 | interfaces.setInterfaceOption("down "DNSSCRIPT" -r ", dns); | 63 | interfaces.setInterfaceOption("down "DNSSCRIPT" -r ", dns); |
67 | } | 64 | } |
68 | } | 65 | } |
69 | 66 | ||
@@ -113,33 +110,27 @@ void InterfaceSetupImp::setProfile(const QString &profile){ | |||
113 | } | 110 | } |
114 | } | 111 | } |
115 | } | 112 | } |
116 | 113 | ||
117 | // We must have a valid interface to get this far so read some settings. | 114 | // We must have a valid interface to get this far so read some settings. |
118 | 115 | ||
119 | // DHCP | 116 | // DHCP |
120 | bool error = false; | 117 | bool error = false; |
121 | if(interfaces.getInterfaceMethod(error) == INTERFACES_METHOD_DHCP) | 118 | if(interfaces.getInterfaceMethod(error) == INTERFACES_METHOD_DHCP) |
122 | dhcpCheckBox->setChecked(true); | 119 | dhcpCheckBox->setChecked(true); |
123 | else | 120 | else |
124 | dhcpCheckBox->setChecked(false); | 121 | dhcpCheckBox->setChecked(false); |
125 | leaseTime->setValue(interfaces.getInterfaceOption("leasehours", error).toInt()); | ||
126 | if(error) | ||
127 | leaseTime->setValue(interfaces.getInterfaceOption("leasetime", error).toInt()/60/60); | ||
128 | if(error) | ||
129 | leaseTime->setValue(24); | ||
130 | 122 | ||
131 | // IP Information | 123 | // IP Information |
132 | autoStart->setChecked(interfaces.isAuto(interface->getInterfaceName())); | 124 | autoStart->setChecked(interfaces.isAuto(interface->getInterfaceName())); |
133 | QString dns = interfaces.getInterfaceOption("up "DNSSCRIPT" -a", error); | 125 | QString dns = interfaces.getInterfaceOption("up "DNSSCRIPT" -a", error); |
134 | if(dns.contains(" ")){ | 126 | if(dns.contains(" ")){ |
135 | firstDNSLineEdit->setText(dns.mid(0, dns.find(" "))); | 127 | firstDNSLineEdit->setText(dns.mid(0, dns.find(" "))); |
136 | secondDNSLineEdit->setText(dns.mid(dns.find(" ")+1, dns.length())); | 128 | secondDNSLineEdit->setText(dns.mid(dns.find(" ")+1, dns.length())); |
137 | } | 129 | } |
138 | ipAddressEdit->setText(interfaces.getInterfaceOption("address", error)); | 130 | ipAddressEdit->setText(interfaces.getInterfaceOption("address", error)); |
139 | subnetMaskEdit->setText(interfaces.getInterfaceOption("netmask", error)); | 131 | subnetMaskEdit->setText(interfaces.getInterfaceOption("netmask", error)); |
140 | gatewayEdit->setText(interfaces.getInterfaceOption("gateway", error)); | 132 | gatewayEdit->setText(interfaces.getInterfaceOption("gateway", error)); |
141 | |||
142 | } | 133 | } |
143 | 134 | ||
144 | // interfacesetup.cpp | 135 | // interfacesetup.cpp |
145 | 136 | ||