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

usb_NNI.cpp

Go to the documentation of this file.
00001 #include <qpe/qpeapplication.h>
00002 #include "usbedit.h"
00003 #include "usb_NNI.h"
00004 #include "usb_NN.h"
00005 
00006 AUSB::AUSB( USBNetNode * PNN ) : ANetNodeInstance( PNN ) {
00007 
00008     GUI = 0;
00009     RT = 0;
00010 }
00011 
00012 void AUSB::setSpecificAttribute( QString & , QString & ) {
00013 }
00014 
00015 void AUSB::saveSpecificAttribute( QTextStream & ) {
00016 }
00017 
00018 
00019 QWidget * AUSB::edit( QWidget * parent ) {
00020     GUI = new USBEdit( parent );
00021     GUI->showData( Data ); 
00022     return GUI;
00023 }
00024 
00025 QString AUSB::acceptable( void ) {
00026     return ( GUI ) ? GUI->acceptable( ) : QString();
00027 }
00028 
00029 void AUSB::commit( void ) {
00030     if( GUI && GUI->commit( Data ) ) {
00031       setModified( 1 );
00032     }
00033 }
00034 
00035 short AUSB::generateFileEmbedded( SystemFile & SF,
00036                                  long DevNr ) {
00037  
00038     QString NIC = runtime()->device()->netNode()->nodeClass()->genNic( DevNr );
00039     short rvl, rvd;
00040 
00041     rvl = 1;
00042 
00043     if( SF.name() == "interfaces" ) {
00044       Log(("Generate USB for %s\n", SF.name().latin1() ));
00045       // generate mapping stanza for this interface
00046       SF << "  pre-up " 
00047          << QPEApplication::qpeDir() 
00048          << "bin/NS2SetMac.sh " 
00049          << NIC 
00050          << " || true" 
00051          << endl;
00052       rvl = 0;
00053     }
00054     rvd = ANetNodeInstance::generateFileEmbedded(SF, DevNr );
00055 
00056     return (rvd == 2 || rvl == 2 ) ? 2 :
00057            (rvd == 0 || rvl == 0 ) ? 0 : 1;
00058 
00059 }

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