-rw-r--r-- | noncore/net/wellenreiter/gui/mainwindow.cpp | 30 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiter.cpp | 12 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiter.h | 2 |
3 files changed, 22 insertions, 22 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 | |||
@@ -29,7 +29,7 @@ | |||
29 | #else | 29 | #else |
30 | #include "resource.h" | 30 | #include "resource.h" |
31 | #include <qapplication.h> | 31 | #include <qapplication.h> |
32 | #include <qfiledialog.h> | 32 | #include <qfiledialog.h> |
33 | #endif | 33 | #endif |
34 | using namespace Opie::Core; | 34 | using namespace Opie::Core; |
35 | using namespace Opie::Net; | 35 | using namespace Opie::Net; |
@@ -189,7 +189,7 @@ WellenreiterMainWindow::WellenreiterMainWindow( QWidget * parent, const char * n | |||
189 | 189 | ||
190 | void WellenreiterMainWindow::showConfigure() | 190 | void WellenreiterMainWindow::showConfigure() |
191 | { | 191 | { |
192 | odebug << "show configure..." << oendl; | 192 | odebug << "show configure..." << oendl; |
193 | cw->setCaption( tr( "Configure" ) ); | 193 | cw->setCaption( tr( "Configure" ) ); |
194 | int result = QPEApplication::execDialog( cw ); | 194 | int result = QPEApplication::execDialog( cw ); |
195 | 195 | ||
@@ -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 ); |
@@ -232,7 +232,7 @@ void WellenreiterMainWindow::changedSniffingState() | |||
232 | 232 | ||
233 | WellenreiterMainWindow::~WellenreiterMainWindow() | 233 | WellenreiterMainWindow::~WellenreiterMainWindow() |
234 | { | 234 | { |
235 | odebug << "Wellenreiter: bye." << oendl; | 235 | odebug << "Wellenreiter: bye." << oendl; |
236 | }; | 236 | }; |
237 | 237 | ||
238 | 238 | ||
@@ -252,7 +252,7 @@ void WellenreiterMainWindow::demoReadFromGps() | |||
252 | { | 252 | { |
253 | WellenreiterConfigWindow* configwindow = WellenreiterConfigWindow::instance(); | 253 | WellenreiterConfigWindow* configwindow = WellenreiterConfigWindow::instance(); |
254 | GPS* gps = new GPS( this ); | 254 | GPS* gps = new GPS( this ); |
255 | odebug << "Wellenreiter::demoReadFromGps(): url=gps://" << configwindow->gpsdHost->currentText() << ":" << configwindow->gpsdPort->value() << "/" << oendl; | 255 | odebug << "Wellenreiter::demoReadFromGps(): url=gps://" << configwindow->gpsdHost->currentText() << ":" << configwindow->gpsdPort->value() << "/" << oendl; |
256 | gps->open( configwindow->gpsdHost->currentText(), configwindow->gpsdPort->value() ); | 256 | gps->open( configwindow->gpsdHost->currentText(), configwindow->gpsdPort->value() ); |
257 | GpsLocation loc = gps->position(); | 257 | GpsLocation loc = gps->position(); |
258 | QMessageBox::information( this, "Wellenreiter/Opie", tr( "GPS said:\n%1" ).arg( loc.dmsPosition() ) ); | 258 | QMessageBox::information( this, "Wellenreiter/Opie", tr( "GPS said:\n%1" ).arg( loc.dmsPosition() ) ); |
@@ -306,11 +306,11 @@ void WellenreiterMainWindow::fileSaveLog() | |||
306 | QTextStream t( &f ); | 306 | QTextStream t( &f ); |
307 | t << mw->logWindow()->getLog(); | 307 | t << mw->logWindow()->getLog(); |
308 | f.close(); | 308 | f.close(); |
309 | odebug << "Saved log to file '" << fname << "'" << oendl; | 309 | odebug << "Saved log to file '" << fname << "'" << oendl; |
310 | } | 310 | } |
311 | else | 311 | else |
312 | { | 312 | { |
313 | odebug << "Problem saving log to file '" << fname << "'" << oendl; | 313 | odebug << "Problem saving log to file '" << fname << "'" << oendl; |
314 | } | 314 | } |
315 | } | 315 | } |
316 | } | 316 | } |
@@ -327,11 +327,11 @@ void WellenreiterMainWindow::fileSaveSession() | |||
327 | QDataStream t( &f ); | 327 | QDataStream t( &f ); |
328 | t << *mw->netView(); | 328 | t << *mw->netView(); |
329 | f.close(); | 329 | f.close(); |
330 | odebug << "Saved session to file '" << fname << "'" << oendl; | 330 | odebug << "Saved session to file '" << fname << "'" << oendl; |
331 | } | 331 | } |
332 | else | 332 | else |
333 | { | 333 | { |
334 | odebug << "Problem saving session to file '" << fname << "'" << oendl; | 334 | odebug << "Problem saving session to file '" << fname << "'" << oendl; |
335 | } | 335 | } |
336 | } | 336 | } |
337 | } | 337 | } |
@@ -349,11 +349,11 @@ void WellenreiterMainWindow::fileSaveHex() | |||
349 | QTextStream t( &f ); | 349 | QTextStream t( &f ); |
350 | t << mw->hexWindow()->getLog(); | 350 | t << mw->hexWindow()->getLog(); |
351 | f.close(); | 351 | f.close(); |
352 | odebug << "Saved hex log to file '" << fname << "'" << oendl; | 352 | odebug << "Saved hex log to file '" << fname << "'" << oendl; |
353 | } | 353 | } |
354 | else | 354 | else |
355 | { | 355 | { |
356 | odebug << "Problem saving hex log to file '" << fname << "'" << oendl; | 356 | odebug << "Problem saving hex log to file '" << fname << "'" << oendl; |
357 | } | 357 | } |
358 | } | 358 | } |
359 | */ | 359 | */ |
@@ -370,11 +370,11 @@ void WellenreiterMainWindow::fileLoadSession() | |||
370 | QDataStream t( &f ); | 370 | QDataStream t( &f ); |
371 | t >> *mw->netView(); | 371 | t >> *mw->netView(); |
372 | f.close(); | 372 | f.close(); |
373 | odebug << "Loaded session from file '" << fname << "'" << oendl; | 373 | odebug << "Loaded session from file '" << fname << "'" << oendl; |
374 | } | 374 | } |
375 | else | 375 | else |
376 | { | 376 | { |
377 | odebug << "Problem loading session from file '" << fname << "'" << oendl; | 377 | odebug << "Problem loading session from file '" << fname << "'" << oendl; |
378 | } | 378 | } |
379 | } | 379 | } |
380 | } | 380 | } |
@@ -439,11 +439,11 @@ void WellenreiterMainWindow::uploadSession() | |||
439 | 439 | ||
440 | if ( !result ) | 440 | if ( !result ) |
441 | { | 441 | { |
442 | odebug << "Session upload cancelled :(" << oendl; | 442 | odebug << "Session upload cancelled :(" << oendl; |
443 | return; | 443 | return; |
444 | } | 444 | } |
445 | 445 | ||
446 | odebug << "Starting upload..." << oendl; | 446 | odebug << "Starting upload..." << oendl; |
447 | 447 | ||
448 | struct sockaddr_in raddr; | 448 | struct sockaddr_in raddr; |
449 | struct hostent *rhost_info; | 449 | struct hostent *rhost_info; |
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() ) |
636 | pcap->openDumpFile( dumpname ); | 633 | { |
634 | odebug << "Wellenreiter:: dumping to " << dumpname << oendl; | ||
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; |