summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings/mainwindowimp.cpp
authorbenmeyer <benmeyer>2002-10-18 15:40:50 (UTC)
committer benmeyer <benmeyer>2002-10-18 15:40:50 (UTC)
commitc16dcab3fe45ae7193cbdfb2f62bf7e5482d449b (patch) (side-by-side diff)
tree39e69706b24b032364ad4483d2f33688e7054390 /noncore/settings/networksettings/mainwindowimp.cpp
parent0910b94b5b6618c84b3eb6c457c9137d63a7277f (diff)
downloadopie-c16dcab3fe45ae7193cbdfb2f62bf7e5482d449b.zip
opie-c16dcab3fe45ae7193cbdfb2f62bf7e5482d449b.tar.gz
opie-c16dcab3fe45ae7193cbdfb2f62bf7e5482d449b.tar.bz2
Profiles copy
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(){
if(profilesList->count() <= 1 || currentProfile == "All"){
currentProfile = "";
}
Interface *i = interfaceItems[item];
if(i->getModuleOwner()){
- i->getModuleOwner()->setProfile(currentProfileLabel->text());
+ i->getModuleOwner()->setProfile(currentProfile);
QTabWidget *tabWidget = NULL;
QWidget *moduleConfigure = i->getModuleOwner()->configure(&tabWidget);
if(moduleConfigure != NULL){
if(tabWidget != NULL){
InterfaceSetupImp *configure = new InterfaceSetupImp(tabWidget, "InterfaceSetupImp", i, true);
- configure->setProfile(currentProfileLabel->text());
+ configure->setProfile(currentProfile);
tabWidget->insertTab(configure, "TCP/IP");
}
moduleConfigure->showMaximized();
moduleConfigure->show();
return;
}
}
InterfaceSetupImp *configure = new InterfaceSetupImp(0, "InterfaceSetupImp", i, true);
- configure->setProfile(currentProfileLabel->text());
+ configure->setProfile(currentProfile);
configure->showMaximized();
configure->show();
}
/**
* Pull up the information about the currently selected interface.
@@ -374,18 +374,20 @@ void MainWindowImp::jobDone(KProcess *process){
bool found = false;
for( it = interfaceNames.begin(); it != interfaceNames.end(); ++it ){
if(it.key() == (*ni))
found = true;
}
if(!found){
- Interface *i = new Interface(this, *ni, false);
- i->setAttached(false);
- i->setHardwareName("Disconnected");
- interfaceNames.insert(i->getInterfaceName(), i);
- updateInterface(i);
- connect(i, SIGNAL(updateInterface(Interface *)), this, SLOT(updateInterface(Interface *)));
+ if(!(*ni).contains("_")){
+ Interface *i = new Interface(this, *ni, false);
+ i->setAttached(false);
+ i->setHardwareName("Disconnected");
+ interfaceNames.insert(i->getInterfaceName(), i);
+ updateInterface(i);
+ connect(i, SIGNAL(updateInterface(Interface *)), this, SLOT(updateInterface(Interface *)));
+ }
}
}
}
}
/**
@@ -486,12 +488,15 @@ void MainWindowImp::removeProfile(){
if(QMessageBox::information(this, "Question",QString("Remove profile: %1").arg(profileToRemove), QMessageBox::Ok, QMessageBox::Cancel) == QMessageBox::Ok){
profiles = QStringList::split(" ", profiles.join(" ").replace(QRegExp(profileToRemove), ""));
profilesList->clear();
for ( QStringList::Iterator it = profiles.begin(); it != profiles.end(); ++it)
profilesList->insertItem((*it));
}
+
+ // Remove any interface settings and mappings.
+ //TODO
}
/**
* A new profile has been selected, change.
* @param newProfile the new profile.
*/
@@ -500,12 +505,13 @@ void MainWindowImp::changeProfile(){
QMessageBox::information(this, "Can't Change.","Please select a profile.", "Ok");
return;
}
QString newProfile = profilesList->text(profilesList->currentItem());
if(newProfile != currentProfileLabel->text()){
currentProfileLabel->setText(newProfile);
+ QFile::remove(SCHEME);
QFile file(SCHEME);
if ( file.open(IO_ReadWrite) ) {
QTextStream stream( &file );
stream << QString("SCHEME=%1").arg(newProfile);
file.close();
}