-rw-r--r-- | korganizer/calendarview.cpp | 47 |
1 files changed, 26 insertions, 21 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index fd026fa..70a1d2d 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -782,9 +782,9 @@ void CalendarView::startAlarm( QString mess , QString filename) | |||
782 | topLevelWidget()->setActiveWindow(); | 782 | topLevelWidget()->setActiveWindow(); |
783 | topLevelWidget()->raise(); | 783 | topLevelWidget()->raise(); |
784 | 784 | ||
785 | mAlarmDialog->eventNotification( mess, KOPrefs::instance()->mAlarmPlayBeeps, filename, true,KOPrefs::instance()->mAlarmBeepInterval ,KOPrefs::instance()->mAlarmSuspendCount ); | 785 | mAlarmDialog->eventNotification( mess, KOPrefs::instance()->mAlarmPlayBeeps, filename, true,KOPrefs::instance()->mAlarmBeepInterval ,KOPrefs::instance()->mAlarmSuspendCount ); |
786 | QTimer::singleShot( 3000, this, SLOT( checkNextTimerAlarm() ) ); | 786 | QTimer::singleShot( 2000, this, SLOT( checkNextTimerAlarm() ) ); |
787 | 787 | ||
788 | } | 788 | } |
789 | 789 | ||
790 | void CalendarView::checkNextTimerAlarm() | 790 | void CalendarView::checkNextTimerAlarm() |
@@ -925,14 +925,18 @@ void CalendarView::recheckTimerAlarm() | |||
925 | mAlarmTimer->stop(); | 925 | mAlarmTimer->stop(); |
926 | mRecheckAlarmTimer->stop(); | 926 | mRecheckAlarmTimer->stop(); |
927 | mCalendar->checkAlarmForIncidence( 0, true ); | 927 | mCalendar->checkAlarmForIncidence( 0, true ); |
928 | } | 928 | } |
929 | #ifndef DESKTOP_VERSION | ||
929 | void CalendarView::removeAlarm(const QDateTime &qdt, const QString ¬i ) | 930 | void CalendarView::removeAlarm(const QDateTime &qdt, const QString ¬i ) |
931 | #else | ||
932 | void CalendarView::removeAlarm(const QDateTime &, const QString & ) | ||
933 | #endif | ||
930 | { | 934 | { |
931 | //qDebug("-----removeAlarm %s %s ", qdt.toString().latin1() , noti.latin1() ); | 935 | //qDebug("-----removeAlarm %s %s ", qdt.toString().latin1() , noti.latin1() ); |
932 | if ( ! KOPrefs::instance()->mUseInternalAlarmNotification ) { | 936 | if ( ! KOPrefs::instance()->mUseInternalAlarmNotification ) { |
933 | #ifndef DESKTOP_VERSION | 937 | #ifndef DESKTOP_VERSION |
934 | AlarmServer::deleteAlarm (qdt ,"koalarm" ,noti.latin1() ); | 938 | AlarmServer::deleteAlarm (qdt ,"koalarm" ,noti.utf8() ); |
935 | #endif | 939 | #endif |
936 | return; | 940 | return; |
937 | } | 941 | } |
938 | mAlarmTimer->stop(); | 942 | mAlarmTimer->stop(); |
@@ -1209,9 +1213,8 @@ bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int | |||
1209 | //QPtrList<Event> el = local->rawEvents(); | 1213 | //QPtrList<Event> el = local->rawEvents(); |
1210 | Event* eventR; | 1214 | Event* eventR; |
1211 | QString uid; | 1215 | QString uid; |
1212 | int take; | 1216 | int take; |
1213 | Event* eventL; | ||
1214 | Event* eventRSync; | 1217 | Event* eventRSync; |
1215 | Event* eventLSync; | 1218 | Event* eventLSync; |
1216 | clearAllViews(); | 1219 | clearAllViews(); |
1217 | QPtrList<Event> eventRSyncSharp = remote->getExternLastSyncEvents(); | 1220 | QPtrList<Event> eventRSyncSharp = remote->getExternLastSyncEvents(); |
@@ -2309,13 +2312,18 @@ void CalendarView::readSettings() | |||
2309 | mViewManager->readSettings( config ); | 2312 | mViewManager->readSettings( config ); |
2310 | QTimer::singleShot( 1, mDateNavigator, SLOT ( setResizeEnabled() ) ); | 2313 | QTimer::singleShot( 1, mDateNavigator, SLOT ( setResizeEnabled() ) ); |
2311 | } | 2314 | } |
2312 | 2315 | ||
2313 | 2316 | void CalendarView::checkSuspendAlarm() | |
2317 | { | ||
2318 | if ( mSuspendTimer->isActive() ) { | ||
2319 | KMessageBox::information( this, i18n("<b>WARNING:</b> There is a pending suspended alarm!"), i18n("Pending Suspend Alarm")); | ||
2320 | } | ||
2321 | } | ||
2314 | void CalendarView::writeSettings() | 2322 | void CalendarView::writeSettings() |
2315 | { | 2323 | { |
2316 | // kdDebug() << "CalendarView::writeSettings" << endl; | 2324 | // kdDebug() << "CalendarView::writeSettings" << endl; |
2317 | 2325 | ||
2318 | KConfig *config = KOGlobals::config(); | 2326 | KConfig *config = KOGlobals::config(); |
2319 | 2327 | ||
2320 | mViewManager->writeSettings( config ); | 2328 | mViewManager->writeSettings( config ); |
2321 | mTodoList->saveLayout(config,QString("Todo Layout")); | 2329 | mTodoList->saveLayout(config,QString("Todo Layout")); |
@@ -2793,10 +2801,9 @@ void CalendarView::removeCategories() | |||
2793 | QStringList catList = KOPrefs::instance()->mCustomCategories; | 2801 | QStringList catList = KOPrefs::instance()->mCustomCategories; |
2794 | QStringList catIncList; | 2802 | QStringList catIncList; |
2795 | QStringList newCatList; | 2803 | QStringList newCatList; |
2796 | Incidence* inc = incList.first(); | 2804 | Incidence* inc = incList.first(); |
2797 | int i; | 2805 | uint i; |
2798 | int count = 0; | ||
2799 | while ( inc ) { | 2806 | while ( inc ) { |
2800 | newCatList.clear(); | 2807 | newCatList.clear(); |
2801 | catIncList = inc->categories() ; | 2808 | catIncList = inc->categories() ; |
2802 | for( i = 0; i< catIncList.count(); ++i ) { | 2809 | for( i = 0; i< catIncList.count(); ++i ) { |
@@ -2814,9 +2821,9 @@ int CalendarView::addCategories() | |||
2814 | QPtrList<Incidence> incList = mCalendar->rawIncidences(); | 2821 | QPtrList<Incidence> incList = mCalendar->rawIncidences(); |
2815 | QStringList catList = KOPrefs::instance()->mCustomCategories; | 2822 | QStringList catList = KOPrefs::instance()->mCustomCategories; |
2816 | QStringList catIncList; | 2823 | QStringList catIncList; |
2817 | Incidence* inc = incList.first(); | 2824 | Incidence* inc = incList.first(); |
2818 | int i; | 2825 | uint i; |
2819 | int count = 0; | 2826 | int count = 0; |
2820 | while ( inc ) { | 2827 | while ( inc ) { |
2821 | catIncList = inc->categories() ; | 2828 | catIncList = inc->categories() ; |
2822 | for( i = 0; i< catIncList.count(); ++i ) { | 2829 | for( i = 0; i< catIncList.count(); ++i ) { |
@@ -2944,17 +2951,19 @@ void CalendarView::beamIncidenceList(QPtrList<Incidence> delSel ) | |||
2944 | ir->send( fn, description, "text/x-vCalendar" ); | 2951 | ir->send( fn, description, "text/x-vCalendar" ); |
2945 | #endif | 2952 | #endif |
2946 | } | 2953 | } |
2947 | } | 2954 | } |
2955 | |||
2956 | #ifndef DESKTOP_VERSION | ||
2948 | void CalendarView::beamDone( Ir *ir ) | 2957 | void CalendarView::beamDone( Ir *ir ) |
2949 | { | 2958 | { |
2950 | #ifndef DESKTOP_VERSION | ||
2951 | delete ir; | 2959 | delete ir; |
2952 | #endif | ||
2953 | topLevelWidget()->setCaption( i18n("KO/Pi: Beaming done.") ); | 2960 | topLevelWidget()->setCaption( i18n("KO/Pi: Beaming done.") ); |
2954 | topLevelWidget()->raise(); | 2961 | topLevelWidget()->raise(); |
2955 | } | 2962 | } |
2956 | 2963 | #else | |
2964 | void CalendarView::beamDone( Ir *){;} | ||
2965 | #endif | ||
2957 | void CalendarView::moveIncidence(Incidence * inc ) | 2966 | void CalendarView::moveIncidence(Incidence * inc ) |
2958 | { | 2967 | { |
2959 | if ( !inc ) return; | 2968 | if ( !inc ) return; |
2960 | showDatePickerPopup(); | 2969 | showDatePickerPopup(); |
@@ -4306,13 +4315,8 @@ Todo *CalendarView::selectedTodo() | |||
4306 | 4315 | ||
4307 | return 0; | 4316 | return 0; |
4308 | } | 4317 | } |
4309 | 4318 | ||
4310 | void CalendarView::dialogClosing(Incidence *in) | ||
4311 | { | ||
4312 | // mDialogList.remove(in); | ||
4313 | } | ||
4314 | |||
4315 | void CalendarView::showIncidence() | 4319 | void CalendarView::showIncidence() |
4316 | { | 4320 | { |
4317 | mViewerCallerIsSearchDialog = false; | 4321 | mViewerCallerIsSearchDialog = false; |
4318 | Incidence *incidence = currentSelection(); | 4322 | Incidence *incidence = currentSelection(); |
@@ -4431,12 +4435,9 @@ void CalendarView::purgeCompleted() | |||
4431 | 4435 | ||
4432 | QPtrList<Todo> todoCal; | 4436 | QPtrList<Todo> todoCal; |
4433 | QPtrList<Todo> rootTodos; | 4437 | QPtrList<Todo> rootTodos; |
4434 | //QPtrList<Incidence> rel; | 4438 | //QPtrList<Incidence> rel; |
4435 | Todo *aTodo;//, *rTodo; | 4439 | Todo *aTodo; |
4436 | Incidence *rIncidence; | ||
4437 | bool childDelete = false; | ||
4438 | bool deletedOne = true; | ||
4439 | todoCal = calendar()->todos(); | 4440 | todoCal = calendar()->todos(); |
4440 | for (aTodo = todoCal.first(); aTodo; aTodo = todoCal.next()) { | 4441 | for (aTodo = todoCal.first(); aTodo; aTodo = todoCal.next()) { |
4441 | if ( !aTodo->relatedTo() ) | 4442 | if ( !aTodo->relatedTo() ) |
4442 | rootTodos.append( aTodo ); | 4443 | rootTodos.append( aTodo ); |
@@ -4462,9 +4463,11 @@ void CalendarView::keyPressEvent ( QKeyEvent *e) | |||
4462 | 4463 | ||
4463 | 4464 | ||
4464 | bool CalendarView::sync(KSyncManager* manager, QString filename, int mode) | 4465 | bool CalendarView::sync(KSyncManager* manager, QString filename, int mode) |
4465 | { | 4466 | { |
4466 | // mSyncManager = manager; | 4467 | |
4468 | if ( manager != mSyncManager) | ||
4469 | qDebug("KO: Internal error-1. SyncManager mismatch "); | ||
4467 | if ( filename == QDir::homeDirPath ()+"/.kdecalendardump.ics" ) { | 4470 | if ( filename == QDir::homeDirPath ()+"/.kdecalendardump.ics" ) { |
4468 | qDebug("KO: SyncKDE request detected!"); | 4471 | qDebug("KO: SyncKDE request detected!"); |
4469 | } | 4472 | } |
4470 | mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice(); | 4473 | mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice(); |
@@ -4473,8 +4476,10 @@ bool CalendarView::sync(KSyncManager* manager, QString filename, int mode) | |||
4473 | } | 4476 | } |
4474 | bool CalendarView::syncExternal(KSyncManager* manager, QString resource) | 4477 | bool CalendarView::syncExternal(KSyncManager* manager, QString resource) |
4475 | { | 4478 | { |
4476 | //mSyncManager = manager; | 4479 | //mSyncManager = manager; |
4480 | if ( manager != mSyncManager) | ||
4481 | qDebug("KO: Internal error-2. SyncManager mismatch "); | ||
4477 | mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice(); | 4482 | mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice(); |
4478 | mCurrentSyncName = mSyncManager->getCurrentSyncName(); | 4483 | mCurrentSyncName = mSyncManager->getCurrentSyncName(); |
4479 | if ( resource == "sharp" ) | 4484 | if ( resource == "sharp" ) |
4480 | syncExternal( 0 ); | 4485 | syncExternal( 0 ); |