summaryrefslogtreecommitdiffabout
authorulf69 <ulf69>2004-09-21 19:50:27 (UTC)
committer ulf69 <ulf69>2004-09-21 19:50:27 (UTC)
commit93313aa8d66c01aa0e4562449020af20b5cef0a7 (patch) (side-by-side diff)
tree7bf9930c58b4651a29b5aa4210742340c9439bc8
parentc2cce86fdb2d0b291c3d3bdfa9fac47452153d1a (diff)
downloadkdepimpi-93313aa8d66c01aa0e4562449020af20b5cef0a7.zip
kdepimpi-93313aa8d66c01aa0e4562449020af20b5cef0a7.tar.gz
kdepimpi-93313aa8d66c01aa0e4562449020af20b5cef0a7.tar.bz2
added edit elements for global prefs
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libkdepim/kcmconfigs/kcmkdepimconfig.cpp17
-rw-r--r--libkdepim/kcmconfigs/kcmkdepimconfig.h2
-rw-r--r--libkdepim/kcmconfigs/kdepimconfigwidget.cpp313
-rw-r--r--libkdepim/kcmconfigs/kdepimconfigwidget.h45
-rw-r--r--libkdepim/kpimglobalprefs.cpp21
-rw-r--r--libkdepim/kpimglobalprefs.h15
-rw-r--r--libkdepim/kpimprefs.cpp6
-rw-r--r--libkdepim/kpimprefs.h2
-rw-r--r--libkdepim/kprefsdialog.cpp106
-rw-r--r--libkdepim/kprefsdialog.h70
-rw-r--r--libkdepim/libkdepimE.pro2
11 files changed, 410 insertions, 189 deletions
diff --git a/libkdepim/kcmconfigs/kcmkdepimconfig.cpp b/libkdepim/kcmconfigs/kcmkdepimconfig.cpp
index f26efe0..e77c5ab 100644
--- a/libkdepim/kcmconfigs/kcmkdepimconfig.cpp
+++ b/libkdepim/kcmconfigs/kcmkdepimconfig.cpp
@@ -46,4 +46,4 @@ extern "C"
{
- KCModule *create_kabconfig( KPimGlobalPrefs* prefs, QWidget *parent, const char * ) {
- return new KCMKdePimConfig( prefs, parent, "kcmkdepimconfig" );
+ KCModule *create_kabconfig(QWidget *parent, const char * ) {
+ return new KCMKdePimConfig(parent, "kcmkdepimconfig" );
}
@@ -52,4 +52,4 @@ extern "C"
-KCMKdePimConfig::KCMKdePimConfig( KPimGlobalPrefs* prefs, QWidget *parent, const char *name )
- : KCModule( prefs, parent, name )
+KCMKdePimConfig::KCMKdePimConfig(QWidget *parent, const char *name )
+ : KCModule( KPimGlobalPrefs::instance(), parent, name )
{
@@ -57,3 +57,3 @@ KCMKdePimConfig::KCMKdePimConfig( KPimGlobalPrefs* prefs, QWidget *parent, const
QVBoxLayout *layout = new QVBoxLayout( this );
- mConfigWidget = new KDEPIMConfigWidget( this, "mConfigWidget" );
+ mConfigWidget = new KDEPIMConfigWidget( (KPimGlobalPrefs*)getPreferences(), this, "KDEPIMConfigWidget" );
layout->addWidget( mConfigWidget );
@@ -67,3 +67,3 @@ void KCMKdePimConfig::load()
{
- mConfigWidget->restoreSettings((KPimGlobalPrefs*)getPreferences());
+ mConfigWidget->readConfig();
}
@@ -72,3 +72,3 @@ void KCMKdePimConfig::save()
{
- mConfigWidget->saveSettings((KPimGlobalPrefs*)getPreferences());
+ mConfigWidget->writeConfig();
}
@@ -77,3 +77,4 @@ void KCMKdePimConfig::defaults()
{
- mConfigWidget->defaults((KPimGlobalPrefs*)getPreferences());
+ qDebug("KCMKdePimConfig::defaults()");
+ mConfigWidget->setDefaults();
}
diff --git a/libkdepim/kcmconfigs/kcmkdepimconfig.h b/libkdepim/kcmconfigs/kcmkdepimconfig.h
index fa96eda..b471e53 100644
--- a/libkdepim/kcmconfigs/kcmkdepimconfig.h
+++ b/libkdepim/kcmconfigs/kcmkdepimconfig.h
@@ -43,3 +43,3 @@ class KCMKdePimConfig : public KCModule
public:
- KCMKdePimConfig( KPimGlobalPrefs* prefs, QWidget *parent = 0, const char *name = 0 );
+ KCMKdePimConfig( QWidget *parent = 0, const char *name = 0 );
diff --git a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
index 703aeb1..00a07d9 100644
--- a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
+++ b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
@@ -36,2 +36,3 @@ $Id$
#include <qlineedit.h>
+#include <qbuttongroup.h>
#include <qfile.h>
@@ -40,3 +41,4 @@ $Id$
#include <klocale.h>
-
+#include <kdateedit.h>
+#include <kglobal.h>
#include <stdlib.h>
@@ -73,2 +75,4 @@ $Id$
+#include "qapplication.h"
+
#include "kpimglobalprefs.h"
@@ -78,4 +82,4 @@ $Id$
-KDEPIMConfigWidget::KDEPIMConfigWidget( QWidget *parent, const char *name )
- : QWidget( parent, name )
+KDEPIMConfigWidget::KDEPIMConfigWidget(KPimGlobalPrefs *prefs, QWidget *parent, const char *name )
+ : KPrefsWidget(prefs, parent, name )
{
@@ -92,3 +96,3 @@ KDEPIMConfigWidget::KDEPIMConfigWidget( QWidget *parent, const char *name )
- QTabWidget *tabWidget = new QTabWidget( this );
+ tabWidget = new QTabWidget( this );
topLayout->addWidget( tabWidget );
@@ -96,4 +100,11 @@ KDEPIMConfigWidget::KDEPIMConfigWidget( QWidget *parent, const char *name )
+ setupLocaleTab();
+ setupLocaleDateTab();
+ setupTimeZoneTab();
+ setupExternalAppTab();
+
+}
- // mailclient page
+void KDEPIMConfigWidget::setupExternalAppTab()
+{
QWidget *externalAppsPage = new QWidget( this );
@@ -114,4 +125,2 @@ KDEPIMConfigWidget::KDEPIMConfigWidget( QWidget *parent, const char *name )
-
-
mExternalAppGroupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Used Mail Client" ), externalAppsPage );
@@ -170,3 +179,2 @@ KDEPIMConfigWidget::KDEPIMConfigWidget( QWidget *parent, const char *name )
-
layout->addWidget( mExternalAppGroupBox );
@@ -176,2 +184,173 @@ KDEPIMConfigWidget::KDEPIMConfigWidget( QWidget *parent, const char *name )
+
+void KDEPIMConfigWidget::setupLocaleDateTab()
+{
+ QWidget *topFrame = new QWidget( this );
+ QGridLayout *topLayout = new QGridLayout( topFrame, 3, 2);
+
+ topLayout->setSpacing(KDialog::spacingHint());
+ topLayout->setMargin(KDialog::marginHint());
+ int iii = 0;
+
+
+ KPrefsWidRadios *syncPrefsGroup =
+ addWidRadios(i18n("Date Format:"),&(KPimGlobalPrefs::instance()->mPreferredDate),topFrame);
+ QString format;
+ if ( QApplication::desktop()->width() < 480 )
+ format = "(%d.%m.%Y)";
+ else
+ format = "(%d.%m.%Y|%A %d %B %Y)";
+ syncPrefsGroup->addRadio(i18n("24.03.2004 "+format));
+ if ( QApplication::desktop()->width() < 480 )
+ format = "(%m.%d.%Y)";
+ else
+ format = "(%m.%d.%Y|%A %B %d %Y)";
+ syncPrefsGroup->addRadio(i18n("03.24.2004 "+format));
+ if ( QApplication::desktop()->width() < 480 )
+ format = "(%Y-%m-%d)";
+ else
+ format = "(%Y-%m-%d|%A %Y %B %d)";
+ syncPrefsGroup->addRadio(i18n("2004-03-24 "+format));
+ syncPrefsGroup->addRadio(i18n("User defined"));
+ topLayout->addMultiCellWidget( (QWidget*)syncPrefsGroup->groupBox(),iii,iii,0,1);
+ ++iii;
+ ++iii;
+ QLabel * lab;
+ mUserDateFormatLong = new QLineEdit(topFrame);
+ lab = new QLabel(mUserDateFormatLong, i18n("User long date:"), topFrame);
+ topLayout->addWidget(lab ,iii,0);
+ topLayout->addWidget(mUserDateFormatLong,iii,1);
+ ++iii;
+ mUserDateFormatShort = new QLineEdit(topFrame);
+ lab = new QLabel(mUserDateFormatShort, i18n("User short date:"), topFrame);
+ 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;
+
+ connect( mUserDateFormatLong, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
+ connect( mUserDateFormatShort, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
+
+
+ tabWidget->addTab( topFrame, i18n( "Date Format" ) );
+}
+
+void KDEPIMConfigWidget::setupLocaleTab()
+{
+
+ QWidget *topFrame = new QWidget( this );
+ QGridLayout *topLayout = new QGridLayout(topFrame,4,2);
+
+ topLayout->setSpacing(KDialog::spacingHint());
+ topLayout->setMargin(KDialog::marginHint());
+ int iii = 0;
+ KPrefsWidRadios *syncPrefsGroup =
+ addWidRadios(i18n("Language:(needs restart)"),&(KPimGlobalPrefs::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 )
+ ;// syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical);
+ topLayout->addMultiCellWidget( (QWidget*)syncPrefsGroup->groupBox(),iii,iii,0,1);
+ ++iii;
+
+ syncPrefsGroup =
+ addWidRadios(i18n("Time Format(nr):"),&(KPimGlobalPrefs::instance()->mPreferredTime),topFrame);
+ if ( QApplication::desktop()->width() > 300 )
+ syncPrefsGroup->groupBox()->setOrientation (Qt::Vertical);
+ syncPrefsGroup->addRadio(i18n("24:00"));
+ syncPrefsGroup->addRadio(i18n("12:00am"));
+ syncPrefsGroup->groupBox()->setOrientation (Qt::Vertical);
+ topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1);
+ ++iii;
+
+ KPrefsWidBool *sb = addWidBool(i18n("Week starts on Sunday"),
+ &(KPimGlobalPrefs::instance()->mWeekStartsOnSunday),topFrame);
+ topLayout->addMultiCellWidget((QWidget*)sb->checkBox(), iii,iii,0,1);
+ ++iii;
+
+
+ tabWidget->addTab( topFrame, i18n( "Locale" ) );
+
+}
+
+
+void KDEPIMConfigWidget::setupTimeZoneTab()
+{
+ QWidget *topFrame = new QWidget( this );
+ QGridLayout *topLayout = new QGridLayout( topFrame, 5, 2);
+ topLayout->setSpacing(KDialog::spacingHint());
+ topLayout->setMargin(KDialog::marginHint());
+
+ QHBox *timeZoneBox = new QHBox( topFrame );
+ topLayout->addMultiCellWidget( timeZoneBox, 0, 0, 0, 1 );
+
+ new QLabel( i18n("Timezone:"), timeZoneBox );
+ mTimeZoneCombo = new QComboBox( timeZoneBox );
+ if ( QApplication::desktop()->width() < 300 ) {
+ mTimeZoneCombo->setMaximumWidth(150);
+ }
+
+ QStringList list;
+ list = KGlobal::locale()->timeZoneList();
+ mTimeZoneCombo->insertStringList(list);
+
+ // find the currently set time zone and select it
+ QString sCurrentlySet = KPimGlobalPrefs::instance()->mTimeZoneId;
+ int nCurrentlySet = 11;
+ for (int i = 0; i < mTimeZoneCombo->count(); i++)
+ {
+ if (mTimeZoneCombo->text(i) == sCurrentlySet)
+ {
+ nCurrentlySet = i;
+ break;
+ }
+ }
+ mTimeZoneCombo->setCurrentItem(nCurrentlySet);
+ int iii = 1;
+ KPrefsWidBool *sb =
+ addWidBool(i18n("Timezone has daylight saving"),
+ &(KPimGlobalPrefs::instance()->mUseDaylightsaving),topFrame);
+ topLayout->addMultiCellWidget((QWidget*)sb->checkBox(), iii,iii,0,1);
+ ++iii;
+ QLabel* lab = new QLabel( i18n("Actual start and end is the\nsunday before this date."), topFrame );
+ topLayout->addMultiCellWidget(lab, iii,iii,0,1);
+ ++iii;
+ lab = new QLabel( i18n("The year in the date is ignored."), topFrame );
+ topLayout->addMultiCellWidget(lab, iii,iii,0,1);
+ ++iii;
+ lab = new QLabel( i18n("Daylight start:"), topFrame );
+ topLayout->addWidget(lab, iii,0);
+ 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(KPimGlobalPrefs::instance()->mDaylightsavingStart-1));
+ mEndDateSavingEdit->setDate(current.addDays(KPimGlobalPrefs::instance()->mDaylightsavingEnd-1));
+
+ connect( mStartDateSavingEdit, SIGNAL( dateChanged(QDate)), this, SLOT( modified()) );
+ connect( mEndDateSavingEdit, SIGNAL( dateChanged(QDate)), this, SLOT( modified()) );
+ connect( mTimeZoneCombo, SIGNAL( activated( int ) ), this, SLOT (modified() ) );
+
+
+
+ tabWidget->addTab( topFrame, i18n( "Time Zone" ) );
+
+}
+
void KDEPIMConfigWidget::externalapp_changed( int newApp )
@@ -230,3 +409,3 @@ void KDEPIMConfigWidget::client_changed( int newClient )
- modified();
+ KPrefsWidget::modified();
}
@@ -446,7 +625,6 @@ void KDEPIMConfigWidget::updateClientWidgets()
-
-
-
-void KDEPIMConfigWidget::restoreSettings(KPimGlobalPrefs* prefs)
+void KDEPIMConfigWidget::usrReadConfig()
{
+ KPimGlobalPrefs* prefs = KPimGlobalPrefs::instance();
+
bool blocked = signalsBlocked();
@@ -454,2 +632,15 @@ void KDEPIMConfigWidget::restoreSettings(KPimGlobalPrefs* prefs)
+ QString dummy = prefs->mUserDateFormatLong;
+ mUserDateFormatLong->setText(dummy.replace( QRegExp("K"), QString(",") ));
+ dummy = prefs->mUserDateFormatShort;
+ mUserDateFormatShort->setText(dummy.replace( QRegExp("K"), QString(",") ));
+
+ QDate current ( 2001, 1,1);
+ mStartDateSavingEdit->setDate(current.addDays(prefs->mDaylightsavingStart-1));
+ mEndDateSavingEdit->setDate(current.addDays(prefs->mDaylightsavingEnd-1));
+ setCombo(mTimeZoneCombo,i18n(prefs->mTimeZoneId));
+
+
+
+
mEmailClient = prefs->mEmailClient;
@@ -493,10 +684,29 @@ void KDEPIMConfigWidget::restoreSettings(KPimGlobalPrefs* prefs)
- emit changed( false );
-
}
-void KDEPIMConfigWidget::saveSettings(KPimGlobalPrefs* prefs)
+void KDEPIMConfigWidget::usrWriteConfig()
{
+ KPimGlobalPrefs* prefs = KPimGlobalPrefs::instance();
+
saveEditFieldSettings();
+
+ prefs->mUserDateFormatShort = mUserDateFormatShort->text().replace( QRegExp(","), QString("K") );
+ prefs->mUserDateFormatLong = mUserDateFormatLong->text().replace( QRegExp(","), QString("K") );
+
+ prefs->mTimeZoneId = mTimeZoneCombo->currentText();
+ QDate date;
+ date = mStartDateSavingEdit->date();
+ int sub = 0;
+ if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 )
+ sub = 1;
+ prefs->mDaylightsavingStart = date.dayOfYear()-sub;
+ date = mEndDateSavingEdit->date();
+ if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 )
+ sub = 1;
+ else
+ sub = 0;
+ prefs->mDaylightsavingEnd = date.dayOfYear()-sub;
+
+
prefs->mEmailClient = mEmailClient;
@@ -534,4 +744,2 @@ void KDEPIMConfigWidget::saveSettings(KPimGlobalPrefs* prefs)
- prefs->writeConfig();
-
//release the cache that other views can access the changed values instantanious
@@ -539,63 +747,22 @@ void KDEPIMConfigWidget::saveSettings(KPimGlobalPrefs* prefs)
- emit changed( false );
}
-void KDEPIMConfigWidget::defaults(KPimGlobalPrefs* prefs)
-{
-
- DefaultAppItem* dai = ExternalAppHandler::instance()->getDefaultItem(ExternalAppHandler::EMAIL, KPimGlobalPrefs::NONE_EMC);
-
- mEmailClient = dai->_id;
- mEmailOtherChannel = dai->_channel;
- mEmailOtherMessage = dai->_message;
- mEmailOtherMessageParameters = dai->_parameters;
- mEmailOtherMessage2 = dai->_message2;
- mEmailOtherMessageParameters2 = dai->_parameters2;
-
-
- dai = ExternalAppHandler::instance()->getDefaultItem(ExternalAppHandler::PHONE, KPimGlobalPrefs::NONE_PHC);
-
- mPhoneClient = dai->_id;
- mPhoneOtherChannel = dai->_channel;
- mPhoneOtherMessage = dai->_message;
- mPhoneOtherMessageParameters = dai->_parameters;
-
- dai = ExternalAppHandler::instance()->getDefaultItem(ExternalAppHandler::FAX, KPimGlobalPrefs::NONE_FAC);
-
- mFaxClient = dai->_id;
- mFaxOtherChannel = dai->_channel;
- mFaxOtherMessage = dai->_message;
- mFaxOtherMessageParameters = dai->_parameters;
- dai = ExternalAppHandler::instance()->getDefaultItem(ExternalAppHandler::SMS, KPimGlobalPrefs::NONE_SMC);
-
- mSMSClient = dai->_id;
- mSMSOtherChannel = dai->_channel;
- mSMSOtherMessage = dai->_message;
- mSMSOtherMessageParameters = dai->_parameters;
-
- dai = ExternalAppHandler::instance()->getDefaultItem(ExternalAppHandler::PAGER, KPimGlobalPrefs::NONE_PAC);
-
- mPagerClient = dai->_id;
- mPagerOtherChannel = dai->_channel;
- mPagerOtherMessage = dai->_message;
- mPagerOtherMessageParameters = dai->_parameters;
-
-
- dai = ExternalAppHandler::instance()->getDefaultItem(ExternalAppHandler::SIP, KPimGlobalPrefs::NONE_SIC);
-
- mSipClient = dai->_id;
- mSipOtherChannel = dai->_channel;
- mSipOtherMessage = dai->_message;
- mSipOtherMessageParameters = dai->_parameters;
-
-
- emit changed( true );
-}
-
-void KDEPIMConfigWidget::modified()
+void KDEPIMConfigWidget::setCombo(QComboBox *combo, const QString & text,
+ const QStringList *tags)
{
- emit changed( true );
+ 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) {
+ combo->setCurrentItem(i);
+ break;
+ }
+ }
+ }
}
+
void KDEPIMConfigWidget::textChanged( const QString& text )
diff --git a/libkdepim/kcmconfigs/kdepimconfigwidget.h b/libkdepim/kcmconfigs/kdepimconfigwidget.h
index e3cfd81..6f26513 100644
--- a/libkdepim/kcmconfigs/kdepimconfigwidget.h
+++ b/libkdepim/kcmconfigs/kdepimconfigwidget.h
@@ -33,3 +33,3 @@ $Id$
-#include <qwidget.h>
+#include <kprefswidget.h>
#include <qmap.h>
@@ -39,8 +39,2 @@ $Id$
-/*
-class QCheckBox;
-class QListViewItem;
-class QPushButton;
-class KListView;
-*/
class QComboBox;
@@ -49,4 +43,6 @@ class KPimGlobalPrefs;
class QGroupBox;
+class QTabWidget;
+class KDateEdit;
-class KDEPIMConfigWidget : public QWidget
+class KDEPIMConfigWidget : public KPrefsWidget
{
@@ -55,16 +51,12 @@ class KDEPIMConfigWidget : public QWidget
public:
- KDEPIMConfigWidget( QWidget *parent, const char *name = 0 );
-
- void restoreSettings(KPimGlobalPrefs* prefs);
- void saveSettings(KPimGlobalPrefs* prefs);
- void defaults(KPimGlobalPrefs* prefs);
-
- signals:
- void changed( bool );
-
+ KDEPIMConfigWidget(KPimGlobalPrefs *prefs, QWidget *parent, const char *name = 0 );
public slots:
- void modified();
void textChanged( const QString& text );
+ protected:
+ /** Implement this to read custom configuration widgets. */
+ virtual void usrReadConfig();
+ /** Implement this to write custom configuration widgets. */
+ virtual void usrWriteConfig();
@@ -79,2 +71,10 @@ class KDEPIMConfigWidget : public QWidget
private:
+ void setupExternalAppTab();
+ void setupLocaleDateTab();
+ void setupLocaleTab();
+ void setupTimeZoneTab();
+
+ void setCombo(QComboBox *combo,const QString & text, const QStringList *tags = 0);
+
+
void saveEditFieldSettings();
@@ -82,2 +82,11 @@ class KDEPIMConfigWidget : public QWidget
+ QTabWidget *tabWidget;
+
+
+ QLineEdit* mUserDateFormatShort;
+ QLineEdit* mUserDateFormatLong;
+ QComboBox* mTimeZoneCombo;
+ KDateEdit* mStartDateSavingEdit;
+ KDateEdit* mEndDateSavingEdit;
+
// void restoreExtensionSettings();
diff --git a/libkdepim/kpimglobalprefs.cpp b/libkdepim/kpimglobalprefs.cpp
index eb8f1de..12a503d 100644
--- a/libkdepim/kpimglobalprefs.cpp
+++ b/libkdepim/kpimglobalprefs.cpp
@@ -45,2 +45,23 @@ KPimGlobalPrefs::KPimGlobalPrefs( const QString &name )
{
+
+ KPrefs::setCurrentGroup("Locale");
+ addItemInt("PreferredLanguage",&mPreferredLanguage,0);
+ addItemInt("PreferredTime",&mPreferredTime,0);
+ addItemInt("PreferredDate",&mPreferredDate,0);
+ addItemBool("WeekStartsOnSunday",&mWeekStartsOnSunday,false);
+ //addItemBool("QuickSavingWOUnicode",&mUseQuicksave,false);
+ // addItemBool("ShortDateInViewer",&mShortDateInViewer,false);
+ addItemString("UserDateFormatLong", &mUserDateFormatLong, "%A %d %b %y");
+ addItemString("UserDateFormatShort", &mUserDateFormatShort, "%aK %d.%m.%y");
+
+ KPrefs::setCurrentGroup("Time & Date");
+
+ addItemString("TimeZoneName",&mTimeZoneId,i18n ("+01:00 Europe/Oslo(CET)") );
+ addItemBool("UseDaylightsaving",&mUseDaylightsaving,true);
+ addItemInt("DaylightsavingStart",&mDaylightsavingStart,90);
+ addItemInt("DaylightsavingEnd",&mDaylightsavingEnd,304);
+
+
+
+
KPrefs::setCurrentGroup( "ExternalApplications" );
diff --git a/libkdepim/kpimglobalprefs.h b/libkdepim/kpimglobalprefs.h
index 8bd543d..dad78e6 100644
--- a/libkdepim/kpimglobalprefs.h
+++ b/libkdepim/kpimglobalprefs.h
@@ -86,2 +86,17 @@ class KPimGlobalPrefs : public KPrefs
public:
+ //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;
diff --git a/libkdepim/kpimprefs.cpp b/libkdepim/kpimprefs.cpp
index 140a286..a9ea330 100644
--- a/libkdepim/kpimprefs.cpp
+++ b/libkdepim/kpimprefs.cpp
@@ -66 +66,7 @@ void KPimPrefs::usrWriteConfig()
}
+
+void KPimPrefs::setCategoryDefaults()
+{
+ // empty implementation
+}
+
diff --git a/libkdepim/kpimprefs.h b/libkdepim/kpimprefs.h
index 9bd9466..860665b 100644
--- a/libkdepim/kpimprefs.h
+++ b/libkdepim/kpimprefs.h
@@ -60,3 +60,3 @@ class KPimPrefs : public KPrefs
protected:
- virtual void setCategoryDefaults() = 0;
+ virtual void setCategoryDefaults();
};
diff --git a/libkdepim/kprefsdialog.cpp b/libkdepim/kprefsdialog.cpp
index 205c526..dd9a602 100644
--- a/libkdepim/kprefsdialog.cpp
+++ b/libkdepim/kprefsdialog.cpp
@@ -59,3 +59,3 @@
-KPrefsWidBool::KPrefsWidBool(const QString &text,bool *reference,
+KPrefsDialogWidBool::KPrefsDialogWidBool(const QString &text,bool *reference,
QWidget *parent)
@@ -67,3 +67,3 @@ KPrefsWidBool::KPrefsWidBool(const QString &text,bool *reference,
-void KPrefsWidBool::readConfig()
+void KPrefsDialogWidBool::readConfig()
{
@@ -72,3 +72,3 @@ void KPrefsWidBool::readConfig()
-void KPrefsWidBool::writeConfig()
+void KPrefsDialogWidBool::writeConfig()
{
@@ -77,3 +77,3 @@ void KPrefsWidBool::writeConfig()
-QCheckBox *KPrefsWidBool::checkBox()
+QCheckBox *KPrefsDialogWidBool::checkBox()
{
@@ -83,3 +83,3 @@ QCheckBox *KPrefsWidBool::checkBox()
-KPrefsWidColor::KPrefsWidColor(const QString &text,QColor *reference,
+KPrefsDialogWidColor::KPrefsDialogWidColor(const QString &text,QColor *reference,
QWidget *parent)
@@ -95,8 +95,8 @@ KPrefsWidColor::KPrefsWidColor(const QString &text,QColor *reference,
-KPrefsWidColor::~KPrefsWidColor()
+KPrefsDialogWidColor::~KPrefsDialogWidColor()
{
-// kdDebug(5300) << "KPrefsWidColor::~KPrefsWidColor()" << endl;
+// kdDebug(5300) << "KPrefsDialogWidColor::~KPrefsDialogWidColor()" << endl;
}
-void KPrefsWidColor::readConfig()
+void KPrefsDialogWidColor::readConfig()
{
@@ -105,3 +105,3 @@ void KPrefsWidColor::readConfig()
-void KPrefsWidColor::writeConfig()
+void KPrefsDialogWidColor::writeConfig()
{
@@ -110,3 +110,3 @@ void KPrefsWidColor::writeConfig()
-QLabel *KPrefsWidColor::label()
+QLabel *KPrefsDialogWidColor::label()
{
@@ -115,3 +115,3 @@ QLabel *KPrefsWidColor::label()
-KColorButton *KPrefsWidColor::button()
+KColorButton *KPrefsDialogWidColor::button()
{
@@ -120,3 +120,3 @@ KColorButton *KPrefsWidColor::button()
-KPrefsWidFont::KPrefsWidFont(const QString &sampleText,const QString &labelText,
+KPrefsDialogWidFont::KPrefsDialogWidFont(const QString &sampleText,const QString &labelText,
QFont *reference,QWidget *parent)
@@ -136,3 +136,3 @@ KPrefsWidFont::KPrefsWidFont(const QString &sampleText,const QString &labelText,
-KPrefsWidFont::~KPrefsWidFont()
+KPrefsDialogWidFont::~KPrefsDialogWidFont()
{
@@ -140,3 +140,3 @@ KPrefsWidFont::~KPrefsWidFont()
-void KPrefsWidFont::readConfig()
+void KPrefsDialogWidFont::readConfig()
{
@@ -145,3 +145,3 @@ void KPrefsWidFont::readConfig()
-void KPrefsWidFont::writeConfig()
+void KPrefsDialogWidFont::writeConfig()
{
@@ -150,3 +150,3 @@ void KPrefsWidFont::writeConfig()
-QLabel *KPrefsWidFont::label()
+QLabel *KPrefsDialogWidFont::label()
{
@@ -155,3 +155,3 @@ QLabel *KPrefsWidFont::label()
-QLabel *KPrefsWidFont::preview()
+QLabel *KPrefsDialogWidFont::preview()
{
@@ -160,3 +160,3 @@ QLabel *KPrefsWidFont::preview()
-QPushButton *KPrefsWidFont::button()
+QPushButton *KPrefsDialogWidFont::button()
{
@@ -165,3 +165,3 @@ QPushButton *KPrefsWidFont::button()
-void KPrefsWidFont::selectFont()
+void KPrefsDialogWidFont::selectFont()
{
@@ -176,3 +176,3 @@ void KPrefsWidFont::selectFont()
-KPrefsWidTime::KPrefsWidTime(const QString &text,int *reference,
+KPrefsDialogWidTime::KPrefsDialogWidTime(const QString &text,int *reference,
QWidget *parent)
@@ -186,3 +186,3 @@ KPrefsWidTime::KPrefsWidTime(const QString &text,int *reference,
-void KPrefsWidTime::readConfig()
+void KPrefsDialogWidTime::readConfig()
{
@@ -191,3 +191,3 @@ void KPrefsWidTime::readConfig()
-void KPrefsWidTime::writeConfig()
+void KPrefsDialogWidTime::writeConfig()
{
@@ -196,3 +196,3 @@ void KPrefsWidTime::writeConfig()
-QLabel *KPrefsWidTime::label()
+QLabel *KPrefsDialogWidTime::label()
{
@@ -201,3 +201,3 @@ QLabel *KPrefsWidTime::label()
-QSpinBox *KPrefsWidTime::spinBox()
+QSpinBox *KPrefsDialogWidTime::spinBox()
{
@@ -207,3 +207,3 @@ QSpinBox *KPrefsWidTime::spinBox()
-KPrefsWidRadios::KPrefsWidRadios(const QString &text,int *reference,
+KPrefsDialogWidRadios::KPrefsDialogWidRadios(const QString &text,int *reference,
QWidget *parent)
@@ -215,3 +215,3 @@ KPrefsWidRadios::KPrefsWidRadios(const QString &text,int *reference,
-KPrefsWidRadios::~KPrefsWidRadios()
+KPrefsDialogWidRadios::~KPrefsDialogWidRadios()
{
@@ -219,3 +219,3 @@ KPrefsWidRadios::~KPrefsWidRadios()
-void KPrefsWidRadios::addRadio(const QString &text)
+void KPrefsDialogWidRadios::addRadio(const QString &text)
{
@@ -224,3 +224,3 @@ void KPrefsWidRadios::addRadio(const QString &text)
-QButtonGroup *KPrefsWidRadios::groupBox()
+QButtonGroup *KPrefsDialogWidRadios::groupBox()
{
@@ -229,3 +229,3 @@ QButtonGroup *KPrefsWidRadios::groupBox()
-void KPrefsWidRadios::readConfig()
+void KPrefsDialogWidRadios::readConfig()
{
@@ -234,3 +234,3 @@ void KPrefsWidRadios::readConfig()
-void KPrefsWidRadios::writeConfig()
+void KPrefsDialogWidRadios::writeConfig()
{
@@ -240,3 +240,3 @@ void KPrefsWidRadios::writeConfig()
-KPrefsWidString::KPrefsWidString(const QString &text,QString *reference,
+KPrefsDialogWidString::KPrefsDialogWidString(const QString &text,QString *reference,
QWidget *parent, QLineEdit::EchoMode echomode)
@@ -250,3 +250,3 @@ KPrefsWidString::KPrefsWidString(const QString &text,QString *reference,
-KPrefsWidString::~KPrefsWidString()
+KPrefsDialogWidString::~KPrefsDialogWidString()
{
@@ -254,3 +254,3 @@ KPrefsWidString::~KPrefsWidString()
-void KPrefsWidString::readConfig()
+void KPrefsDialogWidString::readConfig()
{
@@ -259,3 +259,3 @@ void KPrefsWidString::readConfig()
-void KPrefsWidString::writeConfig()
+void KPrefsDialogWidString::writeConfig()
{
@@ -264,3 +264,3 @@ void KPrefsWidString::writeConfig()
-QLabel *KPrefsWidString::label()
+QLabel *KPrefsDialogWidString::label()
{
@@ -269,3 +269,3 @@ QLabel *KPrefsWidString::label()
-QLineEdit *KPrefsWidString::lineEdit()
+QLineEdit *KPrefsDialogWidString::lineEdit()
{
@@ -293,3 +293,3 @@ KPrefsDialog::~KPrefsDialog()
-void KPrefsDialog::addWid(KPrefsWid *wid)
+void KPrefsDialog::addWid(KPrefsDialogWid *wid)
{
@@ -298,5 +298,5 @@ void KPrefsDialog::addWid(KPrefsWid *wid)
-KPrefsWidBool *KPrefsDialog::addWidBool(const QString &text,bool *reference,QWidget *parent)
+KPrefsDialogWidBool *KPrefsDialog::addWidBool(const QString &text,bool *reference,QWidget *parent)
{
- KPrefsWidBool *w = new KPrefsWidBool(text,reference,parent);
+ KPrefsDialogWidBool *w = new KPrefsDialogWidBool(text,reference,parent);
addWid(w);
@@ -305,5 +305,5 @@ KPrefsWidBool *KPrefsDialog::addWidBool(const QString &text,bool *reference,QWid
-KPrefsWidTime *KPrefsDialog::addWidTime(const QString &text,int *reference,QWidget *parent)
+KPrefsDialogWidTime *KPrefsDialog::addWidTime(const QString &text,int *reference,QWidget *parent)
{
- KPrefsWidTime *w = new KPrefsWidTime(text,reference,parent);
+ KPrefsDialogWidTime *w = new KPrefsDialogWidTime(text,reference,parent);
addWid(w);
@@ -312,5 +312,5 @@ KPrefsWidTime *KPrefsDialog::addWidTime(const QString &text,int *reference,QWidg
-KPrefsWidColor *KPrefsDialog::addWidColor(const QString &text,QColor *reference,QWidget *parent)
+KPrefsDialogWidColor *KPrefsDialog::addWidColor(const QString &text,QColor *reference,QWidget *parent)
{
- KPrefsWidColor *w = new KPrefsWidColor(text,reference,parent);
+ KPrefsDialogWidColor *w = new KPrefsDialogWidColor(text,reference,parent);
addWid(w);
@@ -319,5 +319,5 @@ KPrefsWidColor *KPrefsDialog::addWidColor(const QString &text,QColor *reference,
-KPrefsWidRadios *KPrefsDialog::addWidRadios(const QString &text,int *reference,QWidget *parent)
+KPrefsDialogWidRadios *KPrefsDialog::addWidRadios(const QString &text,int *reference,QWidget *parent)
{
- KPrefsWidRadios *w = new KPrefsWidRadios(text,reference,parent);
+ KPrefsDialogWidRadios *w = new KPrefsDialogWidRadios(text,reference,parent);
addWid(w);
@@ -326,5 +326,5 @@ KPrefsWidRadios *KPrefsDialog::addWidRadios(const QString &text,int *reference,Q
-KPrefsWidString *KPrefsDialog::addWidString(const QString &text,QString *reference,QWidget *parent)
+KPrefsDialogWidString *KPrefsDialog::addWidString(const QString &text,QString *reference,QWidget *parent)
{
- KPrefsWidString *w = new KPrefsWidString(text,reference,parent);
+ KPrefsDialogWidString *w = new KPrefsDialogWidString(text,reference,parent);
addWid(w);
@@ -333,5 +333,5 @@ KPrefsWidString *KPrefsDialog::addWidString(const QString &text,QString *referen
-KPrefsWidString *KPrefsDialog::addWidPassword(const QString &text,QString *reference,QWidget *parent)
+KPrefsDialogWidString *KPrefsDialog::addWidPassword(const QString &text,QString *reference,QWidget *parent)
{
- KPrefsWidString *w = new KPrefsWidString(text,reference,parent,QLineEdit::Password);
+ KPrefsDialogWidString *w = new KPrefsDialogWidString(text,reference,parent,QLineEdit::Password);
addWid(w);
@@ -340,6 +340,6 @@ KPrefsWidString *KPrefsDialog::addWidPassword(const QString &text,QString *refer
-KPrefsWidFont *KPrefsDialog::addWidFont(const QString &sampleText,const QString &buttonText,
+KPrefsDialogWidFont *KPrefsDialog::addWidFont(const QString &sampleText,const QString &buttonText,
QFont *reference,QWidget *parent)
{
- KPrefsWidFont *w = new KPrefsWidFont(sampleText,buttonText,reference,parent);
+ KPrefsDialogWidFont *w = new KPrefsDialogWidFont(sampleText,buttonText,reference,parent);
addWid(w);
@@ -359,3 +359,3 @@ void KPrefsDialog::readConfig()
- KPrefsWid *wid;
+ KPrefsDialogWid *wid;
for(wid = mPrefsWids.first();wid;wid=mPrefsWids.next()) {
@@ -371,3 +371,3 @@ void KPrefsDialog::writeConfig()
- KPrefsWid *wid;
+ KPrefsDialogWid *wid;
for(wid = mPrefsWids.first();wid;wid=mPrefsWids.next()) {
diff --git a/libkdepim/kprefsdialog.h b/libkdepim/kprefsdialog.h
index dceab01..ad13b78 100644
--- a/libkdepim/kprefsdialog.h
+++ b/libkdepim/kprefsdialog.h
@@ -48,3 +48,3 @@ class QButtonGroup;
*/
-class KPrefsWid
+class KPrefsDialogWid
{
@@ -69,3 +69,3 @@ class KPrefsWid
*/
-class KPrefsWidBool : public KPrefsWid
+class KPrefsDialogWidBool : public KPrefsDialogWid
{
@@ -79,3 +79,3 @@ class KPrefsWidBool : public KPrefsWid
*/
- KPrefsWidBool(const QString &text,bool *reference,QWidget *parent);
+ KPrefsDialogWidBool(const QString &text,bool *reference,QWidget *parent);
@@ -101,3 +101,3 @@ class KPrefsWidBool : public KPrefsWid
*/
-class KPrefsWidTime : public KPrefsWid
+class KPrefsDialogWidTime : public KPrefsDialogWid
{
@@ -111,3 +111,3 @@ class KPrefsWidTime : public KPrefsWid
*/
- KPrefsWidTime(const QString &text,int *reference,QWidget *parent);
+ KPrefsDialogWidTime(const QString &text,int *reference,QWidget *parent);
@@ -138,3 +138,3 @@ class KPrefsWidTime : public KPrefsWid
*/
-class KPrefsWidColor : public QObject, public KPrefsWid
+class KPrefsDialogWidColor : public QObject, public KPrefsDialogWid
{
@@ -150,3 +150,3 @@ class KPrefsWidColor : public QObject, public KPrefsWid
*/
- KPrefsWidColor(const QString &text,QColor *reference,QWidget *parent);
+ KPrefsDialogWidColor(const QString &text,QColor *reference,QWidget *parent);
/**
@@ -154,3 +154,3 @@ class KPrefsWidColor : public QObject, public KPrefsWid
*/
- ~KPrefsWidColor();
+ ~KPrefsDialogWidColor();
@@ -181,3 +181,3 @@ class KPrefsWidColor : public QObject, public KPrefsWid
*/
-class KPrefsWidFont : public QObject, public KPrefsWid
+class KPrefsDialogWidFont : public QObject, public KPrefsDialogWid
{
@@ -193,3 +193,3 @@ class KPrefsWidFont : public QObject, public KPrefsWid
*/
- KPrefsWidFont(const QString &sampleText,const QString &labelText,
+ KPrefsDialogWidFont(const QString &sampleText,const QString &labelText,
QFont *reference,QWidget *parent);
@@ -198,3 +198,3 @@ class KPrefsWidFont : public QObject, public KPrefsWid
*/
- ~KPrefsWidFont();
+ ~KPrefsDialogWidFont();
@@ -237,3 +237,3 @@ class KPrefsWidFont : public QObject, public KPrefsWid
*/
-class KPrefsWidRadios : public KPrefsWid
+class KPrefsDialogWidRadios : public KPrefsDialogWid
{
@@ -248,4 +248,4 @@ class KPrefsWidRadios : public KPrefsWid
*/
- KPrefsWidRadios(const QString &text,int *reference,QWidget *parent);
- virtual ~KPrefsWidRadios();
+ KPrefsDialogWidRadios(const QString &text,int *reference,QWidget *parent);
+ virtual ~KPrefsDialogWidRadios();
@@ -279,3 +279,3 @@ class KPrefsWidRadios : public KPrefsWid
*/
-class KPrefsWidString : public KPrefsWid
+class KPrefsDialogWidString : public KPrefsDialogWid
{
@@ -289,3 +289,3 @@ class KPrefsWidString : public KPrefsWid
*/
- KPrefsWidString(const QString &text,QString *reference,QWidget *parent,QLineEdit::EchoMode echomode=QLineEdit::Normal);
+ KPrefsDialogWidString(const QString &text,QString *reference,QWidget *parent,QLineEdit::EchoMode echomode=QLineEdit::Normal);
/**
@@ -293,3 +293,3 @@ class KPrefsWidString : public KPrefsWid
*/
- virtual ~KPrefsWidString();
+ virtual ~KPrefsDialogWidString();
@@ -322,3 +322,3 @@ class KPrefsWidString : public KPrefsWid
- KPrefsDialog provides functions to add subclasses of @ref KPrefsWid. For
+ KPrefsDialog provides functions to add subclasses of @ref KPrefsDialogWid. For
these widgets the reading, writing and setting to default values is handled
@@ -346,7 +346,7 @@ class KPrefsDialog : public KDialogBase
/**
- Register a custom KPrefsWid object.
+ Register a custom KPrefsDialogWid object.
*/
- void addWid(KPrefsWid *);
+ void addWid(KPrefsDialogWid *);
/**
- Register a @ref KPrefsWidBool object.
+ Register a @ref KPrefsDialogWidBool object.
@@ -356,5 +356,5 @@ class KPrefsDialog : public KDialogBase
*/
- KPrefsWidBool *addWidBool(const QString &text,bool *reference,QWidget *parent);
+ KPrefsDialogWidBool *addWidBool(const QString &text,bool *reference,QWidget *parent);
/**
- Register a @ref KPrefsWidTime object.
+ Register a @ref KPrefsDialogWidTime object.
@@ -364,5 +364,5 @@ class KPrefsDialog : public KDialogBase
*/
- KPrefsWidTime *addWidTime(const QString &text,int *reference,QWidget *parent);
+ KPrefsDialogWidTime *addWidTime(const QString &text,int *reference,QWidget *parent);
/**
- Register a @ref KPrefsWidColor object.
+ Register a @ref KPrefsDialogWidColor object.
@@ -372,5 +372,5 @@ class KPrefsDialog : public KDialogBase
*/
- KPrefsWidColor *addWidColor(const QString &text,QColor *reference,QWidget *parent);
+ KPrefsDialogWidColor *addWidColor(const QString &text,QColor *reference,QWidget *parent);
/**
- Register a @ref KPrefsWidRadios object.
+ Register a @ref KPrefsDialogWidRadios object.
@@ -380,5 +380,5 @@ class KPrefsDialog : public KDialogBase
*/
- KPrefsWidRadios *addWidRadios(const QString &text,int *reference,QWidget *parent);
+ KPrefsDialogWidRadios *addWidRadios(const QString &text,int *reference,QWidget *parent);
/**
- Register a @ref KPrefsWidString object.
+ Register a @ref KPrefsDialogWidString object.
@@ -388,5 +388,5 @@ class KPrefsDialog : public KDialogBase
*/
- KPrefsWidString *addWidString(const QString &text,QString *reference,QWidget *parent);
+ KPrefsDialogWidString *addWidString(const QString &text,QString *reference,QWidget *parent);
/**
- Register a password @ref KPrefsWidString object, with echomode set to QLineEdit::Password.
+ Register a password @ref KPrefsDialogWidString object, with echomode set to QLineEdit::Password.
@@ -396,5 +396,5 @@ class KPrefsDialog : public KDialogBase
*/
- KPrefsWidString *addWidPassword (const QString &text,QString *reference,QWidget *parent);
+ KPrefsDialogWidString *addWidPassword (const QString &text,QString *reference,QWidget *parent);
/**
- Register a @ref KPrefsWidFont object.
+ Register a @ref KPrefsDialogWidFont object.
@@ -405,3 +405,3 @@ class KPrefsDialog : public KDialogBase
*/
- KPrefsWidFont *addWidFont(const QString &sampleText,const QString &buttonText,
+ KPrefsDialogWidFont *addWidFont(const QString &sampleText,const QString &buttonText,
QFont *reference,QWidget *parent);
@@ -442,3 +442,3 @@ class KPrefsDialog : public KDialogBase
- QPtrList<KPrefsWid> mPrefsWids;
+ QPtrList<KPrefsDialogWid> mPrefsWids;
};
diff --git a/libkdepim/libkdepimE.pro b/libkdepim/libkdepimE.pro
index 69980e3..2a30ee8 100644
--- a/libkdepim/libkdepimE.pro
+++ b/libkdepim/libkdepimE.pro
@@ -26,2 +26,3 @@ HEADERS = \
kprefsdialog.h \
+ kprefswidget.h \
ksyncprofile.h \
@@ -45,2 +46,3 @@ SOURCES = \
kprefsdialog.cpp \
+ kprefswidget.cpp \
ksyncprofile.cpp \