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) (unidiff)
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
@@ -6,13 +6,13 @@ static const char * ProfileNeeds[] =
6 0 6 0
7 }; 7 };
8 8
9/** 9/**
10 * Constructor, find all of the possible interfaces 10 * Constructor, find all of the possible interfaces
11 */ 11 */
12ProfileNetNode::ProfileNetNode() : ANetNode( tr("Regular profile")) { 12ProfileNetNode::ProfileNetNode() : ANetNode( tr("Regular connection profile")) {
13} 13}
14 14
15/** 15/**
16 * Delete any interfaces that we own. 16 * Delete any interfaces that we own.
17 */ 17 */
18ProfileNetNode::~ProfileNetNode(){ 18ProfileNetNode::~ProfileNetNode(){
@@ -35,23 +35,12 @@ const char ** ProfileNetNode::needs( void ) {
35} 35}
36 36
37const char * ProfileNetNode::provides( void ) { 37const char * ProfileNetNode::provides( void ) {
38 return "fullsetup"; 38 return "fullsetup";
39} 39}
40 40
41bool ProfileNetNode::generateProperFilesFor(
42 ANetNodeInstance * ) {
43 return 0;
44}
45
46bool ProfileNetNode::generateDeviceDataForCommonFile(
47 SystemFile & ,
48 long ) {
49 return 0;
50}
51
52void ProfileNetNode::setSpecificAttribute( QString & , QString & ) { 41void ProfileNetNode::setSpecificAttribute( QString & , QString & ) {
53} 42}
54 43
55void ProfileNetNode::saveSpecificAttribute( QTextStream & ) { 44void ProfileNetNode::saveSpecificAttribute( QTextStream & ) {
56} 45}
57 46
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
@@ -15,24 +15,16 @@ public:
15 virtual ~ProfileNetNode(); 15 virtual ~ProfileNetNode();
16 16
17 virtual const QString pixmapName() 17 virtual const QString pixmapName()
18 { return "Devices/commprofile"; } 18 { return "Devices/commprofile"; }
19 19
20 virtual const QString nodeDescription() ; 20 virtual const QString nodeDescription() ;
21
22 virtual ANetNodeInstance * createInstance( void ); 21 virtual ANetNodeInstance * createInstance( void );
23
24 virtual const char ** needs( void ); 22 virtual const char ** needs( void );
25 virtual const char * provides( void ); 23 virtual const char * provides( void );
26 24
27 virtual bool generateProperFilesFor( ANetNodeInstance * NNI );
28 virtual bool hasDataFor( const QString & )
29 { return 0; }
30 virtual bool generateDeviceDataForCommonFile(
31 SystemFile & SF, long DevNr);
32
33private: 25private:
34 26
35 virtual void setSpecificAttribute( QString & Attr, QString & Value ); 27 virtual void setSpecificAttribute( QString & Attr, QString & Value );
36 virtual void saveSpecificAttribute( QTextStream & TS ); 28 virtual void saveSpecificAttribute( QTextStream & TS );
37}; 29};
38 30
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
@@ -47,12 +47,31 @@ QString AProfile::acceptable( void ) {
47 47
48void AProfile::commit( void ) { 48void AProfile::commit( void ) {
49 if( GUI && GUI->commit( Data ) ) 49 if( GUI && GUI->commit( Data ) )
50 setModified( 1 ); 50 setModified( 1 );
51} 51}
52 52
53bool AProfile::generateDataForCommonFile( 53short AProfile::generateFileEmbedded( const QString & ID,
54 SystemFile & , 54 const QString & Path,
55 long) { 55 QTextStream & TS,
56 return 1; 56 long DevNr ) {
57
58 short rvl, rvd;
59
60 rvl = 1;
61
62 if( ID == "interfaces" ) {
63 Log(("Generate Profile for %s\n", ID.latin1() ));
64 if( Data.TriggerVPN ) {
65 // this profile triggers VPN -> insert trigger
66 TS << " up networksettings2 --triggervpn"
67 << endl;
68 rvl = 0;
69 }
70 }
71 rvd = ANetNodeInstance::generateFileEmbedded( ID, Path, TS, DevNr );
72 return (rvd == 2 || rvl == 2 ) ? 2 :
73 (rvd == 0 || rvl == 0 ) ? 0 : 1;
57} 74}
58 75
76
77
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
@@ -11,32 +11,31 @@ class ProfileEdit;
11class AProfile : public ANetNodeInstance { 11class AProfile : public ANetNodeInstance {
12 12
13public : 13public :
14 14
15 AProfile( ProfileNetNode * PNN ); 15 AProfile( ProfileNetNode * PNN );
16 16
17 RuntimeInfo * runtime( void )
18 { return
19 ( RT ) ? RT : ( RT = new ProfileRun( this, Data ) );
20 }
21
17 QWidget * edit( QWidget * parent ); 22 QWidget * edit( QWidget * parent );
18 QString acceptable( void ); 23 QString acceptable( void );
19 void commit( void ); 24 void commit( void );
20 25
21 const QString & description( void )
22 { return Data.Description; }
23 RuntimeInfo * runtime( void )
24 { if( RT == 0 )
25 RT = new ProfileRun( this, Data );
26 return RT;
27 }
28
29 virtual void * data( void ) 26 virtual void * data( void )
30 { return (void *)&Data; } 27 { return (void *)&Data; }
31 28
32 virtual bool hasDataFor( const QString & ) 29 virtual short generateFileEmbedded( const QString & ID,
33 { return 0; } 30 const QString & Path,
31 QTextStream & TS,
32 long DevNr );
34 33
35 virtual bool generateDataForCommonFile( 34 const QString & description( void )
36 SystemFile & SF, long DevNr); 35 { return Data.Description; }
37 36
38protected : 37protected :
39 38
40 virtual void setSpecificAttribute( QString & Attr, QString & Value ); 39 virtual void setSpecificAttribute( QString & Attr, QString & Value );
41 virtual void saveSpecificAttribute( QTextStream & TS ); 40 virtual void saveSpecificAttribute( QTextStream & TS );
42 41