summaryrefslogtreecommitdiffabout
path: root/korganizer
authorzautrix <zautrix>2005-06-04 10:29:18 (UTC)
committer zautrix <zautrix>2005-06-04 10:29:18 (UTC)
commita7939017000e165e711e3f0cffeab46852a9fb2e (patch) (unidiff)
tree6b1c0d44051039e47f7b7f6cf55e25af9a6e7024 /korganizer
parentd40cf5135c640506011334364274b8ee5df9998b (diff)
downloadkdepimpi-a7939017000e165e711e3f0cffeab46852a9fb2e.zip
kdepimpi-a7939017000e165e711e3f0cffeab46852a9fb2e.tar.gz
kdepimpi-a7939017000e165e711e3f0cffeab46852a9fb2e.tar.bz2
fixes
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp40
1 files changed, 27 insertions, 13 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 42166ab..608b73b 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -142,7 +142,7 @@ MissedAlarmTextBrowser::MissedAlarmTextBrowser(QWidget *parent, QPtrList<Inciden
142 142
143{ 143{
144 mAlarms = alarms; 144 mAlarms = alarms;
145 setBackgroundColor( QColor( 86, 153, 205 ) ); 145 viewport()->setBackgroundColor( QColor( 255, 255, 255 ) );
146 QString mText = "<table width=\"100%\">\n"; 146 QString mText = "<table width=\"100%\">\n";
147 //mText += "<tr bgcolor=\"#3679AD\"><td><h2>"; 147 //mText += "<tr bgcolor=\"#3679AD\"><td><h2>";
148#ifdef DESKTOP_VERSION 148#ifdef DESKTOP_VERSION
@@ -159,11 +159,11 @@ MissedAlarmTextBrowser::MissedAlarmTextBrowser(QWidget *parent, QPtrList<Inciden
159#else 159#else
160 mText += "<font color=\"#FFFFFF\"> <em>" + i18n("You missed the alarms for the following events or todos:")+"</em></font></h3>"; 160 mText += "<font color=\"#FFFFFF\"> <em>" + i18n("You missed the alarms for the following events or todos:")+"</em></font></h3>";
161#endif 161#endif
162 mText += "</td></tr>\n<tr bgcolor=\"#FF997D\"><td>"; 162 //mText += "</td></tr>\n<tr bgcolor=\"#FF997D\"><td>";
163 163
164 Incidence * inc = getNextInc( start ); 164 Incidence * inc = getNextInc( start );
165 int time = 0; 165 int time = 0;
166 mText += "<table>"; 166 //mText += "<table>";
167 while ( inc ) { 167 while ( inc ) {
168 QDateTime dt ; 168 QDateTime dt ;
169 QString tempText = "<a "; 169 QString tempText = "<a ";
@@ -187,18 +187,25 @@ MissedAlarmTextBrowser::MissedAlarmTextBrowser(QWidget *parent, QPtrList<Inciden
187 timestr = KGlobal::locale()->formatDateTime( dt, KOPrefs::instance()->mShortDateInViewer) +": "; 187 timestr = KGlobal::locale()->formatDateTime( dt, KOPrefs::instance()->mShortDateInViewer) +": ";
188 else 188 else
189 timestr = KGlobal::locale()->formatDate( dt.date() , KOPrefs::instance()->mShortDateInViewer) +": "; 189 timestr = KGlobal::locale()->formatDate( dt.date() , KOPrefs::instance()->mShortDateInViewer) +": ";
190 if ( dt.date() == QDate::currentDate() && time == 0 ) { 190 if ( dt.date() < QDate::currentDate() && time == 0 ) {
191 mText += "</td></tr>\n<tr bgcolor=\"#FF997D\"><td>";
192 mText += "<table>";
191 time = 1; 193 time = 1;
192 mText +="</table>"; 194 }
195 if ( dt.date() == QDate::currentDate() && time <= 1 ) {
196 if ( time > 0 )
197 mText +="</table>";
193 mText += "</td></tr>\n<tr bgcolor=\"#FFDC64\"><td>"; 198 mText += "</td></tr>\n<tr bgcolor=\"#FFDC64\"><td>";
194 mText += "<table>"; 199 mText += "<table>";
200 time = 2;
195 201
196 } 202 }
197 if ( dt.date() > QDate::currentDate() && time != 2 ) { 203 if ( dt.date() > QDate::currentDate() && time <= 2 ) {
198 time = 2; 204 if ( time > 0 )
199 mText +="</table>"; 205 mText +="</table>";
200 mText += "</td></tr>\n<tr bgcolor=\"#6AFF6A\"><td>"; 206 mText += "</td></tr>\n<tr bgcolor=\"#6AFF6A\"><td>";
201 mText += "<table>"; 207 mText += "<table>";
208 time = 3;
202 } 209 }
203 mText +="<tr><td><b>"; 210 mText +="<tr><td><b>";
204 mText += timestr; 211 mText += timestr;
@@ -634,7 +641,7 @@ void CalendarView::checkAlarms()
634 config->setGroup( "AppRun" ); 641 config->setGroup( "AppRun" );
635 QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) ); 642 QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) );
636 int secs = config->readNumEntry( "LatestProgramStop" ) - 30; 643 int secs = config->readNumEntry( "LatestProgramStop" ) - 30;
637 secs -= ( 3600 * 24*3 ); // debug only 644 //secs -= ( 3600 * 24*3 ); // debug only
638 QDateTime latest = dt.addSecs ( secs ); 645 QDateTime latest = dt.addSecs ( secs );
639 qDebug("KO: Last termination on %s ", latest.toString().latin1()); 646 qDebug("KO: Last termination on %s ", latest.toString().latin1());
640 QPtrList<Incidence> el = mCalendar->rawIncidences(); 647 QPtrList<Incidence> el = mCalendar->rawIncidences();
@@ -662,10 +669,17 @@ void CalendarView::checkAlarms()
662 MissedAlarmTextBrowser* matb = new MissedAlarmTextBrowser ( dia, al, latest ); 669 MissedAlarmTextBrowser* matb = new MissedAlarmTextBrowser ( dia, al, latest );
663 connect( matb, SIGNAL( showIncidence( QString ) ),SLOT( showIncidence( QString ) )); 670 connect( matb, SIGNAL( showIncidence( QString ) ),SLOT( showIncidence( QString ) ));
664 lay->addWidget( matb ); 671 lay->addWidget( matb );
665 int si = 220; 672 if ( QApplication::desktop()->width() == 480 || QApplication::desktop()->width() == 640 ) {
666 if ( QApplication::desktop()->width() > 470 ) 673 int wid = 210;
667 si = 400; 674 int x = QApplication::desktop()->width() - wid - 7;
668 dia->resize(si,si/2); 675 int y = QApplication::desktop()->height() - wid - 70;
676 dia->setGeometry ( x,y,wid,wid);
677 } else {
678 int si = 220;
679 if ( QApplication::desktop()->width() > 470 )
680 si = 400;
681 dia->resize(si,si/2);
682 }
669 dia->setBackgroundColor( QColor( 255, 255, 255 ) ); 683 dia->setBackgroundColor( QColor( 255, 255, 255 ) );
670 dia->show(); 684 dia->show();
671 685