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) (unidiff)
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()
723 723
724 prefs->mFaxClient = mFaxClient; 724 prefs->mFaxClient = mFaxClient;
725 prefs->mFaxOtherChannel = mFaxOtherChannel; 725 prefs->mFaxOtherChannel = mFaxOtherChannel;
726 prefs->mFaxOtherMessage = mFaxOtherMessage; 726 prefs->mFaxOtherMessage = mFaxOtherMessage;
727 prefs->mFaxOtherMessageParameters = mFaxOtherMessageParameters; 727 prefs->mFaxOtherMessageParameters = mFaxOtherMessageParameters;
728 728
729 prefs->mSMSClient = mSMSClient; 729 prefs->mSMSClient = mSMSClient;
730 prefs->mSMSOtherChannel = mSMSOtherChannel; 730 prefs->mSMSOtherChannel = mSMSOtherChannel;
731 prefs->mSMSOtherMessage = mSMSOtherMessage; 731 prefs->mSMSOtherMessage = mSMSOtherMessage;
732 prefs->mSMSOtherMessageParameters = mSMSOtherMessageParameters; 732 prefs->mSMSOtherMessageParameters = mSMSOtherMessageParameters;
733 733
734 prefs->mPagerClient = mPagerClient; 734 prefs->mPagerClient = mPagerClient;
735 prefs->mPagerOtherChannel = mPagerOtherChannel; 735 prefs->mPagerOtherChannel = mPagerOtherChannel;
736 prefs->mPagerOtherMessage = mPagerOtherMessage; 736 prefs->mPagerOtherMessage = mPagerOtherMessage;
737 prefs->mPagerOtherMessageParameters = mPagerOtherMessageParameters; 737 prefs->mPagerOtherMessageParameters = mPagerOtherMessageParameters;
738 738
739 739
740 prefs->mSipClient = mSipClient; 740 prefs->mSipClient = mSipClient;
741 prefs->mSipOtherChannel = mSipOtherChannel; 741 prefs->mSipOtherChannel = mSipOtherChannel;
742 prefs->mSipOtherMessage = mSipOtherMessage; 742 prefs->mSipOtherMessage = mSipOtherMessage;
743 prefs->mSipOtherMessageParameters = mSipOtherMessageParameters; 743 prefs->mSipOtherMessageParameters = mSipOtherMessageParameters;
744 744
745 //release the cache that other views can access the changed values instantanious 745 //release the cache that other views can access the changed values instantanious
746 ExternalAppHandler::instance()->loadConfig(); 746 ExternalAppHandler::instance()->loadConfig();
747 747 KPimGlobalPrefs::instance()->setGlobalConfig();
748} 748}
749 749
750 750
751void KDEPIMConfigWidget::setCombo(QComboBox *combo, const QString & text, 751void KDEPIMConfigWidget::setCombo(QComboBox *combo, const QString & text,
752 const QStringList *tags) 752 const QStringList *tags)
753{ 753{
754 if (tags) { 754 if (tags) {
755 int i = tags->findIndex(text); 755 int i = tags->findIndex(text);
756 if (i > 0) combo->setCurrentItem(i); 756 if (i > 0) combo->setCurrentItem(i);
757 } else { 757 } else {
758 for(int i=0;i<combo->count();++i) { 758 for(int i=0;i<combo->count();++i) {
759 if (combo->text(i) == text) { 759 if (combo->text(i) == text) {
760 combo->setCurrentItem(i); 760 combo->setCurrentItem(i);
761 break; 761 break;
762 } 762 }
763 } 763 }
764 } 764 }
765} 765}
766 766
767 767
768void KDEPIMConfigWidget::textChanged( const QString& text ) 768void KDEPIMConfigWidget::textChanged( const QString& text )
769{ 769{
770 emit changed( true ); 770 emit changed( true );
771} 771}
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 )
79 addItemString( "PhoneChannelParameters", &mPhoneOtherMessageParameters, "" ); 79 addItemString( "PhoneChannelParameters", &mPhoneOtherMessageParameters, "" );
80 80
81 addItemInt( "FaxChannelType", &mFaxClient, NONE_FAC ); 81 addItemInt( "FaxChannelType", &mFaxClient, NONE_FAC );
82 addItemString( "FaxChannel", &mFaxOtherChannel, "" ); 82 addItemString( "FaxChannel", &mFaxOtherChannel, "" );
83 addItemString( "FaxChannelMessage", &mFaxOtherMessage, "" ); 83 addItemString( "FaxChannelMessage", &mFaxOtherMessage, "" );
84 addItemString( "FaxChannelParameters", &mFaxOtherMessageParameters, "" ); 84 addItemString( "FaxChannelParameters", &mFaxOtherMessageParameters, "" );
85 85
86 addItemInt( "SMSChannelType", &mSMSClient, NONE_SMC ); 86 addItemInt( "SMSChannelType", &mSMSClient, NONE_SMC );
87 addItemString( "SMSChannel", &mSMSOtherChannel, "" ); 87 addItemString( "SMSChannel", &mSMSOtherChannel, "" );
88 addItemString( "SMSChannelMessage", &mSMSOtherMessage, "" ); 88 addItemString( "SMSChannelMessage", &mSMSOtherMessage, "" );
89 addItemString( "SMSChannelParameters", &mSMSOtherMessageParameters, "" ); 89 addItemString( "SMSChannelParameters", &mSMSOtherMessageParameters, "" );
90 90
91 addItemInt( "PagerChannelType", &mPagerClient, NONE_PAC ); 91 addItemInt( "PagerChannelType", &mPagerClient, NONE_PAC );
92 addItemString( "PagerChannel", &mPagerOtherChannel, "" ); 92 addItemString( "PagerChannel", &mPagerOtherChannel, "" );
93 addItemString( "PagerChannelMessage", &mPagerOtherMessage, "" ); 93 addItemString( "PagerChannelMessage", &mPagerOtherMessage, "" );
94 addItemString( "PagerChannelParameters", &mPagerOtherMessageParameters, "" ); 94 addItemString( "PagerChannelParameters", &mPagerOtherMessageParameters, "" );
95 95
96 addItemInt( "SIPChannelType", &mSipClient, NONE_SIC ); 96 addItemInt( "SIPChannelType", &mSipClient, NONE_SIC );
97 addItemString( "SIPChannel", &mSipOtherChannel, "" ); 97 addItemString( "SIPChannel", &mSipOtherChannel, "" );
98 addItemString( "SIPChannelMessage", &mSipOtherMessage, "" ); 98 addItemString( "SIPChannelMessage", &mSipOtherMessage, "" );
99 addItemString( "SIPChannelParameters", &mSipOtherMessageParameters, "" ); 99 addItemString( "SIPChannelParameters", &mSipOtherMessageParameters, "" );
100 100
101} 101}
102 102
103void KPimGlobalPrefs::setGlobalConfig()
104{
105
106 KGlobal::locale()->setHore24Format( !mPreferredTime );
107 KGlobal::locale()->setWeekStartMonday( !mWeekStartsOnSunday );
108 KGlobal::locale()->setIntDateFormat( (KLocale::IntDateFormat)mPreferredDate );
109 KGlobal::locale()->setLanguage( mPreferredLanguage );
110 QString dummy = mUserDateFormatLong;
111 KGlobal::locale()->setDateFormat(dummy.replace( QRegExp("K"), QString(",") ));
112 dummy = mUserDateFormatShort;
113 KGlobal::locale()->setDateFormatShort(dummy.replace( QRegExp("K"), QString(",") ));
114 KGlobal::locale()->setDaylightSaving( mUseDaylightsaving,
115 mDaylightsavingStart,
116 mDaylightsavingEnd );
117 KGlobal::locale()->setTimezone( mTimeZoneId );
118
119}
103KPimGlobalPrefs::~KPimGlobalPrefs() 120KPimGlobalPrefs::~KPimGlobalPrefs()
104{ 121{
105} 122}
106 123
107KPimGlobalPrefs *KPimGlobalPrefs::instance() 124KPimGlobalPrefs *KPimGlobalPrefs::instance()
108{ 125{
109 if ( !sInstance ) { 126 if ( !sInstance ) {
110 sInstance = staticDeleter.setObject( new KPimGlobalPrefs() ); 127 sInstance = staticDeleter.setObject( new KPimGlobalPrefs() );
111 sInstance->readConfig(); 128 sInstance->readConfig();
112 } 129 }
113 130
114 return sInstance; 131 return sInstance;
115} 132}
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 @@
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24/* 24/*
25Enhanced Version of the file for platform independent KDE tools. 25Enhanced Version of the file for platform independent KDE tools.
26Copyright (c) 2004 Ulf Schenk 26Copyright (c) 2004 Ulf Schenk
27 27
28$Id$ 28$Id$
29*/ 29*/
30 30
31#ifndef KPIMGLOBALPREFS_H 31#ifndef KPIMGLOBALPREFS_H
32#define KPIMGLOBALPREFS_H 32#define KPIMGLOBALPREFS_H
33 33
34#include "kprefs.h" 34#include "kprefs.h"
35 35
36class KPimGlobalPrefs : public KPrefs 36class KPimGlobalPrefs : public KPrefs
37{ 37{
38 public: 38 public:
39 39
40 void setGlobalConfig();
40 static KPimGlobalPrefs *instance(); 41 static KPimGlobalPrefs *instance();
41 42
42 43
43 virtual ~KPimGlobalPrefs(); 44 virtual ~KPimGlobalPrefs();
44 45
45 46
46 enum EMailClients { 47 enum EMailClients {
47 NONE_EMC = 0, 48 NONE_EMC = 0,
48 OTHER_EMC = 1, 49 OTHER_EMC = 1,
49 OMPI_EMC = 2, 50 OMPI_EMC = 2,
50 QTOPIA_EMC = 3, 51 QTOPIA_EMC = 3,
51 OPIE_EMC = 4 52 OPIE_EMC = 4
52 }; 53 };
53 54
54 enum PhoneClients { 55 enum PhoneClients {
55 NONE_PHC = 0, 56 NONE_PHC = 0,
56 OTHER_PHC = 1, 57 OTHER_PHC = 1,
57 KPPI_PHC = 2 58 KPPI_PHC = 2
58 }; 59 };
59 60
60 enum FaxClients { 61 enum FaxClients {
61 NONE_FAC = 0, 62 NONE_FAC = 0,
62 OTHER_FAC = 1 63 OTHER_FAC = 1
63 }; 64 };
@@ -75,51 +76,48 @@ class KPimGlobalPrefs : public KPrefs
75 enum SIPClients { 76 enum SIPClients {
76 NONE_SIC = 0, 77 NONE_SIC = 0,
77 OTHER_SIC = 1 78 OTHER_SIC = 1
78 }; 79 };
79 80
80 private: 81 private:
81 KPimGlobalPrefs( const QString &name = QString::null ); 82 KPimGlobalPrefs( const QString &name = QString::null );
82 83
83 static KPimGlobalPrefs *sInstance; 84 static KPimGlobalPrefs *sInstance;
84 85
85 86
86 public: 87 public:
87 //US I copied the following "locale" settings from KOPrefs 88 //US I copied the following "locale" settings from KOPrefs
88 int mPreferredDate; 89 int mPreferredDate;
89 QString mUserDateFormatLong; 90 QString mUserDateFormatLong;
90 QString mUserDateFormatShort; 91 QString mUserDateFormatShort;
91 int mPreferredLanguage; 92 int mPreferredLanguage;
92 int mPreferredTime; 93 int mPreferredTime;
93 bool mWeekStartsOnSunday; 94 bool mWeekStartsOnSunday;
94 QString mTimeZoneId; 95 QString mTimeZoneId;
95 bool mUseDaylightsaving; 96 bool mUseDaylightsaving;
96 int mDaylightsavingStart; 97 int mDaylightsavingStart;
97 int mDaylightsavingEnd; 98 int mDaylightsavingEnd;
98 99
99
100
101
102 int mEmailClient; 100 int mEmailClient;
103 QString mEmailOtherChannel; 101 QString mEmailOtherChannel;
104 QString mEmailOtherMessage; 102 QString mEmailOtherMessage;
105 QString mEmailOtherMessageParameters; 103 QString mEmailOtherMessageParameters;
106 QString mEmailOtherMessage2; 104 QString mEmailOtherMessage2;
107 QString mEmailOtherMessageParameters2; 105 QString mEmailOtherMessageParameters2;
108 106
109 int mPhoneClient; 107 int mPhoneClient;
110 QString mPhoneOtherChannel; 108 QString mPhoneOtherChannel;
111 QString mPhoneOtherMessage; 109 QString mPhoneOtherMessage;
112 QString mPhoneOtherMessageParameters; 110 QString mPhoneOtherMessageParameters;
113 111
114 int mFaxClient; 112 int mFaxClient;
115 QString mFaxOtherChannel; 113 QString mFaxOtherChannel;
116 QString mFaxOtherMessage; 114 QString mFaxOtherMessage;
117 QString mFaxOtherMessageParameters; 115 QString mFaxOtherMessageParameters;
118 116
119 int mSMSClient; 117 int mSMSClient;
120 QString mSMSOtherChannel; 118 QString mSMSOtherChannel;
121 QString mSMSOtherMessage; 119 QString mSMSOtherMessage;
122 QString mSMSOtherMessageParameters; 120 QString mSMSOtherMessageParameters;
123 121
124 int mPagerClient; 122 int mPagerClient;
125 QString mPagerOtherChannel; 123 QString mPagerOtherChannel;