Diffstat (limited to 'noncore/settings/networksettings2/profile') (more/less context) (ignore whitespace changes)
4 files changed, 35 insertions, 36 deletions
diff --git a/noncore/settings/networksettings2/profile/profile_NN.cpp b/noncore/settings/networksettings2/profile/profile_NN.cpp index 59c34a3..945b48d 100644 --- a/noncore/settings/networksettings2/profile/profile_NN.cpp +++ b/noncore/settings/networksettings2/profile/profile_NN.cpp @@ -8,9 +8,9 @@ static const char * ProfileNeeds[] = /** * Constructor, find all of the possible interfaces */ -ProfileNetNode::ProfileNetNode() : ANetNode( tr("Regular profile")) { +ProfileNetNode::ProfileNetNode() : ANetNode( tr("Regular connection profile")) { } /** * Delete any interfaces that we own. @@ -37,19 +37,8 @@ const char ** ProfileNetNode::needs( void ) { const char * ProfileNetNode::provides( void ) { return "fullsetup"; } -bool ProfileNetNode::generateProperFilesFor( - ANetNodeInstance * ) { - return 0; -} - -bool ProfileNetNode::generateDeviceDataForCommonFile( - SystemFile & , - long ) { - return 0; -} - void ProfileNetNode::setSpecificAttribute( QString & , QString & ) { } void ProfileNetNode::saveSpecificAttribute( QTextStream & ) { diff --git a/noncore/settings/networksettings2/profile/profile_NN.h b/noncore/settings/networksettings2/profile/profile_NN.h index e602bd7..1f1ee2c 100644 --- a/noncore/settings/networksettings2/profile/profile_NN.h +++ b/noncore/settings/networksettings2/profile/profile_NN.h @@ -17,20 +17,12 @@ public: virtual const QString pixmapName() { return "Devices/commprofile"; } virtual const QString nodeDescription() ; - virtual ANetNodeInstance * createInstance( void ); - virtual const char ** needs( void ); virtual const char * provides( void ); - virtual bool generateProperFilesFor( ANetNodeInstance * NNI ); - virtual bool hasDataFor( const QString & ) - { return 0; } - virtual bool generateDeviceDataForCommonFile( - SystemFile & SF, long DevNr); - private: virtual void setSpecificAttribute( QString & Attr, QString & Value ); virtual void saveSpecificAttribute( QTextStream & TS ); diff --git a/noncore/settings/networksettings2/profile/profile_NNI.cpp b/noncore/settings/networksettings2/profile/profile_NNI.cpp index cb52b2a..f0f0b97 100644 --- a/noncore/settings/networksettings2/profile/profile_NNI.cpp +++ b/noncore/settings/networksettings2/profile/profile_NNI.cpp @@ -49,10 +49,29 @@ void AProfile::commit( void ) { if( GUI && GUI->commit( Data ) ) setModified( 1 ); } -bool AProfile::generateDataForCommonFile( - SystemFile & , - long) { - return 1; +short AProfile::generateFileEmbedded( const QString & ID, + const QString & Path, + QTextStream & TS, + long DevNr ) { + + short rvl, rvd; + + rvl = 1; + + if( ID == "interfaces" ) { + Log(("Generate Profile for %s\n", ID.latin1() )); + if( Data.TriggerVPN ) { + // this profile triggers VPN -> insert trigger + TS << " up networksettings2 --triggervpn" + << endl; + rvl = 0; + } + } + rvd = ANetNodeInstance::generateFileEmbedded( ID, Path, TS, DevNr ); + return (rvd == 2 || rvl == 2 ) ? 2 : + (rvd == 0 || rvl == 0 ) ? 0 : 1; } + + diff --git a/noncore/settings/networksettings2/profile/profile_NNI.h b/noncore/settings/networksettings2/profile/profile_NNI.h index 2c2db7f..957f4af 100644 --- a/noncore/settings/networksettings2/profile/profile_NNI.h +++ b/noncore/settings/networksettings2/profile/profile_NNI.h @@ -13,28 +13,27 @@ class AProfile : public ANetNodeInstance { public : AProfile( ProfileNetNode * PNN ); + RuntimeInfo * runtime( void ) + { return + ( RT ) ? RT : ( RT = new ProfileRun( this, Data ) ); + } + QWidget * edit( QWidget * parent ); QString acceptable( void ); void commit( void ); - const QString & description( void ) - { return Data.Description; } - RuntimeInfo * runtime( void ) - { if( RT == 0 ) - RT = new ProfileRun( this, Data ); - return RT; - } - virtual void * data( void ) { return (void *)&Data; } - virtual bool hasDataFor( const QString & ) - { return 0; } + virtual short generateFileEmbedded( const QString & ID, + const QString & Path, + QTextStream & TS, + long DevNr ); - virtual bool generateDataForCommonFile( - SystemFile & SF, long DevNr); + const QString & description( void ) + { return Data.Description; } protected : virtual void setSpecificAttribute( QString & Attr, QString & Value ); |