-rw-r--r-- | noncore/net/wellenreiter/gui/gui.pro | 2 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/hexwindow.cpp | 4 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/hexwindow.h | 1 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/logwindow.cpp | 5 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/logwindow.h | 1 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/mainwindow.cpp | 10 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/mainwindow.h | 1 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiter.h | 4 |
8 files changed, 26 insertions, 2 deletions
diff --git a/noncore/net/wellenreiter/gui/gui.pro b/noncore/net/wellenreiter/gui/gui.pro index 200bfc1..505d376 100644 --- a/noncore/net/wellenreiter/gui/gui.pro +++ b/noncore/net/wellenreiter/gui/gui.pro | |||
@@ -1,43 +1,43 @@ | |||
1 | MOC_DIR = ./tmp | 1 | MOC_DIR = ./tmp |
2 | OBJECTS_DIR = ./tmp | 2 | OBJECTS_DIR = ./tmp |
3 | DESTDIR = $(OPIEDIR)/bin | 3 | DESTDIR = $(OPIEDIR)/bin |
4 | TEMPLATE = app | 4 | TEMPLATE = app |
5 | CONFIG = qt warn_on debug | 5 | CONFIG = qt warn_on debug |
6 | 6 | ||
7 | HEADERS = wellenreiterbase.h \ | 7 | HEADERS = wellenreiterbase.h \ |
8 | mainwindow.h \ | 8 | mainwindow.h \ |
9 | wellenreiter.h \ | 9 | wellenreiter.h \ |
10 | scanlist.h \ | 10 | scanlist.h \ |
11 | logwindow.h \ | 11 | logwindow.h \ |
12 | hexwindow.h \ | 12 | hexwindow.h \ |
13 | configwindow.h \ | 13 | configwindow.h \ |
14 | manufacturers.h | 14 | manufacturers.h |
15 | 15 | ||
16 | SOURCES = main.cpp \ | 16 | SOURCES = main.cpp \ |
17 | mainwindow.cpp \ | 17 | mainwindow.cpp \ |
18 | wellenreiterbase.cpp \ | 18 | wellenreiterbase.cpp \ |
19 | wellenreiter.cpp \ | 19 | wellenreiter.cpp \ |
20 | scanlist.cpp \ | 20 | scanlist.cpp \ |
21 | logwindow.cpp \ | 21 | logwindow.cpp \ |
22 | hexwindow.cpp \ | 22 | hexwindow.cpp \ |
23 | configwindow.cpp \ | 23 | configwindow.cpp \ |
24 | manufacturers.cpp | 24 | manufacturers.cpp |
25 | 25 | ||
26 | INCLUDEPATH += $(OPIEDIR)/include | 26 | INCLUDEPATH += $(OPIEDIR)/include |
27 | DEPENDPATH += $(OPIEDIR)/include | 27 | DEPENDPATH += $(OPIEDIR)/include |
28 | LIBS += -L. -lwellenreiter -lopiecore2 -lopieui2 -lopienet2 | 28 | LIBS += -lopiecore2 -lopieui2 -lopienet2 |
29 | INTERFACES = configbase.ui | 29 | INTERFACES = configbase.ui |
30 | TARGET = wellenreiter | 30 | TARGET = wellenreiter |
31 | 31 | ||
32 | !contains( platform, x11 ) { | 32 | !contains( platform, x11 ) { |
33 | message( qws ) | 33 | message( qws ) |
34 | include ( $(OPIEDIR)/include.pro ) | 34 | include ( $(OPIEDIR)/include.pro ) |
35 | LIBS += -lqpe -lopie | 35 | LIBS += -lqpe -lopie |
36 | } | 36 | } |
37 | 37 | ||
38 | contains( platform, x11 ) { | 38 | contains( platform, x11 ) { |
39 | LIBS += -L$(OPIEDIR)/lib -Wl,-rpath,$(OPIEDIR)/lib | 39 | LIBS += -L$(OPIEDIR)/lib -Wl,-rpath,$(OPIEDIR)/lib |
40 | SOURCES += resource.cpp | 40 | SOURCES += resource.cpp |
41 | HEADERS += resource.h | 41 | HEADERS += resource.h |
42 | } | 42 | } |
43 | 43 | ||
diff --git a/noncore/net/wellenreiter/gui/hexwindow.cpp b/noncore/net/wellenreiter/gui/hexwindow.cpp index 91aa6f7..a3022f4 100644 --- a/noncore/net/wellenreiter/gui/hexwindow.cpp +++ b/noncore/net/wellenreiter/gui/hexwindow.cpp | |||
@@ -1,35 +1,39 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. | 2 | ** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Opie Environment. | 4 | ** This file is part of Opie Environment. |
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 "hexwindow.h" | 16 | #include "hexwindow.h" |
17 | #include <qmultilineedit.h> | 17 | #include <qmultilineedit.h> |
18 | 18 | ||
19 | MHexWindow::MHexWindow( QWidget * parent, const char * name, WFlags f ) | 19 | MHexWindow::MHexWindow( QWidget * parent, const char * name, WFlags f ) |
20 | :QVBox( parent, name, f ) | 20 | :QVBox( parent, name, f ) |
21 | { | 21 | { |
22 | ledit = new QMultiLineEdit( this ); | 22 | ledit = new QMultiLineEdit( this ); |
23 | 23 | ||
24 | // FIXME: Set properties( font, read-only, etc...) | 24 | // FIXME: Set properties( font, read-only, etc...) |
25 | 25 | ||
26 | }; | 26 | }; |
27 | 27 | ||
28 | void MHexWindow::log( QString text ) | 28 | void MHexWindow::log( QString text ) |
29 | { | 29 | { |
30 | 30 | ||
31 | ledit->append( text ); | 31 | ledit->append( text ); |
32 | 32 | ||
33 | }; | 33 | }; |
34 | 34 | ||
35 | void MHexWindow::clear() | ||
36 | { | ||
37 | ledit->clear(); | ||
38 | } | ||
35 | 39 | ||
diff --git a/noncore/net/wellenreiter/gui/hexwindow.h b/noncore/net/wellenreiter/gui/hexwindow.h index eec1be0..2618b8c 100644 --- a/noncore/net/wellenreiter/gui/hexwindow.h +++ b/noncore/net/wellenreiter/gui/hexwindow.h | |||
@@ -1,38 +1,39 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. | 2 | ** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Opie Environment. | 4 | ** This file is part of Opie Environment. |
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 HEXWINDOW_H | 16 | #ifndef HEXWINDOW_H |
17 | #define HEXWINDOW_H | 17 | #define HEXWINDOW_H |
18 | 18 | ||
19 | #include <qvbox.h> | 19 | #include <qvbox.h> |
20 | 20 | ||
21 | class QString; | 21 | class QString; |
22 | class QMultiLineEdit; | 22 | class QMultiLineEdit; |
23 | 23 | ||
24 | class MHexWindow: public QVBox | 24 | class MHexWindow: public QVBox |
25 | { | 25 | { |
26 | 26 | ||
27 | public: | 27 | public: |
28 | MHexWindow( QWidget * parent = 0, const char * name = "MHexWindow", WFlags f = 0 ); | 28 | MHexWindow( QWidget * parent = 0, const char * name = "MHexWindow", WFlags f = 0 ); |
29 | 29 | ||
30 | void log( QString text ); | 30 | void log( QString text ); |
31 | void clear(); | ||
31 | 32 | ||
32 | protected: | 33 | protected: |
33 | QMultiLineEdit* ledit; | 34 | QMultiLineEdit* ledit; |
34 | 35 | ||
35 | }; | 36 | }; |
36 | 37 | ||
37 | #endif | 38 | #endif |
38 | 39 | ||
diff --git a/noncore/net/wellenreiter/gui/logwindow.cpp b/noncore/net/wellenreiter/gui/logwindow.cpp index f132f56..55e2ccb 100644 --- a/noncore/net/wellenreiter/gui/logwindow.cpp +++ b/noncore/net/wellenreiter/gui/logwindow.cpp | |||
@@ -1,42 +1,47 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. | 2 | ** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Opie Environment. | 4 | ** This file is part of Opie Environment. |
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 "logwindow.h" | 16 | #include "logwindow.h" |
17 | #include <qmultilineedit.h> | 17 | #include <qmultilineedit.h> |
18 | #include <qdatetime.h> | 18 | #include <qdatetime.h> |
19 | 19 | ||
20 | MLogWindow::MLogWindow( QWidget * parent, const char * name, WFlags f ) | 20 | MLogWindow::MLogWindow( QWidget * parent, const char * name, WFlags f ) |
21 | :QVBox( parent, name, f ) | 21 | :QVBox( parent, name, f ) |
22 | { | 22 | { |
23 | ledit = new QMultiLineEdit( this ); | 23 | ledit = new QMultiLineEdit( this ); |
24 | 24 | ||
25 | // FIXME: Set properties( font, read-only, etc...) | 25 | // FIXME: Set properties( font, read-only, etc...) |
26 | 26 | ||
27 | } | 27 | } |
28 | 28 | ||
29 | void MLogWindow::log( QString text ) | 29 | void MLogWindow::log( QString text ) |
30 | { | 30 | { |
31 | QTime time = QTime::currentTime(); | 31 | QTime time = QTime::currentTime(); |
32 | QString line; | 32 | QString line; |
33 | line.sprintf( "[%s] %s", (const char*) time.toString(), (const char*) text ); | 33 | line.sprintf( "[%s] %s", (const char*) time.toString(), (const char*) text ); |
34 | ledit->append( line ); | 34 | ledit->append( line ); |
35 | qDebug( line ); | 35 | qDebug( line ); |
36 | 36 | ||
37 | } | 37 | } |
38 | 38 | ||
39 | void MLogWindow::clear() | ||
40 | { | ||
41 | ledit->clear(); | ||
42 | } | ||
43 | |||
39 | const QString MLogWindow::getLog() const | 44 | const QString MLogWindow::getLog() const |
40 | { | 45 | { |
41 | return ledit->text(); | 46 | return ledit->text(); |
42 | } | 47 | } |
diff --git a/noncore/net/wellenreiter/gui/logwindow.h b/noncore/net/wellenreiter/gui/logwindow.h index 253defa..6e0fe50 100644 --- a/noncore/net/wellenreiter/gui/logwindow.h +++ b/noncore/net/wellenreiter/gui/logwindow.h | |||
@@ -1,39 +1,40 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. | 2 | ** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Opie Environment. | 4 | ** This file is part of Opie Environment. |
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 LOGWINDOW_H | 16 | #ifndef LOGWINDOW_H |
17 | #define LOGWINDOW_H | 17 | #define LOGWINDOW_H |
18 | 18 | ||
19 | #include <qvbox.h> | 19 | #include <qvbox.h> |
20 | 20 | ||
21 | class QString; | 21 | class QString; |
22 | class QMultiLineEdit; | 22 | class QMultiLineEdit; |
23 | 23 | ||
24 | class MLogWindow: public QVBox | 24 | class MLogWindow: public QVBox |
25 | { | 25 | { |
26 | 26 | ||
27 | public: | 27 | public: |
28 | MLogWindow( QWidget * parent = 0, const char * name = "MLogWindow", WFlags f = 0 ); | 28 | MLogWindow( QWidget * parent = 0, const char * name = "MLogWindow", WFlags f = 0 ); |
29 | 29 | ||
30 | void log( QString text ); | 30 | void log( QString text ); |
31 | const QString getLog() const; | 31 | const QString getLog() const; |
32 | void clear(); | ||
32 | 33 | ||
33 | protected: | 34 | protected: |
34 | QMultiLineEdit* ledit; | 35 | QMultiLineEdit* ledit; |
35 | 36 | ||
36 | }; | 37 | }; |
37 | 38 | ||
38 | #endif | 39 | #endif |
39 | 40 | ||
diff --git a/noncore/net/wellenreiter/gui/mainwindow.cpp b/noncore/net/wellenreiter/gui/mainwindow.cpp index d4988af..8e0164f 100644 --- a/noncore/net/wellenreiter/gui/mainwindow.cpp +++ b/noncore/net/wellenreiter/gui/mainwindow.cpp | |||
@@ -1,164 +1,165 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. | 2 | ** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Opie Environment. | 4 | ** This file is part of Opie Environment. |
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 "configwindow.h" | 16 | #include "configwindow.h" |
17 | #include "logwindow.h" | 17 | #include "logwindow.h" |
18 | #include "hexwindow.h" | ||
18 | #include "mainwindow.h" | 19 | #include "mainwindow.h" |
19 | #include "wellenreiter.h" | 20 | #include "wellenreiter.h" |
20 | |||
21 | #include "scanlist.h" | 21 | #include "scanlist.h" |
22 | 22 | ||
23 | #include <qcombobox.h> | 23 | #include <qcombobox.h> |
24 | #include <qdatastream.h> | 24 | #include <qdatastream.h> |
25 | #include <qfile.h> | 25 | #include <qfile.h> |
26 | #include <qfileinfo.h> | 26 | #include <qfileinfo.h> |
27 | #include <qiconset.h> | 27 | #include <qiconset.h> |
28 | #include <qmenubar.h> | 28 | #include <qmenubar.h> |
29 | #include <qmessagebox.h> | 29 | #include <qmessagebox.h> |
30 | #include <qpopupmenu.h> | 30 | #include <qpopupmenu.h> |
31 | #include <qstatusbar.h> | 31 | #include <qstatusbar.h> |
32 | #include <qtextstream.h> | 32 | #include <qtextstream.h> |
33 | #include <qtoolbutton.h> | 33 | #include <qtoolbutton.h> |
34 | 34 | ||
35 | #ifdef QWS | 35 | #ifdef QWS |
36 | #include <qpe/resource.h> | 36 | #include <qpe/resource.h> |
37 | #include <opie/ofiledialog.h> | 37 | #include <opie/ofiledialog.h> |
38 | #else | 38 | #else |
39 | #include "resource.h" | 39 | #include "resource.h" |
40 | #include <qapplication.h> | 40 | #include <qapplication.h> |
41 | #include <qfiledialog.h> | 41 | #include <qfiledialog.h> |
42 | #endif | 42 | #endif |
43 | 43 | ||
44 | WellenreiterMainWindow::WellenreiterMainWindow( QWidget * parent, const char * name, WFlags f ) | 44 | WellenreiterMainWindow::WellenreiterMainWindow( QWidget * parent, const char * name, WFlags f ) |
45 | :QMainWindow( parent, name, f ) | 45 | :QMainWindow( parent, name, f ) |
46 | { | 46 | { |
47 | cw = new WellenreiterConfigWindow( this ); | 47 | cw = new WellenreiterConfigWindow( this ); |
48 | mw = new Wellenreiter( this ); | 48 | mw = new Wellenreiter( this ); |
49 | mw->setConfigWindow( cw ); | 49 | mw->setConfigWindow( cw ); |
50 | setCentralWidget( mw ); | 50 | setCentralWidget( mw ); |
51 | 51 | ||
52 | // setup application icon | 52 | // setup application icon |
53 | 53 | ||
54 | #ifndef QWS | 54 | #ifndef QWS |
55 | setIcon( Resource::loadPixmap( "wellenreiter/appicon-trans" ) ); | 55 | setIcon( Resource::loadPixmap( "wellenreiter/appicon-trans" ) ); |
56 | setIconText( "Wellenreiter/X11" ); | 56 | setIconText( "Wellenreiter/X11" ); |
57 | #endif | 57 | #endif |
58 | 58 | ||
59 | // setup icon sets | 59 | // setup icon sets |
60 | 60 | ||
61 | infoIconSet = new QIconSet( Resource::loadPixmap( "wellenreiter/InfoIcon" ) ); | 61 | infoIconSet = new QIconSet( Resource::loadPixmap( "wellenreiter/InfoIcon" ) ); |
62 | settingsIconSet = new QIconSet( Resource::loadPixmap( "wellenreiter/SettingsIcon" ) ); | 62 | settingsIconSet = new QIconSet( Resource::loadPixmap( "wellenreiter/SettingsIcon" ) ); |
63 | #ifdef QWS | 63 | #ifdef QWS |
64 | searchIconSet = new QIconSet( Resource::loadPixmap( "wellenreiter/SearchIcon" ) ); | 64 | searchIconSet = new QIconSet( Resource::loadPixmap( "wellenreiter/SearchIcon" ) ); |
65 | cancelIconSet = new QIconSet( Resource::loadPixmap( "wellenreiter/CancelIcon" ) ); | 65 | cancelIconSet = new QIconSet( Resource::loadPixmap( "wellenreiter/CancelIcon" ) ); |
66 | #else | 66 | #else |
67 | startStopIconSet = new QIconSet(); | 67 | startStopIconSet = new QIconSet(); |
68 | startStopIconSet->setPixmap( Resource::loadPixmap( "wellenreiter/SearchIcon" ), QIconSet::Automatic, QIconSet::Normal, QIconSet::Off ); | 68 | startStopIconSet->setPixmap( Resource::loadPixmap( "wellenreiter/SearchIcon" ), QIconSet::Automatic, QIconSet::Normal, QIconSet::Off ); |
69 | startStopIconSet->setPixmap( Resource::loadPixmap( "wellenreiter/CancelIcon" ), QIconSet::Automatic, QIconSet::Normal, QIconSet::On ); | 69 | startStopIconSet->setPixmap( Resource::loadPixmap( "wellenreiter/CancelIcon" ), QIconSet::Automatic, QIconSet::Normal, QIconSet::On ); |
70 | #endif | 70 | #endif |
71 | 71 | ||
72 | // setup tool buttons | 72 | // setup tool buttons |
73 | 73 | ||
74 | startStopButton = new QToolButton( 0 ); | 74 | startStopButton = new QToolButton( 0 ); |
75 | #ifdef QWS | 75 | #ifdef QWS |
76 | startStopButton->setAutoRaise( true ); | 76 | startStopButton->setAutoRaise( true ); |
77 | #endif | 77 | #endif |
78 | #ifdef QWS | 78 | #ifdef QWS |
79 | startStopButton->setOnIconSet( *cancelIconSet ); | 79 | startStopButton->setOnIconSet( *cancelIconSet ); |
80 | startStopButton->setOffIconSet( *searchIconSet ); | 80 | startStopButton->setOffIconSet( *searchIconSet ); |
81 | #else | 81 | #else |
82 | startStopButton->setIconSet( *startStopIconSet ); | 82 | startStopButton->setIconSet( *startStopIconSet ); |
83 | #endif | 83 | #endif |
84 | startStopButton->setToggleButton( true ); | 84 | startStopButton->setToggleButton( true ); |
85 | connect( startStopButton, SIGNAL( clicked() ), mw, SLOT( startStopClicked() ) ); | 85 | connect( startStopButton, SIGNAL( clicked() ), mw, SLOT( startStopClicked() ) ); |
86 | startStopButton->setEnabled( false ); | 86 | startStopButton->setEnabled( false ); |
87 | 87 | ||
88 | QToolButton* c = new QToolButton( 0 ); | 88 | QToolButton* c = new QToolButton( 0 ); |
89 | #ifdef QWS | 89 | #ifdef QWS |
90 | c->setAutoRaise( true ); | 90 | c->setAutoRaise( true ); |
91 | #endif | 91 | #endif |
92 | c->setIconSet( *infoIconSet ); | 92 | c->setIconSet( *infoIconSet ); |
93 | c->setEnabled( false ); | 93 | c->setEnabled( false ); |
94 | 94 | ||
95 | QToolButton* d = new QToolButton( 0 ); | 95 | QToolButton* d = new QToolButton( 0 ); |
96 | #ifdef QWS | 96 | #ifdef QWS |
97 | d->setAutoRaise( true ); | 97 | d->setAutoRaise( true ); |
98 | #endif | 98 | #endif |
99 | d->setIconSet( *settingsIconSet ); | 99 | d->setIconSet( *settingsIconSet ); |
100 | connect( d, SIGNAL( clicked() ), this, SLOT( showConfigure() ) ); | 100 | connect( d, SIGNAL( clicked() ), this, SLOT( showConfigure() ) ); |
101 | 101 | ||
102 | // setup menu bar | 102 | // setup menu bar |
103 | 103 | ||
104 | int id; | 104 | int id; |
105 | 105 | ||
106 | QMenuBar* mb = menuBar(); | 106 | QMenuBar* mb = menuBar(); |
107 | 107 | ||
108 | QPopupMenu* fileSave = new QPopupMenu( mb ); | 108 | QPopupMenu* fileSave = new QPopupMenu( mb ); |
109 | fileSave->insertItem( "&Session...", this, SLOT( fileSaveSession() ) ); | 109 | fileSave->insertItem( "&Session...", this, SLOT( fileSaveSession() ) ); |
110 | fileSave->insertItem( "&Log...", this, SLOT( fileSaveLog() ) ); | 110 | fileSave->insertItem( "&Log...", this, SLOT( fileSaveLog() ) ); |
111 | 111 | ||
112 | QPopupMenu* fileLoad = new QPopupMenu( mb ); | 112 | QPopupMenu* fileLoad = new QPopupMenu( mb ); |
113 | fileLoad->insertItem( "&Session...", this, SLOT( fileLoadSession() ) ); | 113 | fileLoad->insertItem( "&Session...", this, SLOT( fileLoadSession() ) ); |
114 | //fileLoad->insertItem( "&Log", this, SLOT( fileLoadLog() ) ); | 114 | //fileLoad->insertItem( "&Log", this, SLOT( fileLoadLog() ) ); |
115 | 115 | ||
116 | QPopupMenu* file = new QPopupMenu( mb ); | 116 | QPopupMenu* file = new QPopupMenu( mb ); |
117 | file->insertItem( "&New", this, SLOT( fileNew() ) ); | ||
117 | id = file->insertItem( "&Load", fileLoad ); | 118 | id = file->insertItem( "&Load", fileLoad ); |
118 | file->insertItem( "&Save", fileSave ); | 119 | file->insertItem( "&Save", fileSave ); |
119 | file->insertSeparator(); | 120 | file->insertSeparator(); |
120 | file->insertItem( "&Exit", qApp, SLOT( quit() ) ); | 121 | file->insertItem( "&Exit", qApp, SLOT( quit() ) ); |
121 | 122 | ||
122 | QPopupMenu* view = new QPopupMenu( mb ); | 123 | QPopupMenu* view = new QPopupMenu( mb ); |
123 | view->insertItem( "&Configure..." ); | 124 | view->insertItem( "&Configure..." ); |
124 | 125 | ||
125 | QPopupMenu* sniffer = new QPopupMenu( mb ); | 126 | QPopupMenu* sniffer = new QPopupMenu( mb ); |
126 | sniffer->insertItem( "&Configure..." ); | 127 | sniffer->insertItem( "&Configure..." ); |
127 | sniffer->insertSeparator(); | 128 | sniffer->insertSeparator(); |
128 | 129 | ||
129 | QPopupMenu* demo = new QPopupMenu( mb ); | 130 | QPopupMenu* demo = new QPopupMenu( mb ); |
130 | demo->insertItem( "&Add something", this, SLOT( demoAddStations() ) ); | 131 | demo->insertItem( "&Add something", this, SLOT( demoAddStations() ) ); |
131 | 132 | ||
132 | id = mb->insertItem( "&File", file ); | 133 | id = mb->insertItem( "&File", file ); |
133 | id = mb->insertItem( "&View", view ); | 134 | id = mb->insertItem( "&View", view ); |
134 | mb->setItemEnabled( id, false ); | 135 | mb->setItemEnabled( id, false ); |
135 | id = mb->insertItem( "&Sniffer", sniffer ); | 136 | id = mb->insertItem( "&Sniffer", sniffer ); |
136 | mb->setItemEnabled( id, false ); | 137 | mb->setItemEnabled( id, false ); |
137 | id = mb->insertItem( "&Demo", demo ); | 138 | id = mb->insertItem( "&Demo", demo ); |
138 | mb->setItemEnabled( id, true ); | 139 | mb->setItemEnabled( id, true ); |
139 | 140 | ||
140 | #ifdef QWS | 141 | #ifdef QWS |
141 | mb->insertItem( startStopButton ); | 142 | mb->insertItem( startStopButton ); |
142 | mb->insertItem( c ); | 143 | mb->insertItem( c ); |
143 | mb->insertItem( d ); | 144 | mb->insertItem( d ); |
144 | #else // Qt3 changed the insertion order. It's now totally random :( | 145 | #else // Qt3 changed the insertion order. It's now totally random :( |
145 | mb->insertItem( d ); | 146 | mb->insertItem( d ); |
146 | mb->insertItem( c ); | 147 | mb->insertItem( c ); |
147 | mb->insertItem( startStopButton ); | 148 | mb->insertItem( startStopButton ); |
148 | #endif | 149 | #endif |
149 | 150 | ||
150 | // setup status bar (for now only on X11) | 151 | // setup status bar (for now only on X11) |
151 | 152 | ||
152 | #ifndef QWS | 153 | #ifndef QWS |
153 | statusBar()->message( "Ready." ); | 154 | statusBar()->message( "Ready." ); |
154 | #endif | 155 | #endif |
155 | 156 | ||
156 | }; | 157 | }; |
157 | 158 | ||
158 | void WellenreiterMainWindow::showConfigure() | 159 | void WellenreiterMainWindow::showConfigure() |
159 | { | 160 | { |
160 | qDebug( "show configure..." ); | 161 | qDebug( "show configure..." ); |
161 | cw->setCaption( tr( "Configure" ) ); | 162 | cw->setCaption( tr( "Configure" ) ); |
162 | #ifdef QWS | 163 | #ifdef QWS |
163 | cw->showMaximized(); | 164 | cw->showMaximized(); |
164 | #endif | 165 | #endif |
@@ -254,60 +255,67 @@ void WellenreiterMainWindow::fileSaveLog() | |||
254 | else | 255 | else |
255 | { | 256 | { |
256 | qDebug( "Problem saving log to file '%s'", (const char*) fname ); | 257 | qDebug( "Problem saving log to file '%s'", (const char*) fname ); |
257 | } | 258 | } |
258 | } | 259 | } |
259 | } | 260 | } |
260 | 261 | ||
261 | void WellenreiterMainWindow::fileSaveSession() | 262 | void WellenreiterMainWindow::fileSaveSession() |
262 | { | 263 | { |
263 | QString fname = getFileName( true ); | 264 | QString fname = getFileName( true ); |
264 | if ( !fname.isEmpty() ) | 265 | if ( !fname.isEmpty() ) |
265 | { | 266 | { |
266 | 267 | ||
267 | QFile f( fname ); | 268 | QFile f( fname ); |
268 | if ( f.open(IO_WriteOnly) ) | 269 | if ( f.open(IO_WriteOnly) ) |
269 | { | 270 | { |
270 | QDataStream t( &f ); | 271 | QDataStream t( &f ); |
271 | t << *mw->netView(); | 272 | t << *mw->netView(); |
272 | f.close(); | 273 | f.close(); |
273 | qDebug( "Saved session to file '%s'", (const char*) fname ); | 274 | qDebug( "Saved session to file '%s'", (const char*) fname ); |
274 | } | 275 | } |
275 | else | 276 | else |
276 | { | 277 | { |
277 | qDebug( "Problem saving session to file '%s'", (const char*) fname ); | 278 | qDebug( "Problem saving session to file '%s'", (const char*) fname ); |
278 | } | 279 | } |
279 | } | 280 | } |
280 | } | 281 | } |
281 | 282 | ||
282 | void WellenreiterMainWindow::fileLoadSession() | 283 | void WellenreiterMainWindow::fileLoadSession() |
283 | { | 284 | { |
284 | QString fname = getFileName( false ); | 285 | QString fname = getFileName( false ); |
285 | if ( !fname.isEmpty() ) | 286 | if ( !fname.isEmpty() ) |
286 | { | 287 | { |
287 | QFile f( fname ); | 288 | QFile f( fname ); |
288 | if ( f.open(IO_ReadOnly) ) | 289 | if ( f.open(IO_ReadOnly) ) |
289 | { | 290 | { |
290 | QDataStream t( &f ); | 291 | QDataStream t( &f ); |
291 | t >> *mw->netView(); | 292 | t >> *mw->netView(); |
292 | f.close(); | 293 | f.close(); |
293 | qDebug( "Loaded session from file '%s'", (const char*) fname ); | 294 | qDebug( "Loaded session from file '%s'", (const char*) fname ); |
294 | } | 295 | } |
295 | else | 296 | else |
296 | { | 297 | { |
297 | qDebug( "Problem loading session from file '%s'", (const char*) fname ); | 298 | qDebug( "Problem loading session from file '%s'", (const char*) fname ); |
298 | } | 299 | } |
299 | } | 300 | } |
300 | } | 301 | } |
301 | 302 | ||
303 | void WellenreiterMainWindow::fileNew() | ||
304 | { | ||
305 | mw->netView()->clear(); | ||
306 | mw->logWindow()->clear(); | ||
307 | mw->hexWindow()->clear(); | ||
308 | } | ||
309 | |||
302 | void WellenreiterMainWindow::closeEvent( QCloseEvent* e ) | 310 | void WellenreiterMainWindow::closeEvent( QCloseEvent* e ) |
303 | { | 311 | { |
304 | if ( mw->isDaemonRunning() ) | 312 | if ( mw->isDaemonRunning() ) |
305 | { | 313 | { |
306 | QMessageBox::warning( this, "Wellenreiter/Opie", "Sniffing in progress!\nPlease stop sniffing before closing." ); | 314 | QMessageBox::warning( this, "Wellenreiter/Opie", "Sniffing in progress!\nPlease stop sniffing before closing." ); |
307 | e->ignore(); | 315 | e->ignore(); |
308 | } | 316 | } |
309 | else | 317 | else |
310 | { | 318 | { |
311 | QMainWindow::closeEvent( e ); | 319 | QMainWindow::closeEvent( e ); |
312 | } | 320 | } |
313 | } | 321 | } |
diff --git a/noncore/net/wellenreiter/gui/mainwindow.h b/noncore/net/wellenreiter/gui/mainwindow.h index 850a343..e06a60c 100644 --- a/noncore/net/wellenreiter/gui/mainwindow.h +++ b/noncore/net/wellenreiter/gui/mainwindow.h | |||
@@ -10,51 +10,52 @@ | |||
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 MAINWINDOW_H | 16 | #ifndef MAINWINDOW_H |
17 | #define MAINWINDOW_H | 17 | #define MAINWINDOW_H |
18 | 18 | ||
19 | #include <qmainwindow.h> | 19 | #include <qmainwindow.h> |
20 | 20 | ||
21 | class Wellenreiter; | 21 | class Wellenreiter; |
22 | class WellenreiterConfigWindow; | 22 | class WellenreiterConfigWindow; |
23 | class QIconSet; | 23 | class QIconSet; |
24 | class QToolButton; | 24 | class QToolButton; |
25 | 25 | ||
26 | class WellenreiterMainWindow: public QMainWindow | 26 | class WellenreiterMainWindow: public QMainWindow |
27 | { | 27 | { |
28 | Q_OBJECT | 28 | Q_OBJECT |
29 | 29 | ||
30 | public: | 30 | public: |
31 | WellenreiterMainWindow( QWidget * parent = 0, const char * name = "mainwindow", WFlags f = 0 ); | 31 | WellenreiterMainWindow( QWidget * parent = 0, const char * name = "mainwindow", WFlags f = 0 ); |
32 | ~WellenreiterMainWindow(); | 32 | ~WellenreiterMainWindow(); |
33 | 33 | ||
34 | protected: | 34 | protected: |
35 | Wellenreiter* mw; | 35 | Wellenreiter* mw; |
36 | WellenreiterConfigWindow* cw; | 36 | WellenreiterConfigWindow* cw; |
37 | 37 | ||
38 | QIconSet* startStopIconSet; | 38 | QIconSet* startStopIconSet; |
39 | const QIconSet* searchIconSet; | 39 | const QIconSet* searchIconSet; |
40 | const QIconSet* infoIconSet; | 40 | const QIconSet* infoIconSet; |
41 | const QIconSet* settingsIconSet; | 41 | const QIconSet* settingsIconSet; |
42 | const QIconSet* cancelIconSet; | 42 | const QIconSet* cancelIconSet; |
43 | 43 | ||
44 | QToolButton* startStopButton; | 44 | QToolButton* startStopButton; |
45 | 45 | ||
46 | protected: | 46 | protected: |
47 | virtual void closeEvent( QCloseEvent* ); | 47 | virtual void closeEvent( QCloseEvent* ); |
48 | 48 | ||
49 | private: | 49 | private: |
50 | QString getFileName( bool save ); | 50 | QString getFileName( bool save ); |
51 | 51 | ||
52 | public slots: | 52 | public slots: |
53 | void showConfigure(); | 53 | void showConfigure(); |
54 | void demoAddStations(); | 54 | void demoAddStations(); |
55 | void fileSaveLog(); | 55 | void fileSaveLog(); |
56 | void fileSaveSession(); | 56 | void fileSaveSession(); |
57 | void fileLoadSession(); | 57 | void fileLoadSession(); |
58 | void fileNew(); | ||
58 | }; | 59 | }; |
59 | 60 | ||
60 | #endif | 61 | #endif |
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.h b/noncore/net/wellenreiter/gui/wellenreiter.h index 3ec4021..ff73dd4 100644 --- a/noncore/net/wellenreiter/gui/wellenreiter.h +++ b/noncore/net/wellenreiter/gui/wellenreiter.h | |||
@@ -1,67 +1,71 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. | 2 | ** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Opie Environment. | 4 | ** This file is part of Opie Environment. |
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 WELLENREITER_H | 16 | #ifndef WELLENREITER_H |
17 | #define WELLENREITER_H | 17 | #define WELLENREITER_H |
18 | 18 | ||
19 | #include "wellenreiterbase.h" | 19 | #include "wellenreiterbase.h" |
20 | 20 | ||
21 | #ifdef QWS | 21 | #ifdef QWS |
22 | #include <opie/odevice.h> | 22 | #include <opie/odevice.h> |
23 | using namespace Opie; | 23 | using namespace Opie; |
24 | #endif | 24 | #endif |
25 | 25 | ||
26 | class QTimerEvent; | 26 | class QTimerEvent; |
27 | class QPixmap; | 27 | class QPixmap; |
28 | class OPacket; | 28 | class OPacket; |
29 | class OPacketCapturer; | 29 | class OPacketCapturer; |
30 | class OWirelessNetworkInterface; | 30 | class OWirelessNetworkInterface; |
31 | |||
31 | class ManufacturerDB; | 32 | class ManufacturerDB; |
32 | class WellenreiterConfigWindow; | 33 | class WellenreiterConfigWindow; |
34 | class MLogWindow; | ||
35 | class MHexWindow; | ||
33 | 36 | ||
34 | class Wellenreiter : public WellenreiterBase { | 37 | class Wellenreiter : public WellenreiterBase { |
35 | Q_OBJECT | 38 | Q_OBJECT |
36 | 39 | ||
37 | public: | 40 | public: |
38 | Wellenreiter( QWidget* parent = 0 ); | 41 | Wellenreiter( QWidget* parent = 0 ); |
39 | ~Wellenreiter(); | 42 | ~Wellenreiter(); |
40 | 43 | ||
41 | void setConfigWindow( WellenreiterConfigWindow* cw ); | 44 | void setConfigWindow( WellenreiterConfigWindow* cw ); |
42 | MScanListView* netView() const { return netview; }; | 45 | MScanListView* netView() const { return netview; }; |
43 | MLogWindow* logWindow() const { return logwindow; }; | 46 | MLogWindow* logWindow() const { return logwindow; }; |
47 | MHexWindow* hexWindow() const { return hexwindow; }; | ||
44 | bool isDaemonRunning() const { return sniffing; }; | 48 | bool isDaemonRunning() const { return sniffing; }; |
45 | 49 | ||
46 | public slots: | 50 | public slots: |
47 | void receivePacket(OPacket*); | 51 | void receivePacket(OPacket*); |
48 | void startStopClicked(); | 52 | void startStopClicked(); |
49 | 53 | ||
50 | private: | 54 | private: |
51 | #ifdef QWS | 55 | #ifdef QWS |
52 | OSystem _system; // Opie Operating System identifier | 56 | OSystem _system; // Opie Operating System identifier |
53 | #endif | 57 | #endif |
54 | 58 | ||
55 | bool sniffing; | 59 | bool sniffing; |
56 | OWirelessNetworkInterface* iface; | 60 | OWirelessNetworkInterface* iface; |
57 | OPacketCapturer* pcap; | 61 | OPacketCapturer* pcap; |
58 | ManufacturerDB* manufacturerdb; | 62 | ManufacturerDB* manufacturerdb; |
59 | WellenreiterConfigWindow* configwindow; | 63 | WellenreiterConfigWindow* configwindow; |
60 | 64 | ||
61 | //void readConfig(); | 65 | //void readConfig(); |
62 | //void writeConfig(); | 66 | //void writeConfig(); |
63 | }; | 67 | }; |
64 | 68 | ||
65 | 69 | ||
66 | 70 | ||
67 | #endif | 71 | #endif |