Diffstat (limited to 'noncore/settings/networksettings2/wlan/wlan_NNI.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/networksettings2/wlan/wlan_NNI.cpp | 35 |
1 files changed, 23 insertions, 12 deletions
diff --git a/noncore/settings/networksettings2/wlan/wlan_NNI.cpp b/noncore/settings/networksettings2/wlan/wlan_NNI.cpp index 61969f2..0e4fc4c 100644 --- a/noncore/settings/networksettings2/wlan/wlan_NNI.cpp +++ b/noncore/settings/networksettings2/wlan/wlan_NNI.cpp @@ -78,13 +78,20 @@ void AWLan::commit( void ) { if( GUI && GUI->commit( Data ) ) setModified( 1 ); } -bool AWLan::generateDataForCommonFile( - SystemFile & S, - long ) { +short AWLan::generateFileEmbedded( const QString & ID, + const QString & Path, + QTextStream & TS, + long DevNr ) { - S << " wireless_essid \"" + short rvl, rvd; + + rvl = 1; + + if( ID == "interfaces" ) { + Log(("Generate WLanNNI for %s\n", ID.latin1() )); + TS << " wireless_essid \"" << Data.ESSID << "\"" << endl; @@ -92,24 +99,23 @@ bool AWLan::generateDataForCommonFile( if( Data.NodeName == tr("<UseHostName>") ) { char Buf[100]; if( gethostname(Buf, sizeof(Buf) ) == 0 ) { Buf[99] = '\0'; // just to make sure - S << " wireless_nick " + TS << " wireless_nick " << Buf << endl; } } else { - S << " wireless_nick \"" + TS << " wireless_nick \"" << Data.NodeName << "\"" << endl; } } - char * M; + char * M = "Auto"; switch ( Data.Mode ) { case 0 : - M = "Auto"; break; case 1 : M = "Managed"; break; @@ -117,24 +123,29 @@ bool AWLan::generateDataForCommonFile( M = "Ad-Hoc"; break; } - S << " wireless_mode " + TS << " wireless_mode " << M << endl; if( Data.Encrypted ) { for( int i = 0; i < 4; i ++ ) { if( ! Data.Key[i].isEmpty() ) { - S << " wireless_key" + TS << " wireless_key" << i << " " << Data.Key[i] << endl; } } - S << " wireless_keymode " + TS << " wireless_keymode " << ((Data.AcceptNonEncrypted) ? "open" : "restricted") << endl; } - return 0; + rvl = 0; + } + rvd = ANetNodeInstance::generateFileEmbedded( ID, Path, TS, DevNr); + + return (rvd == 2 || rvl == 2 ) ? 2 : + (rvd == 0 || rvl == 0 ) ? 0 : 1; } |