summaryrefslogtreecommitdiff
path: root/noncore/net/wellenreiter/gui/mainwindow.cpp
Side-by-side diff
Diffstat (limited to 'noncore/net/wellenreiter/gui/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/wellenreiter/gui/mainwindow.cpp5
1 files changed, 5 insertions, 0 deletions
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
@@ -1,149 +1,154 @@
/**********************************************************************
** Copyright (C) 2002-2004 Michael 'Mickey' Lauer. All rights reserved.
**
** This file is part of Wellenreiter II.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
**********************************************************************/
#include "configwindow.h"
#include "gps.h"
#include "logwindow.h"
#include "packetview.h"
#include "mainwindow.h"
#include "wellenreiter.h"
#include "scanlist.h"
#include <qcombobox.h>
#include <qdatastream.h>
#include <qfile.h>
#include <qfileinfo.h>
#include <qlabel.h>
#include <qlayout.h>
#include <qlineedit.h>
#include <qiconset.h>
#include <qmenubar.h>
#include <qmessagebox.h>
#include <qpopupmenu.h>
#include <qpushbutton.h>
#include <qstatusbar.h>
#include <qspinbox.h>
#include <qtextstream.h>
#include <qtoolbutton.h>
#include <qwhatsthis.h>
#ifdef QWS
#include <qpe/resource.h>
#include <opie2/ofiledialog.h>
using namespace Opie;
#else
#include "resource.h"
#include <qapplication.h>
#include <qfiledialog.h>
#endif
#include <unistd.h>
+using namespace Opie::Ui;
+using namespace Opie::Net;
+using namespace Opie::Ui;
+using namespace Opie::Net;
+using namespace Opie::Net;
WellenreiterMainWindow::WellenreiterMainWindow( QWidget * parent, const char * name, WFlags f )
:QMainWindow( parent, name, f )
{
cw = new WellenreiterConfigWindow( this );
mw = new Wellenreiter( this );
mw->setConfigWindow( cw );
setCentralWidget( mw );
// setup application icon
setIcon( Resource::loadPixmap( "wellenreiter/appicon-trans" ) );
#ifndef QWS
setIconText( "Wellenreiter/X11" );
#endif
// setup tool buttons
startButton = new QToolButton( 0 );
QWhatsThis::add( startButton, tr( "Click here to start scanning." ) );
#ifdef QWS
startButton->setAutoRaise( true );
#endif
startButton->setIconSet( Resource::loadIconSet( "wellenreiter/SearchIcon" ) );
startButton->setEnabled( false );
connect( startButton, SIGNAL( clicked() ), mw, SLOT( startClicked() ) );
stopButton = new QToolButton( 0 );
QWhatsThis::add( stopButton, tr( "Click here to stop scanning." ) );
#ifdef QWS
stopButton->setAutoRaise( true );
#endif
stopButton->setIconSet( Resource::loadIconSet( "wellenreiter/CancelIcon" ) );
stopButton->setEnabled( false );
connect( stopButton, SIGNAL( clicked() ), mw, SLOT( stopClicked() ) );
QToolButton* d = new QToolButton( 0 );
QWhatsThis::add( d, tr( "Click here to open the configure dialog." ) ),
#ifdef QWS
d->setAutoRaise( true );
#endif
d->setIconSet( Resource::loadIconSet( "wellenreiter/SettingsIcon" ) );
connect( d, SIGNAL( clicked() ), this, SLOT( showConfigure() ) );
uploadButton = new QToolButton( 0 );
QWhatsThis::add( uploadButton, tr( "Click here to upload a capture session." ) );
#ifdef QWS
uploadButton->setAutoRaise( true );
#endif
uploadButton->setIconSet( Resource::loadIconSet( "up" ) );
uploadButton->setEnabled( false );
//uploadButton->setEnabled( true ); // DEBUGGING
connect( uploadButton, SIGNAL( clicked() ), this, SLOT( uploadSession() ) );
// setup menu bar
int id;
QMenuBar* mb = menuBar();
QPopupMenu* fileSave = new QPopupMenu( mb );
fileSave->insertItem( tr( "&Session..." ), this, SLOT( fileSaveSession() ) );
fileSave->insertItem( tr( "&Text Log..." ), this, SLOT( fileSaveLog() ) );
fileSave->insertItem( tr( "&Hex Log..." ), this, SLOT( fileSaveHex() ) );
QPopupMenu* fileLoad = new QPopupMenu( mb );
fileLoad->insertItem( tr( "&Session..." ), this, SLOT( fileLoadSession() ) );
//fileLoad->insertItem( "&Log", this, SLOT( fileLoadLog() ) );
QPopupMenu* file = new QPopupMenu( mb );
file->insertItem( tr( "&New" ), this, SLOT( fileNew() ) );
id = file->insertItem( tr( "&Load" ), fileLoad );
file->insertItem( tr( "&Save" ), fileSave );
file->insertSeparator();
uploadID = file->insertItem( tr( "&Upload Session" ), this, SLOT( uploadSession() ) );
file->insertSeparator();
file->insertItem( tr( "&Exit" ), qApp, SLOT( quit() ) );
QPopupMenu* sniffer = new QPopupMenu( mb );
sniffer->insertItem( tr( "&Configure..." ), this, SLOT( showConfigure() ) );
sniffer->insertSeparator();
startID = sniffer->insertItem( tr( "&Start" ), mw, SLOT( startClicked() ) );
sniffer->setItemEnabled( startID, false );
stopID = sniffer->insertItem( tr( "Sto&p" ), mw, SLOT( stopClicked() ) );
sniffer->setItemEnabled( stopID, false );
QPopupMenu* view = new QPopupMenu( mb );
view->insertItem( tr( "&Expand All" ), this, SLOT( viewExpandAll() ) );
view->insertItem( tr( "&Collapse All" ), this, SLOT( viewCollapseAll() ) );
QPopupMenu* demo = new QPopupMenu( mb );
demo->insertItem( tr( "&Add something" ), this, SLOT( demoAddStations() ) );
//demo->insertItem( tr( "&Read from GPSd" ), this, SLOT( demoReadFromGps() ) );
id = mb->insertItem( tr( "&File" ), file );
id = mb->insertItem( tr( "&View" ), view );