-rw-r--r-- | korganizer/calendarview.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 0015bd6..1e83236 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -1948,227 +1948,227 @@ void CalendarView::writeSettings() | |||
1948 | 1948 | ||
1949 | writeFilterSettings(config); | 1949 | writeFilterSettings(config); |
1950 | 1950 | ||
1951 | config->setGroup( "Views" ); | 1951 | config->setGroup( "Views" ); |
1952 | config->writeEntry( "ShownDatesCount", mNavigator->selectedDates().count() ); | 1952 | config->writeEntry( "ShownDatesCount", mNavigator->selectedDates().count() ); |
1953 | 1953 | ||
1954 | QValueList<int> listINT = mLeftFrame->sizes(); | 1954 | QValueList<int> listINT = mLeftFrame->sizes(); |
1955 | config->writeEntry("Left Splitter Frame",listINT); | 1955 | config->writeEntry("Left Splitter Frame",listINT); |
1956 | QValueList<int> listINT2 = mMainFrame->sizes(); | 1956 | QValueList<int> listINT2 = mMainFrame->sizes(); |
1957 | config->writeEntry("Main Splitter Frame",listINT2); | 1957 | config->writeEntry("Main Splitter Frame",listINT2); |
1958 | #ifdef DESKTOP_VERSION | 1958 | #ifdef DESKTOP_VERSION |
1959 | config->setGroup("WidgetLayout"); | 1959 | config->setGroup("WidgetLayout"); |
1960 | QStringList list ;//= config->readListEntry("MainLayout"); | 1960 | QStringList list ;//= config->readListEntry("MainLayout"); |
1961 | int x,y,w,h; | 1961 | int x,y,w,h; |
1962 | QWidget* wid; | 1962 | QWidget* wid; |
1963 | wid = topLevelWidget(); | 1963 | wid = topLevelWidget(); |
1964 | x = wid->geometry().x(); | 1964 | x = wid->geometry().x(); |
1965 | y = wid->geometry().y(); | 1965 | y = wid->geometry().y(); |
1966 | w = wid->width(); | 1966 | w = wid->width(); |
1967 | h = wid->height(); | 1967 | h = wid->height(); |
1968 | list.clear(); | 1968 | list.clear(); |
1969 | list << QString::number( x ); | 1969 | list << QString::number( x ); |
1970 | list << QString::number( y ); | 1970 | list << QString::number( y ); |
1971 | list << QString::number( w ); | 1971 | list << QString::number( w ); |
1972 | list << QString::number( h ); | 1972 | list << QString::number( h ); |
1973 | config->writeEntry("MainLayout",list ); | 1973 | config->writeEntry("MainLayout",list ); |
1974 | 1974 | ||
1975 | wid = mEventEditor; | 1975 | wid = mEventEditor; |
1976 | x = wid->geometry().x(); | 1976 | x = wid->geometry().x(); |
1977 | y = wid->geometry().y(); | 1977 | y = wid->geometry().y(); |
1978 | w = wid->width(); | 1978 | w = wid->width(); |
1979 | h = wid->height(); | 1979 | h = wid->height(); |
1980 | list.clear(); | 1980 | list.clear(); |
1981 | list << QString::number( x ); | 1981 | list << QString::number( x ); |
1982 | list << QString::number( y ); | 1982 | list << QString::number( y ); |
1983 | list << QString::number( w ); | 1983 | list << QString::number( w ); |
1984 | list << QString::number( h ); | 1984 | list << QString::number( h ); |
1985 | config->writeEntry("EditEventLayout",list ); | 1985 | config->writeEntry("EditEventLayout",list ); |
1986 | 1986 | ||
1987 | wid = mTodoEditor; | 1987 | wid = mTodoEditor; |
1988 | x = wid->geometry().x(); | 1988 | x = wid->geometry().x(); |
1989 | y = wid->geometry().y(); | 1989 | y = wid->geometry().y(); |
1990 | w = wid->width(); | 1990 | w = wid->width(); |
1991 | h = wid->height(); | 1991 | h = wid->height(); |
1992 | list.clear(); | 1992 | list.clear(); |
1993 | list << QString::number( x ); | 1993 | list << QString::number( x ); |
1994 | list << QString::number( y ); | 1994 | list << QString::number( y ); |
1995 | list << QString::number( w ); | 1995 | list << QString::number( w ); |
1996 | list << QString::number( h ); | 1996 | list << QString::number( h ); |
1997 | config->writeEntry("EditTodoLayout",list ); | 1997 | config->writeEntry("EditTodoLayout",list ); |
1998 | wid = getEventViewerDialog(); | 1998 | wid = getEventViewerDialog(); |
1999 | x = wid->geometry().x(); | 1999 | x = wid->geometry().x(); |
2000 | y = wid->geometry().y(); | 2000 | y = wid->geometry().y(); |
2001 | w = wid->width(); | 2001 | w = wid->width(); |
2002 | h = wid->height(); | 2002 | h = wid->height(); |
2003 | list.clear(); | 2003 | list.clear(); |
2004 | list << QString::number( x ); | 2004 | list << QString::number( x ); |
2005 | list << QString::number( y ); | 2005 | list << QString::number( y ); |
2006 | list << QString::number( w ); | 2006 | list << QString::number( w ); |
2007 | list << QString::number( h ); | 2007 | list << QString::number( h ); |
2008 | config->writeEntry("ViewerLayout",list ); | 2008 | config->writeEntry("ViewerLayout",list ); |
2009 | wid = mDialogManager->getSearchDialog(); | 2009 | wid = mDialogManager->getSearchDialog(); |
2010 | if ( wid ) { | 2010 | if ( wid ) { |
2011 | x = wid->geometry().x(); | 2011 | x = wid->geometry().x(); |
2012 | y = wid->geometry().y(); | 2012 | y = wid->geometry().y(); |
2013 | w = wid->width(); | 2013 | w = wid->width(); |
2014 | h = wid->height(); | 2014 | h = wid->height(); |
2015 | list.clear(); | 2015 | list.clear(); |
2016 | list << QString::number( x ); | 2016 | list << QString::number( x ); |
2017 | list << QString::number( y ); | 2017 | list << QString::number( y ); |
2018 | list << QString::number( w ); | 2018 | list << QString::number( w ); |
2019 | list << QString::number( h ); | 2019 | list << QString::number( h ); |
2020 | config->writeEntry("SearchLayout",list ); | 2020 | config->writeEntry("SearchLayout",list ); |
2021 | } | 2021 | } |
2022 | #endif | 2022 | #endif |
2023 | 2023 | ||
2024 | 2024 | ||
2025 | config->sync(); | 2025 | config->sync(); |
2026 | } | 2026 | } |
2027 | 2027 | ||
2028 | void CalendarView::readFilterSettings(KConfig *config) | 2028 | void CalendarView::readFilterSettings(KConfig *config) |
2029 | { | 2029 | { |
2030 | // kdDebug() << "CalendarView::readFilterSettings()" << endl; | 2030 | // kdDebug() << "CalendarView::readFilterSettings()" << endl; |
2031 | 2031 | ||
2032 | mFilters.clear(); | 2032 | mFilters.clear(); |
2033 | 2033 | ||
2034 | config->setGroup("General"); | 2034 | config->setGroup("General"); |
2035 | QStringList filterList = config->readListEntry("CalendarFilters"); | 2035 | QStringList filterList = config->readListEntry("CalendarFilters"); |
2036 | 2036 | ||
2037 | QStringList::ConstIterator it = filterList.begin(); | 2037 | QStringList::ConstIterator it = filterList.begin(); |
2038 | QStringList::ConstIterator end = filterList.end(); | 2038 | QStringList::ConstIterator end = filterList.end(); |
2039 | while(it != end) { | 2039 | while(it != end) { |
2040 | // kdDebug() << " filter: " << (*it) << endl; | 2040 | // kdDebug() << " filter: " << (*it) << endl; |
2041 | 2041 | ||
2042 | CalFilter *filter; | 2042 | CalFilter *filter; |
2043 | filter = new CalFilter(*it); | 2043 | filter = new CalFilter(*it); |
2044 | config->setGroup("Filter_" + (*it)); | 2044 | config->setGroup("Filter_" + (*it).utf8()); |
2045 | //qDebug("readFilterSettings %d ",config->readNumEntry("Criteria",0) ); | 2045 | //qDebug("readFilterSettings %d ",config->readNumEntry("Criteria",0) ); |
2046 | filter->setCriteria(config->readNumEntry("Criteria",0)); | 2046 | filter->setCriteria(config->readNumEntry("Criteria",0)); |
2047 | filter->setCategoryList(config->readListEntry("CategoryList")); | 2047 | filter->setCategoryList(config->readListEntry("CategoryList")); |
2048 | mFilters.append(filter); | 2048 | mFilters.append(filter); |
2049 | 2049 | ||
2050 | ++it; | 2050 | ++it; |
2051 | } | 2051 | } |
2052 | 2052 | ||
2053 | if (mFilters.count() == 0) { | 2053 | if (mFilters.count() == 0) { |
2054 | CalFilter *filter = new CalFilter(i18n("Default")); | 2054 | CalFilter *filter = new CalFilter(i18n("Default")); |
2055 | mFilters.append(filter); | 2055 | mFilters.append(filter); |
2056 | } | 2056 | } |
2057 | mFilterView->updateFilters(); | 2057 | mFilterView->updateFilters(); |
2058 | config->setGroup("FilterView"); | 2058 | config->setGroup("FilterView"); |
2059 | 2059 | ||
2060 | mFilterView->blockSignals(true); | 2060 | mFilterView->blockSignals(true); |
2061 | mFilterView->setFiltersEnabled(config->readBoolEntry("FilterEnabled")); | 2061 | mFilterView->setFiltersEnabled(config->readBoolEntry("FilterEnabled")); |
2062 | mFilterView->setSelectedFilter(config->readEntry("Current Filter")); | 2062 | mFilterView->setSelectedFilter(config->readEntry("Current Filter")); |
2063 | mFilterView->blockSignals(false); | 2063 | mFilterView->blockSignals(false); |
2064 | // We do it manually to avoid it being done twice by the above calls | 2064 | // We do it manually to avoid it being done twice by the above calls |
2065 | updateFilter(); | 2065 | updateFilter(); |
2066 | } | 2066 | } |
2067 | 2067 | ||
2068 | void CalendarView::writeFilterSettings(KConfig *config) | 2068 | void CalendarView::writeFilterSettings(KConfig *config) |
2069 | { | 2069 | { |
2070 | // kdDebug() << "CalendarView::writeFilterSettings()" << endl; | 2070 | // kdDebug() << "CalendarView::writeFilterSettings()" << endl; |
2071 | 2071 | ||
2072 | QStringList filterList; | 2072 | QStringList filterList; |
2073 | 2073 | ||
2074 | CalFilter *filter = mFilters.first(); | 2074 | CalFilter *filter = mFilters.first(); |
2075 | while(filter) { | 2075 | while(filter) { |
2076 | // kdDebug() << " fn: " << filter->name() << endl; | 2076 | // kdDebug() << " fn: " << filter->name() << endl; |
2077 | filterList << filter->name(); | 2077 | filterList << filter->name(); |
2078 | config->setGroup("Filter_" + filter->name()); | 2078 | config->setGroup("Filter_" + filter->name().utf8()); |
2079 | config->writeEntry("Criteria",filter->criteria()); | 2079 | config->writeEntry("Criteria",filter->criteria()); |
2080 | config->writeEntry("CategoryList",filter->categoryList()); | 2080 | config->writeEntry("CategoryList",filter->categoryList()); |
2081 | filter = mFilters.next(); | 2081 | filter = mFilters.next(); |
2082 | } | 2082 | } |
2083 | config->setGroup("General"); | 2083 | config->setGroup("General"); |
2084 | config->writeEntry("CalendarFilters",filterList); | 2084 | config->writeEntry("CalendarFilters",filterList); |
2085 | 2085 | ||
2086 | config->setGroup("FilterView"); | 2086 | config->setGroup("FilterView"); |
2087 | config->writeEntry("FilterEnabled",mFilterView->filtersEnabled()); | 2087 | config->writeEntry("FilterEnabled",mFilterView->filtersEnabled()); |
2088 | config->writeEntry("Current Filter",mFilterView->selectedFilter()->name()); | 2088 | config->writeEntry("Current Filter",mFilterView->selectedFilter()->name()); |
2089 | } | 2089 | } |
2090 | 2090 | ||
2091 | 2091 | ||
2092 | void CalendarView::goToday() | 2092 | void CalendarView::goToday() |
2093 | { | 2093 | { |
2094 | if ( mViewManager->currentView()->isMonthView() ) | 2094 | if ( mViewManager->currentView()->isMonthView() ) |
2095 | mNavigator->selectTodayMonth(); | 2095 | mNavigator->selectTodayMonth(); |
2096 | else | 2096 | else |
2097 | mNavigator->selectToday(); | 2097 | mNavigator->selectToday(); |
2098 | } | 2098 | } |
2099 | 2099 | ||
2100 | void CalendarView::goNext() | 2100 | void CalendarView::goNext() |
2101 | { | 2101 | { |
2102 | mNavigator->selectNext(); | 2102 | mNavigator->selectNext(); |
2103 | } | 2103 | } |
2104 | 2104 | ||
2105 | void CalendarView::goPrevious() | 2105 | void CalendarView::goPrevious() |
2106 | { | 2106 | { |
2107 | mNavigator->selectPrevious(); | 2107 | mNavigator->selectPrevious(); |
2108 | } | 2108 | } |
2109 | void CalendarView::goNextMonth() | 2109 | void CalendarView::goNextMonth() |
2110 | { | 2110 | { |
2111 | mNavigator->selectNextMonth(); | 2111 | mNavigator->selectNextMonth(); |
2112 | } | 2112 | } |
2113 | 2113 | ||
2114 | void CalendarView::goPreviousMonth() | 2114 | void CalendarView::goPreviousMonth() |
2115 | { | 2115 | { |
2116 | mNavigator->selectPreviousMonth(); | 2116 | mNavigator->selectPreviousMonth(); |
2117 | } | 2117 | } |
2118 | void CalendarView::writeLocale() | 2118 | void CalendarView::writeLocale() |
2119 | { | 2119 | { |
2120 | //KPimGlobalPrefs::instance()->setGlobalConfig(); | 2120 | //KPimGlobalPrefs::instance()->setGlobalConfig(); |
2121 | #if 0 | 2121 | #if 0 |
2122 | KGlobal::locale()->setHore24Format( !KOPrefs::instance()->mPreferredTime ); | 2122 | KGlobal::locale()->setHore24Format( !KOPrefs::instance()->mPreferredTime ); |
2123 | KGlobal::locale()->setWeekStartMonday( !KOPrefs::instance()->mWeekStartsOnSunday ); | 2123 | KGlobal::locale()->setWeekStartMonday( !KOPrefs::instance()->mWeekStartsOnSunday ); |
2124 | KGlobal::locale()->setIntDateFormat( (KLocale::IntDateFormat)KOPrefs::instance()->mPreferredDate ); | 2124 | KGlobal::locale()->setIntDateFormat( (KLocale::IntDateFormat)KOPrefs::instance()->mPreferredDate ); |
2125 | KGlobal::locale()->setLanguage( KOPrefs::instance()->mPreferredLanguage ); | 2125 | KGlobal::locale()->setLanguage( KOPrefs::instance()->mPreferredLanguage ); |
2126 | QString dummy = KOPrefs::instance()->mUserDateFormatLong; | 2126 | QString dummy = KOPrefs::instance()->mUserDateFormatLong; |
2127 | KGlobal::locale()->setDateFormat(dummy.replace( QRegExp("K"), QString(",") )); | 2127 | KGlobal::locale()->setDateFormat(dummy.replace( QRegExp("K"), QString(",") )); |
2128 | dummy = KOPrefs::instance()->mUserDateFormatShort; | 2128 | dummy = KOPrefs::instance()->mUserDateFormatShort; |
2129 | KGlobal::locale()->setDateFormatShort(dummy.replace( QRegExp("K"), QString(",") )); | 2129 | KGlobal::locale()->setDateFormatShort(dummy.replace( QRegExp("K"), QString(",") )); |
2130 | KGlobal::locale()->setDaylightSaving( KOPrefs::instance()->mUseDaylightsaving, | 2130 | KGlobal::locale()->setDaylightSaving( KOPrefs::instance()->mUseDaylightsaving, |
2131 | KOPrefs::instance()->mDaylightsavingStart, | 2131 | KOPrefs::instance()->mDaylightsavingStart, |
2132 | KOPrefs::instance()->mDaylightsavingEnd ); | 2132 | KOPrefs::instance()->mDaylightsavingEnd ); |
2133 | KGlobal::locale()->setTimezone( KPimGlobalPrefs::instance()->mTimeZoneId ); | 2133 | KGlobal::locale()->setTimezone( KPimGlobalPrefs::instance()->mTimeZoneId ); |
2134 | #endif | 2134 | #endif |
2135 | } | 2135 | } |
2136 | void CalendarView::updateConfig() | 2136 | void CalendarView::updateConfig() |
2137 | { | 2137 | { |
2138 | writeLocale(); | 2138 | writeLocale(); |
2139 | if ( KOPrefs::instance()->mUseAppColors ) | 2139 | if ( KOPrefs::instance()->mUseAppColors ) |
2140 | QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); | 2140 | QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); |
2141 | emit configChanged(); | 2141 | emit configChanged(); |
2142 | mTodoList->updateConfig(); | 2142 | mTodoList->updateConfig(); |
2143 | // mDateNavigator->setFont ( KOPrefs::instance()->mDateNavigatorFont); | 2143 | // mDateNavigator->setFont ( KOPrefs::instance()->mDateNavigatorFont); |
2144 | mCalendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); | 2144 | mCalendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); |
2145 | // To make the "fill window" configurations work | 2145 | // To make the "fill window" configurations work |
2146 | //mViewManager->raiseCurrentView(); | 2146 | //mViewManager->raiseCurrentView(); |
2147 | } | 2147 | } |
2148 | 2148 | ||
2149 | 2149 | ||
2150 | void CalendarView::eventChanged(Event *event) | 2150 | void CalendarView::eventChanged(Event *event) |
2151 | { | 2151 | { |
2152 | changeEventDisplay(event,KOGlobals::EVENTEDITED); | 2152 | changeEventDisplay(event,KOGlobals::EVENTEDITED); |
2153 | //updateUnmanagedViews(); | 2153 | //updateUnmanagedViews(); |
2154 | } | 2154 | } |
2155 | 2155 | ||
2156 | void CalendarView::eventAdded(Event *event) | 2156 | void CalendarView::eventAdded(Event *event) |
2157 | { | 2157 | { |
2158 | changeEventDisplay(event,KOGlobals::EVENTADDED); | 2158 | changeEventDisplay(event,KOGlobals::EVENTADDED); |
2159 | } | 2159 | } |
2160 | 2160 | ||
2161 | void CalendarView::eventToBeDeleted(Event *) | 2161 | void CalendarView::eventToBeDeleted(Event *) |
2162 | { | 2162 | { |
2163 | kdDebug() << "CalendarView::eventToBeDeleted(): to be implemented" << endl; | 2163 | kdDebug() << "CalendarView::eventToBeDeleted(): to be implemented" << endl; |
2164 | } | 2164 | } |
2165 | 2165 | ||
2166 | void CalendarView::eventDeleted() | 2166 | void CalendarView::eventDeleted() |
2167 | { | 2167 | { |
2168 | changeEventDisplay(0,KOGlobals::EVENTDELETED); | 2168 | changeEventDisplay(0,KOGlobals::EVENTDELETED); |
2169 | } | 2169 | } |
2170 | void CalendarView::changeTodoDisplay(Todo *which, int action) | 2170 | void CalendarView::changeTodoDisplay(Todo *which, int action) |
2171 | { | 2171 | { |
2172 | changeIncidenceDisplay((Incidence *)which, action); | 2172 | changeIncidenceDisplay((Incidence *)which, action); |
2173 | mDateNavigator->updateView(); //LR | 2173 | mDateNavigator->updateView(); //LR |
2174 | //mDialogManager->updateSearchDialog(); | 2174 | //mDialogManager->updateSearchDialog(); |