author | benmeyer <benmeyer> | 2002-10-31 19:50:26 (UTC) |
---|---|---|
committer | benmeyer <benmeyer> | 2002-10-31 19:50:26 (UTC) |
commit | 6a5a109fd55590ff176b29ac8533d36d9d204a63 (patch) (unidiff) | |
tree | 52aa9091b292d74efc2dbde48a70caa3bdca1eb0 | |
parent | 3c76157137de747176466df8c7ecb85105ab9d53 (diff) | |
download | opie-6a5a109fd55590ff176b29ac8533d36d9d204a63.zip opie-6a5a109fd55590ff176b29ac8533d36d9d204a63.tar.gz opie-6a5a109fd55590ff176b29ac8533d36d9d204a63.tar.bz2 |
Fixed DNS bug forgot to have a define
-rw-r--r-- | noncore/net/networksetup/interfaces/interfacesetupimp.cpp | 4 | ||||
-rw-r--r-- | noncore/settings/networksettings/interfaces/interfacesetupimp.cpp | 4 |
2 files changed, 4 insertions, 4 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 | |||
@@ -38,49 +38,49 @@ InterfaceSetupImp::InterfaceSetupImp(QWidget* parent, const char* name, Interfac | |||
38 | */ | 38 | */ |
39 | void InterfaceSetupImp::saveChanges(){ | 39 | void InterfaceSetupImp::saveChanges(){ |
40 | if(!saveSettings()) | 40 | if(!saveSettings()) |
41 | return; | 41 | return; |
42 | interfaces->write(); | 42 | interfaces->write(); |
43 | } | 43 | } |
44 | 44 | ||
45 | /** | 45 | /** |
46 | * Save the settings for the current Interface. | 46 | * Save the settings for the current Interface. |
47 | * @return bool true if successfull, false otherwise | 47 | * @return bool true if successfull, false otherwise |
48 | */ | 48 | */ |
49 | bool InterfaceSetupImp::saveSettings(){ | 49 | 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"); |
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 | if(!firstDNSLineEdit->text().isEmpty() || !secondDNSLineEdit->text().isEmpty()){ | 78 | if(!firstDNSLineEdit->text().isEmpty() || !secondDNSLineEdit->text().isEmpty()){ |
79 | QString dns = firstDNSLineEdit->text() + " " + secondDNSLineEdit->text(); | 79 | QString dns = firstDNSLineEdit->text() + " " + secondDNSLineEdit->text(); |
80 | interfaces->setInterfaceOption("up "DNSSCRIPT" -a ", dns); | 80 | interfaces->setInterfaceOption("up "DNSSCRIPT" -a ", dns); |
81 | interfaces->setInterfaceOption("down "DNSSCRIPT" -r ", dns); | 81 | interfaces->setInterfaceOption("down "DNSSCRIPT" -r ", dns); |
82 | } | 82 | } |
83 | } | 83 | } |
84 | 84 | ||
85 | // IP Information | 85 | // IP Information |
86 | interfaces->setAuto(interface->getInterfaceName(), autoStart->isChecked()); | 86 | interfaces->setAuto(interface->getInterfaceName(), autoStart->isChecked()); |
@@ -115,37 +115,37 @@ void InterfaceSetupImp::setProfile(const QString &profile){ | |||
115 | interfaces->addInterface(newInterfaceName, INTERFACES_FAMILY_INET, INTERFACES_METHOD_DHCP); | 115 | interfaces->addInterface(newInterfaceName, INTERFACES_FAMILY_INET, INTERFACES_METHOD_DHCP); |
116 | if(!interfaces->setInterface(newInterfaceName)){ | 116 | if(!interfaces->setInterface(newInterfaceName)){ |
117 | qDebug("InterfaceSetupImp: Added interface, but still can't set."); | 117 | qDebug("InterfaceSetupImp: Added interface, but still can't set."); |
118 | return; | 118 | return; |
119 | } | 119 | } |
120 | } | 120 | } |
121 | } | 121 | } |
122 | 122 | ||
123 | // We must have a valid interface to get this far so read some settings. | 123 | // We must have a valid interface to get this far so read some settings. |
124 | 124 | ||
125 | // DHCP | 125 | // DHCP |
126 | bool error = false; | 126 | bool error = false; |
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 | ||
diff --git a/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp b/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp index 6587d6f..550e909 100644 --- a/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp +++ b/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp | |||
@@ -38,49 +38,49 @@ InterfaceSetupImp::InterfaceSetupImp(QWidget* parent, const char* name, Interfac | |||
38 | */ | 38 | */ |
39 | void InterfaceSetupImp::saveChanges(){ | 39 | void InterfaceSetupImp::saveChanges(){ |
40 | if(!saveSettings()) | 40 | if(!saveSettings()) |
41 | return; | 41 | return; |
42 | interfaces->write(); | 42 | interfaces->write(); |
43 | } | 43 | } |
44 | 44 | ||
45 | /** | 45 | /** |
46 | * Save the settings for the current Interface. | 46 | * Save the settings for the current Interface. |
47 | * @return bool true if successfull, false otherwise | 47 | * @return bool true if successfull, false otherwise |
48 | */ | 48 | */ |
49 | bool InterfaceSetupImp::saveSettings(){ | 49 | 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"); |
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 | if(!firstDNSLineEdit->text().isEmpty() || !secondDNSLineEdit->text().isEmpty()){ | 78 | if(!firstDNSLineEdit->text().isEmpty() || !secondDNSLineEdit->text().isEmpty()){ |
79 | QString dns = firstDNSLineEdit->text() + " " + secondDNSLineEdit->text(); | 79 | QString dns = firstDNSLineEdit->text() + " " + secondDNSLineEdit->text(); |
80 | interfaces->setInterfaceOption("up "DNSSCRIPT" -a ", dns); | 80 | interfaces->setInterfaceOption("up "DNSSCRIPT" -a ", dns); |
81 | interfaces->setInterfaceOption("down "DNSSCRIPT" -r ", dns); | 81 | interfaces->setInterfaceOption("down "DNSSCRIPT" -r ", dns); |
82 | } | 82 | } |
83 | } | 83 | } |
84 | 84 | ||
85 | // IP Information | 85 | // IP Information |
86 | interfaces->setAuto(interface->getInterfaceName(), autoStart->isChecked()); | 86 | interfaces->setAuto(interface->getInterfaceName(), autoStart->isChecked()); |
@@ -115,37 +115,37 @@ void InterfaceSetupImp::setProfile(const QString &profile){ | |||
115 | interfaces->addInterface(newInterfaceName, INTERFACES_FAMILY_INET, INTERFACES_METHOD_DHCP); | 115 | interfaces->addInterface(newInterfaceName, INTERFACES_FAMILY_INET, INTERFACES_METHOD_DHCP); |
116 | if(!interfaces->setInterface(newInterfaceName)){ | 116 | if(!interfaces->setInterface(newInterfaceName)){ |
117 | qDebug("InterfaceSetupImp: Added interface, but still can't set."); | 117 | qDebug("InterfaceSetupImp: Added interface, but still can't set."); |
118 | return; | 118 | return; |
119 | } | 119 | } |
120 | } | 120 | } |
121 | } | 121 | } |
122 | 122 | ||
123 | // We must have a valid interface to get this far so read some settings. | 123 | // We must have a valid interface to get this far so read some settings. |
124 | 124 | ||
125 | // DHCP | 125 | // DHCP |
126 | bool error = false; | 126 | bool error = false; |
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 | ||