author | zautrix <zautrix> | 2005-03-17 20:00:15 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-03-17 20:00:15 (UTC) |
commit | de34f05c4545688dec24f8d75fc03e42f38b94d1 (patch) (unidiff) | |
tree | 141a403ad18583748284b1aff745b4dcb30c67b5 /korganizer | |
parent | 81295ee3a5e7e90fb4c6baf27ecbb65bee1de5b5 (diff) | |
download | kdepimpi-de34f05c4545688dec24f8d75fc03e42f38b94d1.zip kdepimpi-de34f05c4545688dec24f8d75fc03e42f38b94d1.tar.gz kdepimpi-de34f05c4545688dec24f8d75fc03e42f38b94d1.tar.bz2 |
filter fix
-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 | |||
@@ -3565,103 +3565,107 @@ void CalendarView::showDates(const DateList &selectedDates) | |||
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 | } |