author | benmeyer <benmeyer> | 2002-10-30 15:36:45 (UTC) |
---|---|---|
committer | benmeyer <benmeyer> | 2002-10-30 15:36:45 (UTC) |
commit | a22f8dd98789f4638ab241d281d4319e0ed911ba (patch) (side-by-side diff) | |
tree | 93131daa22042c2c3fbd52f52a90edb1e8fae92c | |
parent | bc95eea1eda31b458e5342695b3ffe246d5ab006 (diff) | |
download | opie-a22f8dd98789f4638ab241d281d4319e0ed911ba.zip opie-a22f8dd98789f4638ab241d281d4319e0ed911ba.tar.gz opie-a22f8dd98789f4638ab241d281d4319e0ed911ba.tar.bz2 |
Re-added profile information which makes interfaces work again
19 files changed, 59 insertions, 47 deletions
diff --git a/noncore/net/networksetup/TODO b/noncore/net/networksetup/TODO index 0584f81..ec6d2c6 100644 --- a/noncore/net/networksetup/TODO +++ b/noncore/net/networksetup/TODO @@ -1,16 +1,16 @@ CLEAN UP Fix Profiles Write dns script - WLAN needs to be re-written to not use Config -WHERE Is DHCP info stored??? - -PPP module needs to be written Write a class that parses /proc and not ifconfig +udchcp needs to output the dhcp information + +Possible other modules to write: ppp, ipsec, bluetooth, ipchains + +PPP module needs to scan pppd.tdb to see what is currently active -Possible other modules: ipsec, bluetooth, ipchains diff --git a/noncore/net/networksetup/interfaces/interfacesetupimp.cpp b/noncore/net/networksetup/interfaces/interfacesetupimp.cpp index 97c05cc..d42b45d 100644 --- a/noncore/net/networksetup/interfaces/interfacesetupimp.cpp +++ b/noncore/net/networksetup/interfaces/interfacesetupimp.cpp @@ -80,32 +80,33 @@ bool InterfaceSetupImp::saveSettings(){ interfaces->setInterfaceOption("down "DNSSCRIPT" -r ", dns); } // IP Information interfaces->setAuto(interface->getInterfaceName(), autoStart->isChecked()); return true; } /** * The Profile has changed. * @profile the new profile. */ void InterfaceSetupImp::setProfile(const QString &profile){ QString newInterfaceName = interface->getInterfaceName(); if(profile.length() > 0) newInterfaceName += "_" + profile; + qDebug("InterfaceSetupImp::setProfile"); // See if we have to make a interface. if(!interfaces->setInterface(newInterfaceName)){ // Add making for this new interface if need too if(profile != ""){ interfaces->copyInterface(interface->getInterfaceName(), newInterfaceName); if(!interfaces->setMapping(interface->getInterfaceName())){ interfaces->addMapping(interface->getInterfaceName()); if(!interfaces->setMapping(interface->getInterfaceName())){ qDebug("InterfaceSetupImp: Added Mapping, but still can't set."); return; } } interfaces->setMap("map", newInterfaceName); interfaces->setScript("getprofile.sh"); } else{ diff --git a/noncore/net/networksetup/interfaces/interfacesetupimp.h b/noncore/net/networksetup/interfaces/interfacesetupimp.h index 936f2be..3bbf34e 100644 --- a/noncore/net/networksetup/interfaces/interfacesetupimp.h +++ b/noncore/net/networksetup/interfaces/interfacesetupimp.h @@ -16,34 +16,40 @@ public: public slots: void setProfile(const QString &profile); bool saveSettings(); private: Interfaces *interfaces; Interface *interface; }; #include <qlayout.h> class InterfaceSetupImpDialog : public QDialog { Q_OBJECT - public: +public: InterfaceSetupImpDialog(QWidget* parent = 0, const char* name = 0, Interface *i=0, bool modal = false, WFlags fl = 0) : QDialog(parent, name, modal, fl){ QVBoxLayout *InterfaceSetupLayout = new QVBoxLayout( this ); setCaption("Interface Setup"); interfaceSetup = new InterfaceSetupImp(this, "InterfaceSetup",i,fl); InterfaceSetupLayout->addWidget( interfaceSetup ); }; + void setProfile(QString &profile){ interfaceSetup->setProfile(profile);}; +private: InterfaceSetupImp *interfaceSetup; - protected slots: - void accept(){ interfaceSetup->saveChanges(); }; +protected slots: + void accept(){ + interfaceSetup->saveChanges(); + QDialog::accept(); + }; + }; #endif // interfacesetupimp.h diff --git a/noncore/net/networksetup/mainwindowimp.cpp b/noncore/net/networksetup/mainwindowimp.cpp index b9fff56..6440bd4 100644 --- a/noncore/net/networksetup/mainwindowimp.cpp +++ b/noncore/net/networksetup/mainwindowimp.cpp @@ -217,77 +217,69 @@ void MainWindowImp::removeClicked(){ }
}
}
/**
* Pull up the configure about the currently selected interface.
* Report an error if no interface is selected.
* If the interface has a module owner then request its configure.
*/
void MainWindowImp::configureClicked(){
QListViewItem *item = connectionList->currentItem();
if(!item){
QMessageBox::information(this, "Sorry","Please select an interface first.", QMessageBox::Ok);
return;
}
- QString currentProfile = currentProfileLabel->text();
- if(profilesList->count() <= 1 || currentProfile == "All"){
- currentProfile = "";
- }
-
Interface *i = interfaceItems[item];
if(i->getModuleOwner()){
- i->getModuleOwner()->setProfile(currentProfile);
QWidget *moduleConfigure = i->getModuleOwner()->configure(i);
if(moduleConfigure != NULL){
moduleConfigure->showMaximized();
moduleConfigure->show();
return;
}
}
InterfaceSetupImpDialog *configure = new InterfaceSetupImpDialog(0, "InterfaceSetupImp", i, true, Qt::WDestructiveClose);
- //configure->setProfile(currentProfile);
+ QString currentProfileText = currentProfileLabel->text();
+ if(currentProfileText.upper() == "ALL");
+ currentProfileText = "";
+ configure->setProfile(currentProfileText);
configure->showMaximized();
configure->show();
}
/**
* Pull up the information about the currently selected interface.
* Report an error if no interface is selected.
* If the interface has a module owner then request its configure.
*/
void MainWindowImp::informationClicked(){
QListViewItem *item = connectionList->currentItem();
if(!item){
QMessageBox::information(this, "Sorry","Please select an interface First.", QMessageBox::Ok);
return;
}
Interface *i = interfaceItems[item];
if(!i->isAttached()){
QMessageBox::information(this, "Sorry","No information about\na disconnected interface.", QMessageBox::Ok);
return;
}
- QStringList list;
- for(uint i = 0; i < profilesList->count(); i++){
- list.append(profilesList->text(i));
- }
-
if(i->getModuleOwner()){
QWidget *moduleInformation = i->getModuleOwner()->information(i);
if(moduleInformation != NULL){
moduleInformation->showMaximized();
moduleInformation->show();
return;
}
}
InterfaceInformationImp *information = new InterfaceInformationImp(0, "InterfaceSetupImp", i, true);
information->showMaximized();
information->show();
}
/**
* Aquire the list of active interfaces from ifconfig
* Call ifconfig and ifconfig -a
@@ -525,20 +517,21 @@ void MainWindowImp::changeProfile(){ QFile file(scheme);
if ( file.open(IO_ReadWrite) ) {
QTextStream stream( &file );
stream << QString("SCHEME=%1").arg(newProfile);
file.close();
}
// restart all up devices?
if(QMessageBox::information(this, "Question","Restart all running interfaces?", QMessageBox::Ok, QMessageBox::No) == QMessageBox::Ok){
// Go through them one by one
QMap<Interface*, QListViewItem*>::Iterator it;
for( it = items.begin(); it != items.end(); ++it ){
if(it.key()->getStatus() == true)
it.key()->restart();
}
}
}
+ // TODO change the profile in the modules
}
// mainwindowimp.cpp
diff --git a/noncore/net/networksetup/networksetup.pro b/noncore/net/networksetup/networksetup.pro index 1719a35..5666a42 100644 --- a/noncore/net/networksetup/networksetup.pro +++ b/noncore/net/networksetup/networksetup.pro @@ -1,11 +1,11 @@ -DESTDIR = $(OPIEDIR)/bin +#DESTDIR = $(OPIEDIR)/bin TEMPLATE = app #CONFIG = qt warn_on debug CONFIG = qt warn_on release HEADERS = mainwindowimp.h addconnectionimp.h defaultmodule.h kprocctrl.h module.h kprocess.h SOURCES = main.cpp mainwindowimp.cpp addconnectionimp.cpp kprocctrl.cpp kprocess.cpp INCLUDEPATH += $(OPIEDIR)/include interfaces/ DEPENDPATH += $(OPIEDIR)/include interfaces/ wlan -LIBS += -lqpe -L$(OPIEDIR)/plugins/networksetup -linterfaces +LIBS += -lqpe -L$(OPIEDIR)/plugins/networksetup -Linterfaces/ -linterfaces INTERFACES = mainwindow.ui addconnection.ui TARGET = networksetup diff --git a/noncore/net/networksetup/opie-networksetup.control b/noncore/net/networksetup/opie-networksetup.control index 35bac52..d14e2d1 100644 --- a/noncore/net/networksetup/opie-networksetup.control +++ b/noncore/net/networksetup/opie-networksetup.control @@ -1,8 +1,8 @@ -Files: bin/networksetup apps/Settings/networksetup.desktop pics/Network plugins/networksetup/* pics/networksetup $QTDIR/lib/libinterfaces.so.1.0.0 $QTDIR/lib/libinterfaces.so.1.0 $QTDIR/lib/libinterfaces.so.1 +Files: bin/networksetup apps/Settings/networksetup.desktop pics/Network plugins/networksetup/* pics/networksetup $QTDIR/lib/libinterfaces.so.1.0.0 $QTDIR/lib/libinterfaces.so.1.0 $QTDIR/lib/libinterfaces.so.1 $OPIEDIR/bin/changedns.sh $OPIEDIR/bin/getprofile.sh Priority: optional Section: opie/settings Maintainer: Ben Meyer <meyerb@sharpsec.com> Architecture: arm Version: $QPE_VERSION-$SUB_VERSION Depends: opie-base ($QPE_VERSION) Description: Opie network setup tool diff --git a/noncore/net/networksetup/wlan/wlanimp.cpp b/noncore/net/networksetup/wlan/wlanimp.cpp index a466020..74bf390 100644 --- a/noncore/net/networksetup/wlan/wlanimp.cpp +++ b/noncore/net/networksetup/wlan/wlanimp.cpp @@ -20,32 +20,36 @@ #include "interfacesetupimp.h" WLANImp::WLANImp( QWidget* parent, const char* name, Interface *i, bool modal, WFlags fl):WLAN(parent, name, modal, fl){ config = new Config("wireless"); interfaceSetup = new InterfaceSetupImp(tabWidget, "InterfaceSetupImp", i);//, Qt::WDestructiveClose); //configure->setProfile(currentProfile); tabWidget->insertTab(interfaceSetup, "TCP/IP"); readConfig(); } WLANImp::~WLANImp( ){ delete config; } +void WLANImp::setProfile(QString &profile){ + interfaceSetup->setProfile(profile); +} + void WLANImp::readConfig() { qWarning( "WLANImp::readConfig() called." ); config->setGroup( "Properties" ); QString ssid = config->readEntry( "SSID", "any" ); if( ssid == "any" || ssid == "ANY" ){ essNon->setChecked( true ); } else { essSpecific->setChecked( true ); essSpecificLineEdit->setText( ssid ); } QString mode = config->readEntry( "Mode", "Managed" ); if( mode == "adhoc" ) { network802->setChecked( true ); } else { networkInfrastructure->setChecked( true ); diff --git a/noncore/net/networksetup/wlan/wlanimp.h b/noncore/net/networksetup/wlan/wlanimp.h index 608d681..faa1674 100644 --- a/noncore/net/networksetup/wlan/wlanimp.h +++ b/noncore/net/networksetup/wlan/wlanimp.h @@ -1,31 +1,32 @@ #ifndef WLANIMP_H #define WLANIMP_H #include "wlan.h" class InterfaceSetupImp; class Interface; class Config; class WLANImp : public WLAN { Q_OBJECT public: WLANImp( QWidget* parent = 0, const char* name = 0, Interface *i=0, bool modal = FALSE, WFlags fl = 0 ); ~WLANImp( ); + void setProfile(QString &profile); protected: void accept(); private: void readConfig(); bool writeConfig(); bool writeWirelessOpts( QString scheme = "*" ); bool writeWlanngOpts( QString scheme = "*" ); Config* config; InterfaceSetupImp *interfaceSetup; }; #endif diff --git a/noncore/net/networksetup/wlan/wlanmodule.cpp b/noncore/net/networksetup/wlan/wlanmodule.cpp index c8becb0..b14fc0a 100644 --- a/noncore/net/networksetup/wlan/wlanmodule.cpp +++ b/noncore/net/networksetup/wlan/wlanmodule.cpp @@ -47,32 +47,33 @@ QString WLANModule::getPixmapName(Interface* ){ bool WLANModule::isOwner(Interface *i){ WExtensions we(i->getInterfaceName()); if(!we.doesHaveWirelessExtensions()) return false; i->setHardwareName("802.11b"); list.append(i); return true; } /** * Create, and return the WLANConfigure Module * @return QWidget* pointer to this modules configure. */ QWidget *WLANModule::configure(Interface *i){ WLANImp *wlanconfig = new WLANImp(0, "WlanConfig", i, false, Qt::WDestructiveClose); + wlanconfig->setProfile(profile); return wlanconfig; } /** * Create, and return the Information Module * @return QWidget* pointer to this modules info. */ QWidget *WLANModule::information(Interface *i){ WExtensions we(i->getInterfaceName()); if(!we.doesHaveWirelessExtensions()) return NULL; WlanInfoImp *info = new WlanInfoImp(0, i->getInterfaceName(), Qt::WDestructiveClose); InterfaceInformationImp *information = new InterfaceInformationImp(info->tabWidget, "InterfaceSetupImp", i); info->tabWidget->insertTab(information, "TCP/IP"); return info; diff --git a/noncore/settings/networksettings/TODO b/noncore/settings/networksettings/TODO index 0584f81..ec6d2c6 100644 --- a/noncore/settings/networksettings/TODO +++ b/noncore/settings/networksettings/TODO @@ -1,16 +1,16 @@ CLEAN UP Fix Profiles Write dns script - WLAN needs to be re-written to not use Config -WHERE Is DHCP info stored??? - -PPP module needs to be written Write a class that parses /proc and not ifconfig +udchcp needs to output the dhcp information + +Possible other modules to write: ppp, ipsec, bluetooth, ipchains + +PPP module needs to scan pppd.tdb to see what is currently active -Possible other modules: ipsec, bluetooth, ipchains diff --git a/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp b/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp index 97c05cc..d42b45d 100644 --- a/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp +++ b/noncore/settings/networksettings/interfaces/interfacesetupimp.cpp @@ -80,32 +80,33 @@ bool InterfaceSetupImp::saveSettings(){ interfaces->setInterfaceOption("down "DNSSCRIPT" -r ", dns); } // IP Information interfaces->setAuto(interface->getInterfaceName(), autoStart->isChecked()); return true; } /** * The Profile has changed. * @profile the new profile. */ void InterfaceSetupImp::setProfile(const QString &profile){ QString newInterfaceName = interface->getInterfaceName(); if(profile.length() > 0) newInterfaceName += "_" + profile; + qDebug("InterfaceSetupImp::setProfile"); // See if we have to make a interface. if(!interfaces->setInterface(newInterfaceName)){ // Add making for this new interface if need too if(profile != ""){ interfaces->copyInterface(interface->getInterfaceName(), newInterfaceName); if(!interfaces->setMapping(interface->getInterfaceName())){ interfaces->addMapping(interface->getInterfaceName()); if(!interfaces->setMapping(interface->getInterfaceName())){ qDebug("InterfaceSetupImp: Added Mapping, but still can't set."); return; } } interfaces->setMap("map", newInterfaceName); interfaces->setScript("getprofile.sh"); } else{ diff --git a/noncore/settings/networksettings/interfaces/interfacesetupimp.h b/noncore/settings/networksettings/interfaces/interfacesetupimp.h index 936f2be..3bbf34e 100644 --- a/noncore/settings/networksettings/interfaces/interfacesetupimp.h +++ b/noncore/settings/networksettings/interfaces/interfacesetupimp.h @@ -16,34 +16,40 @@ public: public slots: void setProfile(const QString &profile); bool saveSettings(); private: Interfaces *interfaces; Interface *interface; }; #include <qlayout.h> class InterfaceSetupImpDialog : public QDialog { Q_OBJECT - public: +public: InterfaceSetupImpDialog(QWidget* parent = 0, const char* name = 0, Interface *i=0, bool modal = false, WFlags fl = 0) : QDialog(parent, name, modal, fl){ QVBoxLayout *InterfaceSetupLayout = new QVBoxLayout( this ); setCaption("Interface Setup"); interfaceSetup = new InterfaceSetupImp(this, "InterfaceSetup",i,fl); InterfaceSetupLayout->addWidget( interfaceSetup ); }; + void setProfile(QString &profile){ interfaceSetup->setProfile(profile);}; +private: InterfaceSetupImp *interfaceSetup; - protected slots: - void accept(){ interfaceSetup->saveChanges(); }; +protected slots: + void accept(){ + interfaceSetup->saveChanges(); + QDialog::accept(); + }; + }; #endif // interfacesetupimp.h diff --git a/noncore/settings/networksettings/mainwindowimp.cpp b/noncore/settings/networksettings/mainwindowimp.cpp index b9fff56..6440bd4 100644 --- a/noncore/settings/networksettings/mainwindowimp.cpp +++ b/noncore/settings/networksettings/mainwindowimp.cpp @@ -217,77 +217,69 @@ void MainWindowImp::removeClicked(){ }
}
}
/**
* Pull up the configure about the currently selected interface.
* Report an error if no interface is selected.
* If the interface has a module owner then request its configure.
*/
void MainWindowImp::configureClicked(){
QListViewItem *item = connectionList->currentItem();
if(!item){
QMessageBox::information(this, "Sorry","Please select an interface first.", QMessageBox::Ok);
return;
}
- QString currentProfile = currentProfileLabel->text();
- if(profilesList->count() <= 1 || currentProfile == "All"){
- currentProfile = "";
- }
-
Interface *i = interfaceItems[item];
if(i->getModuleOwner()){
- i->getModuleOwner()->setProfile(currentProfile);
QWidget *moduleConfigure = i->getModuleOwner()->configure(i);
if(moduleConfigure != NULL){
moduleConfigure->showMaximized();
moduleConfigure->show();
return;
}
}
InterfaceSetupImpDialog *configure = new InterfaceSetupImpDialog(0, "InterfaceSetupImp", i, true, Qt::WDestructiveClose);
- //configure->setProfile(currentProfile);
+ QString currentProfileText = currentProfileLabel->text();
+ if(currentProfileText.upper() == "ALL");
+ currentProfileText = "";
+ configure->setProfile(currentProfileText);
configure->showMaximized();
configure->show();
}
/**
* Pull up the information about the currently selected interface.
* Report an error if no interface is selected.
* If the interface has a module owner then request its configure.
*/
void MainWindowImp::informationClicked(){
QListViewItem *item = connectionList->currentItem();
if(!item){
QMessageBox::information(this, "Sorry","Please select an interface First.", QMessageBox::Ok);
return;
}
Interface *i = interfaceItems[item];
if(!i->isAttached()){
QMessageBox::information(this, "Sorry","No information about\na disconnected interface.", QMessageBox::Ok);
return;
}
- QStringList list;
- for(uint i = 0; i < profilesList->count(); i++){
- list.append(profilesList->text(i));
- }
-
if(i->getModuleOwner()){
QWidget *moduleInformation = i->getModuleOwner()->information(i);
if(moduleInformation != NULL){
moduleInformation->showMaximized();
moduleInformation->show();
return;
}
}
InterfaceInformationImp *information = new InterfaceInformationImp(0, "InterfaceSetupImp", i, true);
information->showMaximized();
information->show();
}
/**
* Aquire the list of active interfaces from ifconfig
* Call ifconfig and ifconfig -a
@@ -525,20 +517,21 @@ void MainWindowImp::changeProfile(){ QFile file(scheme);
if ( file.open(IO_ReadWrite) ) {
QTextStream stream( &file );
stream << QString("SCHEME=%1").arg(newProfile);
file.close();
}
// restart all up devices?
if(QMessageBox::information(this, "Question","Restart all running interfaces?", QMessageBox::Ok, QMessageBox::No) == QMessageBox::Ok){
// Go through them one by one
QMap<Interface*, QListViewItem*>::Iterator it;
for( it = items.begin(); it != items.end(); ++it ){
if(it.key()->getStatus() == true)
it.key()->restart();
}
}
}
+ // TODO change the profile in the modules
}
// mainwindowimp.cpp
diff --git a/noncore/settings/networksettings/networksetup.pro b/noncore/settings/networksettings/networksetup.pro index 1719a35..5666a42 100644 --- a/noncore/settings/networksettings/networksetup.pro +++ b/noncore/settings/networksettings/networksetup.pro @@ -1,11 +1,11 @@ -DESTDIR = $(OPIEDIR)/bin +#DESTDIR = $(OPIEDIR)/bin TEMPLATE = app #CONFIG = qt warn_on debug CONFIG = qt warn_on release HEADERS = mainwindowimp.h addconnectionimp.h defaultmodule.h kprocctrl.h module.h kprocess.h SOURCES = main.cpp mainwindowimp.cpp addconnectionimp.cpp kprocctrl.cpp kprocess.cpp INCLUDEPATH += $(OPIEDIR)/include interfaces/ DEPENDPATH += $(OPIEDIR)/include interfaces/ wlan -LIBS += -lqpe -L$(OPIEDIR)/plugins/networksetup -linterfaces +LIBS += -lqpe -L$(OPIEDIR)/plugins/networksetup -Linterfaces/ -linterfaces INTERFACES = mainwindow.ui addconnection.ui TARGET = networksetup diff --git a/noncore/settings/networksettings/opie-networksettings.control b/noncore/settings/networksettings/opie-networksettings.control index 35bac52..d14e2d1 100644 --- a/noncore/settings/networksettings/opie-networksettings.control +++ b/noncore/settings/networksettings/opie-networksettings.control @@ -1,8 +1,8 @@ -Files: bin/networksetup apps/Settings/networksetup.desktop pics/Network plugins/networksetup/* pics/networksetup $QTDIR/lib/libinterfaces.so.1.0.0 $QTDIR/lib/libinterfaces.so.1.0 $QTDIR/lib/libinterfaces.so.1 +Files: bin/networksetup apps/Settings/networksetup.desktop pics/Network plugins/networksetup/* pics/networksetup $QTDIR/lib/libinterfaces.so.1.0.0 $QTDIR/lib/libinterfaces.so.1.0 $QTDIR/lib/libinterfaces.so.1 $OPIEDIR/bin/changedns.sh $OPIEDIR/bin/getprofile.sh Priority: optional Section: opie/settings Maintainer: Ben Meyer <meyerb@sharpsec.com> Architecture: arm Version: $QPE_VERSION-$SUB_VERSION Depends: opie-base ($QPE_VERSION) Description: Opie network setup tool diff --git a/noncore/settings/networksettings/opie-networksetup.control b/noncore/settings/networksettings/opie-networksetup.control index 35bac52..d14e2d1 100644 --- a/noncore/settings/networksettings/opie-networksetup.control +++ b/noncore/settings/networksettings/opie-networksetup.control @@ -1,8 +1,8 @@ -Files: bin/networksetup apps/Settings/networksetup.desktop pics/Network plugins/networksetup/* pics/networksetup $QTDIR/lib/libinterfaces.so.1.0.0 $QTDIR/lib/libinterfaces.so.1.0 $QTDIR/lib/libinterfaces.so.1 +Files: bin/networksetup apps/Settings/networksetup.desktop pics/Network plugins/networksetup/* pics/networksetup $QTDIR/lib/libinterfaces.so.1.0.0 $QTDIR/lib/libinterfaces.so.1.0 $QTDIR/lib/libinterfaces.so.1 $OPIEDIR/bin/changedns.sh $OPIEDIR/bin/getprofile.sh Priority: optional Section: opie/settings Maintainer: Ben Meyer <meyerb@sharpsec.com> Architecture: arm Version: $QPE_VERSION-$SUB_VERSION Depends: opie-base ($QPE_VERSION) Description: Opie network setup tool diff --git a/noncore/settings/networksettings/wlan/wlanimp.cpp b/noncore/settings/networksettings/wlan/wlanimp.cpp index a466020..74bf390 100644 --- a/noncore/settings/networksettings/wlan/wlanimp.cpp +++ b/noncore/settings/networksettings/wlan/wlanimp.cpp @@ -20,32 +20,36 @@ #include "interfacesetupimp.h" WLANImp::WLANImp( QWidget* parent, const char* name, Interface *i, bool modal, WFlags fl):WLAN(parent, name, modal, fl){ config = new Config("wireless"); interfaceSetup = new InterfaceSetupImp(tabWidget, "InterfaceSetupImp", i);//, Qt::WDestructiveClose); //configure->setProfile(currentProfile); tabWidget->insertTab(interfaceSetup, "TCP/IP"); readConfig(); } WLANImp::~WLANImp( ){ delete config; } +void WLANImp::setProfile(QString &profile){ + interfaceSetup->setProfile(profile); +} + void WLANImp::readConfig() { qWarning( "WLANImp::readConfig() called." ); config->setGroup( "Properties" ); QString ssid = config->readEntry( "SSID", "any" ); if( ssid == "any" || ssid == "ANY" ){ essNon->setChecked( true ); } else { essSpecific->setChecked( true ); essSpecificLineEdit->setText( ssid ); } QString mode = config->readEntry( "Mode", "Managed" ); if( mode == "adhoc" ) { network802->setChecked( true ); } else { networkInfrastructure->setChecked( true ); diff --git a/noncore/settings/networksettings/wlan/wlanimp.h b/noncore/settings/networksettings/wlan/wlanimp.h index 608d681..faa1674 100644 --- a/noncore/settings/networksettings/wlan/wlanimp.h +++ b/noncore/settings/networksettings/wlan/wlanimp.h @@ -1,31 +1,32 @@ #ifndef WLANIMP_H #define WLANIMP_H #include "wlan.h" class InterfaceSetupImp; class Interface; class Config; class WLANImp : public WLAN { Q_OBJECT public: WLANImp( QWidget* parent = 0, const char* name = 0, Interface *i=0, bool modal = FALSE, WFlags fl = 0 ); ~WLANImp( ); + void setProfile(QString &profile); protected: void accept(); private: void readConfig(); bool writeConfig(); bool writeWirelessOpts( QString scheme = "*" ); bool writeWlanngOpts( QString scheme = "*" ); Config* config; InterfaceSetupImp *interfaceSetup; }; #endif diff --git a/noncore/settings/networksettings/wlan/wlanmodule.cpp b/noncore/settings/networksettings/wlan/wlanmodule.cpp index c8becb0..b14fc0a 100644 --- a/noncore/settings/networksettings/wlan/wlanmodule.cpp +++ b/noncore/settings/networksettings/wlan/wlanmodule.cpp @@ -47,32 +47,33 @@ QString WLANModule::getPixmapName(Interface* ){ bool WLANModule::isOwner(Interface *i){ WExtensions we(i->getInterfaceName()); if(!we.doesHaveWirelessExtensions()) return false; i->setHardwareName("802.11b"); list.append(i); return true; } /** * Create, and return the WLANConfigure Module * @return QWidget* pointer to this modules configure. */ QWidget *WLANModule::configure(Interface *i){ WLANImp *wlanconfig = new WLANImp(0, "WlanConfig", i, false, Qt::WDestructiveClose); + wlanconfig->setProfile(profile); return wlanconfig; } /** * Create, and return the Information Module * @return QWidget* pointer to this modules info. */ QWidget *WLANModule::information(Interface *i){ WExtensions we(i->getInterfaceName()); if(!we.doesHaveWirelessExtensions()) return NULL; WlanInfoImp *info = new WlanInfoImp(0, i->getInterfaceName(), Qt::WDestructiveClose); InterfaceInformationImp *information = new InterfaceInformationImp(info->tabWidget, "InterfaceSetupImp", i); info->tabWidget->insertTab(information, "TCP/IP"); return info; |