summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/today/today.cpp4
-rw-r--r--core/pim/today/todaybase.cpp27
2 files changed, 21 insertions, 10 deletions
diff --git a/core/pim/today/today.cpp b/core/pim/today/today.cpp
index 0ab7a2a..01d1a13 100644
--- a/core/pim/today/today.cpp
+++ b/core/pim/today/today.cpp
@@ -110,49 +110,49 @@ void Today::setOwnerField() {
110 QString returnString = cont.fullName(); 110 QString returnString = cont.fullName();
111 OwnerField->setText( "<b>" +tr ("Owned by ") + returnString + "</b>"); 111 OwnerField->setText( "<b>" +tr ("Owned by ") + returnString + "</b>");
112 } else { 112 } else {
113 OwnerField->setText( "<b>" + tr ("Please fill out the business card")+" </b>"); 113 OwnerField->setText( "<b>" + tr ("Please fill out the business card")+" </b>");
114 } 114 }
115} 115}
116 116
117/* 117/*
118 * Set the owner field with a given QString, for example per qcop. 118 * Set the owner field with a given QString, for example per qcop.
119 */ 119 */
120void Today::setOwnerField(QString &message) { 120void Today::setOwnerField(QString &message) {
121 if (!message.isEmpty()) { 121 if (!message.isEmpty()) {
122 OwnerField->setText("<b>" + message + "</b>"); 122 OwnerField->setText("<b>" + message + "</b>");
123 } 123 }
124} 124}
125 125
126/* 126/*
127 * Autostart, uses the new (opie only) autostart method in the launcher code. 127 * Autostart, uses the new (opie only) autostart method in the launcher code.
128 * If registered against that today ist started on each resume. 128 * If registered against that today ist started on each resume.
129 */ 129 */
130void Today::autoStart() { 130void Today::autoStart() {
131 Config cfg("today"); 131 Config cfg("today");
132 cfg.setGroup("Autostart"); 132 cfg.setGroup("Autostart");
133 int AUTOSTART = cfg.readNumEntry("autostart",1); 133 int AUTOSTART = cfg.readNumEntry("autostart",1);
134 qDebug(QString("%1").arg(AUTOSTART)); 134// qDebug(QString("%1").arg(AUTOSTART));
135 if (AUTOSTART) { 135 if (AUTOSTART) {
136 QCopEnvelope e("QPE/System", "autoStart(QString, QString, QString)"); 136 QCopEnvelope e("QPE/System", "autoStart(QString, QString, QString)");
137 e << QString("add"); 137 e << QString("add");
138 e << QString("today"); 138 e << QString("today");
139 e << AUTOSTART_TIMER; 139 e << AUTOSTART_TIMER;
140 } else { 140 } else {
141 qDebug("Nun in else bei autostart"); 141 qDebug("Nun in else bei autostart");
142 QCopEnvelope e("QPE/System", "autoStart(QString, QString)"); 142 QCopEnvelope e("QPE/System", "autoStart(QString, QString)");
143 e << QString("remove"); 143 e << QString("remove");
144 e << QString("today"); 144 e << QString("today");
145 } 145 }
146} 146}
147 147
148/* 148/*
149 * Repaint method. Reread all fields. 149 * Repaint method. Reread all fields.
150 */ 150 */
151void Today::draw() { 151void Today::draw() {
152 init(); 152 init();
153 getDates(); 153 getDates();
154 getMail(); 154 getMail();
155 155
156 // if the todolist.xml file was not modified in between, do not parse it. 156 // if the todolist.xml file was not modified in between, do not parse it.
157 if (checkIfModified()) { 157 if (checkIfModified()) {
158 if (todo) delete todo; 158 if (todo) delete todo;
@@ -458,48 +458,49 @@ void Today::startMail() {
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 = 0,
472 int SHOW_LOCATION = 0, 472 int SHOW_LOCATION = 0,
473 int SHOW_NOTES = 0, 473 int SHOW_NOTES = 0,
474 const char* name = 0, 474 const char* name = 0,
475 WFlags fl = 0) : 475 WFlags fl = 0) :
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 // if 24 h format 483 // if 24 h format
483 ampm = config.readBoolEntry( "AMPM", TRUE ); 484 ampm = config.readBoolEntry( "AMPM", TRUE );
484 485
485 486
486 if (!ONLY_LATER) { 487 if (!ONLY_LATER) {
487 msg += "<B>" + (ev).description() + "</B>"; 488 msg += "<B>" + (ev).description() + "</B>";
488 if ( (ev).event().hasAlarm() ) { 489 if ( (ev).event().hasAlarm() ) {
489 msg += " <b>[with alarm]</b>"; 490 msg += " <b>[with alarm]</b>";
490 } 491 }
491 // include location or not 492 // include location or not
492 if (SHOW_LOCATION == 1) { 493 if (SHOW_LOCATION == 1) {
493 msg += "<BR><i>" + (ev).location() + "</i>"; 494 msg += "<BR><i>" + (ev).location() + "</i>";
494 } 495 }
495 496
496 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") ) {
497 msg += "<br>All day"; 498 msg += "<br>All day";
498 } else { 499 } else {
499 // start time of event 500 // start time of event
500 msg += "<br>" + ampmTime(QTime((ev).event().start().time()) ) 501 msg += "<br>" + ampmTime(QTime((ev).event().start().time()) )
501 // end time of event 502 // end time of event
502 + "<b> - </b>" + ampmTime(QTime((ev).event().end().time()) ); 503 + "<b> - </b>" + ampmTime(QTime((ev).event().end().time()) );
503 } 504 }
504 505
505 // include possible note or not 506 // include possible note or not
@@ -524,48 +525,49 @@ QString DateBookEvent::ampmTime(QTime tm) {
524 hour -= 12; 525 hour -= 12;
525 s.sprintf( "%2d:%02d %s", hour, tm.minute(), 526 s.sprintf( "%2d:%02d %s", hour, tm.minute(),
526 (tm.hour() >= 12) ? "PM" : "AM" ); 527 (tm.hour() >= 12) ? "PM" : "AM" );
527 return s; 528 return s;
528 } else { 529 } else {
529 s.sprintf( "%2d:%02d", tm.hour(), tm.minute() ); 530 s.sprintf( "%2d:%02d", tm.hour(), tm.minute() );
530 return s; 531 return s;
531 } 532 }
532 533
533} 534}
534 535
535 536
536DateBookEventLater::DateBookEventLater(const EffectiveEvent &ev, 537DateBookEventLater::DateBookEventLater(const EffectiveEvent &ev,
537 QWidget* parent = 0, 538 QWidget* parent = 0,
538 int SHOW_LOCATION = 0, 539 int SHOW_LOCATION = 0,
539 int SHOW_NOTES = 0, 540 int SHOW_NOTES = 0,
540 const char* name = 0, 541 const char* name = 0,
541 WFlags fl = 0) : 542 WFlags fl = 0) :
542 ClickableLabel(parent,name,fl), event(ev) { 543 ClickableLabel(parent,name,fl), event(ev) {
543 544
544 QString msg; 545 QString msg;
545 QTime time = QTime::currentTime(); 546 QTime time = QTime::currentTime();
546 547
547 Config config( "qpe" ); 548 Config config( "qpe" );
549 config.setGroup( "Time" );
548 // if 24 h format 550 // if 24 h format
549 ampm = config.readBoolEntry( "AMPM", TRUE ); 551 ampm = config.readBoolEntry( "AMPM", TRUE );
550 552
551 553
552 if ((time.toString() <= TimeString::dateString((ev).event().end())) ) { 554 if ((time.toString() <= TimeString::dateString((ev).event().end())) ) {
553 // show only later appointments 555 // show only later appointments
554 msg += "<B>" + (ev).description() + "</B>"; 556 msg += "<B>" + (ev).description() + "</B>";
555 if ( (ev).event().hasAlarm() ) { 557 if ( (ev).event().hasAlarm() ) {
556 msg += " <b>[with alarm]</b>"; 558 msg += " <b>[with alarm]</b>";
557 } 559 }
558 // include location or not 560 // include location or not
559 if (SHOW_LOCATION == 1) { 561 if (SHOW_LOCATION == 1) {
560 msg += "<BR><i>" + (ev).location() + "</i>"; 562 msg += "<BR><i>" + (ev).location() + "</i>";
561 } 563 }
562 564
563 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") ) {
564 msg += "<br>All day"; 566 msg += "<br>All day";
565 } else { 567 } else {
566 // start time of event 568 // start time of event
567 msg += "<br>" + ampmTime(QTime((ev).event().start().time()) ) 569 msg += "<br>" + ampmTime(QTime((ev).event().start().time()) )
568 // end time of event 570 // end time of event
569 + "<b> - </b>" + ampmTime(QTime((ev).event().end().time()) ); 571 + "<b> - </b>" + ampmTime(QTime((ev).event().end().time()) );
570 } 572 }
571 // include possible note or not 573 // include possible note or not
diff --git a/core/pim/today/todaybase.cpp b/core/pim/today/todaybase.cpp
index ae8763b..c6ea11f 100644
--- a/core/pim/today/todaybase.cpp
+++ b/core/pim/today/todaybase.cpp
@@ -23,83 +23,92 @@
23#include <qpushbutton.h> 23#include <qpushbutton.h>
24#include <qlayout.h> 24#include <qlayout.h>
25#include <qvariant.h> 25#include <qvariant.h>
26#include <qwhatsthis.h> 26#include <qwhatsthis.h>
27#include <qimage.h> 27#include <qimage.h>
28#include <qpixmap.h> 28#include <qpixmap.h>
29#include <qscrollview.h> 29#include <qscrollview.h>
30#include <qvbox.h> 30#include <qvbox.h>
31#include <qapplication.h> 31#include <qapplication.h>
32 32
33#include <qpe/resource.h> 33#include <qpe/resource.h>
34 34
35/* 35/*
36 * Constructs a TodayBase which is a child of 'parent', with the 36 * Constructs a TodayBase which is a child of 'parent', with the
37 * name 'name' and widget flags set to 'f' 37 * name 'name' and widget flags set to 'f'
38 */ 38 */
39TodayBase::TodayBase( QWidget* parent, const char* name, WFlags fl ) 39TodayBase::TodayBase( QWidget* parent, const char* name, WFlags fl )
40 : QWidget( parent, name, fl ) 40 : QWidget( parent, name, fl )
41{ 41{
42 QPixmap logo = Resource::loadPixmap( "today/today_logo"); // logo 42 QPixmap logo = Resource::loadPixmap( "today/today_logo"); // logo
43 QPixmap datebook = Resource::loadPixmap("DateBook"); // datebook 43 QPixmap datebook = Resource::loadPixmap("DateBook"); // datebook
44 QPixmap todo = Resource::loadPixmap( "TodoList" ); // todo 44 QPixmap todo = Resource::loadPixmap( "TodoList" ); // todo
45 QPixmap config = Resource::loadPixmap( "today/config" ); // config icon 45 QPixmap config = Resource::loadPixmap( "today/config" ); // config icon
46 QPixmap mail = Resource::loadPixmap( "today/mail" ); // mail icon 46 QPixmap mail = Resource::loadPixmap( "today/mail" ); // mail icon
47 47 QPixmap opiezilla = Resource::loadPixmap("today/opiezilla" ); //the opiezilla
48 //QPalette pal = this->palette();
49 // QColor col = pal.color(QPalette::Active, QColorGroup::Background);
50 //pal.setColor(QPalette::Active, QColorGroup::Button, col);
51 //pal.setColor(QPalette::Inactive, QColorGroup::Button, col);
52 //pal.setColor(QPalette::Normal, QColorGroup::Button, col);
53 //pal.setColor(QPalette::Disabled, QColorGroup::Button, col);
54 //this->setPalette(pal);
55
56 48
57 QWidget *d = QApplication::desktop(); 49 QWidget *d = QApplication::desktop();
58 int w=d->width(); 50 int w=d->width();
59 int h=d->height(); 51 int h=d->height();
60 resize( w , h ); 52 resize( w , h );
61 53
62 // hehe, qt is ... 54 // hehe, qt is ...
63 getridoffuckingstrippeldlinesbutton = new QPushButton (this, "asdfsad" ); 55 getridoffuckingstrippeldlinesbutton = new QPushButton (this, "asdfsad" );
64 getridoffuckingstrippeldlinesbutton->setGeometry( QRect( -5, 10, 0, 0 ) ); 56 getridoffuckingstrippeldlinesbutton->setGeometry( QRect( -5, 10, 0, 0 ) );
65 57
66 QVBoxLayout * layout = new QVBoxLayout(this); 58 QVBoxLayout * layout = new QVBoxLayout(this);
67 59
68 // --- logo Section --- 60 // --- logo Section ---
69 QPalette pal2; 61 QPalette pal2;
70 QColorGroup cg; 62 QColorGroup cg;
71 cg.setColor( QColorGroup::Text, white ); 63 cg.setColor( QColorGroup::Text, white );
72 cg.setBrush( QColorGroup::Background, QBrush( QColor( 238, 238, 230), logo ) ); 64 cg.setBrush( QColorGroup::Background, QBrush( QColor( 238, 238, 230), logo ) );
73 pal2.setActive( cg ); 65 pal2.setActive( cg );
74 // today logo 66 // today logo
75 Frame = new QLabel( this, "Frame" ); 67 Frame = new QLabel( this, "Frame" );
76 Frame->setPalette( pal2 ); 68 Frame->setPalette( pal2 );
77 Frame->setFrameShape( QFrame::StyledPanel ); 69 Frame->setFrameShape( QFrame::StyledPanel );
78 Frame->setFrameShadow( QFrame::Raised ); 70 Frame->setFrameShadow( QFrame::Raised );
79 Frame->setLineWidth( 0 ); 71 Frame->setLineWidth( 0 );
80 Frame->setMaximumHeight(50); 72 Frame->setMaximumHeight(50);
81 Frame->setMinimumHeight(50); 73 Frame->setMinimumHeight(50);
74
75 // Today text
76 QLabel* TodayLabel = new QLabel( Frame, "TodayText" );
77 TodayLabel->setGeometry( QRect( 10, 0, 168, 40 ) );
78 QFont TodayLabel_font( TodayLabel->font() );
79 TodayLabel_font.setBold( TRUE );
80 TodayLabel_font.setPointSize(40);
81 TodayLabel->setFont( TodayLabel_font );
82 TodayLabel->setBackgroundOrigin( QLabel::ParentOrigin );
83 TodayLabel->setText("<font color=#FFFFFF>" + tr("Today") +"</font>");
84
85 // Opiezilla
86 QLabel* Opiezilla = new QLabel( Frame, "OpieZilla");
87 Opiezilla->setPixmap( opiezilla );
88 Opiezilla->setGeometry( this->width()-50 ,1, 45, 47);
89 Opiezilla->setBackgroundOrigin( QLabel::ParentOrigin );
90
82 // date 91 // date
83 TextLabel1 = new QLabel( Frame, "TextLabel1" ); 92 TextLabel1 = new QLabel( Frame, "TextLabel1" );
84 TextLabel1->setGeometry( QRect( 10, 35, 168, 12 ) ); 93 TextLabel1->setGeometry( QRect( 10, 35, 168, 12 ) );
85 QFont TextLabel1_font( TextLabel1->font() ); 94 QFont TextLabel1_font( TextLabel1->font() );
86 TextLabel1_font.setBold( TRUE ); 95 TextLabel1_font.setBold( TRUE );
87 TextLabel1->setFont( TextLabel1_font ); 96 TextLabel1->setFont( TextLabel1_font );
88 TextLabel1->setBackgroundOrigin( QLabel::ParentOrigin ); 97 TextLabel1->setBackgroundOrigin( QLabel::ParentOrigin );
89 TextLabel1->setTextFormat( RichText ); 98 TextLabel1->setTextFormat( RichText );
90 99
91 OwnerField = new QLabel(this , "Owner" ); 100 OwnerField = new QLabel(this , "Owner" );
92 OwnerField->setGeometry(QRect(0,0, this->width(), 12 )); 101 OwnerField->setGeometry(QRect(0,0, this->width(), 12 ));
93 OwnerField->setAlignment(int (QLabel::AlignTop | QLabel::AlignLeft ) ); 102 OwnerField->setAlignment(int (QLabel::AlignTop | QLabel::AlignLeft ) );
94 OwnerField->setMaximumHeight(12); 103 OwnerField->setMaximumHeight(12);
95 104
96 // --- dates section --- 105 // --- dates section ---
97 Frame4 = new QFrame( this, "Frame4" ); 106 Frame4 = new QFrame( this, "Frame4" );
98// Frame4->setPalette( pal ); 107// Frame4->setPalette( pal );
99 Frame4->setFrameShape( QScrollView::StyledPanel ); 108 Frame4->setFrameShape( QScrollView::StyledPanel );
100 Frame4->setFrameShadow( QScrollView::Sunken ); 109 Frame4->setFrameShadow( QScrollView::Sunken );
101 Frame4->setBackgroundOrigin( QScrollView::ParentOrigin ); 110 Frame4->setBackgroundOrigin( QScrollView::ParentOrigin );
102 Frame4->setFrameStyle( QFrame::NoFrame ); 111 Frame4->setFrameStyle( QFrame::NoFrame );
103 Frame4->setGeometry (QRect( 0, 8, this->width() , this->height()) ); 112 Frame4->setGeometry (QRect( 0, 8, this->width() , this->height()) );
104 113
105 sv1 = new QScrollView( Frame4 ); 114 sv1 = new QScrollView( Frame4 );