summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2004-10-22 06:06:15 (UTC)
committer llornkcor <llornkcor>2004-10-22 06:06:15 (UTC)
commit0ad51ab1359feaf04c3be229250a4e2e93892564 (patch) (unidiff)
tree4e5a55814f2ab401b4c54cb4bd7a47ee347bf4ee
parent84b7a20c67226aa4305ad0cb7c05e2507ca0cc0e (diff)
downloadopie-0ad51ab1359feaf04c3be229250a4e2e93892564.zip
opie-0ad51ab1359feaf04c3be229250a4e2e93892564.tar.gz
opie-0ad51ab1359feaf04c3be229250a4e2e93892564.tar.bz2
upon further investigation, QD does indeed do different stuff for different version strings.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/server.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/core/launcher/server.cpp b/core/launcher/server.cpp
index 0eaebcf..42186d3 100644
--- a/core/launcher/server.cpp
+++ b/core/launcher/server.cpp
@@ -198,392 +198,397 @@ void Server::show()
198} 198}
199 199
200Server::~Server() 200Server::~Server()
201{ 201{
202 serverGui->destroyGUI(); 202 serverGui->destroyGUI();
203 delete docList; 203 delete docList;
204 delete qcopBridge; 204 delete qcopBridge;
205 delete transferServer; 205 delete transferServer;
206 delete serverGui; 206 delete serverGui;
207#if 0 207#if 0
208 delete tsmMonitor; 208 delete tsmMonitor;
209#endif 209#endif
210} 210}
211 211
212 212
213static bool hasVisibleWindow(const QString& clientname, bool partial) 213static bool hasVisibleWindow(const QString& clientname, bool partial)
214{ 214{
215#ifdef QWS 215#ifdef QWS
216 const QList<QWSWindow> &list = qwsServer->clientWindows(); 216 const QList<QWSWindow> &list = qwsServer->clientWindows();
217 QWSWindow* w; 217 QWSWindow* w;
218 for (QListIterator<QWSWindow> it(list); (w=it.current()); ++it) { 218 for (QListIterator<QWSWindow> it(list); (w=it.current()); ++it) {
219 if ( w->client()->identity() == clientname ) { 219 if ( w->client()->identity() == clientname ) {
220 if ( partial && !w->isFullyObscured() ) 220 if ( partial && !w->isFullyObscured() )
221 return TRUE; 221 return TRUE;
222 if ( !partial && !w->isFullyObscured() && !w->isPartiallyObscured() ) { 222 if ( !partial && !w->isFullyObscured() && !w->isPartiallyObscured() ) {
223# if QT_VERSION < 0x030000 223# if QT_VERSION < 0x030000
224 QRect mwr = qt_screen->mapToDevice(qt_maxWindowRect, 224 QRect mwr = qt_screen->mapToDevice(qt_maxWindowRect,
225 QSize(qt_screen->width(),qt_screen->height()) ); 225 QSize(qt_screen->width(),qt_screen->height()) );
226# else 226# else
227 QRect mwr = qt_maxWindowRect; 227 QRect mwr = qt_maxWindowRect;
228# endif 228# endif
229 if ( mwr.contains(w->requested().boundingRect()) ) 229 if ( mwr.contains(w->requested().boundingRect()) )
230 return TRUE; 230 return TRUE;
231 } 231 }
232 } 232 }
233 } 233 }
234#endif 234#endif
235 return FALSE; 235 return FALSE;
236} 236}
237 237
238void Server::activate(const ODeviceButton* button, bool held) 238void Server::activate(const ODeviceButton* button, bool held)
239{ 239{
240 Global::terminateBuiltin("calibrate"); // No tr 240 Global::terminateBuiltin("calibrate"); // No tr
241 OQCopMessage om; 241 OQCopMessage om;
242 if ( held ) { 242 if ( held ) {
243 om = button->heldAction(); 243 om = button->heldAction();
244 } else { 244 } else {
245 om = button->pressedAction(); 245 om = button->pressedAction();
246 } 246 }
247 247
248 if ( om.channel() != "ignore" ) 248 if ( om.channel() != "ignore" )
249 om.send(); 249 om.send();
250 250
251 // A button with no action defined, will return a null ServiceRequest. Don't attempt 251 // A button with no action defined, will return a null ServiceRequest. Don't attempt
252 // to send/do anything with this as it will crash 252 // to send/do anything with this as it will crash
253 /* ### FIXME */ 253 /* ### FIXME */
254#if 0 254#if 0
255 if ( !sr.isNull() ) { 255 if ( !sr.isNull() ) {
256 QString app = sr.app(); 256 QString app = sr.app();
257 bool vis = hasVisibleWindow(app, app != "qpe"); 257 bool vis = hasVisibleWindow(app, app != "qpe");
258 if ( sr.message() == "raise()" && vis ) { 258 if ( sr.message() == "raise()" && vis ) {
259 sr.setMessage("nextView()"); 259 sr.setMessage("nextView()");
260 } else { 260 } else {
261 // "back door" 261 // "back door"
262 sr << (int)vis; 262 sr << (int)vis;
263 } 263 }
264 264
265 sr.send(); 265 sr.send();
266 } 266 }
267#endif 267#endif
268} 268}
269 269
270 270
271#ifdef Q_WS_QWS 271#ifdef Q_WS_QWS
272 272
273typedef struct KeyOverride { 273typedef struct KeyOverride {
274 ushort scan_code; 274 ushort scan_code;
275 QWSServer::KeyMap map; 275 QWSServer::KeyMap map;
276}; 276};
277 277
278 278
279static const KeyOverride jp109keys[] = { 279static const KeyOverride jp109keys[] = {
280 { 0x03, { Qt::Key_2, '2' , 0x22 , 0xffff } }, 280 { 0x03, { Qt::Key_2, '2' , 0x22 , 0xffff } },
281 { 0x07, { Qt::Key_6, '6' , '&' , 0xffff } }, 281 { 0x07, { Qt::Key_6, '6' , '&' , 0xffff } },
282 { 0x08, { Qt::Key_7, '7' , '\'' , 0xffff } }, 282 { 0x08, { Qt::Key_7, '7' , '\'' , 0xffff } },
283 { 0x09, { Qt::Key_8, '8' , '(' , 0xffff } }, 283 { 0x09, { Qt::Key_8, '8' , '(' , 0xffff } },
284 { 0x0a, { Qt::Key_9, '9' , ')' , 0xffff } }, 284 { 0x0a, { Qt::Key_9, '9' , ')' , 0xffff } },
285 { 0x0b, { Qt::Key_0, '0' , 0xffff, 0xffff } }, 285 { 0x0b, { Qt::Key_0, '0' , 0xffff, 0xffff } },
286 { 0x0c, { Qt::Key_Minus, '-' , '=' , 0xffff } }, 286 { 0x0c, { Qt::Key_Minus, '-' , '=' , 0xffff } },
287 { 0x0d, { Qt::Key_AsciiCircum, '^' , '~' , '^'-64 } }, 287 { 0x0d, { Qt::Key_AsciiCircum, '^' , '~' , '^'-64 } },
288 { 0x1a, { Qt::Key_At, '@' , '`' , 0xffff } }, 288 { 0x1a, { Qt::Key_At, '@' , '`' , 0xffff } },
289 { 0x1b, { Qt::Key_BraceLeft, '[' , '{' , '['-64 } }, 289 { 0x1b, { Qt::Key_BraceLeft, '[' , '{' , '['-64 } },
290 { 0x27, { Qt::Key_Semicolon, ';' , '+' , 0xffff } }, 290 { 0x27, { Qt::Key_Semicolon, ';' , '+' , 0xffff } },
291 { 0x28, { Qt::Key_Colon, ':' , '*' , 0xffff } }, 291 { 0x28, { Qt::Key_Colon, ':' , '*' , 0xffff } },
292 { 0x29, { Qt::Key_Zenkaku_Hankaku, 0xffff, 0xffff, 0xffff } }, 292 { 0x29, { Qt::Key_Zenkaku_Hankaku, 0xffff, 0xffff, 0xffff } },
293 { 0x2b, { Qt::Key_BraceRight, ']' , '}' , ']'-64 } }, 293 { 0x2b, { Qt::Key_BraceRight, ']' , '}' , ']'-64 } },
294 { 0x70, { Qt::Key_Hiragana_Katakana, 0xffff, 0xffff, 0xffff } }, 294 { 0x70, { Qt::Key_Hiragana_Katakana, 0xffff, 0xffff, 0xffff } },
295 { 0x73, { Qt::Key_Backslash, '\\' , '_' , 0xffff } }, 295 { 0x73, { Qt::Key_Backslash, '\\' , '_' , 0xffff } },
296 { 0x79, { Qt::Key_Henkan, 0xffff, 0xffff, 0xffff } }, 296 { 0x79, { Qt::Key_Henkan, 0xffff, 0xffff, 0xffff } },
297 { 0x7b, { Qt::Key_Muhenkan, 0xffff, 0xffff, 0xffff } }, 297 { 0x7b, { Qt::Key_Muhenkan, 0xffff, 0xffff, 0xffff } },
298 { 0x7d, { Qt::Key_yen, 0x00a5, '|' , 0xffff } }, 298 { 0x7d, { Qt::Key_yen, 0x00a5, '|' , 0xffff } },
299 { 0x00, { 0, 0xffff, 0xffff, 0xffff } } 299 { 0x00, { 0, 0xffff, 0xffff, 0xffff } }
300}; 300};
301 301
302bool Server::setKeyboardLayout( const QString &kb ) 302bool Server::setKeyboardLayout( const QString &kb )
303{ 303{
304 //quick demo version that can be extended 304 //quick demo version that can be extended
305 305
306 QIntDict<QWSServer::KeyMap> *om = 0; 306 QIntDict<QWSServer::KeyMap> *om = 0;
307 if ( kb == "us101" ) { // No tr 307 if ( kb == "us101" ) { // No tr
308 om = 0; 308 om = 0;
309 } else if ( kb == "jp109" ) { 309 } else if ( kb == "jp109" ) {
310 om = new QIntDict<QWSServer::KeyMap>(37); 310 om = new QIntDict<QWSServer::KeyMap>(37);
311 const KeyOverride *k = jp109keys; 311 const KeyOverride *k = jp109keys;
312 while ( k->scan_code ) { 312 while ( k->scan_code ) {
313 om->insert( k->scan_code, &k->map ); 313 om->insert( k->scan_code, &k->map );
314 k++; 314 k++;
315 } 315 }
316 } 316 }
317 QWSServer::setOverrideKeys( om ); 317 QWSServer::setOverrideKeys( om );
318 318
319 return TRUE; 319 return TRUE;
320} 320}
321#endif 321#endif
322 322
323void Server::systemMsg(const QCString &msg, const QByteArray &data) 323void Server::systemMsg(const QCString &msg, const QByteArray &data)
324{ 324{
325 QDataStream stream( data, IO_ReadOnly ); 325 QDataStream stream( data, IO_ReadOnly );
326 326
327 if ( msg == "securityChanged()" ) { 327 if ( msg == "securityChanged()" ) {
328 if ( transferServer ) 328 if ( transferServer )
329 transferServer->authorizeConnections(); 329 transferServer->authorizeConnections();
330 330
331 if ( qcopBridge ) 331 if ( qcopBridge )
332 qcopBridge->authorizeConnections(); 332 qcopBridge->authorizeConnections();
333#warning FIXME support TempScreenSaverMode 333#warning FIXME support TempScreenSaverMode
334#if 0 334#if 0
335 } else if ( msg == "setTempScreenSaverMode(int,int)" ) { 335 } else if ( msg == "setTempScreenSaverMode(int,int)" ) {
336 int mode, pid; 336 int mode, pid;
337 stream >> mode >> pid; 337 stream >> mode >> pid;
338 tsmMonitor->setTempMode(mode, pid); 338 tsmMonitor->setTempMode(mode, pid);
339#endif 339#endif
340 } else if ( msg == "linkChanged(QString)" ) { 340 } else if ( msg == "linkChanged(QString)" ) {
341 QString link; 341 QString link;
342 stream >> link; 342 stream >> link;
343 odebug << "desktop.cpp systemMsg -> linkchanged( " << link << " )" << oendl; 343 odebug << "desktop.cpp systemMsg -> linkchanged( " << link << " )" << oendl;
344 docList->linkChanged(link); 344 docList->linkChanged(link);
345 } else if ( msg == "serviceChanged(QString)" ) { 345 } else if ( msg == "serviceChanged(QString)" ) {
346 MimeType::updateApplications(); 346 MimeType::updateApplications();
347 } else if ( msg == "mkdir(QString)" ) { 347 } else if ( msg == "mkdir(QString)" ) {
348 QString dir; 348 QString dir;
349 stream >> dir; 349 stream >> dir;
350 if ( !dir.isEmpty() ) 350 if ( !dir.isEmpty() )
351 mkdir( dir ); 351 mkdir( dir );
352 } else if ( msg == "rdiffGenSig(QString,QString)" ) { 352 } else if ( msg == "rdiffGenSig(QString,QString)" ) {
353 QString baseFile, sigFile; 353 QString baseFile, sigFile;
354 stream >> baseFile >> sigFile; 354 stream >> baseFile >> sigFile;
355 QRsync::generateSignature( baseFile, sigFile ); 355 QRsync::generateSignature( baseFile, sigFile );
356 } else if ( msg == "rdiffGenDiff(QString,QString,QString)" ) { 356 } else if ( msg == "rdiffGenDiff(QString,QString,QString)" ) {
357 QString baseFile, sigFile, deltaFile; 357 QString baseFile, sigFile, deltaFile;
358 stream >> baseFile >> sigFile >> deltaFile; 358 stream >> baseFile >> sigFile >> deltaFile;
359 QRsync::generateDiff( baseFile, sigFile, deltaFile ); 359 QRsync::generateDiff( baseFile, sigFile, deltaFile );
360 } else if ( msg == "rdiffApplyPatch(QString,QString)" ) { 360 } else if ( msg == "rdiffApplyPatch(QString,QString)" ) {
361 QString baseFile, deltaFile; 361 QString baseFile, deltaFile;
362 stream >> baseFile >> deltaFile; 362 stream >> baseFile >> deltaFile;
363 if ( !QFile::exists( baseFile ) ) { 363 if ( !QFile::exists( baseFile ) ) {
364 QFile f( baseFile ); 364 QFile f( baseFile );
365 f.open( IO_WriteOnly ); 365 f.open( IO_WriteOnly );
366 f.close(); 366 f.close();
367 } 367 }
368 QRsync::applyDiff( baseFile, deltaFile ); 368 QRsync::applyDiff( baseFile, deltaFile );
369#ifndef QT_NO_COP 369#ifndef QT_NO_COP
370 QCopEnvelope e( "QPE/Desktop", "patchApplied(QString)" ); 370 QCopEnvelope e( "QPE/Desktop", "patchApplied(QString)" );
371 e << baseFile; 371 e << baseFile;
372#endif 372#endif
373 } else if ( msg == "rdiffCleanup()" ) { 373 } else if ( msg == "rdiffCleanup()" ) {
374 mkdir( "/tmp/rdiff" ); 374 mkdir( "/tmp/rdiff" );
375 QDir dir; 375 QDir dir;
376 dir.setPath( "/tmp/rdiff" ); 376 dir.setPath( "/tmp/rdiff" );
377 QStringList entries = dir.entryList(); 377 QStringList entries = dir.entryList();
378 for ( QStringList::Iterator it = entries.begin(); it != entries.end(); ++it ) 378 for ( QStringList::Iterator it = entries.begin(); it != entries.end(); ++it )
379 dir.remove( *it ); 379 dir.remove( *it );
380 } else if ( msg == "sendHandshakeInfo()" ) { 380 } else if ( msg == "sendHandshakeInfo()" ) {
381 QString home = getenv( "HOME" ); 381 QString home = getenv( "HOME" );
382#ifndef QT_NO_COP 382#ifndef QT_NO_COP
383 QCopEnvelope e( "QPE/Desktop", "handshakeInfo(QString,bool)" ); 383 QCopEnvelope e( "QPE/Desktop", "handshakeInfo(QString,bool)" );
384 e << home; 384 e << home;
385 int locked = (int) ServerApplication::screenLocked(); 385 int locked = (int) ServerApplication::screenLocked();
386 e << locked; 386 e << locked;
387#endif 387#endif
388 } else if ( msg == "sendVersionInfo()" ) { 388 } else if ( msg == "sendVersionInfo()" ) {
389 /* 389 /*
390 * QtopiaDesktop relies on the major number 390 * @&$*! Qtopiadesktop relies on the major number
391 * to start with 1. 391 * to start with 1. (or 2 as the case of version 2.1 will be)
392 * we need to fake at least 1.4 to be able 392 * we need to fake 1.7 to be able
393 * to sync with QtopiaDesktop1.6 393 * to sync with Qtopiadesktop 1.7.
394 * We'll send it Opie's version in the platform string for now,
395 * until such time when QD gets rewritten correctly.
394 */ 396 */
395 QCopEnvelope e( "QPE/Desktop", "versionInfo(QString,QString)" ); 397 QCopEnvelope e( "QPE/Desktop", "versionInfo(QString,QString)" );
396 QString opiename = "Opie"; 398
397 e << QString(QPE_VERSION) << opiename; 399 QString opiename = "Opie "+QString(QPE_VERSION);
400 QString QDVersion="1.7";
401 e << QDVersion << opiename;
402
398 } else if ( msg == "sendCardInfo()" ) { 403 } else if ( msg == "sendCardInfo()" ) {
399#ifndef QT_NO_COP 404#ifndef QT_NO_COP
400 QCopEnvelope e( "QPE/Desktop", "cardInfo(QString)" ); 405 QCopEnvelope e( "QPE/Desktop", "cardInfo(QString)" );
401#endif 406#endif
402 storage->update(); 407 storage->update();
403 const QList<FileSystem> &fs = storage->fileSystems(); 408 const QList<FileSystem> &fs = storage->fileSystems();
404 QListIterator<FileSystem> it ( fs ); 409 QListIterator<FileSystem> it ( fs );
405 QString s; 410 QString s;
406 QString homeDir = getenv("HOME"); 411 QString homeDir = getenv("HOME");
407 QString homeFs, homeFsPath; 412 QString homeFs, homeFsPath;
408 for ( ; it.current(); ++it ) { 413 for ( ; it.current(); ++it ) {
409 int k4 = (*it)->blockSize()/256; 414 int k4 = (*it)->blockSize()/256;
410 if ( (*it)->isRemovable() ) { 415 if ( (*it)->isRemovable() ) {
411 s += (*it)->name() + "=" + (*it)->path() + "/Documents " // No tr 416 s += (*it)->name() + "=" + (*it)->path() + "/Documents " // No tr
412 + QString::number( (*it)->availBlocks() * k4/4 ) 417 + QString::number( (*it)->availBlocks() * k4/4 )
413 + "K " + (*it)->options() + ";"; 418 + "K " + (*it)->options() + ";";
414 } else if ( homeDir.contains( (*it)->path() ) && 419 } else if ( homeDir.contains( (*it)->path() ) &&
415 (*it)->path().length() > homeFsPath.length() ) { 420 (*it)->path().length() > homeFsPath.length() ) {
416 homeFsPath = (*it)->path(); 421 homeFsPath = (*it)->path();
417 homeFs = 422 homeFs =
418 (*it)->name() + "=" + homeDir + "/Documents " // No tr 423 (*it)->name() + "=" + homeDir + "/Documents " // No tr
419 + QString::number( (*it)->availBlocks() * k4/4 ) 424 + QString::number( (*it)->availBlocks() * k4/4 )
420 + "K " + (*it)->options() + ";"; 425 + "K " + (*it)->options() + ";";
421 } 426 }
422 } 427 }
423 if ( !homeFs.isEmpty() ) 428 if ( !homeFs.isEmpty() )
424 s += homeFs; 429 s += homeFs;
425#ifndef QT_NO_COP 430#ifndef QT_NO_COP
426 e << s; 431 e << s;
427#endif 432#endif
428 } else if ( msg == "sendInstallLocations()" ) { 433 } else if ( msg == "sendInstallLocations()" ) {
429#ifndef QT_NO_COP 434#ifndef QT_NO_COP
430 QCopEnvelope e( "QPE/Desktop", "installLocations(QString)" ); 435 QCopEnvelope e( "QPE/Desktop", "installLocations(QString)" );
431 e << installLocationsString(); 436 e << installLocationsString();
432#endif 437#endif
433 } else if ( msg == "sendSyncDate(QString)" ) { 438 } else if ( msg == "sendSyncDate(QString)" ) {
434 QString app; 439 QString app;
435 stream >> app; 440 stream >> app;
436 Config cfg( "qpe" ); 441 Config cfg( "qpe" );
437 cfg.setGroup("SyncDate"); 442 cfg.setGroup("SyncDate");
438#ifndef QT_NO_COP 443#ifndef QT_NO_COP
439 QCopEnvelope e( "QPE/Desktop", "syncDate(QString,QString)" ); 444 QCopEnvelope e( "QPE/Desktop", "syncDate(QString,QString)" );
440 e << app << cfg.readEntry( app ); 445 e << app << cfg.readEntry( app );
441#endif 446#endif
442 //odebug << "QPE/System sendSyncDate for " << app.latin1() << ": response " 447 //odebug << "QPE/System sendSyncDate for " << app.latin1() << ": response "
443 // << cfg.readEntry( app ).latin1() << oendl; 448 // << cfg.readEntry( app ).latin1() << oendl;
444 } else if ( msg == "setSyncDate(QString,QString)" ) { 449 } else if ( msg == "setSyncDate(QString,QString)" ) {
445 QString app, date; 450 QString app, date;
446 stream >> app >> date; 451 stream >> app >> date;
447 Config cfg( "qpe" ); 452 Config cfg( "qpe" );
448 cfg.setGroup("SyncDate"); 453 cfg.setGroup("SyncDate");
449 cfg.writeEntry( app, date ); 454 cfg.writeEntry( app, date );
450 //odebug << "setSyncDate(QString,QString) " << app << " " << date << "" << oendl; 455 //odebug << "setSyncDate(QString,QString) " << app << " " << date << "" << oendl;
451 } else if ( msg == "startSync(QString)" ) { 456 } else if ( msg == "startSync(QString)" ) {
452 QString what; 457 QString what;
453 stream >> what; 458 stream >> what;
454 delete syncDialog; 459 delete syncDialog;
455 syncDialog = new SyncDialog( this, what ); 460 syncDialog = new SyncDialog( this, what );
456 syncDialog->show(); 461 syncDialog->show();
457 connect( syncDialog, SIGNAL(cancel()), SLOT(cancelSync()) ); 462 connect( syncDialog, SIGNAL(cancel()), SLOT(cancelSync()) );
458 } else if ( msg == "stopSync()") { 463 } else if ( msg == "stopSync()") {
459 delete syncDialog; 464 delete syncDialog;
460 syncDialog = 0; 465 syncDialog = 0;
461 } else if (msg == "restoreDone(QString)") { 466 } else if (msg == "restoreDone(QString)") {
462 docList->restoreDone(); 467 docList->restoreDone();
463 } else if ( msg == "getAllDocLinks()" ) { 468 } else if ( msg == "getAllDocLinks()" ) {
464 docList->sendAllDocLinks(); 469 docList->sendAllDocLinks();
465 } 470 }
466#ifdef QPE_HAVE_DIRECT_ACCESS 471#ifdef QPE_HAVE_DIRECT_ACCESS
467 else if ( msg == "prepareDirectAccess()" ) { 472 else if ( msg == "prepareDirectAccess()" ) {
468 prepareDirectAccess(); 473 prepareDirectAccess();
469 } else if ( msg == "postDirectAccess()" ) { 474 } else if ( msg == "postDirectAccess()" ) {
470 postDirectAccess(); 475 postDirectAccess();
471 } 476 }
472#endif 477#endif
473#ifdef Q_WS_QWS 478#ifdef Q_WS_QWS
474 479
475 else if ( msg == "setMouseProto(QString)" ) { 480 else if ( msg == "setMouseProto(QString)" ) {
476 QString mice; 481 QString mice;
477 stream >> mice; 482 stream >> mice;
478 setenv("QWS_MOUSE_PROTO",mice.latin1(),1); 483 setenv("QWS_MOUSE_PROTO",mice.latin1(),1);
479 qwsServer->openMouse(); 484 qwsServer->openMouse();
480 } else if ( msg == "setKeyboard(QString)" ) { 485 } else if ( msg == "setKeyboard(QString)" ) {
481 QString kb; 486 QString kb;
482 stream >> kb; 487 stream >> kb;
483 setenv("QWS_KEYBOARD",kb.latin1(),1); 488 setenv("QWS_KEYBOARD",kb.latin1(),1);
484 qwsServer->openKeyboard(); 489 qwsServer->openKeyboard();
485 } else if ( msg == "setKeyboardAutoRepeat(int,int)" ) { 490 } else if ( msg == "setKeyboardAutoRepeat(int,int)" ) {
486 int delay, period; 491 int delay, period;
487 stream >> delay >> period; 492 stream >> delay >> period;
488 qwsSetKeyboardAutoRepeat( delay, period ); 493 qwsSetKeyboardAutoRepeat( delay, period );
489 Config cfg( "qpe" ); 494 Config cfg( "qpe" );
490 cfg.setGroup("Keyboard"); 495 cfg.setGroup("Keyboard");
491 cfg.writeEntry( "RepeatDelay", delay ); 496 cfg.writeEntry( "RepeatDelay", delay );
492 cfg.writeEntry( "RepeatPeriod", period ); 497 cfg.writeEntry( "RepeatPeriod", period );
493 } else if ( msg == "setKeyboardLayout(QString)" ) { 498 } else if ( msg == "setKeyboardLayout(QString)" ) {
494 QString kb; 499 QString kb;
495 stream >> kb; 500 stream >> kb;
496 setKeyboardLayout( kb ); 501 setKeyboardLayout( kb );
497 Config cfg( "qpe" ); 502 Config cfg( "qpe" );
498 cfg.setGroup("Keyboard"); 503 cfg.setGroup("Keyboard");
499 cfg.writeEntry( "Layout", kb ); 504 cfg.writeEntry( "Layout", kb );
500 } else if ( msg == "autoStart(QString)" ) { 505 } else if ( msg == "autoStart(QString)" ) {
501 QString appName; 506 QString appName;
502 stream >> appName; 507 stream >> appName;
503 Config cfg( "autostart" ); 508 Config cfg( "autostart" );
504 cfg.setGroup( "AutoStart" ); 509 cfg.setGroup( "AutoStart" );
505 if ( appName.compare("clear") == 0){ 510 if ( appName.compare("clear") == 0){
506 cfg.writeEntry("Apps", ""); 511 cfg.writeEntry("Apps", "");
507 } 512 }
508 } else if ( msg == "autoStart(QString,QString)" ) { 513 } else if ( msg == "autoStart(QString,QString)" ) {
509 QString modifier, appName; 514 QString modifier, appName;
510 stream >> modifier >> appName; 515 stream >> modifier >> appName;
511 Config cfg( "autostart" ); 516 Config cfg( "autostart" );
512 cfg.setGroup( "AutoStart" ); 517 cfg.setGroup( "AutoStart" );
513 if ( modifier.compare("add") == 0 ){ 518 if ( modifier.compare("add") == 0 ){
514 // only add if appname is entered 519 // only add if appname is entered
515 if (!appName.isEmpty()) { 520 if (!appName.isEmpty()) {
516 cfg.writeEntry("Apps", appName); 521 cfg.writeEntry("Apps", appName);
517 } 522 }
518 } else if (modifier.compare("remove") == 0 ) { 523 } else if (modifier.compare("remove") == 0 ) {
519 // need to change for multiple entries 524 // need to change for multiple entries
520 // actually remove is right now simular to clear, but in future there 525 // actually remove is right now simular to clear, but in future there
521 // should be multiple apps in autostart possible. 526 // should be multiple apps in autostart possible.
522 QString checkName; 527 QString checkName;
523 checkName = cfg.readEntry("Apps", ""); 528 checkName = cfg.readEntry("Apps", "");
524 if (checkName == appName) { 529 if (checkName == appName) {
525 cfg.writeEntry("Apps", ""); 530 cfg.writeEntry("Apps", "");
526 } 531 }
527 } 532 }
528 // case the autostart feature should be delayed 533 // case the autostart feature should be delayed
529 } else if ( msg == "autoStart(QString,QString,QString)") { 534 } else if ( msg == "autoStart(QString,QString,QString)") {
530 QString modifier, appName, delay; 535 QString modifier, appName, delay;
531 stream >> modifier >> appName >> delay; 536 stream >> modifier >> appName >> delay;
532 Config cfg( "autostart" ); 537 Config cfg( "autostart" );
533 538
534 cfg.setGroup( "AutoStart" ); 539 cfg.setGroup( "AutoStart" );
535 if ( modifier.compare("add") == 0 ){ 540 if ( modifier.compare("add") == 0 ){
536 // only add it appname is entered 541 // only add it appname is entered
537 if (!appName.isEmpty()) { 542 if (!appName.isEmpty()) {
538 cfg.writeEntry("Apps", appName); 543 cfg.writeEntry("Apps", appName);
539 cfg.writeEntry("Delay", delay); 544 cfg.writeEntry("Delay", delay);
540 } 545 }
541 } 546 }
542 } 547 }
543#endif 548#endif
544} 549}
545 550
546QString Server::cardInfoString() 551QString Server::cardInfoString()
547{ 552{
548 storage->update(); 553 storage->update();
549 const QList<FileSystem> &fs = storage->fileSystems(); 554 const QList<FileSystem> &fs = storage->fileSystems();
550 QListIterator<FileSystem> it ( fs ); 555 QListIterator<FileSystem> it ( fs );
551 QString s; 556 QString s;
552 QString homeDir = getenv("HOME"); 557 QString homeDir = getenv("HOME");
553 QString homeFs, homeFsPath; 558 QString homeFs, homeFsPath;
554 for ( ; it.current(); ++it ) { 559 for ( ; it.current(); ++it ) {
555 int k4 = (*it)->blockSize()/256; 560 int k4 = (*it)->blockSize()/256;
556 if ( (*it)->isRemovable() ) { 561 if ( (*it)->isRemovable() ) {
557 s += (*it)->name() + "=" + (*it)->path() + "/Documents " // No tr 562 s += (*it)->name() + "=" + (*it)->path() + "/Documents " // No tr
558 + QString::number( (*it)->availBlocks() * k4/4 ) 563 + QString::number( (*it)->availBlocks() * k4/4 )
559 + "K " + (*it)->options() + ";"; 564 + "K " + (*it)->options() + ";";
560 } else if ( homeDir.contains( (*it)->path() ) && 565 } else if ( homeDir.contains( (*it)->path() ) &&
561 (*it)->path().length() > homeFsPath.length() ) { 566 (*it)->path().length() > homeFsPath.length() ) {
562 homeFsPath = (*it)->path(); 567 homeFsPath = (*it)->path();
563 homeFs = 568 homeFs =
564 (*it)->name() + "=" + homeDir + "/Documents " // No tr 569 (*it)->name() + "=" + homeDir + "/Documents " // No tr
565 + QString::number( (*it)->availBlocks() * k4/4 ) 570 + QString::number( (*it)->availBlocks() * k4/4 )
566 + "K " + (*it)->options() + ";"; 571 + "K " + (*it)->options() + ";";
567 } 572 }
568 } 573 }
569 if ( !homeFs.isEmpty() ) 574 if ( !homeFs.isEmpty() )
570 s += homeFs; 575 s += homeFs;
571 return s; 576 return s;
572} 577}
573 578
574QString Server::installLocationsString() 579QString Server::installLocationsString()
575{ 580{
576 storage->update(); 581 storage->update();
577 const QList<FileSystem> &fs = storage->fileSystems(); 582 const QList<FileSystem> &fs = storage->fileSystems();
578 QListIterator<FileSystem> it ( fs ); 583 QListIterator<FileSystem> it ( fs );
579 QString s; 584 QString s;
580 QString homeDir = getenv("HOME"); 585 QString homeDir = getenv("HOME");
581 QString homeFs, homeFsPath; 586 QString homeFs, homeFsPath;
582 for ( ; it.current(); ++it ) { 587 for ( ; it.current(); ++it ) {
583 int k4 = (*it)->blockSize()/256; 588 int k4 = (*it)->blockSize()/256;
584 if ( (*it)->isRemovable() ) { 589 if ( (*it)->isRemovable() ) {
585 s += (*it)->name() + "=" + (*it)->path() + " " // No tr 590 s += (*it)->name() + "=" + (*it)->path() + " " // No tr
586 + QString::number( (*it)->availBlocks() * k4/4 ) 591 + QString::number( (*it)->availBlocks() * k4/4 )
587 + "K " + (*it)->options() + ";"; 592 + "K " + (*it)->options() + ";";
588 } else if ( homeDir.contains( (*it)->path() ) && 593 } else if ( homeDir.contains( (*it)->path() ) &&
589 (*it)->path().length() > homeFsPath.length() ) { 594 (*it)->path().length() > homeFsPath.length() ) {