summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2004-09-22 03:08:05 (UTC)
committer zautrix <zautrix>2004-09-22 03:08:05 (UTC)
commitd63eac7a612a9724705bc58ad98c65c6ac052d07 (patch) (side-by-side diff)
treedc584a0ddcbd5f828ea36b86b6af640e46e137f2
parent633522024e48efc423155a04b71083a03696211d (diff)
downloadkdepimpi-d63eac7a612a9724705bc58ad98c65c6ac052d07.zip
kdepimpi-d63eac7a612a9724705bc58ad98c65c6ac052d07.tar.gz
kdepimpi-d63eac7a612a9724705bc58ad98c65c6ac052d07.tar.bz2
connected global config
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/mainembedded.cpp15
-rw-r--r--kmicromail/libmailwrapper/genericwrapper.cpp18
-rw-r--r--kmicromail/opiemail.cpp2
-rw-r--r--korganizer/calendarview.cpp6
-rw-r--r--korganizer/koprefs.cpp2
-rw-r--r--korganizer/koprefsdialog.cpp106
-rw-r--r--korganizer/mainwindow.cpp2
-rw-r--r--libkdepim/kcmconfigs/kdepimconfigwidget.cpp2
-rw-r--r--libkdepim/kpimglobalprefs.cpp17
-rw-r--r--libkdepim/kpimglobalprefs.h4
10 files changed, 93 insertions, 81 deletions
diff --git a/kaddressbook/mainembedded.cpp b/kaddressbook/mainembedded.cpp
index 10b1013..965fb06 100644
--- a/kaddressbook/mainembedded.cpp
+++ b/kaddressbook/mainembedded.cpp
@@ -16,4 +16,5 @@
#include "kaddressbookmain.h"
#include "externalapphandler.h"
+#include <libkdepim/kpimglobalprefs.h>
int main( int argc, char **argv )
@@ -74,17 +75,5 @@ int main( int argc, char **argv )
{
- 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
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
@@ -30,23 +30,5 @@ Genericwrapper::~Genericwrapper()
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 );
diff --git a/kmicromail/opiemail.cpp b/kmicromail/opiemail.cpp
index 9a1a750..164988c 100644
--- a/kmicromail/opiemail.cpp
+++ b/kmicromail/opiemail.cpp
@@ -16,4 +16,5 @@
#include <qtimer.h>
#include <libkdepim/externalapphandler.h>
+#include <libkdepim/kpimglobalprefs.h>
#include <qpe/qpeapplication.h>
@@ -33,4 +34,5 @@ OpieMail::OpieMail( QWidget *parent, const char *name )
{
settings = new Settings();
+ KPimGlobalPrefs::instance()->setGlobalConfig();
folderView->populate( settings->getAccounts() );
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index bc8625d..3635cfa 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -64,4 +64,5 @@
#include <libkdepim/kdatepicker.h>
#include <libkdepim/ksyncprofile.h>
+#include <libkdepim/kpimglobalprefs.h>
#include <libkcal/vcaldrag.h>
@@ -1885,6 +1886,8 @@ void CalendarView::goPreviousMonth()
mNavigator->selectPreviousMonth();
}
-void CalendarView::writeLocale()
+void CalendarView::writeLocale()
{
+ //KPimGlobalPrefs::instance()->setGlobalConfig();
+#if 0
KGlobal::locale()->setHore24Format( !KOPrefs::instance()->mPreferredTime );
KGlobal::locale()->setWeekStartMonday( !KOPrefs::instance()->mWeekStartsOnSunday );
@@ -1899,4 +1902,5 @@ void CalendarView::writeLocale()
KOPrefs::instance()->mDaylightsavingEnd );
KGlobal::locale()->setTimezone( KOPrefs::instance()->mTimeZoneId );
+#endif
}
void CalendarView::updateConfig()
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp
index dd978bf..5d7db4f 100644
--- a/korganizer/koprefs.cpp
+++ b/korganizer/koprefs.cpp
@@ -42,4 +42,5 @@
#include <kemailsettings.h>
#include <kstaticdeleter.h>
+#include <libkdepim/kpimglobalprefs.h>
#include "koprefs.h"
@@ -391,4 +392,5 @@ QStringList KOPrefs::getDefaultList()
void KOPrefs::usrReadConfig()
{
+ mPreferredLanguage = KPimGlobalPrefs::instance()->mPreferredLanguage;
mLocaleDict = 0;
// pending LR fix translation
diff --git a/korganizer/koprefsdialog.cpp b/korganizer/koprefsdialog.cpp
index 7dafcd8..b4b3b27 100644
--- a/korganizer/koprefsdialog.cpp
+++ b/korganizer/koprefsdialog.cpp
@@ -82,8 +82,8 @@ KOPrefsDialog::KOPrefsDialog(QWidget *parent, char *name, bool modal) :
setupGlobalTab();
setupMainTab();
- setupLocaleTab();
- setupTimeZoneTab();
+ // setupLocaleTab();
+ //setupTimeZoneTab();
setupTimeTab();
- setupLocaleDateTab();
+ //setupLocaleDateTab();
setupFontsTab();
setupColorsTab();
@@ -111,4 +111,5 @@ void KOPrefsDialog::setupGlobalTab()
void KOPrefsDialog::setupLocaleDateTab()
{
+#if 0
QFrame *topFrame = addPage(i18n("Date Format"),0,0);
QGridLayout *topLayout = new QGridLayout(topFrame,3,2);
@@ -160,4 +161,5 @@ QFrame *topFrame = addPage(i18n("Date Format"),0,0);
topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
++iii;
+#endif
}
@@ -165,4 +167,5 @@ QFrame *topFrame = addPage(i18n("Date Format"),0,0);
void KOPrefsDialog::setupLocaleTab()
{
+#if 0
QFrame *topFrame = addPage(i18n("Locale"),0,0);
QGridLayout *topLayout = new QGridLayout(topFrame,4,2);
@@ -224,4 +227,5 @@ void KOPrefsDialog::setupLocaleTab()
topLayout->addMultiCellWidget(sb->checkBox(), iii,iii,0,1);
#endif
+#endif
}
void KOPrefsDialog::showSyncPage()
@@ -624,20 +628,5 @@ void KOPrefsDialog::setupViewsTab()
}
- 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"),
@@ -800,5 +789,31 @@ void KOPrefsDialog::setupViewsTab()
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
@@ -1337,8 +1352,8 @@ void KOPrefsDialog::usrReadConfig()
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);
@@ -1367,8 +1382,8 @@ void KOPrefsDialog::usrReadConfig()
//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 );
@@ -1390,6 +1405,6 @@ void KOPrefsDialog::usrWriteConfig()
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());
@@ -1397,18 +1412,18 @@ void KOPrefsDialog::usrWriteConfig()
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();
@@ -1558,4 +1573,5 @@ void KOPrefsDialog::updateTimezoneOffset( int index )
void KOPrefsDialog::setupTimeZoneTab()
{
+#if 0
QFrame *topFrame = addPage(i18n("Time Zone"),0,0);
// DesktopIcon("clock",KIcon::SizeMedium));
@@ -1616,5 +1632,5 @@ void KOPrefsDialog::setupTimeZoneTab()
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
@@ -35,4 +35,5 @@
#include <libkdepim/ksyncprofile.h>
#include <libkcal/kincidenceformatter.h>
+#include <libkdepim/kpimglobalprefs.h>
#include "calendarview.h"
@@ -82,4 +83,5 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) :
setCaption("KOrganizer/Pi");
KOPrefs *p = KOPrefs::instance();
+ KPimGlobalPrefs::instance()->setGlobalConfig();
// if ( QApplication::desktop()->height() > 480 ) {
// if ( p->mHourSize == 4 )
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
@@ -745,5 +745,5 @@ void KDEPIMConfigWidget::usrWriteConfig()
//release the cache that other views can access the changed values instantanious
ExternalAppHandler::instance()->loadConfig();
-
+ KPimGlobalPrefs::instance()->setGlobalConfig();
}
diff --git a/libkdepim/kpimglobalprefs.cpp b/libkdepim/kpimglobalprefs.cpp
index 12a503d..a896a0f 100644
--- a/libkdepim/kpimglobalprefs.cpp
+++ b/libkdepim/kpimglobalprefs.cpp
@@ -101,4 +101,21 @@ KPimGlobalPrefs::KPimGlobalPrefs( const QString &name )
}
+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()
{
diff --git a/libkdepim/kpimglobalprefs.h b/libkdepim/kpimglobalprefs.h
index dad78e6..84ba689 100644
--- a/libkdepim/kpimglobalprefs.h
+++ b/libkdepim/kpimglobalprefs.h
@@ -38,4 +38,5 @@ class KPimGlobalPrefs : public KPrefs
public:
+ void setGlobalConfig();
static KPimGlobalPrefs *instance();
@@ -97,7 +98,4 @@ class KPimGlobalPrefs : public KPrefs
int mDaylightsavingEnd;
-
-
-
int mEmailClient;
QString mEmailOtherChannel;