summaryrefslogtreecommitdiff
path: root/noncore/net/wellenreiter/gui/protolistview.cpp
Side-by-side diff
Diffstat (limited to 'noncore/net/wellenreiter/gui/protolistview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/wellenreiter/gui/protolistview.cpp19
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
@@ -25,25 +25,25 @@
#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" );
@@ -75,42 +75,49 @@ 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>";
}