author | mickeyl <mickeyl> | 2004-05-03 13:50:22 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2004-05-03 13:50:22 (UTC) |
commit | aad04cffe30ef133edcd5051ce7e486f27599d83 (patch) (unidiff) | |
tree | 830ccec1732ae743073511268c7bb67764c4fb6b | |
parent | 9efa98c49988a41de7613f56818f2e31bb24e22b (diff) | |
download | opie-aad04cffe30ef133edcd5051ce7e486f27599d83.zip opie-aad04cffe30ef133edcd5051ce7e486f27599d83.tar.gz opie-aad04cffe30ef133edcd5051ce7e486f27599d83.tar.bz2 |
don't always write a capture file
-rw-r--r-- | noncore/net/wellenreiter/gui/mainwindow.cpp | 2 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiter.cpp | 10 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiter.h | 2 |
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 | |||
@@ -222,7 +222,7 @@ void WellenreiterMainWindow::changedSniffingState() | |||
222 | stopButton->setEnabled( mw->sniffing ); | 222 | stopButton->setEnabled( mw->sniffing ); |
223 | menuBar()->setItemEnabled( stopID, mw->sniffing ); | 223 | menuBar()->setItemEnabled( stopID, mw->sniffing ); |
224 | 224 | ||
225 | if ( !mw->sniffing ) | 225 | if ( !mw->sniffing && QFile::exists( mw->dumpname ) ) |
226 | { | 226 | { |
227 | menuBar()->setItemEnabled( uploadID, true ); | 227 | menuBar()->setItemEnabled( uploadID, true ); |
228 | uploadButton->setEnabled( true ); | 228 | uploadButton->setEnabled( true ); |
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 | |||
@@ -113,6 +113,7 @@ void Wellenreiter::signalHandler( int sig ) | |||
113 | oerr << "Aye! Received SIGSEGV or SIGBUS! Trying to exit gracefully..." << oendl; | 113 | oerr << "Aye! Received SIGSEGV or SIGBUS! Trying to exit gracefully..." << oendl; |
114 | if ( Wellenreiter::instance->sniffing ) | 114 | if ( Wellenreiter::instance->sniffing ) |
115 | { | 115 | { |
116 | Wellenreiter::instance->pcap->closeDumpFile(); | ||
116 | Wellenreiter::instance->pcap->close(); | 117 | Wellenreiter::instance->pcap->close(); |
117 | Wellenreiter::instance->stopClicked(); | 118 | Wellenreiter::instance->stopClicked(); |
118 | } | 119 | } |
@@ -622,18 +623,17 @@ void Wellenreiter::startClicked() | |||
622 | dumpname.append( QTime::currentTime().toString().replace( QRegExp( ":" ), "-" ) ); | 623 | dumpname.append( QTime::currentTime().toString().replace( QRegExp( ":" ), "-" ) ); |
623 | dumpname.append( ".wellenreiter" ); | 624 | dumpname.append( ".wellenreiter" ); |
624 | } | 625 | } |
625 | else // write it anyway ;) | ||
626 | { | ||
627 | dumpname = "/var/log/dump.wellenreiter"; | ||
628 | } | ||
629 | 626 | ||
630 | if ( cardtype != DEVTYPE_FILE ) | 627 | if ( cardtype != DEVTYPE_FILE ) |
631 | pcap->open( interface ); | 628 | pcap->open( interface ); |
632 | else | 629 | else |
633 | pcap->openCaptureFile( interface ); | 630 | pcap->openCaptureFile( interface ); |
634 | 631 | ||
635 | odebug << "Wellenreiter:: dumping to " << dumpname << "" << oendl; | 632 | if ( configwindow->writeCaptureFile->isChecked() ) |
633 | { | ||
634 | odebug << "Wellenreiter:: dumping to " << dumpname << oendl; | ||
636 | pcap->openDumpFile( dumpname ); | 635 | pcap->openDumpFile( dumpname ); |
636 | } | ||
637 | 637 | ||
638 | if ( !pcap->isOpen() ) | 638 | if ( !pcap->isOpen() ) |
639 | { | 639 | { |
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 | |||
@@ -55,6 +55,7 @@ class Wellenreiter : public WellenreiterBase { | |||
55 | QString captureFileName() const { return dumpname; }; | 55 | QString captureFileName() const { return dumpname; }; |
56 | 56 | ||
57 | public: | 57 | public: |
58 | QString dumpname; | ||
58 | bool sniffing; | 59 | bool sniffing; |
59 | static Wellenreiter* instance; | 60 | static Wellenreiter* instance; |
60 | static void signalHandler( int sig ); | 61 | static void signalHandler( int sig ); |
@@ -97,7 +98,6 @@ class Wellenreiter : public WellenreiterBase { | |||
97 | Opie::Core::OSystem _system; // Opie Operating System identifier | 98 | Opie::Core::OSystem _system; // Opie Operating System identifier |
98 | #endif | 99 | #endif |
99 | 100 | ||
100 | QString dumpname; | ||
101 | Opie::Net::OWirelessNetworkInterface* iface; | 101 | Opie::Net::OWirelessNetworkInterface* iface; |
102 | Opie::Net::OPacketCapturer* pcap; | 102 | Opie::Net::OPacketCapturer* pcap; |
103 | WellenreiterConfigWindow* configwindow; | 103 | WellenreiterConfigWindow* configwindow; |