author | mickeyl <mickeyl> | 2003-02-24 15:54:13 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2003-02-24 15:54:13 (UTC) |
commit | f294a5d101fc9935e1a73f3d44b43ea00d0a03c7 (patch) (unidiff) | |
tree | 3fb4345bb3bacb023c217d55786b734c052de545 | |
parent | 25725a7cd45731656e3ee3476614512b027dacf8 (diff) | |
download | opie-f294a5d101fc9935e1a73f3d44b43ea00d0a03c7.zip opie-f294a5d101fc9935e1a73f3d44b43ea00d0a03c7.tar.gz opie-f294a5d101fc9935e1a73f3d44b43ea00d0a03c7.tar.bz2 |
visual enhancements for the listview...
-rw-r--r-- | noncore/net/wellenreiter/Makefile.static | 2 | ||||
-rw-r--r-- | noncore/net/wellenreiter/README | 124 | ||||
-rw-r--r-- | noncore/net/wellenreiter/config.in | 2 | ||||
-rw-r--r-- | noncore/net/wellenreiter/cornucopia/.cvsignore | 8 | ||||
-rw-r--r-- | noncore/net/wellenreiter/cornucopia/README | 3 | ||||
-rw-r--r-- | noncore/net/wellenreiter/cornucopia/cornucopia.pro | 16 | ||||
-rw-r--r-- | noncore/net/wellenreiter/cornucopia/olistview.cpp | 262 | ||||
-rw-r--r-- | noncore/net/wellenreiter/cornucopia/olistview.h | 168 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/gui.pro | 2 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/scanlist.cpp | 2 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/scanlist.h | 4 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/scanlistitem.cpp | 4 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/scanlistitem.h | 18 | ||||
-rw-r--r-- | noncore/net/wellenreiter/opie-wellenreiter.control | 4 | ||||
-rw-r--r-- | noncore/net/wellenreiter/wellenreiter.pro | 2 |
15 files changed, 527 insertions, 94 deletions
diff --git a/noncore/net/wellenreiter/Makefile.static b/noncore/net/wellenreiter/Makefile.static index 22b23f4..d5cdf44 100644 --- a/noncore/net/wellenreiter/Makefile.static +++ b/noncore/net/wellenreiter/Makefile.static | |||
@@ -9,7 +9,7 @@ | |||
9 | MAKEFILE=Makefile | 9 | MAKEFILE=Makefile |
10 | TMAKE =tmake | 10 | TMAKE =tmake |
11 | 11 | ||
12 | SUBDIRS =libwellenreiter/source daemon/source gui | 12 | SUBDIRS =libwellenreiter/source daemon/source gui cornucopia |
13 | 13 | ||
14 | all: $(SUBDIRS) | 14 | all: $(SUBDIRS) |
15 | 15 | ||
diff --git a/noncore/net/wellenreiter/README b/noncore/net/wellenreiter/README index 7de6a33..ef094c4 100644 --- a/noncore/net/wellenreiter/README +++ b/noncore/net/wellenreiter/README | |||
@@ -1,111 +1,87 @@ | |||
1 | /*************************************************************************/ | 1 | /************************************************************************/ |
2 | /* W e l l e n r e i t e r I I */ | 2 | /* W e l l e n r e i t e r I I */ |
3 | /* =============================== */ | 3 | /* =============================== */ |
4 | /* */ | 4 | /* */ |
5 | /* Version: Opie-ALPHA-January */ | 5 | /* Version: Opie-ALPHA-February */ |
6 | /*************************************************************************/ | 6 | /************************************************************************/ |
7 | 7 | ||
8 | -------------------------------------------------- | 8 | ---------------------------------------------------- |
9 | Release Notes for Opie-ALPHA Version January 2002 | 9 | Release Notes for Opie-ALPHA Version February 2002 |
10 | -------------------------------------------------- | 10 | ---------------------------------------------------- |
11 | 11 | ||
12 | ===================== | 12 | ===================== |
13 | = Supported Devices = | 13 | = Supported Devices = |
14 | ===================== | 14 | ===================== |
15 | 15 | ||
16 | * low-level orinoco_cs-based (including prism2 and spectrum_cs) | 16 | - HERMES chipset [ orinoco ], e.g. Lucent/Agere cards |
17 | - PRISM2 chipset [ orinoco or hostap ], e.g. D-Link, Buffallo | ||
18 | - SYMBOL/SPECTRUM chipset* [ orinoco ], e.g. Symbol Spectrum 24, Socket Lowpower CF | ||
19 | - CISCO chipset | ||
20 | |||
21 | * Warning: Current Symbol/Spectrum CF drivers have bugs - they freeze the system in monitor mode. | ||
22 | This has nothing todo with Wellenreiter as its a driver problem. | ||
17 | 23 | ||
18 | ===================== | 24 | ===================== |
19 | = Build = | 25 | = Build = |
20 | ===================== | 26 | ===================== |
21 | 27 | ||
22 | (I) Opie Build Environment | 28 | (I) Opie Build Environment |
23 | 29 | ||
24 | To compile Wellenreiter within the Opie build environment, add the | 30 | To compile Wellenreiter within the Opie build environment, do |
25 | following directories to $OPIEDIR/Makefile, e.g. to 'NONAPPS=' | 31 | 'make menuconfig' and check Wellenreiter in the subsection |
26 | 32 | "Communications and Networking" | |
27 | noncore/net/wellenreiter/libwellenreiter \ | ||
28 | noncore/net/wellenreiter/daemon \ | ||
29 | noncore/net/wellenreiter/contrib/orinoco_hopper \ | ||
30 | noncore/net/wellenreiter/gui | ||
31 | 33 | ||
32 | ./configure and rebuild. Note that you need libpcap in your toolchain. | 34 | do 'make SUBDIRS=noncore/net/wellenreiter' or 'make' (to build everything) |
35 | Note that you need to have libpcap in your toolchain. | ||
33 | 36 | ||
34 | (II) OpenZaurus Build Environment | 37 | (II) OpenZaurus Build Environment |
35 | 38 | ||
36 | To compile Wellenreiter within the OZ build environment, add the | 39 | See (I), but do 'make SUBDIRS=packages/opie' |
37 | following lines to $OPIEDIR/packages: | ||
38 | CONFIG_WELLENREITER noncore/net/wellenreiter/libwellenreiter libwellenreiter.pro | ||
39 | CONFIG_WELLENREITER noncore/net/wellenreiter/daemon daemon.pro | ||
40 | CONFIG_WELLENREITER noncore/net/wellenreiter/gui gui.pro | ||
41 | CONFIG_WELLENREITER noncore/net/wellenreiter/contrib/orinoco_hopper orinoco_hopper.pro | ||
42 | |||
43 | make -f Makefile.test clean-configs | ||
44 | cd <BUILDROOT> | ||
45 | make SUBDIRS=packages/opie package | ||
46 | 40 | ||
47 | (III) To compile a standalone Wellenreiter for X11, you need Qt3 and the development | 41 | (III) To compile a standalone Wellenreiter for X11, you need Qt3 and the development |
48 | packages for Qt3, e.g. libqt3-devel. Assuming, $QTDIR is set to your Qt-Director | 42 | packages for Qt3, e.g. libqt3-devel. Assuming, $QTDIR is set to your Qt-Director |
49 | (e.g. /usr/lib/qt3), set $OPIEDIR to your installation prefix, e.g. /usr/local, then | 43 | (e.g. /usr/lib/qt3), set $OPIEDIR to your installation prefix, e.g. /usr/local, then |
50 | export QMAKESPEC=$QTDIR/mkspecs/linux-g++ | 44 | 'export QMAKESPEC=$QTDIR/mkspecs/linux-g++' |
51 | qmake "platform=x11" wellenreiter.pro | 45 | 'qmake "platform=x11" wellenreiter.pro' |
52 | make | 46 | 'make' |
53 | make install | 47 | 'make install' |
54 | 48 | ||
55 | ===================== | 49 | ===================== |
56 | = Install = | 50 | = Install = |
57 | ===================== | 51 | ===================== |
58 | 52 | ||
59 | Alternatively, you can use our precompiled ipk. Get it from | 53 | Alternatively, you can use our precompiled ipk. Get it from |
60 | http://opie.net.wox.org/wellenreiter/. This also includes a recent libpcap. | 54 | http://opie.net.wox.org/wellenreiter/. There is also a recent libpcap available. |
61 | 55 | ||
62 | ===================== | 56 | ===================== |
63 | = Run = | 57 | = Run = |
64 | ===================== | 58 | ===================== |
65 | 59 | ||
66 | There are two possible modes: <Manual> and <Automatic>. I suggest, you | 60 | There are two possible modes: <Manual> and <Automatic>. I suggest, you |
67 | start with the <Automatic> Mode. This works just using the "Start" | 61 | start with the <Automatic> Mode. This works just using the Start/Stop |
68 | and "Stop" Pushbuttons in the Wellenreiter GUI. If this doesn't work, | 62 | Toolbutton in the Wellenreiter Menubar. Note that you need to configure |
69 | then use the following strategy: | 63 | your card before the Start/Stop-Toolbutton can be clicked. |
70 | 64 | ||
71 | 1. Place card in monitor mode. This is device dependent. | 65 | If this doesn't work, then try calling the wellenreiter daemon |
72 | 66 | [wellenreiterd] manually. It has a command line interface. You can | |
73 | Caution: Don't do this while you're logged in via ssh | 67 | start the GUI before or after the daemon. |
74 | or otherwise using the wireless interface - your connection | ||
75 | will freeze: The card can't be used normally when sniffing! | ||
76 | |||
77 | For most orinoco-based cards this can be done using either | ||
78 | 'iwpriv <interface> 2' or 'iwpriv <interface> 2 1'. | ||
79 | |||
80 | You can check if this works, by calling 'ifconfig <interface>'. | ||
81 | If you see 'Protocol: UNSPEC' and an unusual long MAC-Address, | ||
82 | then your card has been successfully set to the monitor mode. | ||
83 | |||
84 | 2. Start a channel hopper. A wireless card has several channels | ||
85 | (e.g. radio frequencies) here it can listen for beacons. | ||
86 | Beacons are management data frames from other stations. | ||
87 | Remember, this is radio transmission, so the card has to be | ||
88 | "tuned" to a certain channel to be able to receive the beacons. | ||
89 | |||
90 | In order to scan the complete frequency spectrum and thus be able | ||
91 | to detect all available stations, you have to 'hop' through the | ||
92 | channels frequently. You can do this manually (e.g. with 'iwconfig') | ||
93 | [hahaha] or you can use a channel hopper. | ||
94 | |||
95 | For convenience, the current Wellenreiter Alpha comes with a | ||
96 | channel hopper for Orinoco-based cards. Start this via | ||
97 | orinoco_hopper <interface>. | ||
98 | |||
99 | 3. Start the Wellenreiter sniffing daemon: wellenreiterd. | ||
100 | |||
101 | 4. Start the Wellenreiter GUI and sniff like hell. Don't press the button | ||
102 | "Start Scan" yet, because it enables the demo mode and will crash the | ||
103 | wellenreiterd daemon if running. | ||
104 | 68 | ||
105 | ===================== | 69 | ===================== |
106 | = Credits = | 70 | = Credits = |
107 | ===================== | 71 | ===================== |
108 | 72 | ||
109 | Sniffer: Max Moser <max@remote-exploit.org> | 73 | Wellenreiter/Opie is (C) 2002-2003 M-M-M |
74 | |||
75 | Sniffer Engine: Max Moser <max@remote-exploit.org> | ||
110 | Communication and Protocol: Martin J. Muench <mjm@remote-exploit.org> | 76 | Communication and Protocol: Martin J. Muench <mjm@remote-exploit.org> |
111 | GUI: Michael Lauer <mickeyl@handhelds.org> | 77 | GUI and Packaging: Michael Lauer <mickeyl@handhelds.org> |
78 | |||
79 | ===================== | ||
80 | = Links = | ||
81 | ===================== | ||
82 | |||
83 | Opie Project: http://opie.handhelds.org | ||
84 | OpenZaurus Project: http://openzaurus.org | ||
85 | Wellenreiter: http://www.remote-exploit.org | ||
86 | Wellenreiter/Opie: http://opie.net.wox.org/wellenreiter | ||
87 | |||
diff --git a/noncore/net/wellenreiter/config.in b/noncore/net/wellenreiter/config.in index e7abcf3..19f85e2 100644 --- a/noncore/net/wellenreiter/config.in +++ b/noncore/net/wellenreiter/config.in | |||
@@ -1,4 +1,4 @@ | |||
1 | config WELLENREITER | 1 | config WELLENREITER |
2 | boolean "wellenreiter" | 2 | boolean "wellenreiter (wireless LAN monitor)" |
3 | default "y" | 3 | default "y" |
4 | depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE | 4 | depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE |
diff --git a/noncore/net/wellenreiter/cornucopia/.cvsignore b/noncore/net/wellenreiter/cornucopia/.cvsignore new file mode 100644 index 0000000..724d599 --- a/dev/null +++ b/noncore/net/wellenreiter/cornucopia/.cvsignore | |||
@@ -0,0 +1,8 @@ | |||
1 | *.o | ||
2 | *~ | ||
3 | Makefile* | ||
4 | moc_* | ||
5 | wellenreitertemplate.cpp | ||
6 | wellenreitertemplate.h | ||
7 | configbase.h | ||
8 | configbase.cpp | ||
diff --git a/noncore/net/wellenreiter/cornucopia/README b/noncore/net/wellenreiter/cornucopia/README new file mode 100644 index 0000000..36a6954 --- a/dev/null +++ b/noncore/net/wellenreiter/cornucopia/README | |||
@@ -0,0 +1,3 @@ | |||
1 | --------------------------------------------------------------- | ||
2 | Dies ist ein Testballon für opielibs1.2 - Codename: Cornucopia | ||
3 | --------------------------------------------------------------- | ||
diff --git a/noncore/net/wellenreiter/cornucopia/cornucopia.pro b/noncore/net/wellenreiter/cornucopia/cornucopia.pro new file mode 100644 index 0000000..7ffa202 --- a/dev/null +++ b/noncore/net/wellenreiter/cornucopia/cornucopia.pro | |||
@@ -0,0 +1,16 @@ | |||
1 | DESTDIR = $(OPIEDIR)/lib | ||
2 | MOC_DIR = ./tmp | ||
3 | OBJECTS_DIR = ./tmp | ||
4 | TEMPLATE = lib | ||
5 | CONFIG = qt warn_on debug | ||
6 | VERSION = 0.1 | ||
7 | HEADERS = olistview.h | ||
8 | SOURCES = olistview.cpp | ||
9 | INCLUDEPATH = $(OPIEDIR)/include | ||
10 | DEPENDPATH = $(OPIEDIR)/include | ||
11 | TARGET = cornucopia | ||
12 | |||
13 | !contains( platform, x11 ) { | ||
14 | include ( $(OPIEDIR)/include.pro ) | ||
15 | } | ||
16 | |||
diff --git a/noncore/net/wellenreiter/cornucopia/olistview.cpp b/noncore/net/wellenreiter/cornucopia/olistview.cpp new file mode 100644 index 0000000..bca17b2 --- a/dev/null +++ b/noncore/net/wellenreiter/cornucopia/olistview.cpp | |||
@@ -0,0 +1,262 @@ | |||
1 | /* | ||
2 | This file is part of the Opie Project | ||
3 | |||
4 | Copyright (C) 2003 Michael 'Mickey' Lauer | ||
5 | <mickey@tm.informatik.uni-frankfurt.de> | ||
6 | =. | ||
7 | .=l. | ||
8 | .>+-= | ||
9 | _;:, .> :=|. This program is free software; you can | ||
10 | .> <`_, > . <= redistribute it and/or modify it under | ||
11 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | ||
12 | .="- .-=="i, .._ License as published by the Free Software | ||
13 | - . .-<_> .<> Foundation; either version 2 of the License, | ||
14 | ._= =} : or (at your option) any later version. | ||
15 | .%`+i> _;_. | ||
16 | .i_,=:_. -<s. This program is distributed in the hope that | ||
17 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | ||
18 | : .. .:, . . . without even the implied warranty of | ||
19 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | ||
20 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | ||
21 | ..}^=.= = ; Library General Public License for more | ||
22 | ++= -. .` .: details. | ||
23 | : = ...= . :.=- | ||
24 | -. .:....=;==+<; You should have received a copy of the GNU | ||
25 | -_. . . )=. = Library General Public License along with | ||
26 | -- :-=` this library; see the file COPYING.LIB. | ||
27 | If not, write to the Free Software Foundation, | ||
28 | Inc., 59 Temple Place - Suite 330, | ||
29 | Boston, MA 02111-1307, USA. | ||
30 | |||
31 | */ | ||
32 | |||
33 | #include <qcolor.h> | ||
34 | #include <qheader.h> | ||
35 | #include <qpainter.h> | ||
36 | #include <qpixmap.h> | ||
37 | |||
38 | #include "olistview.h" | ||
39 | |||
40 | //****************************** OListView ************************************************************************** | ||
41 | |||
42 | OListView::OListView( QWidget *parent, const char *name ) | ||
43 | :QListView( parent, name ) | ||
44 | { | ||
45 | //FIXME: get from global settings and calculate ==> see oglobalsettings.* | ||
46 | |||
47 | m_alternateBackground = QColor( 238, 246, 255 ); | ||
48 | m_columnSeparator = QPen( QColor( 150, 160, 170 ), 0, DotLine ); | ||
49 | m_fullWidth = true; | ||
50 | } | ||
51 | |||
52 | OListView::~OListView() | ||
53 | { | ||
54 | } | ||
55 | |||
56 | void OListView::setFullWidth( bool fullWidth ) | ||
57 | { | ||
58 | m_fullWidth = m_fullWidth; | ||
59 | #if QT_VERSION > 290 | ||
60 | header()->setStretchEnabled( fullWidth, columns()-1 ); | ||
61 | #endif | ||
62 | } | ||
63 | |||
64 | bool OListView::fullWidth() const | ||
65 | { | ||
66 | return m_fullWidth; | ||
67 | } | ||
68 | |||
69 | int OListView::addColumn( const QString& label, int width ) | ||
70 | { | ||
71 | int result = QListView::addColumn( label, width ); | ||
72 | #if QT_VERSION > 290 | ||
73 | if (m_fullWidth) { | ||
74 | header()->setStretchEnabled( false, columns()-2 ); | ||
75 | header()->setStretchEnabled( true, columns()-1 ); | ||
76 | } | ||
77 | #endif | ||
78 | return result; | ||
79 | } | ||
80 | |||
81 | int OListView::addColumn( const QIconSet& iconset, const QString& label, int width ) | ||
82 | { | ||
83 | int result = QListView::addColumn( iconset, label, width ); | ||
84 | #if QT_VERSION > 290 | ||
85 | if (m_fullWidth) { | ||
86 | header()->setStretchEnabled( false, columns()-2 ); | ||
87 | header()->setStretchEnabled( true, columns()-1 ); | ||
88 | } | ||
89 | #endif | ||
90 | return result; | ||
91 | } | ||
92 | |||
93 | void OListView::removeColumn( int index ) | ||
94 | { | ||
95 | QListView::removeColumn(index); | ||
96 | #if QT_VERSION > 290 | ||
97 | if ( m_fullWidth && index == columns() ) | ||
98 | { | ||
99 | header()->setStretchEnabled( true, columns()-1 ); | ||
100 | } | ||
101 | #endif | ||
102 | } | ||
103 | |||
104 | const QColor& OListView::alternateBackground() const | ||
105 | { | ||
106 | return m_alternateBackground; | ||
107 | } | ||
108 | |||
109 | void OListView::setAlternateBackground( const QColor &c ) | ||
110 | { | ||
111 | m_alternateBackground = c; | ||
112 | repaint(); | ||
113 | } | ||
114 | |||
115 | const QPen& OListView::columnSeparator() const | ||
116 | { | ||
117 | return m_columnSeparator; | ||
118 | } | ||
119 | |||
120 | void OListView::setColumnSeparator( const QPen& p ) | ||
121 | { | ||
122 | m_columnSeparator = p; | ||
123 | repaint(); | ||
124 | } | ||
125 | |||
126 | //****************************** OListViewItem *********************************************************************** | ||
127 | |||
128 | OListViewItem::OListViewItem(QListView *parent) | ||
129 | : QListViewItem(parent) | ||
130 | { | ||
131 | init(); | ||
132 | } | ||
133 | |||
134 | OListViewItem::OListViewItem(QListViewItem *parent) | ||
135 | : QListViewItem(parent) | ||
136 | { | ||
137 | init(); | ||
138 | } | ||
139 | |||
140 | OListViewItem::OListViewItem(QListView *parent, QListViewItem *after) | ||
141 | : QListViewItem(parent, after) | ||
142 | { | ||
143 | init(); | ||
144 | } | ||
145 | |||
146 | OListViewItem::OListViewItem(QListViewItem *parent, QListViewItem *after) | ||
147 | : QListViewItem(parent, after) | ||
148 | { | ||
149 | init(); | ||
150 | } | ||
151 | |||
152 | OListViewItem::OListViewItem(QListView *parent, | ||
153 | QString label1, QString label2, QString label3, QString label4, | ||
154 | QString label5, QString label6, QString label7, QString label8) | ||
155 | : QListViewItem(parent, label1, label2, label3, label4, label5, label6, label7, label8) | ||
156 | { | ||
157 | init(); | ||
158 | } | ||
159 | |||
160 | OListViewItem::OListViewItem(QListViewItem *parent, | ||
161 | QString label1, QString label2, QString label3, QString label4, | ||
162 | QString label5, QString label6, QString label7, QString label8) | ||
163 | : QListViewItem(parent, label1, label2, label3, label4, label5, label6, label7, label8) | ||
164 | { | ||
165 | init(); | ||
166 | } | ||
167 | |||
168 | OListViewItem::OListViewItem(QListView *parent, QListViewItem *after, | ||
169 | QString label1, QString label2, QString label3, QString label4, | ||
170 | QString label5, QString label6, QString label7, QString label8) | ||
171 | : QListViewItem(parent, after, label1, label2, label3, label4, label5, label6, label7, label8) | ||
172 | { | ||
173 | init(); | ||
174 | } | ||
175 | |||
176 | OListViewItem::OListViewItem(QListViewItem *parent, QListViewItem *after, | ||
177 | QString label1, QString label2, QString label3, QString label4, | ||
178 | QString label5, QString label6, QString label7, QString label8) | ||
179 | : QListViewItem(parent, after, label1, label2, label3, label4, label5, label6, label7, label8) | ||
180 | { | ||
181 | init(); | ||
182 | } | ||
183 | |||
184 | OListViewItem::~OListViewItem() | ||
185 | { | ||
186 | } | ||
187 | |||
188 | void OListViewItem::init() | ||
189 | { | ||
190 | m_known = false; | ||
191 | } | ||
192 | |||
193 | const QColor &OListViewItem::backgroundColor() | ||
194 | { | ||
195 | return isAlternate() ? static_cast<OListView*>(listView())->alternateBackground() : | ||
196 | listView()->viewport()->colorGroup().base(); | ||
197 | } | ||
198 | |||
199 | bool OListViewItem::isAlternate() | ||
200 | { | ||
201 | OListView *lv = static_cast<OListView*>( listView() ); | ||
202 | |||
203 | // check if the item above is an OListViewItem | ||
204 | OListViewItem *above = static_cast<OListViewItem*>( itemAbove() ); | ||
205 | /*if (not itemAbove()->inherits( "OListViewItem" )) return false;*/ | ||
206 | |||
207 | // check if we have a valid alternate background color | ||
208 | if (not (lv && lv->alternateBackground().isValid())) return false; | ||
209 | |||
210 | m_known = above ? above->m_known : true; | ||
211 | if (m_known) | ||
212 | { | ||
213 | m_odd = above ? !above->m_odd : false; | ||
214 | } | ||
215 | else | ||
216 | { | ||
217 | OListViewItem *item; | ||
218 | bool previous = true; | ||
219 | if (parent()) | ||
220 | { | ||
221 | item = static_cast<OListViewItem *>(parent()); | ||
222 | if ( item /*&& item->inherits( "OListViewItem" )*/ ) previous = item->m_odd; | ||
223 | item = static_cast<OListViewItem *>(parent()->firstChild()); | ||
224 | /* if !( item.inherits( "OListViewItem" ) item = 0; */ | ||
225 | } | ||
226 | else | ||
227 | { | ||
228 | item = static_cast<OListViewItem *>(lv->firstChild()); | ||
229 | } | ||
230 | |||
231 | while(item) | ||
232 | { | ||
233 | item->m_odd = previous = !previous; | ||
234 | item->m_known = true; | ||
235 | item = static_cast<OListViewItem *>(item->nextSibling()); | ||
236 | /* if !(item.inherits( "OListViewItem" ) ) break; */ | ||
237 | } | ||
238 | } | ||
239 | return m_odd; | ||
240 | } | ||
241 | |||
242 | void OListViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, int width, int alignment) | ||
243 | { | ||
244 | QColorGroup _cg = cg; | ||
245 | const QPixmap *pm = listView()->viewport()->backgroundPixmap(); | ||
246 | if (pm && !pm->isNull()) | ||
247 | { | ||
248 | _cg.setBrush(QColorGroup::Base, QBrush(backgroundColor(), *pm)); | ||
249 | p->setBrushOrigin( -listView()->contentsX(), -listView()->contentsY() ); | ||
250 | } | ||
251 | else if ( isAlternate() ) | ||
252 | { | ||
253 | _cg.setColor( QColorGroup::Base, static_cast<OListView*>( listView() )->alternateBackground() ); | ||
254 | } | ||
255 | QListViewItem::paintCell(p, _cg, column, width, alignment); | ||
256 | |||
257 | //FIXME: Use styling here? | ||
258 | |||
259 | const QPen& pen = static_cast<OListView*>( listView() )->columnSeparator(); | ||
260 | p->setPen( pen ); | ||
261 | p->drawLine( width-1, 0, width-1, height() ); | ||
262 | } | ||
diff --git a/noncore/net/wellenreiter/cornucopia/olistview.h b/noncore/net/wellenreiter/cornucopia/olistview.h new file mode 100644 index 0000000..4b9e4b0 --- a/dev/null +++ b/noncore/net/wellenreiter/cornucopia/olistview.h | |||
@@ -0,0 +1,168 @@ | |||
1 | /* | ||
2 | This file is part of the Opie Project | ||
3 | |||
4 | Copyright (C) 2003 Michael 'Mickey' Lauer | ||
5 | <mickey@tm.informatik.uni-frankfurt.de> | ||
6 | =. | ||
7 | .=l. | ||
8 | .>+-= | ||
9 | _;:, .> :=|. This program is free software; you can | ||
10 | .> <`_, > . <= redistribute it and/or modify it under | ||
11 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | ||
12 | .="- .-=="i, .._ License as published by the Free Software | ||
13 | - . .-<_> .<> Foundation; either version 2 of the License, | ||
14 | ._= =} : or (at your option) any later version. | ||
15 | .%`+i> _;_. | ||
16 | .i_,=:_. -<s. This program is distributed in the hope that | ||
17 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | ||
18 | : .. .:, . . . without even the implied warranty of | ||
19 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | ||
20 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | ||
21 | ..}^=.= = ; Library General Public License for more | ||
22 | ++= -. .` .: details. | ||
23 | : = ...= . :.=- | ||
24 | -. .:....=;==+<; You should have received a copy of the GNU | ||
25 | -_. . . )=. = Library General Public License along with | ||
26 | -- :-=` this library; see the file COPYING.LIB. | ||
27 | If not, write to the Free Software Foundation, | ||
28 | Inc., 59 Temple Place - Suite 330, | ||
29 | Boston, MA 02111-1307, USA. | ||
30 | |||
31 | */ | ||
32 | |||
33 | #ifndef OLISTVIEW_H | ||
34 | #define OLISTVIEW_H | ||
35 | |||
36 | #include <qlistview.h> | ||
37 | #include <qcolor.h> | ||
38 | #include <qpen.h> | ||
39 | |||
40 | /** | ||
41 | * A @ref QListView variant featuring visual enhancements | ||
42 | * like an alternate background for odd rows and an autostretch | ||
43 | * mode for the width of the widget. | ||
44 | * | ||
45 | * @author Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de> | ||
46 | * @short OListView list/tree widget. | ||
47 | */ | ||
48 | class OListView: public QListView | ||
49 | { | ||
50 | public: | ||
51 | /** | ||
52 | * Constructor. | ||
53 | * | ||
54 | * The parameters @p parent and @p name are handled by | ||
55 | * @ref QListView, as usual. | ||
56 | */ | ||
57 | OListView ( QWidget *parent = 0, const char *name = 0 ); | ||
58 | |||
59 | /** | ||
60 | * Destructor. | ||
61 | */ | ||
62 | virtual ~OListView(); | ||
63 | |||
64 | /** | ||
65 | * Let the last column fit exactly all the available width. | ||
66 | */ | ||
67 | void setFullWidth( bool fullWidth ); | ||
68 | |||
69 | /** | ||
70 | * Returns whether the last column is set to fit the available width. | ||
71 | */ | ||
72 | bool fullWidth() const; | ||
73 | |||
74 | /** | ||
75 | * Reimplemented for full width support | ||
76 | */ | ||
77 | virtual int addColumn( const QString& label, int width = -1 ); | ||
78 | |||
79 | /** | ||
80 | * Reimplemented for full width support | ||
81 | */ | ||
82 | virtual int addColumn( const QIconSet& iconset, const QString& label, int width = -1 ); | ||
83 | |||
84 | /** | ||
85 | * Reimplemented for full width support | ||
86 | */ | ||
87 | virtual void removeColumn(int index); | ||
88 | |||
89 | /** | ||
90 | * sets the alternate background background color. | ||
91 | * This only has an effect if the items are OListViewItems | ||
92 | * | ||
93 | * @param c the color to use for every other item. Set to an invalid | ||
94 | * color to disable alternate colors. | ||
95 | */ | ||
96 | void setAlternateBackground( const QColor &c ); | ||
97 | |||
98 | /** | ||
99 | * sets the column separator pen. | ||
100 | * | ||
101 | * @param p the pen used to draw the column separator. | ||
102 | */ | ||
103 | void setColumnSeparator( const QPen &p ); | ||
104 | |||
105 | /** | ||
106 | * @return the alternate background color | ||
107 | */ | ||
108 | const QColor& alternateBackground() const; | ||
109 | |||
110 | /** | ||
111 | * @return the column separator pen | ||
112 | */ | ||
113 | const QPen& columnSeparator() const; | ||
114 | |||
115 | private: | ||
116 | QColor m_alternateBackground; | ||
117 | bool m_fullWidth; | ||
118 | QPen m_columnSeparator; | ||
119 | |||
120 | }; | ||
121 | |||
122 | //****************************** OListViewItem ****************************************************************** | ||
123 | |||
124 | class OListViewItem: public QListViewItem | ||
125 | { | ||
126 | public: | ||
127 | OListViewItem( QListView * parent ); | ||
128 | OListViewItem( QListViewItem * parent ); | ||
129 | OListViewItem( QListView * parent, QListViewItem * after ); | ||
130 | OListViewItem( QListViewItem * parent, QListViewItem * after ); | ||
131 | |||
132 | OListViewItem( QListView * parent, | ||
133 | QString, QString = QString::null, | ||
134 | QString = QString::null, QString = QString::null, | ||
135 | QString = QString::null, QString = QString::null, | ||
136 | QString = QString::null, QString = QString::null ); | ||
137 | |||
138 | OListViewItem( QListViewItem * parent, | ||
139 | QString, QString = QString::null, | ||
140 | QString = QString::null, QString = QString::null, | ||
141 | QString = QString::null, QString = QString::null, | ||
142 | QString = QString::null, QString = QString::null ); | ||
143 | |||
144 | OListViewItem( QListView * parent, QListViewItem * after, | ||
145 | QString, QString = QString::null, | ||
146 | QString = QString::null, QString = QString::null, | ||
147 | QString = QString::null, QString = QString::null, | ||
148 | QString = QString::null, QString = QString::null ); | ||
149 | |||
150 | OListViewItem( QListViewItem * parent, QListViewItem * after, | ||
151 | QString, QString = QString::null, | ||
152 | QString = QString::null, QString = QString::null, | ||
153 | QString = QString::null, QString = QString::null, | ||
154 | QString = QString::null, QString = QString::null ); | ||
155 | |||
156 | virtual ~OListViewItem(); | ||
157 | |||
158 | const QColor& backgroundColor(); | ||
159 | bool isAlternate(); | ||
160 | void paintCell( QPainter *p, const QColorGroup &cg, int column, int width, int alignment ); | ||
161 | void init(); | ||
162 | |||
163 | private: | ||
164 | bool m_known; | ||
165 | bool m_odd; | ||
166 | }; | ||
167 | |||
168 | #endif | ||
diff --git a/noncore/net/wellenreiter/gui/gui.pro b/noncore/net/wellenreiter/gui/gui.pro index 822b0db..6037661 100644 --- a/noncore/net/wellenreiter/gui/gui.pro +++ b/noncore/net/wellenreiter/gui/gui.pro | |||
@@ -31,7 +31,7 @@ SOURCES = main.cpp \ | |||
31 | 31 | ||
32 | INCLUDEPATH += $(OPIEDIR)/include ../ | 32 | INCLUDEPATH += $(OPIEDIR)/include ../ |
33 | DEPENDPATH += $(OPIEDIR)/include ../ | 33 | DEPENDPATH += $(OPIEDIR)/include ../ |
34 | LIBS += -L. -lwellenreiter | 34 | LIBS += -L. -lwellenreiter -lcornucopia |
35 | INTERFACES = configbase.ui | 35 | INTERFACES = configbase.ui |
36 | TARGET = wellenreiter | 36 | TARGET = wellenreiter |
37 | 37 | ||
diff --git a/noncore/net/wellenreiter/gui/scanlist.cpp b/noncore/net/wellenreiter/gui/scanlist.cpp index a689cca..6d3469c 100644 --- a/noncore/net/wellenreiter/gui/scanlist.cpp +++ b/noncore/net/wellenreiter/gui/scanlist.cpp | |||
@@ -21,7 +21,7 @@ | |||
21 | #include "manufacturers.h" | 21 | #include "manufacturers.h" |
22 | 22 | ||
23 | MScanListView::MScanListView( QWidget* parent, const char* name ) | 23 | MScanListView::MScanListView( QWidget* parent, const char* name ) |
24 | :QListView( parent, name ), _manufacturerdb( 0 ) | 24 | :OListView( parent, name ), _manufacturerdb( 0 ) |
25 | { | 25 | { |
26 | 26 | ||
27 | setFrameShape( QListView::StyledPanel ); | 27 | setFrameShape( QListView::StyledPanel ); |
diff --git a/noncore/net/wellenreiter/gui/scanlist.h b/noncore/net/wellenreiter/gui/scanlist.h index 9a35a82..475f7b6 100644 --- a/noncore/net/wellenreiter/gui/scanlist.h +++ b/noncore/net/wellenreiter/gui/scanlist.h | |||
@@ -16,13 +16,13 @@ | |||
16 | #ifndef SCANLIST_H | 16 | #ifndef SCANLIST_H |
17 | #define SCANLIST_H | 17 | #define SCANLIST_H |
18 | 18 | ||
19 | #include <qlistview.h> | 19 | #include <cornucopia/olistview.h> |
20 | 20 | ||
21 | class QString; | 21 | class QString; |
22 | 22 | ||
23 | class ManufacturerDB; | 23 | class ManufacturerDB; |
24 | 24 | ||
25 | class MScanListView: public QListView | 25 | class MScanListView: public OListView |
26 | { | 26 | { |
27 | Q_OBJECT | 27 | Q_OBJECT |
28 | 28 | ||
diff --git a/noncore/net/wellenreiter/gui/scanlistitem.cpp b/noncore/net/wellenreiter/gui/scanlistitem.cpp index dd33f5f..bfa7aa9 100644 --- a/noncore/net/wellenreiter/gui/scanlistitem.cpp +++ b/noncore/net/wellenreiter/gui/scanlistitem.cpp | |||
@@ -37,7 +37,7 @@ const int col_lastseen = 8; | |||
37 | 37 | ||
38 | MScanListItem::MScanListItem( QListView* parent, QString type, QString essid, QString macaddr, | 38 | MScanListItem::MScanListItem( QListView* parent, QString type, QString essid, QString macaddr, |
39 | bool wep, int channel, int signal ) | 39 | bool wep, int channel, int signal ) |
40 | :QListViewItem( parent, essid, QString::null, macaddr, QString::null, QString::null ), | 40 | :OListViewItem( parent, essid, QString::null, macaddr, QString::null, QString::null ), |
41 | _type( type ), _essid( essid ), _macaddr( macaddr ), _wep( wep ), | 41 | _type( type ), _essid( essid ), _macaddr( macaddr ), _wep( wep ), |
42 | _channel( channel ), _signal( signal ), _beacons( 0 ) | 42 | _channel( channel ), _signal( signal ), _beacons( 0 ) |
43 | { | 43 | { |
@@ -47,7 +47,7 @@ MScanListItem::MScanListItem( QListView* parent, QString type, QString essid, QS | |||
47 | 47 | ||
48 | MScanListItem::MScanListItem( QListViewItem* parent, QString type, QString essid, QString macaddr, | 48 | MScanListItem::MScanListItem( QListViewItem* parent, QString type, QString essid, QString macaddr, |
49 | bool wep, int channel, int signal ) | 49 | bool wep, int channel, int signal ) |
50 | :QListViewItem( parent, essid, QString::null, macaddr, QString::null, QString::null ) | 50 | :OListViewItem( parent, essid, QString::null, macaddr, QString::null, QString::null ) |
51 | { | 51 | { |
52 | qDebug( "creating scanlist item" ); | 52 | qDebug( "creating scanlist item" ); |
53 | decorateItem( type, essid, macaddr, wep, channel, signal ); | 53 | decorateItem( type, essid, macaddr, wep, channel, signal ); |
diff --git a/noncore/net/wellenreiter/gui/scanlistitem.h b/noncore/net/wellenreiter/gui/scanlistitem.h index c3c6255..89b3bc4 100644 --- a/noncore/net/wellenreiter/gui/scanlistitem.h +++ b/noncore/net/wellenreiter/gui/scanlistitem.h | |||
@@ -16,11 +16,11 @@ | |||
16 | #ifndef SCANLISTITEM_H | 16 | #ifndef SCANLISTITEM_H |
17 | #define SCANLISTITEM_H | 17 | #define SCANLISTITEM_H |
18 | 18 | ||
19 | #include <qlistview.h> | 19 | #include <cornucopia/olistview.h> |
20 | 20 | ||
21 | class QString; | 21 | class QString; |
22 | 22 | ||
23 | class MScanListItem: public QListViewItem | 23 | class MScanListItem: public OListViewItem |
24 | { | 24 | { |
25 | public: | 25 | public: |
26 | 26 | ||
@@ -46,11 +46,11 @@ class MScanListItem: public QListViewItem | |||
46 | virtual void decorateItem( QString type, QString essid, QString macaddr, bool wep, int channel, int signal ); | 46 | virtual void decorateItem( QString type, QString essid, QString macaddr, bool wep, int channel, int signal ); |
47 | 47 | ||
48 | public: | 48 | public: |
49 | 49 | ||
50 | QString type; | 50 | QString type; |
51 | 51 | ||
52 | public: | 52 | public: |
53 | 53 | ||
54 | //const QString& type() { return _type; }; | 54 | //const QString& type() { return _type; }; |
55 | const QString& essid() { return _essid; }; | 55 | const QString& essid() { return _essid; }; |
56 | const QString& macaddr() { return _macaddr; }; | 56 | const QString& macaddr() { return _macaddr; }; |
@@ -58,12 +58,12 @@ class MScanListItem: public QListViewItem | |||
58 | int channel() { return _channel; }; | 58 | int channel() { return _channel; }; |
59 | int signal() { return _signal; }; | 59 | int signal() { return _signal; }; |
60 | int beacons() { return _beacons; }; | 60 | int beacons() { return _beacons; }; |
61 | 61 | ||
62 | void setSignal( int signal ) { /* TODO */ }; | 62 | void setSignal( int signal ) { /* TODO */ }; |
63 | void receivedBeacon(); | 63 | void receivedBeacon(); |
64 | 64 | ||
65 | void setManufacturer( const QString& manufacturer ); | 65 | void setManufacturer( const QString& manufacturer ); |
66 | 66 | ||
67 | private: | 67 | private: |
68 | QString _type; | 68 | QString _type; |
69 | QString _essid; | 69 | QString _essid; |
@@ -72,7 +72,7 @@ class MScanListItem: public QListViewItem | |||
72 | int _channel; | 72 | int _channel; |
73 | int _signal; | 73 | int _signal; |
74 | int _beacons; | 74 | int _beacons; |
75 | 75 | ||
76 | }; | 76 | }; |
77 | 77 | ||
78 | #endif | 78 | #endif |
diff --git a/noncore/net/wellenreiter/opie-wellenreiter.control b/noncore/net/wellenreiter/opie-wellenreiter.control index c4cfa10..6fa79c1 100644 --- a/noncore/net/wellenreiter/opie-wellenreiter.control +++ b/noncore/net/wellenreiter/opie-wellenreiter.control | |||
@@ -1,7 +1,7 @@ | |||
1 | Files: bin/wellenreiter bin/wellenreiterd share/wellenreiter pics/wellenreiter apps/Applications/wellenreiter.desktop $OPIEDIR/lib/libwellenreiter.* | 1 | Files: bin/wellenreiter bin/wellenreiterd share/wellenreiter pics/wellenreiter apps/Applications/wellenreiter.desktop $OPIEDIR/lib/libwellenreiter.* $OPIEDIR/lib/libcornucopia.* |
2 | Priority: optional | 2 | Priority: optional |
3 | Section: opie/applications | 3 | Section: opie/applications |
4 | Maintainer: Michael Lauer <mickeyl@handhelds.org> | 4 | Maintainer: Michael 'Mickey' Lauer <mickeyl@handhelds.org> |
5 | Architecture: arm | 5 | Architecture: arm |
6 | Version: $QPE_VERSION-$SUB_VERSION | 6 | Version: $QPE_VERSION-$SUB_VERSION |
7 | Depends: opie-base, libpcap | 7 | Depends: opie-base, libpcap |
diff --git a/noncore/net/wellenreiter/wellenreiter.pro b/noncore/net/wellenreiter/wellenreiter.pro index 17d0e31..1d76564 100644 --- a/noncore/net/wellenreiter/wellenreiter.pro +++ b/noncore/net/wellenreiter/wellenreiter.pro | |||
@@ -1,5 +1,5 @@ | |||
1 | TEMPLATE = subdirs | 1 | TEMPLATE = subdirs |
2 | unix:SUBDIRS = libwellenreiter daemon gui | 2 | unix:SUBDIRS = cornucopia libwellenreiter daemon gui |
3 | 3 | ||
4 | 4 | ||
5 | !contains( platform, x11 ) { | 5 | !contains( platform, x11 ) { |