Diffstat (limited to 'noncore/net/wellenreiter/gui/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/wellenreiter/gui/mainwindow.cpp | 30 |
1 files changed, 15 insertions, 15 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 | |||
@@ -26,13 +26,13 @@ | |||
26 | #include <qpe/resource.h> | 26 | #include <qpe/resource.h> |
27 | #include <opie2/odebug.h> | 27 | #include <opie2/odebug.h> |
28 | #include <opie2/ofiledialog.h> | 28 | #include <opie2/ofiledialog.h> |
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; |
36 | using namespace Opie::Ui; | 36 | using namespace Opie::Ui; |
37 | 37 | ||
38 | /* QT */ | 38 | /* QT */ |
@@ -186,13 +186,13 @@ WellenreiterMainWindow::WellenreiterMainWindow( QWidget * parent, const char * n | |||
186 | }; | 186 | }; |
187 | 187 | ||
188 | 188 | ||
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 | ||
196 | if ( result ) updateToolButtonState(); | 196 | if ( result ) updateToolButtonState(); |
197 | } | 197 | } |
198 | 198 | ||
@@ -219,23 +219,23 @@ void WellenreiterMainWindow::changedSniffingState() | |||
219 | { | 219 | { |
220 | startButton->setEnabled( !mw->sniffing ); | 220 | startButton->setEnabled( !mw->sniffing ); |
221 | menuBar()->setItemEnabled( startID, !mw->sniffing ); | 221 | menuBar()->setItemEnabled( startID, !mw->sniffing ); |
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 ); |
229 | } | 229 | } |
230 | } | 230 | } |
231 | 231 | ||
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 | ||
239 | void WellenreiterMainWindow::demoAddStations() | 239 | void WellenreiterMainWindow::demoAddStations() |
240 | { | 240 | { |
241 | //mw = 0; // test SIGSEGV handling | 241 | //mw = 0; // test SIGSEGV handling |
@@ -249,13 +249,13 @@ void WellenreiterMainWindow::demoAddStations() | |||
249 | 249 | ||
250 | 250 | ||
251 | void WellenreiterMainWindow::demoReadFromGps() | 251 | 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() ) ); |
259 | delete gps; | 259 | delete gps; |
260 | } | 260 | } |
261 | 261 | ||
@@ -303,17 +303,17 @@ void WellenreiterMainWindow::fileSaveLog() | |||
303 | QFile f( fname ); | 303 | QFile f( fname ); |
304 | if ( f.open(IO_WriteOnly) ) | 304 | if ( f.open(IO_WriteOnly) ) |
305 | { | 305 | { |
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 | } |
317 | 317 | ||
318 | void WellenreiterMainWindow::fileSaveSession() | 318 | void WellenreiterMainWindow::fileSaveSession() |
319 | { | 319 | { |
@@ -324,17 +324,17 @@ void WellenreiterMainWindow::fileSaveSession() | |||
324 | QFile f( fname ); | 324 | QFile f( fname ); |
325 | if ( f.open(IO_WriteOnly) ) | 325 | if ( f.open(IO_WriteOnly) ) |
326 | { | 326 | { |
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 | } |
338 | 338 | ||
339 | void WellenreiterMainWindow::fileSaveHex() | 339 | void WellenreiterMainWindow::fileSaveHex() |
340 | { | 340 | { |
@@ -346,17 +346,17 @@ void WellenreiterMainWindow::fileSaveHex() | |||
346 | QFile f( fname ); | 346 | QFile f( fname ); |
347 | if ( f.open(IO_WriteOnly) ) | 347 | if ( f.open(IO_WriteOnly) ) |
348 | { | 348 | { |
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 | */ |
360 | } | 360 | } |
361 | 361 | ||
362 | void WellenreiterMainWindow::fileLoadSession() | 362 | void WellenreiterMainWindow::fileLoadSession() |
@@ -367,17 +367,17 @@ void WellenreiterMainWindow::fileLoadSession() | |||
367 | QFile f( fname ); | 367 | QFile f( fname ); |
368 | if ( f.open(IO_ReadOnly) ) | 368 | if ( f.open(IO_ReadOnly) ) |
369 | { | 369 | { |
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 | } |
381 | 381 | ||
382 | 382 | ||
383 | void WellenreiterMainWindow::fileNew() | 383 | void WellenreiterMainWindow::fileNew() |
@@ -436,17 +436,17 @@ void WellenreiterMainWindow::uploadSession() | |||
436 | connect( accept, SIGNAL( clicked() ), d, SLOT( accept() ) ); | 436 | connect( accept, SIGNAL( clicked() ), d, SLOT( accept() ) ); |
437 | connect( reject, SIGNAL( clicked() ), d, SLOT( reject() ) ); | 437 | connect( reject, SIGNAL( clicked() ), d, SLOT( reject() ) ); |
438 | int result = d->exec(); | 438 | int result = d->exec(); |
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; |
450 | int sock = -1; | 450 | int sock = -1; |
451 | bool ok = false; | 451 | bool ok = false; |
452 | 452 | ||