summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings2/profile/profile_NNI.cpp
Unidiff
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.cpp48
1 files changed, 48 insertions, 0 deletions
diff --git a/noncore/settings/networksettings2/profile/profile_NNI.cpp b/noncore/settings/networksettings2/profile/profile_NNI.cpp
new file mode 100644
index 0000000..bc0118e
--- a/dev/null
+++ b/noncore/settings/networksettings2/profile/profile_NNI.cpp
@@ -0,0 +1,48 @@
1#include "profileedit.h"
2#include "profile_NNI.h"
3#include "profile_NN.h"
4
5AProfile::AProfile( ProfileNetNode * PNN ) : ANetNodeInstance( PNN ) {
6 Data.Automatic = 1;
7 Data.Confirm = 0;
8 Data.Description = "";
9 Data.Disabled = 0;
10 GUI = 0;
11 RT = 0;
12}
13
14void AProfile::setSpecificAttribute( QString & Attr, QString & Value ) {
15
16 if ( Attr == "automatic" ) {
17 Data.Automatic = (Value=="yes");
18 } else if ( Attr == "preconfirm" ) {
19 Data.Confirm = (Value=="yes");
20 } else if ( Attr == "disabled" ) {
21 Data.Disabled = (Value=="yes");
22 } else if ( Attr == "description" ) {
23 Data.Description = Value;
24 }
25}
26
27void AProfile::saveSpecificAttribute( QTextStream & TS ) {
28 TS << "automatic=" << ((Data.Automatic) ? "yes" : "no") << endl;
29 TS << "preconfirm=" << ((Data.Confirm) ? "yes" : "no") << endl;
30 TS << "disabled=" << ((Data.Disabled) ? "yes" : "no") << endl;
31 TS << "description=" << Data.Description << endl;
32}
33
34QWidget * AProfile::edit( QWidget * parent ) {
35 GUI = new ProfileEdit( parent, this );
36 GUI->showData( Data );
37 return GUI;
38}
39
40QString AProfile::acceptable( void ) {
41 return ( GUI ) ? GUI->acceptable( ) : QString();
42}
43
44void AProfile::commit( void ) {
45 if( GUI && GUI->commit( Data ) )
46 setModified( 1 );
47}
48