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
@@ -1898,193 +1898,196 @@ void CalendarView::writeSettings()
wid = getEventViewerDialog();
x = wid->geometry().x();
y = wid->geometry().y();
w = wid->width();
h = wid->height();
list.clear();
list << QString::number( x );
list << QString::number( y );
list << QString::number( w );
list << QString::number( h );
config->writeEntry("ViewerLayout",list );
wid = mDialogManager->getSearchDialog();
if ( wid ) {
x = wid->geometry().x();
y = wid->geometry().y();
w = wid->width();
h = wid->height();
list.clear();
list << QString::number( x );
list << QString::number( y );
list << QString::number( w );
list << QString::number( h );
config->writeEntry("SearchLayout",list );
}
#endif
config->sync();
}
void CalendarView::readFilterSettings(KConfig *config)
{
// kdDebug() << "CalendarView::readFilterSettings()" << endl;
mFilters.clear();
config->setGroup("General");
QStringList filterList = config->readListEntry("CalendarFilters");
QStringList::ConstIterator it = filterList.begin();
QStringList::ConstIterator end = filterList.end();
while(it != end) {
// kdDebug() << " filter: " << (*it) << endl;
CalFilter *filter;
filter = new CalFilter(*it);
config->setGroup("Filter_" + (*it));
//qDebug("readFilterSettings %d ",config->readNumEntry("Criteria",0) );
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
//mViewManager->raiseCurrentView();
}
void CalendarView::eventChanged(Event *event)
{
changeEventDisplay(event,KOGlobals::EVENTEDITED);
//updateUnmanagedViews();
}
void CalendarView::eventAdded(Event *event)
{
changeEventDisplay(event,KOGlobals::EVENTADDED);
}
void CalendarView::eventToBeDeleted(Event *)
{
kdDebug() << "CalendarView::eventToBeDeleted(): to be implemented" << endl;
}
void CalendarView::eventDeleted()
{
changeEventDisplay(0,KOGlobals::EVENTDELETED);
}
void CalendarView::changeTodoDisplay(Todo *which, int action)
{
changeIncidenceDisplay((Incidence *)which, action);
mDateNavigator->updateView(); //LR
//mDialogManager->updateSearchDialog();
if (which) {
mViewManager->updateWNview();
//mTodoList->updateView();
}
}
void CalendarView::changeIncidenceDisplay(Incidence *which, int action)
{
updateUnmanagedViews();
//qDebug(" CalendarView::changeIncidenceDisplay++++++++++++++++++++++++++ %d %d ",which, action );
if ( action == KOGlobals::EVENTDELETED ) { //delete
mCalendar->checkAlarmForIncidence( 0, true );
if ( mEventViewerDialog )
mEventViewerDialog->hide();
}
else
mCalendar->checkAlarmForIncidence( which , false );