-rw-r--r-- | korganizer/calendarview.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 70a1d2d..678143d 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -469,16 +469,17 @@ void CalendarView::init() | |||
469 | connect( mCalEditView, SIGNAL( calendarEnabled (int,bool) ),mCalendar, SLOT( setCalendarEnabled(int,bool)) ); | 469 | connect( mCalEditView, SIGNAL( calendarEnabled (int,bool) ),mCalendar, SLOT( setCalendarEnabled(int,bool)) ); |
470 | connect( mCalEditView, SIGNAL( alarmEnabled(int,bool) ),mCalendar, SLOT( setAlarmEnabled(int,bool)) ); | 470 | connect( mCalEditView, SIGNAL( alarmEnabled(int,bool) ),mCalendar, SLOT( setAlarmEnabled(int,bool)) ); |
471 | connect( mCalEditView, SIGNAL( calendarReadonly(int,bool) ),mCalendar, SLOT( setReadOnly(int,bool)) ); | 471 | connect( mCalEditView, SIGNAL( calendarReadonly(int,bool) ),mCalendar, SLOT( setReadOnly(int,bool)) ); |
472 | connect( mCalEditView, SIGNAL( setCalendarDefault(int) ),mCalendar, SLOT( setDefaultCalendar(int)) ); | 472 | connect( mCalEditView, SIGNAL( setCalendarDefault(int) ),mCalendar, SLOT( setDefaultCalendar(int)) ); |
473 | connect( mCalEditView, SIGNAL( setCalendarDefault(int) ),mViewManager, SLOT( setDefaultCalendar(int)) ); | 473 | connect( mCalEditView, SIGNAL( setCalendarDefault(int) ),mViewManager, SLOT( setDefaultCalendar(int)) ); |
474 | connect( mCalEditView, SIGNAL( removeCalendar(int) ),mCalendar, SLOT( setCalendarRemove(int)) ); | 474 | connect( mCalEditView, SIGNAL( removeCalendar(int) ),mCalendar, SLOT( setCalendarRemove(int)) ); |
475 | connect( mCalEditView, SIGNAL( calendarAdded(int) ),this, SLOT( addCalendarId(int)) ); | 475 | connect( mCalEditView, SIGNAL( calendarAdded(int) ),this, SLOT( addCalendarId(int)) ); |
476 | connect( mCalEditView, SIGNAL( needsUpdate() ),this, SLOT( updateView()) ); | 476 | connect( mCalEditView, SIGNAL( needsUpdate() ),this, SLOT( updateView()) ); |
477 | connect( mCalEditView, SIGNAL( checkCalendar() ),this, SLOT( checkFiles() )); | ||
477 | connect( mCalEditView, SIGNAL( needsUpdate() ),this, SLOT( updateUnmanagedViews()) ); | 478 | connect( mCalEditView, SIGNAL( needsUpdate() ),this, SLOT( updateUnmanagedViews()) ); |
478 | 479 | ||
479 | mTodoList->setNavigator( mNavigator ); | 480 | mTodoList->setNavigator( mNavigator ); |
480 | #if 0 | 481 | #if 0 |
481 | if ( QApplication::desktop()->width() < 480 ) { | 482 | if ( QApplication::desktop()->width() < 480 ) { |
482 | leftFrameLayout->addWidget(mFilterView); | 483 | leftFrameLayout->addWidget(mFilterView); |
483 | leftFrameLayout->addWidget(mTodoList, 2 ); | 484 | leftFrameLayout->addWidget(mTodoList, 2 ); |
484 | 485 | ||
@@ -676,33 +677,37 @@ void CalendarView::scrollBarValue(int val ) | |||
676 | return; | 677 | return; |
677 | } | 678 | } |
678 | QDate d ( year,1,1 ); | 679 | QDate d ( year,1,1 ); |
679 | mNavigator->selectDates( d.addDays( val ), count ); | 680 | mNavigator->selectDates( d.addDays( val ), count ); |
680 | block = false; | 681 | block = false; |
681 | #endif | 682 | #endif |
682 | 683 | ||
683 | } | 684 | } |
684 | 685 | void CalendarView::checkFiles() | |
685 | void CalendarView::checkAlarms() | ||
686 | { | 686 | { |
687 | |||
688 | QString message; | 687 | QString message; |
689 | QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; | 688 | QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; |
690 | KopiCalendarFile * cal = calendars.first(); | 689 | KopiCalendarFile * cal = calendars.first(); |
691 | while ( cal ) { | 690 | while ( cal ) { |
692 | if ( cal->mErrorOnLoad ) { | 691 | if ( cal->mErrorOnLoad ) { |
693 | message += cal->mName +"\n"+KGlobal::formatMessage ( "(" +i18n( "Filepath: ")+ cal->mFileName+")" ,0 )+"\n"; | 692 | message += cal->mName +"\n"+KGlobal::formatMessage ( "(" +i18n( "Filepath: ")+ cal->mFileName+")" ,0 )+"\n"; |
694 | } | 693 | } |
695 | cal = calendars.next(); | 694 | cal = calendars.next(); |
696 | } | 695 | } |
697 | if ( !message.isEmpty() ) { | 696 | if ( !message.isEmpty() ) { |
698 | message = KGlobal::formatMessage( i18n("The loading of one or more calendar failed:"),0 )+"\n" + message +KGlobal::formatMessage(i18n("You can try to reload the calendar in the Resource View!"),0); | 697 | message = KGlobal::formatMessage( i18n("Calendar(s) not loaded:"),0 )+"\n" + message +KGlobal::formatMessage(i18n("You can try to reload the calendar in the Resource View!"),0); |
699 | KMessageBox::error(this,message); | 698 | KMessageBox::error(this,message, i18n("Loding of calendar(s) failed")); |
699 | } | ||
700 | QTimer::singleShot( 2000, this, SLOT ( checkAlarms() )); | ||
700 | } | 701 | } |
702 | void CalendarView::checkAlarms() | ||
703 | { | ||
704 | |||
705 | |||
701 | KConfig *config = KOGlobals::config(); | 706 | KConfig *config = KOGlobals::config(); |
702 | config->setGroup( "AppRun" ); | 707 | config->setGroup( "AppRun" ); |
703 | QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) ); | 708 | QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) ); |
704 | int daysto = dt.daysTo( QDate::currentDate() ); | 709 | int daysto = dt.daysTo( QDate::currentDate() ); |
705 | int days = config->readNumEntry( "LatestProgramStopDays" , daysto); | 710 | int days = config->readNumEntry( "LatestProgramStopDays" , daysto); |
706 | dt = dt.addDays( days ); | 711 | dt = dt.addDays( days ); |
707 | int secto = dt.secsTo( QDateTime::currentDateTime() ); | 712 | int secto = dt.secsTo( QDateTime::currentDateTime() ); |
708 | int secs = config->readNumEntry( "LatestProgramStopSecs" , secto) - 30; | 713 | int secs = config->readNumEntry( "LatestProgramStopSecs" , secto) - 30; |