summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/wellenreiter/gui/configwindow.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/net/wellenreiter/gui/configwindow.cpp b/noncore/net/wellenreiter/gui/configwindow.cpp
index f82c088..68da712 100644
--- a/noncore/net/wellenreiter/gui/configwindow.cpp
+++ b/noncore/net/wellenreiter/gui/configwindow.cpp
@@ -155,191 +155,191 @@ bool WellenreiterConfigWindow::isChannelChecked( int channel ) const
155 case 3: return channel3->isOn(); 155 case 3: return channel3->isOn();
156 case 4: return channel4->isOn(); 156 case 4: return channel4->isOn();
157 case 5: return channel5->isOn(); 157 case 5: return channel5->isOn();
158 case 6: return channel6->isOn(); 158 case 6: return channel6->isOn();
159 case 7: return channel7->isOn(); 159 case 7: return channel7->isOn();
160 case 8: return channel8->isOn(); 160 case 8: return channel8->isOn();
161 case 9: return channel9->isOn(); 161 case 9: return channel9->isOn();
162 case 10: return channel10->isOn(); 162 case 10: return channel10->isOn();
163 case 11: return channel11->isOn(); 163 case 11: return channel11->isOn();
164 case 12: return channel12->isOn(); 164 case 12: return channel12->isOn();
165 case 13: return channel13->isOn(); 165 case 13: return channel13->isOn();
166 case 14: return channel14->isOn(); 166 case 14: return channel14->isOn();
167 } 167 }
168} 168}
169 169
170 170
171void WellenreiterConfigWindow::changedDeviceType(int t) 171void WellenreiterConfigWindow::changedDeviceType(int t)
172{ 172{
173 if ( t != DEVTYPE_FILE ) return; 173 if ( t != DEVTYPE_FILE ) return;
174 QString name = ( (WellenreiterMainWindow*) qApp->mainWidget() )->getFileName(false); 174 QString name = ( (WellenreiterMainWindow*) qApp->mainWidget() )->getFileName(false);
175 if ( !name.isEmpty() && QFile::exists( name ) ) 175 if ( !name.isEmpty() && QFile::exists( name ) )
176 { 176 {
177 interfaceName->insertItem( name ); 177 interfaceName->insertItem( name );
178 interfaceName->setCurrentItem( interfaceName->count()-1 ); 178 interfaceName->setCurrentItem( interfaceName->count()-1 );
179 } 179 }
180 else 180 else
181 { 181 {
182 deviceType->setCurrentItem( _guess ); 182 deviceType->setCurrentItem( _guess );
183 } 183 }
184 184
185} 185}
186 186
187 187
188void WellenreiterConfigWindow::getCaptureFileNameClicked() 188void WellenreiterConfigWindow::getCaptureFileNameClicked()
189{ 189{
190 QString name = ( (WellenreiterMainWindow*) qApp->mainWidget() )->getFileName(true); 190 QString name = ( (WellenreiterMainWindow*) qApp->mainWidget() )->getFileName(true);
191 qDebug( "name = %s", (const char*) name ); 191 qDebug( "name = %s", (const char*) name );
192 if ( !name.isEmpty() ) 192 if ( !name.isEmpty() )
193 { 193 {
194 captureFileName->setText( name ); 194 captureFileName->setText( name );
195 } 195 }
196} 196}
197 197
198 198
199void WellenreiterConfigWindow::channelAllClicked(int state) 199void WellenreiterConfigWindow::channelAllClicked(int state)
200{ 200{
201 bool b = state; 201 bool b = state;
202 channel1->setChecked( b ); 202 channel1->setChecked( b );
203 channel2->setChecked( b ); 203 channel2->setChecked( b );
204 channel3->setChecked( b ); 204 channel3->setChecked( b );
205 channel4->setChecked( b ); 205 channel4->setChecked( b );
206 channel5->setChecked( b ); 206 channel5->setChecked( b );
207 channel6->setChecked( b ); 207 channel6->setChecked( b );
208 channel7->setChecked( b ); 208 channel7->setChecked( b );
209 channel8->setChecked( b ); 209 channel8->setChecked( b );
210 channel9->setChecked( b ); 210 channel9->setChecked( b );
211 channel10->setChecked( b ); 211 channel10->setChecked( b );
212 channel11->setChecked( b ); 212 channel11->setChecked( b );
213 channel12->setChecked( b ); 213 channel12->setChecked( b );
214 channel13->setChecked( b ); 214 channel13->setChecked( b );
215 channel14->setChecked( b ); 215 channel14->setChecked( b );
216} 216}
217 217
218 218
219bool WellenreiterConfigWindow::useGPS() const 219bool WellenreiterConfigWindow::useGPS() const
220{ 220{
221 return enableGPS->isChecked(); 221 return enableGPS->isChecked();
222} 222}
223 223
224 224
225const QString WellenreiterConfigWindow::gpsHost() const 225const QString WellenreiterConfigWindow::gpsHost() const
226{ 226{
227 return useGPS() ? gpsdHost->currentText() : QString::null; 227 return useGPS() ? gpsdHost->currentText() : QString::null;
228} 228}
229 229
230 230
231int WellenreiterConfigWindow::gpsPort() const 231int WellenreiterConfigWindow::gpsPort() const
232{ 232{
233 bool ok; 233 bool ok;
234 return useGPS() ? gpsdPort->value() : -1; 234 return useGPS() ? gpsdPort->value() : -1;
235} 235}
236 236
237 237
238void WellenreiterConfigWindow::load() 238void WellenreiterConfigWindow::load()
239{ 239{
240#ifdef Q_WS_X11 240#ifdef Q_WS_X11
241 #warning Persistent Configuration not yet implemented for standalone X11 build 241 #warning Persistent Configuration not yet implemented for standalone X11 build
242 performAutodetection(); 242 performAutodetection();
243#else 243#else
244 qDebug( "loading configuration settings..." ); 244 qDebug( "loading configuration settings..." );
245 245
246 /* This is dumb monkey typing stuff... We _need_ to do this automatically! */ 246 /* This is dumb monkey typing stuff... We _need_ to do this automatically! */
247 247
248 OConfig* c = oApp->config(); 248 OConfig* c = oApp->config();
249 249
250 c->setGroup( "Interface" ); 250 c->setGroup( "Interface" );
251 251
252 QString interface = c->readEntry( "name", "<none>" ); 252 QString interface = c->readEntry( "name", "<none>" );
253 if ( interface != "<none>" ) 253 if ( interface != "<none>" )
254 { 254 {
255#if QT_VERSION < 300 255#if QT_VERSION < 300
256 interfaceName->insertItem( interface, 0 ); 256 interfaceName->insertItem( interface, 0 );
257 interfaceName->setCurrentItem( 0 ); 257 interfaceName->setCurrentItem( 0 );
258#else 258#else
259 interfaceName->setCurrentText( interface ); 259 interfaceName->setCurrentText( interface );
260#endif 260#endif
261 261
262 QString device = c->readEntry( "type", "<select>" ); 262 QString device = c->readEntry( "type", "<select>" );
263#if QT_VERSION < 300 263#if QT_VERSION < 300
264 for ( int i = 0; i < deviceType->count(); ++i ) 264 for ( int i = 0; i < deviceType->count(); ++i )
265 { 265 {
266 if ( deviceType->text( i ) == device ) 266 if ( deviceType->text( i ) == device )
267 { 267 {
268 deviceType->setCurrentItem( i ); 268 deviceType->setCurrentItem( i );
269 break; 269 break;
270 } 270 }
271 } 271 }
272#else 272#else
273 deviceType->setCurrentText( device ); 273 deviceType->setCurrentText( device );
274#endif 274#endif
275 } 275 }
276 else 276 else
277 { 277 {
278 performAutodetection(); 278 performAutodetection();
279 } 279 }
280 280
281 prismHeader->setChecked( c->readBoolEntry( "prism", false ) ); 281 prismHeader->setChecked( c->readBoolEntry( "prism", false ) );
282 hopChannels->setChecked( c->readBoolEntry( "hop", true ) ); 282 hopChannels->setChecked( c->readBoolEntry( "hop", true ) );
283 hopInterval->setValue( c->readNumEntry( "interval", 100 ) ); 283 hopInterval->setValue( c->readNumEntry( "interval", 250 ) );
284 adaptiveHopping->setChecked( c->readBoolEntry( "adaptive", true ) ); 284 adaptiveHopping->setChecked( c->readBoolEntry( "adaptive", true ) );
285 285
286 c->setGroup( "Capture" ); 286 c->setGroup( "Capture" );
287 captureFileName->setText( c->readEntry( "filename", "/tmp/capture" ) ); 287 captureFileName->setText( c->readEntry( "filename", "/tmp/capture" ) );
288 288
289 c->setGroup( "UI" ); 289 c->setGroup( "UI" );
290 lookupVendor->setChecked( c->readBoolEntry( "lookupVendor", true ) ); 290 lookupVendor->setChecked( c->readBoolEntry( "lookupVendor", true ) );
291 openTree->setChecked( c->readBoolEntry( "openTree", true ) ); 291 openTree->setChecked( c->readBoolEntry( "openTree", true ) );
292 disablePM->setChecked( c->readBoolEntry( "disablePM", true ) ); 292 disablePM->setChecked( c->readBoolEntry( "disablePM", true ) );
293 293
294 c->setGroup( "GPS" ); 294 c->setGroup( "GPS" );
295 enableGPS->setChecked( c->readBoolEntry( "use", false ) ); 295 enableGPS->setChecked( c->readBoolEntry( "use", false ) );
296#if QT_VERSION < 300 296#if QT_VERSION < 300
297 gpsdHost->insertItem( c->readEntry( "host", "localhost" ), 0 ); 297 gpsdHost->insertItem( c->readEntry( "host", "localhost" ), 0 );
298 gpsdHost->setCurrentItem( 0 ); 298 gpsdHost->setCurrentItem( 0 );
299#else 299#else
300 gpsdHost->setCurrentText( c->readEntry( "host", "localhost" ) ); 300 gpsdHost->setCurrentText( c->readEntry( "host", "localhost" ) );
301#endif 301#endif
302 gpsdPort->setValue( c->readNumEntry( "port", 2947 ) ); 302 gpsdPort->setValue( c->readNumEntry( "port", 2947 ) );
303 startGPS->setChecked( c->readBoolEntry( "start", false ) ); 303 startGPS->setChecked( c->readBoolEntry( "start", false ) );
304 commandGPS->setText( c->readEntry( "command", "gpsd -p /dev/ttyS3 -s 57600" ) ); 304 commandGPS->setText( c->readEntry( "command", "gpsd -p /dev/ttyS3 -s 57600" ) );
305 305
306#endif 306#endif
307} 307}
308 308
309 309
310void WellenreiterConfigWindow::save() 310void WellenreiterConfigWindow::save()
311{ 311{
312#ifdef Q_WS_X11 312#ifdef Q_WS_X11
313 #warning Persistent Configuration not yet implemented for standalone X11 build 313 #warning Persistent Configuration not yet implemented for standalone X11 build
314#else 314#else
315 qDebug( "saving configuration settings..." ); 315 qDebug( "saving configuration settings..." );
316 316
317 /* This is dumb monkey typing stuff... We _need_ to do this automatically! */ 317 /* This is dumb monkey typing stuff... We _need_ to do this automatically! */
318 318
319 OConfig* c = oApp->config(); 319 OConfig* c = oApp->config();
320 320
321 c->setGroup( "Interface" ); 321 c->setGroup( "Interface" );
322 c->writeEntry( "name", interfaceName->currentText() ); 322 c->writeEntry( "name", interfaceName->currentText() );
323 c->writeEntry( "type", deviceType->currentText() ); 323 c->writeEntry( "type", deviceType->currentText() );
324 c->writeEntry( "prism", prismHeader->isChecked() ); 324 c->writeEntry( "prism", prismHeader->isChecked() );
325 c->writeEntry( "hop", hopChannels->isChecked() ); 325 c->writeEntry( "hop", hopChannels->isChecked() );
326 c->writeEntry( "interval", hopInterval->value() ); 326 c->writeEntry( "interval", hopInterval->value() );
327 c->writeEntry( "adaptive", adaptiveHopping->isChecked() ); 327 c->writeEntry( "adaptive", adaptiveHopping->isChecked() );
328 328
329 c->setGroup( "Capture" ); 329 c->setGroup( "Capture" );
330 c->writeEntry( "filename", captureFileName->text() ); 330 c->writeEntry( "filename", captureFileName->text() );
331 331
332 c->setGroup( "UI" ); 332 c->setGroup( "UI" );
333 c->writeEntry( "lookupVendor", lookupVendor->isChecked() ); 333 c->writeEntry( "lookupVendor", lookupVendor->isChecked() );
334 c->writeEntry( "openTree", openTree->isChecked() ); 334 c->writeEntry( "openTree", openTree->isChecked() );
335 c->writeEntry( "disablePM", disablePM->isChecked() ); 335 c->writeEntry( "disablePM", disablePM->isChecked() );
336 336
337 c->setGroup( "GPS" ); 337 c->setGroup( "GPS" );
338 c->writeEntry( "use", enableGPS->isChecked() ); 338 c->writeEntry( "use", enableGPS->isChecked() );
339 c->writeEntry( "host", gpsdHost->currentText() ); 339 c->writeEntry( "host", gpsdHost->currentText() );
340 c->writeEntry( "port", gpsdPort->value() ); 340 c->writeEntry( "port", gpsdPort->value() );
341 c->writeEntry( "start", startGPS->isChecked() ); 341 c->writeEntry( "start", startGPS->isChecked() );
342 c->writeEntry( "command", commandGPS->text() ); 342 c->writeEntry( "command", commandGPS->text() );
343 343
344#endif 344#endif
345} 345}