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 @@ -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 |