summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/firstuse.cpp6
-rw-r--r--pics/launcher/firstuse.jpgbin0 -> 12739 bytes
2 files changed, 2 insertions, 4 deletions
diff --git a/core/launcher/firstuse.cpp b/core/launcher/firstuse.cpp
index e9e2d83..acddeea 100644
--- a/core/launcher/firstuse.cpp
+++ b/core/launcher/firstuse.cpp
@@ -405,100 +405,98 @@ void FirstUse::reloadLanguages()
405 405
406 transLib = new QTranslator(qApp); 406 transLib = new QTranslator(qApp);
407 tfn = QPEApplication::qpeDir() + "i18n/"+l+"/libqpe.qm"; 407 tfn = QPEApplication::qpeDir() + "i18n/"+l+"/libqpe.qm";
408 owarn << "loading " + tfn << oendl; 408 owarn << "loading " + tfn << oendl;
409 if ( transLib->load(tfn) ) { 409 if ( transLib->load(tfn) ) {
410 owarn << "installing translator library" << oendl; 410 owarn << "installing translator library" << oendl;
411 qApp->installTranslator( transLib ); 411 qApp->installTranslator( transLib );
412 } else { 412 } else {
413 delete transLib; 413 delete transLib;
414 transLib = 0; 414 transLib = 0;
415 } 415 }
416 loadPixmaps(); 416 loadPixmaps();
417 //###language/font hack; should look it up somewhere 417 //###language/font hack; should look it up somewhere
418#ifdef Q_WS_QWS 418#ifdef Q_WS_QWS
419 if ( l == "ja" || l == "zh_CN" || l == "zh_TW" || l == "ko" ) { 419 if ( l == "ja" || l == "zh_CN" || l == "zh_TW" || l == "ko" ) {
420 QFont fn = FontManager::unicodeFont( FontManager::Proportional ); 420 QFont fn = FontManager::unicodeFont( FontManager::Proportional );
421 qApp->setFont( fn, TRUE ); 421 qApp->setFont( fn, TRUE );
422 } else { 422 } else {
423 qApp->setFont( defaultFont, TRUE ); 423 qApp->setFont( defaultFont, TRUE );
424 } 424 }
425#endif 425#endif
426#endif 426#endif
427} 427}
428 428
429void FirstUse::paintEvent( QPaintEvent * ) 429void FirstUse::paintEvent( QPaintEvent * )
430{ 430{
431 QPainter p( this ); 431 QPainter p( this );
432 432
433 p.drawPixmap(0,0, splash); 433 p.drawPixmap(0,0, splash);
434 434
435 QFont f = p.font(); 435 QFont f = p.font();
436 f.setPointSize(15); 436 f.setPointSize(15);
437 f.setItalic(FALSE); 437 f.setItalic(FALSE);
438 f.setBold(FALSE); 438 f.setBold(FALSE);
439 p.setFont(f); 439 p.setFont(f);
440 440
441 if ( currApp < 0 ) { 441 if ( currApp < 0 ) {
442 drawText(p, tr( "Tap anywhere on the screen to continue." )); 442 drawText(p, tr( "Tap anywhere on the screen to continue." ));
443 } else if ( settingsTable[currApp].app ) { 443 } else if ( settingsTable[currApp].app ) {
444 if ( waitingForLaunch ) 444 if ( waitingForLaunch )
445 drawText(p, tr("Please wait, loading %1 settings.").arg(tr(settingsTable[currApp].desc)) ); 445 drawText(p, tr("Please wait, loading %1 settings.").arg(tr(settingsTable[currApp].desc)) );
446 } else { 446 } else {
447 drawText(p, tr("Please wait...")); 447 drawText(p, tr("Please wait..."));
448 } 448 }
449} 449}
450 450
451void FirstUse::loadPixmaps() 451void FirstUse::loadPixmaps()
452{ 452{
453 /* create background, tr so can change image with language. 453 splash.convertFromImage( Resource::loadImage("launcher/firstuse")
454 images will likely contain text. */ 454 .smoothScale( width(), height() ) );
455 splash.convertFromImage( Resource::loadImage(tr("FirstUseBackground"))
456 .smoothScale( width(), height() ) );
457 455
458 setBackgroundPixmap(splash); 456 setBackgroundPixmap(splash);
459} 457}
460 458
461void FirstUse::drawText(QPainter &p, const QString &text) 459void FirstUse::drawText(QPainter &p, const QString &text)
462{ 460{
463 QString altered = "<CENTER>" + text + "</CENTER>"; 461 QString altered = "<CENTER>" + text + "</CENTER>";
464 462
465 QSimpleRichText rt(altered, p.font()); 463 QSimpleRichText rt(altered, p.font());
466 rt.setWidth(width() - 20); 464 rt.setWidth(width() - 20);
467 465
468 int h = (height() * 3) / 10; // start at 30% 466 int h = (height() * 3) / 10; // start at 30%
469 if (rt.height() < height() / 2) 467 if (rt.height() < height() / 2)
470 h += ((height() / 2) - rt.height()) / 2; 468 h += ((height() / 2) - rt.height()) / 2;
471 rt.draw(&p, 10, h, QRegion(0,0, width()-20, height()), palette()); 469 rt.draw(&p, 10, h, QRegion(0,0, width()-20, height()), palette());
472} 470}
473 471
474void FirstUse::updateButtons() 472void FirstUse::updateButtons()
475{ 473{
476 if ( currApp >= 0 ) { 474 if ( currApp >= 0 ) {
477 taskBar->show(); 475 taskBar->show();
478 } 476 }
479 477
480 int i = currApp-1; 478 int i = currApp-1;
481 while ( i >= 0 && !settingsTable[i].enabled ) 479 while ( i >= 0 && !settingsTable[i].enabled )
482 i--; 480 i--;
483 back->setText(tr("<< Back")); 481 back->setText(tr("<< Back"));
484 back->setEnabled( i >= 0 && !waitingForLaunch ); 482 back->setEnabled( i >= 0 && !waitingForLaunch );
485 483
486 i = currApp+1; 484 i = currApp+1;
487 while ( settingsTable[i].app && !settingsTable[i].enabled ) 485 while ( settingsTable[i].app && !settingsTable[i].enabled )
488 i++; 486 i++;
489 if ( !settingsTable[i].app ) 487 if ( !settingsTable[i].app )
490 next->setText(tr("Finish")); 488 next->setText(tr("Finish"));
491 else 489 else
492 next->setText(tr("Next >>")); 490 next->setText(tr("Next >>"));
493 491
494 next->setEnabled( !waitingForLaunch ); 492 next->setEnabled( !waitingForLaunch );
495} 493}
496 494
497void FirstUse::keyPressEvent( QKeyEvent *e ) 495void FirstUse::keyPressEvent( QKeyEvent *e )
498{ 496{
499 // Allow cancelling at first dialog, in case display is broken. 497 // Allow cancelling at first dialog, in case display is broken.
500 if ( e->key() == Key_Escape && currApp < 0 ) 498 if ( e->key() == Key_Escape && currApp < 0 )
501 QDialog::keyPressEvent(e); 499 QDialog::keyPressEvent(e);
502} 500}
503 501
504void FirstUse::mouseReleaseEvent( QMouseEvent * ) 502void FirstUse::mouseReleaseEvent( QMouseEvent * )
diff --git a/pics/launcher/firstuse.jpg b/pics/launcher/firstuse.jpg
new file mode 100644
index 0000000..92fb044
--- a/dev/null
+++ b/pics/launcher/firstuse.jpg
Binary files differ