Diffstat (limited to 'noncore/net/wellenreiter/gui/protolistview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/wellenreiter/gui/protolistview.cpp | 95 |
1 files changed, 95 insertions, 0 deletions
diff --git a/noncore/net/wellenreiter/gui/protolistview.cpp b/noncore/net/wellenreiter/gui/protolistview.cpp index e69de29..8b86072 100644 --- a/noncore/net/wellenreiter/gui/protolistview.cpp +++ b/noncore/net/wellenreiter/gui/protolistview.cpp | |||
@@ -0,0 +1,95 @@ | |||
1 | /********************************************************************** | ||
2 | ** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. | ||
3 | ** | ||
4 | ** This file is part of Opie Environment. | ||
5 | ** | ||
6 | ** This file may be distributed and/or modified under the terms of the | ||
7 | ** GNU General Public License version 2 as published by the Free Software | ||
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | ||
9 | ** packaging of this file. | ||
10 | ** | ||
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | ||
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | ||
13 | ** | ||
14 | **********************************************************************/ | ||
15 | |||
16 | /* LOCAL */ | ||
17 | #include "protolistview.h" | ||
18 | |||
19 | #include <qcheckbox.h> | ||
20 | #include <qcombobox.h> | ||
21 | #include <qhbox.h> | ||
22 | #include <qvbox.h> | ||
23 | #include <qpalette.h> | ||
24 | #include <qcolor.h> | ||
25 | #include <qlabel.h> | ||
26 | #include <qframe.h> | ||
27 | |||
28 | ProtocolListView::ProtocolListView( QWidget* parent, const char* name, WFlags f ) | ||
29 | :QScrollView( parent, name, f ) | ||
30 | { | ||
31 | actions = ( QString( "parsePackets" ) == QString( name ) ); | ||
32 | |||
33 | setMargins( 3, 3, 0, 0 ); | ||
34 | viewport()->setBackgroundColor( QCheckBox(0).palette().color( QPalette::Active, QColorGroup::Background ) ); | ||
35 | |||
36 | vbox = new QVBox( viewport() ); | ||
37 | vbox->setSpacing( 1 ); | ||
38 | addChild( vbox ); | ||
39 | |||
40 | QHBox* hbox = new QHBox( vbox ); | ||
41 | hbox->setSpacing( 40 ); | ||
42 | new QLabel( tr( "Protocol Family" ), hbox ); | ||
43 | if ( actions ) new QLabel( tr( "Perform Action" ), hbox ); | ||
44 | QFrame* frame = new QFrame( vbox ); | ||
45 | frame->setFrameStyle( QFrame::HLine + QFrame::Sunken ); | ||
46 | |||
47 | //TODO: hardcoded for now...a protocol database would be nice!? | ||
48 | |||
49 | //addProtocol( "Ethernet" ); | ||
50 | addProtocol( "Prism" ); | ||
51 | //addProtocol( "802.11" ); | ||
52 | addProtocol( "802.11 Management" ); | ||
53 | addProtocol( "802.11 SSID" ); | ||
54 | addProtocol( "802.11 Rates" ); | ||
55 | addProtocol( "802.11 CF" ); | ||
56 | addProtocol( "802.11 FH" ); | ||
57 | addProtocol( "802.11 DS" ); | ||
58 | addProtocol( "802.11 Tim" ); | ||
59 | addProtocol( "802.11 IBSS" ); | ||
60 | addProtocol( "802.11 Challenge" ); | ||
61 | addProtocol( "802.11 Data" ); | ||
62 | addProtocol( "802.11 LLC" ); | ||
63 | addProtocol( "802.11 Data" ); | ||
64 | addProtocol( "IP" ); | ||
65 | addProtocol( "ARP" ); | ||
66 | addProtocol( "UDP" ); | ||
67 | addProtocol( "TCP" ); | ||
68 | } | ||
69 | |||
70 | |||
71 | ProtocolListView::~ProtocolListView() | ||
72 | { | ||
73 | } | ||
74 | |||
75 | |||
76 | void ProtocolListView::addProtocol( const QString& name ) | ||
77 | { | ||
78 | QHBox* hbox = new QHBox( vbox ); | ||
79 | new QCheckBox( name, hbox, (const char*) name ); | ||
80 | |||
81 | if ( actions ) | ||
82 | { | ||
83 | QComboBox* combo = new QComboBox( hbox, (const char*) name ); | ||
84 | #ifdef QWS | ||
85 | combo->setFixedWidth( 75 ); | ||
86 | #endif | ||
87 | combo->insertItem( "Ignore" ); | ||
88 | combo->insertItem( "TouchSound" ); | ||
89 | combo->insertItem( "AlarmSound" ); | ||
90 | combo->insertItem( "KeySound" ); | ||
91 | combo->insertItem( "LedOn" ); | ||
92 | combo->insertItem( "LedOff" ); | ||
93 | } | ||
94 | } | ||
95 | |||