author | mickeyl <mickeyl> | 2003-05-07 21:11:29 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2003-05-07 21:11:29 (UTC) |
commit | 8344bbd32ca4ebfef275746de29cb3109b013cb6 (patch) (side-by-side diff) | |
tree | 7edd595d9acda25f7e752a38903f6102cbb55986 /noncore/net/wellenreiter/gui | |
parent | 9e1040d8d3646c03e09fb3c55695e2df7f19420b (diff) | |
download | opie-8344bbd32ca4ebfef275746de29cb3109b013cb6.zip opie-8344bbd32ca4ebfef275746de29cb3109b013cb6.tar.gz opie-8344bbd32ca4ebfef275746de29cb3109b013cb6.tar.bz2 |
start with protocol event handling stuff
Diffstat (limited to 'noncore/net/wellenreiter/gui') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/wellenreiter/gui/configwindow.cpp | 24 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/configwindow.h | 5 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/protolistview.cpp | 16 | ||||
-rw-r--r-- | noncore/net/wellenreiter/gui/protolistview.h | 3 |
4 files changed, 45 insertions, 3 deletions
diff --git a/noncore/net/wellenreiter/gui/configwindow.cpp b/noncore/net/wellenreiter/gui/configwindow.cpp index 2305403..5bec7ed 100644 --- a/noncore/net/wellenreiter/gui/configwindow.cpp +++ b/noncore/net/wellenreiter/gui/configwindow.cpp @@ -106,30 +106,52 @@ int WellenreiterConfigWindow::driverType() const { return 0; } }; int WellenreiterConfigWindow::hoppingInterval() const { return hopInterval->cleanText().toInt(); } -bool WellenreiterConfigWindow::usePrismHeader() +bool WellenreiterConfigWindow::usePrismHeader() const { return prismHeader->isOn(); } +bool WellenreiterConfigWindow::isChannelChecked( int channel ) const +{ + switch ( channel ) + { + case 1: return channel1->isOn(); + case 2: return channel2->isOn(); + case 3: return channel3->isOn(); + case 4: return channel4->isOn(); + case 5: return channel5->isOn(); + case 6: return channel6->isOn(); + case 7: return channel7->isOn(); + case 8: return channel8->isOn(); + case 9: return channel9->isOn(); + case 10: return channel10->isOn(); + case 11: return channel11->isOn(); + case 12: return channel12->isOn(); + case 13: return channel13->isOn(); + case 14: return channel14->isOn(); + } +} + + void WellenreiterConfigWindow::changedDeviceType(int t) { if ( t != DEVTYPE_FILE ) return; QString name = ( (WellenreiterMainWindow*) qApp->mainWidget() )->getFileName(false); if ( !name.isEmpty() && QFile::exists( name ) ) { interfaceName->insertItem( name ); interfaceName->setCurrentItem( interfaceName->count()-1 ); } else { deviceType->setCurrentItem( _guess ); diff --git a/noncore/net/wellenreiter/gui/configwindow.h b/noncore/net/wellenreiter/gui/configwindow.h index 057bed6..32dc840 100644 --- a/noncore/net/wellenreiter/gui/configwindow.h +++ b/noncore/net/wellenreiter/gui/configwindow.h @@ -29,30 +29,31 @@ const int DEVTYPE_ORINOCO = 4; const int DEVTYPE_MANUAL = 5; const int DEVTYPE_FILE = 6; class WellenreiterConfigWindow; class WellenreiterConfigWindow : public WellenreiterConfigBase { Q_OBJECT public: WellenreiterConfigWindow( QWidget * parent = 0, const char * name = "WellenreiterConfigWindow", WFlags f = 0 ); int driverType() const; - int hoppingInterval() const; const QString soundOnNetwork() const { return "";/*netSound->currentText();*/ }; const QString soundOnBeacon() const { return "";/*beaconSound->currentText();*/ }; static WellenreiterConfigWindow* instance() { return _instance; }; - bool usePrismHeader(); + int hoppingInterval() const; + bool usePrismHeader() const; + bool isChannelChecked( int ) const; public slots: void changedDeviceType(int); void getCaptureFileNameClicked(); void channelAllClicked(int); protected: QMap<QString, int> _devicetype; static WellenreiterConfigWindow* _instance; int _guess; diff --git a/noncore/net/wellenreiter/gui/protolistview.cpp b/noncore/net/wellenreiter/gui/protolistview.cpp index 8b86072..05ff5e7 100644 --- a/noncore/net/wellenreiter/gui/protolistview.cpp +++ b/noncore/net/wellenreiter/gui/protolistview.cpp @@ -81,15 +81,31 @@ void ProtocolListView::addProtocol( const QString& name ) if ( actions ) { QComboBox* combo = new QComboBox( hbox, (const char*) name ); #ifdef QWS combo->setFixedWidth( 75 ); #endif combo->insertItem( "Ignore" ); combo->insertItem( "TouchSound" ); combo->insertItem( "AlarmSound" ); combo->insertItem( "KeySound" ); combo->insertItem( "LedOn" ); combo->insertItem( "LedOff" ); + combo->insertItem( "LogMessage" ); + combo->insertItem( "MessageBox" ); } } + +bool ProtocolListView::isProtocolChecked( const QString& name ) +{ + QCheckBox* box = (QCheckBox*) child( (const char*) name ); + return ( box && box->isOn() ); +} + + +QString ProtocolListView::protocolAction( const QString& name ) const +{ + //FIXME +} + + diff --git a/noncore/net/wellenreiter/gui/protolistview.h b/noncore/net/wellenreiter/gui/protolistview.h index 42aec7d..723e8cd 100644 --- a/noncore/net/wellenreiter/gui/protolistview.h +++ b/noncore/net/wellenreiter/gui/protolistview.h @@ -22,23 +22,26 @@ //#include <qcombobox.h> class QCheckBox; class QComboBox; class QVBox; class ProtocolListView : public QScrollView { public: ProtocolListView( QWidget* parent = 0, const char* name = 0, WFlags f = 0 ); virtual ~ProtocolListView(); + bool isProtocolChecked( const QString& name ); + QString protocolAction( const QString& name ) const; + protected: virtual void addProtocol( const QString& name ); private: QVBox* vbox; bool actions; }; #endif // PROTOLISTVIEW_H |