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 @@ -334,32 +334,41 @@ void Wellenreiter::stopClicked() 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 ) ) { @@ -461,32 +470,42 @@ void Wellenreiter::startClicked() } 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 { |