summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings/mainwindowimp.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/noncore/settings/networksettings/mainwindowimp.cpp b/noncore/settings/networksettings/mainwindowimp.cpp
index 50131d8..7e24cda 100644
--- a/noncore/settings/networksettings/mainwindowimp.cpp
+++ b/noncore/settings/networksettings/mainwindowimp.cpp
@@ -182,26 +182,24 @@ void MainWindowImp::getAllInterfaces(){
182 if((loc = line.find(":")) != -1) { 182 if((loc = line.find(":")) != -1) {
183 ifaces += line.left(loc); 183 ifaces += line.left(loc);
184 } 184 }
185 } 185 }
186 } 186 }
187 187
188 for (QStringList::Iterator it = ifaces.begin(); it != ifaces.end(); ++it) { 188 for (QStringList::Iterator it = ifaces.begin(); it != ifaces.end(); ++it) {
189 int flags = 0, family; 189 int flags = 0, family;
190 Interface *i = NULL; 190 Interface *i = NULL;
191 191
192 strcpy(ifr.ifr_name, (*it).latin1()); 192 strcpy(ifr.ifr_name, (*it).latin1());
193 193
194 qWarning("ifr.ifr_name=%s\n", ifr.ifr_name);
195
196 struct ifreq ifcopy; 194 struct ifreq ifcopy;
197 ifcopy = ifr; 195 ifcopy = ifr;
198 result = ioctl(sockfd, SIOCGIFFLAGS, &ifcopy); 196 result = ioctl(sockfd, SIOCGIFFLAGS, &ifcopy);
199 flags = ifcopy.ifr_flags; 197 flags = ifcopy.ifr_flags;
200 i = new Interface(this, ifr.ifr_name, false); 198 i = new Interface(this, ifr.ifr_name, false);
201 i->setAttached(true); 199 i->setAttached(true);
202 if ((flags & IFF_UP) == IFF_UP) 200 if ((flags & IFF_UP) == IFF_UP)
203 i->setStatus(true); 201 i->setStatus(true);
204 else 202 else
205 i->setStatus(false); 203 i->setStatus(false);
206 204
207 if ((flags & IFF_BROADCAST) == IFF_BROADCAST) 205 if ((flags & IFF_BROADCAST) == IFF_BROADCAST)
@@ -380,37 +378,40 @@ void MainWindowImp::removeClicked(){
380/** 378/**
381 * Pull up the configure about the currently selected interface. 379 * Pull up the configure about the currently selected interface.
382 * Report an error if no interface is selected. 380 * Report an error if no interface is selected.
383 * If the interface has a module owner then request its configure. 381 * If the interface has a module owner then request its configure.
384 */ 382 */
385void MainWindowImp::configureClicked(){ 383void MainWindowImp::configureClicked(){
386 QListViewItem *item = connectionList->currentItem(); 384 QListViewItem *item = connectionList->currentItem();
387 if(!item){ 385 if(!item){
388 QMessageBox::information(this, "Sorry","Please select an interface first.", QMessageBox::Ok); 386 QMessageBox::information(this, "Sorry","Please select an interface first.", QMessageBox::Ok);
389 return; 387 return;
390 } 388 }
391 389
390 QString currentProfileText = currentProfileLabel->text();
391 if(currentProfileText.upper() == "ALL");
392 currentProfileText = "";
393
392 Interface *i = interfaceItems[item]; 394 Interface *i = interfaceItems[item];
395
393 if(i->getModuleOwner()){ 396 if(i->getModuleOwner()){
394 QWidget *moduleConfigure = i->getModuleOwner()->configure(i); 397 QWidget *moduleConfigure = i->getModuleOwner()->configure(i);
395 if(moduleConfigure != NULL){ 398 if(moduleConfigure != NULL){
399 i->getModuleOwner()->setProfile(currentProfileText);
396 moduleConfigure->showMaximized(); 400 moduleConfigure->showMaximized();
397 return; 401 return;
398 } 402 }
399 } 403 }
400 404
401 InterfaceSetupImpDialog *configure = new InterfaceSetupImpDialog(this, "InterfaceSetupImp", i, true, Qt::WDestructiveClose ); 405 InterfaceSetupImpDialog *configure = new InterfaceSetupImpDialog(this, "InterfaceSetupImp", i, true, Qt::WDestructiveClose );
402 QString currentProfileText = currentProfileLabel->text();
403 if(currentProfileText.upper() == "ALL");
404 currentProfileText = "";
405 configure->setProfile(currentProfileText); 406 configure->setProfile(currentProfileText);
406 configure->showMaximized(); 407 configure->showMaximized();
407} 408}
408 409
409/** 410/**
410 * Pull up the information about the currently selected interface. 411 * Pull up the information about the currently selected interface.
411 * Report an error if no interface is selected. 412 * Report an error if no interface is selected.
412 * If the interface has a module owner then request its configure. 413 * If the interface has a module owner then request its configure.
413 */ 414 */
414void MainWindowImp::informationClicked(){ 415void MainWindowImp::informationClicked(){
415 QListViewItem *item = connectionList->currentItem(); 416 QListViewItem *item = connectionList->currentItem();
416 if(!item){ 417 if(!item){