summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings2/network/network_NNI.cpp
Unidiff
Diffstat (limited to 'noncore/settings/networksettings2/network/network_NNI.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings2/network/network_NNI.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/noncore/settings/networksettings2/network/network_NNI.cpp b/noncore/settings/networksettings2/network/network_NNI.cpp
index eac2d66..054385a 100644
--- a/noncore/settings/networksettings2/network/network_NNI.cpp
+++ b/noncore/settings/networksettings2/network/network_NNI.cpp
@@ -78,51 +78,54 @@ void ANetwork::saveSpecificAttribute( QTextStream & TS ) {
78 TS << "postup=" << quote(*it) << endl; 78 TS << "postup=" << quote(*it) << endl;
79 } 79 }
80 for ( QStringList::Iterator it = Data.PostDown_SL.begin(); 80 for ( QStringList::Iterator it = Data.PostDown_SL.begin();
81 it != Data.PostDown_SL.end(); 81 it != Data.PostDown_SL.end();
82 ++it ) { 82 ++it ) {
83 TS << "postdown=" << quote(*it) << endl; 83 TS << "postdown=" << quote(*it) << endl;
84 } 84 }
85} 85}
86 86
87QWidget * ANetwork::edit( QWidget * parent ) { 87QWidget * ANetwork::edit( QWidget * parent ) {
88 GUI = new NetworkEdit( parent ); 88 GUI = new NetworkEdit( parent );
89 GUI->showData( Data ); 89 GUI->showData( Data );
90 return GUI; 90 return GUI;
91} 91}
92 92
93QString ANetwork::acceptable( void ) { 93QString ANetwork::acceptable( void ) {
94 return ( GUI ) ? GUI->acceptable( ) : QString(); 94 return ( GUI ) ? GUI->acceptable( ) : QString();
95} 95}
96 96
97void ANetwork::commit( void ) { 97void ANetwork::commit( void ) {
98 if( GUI && GUI->commit( Data ) ) 98 if( GUI && GUI->commit( Data ) )
99 setModified( 1 ); 99 setModified( 1 );
100} 100}
101 101
102bool ANetwork::hasDataFor( const QString & S ) {
103 return S == "interfaces";
104}
105
102bool ANetwork::generateDataForCommonFile( SystemFile & S, long DevNr ) { 106bool ANetwork::generateDataForCommonFile( SystemFile & S, long DevNr ) {
103 AsDevice * Dev = runtime()->device(); 107 QString NIC = runtime()->device()->netNode()->nodeClass()->genNic( DevNr );
104 QString NIC = Dev->genNic( DevNr );
105 108
106 if( S.name() == "interfaces" ) { 109 if( S.name() == "interfaces" ) {
107 // we can safely call from here since device item is deeper 110 // we can safely call from here since device item is deeper
108 if( Data.UseDHCP ) { 111 if( Data.UseDHCP ) {
109 S << "iface " << NIC << "-c" << connection()->number() << 112 S << "iface " << NIC << "-c" << connection()->number() <<
110 "-allowed inet dhcp" << endl; 113 "-allowed inet dhcp" << endl;
111 S << " up echo \"" << NIC << "\" > /tmp/profile-" << connection()->number() << 114 S << " up echo \"" << NIC << "\" > /tmp/profile-" << connection()->number() <<
112 ".up" << Data.IPAddress << endl; 115 ".up" << Data.IPAddress << endl;
113 if( Data.SendHostname ) { 116 if( Data.SendHostname ) {
114 S << " hostname "<< Data.Hostname << endl; 117 S << " hostname "<< Data.Hostname << endl;
115 } 118 }
116 119
117 S << " down rm -f /tmp/profile-" << connection()->number() << 120 S << " down rm -f /tmp/profile-" << connection()->number() <<
118 ".up" << Data.IPAddress << endl; 121 ".up" << Data.IPAddress << endl;
119 } else { 122 } else {
120 S << "iface " << NIC << "-c" << connection()->number() << 123 S << "iface " << NIC << "-c" << connection()->number() <<
121 "-allowed inet static" << endl; 124 "-allowed inet static" << endl;
122 S << " up echo \"" << NIC << "\" > /tmp/profile-" << connection()->number() << 125 S << " up echo \"" << NIC << "\" > /tmp/profile-" << connection()->number() <<
123 ".up" << Data.IPAddress << endl; 126 ".up" << Data.IPAddress << endl;
124 S << " down rm -f /tmp/profile-" << connection()->number() << 127 S << " down rm -f /tmp/profile-" << connection()->number() <<
125 ".up" << Data.IPAddress << endl; 128 ".up" << Data.IPAddress << endl;
126 S << " address " << Data.IPAddress << endl; 129 S << " address " << Data.IPAddress << endl;
127 S << " broadcast " << Data.Broadcast << endl; 130 S << " broadcast " << Data.Broadcast << endl;
128 S << " netmask " << Data.NetMask << endl; 131 S << " netmask " << Data.NetMask << endl;