summaryrefslogtreecommitdiffabout
path: root/libkdepim
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 /libkdepim
parent633522024e48efc423155a04b71083a03696211d (diff)
downloadkdepimpi-d63eac7a612a9724705bc58ad98c65c6ac052d07.zip
kdepimpi-d63eac7a612a9724705bc58ad98c65c6ac052d07.tar.gz
kdepimpi-d63eac7a612a9724705bc58ad98c65c6ac052d07.tar.bz2
connected global config
Diffstat (limited to 'libkdepim') (more/less context) (ignore whitespace changes)
-rw-r--r--libkdepim/kcmconfigs/kdepimconfigwidget.cpp2
-rw-r--r--libkdepim/kpimglobalprefs.cpp17
-rw-r--r--libkdepim/kpimglobalprefs.h4
3 files changed, 19 insertions, 4 deletions
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
@@ -723,49 +723,49 @@ void KDEPIMConfigWidget::usrWriteConfig()
prefs->mFaxClient = mFaxClient;
prefs->mFaxOtherChannel = mFaxOtherChannel;
prefs->mFaxOtherMessage = mFaxOtherMessage;
prefs->mFaxOtherMessageParameters = mFaxOtherMessageParameters;
prefs->mSMSClient = mSMSClient;
prefs->mSMSOtherChannel = mSMSOtherChannel;
prefs->mSMSOtherMessage = mSMSOtherMessage;
prefs->mSMSOtherMessageParameters = mSMSOtherMessageParameters;
prefs->mPagerClient = mPagerClient;
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) {
combo->setCurrentItem(i);
break;
}
}
}
}
void KDEPIMConfigWidget::textChanged( const QString& text )
{
emit changed( true );
}
diff --git a/libkdepim/kpimglobalprefs.cpp b/libkdepim/kpimglobalprefs.cpp
index 12a503d..a896a0f 100644
--- a/libkdepim/kpimglobalprefs.cpp
+++ b/libkdepim/kpimglobalprefs.cpp
@@ -79,37 +79,54 @@ KPimGlobalPrefs::KPimGlobalPrefs( const QString &name )
addItemString( "PhoneChannelParameters", &mPhoneOtherMessageParameters, "" );
addItemInt( "FaxChannelType", &mFaxClient, NONE_FAC );
addItemString( "FaxChannel", &mFaxOtherChannel, "" );
addItemString( "FaxChannelMessage", &mFaxOtherMessage, "" );
addItemString( "FaxChannelParameters", &mFaxOtherMessageParameters, "" );
addItemInt( "SMSChannelType", &mSMSClient, NONE_SMC );
addItemString( "SMSChannel", &mSMSOtherChannel, "" );
addItemString( "SMSChannelMessage", &mSMSOtherMessage, "" );
addItemString( "SMSChannelParameters", &mSMSOtherMessageParameters, "" );
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
@@ -16,48 +16,49 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
As a special exception, permission is given to link this program
with any edition of Qt, and distribute the resulting executable,
without including the source code for Qt in the source distribution.
*/
/*
Enhanced Version of the file for platform independent KDE tools.
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
};
enum PhoneClients {
NONE_PHC = 0,
OTHER_PHC = 1,
KPPI_PHC = 2
};
enum FaxClients {
NONE_FAC = 0,
OTHER_FAC = 1
};
@@ -75,51 +76,48 @@ class KPimGlobalPrefs : public KPrefs
enum SIPClients {
NONE_SIC = 0,
OTHER_SIC = 1
};
private:
KPimGlobalPrefs( const QString &name = QString::null );
static KPimGlobalPrefs *sInstance;
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;
QString mEmailOtherChannel;
QString mEmailOtherMessage;
QString mEmailOtherMessageParameters;
QString mEmailOtherMessage2;
QString mEmailOtherMessageParameters2;
int mPhoneClient;
QString mPhoneOtherChannel;
QString mPhoneOtherMessage;
QString mPhoneOtherMessageParameters;
int mFaxClient;
QString mFaxOtherChannel;
QString mFaxOtherMessage;
QString mFaxOtherMessageParameters;
int mSMSClient;
QString mSMSOtherChannel;
QString mSMSOtherMessage;
QString mSMSOtherMessageParameters;
int mPagerClient;
QString mPagerOtherChannel;