summaryrefslogtreecommitdiffabout
path: root/korganizer/koprefs.cpp
authorzautrix <zautrix>2005-02-06 16:21:57 (UTC)
committer zautrix <zautrix>2005-02-06 16:21:57 (UTC)
commit5fd7b1cc63dc52c15e0666e023cea60700e9fdcf (patch) (side-by-side diff)
treeb0bf4d7d3054679970e2ff672e50149d1089bcb1 /korganizer/koprefs.cpp
parent38898c49275bf27fb8c2df96d145f2a5abb62331 (diff)
downloadkdepimpi-5fd7b1cc63dc52c15e0666e023cea60700e9fdcf.zip
kdepimpi-5fd7b1cc63dc52c15e0666e023cea60700e9fdcf.tar.gz
kdepimpi-5fd7b1cc63dc52c15e0666e023cea60700e9fdcf.tar.bz2
fix
Diffstat (limited to 'korganizer/koprefs.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koprefs.cpp65
1 files changed, 38 insertions, 27 deletions
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp
index 9366c11..8f37793 100644
--- a/korganizer/koprefs.cpp
+++ b/korganizer/koprefs.cpp
@@ -333,81 +333,92 @@ void KOPrefs::fillMailDefaults()
void KOPrefs::setTimeZoneIdDefault()
{
;
}
+void KOPrefs::setAllDefaults()
+{
+ setCategoryDefaults();
+ mEventSummaryUser = getDefaultList() ;
+ mTodoSummaryUser = getDefaultList() ;
+ mLocationDefaults = getLocationDefaultList();
+}
+
void KOPrefs::setCategoryDefaults()
{
mCustomCategories.clear();
mCustomCategories = getDefaultList();
QStringList::Iterator it;
for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) {
setCategoryColor(*it,mDefaultCategoryColor);
}
}
+QStringList KOPrefs::getLocationDefaultList()
+{
+ QStringList retval ;
+ retval << i18n("Home") << i18n("Office") << i18n("Library") << i18n("School") << i18n("Doctor") << i18n("Beach")
+ << i18n("University") << i18n("Restaurant") << i18n("Bar") << i18n("Conference room")
+ << i18n("Cinema") << i18n("Lake") << i18n("Kindergarten")
+ << i18n("Germany") << i18n("Sweden") << i18n("Forest") << i18n("Desert") << i18n("Kitchen") ;
+ // << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("")
+ retval.sort();
+ return retval;
+}
QStringList KOPrefs::getDefaultList()
{
QStringList retval ;
retval << i18n("Anniversary") << i18n("Appointment") << i18n("Birthday") << i18n("Business") << i18n("Business Travel") << i18n("Cinema") << i18n("Customer")
<< i18n("Break")<< i18n("Breakfast")<< i18n("Competition")<< i18n("Dinner")
<< i18n("Education")<< i18n("Family") << i18n("Favorites") << i18n("Festival")<< i18n("Fishing")<< i18n("Flight") << i18n("Gifts")
<< i18n("Holiday") << i18n("Holiday Cards")<< i18n("Hot Contacts") << i18n("Hiking") << i18n("Hunting") << i18n("Key Customer") << i18n("Kids")
<< i18n("Lunch") << i18n("Meeting") << i18n("Miscellaneous") << i18n("Partner")<< i18n("Party") << i18n("Personal") << i18n("Personal Travel")
<< i18n("PHB") << i18n("Phone Calls") << i18n("Projects") << i18n("Recurring") << i18n("School") << i18n("Shopping")
<< i18n("Speach") << i18n("Special Occasion") << i18n("Sports") << i18n("Talk") << i18n("Travel") << i18n("TV")<< i18n("University")
<< i18n("Vacation") << i18n("VIP") << i18n("SyncEvent") ;
retval.sort();
- //qDebug("cat %s ", retval.join("-").latin1());
+ qDebug("cat %s ", retval.join("-").latin1());
return retval;
}
void KOPrefs::usrReadConfig()
{
config()->setGroup("General");
+ //qDebug("KOPrefs::usrReadConfig() ");
mCustomCategories = config()->readListEntry("Custom Categories");
- if ( KPimGlobalPrefs::instance()->mPreferredLanguage != mOldLanguage ) {
- mLocationDefaults.clear();
- mEventSummaryUser.clear();
- mTodoSummaryUser.clear();
- }
mOldLoadedLanguage = mOldLanguage ;
mOldLanguage = KPimGlobalPrefs::instance()->mPreferredLanguage;
- if (mLocationDefaults.isEmpty()) {
- mLocationDefaults << i18n("Home") << i18n("Office") << i18n("Library") << i18n("School") << i18n("Doctor") << i18n("Beach")
- << i18n("University") << i18n("Restaurant") << i18n("Bar") << i18n("Conference room") << i18n("Cinema") << i18n("Lake") << i18n("Kindergarten")
- << i18n("Germany") << i18n("Sweden") << i18n("Forest") << i18n("Desert") << i18n("Kitchen") ;
- // << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("")
- mLocationDefaults.sort();
+ if (mLocationDefaults.isEmpty()) {
+ mLocationDefaults = getLocationDefaultList();
}
- if (mEventSummaryUser.isEmpty()) {
+ if (mEventSummaryUser.isEmpty()) {
mEventSummaryUser = getDefaultList() ;
}
- if (mTodoSummaryUser.isEmpty()) {
- mTodoSummaryUser = getDefaultList() ;
- }
+ if (mTodoSummaryUser.isEmpty()) {
+ mTodoSummaryUser = getDefaultList() ;
+ }
- if (mCustomCategories.isEmpty()) setCategoryDefaults();
+ if (mCustomCategories.isEmpty()) setCategoryDefaults();
- config()->setGroup("Personal Settings");
- mName = config()->readEntry("user_name","");
- mEmail = config()->readEntry("user_email","");
- fillMailDefaults();
+ config()->setGroup("Personal Settings");
+ mName = config()->readEntry("user_name","");
+ mEmail = config()->readEntry("user_email","");
+ fillMailDefaults();
- config()->setGroup("Category Colors");
- QStringList::Iterator it;
- for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) {
- setCategoryColor(*it,config()->readColorEntry(*it,&mDefaultCategoryColor));
+ config()->setGroup("Category Colors");
+ QStringList::Iterator it;
+ for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) {
+ setCategoryColor(*it,config()->readColorEntry(*it,&mDefaultCategoryColor));
- }
+ }
- KPimPrefs::usrReadConfig();
+ KPimPrefs::usrReadConfig();
}
void KOPrefs::usrWriteConfig()
{
config()->setGroup("General");