summaryrefslogtreecommitdiff
path: root/noncore
Side-by-side diff
Diffstat (limited to 'noncore') (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
@@ -52,3 +52,2 @@ private:
bool attached;
- QString interfaceName;
QString hardwareName;
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
@@ -18,3 +18,10 @@ 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;
+
/**
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
@@ -28,5 +28,5 @@ void WLANImp::readConfig()
if( ssid == "any" || ssid == "ANY" ){
- essNon->setChecked( TRUE );
+ essNon->setChecked( true );
} else {
- essSpecific->setChecked( TRUE );
+ essSpecific->setChecked( true );
essSpecificLineEdit->setText( ssid );
@@ -35,5 +35,5 @@ void WLANImp::readConfig()
if( mode == "adhoc" ) {
- network802->setChecked( TRUE );
+ network802->setChecked( true );
} else {
- networkInfrastructure->setChecked( TRUE );
+ networkInfrastructure->setChecked( true );
}
@@ -41,5 +41,5 @@ void WLANImp::readConfig()
// 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 );
@@ -47,12 +47,12 @@ void WLANImp::readConfig()
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;
@@ -99,3 +99,3 @@ bool WLANImp::writeConfig()
return writeWirelessOpts( config );
-// return TRUE;
+// return true;
}
@@ -122,3 +122,3 @@ bool WLANImp::writeWirelessOpts( Config &config, QString scheme )
if ( !prevFile.open( IO_ReadOnly ) )
- return FALSE;
+ return false;
@@ -127,5 +127,5 @@ bool WLANImp::writeWirelessOpts( Config &config, QString scheme )
if ( !tmpFile.open( IO_WriteOnly ) )
- return FALSE;
+ return false;
- bool retval = TRUE;
+ bool retval = true;
@@ -137,4 +137,4 @@ bool WLANImp::writeWirelessOpts( Config &config, QString scheme )
QString line;
- bool found=FALSE;
- bool done=FALSE;
+ bool found=false;
+ bool done=false;
while ( !in.atEnd() ) {
@@ -146,3 +146,3 @@ bool WLANImp::writeWirelessOpts( Config &config, QString scheme )
if ( wline == ";;" ) {
- found = FALSE;
+ found = false;
continue;
@@ -153,3 +153,3 @@ bool WLANImp::writeWirelessOpts( Config &config, QString scheme )
if ( wline.left(scheme.length()+7) == scheme + ",*,*,*)" ) {
- found=TRUE;
+ found=true;
continue; // skip this line
@@ -203,3 +203,3 @@ bool WLANImp::writeWirelessOpts( Config &config, QString scheme )
out << " ;;\n";
- done = TRUE;
+ done = true;
}
@@ -223,3 +223,3 @@ bool WLANImp::writeWirelessOpts( Config &config, QString scheme )
if( system( "mv " + tmp + " " + prev ) )
- retval = FALSE;
+ retval = false;
//#ifdef USE_SCHEMES
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
@@ -12,2 +12,9 @@ WLANModule::WLANModule() : Module() {
/**
+ * Change the current profile
+ */
+void WLANModule::setProfile(QString newProfile){
+ profile = newProfile;
+}
+
+/**
* get the icon name for this device.
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
@@ -13,2 +13,3 @@ public:
+ virtual void setProfile(QString newProfile);
virtual bool isOwner(Interface *);
@@ -24,3 +25,4 @@ private:
QList<Interface> list;
-
+ QString profile;
+
};
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
@@ -52,3 +52,2 @@ private:
bool attached;
- QString interfaceName;
QString hardwareName;
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
@@ -18,3 +18,10 @@ 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;
+
/**
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
@@ -28,5 +28,5 @@ void WLANImp::readConfig()
if( ssid == "any" || ssid == "ANY" ){
- essNon->setChecked( TRUE );
+ essNon->setChecked( true );
} else {
- essSpecific->setChecked( TRUE );
+ essSpecific->setChecked( true );
essSpecificLineEdit->setText( ssid );
@@ -35,5 +35,5 @@ void WLANImp::readConfig()
if( mode == "adhoc" ) {
- network802->setChecked( TRUE );
+ network802->setChecked( true );
} else {
- networkInfrastructure->setChecked( TRUE );
+ networkInfrastructure->setChecked( true );
}
@@ -41,5 +41,5 @@ void WLANImp::readConfig()
// 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 );
@@ -47,12 +47,12 @@ void WLANImp::readConfig()
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;
@@ -99,3 +99,3 @@ bool WLANImp::writeConfig()
return writeWirelessOpts( config );
-// return TRUE;
+// return true;
}
@@ -122,3 +122,3 @@ bool WLANImp::writeWirelessOpts( Config &config, QString scheme )
if ( !prevFile.open( IO_ReadOnly ) )
- return FALSE;
+ return false;
@@ -127,5 +127,5 @@ bool WLANImp::writeWirelessOpts( Config &config, QString scheme )
if ( !tmpFile.open( IO_WriteOnly ) )
- return FALSE;
+ return false;
- bool retval = TRUE;
+ bool retval = true;
@@ -137,4 +137,4 @@ bool WLANImp::writeWirelessOpts( Config &config, QString scheme )
QString line;
- bool found=FALSE;
- bool done=FALSE;
+ bool found=false;
+ bool done=false;
while ( !in.atEnd() ) {
@@ -146,3 +146,3 @@ bool WLANImp::writeWirelessOpts( Config &config, QString scheme )
if ( wline == ";;" ) {
- found = FALSE;
+ found = false;
continue;
@@ -153,3 +153,3 @@ bool WLANImp::writeWirelessOpts( Config &config, QString scheme )
if ( wline.left(scheme.length()+7) == scheme + ",*,*,*)" ) {
- found=TRUE;
+ found=true;
continue; // skip this line
@@ -203,3 +203,3 @@ bool WLANImp::writeWirelessOpts( Config &config, QString scheme )
out << " ;;\n";
- done = TRUE;
+ done = true;
}
@@ -223,3 +223,3 @@ bool WLANImp::writeWirelessOpts( Config &config, QString scheme )
if( system( "mv " + tmp + " " + prev ) )
- retval = FALSE;
+ retval = false;
//#ifdef USE_SCHEMES
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
@@ -12,2 +12,9 @@ WLANModule::WLANModule() : Module() {
/**
+ * Change the current profile
+ */
+void WLANModule::setProfile(QString newProfile){
+ profile = newProfile;
+}
+
+/**
* get the icon name for this device.
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
@@ -13,2 +13,3 @@ public:
+ virtual void setProfile(QString newProfile);
virtual bool isOwner(Interface *);
@@ -24,3 +25,4 @@ private:
QList<Interface> list;
-
+ QString profile;
+
};