summaryrefslogtreecommitdiffabout
path: root/korganizer
authorzautrix <zautrix>2005-06-07 06:37:42 (UTC)
committer zautrix <zautrix>2005-06-07 06:37:42 (UTC)
commitff8af7ccdd6346bba1cb871c33931352bbafe40e (patch) (unidiff)
tree8a905fe8237cd1be7276b3c5f10479a9efdb6ee5 /korganizer
parent79f58240bc34d20601abe3325e1dc7e76e1ebe39 (diff)
downloadkdepimpi-ff8af7ccdd6346bba1cb871c33931352bbafe40e.zip
kdepimpi-ff8af7ccdd6346bba1cb871c33931352bbafe40e.tar.gz
kdepimpi-ff8af7ccdd6346bba1cb871c33931352bbafe40e.tar.bz2
fixx
Diffstat (limited to 'korganizer') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/calendarview.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index e13d0be..720ad78 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -595,97 +595,98 @@ void CalendarView::init()
595 mDateFrame->setCaption( i18n( "Pick a date to display")); 595 mDateFrame->setCaption( i18n( "Pick a date to display"));
596 mDatePicker = new KDatePicker ( mDateFrame , QDate::currentDate() ); 596 mDatePicker = new KDatePicker ( mDateFrame , QDate::currentDate() );
597 597
598 connect(mDatePicker,SIGNAL(dateSelected(QDate)),SLOT(slotSelectPickerDate(QDate))); 598 connect(mDatePicker,SIGNAL(dateSelected(QDate)),SLOT(slotSelectPickerDate(QDate)));
599 599
600 mEventEditor = mDialogManager->getEventEditor(); 600 mEventEditor = mDialogManager->getEventEditor();
601 mTodoEditor = mDialogManager->getTodoEditor(); 601 mTodoEditor = mDialogManager->getTodoEditor();
602 602
603 mFlagEditDescription = false; 603 mFlagEditDescription = false;
604 604
605 mSuspendTimer = new QTimer( this ); 605 mSuspendTimer = new QTimer( this );
606 mAlarmTimer = new QTimer( this ); 606 mAlarmTimer = new QTimer( this );
607 mRecheckAlarmTimer = new QTimer( this ); 607 mRecheckAlarmTimer = new QTimer( this );
608 connect( mRecheckAlarmTimer, SIGNAL( timeout () ), SLOT( recheckTimerAlarm() ) ); 608 connect( mRecheckAlarmTimer, SIGNAL( timeout () ), SLOT( recheckTimerAlarm() ) );
609 connect( mSuspendTimer, SIGNAL( timeout () ), SLOT( suspendAlarm() ) ); 609 connect( mSuspendTimer, SIGNAL( timeout () ), SLOT( suspendAlarm() ) );
610 connect( mAlarmTimer, SIGNAL( timeout () ), SLOT( timerAlarm() ) ); 610 connect( mAlarmTimer, SIGNAL( timeout () ), SLOT( timerAlarm() ) );
611 mAlarmDialog = new AlarmDialog( this ); 611 mAlarmDialog = new AlarmDialog( this );
612 connect( mAlarmDialog, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addSuspendAlarm(const QDateTime &, const QString & ) ) ); 612 connect( mAlarmDialog, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addSuspendAlarm(const QDateTime &, const QString & ) ) );
613 mAlarmDialog->setServerNotification( false ); 613 mAlarmDialog->setServerNotification( false );
614 mAlarmDialog->setSuspendTime( KOPrefs::instance()->mAlarmSuspendTime ); 614 mAlarmDialog->setSuspendTime( KOPrefs::instance()->mAlarmSuspendTime );
615 615
616 616
617#ifndef DESKTOP_VERSION 617#ifndef DESKTOP_VERSION
618//US listen for arriving address resultsets 618//US listen for arriving address resultsets
619 connect(ExternalAppHandler::instance(), SIGNAL(receivedBirthdayListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)), 619 connect(ExternalAppHandler::instance(), SIGNAL(receivedBirthdayListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)),
620 this, SLOT(insertBirthdays(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&))); 620 this, SLOT(insertBirthdays(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)));
621#endif 621#endif
622 mDateNavigator->setCalendar( mCalendar ); 622 mDateNavigator->setCalendar( mCalendar );
623} 623}
624 624
625 625
626CalendarView::~CalendarView() 626CalendarView::~CalendarView()
627{ 627{
628 // kdDebug() << "~CalendarView()" << endl; 628 // kdDebug() << "~CalendarView()" << endl;
629 //qDebug("CalendarView::~CalendarView() "); 629 //qDebug("CalendarView::~CalendarView() ");
630 delete mDialogManager; 630 delete mDialogManager;
631 delete mViewManager; 631 delete mViewManager;
632 delete mStorage; 632 delete mStorage;
633 delete mDateFrame ; 633 delete mDateFrame ;
634 delete beamDialog; 634 delete beamDialog;
635 delete mEventViewerDialog; 635 delete mEventViewerDialog;
636 //kdDebug() << "~CalendarView() done" << endl; 636 //kdDebug() << "~CalendarView() done" << endl;
637} 637}
638void CalendarView::checkAlarms() 638void CalendarView::checkAlarms()
639{ 639{
640 KConfig *config = KOGlobals::config(); 640 KConfig *config = KOGlobals::config();
641 config->setGroup( "AppRun" ); 641 config->setGroup( "AppRun" );
642 QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) ); 642 QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) );
643 int secs = config->readNumEntry( "LatestProgramStop" ) - 30; 643 int secto = dt.secsTo( QDateTime::currentDateTime() );
644 int secs = config->readNumEntry( "LatestProgramStop" , secto) - 30;
644 //secs -= ( 3600 * 24*3 ); // debug only 645 //secs -= ( 3600 * 24*3 ); // debug only
645 QDateTime latest = dt.addSecs ( secs ); 646 QDateTime latest = dt.addSecs ( secs );
646 qDebug("KO: Last termination on %s ", latest.toString().latin1()); 647 qDebug("KO: Last termination on %s ", latest.toString().latin1());
647 QPtrList<Incidence> el = mCalendar->rawIncidences(); 648 QPtrList<Incidence> el = mCalendar->rawIncidences();
648 QPtrList<Incidence> al; 649 QPtrList<Incidence> al;
649 Incidence* inL = el.first(); 650 Incidence* inL = el.first();
650 while ( inL ) { 651 while ( inL ) {
651 bool ok = false; 652 bool ok = false;
652 int offset = 0; 653 int offset = 0;
653 QDateTime next = inL->getNextAlarmDateTime(& ok, &offset, latest ) ; 654 QDateTime next = inL->getNextAlarmDateTime(& ok, &offset, latest ) ;
654 if ( ok ) { 655 if ( ok ) {
655 //qDebug("OK %s",next.toString().latin1()); 656 //qDebug("OK %s",next.toString().latin1());
656 if ( next < QDateTime::currentDateTime() ) { 657 if ( next < QDateTime::currentDateTime() ) {
657 al.append( inL ); 658 al.append( inL );
658 //qDebug("found missed alarm: %s ", inL->summary().latin1() ); 659 //qDebug("found missed alarm: %s ", inL->summary().latin1() );
659 } 660 }
660 } 661 }
661 inL = el.next(); 662 inL = el.next();
662 } 663 }
663 if ( al.count() ) { 664 if ( al.count() ) {
664 QDialog* dia = new QDialog( this, "huhu", false, WDestructiveClose | WStyle_StaysOnTop ); 665 QDialog* dia = new QDialog( this, "huhu", false, WDestructiveClose | WStyle_StaysOnTop );
665 dia->setCaption( i18n("KO/Pi: Missing alarms!") ); 666 dia->setCaption( i18n("KO/Pi: Missing alarms!") );
666 QVBoxLayout* lay = new QVBoxLayout( dia ); 667 QVBoxLayout* lay = new QVBoxLayout( dia );
667 lay->setSpacing( 0 ); 668 lay->setSpacing( 0 );
668 lay->setMargin( 0 ); 669 lay->setMargin( 0 );
669 MissedAlarmTextBrowser* matb = new MissedAlarmTextBrowser ( dia, al, latest ); 670 MissedAlarmTextBrowser* matb = new MissedAlarmTextBrowser ( dia, al, latest );
670 connect( matb, SIGNAL( showIncidence( QString ) ),SLOT( showIncidence( QString ) )); 671 connect( matb, SIGNAL( showIncidence( QString ) ),SLOT( showIncidence( QString ) ));
671 lay->addWidget( matb ); 672 lay->addWidget( matb );
672 if ( QApplication::desktop()->width() == 480 || QApplication::desktop()->width() == 640 ) { 673 if ( QApplication::desktop()->width() == 480 || QApplication::desktop()->width() == 640 ) {
673 int wid = 210; 674 int wid = 210;
674 int x = QApplication::desktop()->width() - wid - 7; 675 int x = QApplication::desktop()->width() - wid - 7;
675 int y = QApplication::desktop()->height() - wid - 70; 676 int y = QApplication::desktop()->height() - wid - 70;
676 dia->setGeometry ( x,y,wid,wid); 677 dia->setGeometry ( x,y,wid,wid);
677 } else { 678 } else {
678 int si = 220; 679 int si = 220;
679 if ( QApplication::desktop()->width() > 470 ) 680 if ( QApplication::desktop()->width() > 470 )
680 si = 400; 681 si = 400;
681 dia->resize(si,si/2); 682 dia->resize(si,si/2);
682 } 683 }
683 dia->setBackgroundColor( QColor( 255, 255, 255 ) ); 684 dia->setBackgroundColor( QColor( 255, 255, 255 ) );
684 dia->show(); 685 dia->show();
685 686
686 } 687 }
687} 688}
688void CalendarView::showDay( QDate d ) 689void CalendarView::showDay( QDate d )
689{ 690{
690 dateNavigator()->blockSignals( true ); 691 dateNavigator()->blockSignals( true );
691 dateNavigator()->selectDate( d ); 692 dateNavigator()->selectDate( d );