Diffstat (limited to 'noncore/settings/networksettings/interfaces') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings/interfaces/interfacesetupimp.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp b/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp index 8498759..62b1b7a 100644 --- a/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp +++ b/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp | |||
@@ -22,13 +22,13 @@ | |||
22 | 22 | ||
23 | /** | 23 | /** |
24 | * Constuctor. Set up the connection. A profile must be set. | 24 | * Constuctor. Set up the connection. A profile must be set. |
25 | */ | 25 | */ |
26 | using namespace Opie::Ui; | 26 | using namespace Opie::Ui; |
27 | using namespace Opie::Core; | 27 | using namespace Opie::Core; |
28 | InterfaceSetupImp::InterfaceSetupImp(QWidget* parent, const char* name, Interface *i, Interfaces *j, WFlags fl) : InterfaceSetup(parent, name, fl), interface(i), interfaces(j), delInterfaces(false){ | 28 | InterfaceSetupImp::InterfaceSetupImp(QWidget* parent, const char* name, Interface *i, Interfaces *j, WFlags fl) : InterfaceSetup(parent, name, fl), interfaces(j), interface(i), delInterfaces(false){ |
29 | if (j == 0) { | 29 | if (j == 0) { |
30 | delInterfaces = true; | 30 | delInterfaces = true; |
31 | interfaces = new Interfaces; | 31 | interfaces = new Interfaces; |
32 | } | 32 | } |
33 | } | 33 | } |
34 | 34 | ||
@@ -44,13 +44,13 @@ InterfaceSetupImp::~InterfaceSetupImp(){ | |||
44 | /** | 44 | /** |
45 | * Save the current settings, then write out the interfaces file and close. | 45 | * Save the current settings, then write out the interfaces file and close. |
46 | */ | 46 | */ |
47 | bool InterfaceSetupImp::saveChanges(){ | 47 | bool InterfaceSetupImp::saveChanges(){ |
48 | bool error; | 48 | bool error; |
49 | QString iface = interfaces->getInterfaceName(error); | 49 | QString iface = interfaces->getInterfaceName(error); |
50 | odebug << "InterfaceSetupImp::saveChanges saves interface " << iface.latin1() << "" << oendl; | 50 | odebug << "InterfaceSetupImp::saveChanges saves interface " << iface.latin1() << "" << oendl; |
51 | if(!saveSettings()) | 51 | if(!saveSettings()) |
52 | return false; | 52 | return false; |
53 | 53 | ||
54 | interfaces->write(); | 54 | interfaces->write(); |
55 | 55 | ||
56 | if (interface->getStatus()) { | 56 | if (interface->getStatus()) { |
@@ -70,13 +70,13 @@ bool InterfaceSetupImp::saveChanges(){ | |||
70 | Global::statusMessage( tr( "Restarting interface" ) ); | 70 | Global::statusMessage( tr( "Restarting interface" ) ); |
71 | 71 | ||
72 | owait->show(); | 72 | owait->show(); |
73 | qApp->processEvents(); | 73 | qApp->processEvents(); |
74 | 74 | ||
75 | if (!restart.start(OProcess::Block, OProcess::NoCommunication) ) { | 75 | if (!restart.start(OProcess::Block, OProcess::NoCommunication) ) { |
76 | owarn << "unstable to spawn ifdown/ifup" << oendl; | 76 | owarn << "unstable to spawn ifdown/ifup" << oendl; |
77 | } | 77 | } |
78 | 78 | ||
79 | owait->hide(); | 79 | owait->hide(); |
80 | delete owait; | 80 | delete owait; |
81 | 81 | ||
82 | interface->refresh(); | 82 | interface->refresh(); |
@@ -155,23 +155,23 @@ void InterfaceSetupImp::setProfile(const QString &profile){ | |||
155 | // Add making for this new interface if need too | 155 | // Add making for this new interface if need too |
156 | if(profile != ""){ | 156 | if(profile != ""){ |
157 | interfaces->copyInterface(interface->getInterfaceName(), newInterfaceName); | 157 | interfaces->copyInterface(interface->getInterfaceName(), newInterfaceName); |
158 | if(!interfaces->setMapping(interface->getInterfaceName())){ | 158 | if(!interfaces->setMapping(interface->getInterfaceName())){ |
159 | interfaces->addMapping(interface->getInterfaceName()); | 159 | interfaces->addMapping(interface->getInterfaceName()); |
160 | if(!interfaces->setMapping(interface->getInterfaceName())){ | 160 | if(!interfaces->setMapping(interface->getInterfaceName())){ |
161 | odebug << "InterfaceSetupImp: Added Mapping, but still can't setInterface." << oendl; | 161 | odebug << "InterfaceSetupImp: Added Mapping, but still can't setInterface." << oendl; |
162 | return; | 162 | return; |
163 | } | 163 | } |
164 | } | 164 | } |
165 | interfaces->setMap("map", newInterfaceName); | 165 | interfaces->setMap("map", newInterfaceName); |
166 | interfaces->setScript("getprofile.sh"); | 166 | interfaces->setScript("getprofile.sh"); |
167 | } | 167 | } |
168 | else{ | 168 | else{ |
169 | interfaces->addInterface(newInterfaceName, INTERFACES_FAMILY_INET, INTERFACES_METHOD_DHCP); | 169 | interfaces->addInterface(newInterfaceName, INTERFACES_FAMILY_INET, INTERFACES_METHOD_DHCP); |
170 | if(!interfaces->setInterface(newInterfaceName)){ | 170 | if(!interfaces->setInterface(newInterfaceName)){ |
171 | odebug << "InterfaceSetupImp: Added interface, but still can't setInterface." << oendl; | 171 | odebug << "InterfaceSetupImp: Added interface, but still can't setInterface." << oendl; |
172 | return; | 172 | return; |
173 | } | 173 | } |
174 | } | 174 | } |
175 | } | 175 | } |
176 | 176 | ||
177 | // We must have a valid interface to get this far so read some settings. | 177 | // We must have a valid interface to get this far so read some settings. |
@@ -183,13 +183,13 @@ void InterfaceSetupImp::setProfile(const QString &profile){ | |||
183 | else | 183 | else |
184 | dhcpCheckBox->setChecked(false); | 184 | dhcpCheckBox->setChecked(false); |
185 | 185 | ||
186 | // IP Information | 186 | // IP Information |
187 | autoStart->setChecked(interfaces->isAuto(interface->getInterfaceName())); | 187 | autoStart->setChecked(interfaces->isAuto(interface->getInterfaceName())); |
188 | QString dns = interfaces->getInterfaceOption("up "DNSSCRIPT" -a", error); | 188 | QString dns = interfaces->getInterfaceOption("up "DNSSCRIPT" -a", error); |
189 | odebug << "dns >" << dns.latin1() << "<" << oendl; | 189 | odebug << "dns >" << dns.latin1() << "<" << oendl; |
190 | if(dns.contains(" ")){ | 190 | if(dns.contains(" ")){ |
191 | firstDNSLineEdit->setText(dns.mid(0, dns.find(" "))); | 191 | firstDNSLineEdit->setText(dns.mid(0, dns.find(" "))); |
192 | secondDNSLineEdit->setText(dns.mid(dns.find(" ")+1, dns.length())); | 192 | secondDNSLineEdit->setText(dns.mid(dns.find(" ")+1, dns.length())); |
193 | }else firstDNSLineEdit->setText(dns); | 193 | }else firstDNSLineEdit->setText(dns); |
194 | 194 | ||
195 | ipAddressEdit->setText(interfaces->getInterfaceOption("address", error)); | 195 | ipAddressEdit->setText(interfaces->getInterfaceOption("address", error)); |
@@ -197,13 +197,13 @@ void InterfaceSetupImp::setProfile(const QString &profile){ | |||
197 | if (subnetMaskEdit->text().isEmpty()) | 197 | if (subnetMaskEdit->text().isEmpty()) |
198 | subnetMaskEdit->setText( "255.255.255.0" ); | 198 | subnetMaskEdit->setText( "255.255.255.0" ); |
199 | gatewayEdit->setText(interfaces->getInterfaceOption("gateway", error)); | 199 | gatewayEdit->setText(interfaces->getInterfaceOption("gateway", error)); |
200 | 200 | ||
201 | 201 | ||
202 | 202 | ||
203 | owarn << "InterfaceSetupImp::setProfile(" << profile.latin1() << ")\n" << oendl; | 203 | owarn << "InterfaceSetupImp::setProfile(" << profile.latin1() << ")\n" << oendl; |
204 | owarn << "InterfaceSetupImp::setProfile: iface is " << interfaces->getInterfaceName(error).latin1() << "\n" << oendl; | 204 | owarn << "InterfaceSetupImp::setProfile: iface is " << interfaces->getInterfaceName(error).latin1() << "\n" << oendl; |
205 | 205 | ||
206 | } | 206 | } |
207 | 207 | ||
208 | // interfacesetup.cpp | 208 | // interfacesetup.cpp |
209 | 209 | ||