-rw-r--r-- | korganizer/koprefs.cpp | 65 | ||||
-rw-r--r-- | korganizer/koprefs.h | 2 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 8 |
3 files changed, 45 insertions, 30 deletions
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp index 9366c11..8f37793 100644 --- a/korganizer/koprefs.cpp +++ b/korganizer/koprefs.cpp @@ -337,4 +337,12 @@ void KOPrefs::setTimeZoneIdDefault() } +void KOPrefs::setAllDefaults() +{ + setCategoryDefaults(); + mEventSummaryUser = getDefaultList() ; + mTodoSummaryUser = getDefaultList() ; + mLocationDefaults = getLocationDefaultList(); +} + void KOPrefs::setCategoryDefaults() { @@ -347,5 +355,16 @@ void KOPrefs::setCategoryDefaults() } } +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() { @@ -360,5 +379,5 @@ QStringList KOPrefs::getDefaultList() << i18n("Vacation") << i18n("VIP") << i18n("SyncEvent") ; retval.sort(); - //qDebug("cat %s ", retval.join("-").latin1()); + qDebug("cat %s ", retval.join("-").latin1()); return retval; } @@ -368,42 +387,34 @@ 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(); } diff --git a/korganizer/koprefs.h b/korganizer/koprefs.h index dddcdca..fa69d52 100644 --- a/korganizer/koprefs.h +++ b/korganizer/koprefs.h @@ -58,4 +58,5 @@ class KOPrefs : public KPimPrefs void usrWriteConfig(); void setCategoryDefaults(); + void setAllDefaults(); protected: @@ -72,4 +73,5 @@ class KOPrefs : public KPimPrefs static KOPrefs *mInstance; QStringList getDefaultList(); + QStringList getLocationDefaultList(); public: // preferences data diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 1c74307..348dd5e 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp @@ -133,4 +133,5 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : { + #ifdef DESKTOP_VERSION setFont( QFont("Arial"), 14 ); @@ -144,7 +145,6 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : mBlockAtStartup = true; mFlagKeyPressed = false; - setCaption("KOrganizer/Pi"); - KPimGlobalPrefs::instance()->setGlobalConfig(); KOPrefs *p = KOPrefs::instance(); + KPimGlobalPrefs::instance()->setGlobalConfig(); if ( p->mHourSize > 18 ) p->mHourSize = 18; @@ -169,4 +169,5 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : mCalendarModifiedFlag = false; + setCaption("KOrganizer/Pi"); QLabel* splash = new QLabel(i18n("KO/Pi is starting ... "), this ); splash->setAlignment ( AlignCenter ); @@ -175,4 +176,5 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : showMaximized(); #endif + //qDebug("Mainwidget x %d y %d w %d h %d", x(), y(), width(), height ()); setDefaultPreferences(); @@ -232,5 +234,5 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : if ( KPimGlobalPrefs::instance()->mPreferredLanguage != KOPrefs::instance()->mOldLoadedLanguage ) { - KOPrefs::instance()->setCategoryDefaults(); + KOPrefs::instance()->setAllDefaults(); int count = mView->addCategories(); } |