summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/net/wellenreiter/gui/mainwindow.cpp2
-rw-r--r--noncore/net/wellenreiter/gui/wellenreiter.cpp10
-rw-r--r--noncore/net/wellenreiter/gui/wellenreiter.h2
3 files changed, 7 insertions, 7 deletions
diff --git a/noncore/net/wellenreiter/gui/mainwindow.cpp b/noncore/net/wellenreiter/gui/mainwindow.cpp
index 8525109..ef7ffcf 100644
--- a/noncore/net/wellenreiter/gui/mainwindow.cpp
+++ b/noncore/net/wellenreiter/gui/mainwindow.cpp
@@ -217,17 +217,17 @@ void WellenreiterMainWindow::updateToolButtonState()
void WellenreiterMainWindow::changedSniffingState()
{
startButton->setEnabled( !mw->sniffing );
menuBar()->setItemEnabled( startID, !mw->sniffing );
stopButton->setEnabled( mw->sniffing );
menuBar()->setItemEnabled( stopID, mw->sniffing );
- if ( !mw->sniffing )
+ if ( !mw->sniffing && QFile::exists( mw->dumpname ) )
{
menuBar()->setItemEnabled( uploadID, true );
uploadButton->setEnabled( true );
}
}
WellenreiterMainWindow::~WellenreiterMainWindow()
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.cpp b/noncore/net/wellenreiter/gui/wellenreiter.cpp
index fe8f22d..2f85790 100644
--- a/noncore/net/wellenreiter/gui/wellenreiter.cpp
+++ b/noncore/net/wellenreiter/gui/wellenreiter.cpp
@@ -108,16 +108,17 @@ void Wellenreiter::initialTimer()
}
void Wellenreiter::signalHandler( int sig )
{
oerr << "Aye! Received SIGSEGV or SIGBUS! Trying to exit gracefully..." << oendl;
if ( Wellenreiter::instance->sniffing )
{
+ Wellenreiter::instance->pcap->closeDumpFile();
Wellenreiter::instance->pcap->close();
Wellenreiter::instance->stopClicked();
}
oerr << "Phew. Seemed to work." << oendl;
::exit( -1 );
}
@@ -617,28 +618,27 @@ void Wellenreiter::startClicked()
if ( configwindow->writeCaptureFile->isChecked() ) // write to a user specified capture file?
{
dumpname = configwindow->captureFileName->text();
if ( dumpname.isEmpty() ) dumpname = "captureFile";
dumpname.append( '-' );
dumpname.append( QTime::currentTime().toString().replace( QRegExp( ":" ), "-" ) );
dumpname.append( ".wellenreiter" );
}
- else // write it anyway ;)
- {
- dumpname = "/var/log/dump.wellenreiter";
- }
if ( cardtype != DEVTYPE_FILE )
pcap->open( interface );
else
pcap->openCaptureFile( interface );
- odebug << "Wellenreiter:: dumping to " << dumpname << "" << oendl;
+ if ( configwindow->writeCaptureFile->isChecked() )
+ {
+ odebug << "Wellenreiter:: dumping to " << dumpname << oendl;
pcap->openDumpFile( dumpname );
+ }
if ( !pcap->isOpen() )
{
QMessageBox::warning( this, "Wellenreiter II", tr( "Can't open packet capturer for\n'%1':\n" ).arg(
cardtype == DEVTYPE_FILE ? (const char*) interface : iface->name() ) + QString(strerror( errno ) ));
return;
}
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.h b/noncore/net/wellenreiter/gui/wellenreiter.h
index 32e5690..f582a5f 100644
--- a/noncore/net/wellenreiter/gui/wellenreiter.h
+++ b/noncore/net/wellenreiter/gui/wellenreiter.h
@@ -50,16 +50,17 @@ class Wellenreiter : public WellenreiterBase {
void setConfigWindow( WellenreiterConfigWindow* cw );
MScanListView* netView() const { return netview; };
MLogWindow* logWindow() const { return logwindow; };
PacketView* hexWindow() const { return hexwindow; };
bool isDaemonRunning() const { return sniffing; };
QString captureFileName() const { return dumpname; };
public:
+ QString dumpname;
bool sniffing;
static Wellenreiter* instance;
static void signalHandler( int sig );
protected:
virtual void timerEvent( QTimerEvent* );
public slots:
@@ -92,17 +93,16 @@ class Wellenreiter : public WellenreiterBase {
bool checkDumpPacket( Opie::Net::OPacket* p );
void registerSignalHandler();
private:
#ifdef QWS
Opie::Core::OSystem _system; // Opie Operating System identifier
#endif
- QString dumpname;
Opie::Net::OWirelessNetworkInterface* iface;
Opie::Net::OPacketCapturer* pcap;
WellenreiterConfigWindow* configwindow;
GPS* gps;
//void readConfig();
//void writeConfig();
};