author | mickeyl <mickeyl> | 2003-05-07 21:11:29 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2003-05-07 21:11:29 (UTC) |
commit | 8344bbd32ca4ebfef275746de29cb3109b013cb6 (patch) (unidiff) | |
tree | 7edd595d9acda25f7e752a38903f6102cbb55986 | |
parent | 9e1040d8d3646c03e09fb3c55695e2df7f19420b (diff) | |
download | opie-8344bbd32ca4ebfef275746de29cb3109b013cb6.zip opie-8344bbd32ca4ebfef275746de29cb3109b013cb6.tar.gz opie-8344bbd32ca4ebfef275746de29cb3109b013cb6.tar.bz2 |
start with protocol event handling stuff
-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 | |||
@@ -102,38 +102,60 @@ int WellenreiterConfigWindow::driverType() const | |||
102 | { | 102 | { |
103 | return _devicetype[name]; | 103 | return _devicetype[name]; |
104 | } | 104 | } |
105 | else | 105 | else |
106 | { | 106 | { |
107 | return 0; | 107 | return 0; |
108 | } | 108 | } |
109 | }; | 109 | }; |
110 | 110 | ||
111 | 111 | ||
112 | int WellenreiterConfigWindow::hoppingInterval() const | 112 | int WellenreiterConfigWindow::hoppingInterval() const |
113 | { | 113 | { |
114 | return hopInterval->cleanText().toInt(); | 114 | return hopInterval->cleanText().toInt(); |
115 | } | 115 | } |
116 | 116 | ||
117 | 117 | ||
118 | bool WellenreiterConfigWindow::usePrismHeader() | 118 | bool WellenreiterConfigWindow::usePrismHeader() const |
119 | { | 119 | { |
120 | return prismHeader->isOn(); | 120 | return prismHeader->isOn(); |
121 | } | 121 | } |
122 | 122 | ||
123 | 123 | ||
124 | bool WellenreiterConfigWindow::isChannelChecked( int channel ) const | ||
125 | { | ||
126 | switch ( channel ) | ||
127 | { | ||
128 | case 1: return channel1->isOn(); | ||
129 | case 2: return channel2->isOn(); | ||
130 | case 3: return channel3->isOn(); | ||
131 | case 4: return channel4->isOn(); | ||
132 | case 5: return channel5->isOn(); | ||
133 | case 6: return channel6->isOn(); | ||
134 | case 7: return channel7->isOn(); | ||
135 | case 8: return channel8->isOn(); | ||
136 | case 9: return channel9->isOn(); | ||
137 | case 10: return channel10->isOn(); | ||
138 | case 11: return channel11->isOn(); | ||
139 | case 12: return channel12->isOn(); | ||
140 | case 13: return channel13->isOn(); | ||
141 | case 14: return channel14->isOn(); | ||
142 | } | ||
143 | } | ||
144 | |||
145 | |||
124 | void WellenreiterConfigWindow::changedDeviceType(int t) | 146 | void WellenreiterConfigWindow::changedDeviceType(int t) |
125 | { | 147 | { |
126 | if ( t != DEVTYPE_FILE ) return; | 148 | if ( t != DEVTYPE_FILE ) return; |
127 | QString name = ( (WellenreiterMainWindow*) qApp->mainWidget() )->getFileName(false); | 149 | QString name = ( (WellenreiterMainWindow*) qApp->mainWidget() )->getFileName(false); |
128 | if ( !name.isEmpty() && QFile::exists( name ) ) | 150 | if ( !name.isEmpty() && QFile::exists( name ) ) |
129 | { | 151 | { |
130 | interfaceName->insertItem( name ); | 152 | interfaceName->insertItem( name ); |
131 | interfaceName->setCurrentItem( interfaceName->count()-1 ); | 153 | interfaceName->setCurrentItem( interfaceName->count()-1 ); |
132 | } | 154 | } |
133 | else | 155 | else |
134 | { | 156 | { |
135 | deviceType->setCurrentItem( _guess ); | 157 | deviceType->setCurrentItem( _guess ); |
136 | } | 158 | } |
137 | 159 | ||
138 | } | 160 | } |
139 | 161 | ||
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 | |||
@@ -25,37 +25,38 @@ const int DEVTYPE_SELECT = 0; | |||
25 | const int DEVTYPE_CISCO = 1; | 25 | const int DEVTYPE_CISCO = 1; |
26 | const int DEVTYPE_WLAN_NG = 2; | 26 | const int DEVTYPE_WLAN_NG = 2; |
27 | const int DEVTYPE_HOSTAP = 3; | 27 | const int DEVTYPE_HOSTAP = 3; |
28 | const int DEVTYPE_ORINOCO = 4; | 28 | const int DEVTYPE_ORINOCO = 4; |
29 | const int DEVTYPE_MANUAL = 5; | 29 | const int DEVTYPE_MANUAL = 5; |
30 | const int DEVTYPE_FILE = 6; | 30 | const int DEVTYPE_FILE = 6; |
31 | 31 | ||
32 | class WellenreiterConfigWindow; | 32 | class WellenreiterConfigWindow; |
33 | 33 | ||
34 | class WellenreiterConfigWindow : public WellenreiterConfigBase | 34 | class WellenreiterConfigWindow : public WellenreiterConfigBase |
35 | { | 35 | { |
36 | Q_OBJECT | 36 | Q_OBJECT |
37 | 37 | ||
38 | public: | 38 | public: |
39 | WellenreiterConfigWindow( QWidget * parent = 0, const char * name = "WellenreiterConfigWindow", WFlags f = 0 ); | 39 | WellenreiterConfigWindow( QWidget * parent = 0, const char * name = "WellenreiterConfigWindow", WFlags f = 0 ); |
40 | int driverType() const; | 40 | int driverType() const; |
41 | int hoppingInterval() const; | ||
42 | const QString soundOnNetwork() const { return "";/*netSound->currentText();*/ }; | 41 | const QString soundOnNetwork() const { return "";/*netSound->currentText();*/ }; |
43 | const QString soundOnBeacon() const { return "";/*beaconSound->currentText();*/ }; | 42 | const QString soundOnBeacon() const { return "";/*beaconSound->currentText();*/ }; |
44 | static WellenreiterConfigWindow* instance() { return _instance; }; | 43 | static WellenreiterConfigWindow* instance() { return _instance; }; |
45 | 44 | ||
46 | bool usePrismHeader(); | 45 | int hoppingInterval() const; |
46 | bool usePrismHeader() const; | ||
47 | bool isChannelChecked( int ) const; | ||
47 | 48 | ||
48 | public slots: | 49 | public slots: |
49 | void changedDeviceType(int); | 50 | void changedDeviceType(int); |
50 | void getCaptureFileNameClicked(); | 51 | void getCaptureFileNameClicked(); |
51 | 52 | ||
52 | void channelAllClicked(int); | 53 | void channelAllClicked(int); |
53 | 54 | ||
54 | protected: | 55 | protected: |
55 | QMap<QString, int> _devicetype; | 56 | QMap<QString, int> _devicetype; |
56 | static WellenreiterConfigWindow* _instance; | 57 | static WellenreiterConfigWindow* _instance; |
57 | int _guess; | 58 | int _guess; |
58 | 59 | ||
59 | }; | 60 | }; |
60 | 61 | ||
61 | #endif | 62 | #endif |
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 | |||
@@ -77,19 +77,35 @@ void ProtocolListView::addProtocol( const QString& name ) | |||
77 | { | 77 | { |
78 | QHBox* hbox = new QHBox( vbox ); | 78 | QHBox* hbox = new QHBox( vbox ); |
79 | new QCheckBox( name, hbox, (const char*) name ); | 79 | new QCheckBox( name, hbox, (const char*) name ); |
80 | 80 | ||
81 | if ( actions ) | 81 | if ( actions ) |
82 | { | 82 | { |
83 | QComboBox* combo = new QComboBox( hbox, (const char*) name ); | 83 | QComboBox* combo = new QComboBox( hbox, (const char*) name ); |
84 | #ifdef QWS | 84 | #ifdef QWS |
85 | combo->setFixedWidth( 75 ); | 85 | combo->setFixedWidth( 75 ); |
86 | #endif | 86 | #endif |
87 | combo->insertItem( "Ignore" ); | 87 | combo->insertItem( "Ignore" ); |
88 | combo->insertItem( "TouchSound" ); | 88 | combo->insertItem( "TouchSound" ); |
89 | combo->insertItem( "AlarmSound" ); | 89 | combo->insertItem( "AlarmSound" ); |
90 | combo->insertItem( "KeySound" ); | 90 | combo->insertItem( "KeySound" ); |
91 | combo->insertItem( "LedOn" ); | 91 | combo->insertItem( "LedOn" ); |
92 | combo->insertItem( "LedOff" ); | 92 | combo->insertItem( "LedOff" ); |
93 | combo->insertItem( "LogMessage" ); | ||
94 | combo->insertItem( "MessageBox" ); | ||
93 | } | 95 | } |
94 | } | 96 | } |
95 | 97 | ||
98 | |||
99 | bool ProtocolListView::isProtocolChecked( const QString& name ) | ||
100 | { | ||
101 | QCheckBox* box = (QCheckBox*) child( (const char*) name ); | ||
102 | return ( box && box->isOn() ); | ||
103 | } | ||
104 | |||
105 | |||
106 | QString ProtocolListView::protocolAction( const QString& name ) const | ||
107 | { | ||
108 | //FIXME | ||
109 | } | ||
110 | |||
111 | |||
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 | |||
@@ -18,27 +18,30 @@ | |||
18 | 18 | ||
19 | #include <qscrollview.h> | 19 | #include <qscrollview.h> |
20 | #include <qdict.h> | 20 | #include <qdict.h> |
21 | //#include <qcheckbox.h> | 21 | //#include <qcheckbox.h> |
22 | //#include <qcombobox.h> | 22 | //#include <qcombobox.h> |
23 | class QCheckBox; | 23 | class QCheckBox; |
24 | class QComboBox; | 24 | class QComboBox; |
25 | 25 | ||
26 | class QVBox; | 26 | class QVBox; |
27 | 27 | ||
28 | class ProtocolListView : public QScrollView | 28 | class ProtocolListView : public QScrollView |
29 | { | 29 | { |
30 | public: | 30 | public: |
31 | ProtocolListView( QWidget* parent = 0, const char* name = 0, WFlags f = 0 ); | 31 | ProtocolListView( QWidget* parent = 0, const char* name = 0, WFlags f = 0 ); |
32 | virtual ~ProtocolListView(); | 32 | virtual ~ProtocolListView(); |
33 | 33 | ||
34 | bool isProtocolChecked( const QString& name ); | ||
35 | QString protocolAction( const QString& name ) const; | ||
36 | |||
34 | protected: | 37 | protected: |
35 | virtual void addProtocol( const QString& name ); | 38 | virtual void addProtocol( const QString& name ); |
36 | 39 | ||
37 | private: | 40 | private: |
38 | QVBox* vbox; | 41 | QVBox* vbox; |
39 | bool actions; | 42 | bool actions; |
40 | }; | 43 | }; |
41 | 44 | ||
42 | 45 | ||
43 | 46 | ||
44 | #endif // PROTOLISTVIEW_H | 47 | #endif // PROTOLISTVIEW_H |