summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings2/profile
authorwimpie <wimpie>2004-08-12 12:46:55 (UTC)
committer wimpie <wimpie>2004-08-12 12:46:55 (UTC)
commit8f215ba9ceb395f262517855a99d7d2d303ca760 (patch) (side-by-side diff)
treeaa5f9b14c249217b4d3fc30f4771bdaf1c3545d3 /noncore/settings/networksettings2/profile
parentef64880308b5035cc8ca2e4e79325db613af525b (diff)
downloadopie-8f215ba9ceb395f262517855a99d7d2d303ca760.zip
opie-8f215ba9ceb395f262517855a99d7d2d303ca760.tar.gz
opie-8f215ba9ceb395f262517855a99d7d2d303ca760.tar.bz2
MANY changes
- now generates peers/pap-chap secrets files (no chatscript yet) (not all usefull ppp options included yet) - still not ready for prime time yet
Diffstat (limited to 'noncore/settings/networksettings2/profile') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings2/profile/profile_NN.cpp13
-rw-r--r--noncore/settings/networksettings2/profile/profile_NN.h8
-rw-r--r--noncore/settings/networksettings2/profile/profile_NNI.cpp27
-rw-r--r--noncore/settings/networksettings2/profile/profile_NNI.h23
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
@@ -9,7 +9,7 @@ static const char * ProfileNeeds[] =
/**
* Constructor, find all of the possible interfaces
*/
-ProfileNetNode::ProfileNetNode() : ANetNode( tr("Regular profile")) {
+ProfileNetNode::ProfileNetNode() : ANetNode( tr("Regular connection profile")) {
}
/**
@@ -38,17 +38,6 @@ 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 & ) {
}
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
@@ -18,18 +18,10 @@ public:
{ 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 );
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
@@ -50,9 +50,28 @@ void AProfile::commit( void ) {
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
@@ -14,26 +14,25 @@ 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 :