Diffstat (limited to 'noncore/net/networksetup/mainwindowimp.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/networksetup/mainwindowimp.cpp | 36 |
1 files changed, 28 insertions, 8 deletions
diff --git a/noncore/net/networksetup/mainwindowimp.cpp b/noncore/net/networksetup/mainwindowimp.cpp index 9f07f0d..01063c2 100644 --- a/noncore/net/networksetup/mainwindowimp.cpp +++ b/noncore/net/networksetup/mainwindowimp.cpp | |||
@@ -34,3 +34,4 @@ | |||
34 | 34 | ||
35 | #define SCHEME "/var/lib/pcmcia/scheme" | 35 | #define DEFAULT_SCHEME "/var/lib/pcmcia/scheme" |
36 | |||
36 | MainWindowImp::MainWindowImp(QWidget *parent, const char *name) : MainWindow(parent, name, true), advancedUserMode(false){ | 37 | MainWindowImp::MainWindowImp(QWidget *parent, const char *name) : MainWindow(parent, name, true), advancedUserMode(false){ |
@@ -58,4 +59,5 @@ MainWindowImp::MainWindowImp(QWidget *parent, const char *name) : MainWindow(par | |||
58 | advancedUserMode = cfg.readBoolEntry("AdvancedUserMode", false); | 59 | advancedUserMode = cfg.readBoolEntry("AdvancedUserMode", false); |
60 | scheme = cfg.readEntry("SchemeFile", DEFAULT_SCHEME); | ||
59 | 61 | ||
60 | QFile file(SCHEME); | 62 | QFile file(scheme); |
61 | if ( file.open(IO_ReadOnly) ) { // file opened successfully | 63 | if ( file.open(IO_ReadOnly) ) { // file opened successfully |
@@ -97,3 +99,3 @@ MainWindowImp::~MainWindowImp(){ | |||
97 | void MainWindowImp::loadModules(QString path){ | 99 | void MainWindowImp::loadModules(QString path){ |
98 | qDebug(path.latin1()); | 100 | //qDebug(path.latin1()); |
99 | QDir d(path); | 101 | QDir d(path); |
@@ -122,3 +124,3 @@ void MainWindowImp::loadModules(QString path){ | |||
122 | Module* MainWindowImp::loadPlugin(QString pluginFileName, QString resolveString){ | 124 | Module* MainWindowImp::loadPlugin(QString pluginFileName, QString resolveString){ |
123 | qDebug(QString("MainWindowImp::loadPlugin: %1").arg(pluginFileName).latin1()); | 125 | //qDebug(QString("MainWindowImp::loadPlugin: %1").arg(pluginFileName).latin1()); |
124 | QLibrary *lib = new QLibrary(pluginFileName); | 126 | QLibrary *lib = new QLibrary(pluginFileName); |
@@ -492,6 +494,24 @@ void MainWindowImp::removeProfile(){ | |||
492 | profilesList->insertItem((*it)); | 494 | profilesList->insertItem((*it)); |
493 | } | ||
494 | 495 | ||
495 | // Remove any interface settings and mappings. | 496 | // Remove any interface settings and mappings. |
496 | //TODO | 497 | Interfaces interfaces; |
498 | // Go through them one by one | ||
499 | QMap<Interface*, QListViewItem*>::Iterator it; | ||
500 | for( it = items.begin(); it != items.end(); ++it ){ | ||
501 | QString interfaceName = it.key()->getInterfaceName(); | ||
502 | qDebug(interfaceName.latin1()); | ||
503 | if(interfaces.setInterface(interfaceName + "_" + profileToRemove)){ | ||
504 | interfaces.removeInterface(); | ||
505 | if(interfaces.setMapping(interfaceName)){ | ||
506 | if(profilesList->count() == 1) | ||
507 | interfaces.removeMapping(); | ||
508 | else{ | ||
509 | interfaces.removeMap("map", interfaceName + "_" + profileToRemove); | ||
510 | } | ||
511 | } | ||
512 | interfaces.write(); | ||
513 | break; | ||
514 | } | ||
515 | } | ||
516 | } | ||
497 | } | 517 | } |
@@ -510,4 +530,4 @@ void MainWindowImp::changeProfile(){ | |||
510 | currentProfileLabel->setText(newProfile); | 530 | currentProfileLabel->setText(newProfile); |
511 | QFile::remove(SCHEME); | 531 | QFile::remove(scheme); |
512 | QFile file(SCHEME); | 532 | QFile file(scheme); |
513 | if ( file.open(IO_ReadWrite) ) { | 533 | if ( file.open(IO_ReadWrite) ) { |