Diffstat (limited to 'noncore/settings/networksettings2/network/network_NNI.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/networksettings2/network/network_NNI.cpp | 7 |
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 ) { TS << "postup=" << quote(*it) << endl; } for ( QStringList::Iterator it = Data.PostDown_SL.begin(); it != Data.PostDown_SL.end(); ++it ) { TS << "postdown=" << quote(*it) << endl; } } QWidget * ANetwork::edit( QWidget * parent ) { GUI = new NetworkEdit( parent ); GUI->showData( Data ); return GUI; } QString ANetwork::acceptable( void ) { return ( GUI ) ? GUI->acceptable( ) : QString(); } void ANetwork::commit( void ) { if( GUI && GUI->commit( Data ) ) setModified( 1 ); } +bool ANetwork::hasDataFor( const QString & S ) { + return S == "interfaces"; +} + bool ANetwork::generateDataForCommonFile( SystemFile & S, long DevNr ) { - AsDevice * Dev = runtime()->device(); - QString NIC = Dev->genNic( DevNr ); + QString NIC = runtime()->device()->netNode()->nodeClass()->genNic( DevNr ); if( S.name() == "interfaces" ) { // we can safely call from here since device item is deeper if( Data.UseDHCP ) { S << "iface " << NIC << "-c" << connection()->number() << "-allowed inet dhcp" << endl; S << " up echo \"" << NIC << "\" > /tmp/profile-" << connection()->number() << ".up" << Data.IPAddress << endl; if( Data.SendHostname ) { S << " hostname "<< Data.Hostname << endl; } S << " down rm -f /tmp/profile-" << connection()->number() << ".up" << Data.IPAddress << endl; } else { S << "iface " << NIC << "-c" << connection()->number() << "-allowed inet static" << endl; S << " up echo \"" << NIC << "\" > /tmp/profile-" << connection()->number() << ".up" << Data.IPAddress << endl; S << " down rm -f /tmp/profile-" << connection()->number() << ".up" << Data.IPAddress << endl; S << " address " << Data.IPAddress << endl; S << " broadcast " << Data.Broadcast << endl; S << " netmask " << Data.NetMask << endl; |