-rw-r--r-- | noncore/settings/networksettings/interfaces/interfacesetupimp.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp b/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp index 8de30de..f19cbdd 100644 --- a/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp +++ b/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp | |||
@@ -138,62 +138,63 @@ void InterfaceSetupImp::setProfile(const QString &profile){ | |||
138 | leaseTime->hide(); | 138 | leaseTime->hide(); |
139 | leaseHoursLabel->hide(); | 139 | leaseHoursLabel->hide(); |
140 | } | 140 | } |
141 | */ | 141 | */ |
142 | 142 | ||
143 | QString newInterfaceName = interface->getInterfaceName(); | 143 | QString newInterfaceName = interface->getInterfaceName(); |
144 | if(profile.length() > 0) | 144 | if(profile.length() > 0) |
145 | newInterfaceName += "_" + profile; | 145 | newInterfaceName += "_" + profile; |
146 | // See if we have to make a interface. | 146 | // See if we have to make a interface. |
147 | if(!interfaces->setInterface(newInterfaceName)){ | 147 | if(!interfaces->setInterface(newInterfaceName)){ |
148 | // Add making for this new interface if need too | 148 | // Add making for this new interface if need too |
149 | if(profile != ""){ | 149 | if(profile != ""){ |
150 | interfaces->copyInterface(interface->getInterfaceName(), newInterfaceName); | 150 | interfaces->copyInterface(interface->getInterfaceName(), newInterfaceName); |
151 | if(!interfaces->setMapping(interface->getInterfaceName())){ | 151 | if(!interfaces->setMapping(interface->getInterfaceName())){ |
152 | interfaces->addMapping(interface->getInterfaceName()); | 152 | interfaces->addMapping(interface->getInterfaceName()); |
153 | if(!interfaces->setMapping(interface->getInterfaceName())){ | 153 | if(!interfaces->setMapping(interface->getInterfaceName())){ |
154 | qDebug("InterfaceSetupImp: Added Mapping, but still can't setInterface."); | 154 | qDebug("InterfaceSetupImp: Added Mapping, but still can't setInterface."); |
155 | return; | 155 | return; |
156 | } | 156 | } |
157 | } | 157 | } |
158 | interfaces->setMap("map", newInterfaceName); | 158 | interfaces->setMap("map", newInterfaceName); |
159 | interfaces->setScript("getprofile.sh"); | 159 | interfaces->setScript("getprofile.sh"); |
160 | } | 160 | } |
161 | else{ | 161 | else{ |
162 | interfaces->addInterface(newInterfaceName, INTERFACES_FAMILY_INET, INTERFACES_METHOD_DHCP); | 162 | interfaces->addInterface(newInterfaceName, INTERFACES_FAMILY_INET, INTERFACES_METHOD_DHCP); |
163 | if(!interfaces->setInterface(newInterfaceName)){ | 163 | if(!interfaces->setInterface(newInterfaceName)){ |
164 | qDebug("InterfaceSetupImp: Added interface, but still can't setInterface."); | 164 | qDebug("InterfaceSetupImp: Added interface, but still can't setInterface."); |
165 | return; | 165 | return; |
166 | } | 166 | } |
167 | } | 167 | } |
168 | } | 168 | } |
169 | 169 | ||
170 | // We must have a valid interface to get this far so read some settings. | 170 | // We must have a valid interface to get this far so read some settings. |
171 | 171 | ||
172 | // DHCP | 172 | // DHCP |
173 | bool error = false; | 173 | bool error = false; |
174 | if(interfaces->getInterfaceMethod(error) == INTERFACES_METHOD_DHCP) | 174 | if(interfaces->getInterfaceMethod(error) == INTERFACES_METHOD_DHCP) |
175 | dhcpCheckBox->setChecked(true); | 175 | dhcpCheckBox->setChecked(true); |
176 | else | 176 | else |
177 | dhcpCheckBox->setChecked(false); | 177 | dhcpCheckBox->setChecked(false); |
178 | 178 | ||
179 | // IP Information | 179 | // IP Information |
180 | autoStart->setChecked(interfaces->isAuto(interface->getInterfaceName())); | 180 | autoStart->setChecked(interfaces->isAuto(interface->getInterfaceName())); |
181 | QString dns = interfaces->getInterfaceOption("up "DNSSCRIPT" -a", error); | 181 | QString dns = interfaces->getInterfaceOption("up "DNSSCRIPT" -a", error); |
182 | qDebug("dns >%s<",dns.latin1()); | 182 | qDebug("dns >%s<",dns.latin1()); |
183 | if(dns.contains(" ")){ | 183 | if(dns.contains(" ")){ |
184 | firstDNSLineEdit->setText(dns.mid(0, dns.find(" "))); | 184 | firstDNSLineEdit->setText(dns.mid(0, dns.find(" "))); |
185 | secondDNSLineEdit->setText(dns.mid(dns.find(" ")+1, dns.length())); | 185 | secondDNSLineEdit->setText(dns.mid(dns.find(" ")+1, dns.length())); |
186 | } | 186 | }else firstDNSLineEdit->setText(dns); |
187 | |||
187 | ipAddressEdit->setText(interfaces->getInterfaceOption("address", error)); | 188 | ipAddressEdit->setText(interfaces->getInterfaceOption("address", error)); |
188 | subnetMaskEdit->setText(interfaces->getInterfaceOption("netmask", error)); | 189 | subnetMaskEdit->setText(interfaces->getInterfaceOption("netmask", error)); |
189 | gatewayEdit->setText(interfaces->getInterfaceOption("gateway", error)); | 190 | gatewayEdit->setText(interfaces->getInterfaceOption("gateway", error)); |
190 | 191 | ||
191 | 192 | ||
192 | 193 | ||
193 | qWarning("InterfaceSetupImp::setProfile(%s)\n", profile.latin1()); | 194 | qWarning("InterfaceSetupImp::setProfile(%s)\n", profile.latin1()); |
194 | qWarning("InterfaceSetupImp::setProfile: iface is %s\n", interfaces->getInterfaceName(error).latin1()); | 195 | qWarning("InterfaceSetupImp::setProfile: iface is %s\n", interfaces->getInterfaceName(error).latin1()); |
195 | 196 | ||
196 | } | 197 | } |
197 | 198 | ||
198 | // interfacesetup.cpp | 199 | // interfacesetup.cpp |
199 | 200 | ||