Diffstat (limited to 'noncore/settings/networksettings2/profile') (more/less context) (show whitespace changes)
4 files changed, 23 insertions, 13 deletions
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 @@ -43,7 +43,7 @@ bool ProfileNetNode::generateProperFilesFor( return 1; } -bool ProfileNetNode::hasDataFor( const QString & ) { +bool ProfileNetNode::hasDataFor( const QString &, bool ) { return 0; } @@ -54,6 +54,13 @@ bool ProfileNetNode::generateDataForCommonFile( 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 @@ -28,9 +28,11 @@ public: 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: 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 @@ -19,25 +19,23 @@ bool ProfileRun::setState( NodeCollection * NC, Action_t A ) { 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 : 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 @@ -20,6 +20,9 @@ public : virtual const QString & description( void ) { return Data->Description; } + + virtual AsFullSetup * asFullSetup( void ) + { return (AsFullSetup *)this; } private : ProfileData * Data; |