author | mickeyl <mickeyl> | 2003-02-24 15:54:13 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2003-02-24 15:54:13 (UTC) |
commit | f294a5d101fc9935e1a73f3d44b43ea00d0a03c7 (patch) (side-by-side diff) | |
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 | 110 | ||||
-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 | 4 | ||||
-rw-r--r-- | noncore/net/wellenreiter/opie-wellenreiter.control | 4 | ||||
-rw-r--r-- | noncore/net/wellenreiter/wellenreiter.pro | 2 |
15 files changed, 513 insertions, 80 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 @@ -1,28 +1,28 @@ # Warning: Handcrafted! ############################################################################# # Makefile for building targets in sub directories. # Project: wellenreiter # Template: subdirs ############################################################################# MAKEFILE= Makefile TMAKE = tmake -SUBDIRS = libwellenreiter/source daemon/source gui +SUBDIRS = libwellenreiter/source daemon/source gui cornucopia all: $(SUBDIRS) $(SUBDIRS): FORCE cd $@; $(MAKE) tmake: tmake wellenreiter.pro tmake_all: for i in $(SUBDIRS); do ( if [ -d $$i ]; then cd $$i ; pro=`basename $$i`.pro ; $(TMAKE) $$pro -o $(MAKEFILE); grep "TEMPLATE.*subdirs" $$pro 2>/dev/null >/dev/null && $(MAKE) -f $(MAKEFILE) tmake_all || true; fi; ) ; done clean release debug: for i in $(SUBDIRS); do ( if [ -d $$i ]; then cd $$i ; $(MAKE) $@; fi; ) ; done FORCE: 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 @@ -/*************************************************************************/ +/************************************************************************/ /* W e l l e n r e i t e r I I */ /* =============================== */ /* */ - /* Version: Opie-ALPHA-January */ -/*************************************************************************/ +/* Version: Opie-ALPHA-February */ +/************************************************************************/ --------------------------------------------------- -Release Notes for Opie-ALPHA Version January 2002 --------------------------------------------------- +---------------------------------------------------- +Release Notes for Opie-ALPHA Version February 2002 +---------------------------------------------------- ===================== = Supported Devices = ===================== -* low-level orinoco_cs-based (including prism2 and spectrum_cs) +- HERMES chipset [ orinoco ], e.g. Lucent/Agere cards +- PRISM2 chipset [ orinoco or hostap ], e.g. D-Link, Buffallo +- SYMBOL/SPECTRUM chipset* [ orinoco ], e.g. Symbol Spectrum 24, Socket Lowpower CF +- CISCO chipset + +* Warning: Current Symbol/Spectrum CF drivers have bugs - they freeze the system in monitor mode. + This has nothing todo with Wellenreiter as its a driver problem. ===================== = Build = ===================== (I) Opie Build Environment -To compile Wellenreiter within the Opie build environment, add the -following directories to $OPIEDIR/Makefile, e.g. to 'NONAPPS=' - -noncore/net/wellenreiter/libwellenreiter \ -noncore/net/wellenreiter/daemon \ -noncore/net/wellenreiter/contrib/orinoco_hopper \ -noncore/net/wellenreiter/gui +To compile Wellenreiter within the Opie build environment, do +'make menuconfig' and check Wellenreiter in the subsection +"Communications and Networking" -./configure and rebuild. Note that you need libpcap in your toolchain. +do 'make SUBDIRS=noncore/net/wellenreiter' or 'make' (to build everything) +Note that you need to have libpcap in your toolchain. (II) OpenZaurus Build Environment -To compile Wellenreiter within the OZ build environment, add the -following lines to $OPIEDIR/packages: -CONFIG_WELLENREITER noncore/net/wellenreiter/libwellenreiter libwellenreiter.pro -CONFIG_WELLENREITER noncore/net/wellenreiter/daemon daemon.pro -CONFIG_WELLENREITER noncore/net/wellenreiter/gui gui.pro -CONFIG_WELLENREITER noncore/net/wellenreiter/contrib/orinoco_hopper orinoco_hopper.pro - -make -f Makefile.test clean-configs -cd <BUILDROOT> -make SUBDIRS=packages/opie package +See (I), but do 'make SUBDIRS=packages/opie' (III) To compile a standalone Wellenreiter for X11, you need Qt3 and the development packages for Qt3, e.g. libqt3-devel. Assuming, $QTDIR is set to your Qt-Director (e.g. /usr/lib/qt3), set $OPIEDIR to your installation prefix, e.g. /usr/local, then -export QMAKESPEC=$QTDIR/mkspecs/linux-g++ -qmake "platform=x11" wellenreiter.pro -make -make install +'export QMAKESPEC=$QTDIR/mkspecs/linux-g++' +'qmake "platform=x11" wellenreiter.pro' +'make' +'make install' ===================== = Install = ===================== Alternatively, you can use our precompiled ipk. Get it from -http://opie.net.wox.org/wellenreiter/. This also includes a recent libpcap. +http://opie.net.wox.org/wellenreiter/. There is also a recent libpcap available. ===================== = Run = ===================== There are two possible modes: <Manual> and <Automatic>. I suggest, you -start with the <Automatic> Mode. This works just using the "Start" -and "Stop" Pushbuttons in the Wellenreiter GUI. If this doesn't work, -then use the following strategy: - -1. Place card in monitor mode. This is device dependent. - - Caution: Don't do this while you're logged in via ssh - or otherwise using the wireless interface - your connection - will freeze: The card can't be used normally when sniffing! - - For most orinoco-based cards this can be done using either - 'iwpriv <interface> 2' or 'iwpriv <interface> 2 1'. - - You can check if this works, by calling 'ifconfig <interface>'. - If you see 'Protocol: UNSPEC' and an unusual long MAC-Address, - then your card has been successfully set to the monitor mode. - -2. Start a channel hopper. A wireless card has several channels - (e.g. radio frequencies) here it can listen for beacons. - Beacons are management data frames from other stations. - Remember, this is radio transmission, so the card has to be - "tuned" to a certain channel to be able to receive the beacons. +start with the <Automatic> Mode. This works just using the Start/Stop +Toolbutton in the Wellenreiter Menubar. Note that you need to configure +your card before the Start/Stop-Toolbutton can be clicked. - In order to scan the complete frequency spectrum and thus be able - to detect all available stations, you have to 'hop' through the - channels frequently. You can do this manually (e.g. with 'iwconfig') - [hahaha] or you can use a channel hopper. +If this doesn't work, then try calling the wellenreiter daemon +[wellenreiterd] manually. It has a command line interface. You can +start the GUI before or after the daemon. - For convenience, the current Wellenreiter Alpha comes with a - channel hopper for Orinoco-based cards. Start this via - orinoco_hopper <interface>. +===================== += Credits = +===================== -3. Start the Wellenreiter sniffing daemon: wellenreiterd. +Wellenreiter/Opie is (C) 2002-2003 M-M-M -4. Start the Wellenreiter GUI and sniff like hell. Don't press the button - "Start Scan" yet, because it enables the demo mode and will crash the - wellenreiterd daemon if running. +Sniffer Engine: Max Moser <max@remote-exploit.org> +Communication and Protocol: Martin J. Muench <mjm@remote-exploit.org> +GUI and Packaging: Michael Lauer <mickeyl@handhelds.org> ===================== -= Credits = += Links = ===================== -Sniffer: Max Moser <max@remote-exploit.org> -Communication and Protocol: Martin J. Muench <mjm@remote-exploit.org> -GUI: Michael Lauer <mickeyl@handhelds.org> +Opie Project: http://opie.handhelds.org +OpenZaurus Project: http://openzaurus.org +Wellenreiter: http://www.remote-exploit.org +Wellenreiter/Opie: http://opie.net.wox.org/wellenreiter + 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 @@ config WELLENREITER - boolean "wellenreiter" + boolean "wellenreiter (wireless LAN monitor)" default "y" 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 @@ +*.o +*~ +Makefile* +moc_* +wellenreitertemplate.cpp +wellenreitertemplate.h +configbase.h +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 @@ +--------------------------------------------------------------- +Dies ist ein Testballon für opielibs1.2 - Codename: Cornucopia +--------------------------------------------------------------- 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 @@ +DESTDIR = $(OPIEDIR)/lib +MOC_DIR = ./tmp +OBJECTS_DIR = ./tmp +TEMPLATE = lib +CONFIG = qt warn_on debug +VERSION = 0.1 +HEADERS = olistview.h +SOURCES = olistview.cpp +INCLUDEPATH = $(OPIEDIR)/include +DEPENDPATH = $(OPIEDIR)/include +TARGET = cornucopia + +!contains( platform, x11 ) { + include ( $(OPIEDIR)/include.pro ) +} + 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 @@ +/* + This file is part of the Opie Project + + Copyright (C) 2003 Michael 'Mickey' Lauer + <mickey@tm.informatik.uni-frankfurt.de> + =. + .=l. + .>+-= + _;:, .> :=|. This program is free software; you can +.> <`_, > . <= redistribute it and/or modify it under +:`=1 )Y*s>-.-- : the terms of the GNU Library General Public +.="- .-=="i, .._ License as published by the Free Software + - . .-<_> .<> Foundation; either version 2 of the License, + ._= =} : or (at your option) any later version. + .%`+i> _;_. + .i_,=:_. -<s. This program is distributed in the hope that + + . -:. = it will be useful, but WITHOUT ANY WARRANTY; + : .. .:, . . . without even the implied warranty of + =_ + =;=|` MERCHANTABILITY or FITNESS FOR A + _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU +..}^=.= = ; Library General Public License for more +++= -. .` .: details. + : = ...= . :.=- + -. .:....=;==+<; You should have received a copy of the GNU + -_. . . )=. = Library General Public License along with + -- :-=` this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. + +*/ + +#include <qcolor.h> +#include <qheader.h> +#include <qpainter.h> +#include <qpixmap.h> + +#include "olistview.h" + +//****************************** OListView ************************************************************************** + +OListView::OListView( QWidget *parent, const char *name ) + :QListView( parent, name ) +{ + //FIXME: get from global settings and calculate ==> see oglobalsettings.* + + m_alternateBackground = QColor( 238, 246, 255 ); + m_columnSeparator = QPen( QColor( 150, 160, 170 ), 0, DotLine ); + m_fullWidth = true; +} + +OListView::~OListView() +{ +} + +void OListView::setFullWidth( bool fullWidth ) +{ + m_fullWidth = m_fullWidth; + #if QT_VERSION > 290 + header()->setStretchEnabled( fullWidth, columns()-1 ); + #endif +} + +bool OListView::fullWidth() const +{ + return m_fullWidth; +} + +int OListView::addColumn( const QString& label, int width ) +{ + int result = QListView::addColumn( label, width ); + #if QT_VERSION > 290 + if (m_fullWidth) { + header()->setStretchEnabled( false, columns()-2 ); + header()->setStretchEnabled( true, columns()-1 ); + } + #endif + return result; +} + +int OListView::addColumn( const QIconSet& iconset, const QString& label, int width ) +{ + int result = QListView::addColumn( iconset, label, width ); + #if QT_VERSION > 290 + if (m_fullWidth) { + header()->setStretchEnabled( false, columns()-2 ); + header()->setStretchEnabled( true, columns()-1 ); + } + #endif + return result; +} + +void OListView::removeColumn( int index ) +{ + QListView::removeColumn(index); + #if QT_VERSION > 290 + if ( m_fullWidth && index == columns() ) + { + header()->setStretchEnabled( true, columns()-1 ); + } + #endif +} + +const QColor& OListView::alternateBackground() const +{ + return m_alternateBackground; +} + +void OListView::setAlternateBackground( const QColor &c ) +{ + m_alternateBackground = c; + repaint(); +} + +const QPen& OListView::columnSeparator() const +{ + return m_columnSeparator; +} + +void OListView::setColumnSeparator( const QPen& p ) +{ + m_columnSeparator = p; + repaint(); +} + +//****************************** OListViewItem *********************************************************************** + +OListViewItem::OListViewItem(QListView *parent) + : QListViewItem(parent) +{ + init(); +} + +OListViewItem::OListViewItem(QListViewItem *parent) + : QListViewItem(parent) +{ + init(); +} + +OListViewItem::OListViewItem(QListView *parent, QListViewItem *after) + : QListViewItem(parent, after) +{ + init(); +} + +OListViewItem::OListViewItem(QListViewItem *parent, QListViewItem *after) + : QListViewItem(parent, after) +{ + init(); +} + +OListViewItem::OListViewItem(QListView *parent, + QString label1, QString label2, QString label3, QString label4, + QString label5, QString label6, QString label7, QString label8) + : QListViewItem(parent, label1, label2, label3, label4, label5, label6, label7, label8) +{ + init(); +} + +OListViewItem::OListViewItem(QListViewItem *parent, + QString label1, QString label2, QString label3, QString label4, + QString label5, QString label6, QString label7, QString label8) + : QListViewItem(parent, label1, label2, label3, label4, label5, label6, label7, label8) +{ + init(); +} + +OListViewItem::OListViewItem(QListView *parent, QListViewItem *after, + QString label1, QString label2, QString label3, QString label4, + QString label5, QString label6, QString label7, QString label8) + : QListViewItem(parent, after, label1, label2, label3, label4, label5, label6, label7, label8) +{ + init(); +} + +OListViewItem::OListViewItem(QListViewItem *parent, QListViewItem *after, + QString label1, QString label2, QString label3, QString label4, + QString label5, QString label6, QString label7, QString label8) + : QListViewItem(parent, after, label1, label2, label3, label4, label5, label6, label7, label8) +{ + init(); +} + +OListViewItem::~OListViewItem() +{ +} + +void OListViewItem::init() +{ + m_known = false; +} + +const QColor &OListViewItem::backgroundColor() +{ + return isAlternate() ? static_cast<OListView*>(listView())->alternateBackground() : + listView()->viewport()->colorGroup().base(); +} + +bool OListViewItem::isAlternate() +{ + OListView *lv = static_cast<OListView*>( listView() ); + + // check if the item above is an OListViewItem + OListViewItem *above = static_cast<OListViewItem*>( itemAbove() ); + /*if (not itemAbove()->inherits( "OListViewItem" )) return false;*/ + + // check if we have a valid alternate background color + if (not (lv && lv->alternateBackground().isValid())) return false; + + m_known = above ? above->m_known : true; + if (m_known) + { + m_odd = above ? !above->m_odd : false; + } + else + { + OListViewItem *item; + bool previous = true; + if (parent()) + { + item = static_cast<OListViewItem *>(parent()); + if ( item /*&& item->inherits( "OListViewItem" )*/ ) previous = item->m_odd; + item = static_cast<OListViewItem *>(parent()->firstChild()); + /* if !( item.inherits( "OListViewItem" ) item = 0; */ + } + else + { + item = static_cast<OListViewItem *>(lv->firstChild()); + } + + while(item) + { + item->m_odd = previous = !previous; + item->m_known = true; + item = static_cast<OListViewItem *>(item->nextSibling()); + /* if !(item.inherits( "OListViewItem" ) ) break; */ + } + } + return m_odd; +} + +void OListViewItem::paintCell(QPainter *p, const QColorGroup &cg, int column, int width, int alignment) +{ + QColorGroup _cg = cg; + const QPixmap *pm = listView()->viewport()->backgroundPixmap(); + if (pm && !pm->isNull()) + { + _cg.setBrush(QColorGroup::Base, QBrush(backgroundColor(), *pm)); + p->setBrushOrigin( -listView()->contentsX(), -listView()->contentsY() ); + } + else if ( isAlternate() ) + { + _cg.setColor( QColorGroup::Base, static_cast<OListView*>( listView() )->alternateBackground() ); + } + QListViewItem::paintCell(p, _cg, column, width, alignment); + + //FIXME: Use styling here? + + const QPen& pen = static_cast<OListView*>( listView() )->columnSeparator(); + p->setPen( pen ); + p->drawLine( width-1, 0, width-1, height() ); +} 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 @@ +/* + This file is part of the Opie Project + + Copyright (C) 2003 Michael 'Mickey' Lauer + <mickey@tm.informatik.uni-frankfurt.de> + =. + .=l. + .>+-= + _;:, .> :=|. This program is free software; you can +.> <`_, > . <= redistribute it and/or modify it under +:`=1 )Y*s>-.-- : the terms of the GNU Library General Public +.="- .-=="i, .._ License as published by the Free Software + - . .-<_> .<> Foundation; either version 2 of the License, + ._= =} : or (at your option) any later version. + .%`+i> _;_. + .i_,=:_. -<s. This program is distributed in the hope that + + . -:. = it will be useful, but WITHOUT ANY WARRANTY; + : .. .:, . . . without even the implied warranty of + =_ + =;=|` MERCHANTABILITY or FITNESS FOR A + _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU +..}^=.= = ; Library General Public License for more +++= -. .` .: details. + : = ...= . :.=- + -. .:....=;==+<; You should have received a copy of the GNU + -_. . . )=. = Library General Public License along with + -- :-=` this library; see the file COPYING.LIB. + If not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. + +*/ + +#ifndef OLISTVIEW_H +#define OLISTVIEW_H + +#include <qlistview.h> +#include <qcolor.h> +#include <qpen.h> + +/** + * A @ref QListView variant featuring visual enhancements + * like an alternate background for odd rows and an autostretch + * mode for the width of the widget. + * + * @author Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de> + * @short OListView list/tree widget. + */ + class OListView: public QListView +{ + public: + /** + * Constructor. + * + * The parameters @p parent and @p name are handled by + * @ref QListView, as usual. + */ + OListView ( QWidget *parent = 0, const char *name = 0 ); + + /** + * Destructor. + */ + virtual ~OListView(); + + /** + * Let the last column fit exactly all the available width. + */ + void setFullWidth( bool fullWidth ); + + /** + * Returns whether the last column is set to fit the available width. + */ + bool fullWidth() const; + + /** + * Reimplemented for full width support + */ + virtual int addColumn( const QString& label, int width = -1 ); + + /** + * Reimplemented for full width support + */ + virtual int addColumn( const QIconSet& iconset, const QString& label, int width = -1 ); + + /** + * Reimplemented for full width support + */ + virtual void removeColumn(int index); + + /** + * sets the alternate background background color. + * This only has an effect if the items are OListViewItems + * + * @param c the color to use for every other item. Set to an invalid + * color to disable alternate colors. + */ + void setAlternateBackground( const QColor &c ); + + /** + * sets the column separator pen. + * + * @param p the pen used to draw the column separator. + */ + void setColumnSeparator( const QPen &p ); + + /** + * @return the alternate background color + */ + const QColor& alternateBackground() const; + + /** + * @return the column separator pen + */ + const QPen& columnSeparator() const; + + private: + QColor m_alternateBackground; + bool m_fullWidth; + QPen m_columnSeparator; + +}; + +//****************************** OListViewItem ****************************************************************** + +class OListViewItem: public QListViewItem +{ + public: + OListViewItem( QListView * parent ); + OListViewItem( QListViewItem * parent ); + OListViewItem( QListView * parent, QListViewItem * after ); + OListViewItem( QListViewItem * parent, QListViewItem * after ); + + OListViewItem( QListView * parent, + QString, QString = QString::null, + QString = QString::null, QString = QString::null, + QString = QString::null, QString = QString::null, + QString = QString::null, QString = QString::null ); + + OListViewItem( QListViewItem * parent, + QString, QString = QString::null, + QString = QString::null, QString = QString::null, + QString = QString::null, QString = QString::null, + QString = QString::null, QString = QString::null ); + + OListViewItem( QListView * parent, QListViewItem * after, + QString, QString = QString::null, + QString = QString::null, QString = QString::null, + QString = QString::null, QString = QString::null, + QString = QString::null, QString = QString::null ); + + OListViewItem( QListViewItem * parent, QListViewItem * after, + QString, QString = QString::null, + QString = QString::null, QString = QString::null, + QString = QString::null, QString = QString::null, + QString = QString::null, QString = QString::null ); + + virtual ~OListViewItem(); + + const QColor& backgroundColor(); + bool isAlternate(); + void paintCell( QPainter *p, const QColorGroup &cg, int column, int width, int alignment ); + void init(); + + private: + bool m_known; + bool m_odd; +}; + +#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 @@ -1,49 +1,49 @@ MOC_DIR = ./tmp OBJECTS_DIR = ./tmp DESTDIR = $(OPIEDIR)/bin TEMPLATE = app CONFIG = qt warn_on debug HEADERS = wellenreiterbase.h \ mainwindow.h \ wellenreiter.h \ scanlistitem.h \ scanlist.h \ logwindow.h \ hexwindow.h \ configwindow.h \ wlan.h \ cardconfig.h \ manufacturers.h SOURCES = main.cpp \ mainwindow.cpp \ wellenreiterbase.cpp \ wellenreiter.cpp \ scanlistitem.cpp \ scanlist.cpp \ logwindow.cpp \ hexwindow.cpp \ configwindow.cpp \ wlan.cpp \ cardconfig.cpp \ manufacturers.cpp INCLUDEPATH += $(OPIEDIR)/include ../ DEPENDPATH += $(OPIEDIR)/include ../ -LIBS += -L. -lwellenreiter +LIBS += -L. -lwellenreiter -lcornucopia INTERFACES = configbase.ui TARGET = wellenreiter !contains( platform, x11 ) { message( qws ) include ( $(OPIEDIR)/include.pro ) LIBS += -lqpe -lopie } contains( platform, x11 ) { LIBS += -L$(OPIEDIR)/lib -Wl,-rpath,$(OPIEDIR)/lib SOURCES += resource.cpp HEADERS += resource.h } 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 @@ -1,153 +1,153 @@ /********************************************************************** ** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. ** ** This file is part of Opie Environment. ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** **********************************************************************/ #include "scanlist.h" #include "scanlistitem.h" #include <assert.h> #include "manufacturers.h" MScanListView::MScanListView( QWidget* parent, const char* name ) - :QListView( parent, name ), _manufacturerdb( 0 ) + :OListView( parent, name ), _manufacturerdb( 0 ) { setFrameShape( QListView::StyledPanel ); setFrameShadow( QListView::Sunken ); addColumn( tr( "Net/Station" ) ); setColumnAlignment( 0, AlignLeft || AlignVCenter ); addColumn( tr( "B" ) ); setColumnAlignment( 1, AlignCenter ); addColumn( tr( "AP" ) ); setColumnAlignment( 2, AlignCenter ); addColumn( tr( "Chn" ) ); setColumnAlignment( 3, AlignCenter ); addColumn( tr( "W" ) ); setColumnAlignment( 4, AlignCenter ); addColumn( tr( "T" ) ); setColumnAlignment( 5, AlignCenter ); addColumn( tr( "Manufacturer" ) ); setColumnAlignment( 6, AlignCenter ); addColumn( tr( "First Seen" ) ); setColumnAlignment( 7, AlignCenter ); addColumn( tr( "Last Seen" ) ); setColumnAlignment( 8, AlignCenter ); setRootIsDecorated( true ); setAllColumnsShowFocus( true ); }; MScanListView::~MScanListView() { }; void MScanListView::setManufacturerDB( ManufacturerDB* manufacturerdb ) { _manufacturerdb = manufacturerdb; } void MScanListView::addNewItem( QString type, QString essid, QString macaddr, bool wep, int channel, int signal ) { // FIXME: scanlistitem needs a proper encapsulation and not such a damn dealing with text(...) qDebug( "MScanList::addNewItem( %s / %s / %s [%d]", (const char*) type, (const char*) essid, (const char*) macaddr, channel ); // search, if we already have seen this net QString s; MScanListItem* network; MScanListItem* item = static_cast<MScanListItem*> ( firstChild() ); while ( item && ( item->text( 0 ) != essid ) ) { qDebug( "itemtext: %s", (const char*) item->text( 0 ) ); item = static_cast<MScanListItem*> ( item->itemBelow() ); } if ( item ) { // animate the item /* const QPixmap* pixmap = item->pixmap( 0 ); const QPixmap* nextpixmap = ani2; if ( pixmap == ani1 ) nextpixmap = ani2; else if ( pixmap == ani2 ) nextpixmap = ani3; else if ( pixmap == ani3 ) nextpixmap = ani4; else if ( pixmap == ani4 ) nextpixmap = ani1; item->setPixmap( 0, *nextpixmap ); */ //qDebug( "current pixmap %d, next %d", pixmap, nextpixmap ); // we have already seen this net, check all childs if MAC exists network = item; item = static_cast<MScanListItem*> ( item->firstChild() ); assert( item ); // this shouldn't fail while ( item && ( item->text( 2 ) != macaddr ) ) { qDebug( "subitemtext: %s", (const char*) item->text( 2 ) ); item = static_cast<MScanListItem*> ( item->itemBelow() ); } if ( item ) { // we have already seen this item, it's a dupe #ifdef DEBUG qDebug( "%s is a dupe - ignoring...", (const char*) macaddr ); #endif item->receivedBeacon(); return; } } else { s.sprintf( "(i) new network: '%s'", (const char*) essid ); network = new MScanListItem( this, "networks", essid, QString::null, 0, 0, 0 ); } // insert new station as child from network // no essid to reduce clutter, maybe later we have a nick or stationname to display!? qDebug( "inserting new station %s", (const char*) macaddr ); MScanListItem* station = new MScanListItem( network, type, "", macaddr, wep, channel, signal ); if ( _manufacturerdb ) station->setManufacturer( _manufacturerdb->lookup( macaddr ) ); if ( type == "managed" ) { s.sprintf( "(i) new AP in '%s' [%d]", (const char*) essid, channel ); } else { s.sprintf( "(i) new adhoc station in '%s' [%d]", (const char*) essid, channel ); } } 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 @@ -1,44 +1,44 @@ /********************************************************************** ** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. ** ** This file is part of Opie Environment. ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** **********************************************************************/ #ifndef SCANLIST_H #define SCANLIST_H -#include <qlistview.h> +#include <cornucopia/olistview.h> class QString; class ManufacturerDB; -class MScanListView: public QListView +class MScanListView: public OListView { Q_OBJECT public: MScanListView( QWidget* parent = 0, const char* name = 0 ); virtual ~MScanListView(); void setManufacturerDB( ManufacturerDB* manufacturerdb ); public slots: void addNewItem( QString type, QString essid, QString macaddr, bool wep, int channel, int signal ); private: ManufacturerDB* _manufacturerdb; }; #endif 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 @@ -1,102 +1,102 @@ /********************************************************************** ** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. ** ** This file is part of Opie Environment. ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** **********************************************************************/ #include "scanlistitem.h" #include <assert.h> #include <qdatetime.h> #include <qpixmap.h> #ifdef QWS #include <qpe/resource.h> #else #include "resource.h" #endif const int col_type = 0; const int col_essid = 0; const int col_sig = 1; const int col_ap = 2; const int col_channel = 3; const int col_wep = 4; const int col_traffic = 5; const int col_manuf = 6; const int col_firstseen = 7; const int col_lastseen = 8; MScanListItem::MScanListItem( QListView* parent, QString type, QString essid, QString macaddr, bool wep, int channel, int signal ) - :QListViewItem( parent, essid, QString::null, macaddr, QString::null, QString::null ), + :OListViewItem( parent, essid, QString::null, macaddr, QString::null, QString::null ), _type( type ), _essid( essid ), _macaddr( macaddr ), _wep( wep ), _channel( channel ), _signal( signal ), _beacons( 0 ) { qDebug( "creating scanlist item" ); decorateItem( type, essid, macaddr, wep, channel, signal ); } MScanListItem::MScanListItem( QListViewItem* parent, QString type, QString essid, QString macaddr, bool wep, int channel, int signal ) - :QListViewItem( parent, essid, QString::null, macaddr, QString::null, QString::null ) + :OListViewItem( parent, essid, QString::null, macaddr, QString::null, QString::null ) { qDebug( "creating scanlist item" ); decorateItem( type, essid, macaddr, wep, channel, signal ); } void MScanListItem::decorateItem( QString type, QString essid, QString macaddr, bool wep, int channel, int signal ) { qDebug( "decorating scanlist item %s / %s / %s [%d]", (const char*) type, (const char*) essid, (const char*) macaddr, channel ); // set icon for managed or adhoc mode QString name; name.sprintf( "wellenreiter/%s", (const char*) type ); setPixmap( col_type, Resource::loadPixmap( name ) ); // set icon for wep (wireless encryption protocol) if ( wep ) setPixmap( col_wep, Resource::loadPixmap( "wellenreiter/cracked" ) ); //FIXME: rename the pixmap! // set channel and signal text if ( signal != -1 ) setText( col_sig, QString::number( signal ) ); if ( channel != -1 ) setText( col_channel, QString::number( channel ) ); setText( col_firstseen, QTime::currentTime().toString() ); //setText( col_lastseen, QTime::currentTime().toString() ); listView()->triggerUpdate(); this->type = type; } void MScanListItem::setManufacturer( const QString& manufacturer ) { setText( col_manuf, manufacturer ); } void MScanListItem::receivedBeacon() { _beacons++; #ifdef DEBUG qDebug( "MScanListItem %s: received beacon #%d", (const char*) _macaddr, _beacons ); #endif setText( col_sig, QString::number( _beacons ) ); setText( col_lastseen, QTime::currentTime().toString() ); } 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 @@ -1,79 +1,79 @@ /********************************************************************** ** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. ** ** This file is part of Opie Environment. ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** **********************************************************************/ #ifndef SCANLISTITEM_H #define SCANLISTITEM_H -#include <qlistview.h> +#include <cornucopia/olistview.h> class QString; -class MScanListItem: public QListViewItem +class MScanListItem: public OListViewItem { public: MScanListItem::MScanListItem( QListView* parent, QString type, QString essid, QString macaddr, bool wep, int channel, int signal ); MScanListItem::MScanListItem( QListViewItem* parent, QString type, QString essid, QString macaddr, bool wep, int channel, int signal ); protected: virtual void decorateItem( QString type, QString essid, QString macaddr, bool wep, int channel, int signal ); public: QString type; public: //const QString& type() { return _type; }; const QString& essid() { return _essid; }; const QString& macaddr() { return _macaddr; }; bool wep() { return _wep; }; int channel() { return _channel; }; int signal() { return _signal; }; int beacons() { return _beacons; }; void setSignal( int signal ) { /* TODO */ }; void receivedBeacon(); void setManufacturer( const QString& manufacturer ); private: QString _type; QString _essid; QString _macaddr; bool _wep; int _channel; int _signal; int _beacons; }; #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,9 +1,9 @@ -Files: bin/wellenreiter bin/wellenreiterd share/wellenreiter pics/wellenreiter apps/Applications/wellenreiter.desktop $OPIEDIR/lib/libwellenreiter.* +Files: bin/wellenreiter bin/wellenreiterd share/wellenreiter pics/wellenreiter apps/Applications/wellenreiter.desktop $OPIEDIR/lib/libwellenreiter.* $OPIEDIR/lib/libcornucopia.* Priority: optional Section: opie/applications -Maintainer: Michael Lauer <mickeyl@handhelds.org> +Maintainer: Michael 'Mickey' Lauer <mickeyl@handhelds.org> Architecture: arm Version: $QPE_VERSION-$SUB_VERSION Depends: opie-base, libpcap Description: A WaveLAN Network Monitor A WaveLAN Network Monitor/Sniffer for the Opie Environment. 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,14 +1,14 @@ TEMPLATE = subdirs -unix:SUBDIRS = libwellenreiter daemon gui +unix:SUBDIRS = cornucopia libwellenreiter daemon gui !contains( platform, x11 ) { message( Configuring Wellenreiter for build on Opie ) include ( $(OPIEDIR)/include.pro ) } contains( platform, x11 ) { message( Configuring Wellenreiter for build on Qt/X11 ) system( mkdir -p $OPIEDIR/lib $OPIEDIR/bin $OPIEDIR/share/pics ) } |