Diffstat (limited to 'noncore/net/wellenreiter/gui/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/wellenreiter/gui/mainwindow.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/noncore/net/wellenreiter/gui/mainwindow.cpp b/noncore/net/wellenreiter/gui/mainwindow.cpp index a4b8839..8525109 100644 --- a/noncore/net/wellenreiter/gui/mainwindow.cpp +++ b/noncore/net/wellenreiter/gui/mainwindow.cpp | |||
@@ -243,25 +243,25 @@ void WellenreiterMainWindow::demoAddStations() | |||
243 | mw->netView()->addNewItem( "managed", "Vanille", OMacAddress::fromString("00:00:20:EF:A6:43"), true, 6, 80, GpsLocation( 39.8794, -94.0936) ); | 243 | mw->netView()->addNewItem( "managed", "Vanille", OMacAddress::fromString("00:00:20:EF:A6:43"), true, 6, 80, GpsLocation( 39.8794, -94.0936) ); |
244 | mw->netView()->addNewItem( "managed", "Vanille", OMacAddress::fromString("00:30:6D:EF:A6:23"), true, 11, 10, GpsLocation( 0.0, 0.0 ) ); | 244 | mw->netView()->addNewItem( "managed", "Vanille", OMacAddress::fromString("00:30:6D:EF:A6:23"), true, 11, 10, GpsLocation( 0.0, 0.0 ) ); |
245 | mw->netView()->addNewItem( "adhoc", "ELAN", OMacAddress::fromString("00:03:F8:E7:16:22"), false, 3, 10, GpsLocation( 5.5, 2.3 ) ); | 245 | mw->netView()->addNewItem( "adhoc", "ELAN", OMacAddress::fromString("00:03:F8:E7:16:22"), false, 3, 10, GpsLocation( 5.5, 2.3 ) ); |
246 | mw->netView()->addNewItem( "adhoc", "ELAN", OMacAddress::fromString("00:04:01:E7:56:62"), false, 3, 15, GpsLocation( 2.3, 5.5 ) ); | 246 | mw->netView()->addNewItem( "adhoc", "ELAN", OMacAddress::fromString("00:04:01:E7:56:62"), false, 3, 15, GpsLocation( 2.3, 5.5 ) ); |
247 | mw->netView()->addNewItem( "adhoc", "ELAN", OMacAddress::fromString("00:05:8E:E7:56:E2"), false, 3, 20, GpsLocation( -10.0, -20.5 ) ); | 247 | mw->netView()->addNewItem( "adhoc", "ELAN", OMacAddress::fromString("00:05:8E:E7:56:E2"), false, 3, 20, GpsLocation( -10.0, -20.5 ) ); |
248 | } | 248 | } |
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://" << (const char*) 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 | ||
262 | 262 | ||
263 | QString WellenreiterMainWindow::getFileName( bool save ) | 263 | QString WellenreiterMainWindow::getFileName( bool save ) |
264 | { | 264 | { |
265 | QMap<QString, QStringList> map; | 265 | QMap<QString, QStringList> map; |
266 | map.insert( tr("All"), QStringList() ); | 266 | map.insert( tr("All"), QStringList() ); |
267 | QStringList text; | 267 | QStringList text; |
@@ -297,93 +297,93 @@ QString WellenreiterMainWindow::getFileName( bool save ) | |||
297 | 297 | ||
298 | void WellenreiterMainWindow::fileSaveLog() | 298 | void WellenreiterMainWindow::fileSaveLog() |
299 | { | 299 | { |
300 | QString fname = getFileName( true ); | 300 | QString fname = getFileName( true ); |
301 | if ( !fname.isEmpty() ) | 301 | if ( !fname.isEmpty() ) |
302 | { | 302 | { |
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 '" << (const char*) 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 '" << (const char*) 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 | { |
320 | QString fname = getFileName( true ); | 320 | QString fname = getFileName( true ); |
321 | if ( !fname.isEmpty() ) | 321 | if ( !fname.isEmpty() ) |
322 | { | 322 | { |
323 | 323 | ||
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 '" << (const char*) 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 '" << (const char*) 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 | { |
341 | #warning DOES NOT WORK AT THE MOMENT | 341 | #warning DOES NOT WORK AT THE MOMENT |
342 | /* | 342 | /* |
343 | QString fname = getFileName( true ); | 343 | QString fname = getFileName( true ); |
344 | if ( !fname.isEmpty() ) | 344 | if ( !fname.isEmpty() ) |
345 | { | 345 | { |
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 '" << (const char*) 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 '" << (const char*) 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() |
363 | { | 363 | { |
364 | QString fname = getFileName( false ); | 364 | QString fname = getFileName( false ); |
365 | if ( !fname.isEmpty() ) | 365 | if ( !fname.isEmpty() ) |
366 | { | 366 | { |
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 '" << (const char*) 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 '" << (const char*) 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() |
384 | { | 384 | { |
385 | mw->netView()->clear(); | 385 | mw->netView()->clear(); |
386 | mw->logWindow()->clear(); | 386 | mw->logWindow()->clear(); |
387 | mw->hexWindow()->clear(); | 387 | mw->hexWindow()->clear(); |
388 | } | 388 | } |
389 | 389 | ||