author | mickeyl <mickeyl> | 2003-09-26 10:59:31 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2003-09-26 10:59:31 (UTC) |
commit | a88328daa117bdb3bd72cef6ca6e5e2b9d619a13 (patch) (side-by-side diff) | |
tree | 1886fdd9685afd6b5828c78df3255eb3b999142f | |
parent | 0009e5f8bfb3050a7906bf03ce7b9870275496e6 (diff) | |
download | opie-a88328daa117bdb3bd72cef6ca6e5e2b9d619a13.zip opie-a88328daa117bdb3bd72cef6ca6e5e2b9d619a13.tar.gz opie-a88328daa117bdb3bd72cef6ca6e5e2b9d619a13.tar.bz2 |
disable screensaver if checked in config
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiter.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.cpp b/noncore/net/wellenreiter/gui/wellenreiter.cpp index 5dc2e79..14f251a 100644 --- a/noncore/net/wellenreiter/gui/wellenreiter.cpp +++ b/noncore/net/wellenreiter/gui/wellenreiter.cpp @@ -326,48 +326,57 @@ void Wellenreiter::stopClicked() pcap->close(); sniffing = false; if ( iface ) { // switch off monitor mode iface->setMonitorMode( false ); // switch off promisc flag iface->setPromiscuousMode( false ); system( "cardctl reset; sleep 1" ); //FIXME: Use OProcess } logwindow->log( "(i) Stopped Scanning." ); assert( parent() ); ( (QMainWindow*) parent() )->setCaption( "Wellenreiter II" ); // message the user QMessageBox::information( this, "Wellenreiter II", tr( "Your wireless card\nshould now be usable again." ) ); sniffing = false; emit( stoppedSniffing() ); + #ifdef QWS + if ( WellenreiterConfigWindow::instance()->disablePM->isChecked() ) + { + QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Enable; + } + #else + #warning FIXME: setScreenSaverMode is not operational on the X11 build + #endif + // print out statistics for( QMap<QString,int>::ConstIterator it = pcap->statistics().begin(); it != pcap->statistics().end(); ++it ) statwindow->updateCounter( it.key(), it.data() ); } void Wellenreiter::startClicked() { // get configuration from config window const QString& interface = configwindow->interfaceName->currentText(); const int cardtype = configwindow->driverType(); const int interval = configwindow->hoppingInterval(); if ( ( interface == "" ) || ( cardtype == 0 ) ) { QMessageBox::information( this, "Wellenreiter II", tr( "Your device is not\nproperly configured. Please reconfigure!" ) ); return; } // configure device ONetwork* net = ONetwork::instance(); @@ -453,48 +462,58 @@ void Wellenreiter::startClicked() // set capturer to non-blocking mode pcap->setBlocking( false ); // start channel hopper if ( cardtype != DEVTYPE_FILE ) { logwindow->log( QString().sprintf( "(i) Starting channel hopper (d=%d ms)", configwindow->hopInterval->value() ) ); iface->setChannelHopping( configwindow->hopInterval->value() ); //use interval from config window } if ( cardtype != DEVTYPE_FILE ) { // connect socket notifier and start channel hopper connect( pcap, SIGNAL( receivedPacket(OPacket*) ), this, SLOT( receivePacket(OPacket*) ) ); connect( iface->channelHopper(), SIGNAL( hopped(int) ), this, SLOT( channelHopped(int) ) ); } else { // start timer for reading packets startTimer( 100 ); } logwindow->log( "(i) Started Scanning." ); sniffing = true; + + #ifdef QWS + if ( WellenreiterConfigWindow::instance()->disablePM->isChecked() ) + { + QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::Disable; + } + #else + #warning FIXME: setScreenSaverMode is not operational on the X11 build + #endif + emit( startedSniffing() ); if ( cardtype != DEVTYPE_FILE ) channelHopped( 6 ); // set title else { assert( parent() ); ( (QMainWindow*) parent() )->setCaption( tr( "Wellenreiter II - replaying capture file..." ) ); } } void Wellenreiter::timerEvent( QTimerEvent* ) { qDebug( "Wellenreiter::timerEvent()" ); OPacket* p = pcap->next(); if ( !p ) // no more packets available { stopClicked(); } else { receivePacket( p ); delete p; } } |