summaryrefslogtreecommitdiff
authorfbarros <fbarros>2002-08-29 17:49:16 (UTC)
committer fbarros <fbarros>2002-08-29 17:49:16 (UTC)
commit6707dd2b7abf2fac4aef4025cf8e554577d0891c (patch) (unidiff)
tree0991d5274dc372dc089368deac74abb96ad6e413
parentf30d948cc7fec19a00ebc131b5b1ace159212a81 (diff)
downloadopie-6707dd2b7abf2fac4aef4025cf8e554577d0891c.zip
opie-6707dd2b7abf2fac4aef4025cf8e554577d0891c.tar.gz
opie-6707dd2b7abf2fac4aef4025cf8e554577d0891c.tar.bz2
just a tr()
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/tools/clock/clock.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/tools/clock/clock.cpp b/noncore/tools/clock/clock.cpp
index 69d8214..e3621d9 100644
--- a/noncore/tools/clock/clock.cpp
+++ b/noncore/tools/clock/clock.cpp
@@ -356,129 +356,129 @@ void Clock::alarmOn()
356{ 356{
357 QDate d = QDate::currentDate(); 357 QDate d = QDate::currentDate();
358 QTime tm((int)hour,(int)minute,0); 358 QTime tm((int)hour,(int)minute,0);
359 qDebug("Time set "+tm.toString()); 359 qDebug("Time set "+tm.toString());
360 QTime t = QTime::currentTime(); 360 QTime t = QTime::currentTime();
361 if( t > tm) 361 if( t > tm)
362 d = d.addDays(1); 362 d = d.addDays(1);
363 int warn = 0; 363 int warn = 0;
364 QDateTime whenl(d,tm); 364 QDateTime whenl(d,tm);
365 when=whenl; 365 when=whenl;
366 AlarmServer::addAlarm( when, 366 AlarmServer::addAlarm( when,
367 "QPE/Application/clock", 367 "QPE/Application/clock",
368 "alarm(QDateTime,int)", warn ); 368 "alarm(QDateTime,int)", warn );
369 setCaption("Alarm set: "+ whenl.toString()); 369 setCaption("Alarm set: "+ whenl.toString());
370} 370}
371 371
372void Clock::alarmOff() 372void Clock::alarmOff()
373{ 373{
374 int warn = 0; 374 int warn = 0;
375 bSound=FALSE; 375 bSound=FALSE;
376 AlarmServer::deleteAlarm( when, 376 AlarmServer::deleteAlarm( when,
377 "QPE/Application/clock", 377 "QPE/Application/clock",
378 "alarm(QDateTime,int)", warn ); 378 "alarm(QDateTime,int)", warn );
379 qDebug("Alarm Off "+ when.toString()); 379 qDebug("Alarm Off "+ when.toString());
380 setCaption("Clock"); 380 setCaption("Clock");
381} 381}
382 382
383void Clock::appMessage(const QCString& msg, const QByteArray& data) 383void Clock::appMessage(const QCString& msg, const QByteArray& data)
384{ 384{
385 int stopTimer = 0; 385 int stopTimer = 0;
386 int timerStay = 5000; 386 int timerStay = 5000;
387 bSound=TRUE; 387 bSound=TRUE;
388 qDebug("Message received in clock"); 388 qDebug("Message received in clock");
389 if ( msg == "alarm(QDateTime,int)" ) { 389 if ( msg == "alarm(QDateTime,int)" ) {
390 Config config( "qpe" ); 390 Config config( "qpe" );
391 config.setGroup("Time"); 391 config.setGroup("Time");
392 if(config.readBoolEntry("mp3Alarm",0)){ 392 if(config.readBoolEntry("mp3Alarm",0)){
393 393
394 QCopEnvelope e("QPE/Application/opieplayer","setDocument(QString)"); 394 QCopEnvelope e("QPE/Application/opieplayer","setDocument(QString)");
395 e<<config.readEntry("mp3File",""); 395 e<<config.readEntry("mp3File","");
396 } else { 396 } else {
397 397
398 Sound::soundAlarm(); 398 Sound::soundAlarm();
399 stopTimer = startTimer( timerStay); 399 stopTimer = startTimer( timerStay);
400 } 400 }
401 } 401 }
402 show(); 402 show();
403 raise(); 403 raise();
404 QPEApplication::setKeepRunning(); 404 QPEApplication::setKeepRunning();
405 setActiveWindow(); 405 setActiveWindow();
406} 406}
407 407
408void Clock::timerEvent( QTimerEvent *e ) 408void Clock::timerEvent( QTimerEvent *e )
409{ 409{
410 static int stop = 0; 410 static int stop = 0;
411 if ( stop < 120 && bSound) { 411 if ( stop < 120 && bSound) {
412 Sound::soundAlarm(); 412 Sound::soundAlarm();
413 stop++; 413 stop++;
414 } else { 414 } else {
415 stop = 0; 415 stop = 0;
416 killTimer( e->timerId() ); 416 killTimer( e->timerId() );
417 alarmOffBtn->setText( tr( "Alarm Is Off" ) ); 417 alarmOffBtn->setText( tr( "Alarm Is Off" ) );
418 alarmBool=FALSE; 418 alarmBool=FALSE;
419 snoozeBtn->hide(); 419 snoozeBtn->hide();
420 setCaption("Clock: Alarm was missed."); 420 setCaption(tr("Clock: Alarm was missed."));
421 } 421 }
422} 422}
423 423
424 424
425QSizePolicy AnalogClock::sizePolicy() const 425QSizePolicy AnalogClock::sizePolicy() const
426{ 426{
427 return QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ); 427 return QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding );
428} 428}
429 429
430void AnalogClock::drawContents( QPainter *p ) 430void AnalogClock::drawContents( QPainter *p )
431{ 431{
432 QRect r = contentsRect(); 432 QRect r = contentsRect();
433 QPoint center( r.x() + r.width() / 2, r.y() + r.height() / 2 ); 433 QPoint center( r.x() + r.width() / 2, r.y() + r.height() / 2 );
434 434
435 QPoint l1( r.x() + r.width() / 2, r.y() + 2 ); 435 QPoint l1( r.x() + r.width() / 2, r.y() + 2 );
436 QPoint l2( r.x() + r.width() / 2, r.y() + 8 ); 436 QPoint l2( r.x() + r.width() / 2, r.y() + 8 );
437 437
438 QPoint h1( r.x() + r.width() / 2, r.y() + r.height() / 4 ); 438 QPoint h1( r.x() + r.width() / 2, r.y() + r.height() / 4 );
439 QPoint h2( r.x() + r.width() / 2, r.y() + r.height() / 2 ); 439 QPoint h2( r.x() + r.width() / 2, r.y() + r.height() / 2 );
440 440
441 QPoint m1( r.x() + r.width() / 2, r.y() + r.height() / 8 ); 441 QPoint m1( r.x() + r.width() / 2, r.y() + r.height() / 8 );
442 QPoint m2( r.x() + r.width() / 2, r.y() + r.height() / 2 ); 442 QPoint m2( r.x() + r.width() / 2, r.y() + r.height() / 2 );
443 443
444 QPoint s1( r.x() + r.width() / 2, r.y() + 8 ); 444 QPoint s1( r.x() + r.width() / 2, r.y() + 8 );
445 QPoint s2( r.x() + r.width() / 2, r.y() + r.height() / 2 ); 445 QPoint s2( r.x() + r.width() / 2, r.y() + r.height() / 2 );
446 446
447 QColor color( clear ? backgroundColor() : black ); 447 QColor color( clear ? backgroundColor() : black );
448 QTime time = clear ? prevTime : currTime; 448 QTime time = clear ? prevTime : currTime;
449 449
450 if ( clear && prevTime.secsTo(currTime) > 1 ) { 450 if ( clear && prevTime.secsTo(currTime) > 1 ) {
451 p->eraseRect( rect() ); 451 p->eraseRect( rect() );
452 return; 452 return;
453 } 453 }
454 454
455 if ( !clear ) { 455 if ( !clear ) {
456 // draw ticks 456 // draw ticks
457 p->setPen( QPen( color, 1 ) ); 457 p->setPen( QPen( color, 1 ) );
458 for ( int i = 0; i < 12; i++ ) 458 for ( int i = 0; i < 12; i++ )
459 p->drawLine( rotate( center, l1, i * 30 ), rotate( center, l2, i * 30 ) ); 459 p->drawLine( rotate( center, l1, i * 30 ), rotate( center, l2, i * 30 ) );
460 } 460 }
461 461
462 if ( !clear || prevTime.minute() != currTime.minute() || 462 if ( !clear || prevTime.minute() != currTime.minute() ||
463 prevTime.hour() != currTime.hour() ) { 463 prevTime.hour() != currTime.hour() ) {
464 // draw hour pointer 464 // draw hour pointer
465 h1 = rotate( center, h1, 30 * ( time.hour() % 12 ) + time.minute() / 2 ); 465 h1 = rotate( center, h1, 30 * ( time.hour() % 12 ) + time.minute() / 2 );
466 h2 = rotate( center, h2, 30 * ( time.hour() % 12 ) + time.minute() / 2 ); 466 h2 = rotate( center, h2, 30 * ( time.hour() % 12 ) + time.minute() / 2 );
467 p->setPen( QPen( color, 3 ) ); 467 p->setPen( QPen( color, 3 ) );
468 p->drawLine( h1, h2 ); 468 p->drawLine( h1, h2 );
469 } 469 }
470 470
471 if ( !clear || prevTime.minute() != currTime.minute() ) { 471 if ( !clear || prevTime.minute() != currTime.minute() ) {
472 // draw minute pointer 472 // draw minute pointer
473 m1 = rotate( center, m1, time.minute() * 6 ); 473 m1 = rotate( center, m1, time.minute() * 6 );
474 m2 = rotate( center, m2, time.minute() * 6 ); 474 m2 = rotate( center, m2, time.minute() * 6 );
475 p->setPen( QPen( color, 2 ) ); 475 p->setPen( QPen( color, 2 ) );
476 p->drawLine( m1, m2 ); 476 p->drawLine( m1, m2 );
477 } 477 }
478 478
479 // draw second pointer 479 // draw second pointer
480 s1 = rotate( center, s1, time.second() * 6 ); 480 s1 = rotate( center, s1, time.second() * 6 );
481 s2 = rotate( center, s2, time.second() * 6 ); 481 s2 = rotate( center, s2, time.second() * 6 );
482 p->setPen( QPen( color, 1 ) ); 482 p->setPen( QPen( color, 1 ) );
483 p->drawLine( s1, s2 ); 483 p->drawLine( s1, s2 );
484 484