summaryrefslogtreecommitdiff
authorbenmeyer <benmeyer>2002-10-24 20:20:12 (UTC)
committer benmeyer <benmeyer>2002-10-24 20:20:12 (UTC)
commit57c34f2f0b35ab13e7618ba77480c9b28b83885a (patch) (side-by-side diff)
tree406fc6016ccea8d9d77a3b251361d11828e7afbc
parent013b5a78262099a55de8e7228436f2c00660e6b1 (diff)
downloadopie-57c34f2f0b35ab13e7618ba77480c9b28b83885a.zip
opie-57c34f2f0b35ab13e7618ba77480c9b28b83885a.tar.gz
opie-57c34f2f0b35ab13e7618ba77480c9b28b83885a.tar.bz2
Fix segfault
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/networksetup/interfacesetupimp.cpp2
-rw-r--r--noncore/net/networksetup/interfacesetupimp.h2
-rw-r--r--noncore/net/networksetup/mainwindowimp.cpp13
-rw-r--r--noncore/net/networksetup/networksetup.pro6
-rw-r--r--noncore/net/networksetup/wlan/wlan.pro6
-rw-r--r--noncore/net/networksetup/wlan/wlanimp.cpp9
-rw-r--r--noncore/net/networksetup/wlan/wlanimp.h3
-rw-r--r--noncore/net/networksetup/wlan/wlanmodule.cpp7
-rw-r--r--noncore/settings/networksettings/interfacesetupimp.cpp2
-rw-r--r--noncore/settings/networksettings/interfacesetupimp.h2
-rw-r--r--noncore/settings/networksettings/mainwindowimp.cpp13
-rw-r--r--noncore/settings/networksettings/networksetup.pro6
-rw-r--r--noncore/settings/networksettings/wlan/wlan.pro6
-rw-r--r--noncore/settings/networksettings/wlan/wlanimp.cpp9
-rw-r--r--noncore/settings/networksettings/wlan/wlanimp.h3
-rw-r--r--noncore/settings/networksettings/wlan/wlanmodule.cpp7
16 files changed, 38 insertions, 58 deletions
diff --git a/noncore/net/networksetup/interfacesetupimp.cpp b/noncore/net/networksetup/interfacesetupimp.cpp
index 1327726..a8731a9 100644
--- a/noncore/net/networksetup/interfacesetupimp.cpp
+++ b/noncore/net/networksetup/interfacesetupimp.cpp
@@ -29,25 +29,25 @@ InterfaceSetupImp::InterfaceSetupImp(QWidget* parent, const char* name, Interfac
leaseTime->hide();
leaseHoursLabel->hide();
}
}
/**
* Save the current settings, then write out the interfaces file and close.
*/
void InterfaceSetupImp::accept(){
if(!saveSettings())
return;
interfaces->write();
- close(true);
+ QDialog::accept();
}
/**
* Save the settings for the current Interface.
* @return bool true if successfull, false otherwise
*/
bool InterfaceSetupImp::saveSettings(){
// eh can't really do anything about it other then return. :-D
if(!interfaces->isInterfaceSet())
return true;
bool error = false;
diff --git a/noncore/net/networksetup/interfacesetupimp.h b/noncore/net/networksetup/interfacesetupimp.h
index 7df0d46..a0bec32 100644
--- a/noncore/net/networksetup/interfacesetupimp.h
+++ b/noncore/net/networksetup/interfacesetupimp.h
@@ -2,25 +2,25 @@
#define INTERFACESETUPIMP_H
#include "interfacesetup.h"
class Interface;
class Interfaces;
class InterfaceSetupImp : public InterfaceSetup {
Q_OBJECT
public:
InterfaceSetupImp( QWidget* parent = 0, const char* name = 0, Interface *i=0, bool modal = FALSE, WFlags fl = 0);
-
+
protected slots:
void accept();
public slots:
void setProfile(const QString &profile);
private:
bool saveSettings();
Interfaces *interfaces;
Interface *interface;
};
diff --git a/noncore/net/networksetup/mainwindowimp.cpp b/noncore/net/networksetup/mainwindowimp.cpp
index c86acdc..4a088cb 100644
--- a/noncore/net/networksetup/mainwindowimp.cpp
+++ b/noncore/net/networksetup/mainwindowimp.cpp
@@ -69,44 +69,44 @@ MainWindowImp::MainWindowImp(QWidget *parent, const char *name) : MainWindow(par
currentProfileLabel->setText(line);
break;
}
}
file.close();
}
}
/**
* Deconstructor. Save profiles. Delete loaded libraries.
*/
MainWindowImp::~MainWindowImp(){
- qDebug("start Saving mainwindow");
+ qDebug("Deleting main window");
// Save profiles.
Config cfg("NetworkSetup");
cfg.setGroup("General");
cfg.writeEntry("Profiles", profiles.join(" "));
// Delete all interfaces that don't have owners.
QMap<Interface*, QListViewItem*>::Iterator iIt;
for( iIt = items.begin(); iIt != items.end(); ++iIt ){
if(iIt.key()->getModuleOwner() == NULL)
delete iIt.key();
}
-
+
// Delete Modules and Libraries
QMap<Module*, QLibrary*>::Iterator it;
for( it = libraries.begin(); it != libraries.end(); ++it ){
delete it.key();
- delete it.data();
+ //delete it.data();
}
- qDebug("done Saving mainwindow");
+ qDebug("Done deleting main window");
}
/**
* Load all modules that are found in the path
* @param path a directory that is scaned for any plugins that can be loaded
* and attempts to load them
*/
void MainWindowImp::loadModules(QString path){
//qDebug(path.latin1());
QDir d(path);
if(!d.exists())
return;
@@ -235,36 +235,35 @@ void MainWindowImp::configureClicked(){
QString currentProfile = currentProfileLabel->text();
if(profilesList->count() <= 1 || currentProfile == "All"){
currentProfile = "";
}
Interface *i = interfaceItems[item];
if(i->getModuleOwner()){
i->getModuleOwner()->setProfile(currentProfile);
QTabWidget *tabWidget = NULL;
QWidget *moduleConfigure = i->getModuleOwner()->configure(i, &tabWidget);
if(moduleConfigure != NULL){
if(tabWidget != NULL){
- InterfaceSetupImp *configure = new InterfaceSetupImp(tabWidget, "InterfaceSetupImp", i, true);
+ InterfaceSetupImp *configure = new InterfaceSetupImp(tabWidget, "InterfaceSetupImp", i, false, Qt::WDestructiveClose);
configure->setProfile(currentProfile);
tabWidget->insertTab(configure, "TCP/IP");
-
}
moduleConfigure->showMaximized();
moduleConfigure->show();
return;
}
}
- InterfaceSetupImp *configure = new InterfaceSetupImp(0, "InterfaceSetupImp", i, true);
+ InterfaceSetupImp *configure = new InterfaceSetupImp(0, "InterfaceSetupImp", i, false, Qt::WDestructiveClose);
configure->setProfile(currentProfile);
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 with a empty
* tab. If tab is !NULL then append the interfaces setup widget to it.
*/
void MainWindowImp::informationClicked(){
diff --git a/noncore/net/networksetup/networksetup.pro b/noncore/net/networksetup/networksetup.pro
index f09db93..7299cc6 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
+CONFIG = qt warn_on debug
+#CONFIG = qt warn_on release
HEADERS = mainwindowimp.h addconnectionimp.h interface.h interfaceinformationimp.h interfacesetupimp.h interfaces.h defaultmodule.h kprocctrl.h module.h kprocess.h
SOURCES = main.cpp mainwindowimp.cpp addconnectionimp.cpp interface.cpp interfaceinformationimp.cpp interfacesetupimp.cpp kprocctrl.cpp kprocess.cpp interfaces.cpp
INCLUDEPATH += $(OPIEDIR)/include
DEPENDPATH += $(OPIEDIR)/include
LIBS += -lqpe
INTERFACES = mainwindow.ui addconnection.ui interfaceinformation.ui interfaceadvanced.ui interfacesetup.ui
TARGET = networksetup
diff --git a/noncore/net/networksetup/wlan/wlan.pro b/noncore/net/networksetup/wlan/wlan.pro
index 432a096..814a0b4 100644
--- a/noncore/net/networksetup/wlan/wlan.pro
+++ b/noncore/net/networksetup/wlan/wlan.pro
@@ -1,12 +1,12 @@
TEMPLATE = lib
-CONFIG += qt warn_on release
-#CONFIG += qt warn_on debug
-DESTDIR = $(OPIEDIR)/plugins/networksetup
+#CONFIG += qt warn_on release
+CONFIG += qt warn_on debug
+#DESTDIR = $(OPIEDIR)/plugins/networksetup
HEADERS = wlanimp.h wlanmodule.h wextensions.h
SOURCES = wlanimp.cpp wlanmodule.cpp wextensions.cpp
INCLUDEPATH += $(OPIEDIR)/include ../
DEPENDPATH += $(OPIEDIR)/include
LIBS += -lqpe
INTERFACES = wlan.ui info.ui
TARGET = wlanplugin
VERSION = 1.0.0
diff --git a/noncore/net/networksetup/wlan/wlanimp.cpp b/noncore/net/networksetup/wlan/wlanimp.cpp
index 94c7518..45952b9 100644
--- a/noncore/net/networksetup/wlan/wlanimp.cpp
+++ b/noncore/net/networksetup/wlan/wlanimp.cpp
@@ -7,25 +7,25 @@
/* system() */
#include <stdlib.h>
#include <qfile.h>
#include <qdir.h>
#include <qtextstream.h>
#include <qmessagebox.h>
#include <qlineedit.h>
#include <qspinbox.h>
#include <qradiobutton.h>
#include <qcheckbox.h>
#include <qregexp.h>
-WLANImp::WLANImp( QWidget* parent, const char* name):WLAN(parent, name, Qt::WDestructiveClose){
+WLANImp::WLANImp( QWidget* parent, const char* name, bool modal, WFlags fl):WLAN(parent, name, modal, fl){
config = new Config("wireless");
readConfig();
}
WLANImp::~WLANImp( ){
delete config;
}
void WLANImp::readConfig()
{
qWarning( "WLANImp::readConfig() called." );
config->setGroup( "Properties" );
@@ -92,41 +92,36 @@ bool WLANImp::writeConfig()
config->writeEntry( "dot11WEPDefaultKeyID", 0 );
} else if( keyRadio1->isChecked() ){
config->writeEntry( "dot11WEPDefaultKeyID", 1 );
} else if( keyRadio2->isChecked() ){
config->writeEntry( "dot11WEPDefaultKeyID", 2 );
} else if( keyRadio3->isChecked() ){
config->writeEntry( "dot11WEPDefaultKeyID", 3 );
}
config->writeEntry( "dot11WEPDefaultKey0", keyLineEdit0->text() );
config->writeEntry( "dot11WEPDefaultKey1", keyLineEdit1->text() );
config->writeEntry( "dot11WEPDefaultKey2", keyLineEdit2->text() );
config->writeEntry( "dot11WEPDefaultKey3", keyLineEdit3->text() );
+ return true;
return writeWirelessOpts( );
}
/**
*/
void WLANImp::accept()
{
if ( writeConfig() )
QDialog::accept();
}
-void WLANImp::done ( int r )
-{
- QDialog::done ( r );
- close ( );
-}
-
bool WLANImp::writeWirelessOpts( QString scheme )
{
qWarning( "WLANImp::writeWirelessOpts entered." );
QString prev = "/etc/pcmcia/wireless.opts";
QFile prevFile(prev);
if ( !prevFile.open( IO_ReadOnly ) )
return false;
QString tmp = "/etc/pcmcia/wireless.opts-qpe-new";
QFile tmpFile(tmp);
if ( !tmpFile.open( IO_WriteOnly ) )
return false;
diff --git a/noncore/net/networksetup/wlan/wlanimp.h b/noncore/net/networksetup/wlan/wlanimp.h
index 22ce143..59b7c59 100644
--- a/noncore/net/networksetup/wlan/wlanimp.h
+++ b/noncore/net/networksetup/wlan/wlanimp.h
@@ -1,28 +1,27 @@
#ifndef WLANIMP_H
#define WLANIMP_H
#include "wlan.h"
#include <qpe/config.h>
class WLANImp : public WLAN {
Q_OBJECT
public:
- WLANImp( QWidget* parent = 0, const char* name = 0);
+ WLANImp( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
~WLANImp( );
protected:
void accept();
- void done ( int r );
private:
void readConfig();
bool writeConfig();
bool writeWirelessOpts( QString scheme = "*" );
bool writeWlanngOpts( QString scheme = "*" );
Config* config;
};
#endif
diff --git a/noncore/net/networksetup/wlan/wlanmodule.cpp b/noncore/net/networksetup/wlan/wlanmodule.cpp
index 7507c54..3363b8a 100644
--- a/noncore/net/networksetup/wlan/wlanmodule.cpp
+++ b/noncore/net/networksetup/wlan/wlanmodule.cpp
@@ -6,24 +6,25 @@
#include <qlabel.h>
#include <qprogressbar.h>
/**
* Constructor, find all of the possible interfaces
*/
WLANModule::WLANModule() : Module() {
}
/**
*/
WLANModule::~WLANModule(){
+ qDebug("Deleting module");
Interface *i;
for ( i=list.first(); i != 0; i=list.next() )
delete i;
}
/**
* Change the current profile
*/
void WLANModule::setProfile(QString newProfile){
profile = newProfile;
}
@@ -48,25 +49,25 @@ bool WLANModule::isOwner(Interface *i){
i->setHardwareName("802.11b");
list.append(i);
return true;
}
/**
* Create, set tabWiget and return the WLANConfigure Module
* @param tabWidget a pointer to the tab widget that this configure has.
* @return QWidget* pointer to the tab widget in this modules configure.
*/
QWidget *WLANModule::configure(Interface *, QTabWidget **tabWidget){
- WLANImp *wlanconfig = new WLANImp(0, "WlanConfig");
+ WLANImp *wlanconfig = new WLANImp(0, "WlanConfig", false, Qt::WDestructiveClose);
(*tabWidget) = wlanconfig->tabWidget;
return wlanconfig;
}
/**
* Create, set tabWiget and return the Information Module
* @param tabWidget a pointer to the tab widget that this information has.
* @return QWidget* pointer to the tab widget in this modules info.
*/
QWidget *WLANModule::information(Interface *i, QTabWidget **tabWidget){
WExtensions we(i->getInterfaceName());
if(!we.doesHaveWirelessExtensions())
@@ -79,28 +80,24 @@ QWidget *WLANModule::information(Interface *i, QTabWidget **tabWidget){
info->apLabel->setText(we.ap());
info->stationLabel->setText(we.station());
info->modeLabel->setText(we.mode());
info->freqLabel->setText(QString("%1 GHz").arg(we.frequency()));
int signal = 0;
int noise = 0;
int quality = 0;
we.stats(signal, noise, quality);
info->signalProgressBar->setProgress(signal);
info->noiseProgressBar->setProgress(noise);
info->qualityProgressBar->setProgress(quality);
info->rateLabel->setText(QString("%1 Mb/s").arg(we.rate()));
- //WlanInfo info (0, "wireless info", true);
- //info.show();
- //return NULL;
-
return info;
}
/**
* Get all active (up or down) interfaces
* @return QList<Interface> A list of interfaces that exsist that havn't
* been called by isOwner()
*/
QList<Interface> WLANModule::getInterfaces(){
return list;
}
diff --git a/noncore/settings/networksettings/interfacesetupimp.cpp b/noncore/settings/networksettings/interfacesetupimp.cpp
index 1327726..a8731a9 100644
--- a/noncore/settings/networksettings/interfacesetupimp.cpp
+++ b/noncore/settings/networksettings/interfacesetupimp.cpp
@@ -29,25 +29,25 @@ InterfaceSetupImp::InterfaceSetupImp(QWidget* parent, const char* name, Interfac
leaseTime->hide();
leaseHoursLabel->hide();
}
}
/**
* Save the current settings, then write out the interfaces file and close.
*/
void InterfaceSetupImp::accept(){
if(!saveSettings())
return;
interfaces->write();
- close(true);
+ QDialog::accept();
}
/**
* Save the settings for the current Interface.
* @return bool true if successfull, false otherwise
*/
bool InterfaceSetupImp::saveSettings(){
// eh can't really do anything about it other then return. :-D
if(!interfaces->isInterfaceSet())
return true;
bool error = false;
diff --git a/noncore/settings/networksettings/interfacesetupimp.h b/noncore/settings/networksettings/interfacesetupimp.h
index 7df0d46..a0bec32 100644
--- a/noncore/settings/networksettings/interfacesetupimp.h
+++ b/noncore/settings/networksettings/interfacesetupimp.h
@@ -2,25 +2,25 @@
#define INTERFACESETUPIMP_H
#include "interfacesetup.h"
class Interface;
class Interfaces;
class InterfaceSetupImp : public InterfaceSetup {
Q_OBJECT
public:
InterfaceSetupImp( QWidget* parent = 0, const char* name = 0, Interface *i=0, bool modal = FALSE, WFlags fl = 0);
-
+
protected slots:
void accept();
public slots:
void setProfile(const QString &profile);
private:
bool saveSettings();
Interfaces *interfaces;
Interface *interface;
};
diff --git a/noncore/settings/networksettings/mainwindowimp.cpp b/noncore/settings/networksettings/mainwindowimp.cpp
index c86acdc..4a088cb 100644
--- a/noncore/settings/networksettings/mainwindowimp.cpp
+++ b/noncore/settings/networksettings/mainwindowimp.cpp
@@ -69,44 +69,44 @@ MainWindowImp::MainWindowImp(QWidget *parent, const char *name) : MainWindow(par
currentProfileLabel->setText(line);
break;
}
}
file.close();
}
}
/**
* Deconstructor. Save profiles. Delete loaded libraries.
*/
MainWindowImp::~MainWindowImp(){
- qDebug("start Saving mainwindow");
+ qDebug("Deleting main window");
// Save profiles.
Config cfg("NetworkSetup");
cfg.setGroup("General");
cfg.writeEntry("Profiles", profiles.join(" "));
// Delete all interfaces that don't have owners.
QMap<Interface*, QListViewItem*>::Iterator iIt;
for( iIt = items.begin(); iIt != items.end(); ++iIt ){
if(iIt.key()->getModuleOwner() == NULL)
delete iIt.key();
}
-
+
// Delete Modules and Libraries
QMap<Module*, QLibrary*>::Iterator it;
for( it = libraries.begin(); it != libraries.end(); ++it ){
delete it.key();
- delete it.data();
+ //delete it.data();
}
- qDebug("done Saving mainwindow");
+ qDebug("Done deleting main window");
}
/**
* Load all modules that are found in the path
* @param path a directory that is scaned for any plugins that can be loaded
* and attempts to load them
*/
void MainWindowImp::loadModules(QString path){
//qDebug(path.latin1());
QDir d(path);
if(!d.exists())
return;
@@ -235,36 +235,35 @@ void MainWindowImp::configureClicked(){
QString currentProfile = currentProfileLabel->text();
if(profilesList->count() <= 1 || currentProfile == "All"){
currentProfile = "";
}
Interface *i = interfaceItems[item];
if(i->getModuleOwner()){
i->getModuleOwner()->setProfile(currentProfile);
QTabWidget *tabWidget = NULL;
QWidget *moduleConfigure = i->getModuleOwner()->configure(i, &tabWidget);
if(moduleConfigure != NULL){
if(tabWidget != NULL){
- InterfaceSetupImp *configure = new InterfaceSetupImp(tabWidget, "InterfaceSetupImp", i, true);
+ InterfaceSetupImp *configure = new InterfaceSetupImp(tabWidget, "InterfaceSetupImp", i, false, Qt::WDestructiveClose);
configure->setProfile(currentProfile);
tabWidget->insertTab(configure, "TCP/IP");
-
}
moduleConfigure->showMaximized();
moduleConfigure->show();
return;
}
}
- InterfaceSetupImp *configure = new InterfaceSetupImp(0, "InterfaceSetupImp", i, true);
+ InterfaceSetupImp *configure = new InterfaceSetupImp(0, "InterfaceSetupImp", i, false, Qt::WDestructiveClose);
configure->setProfile(currentProfile);
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 with a empty
* tab. If tab is !NULL then append the interfaces setup widget to it.
*/
void MainWindowImp::informationClicked(){
diff --git a/noncore/settings/networksettings/networksetup.pro b/noncore/settings/networksettings/networksetup.pro
index f09db93..7299cc6 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
+CONFIG = qt warn_on debug
+#CONFIG = qt warn_on release
HEADERS = mainwindowimp.h addconnectionimp.h interface.h interfaceinformationimp.h interfacesetupimp.h interfaces.h defaultmodule.h kprocctrl.h module.h kprocess.h
SOURCES = main.cpp mainwindowimp.cpp addconnectionimp.cpp interface.cpp interfaceinformationimp.cpp interfacesetupimp.cpp kprocctrl.cpp kprocess.cpp interfaces.cpp
INCLUDEPATH += $(OPIEDIR)/include
DEPENDPATH += $(OPIEDIR)/include
LIBS += -lqpe
INTERFACES = mainwindow.ui addconnection.ui interfaceinformation.ui interfaceadvanced.ui interfacesetup.ui
TARGET = networksetup
diff --git a/noncore/settings/networksettings/wlan/wlan.pro b/noncore/settings/networksettings/wlan/wlan.pro
index 432a096..814a0b4 100644
--- a/noncore/settings/networksettings/wlan/wlan.pro
+++ b/noncore/settings/networksettings/wlan/wlan.pro
@@ -1,12 +1,12 @@
TEMPLATE = lib
-CONFIG += qt warn_on release
-#CONFIG += qt warn_on debug
-DESTDIR = $(OPIEDIR)/plugins/networksetup
+#CONFIG += qt warn_on release
+CONFIG += qt warn_on debug
+#DESTDIR = $(OPIEDIR)/plugins/networksetup
HEADERS = wlanimp.h wlanmodule.h wextensions.h
SOURCES = wlanimp.cpp wlanmodule.cpp wextensions.cpp
INCLUDEPATH += $(OPIEDIR)/include ../
DEPENDPATH += $(OPIEDIR)/include
LIBS += -lqpe
INTERFACES = wlan.ui info.ui
TARGET = wlanplugin
VERSION = 1.0.0
diff --git a/noncore/settings/networksettings/wlan/wlanimp.cpp b/noncore/settings/networksettings/wlan/wlanimp.cpp
index 94c7518..45952b9 100644
--- a/noncore/settings/networksettings/wlan/wlanimp.cpp
+++ b/noncore/settings/networksettings/wlan/wlanimp.cpp
@@ -7,25 +7,25 @@
/* system() */
#include <stdlib.h>
#include <qfile.h>
#include <qdir.h>
#include <qtextstream.h>
#include <qmessagebox.h>
#include <qlineedit.h>
#include <qspinbox.h>
#include <qradiobutton.h>
#include <qcheckbox.h>
#include <qregexp.h>
-WLANImp::WLANImp( QWidget* parent, const char* name):WLAN(parent, name, Qt::WDestructiveClose){
+WLANImp::WLANImp( QWidget* parent, const char* name, bool modal, WFlags fl):WLAN(parent, name, modal, fl){
config = new Config("wireless");
readConfig();
}
WLANImp::~WLANImp( ){
delete config;
}
void WLANImp::readConfig()
{
qWarning( "WLANImp::readConfig() called." );
config->setGroup( "Properties" );
@@ -92,41 +92,36 @@ bool WLANImp::writeConfig()
config->writeEntry( "dot11WEPDefaultKeyID", 0 );
} else if( keyRadio1->isChecked() ){
config->writeEntry( "dot11WEPDefaultKeyID", 1 );
} else if( keyRadio2->isChecked() ){
config->writeEntry( "dot11WEPDefaultKeyID", 2 );
} else if( keyRadio3->isChecked() ){
config->writeEntry( "dot11WEPDefaultKeyID", 3 );
}
config->writeEntry( "dot11WEPDefaultKey0", keyLineEdit0->text() );
config->writeEntry( "dot11WEPDefaultKey1", keyLineEdit1->text() );
config->writeEntry( "dot11WEPDefaultKey2", keyLineEdit2->text() );
config->writeEntry( "dot11WEPDefaultKey3", keyLineEdit3->text() );
+ return true;
return writeWirelessOpts( );
}
/**
*/
void WLANImp::accept()
{
if ( writeConfig() )
QDialog::accept();
}
-void WLANImp::done ( int r )
-{
- QDialog::done ( r );
- close ( );
-}
-
bool WLANImp::writeWirelessOpts( QString scheme )
{
qWarning( "WLANImp::writeWirelessOpts entered." );
QString prev = "/etc/pcmcia/wireless.opts";
QFile prevFile(prev);
if ( !prevFile.open( IO_ReadOnly ) )
return false;
QString tmp = "/etc/pcmcia/wireless.opts-qpe-new";
QFile tmpFile(tmp);
if ( !tmpFile.open( IO_WriteOnly ) )
return false;
diff --git a/noncore/settings/networksettings/wlan/wlanimp.h b/noncore/settings/networksettings/wlan/wlanimp.h
index 22ce143..59b7c59 100644
--- a/noncore/settings/networksettings/wlan/wlanimp.h
+++ b/noncore/settings/networksettings/wlan/wlanimp.h
@@ -1,28 +1,27 @@
#ifndef WLANIMP_H
#define WLANIMP_H
#include "wlan.h"
#include <qpe/config.h>
class WLANImp : public WLAN {
Q_OBJECT
public:
- WLANImp( QWidget* parent = 0, const char* name = 0);
+ WLANImp( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
~WLANImp( );
protected:
void accept();
- void done ( int r );
private:
void readConfig();
bool writeConfig();
bool writeWirelessOpts( QString scheme = "*" );
bool writeWlanngOpts( QString scheme = "*" );
Config* config;
};
#endif
diff --git a/noncore/settings/networksettings/wlan/wlanmodule.cpp b/noncore/settings/networksettings/wlan/wlanmodule.cpp
index 7507c54..3363b8a 100644
--- a/noncore/settings/networksettings/wlan/wlanmodule.cpp
+++ b/noncore/settings/networksettings/wlan/wlanmodule.cpp
@@ -6,24 +6,25 @@
#include <qlabel.h>
#include <qprogressbar.h>
/**
* Constructor, find all of the possible interfaces
*/
WLANModule::WLANModule() : Module() {
}
/**
*/
WLANModule::~WLANModule(){
+ qDebug("Deleting module");
Interface *i;
for ( i=list.first(); i != 0; i=list.next() )
delete i;
}
/**
* Change the current profile
*/
void WLANModule::setProfile(QString newProfile){
profile = newProfile;
}
@@ -48,25 +49,25 @@ bool WLANModule::isOwner(Interface *i){
i->setHardwareName("802.11b");
list.append(i);
return true;
}
/**
* Create, set tabWiget and return the WLANConfigure Module
* @param tabWidget a pointer to the tab widget that this configure has.
* @return QWidget* pointer to the tab widget in this modules configure.
*/
QWidget *WLANModule::configure(Interface *, QTabWidget **tabWidget){
- WLANImp *wlanconfig = new WLANImp(0, "WlanConfig");
+ WLANImp *wlanconfig = new WLANImp(0, "WlanConfig", false, Qt::WDestructiveClose);
(*tabWidget) = wlanconfig->tabWidget;
return wlanconfig;
}
/**
* Create, set tabWiget and return the Information Module
* @param tabWidget a pointer to the tab widget that this information has.
* @return QWidget* pointer to the tab widget in this modules info.
*/
QWidget *WLANModule::information(Interface *i, QTabWidget **tabWidget){
WExtensions we(i->getInterfaceName());
if(!we.doesHaveWirelessExtensions())
@@ -79,28 +80,24 @@ QWidget *WLANModule::information(Interface *i, QTabWidget **tabWidget){
info->apLabel->setText(we.ap());
info->stationLabel->setText(we.station());
info->modeLabel->setText(we.mode());
info->freqLabel->setText(QString("%1 GHz").arg(we.frequency()));
int signal = 0;
int noise = 0;
int quality = 0;
we.stats(signal, noise, quality);
info->signalProgressBar->setProgress(signal);
info->noiseProgressBar->setProgress(noise);
info->qualityProgressBar->setProgress(quality);
info->rateLabel->setText(QString("%1 Mb/s").arg(we.rate()));
- //WlanInfo info (0, "wireless info", true);
- //info.show();
- //return NULL;
-
return info;
}
/**
* Get all active (up or down) interfaces
* @return QList<Interface> A list of interfaces that exsist that havn't
* been called by isOwner()
*/
QList<Interface> WLANModule::getInterfaces(){
return list;
}