summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/today/clickablelabel.cpp6
-rw-r--r--core/pim/today/today.cpp20
2 files changed, 13 insertions, 13 deletions
diff --git a/core/pim/today/clickablelabel.cpp b/core/pim/today/clickablelabel.cpp
index 6912c34..e11cef6 100644
--- a/core/pim/today/clickablelabel.cpp
+++ b/core/pim/today/clickablelabel.cpp
@@ -1,29 +1,29 @@
1#include "clickablelabel.h" 1#include "clickablelabel.h"
2 2
3ClickableLabel::ClickableLabel(QWidget* parent = 0, 3ClickableLabel::ClickableLabel(QWidget* parent,
4 const char* name = 0, 4 const char* name,
5 WFlags fl = 0) : 5 WFlags fl) :
6 QLabel(parent,name,fl) 6 QLabel(parent,name,fl)
7{ 7{
8 setFrameShape(NoFrame); 8 setFrameShape(NoFrame);
9 setFrameShadow(Sunken); 9 setFrameShadow(Sunken);
10} 10}
11 11
12void ClickableLabel::mousePressEvent( QMouseEvent *e ) { 12void ClickableLabel::mousePressEvent( QMouseEvent *e ) {
13 setFrameShape(Panel); 13 setFrameShape(Panel);
14 repaint(); 14 repaint();
15} 15}
16 16
17void ClickableLabel::mouseReleaseEvent( QMouseEvent *e ) { 17void ClickableLabel::mouseReleaseEvent( QMouseEvent *e ) {
18 setFrameShape(NoFrame); 18 setFrameShape(NoFrame);
19 repaint(); 19 repaint();
20 if (rect().contains(e->pos())) { 20 if (rect().contains(e->pos())) {
21 emit clicked(); 21 emit clicked();
22 } 22 }
23} 23}
24 24
25void ClickableLabel::mouseMoveEvent( QMouseEvent *e ) { 25void ClickableLabel::mouseMoveEvent( QMouseEvent *e ) {
26 if (rect().contains(e->pos())) { 26 if (rect().contains(e->pos())) {
27 setFrameShape(Panel); 27 setFrameShape(Panel);
28 } else { 28 } else {
29 setFrameShape(NoFrame); 29 setFrameShape(NoFrame);
diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp
index 01d1a13..1b4408c 100644
--- a/core/pim/today/today.cpp
+++ b/core/pim/today/today.cpp
@@ -447,53 +447,53 @@ void Today::editEvent(const Event &e) {
447void Today::startTodo() { 447void Today::startTodo() {
448 QCopEnvelope e("QPE/System", "execute(QString)"); 448 QCopEnvelope e("QPE/System", "execute(QString)");
449 e << QString("todolist"); 449 e << QString("todolist");
450} 450}
451 451
452/* 452/*
453 * launch opiemail 453 * launch opiemail
454 */ 454 */
455void Today::startMail() { 455void Today::startMail() {
456 QCopEnvelope e("QPE/System", "execute(QString)"); 456 QCopEnvelope e("QPE/System", "execute(QString)");
457 e << QString("opiemail"); 457 e << QString("opiemail");
458//Right now start both, maybe decide which to rum via config file .. 458//Right now start both, maybe decide which to rum via config file ..
459 QCopEnvelope f("QPE/System", "execute(QString)"); 459 QCopEnvelope f("QPE/System", "execute(QString)");
460 f << QString("qtmail"); 460 f << QString("qtmail");
461} 461}
462 462
463 463
464Today::~Today() { 464Today::~Today() {
465} 465}
466 466
467/* 467/*
468 * Gets the events for the current day, if it should get all dates 468 * Gets the events for the current day, if it should get all dates
469 */ 469 */
470DateBookEvent::DateBookEvent(const EffectiveEvent &ev, 470DateBookEvent::DateBookEvent(const EffectiveEvent &ev,
471 QWidget* parent = 0, 471 QWidget* parent,
472 int SHOW_LOCATION = 0, 472 int SHOW_LOCATION,
473 int SHOW_NOTES = 0, 473 int SHOW_NOTES,
474 const char* name = 0, 474 const char* name,
475 WFlags fl = 0) : 475 WFlags fl) :
476 ClickableLabel(parent,name,fl), event(ev) { 476 ClickableLabel(parent,name,fl), event(ev) {
477 477
478 QString msg; 478 QString msg;
479 //QTime time = QTime::currentTime(); 479 //QTime time = QTime::currentTime();
480 480
481 Config config( "qpe" ); 481 Config config( "qpe" );
482 config.setGroup( "Time" ); 482 config.setGroup( "Time" );
483 // if 24 h format 483 // if 24 h format
484 ampm = config.readBoolEntry( "AMPM", TRUE ); 484 ampm = config.readBoolEntry( "AMPM", TRUE );
485 485
486 486
487 if (!ONLY_LATER) { 487 if (!ONLY_LATER) {
488 msg += "<B>" + (ev).description() + "</B>"; 488 msg += "<B>" + (ev).description() + "</B>";
489 if ( (ev).event().hasAlarm() ) { 489 if ( (ev).event().hasAlarm() ) {
490 msg += " <b>[with alarm]</b>"; 490 msg += " <b>[with alarm]</b>";
491 } 491 }
492 // include location or not 492 // include location or not
493 if (SHOW_LOCATION == 1) { 493 if (SHOW_LOCATION == 1) {
494 msg += "<BR><i>" + (ev).location() + "</i>"; 494 msg += "<BR><i>" + (ev).location() + "</i>";
495 } 495 }
496 496
497 if ( (TimeString::timeString(QTime((ev).event().start().time()) ) == "00:00") && (TimeString::timeString(QTime((ev).event().end().time()) ) == "23:59") ) { 497 if ( (TimeString::timeString(QTime((ev).event().start().time()) ) == "00:00") && (TimeString::timeString(QTime((ev).event().end().time()) ) == "23:59") ) {
498 msg += "<br>All day"; 498 msg += "<br>All day";
499 } else { 499 } else {
@@ -514,53 +514,53 @@ DateBookEvent::DateBookEvent(const EffectiveEvent &ev,
514} 514}
515 515
516 516
517QString DateBookEvent::ampmTime(QTime tm) { 517QString DateBookEvent::ampmTime(QTime tm) {
518 518
519 QString s; 519 QString s;
520 if( ampm ) { 520 if( ampm ) {
521 int hour = tm.hour(); 521 int hour = tm.hour();
522 if (hour == 0) 522 if (hour == 0)
523 hour = 12; 523 hour = 12;
524 if (hour > 12) 524 if (hour > 12)
525 hour -= 12; 525 hour -= 12;
526 s.sprintf( "%2d:%02d %s", hour, tm.minute(), 526 s.sprintf( "%2d:%02d %s", hour, tm.minute(),
527 (tm.hour() >= 12) ? "PM" : "AM" ); 527 (tm.hour() >= 12) ? "PM" : "AM" );
528 return s; 528 return s;
529 } else { 529 } else {
530 s.sprintf( "%2d:%02d", tm.hour(), tm.minute() ); 530 s.sprintf( "%2d:%02d", tm.hour(), tm.minute() );
531 return s; 531 return s;
532 } 532 }
533 533
534} 534}
535 535
536 536
537DateBookEventLater::DateBookEventLater(const EffectiveEvent &ev, 537DateBookEventLater::DateBookEventLater(const EffectiveEvent &ev,
538 QWidget* parent = 0, 538 QWidget* parent,
539 int SHOW_LOCATION = 0, 539 int SHOW_LOCATION,
540 int SHOW_NOTES = 0, 540 int SHOW_NOTES,
541 const char* name = 0, 541 const char* name,
542 WFlags fl = 0) : 542 WFlags fl) :
543 ClickableLabel(parent,name,fl), event(ev) { 543 ClickableLabel(parent,name,fl), event(ev) {
544 544
545 QString msg; 545 QString msg;
546 QTime time = QTime::currentTime(); 546 QTime time = QTime::currentTime();
547 547
548 Config config( "qpe" ); 548 Config config( "qpe" );
549 config.setGroup( "Time" ); 549 config.setGroup( "Time" );
550 // if 24 h format 550 // if 24 h format
551 ampm = config.readBoolEntry( "AMPM", TRUE ); 551 ampm = config.readBoolEntry( "AMPM", TRUE );
552 552
553 553
554 if ((time.toString() <= TimeString::dateString((ev).event().end())) ) { 554 if ((time.toString() <= TimeString::dateString((ev).event().end())) ) {
555 // show only later appointments 555 // show only later appointments
556 msg += "<B>" + (ev).description() + "</B>"; 556 msg += "<B>" + (ev).description() + "</B>";
557 if ( (ev).event().hasAlarm() ) { 557 if ( (ev).event().hasAlarm() ) {
558 msg += " <b>[with alarm]</b>"; 558 msg += " <b>[with alarm]</b>";
559 } 559 }
560 // include location or not 560 // include location or not
561 if (SHOW_LOCATION == 1) { 561 if (SHOW_LOCATION == 1) {
562 msg += "<BR><i>" + (ev).location() + "</i>"; 562 msg += "<BR><i>" + (ev).location() + "</i>";
563 } 563 }
564 564
565 if ( (TimeString::timeString(QTime((ev).event().start().time()) ) == "00:00") && (TimeString::timeString(QTime((ev).event().end().time()) ) == "23:59") ) { 565 if ( (TimeString::timeString(QTime((ev).event().start().time()) ) == "00:00") && (TimeString::timeString(QTime((ev).event().end().time()) ) == "23:59") ) {
566 msg += "<br>All day"; 566 msg += "<br>All day";