summaryrefslogtreecommitdiffabout
path: root/korganizer/calendarview.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/calendarview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 3908dbb..47cd488 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -1946,97 +1946,100 @@ void CalendarView::readFilterSettings(KConfig *config)
filter->setCriteria(config->readNumEntry("Criteria",0));
filter->setCategoryList(config->readListEntry("CategoryList"));
mFilters.append(filter);
++it;
}
if (mFilters.count() == 0) {
CalFilter *filter = new CalFilter(i18n("Default"));
mFilters.append(filter);
}
mFilterView->updateFilters();
config->setGroup("FilterView");
mFilterView->blockSignals(true);
mFilterView->setFiltersEnabled(config->readBoolEntry("FilterEnabled"));
mFilterView->setSelectedFilter(config->readEntry("Current Filter"));
mFilterView->blockSignals(false);
// We do it manually to avoid it being done twice by the above calls
updateFilter();
}
void CalendarView::writeFilterSettings(KConfig *config)
{
// kdDebug() << "CalendarView::writeFilterSettings()" << endl;
QStringList filterList;
CalFilter *filter = mFilters.first();
while(filter) {
// kdDebug() << " fn: " << filter->name() << endl;
filterList << filter->name();
config->setGroup("Filter_" + filter->name());
config->writeEntry("Criteria",filter->criteria());
config->writeEntry("CategoryList",filter->categoryList());
filter = mFilters.next();
}
config->setGroup("General");
config->writeEntry("CalendarFilters",filterList);
config->setGroup("FilterView");
config->writeEntry("FilterEnabled",mFilterView->filtersEnabled());
config->writeEntry("Current Filter",mFilterView->selectedFilter()->name());
}
void CalendarView::goToday()
{
- mNavigator->selectToday();
+ if ( mViewManager->currentView()->isMonthView() )
+ mNavigator->selectTodayMonth();
+ else
+ mNavigator->selectToday();
}
void CalendarView::goNext()
{
mNavigator->selectNext();
}
void CalendarView::goPrevious()
{
mNavigator->selectPrevious();
}
void CalendarView::goNextMonth()
{
mNavigator->selectNextMonth();
}
void CalendarView::goPreviousMonth()
{
mNavigator->selectPreviousMonth();
}
void CalendarView::writeLocale()
{
//KPimGlobalPrefs::instance()->setGlobalConfig();
#if 0
KGlobal::locale()->setHore24Format( !KOPrefs::instance()->mPreferredTime );
KGlobal::locale()->setWeekStartMonday( !KOPrefs::instance()->mWeekStartsOnSunday );
KGlobal::locale()->setIntDateFormat( (KLocale::IntDateFormat)KOPrefs::instance()->mPreferredDate );
KGlobal::locale()->setLanguage( KOPrefs::instance()->mPreferredLanguage );
QString dummy = KOPrefs::instance()->mUserDateFormatLong;
KGlobal::locale()->setDateFormat(dummy.replace( QRegExp("K"), QString(",") ));
dummy = KOPrefs::instance()->mUserDateFormatShort;
KGlobal::locale()->setDateFormatShort(dummy.replace( QRegExp("K"), QString(",") ));
KGlobal::locale()->setDaylightSaving( KOPrefs::instance()->mUseDaylightsaving,
KOPrefs::instance()->mDaylightsavingStart,
KOPrefs::instance()->mDaylightsavingEnd );
KGlobal::locale()->setTimezone( KPimGlobalPrefs::instance()->mTimeZoneId );
#endif
}
void CalendarView::updateConfig()
{
writeLocale();
if ( KOPrefs::instance()->mUseAppColors )
QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true );
emit configChanged();
mTodoList->updateConfig();
// mDateNavigator->setFont ( KOPrefs::instance()->mDateNavigatorFont);
mCalendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId);
// To make the "fill window" configurations work