-rw-r--r-- | korganizer/calendarview.cpp | 6 | ||||
-rw-r--r-- | korganizer/calendarview.h | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 2ccccfa..af01625 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -3255,512 +3255,518 @@ bool CalendarView::exportVCalendar( QString filename ) | |||
3255 | { | 3255 | { |
3256 | if (mCalendar->journals().count() > 0) { | 3256 | if (mCalendar->journals().count() > 0) { |
3257 | int result = KMessageBox::warningContinueCancel(this, | 3257 | int result = KMessageBox::warningContinueCancel(this, |
3258 | i18n("The journal entries can not be\nexported to a vCalendar file."), | 3258 | i18n("The journal entries can not be\nexported to a vCalendar file."), |
3259 | i18n("Data Loss Warning"),i18n("Proceed"),i18n("Cancel"), | 3259 | i18n("Data Loss Warning"),i18n("Proceed"),i18n("Cancel"), |
3260 | true); | 3260 | true); |
3261 | if (result != KMessageBox::Continue) return false; | 3261 | if (result != KMessageBox::Continue) return false; |
3262 | } | 3262 | } |
3263 | 3263 | ||
3264 | //QString filename = KFileDialog::getSaveFileName("vcalout.vcs",i18n("*.vcs|VCalendars"),this); | 3264 | //QString filename = KFileDialog::getSaveFileName("vcalout.vcs",i18n("*.vcs|VCalendars"),this); |
3265 | 3265 | ||
3266 | // Force correct extension | 3266 | // Force correct extension |
3267 | if (filename.right(4) != ".vcs") filename += ".vcs"; | 3267 | if (filename.right(4) != ".vcs") filename += ".vcs"; |
3268 | 3268 | ||
3269 | FileStorage storage( mCalendar, filename, new VCalFormat ); | 3269 | FileStorage storage( mCalendar, filename, new VCalFormat ); |
3270 | return storage.save(); | 3270 | return storage.save(); |
3271 | 3271 | ||
3272 | } | 3272 | } |
3273 | 3273 | ||
3274 | void CalendarView::eventUpdated(Incidence *) | 3274 | void CalendarView::eventUpdated(Incidence *) |
3275 | { | 3275 | { |
3276 | setModified(); | 3276 | setModified(); |
3277 | // Don't call updateView here. The code, which has caused the update of the | 3277 | // Don't call updateView here. The code, which has caused the update of the |
3278 | // event is responsible for updating the view. | 3278 | // event is responsible for updating the view. |
3279 | // updateView(); | 3279 | // updateView(); |
3280 | } | 3280 | } |
3281 | 3281 | ||
3282 | void CalendarView::adaptNavigationUnits() | 3282 | void CalendarView::adaptNavigationUnits() |
3283 | { | 3283 | { |
3284 | if (mViewManager->currentView()->isEventView()) { | 3284 | if (mViewManager->currentView()->isEventView()) { |
3285 | int days = mViewManager->currentView()->currentDateCount(); | 3285 | int days = mViewManager->currentView()->currentDateCount(); |
3286 | if (days == 1) { | 3286 | if (days == 1) { |
3287 | emit changeNavStringPrev(i18n("&Previous Day")); | 3287 | emit changeNavStringPrev(i18n("&Previous Day")); |
3288 | emit changeNavStringNext(i18n("&Next Day")); | 3288 | emit changeNavStringNext(i18n("&Next Day")); |
3289 | } else { | 3289 | } else { |
3290 | emit changeNavStringPrev(i18n("&Previous Week")); | 3290 | emit changeNavStringPrev(i18n("&Previous Week")); |
3291 | emit changeNavStringNext(i18n("&Next Week")); | 3291 | emit changeNavStringNext(i18n("&Next Week")); |
3292 | } | 3292 | } |
3293 | } | 3293 | } |
3294 | } | 3294 | } |
3295 | 3295 | ||
3296 | void CalendarView::processMainViewSelection( Incidence *incidence ) | 3296 | void CalendarView::processMainViewSelection( Incidence *incidence ) |
3297 | { | 3297 | { |
3298 | if ( incidence ) mTodoList->clearSelection(); | 3298 | if ( incidence ) mTodoList->clearSelection(); |
3299 | processIncidenceSelection( incidence ); | 3299 | processIncidenceSelection( incidence ); |
3300 | } | 3300 | } |
3301 | 3301 | ||
3302 | void CalendarView::processTodoListSelection( Incidence *incidence ) | 3302 | void CalendarView::processTodoListSelection( Incidence *incidence ) |
3303 | { | 3303 | { |
3304 | if ( incidence && mViewManager->currentView() ) { | 3304 | if ( incidence && mViewManager->currentView() ) { |
3305 | mViewManager->currentView()->clearSelection(); | 3305 | mViewManager->currentView()->clearSelection(); |
3306 | } | 3306 | } |
3307 | processIncidenceSelection( incidence ); | 3307 | processIncidenceSelection( incidence ); |
3308 | } | 3308 | } |
3309 | 3309 | ||
3310 | void CalendarView::processIncidenceSelection( Incidence *incidence ) | 3310 | void CalendarView::processIncidenceSelection( Incidence *incidence ) |
3311 | { | 3311 | { |
3312 | if ( incidence == mSelectedIncidence ) return; | 3312 | if ( incidence == mSelectedIncidence ) return; |
3313 | 3313 | ||
3314 | mSelectedIncidence = incidence; | 3314 | mSelectedIncidence = incidence; |
3315 | 3315 | ||
3316 | emit incidenceSelected( mSelectedIncidence ); | 3316 | emit incidenceSelected( mSelectedIncidence ); |
3317 | 3317 | ||
3318 | if ( incidence && incidence->type() == "Event" ) { | 3318 | if ( incidence && incidence->type() == "Event" ) { |
3319 | Event *event = static_cast<Event *>( incidence ); | 3319 | Event *event = static_cast<Event *>( incidence ); |
3320 | if ( event->organizer() == KOPrefs::instance()->email() ) { | 3320 | if ( event->organizer() == KOPrefs::instance()->email() ) { |
3321 | emit organizerEventsSelected( true ); | 3321 | emit organizerEventsSelected( true ); |
3322 | } else { | 3322 | } else { |
3323 | emit organizerEventsSelected(false); | 3323 | emit organizerEventsSelected(false); |
3324 | } | 3324 | } |
3325 | if (event->attendeeByMails( KOPrefs::instance()->mAdditionalMails, | 3325 | if (event->attendeeByMails( KOPrefs::instance()->mAdditionalMails, |
3326 | KOPrefs::instance()->email() ) ) { | 3326 | KOPrefs::instance()->email() ) ) { |
3327 | emit groupEventsSelected( true ); | 3327 | emit groupEventsSelected( true ); |
3328 | } else { | 3328 | } else { |
3329 | emit groupEventsSelected(false); | 3329 | emit groupEventsSelected(false); |
3330 | } | 3330 | } |
3331 | return; | 3331 | return; |
3332 | } else { | 3332 | } else { |
3333 | if ( incidence && incidence->type() == "Todo" ) { | 3333 | if ( incidence && incidence->type() == "Todo" ) { |
3334 | emit todoSelected( true ); | 3334 | emit todoSelected( true ); |
3335 | Todo *event = static_cast<Todo *>( incidence ); | 3335 | Todo *event = static_cast<Todo *>( incidence ); |
3336 | if ( event->organizer() == KOPrefs::instance()->email() ) { | 3336 | if ( event->organizer() == KOPrefs::instance()->email() ) { |
3337 | emit organizerEventsSelected( true ); | 3337 | emit organizerEventsSelected( true ); |
3338 | } else { | 3338 | } else { |
3339 | emit organizerEventsSelected(false); | 3339 | emit organizerEventsSelected(false); |
3340 | } | 3340 | } |
3341 | if (event->attendeeByMails( KOPrefs::instance()->mAdditionalMails, | 3341 | if (event->attendeeByMails( KOPrefs::instance()->mAdditionalMails, |
3342 | KOPrefs::instance()->email() ) ) { | 3342 | KOPrefs::instance()->email() ) ) { |
3343 | emit groupEventsSelected( true ); | 3343 | emit groupEventsSelected( true ); |
3344 | } else { | 3344 | } else { |
3345 | emit groupEventsSelected(false); | 3345 | emit groupEventsSelected(false); |
3346 | } | 3346 | } |
3347 | return; | 3347 | return; |
3348 | } else { | 3348 | } else { |
3349 | emit todoSelected( false ); | 3349 | emit todoSelected( false ); |
3350 | emit organizerEventsSelected(false); | 3350 | emit organizerEventsSelected(false); |
3351 | emit groupEventsSelected(false); | 3351 | emit groupEventsSelected(false); |
3352 | } | 3352 | } |
3353 | return; | 3353 | return; |
3354 | } | 3354 | } |
3355 | 3355 | ||
3356 | /* if ( incidence && incidence->type() == "Todo" ) { | 3356 | /* if ( incidence && incidence->type() == "Todo" ) { |
3357 | emit todoSelected( true ); | 3357 | emit todoSelected( true ); |
3358 | } else { | 3358 | } else { |
3359 | emit todoSelected( false ); | 3359 | emit todoSelected( false ); |
3360 | }*/ | 3360 | }*/ |
3361 | } | 3361 | } |
3362 | 3362 | ||
3363 | 3363 | ||
3364 | void CalendarView::checkClipboard() | 3364 | void CalendarView::checkClipboard() |
3365 | { | 3365 | { |
3366 | #ifndef KORG_NODND | 3366 | #ifndef KORG_NODND |
3367 | if (ICalDrag::canDecode(QApplication::clipboard()->data())) { | 3367 | if (ICalDrag::canDecode(QApplication::clipboard()->data())) { |
3368 | emit pasteEnabled(true); | 3368 | emit pasteEnabled(true); |
3369 | } else { | 3369 | } else { |
3370 | emit pasteEnabled(false); | 3370 | emit pasteEnabled(false); |
3371 | } | 3371 | } |
3372 | #endif | 3372 | #endif |
3373 | } | 3373 | } |
3374 | 3374 | ||
3375 | void CalendarView::showDates(const DateList &selectedDates) | 3375 | void CalendarView::showDates(const DateList &selectedDates) |
3376 | { | 3376 | { |
3377 | // kdDebug() << "CalendarView::selectDates()" << endl; | 3377 | // kdDebug() << "CalendarView::selectDates()" << endl; |
3378 | 3378 | ||
3379 | if ( mViewManager->currentView() ) { | 3379 | if ( mViewManager->currentView() ) { |
3380 | updateView( selectedDates.first(), selectedDates.last() ); | 3380 | updateView( selectedDates.first(), selectedDates.last() ); |
3381 | } else { | 3381 | } else { |
3382 | mViewManager->showAgendaView(); | 3382 | mViewManager->showAgendaView(); |
3383 | } | 3383 | } |
3384 | 3384 | ||
3385 | QString selDates; | 3385 | QString selDates; |
3386 | selDates = KGlobal::locale()->formatDate( selectedDates.first(), true); | 3386 | selDates = KGlobal::locale()->formatDate( selectedDates.first(), true); |
3387 | if (selectedDates.first() < selectedDates.last() ) | 3387 | if (selectedDates.first() < selectedDates.last() ) |
3388 | selDates += " - " + KGlobal::locale()->formatDate( selectedDates.last(),true); | 3388 | selDates += " - " + KGlobal::locale()->formatDate( selectedDates.last(),true); |
3389 | topLevelWidget()->setCaption( i18n("Dates: ") + selDates ); | 3389 | topLevelWidget()->setCaption( i18n("Dates: ") + selDates ); |
3390 | 3390 | ||
3391 | } | 3391 | } |
3392 | 3392 | ||
3393 | QPtrList<CalFilter> CalendarView::filters() | 3393 | QPtrList<CalFilter> CalendarView::filters() |
3394 | { | 3394 | { |
3395 | return mFilters; | 3395 | return mFilters; |
3396 | 3396 | ||
3397 | } | 3397 | } |
3398 | void CalendarView::editFilters() | 3398 | void CalendarView::editFilters() |
3399 | { | 3399 | { |
3400 | // kdDebug() << "CalendarView::editFilters()" << endl; | 3400 | // kdDebug() << "CalendarView::editFilters()" << endl; |
3401 | 3401 | ||
3402 | CalFilter *filter = mFilters.first(); | 3402 | CalFilter *filter = mFilters.first(); |
3403 | while(filter) { | 3403 | while(filter) { |
3404 | kdDebug() << " Filter: " << filter->name() << endl; | 3404 | kdDebug() << " Filter: " << filter->name() << endl; |
3405 | filter = mFilters.next(); | 3405 | filter = mFilters.next(); |
3406 | } | 3406 | } |
3407 | 3407 | ||
3408 | mDialogManager->showFilterEditDialog(&mFilters); | 3408 | mDialogManager->showFilterEditDialog(&mFilters); |
3409 | } | 3409 | } |
3410 | void CalendarView::toggleFilter() | 3410 | void CalendarView::toggleFilter() |
3411 | { | 3411 | { |
3412 | showFilter(! mFilterView->isVisible()); | 3412 | showFilter(! mFilterView->isVisible()); |
3413 | } | 3413 | } |
3414 | 3414 | ||
3415 | KOFilterView *CalendarView::filterView() | 3415 | KOFilterView *CalendarView::filterView() |
3416 | { | 3416 | { |
3417 | return mFilterView; | 3417 | return mFilterView; |
3418 | } | 3418 | } |
3419 | void CalendarView::selectFilter( int fil ) | 3419 | void CalendarView::selectFilter( int fil ) |
3420 | { | 3420 | { |
3421 | mFilterView->setSelectedFilter( fil ); | 3421 | mFilterView->setSelectedFilter( fil ); |
3422 | } | 3422 | } |
3423 | void CalendarView::showFilter(bool visible) | 3423 | void CalendarView::showFilter(bool visible) |
3424 | { | 3424 | { |
3425 | if (visible) mFilterView->show(); | 3425 | if (visible) mFilterView->show(); |
3426 | else mFilterView->hide(); | 3426 | else mFilterView->hide(); |
3427 | } | 3427 | } |
3428 | void CalendarView::toggleFilerEnabled( ) | 3428 | void CalendarView::toggleFilerEnabled( ) |
3429 | { | 3429 | { |
3430 | mFilterView->setFiltersEnabled ( !mFilterView->filtersEnabled() ); | 3430 | mFilterView->setFiltersEnabled ( !mFilterView->filtersEnabled() ); |
3431 | if ( !mFilterView->filtersEnabled() ) | 3431 | if ( !mFilterView->filtersEnabled() ) |
3432 | topLevelWidget()->setCaption( i18n("Filter disabled ") ); | 3432 | topLevelWidget()->setCaption( i18n("Filter disabled ") ); |
3433 | 3433 | ||
3434 | } | 3434 | } |
3435 | void CalendarView::updateFilter() | 3435 | void CalendarView::updateFilter() |
3436 | { | 3436 | { |
3437 | CalFilter *filter = mFilterView->selectedFilter(); | 3437 | CalFilter *filter = mFilterView->selectedFilter(); |
3438 | if (filter) { | 3438 | if (filter) { |
3439 | if (mFilterView->filtersEnabled()) { | 3439 | if (mFilterView->filtersEnabled()) { |
3440 | topLevelWidget()->setCaption( i18n("Filter selected: ")+filter->name() ); | 3440 | topLevelWidget()->setCaption( i18n("Filter selected: ")+filter->name() ); |
3441 | filter->setEnabled(true); | 3441 | filter->setEnabled(true); |
3442 | } | 3442 | } |
3443 | else filter->setEnabled(false); | 3443 | else filter->setEnabled(false); |
3444 | mCalendar->setFilter(filter); | 3444 | mCalendar->setFilter(filter); |
3445 | updateView(); | 3445 | updateView(); |
3446 | } | 3446 | } |
3447 | } | 3447 | } |
3448 | 3448 | ||
3449 | void CalendarView::filterEdited() | 3449 | void CalendarView::filterEdited() |
3450 | { | 3450 | { |
3451 | mFilterView->updateFilters(); | 3451 | mFilterView->updateFilters(); |
3452 | updateFilter(); | 3452 | updateFilter(); |
3453 | writeSettings(); | 3453 | writeSettings(); |
3454 | } | 3454 | } |
3455 | 3455 | ||
3456 | 3456 | ||
3457 | void CalendarView::takeOverEvent() | 3457 | void CalendarView::takeOverEvent() |
3458 | { | 3458 | { |
3459 | Incidence *incidence = currentSelection(); | 3459 | Incidence *incidence = currentSelection(); |
3460 | 3460 | ||
3461 | if (!incidence) return; | 3461 | if (!incidence) return; |
3462 | 3462 | ||
3463 | incidence->setOrganizer(KOPrefs::instance()->email()); | 3463 | incidence->setOrganizer(KOPrefs::instance()->email()); |
3464 | incidence->recreate(); | 3464 | incidence->recreate(); |
3465 | incidence->setReadOnly(false); | 3465 | incidence->setReadOnly(false); |
3466 | 3466 | ||
3467 | updateView(); | 3467 | updateView(); |
3468 | } | 3468 | } |
3469 | 3469 | ||
3470 | void CalendarView::takeOverCalendar() | 3470 | void CalendarView::takeOverCalendar() |
3471 | { | 3471 | { |
3472 | // TODO: Create Calendar::allIncidences() function and use it here | 3472 | // TODO: Create Calendar::allIncidences() function and use it here |
3473 | 3473 | ||
3474 | QPtrList<Event> events = mCalendar->events(); | 3474 | QPtrList<Event> events = mCalendar->events(); |
3475 | for(uint i=0; i<events.count(); ++i) { | 3475 | for(uint i=0; i<events.count(); ++i) { |
3476 | events.at(i)->setOrganizer(KOPrefs::instance()->email()); | 3476 | events.at(i)->setOrganizer(KOPrefs::instance()->email()); |
3477 | events.at(i)->recreate(); | 3477 | events.at(i)->recreate(); |
3478 | events.at(i)->setReadOnly(false); | 3478 | events.at(i)->setReadOnly(false); |
3479 | } | 3479 | } |
3480 | 3480 | ||
3481 | QPtrList<Todo> todos = mCalendar->todos(); | 3481 | QPtrList<Todo> todos = mCalendar->todos(); |
3482 | for(uint i=0; i<todos.count(); ++i) { | 3482 | for(uint i=0; i<todos.count(); ++i) { |
3483 | todos.at(i)->setOrganizer(KOPrefs::instance()->email()); | 3483 | todos.at(i)->setOrganizer(KOPrefs::instance()->email()); |
3484 | todos.at(i)->recreate(); | 3484 | todos.at(i)->recreate(); |
3485 | todos.at(i)->setReadOnly(false); | 3485 | todos.at(i)->setReadOnly(false); |
3486 | } | 3486 | } |
3487 | 3487 | ||
3488 | QPtrList<Journal> journals = mCalendar->journals(); | 3488 | QPtrList<Journal> journals = mCalendar->journals(); |
3489 | for(uint i=0; i<journals.count(); ++i) { | 3489 | for(uint i=0; i<journals.count(); ++i) { |
3490 | journals.at(i)->setOrganizer(KOPrefs::instance()->email()); | 3490 | journals.at(i)->setOrganizer(KOPrefs::instance()->email()); |
3491 | journals.at(i)->recreate(); | 3491 | journals.at(i)->recreate(); |
3492 | journals.at(i)->setReadOnly(false); | 3492 | journals.at(i)->setReadOnly(false); |
3493 | } | 3493 | } |
3494 | 3494 | ||
3495 | updateView(); | 3495 | updateView(); |
3496 | } | 3496 | } |
3497 | 3497 | ||
3498 | void CalendarView::showIntro() | 3498 | void CalendarView::showIntro() |
3499 | { | 3499 | { |
3500 | kdDebug() << "To be implemented." << endl; | 3500 | kdDebug() << "To be implemented." << endl; |
3501 | } | 3501 | } |
3502 | 3502 | ||
3503 | QWidgetStack *CalendarView::viewStack() | 3503 | QWidgetStack *CalendarView::viewStack() |
3504 | { | 3504 | { |
3505 | return mRightFrame; | 3505 | return mRightFrame; |
3506 | } | 3506 | } |
3507 | 3507 | ||
3508 | QWidget *CalendarView::leftFrame() | 3508 | QWidget *CalendarView::leftFrame() |
3509 | { | 3509 | { |
3510 | return mLeftFrame; | 3510 | return mLeftFrame; |
3511 | } | 3511 | } |
3512 | 3512 | ||
3513 | DateNavigator *CalendarView::dateNavigator() | 3513 | DateNavigator *CalendarView::dateNavigator() |
3514 | { | 3514 | { |
3515 | return mNavigator; | 3515 | return mNavigator; |
3516 | } | 3516 | } |
3517 | 3517 | ||
3518 | KDateNavigator* CalendarView::dateNavigatorWidget() | 3518 | KDateNavigator* CalendarView::dateNavigatorWidget() |
3519 | { | 3519 | { |
3520 | return mDateNavigator; | 3520 | return mDateNavigator; |
3521 | } | 3521 | } |
3522 | void CalendarView::toggleDateNavigatorWidget() | 3522 | void CalendarView::toggleDateNavigatorWidget() |
3523 | { | 3523 | { |
3524 | if (mDateNavigator->isVisible()) | 3524 | if (mDateNavigator->isVisible()) |
3525 | mDateNavigator->hide(); | 3525 | mDateNavigator->hide(); |
3526 | else | 3526 | else |
3527 | mDateNavigator->show(); | 3527 | mDateNavigator->show(); |
3528 | } | 3528 | } |
3529 | void CalendarView::addView(KOrg::BaseView *view) | 3529 | void CalendarView::addView(KOrg::BaseView *view) |
3530 | { | 3530 | { |
3531 | mViewManager->addView(view); | 3531 | mViewManager->addView(view); |
3532 | } | 3532 | } |
3533 | 3533 | ||
3534 | void CalendarView::showView(KOrg::BaseView *view) | 3534 | void CalendarView::showView(KOrg::BaseView *view) |
3535 | { | 3535 | { |
3536 | mViewManager->showView(view, mLeftFrame->isVisible()); | 3536 | mViewManager->showView(view, mLeftFrame->isVisible()); |
3537 | } | 3537 | } |
3538 | 3538 | ||
3539 | Incidence *CalendarView::currentSelection() | 3539 | Incidence *CalendarView::currentSelection() |
3540 | { | 3540 | { |
3541 | return mViewManager->currentSelection(); | 3541 | return mViewManager->currentSelection(); |
3542 | } | 3542 | } |
3543 | void CalendarView::toggleAllDaySize() | 3543 | void CalendarView::toggleAllDaySize() |
3544 | { | 3544 | { |
3545 | /* | 3545 | /* |
3546 | if ( KOPrefs::instance()->mAllDaySize > 47 ) | 3546 | if ( KOPrefs::instance()->mAllDaySize > 47 ) |
3547 | KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize /2; | 3547 | KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize /2; |
3548 | else | 3548 | else |
3549 | KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize *2; | 3549 | KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize *2; |
3550 | */ | 3550 | */ |
3551 | viewManager()->agendaView()->toggleAllDay(); | 3551 | viewManager()->agendaView()->toggleAllDay(); |
3552 | } | 3552 | } |
3553 | void CalendarView::toggleExpand() | 3553 | void CalendarView::toggleExpand() |
3554 | { | 3554 | { |
3555 | // if ( mLeftFrame->isHidden() ) { | 3555 | // if ( mLeftFrame->isHidden() ) { |
3556 | // mLeftFrame->show(); | 3556 | // mLeftFrame->show(); |
3557 | // emit calendarViewExpanded( false ); | 3557 | // emit calendarViewExpanded( false ); |
3558 | // } else { | 3558 | // } else { |
3559 | // mLeftFrame->hide(); | 3559 | // mLeftFrame->hide(); |
3560 | // emit calendarViewExpanded( true ); | 3560 | // emit calendarViewExpanded( true ); |
3561 | // } | 3561 | // } |
3562 | 3562 | ||
3563 | globalFlagBlockAgenda = 1; | 3563 | globalFlagBlockAgenda = 1; |
3564 | emit calendarViewExpanded( !mLeftFrame->isHidden() ); | 3564 | emit calendarViewExpanded( !mLeftFrame->isHidden() ); |
3565 | globalFlagBlockAgenda = 5; | 3565 | globalFlagBlockAgenda = 5; |
3566 | mViewManager->raiseCurrentView( !mLeftFrame->isHidden() ); | 3566 | mViewManager->raiseCurrentView( !mLeftFrame->isHidden() ); |
3567 | //mViewManager->showView( 0, true ); | 3567 | //mViewManager->showView( 0, true ); |
3568 | } | 3568 | } |
3569 | 3569 | ||
3570 | void CalendarView::calendarModified( bool modified, Calendar * ) | 3570 | void CalendarView::calendarModified( bool modified, Calendar * ) |
3571 | { | 3571 | { |
3572 | setModified( modified ); | 3572 | setModified( modified ); |
3573 | } | 3573 | } |
3574 | 3574 | ||
3575 | Todo *CalendarView::selectedTodo() | 3575 | Todo *CalendarView::selectedTodo() |
3576 | { | 3576 | { |
3577 | Incidence *incidence = currentSelection(); | 3577 | Incidence *incidence = currentSelection(); |
3578 | if ( incidence && incidence->type() == "Todo" ) { | 3578 | if ( incidence && incidence->type() == "Todo" ) { |
3579 | return static_cast<Todo *>( incidence ); | 3579 | return static_cast<Todo *>( incidence ); |
3580 | } | 3580 | } |
3581 | 3581 | ||
3582 | incidence = mTodoList->selectedIncidences().first(); | 3582 | incidence = mTodoList->selectedIncidences().first(); |
3583 | if ( incidence && incidence->type() == "Todo" ) { | 3583 | if ( incidence && incidence->type() == "Todo" ) { |
3584 | return static_cast<Todo *>( incidence ); | 3584 | return static_cast<Todo *>( incidence ); |
3585 | } | 3585 | } |
3586 | 3586 | ||
3587 | return 0; | 3587 | return 0; |
3588 | } | 3588 | } |
3589 | 3589 | ||
3590 | void CalendarView::dialogClosing(Incidence *in) | 3590 | void CalendarView::dialogClosing(Incidence *in) |
3591 | { | 3591 | { |
3592 | // mDialogList.remove(in); | 3592 | // mDialogList.remove(in); |
3593 | } | 3593 | } |
3594 | 3594 | ||
3595 | void CalendarView::showIncidence() | 3595 | void CalendarView::showIncidence() |
3596 | { | 3596 | { |
3597 | Incidence *incidence = currentSelection(); | 3597 | Incidence *incidence = currentSelection(); |
3598 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); | 3598 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); |
3599 | if ( incidence ) { | 3599 | if ( incidence ) { |
3600 | ShowIncidenceVisitor v; | 3600 | ShowIncidenceVisitor v; |
3601 | v.act( incidence, this ); | 3601 | v.act( incidence, this ); |
3602 | } | 3602 | } |
3603 | } | 3603 | } |
3604 | void CalendarView::editIncidenceDescription() | 3604 | void CalendarView::editIncidenceDescription() |
3605 | { | 3605 | { |
3606 | mFlagEditDescription = true; | 3606 | mFlagEditDescription = true; |
3607 | editIncidence(); | 3607 | editIncidence(); |
3608 | mFlagEditDescription = false; | 3608 | mFlagEditDescription = false; |
3609 | } | 3609 | } |
3610 | void CalendarView::editIncidence() | 3610 | void CalendarView::editIncidence() |
3611 | { | 3611 | { |
3612 | // qDebug("editIncidence() "); | 3612 | // qDebug("editIncidence() "); |
3613 | Incidence *incidence = currentSelection(); | 3613 | Incidence *incidence = currentSelection(); |
3614 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); | 3614 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); |
3615 | if ( incidence ) { | 3615 | if ( incidence ) { |
3616 | EditIncidenceVisitor v; | 3616 | EditIncidenceVisitor v; |
3617 | v.act( incidence, this ); | 3617 | v.act( incidence, this ); |
3618 | } | 3618 | } |
3619 | } | 3619 | } |
3620 | 3620 | ||
3621 | void CalendarView::deleteIncidence() | 3621 | void CalendarView::deleteIncidence() |
3622 | { | 3622 | { |
3623 | Incidence *incidence = currentSelection(); | 3623 | Incidence *incidence = currentSelection(); |
3624 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); | 3624 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); |
3625 | if ( incidence ) { | 3625 | if ( incidence ) { |
3626 | deleteIncidence(incidence); | 3626 | deleteIncidence(incidence); |
3627 | } | 3627 | } |
3628 | } | 3628 | } |
3629 | 3629 | ||
3630 | void CalendarView::showIncidence(Incidence *incidence) | 3630 | void CalendarView::showIncidence(Incidence *incidence) |
3631 | { | 3631 | { |
3632 | if ( incidence ) { | 3632 | if ( incidence ) { |
3633 | ShowIncidenceVisitor v; | 3633 | ShowIncidenceVisitor v; |
3634 | v.act( incidence, this ); | 3634 | v.act( incidence, this ); |
3635 | } | 3635 | } |
3636 | } | 3636 | } |
3637 | 3637 | ||
3638 | void CalendarView::editIncidence(Incidence *incidence) | 3638 | void CalendarView::editIncidence(Incidence *incidence) |
3639 | { | 3639 | { |
3640 | if ( incidence ) { | 3640 | if ( incidence ) { |
3641 | 3641 | ||
3642 | EditIncidenceVisitor v; | 3642 | EditIncidenceVisitor v; |
3643 | v.act( incidence, this ); | 3643 | v.act( incidence, this ); |
3644 | 3644 | ||
3645 | } | 3645 | } |
3646 | } | 3646 | } |
3647 | 3647 | ||
3648 | void CalendarView::deleteIncidence(Incidence *incidence) | 3648 | void CalendarView::deleteIncidence(Incidence *incidence) |
3649 | { | 3649 | { |
3650 | //qDebug(" CalendarView::deleteIncidence "); | 3650 | //qDebug(" CalendarView::deleteIncidence "); |
3651 | if ( incidence ) { | 3651 | if ( incidence ) { |
3652 | DeleteIncidenceVisitor v; | 3652 | DeleteIncidenceVisitor v; |
3653 | v.act( incidence, this ); | 3653 | v.act( incidence, this ); |
3654 | } | 3654 | } |
3655 | } | 3655 | } |
3656 | 3656 | ||
3657 | 3657 | ||
3658 | void CalendarView::lookForOutgoingMessages() | 3658 | void CalendarView::lookForOutgoingMessages() |
3659 | { | 3659 | { |
3660 | OutgoingDialog *ogd = mDialogManager->outgoingDialog(); | 3660 | OutgoingDialog *ogd = mDialogManager->outgoingDialog(); |
3661 | ogd->loadMessages(); | 3661 | ogd->loadMessages(); |
3662 | } | 3662 | } |
3663 | 3663 | ||
3664 | void CalendarView::lookForIncomingMessages() | 3664 | void CalendarView::lookForIncomingMessages() |
3665 | { | 3665 | { |
3666 | IncomingDialog *icd = mDialogManager->incomingDialog(); | 3666 | IncomingDialog *icd = mDialogManager->incomingDialog(); |
3667 | icd->retrieve(); | 3667 | icd->retrieve(); |
3668 | } | 3668 | } |
3669 | 3669 | ||
3670 | bool CalendarView::removeCompletedSubTodos( Todo* t ) | 3670 | bool CalendarView::removeCompletedSubTodos( Todo* t ) |
3671 | { | 3671 | { |
3672 | bool deleteTodo = true; | 3672 | bool deleteTodo = true; |
3673 | QPtrList<Incidence> subTodos; | 3673 | QPtrList<Incidence> subTodos; |
3674 | Incidence *aTodo; | 3674 | Incidence *aTodo; |
3675 | subTodos = t->relations(); | 3675 | subTodos = t->relations(); |
3676 | for (aTodo = subTodos.first(); aTodo; aTodo = subTodos.next()) { | 3676 | for (aTodo = subTodos.first(); aTodo; aTodo = subTodos.next()) { |
3677 | if (! removeCompletedSubTodos( (Todo*) aTodo )) | 3677 | if (! removeCompletedSubTodos( (Todo*) aTodo )) |
3678 | deleteTodo = false; | 3678 | deleteTodo = false; |
3679 | } | 3679 | } |
3680 | if ( deleteTodo ) { | 3680 | if ( deleteTodo ) { |
3681 | if ( t->isCompleted() ) { | 3681 | if ( t->isCompleted() ) { |
3682 | checkExternalId( t ); | 3682 | checkExternalId( t ); |
3683 | mCalendar->deleteTodo( t ); | 3683 | mCalendar->deleteTodo( t ); |
3684 | changeTodoDisplay( t,KOGlobals::EVENTDELETED ); | 3684 | changeTodoDisplay( t,KOGlobals::EVENTDELETED ); |
3685 | } | 3685 | } |
3686 | else | 3686 | else |
3687 | deleteTodo = false; | 3687 | deleteTodo = false; |
3688 | } | 3688 | } |
3689 | return deleteTodo; | 3689 | return deleteTodo; |
3690 | 3690 | ||
3691 | } | 3691 | } |
3692 | void CalendarView::purgeCompleted() | 3692 | void CalendarView::purgeCompleted() |
3693 | { | 3693 | { |
3694 | int result = KMessageBox::warningContinueCancel(this, | 3694 | int result = KMessageBox::warningContinueCancel(this, |
3695 | i18n("Delete all\ncompleted To-Dos?"),i18n("Purge To-Dos"),i18n("Purge")); | 3695 | i18n("Delete all\ncompleted To-Dos?"),i18n("Purge To-Dos"),i18n("Purge")); |
3696 | 3696 | ||
3697 | if (result == KMessageBox::Continue) { | 3697 | if (result == KMessageBox::Continue) { |
3698 | 3698 | ||
3699 | QPtrList<Todo> todoCal; | 3699 | QPtrList<Todo> todoCal; |
3700 | QPtrList<Todo> rootTodos; | 3700 | QPtrList<Todo> rootTodos; |
3701 | //QPtrList<Incidence> rel; | 3701 | //QPtrList<Incidence> rel; |
3702 | Todo *aTodo;//, *rTodo; | 3702 | Todo *aTodo;//, *rTodo; |
3703 | Incidence *rIncidence; | 3703 | Incidence *rIncidence; |
3704 | bool childDelete = false; | 3704 | bool childDelete = false; |
3705 | bool deletedOne = true; | 3705 | bool deletedOne = true; |
3706 | todoCal = calendar()->todos(); | 3706 | todoCal = calendar()->todos(); |
3707 | for (aTodo = todoCal.first(); aTodo; aTodo = todoCal.next()) { | 3707 | for (aTodo = todoCal.first(); aTodo; aTodo = todoCal.next()) { |
3708 | if ( !aTodo->relatedTo() ) | 3708 | if ( !aTodo->relatedTo() ) |
3709 | rootTodos.append( aTodo ); | 3709 | rootTodos.append( aTodo ); |
3710 | } | 3710 | } |
3711 | for (aTodo = rootTodos.first(); aTodo; aTodo = rootTodos.next()) { | 3711 | for (aTodo = rootTodos.first(); aTodo; aTodo = rootTodos.next()) { |
3712 | removeCompletedSubTodos( aTodo ); | 3712 | removeCompletedSubTodos( aTodo ); |
3713 | } | 3713 | } |
3714 | 3714 | ||
3715 | updateView(); | 3715 | updateView(); |
3716 | } | 3716 | } |
3717 | } | 3717 | } |
3718 | 3718 | ||
3719 | void CalendarView::slotCalendarChanged() | 3719 | void CalendarView::slotCalendarChanged() |
3720 | { | 3720 | { |
3721 | ; | 3721 | ; |
3722 | } | 3722 | } |
3723 | 3723 | ||
3724 | NavigatorBar *CalendarView::navigatorBar() | 3724 | NavigatorBar *CalendarView::navigatorBar() |
3725 | { | 3725 | { |
3726 | return mNavigatorBar; | 3726 | return mNavigatorBar; |
3727 | } | 3727 | } |
3728 | 3728 | ||
3729 | 3729 | ||
3730 | 3730 | ||
3731 | void CalendarView::keyPressEvent ( QKeyEvent *e) | 3731 | void CalendarView::keyPressEvent ( QKeyEvent *e) |
3732 | { | 3732 | { |
3733 | //qDebug(" alendarView::keyPressEvent "); | 3733 | //qDebug(" alendarView::keyPressEvent "); |
3734 | e->ignore(); | 3734 | e->ignore(); |
3735 | } | 3735 | } |
3736 | 3736 | ||
3737 | 3737 | ||
3738 | bool CalendarView::sync(KSyncManager* manager, QString filename, int mode) | 3738 | bool CalendarView::sync(KSyncManager* manager, QString filename, int mode) |
3739 | { | 3739 | { |
3740 | // mSyncManager = manager; | 3740 | // mSyncManager = manager; |
3741 | mSyncKDE = false; | 3741 | mSyncKDE = false; |
3742 | if ( filename == QDir::homeDirPath ()+"/.kdecalendardump.ics" ) { | 3742 | if ( filename == QDir::homeDirPath ()+"/.kdecalendardump.ics" ) { |
3743 | qDebug("SyncKDE request detected!"); | 3743 | qDebug("SyncKDE request detected!"); |
3744 | mSyncKDE = true; | 3744 | mSyncKDE = true; |
3745 | } | 3745 | } |
3746 | mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice(); | 3746 | mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice(); |
3747 | mCurrentSyncName = mSyncManager->getCurrentSyncName(); | 3747 | mCurrentSyncName = mSyncManager->getCurrentSyncName(); |
3748 | return syncCalendar( filename, mode ); | 3748 | return syncCalendar( filename, mode ); |
3749 | } | 3749 | } |
3750 | bool CalendarView::syncExternal(KSyncManager* manager, QString resource) | 3750 | bool CalendarView::syncExternal(KSyncManager* manager, QString resource) |
3751 | { | 3751 | { |
3752 | mSyncKDE = false; | 3752 | mSyncKDE = false; |
3753 | //mSyncManager = manager; | 3753 | //mSyncManager = manager; |
3754 | mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice(); | 3754 | mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice(); |
3755 | mCurrentSyncName = mSyncManager->getCurrentSyncName(); | 3755 | mCurrentSyncName = mSyncManager->getCurrentSyncName(); |
3756 | if ( resource == "sharp" ) | 3756 | if ( resource == "sharp" ) |
3757 | syncExternal( 0 ); | 3757 | syncExternal( 0 ); |
3758 | if ( resource == "phone" ) | 3758 | if ( resource == "phone" ) |
3759 | syncExternal( 1 ); | 3759 | syncExternal( 1 ); |
3760 | // pending setmodified | 3760 | // pending setmodified |
3761 | return true; | 3761 | return true; |
3762 | } | 3762 | } |
3763 | void CalendarView::setSyncManager(KSyncManager* manager) | 3763 | void CalendarView::setSyncManager(KSyncManager* manager) |
3764 | { | 3764 | { |
3765 | mSyncManager = manager; | 3765 | mSyncManager = manager; |
3766 | } | 3766 | } |
3767 | |||
3768 | void CalendarView::removeSyncInfo( QString syncProfile) | ||
3769 | { | ||
3770 | qDebug("removeSyncInfo for profile %s ", syncProfile.latin1()); | ||
3771 | |||
3772 | } | ||
diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h index 2818ee9..acc20d6 100644 --- a/korganizer/calendarview.h +++ b/korganizer/calendarview.h | |||
@@ -1,605 +1,606 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KOrganizer. | 2 | This file is part of KOrganizer. |
3 | Copyright (c) 2000, 2001 | 3 | Copyright (c) 2000, 2001 |
4 | Cornelius Schumacher <schumacher@kde.org> | 4 | Cornelius Schumacher <schumacher@kde.org> |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify | 6 | This program is free software; you can redistribute it and/or modify |
7 | it under the terms of the GNU General Public License as published by | 7 | it under the terms of the GNU General Public License as published by |
8 | the Free Software Foundation; either version 2 of the License, or | 8 | the Free Software Foundation; either version 2 of the License, or |
9 | (at your option) any later version. | 9 | (at your option) any later version. |
10 | 10 | ||
11 | This program is distributed in the hope that it will be useful, | 11 | This program is distributed in the hope that it will be useful, |
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 | GNU General Public License for more details. | 14 | GNU General Public License for more details. |
15 | 15 | ||
16 | You should have received a copy of the GNU General Public License | 16 | You should have received a copy of the GNU General Public License |
17 | along with this program; if not, write to the Free Software | 17 | along with this program; if not, write to the Free Software |
18 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 18 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
19 | 19 | ||
20 | As a special exception, permission is given to link this program | 20 | As a special exception, permission is given to link this program |
21 | with any edition of Qt, and distribute the resulting executable, | 21 | with any edition of Qt, and distribute the resulting executable, |
22 | without including the source code for Qt in the source distribution. | 22 | without including the source code for Qt in the source distribution. |
23 | */ | 23 | */ |
24 | #ifndef CALENDARVIEW_H | 24 | #ifndef CALENDARVIEW_H |
25 | #define CALENDARVIEW_H | 25 | #define CALENDARVIEW_H |
26 | 26 | ||
27 | #include <qframe.h> | 27 | #include <qframe.h> |
28 | #include <qlayout.h> | 28 | #include <qlayout.h> |
29 | #include <qwidget.h> | 29 | #include <qwidget.h> |
30 | #include <qptrlist.h> | 30 | #include <qptrlist.h> |
31 | #include <qvbox.h> | 31 | #include <qvbox.h> |
32 | #include <qmap.h> | 32 | #include <qmap.h> |
33 | #ifndef DESKTOP_VERSION | 33 | #ifndef DESKTOP_VERSION |
34 | #include <qtopia/ir.h> | 34 | #include <qtopia/ir.h> |
35 | #else | 35 | #else |
36 | #define Ir char | 36 | #define Ir char |
37 | #endif | 37 | #endif |
38 | #include <libkcal/calendar.h> | 38 | #include <libkcal/calendar.h> |
39 | #include <libkcal/scheduler.h> | 39 | #include <libkcal/scheduler.h> |
40 | #include <libkcal/calendarresources.h> | 40 | #include <libkcal/calendarresources.h> |
41 | #include <libkcal/resourcecalendar.h> | 41 | #include <libkcal/resourcecalendar.h> |
42 | 42 | ||
43 | #include <korganizer/calendarviewbase.h> | 43 | #include <korganizer/calendarviewbase.h> |
44 | 44 | ||
45 | #include <ksyncmanager.h> | 45 | #include <ksyncmanager.h> |
46 | 46 | ||
47 | class QWidgetStack; | 47 | class QWidgetStack; |
48 | class QSplitter; | 48 | class QSplitter; |
49 | 49 | ||
50 | class CalPrinter; | 50 | class CalPrinter; |
51 | class KOFilterView; | 51 | class KOFilterView; |
52 | class KOViewManager; | 52 | class KOViewManager; |
53 | class KODialogManager; | 53 | class KODialogManager; |
54 | class KOTodoView; | 54 | class KOTodoView; |
55 | class KDateNavigator; | 55 | class KDateNavigator; |
56 | class DateNavigator; | 56 | class DateNavigator; |
57 | class KOIncidenceEditor; | 57 | class KOIncidenceEditor; |
58 | class KDatePicker; | 58 | class KDatePicker; |
59 | class ResourceView; | 59 | class ResourceView; |
60 | class NavigatorBar; | 60 | class NavigatorBar; |
61 | class KOEventEditor; | 61 | class KOEventEditor; |
62 | class KOTodoEditor ; | 62 | class KOTodoEditor ; |
63 | class KOEventViewerDialog; | 63 | class KOEventViewerDialog; |
64 | class KOBeamPrefs; | 64 | class KOBeamPrefs; |
65 | class KSyncProfile; | 65 | class KSyncProfile; |
66 | class AlarmDialog; | 66 | class AlarmDialog; |
67 | class KCal::Attendee; | 67 | class KCal::Attendee; |
68 | 68 | ||
69 | namespace KCal { class FileStorage; } | 69 | namespace KCal { class FileStorage; } |
70 | 70 | ||
71 | using namespace KCal; | 71 | using namespace KCal; |
72 | 72 | ||
73 | /** | 73 | /** |
74 | This is the main calendar widget. It provides the different vies on t he | 74 | This is the main calendar widget. It provides the different vies on t he |
75 | calendar data as well as the date navigator. It also handles synchronisation | 75 | calendar data as well as the date navigator. It also handles synchronisation |
76 | of the different views and controls the different dialogs like preferences, | 76 | of the different views and controls the different dialogs like preferences, |
77 | event editor, search dialog etc. | 77 | event editor, search dialog etc. |
78 | 78 | ||
79 | @short main calendar view widget | 79 | @short main calendar view widget |
80 | @author Cornelius Schumacher | 80 | @author Cornelius Schumacher |
81 | */ | 81 | */ |
82 | class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Observer, public KSyncInterface | 82 | class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Observer, public KSyncInterface |
83 | { | 83 | { |
84 | Q_OBJECT | 84 | Q_OBJECT |
85 | public: | 85 | public: |
86 | /** | 86 | /** |
87 | Constructs a new calendar view widget. | 87 | Constructs a new calendar view widget. |
88 | 88 | ||
89 | @param calendar calendar document | 89 | @param calendar calendar document |
90 | @param parent parent window | 90 | @param parent parent window |
91 | @param name Qt internal widget object name | 91 | @param name Qt internal widget object name |
92 | */ | 92 | */ |
93 | CalendarView( CalendarResources *calendar, QWidget *parent = 0, | 93 | CalendarView( CalendarResources *calendar, QWidget *parent = 0, |
94 | const char *name = 0 ); | 94 | const char *name = 0 ); |
95 | CalendarView( Calendar *calendar, QWidget *parent = 0, | 95 | CalendarView( Calendar *calendar, QWidget *parent = 0, |
96 | const char *name = 0 ); | 96 | const char *name = 0 ); |
97 | virtual ~CalendarView(); | 97 | virtual ~CalendarView(); |
98 | 98 | ||
99 | Calendar *calendar() { return mCalendar; } | 99 | Calendar *calendar() { return mCalendar; } |
100 | 100 | ||
101 | KOViewManager *viewManager(); | 101 | KOViewManager *viewManager(); |
102 | KODialogManager *dialogManager(); | 102 | KODialogManager *dialogManager(); |
103 | 103 | ||
104 | QDate startDate(); | 104 | QDate startDate(); |
105 | QDate endDate(); | 105 | QDate endDate(); |
106 | 106 | ||
107 | QWidgetStack *viewStack(); | 107 | QWidgetStack *viewStack(); |
108 | QWidget *leftFrame(); | 108 | QWidget *leftFrame(); |
109 | NavigatorBar *navigatorBar(); | 109 | NavigatorBar *navigatorBar(); |
110 | 110 | ||
111 | DateNavigator *dateNavigator(); | 111 | DateNavigator *dateNavigator(); |
112 | KDateNavigator *dateNavigatorWidget(); | 112 | KDateNavigator *dateNavigatorWidget(); |
113 | 113 | ||
114 | void addView(KOrg::BaseView *); | 114 | void addView(KOrg::BaseView *); |
115 | void showView(KOrg::BaseView *); | 115 | void showView(KOrg::BaseView *); |
116 | KOEventViewerDialog* getEventViewerDialog(); | 116 | KOEventViewerDialog* getEventViewerDialog(); |
117 | Incidence *currentSelection(); | 117 | Incidence *currentSelection(); |
118 | 118 | ||
119 | signals: | 119 | signals: |
120 | void tempDisableBR(bool); | 120 | void tempDisableBR(bool); |
121 | /** This todo has been modified */ | 121 | /** This todo has been modified */ |
122 | void todoModified(Todo *, int); | 122 | void todoModified(Todo *, int); |
123 | 123 | ||
124 | /** when change is made to options dialog, the topwidget will catch this | 124 | /** when change is made to options dialog, the topwidget will catch this |
125 | * and emit this signal which notifies all widgets which have registered | 125 | * and emit this signal which notifies all widgets which have registered |
126 | * for notification to update their settings. */ | 126 | * for notification to update their settings. */ |
127 | void configChanged(); | 127 | void configChanged(); |
128 | /** emitted when the topwidget is closing down, so that any attached | 128 | /** emitted when the topwidget is closing down, so that any attached |
129 | child windows can also close. */ | 129 | child windows can also close. */ |
130 | void closingDown(); | 130 | void closingDown(); |
131 | /** emitted right before we die */ | 131 | /** emitted right before we die */ |
132 | void closed(QWidget *); | 132 | void closed(QWidget *); |
133 | 133 | ||
134 | /** Emitted when state of modified flag changes */ | 134 | /** Emitted when state of modified flag changes */ |
135 | void modifiedChanged(bool); | 135 | void modifiedChanged(bool); |
136 | void signalmodified(); | 136 | void signalmodified(); |
137 | 137 | ||
138 | /** Emitted when state of read-only flag changes */ | 138 | /** Emitted when state of read-only flag changes */ |
139 | void readOnlyChanged(bool); | 139 | void readOnlyChanged(bool); |
140 | 140 | ||
141 | /** Emitted when the unit of navigation changes */ | 141 | /** Emitted when the unit of navigation changes */ |
142 | void changeNavStringPrev(const QString &); | 142 | void changeNavStringPrev(const QString &); |
143 | void changeNavStringNext(const QString &); | 143 | void changeNavStringNext(const QString &); |
144 | 144 | ||
145 | /** Emitted when state of events selection has changed and user is organizer*/ | 145 | /** Emitted when state of events selection has changed and user is organizer*/ |
146 | void organizerEventsSelected(bool); | 146 | void organizerEventsSelected(bool); |
147 | /** Emitted when state of events selection has changed and user is attendee*/ | 147 | /** Emitted when state of events selection has changed and user is attendee*/ |
148 | void groupEventsSelected(bool); | 148 | void groupEventsSelected(bool); |
149 | /** | 149 | /** |
150 | Emitted when an incidence gets selected. If the selection is cleared the | 150 | Emitted when an incidence gets selected. If the selection is cleared the |
151 | signal is emitted with 0 as argument. | 151 | signal is emitted with 0 as argument. |
152 | */ | 152 | */ |
153 | void incidenceSelected( Incidence * ); | 153 | void incidenceSelected( Incidence * ); |
154 | /** Emitted, when a todoitem is selected or deselected. */ | 154 | /** Emitted, when a todoitem is selected or deselected. */ |
155 | void todoSelected( bool ); | 155 | void todoSelected( bool ); |
156 | 156 | ||
157 | /** | 157 | /** |
158 | Emitted, when clipboard content changes. Parameter indicates if paste | 158 | Emitted, when clipboard content changes. Parameter indicates if paste |
159 | is possible or not. | 159 | is possible or not. |
160 | */ | 160 | */ |
161 | void pasteEnabled(bool); | 161 | void pasteEnabled(bool); |
162 | 162 | ||
163 | /** Emitted, when the number of incoming messages has changed. */ | 163 | /** Emitted, when the number of incoming messages has changed. */ |
164 | void numIncomingChanged(int); | 164 | void numIncomingChanged(int); |
165 | 165 | ||
166 | /** Emitted, when the number of outgoing messages has changed. */ | 166 | /** Emitted, when the number of outgoing messages has changed. */ |
167 | void numOutgoingChanged(int); | 167 | void numOutgoingChanged(int); |
168 | 168 | ||
169 | /** Send status message, which can e.g. be displayed in the status bar. */ | 169 | /** Send status message, which can e.g. be displayed in the status bar. */ |
170 | void statusMessage(const QString &); | 170 | void statusMessage(const QString &); |
171 | 171 | ||
172 | void calendarViewExpanded( bool ); | 172 | void calendarViewExpanded( bool ); |
173 | void updateSearchDialog(); | 173 | void updateSearchDialog(); |
174 | 174 | ||
175 | 175 | ||
176 | public slots: | 176 | public slots: |
177 | void showOpenError(); | 177 | void showOpenError(); |
178 | void watchSavedFile(); | 178 | void watchSavedFile(); |
179 | void recheckTimerAlarm(); | 179 | void recheckTimerAlarm(); |
180 | void checkNextTimerAlarm(); | 180 | void checkNextTimerAlarm(); |
181 | void addAlarm(const QDateTime &qdt, const QString ¬i ); | 181 | void addAlarm(const QDateTime &qdt, const QString ¬i ); |
182 | void addSuspendAlarm(const QDateTime &qdt, const QString ¬i ); | 182 | void addSuspendAlarm(const QDateTime &qdt, const QString ¬i ); |
183 | void removeAlarm(const QDateTime &qdt, const QString ¬i ); | 183 | void removeAlarm(const QDateTime &qdt, const QString ¬i ); |
184 | 184 | ||
185 | /** options dialog made a changed to the configuration. we catch this | 185 | /** options dialog made a changed to the configuration. we catch this |
186 | * and notify all widgets which need to update their configuration. */ | 186 | * and notify all widgets which need to update their configuration. */ |
187 | void updateConfig(); | 187 | void updateConfig(); |
188 | 188 | ||
189 | void insertBirthdays(const QString& uid, const QStringList& birthdayList, | 189 | void insertBirthdays(const QString& uid, const QStringList& birthdayList, |
190 | const QStringList& anniversaryList, const QStringList& realNameList, | 190 | const QStringList& anniversaryList, const QStringList& realNameList, |
191 | const QStringList& emailList, const QStringList& assembledNameList, | 191 | const QStringList& emailList, const QStringList& assembledNameList, |
192 | const QStringList& uidList); | 192 | const QStringList& uidList); |
193 | 193 | ||
194 | /** | 194 | /** |
195 | Load calendar from file \a filename. If \a merge is true, load | 195 | Load calendar from file \a filename. If \a merge is true, load |
196 | calendar into existing one, if it is false, clear calendar, before | 196 | calendar into existing one, if it is false, clear calendar, before |
197 | loading. Return true, if calendar could be successfully loaded. | 197 | loading. Return true, if calendar could be successfully loaded. |
198 | */ | 198 | */ |
199 | bool openCalendar(QString filename, bool merge=false); | 199 | bool openCalendar(QString filename, bool merge=false); |
200 | bool syncCalendar(QString filename,int mode = 0 ); | 200 | bool syncCalendar(QString filename,int mode = 0 ); |
201 | 201 | ||
202 | /** | 202 | /** |
203 | Save calendar data to file. Return true if calendar could be | 203 | Save calendar data to file. Return true if calendar could be |
204 | successfully saved. | 204 | successfully saved. |
205 | */ | 205 | */ |
206 | bool saveCalendar(QString filename); | 206 | bool saveCalendar(QString filename); |
207 | 207 | ||
208 | /** | 208 | /** |
209 | Close calendar. Clear calendar data and reset views to display an empty | 209 | Close calendar. Clear calendar data and reset views to display an empty |
210 | calendar. | 210 | calendar. |
211 | */ | 211 | */ |
212 | void closeCalendar(); | 212 | void closeCalendar(); |
213 | 213 | ||
214 | /** Archive old events of calendar */ | 214 | /** Archive old events of calendar */ |
215 | void archiveCalendar(); | 215 | void archiveCalendar(); |
216 | 216 | ||
217 | void showIncidence(); | 217 | void showIncidence(); |
218 | void editIncidence(); | 218 | void editIncidence(); |
219 | void editIncidenceDescription(); | 219 | void editIncidenceDescription(); |
220 | void deleteIncidence(); | 220 | void deleteIncidence(); |
221 | void cloneIncidence(); | 221 | void cloneIncidence(); |
222 | void moveIncidence(); | 222 | void moveIncidence(); |
223 | void beamIncidence(); | 223 | void beamIncidence(); |
224 | void toggleCancelIncidence(); | 224 | void toggleCancelIncidence(); |
225 | 225 | ||
226 | /** create an editeventwin with supplied date/time, and if bool is true, | 226 | /** create an editeventwin with supplied date/time, and if bool is true, |
227 | * make the event take all day. */ | 227 | * make the event take all day. */ |
228 | void newEvent(QDateTime, QDateTime, bool allDay = false); | 228 | void newEvent(QDateTime, QDateTime, bool allDay = false); |
229 | void newEvent(QDateTime fh); | 229 | void newEvent(QDateTime fh); |
230 | void newEvent(QDate dt); | 230 | void newEvent(QDate dt); |
231 | /** create new event without having a date hint. Takes current date as | 231 | /** create new event without having a date hint. Takes current date as |
232 | default hint. */ | 232 | default hint. */ |
233 | void newEvent(); | 233 | void newEvent(); |
234 | void newFloatingEvent(); | 234 | void newFloatingEvent(); |
235 | 235 | ||
236 | /** Create a read-only viewer dialog for the supplied incidence. It calls the correct showXXX method*/ | 236 | /** Create a read-only viewer dialog for the supplied incidence. It calls the correct showXXX method*/ |
237 | void showIncidence(Incidence *); | 237 | void showIncidence(Incidence *); |
238 | /** Create an editor for the supplied incidence. It calls the correct editXXX method*/ | 238 | /** Create an editor for the supplied incidence. It calls the correct editXXX method*/ |
239 | void editIncidence(Incidence *); | 239 | void editIncidence(Incidence *); |
240 | /** Delete the supplied incidence. It calls the correct deleteXXX method*/ | 240 | /** Delete the supplied incidence. It calls the correct deleteXXX method*/ |
241 | void deleteIncidence(Incidence *); | 241 | void deleteIncidence(Incidence *); |
242 | void cloneIncidence(Incidence *); | 242 | void cloneIncidence(Incidence *); |
243 | void cancelIncidence(Incidence *); | 243 | void cancelIncidence(Incidence *); |
244 | /** Create an editor for the supplied event. */ | 244 | /** Create an editor for the supplied event. */ |
245 | void editEvent(Event *); | 245 | void editEvent(Event *); |
246 | /** Delete the supplied event. */ | 246 | /** Delete the supplied event. */ |
247 | void deleteEvent(Event *); | 247 | void deleteEvent(Event *); |
248 | /** Delete the event with the given unique ID. Returns false, if event wasn't | 248 | /** Delete the event with the given unique ID. Returns false, if event wasn't |
249 | found. */ | 249 | found. */ |
250 | bool deleteEvent(const QString &uid); | 250 | bool deleteEvent(const QString &uid); |
251 | /** Create a read-only viewer dialog for the supplied event. */ | 251 | /** Create a read-only viewer dialog for the supplied event. */ |
252 | void showEvent(Event *); | 252 | void showEvent(Event *); |
253 | 253 | ||
254 | void editJournal(Journal *); | 254 | void editJournal(Journal *); |
255 | void showJournal(Journal *); | 255 | void showJournal(Journal *); |
256 | void deleteJournal(Journal *); | 256 | void deleteJournal(Journal *); |
257 | /** Create an editor dialog for a todo */ | 257 | /** Create an editor dialog for a todo */ |
258 | void editTodo(Todo *); | 258 | void editTodo(Todo *); |
259 | /** Create a read-only viewer dialog for the supplied todo */ | 259 | /** Create a read-only viewer dialog for the supplied todo */ |
260 | void showTodo(Todo *); | 260 | void showTodo(Todo *); |
261 | /** create new todo */ | 261 | /** create new todo */ |
262 | void newTodo(); | 262 | void newTodo(); |
263 | /** create new todo with a parent todo */ | 263 | /** create new todo with a parent todo */ |
264 | void newSubTodo(); | 264 | void newSubTodo(); |
265 | /** create new todo with a parent todo */ | 265 | /** create new todo with a parent todo */ |
266 | void newSubTodo(Todo *); | 266 | void newSubTodo(Todo *); |
267 | /** Delete todo */ | 267 | /** Delete todo */ |
268 | void deleteTodo(Todo *); | 268 | void deleteTodo(Todo *); |
269 | 269 | ||
270 | 270 | ||
271 | /** Check if clipboard contains vCalendar event. The signal pasteEnabled() is | 271 | /** Check if clipboard contains vCalendar event. The signal pasteEnabled() is |
272 | * emitted as result. */ | 272 | * emitted as result. */ |
273 | void checkClipboard(); | 273 | void checkClipboard(); |
274 | 274 | ||
275 | /** using the KConfig associated with the kapp variable, read in the | 275 | /** using the KConfig associated with the kapp variable, read in the |
276 | * settings from the config file. | 276 | * settings from the config file. |
277 | */ | 277 | */ |
278 | void readSettings(); | 278 | void readSettings(); |
279 | 279 | ||
280 | /** write current state to config file. */ | 280 | /** write current state to config file. */ |
281 | void writeSettings(); | 281 | void writeSettings(); |
282 | 282 | ||
283 | /** read settings for calendar filters */ | 283 | /** read settings for calendar filters */ |
284 | void readFilterSettings(KConfig *config); | 284 | void readFilterSettings(KConfig *config); |
285 | 285 | ||
286 | /** write settings for calendar filters */ | 286 | /** write settings for calendar filters */ |
287 | void writeFilterSettings(KConfig *config); | 287 | void writeFilterSettings(KConfig *config); |
288 | 288 | ||
289 | /** passes on the message that an event has changed to the currently | 289 | /** passes on the message that an event has changed to the currently |
290 | * activated view so that it can make appropriate display changes. */ | 290 | * activated view so that it can make appropriate display changes. */ |
291 | void changeEventDisplay(Event *, int); | 291 | void changeEventDisplay(Event *, int); |
292 | void changeIncidenceDisplay(Incidence *, int); | 292 | void changeIncidenceDisplay(Incidence *, int); |
293 | void changeTodoDisplay(Todo *, int); | 293 | void changeTodoDisplay(Todo *, int); |
294 | 294 | ||
295 | void eventAdded(Event *); | 295 | void eventAdded(Event *); |
296 | void eventChanged(Event *); | 296 | void eventChanged(Event *); |
297 | void eventToBeDeleted(Event *); | 297 | void eventToBeDeleted(Event *); |
298 | void eventDeleted(); | 298 | void eventDeleted(); |
299 | 299 | ||
300 | void todoAdded(Todo *); | 300 | void todoAdded(Todo *); |
301 | void todoChanged(Todo *); | 301 | void todoChanged(Todo *); |
302 | void todoToBeDeleted(Todo *); | 302 | void todoToBeDeleted(Todo *); |
303 | void todoDeleted(); | 303 | void todoDeleted(); |
304 | 304 | ||
305 | void updateView(const QDate &start, const QDate &end); | 305 | void updateView(const QDate &start, const QDate &end); |
306 | void updateView(); | 306 | void updateView(); |
307 | 307 | ||
308 | /** Full update of visible todo views */ | 308 | /** Full update of visible todo views */ |
309 | void updateTodoViews(); | 309 | void updateTodoViews(); |
310 | 310 | ||
311 | void updateUnmanagedViews(); | 311 | void updateUnmanagedViews(); |
312 | 312 | ||
313 | /** cut the current appointment to the clipboard */ | 313 | /** cut the current appointment to the clipboard */ |
314 | void edit_cut(); | 314 | void edit_cut(); |
315 | 315 | ||
316 | /** copy the current appointment(s) to the clipboard */ | 316 | /** copy the current appointment(s) to the clipboard */ |
317 | void edit_copy(); | 317 | void edit_copy(); |
318 | 318 | ||
319 | /** paste the current vobject(s) in the clipboard buffer into calendar */ | 319 | /** paste the current vobject(s) in the clipboard buffer into calendar */ |
320 | void edit_paste(); | 320 | void edit_paste(); |
321 | 321 | ||
322 | /** edit viewing and configuration options. */ | 322 | /** edit viewing and configuration options. */ |
323 | void edit_options(); | 323 | void edit_options(); |
324 | /** | 324 | /** |
325 | Functions for printing, previewing a print, and setting up printing | 325 | Functions for printing, previewing a print, and setting up printing |
326 | parameters. | 326 | parameters. |
327 | */ | 327 | */ |
328 | void print(); | 328 | void print(); |
329 | void printSetup(); | 329 | void printSetup(); |
330 | void printPreview(); | 330 | void printPreview(); |
331 | 331 | ||
332 | /** Export as iCalendar file */ | 332 | /** Export as iCalendar file */ |
333 | void exportICalendar(); | 333 | void exportICalendar(); |
334 | 334 | ||
335 | /** Export as vCalendar file */ | 335 | /** Export as vCalendar file */ |
336 | bool exportVCalendar( QString fn); | 336 | bool exportVCalendar( QString fn); |
337 | 337 | ||
338 | /** pop up a dialog to show an existing appointment. */ | 338 | /** pop up a dialog to show an existing appointment. */ |
339 | void appointment_show(); | 339 | void appointment_show(); |
340 | /** | 340 | /** |
341 | * pop up an Appointment Dialog to edit an existing appointment.Get | 341 | * pop up an Appointment Dialog to edit an existing appointment.Get |
342 | * information on the appointment from the list of unique IDs that is | 342 | * information on the appointment from the list of unique IDs that is |
343 | * currently in the View, called currIds. | 343 | * currently in the View, called currIds. |
344 | */ | 344 | */ |
345 | void appointment_edit(); | 345 | void appointment_edit(); |
346 | /** | 346 | /** |
347 | * pop up dialog confirming deletion of currently selected event in the | 347 | * pop up dialog confirming deletion of currently selected event in the |
348 | * View. | 348 | * View. |
349 | */ | 349 | */ |
350 | void appointment_delete(); | 350 | void appointment_delete(); |
351 | 351 | ||
352 | /** mails the currently selected event to a particular user as a vCalendar | 352 | /** mails the currently selected event to a particular user as a vCalendar |
353 | attachment. */ | 353 | attachment. */ |
354 | void action_mail(); | 354 | void action_mail(); |
355 | 355 | ||
356 | /* frees a subtodo from it's relation */ | 356 | /* frees a subtodo from it's relation */ |
357 | void todo_unsub( Todo * ); | 357 | void todo_unsub( Todo * ); |
358 | void todo_resub( Todo * parent, Todo * sub ); | 358 | void todo_resub( Todo * parent, Todo * sub ); |
359 | 359 | ||
360 | /** Take ownership of selected event. */ | 360 | /** Take ownership of selected event. */ |
361 | void takeOverEvent(); | 361 | void takeOverEvent(); |
362 | 362 | ||
363 | /** Take ownership of all events in calendar. */ | 363 | /** Take ownership of all events in calendar. */ |
364 | void takeOverCalendar(); | 364 | void takeOverCalendar(); |
365 | 365 | ||
366 | /** query whether or not the calendar is "dirty". */ | 366 | /** query whether or not the calendar is "dirty". */ |
367 | bool isModified(); | 367 | bool isModified(); |
368 | /** set the state of calendar. Modified means "dirty", i.e. needing a save. */ | 368 | /** set the state of calendar. Modified means "dirty", i.e. needing a save. */ |
369 | void setModified(bool modified=true); | 369 | void setModified(bool modified=true); |
370 | 370 | ||
371 | /** query if the calendar is read-only. */ | 371 | /** query if the calendar is read-only. */ |
372 | bool isReadOnly(); | 372 | bool isReadOnly(); |
373 | /** set state of calendar to read-only */ | 373 | /** set state of calendar to read-only */ |
374 | void setReadOnly(bool readOnly=true); | 374 | void setReadOnly(bool readOnly=true); |
375 | 375 | ||
376 | void eventUpdated(Incidence *); | 376 | void eventUpdated(Incidence *); |
377 | 377 | ||
378 | /* iTIP scheduling actions */ | 378 | /* iTIP scheduling actions */ |
379 | void schedule_publish(Incidence *incidence = 0); | 379 | void schedule_publish(Incidence *incidence = 0); |
380 | void schedule_request(Incidence *incidence = 0); | 380 | void schedule_request(Incidence *incidence = 0); |
381 | void schedule_refresh(Incidence *incidence = 0); | 381 | void schedule_refresh(Incidence *incidence = 0); |
382 | void schedule_cancel(Incidence *incidence = 0); | 382 | void schedule_cancel(Incidence *incidence = 0); |
383 | void schedule_add(Incidence *incidence = 0); | 383 | void schedule_add(Incidence *incidence = 0); |
384 | void schedule_reply(Incidence *incidence = 0); | 384 | void schedule_reply(Incidence *incidence = 0); |
385 | void schedule_counter(Incidence *incidence = 0); | 385 | void schedule_counter(Incidence *incidence = 0); |
386 | void schedule_declinecounter(Incidence *incidence = 0); | 386 | void schedule_declinecounter(Incidence *incidence = 0); |
387 | void schedule_publish_freebusy(int daysToPublish = 30); | 387 | void schedule_publish_freebusy(int daysToPublish = 30); |
388 | 388 | ||
389 | void openAddressbook(); | 389 | void openAddressbook(); |
390 | 390 | ||
391 | void editFilters(); | 391 | void editFilters(); |
392 | void toggleFilerEnabled(); | 392 | void toggleFilerEnabled(); |
393 | QPtrList<CalFilter> filters(); | 393 | QPtrList<CalFilter> filters(); |
394 | void toggleFilter(); | 394 | void toggleFilter(); |
395 | void showFilter(bool visible); | 395 | void showFilter(bool visible); |
396 | void updateFilter(); | 396 | void updateFilter(); |
397 | void filterEdited(); | 397 | void filterEdited(); |
398 | void selectFilter( int ); | 398 | void selectFilter( int ); |
399 | KOFilterView *filterView(); | 399 | KOFilterView *filterView(); |
400 | 400 | ||
401 | void showIntro(); | 401 | void showIntro(); |
402 | 402 | ||
403 | /** Move the curdatepient view date to today */ | 403 | /** Move the curdatepient view date to today */ |
404 | void goToday(); | 404 | void goToday(); |
405 | 405 | ||
406 | /** Move to the next date(s) in the current view */ | 406 | /** Move to the next date(s) in the current view */ |
407 | void goNext(); | 407 | void goNext(); |
408 | 408 | ||
409 | /** Move to the previous date(s) in the current view */ | 409 | /** Move to the previous date(s) in the current view */ |
410 | void goPrevious(); | 410 | void goPrevious(); |
411 | /** Move to the next date(s) in the current view */ | 411 | /** Move to the next date(s) in the current view */ |
412 | void goNextMonth(); | 412 | void goNextMonth(); |
413 | 413 | ||
414 | /** Move to the previous date(s) in the current view */ | 414 | /** Move to the previous date(s) in the current view */ |
415 | void goPreviousMonth(); | 415 | void goPreviousMonth(); |
416 | 416 | ||
417 | void toggleExpand(); | 417 | void toggleExpand(); |
418 | void toggleDateNavigatorWidget(); | 418 | void toggleDateNavigatorWidget(); |
419 | void toggleAllDaySize(); | 419 | void toggleAllDaySize(); |
420 | void dialogClosing(Incidence *); | 420 | void dialogClosing(Incidence *); |
421 | 421 | ||
422 | /** Look for new messages in the inbox */ | 422 | /** Look for new messages in the inbox */ |
423 | void lookForIncomingMessages(); | 423 | void lookForIncomingMessages(); |
424 | /** Look for new messages in the outbox */ | 424 | /** Look for new messages in the outbox */ |
425 | void lookForOutgoingMessages(); | 425 | void lookForOutgoingMessages(); |
426 | 426 | ||
427 | void processMainViewSelection( Incidence * ); | 427 | void processMainViewSelection( Incidence * ); |
428 | void processTodoListSelection( Incidence * ); | 428 | void processTodoListSelection( Incidence * ); |
429 | 429 | ||
430 | void processIncidenceSelection( Incidence * ); | 430 | void processIncidenceSelection( Incidence * ); |
431 | 431 | ||
432 | void purgeCompleted(); | 432 | void purgeCompleted(); |
433 | bool removeCompletedSubTodos( Todo* ); | 433 | bool removeCompletedSubTodos( Todo* ); |
434 | void slotCalendarChanged(); | 434 | void slotCalendarChanged(); |
435 | bool importBday(); | 435 | bool importBday(); |
436 | bool addAnniversary( QDate data, QString name, KCal::Attendee* a , bool birthday ); | 436 | bool addAnniversary( QDate data, QString name, KCal::Attendee* a , bool birthday ); |
437 | bool importQtopia( const QString &categoriesFile, | 437 | bool importQtopia( const QString &categoriesFile, |
438 | const QString &datebookFile, | 438 | const QString &datebookFile, |
439 | const QString &tasklistFile ); | 439 | const QString &tasklistFile ); |
440 | void syncExternal( int mode ); | 440 | void syncExternal( int mode ); |
441 | void slotSelectPickerDate( QDate ) ; | 441 | void slotSelectPickerDate( QDate ) ; |
442 | void showDatePicker( ) ; | 442 | void showDatePicker( ) ; |
443 | void moveIncidence(Incidence *) ; | 443 | void moveIncidence(Incidence *) ; |
444 | void beamIncidence(Incidence *) ; | 444 | void beamIncidence(Incidence *) ; |
445 | void beamCalendar() ; | 445 | void beamCalendar() ; |
446 | void beamFilteredCalendar() ; | 446 | void beamFilteredCalendar() ; |
447 | void beamIncidenceList(QPtrList<Incidence>) ; | 447 | void beamIncidenceList(QPtrList<Incidence>) ; |
448 | void manageCategories(); | 448 | void manageCategories(); |
449 | int addCategories(); | 449 | int addCategories(); |
450 | void removeCategories(); | 450 | void removeCategories(); |
451 | void setSyncDevice( QString ); | 451 | void setSyncDevice( QString ); |
452 | void setSyncName( QString ); | 452 | void setSyncName( QString ); |
453 | protected slots: | 453 | protected slots: |
454 | void timerAlarm(); | 454 | void timerAlarm(); |
455 | void suspendAlarm(); | 455 | void suspendAlarm(); |
456 | void beamDone( Ir *ir ); | 456 | void beamDone( Ir *ir ); |
457 | /** Select a view or adapt the current view to display the specified dates. */ | 457 | /** Select a view or adapt the current view to display the specified dates. */ |
458 | void showDates( const KCal::DateList & ); | 458 | void showDates( const KCal::DateList & ); |
459 | void selectWeekNum ( int ); | 459 | void selectWeekNum ( int ); |
460 | 460 | ||
461 | public: | 461 | public: |
462 | // show a standard warning | 462 | // show a standard warning |
463 | // returns KMsgBox::yesNoCancel() | 463 | // returns KMsgBox::yesNoCancel() |
464 | int msgCalModified(); | 464 | int msgCalModified(); |
465 | virtual bool sync(KSyncManager* manager, QString filename, int mode); | 465 | virtual bool sync(KSyncManager* manager, QString filename, int mode); |
466 | 466 | ||
467 | virtual bool syncExternal(KSyncManager* manager, QString resource); | 467 | virtual bool syncExternal(KSyncManager* manager, QString resource); |
468 | virtual void removeSyncInfo( QString syncProfile); | ||
468 | void setSyncManager(KSyncManager* manager); | 469 | void setSyncManager(KSyncManager* manager); |
469 | void setLoadedFileVersion(QDateTime); | 470 | void setLoadedFileVersion(QDateTime); |
470 | bool checkFileVersion(QString fn); | 471 | bool checkFileVersion(QString fn); |
471 | bool checkFileChanged(QString fn); | 472 | bool checkFileChanged(QString fn); |
472 | Event* getLastSyncEvent(); | 473 | Event* getLastSyncEvent(); |
473 | /** Adapt navigation units correpsonding to step size of navigation of the | 474 | /** Adapt navigation units correpsonding to step size of navigation of the |
474 | * current view. | 475 | * current view. |
475 | */ | 476 | */ |
476 | void adaptNavigationUnits(); | 477 | void adaptNavigationUnits(); |
477 | bool synchronizeCalendar( Calendar* local, Calendar* remote, int mode ); | 478 | bool synchronizeCalendar( Calendar* local, Calendar* remote, int mode ); |
478 | int takeEvent( Incidence* local, Incidence* remote, int mode, bool full = false ); | 479 | int takeEvent( Incidence* local, Incidence* remote, int mode, bool full = false ); |
479 | //Attendee* getYourAttendee(Event *event); | 480 | //Attendee* getYourAttendee(Event *event); |
480 | protected: | 481 | protected: |
481 | void schedule(Scheduler::Method, Incidence *incidence = 0); | 482 | void schedule(Scheduler::Method, Incidence *incidence = 0); |
482 | 483 | ||
483 | // returns KMsgBox::OKCandel() | 484 | // returns KMsgBox::OKCandel() |
484 | int msgItemDelete(); | 485 | int msgItemDelete(); |
485 | void showEventEditor(); | 486 | void showEventEditor(); |
486 | void showTodoEditor(); | 487 | void showTodoEditor(); |
487 | void writeLocale(); | 488 | void writeLocale(); |
488 | Todo *selectedTodo(); | 489 | Todo *selectedTodo(); |
489 | 490 | ||
490 | private: | 491 | private: |
491 | bool mSyncKDE; | 492 | bool mSyncKDE; |
492 | KSyncManager* mSyncManager; | 493 | KSyncManager* mSyncManager; |
493 | AlarmDialog * mAlarmDialog; | 494 | AlarmDialog * mAlarmDialog; |
494 | QString mAlarmNotification; | 495 | QString mAlarmNotification; |
495 | QString mSuspendAlarmNotification; | 496 | QString mSuspendAlarmNotification; |
496 | QTimer* mSuspendTimer; | 497 | QTimer* mSuspendTimer; |
497 | QTimer* mAlarmTimer; | 498 | QTimer* mAlarmTimer; |
498 | QTimer* mRecheckAlarmTimer; | 499 | QTimer* mRecheckAlarmTimer; |
499 | void computeAlarm( QString ); | 500 | void computeAlarm( QString ); |
500 | void startAlarm( QString, QString ); | 501 | void startAlarm( QString, QString ); |
501 | void setSyncEventsReadOnly(); | 502 | void setSyncEventsReadOnly(); |
502 | 503 | ||
503 | QDateTime loadedFileVersion; | 504 | QDateTime loadedFileVersion; |
504 | void checkExternSyncEvent( QPtrList<Event> lastSync , Incidence* toDelete ); | 505 | void checkExternSyncEvent( QPtrList<Event> lastSync , Incidence* toDelete ); |
505 | void checkExternalId( Incidence * inc ); | 506 | void checkExternalId( Incidence * inc ); |
506 | int mGlobalSyncMode; | 507 | int mGlobalSyncMode; |
507 | QString mCurrentSyncDevice; | 508 | QString mCurrentSyncDevice; |
508 | QString mCurrentSyncName; | 509 | QString mCurrentSyncName; |
509 | KOBeamPrefs* beamDialog; | 510 | KOBeamPrefs* beamDialog; |
510 | void init(); | 511 | void init(); |
511 | int mDatePickerMode; | 512 | int mDatePickerMode; |
512 | bool mFlagEditDescription; | 513 | bool mFlagEditDescription; |
513 | QDateTime mLastCalendarSync; | 514 | QDateTime mLastCalendarSync; |
514 | void createPrinter(); | 515 | void createPrinter(); |
515 | 516 | ||
516 | void calendarModified( bool, Calendar * ); | 517 | void calendarModified( bool, Calendar * ); |
517 | 518 | ||
518 | CalPrinter *mCalPrinter; | 519 | CalPrinter *mCalPrinter; |
519 | 520 | ||
520 | QSplitter *mPanner; | 521 | QSplitter *mPanner; |
521 | QSplitter *mLeftSplitter; | 522 | QSplitter *mLeftSplitter; |
522 | QWidget *mLeftFrame; | 523 | QWidget *mLeftFrame; |
523 | QWidgetStack *mRightFrame; | 524 | QWidgetStack *mRightFrame; |
524 | 525 | ||
525 | KDatePicker* mDatePicker; | 526 | KDatePicker* mDatePicker; |
526 | QVBox* mDateFrame; | 527 | QVBox* mDateFrame; |
527 | NavigatorBar *mNavigatorBar; | 528 | NavigatorBar *mNavigatorBar; |
528 | 529 | ||
529 | KDateNavigator *mDateNavigator; // widget showing small month view. | 530 | KDateNavigator *mDateNavigator; // widget showing small month view. |
530 | 531 | ||
531 | KOFilterView *mFilterView; | 532 | KOFilterView *mFilterView; |
532 | 533 | ||
533 | ResourceView *mResourceView; | 534 | ResourceView *mResourceView; |
534 | 535 | ||
535 | // calendar object for this viewing instance | 536 | // calendar object for this viewing instance |
536 | Calendar *mCalendar; | 537 | Calendar *mCalendar; |
537 | 538 | ||
538 | CalendarResourceManager *mResourceManager; | 539 | CalendarResourceManager *mResourceManager; |
539 | 540 | ||
540 | FileStorage *mStorage; | 541 | FileStorage *mStorage; |
541 | 542 | ||
542 | DateNavigator *mNavigator; | 543 | DateNavigator *mNavigator; |
543 | 544 | ||
544 | KOViewManager *mViewManager; | 545 | KOViewManager *mViewManager; |
545 | KODialogManager *mDialogManager; | 546 | KODialogManager *mDialogManager; |
546 | 547 | ||
547 | // Calendar filters | 548 | // Calendar filters |
548 | QPtrList<CalFilter> mFilters; | 549 | QPtrList<CalFilter> mFilters; |
549 | 550 | ||
550 | // various housekeeping variables. | 551 | // various housekeeping variables. |
551 | bool mModified; // flag indicating if calendar is modified | 552 | bool mModified; // flag indicating if calendar is modified |
552 | bool mReadOnly; // flag indicating if calendar is read-only | 553 | bool mReadOnly; // flag indicating if calendar is read-only |
553 | QDate mSaveSingleDate; | 554 | QDate mSaveSingleDate; |
554 | 555 | ||
555 | Incidence *mSelectedIncidence; | 556 | Incidence *mSelectedIncidence; |
556 | Incidence *mMoveIncidence; | 557 | Incidence *mMoveIncidence; |
557 | KOTodoView *mTodoList; | 558 | KOTodoView *mTodoList; |
558 | KOEventEditor * mEventEditor; | 559 | KOEventEditor * mEventEditor; |
559 | KOTodoEditor * mTodoEditor; | 560 | KOTodoEditor * mTodoEditor; |
560 | KOEventViewerDialog * mEventViewerDialog; | 561 | KOEventViewerDialog * mEventViewerDialog; |
561 | void keyPressEvent ( QKeyEvent *e) ; | 562 | void keyPressEvent ( QKeyEvent *e) ; |
562 | //QMap<Incidence*,KOIncidenceEditor*> mDialogList; | 563 | //QMap<Incidence*,KOIncidenceEditor*> mDialogList; |
563 | }; | 564 | }; |
564 | 565 | ||
565 | 566 | ||
566 | class CalendarViewVisitor : public Incidence::Visitor | 567 | class CalendarViewVisitor : public Incidence::Visitor |
567 | { | 568 | { |
568 | public: | 569 | public: |
569 | CalendarViewVisitor() : mView( 0 ) {} | 570 | CalendarViewVisitor() : mView( 0 ) {} |
570 | 571 | ||
571 | bool act( Incidence *incidence, CalendarView *view ) | 572 | bool act( Incidence *incidence, CalendarView *view ) |
572 | { | 573 | { |
573 | mView = view; | 574 | mView = view; |
574 | return incidence->accept( *this ); | 575 | return incidence->accept( *this ); |
575 | } | 576 | } |
576 | 577 | ||
577 | protected: | 578 | protected: |
578 | CalendarView *mView; | 579 | CalendarView *mView; |
579 | }; | 580 | }; |
580 | 581 | ||
581 | class ShowIncidenceVisitor : public CalendarViewVisitor | 582 | class ShowIncidenceVisitor : public CalendarViewVisitor |
582 | { | 583 | { |
583 | protected: | 584 | protected: |
584 | bool visit( Event *event ) { mView->showEvent( event ); return true; } | 585 | bool visit( Event *event ) { mView->showEvent( event ); return true; } |
585 | bool visit( Todo *todo ) { mView->showTodo( todo ); return true; } | 586 | bool visit( Todo *todo ) { mView->showTodo( todo ); return true; } |
586 | bool visit( Journal * j ) { mView->showJournal( j );return true; } | 587 | bool visit( Journal * j ) { mView->showJournal( j );return true; } |
587 | }; | 588 | }; |
588 | 589 | ||
589 | class EditIncidenceVisitor : public CalendarViewVisitor | 590 | class EditIncidenceVisitor : public CalendarViewVisitor |
590 | { | 591 | { |
591 | protected: | 592 | protected: |
592 | bool visit( Event *event ) { mView->editEvent( event ); return true; } | 593 | bool visit( Event *event ) { mView->editEvent( event ); return true; } |
593 | bool visit( Todo *todo ) { mView->editTodo( todo ); return true; } | 594 | bool visit( Todo *todo ) { mView->editTodo( todo ); return true; } |
594 | bool visit( Journal *j ) { mView->editJournal( j); return true; } | 595 | bool visit( Journal *j ) { mView->editJournal( j); return true; } |
595 | }; | 596 | }; |
596 | 597 | ||
597 | class DeleteIncidenceVisitor : public CalendarViewVisitor | 598 | class DeleteIncidenceVisitor : public CalendarViewVisitor |
598 | { | 599 | { |
599 | protected: | 600 | protected: |
600 | bool visit( Event *event ) { mView->deleteEvent( event ); return true; } | 601 | bool visit( Event *event ) { mView->deleteEvent( event ); return true; } |
601 | bool visit( Todo *todo ) { mView->deleteTodo( todo ); return true; } | 602 | bool visit( Todo *todo ) { mView->deleteTodo( todo ); return true; } |
602 | bool visit( Journal * j) {mView->deleteJournal( j ); return true; } | 603 | bool visit( Journal * j) {mView->deleteJournal( j ); return true; } |
603 | }; | 604 | }; |
604 | 605 | ||
605 | #endif | 606 | #endif |