summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/networksettings2/bluetooth/bluetoothBNEPrun.h4
-rw-r--r--noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMrun.h3
-rw-r--r--noncore/settings/networksettings2/bluetooth/bluetooth_NN.cpp13
-rw-r--r--noncore/settings/networksettings2/bluetooth/bluetooth_NN.h8
-rw-r--r--noncore/settings/networksettings2/cable/cable_NN.cpp9
-rw-r--r--noncore/settings/networksettings2/cable/cable_NN.h4
-rw-r--r--noncore/settings/networksettings2/cable/cablerun.h3
-rw-r--r--noncore/settings/networksettings2/irda/irda_NN.cpp9
-rw-r--r--noncore/settings/networksettings2/irda/irda_NN.h4
-rw-r--r--noncore/settings/networksettings2/irda/irdarun.h3
-rw-r--r--noncore/settings/networksettings2/lancard/lancard_NN.cpp11
-rw-r--r--noncore/settings/networksettings2/lancard/lancard_NN.h4
-rw-r--r--noncore/settings/networksettings2/lancard/lancard_NNI.cpp14
-rw-r--r--noncore/settings/networksettings2/lancard/lancard_NNI.h2
-rw-r--r--noncore/settings/networksettings2/lancard/lancardrun.cpp14
-rw-r--r--noncore/settings/networksettings2/lancard/lancardrun.h6
-rw-r--r--noncore/settings/networksettings2/modem/modem_NN.cpp9
-rw-r--r--noncore/settings/networksettings2/modem/modem_NN.h4
-rw-r--r--noncore/settings/networksettings2/modem/modemrun.h3
-rw-r--r--noncore/settings/networksettings2/network/network_NN.cpp11
-rw-r--r--noncore/settings/networksettings2/network/network_NN.h4
-rw-r--r--noncore/settings/networksettings2/network/network_NNI.cpp5
-rw-r--r--noncore/settings/networksettings2/network/networkedit.cpp6
-rw-r--r--noncore/settings/networksettings2/network/networkrun.cpp10
-rw-r--r--noncore/settings/networksettings2/network/networkrun.h3
-rw-r--r--noncore/settings/networksettings2/networksettings.cpp34
-rw-r--r--noncore/settings/networksettings2/networksettings2/netnode.h23
-rw-r--r--noncore/settings/networksettings2/networksettings2/system.cpp5
-rw-r--r--noncore/settings/networksettings2/networksettings2/systemfile.cpp49
-rw-r--r--noncore/settings/networksettings2/networksettings2/systemfile.h6
-rw-r--r--noncore/settings/networksettings2/nsdata.cpp178
-rw-r--r--noncore/settings/networksettings2/ppp/ppp_NN.cpp9
-rw-r--r--noncore/settings/networksettings2/ppp/ppp_NN.h4
-rw-r--r--noncore/settings/networksettings2/ppp/ppprun.cpp10
-rw-r--r--noncore/settings/networksettings2/ppp/ppprun.h8
-rw-r--r--noncore/settings/networksettings2/profile/profile_NN.cpp9
-rw-r--r--noncore/settings/networksettings2/profile/profile_NN.h4
-rw-r--r--noncore/settings/networksettings2/profile/profilerun.cpp20
-rw-r--r--noncore/settings/networksettings2/profile/profilerun.h3
-rw-r--r--noncore/settings/networksettings2/usb/usb_NN.cpp9
-rw-r--r--noncore/settings/networksettings2/usb/usb_NN.h4
-rw-r--r--noncore/settings/networksettings2/usb/usb_NNI.cpp11
-rw-r--r--noncore/settings/networksettings2/usb/usb_NNI.h1
-rw-r--r--noncore/settings/networksettings2/usb/usbrun.cpp21
-rw-r--r--noncore/settings/networksettings2/usb/usbrun.h5
-rw-r--r--noncore/settings/networksettings2/vpn/vpn_NN.cpp9
-rw-r--r--noncore/settings/networksettings2/vpn/vpn_NN.h4
-rw-r--r--noncore/settings/networksettings2/vpn/vpnrun.h2
-rw-r--r--noncore/settings/networksettings2/wlan/wlan_NN.cpp11
-rw-r--r--noncore/settings/networksettings2/wlan/wlan_NN.h4
-rw-r--r--noncore/settings/networksettings2/wlan/wlan_NNI.cpp12
-rw-r--r--noncore/settings/networksettings2/wlan/wlan_NNI.h2
-rw-r--r--noncore/settings/networksettings2/wlan/wlanrun.h4
53 files changed, 517 insertions, 110 deletions
diff --git a/noncore/settings/networksettings2/bluetooth/bluetoothBNEPrun.h b/noncore/settings/networksettings2/bluetooth/bluetoothBNEPrun.h
index e65b378..347da0c 100644
--- a/noncore/settings/networksettings2/bluetooth/bluetoothBNEPrun.h
+++ b/noncore/settings/networksettings2/bluetooth/bluetoothBNEPrun.h
@@ -10,12 +10,16 @@ public :
{ }
virtual long count( void )
{ return 3; }
virtual QString genNic( long nr )
{ QString S; return S.sprintf( "bnep%ld", nr ); }
+
+ virtual AsDevice * asDevice( void )
+ { return (AsDevice *)this; }
+
virtual AsDevice * device( void )
{ return asDevice(); }
protected :
void detectState( NodeCollection * )
diff --git a/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMrun.h b/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMrun.h
index 87116e2..6a7902a 100644
--- a/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMrun.h
+++ b/noncore/settings/networksettings2/bluetooth/bluetoothRFCOMMrun.h
@@ -6,12 +6,15 @@ class BluetoothRFCOMMRun : public AsLine {
public :
BluetoothRFCOMMRun( ANetNodeInstance * NNI,
BluetoothRFCOMMData & Data ) : AsLine( NNI )
{ }
+ virtual AsLine * asLine( void )
+ { return (AsLine *)this; }
+
protected :
void detectState( NodeCollection * )
{ }
bool setState( NodeCollection * , Action_t )
diff --git a/noncore/settings/networksettings2/bluetooth/bluetooth_NN.cpp b/noncore/settings/networksettings2/bluetooth/bluetooth_NN.cpp
index 91be153..47272c4 100644
--- a/noncore/settings/networksettings2/bluetooth/bluetooth_NN.cpp
+++ b/noncore/settings/networksettings2/bluetooth/bluetooth_NN.cpp
@@ -46,23 +46,30 @@ const char * BluetoothBNEPNetNode::provides( void ) {
bool BluetoothBNEPNetNode::generateProperFilesFor(
ANetNodeInstance * ) {
return 1;
}
-bool BluetoothBNEPNetNode::hasDataFor( const QString & ) {
- return 0;
+bool BluetoothBNEPNetNode::hasDataFor( const QString & S, bool DS ) {
+ return DS && S == "interfaces";
}
bool BluetoothBNEPNetNode::generateDataForCommonFile(
SystemFile & ,
long ,
ANetNodeInstance * ) {
return 1;
}
+bool BluetoothBNEPNetNode::generateDeviceDataForCommonFile(
+ SystemFile & ,
+ long ,
+ ANetNodeInstance * ) {
+ return 1;
+}
+
//
//
// BLUETOOTH PAN/NAP node
//
//
@@ -98,13 +105,13 @@ const char * BluetoothRFCOMMNetNode::provides( void ) {
bool BluetoothRFCOMMNetNode::generateProperFilesFor(
ANetNodeInstance * ) {
return 0;
}
-bool BluetoothRFCOMMNetNode::hasDataFor( const QString & ) {
+bool BluetoothRFCOMMNetNode::hasDataFor( const QString &, bool ) {
return 0;
}
bool BluetoothRFCOMMNetNode::generateDataForCommonFile(
SystemFile & ,
long,
diff --git a/noncore/settings/networksettings2/bluetooth/bluetooth_NN.h b/noncore/settings/networksettings2/bluetooth/bluetooth_NN.h
index 705201c..d72b0d4 100644
--- a/noncore/settings/networksettings2/bluetooth/bluetooth_NN.h
+++ b/noncore/settings/networksettings2/bluetooth/bluetooth_NN.h
@@ -25,15 +25,17 @@ public:
virtual ANetNodeInstance * createInstance( void );
virtual const char ** needs( void );
virtual const char * provides( void );
virtual bool generateProperFilesFor( ANetNodeInstance * NNI );
- virtual bool hasDataFor( const QString & S );
+ virtual bool hasDataFor( const QString & S, bool DS );
virtual bool generateDataForCommonFile(
SystemFile & SF, long DevNr, ANetNodeInstance * NNI );
+ virtual bool generateDeviceDataForCommonFile(
+ SystemFile & SF, long DevNr, ANetNodeInstance * NNI );
private:
};
class BluetoothRFCOMMNetNode : public ANetNode {
@@ -56,15 +58,17 @@ public:
virtual ANetNodeInstance * createInstance( void );
virtual const char ** needs( void );
virtual const char * provides( void );
virtual bool generateProperFilesFor( ANetNodeInstance * NNI );
- virtual bool hasDataFor( const QString & S );
+ virtual bool hasDataFor( const QString & S, bool );
virtual bool generateDataForCommonFile(
SystemFile & SF, long, ANetNodeInstance * NNI );
+ virtual bool generateDeviceDataForCommonFile(
+ SystemFile & SF, long, ANetNodeInstance * NNI );
private:
};
extern "C"
diff --git a/noncore/settings/networksettings2/cable/cable_NN.cpp b/noncore/settings/networksettings2/cable/cable_NN.cpp
index 756903e..6f62772 100644
--- a/noncore/settings/networksettings2/cable/cable_NN.cpp
+++ b/noncore/settings/networksettings2/cable/cable_NN.cpp
@@ -38,22 +38,29 @@ const char * CableNetNode::provides( void ) {
bool CableNetNode::generateProperFilesFor(
ANetNodeInstance * ) {
return 1;
}
-bool CableNetNode::hasDataFor( const QString & ) {
+bool CableNetNode::hasDataFor( const QString &, bool ) {
return 0;
}
bool CableNetNode::generateDataForCommonFile(
SystemFile & ,
long ,
ANetNodeInstance * ) {
return 1;
}
+bool CableNetNode::generateDeviceDataForCommonFile(
+ SystemFile & ,
+ long ,
+ ANetNodeInstance * ) {
+ return 1;
+}
+
extern "C" {
void create_plugin( QList<ANetNode> & PNN ) {
PNN.append( new CableNetNode() );
}
}
diff --git a/noncore/settings/networksettings2/cable/cable_NN.h b/noncore/settings/networksettings2/cable/cable_NN.h
index da99c1c..3875af6 100644
--- a/noncore/settings/networksettings2/cable/cable_NN.h
+++ b/noncore/settings/networksettings2/cable/cable_NN.h
@@ -25,15 +25,17 @@ public:
virtual ANetNodeInstance * createInstance( void );
virtual const char ** needs( void );
virtual const char * provides( void );
virtual bool generateProperFilesFor( ANetNodeInstance * NNI );
- virtual bool hasDataFor( const QString & S );
+ virtual bool hasDataFor( const QString & S, bool DS );
virtual bool generateDataForCommonFile(
SystemFile & SF, long DevNr, ANetNodeInstance * NNI );
+ virtual bool generateDeviceDataForCommonFile(
+ SystemFile & SF, long DevNr, ANetNodeInstance * NNI );
private:
};
extern "C"
diff --git a/noncore/settings/networksettings2/cable/cablerun.h b/noncore/settings/networksettings2/cable/cablerun.h
index 36ee640..7b341c4 100644
--- a/noncore/settings/networksettings2/cable/cablerun.h
+++ b/noncore/settings/networksettings2/cable/cablerun.h
@@ -6,12 +6,15 @@ class CableRun : public AsLine {
public :
CableRun( ANetNodeInstance * NNI,
CableData & Data ) : AsLine( NNI )
{ D = &Data; }
+ virtual AsLine * asLine( void )
+ { return (AsLine *)this; }
+
protected :
void detectState( NodeCollection * NC );
bool setState( NodeCollection * NC, Action_t A );
bool canSetState( State_t Curr, Action_t A );
diff --git a/noncore/settings/networksettings2/irda/irda_NN.cpp b/noncore/settings/networksettings2/irda/irda_NN.cpp
index 3b9c938..4347191 100644
--- a/noncore/settings/networksettings2/irda/irda_NN.cpp
+++ b/noncore/settings/networksettings2/irda/irda_NN.cpp
@@ -38,22 +38,29 @@ const char * IRDANetNode::provides( void ) {
bool IRDANetNode::generateProperFilesFor(
ANetNodeInstance * ) {
return 1;
}
-bool IRDANetNode::hasDataFor( const QString & ) {
+bool IRDANetNode::hasDataFor( const QString &, bool ) {
return 0;
}
bool IRDANetNode::generateDataForCommonFile(
SystemFile & ,
long ,
ANetNodeInstance * ) {
return 1;
}
+bool IRDANetNode::generateDeviceDataForCommonFile(
+ SystemFile & ,
+ long ,
+ ANetNodeInstance * ) {
+ return 1;
+}
+
extern "C" {
void create_plugin( QList<ANetNode> & PNN ) {
PNN.append( new IRDANetNode() );
}
}
diff --git a/noncore/settings/networksettings2/irda/irda_NN.h b/noncore/settings/networksettings2/irda/irda_NN.h
index 6574c17..a772f69 100644
--- a/noncore/settings/networksettings2/irda/irda_NN.h
+++ b/noncore/settings/networksettings2/irda/irda_NN.h
@@ -25,15 +25,17 @@ public:
virtual ANetNodeInstance * createInstance( void );
virtual const char ** needs( void );
virtual const char * provides( void );
virtual bool generateProperFilesFor( ANetNodeInstance * NNI );
- virtual bool hasDataFor( const QString & S );
+ virtual bool hasDataFor( const QString & S, bool DS );
virtual bool generateDataForCommonFile(
SystemFile & SF, long DevNr, ANetNodeInstance * NNI );
+ virtual bool generateDeviceDataForCommonFile(
+ SystemFile & SF, long DevNr, ANetNodeInstance * NNI );
private:
};
extern "C"
diff --git a/noncore/settings/networksettings2/irda/irdarun.h b/noncore/settings/networksettings2/irda/irdarun.h
index adc9c24..d9fe5e8 100644
--- a/noncore/settings/networksettings2/irda/irdarun.h
+++ b/noncore/settings/networksettings2/irda/irdarun.h
@@ -6,12 +6,15 @@ class IRDARun : public AsLine {
public :
IRDARun( ANetNodeInstance * NNI,
IRDAData & Data ) : AsLine( NNI )
{ }
+ virtual AsLine * asLine( void )
+ { return (AsLine *)this; }
+
protected :
void detectState( NodeCollection * )
{ }
bool setState( NodeCollection * , Action_t )
diff --git a/noncore/settings/networksettings2/lancard/lancard_NN.cpp b/noncore/settings/networksettings2/lancard/lancard_NN.cpp
index a45496d..7d36918 100644
--- a/noncore/settings/networksettings2/lancard/lancard_NN.cpp
+++ b/noncore/settings/networksettings2/lancard/lancard_NN.cpp
@@ -39,22 +39,29 @@ const char * LanCardNetNode::provides( void ) {
bool LanCardNetNode::generateProperFilesFor(
ANetNodeInstance * ) {
return 1;
}
-bool LanCardNetNode::hasDataFor( const QString & ) {
- return 0;
+bool LanCardNetNode::hasDataFor( const QString & S, bool DS ) {
+ return DS && S == "interfaces";
}
bool LanCardNetNode::generateDataForCommonFile(
SystemFile & ,
long ,
ANetNodeInstance * ) {
return 1;
}
+bool LanCardNetNode::generateDeviceDataForCommonFile(
+ SystemFile & S ,
+ long DevNr ,
+ ANetNodeInstance * NNI ) {
+ return ((ALanCard *)NNI)->generateDeviceDataForCommonFile(S, DevNr);
+}
+
extern "C" {
void create_plugin( QList<ANetNode> & PNN ) {
PNN.append( new LanCardNetNode() );
}
}
diff --git a/noncore/settings/networksettings2/lancard/lancard_NN.h b/noncore/settings/networksettings2/lancard/lancard_NN.h
index 71b49d0..9690c76 100644
--- a/noncore/settings/networksettings2/lancard/lancard_NN.h
+++ b/noncore/settings/networksettings2/lancard/lancard_NN.h
@@ -25,15 +25,17 @@ public:
virtual ANetNodeInstance * createInstance( void );
virtual const char ** needs( void );
virtual const char * provides( void );
virtual bool generateProperFilesFor( ANetNodeInstance * NNI );
- virtual bool hasDataFor( const QString & S );
+ virtual bool hasDataFor( const QString & S, bool DS );
virtual bool generateDataForCommonFile(
SystemFile & SF, long DevNr, ANetNodeInstance * NNI );
+ virtual bool generateDeviceDataForCommonFile(
+ SystemFile & SF, long DevNr, ANetNodeInstance * NNI );
private:
};
extern "C"
diff --git a/noncore/settings/networksettings2/lancard/lancard_NNI.cpp b/noncore/settings/networksettings2/lancard/lancard_NNI.cpp
index 9595e2e..a6401db 100644
--- a/noncore/settings/networksettings2/lancard/lancard_NNI.cpp
+++ b/noncore/settings/networksettings2/lancard/lancard_NNI.cpp
@@ -39,6 +39,20 @@ QString ALanCard::acceptable( void ) {
}
void ALanCard::commit( void ) {
if( GUI && GUI->commit( Data ) )
setModified( 1 );
}
+
+bool ALanCard::generateDeviceDataForCommonFile( SystemFile & S, long DevNr ) {
+ AsDevice * Dev = runtime()->device();
+ QString NIC = Dev->genNic( DevNr );
+
+ if( S.name() == "interfaces" ) {
+ // generate mapping stanza for this interface
+ S << "# check if " << NIC << " can be brought UP" << endl;
+ S << "mapping " << NIC << endl;
+ S << " script networksettings2-request" << endl << endl;
+ }
+ return 0;
+}
+
diff --git a/noncore/settings/networksettings2/lancard/lancard_NNI.h b/noncore/settings/networksettings2/lancard/lancard_NNI.h
index 8fc8868..16f5f56 100644
--- a/noncore/settings/networksettings2/lancard/lancard_NNI.h
+++ b/noncore/settings/networksettings2/lancard/lancard_NNI.h
@@ -24,12 +24,14 @@ public :
return RT;
}
virtual void * data( void )
{ return (void *)&Data; }
+ bool generateDeviceDataForCommonFile( SystemFile & S, long DevNr );
+
protected :
virtual void setSpecificAttribute( QString & Attr, QString & Value );
virtual void saveSpecificAttribute( QTextStream & TS );
private :
diff --git a/noncore/settings/networksettings2/lancard/lancardrun.cpp b/noncore/settings/networksettings2/lancard/lancardrun.cpp
index b3b592b..951756d 100644
--- a/noncore/settings/networksettings2/lancard/lancardrun.cpp
+++ b/noncore/settings/networksettings2/lancard/lancardrun.cpp
@@ -33,13 +33,22 @@ void LanCardRun::detectState( NodeCollection * NC ) {
return;
}
}
}
}
- // we are certainly not UP
+ if( ( Run = assignedInterface() ) ) {
+ // we already have an interface assigned -> still present ?
+ if( ! Run->IsUp ) {
+ // usb is still free -> keep assignment
+ NC->setCurrentState( Available );
+ return;
+ } // else interface is up but NOT us -> some other profile
+ }
+
+ // nothing (valid) assigned to us
assignInterface( 0 );
// find possible interface
for( QDictIterator<InterfaceInfo> It(Sys.interfaces());
It.current();
++It ) {
@@ -84,14 +93,13 @@ bool LanCardRun::setState( NodeCollection * NC, Action_t A ) {
case Deactivate :
if( NC->currentState() == IsUp ) {
// bring down first
if( ! connection()->setState( Down ) )
// could not ...
return 0;
- }
- if( NC->currentState() != Available ) {
+ } else if( NC->currentState() != Available ) {
return 1;
}
assignedInterface()->assignNode( 0 ); // release
assignInterface( 0 );
NC->setCurrentState( Off );
return 1;
diff --git a/noncore/settings/networksettings2/lancard/lancardrun.h b/noncore/settings/networksettings2/lancard/lancardrun.h
index 5f004e0..8dbd1b1 100644
--- a/noncore/settings/networksettings2/lancard/lancardrun.h
+++ b/noncore/settings/networksettings2/lancard/lancardrun.h
@@ -15,14 +15,18 @@ public :
{ }
virtual long count( void )
{ return 2; }
virtual QString genNic( long nr )
{ QString S; return S.sprintf( "eth%ld", nr ); }
+
virtual AsDevice * device( void )
- { return asDevice(); }
+ { return (AsDevice *)this; }
+
+ virtual AsDevice * asDevice( void )
+ { return (AsDevice *)this; }
protected :
void detectState( NodeCollection * NC );
bool setState( NodeCollection * NC, Action_t A );
bool canSetState( State_t Curr, Action_t A );
diff --git a/noncore/settings/networksettings2/modem/modem_NN.cpp b/noncore/settings/networksettings2/modem/modem_NN.cpp
index 48e1ad8..2807963 100644
--- a/noncore/settings/networksettings2/modem/modem_NN.cpp
+++ b/noncore/settings/networksettings2/modem/modem_NN.cpp
@@ -39,22 +39,29 @@ const char * ModemNetNode::provides( void ) {
bool ModemNetNode::generateProperFilesFor(
ANetNodeInstance * ) {
return 1;
}
-bool ModemNetNode::hasDataFor( const QString & ) {
+bool ModemNetNode::hasDataFor( const QString &, bool ) {
return 0;
}
bool ModemNetNode::generateDataForCommonFile(
SystemFile & ,
long ,
ANetNodeInstance * ) {
return 1;
}
+bool ModemNetNode::generateDeviceDataForCommonFile(
+ SystemFile & ,
+ long ,
+ ANetNodeInstance * ) {
+ return 1;
+}
+
extern "C" {
void create_plugin( QList<ANetNode> & PNN ) {
PNN.append( new ModemNetNode() );
}
}
diff --git a/noncore/settings/networksettings2/modem/modem_NN.h b/noncore/settings/networksettings2/modem/modem_NN.h
index 5eceed2..bd921c6 100644
--- a/noncore/settings/networksettings2/modem/modem_NN.h
+++ b/noncore/settings/networksettings2/modem/modem_NN.h
@@ -25,15 +25,17 @@ public:
virtual ANetNodeInstance * createInstance( void );
virtual const char ** needs( void );
virtual const char * provides( void );
virtual bool generateProperFilesFor( ANetNodeInstance * NNI );
- virtual bool hasDataFor( const QString & S );
+ virtual bool hasDataFor( const QString & S, bool DS );
virtual bool generateDataForCommonFile(
SystemFile & SF, long DevNr, ANetNodeInstance * NNI );
+ virtual bool generateDeviceDataForCommonFile(
+ SystemFile & SF, long DevNr, ANetNodeInstance * NNI );
private:
};
extern "C"
diff --git a/noncore/settings/networksettings2/modem/modemrun.h b/noncore/settings/networksettings2/modem/modemrun.h
index 719ab2f..6d1662b 100644
--- a/noncore/settings/networksettings2/modem/modemrun.h
+++ b/noncore/settings/networksettings2/modem/modemrun.h
@@ -6,12 +6,15 @@ class ModemRun : public AsLine {
public :
ModemRun( ANetNodeInstance * NNI,
ModemData & Data ) : AsLine ( NNI )
{ }
+ virtual AsLine * asLine( void )
+ { return (AsLine *)this; }
+
protected :
void detectState( NodeCollection * )
{ }
bool setState( NodeCollection *, Action_t )
diff --git a/noncore/settings/networksettings2/network/network_NN.cpp b/noncore/settings/networksettings2/network/network_NN.cpp
index bb371ad..a6b15c6 100644
--- a/noncore/settings/networksettings2/network/network_NN.cpp
+++ b/noncore/settings/networksettings2/network/network_NN.cpp
@@ -40,25 +40,32 @@ const char * NetworkNetNode::provides( void ) {
bool NetworkNetNode::generateProperFilesFor(
ANetNodeInstance * ) {
return 1;
}
-bool NetworkNetNode::hasDataFor( const QString & S ) {
- if( S == "interfaces" ) {
+bool NetworkNetNode::hasDataFor( const QString & S, bool DS ) {
+ if( ! DS && S == "interfaces" ) {
return 1;
}
return 0;
}
bool NetworkNetNode::generateDataForCommonFile(
SystemFile & S,
long DevNr,
ANetNodeInstance * NNI ) {
return ((ANetwork *)NNI)->generateDataForCommonFile(S, DevNr);
}
+bool NetworkNetNode::generateDeviceDataForCommonFile(
+ SystemFile & ,
+ long ,
+ ANetNodeInstance * ) {
+ return 1;
+}
+
extern "C" {
void create_plugin( QList<ANetNode> & PNN ) {
PNN.append( new NetworkNetNode() );
}
}
diff --git a/noncore/settings/networksettings2/network/network_NN.h b/noncore/settings/networksettings2/network/network_NN.h
index 220e00f..62a3f10 100644
--- a/noncore/settings/networksettings2/network/network_NN.h
+++ b/noncore/settings/networksettings2/network/network_NN.h
@@ -25,15 +25,17 @@ public:
virtual ANetNodeInstance * createInstance( void );
virtual const char ** needs( void );
virtual const char * provides( void );
virtual bool generateProperFilesFor( ANetNodeInstance * NNI );
- virtual bool hasDataFor( const QString & S );
+ virtual bool hasDataFor( const QString & S, bool DS );
virtual bool generateDataForCommonFile(
SystemFile & SF, long DevNr, ANetNodeInstance * NNI );
+ virtual bool generateDeviceDataForCommonFile(
+ SystemFile & SF, long DevNr, ANetNodeInstance * NNI );
private:
};
extern "C"
diff --git a/noncore/settings/networksettings2/network/network_NNI.cpp b/noncore/settings/networksettings2/network/network_NNI.cpp
index 7130764..eac2d66 100644
--- a/noncore/settings/networksettings2/network/network_NNI.cpp
+++ b/noncore/settings/networksettings2/network/network_NNI.cpp
@@ -101,17 +101,12 @@ void ANetwork::commit( void ) {
bool ANetwork::generateDataForCommonFile( SystemFile & S, long DevNr ) {
AsDevice * Dev = runtime()->device();
QString NIC = Dev->genNic( DevNr );
if( S.name() == "interfaces" ) {
- // generate mapping stanza for this interface
- S << "# check if " << NIC << " can be brought UP" << endl;
- S << "mapping " << NIC << endl;
- S << " script networksettings2-request" << endl << endl;
-
// we can safely call from here since device item is deeper
if( Data.UseDHCP ) {
S << "iface " << NIC << "-c" << connection()->number() <<
"-allowed inet dhcp" << endl;
S << " up echo \"" << NIC << "\" > /tmp/profile-" << connection()->number() <<
".up" << Data.IPAddress << endl;
diff --git a/noncore/settings/networksettings2/network/networkedit.cpp b/noncore/settings/networksettings2/network/networkedit.cpp
index b17d745..182213b 100644
--- a/noncore/settings/networksettings2/network/networkedit.cpp
+++ b/noncore/settings/networksettings2/network/networkedit.cpp
@@ -49,19 +49,19 @@ QString NetworkEdit::acceptable( void ) {
if( ! validIP( IPAddress_LE->text() ) )
return tr("IPAddress not valid");
if( ! validIP( SubnetMask_LE->text() ) )
return tr("Subnet mask not valid");
if( ! validIP( Broadcast_LE->text() ) )
return tr("Broadcast address not valid");
- if( Gateway_LE->text().isEmpty() &&
+ if( Gateway_LE->text().isEmpty() ||
! validIP( Gateway_LE->text() ) )
return tr("Gateway address not valid");
- if( DNS1_LE->text().isEmpty() &&
+ if( ! DNS1_LE->text().isEmpty() &&
! validIP( DNS1_LE->text() ) )
return tr("DNS1 address not valid");
- if( DNS2_LE->text().isEmpty() &&
+ if( ! DNS2_LE->text().isEmpty() &&
! validIP( DNS2_LE->text() ) )
return tr("DNS2 address not valid");
return QString();
}
bool NetworkEdit::commit( NetworkData_t & Data ) {
diff --git a/noncore/settings/networksettings2/network/networkrun.cpp b/noncore/settings/networksettings2/network/networkrun.cpp
index 8deca14..f34fdbf 100644
--- a/noncore/settings/networksettings2/network/networkrun.cpp
+++ b/noncore/settings/networksettings2/network/networkrun.cpp
@@ -23,23 +23,25 @@ bool NetworkRun::setState( NodeCollection * NC, Action_t A ) {
InterfaceInfo * II = Next->assignedInterface();
if( A == Up ) {
// we can bring UP if lower level is available
if( NC->currentState() == Available ) {
QString S;
- S.sprintf( "ifup %s", II->Name.latin1() );
+ S.sprintf( "ifup %s=%s-c%d-allowed",
+ II->Name.latin1(), II->Name.latin1(),
+ connection()->number() );
NSResources->system().execute( S );
- NC->setCurrentState( IsUp );
}
return 1;
} else if( A == Down ) {
if( NC->currentState() == IsUp ) {
QString S;
- S.sprintf( "ifdown %s", II->Name.latin1() );
+ S.sprintf( "ifdown %s=%s-c%d-allowed",
+ II->Name.latin1(), II->Name.latin1(),
+ connection()->number() );
NSResources->system().execute( S );
- NC->setCurrentState( Available );
}
return 1;
}
// delegate
return RI->setState( NC, A );
}
diff --git a/noncore/settings/networksettings2/network/networkrun.h b/noncore/settings/networksettings2/network/networkrun.h
index f3d840e..fa16365 100644
--- a/noncore/settings/networksettings2/network/networkrun.h
+++ b/noncore/settings/networksettings2/network/networkrun.h
@@ -6,12 +6,15 @@ class NetworkRun : public AsConnection {
public :
NetworkRun( ANetNodeInstance * NNI,
NetworkData & Data ) : AsConnection( NNI )
{ }
+ virtual AsConnection * asConnection( void )
+ { return (AsConnection *)this; }
+
protected :
void detectState( NodeCollection * );
bool setState( NodeCollection * ,Action_t A );
bool canSetState( State_t , Action_t A );
diff --git a/noncore/settings/networksettings2/networksettings.cpp b/noncore/settings/networksettings2/networksettings.cpp
index e1110e2..c3e6572 100644
--- a/noncore/settings/networksettings2/networksettings.cpp
+++ b/noncore/settings/networksettings2/networksettings.cpp
@@ -165,22 +165,38 @@ void NetworkSettings::SLOT_EditNode( QListBoxItem * LBI ) {
EC.setConnection( NC );
}
EC.showMaximized();
// disable refresh timer
UpdateTimer->stop();
+ // we need to retry
+ while( 1 ) {
if( EC.exec() == QDialog::Accepted ) {
// toplevel item -> store
NodeCollection * NC = EC.connection();
if( NC->isModified() ) {
setModified( 1 );
if( LBI ) {
+ if( NC->name() != OldName ) {
+ // find if new name is free
+ NodeCollection * LCN = NSResources->findConnection(
+ NC->name() );
+ if( LCN ) {
+ QMessageBox::warning(
+ 0,
+ tr( "Generating system configuration" ),
+ tr( "Name %1 already exists" ).arg(NC->name())
+ );
+ continue; // restart exec
+ } // else new name
// new name -> remove item
NSResources->removeConnection( OldName );
- // must add it here since change will trigger event
NSResources->addConnection( NC );
+ } // else not changed
+
+ // must add it here since change will trigger event
Profiles_LB->changeItem( NC->devicePixmap(),
NC->name(),
Profiles_LB->index( LBI )
);
} else {
// new item
@@ -196,12 +212,14 @@ void NetworkSettings::SLOT_EditNode( QListBoxItem * LBI ) {
// cancelled : reset connection
if( LBI ) {
NodeCollection * NC = NSResources->findConnection( LBI->text() );
NC->reassign();
}
}
+ break;
+ }
// reenable
UpdateTimer->start( 5000 );
}
void NetworkSettings::SLOT_ShowNode( QListBoxItem * LBI ) {
if( LBI == 0 )
@@ -330,21 +348,16 @@ void NetworkSettings::SLOT_On( void ) {
bool rv;
switch( NC->state() ) {
case Off :
// activate interface
rv = NC->setState( Activate );
break;
- case Available :
- // deactivate
+ case Available : // deactivate
+ case IsUp : // deactivate (will also bring down if needed)
rv = NC->setState( Deactivate );
break;
- case IsUp :
- // bring down and deactivate
- rv = ( NC->setState( Down ) &&
- NC->setState( Deactivate ) );
- break;
default :
// others no change
return;
}
if( ! rv ) {
@@ -363,13 +376,13 @@ void NetworkSettings::SLOT_Connect( void ) {
if ( ! LBI )
return;
NodeCollection * NC =
NSResources->findConnection( LBI->text() );
- bool rv;
+ bool rv = 1 ;
switch( NC->state() ) {
case IsUp :
// down interface
rv = NC->setState( Down );
break;
case Available :
@@ -380,21 +393,20 @@ void NetworkSettings::SLOT_Connect( void ) {
// activate and bring up
rv = ( NC->setState( Activate ) &&
NC->setState( Up ) );
break;
default :
// others no change
- return;
+ break;
}
if( ! rv ) {
QMessageBox::warning(
0,
tr( "Activating profile" ),
tr( "Cannot enable profile" ) );
- return;
}
// we do not update the GUI but wait for the REAL upping of the device
}
void NetworkSettings::SLOT_QCopMessage(const QCString &msg, const QByteArray &data) {
diff --git a/noncore/settings/networksettings2/networksettings2/netnode.h b/noncore/settings/networksettings2/networksettings2/netnode.h
index 56333c5..f4a5e30 100644
--- a/noncore/settings/networksettings2/networksettings2/netnode.h
+++ b/noncore/settings/networksettings2/networksettings2/netnode.h
@@ -92,17 +92,21 @@ public:
virtual const char ** needs( void ) = 0;
// generate files specific for this node (if any)
virtual bool generateProperFilesFor( ANetNodeInstance * NNI ) = 0;
// return TRUE if this node has data to be inserted in systemfile
// with name S
- virtual bool hasDataFor( const QString & S ) = 0;
- // generate data specific for the system file S
+ virtual bool hasDataFor( const QString & S, bool DeviceSpecific ) = 0;
+ // generate data specific for a profile and for the system file S
// called only IF data was needed
virtual bool generateDataForCommonFile(
SystemFile & SF, long DevNr, ANetNodeInstance * NNI ) = 0;
+ // generate data specific for the device for the system file S
+ // called only IF data was needed
+ virtual bool generateDeviceDataForCommonFile(
+ SystemFile & SF, long DevNr, ANetNodeInstance * NNI ) = 0;
// does this Node provide a Connection
bool isToplevel( void )
{ return strcmp( provides(), "fullsetup") == 0 ; }
// compiled references to 'needed' NetNodes -> needs list
@@ -212,21 +216,21 @@ class RuntimeInfo : public QObject {
public :
RuntimeInfo( ANetNodeInstance * TheNNI )
{ NNI = TheNNI; }
- // downcast
+ // downcast implemented by specify runtime classes
AsDevice * asDevice( void )
- { return (AsDevice *)this; }
+ { return 0; }
AsConnection * asConnection( void )
- { return (AsConnection *)this; }
+ { return 0; }
AsLine * asLine( void )
- { return (AsLine *)this; }
+ { return 0; }
AsFullSetup * asFullSetup( void )
- { return (AsFullSetup *)this; }
+ { return 0; }
// does this node handles this interface e.g.eth0
// recurse deeper if this node cannot answer that question
virtual bool handlesInterface( const QString & )
{ return 0; }
virtual InterfaceInfo * assignedInterface( void );
@@ -381,17 +385,20 @@ public:
const char * provides( void )
{ return ""; }
virtual const char ** needs( void )
{ return 0; }
virtual bool generateProperFilesFor( ANetNodeInstance * )
{ return 0; }
- virtual bool hasDataFor( const QString & )
+ virtual bool hasDataFor( const QString &, bool DS )
{ return 0; }
virtual bool generateDataForCommonFile(
SystemFile & , long , ANetNodeInstance * )
{return 1; }
+ virtual bool generateDeviceDataForCommonFile(
+ SystemFile & , long , ANetNodeInstance * )
+ {return 1; }
private :
};
class FakeNetNodeInstance : public ANetNodeInstance {
diff --git a/noncore/settings/networksettings2/networksettings2/system.cpp b/noncore/settings/networksettings2/networksettings2/system.cpp
index 85dcd7d..a68f3c0 100644
--- a/noncore/settings/networksettings2/networksettings2/system.cpp
+++ b/noncore/settings/networksettings2/networksettings2/system.cpp
@@ -35,20 +35,21 @@ System::~System( void ) {
if( ProcDevNet )
delete ProcDevNet;
}
int System::execute( const QString & S ) {
QString MyS = S;
+ char * usr = getenv("USER");
int rv;
if( S.isEmpty() ) {
// loophole to start shell
return 8888;
}
- if( getenv("USER") != "root" ) {
- // use SUDO
+ if( usr == 0 || strcmp( usr, "root" ) ) {
+ // unknown or non-root user -> use SUDO
MyS.prepend( "sudo " );
}
fprintf( stderr, "Executing %s\n", MyS.latin1() );
rv = system( MyS.latin1() ) ;
diff --git a/noncore/settings/networksettings2/networksettings2/systemfile.cpp b/noncore/settings/networksettings2/networksettings2/systemfile.cpp
index 7249976..394ff52 100644
--- a/noncore/settings/networksettings2/networksettings2/systemfile.cpp
+++ b/noncore/settings/networksettings2/networksettings2/systemfile.cpp
@@ -27,13 +27,15 @@ SystemFile::SystemFile( const QString & N, const QString & P ){
TemplDir = "./" TEMPLATEDIR;
FI.setFile( TemplDir );
if( ! FI.isDir() ) {
hasPreSection =
hasPostSection =
hasPreNodeSection =
- hasPostNodeSection = 0;
+ hasPostNodeSection =
+ hasPreDeviceSection =
+ hasPostDeviceSection = 0;
return;
}
}
// have found location
S = TemplDir + Name + "/presection";
@@ -45,12 +47,18 @@ SystemFile::SystemFile( const QString & N, const QString & P ){
S = TemplDir + Name + "/prenodesection";
FI.setFile( S );
hasPreNodeSection = ( FI.exists() && FI.isReadable() );
S = TemplDir + Name + "/postnodesection";
FI.setFile( S );
hasPostNodeSection = ( FI.exists() && FI.isReadable() );
+ S = TemplDir + Name + "/predevicesection";
+ FI.setFile( S );
+ hasPreDeviceSection = ( FI.exists() && FI.isReadable() );
+ S = TemplDir + Name + "/postdevicesection";
+ FI.setFile( S );
+ hasPostDeviceSection = ( FI.exists() && FI.isReadable() );
}
}
SystemFile::~SystemFile( void ) {
if( F )
delete F;
@@ -105,13 +113,13 @@ bool SystemFile::postSection( void ) {
}
return 0;
}
bool SystemFile::preNodeSection( ANetNodeInstance * NNI, long ) {
if( hasPreNodeSection ) {
- QFile Fl( TemplDir + Name + "/prenodesectoin" );
+ QFile Fl( TemplDir + Name + "/prenodesection" );
if( ! Fl.open( IO_ReadOnly ) )
return 1; // error
QTextStream TX( &Fl );
QString Out;
QString S = TX.readLine();
while( ! TX.eof() ) {
@@ -123,13 +131,13 @@ bool SystemFile::preNodeSection( ANetNodeInstance * NNI, long ) {
}
return 0;
}
bool SystemFile::postNodeSection( ANetNodeInstance * NNI, long DevNr ) {
if( hasPostNodeSection ) {
- QFile Fl( TemplDir + Name + "/postnodesectoin" );
+ QFile Fl( TemplDir + Name + "/postnodesection" );
if( ! Fl.open( IO_ReadOnly ) )
return 1; // error
QTextStream TX( &Fl );
QString Out;
QString S = TX.readLine();
while( ! TX.eof() ) {
@@ -139,6 +147,41 @@ bool SystemFile::postNodeSection( ANetNodeInstance * NNI, long DevNr ) {
S = TX.readLine();
}
}
return 0;
}
+bool SystemFile::preDeviceSection( ANetNodeInstance * NNI, long ) {
+ if( hasPreDeviceSection ) {
+ QFile Fl( TemplDir + Name + "/predevicesection" );
+ if( ! Fl.open( IO_ReadOnly ) )
+ return 1; // error
+ QTextStream TX( &Fl );
+ QString Out;
+ QString S = TX.readLine();
+ while( ! TX.eof() ) {
+ Out = S.
+ arg(NNI->netNode()->nodeName());
+ (*this) << Out << endl;
+ S = TX.readLine();
+ }
+ }
+ return 0;
+}
+
+bool SystemFile::postDeviceSection( ANetNodeInstance * NNI, long DevNr ) {
+ if( hasPostDeviceSection ) {
+ QFile Fl( TemplDir + Name + "/postdevicesection" );
+ if( ! Fl.open( IO_ReadOnly ) )
+ return 1; // error
+ QTextStream TX( &Fl );
+ QString Out;
+ QString S = TX.readLine();
+ while( ! TX.eof() ) {
+ Out = S.
+ arg(NNI->nodeName());
+ (*this) << Out << endl;
+ S = TX.readLine();
+ }
+ }
+ return 0;
+}
diff --git a/noncore/settings/networksettings2/networksettings2/systemfile.h b/noncore/settings/networksettings2/networksettings2/systemfile.h
index 8b6bcb9..35e0dfc 100644
--- a/noncore/settings/networksettings2/networksettings2/systemfile.h
+++ b/noncore/settings/networksettings2/networksettings2/systemfile.h
@@ -21,19 +21,23 @@ public :
bool close( void );
bool preSection( void );
bool postSection( void );
bool preNodeSection( ANetNodeInstance * NNI, long DevNr );
bool postNodeSection( ANetNodeInstance * NNI, long DevNr );
+ bool preDeviceSection( ANetNodeInstance * NNI, long DevNr );
+ bool postDeviceSection( ANetNodeInstance * NNI, long DevNr );
private :
QString Name;
QString Path;
QFile * F;
bool hasPreSection;
- bool hasPreNodeSection;
bool hasPostSection;
+ bool hasPreNodeSection;
bool hasPostNodeSection;
+ bool hasPreDeviceSection;
+ bool hasPostDeviceSection;
};
#endif
diff --git a/noncore/settings/networksettings2/nsdata.cpp b/noncore/settings/networksettings2/nsdata.cpp
index 3f5e958..6541596 100644
--- a/noncore/settings/networksettings2/nsdata.cpp
+++ b/noncore/settings/networksettings2/nsdata.cpp
@@ -185,12 +185,13 @@ QString NetworkSettingsData::generateSettings( bool ForceReq ) {
{ Name2SystemFile_t & SFM = NSResources->systemFiles();
Name2Connection_t & M = NSResources->connections();
NodeCollection * NC;
ANetNodeInstance * NNI;
SystemFile * SF;
+ AsDevice * CurDev;
bool needToRegenerate = ForceIt;
//
// check if we need to generate at least one of the system files
//
if( ! ForceIt ) {
@@ -211,13 +212,15 @@ QString NetworkSettingsData::generateSettings( bool ForceReq ) {
if( NC->isModified() ) {
// does this connection 'touch' this system file ?
for( QListIterator<ANetNodeInstance> cncit(*NC);
cncit.current();
++cncit ) {
NNI = cncit.current();
- if( NNI->netNode()->hasDataFor( SF->name() ) &&
+ if( ( NNI->netNode()->hasDataFor( SF->name(), 1 ) ||
+ NNI->netNode()->hasDataFor( SF->name(), 0 )
+ ) &&
NNI->isModified() ) {
needToRegenerate = 1;
break;
}
}
}
@@ -238,13 +241,12 @@ QString NetworkSettingsData::generateSettings( bool ForceReq ) {
}
//
// generate files proper to each netnodeinstance
//
{ Name2Instance_t & NNIs = NSResources->netNodeInstances();
- ANetNodeInstance * NNI;
for( QDictIterator<ANetNodeInstance> NNIIt(NNIs);
NNIIt.current();
++NNIIt
){
// for all nodes find those that are modified
@@ -260,86 +262,236 @@ QString NetworkSettingsData::generateSettings( bool ForceReq ) {
}
}
}
}
//
- // generate system files
+ // generate all system files
//
for( QDictIterator<SystemFile> sfit(SFM);
sfit.current();
++sfit ) {
SF = sfit.current();
- //
- // regenerate current file
- //
printf( "Generating %s\n", SF->name().latin1() );
SF->open();
do { // so we can break;
+ // global presection for this system file
if( SF->preSection() ) {
S = qApp->translate( "NetworkSettings",
"<p>Error in preSection for file %1</p>" ).
arg( SF->name() );
return S;
}
+ // find all netnodes and figure out if
+ // for that node there are instances
+ for( QDictIterator<NetNode_t> nnit(
+ NSResources->netNodes() );
+ nnit.current();
+ ++nnit ) {
+ ANetNode * NN;
+
+ NN = nnit.current()->NetNode;
+
+ // are there instances ?
+ NNI = 0;
+ for( QDictIterator<ANetNodeInstance> nniit(
+ NSResources->netNodeInstances() );
+ nniit.current();
+ ++nniit ) {
+ if( nniit.current()->netNode() == NN ) {
+ NNI = nniit.current();
+ break;
+ }
+ }
+
+ if( ! NNI )
+ // no instances
+ continue;
+
+ // has this node data for this system file ?
+ if( (CurDev = NNI->runtime()->asDevice() ) ) {
+ // generate start for this nodetype for all possible devices of this type
+ for( int i = 0; i < CurDev->count(); i ++ ) {
+ if( SF->preDeviceSection( NNI, i ) ) {
+ S = qApp->translate( "NetworkSettings",
+ "<p>Error in preDeviceSection for file %1 and node %2</p>" ).
+ arg( SF->name() ).
+ arg( NN->nodeName() );
+ return S;
+ }
+
+ if( ! NN->hasDataFor( SF->name(), 1 ) ) {
+ if( NN->generateDeviceDataForCommonFile( *SF, i, NNI ) ) {
+ S = qApp->translate( "NetworkSettings",
+ "<p>Error in node part for file %1 and node %2</p>" ).
+ arg( SF->name() ).
+ arg( NN->nodeName() );
+ return S;
+ }
+ }
+ }
+ } else {
+ // just request this once
+ if( SF->preDeviceSection( NNI, -1 ) ) {
+ S = qApp->translate( "NetworkSettings",
+ "<p>Error in preDeviceSection for file %1 and node %2</p>" ).
+ arg( SF->name() ).
+ arg( NN->nodeName() );
+ return S;
+ }
+
+ if( ! NN->hasDataFor( SF->name(), 1 ) ) {
+ if( NN->generateDeviceDataForCommonFile( *SF, -1, NNI ) ) {
+ S = qApp->translate( "NetworkSettings",
+ "<p>Error in node part for file %1 and node %2</p>" ).
+ arg( SF->name() ).
+ arg( NN->nodeName() );
+ return S;
+ }
+ }
+ }
+
+ // now generate profile specific data for all
+ // connections working on a device of the current
+ // netnode type
for( QDictIterator<NodeCollection> ncit(M);
ncit.current();
++ncit ) {
NC = ncit.current();
+ NNI = NC->getToplevel();
+
+ // no output needed
+ if( ! NNI->netNode()->hasDataFor( SF->name(), 0 ) )
+ continue;
+
// get the netnode that serves as the device for this
// connection
AsDevice * Dev = NC->device();
- // generate 'entry' for every possible device this profile handles
+ if( CurDev ) {
+ if( CurDev != Dev ) {
+ // other device -> later
+ continue;
+ }
- for( QListIterator<ANetNodeInstance> cncit(*NC);
- cncit.current();
- ++cncit ) {
- NNI = cncit.current();
- for( int i = 0; i < Dev->count(); i ++ ) {
- if( NNI->netNode()->hasDataFor( SF->name() ) ) {
+ // generate 'entry' for every combination of device and profile
+ // each node delegates to deeper level
+ for( int i = 0; i < CurDev->count(); i ++ ) {
if( SF->preNodeSection( NNI, i ) ) {
S = qApp->translate( "NetworkSettings",
"<p>Error in preNodeSection for file %1 and node %2</p>" ).
arg( SF->name() ).
arg( NNI->netNode()->nodeName() );
return S;
}
+ // ask all nodes in connection
+
+ for( QListIterator<ANetNodeInstance> cncit(*NC);
+ cncit.current();
+ ++cncit ) {
+ NNI = cncit.current();
+
+ if( NNI->netNode()->hasDataFor( SF->name(), 0 ) ) {
if( NNI->netNode()->generateDataForCommonFile(*SF,i,NNI) ) {
S = qApp->translate( "NetworkSettings",
"<p>Error in node part for file %1 and node %2</p>" ).
arg( SF->name() ).
arg( NNI->netNode()->nodeName() );
return S;
}
+ }
+ }
if( SF->postNodeSection( NNI, i ) ) {
S = qApp->translate( "NetworkSettings",
"<p>Error in postNodeSection for file %1 and node %2</p>" ).
arg( SF->name() ).
arg( NNI->netNode()->nodeName() );
return S;
}
}
+
+ } else {
+ if( Dev ) {
+ // other
+ continue;
}
+
+ // one entry to generate
+ if( SF->preNodeSection( NNI, -1 ) ) {
+ S = qApp->translate( "NetworkSettings",
+ "<p>Error in preNodeSection for file %1 and node %2</p>" ).
+ arg( SF->name() ).
+ arg( NNI->netNode()->nodeName() );
+ return S;
+ }
+
+ if( NNI->netNode()->generateDataForCommonFile(*SF,-1,NNI) ) {
+ S = qApp->translate( "NetworkSettings",
+ "<p>Error in node part for file %1 and node %2</p>" ).
+ arg( SF->name() ).
+ arg( NNI->netNode()->nodeName() );
+ return S;
+ }
+
+ if( SF->postNodeSection( NNI, -1 ) ) {
+ S = qApp->translate( "NetworkSettings",
+ "<p>Error in postNodeSection for file %1 and node %2</p>" ).
+ arg( SF->name() ).
+ arg( NNI->netNode()->nodeName() );
+ return S;
+ }
+ }
+
+ // generated some data
+ if( SF->postNodeSection( NNI, -1 ) ) {
+ S = qApp->translate( "NetworkSettings",
+ "<p>Error in postNodeSection for file %1 and node %2</p>" ).
+ arg( SF->name() ).
+ arg( NNI->netNode()->nodeName() );
+ return S;
}
*SF << endl;
}
+ if( CurDev ) {
+ // generate 'entry' for every combination of device and profile
+ // each node delegates to deeper level
+ for( int i = 0; i < CurDev->count(); i ++ ) {
+ if( SF->postDeviceSection( NNI, i ) ) {
+ S = qApp->translate( "NetworkSettings",
+ "<p>Error in postDeviceSection for file %1 and node %2</p>" ).
+ arg( SF->name() ).
+ arg( NNI->netNode()->nodeName() );
+ return S;
+ }
+ }
+ } else {
+ if( SF->postDeviceSection( NNI, -1 ) ) {
+ S = qApp->translate( "NetworkSettings",
+ "<p>Error in postDeviceSection for file %1 and node %2</p>" ).
+ arg( SF->name() ).
+ arg( NNI->netNode()->nodeName() );
+ return S;
+ }
+ }
+ }
+
if( SF->postSection() ) {
S = qApp->translate( "NetworkSettings",
"<p>Error in postSection for file %1</p>" ).
arg( SF->name() );
return S;
}
+
} while( 0 );
SF->close();
}
}
Force = 0;
return S;
diff --git a/noncore/settings/networksettings2/ppp/ppp_NN.cpp b/noncore/settings/networksettings2/ppp/ppp_NN.cpp
index 309c9a1..51d17ec 100644
--- a/noncore/settings/networksettings2/ppp/ppp_NN.cpp
+++ b/noncore/settings/networksettings2/ppp/ppp_NN.cpp
@@ -41,22 +41,29 @@ const char * PPPNetNode::provides( void ) {
bool PPPNetNode::generateProperFilesFor(
ANetNodeInstance * ) {
return 1;
}
-bool PPPNetNode::hasDataFor( const QString & ) {
+bool PPPNetNode::hasDataFor( const QString &, bool ) {
return 0;
}
bool PPPNetNode::generateDataForCommonFile(
SystemFile & ,
long,
ANetNodeInstance * ) {
return 1;
}
+bool PPPNetNode::generateDeviceDataForCommonFile(
+ SystemFile & ,
+ long ,
+ ANetNodeInstance * ) {
+ return 1;
+}
+
extern "C" {
void create_plugin( QList<ANetNode> & PNN ) {
PNN.append( new PPPNetNode() );
}
}
diff --git a/noncore/settings/networksettings2/ppp/ppp_NN.h b/noncore/settings/networksettings2/ppp/ppp_NN.h
index 3f9a338..8d56e7f 100644
--- a/noncore/settings/networksettings2/ppp/ppp_NN.h
+++ b/noncore/settings/networksettings2/ppp/ppp_NN.h
@@ -25,15 +25,17 @@ public:
virtual ANetNodeInstance * createInstance( void );
virtual const char ** needs( void );
virtual const char * provides( void );
virtual bool generateProperFilesFor( ANetNodeInstance * NNI );
- virtual bool hasDataFor( const QString & S );
+ virtual bool hasDataFor( const QString & S, bool DS );
virtual bool generateDataForCommonFile(
SystemFile & SF, long DevNr, ANetNodeInstance * NNI );
+ virtual bool generateDeviceDataForCommonFile(
+ SystemFile & SF, long DevNr, ANetNodeInstance * NNI );
private:
};
extern "C"
diff --git a/noncore/settings/networksettings2/ppp/ppprun.cpp b/noncore/settings/networksettings2/ppp/ppprun.cpp
index 4ac0c5a..8c75df3 100644
--- a/noncore/settings/networksettings2/ppp/ppprun.cpp
+++ b/noncore/settings/networksettings2/ppp/ppprun.cpp
@@ -13,21 +13,13 @@ void PPPRun::detectState( NodeCollection * NC ) {
} else {
NC->setCurrentState( Available );
}
} else {
NC->setCurrentState( Off ); // at least this
// but could also be unavailable
- ANetNodeInstance * NNI;
- RuntimeInfo * RI;
- NNI = AsDevice::netNode();
- printf( "%p\n", NNI );
- NNI = NNI->nextNode();
- printf( "%p\n", NNI );
- RI = NNI->runtime();
- printf( "%p\n", RI );
- RI->detectState( NC );
+ AsDevice::netNode()->nextNode()->runtime()->detectState( NC );
}
}
bool PPPRun::setState( NodeCollection * NC, Action_t A ) {
switch( A ) {
case Activate :
diff --git a/noncore/settings/networksettings2/ppp/ppprun.h b/noncore/settings/networksettings2/ppp/ppprun.h
index abb9176..765aff2 100644
--- a/noncore/settings/networksettings2/ppp/ppprun.h
+++ b/noncore/settings/networksettings2/ppp/ppprun.h
@@ -12,14 +12,20 @@ public :
PPPRun( ANetNodeInstance * NNI,
PPPData & Data );
virtual QString genNic( long NicNr )
{ QString S; return S.sprintf( "ppp%ld", NicNr ); }
+ virtual AsDevice * asDevice( void )
+ { return (AsDevice *)this; }
+ virtual AsConnection * asConnection( void )
+ { return (AsConnection *)this; }
+
virtual AsDevice * device( void )
- { return AsDevice::asDevice(); }
+ { return (AsDevice *)this; }
+
virtual RuntimeInfo * runtimeInfo( void )
{ return ( AsConnection *)this; }
protected :
void detectState( NodeCollection * NC );
diff --git a/noncore/settings/networksettings2/profile/profile_NN.cpp b/noncore/settings/networksettings2/profile/profile_NN.cpp
index c39b86f..fcf1ca6 100644
--- a/noncore/settings/networksettings2/profile/profile_NN.cpp
+++ b/noncore/settings/networksettings2/profile/profile_NN.cpp
@@ -40,22 +40,29 @@ const char * ProfileNetNode::provides( void ) {
bool ProfileNetNode::generateProperFilesFor(
ANetNodeInstance * ) {
return 1;
}
-bool ProfileNetNode::hasDataFor( const QString & ) {
+bool ProfileNetNode::hasDataFor( const QString &, bool ) {
return 0;
}
bool ProfileNetNode::generateDataForCommonFile(
SystemFile & ,
long,
ANetNodeInstance * ) {
return 1;
}
+bool ProfileNetNode::generateDeviceDataForCommonFile(
+ SystemFile & ,
+ long ,
+ ANetNodeInstance * ) {
+ return 1;
+}
+
extern "C" {
void create_plugin( QList<ANetNode> & PNN ) {
PNN.append( new ProfileNetNode() );
}
}
diff --git a/noncore/settings/networksettings2/profile/profile_NN.h b/noncore/settings/networksettings2/profile/profile_NN.h
index 3c06947..b64a6dd 100644
--- a/noncore/settings/networksettings2/profile/profile_NN.h
+++ b/noncore/settings/networksettings2/profile/profile_NN.h
@@ -25,15 +25,17 @@ public:
virtual ANetNodeInstance * createInstance( void );
virtual const char ** needs( void );
virtual const char * provides( void );
virtual bool generateProperFilesFor( ANetNodeInstance * NNI );
- virtual bool hasDataFor( const QString & S );
+ virtual bool hasDataFor( const QString & S, bool DS );
virtual bool generateDataForCommonFile(
SystemFile & SF, long DevNr, ANetNodeInstance * NNI );
+ virtual bool generateDeviceDataForCommonFile(
+ SystemFile & SF, long DevNr, ANetNodeInstance * NNI );
private:
};
extern "C"
diff --git a/noncore/settings/networksettings2/profile/profilerun.cpp b/noncore/settings/networksettings2/profile/profilerun.cpp
index 90c37ed..feebf86 100644
--- a/noncore/settings/networksettings2/profile/profilerun.cpp
+++ b/noncore/settings/networksettings2/profile/profilerun.cpp
@@ -16,31 +16,29 @@ bool ProfileRun::setState( NodeCollection * NC, Action_t A ) {
ANetNodeInstance * NNNI;
NNNI = netNode()->nextNode();
switch ( A ) {
case Enable :
if( NC->currentState() == Disabled ) {
+ Data->Disabled = 0;
NC->setCurrentState( Off ); // at least
// ... but request deeper
NNNI->runtime()->detectState(NC);
- return 1;
}
return 1;
case Disable :
- if( NC->currentState() == IsUp ) {
- // bring down -> make available
- NNNI->runtime()->setState(NC, Down);
- }
- if( NC->currentState() == Available ) {
- // make unavailable
- NNNI->runtime()->setState(NC, Deactivate);
- }
- if( NC->currentState() > Available ) {
- // could not disable
+ switch( NC->currentState() ) {
+ case IsUp :
+ case Available :
+ // bring Deactivate (will bring down)
+ if( ! NNNI->runtime()->setState(NC, Deactivate) )
return 0;
+ default :
+ break;
}
+ Data->Disabled = 1;
NC->setCurrentState( Disabled );
return 1;
default :
break;
}
return NNNI->runtime()->setState(NC, A);
diff --git a/noncore/settings/networksettings2/profile/profilerun.h b/noncore/settings/networksettings2/profile/profilerun.h
index d3797b5..6e8385c 100644
--- a/noncore/settings/networksettings2/profile/profilerun.h
+++ b/noncore/settings/networksettings2/profile/profilerun.h
@@ -17,12 +17,15 @@ public :
bool canSetState( State_t Curr, Action_t A );
bool handlesInterface( const QString & I );
virtual const QString & description( void )
{ return Data->Description; }
+
+ virtual AsFullSetup * asFullSetup( void )
+ { return (AsFullSetup *)this; }
private :
ProfileData * Data;
};
#endif
diff --git a/noncore/settings/networksettings2/usb/usb_NN.cpp b/noncore/settings/networksettings2/usb/usb_NN.cpp
index c65771d..be4a2bc 100644
--- a/noncore/settings/networksettings2/usb/usb_NN.cpp
+++ b/noncore/settings/networksettings2/usb/usb_NN.cpp
@@ -39,22 +39,29 @@ const char * USBNetNode::provides( void ) {
bool USBNetNode::generateProperFilesFor(
ANetNodeInstance * ) {
return 1;
}
-bool USBNetNode::hasDataFor( const QString & S ) {
+bool USBNetNode::hasDataFor( const QString & S, bool ) {
return (S== "interfaces");
}
bool USBNetNode::generateDataForCommonFile(
SystemFile & S ,
long DevNr,
ANetNodeInstance * NNI) {
return ((AUSB *)NNI)->generateDataForCommonFile(S, DevNr);
}
+bool USBNetNode::generateDeviceDataForCommonFile(
+ SystemFile & S ,
+ long DevNr,
+ ANetNodeInstance * NNI) {
+ return ((AUSB *)NNI)->generateDeviceDataForCommonFile(S, DevNr);
+}
+
extern "C" {
void create_plugin( QList<ANetNode> & PNN ) {
PNN.append( new USBNetNode() );
}
}
diff --git a/noncore/settings/networksettings2/usb/usb_NN.h b/noncore/settings/networksettings2/usb/usb_NN.h
index 8b97452..8ff5289 100644
--- a/noncore/settings/networksettings2/usb/usb_NN.h
+++ b/noncore/settings/networksettings2/usb/usb_NN.h
@@ -25,15 +25,17 @@ public:
virtual ANetNodeInstance * createInstance( void );
virtual const char ** needs( void );
virtual const char * provides( void );
virtual bool generateProperFilesFor( ANetNodeInstance * NNI );
- virtual bool hasDataFor( const QString & S );
+ virtual bool hasDataFor( const QString & S, bool DeviceSpec );
virtual bool generateDataForCommonFile(
SystemFile & SF, long DevNr, ANetNodeInstance * NNI );
+ virtual bool generateDeviceDataForCommonFile(
+ SystemFile & SF, long DevNr, ANetNodeInstance * NNI );
private:
};
extern "C"
diff --git a/noncore/settings/networksettings2/usb/usb_NNI.cpp b/noncore/settings/networksettings2/usb/usb_NNI.cpp
index 4729416..6fcd6d5 100644
--- a/noncore/settings/networksettings2/usb/usb_NNI.cpp
+++ b/noncore/settings/networksettings2/usb/usb_NNI.cpp
@@ -40,7 +40,18 @@ bool AUSB::generateDataForCommonFile( SystemFile & S, long DevNr ) {
// generate mapping stanza for this interface
S << " pre-up " << QPEApplication::qpeDir() << "bin/setmacaddress.sh " << NIC << " || true" << endl;
}
return 0;
}
+bool AUSB::generateDeviceDataForCommonFile( SystemFile & S, long DevNr ) {
+ AsDevice * Dev = runtime()->device();
+ QString NIC = Dev->genNic( DevNr );
+ if( S.name() == "interfaces" ) {
+ // generate mapping stanza for this interface
+ S << "# check if " << NIC << " can be brought UP" << endl;
+ S << "mapping " << NIC << endl;
+ S << " script networksettings2-request" << endl << endl;
+ }
+ return 0;
+}
diff --git a/noncore/settings/networksettings2/usb/usb_NNI.h b/noncore/settings/networksettings2/usb/usb_NNI.h
index b09f17a..5dead36 100644
--- a/noncore/settings/networksettings2/usb/usb_NNI.h
+++ b/noncore/settings/networksettings2/usb/usb_NNI.h
@@ -25,12 +25,13 @@ public :
}
virtual void * data( void )
{ return (void *)&Data; }
bool generateDataForCommonFile( SystemFile & S, long DevNr );
+ bool generateDeviceDataForCommonFile( SystemFile & S, long DevNr );
protected :
virtual void setSpecificAttribute( QString & Attr, QString & Value );
virtual void saveSpecificAttribute( QTextStream & TS );
diff --git a/noncore/settings/networksettings2/usb/usbrun.cpp b/noncore/settings/networksettings2/usb/usbrun.cpp
index 49b5a77..3007e79 100644
--- a/noncore/settings/networksettings2/usb/usbrun.cpp
+++ b/noncore/settings/networksettings2/usb/usbrun.cpp
@@ -31,31 +31,42 @@ void USBRun::detectState( NodeCollection * NC ) {
return;
}
}
}
}
- fprintf( stderr, "NUP\n" );
- // definitively not up
+ fprintf( stderr, "Assigned %p\n", assignedInterface() );
+ if( ( Run = assignedInterface() ) ) {
+ // we already have an interface assigned -> still present ?
+ if( ! Run->IsUp ) {
+ // usb is still free -> keep assignment
+ NC->setCurrentState( Available );
+ return;
+ } // else interface is up but NOT us -> some other profile
+ }
+
+ // nothing (valid) assigned to us
assignInterface( 0 );
// find possible interface
for( QDictIterator<InterfaceInfo> It(Sys.interfaces());
It.current();
++It ) {
Run = It.current();
+
fprintf( stderr, "%s %d %d=%d %d\n",
Run->Name.latin1(),
handlesInterface( Run->Name ),
Run->CardType, ARPHRD_ETHER,
! Run->IsUp );
+
if( handlesInterface( Run->Name ) &&
Run->CardType == ARPHRD_ETHER &&
! Run->IsUp
) {
- fprintf( stderr, "OFF\n" );
+ fprintf( stderr, "Released(OFF)\n" );
// proper type, and Not UP -> free
NC->setCurrentState( Off );
return;
}
}
// no free found
@@ -80,23 +91,23 @@ bool USBRun::setState( NodeCollection * NC, Action_t A ) {
return 0;
}
// because we were OFF the interface
// we get back is NOT assigned
N->assignNode( netNode() );
assignInterface( N );
+ fprintf( stderr, "Assing %p\n", N );
NC->setCurrentState( Available );
return 1;
}
case Deactivate :
if( NC->currentState() == IsUp ) {
// bring down first
if( ! connection()->setState( Down ) )
// could not ...
return 0;
- }
- if( NC->currentState() != Available ) {
+ } else if( NC->currentState() != Available ) {
return 1;
}
assignedInterface()->assignNode( 0 ); // release
assignInterface( 0 );
NC->setCurrentState( Off );
return 1;
diff --git a/noncore/settings/networksettings2/usb/usbrun.h b/noncore/settings/networksettings2/usb/usbrun.h
index c9c9121..60f9fe8 100644
--- a/noncore/settings/networksettings2/usb/usbrun.h
+++ b/noncore/settings/networksettings2/usb/usbrun.h
@@ -15,15 +15,18 @@ public :
Pat( "usb[0-9abcdef]" )
{ }
virtual long count( void )
{ return 1; }
virtual QString genNic( long nr );
+
virtual AsDevice * device( void )
- { return asDevice(); }
+ { return (AsDevice *)this; }
+ virtual AsDevice * asDevice( void )
+ { return (AsDevice *)this; }
protected :
void detectState( NodeCollection * );
bool setState( NodeCollection * , Action_t A );
bool canSetState( State_t , Action_t A );
diff --git a/noncore/settings/networksettings2/vpn/vpn_NN.cpp b/noncore/settings/networksettings2/vpn/vpn_NN.cpp
index c800929..f570fb2 100644
--- a/noncore/settings/networksettings2/vpn/vpn_NN.cpp
+++ b/noncore/settings/networksettings2/vpn/vpn_NN.cpp
@@ -40,22 +40,29 @@ const char * VPNNetNode::provides( void ) {
bool VPNNetNode::generateProperFilesFor(
ANetNodeInstance * ) {
return 1;
}
-bool VPNNetNode::hasDataFor( const QString & ) {
+bool VPNNetNode::hasDataFor( const QString &, bool ) {
return 0;
}
bool VPNNetNode::generateDataForCommonFile(
SystemFile & ,
long,
ANetNodeInstance * ) {
return 1;
}
+bool VPNNetNode::generateDeviceDataForCommonFile(
+ SystemFile & ,
+ long ,
+ ANetNodeInstance * ) {
+ return 1;
+}
+
extern "C" {
void create_plugin( QList<ANetNode> & PNN ) {
PNN.append( new VPNNetNode() );
}
}
diff --git a/noncore/settings/networksettings2/vpn/vpn_NN.h b/noncore/settings/networksettings2/vpn/vpn_NN.h
index a113ab9..cdb5117 100644
--- a/noncore/settings/networksettings2/vpn/vpn_NN.h
+++ b/noncore/settings/networksettings2/vpn/vpn_NN.h
@@ -25,15 +25,17 @@ public:
virtual ANetNodeInstance * createInstance( void );
virtual const char ** needs( void );
virtual const char * provides( void );
virtual bool generateProperFilesFor( ANetNodeInstance * NNI );
- virtual bool hasDataFor( const QString & S );
+ virtual bool hasDataFor( const QString & S, bool DS );
virtual bool generateDataForCommonFile(
SystemFile & SF, long DevNr, ANetNodeInstance * NNI );
+ virtual bool generateDeviceDataForCommonFile(
+ SystemFile & SF, long DevNr, ANetNodeInstance * NNI );
private:
};
extern "C"
diff --git a/noncore/settings/networksettings2/vpn/vpnrun.h b/noncore/settings/networksettings2/vpn/vpnrun.h
index c221fd0..4d26298 100644
--- a/noncore/settings/networksettings2/vpn/vpnrun.h
+++ b/noncore/settings/networksettings2/vpn/vpnrun.h
@@ -9,12 +9,14 @@ class VPNRun : public AsConnection {
public :
VPNRun( ANetNodeInstance * NNI, VPNData & Data ) :
AsConnection( NNI )
{ }
+ virtual AsConnection * asConnection( void )
+ { return (AsConnection *)this; }
protected :
void detectState( NodeCollection * )
{ }
bool setState( NodeCollection *, Action_t )
diff --git a/noncore/settings/networksettings2/wlan/wlan_NN.cpp b/noncore/settings/networksettings2/wlan/wlan_NN.cpp
index 5a26e41..e1e20c0 100644
--- a/noncore/settings/networksettings2/wlan/wlan_NN.cpp
+++ b/noncore/settings/networksettings2/wlan/wlan_NN.cpp
@@ -39,22 +39,29 @@ const char * WLanNetNode::provides( void ) {
bool WLanNetNode::generateProperFilesFor(
ANetNodeInstance * ) {
return 1;
}
-bool WLanNetNode::hasDataFor( const QString & ) {
- return 0;
+bool WLanNetNode::hasDataFor( const QString & S, bool DS ) {
+ return DS && S == "interfaces";
}
bool WLanNetNode::generateDataForCommonFile(
SystemFile & ,
long,
ANetNodeInstance * ) {
return 1;
}
+bool WLanNetNode::generateDeviceDataForCommonFile(
+ SystemFile & S,
+ long DevNr,
+ ANetNodeInstance * NNI ) {
+ return ((AWLan *)NNI)->generateDeviceDataForCommonFile(S, DevNr);
+}
+
extern "C" {
void create_plugin( QList<ANetNode> & PNN ) {
PNN.append( new WLanNetNode() );
}
}
diff --git a/noncore/settings/networksettings2/wlan/wlan_NN.h b/noncore/settings/networksettings2/wlan/wlan_NN.h
index 0728a79..9111995 100644
--- a/noncore/settings/networksettings2/wlan/wlan_NN.h
+++ b/noncore/settings/networksettings2/wlan/wlan_NN.h
@@ -25,15 +25,17 @@ public:
virtual ANetNodeInstance * createInstance( void );
virtual const char ** needs( void );
virtual const char * provides( void );
virtual bool generateProperFilesFor( ANetNodeInstance * NNI );
- virtual bool hasDataFor( const QString & S );
+ virtual bool hasDataFor( const QString & S, bool DS );
virtual bool generateDataForCommonFile(
SystemFile & SF, long DevNr, ANetNodeInstance * NNI );
+ virtual bool generateDeviceDataForCommonFile(
+ SystemFile & SF, long DevNr, ANetNodeInstance * NNI );
private:
};
extern "C"
diff --git a/noncore/settings/networksettings2/wlan/wlan_NNI.cpp b/noncore/settings/networksettings2/wlan/wlan_NNI.cpp
index 92f3457..8b948e0 100644
--- a/noncore/settings/networksettings2/wlan/wlan_NNI.cpp
+++ b/noncore/settings/networksettings2/wlan/wlan_NNI.cpp
@@ -25,6 +25,18 @@ QString AWLan::acceptable( void ) {
void AWLan::commit( void ) {
if( GUI && GUI->commit( Data ) )
setModified( 1 );
}
+bool AWLan::generateDeviceDataForCommonFile( SystemFile & S, long DevNr ) {
+ AsDevice * Dev = runtime()->device();
+ QString NIC = Dev->genNic( DevNr );
+
+ if( S.name() == "interfaces" ) {
+ // generate mapping stanza for this interface
+ S << "# check if " << NIC << " can be brought UP" << endl;
+ S << "mapping " << NIC << endl;
+ S << " script networksettings2-request" << endl << endl;
+ }
+ return 0;
+}
diff --git a/noncore/settings/networksettings2/wlan/wlan_NNI.h b/noncore/settings/networksettings2/wlan/wlan_NNI.h
index 8b695b5..e464c84 100644
--- a/noncore/settings/networksettings2/wlan/wlan_NNI.h
+++ b/noncore/settings/networksettings2/wlan/wlan_NNI.h
@@ -24,12 +24,14 @@ public :
return RT;
}
virtual void * data( void )
{ return (void *)&Data; }
+ bool generateDeviceDataForCommonFile( SystemFile & S, long DevNr );
+
protected :
virtual void setSpecificAttribute( QString & Attr, QString & Value );
virtual void saveSpecificAttribute( QTextStream & TS );
private :
diff --git a/noncore/settings/networksettings2/wlan/wlanrun.h b/noncore/settings/networksettings2/wlan/wlanrun.h
index 4cbb059..b853262 100644
--- a/noncore/settings/networksettings2/wlan/wlanrun.h
+++ b/noncore/settings/networksettings2/wlan/wlanrun.h
@@ -16,13 +16,15 @@ public :
virtual long count( void )
{ return 2; }
virtual QString genNic( long nr )
{ QString S; return S.sprintf( "wlan%ld", nr ); }
virtual AsDevice * device( void )
- { return asDevice(); }
+ { return (AsDevice *)this; }
+ virtual AsDevice * asDevice( void )
+ { return (AsDevice *)this; }
protected :
void detectState( NodeCollection * )
{ }