-rw-r--r-- | korganizer/calendarview.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index d6918d3..6eaac1c 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -3549,135 +3549,139 @@ void CalendarView::showDates(const DateList &selectedDates) | |||
3549 | addString = i18n("Today"); | 3549 | addString = i18n("Today"); |
3550 | else if ( selectedDates.first() == QDateTime::currentDateTime().date().addDays(1) ) | 3550 | else if ( selectedDates.first() == QDateTime::currentDateTime().date().addDays(1) ) |
3551 | addString = i18n("Tomorrow"); | 3551 | addString = i18n("Tomorrow"); |
3552 | else if ( selectedDates.first() == QDateTime::currentDateTime().date().addDays(-1) ) | 3552 | else if ( selectedDates.first() == QDateTime::currentDateTime().date().addDays(-1) ) |
3553 | addString = i18n("Yesterday"); | 3553 | addString = i18n("Yesterday"); |
3554 | else if ( selectedDates.first() == QDateTime::currentDateTime().date().addDays(-2) ) | 3554 | else if ( selectedDates.first() == QDateTime::currentDateTime().date().addDays(-2) ) |
3555 | addString = i18n("Day before yesterday"); | 3555 | addString = i18n("Day before yesterday"); |
3556 | else if ( selectedDates.first() == QDateTime::currentDateTime().date().addDays(2) ) | 3556 | else if ( selectedDates.first() == QDateTime::currentDateTime().date().addDays(2) ) |
3557 | addString = i18n("Day after tomorrow"); | 3557 | addString = i18n("Day after tomorrow"); |
3558 | if ( !addString.isEmpty() ) { | 3558 | if ( !addString.isEmpty() ) { |
3559 | topLevelWidget()->setCaption( addString+", " + selDates ); | 3559 | topLevelWidget()->setCaption( addString+", " + selDates ); |
3560 | return; | 3560 | return; |
3561 | } | 3561 | } |
3562 | } | 3562 | } |
3563 | topLevelWidget()->setCaption( i18n("Dates: ") + selDates ); | 3563 | topLevelWidget()->setCaption( i18n("Dates: ") + selDates ); |
3564 | 3564 | ||
3565 | } | 3565 | } |
3566 | 3566 | ||
3567 | QPtrList<CalFilter> CalendarView::filters() | 3567 | QPtrList<CalFilter> CalendarView::filters() |
3568 | { | 3568 | { |
3569 | return mFilters; | 3569 | return mFilters; |
3570 | 3570 | ||
3571 | } | 3571 | } |
3572 | void CalendarView::editFilters() | 3572 | void CalendarView::editFilters() |
3573 | { | 3573 | { |
3574 | // kdDebug() << "CalendarView::editFilters()" << endl; | 3574 | // kdDebug() << "CalendarView::editFilters()" << endl; |
3575 | 3575 | ||
3576 | CalFilter *filter = mFilters.first(); | 3576 | CalFilter *filter = mFilters.first(); |
3577 | while(filter) { | 3577 | while(filter) { |
3578 | kdDebug() << " Filter: " << filter->name() << endl; | 3578 | kdDebug() << " Filter: " << filter->name() << endl; |
3579 | filter = mFilters.next(); | 3579 | filter = mFilters.next(); |
3580 | } | 3580 | } |
3581 | 3581 | ||
3582 | mDialogManager->showFilterEditDialog(&mFilters); | 3582 | mDialogManager->showFilterEditDialog(&mFilters); |
3583 | } | 3583 | } |
3584 | void CalendarView::toggleFilter() | 3584 | void CalendarView::toggleFilter() |
3585 | { | 3585 | { |
3586 | showFilter(! mFilterView->isVisible()); | 3586 | showFilter(! mFilterView->isVisible()); |
3587 | } | 3587 | } |
3588 | 3588 | ||
3589 | KOFilterView *CalendarView::filterView() | 3589 | KOFilterView *CalendarView::filterView() |
3590 | { | 3590 | { |
3591 | return mFilterView; | 3591 | return mFilterView; |
3592 | } | 3592 | } |
3593 | void CalendarView::selectFilter( int fil ) | 3593 | void CalendarView::selectFilter( int fil ) |
3594 | { | 3594 | { |
3595 | mFilterView->setSelectedFilter( fil ); | 3595 | mFilterView->setSelectedFilter( fil ); |
3596 | } | 3596 | } |
3597 | void CalendarView::showFilter(bool visible) | 3597 | void CalendarView::showFilter(bool visible) |
3598 | { | 3598 | { |
3599 | if (visible) mFilterView->show(); | 3599 | if (visible) mFilterView->show(); |
3600 | else mFilterView->hide(); | 3600 | else mFilterView->hide(); |
3601 | } | 3601 | } |
3602 | void CalendarView::toggleFilerEnabled( ) | 3602 | void CalendarView::toggleFilerEnabled( ) |
3603 | { | 3603 | { |
3604 | mFilterView->setFiltersEnabled ( !mFilterView->filtersEnabled() ); | 3604 | mFilterView->setFiltersEnabled ( !mFilterView->filtersEnabled() ); |
3605 | if ( !mFilterView->filtersEnabled() ) | 3605 | if ( !mFilterView->filtersEnabled() ) |
3606 | topLevelWidget()->setCaption( i18n("Filter disabled ") ); | 3606 | topLevelWidget()->setCaption( i18n("Filter disabled ") ); |
3607 | 3607 | ||
3608 | } | 3608 | } |
3609 | void CalendarView::updateFilter() | 3609 | void CalendarView::updateFilter() |
3610 | { | 3610 | { |
3611 | CalFilter *filter = mFilterView->selectedFilter(); | 3611 | CalFilter *filter = mFilterView->selectedFilter(); |
3612 | if (filter) { | 3612 | if (filter) { |
3613 | QString mess; | ||
3613 | if (mFilterView->filtersEnabled()) { | 3614 | if (mFilterView->filtersEnabled()) { |
3614 | topLevelWidget()->setCaption( i18n("Filter selected: ")+filter->name() ); | 3615 | mess = i18n("Filter selected: ")+filter->name(); |
3615 | filter->setEnabled(true); | 3616 | filter->setEnabled(true); |
3616 | } | 3617 | } |
3617 | else filter->setEnabled(false); | 3618 | else filter->setEnabled(false); |
3618 | mCalendar->setFilter(filter); | 3619 | mCalendar->setFilter(filter); |
3619 | updateView(); | 3620 | updateView(); |
3621 | if ( !mess.isEmpty() ) | ||
3622 | topLevelWidget()->setCaption( mess ); | ||
3623 | |||
3620 | } | 3624 | } |
3621 | } | 3625 | } |
3622 | 3626 | ||
3623 | void CalendarView::filterEdited() | 3627 | void CalendarView::filterEdited() |
3624 | { | 3628 | { |
3625 | mFilterView->updateFilters(); | 3629 | mFilterView->updateFilters(); |
3626 | updateFilter(); | 3630 | updateFilter(); |
3627 | writeSettings(); | 3631 | writeSettings(); |
3628 | } | 3632 | } |
3629 | 3633 | ||
3630 | 3634 | ||
3631 | void CalendarView::takeOverEvent() | 3635 | void CalendarView::takeOverEvent() |
3632 | { | 3636 | { |
3633 | Incidence *incidence = currentSelection(); | 3637 | Incidence *incidence = currentSelection(); |
3634 | 3638 | ||
3635 | if (!incidence) return; | 3639 | if (!incidence) return; |
3636 | 3640 | ||
3637 | incidence->setOrganizer(KOPrefs::instance()->email()); | 3641 | incidence->setOrganizer(KOPrefs::instance()->email()); |
3638 | incidence->recreate(); | 3642 | incidence->recreate(); |
3639 | incidence->setReadOnly(false); | 3643 | incidence->setReadOnly(false); |
3640 | 3644 | ||
3641 | updateView(); | 3645 | updateView(); |
3642 | } | 3646 | } |
3643 | 3647 | ||
3644 | void CalendarView::takeOverCalendar() | 3648 | void CalendarView::takeOverCalendar() |
3645 | { | 3649 | { |
3646 | // TODO: Create Calendar::allIncidences() function and use it here | 3650 | // TODO: Create Calendar::allIncidences() function and use it here |
3647 | 3651 | ||
3648 | QPtrList<Event> events = mCalendar->events(); | 3652 | QPtrList<Event> events = mCalendar->events(); |
3649 | for(uint i=0; i<events.count(); ++i) { | 3653 | for(uint i=0; i<events.count(); ++i) { |
3650 | events.at(i)->setOrganizer(KOPrefs::instance()->email()); | 3654 | events.at(i)->setOrganizer(KOPrefs::instance()->email()); |
3651 | events.at(i)->recreate(); | 3655 | events.at(i)->recreate(); |
3652 | events.at(i)->setReadOnly(false); | 3656 | events.at(i)->setReadOnly(false); |
3653 | } | 3657 | } |
3654 | 3658 | ||
3655 | QPtrList<Todo> todos = mCalendar->todos(); | 3659 | QPtrList<Todo> todos = mCalendar->todos(); |
3656 | for(uint i=0; i<todos.count(); ++i) { | 3660 | for(uint i=0; i<todos.count(); ++i) { |
3657 | todos.at(i)->setOrganizer(KOPrefs::instance()->email()); | 3661 | todos.at(i)->setOrganizer(KOPrefs::instance()->email()); |
3658 | todos.at(i)->recreate(); | 3662 | todos.at(i)->recreate(); |
3659 | todos.at(i)->setReadOnly(false); | 3663 | todos.at(i)->setReadOnly(false); |
3660 | } | 3664 | } |
3661 | 3665 | ||
3662 | QPtrList<Journal> journals = mCalendar->journals(); | 3666 | QPtrList<Journal> journals = mCalendar->journals(); |
3663 | for(uint i=0; i<journals.count(); ++i) { | 3667 | for(uint i=0; i<journals.count(); ++i) { |
3664 | journals.at(i)->setOrganizer(KOPrefs::instance()->email()); | 3668 | journals.at(i)->setOrganizer(KOPrefs::instance()->email()); |
3665 | journals.at(i)->recreate(); | 3669 | journals.at(i)->recreate(); |
3666 | journals.at(i)->setReadOnly(false); | 3670 | journals.at(i)->setReadOnly(false); |
3667 | } | 3671 | } |
3668 | 3672 | ||
3669 | updateView(); | 3673 | updateView(); |
3670 | } | 3674 | } |
3671 | 3675 | ||
3672 | void CalendarView::showIntro() | 3676 | void CalendarView::showIntro() |
3673 | { | 3677 | { |
3674 | kdDebug() << "To be implemented." << endl; | 3678 | kdDebug() << "To be implemented." << endl; |
3675 | } | 3679 | } |
3676 | 3680 | ||
3677 | QWidgetStack *CalendarView::viewStack() | 3681 | QWidgetStack *CalendarView::viewStack() |
3678 | { | 3682 | { |
3679 | return mRightFrame; | 3683 | return mRightFrame; |
3680 | } | 3684 | } |
3681 | 3685 | ||
3682 | QWidget *CalendarView::leftFrame() | 3686 | QWidget *CalendarView::leftFrame() |
3683 | { | 3687 | { |