summaryrefslogtreecommitdiff
path: root/noncore/net/wellenreiter/gui/mainwindow.cpp
Unidiff
Diffstat (limited to 'noncore/net/wellenreiter/gui/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/wellenreiter/gui/mainwindow.cpp32
1 files changed, 25 insertions, 7 deletions
diff --git a/noncore/net/wellenreiter/gui/mainwindow.cpp b/noncore/net/wellenreiter/gui/mainwindow.cpp
index 95a8294..6f57a7f 100644
--- a/noncore/net/wellenreiter/gui/mainwindow.cpp
+++ b/noncore/net/wellenreiter/gui/mainwindow.cpp
@@ -1,7 +1,7 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2002 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 Opie Environment. 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
@@ -37,6 +37,7 @@
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 41
41#ifdef QWS 42#ifdef QWS
42#include <qpe/resource.h> 43#include <qpe/resource.h>
@@ -60,14 +61,15 @@ WellenreiterMainWindow::WellenreiterMainWindow( QWidget * parent, const char * n
60 61
61 // setup application icon 62 // setup application icon
62 63
63 #ifndef QWS
64 setIcon( Resource::loadPixmap( "wellenreiter/appicon-trans" ) ); 64 setIcon( Resource::loadPixmap( "wellenreiter/appicon-trans" ) );
65 #ifndef QWS
65 setIconText( "Wellenreiter/X11" ); 66 setIconText( "Wellenreiter/X11" );
66 #endif 67 #endif
67 68
68 // setup tool buttons 69 // setup tool buttons
69 70
70 startButton = new QToolButton( 0 ); 71 startButton = new QToolButton( 0 );
72 QWhatsThis::add( startButton, tr( "Click here to start scanning." ) );
71 #ifdef QWS 73 #ifdef QWS
72 startButton->setAutoRaise( true ); 74 startButton->setAutoRaise( true );
73 #endif 75 #endif
@@ -76,6 +78,7 @@ WellenreiterMainWindow::WellenreiterMainWindow( QWidget * parent, const char * n
76 connect( startButton, SIGNAL( clicked() ), mw, SLOT( startClicked() ) ); 78 connect( startButton, SIGNAL( clicked() ), mw, SLOT( startClicked() ) );
77 79
78 stopButton = new QToolButton( 0 ); 80 stopButton = new QToolButton( 0 );
81 QWhatsThis::add( stopButton, tr( "Click here to stop scanning." ) );
79 #ifdef QWS 82 #ifdef QWS
80 stopButton->setAutoRaise( true ); 83 stopButton->setAutoRaise( true );
81 #endif 84 #endif
@@ -84,6 +87,7 @@ WellenreiterMainWindow::WellenreiterMainWindow( QWidget * parent, const char * n
84 connect( stopButton, SIGNAL( clicked() ), mw, SLOT( stopClicked() ) ); 87 connect( stopButton, SIGNAL( clicked() ), mw, SLOT( stopClicked() ) );
85 88
86 QToolButton* d = new QToolButton( 0 ); 89 QToolButton* d = new QToolButton( 0 );
90 QWhatsThis::add( d, tr( "Click here to open the configure dialog." ) ),
87 #ifdef QWS 91 #ifdef QWS
88 d->setAutoRaise( true ); 92 d->setAutoRaise( true );
89 #endif 93 #endif
@@ -91,6 +95,7 @@ WellenreiterMainWindow::WellenreiterMainWindow( QWidget * parent, const char * n
91 connect( d, SIGNAL( clicked() ), this, SLOT( showConfigure() ) ); 95 connect( d, SIGNAL( clicked() ), this, SLOT( showConfigure() ) );
92 96
93 uploadButton = new QToolButton( 0 ); 97 uploadButton = new QToolButton( 0 );
98 QWhatsThis::add( uploadButton, tr( "Click here to upload a capture session." ) );
94 #ifdef QWS 99 #ifdef QWS
95 uploadButton->setAutoRaise( true ); 100 uploadButton->setAutoRaise( true );
96 #endif 101 #endif
@@ -123,9 +128,6 @@ WellenreiterMainWindow::WellenreiterMainWindow( QWidget * parent, const char * n
123 file->insertSeparator(); 128 file->insertSeparator();
124 file->insertItem( tr( "&Exit" ), qApp, SLOT( quit() ) ); 129 file->insertItem( tr( "&Exit" ), qApp, SLOT( quit() ) );
125 130
126 QPopupMenu* view = new QPopupMenu( mb );
127 view->insertItem( tr( "&Configure..." ) );
128
129 QPopupMenu* sniffer = new QPopupMenu( mb ); 131 QPopupMenu* sniffer = new QPopupMenu( mb );
130 sniffer->insertItem( tr( "&Configure..." ), this, SLOT( showConfigure() ) ); 132 sniffer->insertItem( tr( "&Configure..." ), this, SLOT( showConfigure() ) );
131 sniffer->insertSeparator(); 133 sniffer->insertSeparator();
@@ -134,13 +136,19 @@ WellenreiterMainWindow::WellenreiterMainWindow( QWidget * parent, const char * n
134 stopID = sniffer->insertItem( tr( "Sto&p" ), mw, SLOT( stopClicked() ) ); 136 stopID = sniffer->insertItem( tr( "Sto&p" ), mw, SLOT( stopClicked() ) );
135 sniffer->setItemEnabled( stopID, false ); 137 sniffer->setItemEnabled( stopID, false );
136 138
139 QPopupMenu* view = new QPopupMenu( mb );
140 view->insertItem( tr( "&Expand All" ), this, SLOT( viewExpandAll() ) );
141 view->insertItem( tr( "&Collapse All" ), this, SLOT( viewCollapseAll() ) );
142
137 QPopupMenu* demo = new QPopupMenu( mb ); 143 QPopupMenu* demo = new QPopupMenu( mb );
138 demo->insertItem( tr( "&Add something" ), this, SLOT( demoAddStations() ) ); 144 demo->insertItem( tr( "&Add something" ), this, SLOT( demoAddStations() ) );
139 //demo->insertItem( tr( "&Read from GPSd" ), this, SLOT( demoReadFromGps() ) ); 145 //demo->insertItem( tr( "&Read from GPSd" ), this, SLOT( demoReadFromGps() ) );
140 146
141 id = mb->insertItem( tr( "&File" ), file ); 147 id = mb->insertItem( tr( "&File" ), file );
142 //id = mb->insertItem( tr( "&View" ), view ); 148
149 id = mb->insertItem( tr( "&View" ), view );
143 //mb->setItemEnabled( id, false ); 150 //mb->setItemEnabled( id, false );
151
144 id = mb->insertItem( tr( "&Sniffer" ), sniffer ); 152 id = mb->insertItem( tr( "&Sniffer" ), sniffer );
145 153
146 id = mb->insertItem( tr( "&Demo" ), demo ); 154 id = mb->insertItem( tr( "&Demo" ), demo );
@@ -553,3 +561,13 @@ void WellenreiterMainWindow::uploadSession()
553 QString ( "<p>%1</p>" ).arg ( tr( "Connection to %1 failed" ) ).arg( CAP_hostname ) ); 561 QString ( "<p>%1</p>" ).arg ( tr( "Connection to %1 failed" ) ).arg( CAP_hostname ) );
554} 562}
555 563
564
565void WellenreiterMainWindow::viewExpandAll()
566{
567 mw->netView()->expand();
568}
569
570void WellenreiterMainWindow::viewCollapseAll()
571{
572 mw->netView()->collapse();
573}