-rw-r--r-- | noncore/net/wellenreiter/gui/configwindow.cpp | 2 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/scanlist.cpp | 1 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiter.cpp | 9 |
3 files changed, 10 insertions, 2 deletions
diff --git a/noncore/net/wellenreiter/gui/configwindow.cpp b/noncore/net/wellenreiter/gui/configwindow.cpp index 5bec7ed..11394d7 100644 --- a/noncore/net/wellenreiter/gui/configwindow.cpp +++ b/noncore/net/wellenreiter/gui/configwindow.cpp | |||
@@ -60,49 +60,49 @@ WellenreiterConfigWindow::WellenreiterConfigWindow( QWidget * parent, const char | |||
60 | if ( m.open( IO_ReadOnly ) ) | 60 | if ( m.open( IO_ReadOnly ) ) |
61 | { | 61 | { |
62 | int devicetype(0); | 62 | int devicetype(0); |
63 | QString line; | 63 | QString line; |
64 | QTextStream modules( &m ); | 64 | QTextStream modules( &m ); |
65 | while( !modules.atEnd() && !devicetype ) | 65 | while( !modules.atEnd() && !devicetype ) |
66 | { | 66 | { |
67 | modules >> line; | 67 | modules >> line; |
68 | if ( line.contains( "cisco" ) ) devicetype = DEVTYPE_CISCO; | 68 | if ( line.contains( "cisco" ) ) devicetype = DEVTYPE_CISCO; |
69 | else if ( line.contains( "hostap" ) ) devicetype = DEVTYPE_HOSTAP; | 69 | else if ( line.contains( "hostap" ) ) devicetype = DEVTYPE_HOSTAP; |
70 | else if ( line.contains( "prism" ) ) devicetype = DEVTYPE_WLAN_NG; | 70 | else if ( line.contains( "prism" ) ) devicetype = DEVTYPE_WLAN_NG; |
71 | else if ( line.contains( "orinoco" ) ) devicetype = DEVTYPE_ORINOCO; | 71 | else if ( line.contains( "orinoco" ) ) devicetype = DEVTYPE_ORINOCO; |
72 | } | 72 | } |
73 | if ( devicetype ) | 73 | if ( devicetype ) |
74 | { | 74 | { |
75 | deviceType->setCurrentItem( devicetype ); | 75 | deviceType->setCurrentItem( devicetype ); |
76 | _guess = devicetype; | 76 | _guess = devicetype; |
77 | qDebug( "Wellenreiter: guessed device type to be #%d", devicetype ); | 77 | qDebug( "Wellenreiter: guessed device type to be #%d", devicetype ); |
78 | } | 78 | } |
79 | } | 79 | } |
80 | 80 | ||
81 | #ifdef Q_WS_X11 // We're on X11: adding an Ok-Button for the Dialog here | 81 | #ifdef Q_WS_X11 // We're on X11: adding an Ok-Button for the Dialog here |
82 | QPushButton* okButton = new QPushButton( "ok", this ); | 82 | QPushButton* okButton = new QPushButton( "ok", this ); |
83 | okButton->show(); | 83 | okButton->show(); |
84 | Layout5_2->addWidget( okButton, 0, 3 ); //FIXME: rename this in configbase.ui | 84 | WellenreiterConfigBaseLayout->addWidget( okButton, 0, 3 ); //FIXME: rename this in configbase.ui |
85 | connect( okButton, SIGNAL( clicked() ), this, SLOT( accept() ) ); | 85 | connect( okButton, SIGNAL( clicked() ), this, SLOT( accept() ) ); |
86 | #endif | 86 | #endif |
87 | 87 | ||
88 | WellenreiterConfigWindow::_instance = this; | 88 | WellenreiterConfigWindow::_instance = this; |
89 | 89 | ||
90 | connect( deviceType, SIGNAL( activated(int) ), this, SLOT( changedDeviceType(int) ) ); | 90 | connect( deviceType, SIGNAL( activated(int) ), this, SLOT( changedDeviceType(int) ) ); |
91 | connect( getCaptureFileName, SIGNAL( clicked() ), this, SLOT( getCaptureFileNameClicked() ) ); | 91 | connect( getCaptureFileName, SIGNAL( clicked() ), this, SLOT( getCaptureFileNameClicked() ) ); |
92 | 92 | ||
93 | // make the checkbox 'channelAll' control all other channels | 93 | // make the checkbox 'channelAll' control all other channels |
94 | connect( channelAll, SIGNAL( stateChanged(int) ), this, SLOT( channelAllClicked(int) ) ); | 94 | connect( channelAll, SIGNAL( stateChanged(int) ), this, SLOT( channelAllClicked(int) ) ); |
95 | }; | 95 | }; |
96 | 96 | ||
97 | 97 | ||
98 | int WellenreiterConfigWindow::driverType() const | 98 | int WellenreiterConfigWindow::driverType() const |
99 | { | 99 | { |
100 | QString name = deviceType->currentText(); | 100 | QString name = deviceType->currentText(); |
101 | if ( _devicetype.contains( name ) ) | 101 | if ( _devicetype.contains( name ) ) |
102 | { | 102 | { |
103 | return _devicetype[name]; | 103 | return _devicetype[name]; |
104 | } | 104 | } |
105 | else | 105 | else |
106 | { | 106 | { |
107 | return 0; | 107 | return 0; |
108 | } | 108 | } |
diff --git a/noncore/net/wellenreiter/gui/scanlist.cpp b/noncore/net/wellenreiter/gui/scanlist.cpp index 085eec4..f4cfe52 100644 --- a/noncore/net/wellenreiter/gui/scanlist.cpp +++ b/noncore/net/wellenreiter/gui/scanlist.cpp | |||
@@ -1,44 +1,45 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. | 2 | ** Copyright (C) 2002 Michael 'Mickey' Lauer. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Opie Environment. | 4 | ** This file is part of Opie Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | **********************************************************************/ | 14 | **********************************************************************/ |
15 | 15 | ||
16 | #include "scanlist.h" | 16 | #include "scanlist.h" |
17 | #include "configwindow.h" | 17 | #include "configwindow.h" |
18 | #include "logwindow.h" | 18 | #include "logwindow.h" |
19 | 19 | ||
20 | #include <assert.h> | 20 | #include <assert.h> |
21 | #include <qcursor.h> | ||
21 | #include <qdatetime.h> | 22 | #include <qdatetime.h> |
22 | #include <qtextstream.h> | 23 | #include <qtextstream.h> |
23 | #include <qpopupmenu.h> | 24 | #include <qpopupmenu.h> |
24 | 25 | ||
25 | #ifdef QWS | 26 | #ifdef QWS |
26 | #include <qpe/qpeapplication.h> | 27 | #include <qpe/qpeapplication.h> |
27 | #include <opie/odevice.h> | 28 | #include <opie/odevice.h> |
28 | using namespace Opie; | 29 | using namespace Opie; |
29 | #endif | 30 | #endif |
30 | 31 | ||
31 | 32 | ||
32 | #ifdef QWS | 33 | #ifdef QWS |
33 | #include <qpe/resource.h> | 34 | #include <qpe/resource.h> |
34 | #else | 35 | #else |
35 | #include "resource.h" | 36 | #include "resource.h" |
36 | #endif | 37 | #endif |
37 | 38 | ||
38 | const int col_type = 0; | 39 | const int col_type = 0; |
39 | const int col_essid = 0; | 40 | const int col_essid = 0; |
40 | const int col_sig = 1; | 41 | const int col_sig = 1; |
41 | const int col_ap = 2; | 42 | const int col_ap = 2; |
42 | const int col_channel = 3; | 43 | const int col_channel = 3; |
43 | const int col_wep = 4; | 44 | const int col_wep = 4; |
44 | const int col_traffic = 5; | 45 | const int col_traffic = 5; |
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.cpp b/noncore/net/wellenreiter/gui/wellenreiter.cpp index dcf796f..96733ff 100644 --- a/noncore/net/wellenreiter/gui/wellenreiter.cpp +++ b/noncore/net/wellenreiter/gui/wellenreiter.cpp | |||
@@ -453,78 +453,85 @@ void Wellenreiter::startClicked() | |||
453 | assert( parent() ); | 453 | assert( parent() ); |
454 | ( (QMainWindow*) parent() )->setCaption( tr( "Wellenreiter II - replaying capture file..." ) ); | 454 | ( (QMainWindow*) parent() )->setCaption( tr( "Wellenreiter II - replaying capture file..." ) ); |
455 | } | 455 | } |
456 | } | 456 | } |
457 | 457 | ||
458 | 458 | ||
459 | void Wellenreiter::timerEvent( QTimerEvent* ) | 459 | void Wellenreiter::timerEvent( QTimerEvent* ) |
460 | { | 460 | { |
461 | qDebug( "Wellenreiter::timerEvent()" ); | 461 | qDebug( "Wellenreiter::timerEvent()" ); |
462 | OPacket* p = pcap->next(); | 462 | OPacket* p = pcap->next(); |
463 | if ( !p ) // no more packets available | 463 | if ( !p ) // no more packets available |
464 | { | 464 | { |
465 | stopClicked(); | 465 | stopClicked(); |
466 | } | 466 | } |
467 | else | 467 | else |
468 | { | 468 | { |
469 | receivePacket( p ); | 469 | receivePacket( p ); |
470 | delete p; | 470 | delete p; |
471 | } | 471 | } |
472 | } | 472 | } |
473 | 473 | ||
474 | 474 | ||
475 | void Wellenreiter::doAction( const QString& action, const QString& protocol, OPacket* p ) | 475 | void Wellenreiter::doAction( const QString& action, const QString& protocol, OPacket* p ) |
476 | { | 476 | { |
477 | #ifdef QWS | ||
477 | if ( action == "TouchSound" ) | 478 | if ( action == "TouchSound" ) |
478 | ODevice::inst()->touchSound(); | 479 | ODevice::inst()->touchSound(); |
479 | else if ( action == "AlarmSound" ) | 480 | else if ( action == "AlarmSound" ) |
480 | ODevice::inst()->alarmSound(); | 481 | ODevice::inst()->alarmSound(); |
481 | else if ( action == "KeySound" ) | 482 | else if ( action == "KeySound" ) |
482 | ODevice::inst()->keySound(); | 483 | ODevice::inst()->keySound(); |
483 | else if ( action == "LedOn" ) | 484 | else if ( action == "LedOn" ) |
484 | ODevice::inst()->setLedState( Led_Mail, Led_On ); | 485 | ODevice::inst()->setLedState( Led_Mail, Led_On ); |
485 | else if ( action == "LedOff" ) | 486 | else if ( action == "LedOff" ) |
486 | ODevice::inst()->setLedState( Led_Mail, Led_Off ); | 487 | ODevice::inst()->setLedState( Led_Mail, Led_Off ); |
487 | else if ( action == "LogMessage" ) | 488 | else if ( action == "LogMessage" ) |
488 | logwindow->log( QString().sprintf( "Got packet with protocol '%s'", (const char*) protocol ) ); | 489 | logwindow->log( QString().sprintf( "Got packet with protocol '%s'", (const char*) protocol ) ); |
489 | else if ( action == "MessageBox" ) | 490 | else if ( action == "MessageBox" ) |
490 | QMessageBox::information( this, "Notification!", | 491 | QMessageBox::information( this, "Notification!", |
491 | QString().sprintf( "Got packet with protocol '%s'", (const char*) protocol ) ); | 492 | QString().sprintf( "Got packet with protocol '%s'", (const char*) protocol ) ); |
493 | #else | ||
494 | #warning Actions do not work with Qt/X11 yet | ||
495 | #endif | ||
492 | } | 496 | } |
493 | 497 | ||
494 | void Wellenreiter::joinNetwork(const QString& type, const QString& essid, int channel, const QString& macaddr) | 498 | void Wellenreiter::joinNetwork(const QString& type, const QString& essid, int channel, const QString& macaddr) |
495 | { | 499 | { |
500 | #ifdef QWS | ||
496 | if ( !iface ) | 501 | if ( !iface ) |
497 | { | 502 | { |
498 | QMessageBox::warning( this, tr( "Can't do that!" ), tr( "No wireless\ninterface available." ) ); | 503 | QMessageBox::warning( this, tr( "Can't do that!" ), tr( "No wireless\ninterface available." ) ); |
499 | return; | 504 | return; |
500 | } | 505 | } |
501 | 506 | ||
502 | if ( sniffing ) | 507 | if ( sniffing ) |
503 | { | 508 | { |
504 | QMessageBox::warning( this, tr( "Can't do that!" ), tr( "Stop sniffing before\njoining a net." ) ); | 509 | QMessageBox::warning( this, tr( "Can't do that!" ), tr( "Stop sniffing before\njoining a net." ) ); |
505 | return; | 510 | return; |
506 | } | 511 | } |
507 | 512 | ||
508 | qDebug( "joinNetwork() with Interface %s: %s, %s, %d, %s", | 513 | qDebug( "joinNetwork() with Interface %s: %s, %s, %d, %s", |
509 | (const char*) iface->name(), | 514 | (const char*) iface->name(), |
510 | (const char*) type, | 515 | (const char*) type, |
511 | (const char*) essid, | 516 | (const char*) essid, |
512 | channel, | 517 | channel, |
513 | (const char*) macaddr ); | 518 | (const char*) macaddr ); |
514 | 519 | ||
515 | QCopEnvelope msg( "QPE/Application/networksettings", "wlan(QString,QString,QString)" ); | 520 | QCopEnvelope msg( "QPE/Application/networksettings", "wlan(QString,QString,QString)" ); |
516 | int count = 3; | 521 | int count = 3; |
517 | qDebug("sending %d messages",count); | 522 | qDebug("sending %d messages",count); |
518 | msg << QString("count") << QString::number(count); | 523 | msg << QString("count") << QString::number(count); |
519 | qDebug("msg >%s< Mode >%s<", iface->name(),type.latin1() ); | 524 | qDebug("msg >%s< Mode >%s<", iface->name(),type.latin1() ); |
520 | msg << QString(iface->name()) << QString("Mode") << type; | 525 | msg << QString(iface->name()) << QString("Mode") << type; |
521 | qDebug("msg >%s< essid >%s<", iface->name(),essid.latin1()); | 526 | qDebug("msg >%s< essid >%s<", iface->name(),essid.latin1()); |
522 | msg << QString(iface->name()) << QString("ESSID") << essid; | 527 | msg << QString(iface->name()) << QString("ESSID") << essid; |
523 | qDebug("msg >%s< channel >%d<", iface->name(),channel); | 528 | qDebug("msg >%s< channel >%d<", iface->name(),channel); |
524 | msg << QString(iface->name()) << QString("Channel") << channel; | 529 | msg << QString(iface->name()) << QString("Channel") << channel; |
525 | // qDebug("msg >%s< mac >%s<", iface->name(),macaddr); | 530 | // qDebug("msg >%s< mac >%s<", iface->name(),macaddr); |
526 | // msg << QString(iface->name()) << QString("MacAddr") << macaddr; | 531 | // msg << QString(iface->name()) << QString("MacAddr") << macaddr; |
527 | 532 | #else | |
533 | QMessageBox::warning( this, tr( "Can't do that!" ), tr( "Function only available on Embedded build" ) ); | ||
534 | #endif | ||
528 | 535 | ||
529 | } | 536 | } |
530 | 537 | ||