author | zecke <zecke> | 2004-03-14 13:22:42 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-03-14 13:22:42 (UTC) |
commit | 0f7217afa7cdcb108dd2afba0ff6b42c97ab6f44 (patch) (unidiff) | |
tree | f6a68afa76a9be4099c3de7a286caeadd250c966 /noncore/net/wellenreiter/gui | |
parent | d9d68663164078b8dbdbfe70d291291b9fd5aacf (diff) | |
download | opie-0f7217afa7cdcb108dd2afba0ff6b42c97ab6f44.zip opie-0f7217afa7cdcb108dd2afba0ff6b42c97ab6f44.tar.gz opie-0f7217afa7cdcb108dd2afba0ff6b42c97ab6f44.tar.bz2 |
Convert net to ODP and QtAUX
Diffstat (limited to 'noncore/net/wellenreiter/gui') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/wellenreiter/gui/configwindow.cpp | 6 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/main.cpp | 3 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/mainwindow.cpp | 5 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/packetview.cpp | 3 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/packetview.h | 6 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/scanlist.cpp | 6 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/scanlist.h | 26 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/statwindow.cpp | 3 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/statwindow.h | 4 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiter.cpp | 10 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiter.h | 56 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiterbase.cpp | 3 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiterbase.h | 2 |
13 files changed, 84 insertions, 49 deletions
diff --git a/noncore/net/wellenreiter/gui/configwindow.cpp b/noncore/net/wellenreiter/gui/configwindow.cpp index 95b03d0..da39113 100644 --- a/noncore/net/wellenreiter/gui/configwindow.cpp +++ b/noncore/net/wellenreiter/gui/configwindow.cpp | |||
@@ -1,93 +1,99 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2002-2004 Michael 'Mickey' Lauer. All rights reserved. | 2 | ** Copyright (C) 2002-2004 Michael 'Mickey' Lauer. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Wellenreiter II. | 4 | ** This file is part of Wellenreiter II. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 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 | 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 | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 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. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | **********************************************************************/ | 14 | **********************************************************************/ |
15 | 15 | ||
16 | /* LOCAL */ | 16 | /* LOCAL */ |
17 | #include "configwindow.h" | 17 | #include "configwindow.h" |
18 | #include "mainwindow.h" | 18 | #include "mainwindow.h" |
19 | 19 | ||
20 | /* OPIE */ | 20 | /* OPIE */ |
21 | #include <opie2/onetwork.h> | 21 | #include <opie2/onetwork.h> |
22 | #ifdef QWS | 22 | #ifdef QWS |
23 | #include <opie2/oapplication.h> | 23 | #include <opie2/oapplication.h> |
24 | #include <opie2/oconfig.h> | 24 | #include <opie2/oconfig.h> |
25 | #include <opie2/odevice.h> | 25 | #include <opie2/odevice.h> |
26 | using namespace Opie; | 26 | using namespace Opie; |
27 | #endif | 27 | #endif |
28 | 28 | ||
29 | /* QT */ | 29 | /* QT */ |
30 | #include <qapplication.h> | 30 | #include <qapplication.h> |
31 | #include <qcheckbox.h> | 31 | #include <qcheckbox.h> |
32 | #include <qcombobox.h> | 32 | #include <qcombobox.h> |
33 | #include <qfile.h> | 33 | #include <qfile.h> |
34 | #include <qlineedit.h> | 34 | #include <qlineedit.h> |
35 | #include <qlayout.h> | 35 | #include <qlayout.h> |
36 | #include <qmap.h> | 36 | #include <qmap.h> |
37 | #include <qpushbutton.h> | 37 | #include <qpushbutton.h> |
38 | #include <qtabwidget.h> | 38 | #include <qtabwidget.h> |
39 | #include <qtoolbutton.h> | 39 | #include <qtoolbutton.h> |
40 | #include <qspinbox.h> | 40 | #include <qspinbox.h> |
41 | #include <qtextstream.h> | 41 | #include <qtextstream.h> |
42 | 42 | ||
43 | /* POSIX */ | 43 | /* POSIX */ |
44 | #include <assert.h> | 44 | #include <assert.h> |
45 | 45 | ||
46 | using namespace Opie::Core; | ||
47 | using namespace Opie::Net; | ||
48 | using namespace Opie::Core; | ||
49 | using namespace Opie::Net; | ||
50 | using namespace Opie::Core; | ||
51 | using namespace Opie::Net; | ||
46 | WellenreiterConfigWindow* WellenreiterConfigWindow::_instance = 0; | 52 | WellenreiterConfigWindow* WellenreiterConfigWindow::_instance = 0; |
47 | 53 | ||
48 | WellenreiterConfigWindow::WellenreiterConfigWindow( QWidget * parent, const char * name, WFlags f ) | 54 | WellenreiterConfigWindow::WellenreiterConfigWindow( QWidget * parent, const char * name, WFlags f ) |
49 | :WellenreiterConfigBase( parent, name, true, f ) | 55 | :WellenreiterConfigBase( parent, name, true, f ) |
50 | { | 56 | { |
51 | _devicetype[ "cisco" ] = DEVTYPE_CISCO; | 57 | _devicetype[ "cisco" ] = DEVTYPE_CISCO; |
52 | _devicetype[ "wlan-ng" ] = DEVTYPE_WLAN_NG; | 58 | _devicetype[ "wlan-ng" ] = DEVTYPE_WLAN_NG; |
53 | _devicetype[ "hostap" ] = DEVTYPE_HOSTAP; | 59 | _devicetype[ "hostap" ] = DEVTYPE_HOSTAP; |
54 | _devicetype[ "orinoco" ] = DEVTYPE_ORINOCO; | 60 | _devicetype[ "orinoco" ] = DEVTYPE_ORINOCO; |
55 | _devicetype[ "<manual>" ] = DEVTYPE_MANUAL; | 61 | _devicetype[ "<manual>" ] = DEVTYPE_MANUAL; |
56 | _devicetype[ "<file>" ] = DEVTYPE_FILE; | 62 | _devicetype[ "<file>" ] = DEVTYPE_FILE; |
57 | 63 | ||
58 | // gather possible interface names from ONetwork | 64 | // gather possible interface names from ONetwork |
59 | ONetwork* net = ONetwork::instance(); | 65 | ONetwork* net = ONetwork::instance(); |
60 | ONetwork::InterfaceIterator it = net->iterator(); | 66 | ONetwork::InterfaceIterator it = net->iterator(); |
61 | while ( it.current() ) | 67 | while ( it.current() ) |
62 | { | 68 | { |
63 | if ( it.current()->isWireless() ) | 69 | if ( it.current()->isWireless() ) |
64 | interfaceName->insertItem( it.current()->name() ); | 70 | interfaceName->insertItem( it.current()->name() ); |
65 | ++it; | 71 | ++it; |
66 | } | 72 | } |
67 | 73 | ||
68 | load(); | 74 | load(); |
69 | 75 | ||
70 | #ifdef Q_WS_X11 // We're on X11: adding an Ok-Button for the Dialog here | 76 | #ifdef Q_WS_X11 // We're on X11: adding an Ok-Button for the Dialog here |
71 | QPushButton* okButton = new QPushButton( "ok", this ); | 77 | QPushButton* okButton = new QPushButton( "ok", this ); |
72 | okButton->show(); | 78 | okButton->show(); |
73 | WellenreiterConfigBaseLayout->addWidget( okButton, 0, 3 ); //FIXME: rename this in configbase.ui | 79 | WellenreiterConfigBaseLayout->addWidget( okButton, 0, 3 ); //FIXME: rename this in configbase.ui |
74 | connect( okButton, SIGNAL( clicked() ), this, SLOT( accept() ) ); | 80 | connect( okButton, SIGNAL( clicked() ), this, SLOT( accept() ) ); |
75 | #endif | 81 | #endif |
76 | 82 | ||
77 | WellenreiterConfigWindow::_instance = this; | 83 | WellenreiterConfigWindow::_instance = this; |
78 | 84 | ||
79 | connect( deviceType, SIGNAL( activated(int) ), this, SLOT( changedDeviceType(int) ) ); | 85 | connect( deviceType, SIGNAL( activated(int) ), this, SLOT( changedDeviceType(int) ) ); |
80 | connect( newNetworkAction, SIGNAL( activated(int) ), this, SLOT( changedNetworkAction(int) ) ); | 86 | connect( newNetworkAction, SIGNAL( activated(int) ), this, SLOT( changedNetworkAction(int) ) ); |
81 | connect( newClientAction, SIGNAL( activated(int) ), this, SLOT( changedClientAction(int) ) ); | 87 | connect( newClientAction, SIGNAL( activated(int) ), this, SLOT( changedClientAction(int) ) ); |
82 | connect( newStationAction, SIGNAL( activated(int) ), this, SLOT( changedStationAction(int) ) ); | 88 | connect( newStationAction, SIGNAL( activated(int) ), this, SLOT( changedStationAction(int) ) ); |
83 | connect( getCaptureFileName, SIGNAL( clicked() ), this, SLOT( getCaptureFileNameClicked() ) ); | 89 | connect( getCaptureFileName, SIGNAL( clicked() ), this, SLOT( getCaptureFileNameClicked() ) ); |
84 | 90 | ||
85 | // make the checkbox 'channelAll' control all other channels | 91 | // make the checkbox 'channelAll' control all other channels |
86 | connect( channelAll, SIGNAL( stateChanged(int) ), this, SLOT( channelAllClicked(int) ) ); | 92 | connect( channelAll, SIGNAL( stateChanged(int) ), this, SLOT( channelAllClicked(int) ) ); |
87 | 93 | ||
88 | connect( autodetect, SIGNAL( clicked() ), this, SLOT( performAutodetection() ) ); | 94 | connect( autodetect, SIGNAL( clicked() ), this, SLOT( performAutodetection() ) ); |
89 | 95 | ||
90 | // hide tab4 (parse) until Wellenreiter 1.2 | 96 | // hide tab4 (parse) until Wellenreiter 1.2 |
91 | tab->removePage( tab_4 ); | 97 | tab->removePage( tab_4 ); |
92 | }; | 98 | }; |
93 | 99 | ||
diff --git a/noncore/net/wellenreiter/gui/main.cpp b/noncore/net/wellenreiter/gui/main.cpp index 7dcc583..6bbc39b 100644 --- a/noncore/net/wellenreiter/gui/main.cpp +++ b/noncore/net/wellenreiter/gui/main.cpp | |||
@@ -1,79 +1,82 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2002-2004 Michael 'Mickey' Lauer. All rights reserved. | 2 | ** Copyright (C) 2002-2004 Michael 'Mickey' Lauer. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Wellenreiter II. | 4 | ** This file is part of Wellenreiter II. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 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 | 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 | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 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. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | **********************************************************************/ | 14 | **********************************************************************/ |
15 | 15 | ||
16 | #include "mainwindow.h" | 16 | #include "mainwindow.h" |
17 | #ifdef QWS | 17 | #ifdef QWS |
18 | #include <opie2/oapplication.h> | 18 | #include <opie2/oapplication.h> |
19 | #include <opie2/oprocess.h> | 19 | #include <opie2/oprocess.h> |
20 | #else | 20 | #else |
21 | #include <qapplication.h> | 21 | #include <qapplication.h> |
22 | #endif | 22 | #endif |
23 | 23 | ||
24 | #include <qmessagebox.h> | 24 | #include <qmessagebox.h> |
25 | #include <qstringlist.h> | 25 | #include <qstringlist.h> |
26 | 26 | ||
27 | #include <errno.h> | 27 | #include <errno.h> |
28 | #include <signal.h> | 28 | #include <signal.h> |
29 | #include <string.h> | 29 | #include <string.h> |
30 | #include <unistd.h> | 30 | #include <unistd.h> |
31 | 31 | ||
32 | using namespace Opie::Core; | ||
33 | using namespace Opie::Core; | ||
34 | using namespace Opie::Core; | ||
32 | int main( int argc, char **argv ) | 35 | int main( int argc, char **argv ) |
33 | { | 36 | { |
34 | #ifdef QWS | 37 | #ifdef QWS |
35 | OApplication a( argc, argv, "Wellenreiter II" ); | 38 | OApplication a( argc, argv, "Wellenreiter II" ); |
36 | #else | 39 | #else |
37 | QApplication a( argc, argv ); | 40 | QApplication a( argc, argv ); |
38 | #endif | 41 | #endif |
39 | WellenreiterMainWindow* w = new WellenreiterMainWindow(); | 42 | WellenreiterMainWindow* w = new WellenreiterMainWindow(); |
40 | #ifdef QWS | 43 | #ifdef QWS |
41 | a.showMainWidget( w ); | 44 | a.showMainWidget( w ); |
42 | #else | 45 | #else |
43 | a.setMainWidget( w ); | 46 | a.setMainWidget( w ); |
44 | w->setCaption( "Wellenreiter II" ); | 47 | w->setCaption( "Wellenreiter II" ); |
45 | w->show(); | 48 | w->show(); |
46 | #endif | 49 | #endif |
47 | 50 | ||
48 | a.processEvents(); // show the window before doing the safety checks | 51 | a.processEvents(); // show the window before doing the safety checks |
49 | int result = -1; | 52 | int result = -1; |
50 | static int killed = false; | 53 | static int killed = false; |
51 | 54 | ||
52 | bool check = true; | 55 | bool check = true; |
53 | for ( int i = 1; i < argc; ++i ) | 56 | for ( int i = 1; i < argc; ++i ) |
54 | { | 57 | { |
55 | qDebug( "Wellenreiter::main() parsing argument %d = '%s'", i, argv[i] ); | 58 | qDebug( "Wellenreiter::main() parsing argument %d = '%s'", i, argv[i] ); |
56 | if ( !strcmp( "-nocheck", argv[i] ) ) | 59 | if ( !strcmp( "-nocheck", argv[i] ) ) |
57 | { | 60 | { |
58 | qDebug( "-nocheck found" ); | 61 | qDebug( "-nocheck found" ); |
59 | check = false; | 62 | check = false; |
60 | break; | 63 | break; |
61 | } | 64 | } |
62 | } | 65 | } |
63 | 66 | ||
64 | if ( check ) | 67 | if ( check ) |
65 | { | 68 | { |
66 | // root check | 69 | // root check |
67 | if ( getuid() ) | 70 | if ( getuid() ) |
68 | { | 71 | { |
69 | qWarning( QObject::tr( "Wellenreiter: trying to run as non-root!" ) ); | 72 | qWarning( QObject::tr( "Wellenreiter: trying to run as non-root!" ) ); |
70 | result = QMessageBox::warning( w, " - Wellenreiter II - (non-root)", QObject::tr( "You have started Wellenreiter II\n" | 73 | result = QMessageBox::warning( w, " - Wellenreiter II - (non-root)", QObject::tr( "You have started Wellenreiter II\n" |
71 | "as non-root. You will have\nonly limited functionality.\nProceed anyway?" ), | 74 | "as non-root. You will have\nonly limited functionality.\nProceed anyway?" ), |
72 | QMessageBox::Yes, QMessageBox::No ); | 75 | QMessageBox::Yes, QMessageBox::No ); |
73 | if ( result == QMessageBox::No ) return -1; | 76 | if ( result == QMessageBox::No ) return -1; |
74 | } | 77 | } |
75 | 78 | ||
76 | int dhcpid = OProcess::processPID( "dhcpc" ); | 79 | int dhcpid = OProcess::processPID( "dhcpc" ); |
77 | 80 | ||
78 | if ( dhcpid ) | 81 | if ( dhcpid ) |
79 | { | 82 | { |
diff --git a/noncore/net/wellenreiter/gui/mainwindow.cpp b/noncore/net/wellenreiter/gui/mainwindow.cpp index 5cc0daf..7add6cd 100644 --- a/noncore/net/wellenreiter/gui/mainwindow.cpp +++ b/noncore/net/wellenreiter/gui/mainwindow.cpp | |||
@@ -6,96 +6,101 @@ | |||
6 | ** This file may be distributed and/or modified under the terms of the | 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 | 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 | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 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. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | **********************************************************************/ | 14 | **********************************************************************/ |
15 | 15 | ||
16 | #include "configwindow.h" | 16 | #include "configwindow.h" |
17 | #include "gps.h" | 17 | #include "gps.h" |
18 | #include "logwindow.h" | 18 | #include "logwindow.h" |
19 | #include "packetview.h" | 19 | #include "packetview.h" |
20 | #include "mainwindow.h" | 20 | #include "mainwindow.h" |
21 | #include "wellenreiter.h" | 21 | #include "wellenreiter.h" |
22 | #include "scanlist.h" | 22 | #include "scanlist.h" |
23 | 23 | ||
24 | #include <qcombobox.h> | 24 | #include <qcombobox.h> |
25 | #include <qdatastream.h> | 25 | #include <qdatastream.h> |
26 | #include <qfile.h> | 26 | #include <qfile.h> |
27 | #include <qfileinfo.h> | 27 | #include <qfileinfo.h> |
28 | #include <qlabel.h> | 28 | #include <qlabel.h> |
29 | #include <qlayout.h> | 29 | #include <qlayout.h> |
30 | #include <qlineedit.h> | 30 | #include <qlineedit.h> |
31 | #include <qiconset.h> | 31 | #include <qiconset.h> |
32 | #include <qmenubar.h> | 32 | #include <qmenubar.h> |
33 | #include <qmessagebox.h> | 33 | #include <qmessagebox.h> |
34 | #include <qpopupmenu.h> | 34 | #include <qpopupmenu.h> |
35 | #include <qpushbutton.h> | 35 | #include <qpushbutton.h> |
36 | #include <qstatusbar.h> | 36 | #include <qstatusbar.h> |
37 | #include <qspinbox.h> | 37 | #include <qspinbox.h> |
38 | #include <qtextstream.h> | 38 | #include <qtextstream.h> |
39 | #include <qtoolbutton.h> | 39 | #include <qtoolbutton.h> |
40 | #include <qwhatsthis.h> | 40 | #include <qwhatsthis.h> |
41 | 41 | ||
42 | #ifdef QWS | 42 | #ifdef QWS |
43 | #include <qpe/resource.h> | 43 | #include <qpe/resource.h> |
44 | #include <opie2/ofiledialog.h> | 44 | #include <opie2/ofiledialog.h> |
45 | using namespace Opie; | 45 | using namespace Opie; |
46 | #else | 46 | #else |
47 | #include "resource.h" | 47 | #include "resource.h" |
48 | #include <qapplication.h> | 48 | #include <qapplication.h> |
49 | #include <qfiledialog.h> | 49 | #include <qfiledialog.h> |
50 | #endif | 50 | #endif |
51 | 51 | ||
52 | #include <unistd.h> | 52 | #include <unistd.h> |
53 | 53 | ||
54 | using namespace Opie::Ui; | ||
55 | using namespace Opie::Net; | ||
56 | using namespace Opie::Ui; | ||
57 | using namespace Opie::Net; | ||
58 | using namespace Opie::Net; | ||
54 | WellenreiterMainWindow::WellenreiterMainWindow( QWidget * parent, const char * name, WFlags f ) | 59 | WellenreiterMainWindow::WellenreiterMainWindow( QWidget * parent, const char * name, WFlags f ) |
55 | :QMainWindow( parent, name, f ) | 60 | :QMainWindow( parent, name, f ) |
56 | { | 61 | { |
57 | cw = new WellenreiterConfigWindow( this ); | 62 | cw = new WellenreiterConfigWindow( this ); |
58 | mw = new Wellenreiter( this ); | 63 | mw = new Wellenreiter( this ); |
59 | mw->setConfigWindow( cw ); | 64 | mw->setConfigWindow( cw ); |
60 | setCentralWidget( mw ); | 65 | setCentralWidget( mw ); |
61 | 66 | ||
62 | // setup application icon | 67 | // setup application icon |
63 | 68 | ||
64 | setIcon( Resource::loadPixmap( "wellenreiter/appicon-trans" ) ); | 69 | setIcon( Resource::loadPixmap( "wellenreiter/appicon-trans" ) ); |
65 | #ifndef QWS | 70 | #ifndef QWS |
66 | setIconText( "Wellenreiter/X11" ); | 71 | setIconText( "Wellenreiter/X11" ); |
67 | #endif | 72 | #endif |
68 | 73 | ||
69 | // setup tool buttons | 74 | // setup tool buttons |
70 | 75 | ||
71 | startButton = new QToolButton( 0 ); | 76 | startButton = new QToolButton( 0 ); |
72 | QWhatsThis::add( startButton, tr( "Click here to start scanning." ) ); | 77 | QWhatsThis::add( startButton, tr( "Click here to start scanning." ) ); |
73 | #ifdef QWS | 78 | #ifdef QWS |
74 | startButton->setAutoRaise( true ); | 79 | startButton->setAutoRaise( true ); |
75 | #endif | 80 | #endif |
76 | startButton->setIconSet( Resource::loadIconSet( "wellenreiter/SearchIcon" ) ); | 81 | startButton->setIconSet( Resource::loadIconSet( "wellenreiter/SearchIcon" ) ); |
77 | startButton->setEnabled( false ); | 82 | startButton->setEnabled( false ); |
78 | connect( startButton, SIGNAL( clicked() ), mw, SLOT( startClicked() ) ); | 83 | connect( startButton, SIGNAL( clicked() ), mw, SLOT( startClicked() ) ); |
79 | 84 | ||
80 | stopButton = new QToolButton( 0 ); | 85 | stopButton = new QToolButton( 0 ); |
81 | QWhatsThis::add( stopButton, tr( "Click here to stop scanning." ) ); | 86 | QWhatsThis::add( stopButton, tr( "Click here to stop scanning." ) ); |
82 | #ifdef QWS | 87 | #ifdef QWS |
83 | stopButton->setAutoRaise( true ); | 88 | stopButton->setAutoRaise( true ); |
84 | #endif | 89 | #endif |
85 | stopButton->setIconSet( Resource::loadIconSet( "wellenreiter/CancelIcon" ) ); | 90 | stopButton->setIconSet( Resource::loadIconSet( "wellenreiter/CancelIcon" ) ); |
86 | stopButton->setEnabled( false ); | 91 | stopButton->setEnabled( false ); |
87 | connect( stopButton, SIGNAL( clicked() ), mw, SLOT( stopClicked() ) ); | 92 | connect( stopButton, SIGNAL( clicked() ), mw, SLOT( stopClicked() ) ); |
88 | 93 | ||
89 | QToolButton* d = new QToolButton( 0 ); | 94 | QToolButton* d = new QToolButton( 0 ); |
90 | QWhatsThis::add( d, tr( "Click here to open the configure dialog." ) ), | 95 | QWhatsThis::add( d, tr( "Click here to open the configure dialog." ) ), |
91 | #ifdef QWS | 96 | #ifdef QWS |
92 | d->setAutoRaise( true ); | 97 | d->setAutoRaise( true ); |
93 | #endif | 98 | #endif |
94 | d->setIconSet( Resource::loadIconSet( "wellenreiter/SettingsIcon" ) ); | 99 | d->setIconSet( Resource::loadIconSet( "wellenreiter/SettingsIcon" ) ); |
95 | connect( d, SIGNAL( clicked() ), this, SLOT( showConfigure() ) ); | 100 | connect( d, SIGNAL( clicked() ), this, SLOT( showConfigure() ) ); |
96 | 101 | ||
97 | uploadButton = new QToolButton( 0 ); | 102 | uploadButton = new QToolButton( 0 ); |
98 | QWhatsThis::add( uploadButton, tr( "Click here to upload a capture session." ) ); | 103 | QWhatsThis::add( uploadButton, tr( "Click here to upload a capture session." ) ); |
99 | #ifdef QWS | 104 | #ifdef QWS |
100 | uploadButton->setAutoRaise( true ); | 105 | uploadButton->setAutoRaise( true ); |
101 | #endif | 106 | #endif |
diff --git a/noncore/net/wellenreiter/gui/packetview.cpp b/noncore/net/wellenreiter/gui/packetview.cpp index ef5d020..8312e71 100644 --- a/noncore/net/wellenreiter/gui/packetview.cpp +++ b/noncore/net/wellenreiter/gui/packetview.cpp | |||
@@ -1,68 +1,71 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2002-2004 Michael 'Mickey' Lauer. All rights reserved. | 2 | ** Copyright (C) 2002-2004 Michael 'Mickey' Lauer. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Wellenreiter II. | 4 | ** This file is part of Wellenreiter II. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 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 | 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 | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 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. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | **********************************************************************/ | 14 | **********************************************************************/ |
15 | 15 | ||
16 | #include "packetview.h" | 16 | #include "packetview.h" |
17 | 17 | ||
18 | /* OPIE */ | 18 | /* OPIE */ |
19 | #include <opie2/opcap.h> | 19 | #include <opie2/opcap.h> |
20 | 20 | ||
21 | /* QT */ | 21 | /* QT */ |
22 | #include <qtextview.h> | 22 | #include <qtextview.h> |
23 | #include <qspinbox.h> | 23 | #include <qspinbox.h> |
24 | #include <qlabel.h> | 24 | #include <qlabel.h> |
25 | #include <qlayout.h> | 25 | #include <qlayout.h> |
26 | #include <qlist.h> | 26 | #include <qlist.h> |
27 | 27 | ||
28 | using namespace Opie::Net; | ||
29 | using namespace Opie::Net; | ||
30 | using namespace Opie::Net; | ||
28 | PacketView::PacketView( QWidget * parent, const char * name, WFlags f ) | 31 | PacketView::PacketView( QWidget * parent, const char * name, WFlags f ) |
29 | :QFrame( parent, name, f ) | 32 | :QFrame( parent, name, f ) |
30 | { | 33 | { |
31 | _number = new QSpinBox( this ); | 34 | _number = new QSpinBox( this ); |
32 | _number->setPrefix( "Packet # " ); | 35 | _number->setPrefix( "Packet # " ); |
33 | _label = new QLabel( this ); | 36 | _label = new QLabel( this ); |
34 | _label->setText( "eth0 2004/03/08 - 00:00:21" ); | 37 | _label->setText( "eth0 2004/03/08 - 00:00:21" ); |
35 | _list = new QLabel( this ); | 38 | _list = new QLabel( this ); |
36 | _hex = new QTextView( this ); | 39 | _hex = new QTextView( this ); |
37 | 40 | ||
38 | QVBoxLayout* vb = new QVBoxLayout( this, 2, 2 ); | 41 | QVBoxLayout* vb = new QVBoxLayout( this, 2, 2 ); |
39 | QHBoxLayout* hb = new QHBoxLayout( vb, 2 ); | 42 | QHBoxLayout* hb = new QHBoxLayout( vb, 2 ); |
40 | hb->addWidget( _label ); | 43 | hb->addWidget( _label ); |
41 | hb->addWidget( _number ); | 44 | hb->addWidget( _number ); |
42 | vb->addWidget( _list ); | 45 | vb->addWidget( _list ); |
43 | vb->addWidget( _hex ); | 46 | vb->addWidget( _hex ); |
44 | 47 | ||
45 | _packets.setAutoDelete( true ); | 48 | _packets.setAutoDelete( true ); |
46 | 49 | ||
47 | _list->setText( "<b>[ 802.11 [ LLC [ IP [ UDP [ DHCP ] ] ] ] ]</b>" ); | 50 | _list->setText( "<b>[ 802.11 [ LLC [ IP [ UDP [ DHCP ] ] ] ] ]</b>" ); |
48 | }; | 51 | }; |
49 | 52 | ||
50 | void PacketView::add( OPacket* p ) | 53 | void PacketView::add( OPacket* p ) |
51 | { | 54 | { |
52 | _packets.append( p ); | 55 | _packets.append( p ); |
53 | }; | 56 | }; |
54 | 57 | ||
55 | const QString PacketView::getLog() const | 58 | const QString PacketView::getLog() const |
56 | { | 59 | { |
57 | } | 60 | } |
58 | 61 | ||
59 | void PacketView::clear() | 62 | void PacketView::clear() |
60 | { | 63 | { |
61 | _packets.clear(); | 64 | _packets.clear(); |
62 | _number->setMinValue( 0 ); | 65 | _number->setMinValue( 0 ); |
63 | _number->setMaxValue( 0 ); | 66 | _number->setMaxValue( 0 ); |
64 | _label->setText( "---" ); | 67 | _label->setText( "---" ); |
65 | _list->setText( " <b>-- no Packet available --</b> " ); | 68 | _list->setText( " <b>-- no Packet available --</b> " ); |
66 | _hex->setText( " <i>-- no Packet available --</i> " ); | 69 | _hex->setText( " <i>-- no Packet available --</i> " ); |
67 | } | 70 | } |
68 | 71 | ||
diff --git a/noncore/net/wellenreiter/gui/packetview.h b/noncore/net/wellenreiter/gui/packetview.h index b5f2b26..1ac19bb 100644 --- a/noncore/net/wellenreiter/gui/packetview.h +++ b/noncore/net/wellenreiter/gui/packetview.h | |||
@@ -1,49 +1,49 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2002-2004 Michael 'Mickey' Lauer. All rights reserved. | 2 | ** Copyright (C) 2002-2004 Michael 'Mickey' Lauer. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Wellenreiter II. | 4 | ** This file is part of Wellenreiter II. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 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 | 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 | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 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. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | **********************************************************************/ | 14 | **********************************************************************/ |
15 | 15 | ||
16 | #ifndef PACKETVIEW_H | 16 | #ifndef PACKETVIEW_H |
17 | #define PACKETVIEW_H | 17 | #define PACKETVIEW_H |
18 | 18 | ||
19 | #include <qlist.h> | 19 | #include <qlist.h> |
20 | #include <qframe.h> | 20 | #include <qframe.h> |
21 | 21 | ||
22 | class QString; | 22 | class QString; |
23 | class QSpinBox; | 23 | class QSpinBox; |
24 | class QLabel; | 24 | class QLabel; |
25 | class QTextView; | 25 | class QTextView; |
26 | class OPacket; | 26 | namespace Opie {namespace Net {class Opie::Net::OPacket;}} |
27 | 27 | ||
28 | class PacketView: public QFrame | 28 | class PacketView: public QFrame |
29 | { | 29 | { |
30 | 30 | ||
31 | public: | 31 | public: |
32 | PacketView( QWidget * parent = 0, const char * name = "PacketView", WFlags f = 0 ); | 32 | PacketView( QWidget * parent = 0, const char * name = "PacketView", WFlags f = 0 ); |
33 | 33 | ||
34 | void add( OPacket* p ); | 34 | void add( Opie::Net::OPacket* p ); |
35 | const QString getLog() const; | 35 | const QString getLog() const; |
36 | void clear(); | 36 | void clear(); |
37 | 37 | ||
38 | protected: | 38 | protected: |
39 | 39 | ||
40 | QSpinBox* _number; | 40 | QSpinBox* _number; |
41 | QLabel* _label; | 41 | QLabel* _label; |
42 | QLabel* _list; | 42 | QLabel* _list; |
43 | QTextView* _hex; | 43 | QTextView* _hex; |
44 | QList<OPacket> _packets; | 44 | QList<Opie::Net::OPacket> _packets; |
45 | 45 | ||
46 | }; | 46 | }; |
47 | 47 | ||
48 | #endif | 48 | #endif |
49 | 49 | ||
diff --git a/noncore/net/wellenreiter/gui/scanlist.cpp b/noncore/net/wellenreiter/gui/scanlist.cpp index 6005818..3b7120a 100644 --- a/noncore/net/wellenreiter/gui/scanlist.cpp +++ b/noncore/net/wellenreiter/gui/scanlist.cpp | |||
@@ -1,96 +1,102 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2002-2004 Michael 'Mickey' Lauer. All rights reserved. | 2 | ** Copyright (C) 2002-2004 Michael 'Mickey' Lauer. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Wellenreiter II. | 4 | ** This file is part of Wellenreiter II. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 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 | 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 | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 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. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | **********************************************************************/ | 14 | **********************************************************************/ |
15 | 15 | ||
16 | #include "scanlist.h" | 16 | #include "scanlist.h" |
17 | #include "configwindow.h" | 17 | #include "configwindow.h" |
18 | #include "logwindow.h" | 18 | #include "logwindow.h" |
19 | 19 | ||
20 | #include <assert.h> | 20 | #include <assert.h> |
21 | #include <qcursor.h> | 21 | #include <qcursor.h> |
22 | #include <qdatetime.h> | 22 | #include <qdatetime.h> |
23 | #include <qpopupmenu.h> | 23 | #include <qpopupmenu.h> |
24 | #include <qcheckbox.h> | 24 | #include <qcheckbox.h> |
25 | 25 | ||
26 | #ifdef QWS | 26 | #ifdef QWS |
27 | #include <qpe/qpeapplication.h> | 27 | #include <qpe/qpeapplication.h> |
28 | #endif | 28 | #endif |
29 | 29 | ||
30 | #ifdef QWS | 30 | #ifdef QWS |
31 | #include <qpe/resource.h> | 31 | #include <qpe/resource.h> |
32 | #else | 32 | #else |
33 | #include "resource.h" | 33 | #include "resource.h" |
34 | #endif | 34 | #endif |
35 | 35 | ||
36 | const int col_type = 0; | 36 | const int col_type = 0; |
37 | const int col_essid = 0; | 37 | const int col_essid = 0; |
38 | const int col_sig = 1; | 38 | const int col_sig = 1; |
39 | const int col_ap = 2; | 39 | const int col_ap = 2; |
40 | const int col_channel = 3; | 40 | const int col_channel = 3; |
41 | const int col_wep = 4; | 41 | const int col_wep = 4; |
42 | const int col_traffic = 5; | 42 | const int col_traffic = 5; |
43 | const int col_ip = 6; | 43 | const int col_ip = 6; |
44 | const int col_manuf = 7; | 44 | const int col_manuf = 7; |
45 | const int col_firstseen = 8; | 45 | const int col_firstseen = 8; |
46 | const int col_lastseen = 9; | 46 | const int col_lastseen = 9; |
47 | const int col_location = 10; | 47 | const int col_location = 10; |
48 | 48 | ||
49 | using namespace Opie::Net; | ||
50 | using namespace Opie::Ui; | ||
51 | using namespace Opie::Net; | ||
52 | using namespace Opie::Ui; | ||
53 | using namespace Opie::Ui; | ||
54 | using namespace Opie::Net; | ||
49 | MScanListView::MScanListView( QWidget* parent, const char* name ) | 55 | MScanListView::MScanListView( QWidget* parent, const char* name ) |
50 | :OListView( parent, name ) | 56 | :OListView( parent, name ) |
51 | { | 57 | { |
52 | setFrameShape( QListView::StyledPanel ); | 58 | setFrameShape( QListView::StyledPanel ); |
53 | setFrameShadow( QListView::Sunken ); | 59 | setFrameShadow( QListView::Sunken ); |
54 | 60 | ||
55 | addColumn( tr( "Net/Station" ) ); | 61 | addColumn( tr( "Net/Station" ) ); |
56 | setColumnAlignment( col_essid, AlignLeft || AlignVCenter ); | 62 | setColumnAlignment( col_essid, AlignLeft || AlignVCenter ); |
57 | addColumn( tr( "#" ) ); | 63 | addColumn( tr( "#" ) ); |
58 | setColumnAlignment( col_sig, AlignCenter ); | 64 | setColumnAlignment( col_sig, AlignCenter ); |
59 | addColumn( tr( "MAC" ) ); | 65 | addColumn( tr( "MAC" ) ); |
60 | setColumnAlignment( col_ap, AlignCenter ); | 66 | setColumnAlignment( col_ap, AlignCenter ); |
61 | addColumn( tr( "Chn" ) ); | 67 | addColumn( tr( "Chn" ) ); |
62 | setColumnAlignment( col_channel, AlignCenter ); | 68 | setColumnAlignment( col_channel, AlignCenter ); |
63 | addColumn( tr( "W" ) ); | 69 | addColumn( tr( "W" ) ); |
64 | setColumnAlignment( col_wep, AlignCenter ); | 70 | setColumnAlignment( col_wep, AlignCenter ); |
65 | addColumn( tr( "T" ) ); | 71 | addColumn( tr( "T" ) ); |
66 | setColumnAlignment( col_traffic, AlignCenter ); | 72 | setColumnAlignment( col_traffic, AlignCenter ); |
67 | addColumn( tr( "IP" ) ); | 73 | addColumn( tr( "IP" ) ); |
68 | setColumnAlignment( col_ip, AlignCenter ); | 74 | setColumnAlignment( col_ip, AlignCenter ); |
69 | addColumn( tr( "Manufacturer" ) ); | 75 | addColumn( tr( "Manufacturer" ) ); |
70 | setColumnAlignment( col_manuf, AlignCenter ); | 76 | setColumnAlignment( col_manuf, AlignCenter ); |
71 | addColumn( tr( "First Seen" ) ); | 77 | addColumn( tr( "First Seen" ) ); |
72 | setColumnAlignment( col_firstseen, AlignCenter ); | 78 | setColumnAlignment( col_firstseen, AlignCenter ); |
73 | addColumn( tr( "Last Seen" ) ); | 79 | addColumn( tr( "Last Seen" ) ); |
74 | setColumnAlignment( col_lastseen, AlignCenter ); | 80 | setColumnAlignment( col_lastseen, AlignCenter ); |
75 | addColumn( tr( "Location" ) ); | 81 | addColumn( tr( "Location" ) ); |
76 | setColumnAlignment( col_location, AlignCenter ); | 82 | setColumnAlignment( col_location, AlignCenter ); |
77 | setRootIsDecorated( true ); | 83 | setRootIsDecorated( true ); |
78 | setAllColumnsShowFocus( true ); | 84 | setAllColumnsShowFocus( true ); |
79 | 85 | ||
80 | connect( this, SIGNAL( rightButtonClicked(QListViewItem*,const QPoint&,int) ), | 86 | connect( this, SIGNAL( rightButtonClicked(QListViewItem*,const QPoint&,int) ), |
81 | this, SLOT( contextMenuRequested(QListViewItem*,const QPoint&,int) ) ); | 87 | this, SLOT( contextMenuRequested(QListViewItem*,const QPoint&,int) ) ); |
82 | 88 | ||
83 | #ifdef QWS | 89 | #ifdef QWS |
84 | QPEApplication::setStylusOperation( viewport(), QPEApplication::RightOnHold ); | 90 | QPEApplication::setStylusOperation( viewport(), QPEApplication::RightOnHold ); |
85 | #endif | 91 | #endif |
86 | 92 | ||
87 | }; | 93 | }; |
88 | 94 | ||
89 | 95 | ||
90 | MScanListView::~MScanListView() | 96 | MScanListView::~MScanListView() |
91 | { | 97 | { |
92 | }; | 98 | }; |
93 | 99 | ||
94 | 100 | ||
95 | OListViewItem* MScanListView::childFactory() | 101 | OListViewItem* MScanListView::childFactory() |
96 | { | 102 | { |
diff --git a/noncore/net/wellenreiter/gui/scanlist.h b/noncore/net/wellenreiter/gui/scanlist.h index ab870c2..6a80f70 100644 --- a/noncore/net/wellenreiter/gui/scanlist.h +++ b/noncore/net/wellenreiter/gui/scanlist.h | |||
@@ -1,140 +1,140 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2002-2004 Michael 'Mickey' Lauer. All rights reserved. | 2 | ** Copyright (C) 2002-2004 Michael 'Mickey' Lauer. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Wellenreiter II. | 4 | ** This file is part of Wellenreiter II. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 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 | 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 | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 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. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | **********************************************************************/ | 14 | **********************************************************************/ |
15 | 15 | ||
16 | #ifndef SCANLIST_H | 16 | #ifndef SCANLIST_H |
17 | #define SCANLIST_H | 17 | #define SCANLIST_H |
18 | 18 | ||
19 | #include "gps.h" | 19 | #include "gps.h" |
20 | 20 | ||
21 | /* OPIE */ | 21 | /* OPIE */ |
22 | #include <opie2/olistview.h> | 22 | #include <opie2/olistview.h> |
23 | #include <opie2/onetutils.h> | 23 | #include <opie2/onetutils.h> |
24 | 24 | ||
25 | /* QT */ | 25 | /* QT */ |
26 | #include <qtextstream.h> | 26 | #include <qtextstream.h> |
27 | 27 | ||
28 | class QString; | 28 | class QString; |
29 | class MScanListItem; | 29 | class MScanListItem; |
30 | 30 | ||
31 | class MScanListView: public OListView | 31 | class MScanListView: public Opie::Ui::OListView |
32 | { | 32 | { |
33 | Q_OBJECT | 33 | Q_OBJECT |
34 | 34 | ||
35 | public: | 35 | public: |
36 | MScanListView( QWidget* parent = 0, const char* name = 0 ); | 36 | MScanListView( QWidget* parent = 0, const char* name = 0 ); |
37 | virtual ~MScanListView(); | 37 | virtual ~MScanListView(); |
38 | 38 | ||
39 | virtual OListViewItem* childFactory(); | 39 | virtual Opie::Ui::OListViewItem* childFactory(); |
40 | virtual void serializeTo( QDataStream& s ) const; | 40 | virtual void serializeTo( QDataStream& s ) const; |
41 | virtual void serializeFrom( QDataStream& s ); | 41 | virtual void serializeFrom( QDataStream& s ); |
42 | 42 | ||
43 | public slots: | 43 | public slots: |
44 | void addNewItem( const QString& type, const QString&, const OMacAddress&, bool, int, int, const GpsLocation&, bool = false ); | 44 | void addNewItem( const QString& type, const QString&, const Opie::Net::OMacAddress&, bool, int, int, const GpsLocation&, bool = false ); |
45 | void addService( const QString& name, const OMacAddress& macaddr, const QString& ip ); | 45 | void addService( const QString& name, const Opie::Net::OMacAddress& macaddr, const QString& ip ); |
46 | 46 | ||
47 | void fromDStraffic( const OMacAddress& from, const OMacAddress& to, const OMacAddress& via ); | 47 | void fromDStraffic( const Opie::Net::OMacAddress& from, const Opie::Net::OMacAddress& to, const Opie::Net::OMacAddress& via ); |
48 | void toDStraffic( const OMacAddress& from, const OMacAddress& to, const OMacAddress& via ); | 48 | void toDStraffic( const Opie::Net::OMacAddress& from, const Opie::Net::OMacAddress& to, const Opie::Net::OMacAddress& via ); |
49 | void WDStraffic( const OMacAddress& from, const OMacAddress& to, const OMacAddress& viaFrom, const OMacAddress& viaTo ); | 49 | void WDStraffic( const Opie::Net::OMacAddress& from, const Opie::Net::OMacAddress& to, const Opie::Net::OMacAddress& viaFrom, const Opie::Net::OMacAddress& viaTo ); |
50 | void IBSStraffic( const OMacAddress& from, const OMacAddress& to, const OMacAddress& via ); | 50 | void IBSStraffic( const Opie::Net::OMacAddress& from, const Opie::Net::OMacAddress& to, const Opie::Net::OMacAddress& via ); |
51 | 51 | ||
52 | void identify( const OMacAddress&, const QString& ipaddr ); | 52 | void identify( const Opie::Net::OMacAddress&, const QString& ipaddr ); |
53 | 53 | ||
54 | void contextMenuRequested( QListViewItem* item, const QPoint&, int ); | 54 | void contextMenuRequested( QListViewItem* item, const QPoint&, int ); |
55 | 55 | ||
56 | signals: | 56 | signals: |
57 | void rightButtonClicked(QListViewItem*,const QPoint&,int); | 57 | void rightButtonClicked(QListViewItem*,const QPoint&,int); |
58 | void joinNetwork( const QString&, const QString&, int, const QString& ); | 58 | void joinNetwork( const QString&, const QString&, int, const QString& ); |
59 | 59 | ||
60 | protected: | 60 | protected: |
61 | void addIfNotExisting( MScanListItem* parent, const OMacAddress& addr, const QString& type = "station" ); | 61 | void addIfNotExisting( MScanListItem* parent, const Opie::Net::OMacAddress& addr, const QString& type = "station" ); |
62 | 62 | ||
63 | }; | 63 | }; |
64 | 64 | ||
65 | //****************************** MScanListItem **************************************************************** | 65 | //****************************** MScanListItem **************************************************************** |
66 | 66 | ||
67 | class MScanListItem: public OListViewItem | 67 | class MScanListItem: public Opie::Ui::OListViewItem |
68 | { | 68 | { |
69 | public: | 69 | public: |
70 | MScanListItem::MScanListItem( QListView* parent, | 70 | MScanListItem::MScanListItem( QListView* parent, |
71 | const QString& type = "unknown", | 71 | const QString& type = "unknown", |
72 | const QString& essid = "unknown", | 72 | const QString& essid = "unknown", |
73 | const QString& macaddr = "unknown", | 73 | const QString& macaddr = "unknown", |
74 | bool wep = false, | 74 | bool wep = false, |
75 | int channel = 0, | 75 | int channel = 0, |
76 | int signal = 0, | 76 | int signal = 0, |
77 | bool probed = false ); | 77 | bool probed = false ); |
78 | 78 | ||
79 | MScanListItem::MScanListItem( QListViewItem* parent, | 79 | MScanListItem::MScanListItem( QListViewItem* parent, |
80 | const QString& type = "unknown", | 80 | const QString& type = "unknown", |
81 | const QString& essid = "unknown", | 81 | const QString& essid = "unknown", |
82 | const QString& macaddr = "unknown", | 82 | const QString& macaddr = "unknown", |
83 | bool wep = false, | 83 | bool wep = false, |
84 | int channel = 0, | 84 | int channel = 0, |
85 | int signal = 0 ); | 85 | int signal = 0 ); |
86 | 86 | ||
87 | 87 | ||
88 | protected: | 88 | protected: |
89 | virtual void decorateItem( QString type, QString essid, QString macaddr, bool wep, int channel, int signal, bool probed ); | 89 | virtual void decorateItem( QString type, QString essid, QString macaddr, bool wep, int channel, int signal, bool probed ); |
90 | 90 | ||
91 | public: | 91 | public: |
92 | QString type; | 92 | QString type; |
93 | 93 | ||
94 | public: | 94 | public: |
95 | //const QString& type() { return _type; }; | 95 | //const QString& type() { return _type; }; |
96 | const QString& essid() const; | 96 | const QString& essid() const; |
97 | const QString& macaddr() { return _macaddr; }; | 97 | const QString& macaddr() { return _macaddr; }; |
98 | bool wep() { return _wep; }; | 98 | bool wep() { return _wep; }; |
99 | int channel() { return _channel; }; | 99 | int channel() { return _channel; }; |
100 | int signal() { return _signal; }; | 100 | int signal() { return _signal; }; |
101 | int beacons() { return _beacons; }; | 101 | int beacons() { return _beacons; }; |
102 | 102 | ||
103 | void setSignal( int signal ) { /* TODO */ }; | 103 | void setSignal( int signal ) { /* TODO */ }; |
104 | void receivedBeacon(); | 104 | void receivedBeacon(); |
105 | 105 | ||
106 | void setManufacturer( const QString& manufacturer ); | 106 | void setManufacturer( const QString& manufacturer ); |
107 | void setLocation( const QString& location ); | 107 | void setLocation( const QString& location ); |
108 | 108 | ||
109 | virtual OListViewItem* childFactory(); | 109 | virtual Opie::Ui::OListViewItem* childFactory(); |
110 | virtual void serializeTo( QDataStream& s ) const; | 110 | virtual void serializeTo( QDataStream& s ) const; |
111 | virtual void serializeFrom( QDataStream& s ); | 111 | virtual void serializeFrom( QDataStream& s ); |
112 | 112 | ||
113 | private: | 113 | private: |
114 | QString _type; | 114 | QString _type; |
115 | QString _essid; | 115 | QString _essid; |
116 | QString _macaddr; | 116 | QString _macaddr; |
117 | bool _wep; | 117 | bool _wep; |
118 | int _channel; | 118 | int _channel; |
119 | int _signal; | 119 | int _signal; |
120 | int _beacons; | 120 | int _beacons; |
121 | 121 | ||
122 | }; | 122 | }; |
123 | 123 | ||
124 | //****************************** MScanListViewFactory **************************************************************** | 124 | //****************************** MScanListViewFactory **************************************************************** |
125 | 125 | ||
126 | /* | 126 | /* |
127 | 127 | ||
128 | class MScanListViewFactory : public OListViewFactory | 128 | class MScanListViewFactory : public Opie::Ui::OListViewFactory |
129 | { | 129 | { |
130 | public: | 130 | public: |
131 | virtual QListView* listViewFactory(); | 131 | virtual QListView* listViewFactory(); |
132 | virtual QListViewItem* listViewItemFactory( QListView* lv ); | 132 | virtual QListViewItem* listViewItemFactory( QListView* lv ); |
133 | virtual QListViewItem* listViewItemFactory( QListViewItem* lvi ); | 133 | virtual QListViewItem* listViewItemFactory( QListViewItem* lvi ); |
134 | virtual void setColumnText( int depth, QListViewItem* lvi, int column, const QString& text ); | 134 | virtual void setColumnText( int depth, QListViewItem* lvi, int column, const QString& text ); |
135 | virtual void setCustomData( int depth, QListViewItem* lvi, const QString& text ); | 135 | virtual void setCustomData( int depth, QListViewItem* lvi, const QString& text ); |
136 | } | 136 | } |
137 | */ | 137 | */ |
138 | 138 | ||
139 | #endif | 139 | #endif |
140 | 140 | ||
diff --git a/noncore/net/wellenreiter/gui/statwindow.cpp b/noncore/net/wellenreiter/gui/statwindow.cpp index 48e4847..e3c6bbe 100644 --- a/noncore/net/wellenreiter/gui/statwindow.cpp +++ b/noncore/net/wellenreiter/gui/statwindow.cpp | |||
@@ -1,43 +1,46 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2002-2004 Michael 'Mickey' Lauer. All rights reserved. | 2 | ** Copyright (C) 2002-2004 Michael 'Mickey' Lauer. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Wellenreiter II. | 4 | ** This file is part of Wellenreiter II. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 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 | 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 | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 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. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | **********************************************************************/ | 14 | **********************************************************************/ |
15 | 15 | ||
16 | #include "statwindow.h" | 16 | #include "statwindow.h" |
17 | #include <opie2/olistview.h> | 17 | #include <opie2/olistview.h> |
18 | 18 | ||
19 | using namespace Opie::Ui; | ||
20 | using namespace Opie::Ui; | ||
21 | using namespace Opie::Ui; | ||
19 | MStatWindow::MStatWindow( QWidget * parent, const char * name, WFlags f ) | 22 | MStatWindow::MStatWindow( QWidget * parent, const char * name, WFlags f ) |
20 | :QVBox( parent, name, f ) | 23 | :QVBox( parent, name, f ) |
21 | { | 24 | { |
22 | table = new OListView( this ); | 25 | table = new OListView( this ); |
23 | table->addColumn( tr( "Protocol" ) ); | 26 | table->addColumn( tr( "Protocol" ) ); |
24 | table->addColumn( tr( "Count" ) ); | 27 | table->addColumn( tr( "Count" ) ); |
25 | table->setItemMargin( 2 ); | 28 | table->setItemMargin( 2 ); |
26 | }; | 29 | }; |
27 | 30 | ||
28 | 31 | ||
29 | void MStatWindow::updateCounter( const QString& protocol, int counter ) | 32 | void MStatWindow::updateCounter( const QString& protocol, int counter ) |
30 | { | 33 | { |
31 | QListViewItemIterator it( table ); | 34 | QListViewItemIterator it( table ); |
32 | for ( ; it.current(); ++it ) | 35 | for ( ; it.current(); ++it ) |
33 | { | 36 | { |
34 | if ( it.current()->text( 0 ) == protocol ) | 37 | if ( it.current()->text( 0 ) == protocol ) |
35 | { | 38 | { |
36 | it.current()->setText( 1, QString::number( counter ) ); | 39 | it.current()->setText( 1, QString::number( counter ) ); |
37 | return; | 40 | return; |
38 | } | 41 | } |
39 | } | 42 | } |
40 | 43 | ||
41 | new OListViewItem( table, protocol, QString::number( counter ) ); | 44 | new OListViewItem( table, protocol, QString::number( counter ) ); |
42 | } | 45 | } |
43 | 46 | ||
diff --git a/noncore/net/wellenreiter/gui/statwindow.h b/noncore/net/wellenreiter/gui/statwindow.h index b9057e7..e11247b 100644 --- a/noncore/net/wellenreiter/gui/statwindow.h +++ b/noncore/net/wellenreiter/gui/statwindow.h | |||
@@ -1,43 +1,43 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2002-2004 Michael 'Mickey' Lauer. All rights reserved. | 2 | ** Copyright (C) 2002-2004 Michael 'Mickey' Lauer. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Wellenreiter II. | 4 | ** This file is part of Wellenreiter II. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 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 | 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 | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 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. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | **********************************************************************/ | 14 | **********************************************************************/ |
15 | 15 | ||
16 | #ifndef STATWINDOW_H | 16 | #ifndef STATWINDOW_H |
17 | #define STATWINDOW_H | 17 | #define STATWINDOW_H |
18 | 18 | ||
19 | #include <qvbox.h> | 19 | #include <qvbox.h> |
20 | 20 | ||
21 | class QString; | 21 | class QString; |
22 | class OListView; | 22 | namespace Opie {namespace Ui {class Opie::Ui::OListView;}} |
23 | 23 | ||
24 | class MStatWindow: public QVBox | 24 | class MStatWindow: public QVBox |
25 | { | 25 | { |
26 | Q_OBJECT | 26 | Q_OBJECT |
27 | 27 | ||
28 | public: | 28 | public: |
29 | MStatWindow( QWidget * parent = 0, const char * name = "MStatWindow", WFlags f = 0 ); | 29 | MStatWindow( QWidget * parent = 0, const char * name = "MStatWindow", WFlags f = 0 ); |
30 | 30 | ||
31 | void log( QString text ); | 31 | void log( QString text ); |
32 | const QString getLog() const; | 32 | const QString getLog() const; |
33 | void clear(); | 33 | void clear(); |
34 | 34 | ||
35 | void updateCounter( const QString&, int ); | 35 | void updateCounter( const QString&, int ); |
36 | 36 | ||
37 | protected: | 37 | protected: |
38 | OListView* table; | 38 | Opie::Ui::OListView* table; |
39 | 39 | ||
40 | }; | 40 | }; |
41 | 41 | ||
42 | #endif | 42 | #endif |
43 | 43 | ||
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.cpp b/noncore/net/wellenreiter/gui/wellenreiter.cpp index ce416e5..e8d9de7 100644 --- a/noncore/net/wellenreiter/gui/wellenreiter.cpp +++ b/noncore/net/wellenreiter/gui/wellenreiter.cpp | |||
@@ -16,96 +16,102 @@ | |||
16 | #include "gps.h" | 16 | #include "gps.h" |
17 | #include "wellenreiter.h" | 17 | #include "wellenreiter.h" |
18 | #include "scanlist.h" | 18 | #include "scanlist.h" |
19 | #include "logwindow.h" | 19 | #include "logwindow.h" |
20 | #include "packetview.h" | 20 | #include "packetview.h" |
21 | #include "configwindow.h" | 21 | #include "configwindow.h" |
22 | #include "statwindow.h" | 22 | #include "statwindow.h" |
23 | #include "graphwindow.h" | 23 | #include "graphwindow.h" |
24 | #include "protolistview.h" | 24 | #include "protolistview.h" |
25 | 25 | ||
26 | // Opie | 26 | // Opie |
27 | 27 | ||
28 | #ifdef QWS | 28 | #ifdef QWS |
29 | #include <opie2/oapplication.h> | 29 | #include <opie2/oapplication.h> |
30 | #include <opie2/odevice.h> | 30 | #include <opie2/odevice.h> |
31 | #else | 31 | #else |
32 | #include <qapplication.h> | 32 | #include <qapplication.h> |
33 | #endif | 33 | #endif |
34 | #include <opie2/omanufacturerdb.h> | 34 | #include <opie2/omanufacturerdb.h> |
35 | #include <opie2/onetwork.h> | 35 | #include <opie2/onetwork.h> |
36 | #include <opie2/opcap.h> | 36 | #include <opie2/opcap.h> |
37 | #include <qpe/qcopenvelope_qws.h> | 37 | #include <qpe/qcopenvelope_qws.h> |
38 | using namespace Opie; | 38 | using namespace Opie; |
39 | 39 | ||
40 | // Qt | 40 | // Qt |
41 | 41 | ||
42 | #include <qcheckbox.h> | 42 | #include <qcheckbox.h> |
43 | #include <qcombobox.h> | 43 | #include <qcombobox.h> |
44 | #include <qdatetime.h> | 44 | #include <qdatetime.h> |
45 | #include <qpushbutton.h> | 45 | #include <qpushbutton.h> |
46 | #include <qlineedit.h> | 46 | #include <qlineedit.h> |
47 | #include <qmessagebox.h> | 47 | #include <qmessagebox.h> |
48 | #include <qobjectlist.h> | 48 | #include <qobjectlist.h> |
49 | #include <qregexp.h> | 49 | #include <qregexp.h> |
50 | #include <qspinbox.h> | 50 | #include <qspinbox.h> |
51 | #include <qtimer.h> | 51 | #include <qtimer.h> |
52 | #include <qtoolbutton.h> | 52 | #include <qtoolbutton.h> |
53 | #include <qmainwindow.h> | 53 | #include <qmainwindow.h> |
54 | 54 | ||
55 | // Standard | 55 | // Standard |
56 | 56 | ||
57 | #include <assert.h> | 57 | #include <assert.h> |
58 | #include <errno.h> | 58 | #include <errno.h> |
59 | #include <unistd.h> | 59 | #include <unistd.h> |
60 | #include <string.h> | 60 | #include <string.h> |
61 | #include <sys/types.h> | 61 | #include <sys/types.h> |
62 | #include <stdlib.h> | 62 | #include <stdlib.h> |
63 | 63 | ||
64 | using namespace Opie::Core; | ||
65 | using namespace Opie::Net; | ||
66 | using namespace Opie::Net; | ||
67 | using namespace Opie::Core; | ||
68 | using namespace Opie::Net; | ||
69 | using namespace Opie::Core; | ||
64 | Wellenreiter::Wellenreiter( QWidget* parent ) | 70 | Wellenreiter::Wellenreiter( QWidget* parent ) |
65 | : WellenreiterBase( parent, 0, 0 ), | 71 | : WellenreiterBase( parent, 0, 0 ), |
66 | sniffing( false ), iface( 0 ), configwindow( 0 ) | 72 | sniffing( false ), iface( 0 ), configwindow( 0 ) |
67 | { | 73 | { |
68 | 74 | ||
69 | logwindow->log( "(i) Wellenreiter has been started." ); | 75 | logwindow->log( "(i) Wellenreiter has been started." ); |
70 | 76 | ||
71 | // | 77 | // |
72 | // detect operating system | 78 | // detect operating system |
73 | // | 79 | // |
74 | 80 | ||
75 | #ifdef QWS | 81 | #ifdef QWS |
76 | QString sys; | 82 | QString sys; |
77 | sys.sprintf( "(i) Running on '%s'.", (const char*) ODevice::inst()->systemString() ); | 83 | sys.sprintf( "(i) Running on '%s'.", (const char*) ODevice::inst()->systemString() ); |
78 | _system = ODevice::inst()->system(); | 84 | _system = ODevice::inst()->system(); |
79 | logwindow->log( sys ); | 85 | logwindow->log( sys ); |
80 | #endif | 86 | #endif |
81 | 87 | ||
82 | netview->setColumnWidthMode( 1, QListView::Manual ); | 88 | netview->setColumnWidthMode( 1, QListView::Manual ); |
83 | connect( netview, SIGNAL( joinNetwork(const QString&,const QString&,int,const QString&) ), | 89 | connect( netview, SIGNAL( joinNetwork(const QString&,const QString&,int,const QString&) ), |
84 | this, SLOT( joinNetwork(const QString&,const QString&,int,const QString&) ) ); | 90 | this, SLOT( joinNetwork(const QString&,const QString&,int,const QString&) ) ); |
85 | pcap = new OPacketCapturer(); | 91 | pcap = new OPacketCapturer(); |
86 | 92 | ||
87 | gps = new GPS( this ); | 93 | gps = new GPS( this ); |
88 | 94 | ||
89 | QTimer::singleShot( 1000, this, SLOT( initialTimer() ) ); | 95 | QTimer::singleShot( 1000, this, SLOT( initialTimer() ) ); |
90 | 96 | ||
91 | } | 97 | } |
92 | 98 | ||
93 | 99 | ||
94 | Wellenreiter::~Wellenreiter() | 100 | Wellenreiter::~Wellenreiter() |
95 | { | 101 | { |
96 | delete pcap; | 102 | delete pcap; |
97 | } | 103 | } |
98 | 104 | ||
99 | 105 | ||
100 | void Wellenreiter::initialTimer() | 106 | void Wellenreiter::initialTimer() |
101 | { | 107 | { |
102 | qDebug( "Wellenreiter::preloading manufacturer database..." ); | 108 | qDebug( "Wellenreiter::preloading manufacturer database..." ); |
103 | OManufacturerDB::instance(); | 109 | OManufacturerDB::instance(); |
104 | } | 110 | } |
105 | 111 | ||
106 | 112 | ||
107 | void Wellenreiter::setConfigWindow( WellenreiterConfigWindow* cw ) | 113 | void Wellenreiter::setConfigWindow( WellenreiterConfigWindow* cw ) |
108 | { | 114 | { |
109 | configwindow = cw; | 115 | configwindow = cw; |
110 | } | 116 | } |
111 | 117 | ||
@@ -401,97 +407,97 @@ void Wellenreiter::receivePacket( OPacket* p ) | |||
401 | { | 407 | { |
402 | handleControlFrame( p, control ); | 408 | handleControlFrame( p, control ); |
403 | return; | 409 | return; |
404 | } | 410 | } |
405 | 411 | ||
406 | OMacAddress source; | 412 | OMacAddress source; |
407 | OMacAddress dest; | 413 | OMacAddress dest; |
408 | 414 | ||
409 | //TODO: WEP check here | 415 | //TODO: WEP check here |
410 | 416 | ||
411 | // check for a wireless data frame | 417 | // check for a wireless data frame |
412 | OWaveLanDataPacket* wlan = static_cast<OWaveLanDataPacket*>( childIfToParse( p, "802.11 Data" ) ); | 418 | OWaveLanDataPacket* wlan = static_cast<OWaveLanDataPacket*>( childIfToParse( p, "802.11 Data" ) ); |
413 | if ( wlan ) | 419 | if ( wlan ) |
414 | { | 420 | { |
415 | handleWlanData( p, wlan, source, dest ); | 421 | handleWlanData( p, wlan, source, dest ); |
416 | } | 422 | } |
417 | 423 | ||
418 | // check for a wired data frame | 424 | // check for a wired data frame |
419 | OEthernetPacket* eth = static_cast<OEthernetPacket*>( childIfToParse( p, "Ethernet" ) ); | 425 | OEthernetPacket* eth = static_cast<OEthernetPacket*>( childIfToParse( p, "Ethernet" ) ); |
420 | if ( eth ) | 426 | if ( eth ) |
421 | { | 427 | { |
422 | handleEthernetData( p, eth, source, dest ); | 428 | handleEthernetData( p, eth, source, dest ); |
423 | } | 429 | } |
424 | 430 | ||
425 | // check for an arp frame since arp frames come in two flavours: | 431 | // check for an arp frame since arp frames come in two flavours: |
426 | // 802.11 encapsulates ARP data within IP packets while wired ethernet doesn't. | 432 | // 802.11 encapsulates ARP data within IP packets while wired ethernet doesn't. |
427 | OARPPacket* arp = static_cast<OARPPacket*>( childIfToParse( p, "ARP" ) ); | 433 | OARPPacket* arp = static_cast<OARPPacket*>( childIfToParse( p, "ARP" ) ); |
428 | if ( arp ) | 434 | if ( arp ) |
429 | { | 435 | { |
430 | handleARPData( p, arp, source, dest ); | 436 | handleARPData( p, arp, source, dest ); |
431 | } | 437 | } |
432 | 438 | ||
433 | // check for a ip frame | 439 | // check for a ip frame |
434 | OIPPacket* ip = static_cast<OIPPacket*>( childIfToParse( p, "IP" ) ); | 440 | OIPPacket* ip = static_cast<OIPPacket*>( childIfToParse( p, "IP" ) ); |
435 | if ( ip ) | 441 | if ( ip ) |
436 | { | 442 | { |
437 | handleIPData( p, ip, source, dest ); | 443 | handleIPData( p, ip, source, dest ); |
438 | } | 444 | } |
439 | 445 | ||
440 | //handleNotification( p ); | 446 | //handleNotification( p ); |
441 | 447 | ||
442 | } | 448 | } |
443 | 449 | ||
444 | 450 | ||
445 | void Wellenreiter::stopClicked() | 451 | void Wellenreiter::stopClicked() |
446 | { | 452 | { |
447 | if ( iface ) | 453 | if ( iface ) |
448 | { | 454 | { |
449 | disconnect( SIGNAL( receivedPacket(OPacket*) ), this, SLOT( receivePacket(OPacket*) ) ); | 455 | disconnect( SIGNAL( receivedPacket(Opie::Net::OPacket*) ), this, SLOT( receivePacket(Opie::Net::OPacket*) ) ); |
450 | disconnect( SIGNAL( hopped(int) ), this, SLOT( channelHopped(int) ) ); | 456 | disconnect( SIGNAL( hopped(int) ), this, SLOT( channelHopped(int) ) ); |
451 | iface->setChannelHopping(); // stop hopping channels | 457 | iface->setChannelHopping(); // stop hopping channels |
452 | } | 458 | } |
453 | else | 459 | else |
454 | killTimers(); | 460 | killTimers(); |
455 | 461 | ||
456 | pcap->close(); | 462 | pcap->close(); |
457 | sniffing = false; | 463 | sniffing = false; |
458 | 464 | ||
459 | if ( iface ) | 465 | if ( iface ) |
460 | { | 466 | { |
461 | // switch off monitor mode | 467 | // switch off monitor mode |
462 | iface->setMode( "managed" ); | 468 | iface->setMode( "managed" ); |
463 | // switch off promisc flag | 469 | // switch off promisc flag |
464 | iface->setPromiscuousMode( false ); | 470 | iface->setPromiscuousMode( false ); |
465 | 471 | ||
466 | system( "cardctl reset; sleep 1" ); //FIXME: Use OProcess | 472 | system( "cardctl reset; sleep 1" ); //FIXME: Use OProcess |
467 | } | 473 | } |
468 | 474 | ||
469 | logwindow->log( "(i) Stopped Scanning." ); | 475 | logwindow->log( "(i) Stopped Scanning." ); |
470 | assert( parent() ); | 476 | assert( parent() ); |
471 | ( (QMainWindow*) parent() )->setCaption( "Wellenreiter II" ); | 477 | ( (QMainWindow*) parent() )->setCaption( "Wellenreiter II" ); |
472 | 478 | ||
473 | // message the user | 479 | // message the user |
474 | QMessageBox::information( this, "Wellenreiter II", | 480 | QMessageBox::information( this, "Wellenreiter II", |
475 | tr( "Your wireless card\nshould now be usable again." ) ); | 481 | tr( "Your wireless card\nshould now be usable again." ) ); |
476 | 482 | ||
477 | sniffing = false; | 483 | sniffing = false; |
478 | emit( stoppedSniffing() ); | 484 | emit( stoppedSniffing() ); |
479 | 485 | ||
480 | #ifdef QWS | 486 | #ifdef QWS |
481 | if ( WellenreiterConfigWindow::instance()->disablePM->isChecked() ) | 487 | if ( WellenreiterConfigWindow::instance()->disablePM->isChecked() ) |
482 | { | 488 | { |
483 | QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Enable; | 489 | QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Enable; |
484 | } | 490 | } |
485 | #else | 491 | #else |
486 | #warning FIXME: setScreenSaverMode is not operational on the X11 build | 492 | #warning FIXME: setScreenSaverMode is not operational on the X11 build |
487 | #endif | 493 | #endif |
488 | 494 | ||
489 | // print out statistics | 495 | // print out statistics |
490 | for( QMap<QString,int>::ConstIterator it = pcap->statistics().begin(); it != pcap->statistics().end(); ++it ) | 496 | for( QMap<QString,int>::ConstIterator it = pcap->statistics().begin(); it != pcap->statistics().end(); ++it ) |
491 | statwindow->updateCounter( it.key(), it.data() ); | 497 | statwindow->updateCounter( it.key(), it.data() ); |
492 | } | 498 | } |
493 | 499 | ||
494 | 500 | ||
495 | void Wellenreiter::startClicked() | 501 | void Wellenreiter::startClicked() |
496 | { | 502 | { |
497 | // get configuration from config window | 503 | // get configuration from config window |
@@ -566,97 +572,97 @@ void Wellenreiter::startClicked() | |||
566 | { | 572 | { |
567 | qDebug( "Wellenreiter:GPS enabled @ %s:%d", (const char*) configwindow->gpsdHost->currentText(), configwindow->gpsdPort->value() ); | 573 | qDebug( "Wellenreiter:GPS enabled @ %s:%d", (const char*) configwindow->gpsdHost->currentText(), configwindow->gpsdPort->value() ); |
568 | gps->open( configwindow->gpsdHost->currentText(), configwindow->gpsdPort->value() ); | 574 | gps->open( configwindow->gpsdHost->currentText(), configwindow->gpsdPort->value() ); |
569 | } | 575 | } |
570 | 576 | ||
571 | // open pcap and start sniffing | 577 | // open pcap and start sniffing |
572 | 578 | ||
573 | if ( configwindow->writeCaptureFile->isChecked() ) // write to a user specified capture file? | 579 | if ( configwindow->writeCaptureFile->isChecked() ) // write to a user specified capture file? |
574 | { | 580 | { |
575 | dumpname = configwindow->captureFileName->text(); | 581 | dumpname = configwindow->captureFileName->text(); |
576 | if ( dumpname.isEmpty() ) dumpname = "captureFile"; | 582 | if ( dumpname.isEmpty() ) dumpname = "captureFile"; |
577 | dumpname.append( '-' ); | 583 | dumpname.append( '-' ); |
578 | dumpname.append( QTime::currentTime().toString().replace( QRegExp( ":" ), "-" ) ); | 584 | dumpname.append( QTime::currentTime().toString().replace( QRegExp( ":" ), "-" ) ); |
579 | dumpname.append( ".wellenreiter" ); | 585 | dumpname.append( ".wellenreiter" ); |
580 | } | 586 | } |
581 | else // write it anyway ;) | 587 | else // write it anyway ;) |
582 | { | 588 | { |
583 | dumpname = "/var/log/dump.wellenreiter"; | 589 | dumpname = "/var/log/dump.wellenreiter"; |
584 | } | 590 | } |
585 | 591 | ||
586 | if ( cardtype != DEVTYPE_FILE ) | 592 | if ( cardtype != DEVTYPE_FILE ) |
587 | pcap->open( interface ); | 593 | pcap->open( interface ); |
588 | else | 594 | else |
589 | pcap->open( QFile( interface ) ); | 595 | pcap->open( QFile( interface ) ); |
590 | 596 | ||
591 | qDebug( "Wellenreiter:: dumping to %s", (const char*) dumpname ); | 597 | qDebug( "Wellenreiter:: dumping to %s", (const char*) dumpname ); |
592 | pcap->openDumpFile( dumpname ); | 598 | pcap->openDumpFile( dumpname ); |
593 | 599 | ||
594 | if ( !pcap->isOpen() ) | 600 | if ( !pcap->isOpen() ) |
595 | { | 601 | { |
596 | QMessageBox::warning( this, "Wellenreiter II", tr( "Can't open packet capturer for\n'%1':\n" ).arg( | 602 | QMessageBox::warning( this, "Wellenreiter II", tr( "Can't open packet capturer for\n'%1':\n" ).arg( |
597 | cardtype == DEVTYPE_FILE ? (const char*) interface : iface->name() ) + QString(strerror( errno ) )); | 603 | cardtype == DEVTYPE_FILE ? (const char*) interface : iface->name() ) + QString(strerror( errno ) )); |
598 | return; | 604 | return; |
599 | } | 605 | } |
600 | 606 | ||
601 | // set capturer to non-blocking mode | 607 | // set capturer to non-blocking mode |
602 | pcap->setBlocking( false ); | 608 | pcap->setBlocking( false ); |
603 | 609 | ||
604 | // start channel hopper | 610 | // start channel hopper |
605 | if ( cardtype != DEVTYPE_FILE ) | 611 | if ( cardtype != DEVTYPE_FILE ) |
606 | { | 612 | { |
607 | logwindow->log( QString().sprintf( "(i) Starting channel hopper (d=%d ms)", configwindow->hopInterval->value() ) ); | 613 | logwindow->log( QString().sprintf( "(i) Starting channel hopper (d=%d ms)", configwindow->hopInterval->value() ) ); |
608 | iface->setChannelHopping( configwindow->hopInterval->value() ); //use interval from config window | 614 | iface->setChannelHopping( configwindow->hopInterval->value() ); //use interval from config window |
609 | } | 615 | } |
610 | 616 | ||
611 | if ( cardtype != DEVTYPE_FILE ) | 617 | if ( cardtype != DEVTYPE_FILE ) |
612 | { | 618 | { |
613 | // connect socket notifier and start channel hopper | 619 | // connect socket notifier and start channel hopper |
614 | connect( pcap, SIGNAL( receivedPacket(OPacket*) ), this, SLOT( receivePacket(OPacket*) ) ); | 620 | connect( pcap, SIGNAL( receivedPacket(Opie::Net::OPacket*) ), this, SLOT( receivePacket(Opie::Net::OPacket*) ) ); |
615 | connect( iface->channelHopper(), SIGNAL( hopped(int) ), this, SLOT( channelHopped(int) ) ); | 621 | connect( iface->channelHopper(), SIGNAL( hopped(int) ), this, SLOT( channelHopped(int) ) ); |
616 | } | 622 | } |
617 | else | 623 | else |
618 | { | 624 | { |
619 | // start timer for reading packets | 625 | // start timer for reading packets |
620 | startTimer( 100 ); | 626 | startTimer( 100 ); |
621 | } | 627 | } |
622 | 628 | ||
623 | logwindow->log( "(i) Started Scanning." ); | 629 | logwindow->log( "(i) Started Scanning." ); |
624 | sniffing = true; | 630 | sniffing = true; |
625 | 631 | ||
626 | #ifdef QWS | 632 | #ifdef QWS |
627 | if ( WellenreiterConfigWindow::instance()->disablePM->isChecked() ) | 633 | if ( WellenreiterConfigWindow::instance()->disablePM->isChecked() ) |
628 | { | 634 | { |
629 | QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Disable; | 635 | QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Disable; |
630 | } | 636 | } |
631 | #else | 637 | #else |
632 | #warning FIXME: setScreenSaverMode is not operational on the X11 build | 638 | #warning FIXME: setScreenSaverMode is not operational on the X11 build |
633 | #endif | 639 | #endif |
634 | 640 | ||
635 | emit( startedSniffing() ); | 641 | emit( startedSniffing() ); |
636 | if ( cardtype != DEVTYPE_FILE ) channelHopped( 6 ); // set title | 642 | if ( cardtype != DEVTYPE_FILE ) channelHopped( 6 ); // set title |
637 | else | 643 | else |
638 | { | 644 | { |
639 | assert( parent() ); | 645 | assert( parent() ); |
640 | ( (QMainWindow*) parent() )->setCaption( tr( "Wellenreiter II - replaying capture file..." ) ); | 646 | ( (QMainWindow*) parent() )->setCaption( tr( "Wellenreiter II - replaying capture file..." ) ); |
641 | } | 647 | } |
642 | } | 648 | } |
643 | 649 | ||
644 | 650 | ||
645 | void Wellenreiter::timerEvent( QTimerEvent* ) | 651 | void Wellenreiter::timerEvent( QTimerEvent* ) |
646 | { | 652 | { |
647 | qDebug( "Wellenreiter::timerEvent()" ); | 653 | qDebug( "Wellenreiter::timerEvent()" ); |
648 | OPacket* p = pcap->next(); | 654 | OPacket* p = pcap->next(); |
649 | if ( !p ) // no more packets available | 655 | if ( !p ) // no more packets available |
650 | { | 656 | { |
651 | stopClicked(); | 657 | stopClicked(); |
652 | } | 658 | } |
653 | else | 659 | else |
654 | { | 660 | { |
655 | receivePacket( p ); | 661 | receivePacket( p ); |
656 | delete p; | 662 | delete p; |
657 | } | 663 | } |
658 | } | 664 | } |
659 | 665 | ||
660 | 666 | ||
661 | void Wellenreiter::doAction( const QString& action, const QString& protocol, OPacket* p ) | 667 | void Wellenreiter::doAction( const QString& action, const QString& protocol, OPacket* p ) |
662 | { | 668 | { |
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.h b/noncore/net/wellenreiter/gui/wellenreiter.h index d02813b..83299c9 100644 --- a/noncore/net/wellenreiter/gui/wellenreiter.h +++ b/noncore/net/wellenreiter/gui/wellenreiter.h | |||
@@ -1,107 +1,107 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2002-2004 Michael 'Mickey' Lauer. All rights reserved. | 2 | ** Copyright (C) 2002-2004 Michael 'Mickey' Lauer. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file may be distributed and/or modified under the terms of the | 4 | ** This file may be distributed and/or modified under the terms of the |
5 | ** GNU General Public License version 2 as published by the Free Software | 5 | ** GNU General Public License version 2 as published by the Free Software |
6 | ** Foundation and appearing in the file LICENSE.GPL included in the | 6 | ** Foundation and appearing in the file LICENSE.GPL included in the |
7 | ** packaging of this file. | 7 | ** packaging of this file. |
8 | ** | 8 | ** |
9 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 9 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
10 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 10 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
11 | ** | 11 | ** |
12 | **********************************************************************/ | 12 | **********************************************************************/ |
13 | 13 | ||
14 | #ifndef WELLENREITER_H | 14 | #ifndef WELLENREITER_H |
15 | #define WELLENREITER_H | 15 | #define WELLENREITER_H |
16 | 16 | ||
17 | #include "wellenreiterbase.h" | 17 | #include "wellenreiterbase.h" |
18 | 18 | ||
19 | #ifdef QWS | 19 | #ifdef QWS |
20 | #include <opie2/odevice.h> | 20 | #include <opie2/odevice.h> |
21 | using namespace Opie; | ||
22 | #endif | 21 | #endif |
23 | 22 | ||
24 | class QTimerEvent; | 23 | class QTimerEvent; |
25 | class QPixmap; | 24 | class QPixmap; |
26 | class OPacket; | 25 | namespace Opie {namespace Net {class Opie::Net::OPacket;}} |
27 | class OWaveLanManagementPacket; | 26 | namespace Opie {namespace Net {class Opie::Net::OWaveLanManagementPacket;}} |
28 | class OWaveLanControlPacket; | 27 | namespace Opie {namespace Net {class Opie::Net::OWaveLanControlPacket;}} |
29 | class OWaveLanDataPacket; | 28 | namespace Opie {namespace Net {class Opie::Net::OWaveLanDataPacket;}} |
30 | class OEthernetPacket; | 29 | namespace Opie {namespace Net {class Opie::Net::OEthernetPacket;}} |
31 | class OARPPacket; | 30 | namespace Opie {namespace Net {class Opie::Net::OARPPacket;}} |
32 | class OMacAddress; | 31 | namespace Opie {namespace Net {class Opie::Net::OMacAddress;}} |
33 | class OIPPacket; | 32 | namespace Opie {namespace Net {class Opie::Net::OIPPacket;}} |
34 | class OPacketCapturer; | 33 | namespace Opie {namespace Net {class Opie::Net::OPacket;}} |
35 | class OWirelessNetworkInterface; | 34 | namespace Opie {namespace Net {class Opie::Net::OWirelessNetworkInterface;}} |
35 | namespace Opie {namespace Net {class Opie::Net::OPacketCapturer;}} | ||
36 | class PacketView; | 36 | class PacketView; |
37 | class WellenreiterConfigWindow; | 37 | class WellenreiterConfigWindow; |
38 | class MLogWindow; | 38 | class MLogWindow; |
39 | class GPS; | 39 | class GPS; |
40 | 40 | ||
41 | class Wellenreiter : public WellenreiterBase { | 41 | class Wellenreiter : public WellenreiterBase { |
42 | Q_OBJECT | 42 | Q_OBJECT |
43 | 43 | ||
44 | public: | 44 | public: |
45 | Wellenreiter( QWidget* parent = 0 ); | 45 | Wellenreiter( QWidget* parent = 0 ); |
46 | ~Wellenreiter(); | 46 | ~Wellenreiter(); |
47 | 47 | ||
48 | void setConfigWindow( WellenreiterConfigWindow* cw ); | 48 | void setConfigWindow( WellenreiterConfigWindow* cw ); |
49 | MScanListView* netView() const { return netview; }; | 49 | MScanListView* netView() const { return netview; }; |
50 | MLogWindow* logWindow() const { return logwindow; }; | 50 | MLogWindow* logWindow() const { return logwindow; }; |
51 | PacketView* hexWindow() const { return hexwindow; }; | 51 | PacketView* hexWindow() const { return hexwindow; }; |
52 | bool isDaemonRunning() const { return sniffing; }; | 52 | bool isDaemonRunning() const { return sniffing; }; |
53 | QString captureFileName() const { return dumpname; }; | 53 | QString captureFileName() const { return dumpname; }; |
54 | 54 | ||
55 | public: | 55 | public: |
56 | bool sniffing; | 56 | bool sniffing; |
57 | 57 | ||
58 | protected: | 58 | protected: |
59 | virtual void timerEvent( QTimerEvent* ); | 59 | virtual void timerEvent( QTimerEvent* ); |
60 | 60 | ||
61 | public slots: | 61 | public slots: |
62 | void initialTimer(); | 62 | void initialTimer(); |
63 | 63 | ||
64 | void channelHopped(int); | 64 | void channelHopped(int); |
65 | void receivePacket(OPacket*); | 65 | void receivePacket(Opie::Net::OPacket*); |
66 | void startClicked(); | 66 | void startClicked(); |
67 | void stopClicked(); | 67 | void stopClicked(); |
68 | 68 | ||
69 | void joinNetwork(const QString&,const QString&,int,const QString&); | 69 | void joinNetwork(const QString&,const QString&,int,const QString&); |
70 | 70 | ||
71 | signals: | 71 | signals: |
72 | void startedSniffing(); | 72 | void startedSniffing(); |
73 | void stoppedSniffing(); | 73 | void stoppedSniffing(); |
74 | 74 | ||
75 | private: | 75 | private: |
76 | void handleManagementFrame( OPacket* p, OWaveLanManagementPacket* ); | 76 | void handleManagementFrame( Opie::Net::OPacket* p, Opie::Net::OWaveLanManagementPacket* ); |
77 | void handleManagementFrameBeacon( OPacket* p, OWaveLanManagementPacket* ); | 77 | void handleManagementFrameBeacon( Opie::Net::OPacket* p, Opie::Net::OWaveLanManagementPacket* ); |
78 | void handleManagementFrameProbeRequest( OPacket* p, OWaveLanManagementPacket* ); | 78 | void handleManagementFrameProbeRequest( Opie::Net::OPacket* p, Opie::Net::OWaveLanManagementPacket* ); |
79 | void handleManagementFrameProbeResponse( OPacket* p, OWaveLanManagementPacket* ); | 79 | void handleManagementFrameProbeResponse( Opie::Net::OPacket* p, Opie::Net::OWaveLanManagementPacket* ); |
80 | void handleControlFrame( OPacket* p, OWaveLanControlPacket* control ); | 80 | void handleControlFrame( Opie::Net::OPacket* p, Opie::Net::OWaveLanControlPacket* control ); |
81 | void handleWlanData( OPacket* p, OWaveLanDataPacket* data, OMacAddress& from, OMacAddress& to ); | 81 | void handleWlanData( Opie::Net::OPacket* p, Opie::Net::OWaveLanDataPacket* data, Opie::Net::OMacAddress& from, Opie::Net::OMacAddress& to ); |
82 | void handleEthernetData( OPacket* p, OEthernetPacket* data, OMacAddress& from, OMacAddress& to ); | 82 | void handleEthernetData( Opie::Net::OPacket* p, Opie::Net::OEthernetPacket* data, Opie::Net::OMacAddress& from, Opie::Net::OMacAddress& to ); |
83 | void handleARPData( OPacket* p, OARPPacket* arp, OMacAddress& from, OMacAddress& to ); | 83 | void handleARPData( Opie::Net::OPacket* p, Opie::Net::OARPPacket* arp, Opie::Net::OMacAddress& from, Opie::Net::OMacAddress& to ); |
84 | void handleIPData( OPacket* p, OIPPacket* ip, OMacAddress& from, OMacAddress& to ); | 84 | void handleIPData( Opie::Net::OPacket* p, Opie::Net::OIPPacket* ip, Opie::Net::OMacAddress& from, Opie::Net::OMacAddress& to ); |
85 | void handleNotification( OPacket* p ); | 85 | void handleNotification( Opie::Net::OPacket* p ); |
86 | void doAction( const QString& action, const QString& protocol, OPacket* p ); | 86 | void doAction( const QString& action, const QString& protocol, Opie::Net::OPacket* p ); |
87 | QObject* childIfToParse( OPacket* p, const QString& protocol ); | 87 | QObject* childIfToParse( Opie::Net::OPacket* p, const QString& protocol ); |
88 | bool checkDumpPacket( OPacket* p ); | 88 | bool checkDumpPacket( Opie::Net::OPacket* p ); |
89 | 89 | ||
90 | private: | 90 | private: |
91 | #ifdef QWS | 91 | #ifdef QWS |
92 | OSystem _system; // Opie Operating System identifier | 92 | Opie::Core::OSystem _system; // Opie Operating System identifier |
93 | #endif | 93 | #endif |
94 | 94 | ||
95 | QString dumpname; | 95 | QString dumpname; |
96 | OWirelessNetworkInterface* iface; | 96 | Opie::Net::OWirelessNetworkInterface* iface; |
97 | OPacketCapturer* pcap; | 97 | Opie::Net::OPacketCapturer* pcap; |
98 | WellenreiterConfigWindow* configwindow; | 98 | WellenreiterConfigWindow* configwindow; |
99 | GPS* gps; | 99 | GPS* gps; |
100 | 100 | ||
101 | //void readConfig(); | 101 | //void readConfig(); |
102 | //void writeConfig(); | 102 | //void writeConfig(); |
103 | }; | 103 | }; |
104 | 104 | ||
105 | 105 | ||
106 | 106 | ||
107 | #endif | 107 | #endif |
diff --git a/noncore/net/wellenreiter/gui/wellenreiterbase.cpp b/noncore/net/wellenreiter/gui/wellenreiterbase.cpp index 3d0595d..f035e89 100644 --- a/noncore/net/wellenreiter/gui/wellenreiterbase.cpp +++ b/noncore/net/wellenreiter/gui/wellenreiterbase.cpp | |||
@@ -1,88 +1,91 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2002-2004 Michael 'Mickey' Lauer. All rights reserved. | 2 | ** Copyright (C) 2002-2004 Michael 'Mickey' Lauer. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Wellenreiter II. | 4 | ** This file is part of Wellenreiter II. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 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 | 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 | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 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. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ***********************************************************************/ | 14 | ***********************************************************************/ |
15 | 15 | ||
16 | #include "wellenreiterbase.h" | 16 | #include "wellenreiterbase.h" |
17 | 17 | ||
18 | #include <qlabel.h> | 18 | #include <qlabel.h> |
19 | #include <qlayout.h> | 19 | #include <qlayout.h> |
20 | 20 | ||
21 | #include "logwindow.h" | 21 | #include "logwindow.h" |
22 | #include "packetview.h" | 22 | #include "packetview.h" |
23 | #include "scanlist.h" | 23 | #include "scanlist.h" |
24 | #include "statwindow.h" | 24 | #include "statwindow.h" |
25 | #include "graphwindow.h" | 25 | #include "graphwindow.h" |
26 | 26 | ||
27 | #ifdef QWS | 27 | #ifdef QWS |
28 | #include <qpe/resource.h> | 28 | #include <qpe/resource.h> |
29 | #include <opie2/otabwidget.h> | 29 | #include <opie2/otabwidget.h> |
30 | using namespace Opie; | 30 | using namespace Opie; |
31 | #else | 31 | #else |
32 | #include "resource.h" | 32 | #include "resource.h" |
33 | #include <qtabwidget.h> | 33 | #include <qtabwidget.h> |
34 | #endif | 34 | #endif |
35 | 35 | ||
36 | 36 | ||
37 | /* | 37 | /* |
38 | * Constructs a WellenreiterBase which is a child of 'parent', with the | 38 | * Constructs a WellenreiterBase which is a child of 'parent', with the |
39 | * name 'name' and widget flags set to 'f' | 39 | * name 'name' and widget flags set to 'f' |
40 | */ | 40 | */ |
41 | using namespace Opie::Ui; | ||
42 | using namespace Opie::Ui; | ||
43 | using namespace Opie::Ui; | ||
41 | WellenreiterBase::WellenreiterBase( QWidget* parent, const char* name, WFlags fl ) | 44 | WellenreiterBase::WellenreiterBase( QWidget* parent, const char* name, WFlags fl ) |
42 | : QWidget( parent, name, fl ) | 45 | : QWidget( parent, name, fl ) |
43 | { | 46 | { |
44 | //ani1 = new QPixmap( Resource::loadPixmap( "wellenreiter/networks_rot0" ) ); | 47 | //ani1 = new QPixmap( Resource::loadPixmap( "wellenreiter/networks_rot0" ) ); |
45 | //ani2 = new QPixmap( Resource::loadPixmap( "wellenreiter/networks_rot90" ) ); | 48 | //ani2 = new QPixmap( Resource::loadPixmap( "wellenreiter/networks_rot90" ) ); |
46 | //ani3 = new QPixmap( Resource::loadPixmap( "wellenreiter/networks_rot180" ) ); | 49 | //ani3 = new QPixmap( Resource::loadPixmap( "wellenreiter/networks_rot180" ) ); |
47 | //ani4 = new QPixmap( Resource::loadPixmap( "wellenreiter/networks_rot270" ) ); | 50 | //ani4 = new QPixmap( Resource::loadPixmap( "wellenreiter/networks_rot270" ) ); |
48 | 51 | ||
49 | if ( !name ) | 52 | if ( !name ) |
50 | setName( "WellenreiterBase" ); | 53 | setName( "WellenreiterBase" ); |
51 | resize( 191, 294 ); | 54 | resize( 191, 294 ); |
52 | #ifdef QWS | 55 | #ifdef QWS |
53 | setCaption( tr( "Wellenreiter/Opie" ) ); | 56 | setCaption( tr( "Wellenreiter/Opie" ) ); |
54 | #else | 57 | #else |
55 | setCaption( tr( "Wellenreiter/X11" ) ); | 58 | setCaption( tr( "Wellenreiter/X11" ) ); |
56 | #endif | 59 | #endif |
57 | WellenreiterBaseLayout = new QVBoxLayout( this ); | 60 | WellenreiterBaseLayout = new QVBoxLayout( this ); |
58 | WellenreiterBaseLayout->setSpacing( 2 ); | 61 | WellenreiterBaseLayout->setSpacing( 2 ); |
59 | WellenreiterBaseLayout->setMargin( 0 ); | 62 | WellenreiterBaseLayout->setMargin( 0 ); |
60 | #ifdef QWS | 63 | #ifdef QWS |
61 | TabWidget = new OTabWidget( this, "TabWidget", OTabWidget::Global ); | 64 | TabWidget = new OTabWidget( this, "TabWidget", OTabWidget::Global ); |
62 | #else | 65 | #else |
63 | TabWidget = new QTabWidget( this, "TabWidget" ); | 66 | TabWidget = new QTabWidget( this, "TabWidget" ); |
64 | #endif | 67 | #endif |
65 | ap = new QWidget( TabWidget, "ap" ); | 68 | ap = new QWidget( TabWidget, "ap" ); |
66 | apLayout = new QVBoxLayout( ap ); | 69 | apLayout = new QVBoxLayout( ap ); |
67 | apLayout->setSpacing( 2 ); | 70 | apLayout->setSpacing( 2 ); |
68 | apLayout->setMargin( 2 ); | 71 | apLayout->setMargin( 2 ); |
69 | 72 | ||
70 | //--------- NETVIEW TAB -------------- | 73 | //--------- NETVIEW TAB -------------- |
71 | 74 | ||
72 | netview = new MScanListView( ap ); | 75 | netview = new MScanListView( ap ); |
73 | apLayout->addWidget( netview ); | 76 | apLayout->addWidget( netview ); |
74 | 77 | ||
75 | //--------- GRAPH TAB -------------- | 78 | //--------- GRAPH TAB -------------- |
76 | 79 | ||
77 | graphwindow = new MGraphWindow( TabWidget, "Graph" ); | 80 | graphwindow = new MGraphWindow( TabWidget, "Graph" ); |
78 | 81 | ||
79 | //--------- LOG TAB -------------- | 82 | //--------- LOG TAB -------------- |
80 | 83 | ||
81 | logwindow = new MLogWindow( TabWidget, "Log" ); | 84 | logwindow = new MLogWindow( TabWidget, "Log" ); |
82 | 85 | ||
83 | //--------- HEX TAB -------------- | 86 | //--------- HEX TAB -------------- |
84 | 87 | ||
85 | hexwindow = new PacketView( TabWidget, "Hex" ); | 88 | hexwindow = new PacketView( TabWidget, "Hex" ); |
86 | 89 | ||
87 | //--------- STAT TAB -------------- | 90 | //--------- STAT TAB -------------- |
88 | 91 | ||
diff --git a/noncore/net/wellenreiter/gui/wellenreiterbase.h b/noncore/net/wellenreiter/gui/wellenreiterbase.h index 126aad2..e40b699 100644 --- a/noncore/net/wellenreiter/gui/wellenreiterbase.h +++ b/noncore/net/wellenreiter/gui/wellenreiterbase.h | |||
@@ -1,77 +1,77 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2002-2004 Michael 'Mickey' Lauer. All rights reserved. | 2 | ** Copyright (C) 2002-2004 Michael 'Mickey' Lauer. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Wellenreiter II. | 4 | ** This file is part of Wellenreiter II. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 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 | 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 | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 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. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | **********************************************************************/ | 14 | **********************************************************************/ |
15 | 15 | ||
16 | #ifndef WELLENREITERBASE_H | 16 | #ifndef WELLENREITERBASE_H |
17 | #define WELLENREITERBASE_H | 17 | #define WELLENREITERBASE_H |
18 | 18 | ||
19 | #include <qvariant.h> | 19 | #include <qvariant.h> |
20 | #include <qwidget.h> | 20 | #include <qwidget.h> |
21 | class QVBoxLayout; | 21 | class QVBoxLayout; |
22 | class QHBoxLayout; | 22 | class QHBoxLayout; |
23 | class QGridLayout; | 23 | class QGridLayout; |
24 | class QLabel; | 24 | class QLabel; |
25 | class MScanListView; | 25 | class MScanListView; |
26 | class MScanListItem; | 26 | class MScanListItem; |
27 | class QPushButton; | 27 | class QPushButton; |
28 | class MLogWindow; | 28 | class MLogWindow; |
29 | class MStatWindow; | 29 | class MStatWindow; |
30 | class MGraphWindow; | 30 | class MGraphWindow; |
31 | class PacketView; | 31 | class PacketView; |
32 | 32 | ||
33 | #ifdef QWS | 33 | #ifdef QWS |
34 | #include <opie2/otabwidget.h> | 34 | #include <opie2/otabwidget.h> |
35 | using namespace Opie; | 35 | using namespace Opie; |
36 | #else | 36 | #else |
37 | class QTabWidget; | 37 | class QTabWidget; |
38 | #endif | 38 | #endif |
39 | 39 | ||
40 | class WellenreiterBase : public QWidget | 40 | class WellenreiterBase : public QWidget |
41 | { | 41 | { |
42 | Q_OBJECT | 42 | Q_OBJECT |
43 | 43 | ||
44 | public: | 44 | public: |
45 | WellenreiterBase( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); | 45 | WellenreiterBase( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); |
46 | ~WellenreiterBase(); | 46 | ~WellenreiterBase(); |
47 | 47 | ||
48 | #ifdef QWS | 48 | #ifdef QWS |
49 | OTabWidget* TabWidget; | 49 | Opie::Ui::OTabWidget* TabWidget; |
50 | #else | 50 | #else |
51 | QTabWidget* TabWidget; | 51 | QTabWidget* TabWidget; |
52 | #endif | 52 | #endif |
53 | QWidget* ap; | 53 | QWidget* ap; |
54 | MScanListView* netview; | 54 | MScanListView* netview; |
55 | MLogWindow* logwindow; | 55 | MLogWindow* logwindow; |
56 | PacketView* hexwindow; | 56 | PacketView* hexwindow; |
57 | MStatWindow* statwindow; | 57 | MStatWindow* statwindow; |
58 | MGraphWindow* graphwindow; | 58 | MGraphWindow* graphwindow; |
59 | QWidget* about; | 59 | QWidget* about; |
60 | QLabel* PixmapLabel1_3_2; | 60 | QLabel* PixmapLabel1_3_2; |
61 | QLabel* TextLabel1_4_2; | 61 | QLabel* TextLabel1_4_2; |
62 | 62 | ||
63 | protected: | 63 | protected: |
64 | QVBoxLayout* WellenreiterBaseLayout; | 64 | QVBoxLayout* WellenreiterBaseLayout; |
65 | QVBoxLayout* apLayout; | 65 | QVBoxLayout* apLayout; |
66 | QGridLayout* aboutLayout; | 66 | QGridLayout* aboutLayout; |
67 | bool event( QEvent* ); | 67 | bool event( QEvent* ); |
68 | 68 | ||
69 | QPixmap* ani1; | 69 | QPixmap* ani1; |
70 | QPixmap* ani2; | 70 | QPixmap* ani2; |
71 | QPixmap* ani3; | 71 | QPixmap* ani3; |
72 | QPixmap* ani4; | 72 | QPixmap* ani4; |
73 | 73 | ||
74 | 74 | ||
75 | }; | 75 | }; |
76 | 76 | ||
77 | #endif // WELLENREITERBASE_H | 77 | #endif // WELLENREITERBASE_H |