Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

lancard_NNI.cpp

Go to the documentation of this file.
00001 #include "lancardedit.h"
00002 #include "lancard_NNI.h"
00003 #include "lancard_NN.h"
00004 
00005 ALanCard::ALanCard( LanCardNetNode * PNN ) : ANetNodeInstance( PNN ) {
00006 
00007     Data.AnyLanCard = 1;
00008     Data.HWAddresses.clear();
00009 
00010     GUI = 0;
00011     RT = 0;
00012 }
00013 
00014 void ALanCard::setSpecificAttribute( QString & A, QString & V ) {
00015     if( A == "matchanycard" ) {
00016       Data.AnyLanCard = (V == "yes" );
00017     } else if( A == "match" ) {
00018       Data.HWAddresses.append( V );
00019     }
00020 }
00021 
00022 void ALanCard::saveSpecificAttribute( QTextStream & TS) {
00023     TS << "matchanycard=" << 
00024       ((Data.AnyLanCard) ? "yes" : "no") << endl;
00025     for( QStringList::Iterator it = Data.HWAddresses.begin(); 
00026          it != Data.HWAddresses.end(); ++it ) {
00027       TS << "match=" << quote( *it ) << endl;
00028     }
00029 }
00030 
00031 QWidget * ALanCard::edit( QWidget * parent ) {
00032     GUI = new LanCardEdit( parent );
00033     GUI->showData( this );
00034     return GUI;
00035 }
00036 
00037 QString ALanCard::acceptable( void ) {
00038     return ( GUI ) ? GUI->acceptable( ) : QString();
00039 }
00040 
00041 void ALanCard::commit( void ) {
00042     if( GUI && GUI->commit( Data ) )
00043       setModified( 1 );
00044 }
00045 

Generated on Sat Nov 5 16:17:53 2005 for OPIE by  doxygen 1.4.2