summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/networksetup/interface.h1
-rw-r--r--noncore/net/networksetup/module.h9
-rw-r--r--noncore/net/networksetup/wlan/wlanimp.cpp40
-rw-r--r--noncore/net/networksetup/wlan/wlanmodule.cpp7
-rw-r--r--noncore/net/networksetup/wlan/wlanmodule.h4
-rw-r--r--noncore/settings/networksettings/interface.h1
-rw-r--r--noncore/settings/networksettings/module.h9
-rw-r--r--noncore/settings/networksettings/wlan/wlanimp.cpp40
-rw-r--r--noncore/settings/networksettings/wlan/wlanmodule.cpp7
-rw-r--r--noncore/settings/networksettings/wlan/wlanmodule.h4
10 files changed, 76 insertions, 46 deletions
diff --git a/noncore/net/networksetup/interface.h b/noncore/net/networksetup/interface.h
index 7943fd6..dc9c6d3 100644
--- a/noncore/net/networksetup/interface.h
+++ b/noncore/net/networksetup/interface.h
@@ -50,7 +50,6 @@ private:
// Interface information
bool status;
bool attached;
- QString interfaceName;
QString hardwareName;
Module *moduleOwner;
diff --git a/noncore/net/networksetup/module.h b/noncore/net/networksetup/module.h
index 0c81928..a30f492 100644
--- a/noncore/net/networksetup/module.h
+++ b/noncore/net/networksetup/module.h
@@ -16,7 +16,14 @@ signals:
public:
Module(){};
-
+
+ /**
+ * The current profile has been changed and the module should do any
+ * neccesary changes also.
+ * @param newProfile what the profile should be changed to.
+ */
+ virtual void setProfile(QString newProfile) = 0;
+
/**
* get the icon name for this device.
* @param Interface* can be used in determining the icon.
diff --git a/noncore/net/networksetup/wlan/wlanimp.cpp b/noncore/net/networksetup/wlan/wlanimp.cpp
index 806643d..74eef5f 100644
--- a/noncore/net/networksetup/wlan/wlanimp.cpp
+++ b/noncore/net/networksetup/wlan/wlanimp.cpp
@@ -26,35 +26,35 @@ void WLANImp::readConfig()
config.setGroup( "Properties" );
QString ssid = config.readEntry( "SSID", "any" );
if( ssid == "any" || ssid == "ANY" ){
- essNon->setChecked( TRUE );
+ essNon->setChecked( true );
} else {
- essSpecific->setChecked( TRUE );
+ essSpecific->setChecked( true );
essSpecificLineEdit->setText( ssid );
}
QString mode = config.readEntry( "Mode", "Managed" );
if( mode == "adhoc" ) {
- network802->setChecked( TRUE );
+ network802->setChecked( true );
} else {
- networkInfrastructure->setChecked( TRUE );
+ networkInfrastructure->setChecked( true );
}
networkChannel->setValue( config.readNumEntry( "CHANNEL", 1 ) );
// config.readEntry( "RATE", "auto" );
- config.readEntry( "dot11PrivacyInvoked" ) == "true" ? wepEnabled->setChecked( TRUE ) : wepEnabled->setChecked( FALSE );
+ config.readEntry( "dot11PrivacyInvoked" ) == "true" ? wepEnabled->setChecked( true ) : wepEnabled->setChecked( false );
config.readEntry( "AuthType", "opensystem" );
- config.readEntry( "PRIV_KEY128", "false" ) == "false" ? key40->setChecked( TRUE ) : key128->setChecked( TRUE );
+ config.readEntry( "PRIV_KEY128", "false" ) == "false" ? key40->setChecked( true ) : key128->setChecked( true );
int defaultkey = config.readNumEntry( "dot11WEPDefaultKeyID", 0 );
switch( defaultkey ){
case 0:
- keyRadio0->setChecked( TRUE );
+ keyRadio0->setChecked( true );
break;
case 1:
- keyRadio1->setChecked( TRUE );
+ keyRadio1->setChecked( true );
break;
case 2:
- keyRadio2->setChecked( TRUE );
+ keyRadio2->setChecked( true );
break;
case 3:
- keyRadio3->setChecked( TRUE );
+ keyRadio3->setChecked( true );
break;
}
keyLineEdit0->setText(config.readEntry( "dot11WEPDefaultKey0" ));
@@ -97,7 +97,7 @@ bool WLANImp::writeConfig()
config.writeEntry( "dot11WEPDefaultKey2", keyLineEdit2->text() );
config.writeEntry( "dot11WEPDefaultKey3", keyLineEdit3->text() );
return writeWirelessOpts( config );
-// return TRUE;
+// return true;
}
/**
@@ -120,14 +120,14 @@ bool WLANImp::writeWirelessOpts( Config &config, QString scheme )
QString prev = "/etc/pcmcia/wireless.opts";
QFile prevFile(prev);
if ( !prevFile.open( IO_ReadOnly ) )
- return FALSE;
+ return false;
QString tmp = "/etc/pcmcia/wireless.opts-qpe-new";
QFile tmpFile(tmp);
if ( !tmpFile.open( IO_WriteOnly ) )
- return FALSE;
+ return false;
- bool retval = TRUE;
+ bool retval = true;
QTextStream in( &prevFile );
QTextStream out( &tmpFile );
@@ -135,8 +135,8 @@ bool WLANImp::writeWirelessOpts( Config &config, QString scheme )
config.setGroup("Properties");
QString line;
- bool found=FALSE;
- bool done=FALSE;
+ bool found=false;
+ bool done=false;
while ( !in.atEnd() ) {
QString line = in.readLine();
QString wline = line.simplifyWhiteSpace();
@@ -144,14 +144,14 @@ bool WLANImp::writeWirelessOpts( Config &config, QString scheme )
if ( found ) {
// skip existing entry for this scheme, and write our own.
if ( wline == ";;" ) {
- found = FALSE;
+ found = false;
continue;
} else {
continue;
}
} else {
if ( wline.left(scheme.length()+7) == scheme + ",*,*,*)" ) {
- found=TRUE;
+ found=true;
continue; // skip this line
} else if ( wline == "esac" || wline == "*,*,*,*)" ) {
// end - add new entry
@@ -201,7 +201,7 @@ bool WLANImp::writeWirelessOpts( Config &config, QString scheme )
++f;
}
out << " ;;\n";
- done = TRUE;
+ done = true;
}
}
}
@@ -221,7 +221,7 @@ bool WLANImp::writeWirelessOpts( Config &config, QString scheme )
system(QString("%1/pcmcia stop").arg(initpath));
if( system( "mv " + tmp + " " + prev ) )
- retval = FALSE;
+ retval = false;
//#ifdef USE_SCHEMES
// if ( retval )
// SchemeChanger::changeScheme(scheme);
diff --git a/noncore/net/networksetup/wlan/wlanmodule.cpp b/noncore/net/networksetup/wlan/wlanmodule.cpp
index f0394b4..9d34d75 100644
--- a/noncore/net/networksetup/wlan/wlanmodule.cpp
+++ b/noncore/net/networksetup/wlan/wlanmodule.cpp
@@ -10,6 +10,13 @@ WLANModule::WLANModule() : Module() {
}
/**
+ * Change the current profile
+ */
+void WLANModule::setProfile(QString newProfile){
+ profile = newProfile;
+}
+
+/**
* get the icon name for this device.
* @param Interface* can be used in determining the icon.
* @return QString the icon name (minus .png, .gif etc)
diff --git a/noncore/net/networksetup/wlan/wlanmodule.h b/noncore/net/networksetup/wlan/wlanmodule.h
index 7ebe129..833d4b1 100644
--- a/noncore/net/networksetup/wlan/wlanmodule.h
+++ b/noncore/net/networksetup/wlan/wlanmodule.h
@@ -11,6 +11,7 @@ signals:
public:
WLANModule();
+ virtual void setProfile(QString newProfile);
virtual bool isOwner(Interface *);
virtual QWidget *configure(QTabWidget **tabWidget);
virtual QWidget *information(QTabWidget **tabWidget);
@@ -22,7 +23,8 @@ public:
private:
QList<Interface> list;
-
+ QString profile;
+
};
extern "C"
diff --git a/noncore/settings/networksettings/interface.h b/noncore/settings/networksettings/interface.h
index 7943fd6..dc9c6d3 100644
--- a/noncore/settings/networksettings/interface.h
+++ b/noncore/settings/networksettings/interface.h
@@ -50,7 +50,6 @@ private:
// Interface information
bool status;
bool attached;
- QString interfaceName;
QString hardwareName;
Module *moduleOwner;
diff --git a/noncore/settings/networksettings/module.h b/noncore/settings/networksettings/module.h
index 0c81928..a30f492 100644
--- a/noncore/settings/networksettings/module.h
+++ b/noncore/settings/networksettings/module.h
@@ -16,7 +16,14 @@ signals:
public:
Module(){};
-
+
+ /**
+ * The current profile has been changed and the module should do any
+ * neccesary changes also.
+ * @param newProfile what the profile should be changed to.
+ */
+ virtual void setProfile(QString newProfile) = 0;
+
/**
* get the icon name for this device.
* @param Interface* can be used in determining the icon.
diff --git a/noncore/settings/networksettings/wlan/wlanimp.cpp b/noncore/settings/networksettings/wlan/wlanimp.cpp
index 806643d..74eef5f 100644
--- a/noncore/settings/networksettings/wlan/wlanimp.cpp
+++ b/noncore/settings/networksettings/wlan/wlanimp.cpp
@@ -26,35 +26,35 @@ void WLANImp::readConfig()
config.setGroup( "Properties" );
QString ssid = config.readEntry( "SSID", "any" );
if( ssid == "any" || ssid == "ANY" ){
- essNon->setChecked( TRUE );
+ essNon->setChecked( true );
} else {
- essSpecific->setChecked( TRUE );
+ essSpecific->setChecked( true );
essSpecificLineEdit->setText( ssid );
}
QString mode = config.readEntry( "Mode", "Managed" );
if( mode == "adhoc" ) {
- network802->setChecked( TRUE );
+ network802->setChecked( true );
} else {
- networkInfrastructure->setChecked( TRUE );
+ networkInfrastructure->setChecked( true );
}
networkChannel->setValue( config.readNumEntry( "CHANNEL", 1 ) );
// config.readEntry( "RATE", "auto" );
- config.readEntry( "dot11PrivacyInvoked" ) == "true" ? wepEnabled->setChecked( TRUE ) : wepEnabled->setChecked( FALSE );
+ config.readEntry( "dot11PrivacyInvoked" ) == "true" ? wepEnabled->setChecked( true ) : wepEnabled->setChecked( false );
config.readEntry( "AuthType", "opensystem" );
- config.readEntry( "PRIV_KEY128", "false" ) == "false" ? key40->setChecked( TRUE ) : key128->setChecked( TRUE );
+ config.readEntry( "PRIV_KEY128", "false" ) == "false" ? key40->setChecked( true ) : key128->setChecked( true );
int defaultkey = config.readNumEntry( "dot11WEPDefaultKeyID", 0 );
switch( defaultkey ){
case 0:
- keyRadio0->setChecked( TRUE );
+ keyRadio0->setChecked( true );
break;
case 1:
- keyRadio1->setChecked( TRUE );
+ keyRadio1->setChecked( true );
break;
case 2:
- keyRadio2->setChecked( TRUE );
+ keyRadio2->setChecked( true );
break;
case 3:
- keyRadio3->setChecked( TRUE );
+ keyRadio3->setChecked( true );
break;
}
keyLineEdit0->setText(config.readEntry( "dot11WEPDefaultKey0" ));
@@ -97,7 +97,7 @@ bool WLANImp::writeConfig()
config.writeEntry( "dot11WEPDefaultKey2", keyLineEdit2->text() );
config.writeEntry( "dot11WEPDefaultKey3", keyLineEdit3->text() );
return writeWirelessOpts( config );
-// return TRUE;
+// return true;
}
/**
@@ -120,14 +120,14 @@ bool WLANImp::writeWirelessOpts( Config &config, QString scheme )
QString prev = "/etc/pcmcia/wireless.opts";
QFile prevFile(prev);
if ( !prevFile.open( IO_ReadOnly ) )
- return FALSE;
+ return false;
QString tmp = "/etc/pcmcia/wireless.opts-qpe-new";
QFile tmpFile(tmp);
if ( !tmpFile.open( IO_WriteOnly ) )
- return FALSE;
+ return false;
- bool retval = TRUE;
+ bool retval = true;
QTextStream in( &prevFile );
QTextStream out( &tmpFile );
@@ -135,8 +135,8 @@ bool WLANImp::writeWirelessOpts( Config &config, QString scheme )
config.setGroup("Properties");
QString line;
- bool found=FALSE;
- bool done=FALSE;
+ bool found=false;
+ bool done=false;
while ( !in.atEnd() ) {
QString line = in.readLine();
QString wline = line.simplifyWhiteSpace();
@@ -144,14 +144,14 @@ bool WLANImp::writeWirelessOpts( Config &config, QString scheme )
if ( found ) {
// skip existing entry for this scheme, and write our own.
if ( wline == ";;" ) {
- found = FALSE;
+ found = false;
continue;
} else {
continue;
}
} else {
if ( wline.left(scheme.length()+7) == scheme + ",*,*,*)" ) {
- found=TRUE;
+ found=true;
continue; // skip this line
} else if ( wline == "esac" || wline == "*,*,*,*)" ) {
// end - add new entry
@@ -201,7 +201,7 @@ bool WLANImp::writeWirelessOpts( Config &config, QString scheme )
++f;
}
out << " ;;\n";
- done = TRUE;
+ done = true;
}
}
}
@@ -221,7 +221,7 @@ bool WLANImp::writeWirelessOpts( Config &config, QString scheme )
system(QString("%1/pcmcia stop").arg(initpath));
if( system( "mv " + tmp + " " + prev ) )
- retval = FALSE;
+ retval = false;
//#ifdef USE_SCHEMES
// if ( retval )
// SchemeChanger::changeScheme(scheme);
diff --git a/noncore/settings/networksettings/wlan/wlanmodule.cpp b/noncore/settings/networksettings/wlan/wlanmodule.cpp
index f0394b4..9d34d75 100644
--- a/noncore/settings/networksettings/wlan/wlanmodule.cpp
+++ b/noncore/settings/networksettings/wlan/wlanmodule.cpp
@@ -10,6 +10,13 @@ WLANModule::WLANModule() : Module() {
}
/**
+ * Change the current profile
+ */
+void WLANModule::setProfile(QString newProfile){
+ profile = newProfile;
+}
+
+/**
* get the icon name for this device.
* @param Interface* can be used in determining the icon.
* @return QString the icon name (minus .png, .gif etc)
diff --git a/noncore/settings/networksettings/wlan/wlanmodule.h b/noncore/settings/networksettings/wlan/wlanmodule.h
index 7ebe129..833d4b1 100644
--- a/noncore/settings/networksettings/wlan/wlanmodule.h
+++ b/noncore/settings/networksettings/wlan/wlanmodule.h
@@ -11,6 +11,7 @@ signals:
public:
WLANModule();
+ virtual void setProfile(QString newProfile);
virtual bool isOwner(Interface *);
virtual QWidget *configure(QTabWidget **tabWidget);
virtual QWidget *information(QTabWidget **tabWidget);
@@ -22,7 +23,8 @@ public:
private:
QList<Interface> list;
-
+ QString profile;
+
};
extern "C"