author | mickeyl <mickeyl> | 2003-05-08 09:12:24 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2003-05-08 09:12:24 (UTC) |
commit | 215b9cbd3d1316887674b92268610c8f63a5caaf (patch) (side-by-side diff) | |
tree | 92f77edcb0f997cf180d545dd78a40fe23a44169 /noncore/net/wellenreiter/gui/protolistview.cpp | |
parent | eb1dba5550e63ab7b915d55048175e2992ab5447 (diff) | |
download | opie-215b9cbd3d1316887674b92268610c8f63a5caaf.zip opie-215b9cbd3d1316887674b92268610c8f63a5caaf.tar.gz opie-215b9cbd3d1316887674b92268610c8f63a5caaf.tar.bz2 |
add fine tuning of parsing process - the semantics is not yet set in stone however...
Diffstat (limited to 'noncore/net/wellenreiter/gui/protolistview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/wellenreiter/gui/protolistview.cpp | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/noncore/net/wellenreiter/gui/protolistview.cpp b/noncore/net/wellenreiter/gui/protolistview.cpp index d4b0dfe..f4b45d0 100644 --- a/noncore/net/wellenreiter/gui/protolistview.cpp +++ b/noncore/net/wellenreiter/gui/protolistview.cpp @@ -23,29 +23,29 @@ #include <qpalette.h> #include <qcolor.h> #include <qlabel.h> #include <qframe.h> ProtocolListView::ProtocolListView( QWidget* parent, const char* name, WFlags f ) :QScrollView( parent, name, f ) { - actions = ( QString( "parsePackets" ) == QString( name ) ); + parse = ( QString( "parsePackets" ) == QString( name ) ); setMargins( 3, 3, 0, 0 ); viewport()->setBackgroundColor( QCheckBox(0).palette().color( QPalette::Active, QColorGroup::Background ) ); vbox = new QVBox( viewport() ); vbox->setSpacing( 1 ); addChild( vbox ); QHBox* hbox = new QHBox( vbox ); hbox->setSpacing( 40 ); new QLabel( tr( "Protocol Family" ), hbox ); - if ( actions ) new QLabel( tr( "Perform Action" ), hbox ); + new QLabel( tr( "Perform Action" ), hbox ); QFrame* frame = new QFrame( vbox ); frame->setFrameStyle( QFrame::HLine + QFrame::Sunken ); //TODO: hardcoded for now...a protocol database would be nice!? //addProtocol( "Ethernet" ); addProtocol( "Prism" ); //addProtocol( "802.11" ); @@ -73,45 +73,52 @@ ProtocolListView::~ProtocolListView() } void ProtocolListView::addProtocol( const QString& name ) { QHBox* hbox = new QHBox( vbox ); new QCheckBox( name, hbox, (const char*) name ); - if ( actions ) + if ( parse ) { QComboBox* combo = new QComboBox( hbox, (const char*) name ); #ifdef QWS combo->setFixedWidth( 75 ); #endif combo->insertItem( "Ignore" ); + combo->insertItem( "Discard!" ); combo->insertItem( "TouchSound" ); combo->insertItem( "AlarmSound" ); combo->insertItem( "KeySound" ); combo->insertItem( "LedOn" ); combo->insertItem( "LedOff" ); combo->insertItem( "LogMessage" ); combo->insertItem( "MessageBox" ); } + else + { + QComboBox* combo = new QComboBox( hbox, (const char*) name ); + #ifdef QWS + combo->setFixedWidth( 75 ); + #endif + combo->insertItem( "Pass" ); + combo->insertItem( "Discard!" ); + } } bool ProtocolListView::isProtocolChecked( const QString& name ) { QCheckBox* box = (QCheckBox*) child( (const char*) name ); return ( box && box->isOn() ); } QString ProtocolListView::protocolAction( const QString& name ) { - //QObject * child ( const char * objName, const char * inheritsClass = 0, - // bool recursiveSearch = TRUE ) - QComboBox* combo = (QComboBox*) child( (const char*) name, "QComboBox" ); if ( combo ) return combo->currentText(); else return "<unknown>"; } |