author | mickeyl <mickeyl> | 2003-02-23 15:14:18 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2003-02-23 15:14:18 (UTC) |
commit | 9b7faae2ec12eeb9a056ca6093ac6e0840b11717 (patch) (side-by-side diff) | |
tree | fc4d9de4ee2fd5c502513ccf0fa592bfaaa87185 /noncore/net/wellenreiter/gui/wellenreiter.cpp | |
parent | 791c7512c530cb373726f9c01e26229cb8ca992a (diff) | |
download | opie-9b7faae2ec12eeb9a056ca6093ac6e0840b11717.zip opie-9b7faae2ec12eeb9a056ca6093ac6e0840b11717.tar.gz opie-9b7faae2ec12eeb9a056ca6093ac6e0840b11717.tar.bz2 |
- revamped part of the gui
- configuration is now a seperate dialog
- orinoco_hopper is no longer needed
Diffstat (limited to 'noncore/net/wellenreiter/gui/wellenreiter.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiter.cpp | 37 |
1 files changed, 14 insertions, 23 deletions
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.cpp b/noncore/net/wellenreiter/gui/wellenreiter.cpp index 4c53028..db7063b 100644 --- a/noncore/net/wellenreiter/gui/wellenreiter.cpp +++ b/noncore/net/wellenreiter/gui/wellenreiter.cpp @@ -58,14 +58,15 @@ using namespace Opie; #include <daemon/source/config.hh> #include <libwellenreiter/source/wl_types.hh> #include <libwellenreiter/source/wl_sock.hh> #include <libwellenreiter/source/wl_proto.hh> -Wellenreiter::Wellenreiter( QWidget* parent, const char* name, WFlags fl ) - : WellenreiterBase( parent, name, fl ), daemonRunning( false ), manufacturerdb( 0 ) +Wellenreiter::Wellenreiter( QWidget* parent ) + : WellenreiterBase( parent, 0, 0 ), + daemonRunning( false ), manufacturerdb( 0 ), configwindow( 0 ) { // // construct manufacturer database // @@ -75,17 +76,17 @@ Wellenreiter::Wellenreiter( QWidget* parent, const char* name, WFlags fl ) #else manufile.sprintf( "/home/mickey/work/opie/share/wellenreiter/manufacturers.dat" ); #endif manufacturerdb = new ManufacturerDB( manufile ); logwindow->log( "(i) Wellenreiter has been started." ); - + // // detect operating system // - + #ifdef QWS QString sys; sys.sprintf( "(i) Running on '%s'.", (const char*) ODevice::inst()->systemString() ); _system = ODevice::inst()->system(); logwindow->log( sys ); #endif @@ -107,29 +108,31 @@ Wellenreiter::Wellenreiter( QWidget* parent, const char* name, WFlags fl ) fcntl( daemon_fd, F_SETFL, flags | O_NONBLOCK ); QSocketNotifier *sn = new QSocketNotifier( daemon_fd, QSocketNotifier::Read, parent ); connect( sn, SIGNAL( activated( int ) ), this, SLOT( dataReceived() ) ); } // setup GUI - - connect( button, SIGNAL( clicked() ), this, SLOT( buttonClicked() ) ); - // button->setEnabled( false ); netview->setColumnWidthMode( 1, QListView::Manual ); if ( manufacturerdb ) netview->setManufacturerDB( manufacturerdb ); - + } Wellenreiter::~Wellenreiter() { // no need to delete child widgets, Qt does it all for us - + delete manufacturerdb; } +void Wellenreiter::setConfigWindow( WellenreiterConfigWindow* cw ) +{ + configwindow = cw; +} + void Wellenreiter::handleMessage() { // FIXME: receive message and handle it qDebug( "received message from daemon." ); @@ -208,30 +211,19 @@ typedef struct { void Wellenreiter::dataReceived() { logwindow->log( "(d) Received data from daemon" ); handleMessage(); } -void Wellenreiter::buttonClicked() +void Wellenreiter::startStopClicked() { - /* - // add some test stations, so that we can see if the GUI part works - addNewItem( "managed", "Vanille", "04:00:20:EF:A6:43", true, 6, 80 ); - addNewItem( "managed", "Vanille", "04:00:20:EF:A6:23", true, 11, 10 ); - addNewItem( "adhoc", "ELAN", "40:03:43:E7:16:22", false, 3, 10 ); - addNewItem( "adhoc", "ELAN", "40:03:53:E7:56:62", false, 3, 15 ); - addNewItem( "adhoc", "ELAN", "40:03:63:E7:56:E2", false, 3, 20 ); - */ - - if ( daemonRunning ) { daemonRunning = false; logwindow->log( "(i) Daemon has been stopped." ); - button->setText( tr( "Start Scanning" ) ); setCaption( tr( "Wellenreiter/Opie" ) ); // Stop daemon - ugly for now... later better system( "killall wellenreiterd" ); @@ -258,13 +250,13 @@ void Wellenreiter::buttonClicked() const QString& interface = configwindow->interfaceName->currentText(); const int cardtype = configwindow->daemonDeviceType(); const int interval = configwindow->daemonHopInterval(); if ( ( interface == "<select>" ) || ( cardtype == 0 ) ) { - QMessageBox::information( this, "Wellenreiter/Opie", "You must configure your\ndevice before scanning." ); + QMessageBox::information( this, "Wellenreiter/Opie", "Your device is not\nptoperly configured. Please reconfigure!" ); return; } // start wellenreiterd QString cmdline; @@ -273,11 +265,10 @@ void Wellenreiter::buttonClicked() qDebug( "about to execute '%s' ...", (const char*) cmdline ); system( cmdline ); qDebug( "done!" ); logwindow->log( "(i) Daemon has been started." ); daemonRunning = true; - button->setText( tr( "Stop Scanning" ) ); setCaption( tr( "Scanning ..." ) ); } } |