author | zautrix <zautrix> | 2004-09-22 03:08:05 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-09-22 03:08:05 (UTC) |
commit | d63eac7a612a9724705bc58ad98c65c6ac052d07 (patch) (side-by-side diff) | |
tree | dc584a0ddcbd5f828ea36b86b6af640e46e137f2 | |
parent | 633522024e48efc423155a04b71083a03696211d (diff) | |
download | kdepimpi-d63eac7a612a9724705bc58ad98c65c6ac052d07.zip kdepimpi-d63eac7a612a9724705bc58ad98c65c6ac052d07.tar.gz kdepimpi-d63eac7a612a9724705bc58ad98c65c6ac052d07.tar.bz2 |
connected global config
-rw-r--r-- | kaddressbook/mainembedded.cpp | 15 | ||||
-rw-r--r-- | kmicromail/libmailwrapper/genericwrapper.cpp | 18 | ||||
-rw-r--r-- | kmicromail/opiemail.cpp | 2 | ||||
-rw-r--r-- | korganizer/calendarview.cpp | 4 | ||||
-rw-r--r-- | korganizer/koprefs.cpp | 2 | ||||
-rw-r--r-- | korganizer/koprefsdialog.cpp | 102 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 2 | ||||
-rw-r--r-- | libkdepim/kcmconfigs/kdepimconfigwidget.cpp | 2 | ||||
-rw-r--r-- | libkdepim/kpimglobalprefs.cpp | 17 | ||||
-rw-r--r-- | libkdepim/kpimglobalprefs.h | 4 |
10 files changed, 90 insertions, 78 deletions
diff --git a/kaddressbook/mainembedded.cpp b/kaddressbook/mainembedded.cpp index 10b1013..965fb06 100644 --- a/kaddressbook/mainembedded.cpp +++ b/kaddressbook/mainembedded.cpp @@ -6,24 +6,25 @@ #include <qwindowsstyle.h> #include <qplatinumstyle.h> #include <qmainwindow.h> #endif #include <kstandarddirs.h> #include <qregexp.h> #include <kglobal.h> #include <stdio.h> #include <qdir.h> #include "kaddressbookmain.h" #include "externalapphandler.h" +#include <libkdepim/kpimglobalprefs.h> int main( int argc, char **argv ) { #ifndef DESKTOP_VERSION QPEApplication a( argc, argv ); a.setKeepRunning (); #else QApplication a( argc, argv ); QApplication::setStyle( new QPlatinumStyle ()); QString hdir = QDir::homeDirPath(); // there is a bug when creating dirs for WIN 98 // it is difficult to fix, because we have no WIN 98 runnung @@ -64,37 +65,25 @@ int main( int argc, char **argv ) QString fileName ; fileName = qApp->applicationDirPath () + "/kdepim/kaddressbook/icons22/"; KGlobal::iconLoader()->setIconPath(QDir::convertSeparators(fileName)); QApplication::addLibraryPath ( qApp->applicationDirPath () ); #endif KStandardDirs::setAppDir( QDir::convertSeparators(locateLocal("data", "kaddressbook"))); KAddressBookMain m ; //US MainWindow m; QObject::connect(&a, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); { - KConfig kon ( locateLocal( "config", "korganizerrc" ) ); - kon.setGroup("Locale"); - KGlobal::locale()->setIntDateFormat( (KLocale::IntDateFormat)kon.readNumEntry( "PreferredDate",0) ); - QString dummy = kon.readEntry( "UserDateFormatShort","%aK %d.%m.%y" );// kon.readEntry( ""); - KGlobal::locale()->setHore24Format( !kon.readNumEntry( "PreferredTime",0 ) ); - KGlobal::locale()->setDateFormatShort(dummy.replace( QRegExp("K"), QString(",") )); - dummy = kon.readEntry( "UserDateFormatLong","%A %d %b %y" ); - KGlobal::locale()->setDateFormat(dummy.replace( QRegExp("K"), QString(",") )); - kon.setGroup("Time & Date"); - KGlobal::locale()->setDaylightSaving( kon.readBoolEntry( "UseDaylightsaving", true ), - kon.readNumEntry( "DaylightsavingStart", 90), - kon.readNumEntry( "DaylightsavingEnd",304) ); - KGlobal::locale()->setTimezone( kon.readEntry( "TimeZoneName" ," 00:00 Europe/London(UTC)") ); + KPimGlobalPrefs::instance()->setGlobalConfig(); } #ifndef DESKTOP_VERSION a.showMainWidget( &m ); #else a.setMainWidget( &m ); m.resize (640, 480 ); m.show(); #endif a.exec(); } qDebug("KA: Bye! "); diff --git a/kmicromail/libmailwrapper/genericwrapper.cpp b/kmicromail/libmailwrapper/genericwrapper.cpp index 09a6447..e691082 100644 --- a/kmicromail/libmailwrapper/genericwrapper.cpp +++ b/kmicromail/libmailwrapper/genericwrapper.cpp @@ -20,43 +20,25 @@ Genericwrapper::Genericwrapper() Genericwrapper::~Genericwrapper() { if (m_folder) { mailfolder_free(m_folder); } if (m_storage) { mailstorage_free(m_storage); } cleanMimeCache(); } const QDateTime Genericwrapper::parseDateTime( mailimf_date_time *date ) { - static bool init = false ; - if ( ! init ) { - KConfig kon ( locateLocal( "config", "korganizerrc" ) ); - kon.setGroup("Locale"); - KGlobal::locale()->setIntDateFormat( (KLocale::IntDateFormat)kon.readNumEntry( "PreferredDate",0) ); - QString dummy = kon.readEntry( "UserDateFormatShort","%aK %d.%m.%y" );// kon.readEntry( ""); - KGlobal::locale()->setHore24Format( !kon.readNumEntry( "PreferredTime",0 ) ); - KGlobal::locale()->setDateFormatShort(dummy.replace( QRegExp("K"), QString(",") )); - dummy = kon.readEntry( "UserDateFormatLong","%A %d %b %y" ); - KGlobal::locale()->setDateFormat(dummy.replace( QRegExp("K"), QString(",") )); - kon.setGroup("Time & Date"); - KGlobal::locale()->setDaylightSaving( kon.readBoolEntry( "UseDaylightsaving", true ), - kon.readNumEntry( "DaylightsavingStart", 90), - kon.readNumEntry( "DaylightsavingEnd",304) ); - KGlobal::locale()->setTimezone( kon.readEntry( "TimeZoneName" ," 00:00 Europe/London(UTC)") ); - - init = true; - } QDate da (date->dt_year,date->dt_month, date->dt_day ); QTime ti ( date->dt_hour, date->dt_min, date->dt_sec ); QDateTime dt ( da ,ti ); int addsec = -date->dt_zone*36; //qDebug("adsec1 %d ",addsec ); dt = dt.addSecs( addsec ); int off = KGlobal::locale()->localTimeOffset( dt ); //qDebug("adsec2 %d ",off*60 ); dt = dt.addSecs( off*60 ); return dt; #if 0 diff --git a/kmicromail/opiemail.cpp b/kmicromail/opiemail.cpp index 9a1a750..164988c 100644 --- a/kmicromail/opiemail.cpp +++ b/kmicromail/opiemail.cpp @@ -6,41 +6,43 @@ #include "editaccounts.h" #include "composemail.h" #include "mailistviewitem.h" #include "viewmail.h" #include "selectstore.h" #include "selectsmtp.h" #include "accountitem.h" #include "koprefsdialog.h" #include <qmessagebox.h> #include <qtimer.h> #include <libkdepim/externalapphandler.h> +#include <libkdepim/kpimglobalprefs.h> #include <qpe/qpeapplication.h> #include <libmailwrapper/smtpwrapper.h> #include <libmailwrapper/mailtypes.h> #include <libmailwrapper/abstractmail.h> /* OPIE */ //#include <qpe/resource.h> //#include <qpe/qpeapplication.h> /* QT */ //using namespace Opie::Core; OpieMail::OpieMail( QWidget *parent, const char *name ) : MainWindow( parent, name) //, WStyle_ContextHelp ) { settings = new Settings(); + KPimGlobalPrefs::instance()->setGlobalConfig(); folderView->populate( settings->getAccounts() ); } OpieMail::~OpieMail() { if (settings) delete settings; } void OpieMail::appMessage(const QCString &msg, const QByteArray &data) { diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index bc8625d..3635cfa 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp @@ -54,24 +54,25 @@ #include <kdebug.h> #include <kstandarddirs.h> #include <kfiledialog.h> #include <kmessagebox.h> #include <knotifyclient.h> #include <kconfig.h> #include <libkdepim/ksyncprefsdialog.h> #include <krun.h> #include <kdirwatch.h> #include <libkdepim/kdatepicker.h> #include <libkdepim/ksyncprofile.h> +#include <libkdepim/kpimglobalprefs.h> #include <libkcal/vcaldrag.h> #include <libkcal/icaldrag.h> #include <libkcal/icalformat.h> #include <libkcal/vcalformat.h> #include <libkcal/scheduler.h> #include <libkcal/calendarlocal.h> #include <libkcal/journal.h> #include <libkcal/calfilter.h> #include <libkcal/attendee.h> #include <libkcal/dndfactory.h> #include <libkcal/freebusy.h> @@ -1877,36 +1878,39 @@ void CalendarView::goPrevious() } 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( KOPrefs::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(KOPrefs::instance()->mTimeZoneId); // To make the "fill window" configurations work //mViewManager->raiseCurrentView(); diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp index dd978bf..5d7db4f 100644 --- a/korganizer/koprefs.cpp +++ b/korganizer/koprefs.cpp @@ -32,24 +32,25 @@ #include <qregexp.h> #include <qfont.h> #include <qcolor.h> #include <qstringlist.h> #include <stdlib.h> #include <kglobal.h> #include <kconfig.h> #include <klocale.h> #include <kdebug.h> #include <kemailsettings.h> #include <kstaticdeleter.h> +#include <libkdepim/kpimglobalprefs.h> #include "koprefs.h" #include "mainwindow.h" const char *germanwords[][2] = { #include "wordsgerman.h" "", "" }; KOPrefs *KOPrefs::mInstance = 0; static KStaticDeleter<KOPrefs> insd; @@ -381,24 +382,25 @@ QStringList KOPrefs::getDefaultList() << 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(); return retval; } void KOPrefs::usrReadConfig() { + mPreferredLanguage = KPimGlobalPrefs::instance()->mPreferredLanguage; mLocaleDict = 0; // pending LR fix translation // qDebug("KOPrefs::usrReadConfig() fix translation "); if ( mPreferredLanguage > 0 && mPreferredLanguage < 4 ) { if ( mPreferredLanguage == 1 ) { mLocaleDict = new QDict<QString>; int i = 0; QString fw ( germanwords[i] [0]); while ( !fw.isEmpty() ) { mLocaleDict->insert( fw, new QString (germanwords[i] [1] )); ++i; fw = germanwords[i] [0]; diff --git a/korganizer/koprefsdialog.cpp b/korganizer/koprefsdialog.cpp index 7dafcd8..b4b3b27 100644 --- a/korganizer/koprefsdialog.cpp +++ b/korganizer/koprefsdialog.cpp @@ -72,28 +72,28 @@ KOPrefsDialog::KOPrefsDialog(QWidget *parent, char *name, bool modal) : KPrefsDialog(KOPrefs::instance(),parent,name,true) { setCaption( i18n("Preferences - some settings need a restart (nr)")); mCategoryDict.setAutoDelete(true); KGlobal::locale()->insertCatalogue("timezones"); setupGlobalTab(); setupMainTab(); - setupLocaleTab(); - setupTimeZoneTab(); + // setupLocaleTab(); + //setupTimeZoneTab(); setupTimeTab(); - setupLocaleDateTab(); + //setupLocaleDateTab(); setupFontsTab(); setupColorsTab(); setupViewsTab(); //setupSyncTab(); //setupSyncAlgTab(); //setupPrinterTab(); //setupGroupSchedulingTab(); //setupGroupAutomationTab(); } KOPrefsDialog::~KOPrefsDialog() @@ -101,24 +101,25 @@ KOPrefsDialog::~KOPrefsDialog() } void KOPrefsDialog::setupGlobalTab() { QFrame *topFrame = addPage(i18n("Global"),0,0); kdelibcfg = new KDEPIMConfigWidget( KPimGlobalPrefs::instance(), topFrame, "KCMKdeLibConfig" ); QVBoxLayout *topLayout = new QVBoxLayout(topFrame); topLayout->addWidget( kdelibcfg ); } void KOPrefsDialog::setupLocaleDateTab() { +#if 0 QFrame *topFrame = addPage(i18n("Date Format"),0,0); QGridLayout *topLayout = new QGridLayout(topFrame,3,2); topLayout->setSpacing(spacingHint()); topLayout->setMargin(marginHint()); int iii = 0; KPrefsDialogWidRadios *syncPrefsGroup = addWidRadios(i18n("Date Format:"),&(KOPrefs::instance()->mPreferredDate),topFrame); QString format; if ( QApplication::desktop()->width() < 480 ) format = "(%d.%m.%Y)"; @@ -150,29 +151,31 @@ QFrame *topFrame = addPage(i18n("Date Format"),0,0); topLayout->addWidget(lab ,iii,0); topLayout->addWidget(mUserDateFormatShort,iii,1); ++iii; lab = new QLabel( i18n("Monday 19 April 2004: %A %d %B %Y"), topFrame); topLayout->addMultiCellWidget(lab ,iii,iii,0,1); ++iii; lab = new QLabel( i18n("Mon 19.04.04: %a %d.%m.%y"), topFrame); topLayout->addMultiCellWidget(lab ,iii,iii,0,1); ++iii; lab = new QLabel( i18n("Mon, 19.Apr.04: %a, %d.%b.%y"), topFrame); topLayout->addMultiCellWidget(lab ,iii,iii,0,1); ++iii; +#endif } void KOPrefsDialog::setupLocaleTab() { +#if 0 QFrame *topFrame = addPage(i18n("Locale"),0,0); QGridLayout *topLayout = new QGridLayout(topFrame,4,2); topLayout->setSpacing(spacingHint()); topLayout->setMargin(marginHint()); int iii = 0; KPrefsDialogWidRadios *syncPrefsGroup = addWidRadios(i18n("Language:(needs restart)"),&(KOPrefs::instance()->mPreferredLanguage),topFrame); syncPrefsGroup->addRadio(i18n("English")); syncPrefsGroup->addRadio(i18n("German")); syncPrefsGroup->addRadio(i18n("French")); syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)")); if ( QApplication::desktop()->width() < 300 ) @@ -214,24 +217,25 @@ void KOPrefsDialog::setupLocaleTab() hbLayout->addWidget(sb->checkBox() ); topLayout->addMultiCellWidget(hb, iii,iii,0,1); } // KPrefsDialogWidBool *sb; //#ifndef DESKTOP_VERSION #if 0 ++iii; sb = addWidBool(i18n("Quick load/save (w/o Unicode)"), &(KOPrefs::instance()->mUseQuicksave),topFrame); topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1); #endif +#endif } void KOPrefsDialog::showSyncPage() { showPage ( 2 ) ; } void KOPrefsDialog::setupSyncAlgTab() { #if 0 QLabel * lab; QFrame *topFrame = addPage(i18n("Sync Prefs"),0,0); mSetupSyncAlgTab = topFrame; @@ -614,39 +618,24 @@ void KOPrefsDialog::setupViewsTab() KPrefsDialogWidBool *weeklyRecur = addWidBool(i18n("Show ev. that recur weekly in date nav."), &(KOPrefs::instance()->mWeeklyRecur),topFrame); topLayout->addWidget(weeklyRecur->checkBox(),ii++,0); if ( QApplication::desktop()->width() > 640 ) { KPrefsDialogWidBool *enableToolTips = addWidBool(i18n("Enable tooltips displaying summary of ev."), &(KOPrefs::instance()->mEnableToolTips),topFrame); topLayout->addWidget(enableToolTips->checkBox(),ii++,0); } - KPrefsDialogWidBool *passwdk = - addWidBool(i18n("Show parent To-Do's in What's Next view"), - &(KOPrefs::instance()->mWNViewShowsParents),topFrame); - topLayout->addWidget(passwdk->checkBox(), ii++,0); - - passwdk = - addWidBool(i18n("Show location in What's Next view"), - &(KOPrefs::instance()->mWNViewShowLocation),topFrame); - topLayout->addWidget(passwdk->checkBox(), ii++,0); - - passwdk = - addWidBool(i18n("Show Sync Events in WN/Agenda view"), - &(KOPrefs::instance()->mShowSyncEvents),topFrame); - topLayout->addWidget(passwdk->checkBox(), ii++,0); - KPrefsDialogWidBool *marcusBainsEnabled = addWidBool(i18n("Show Marcus Bains line"), &(KOPrefs::instance()->mMarcusBainsEnabled),topFrame); topLayout->addWidget(marcusBainsEnabled->checkBox(),ii++,0); // topLayout->addWidget(hourSizeGroup,ii++,0); // topLayout->addMultiCellWidget(hourSizeGroup,ii,ii,0,0); //topLayout->setRowStretch(11,1); @@ -790,24 +779,50 @@ void KOPrefsDialog::setupViewsTab() holidayColor = addWidColor(i18n("Day color even months"), &(KOPrefs::instance()->mMonthViewEvenColor),topFrame); topLayout->addWidget(holidayColor->label(),ii,0); topLayout->addWidget(holidayColor->button(),ii++,1); holidayColor = addWidColor(i18n("Color for Sundays + category \"Holiday\""), &(KOPrefs::instance()->mMonthViewHolidayColor),topFrame); topLayout->addWidget(holidayColor->label(),ii,0); topLayout->addWidget(holidayColor->button(),ii++,1); + // *********************** What'sNext View + topFrame = addPage(i18n("What's Next View"),0,0); + // DesktopIcon("viewmag",KIcon::SizeMedium)); + + topLayout = new QGridLayout(topFrame,4,1); + topLayout->setSpacing(spacingHint()); + topLayout->setMargin(marginHint()); + ii = 0; + KPrefsDialogWidBool *passwdk = + addWidBool(i18n("Show parent To-Do's in What's Next view"), + &(KOPrefs::instance()->mWNViewShowsParents),topFrame); + topLayout->addWidget(passwdk->checkBox(), ii++,0); + + passwdk = + addWidBool(i18n("Show location in What's Next view"), + &(KOPrefs::instance()->mWNViewShowLocation),topFrame); + topLayout->addWidget(passwdk->checkBox(), ii++,0); + + passwdk = + addWidBool(i18n("Show Sync Events in \nWhat's Next/Agenda view"), + &(KOPrefs::instance()->mShowSyncEvents),topFrame); + topLayout->addWidget(passwdk->checkBox(), ii++,0); + passwdk = + addWidBool(i18n("Use short date in \nWhat's Next/Event view"), + &(KOPrefs::instance()->mShortDateInViewer),topFrame); + topLayout->addMultiCellWidget(passwdk->checkBox(), ii,ii,0,1); // *********************** Todo View topFrame = addPage(i18n("Todo View"),0,0); // DesktopIcon("viewmag",KIcon::SizeMedium)); topLayout = new QGridLayout(topFrame,4,1); topLayout->setSpacing(spacingHint()); topLayout->setMargin(marginHint()); ii = 0; KPrefsDialogWidBool *showCompletedTodo = @@ -1327,28 +1342,28 @@ void KOPrefsDialog::setCombo(QComboBox *combo, const QString & text, } } } } void KOPrefsDialog::usrReadConfig() { kdelibcfg->readConfig(); mNameEdit->setText(KOPrefs::instance()->fullName()); mEmailEdit->setText(KOPrefs::instance()->email()); mAutoSaveIntervalSpin->setValue(KOPrefs::instance()->mAutoSaveInterval); - QDate current ( 2001, 1,1); - mStartDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingStart-1)); - mEndDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingEnd-1)); - setCombo(mTimeZoneCombo,i18n(KOPrefs::instance()->mTimeZoneId)); + // QDate current ( 2001, 1,1); + //mStartDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingStart-1)); + //mEndDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingEnd-1)); + //setCombo(mTimeZoneCombo,i18n(KOPrefs::instance()->mTimeZoneId)); //mTimezoneOffsetSpin->setValue( KOPrefs::instance()->mTimeZoneOffset); mStartTimeSpin->setValue(KOPrefs::instance()->mStartTime); mDefaultDurationSpin->setValue(KOPrefs::instance()->mDefaultDuration); mAlarmTimeCombo->setCurrentItem(KOPrefs::instance()->mAlarmTime); // if (KOPrefs::instance()->mAllDaySize > 47 ) // KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize/2; //mHourSizeSlider->setValue(KOPrefs::instance()->mAllDaySize); mNextXDaysSpin->setValue(KOPrefs::instance()->mNextXDays); mWhatsNextSpin->setValue(KOPrefs::instance()->mWhatsNextDays); mPrioSpin->setValue(KOPrefs::instance()->mWhatsNextPrios); // mAMails->clear(); @@ -1357,68 +1372,68 @@ void KOPrefsDialog::usrReadConfig() // QListViewItem *item = new QListViewItem(mAMails); // item->setText(0,*it); // mAMails->insertItem(item); // } // mRemoteIPEdit->setText(KOPrefs::instance()->mRemoteIP); //mRemoteUser->setText(KOPrefs::instance()->mRemoteUser); //mRemotePassWd->setText(KOPrefs::instance()->mRemotePassWd); //mRemoteFile->setText(KOPrefs::instance()->mRemoteFile); //that soundmLocalTempFile->setText(KOPrefs::instance()->mLocalTempFile); mDefaultAlarmFile->setText(KOPrefs::instance()->mDefaultAlarmFile); - QString dummy = KOPrefs::instance()->mUserDateFormatLong; - mUserDateFormatLong->setText(dummy.replace( QRegExp("K"), QString(",") )); - dummy = KOPrefs::instance()->mUserDateFormatShort; - mUserDateFormatShort->setText(dummy.replace( QRegExp("K"), QString(",") )); + //QString dummy = KOPrefs::instance()->mUserDateFormatLong; + //mUserDateFormatLong->setText(dummy.replace( QRegExp("K"), QString(",") )); + //dummy = KOPrefs::instance()->mUserDateFormatShort; + //mUserDateFormatShort->setText(dummy.replace( QRegExp("K"), QString(",") )); updateCategories(); mAlarmPlayBeeps->setValue(KOPrefs::instance()->mAlarmPlayBeeps ); mAlarmSuspendTime->setValue(KOPrefs::instance()->mAlarmSuspendTime ); mAlarmSuspendCount->setValue(KOPrefs::instance()->mAlarmSuspendCount ); mAlarmBeepInterval->setValue(KOPrefs::instance()->mAlarmBeepInterval ); } void KOPrefsDialog::usrWriteConfig() { kdelibcfg->writeConfig(); // KOPrefs::instance()->mRemoteIP = mRemoteIPEdit->text(); //KOPrefs::instance()->mRemoteUser = mRemoteUser->text(); //KOPrefs::instance()->mRemotePassWd = mRemotePassWd->text(); //KOPrefs::instance()->mRemoteFile= mRemoteFile->text(); //KOPrefs::instance()->mLocalTempFile =mLocalTempFile->text(); KOPrefs::instance()->mDefaultAlarmFile =mDefaultAlarmFile->text(); - KOPrefs::instance()->mUserDateFormatShort = mUserDateFormatShort->text().replace( QRegExp(","), QString("K") ); - KOPrefs::instance()->mUserDateFormatLong = mUserDateFormatLong->text().replace( QRegExp(","), QString("K") ); + //KOPrefs::instance()->mUserDateFormatShort = mUserDateFormatShort->text().replace( QRegExp(","), QString("K") ); + //KOPrefs::instance()->mUserDateFormatLong = mUserDateFormatLong->text().replace( QRegExp(","), QString("K") ); KOPrefs::instance()->setFullName(mNameEdit->text()); KOPrefs::instance()->setEmail(mEmailEdit->text()); KOPrefs::instance()->mAutoSaveInterval = mAutoSaveIntervalSpin->value(); - KOPrefs::instance()->mTimeZoneId = mTimeZoneCombo->currentText(); - QDate date; - date = mStartDateSavingEdit->date(); - int sub = 0; - if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 ) - sub = 1; - KOPrefs::instance()->mDaylightsavingStart = date.dayOfYear()-sub; - date = mEndDateSavingEdit->date(); - if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 ) - sub = 1; - else - sub = 0; - KOPrefs::instance()->mDaylightsavingEnd = date.dayOfYear()-sub; - // KOPrefs::instance()->mTimeZoneOffset = mTimezoneOffsetSpin->value(); + // KOPrefs::instance()->mTimeZoneId = mTimeZoneCombo->currentText(); + //QDate date; + //date = mStartDateSavingEdit->date(); + //int sub = 0; + //if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 ) + // sub = 1; +// KOPrefs::instance()->mDaylightsavingStart = date.dayOfYear()-sub; +// date = mEndDateSavingEdit->date(); +// if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 ) +// sub = 1; +// else +// sub = 0; +// KOPrefs::instance()->mDaylightsavingEnd = date.dayOfYear()-sub; +// // KOPrefs::instance()->mTimeZoneOffset = mTimezoneOffsetSpin->value(); KOPrefs::instance()->mStartTime = mStartTimeSpin->value(); KOPrefs::instance()->mDefaultDuration = mDefaultDurationSpin->value(); KOPrefs::instance()->mAlarmTime = mAlarmTimeCombo->currentItem(); //KOPrefs::instance()->mAllDaySize = mHourSizeSlider->value(); QDictIterator<QColor> it(mCategoryDict); while (it.current()) { KOPrefs::instance()->setCategoryColor(it.currentKey(),*it.current()); ++it; } @@ -1548,24 +1563,25 @@ void KOPrefsDialog::updateTimezoneOffset( int index ) mTimezoneOffsetSpin->setValue( KOPrefs::instance()->mTimeZoneOffset); } else { mTimezoneOffsetSpin->setEnabled ( false ); mTimezoneOffsetSpin->setValue( 0 ); } } */ } void KOPrefsDialog::setupTimeZoneTab() { +#if 0 QFrame *topFrame = addPage(i18n("Time Zone"),0,0); // DesktopIcon("clock",KIcon::SizeMedium)); QGridLayout *topLayout = new QGridLayout(topFrame,5,2); topLayout->setSpacing(spacingHint()); topLayout->setMargin(marginHint()); QHBox *timeZoneBox = new QHBox( topFrame ); topLayout->addMultiCellWidget( timeZoneBox, 0, 0, 0, 1 ); new QLabel( i18n("Timezone:"), timeZoneBox ); mTimeZoneCombo = new QComboBox( timeZoneBox ); @@ -1606,16 +1622,16 @@ void KOPrefsDialog::setupTimeZoneTab() mStartDateSavingEdit = new KDateEdit(topFrame); topLayout->addWidget(mStartDateSavingEdit, iii,1); ++iii; lab = new QLabel( i18n("Daylight end:"), topFrame ); topLayout->addWidget(lab, iii,0); mEndDateSavingEdit = new KDateEdit(topFrame); topLayout->addWidget(mEndDateSavingEdit, iii,1); ++iii; QDate current ( 2001, 1,1); mStartDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingStart-1)); mEndDateSavingEdit->setDate(current.addDays(KOPrefs::instance()->mDaylightsavingEnd-1)); - +#endif } diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index b597a6a..1c4a186 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp @@ -25,24 +25,25 @@ #include <qtopia/qcopenvelope_qws.h> #else #include <qmenubar.h> #include <qtoolbar.h> #include <qapplication.h> //#include <resource.h> #endif #include <libkcal/calendarlocal.h> #include <libkcal/todo.h> #include <libkdepim/ksyncprofile.h> #include <libkcal/kincidenceformatter.h> +#include <libkdepim/kpimglobalprefs.h> #include "calendarview.h" #include "koviewmanager.h" #include "datenavigator.h" #include "koagendaview.h" #include "koagenda.h" #include "kodialogmanager.h" #include "kdialogbase.h" #include "kapplication.h" #include "kofilterview.h" #include "kstandarddirs.h" #include "koprefs.h" @@ -72,24 +73,25 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) : #endif mClosed = false; //QString confFile = KStandardDirs::appDir() + "config/korganizerrc"; QString confFile = locateLocal("config","korganizerrc"); QFileInfo finf ( confFile ); bool showWarning = !finf.exists(); setIcon(SmallIcon( "ko24" ) ); mBlockAtStartup = true; mFlagKeyPressed = false; setCaption("KOrganizer/Pi"); KOPrefs *p = KOPrefs::instance(); + KPimGlobalPrefs::instance()->setGlobalConfig(); // if ( QApplication::desktop()->height() > 480 ) { // if ( p->mHourSize == 4 ) // p->mHourSize = 6; // } if ( p->mHourSize > 18 ) p->mHourSize = 18; QMainWindow::ToolBarDock tbd; if ( p->mToolBarHor ) { if ( p->mToolBarUp ) tbd = Bottom; else tbd = Top; diff --git a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp index 00a07d9..2819ab1 100644 --- a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp +++ b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp @@ -735,25 +735,25 @@ void KDEPIMConfigWidget::usrWriteConfig() prefs->mPagerOtherChannel = mPagerOtherChannel; prefs->mPagerOtherMessage = mPagerOtherMessage; prefs->mPagerOtherMessageParameters = mPagerOtherMessageParameters; prefs->mSipClient = mSipClient; prefs->mSipOtherChannel = mSipOtherChannel; prefs->mSipOtherMessage = mSipOtherMessage; prefs->mSipOtherMessageParameters = mSipOtherMessageParameters; //release the cache that other views can access the changed values instantanious ExternalAppHandler::instance()->loadConfig(); - + KPimGlobalPrefs::instance()->setGlobalConfig(); } void KDEPIMConfigWidget::setCombo(QComboBox *combo, const QString & text, const QStringList *tags) { if (tags) { int i = tags->findIndex(text); if (i > 0) combo->setCurrentItem(i); } else { for(int i=0;i<combo->count();++i) { if (combo->text(i) == text) { diff --git a/libkdepim/kpimglobalprefs.cpp b/libkdepim/kpimglobalprefs.cpp index 12a503d..a896a0f 100644 --- a/libkdepim/kpimglobalprefs.cpp +++ b/libkdepim/kpimglobalprefs.cpp @@ -91,24 +91,41 @@ KPimGlobalPrefs::KPimGlobalPrefs( const QString &name ) addItemInt( "PagerChannelType", &mPagerClient, NONE_PAC ); addItemString( "PagerChannel", &mPagerOtherChannel, "" ); addItemString( "PagerChannelMessage", &mPagerOtherMessage, "" ); addItemString( "PagerChannelParameters", &mPagerOtherMessageParameters, "" ); addItemInt( "SIPChannelType", &mSipClient, NONE_SIC ); addItemString( "SIPChannel", &mSipOtherChannel, "" ); addItemString( "SIPChannelMessage", &mSipOtherMessage, "" ); addItemString( "SIPChannelParameters", &mSipOtherMessageParameters, "" ); } +void KPimGlobalPrefs::setGlobalConfig() +{ + + KGlobal::locale()->setHore24Format( !mPreferredTime ); + KGlobal::locale()->setWeekStartMonday( !mWeekStartsOnSunday ); + KGlobal::locale()->setIntDateFormat( (KLocale::IntDateFormat)mPreferredDate ); + KGlobal::locale()->setLanguage( mPreferredLanguage ); + QString dummy = mUserDateFormatLong; + KGlobal::locale()->setDateFormat(dummy.replace( QRegExp("K"), QString(",") )); + dummy = mUserDateFormatShort; + KGlobal::locale()->setDateFormatShort(dummy.replace( QRegExp("K"), QString(",") )); + KGlobal::locale()->setDaylightSaving( mUseDaylightsaving, + mDaylightsavingStart, + mDaylightsavingEnd ); + KGlobal::locale()->setTimezone( mTimeZoneId ); + +} KPimGlobalPrefs::~KPimGlobalPrefs() { } KPimGlobalPrefs *KPimGlobalPrefs::instance() { if ( !sInstance ) { sInstance = staticDeleter.setObject( new KPimGlobalPrefs() ); sInstance->readConfig(); } return sInstance; diff --git a/libkdepim/kpimglobalprefs.h b/libkdepim/kpimglobalprefs.h index dad78e6..84ba689 100644 --- a/libkdepim/kpimglobalprefs.h +++ b/libkdepim/kpimglobalprefs.h @@ -28,24 +28,25 @@ Copyright (c) 2004 Ulf Schenk $Id$ */ #ifndef KPIMGLOBALPREFS_H #define KPIMGLOBALPREFS_H #include "kprefs.h" class KPimGlobalPrefs : public KPrefs { public: + void setGlobalConfig(); static KPimGlobalPrefs *instance(); virtual ~KPimGlobalPrefs(); enum EMailClients { NONE_EMC = 0, OTHER_EMC = 1, OMPI_EMC = 2, QTOPIA_EMC = 3, OPIE_EMC = 4 @@ -87,27 +88,24 @@ class KPimGlobalPrefs : public KPrefs //US I copied the following "locale" settings from KOPrefs int mPreferredDate; QString mUserDateFormatLong; QString mUserDateFormatShort; int mPreferredLanguage; int mPreferredTime; bool mWeekStartsOnSunday; QString mTimeZoneId; bool mUseDaylightsaving; int mDaylightsavingStart; int mDaylightsavingEnd; - - - int mEmailClient; QString mEmailOtherChannel; QString mEmailOtherMessage; QString mEmailOtherMessageParameters; QString mEmailOtherMessage2; QString mEmailOtherMessageParameters2; int mPhoneClient; QString mPhoneOtherChannel; QString mPhoneOtherMessage; QString mPhoneOtherMessageParameters; |