Diffstat (limited to 'noncore/net/wellenreiter/gui/configwindow.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/wellenreiter/gui/configwindow.cpp | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/noncore/net/wellenreiter/gui/configwindow.cpp b/noncore/net/wellenreiter/gui/configwindow.cpp index da39113..bfdb20a 100644 --- a/noncore/net/wellenreiter/gui/configwindow.cpp +++ b/noncore/net/wellenreiter/gui/configwindow.cpp | |||
@@ -22,9 +22,11 @@ | |||
22 | #ifdef QWS | 22 | #ifdef QWS |
23 | #include <opie2/oapplication.h> | 23 | #include <opie2/oapplication.h> |
24 | #include <opie2/oconfig.h> | 24 | #include <opie2/oconfig.h> |
25 | #include <opie2/odevice.h> | 25 | #include <opie2/odevice.h> |
26 | using namespace Opie; | 26 | #include <opie2/odebug.h> |
27 | using namespace Opie::Core; | ||
28 | using namespace Opie::Net; | ||
27 | #endif | 29 | #endif |
28 | 30 | ||
29 | /* QT */ | 31 | /* QT */ |
30 | #include <qapplication.h> | 32 | #include <qapplication.h> |
@@ -39,17 +41,11 @@ using namespace Opie; | |||
39 | #include <qtoolbutton.h> | 41 | #include <qtoolbutton.h> |
40 | #include <qspinbox.h> | 42 | #include <qspinbox.h> |
41 | #include <qtextstream.h> | 43 | #include <qtextstream.h> |
42 | 44 | ||
43 | /* POSIX */ | 45 | /* STD */ |
44 | #include <assert.h> | 46 | #include <assert.h> |
45 | 47 | ||
46 | using namespace Opie::Core; | ||
47 | using namespace Opie::Net; | ||
48 | using namespace Opie::Core; | ||
49 | using namespace Opie::Net; | ||
50 | using namespace Opie::Core; | ||
51 | using namespace Opie::Net; | ||
52 | WellenreiterConfigWindow* WellenreiterConfigWindow::_instance = 0; | 48 | WellenreiterConfigWindow* WellenreiterConfigWindow::_instance = 0; |
53 | 49 | ||
54 | WellenreiterConfigWindow::WellenreiterConfigWindow( QWidget * parent, const char * name, WFlags f ) | 50 | WellenreiterConfigWindow::WellenreiterConfigWindow( QWidget * parent, const char * name, WFlags f ) |
55 | :WellenreiterConfigBase( parent, name, true, f ) | 51 | :WellenreiterConfigBase( parent, name, true, f ) |
@@ -115,9 +111,9 @@ void WellenreiterConfigWindow::performAutodetection() | |||
115 | //TODO: insert modal splash screen here | 111 | //TODO: insert modal splash screen here |
116 | // and sleep a second, so that it looks | 112 | // and sleep a second, so that it looks |
117 | // like we're actually doing something fancy... ;-) | 113 | // like we're actually doing something fancy... ;-) |
118 | 114 | ||
119 | qDebug( "WellenreiterConfigWindow::performAutodetection()" ); | 115 | odebug << "WellenreiterConfigWindow::performAutodetection()" << oendl; |
120 | 116 | ||
121 | // try to guess device type | 117 | // try to guess device type |
122 | QFile m( "/proc/modules" ); | 118 | QFile m( "/proc/modules" ); |
123 | if ( m.open( IO_ReadOnly ) ) | 119 | if ( m.open( IO_ReadOnly ) ) |
@@ -136,9 +132,9 @@ void WellenreiterConfigWindow::performAutodetection() | |||
136 | if ( devicetype ) | 132 | if ( devicetype ) |
137 | { | 133 | { |
138 | deviceType->setCurrentItem( devicetype ); | 134 | deviceType->setCurrentItem( devicetype ); |
139 | _guess = devicetype; | 135 | _guess = devicetype; |
140 | qDebug( "Wellenreiter: guessed device type to be #%d", devicetype ); | 136 | odebug << "Wellenreiter: guessed device type to be #" << devicetype << "" << oendl; |
141 | } | 137 | } |
142 | } | 138 | } |
143 | } | 139 | } |
144 | 140 | ||
@@ -240,9 +236,9 @@ void WellenreiterConfigWindow::changedStationAction(int t) | |||
240 | 236 | ||
241 | void WellenreiterConfigWindow::getCaptureFileNameClicked() | 237 | void WellenreiterConfigWindow::getCaptureFileNameClicked() |
242 | { | 238 | { |
243 | QString name = ( (WellenreiterMainWindow*) qApp->mainWidget() )->getFileName(true); | 239 | QString name = ( (WellenreiterMainWindow*) qApp->mainWidget() )->getFileName(true); |
244 | qDebug( "name = %s", (const char*) name ); | 240 | odebug << "name = " << (const char*) name << "" << oendl; |
245 | if ( !name.isEmpty() ) | 241 | if ( !name.isEmpty() ) |
246 | { | 242 | { |
247 | captureFileName->setText( name ); | 243 | captureFileName->setText( name ); |
248 | } | 244 | } |
@@ -315,13 +311,13 @@ void WellenreiterConfigWindow::performAction( const QString& type, | |||
315 | script = newStationScript->text(); | 311 | script = newStationScript->text(); |
316 | } | 312 | } |
317 | else | 313 | else |
318 | { | 314 | { |
319 | qWarning( "WellenreiterConfigWindow::performAction(): unknown type '%s'", (const char*) type ); | 315 | owarn << "WellenreiterConfigWindow::performAction(): unknown type '" << (const char*) type << "'" << oendl; |
320 | return; | 316 | return; |
321 | } | 317 | } |
322 | 318 | ||
323 | qDebug( "for event '%s' I'm going to perform action %d (script='%s')", (const char*) type, action, (const char*) script ); | 319 | odebug << "for event '" << (const char*) type << "' I'm going to perform action " << action << " (script='" << (const char*) script << "')" << oendl; |
324 | 320 | ||
325 | switch( action ) | 321 | switch( action ) |
326 | { | 322 | { |
327 | case 0: /* Ignore */ return; | 323 | case 0: /* Ignore */ return; |
@@ -344,11 +340,11 @@ void WellenreiterConfigWindow::performAction( const QString& type, | |||
344 | script = script.replace( QRegExp( "$MAC" ), mac ); | 340 | script = script.replace( QRegExp( "$MAC" ), mac ); |
345 | script = script.replace( QRegExp( "$WEP" ), wep ? QString( "true" ) : QString( "false" ) ); | 341 | script = script.replace( QRegExp( "$WEP" ), wep ? QString( "true" ) : QString( "false" ) ); |
346 | script = script.replace( QRegExp( "$CHAN" ), QString::number( channel ) ); | 342 | script = script.replace( QRegExp( "$CHAN" ), QString::number( channel ) ); |
347 | 343 | ||
348 | qDebug( "going to call script '%s'", (const char*) script ); | 344 | odebug << "going to call script '" << (const char*) script << "'" << oendl; |
349 | ::system( script ); | 345 | ::system( script ); |
350 | qDebug( "script returned." ); | 346 | odebug << "script returned." << oendl; |
351 | return; | 347 | return; |
352 | } | 348 | } |
353 | default: assert( false ); | 349 | default: assert( false ); |
354 | } | 350 | } |
@@ -360,9 +356,9 @@ void WellenreiterConfigWindow::load() | |||
360 | #ifdef Q_WS_X11 | 356 | #ifdef Q_WS_X11 |
361 | #warning Persistent Configuration not yet implemented for standalone X11 build | 357 | #warning Persistent Configuration not yet implemented for standalone X11 build |
362 | performAutodetection(); | 358 | performAutodetection(); |
363 | #else | 359 | #else |
364 | qDebug( "loading configuration settings..." ); | 360 | odebug << "loading configuration settings..." << oendl; |
365 | 361 | ||
366 | /* This is dumb monkey typing stuff... We _need_ to do this automatically! */ | 362 | /* This is dumb monkey typing stuff... We _need_ to do this automatically! */ |
367 | 363 | ||
368 | OConfig* c = oApp->config(); | 364 | OConfig* c = oApp->config(); |
@@ -438,9 +434,9 @@ void WellenreiterConfigWindow::save() | |||
438 | { | 434 | { |
439 | #ifdef Q_WS_X11 | 435 | #ifdef Q_WS_X11 |
440 | #warning Persistent Configuration not yet implemented for standalone X11 build | 436 | #warning Persistent Configuration not yet implemented for standalone X11 build |
441 | #else | 437 | #else |
442 | qDebug( "saving configuration settings..." ); | 438 | odebug << "saving configuration settings..." << oendl; |
443 | 439 | ||
444 | /* This is dumb monkey typing stuff... We _need_ to do this automatically! */ | 440 | /* This is dumb monkey typing stuff... We _need_ to do this automatically! */ |
445 | 441 | ||
446 | OConfig* c = oApp->config(); | 442 | OConfig* c = oApp->config(); |