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.cpp10
1 files changed, 9 insertions, 1 deletions
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
@@ -6,27 +6,27 @@
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>
@@ -105,24 +105,25 @@ WellenreiterMainWindow::WellenreiterMainWindow( QWidget * parent, const char * n
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
@@ -290,24 +291,31 @@ void WellenreiterMainWindow::fileLoadSession()
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
303void WellenreiterMainWindow::fileNew()
304{
305 mw->netView()->clear();
306 mw->logWindow()->clear();
307 mw->hexWindow()->clear();
308}
309
302void WellenreiterMainWindow::closeEvent( QCloseEvent* e ) 310void 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}