summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings2/profile/profile_NNI.cpp
Side-by-side diff
Diffstat (limited to 'noncore/settings/networksettings2/profile/profile_NNI.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings2/profile/profile_NNI.cpp27
1 files changed, 23 insertions, 4 deletions
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
@@ -29,30 +29,49 @@ void AProfile::setSpecificAttribute( QString & Attr, QString & Value ) {
void AProfile::saveSpecificAttribute( QTextStream & TS ) {
TS << "automatic=" << ((Data.Automatic) ? "yes" : "no") << endl;
TS << "preconfirm=" << ((Data.Confirm) ? "yes" : "no") << endl;
TS << "disabled=" << ((Data.Disabled) ? "yes" : "no") << endl;
TS << "triggervpn=" << ((Data.TriggerVPN) ? "yes" : "no") << endl;
TS << "description=" << Data.Description << endl;
}
QWidget * AProfile::edit( QWidget * parent ) {
GUI = new ProfileEdit( parent, this );
GUI->showData( Data );
return GUI;
}
QString AProfile::acceptable( void ) {
return ( GUI ) ? GUI->acceptable( ) : QString();
}
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;
}
+
+