summaryrefslogtreecommitdiff
path: root/noncore/net/wellenreiter/gui/protolistview.cpp
Unidiff
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
@@ -28,7 +28,7 @@
28ProtocolListView::ProtocolListView( QWidget* parent, const char* name, WFlags f ) 28ProtocolListView::ProtocolListView( QWidget* parent, const char* name, WFlags f )
29 :QScrollView( parent, name, f ) 29 :QScrollView( parent, name, f )
30{ 30{
31 actions = ( QString( "parsePackets" ) == QString( name ) ); 31 parse = ( QString( "parsePackets" ) == QString( name ) );
32 32
33 setMargins( 3, 3, 0, 0 ); 33 setMargins( 3, 3, 0, 0 );
34 viewport()->setBackgroundColor( QCheckBox(0).palette().color( QPalette::Active, QColorGroup::Background ) ); 34 viewport()->setBackgroundColor( QCheckBox(0).palette().color( QPalette::Active, QColorGroup::Background ) );
@@ -40,7 +40,7 @@ ProtocolListView::ProtocolListView( QWidget* parent, const char* name, WFlags f
40 QHBox* hbox = new QHBox( vbox ); 40 QHBox* hbox = new QHBox( vbox );
41 hbox->setSpacing( 40 ); 41 hbox->setSpacing( 40 );
42 new QLabel( tr( "Protocol Family" ), hbox ); 42 new QLabel( tr( "Protocol Family" ), hbox );
43 if ( actions ) new QLabel( tr( "Perform Action" ), hbox ); 43 new QLabel( tr( "Perform Action" ), hbox );
44 QFrame* frame = new QFrame( vbox ); 44 QFrame* frame = new QFrame( vbox );
45 frame->setFrameStyle( QFrame::HLine + QFrame::Sunken ); 45 frame->setFrameStyle( QFrame::HLine + QFrame::Sunken );
46 46
@@ -78,13 +78,14 @@ void ProtocolListView::addProtocol( const QString& name )
78 QHBox* hbox = new QHBox( vbox ); 78 QHBox* hbox = new QHBox( vbox );
79 new QCheckBox( name, hbox, (const char*) name ); 79 new QCheckBox( name, hbox, (const char*) name );
80 80
81 if ( actions ) 81 if ( parse )
82 { 82 {
83 QComboBox* combo = new QComboBox( hbox, (const char*) name ); 83 QComboBox* combo = new QComboBox( hbox, (const char*) name );
84 #ifdef QWS 84 #ifdef QWS
85 combo->setFixedWidth( 75 ); 85 combo->setFixedWidth( 75 );
86 #endif 86 #endif
87 combo->insertItem( "Ignore" ); 87 combo->insertItem( "Ignore" );
88 combo->insertItem( "Discard!" );
88 combo->insertItem( "TouchSound" ); 89 combo->insertItem( "TouchSound" );
89 combo->insertItem( "AlarmSound" ); 90 combo->insertItem( "AlarmSound" );
90 combo->insertItem( "KeySound" ); 91 combo->insertItem( "KeySound" );
@@ -93,6 +94,15 @@ void ProtocolListView::addProtocol( const QString& name )
93 combo->insertItem( "LogMessage" ); 94 combo->insertItem( "LogMessage" );
94 combo->insertItem( "MessageBox" ); 95 combo->insertItem( "MessageBox" );
95 } 96 }
97 else
98 {
99 QComboBox* combo = new QComboBox( hbox, (const char*) name );
100 #ifdef QWS
101 combo->setFixedWidth( 75 );
102 #endif
103 combo->insertItem( "Pass" );
104 combo->insertItem( "Discard!" );
105 }
96} 106}
97 107
98 108
@@ -105,9 +115,6 @@ bool ProtocolListView::isProtocolChecked( const QString& name )
105 115
106QString ProtocolListView::protocolAction( const QString& name ) 116QString ProtocolListView::protocolAction( const QString& name )
107{ 117{
108 //QObject * child ( const char * objName, const char * inheritsClass = 0,
109 // bool recursiveSearch = TRUE )
110
111 QComboBox* combo = (QComboBox*) child( (const char*) name, "QComboBox" ); 118 QComboBox* combo = (QComboBox*) child( (const char*) name, "QComboBox" );
112 if ( combo ) 119 if ( combo )
113 return combo->currentText(); 120 return combo->currentText();