Diffstat (limited to 'noncore/net/wellenreiter/gui/wellenreiter.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiter.cpp | 26 |
1 files changed, 21 insertions, 5 deletions
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.cpp b/noncore/net/wellenreiter/gui/wellenreiter.cpp index b22c5cc..4ee9a35 100644 --- a/noncore/net/wellenreiter/gui/wellenreiter.cpp +++ b/noncore/net/wellenreiter/gui/wellenreiter.cpp @@ -114,3 +114,3 @@ Wellenreiter::Wellenreiter( QWidget* parent, const char* name, WFlags fl ) connect( button, SIGNAL( clicked() ), this, SLOT( buttonClicked() ) ); - button->setEnabled( false ); + // button->setEnabled( false ); netview->setColumnWidthMode( 1, QListView::Manual ); @@ -237,7 +237,24 @@ void Wellenreiter::buttonClicked() - // FIXME: reset the card trying to get into a usable state again + // get configuration from config window - // for now, just message the user + const QString& interface = configwindow->interfaceName->currentText(); + const QString& cardtype = configwindow->deviceType->currentText(); + const QString& interval = configwindow->hopInterval->cleanText(); - QMessageBox::information( this, "Wellenreiter/Opie", "You should reset your\ndevice before using it again." ); + // reset the card trying to get into a usable state again + + QString cmdline; + cmdline.sprintf( "iwpriv %s monitor 1", (const char*) interface ); + system( cmdline ); + cmdline.sprintf( "iwpriv %s monitor 1 6", (const char*) interface ); + system( cmdline ); + cmdline.sprintf( "ifconfig %s -promisc", (const char*) interface ); + system( cmdline ); + cmdline.sprintf( "killall -14 dhcpcd" ); + system( cmdline ); + cmdline.sprintf( "killall -10 udhcpc" ); + + // message the user + + QMessageBox::information( this, "Wellenreiter/Opie", "Your wireless card\nshould now be usable again." ); } @@ -267,3 +284,2 @@ void Wellenreiter::buttonClicked() QString cmdline; - cmdline.sprintf( "iwpriv %s monitor 2", (const char*) interface ); |