summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings/mainwindowimp.cpp
Unidiff
Diffstat (limited to 'noncore/settings/networksettings/mainwindowimp.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings/mainwindowimp.cpp24
1 files changed, 15 insertions, 9 deletions
diff --git a/noncore/settings/networksettings/mainwindowimp.cpp b/noncore/settings/networksettings/mainwindowimp.cpp
index 3c0af6a..9f07f0d 100644
--- a/noncore/settings/networksettings/mainwindowimp.cpp
+++ b/noncore/settings/networksettings/mainwindowimp.cpp
@@ -225,30 +225,30 @@ void MainWindowImp::configureClicked(){
225 if(profilesList->count() <= 1 || currentProfile == "All"){ 225 if(profilesList->count() <= 1 || currentProfile == "All"){
226 currentProfile = ""; 226 currentProfile = "";
227 } 227 }
228 228
229 Interface *i = interfaceItems[item]; 229 Interface *i = interfaceItems[item];
230 if(i->getModuleOwner()){ 230 if(i->getModuleOwner()){
231 i->getModuleOwner()->setProfile(currentProfileLabel->text()); 231 i->getModuleOwner()->setProfile(currentProfile);
232 QTabWidget *tabWidget = NULL; 232 QTabWidget *tabWidget = NULL;
233 QWidget *moduleConfigure = i->getModuleOwner()->configure(&tabWidget); 233 QWidget *moduleConfigure = i->getModuleOwner()->configure(&tabWidget);
234 if(moduleConfigure != NULL){ 234 if(moduleConfigure != NULL){
235 if(tabWidget != NULL){ 235 if(tabWidget != NULL){
236 InterfaceSetupImp *configure = new InterfaceSetupImp(tabWidget, "InterfaceSetupImp", i, true); 236 InterfaceSetupImp *configure = new InterfaceSetupImp(tabWidget, "InterfaceSetupImp", i, true);
237 configure->setProfile(currentProfileLabel->text()); 237 configure->setProfile(currentProfile);
238 tabWidget->insertTab(configure, "TCP/IP"); 238 tabWidget->insertTab(configure, "TCP/IP");
239 239
240 } 240 }
241 moduleConfigure->showMaximized(); 241 moduleConfigure->showMaximized();
242 moduleConfigure->show(); 242 moduleConfigure->show();
243 return; 243 return;
244 } 244 }
245 } 245 }
246 246
247 InterfaceSetupImp *configure = new InterfaceSetupImp(0, "InterfaceSetupImp", i, true); 247 InterfaceSetupImp *configure = new InterfaceSetupImp(0, "InterfaceSetupImp", i, true);
248 configure->setProfile(currentProfileLabel->text()); 248 configure->setProfile(currentProfile);
249 configure->showMaximized(); 249 configure->showMaximized();
250 configure->show(); 250 configure->show();
251} 251}
252 252
253/** 253/**
254 * Pull up the information about the currently selected interface. 254 * Pull up the information about the currently selected interface.
@@ -374,18 +374,20 @@ void MainWindowImp::jobDone(KProcess *process){
374 bool found = false; 374 bool found = false;
375 for( it = interfaceNames.begin(); it != interfaceNames.end(); ++it ){ 375 for( it = interfaceNames.begin(); it != interfaceNames.end(); ++it ){
376 if(it.key() == (*ni)) 376 if(it.key() == (*ni))
377 found = true; 377 found = true;
378 } 378 }
379 if(!found){ 379 if(!found){
380 Interface *i = new Interface(this, *ni, false); 380 if(!(*ni).contains("_")){
381 i->setAttached(false); 381 Interface *i = new Interface(this, *ni, false);
382 i->setHardwareName("Disconnected"); 382 i->setAttached(false);
383 interfaceNames.insert(i->getInterfaceName(), i); 383 i->setHardwareName("Disconnected");
384 updateInterface(i); 384 interfaceNames.insert(i->getInterfaceName(), i);
385 connect(i, SIGNAL(updateInterface(Interface *)), this, SLOT(updateInterface(Interface *))); 385 updateInterface(i);
386 connect(i, SIGNAL(updateInterface(Interface *)), this, SLOT(updateInterface(Interface *)));
387 }
386 } 388 }
387 } 389 }
388 } 390 }
389} 391}
390 392
391/** 393/**
@@ -486,12 +488,15 @@ void MainWindowImp::removeProfile(){
486 if(QMessageBox::information(this, "Question",QString("Remove profile: %1").arg(profileToRemove), QMessageBox::Ok, QMessageBox::Cancel) == QMessageBox::Ok){ 488 if(QMessageBox::information(this, "Question",QString("Remove profile: %1").arg(profileToRemove), QMessageBox::Ok, QMessageBox::Cancel) == QMessageBox::Ok){
487 profiles = QStringList::split(" ", profiles.join(" ").replace(QRegExp(profileToRemove), "")); 489 profiles = QStringList::split(" ", profiles.join(" ").replace(QRegExp(profileToRemove), ""));
488 profilesList->clear(); 490 profilesList->clear();
489 for ( QStringList::Iterator it = profiles.begin(); it != profiles.end(); ++it) 491 for ( QStringList::Iterator it = profiles.begin(); it != profiles.end(); ++it)
490 profilesList->insertItem((*it)); 492 profilesList->insertItem((*it));
491 } 493 }
494
495 // Remove any interface settings and mappings.
496 //TODO
492} 497}
493 498
494/** 499/**
495 * A new profile has been selected, change. 500 * A new profile has been selected, change.
496 * @param newProfile the new profile. 501 * @param newProfile the new profile.
497 */ 502 */
@@ -500,12 +505,13 @@ void MainWindowImp::changeProfile(){
500 QMessageBox::information(this, "Can't Change.","Please select a profile.", "Ok"); 505 QMessageBox::information(this, "Can't Change.","Please select a profile.", "Ok");
501 return; 506 return;
502 } 507 }
503 QString newProfile = profilesList->text(profilesList->currentItem()); 508 QString newProfile = profilesList->text(profilesList->currentItem());
504 if(newProfile != currentProfileLabel->text()){ 509 if(newProfile != currentProfileLabel->text()){
505 currentProfileLabel->setText(newProfile); 510 currentProfileLabel->setText(newProfile);
511 QFile::remove(SCHEME);
506 QFile file(SCHEME); 512 QFile file(SCHEME);
507 if ( file.open(IO_ReadWrite) ) { 513 if ( file.open(IO_ReadWrite) ) {
508 QTextStream stream( &file ); 514 QTextStream stream( &file );
509 stream << QString("SCHEME=%1").arg(newProfile); 515 stream << QString("SCHEME=%1").arg(newProfile);
510 file.close(); 516 file.close();
511 } 517 }