summaryrefslogtreecommitdiffabout
path: root/korganizer/calendarview.cpp
Unidiff
Diffstat (limited to 'korganizer/calendarview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 5132f98..42166ab 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -202,24 +202,28 @@ MissedAlarmTextBrowser::MissedAlarmTextBrowser(QWidget *parent, QPtrList<Inciden
202 } 202 }
203 mText +="<tr><td><b>"; 203 mText +="<tr><td><b>";
204 mText += timestr; 204 mText += timestr;
205 mText += "</b></td><td>"; 205 mText += "</b></td><td>";
206 mText += tempText; 206 mText += tempText;
207 mText += "</td></tr>\n"; 207 mText += "</td></tr>\n";
208 inc = getNextInc( start ); 208 inc = getNextInc( start );
209 } 209 }
210 mText +="</table>"; 210 mText +="</table>";
211 setText( mText ); 211 setText( mText );
212} 212}
213 213
214MissedAlarmTextBrowser::~MissedAlarmTextBrowser()
215{
216 //qDebug("delete MissedAlarmTextBrowser::~MissedAlarmTextBrowser() ");
217}
214Incidence * MissedAlarmTextBrowser::getNextInc( QDateTime start ) 218Incidence * MissedAlarmTextBrowser::getNextInc( QDateTime start )
215{ 219{
216 QDateTime dt ; 220 QDateTime dt ;
217 Incidence * retInc; 221 Incidence * retInc;
218 Incidence * inc = mAlarms.first(); 222 Incidence * inc = mAlarms.first();
219 if ( inc == 0 ) 223 if ( inc == 0 )
220 return 0; 224 return 0;
221 bool ok; 225 bool ok;
222 dt = inc->getNextOccurence( start, &ok ); 226 dt = inc->getNextOccurence( start, &ok );
223 if ( ! ok ) return 0; 227 if ( ! ok ) return 0;
224 QDateTime dtn ; 228 QDateTime dtn ;
225 retInc = inc; 229 retInc = inc;
@@ -635,32 +639,32 @@ void CalendarView::checkAlarms()
635 qDebug("KO: Last termination on %s ", latest.toString().latin1()); 639 qDebug("KO: Last termination on %s ", latest.toString().latin1());
636 QPtrList<Incidence> el = mCalendar->rawIncidences(); 640 QPtrList<Incidence> el = mCalendar->rawIncidences();
637 QPtrList<Incidence> al; 641 QPtrList<Incidence> al;
638 Incidence* inL = el.first(); 642 Incidence* inL = el.first();
639 while ( inL ) { 643 while ( inL ) {
640 bool ok = false; 644 bool ok = false;
641 int offset = 0; 645 int offset = 0;
642 QDateTime next = inL->getNextAlarmDateTime(& ok, &offset, latest ) ; 646 QDateTime next = inL->getNextAlarmDateTime(& ok, &offset, latest ) ;
643 if ( ok ) { 647 if ( ok ) {
644 //qDebug("OK %s",next.toString().latin1()); 648 //qDebug("OK %s",next.toString().latin1());
645 if ( next < QDateTime::currentDateTime() ) { 649 if ( next < QDateTime::currentDateTime() ) {
646 al.append( inL ); 650 al.append( inL );
647 qDebug("found missed alarm: %s ", inL->summary().latin1() ); 651 //qDebug("found missed alarm: %s ", inL->summary().latin1() );
648 } 652 }
649 } 653 }
650 inL = el.next(); 654 inL = el.next();
651 } 655 }
652 if ( al.count() ) { 656 if ( al.count() ) {
653 QDialog* dia = new QDialog( this, "huhu", false ); 657 QDialog* dia = new QDialog( this, "huhu", false, WDestructiveClose | WStyle_StaysOnTop );
654 dia->setCaption( i18n("KO/Pi: Missing alarm notification!") ); 658 dia->setCaption( i18n("KO/Pi: Missing alarms!") );
655 QVBoxLayout* lay = new QVBoxLayout( dia ); 659 QVBoxLayout* lay = new QVBoxLayout( dia );
656 lay->setSpacing( 0 ); 660 lay->setSpacing( 0 );
657 lay->setMargin( 0 ); 661 lay->setMargin( 0 );
658 MissedAlarmTextBrowser* matb = new MissedAlarmTextBrowser ( dia, al, latest ); 662 MissedAlarmTextBrowser* matb = new MissedAlarmTextBrowser ( dia, al, latest );
659 connect( matb, SIGNAL( showIncidence( QString ) ),SLOT( showIncidence( QString ) )); 663 connect( matb, SIGNAL( showIncidence( QString ) ),SLOT( showIncidence( QString ) ));
660 lay->addWidget( matb ); 664 lay->addWidget( matb );
661 int si = 220; 665 int si = 220;
662 if ( QApplication::desktop()->width() > 470 ) 666 if ( QApplication::desktop()->width() > 470 )
663 si = 400; 667 si = 400;
664 dia->resize(si,si/2); 668 dia->resize(si,si/2);
665 dia->setBackgroundColor( QColor( 255, 255, 255 ) ); 669 dia->setBackgroundColor( QColor( 255, 255, 255 ) );
666 dia->show(); 670 dia->show();