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
@@ -1,771 +1,771 @@
1/* 1/*
2 This file is part of KdePim/Pi. 2 This file is part of KdePim/Pi.
3 Copyright (c) 2004 Ulf Schenk 3 Copyright (c) 2004 Ulf Schenk
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
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#include <qlayout.h> 31#include <qlayout.h>
32#include <qtabwidget.h> 32#include <qtabwidget.h>
33#include <qcombobox.h> 33#include <qcombobox.h>
34#include <qgroupbox.h> 34#include <qgroupbox.h>
35#include <qlabel.h> 35#include <qlabel.h>
36#include <qlineedit.h> 36#include <qlineedit.h>
37#include <qbuttongroup.h> 37#include <qbuttongroup.h>
38#include <qfile.h> 38#include <qfile.h>
39 39
40#include <kdialog.h> 40#include <kdialog.h>
41#include <klocale.h> 41#include <klocale.h>
42#include <kdateedit.h> 42#include <kdateedit.h>
43#include <kglobal.h> 43#include <kglobal.h>
44#include <stdlib.h> 44#include <stdlib.h>
45 45
46/*US 46/*US
47#include <qcheckbox.h> 47#include <qcheckbox.h>
48#include <qframe.h> 48#include <qframe.h>
49#include <qpushbutton.h> 49#include <qpushbutton.h>
50#include <qcombobox.h> 50#include <qcombobox.h>
51#include <qlineedit.h> 51#include <qlineedit.h>
52#include <qlabel.h> 52#include <qlabel.h>
53#include <qfile.h> 53#include <qfile.h>
54 54
55#include <kconfig.h> 55#include <kconfig.h>
56#include <kdebug.h> 56#include <kdebug.h>
57#include <kdialog.h> 57#include <kdialog.h>
58#include <klistview.h> 58#include <klistview.h>
59#include <klocale.h> 59#include <klocale.h>
60#include <kglobal.h> 60#include <kglobal.h>
61#include <kmessagebox.h> 61#include <kmessagebox.h>
62#include <kstandarddirs.h> 62#include <kstandarddirs.h>
63 63
64#ifndef KAB_EMBEDDED 64#ifndef KAB_EMBEDDED
65#include <ktrader.h> 65#include <ktrader.h>
66#else // KAB_EMBEDDED 66#else // KAB_EMBEDDED
67#include <mergewidget.h> 67#include <mergewidget.h>
68#include <distributionlistwidget.h> 68#include <distributionlistwidget.h>
69#endif // KAB_EMBEDDED 69#endif // KAB_EMBEDDED
70 70
71#include "addresseewidget.h" 71#include "addresseewidget.h"
72#include "extensionconfigdialog.h" 72#include "extensionconfigdialog.h"
73#include "extensionwidget.h" 73#include "extensionwidget.h"
74*/ 74*/
75 75
76#include "qapplication.h" 76#include "qapplication.h"
77 77
78#include "kpimglobalprefs.h" 78#include "kpimglobalprefs.h"
79 79
80#include "kdepimconfigwidget.h" 80#include "kdepimconfigwidget.h"
81 81
82 82
83KDEPIMConfigWidget::KDEPIMConfigWidget(KPimGlobalPrefs *prefs, QWidget *parent, const char *name ) 83KDEPIMConfigWidget::KDEPIMConfigWidget(KPimGlobalPrefs *prefs, QWidget *parent, const char *name )
84 : KPrefsWidget(prefs, parent, name ) 84 : KPrefsWidget(prefs, parent, name )
85{ 85{
86 mExternalAppsMap.insert(ExternalAppHandler::EMAIL, i18n("Email")); 86 mExternalAppsMap.insert(ExternalAppHandler::EMAIL, i18n("Email"));
87 mExternalAppsMap.insert(ExternalAppHandler::PHONE, i18n("Phone")); 87 mExternalAppsMap.insert(ExternalAppHandler::PHONE, i18n("Phone"));
88 mExternalAppsMap.insert(ExternalAppHandler::SMS, i18n("SMS")); 88 mExternalAppsMap.insert(ExternalAppHandler::SMS, i18n("SMS"));
89 mExternalAppsMap.insert(ExternalAppHandler::FAX, i18n("Fax")); 89 mExternalAppsMap.insert(ExternalAppHandler::FAX, i18n("Fax"));
90 mExternalAppsMap.insert(ExternalAppHandler::PAGER, i18n("Pager")); 90 mExternalAppsMap.insert(ExternalAppHandler::PAGER, i18n("Pager"));
91 mExternalAppsMap.insert(ExternalAppHandler::SIP, i18n("SIP")); 91 mExternalAppsMap.insert(ExternalAppHandler::SIP, i18n("SIP"));
92 92
93 93
94 QVBoxLayout *topLayout = new QVBoxLayout( this, 0, 94 QVBoxLayout *topLayout = new QVBoxLayout( this, 0,
95 KDialog::spacingHint() ); 95 KDialog::spacingHint() );
96 96
97 tabWidget = new QTabWidget( this ); 97 tabWidget = new QTabWidget( this );
98 topLayout->addWidget( tabWidget ); 98 topLayout->addWidget( tabWidget );
99 99
100 100
101 setupLocaleTab(); 101 setupLocaleTab();
102 setupLocaleDateTab(); 102 setupLocaleDateTab();
103 setupTimeZoneTab(); 103 setupTimeZoneTab();
104 setupExternalAppTab(); 104 setupExternalAppTab();
105 105
106} 106}
107 107
108void KDEPIMConfigWidget::setupExternalAppTab() 108void KDEPIMConfigWidget::setupExternalAppTab()
109{ 109{
110 QWidget *externalAppsPage = new QWidget( this ); 110 QWidget *externalAppsPage = new QWidget( this );
111 QVBoxLayout* layout = new QVBoxLayout( externalAppsPage, KDialog::marginHintSmall(), 111 QVBoxLayout* layout = new QVBoxLayout( externalAppsPage, KDialog::marginHintSmall(),
112 KDialog::spacingHintSmall() ); 112 KDialog::spacingHintSmall() );
113 113
114 mExternalApps = new QComboBox( externalAppsPage ); 114 mExternalApps = new QComboBox( externalAppsPage );
115 115
116 QMap<ExternalAppHandler::Types, QString>::Iterator it; 116 QMap<ExternalAppHandler::Types, QString>::Iterator it;
117 for( it = mExternalAppsMap.begin(); it != mExternalAppsMap.end(); ++it ) 117 for( it = mExternalAppsMap.begin(); it != mExternalAppsMap.end(); ++it )
118 mExternalApps->insertItem( it.data(), it.key() ); 118 mExternalApps->insertItem( it.data(), it.key() );
119 119
120 layout->addWidget( mExternalApps ); 120 layout->addWidget( mExternalApps );
121 121
122 connect( mExternalApps, SIGNAL( activated( int ) ), 122 connect( mExternalApps, SIGNAL( activated( int ) ),
123 this, SLOT (externalapp_changed( int ) ) ); 123 this, SLOT (externalapp_changed( int ) ) );
124 124
125 125
126 mExternalAppGroupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Used Mail Client" ), externalAppsPage ); 126 mExternalAppGroupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Used Mail Client" ), externalAppsPage );
127 QGridLayout *boxLayout = new QGridLayout( mExternalAppGroupBox->layout(), 4, 2, -1, "gridlayout" ); 127 QGridLayout *boxLayout = new QGridLayout( mExternalAppGroupBox->layout(), 4, 2, -1, "gridlayout" );
128 128
129 129
130 mClient = new QComboBox( mExternalAppGroupBox ); 130 mClient = new QComboBox( mExternalAppGroupBox );
131 boxLayout->addMultiCellWidget( mClient, 0, 0, 0, 1 ); 131 boxLayout->addMultiCellWidget( mClient, 0, 0, 0, 1 );
132 132
133 connect( mClient, SIGNAL( activated( int ) ), 133 connect( mClient, SIGNAL( activated( int ) ),
134 this, SLOT (client_changed( int ) ) ); 134 this, SLOT (client_changed( int ) ) );
135 135
136 QLabel* lab = new QLabel( i18n("Channel:"), mExternalAppGroupBox); 136 QLabel* lab = new QLabel( i18n("Channel:"), mExternalAppGroupBox);
137 boxLayout->addWidget( lab, 1, 0 ); 137 boxLayout->addWidget( lab, 1, 0 );
138 mChannel = new QLineEdit(mExternalAppGroupBox); 138 mChannel = new QLineEdit(mExternalAppGroupBox);
139 mChannel->setReadOnly(true); 139 mChannel->setReadOnly(true);
140 boxLayout->addMultiCellWidget( mChannel, 2 , 2, 0, 1 ); 140 boxLayout->addMultiCellWidget( mChannel, 2 , 2, 0, 1 );
141 141
142 lab = new QLabel( i18n("Message:"), mExternalAppGroupBox); 142 lab = new QLabel( i18n("Message:"), mExternalAppGroupBox);
143 boxLayout->addWidget( lab, 3, 0 ); 143 boxLayout->addWidget( lab, 3, 0 );
144 mMessage = new QLineEdit(mExternalAppGroupBox); 144 mMessage = new QLineEdit(mExternalAppGroupBox);
145 mMessage->setReadOnly(true); 145 mMessage->setReadOnly(true);
146 boxLayout->addWidget( mMessage , 4, 0); 146 boxLayout->addWidget( mMessage , 4, 0);
147 147
148 lab = new QLabel( i18n("Parameters:"), mExternalAppGroupBox); 148 lab = new QLabel( i18n("Parameters:"), mExternalAppGroupBox);
149 boxLayout->addWidget( lab, 3, 1 ); 149 boxLayout->addWidget( lab, 3, 1 );
150 mParameters = new QLineEdit(mExternalAppGroupBox); 150 mParameters = new QLineEdit(mExternalAppGroupBox);
151 mParameters->setReadOnly(true); 151 mParameters->setReadOnly(true);
152 boxLayout->addWidget( mParameters, 4, 1 ); 152 boxLayout->addWidget( mParameters, 4, 1 );
153 153
154 lab = new QLabel( i18n("HINT: Delimiter=; Name=%1,Email=%2"), mExternalAppGroupBox); 154 lab = new QLabel( i18n("HINT: Delimiter=; Name=%1,Email=%2"), mExternalAppGroupBox);
155 boxLayout->addMultiCellWidget( lab, 5, 5, 0, 1 ); 155 boxLayout->addMultiCellWidget( lab, 5, 5, 0, 1 );
156 156
157 lab = new QLabel( i18n("extra Message:"), mExternalAppGroupBox); 157 lab = new QLabel( i18n("extra Message:"), mExternalAppGroupBox);
158 boxLayout->addWidget( lab, 6, 0 ); 158 boxLayout->addWidget( lab, 6, 0 );
159 mMessage2 = new QLineEdit(mExternalAppGroupBox); 159 mMessage2 = new QLineEdit(mExternalAppGroupBox);
160 mMessage2->setReadOnly(true); 160 mMessage2->setReadOnly(true);
161 boxLayout->addWidget( mMessage2 , 7, 0); 161 boxLayout->addWidget( mMessage2 , 7, 0);
162 162
163 lab = new QLabel( i18n("extra Parameters:"), mExternalAppGroupBox); 163 lab = new QLabel( i18n("extra Parameters:"), mExternalAppGroupBox);
164 boxLayout->addWidget( lab, 6, 1 ); 164 boxLayout->addWidget( lab, 6, 1 );
165 mParameters2 = new QLineEdit(mExternalAppGroupBox); 165 mParameters2 = new QLineEdit(mExternalAppGroupBox);
166 mParameters2->setReadOnly(true); 166 mParameters2->setReadOnly(true);
167 boxLayout->addWidget( mParameters2, 7, 1 ); 167 boxLayout->addWidget( mParameters2, 7, 1 );
168 168
169 lab = new QLabel( i18n("HINT: Emails=%1,Attachments=%2"), mExternalAppGroupBox); 169 lab = new QLabel( i18n("HINT: Emails=%1,Attachments=%2"), mExternalAppGroupBox);
170 boxLayout->addMultiCellWidget( lab, 8, 8, 0, 1 ); 170 boxLayout->addMultiCellWidget( lab, 8, 8, 0, 1 );
171 171
172 172
173 connect( mChannel, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 173 connect( mChannel, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
174 connect( mMessage, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 174 connect( mMessage, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
175 connect( mParameters, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 175 connect( mParameters, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
176 connect( mMessage2, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 176 connect( mMessage2, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
177 connect( mParameters2, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 177 connect( mParameters2, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
178 178
179 179
180 layout->addWidget( mExternalAppGroupBox ); 180 layout->addWidget( mExternalAppGroupBox );
181 tabWidget->addTab( externalAppsPage, i18n( "External Apps." ) ); 181 tabWidget->addTab( externalAppsPage, i18n( "External Apps." ) );
182 182
183} 183}
184 184
185 185
186void KDEPIMConfigWidget::setupLocaleDateTab() 186void KDEPIMConfigWidget::setupLocaleDateTab()
187{ 187{
188 QWidget *topFrame = new QWidget( this ); 188 QWidget *topFrame = new QWidget( this );
189 QGridLayout *topLayout = new QGridLayout( topFrame, 3, 2); 189 QGridLayout *topLayout = new QGridLayout( topFrame, 3, 2);
190 190
191 topLayout->setSpacing(KDialog::spacingHint()); 191 topLayout->setSpacing(KDialog::spacingHint());
192 topLayout->setMargin(KDialog::marginHint()); 192 topLayout->setMargin(KDialog::marginHint());
193 int iii = 0; 193 int iii = 0;
194 194
195 195
196 KPrefsWidRadios *syncPrefsGroup = 196 KPrefsWidRadios *syncPrefsGroup =
197 addWidRadios(i18n("Date Format:"),&(KPimGlobalPrefs::instance()->mPreferredDate),topFrame); 197 addWidRadios(i18n("Date Format:"),&(KPimGlobalPrefs::instance()->mPreferredDate),topFrame);
198 QString format; 198 QString format;
199 if ( QApplication::desktop()->width() < 480 ) 199 if ( QApplication::desktop()->width() < 480 )
200 format = "(%d.%m.%Y)"; 200 format = "(%d.%m.%Y)";
201 else 201 else
202 format = "(%d.%m.%Y|%A %d %B %Y)"; 202 format = "(%d.%m.%Y|%A %d %B %Y)";
203 syncPrefsGroup->addRadio(i18n("24.03.2004 "+format)); 203 syncPrefsGroup->addRadio(i18n("24.03.2004 "+format));
204 if ( QApplication::desktop()->width() < 480 ) 204 if ( QApplication::desktop()->width() < 480 )
205 format = "(%m.%d.%Y)"; 205 format = "(%m.%d.%Y)";
206 else 206 else
207 format = "(%m.%d.%Y|%A %B %d %Y)"; 207 format = "(%m.%d.%Y|%A %B %d %Y)";
208 syncPrefsGroup->addRadio(i18n("03.24.2004 "+format)); 208 syncPrefsGroup->addRadio(i18n("03.24.2004 "+format));
209 if ( QApplication::desktop()->width() < 480 ) 209 if ( QApplication::desktop()->width() < 480 )
210 format = "(%Y-%m-%d)"; 210 format = "(%Y-%m-%d)";
211 else 211 else
212 format = "(%Y-%m-%d|%A %Y %B %d)"; 212 format = "(%Y-%m-%d|%A %Y %B %d)";
213 syncPrefsGroup->addRadio(i18n("2004-03-24 "+format)); 213 syncPrefsGroup->addRadio(i18n("2004-03-24 "+format));
214 syncPrefsGroup->addRadio(i18n("User defined")); 214 syncPrefsGroup->addRadio(i18n("User defined"));
215 topLayout->addMultiCellWidget( (QWidget*)syncPrefsGroup->groupBox(),iii,iii,0,1); 215 topLayout->addMultiCellWidget( (QWidget*)syncPrefsGroup->groupBox(),iii,iii,0,1);
216 ++iii; 216 ++iii;
217 ++iii; 217 ++iii;
218 QLabel * lab; 218 QLabel * lab;
219 mUserDateFormatLong = new QLineEdit(topFrame); 219 mUserDateFormatLong = new QLineEdit(topFrame);
220 lab = new QLabel(mUserDateFormatLong, i18n("User long date:"), topFrame); 220 lab = new QLabel(mUserDateFormatLong, i18n("User long date:"), topFrame);
221 topLayout->addWidget(lab ,iii,0); 221 topLayout->addWidget(lab ,iii,0);
222 topLayout->addWidget(mUserDateFormatLong,iii,1); 222 topLayout->addWidget(mUserDateFormatLong,iii,1);
223 ++iii; 223 ++iii;
224 mUserDateFormatShort = new QLineEdit(topFrame); 224 mUserDateFormatShort = new QLineEdit(topFrame);
225 lab = new QLabel(mUserDateFormatShort, i18n("User short date:"), topFrame); 225 lab = new QLabel(mUserDateFormatShort, i18n("User short date:"), topFrame);
226 topLayout->addWidget(lab ,iii,0); 226 topLayout->addWidget(lab ,iii,0);
227 topLayout->addWidget(mUserDateFormatShort,iii,1); 227 topLayout->addWidget(mUserDateFormatShort,iii,1);
228 ++iii; 228 ++iii;
229 lab = new QLabel( i18n("Monday 19 April 2004: %A %d %B %Y"), topFrame); 229 lab = new QLabel( i18n("Monday 19 April 2004: %A %d %B %Y"), topFrame);
230 topLayout->addMultiCellWidget(lab ,iii,iii,0,1); 230 topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
231 ++iii; 231 ++iii;
232 lab = new QLabel( i18n("Mon 19.04.04: %a %d.%m.%y"), topFrame); 232 lab = new QLabel( i18n("Mon 19.04.04: %a %d.%m.%y"), topFrame);
233 topLayout->addMultiCellWidget(lab ,iii,iii,0,1); 233 topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
234 ++iii; 234 ++iii;
235 lab = new QLabel( i18n("Mon, 19.Apr.04: %a, %d.%b.%y"), topFrame); 235 lab = new QLabel( i18n("Mon, 19.Apr.04: %a, %d.%b.%y"), topFrame);
236 topLayout->addMultiCellWidget(lab ,iii,iii,0,1); 236 topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
237 ++iii; 237 ++iii;
238 238
239 connect( mUserDateFormatLong, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 239 connect( mUserDateFormatLong, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
240 connect( mUserDateFormatShort, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 240 connect( mUserDateFormatShort, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
241 241
242 242
243 tabWidget->addTab( topFrame, i18n( "Date Format" ) ); 243 tabWidget->addTab( topFrame, i18n( "Date Format" ) );
244} 244}
245 245
246void KDEPIMConfigWidget::setupLocaleTab() 246void KDEPIMConfigWidget::setupLocaleTab()
247{ 247{
248 248
249 QWidget *topFrame = new QWidget( this ); 249 QWidget *topFrame = new QWidget( this );
250 QGridLayout *topLayout = new QGridLayout(topFrame,4,2); 250 QGridLayout *topLayout = new QGridLayout(topFrame,4,2);
251 251
252 topLayout->setSpacing(KDialog::spacingHint()); 252 topLayout->setSpacing(KDialog::spacingHint());
253 topLayout->setMargin(KDialog::marginHint()); 253 topLayout->setMargin(KDialog::marginHint());
254 int iii = 0; 254 int iii = 0;
255 KPrefsWidRadios *syncPrefsGroup = 255 KPrefsWidRadios *syncPrefsGroup =
256 addWidRadios(i18n("Language:(needs restart)"),&(KPimGlobalPrefs::instance()->mPreferredLanguage),topFrame); 256 addWidRadios(i18n("Language:(needs restart)"),&(KPimGlobalPrefs::instance()->mPreferredLanguage),topFrame);
257 syncPrefsGroup->addRadio(i18n("English")); 257 syncPrefsGroup->addRadio(i18n("English"));
258 syncPrefsGroup->addRadio(i18n("German")); 258 syncPrefsGroup->addRadio(i18n("German"));
259 syncPrefsGroup->addRadio(i18n("French")); 259 syncPrefsGroup->addRadio(i18n("French"));
260 syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)")); 260 syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)"));
261 if ( QApplication::desktop()->width() < 300 ) 261 if ( QApplication::desktop()->width() < 300 )
262 ;// syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); 262 ;// syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical);
263 topLayout->addMultiCellWidget( (QWidget*)syncPrefsGroup->groupBox(),iii,iii,0,1); 263 topLayout->addMultiCellWidget( (QWidget*)syncPrefsGroup->groupBox(),iii,iii,0,1);
264 ++iii; 264 ++iii;
265 265
266 syncPrefsGroup = 266 syncPrefsGroup =
267 addWidRadios(i18n("Time Format(nr):"),&(KPimGlobalPrefs::instance()->mPreferredTime),topFrame); 267 addWidRadios(i18n("Time Format(nr):"),&(KPimGlobalPrefs::instance()->mPreferredTime),topFrame);
268 if ( QApplication::desktop()->width() > 300 ) 268 if ( QApplication::desktop()->width() > 300 )
269 syncPrefsGroup->groupBox()->setOrientation (Qt::Vertical); 269 syncPrefsGroup->groupBox()->setOrientation (Qt::Vertical);
270 syncPrefsGroup->addRadio(i18n("24:00")); 270 syncPrefsGroup->addRadio(i18n("24:00"));
271 syncPrefsGroup->addRadio(i18n("12:00am")); 271 syncPrefsGroup->addRadio(i18n("12:00am"));
272 syncPrefsGroup->groupBox()->setOrientation (Qt::Vertical); 272 syncPrefsGroup->groupBox()->setOrientation (Qt::Vertical);
273 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); 273 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1);
274 ++iii; 274 ++iii;
275 275
276 KPrefsWidBool *sb = addWidBool(i18n("Week starts on Sunday"), 276 KPrefsWidBool *sb = addWidBool(i18n("Week starts on Sunday"),
277 &(KPimGlobalPrefs::instance()->mWeekStartsOnSunday),topFrame); 277 &(KPimGlobalPrefs::instance()->mWeekStartsOnSunday),topFrame);
278 topLayout->addMultiCellWidget((QWidget*)sb->checkBox(), iii,iii,0,1); 278 topLayout->addMultiCellWidget((QWidget*)sb->checkBox(), iii,iii,0,1);
279 ++iii; 279 ++iii;
280 280
281 281
282 tabWidget->addTab( topFrame, i18n( "Locale" ) ); 282 tabWidget->addTab( topFrame, i18n( "Locale" ) );
283 283
284} 284}
285 285
286 286
287void KDEPIMConfigWidget::setupTimeZoneTab() 287void KDEPIMConfigWidget::setupTimeZoneTab()
288{ 288{
289 QWidget *topFrame = new QWidget( this ); 289 QWidget *topFrame = new QWidget( this );
290 QGridLayout *topLayout = new QGridLayout( topFrame, 5, 2); 290 QGridLayout *topLayout = new QGridLayout( topFrame, 5, 2);
291 topLayout->setSpacing(KDialog::spacingHint()); 291 topLayout->setSpacing(KDialog::spacingHint());
292 topLayout->setMargin(KDialog::marginHint()); 292 topLayout->setMargin(KDialog::marginHint());
293 293
294 QHBox *timeZoneBox = new QHBox( topFrame ); 294 QHBox *timeZoneBox = new QHBox( topFrame );
295 topLayout->addMultiCellWidget( timeZoneBox, 0, 0, 0, 1 ); 295 topLayout->addMultiCellWidget( timeZoneBox, 0, 0, 0, 1 );
296 296
297 new QLabel( i18n("Timezone:"), timeZoneBox ); 297 new QLabel( i18n("Timezone:"), timeZoneBox );
298 mTimeZoneCombo = new QComboBox( timeZoneBox ); 298 mTimeZoneCombo = new QComboBox( timeZoneBox );
299 if ( QApplication::desktop()->width() < 300 ) { 299 if ( QApplication::desktop()->width() < 300 ) {
300 mTimeZoneCombo->setMaximumWidth(150); 300 mTimeZoneCombo->setMaximumWidth(150);
301 } 301 }
302 302
303 QStringList list; 303 QStringList list;
304 list = KGlobal::locale()->timeZoneList(); 304 list = KGlobal::locale()->timeZoneList();
305 mTimeZoneCombo->insertStringList(list); 305 mTimeZoneCombo->insertStringList(list);
306 306
307 // find the currently set time zone and select it 307 // find the currently set time zone and select it
308 QString sCurrentlySet = KPimGlobalPrefs::instance()->mTimeZoneId; 308 QString sCurrentlySet = KPimGlobalPrefs::instance()->mTimeZoneId;
309 int nCurrentlySet = 11; 309 int nCurrentlySet = 11;
310 for (int i = 0; i < mTimeZoneCombo->count(); i++) 310 for (int i = 0; i < mTimeZoneCombo->count(); i++)
311 { 311 {
312 if (mTimeZoneCombo->text(i) == sCurrentlySet) 312 if (mTimeZoneCombo->text(i) == sCurrentlySet)
313 { 313 {
314 nCurrentlySet = i; 314 nCurrentlySet = i;
315 break; 315 break;
316 } 316 }
317 } 317 }
318 mTimeZoneCombo->setCurrentItem(nCurrentlySet); 318 mTimeZoneCombo->setCurrentItem(nCurrentlySet);
319 int iii = 1; 319 int iii = 1;
320 KPrefsWidBool *sb = 320 KPrefsWidBool *sb =
321 addWidBool(i18n("Timezone has daylight saving"), 321 addWidBool(i18n("Timezone has daylight saving"),
322 &(KPimGlobalPrefs::instance()->mUseDaylightsaving),topFrame); 322 &(KPimGlobalPrefs::instance()->mUseDaylightsaving),topFrame);
323 topLayout->addMultiCellWidget((QWidget*)sb->checkBox(), iii,iii,0,1); 323 topLayout->addMultiCellWidget((QWidget*)sb->checkBox(), iii,iii,0,1);
324 ++iii; 324 ++iii;
325 QLabel* lab = new QLabel( i18n("Actual start and end is the\nsunday before this date."), topFrame ); 325 QLabel* lab = new QLabel( i18n("Actual start and end is the\nsunday before this date."), topFrame );
326 topLayout->addMultiCellWidget(lab, iii,iii,0,1); 326 topLayout->addMultiCellWidget(lab, iii,iii,0,1);
327 ++iii; 327 ++iii;
328 lab = new QLabel( i18n("The year in the date is ignored."), topFrame ); 328 lab = new QLabel( i18n("The year in the date is ignored."), topFrame );
329 topLayout->addMultiCellWidget(lab, iii,iii,0,1); 329 topLayout->addMultiCellWidget(lab, iii,iii,0,1);
330 ++iii; 330 ++iii;
331 lab = new QLabel( i18n("Daylight start:"), topFrame ); 331 lab = new QLabel( i18n("Daylight start:"), topFrame );
332 topLayout->addWidget(lab, iii,0); 332 topLayout->addWidget(lab, iii,0);
333 mStartDateSavingEdit = new KDateEdit(topFrame); 333 mStartDateSavingEdit = new KDateEdit(topFrame);
334 topLayout->addWidget(mStartDateSavingEdit, iii,1); 334 topLayout->addWidget(mStartDateSavingEdit, iii,1);
335 ++iii; 335 ++iii;
336 336
337 lab = new QLabel( i18n("Daylight end:"), topFrame ); 337 lab = new QLabel( i18n("Daylight end:"), topFrame );
338 topLayout->addWidget(lab, iii,0); 338 topLayout->addWidget(lab, iii,0);
339 mEndDateSavingEdit = new KDateEdit(topFrame); 339 mEndDateSavingEdit = new KDateEdit(topFrame);
340 topLayout->addWidget(mEndDateSavingEdit, iii,1); 340 topLayout->addWidget(mEndDateSavingEdit, iii,1);
341 ++iii; 341 ++iii;
342 QDate current ( 2001, 1,1); 342 QDate current ( 2001, 1,1);
343 mStartDateSavingEdit->setDate(current.addDays(KPimGlobalPrefs::instance()->mDaylightsavingStart-1)); 343 mStartDateSavingEdit->setDate(current.addDays(KPimGlobalPrefs::instance()->mDaylightsavingStart-1));
344 mEndDateSavingEdit->setDate(current.addDays(KPimGlobalPrefs::instance()->mDaylightsavingEnd-1)); 344 mEndDateSavingEdit->setDate(current.addDays(KPimGlobalPrefs::instance()->mDaylightsavingEnd-1));
345 345
346 connect( mStartDateSavingEdit, SIGNAL( dateChanged(QDate)), this, SLOT( modified()) ); 346 connect( mStartDateSavingEdit, SIGNAL( dateChanged(QDate)), this, SLOT( modified()) );
347 connect( mEndDateSavingEdit, SIGNAL( dateChanged(QDate)), this, SLOT( modified()) ); 347 connect( mEndDateSavingEdit, SIGNAL( dateChanged(QDate)), this, SLOT( modified()) );
348 connect( mTimeZoneCombo, SIGNAL( activated( int ) ), this, SLOT (modified() ) ); 348 connect( mTimeZoneCombo, SIGNAL( activated( int ) ), this, SLOT (modified() ) );
349 349
350 350
351 351
352 tabWidget->addTab( topFrame, i18n( "Time Zone" ) ); 352 tabWidget->addTab( topFrame, i18n( "Time Zone" ) );
353 353
354} 354}
355 355
356void KDEPIMConfigWidget::externalapp_changed( int newApp ) 356void KDEPIMConfigWidget::externalapp_changed( int newApp )
357{ 357{
358 // first store the current data 358 // first store the current data
359 saveEditFieldSettings(); 359 saveEditFieldSettings();
360 360
361 // set mCurrentApp 361 // set mCurrentApp
362 mCurrentApp = (ExternalAppHandler::Types)newApp; 362 mCurrentApp = (ExternalAppHandler::Types)newApp;
363 363
364 // set mCurrentClient 364 // set mCurrentClient
365 switch(mCurrentApp) 365 switch(mCurrentApp)
366 { 366 {
367 case(ExternalAppHandler::EMAIL): 367 case(ExternalAppHandler::EMAIL):
368 mCurrentClient = mEmailClient; 368 mCurrentClient = mEmailClient;
369 break; 369 break;
370 case(ExternalAppHandler::PHONE): 370 case(ExternalAppHandler::PHONE):
371 mCurrentClient = mPhoneClient; 371 mCurrentClient = mPhoneClient;
372 break; 372 break;
373 case(ExternalAppHandler::SMS): 373 case(ExternalAppHandler::SMS):
374 mCurrentClient = mSMSClient; 374 mCurrentClient = mSMSClient;
375 break; 375 break;
376 case(ExternalAppHandler::FAX): 376 case(ExternalAppHandler::FAX):
377 mCurrentClient = mFaxClient; 377 mCurrentClient = mFaxClient;
378 break; 378 break;
379 case(ExternalAppHandler::PAGER): 379 case(ExternalAppHandler::PAGER):
380 mCurrentClient = mPagerClient; 380 mCurrentClient = mPagerClient;
381 break; 381 break;
382 case(ExternalAppHandler::SIP): 382 case(ExternalAppHandler::SIP):
383 mCurrentClient = mSipClient; 383 mCurrentClient = mSipClient;
384 break; 384 break;
385 default: 385 default:
386 return; 386 return;
387 } 387 }
388 388
389 // and at last update the widgets 389 // and at last update the widgets
390 updateClientWidgets(); 390 updateClientWidgets();
391} 391}
392 392
393 393
394 394
395void KDEPIMConfigWidget::client_changed( int newClient ) 395void KDEPIMConfigWidget::client_changed( int newClient )
396{ 396{
397 if (newClient == mCurrentClient) 397 if (newClient == mCurrentClient)
398 return; 398 return;
399 399
400 // first store the current data 400 // first store the current data
401 saveEditFieldSettings(); 401 saveEditFieldSettings();
402 402
403 403
404 //then reset the clientvariable 404 //then reset the clientvariable
405 mCurrentClient = newClient; 405 mCurrentClient = newClient;
406 406
407 // and at last update the widgets 407 // and at last update the widgets
408 updateClientWidgets(); 408 updateClientWidgets();
409 409
410 KPrefsWidget::modified(); 410 KPrefsWidget::modified();
411} 411}
412 412
413void KDEPIMConfigWidget::saveEditFieldSettings() 413void KDEPIMConfigWidget::saveEditFieldSettings()
414{ 414{
415 415
416 switch(mCurrentApp) 416 switch(mCurrentApp)
417 { 417 {
418 case(ExternalAppHandler::EMAIL): 418 case(ExternalAppHandler::EMAIL):
419 mEmailClient = mClient->currentItem(); 419 mEmailClient = mClient->currentItem();
420 break; 420 break;
421 case(ExternalAppHandler::PHONE): 421 case(ExternalAppHandler::PHONE):
422 mPhoneClient= mClient->currentItem(); 422 mPhoneClient= mClient->currentItem();
423 break; 423 break;
424 case(ExternalAppHandler::SMS): 424 case(ExternalAppHandler::SMS):
425 mSMSClient = mClient->currentItem(); 425 mSMSClient = mClient->currentItem();
426 break; 426 break;
427 case(ExternalAppHandler::FAX): 427 case(ExternalAppHandler::FAX):
428 mFaxClient = mClient->currentItem(); 428 mFaxClient = mClient->currentItem();
429 break; 429 break;
430 case(ExternalAppHandler::PAGER): 430 case(ExternalAppHandler::PAGER):
431 mPagerClient = mClient->currentItem(); 431 mPagerClient = mClient->currentItem();
432 break; 432 break;
433 case(ExternalAppHandler::SIP): 433 case(ExternalAppHandler::SIP):
434 mSipClient = mClient->currentItem(); 434 mSipClient = mClient->currentItem();
435 break; 435 break;
436 default: 436 default:
437 return; 437 return;
438 } 438 }
439 439
440 //store the current data back to the apropriate membervariables if we had set it to "other" 440 //store the current data back to the apropriate membervariables if we had set it to "other"
441 if ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::OTHER_EMC)) 441 if ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::OTHER_EMC))
442 { 442 {
443 mEmailOtherChannel = mChannel->text(); 443 mEmailOtherChannel = mChannel->text();
444 mEmailOtherMessage = mMessage->text(); 444 mEmailOtherMessage = mMessage->text();
445 mEmailOtherMessageParameters = mParameters->text(); 445 mEmailOtherMessageParameters = mParameters->text();
446 mEmailOtherMessage2 = mMessage2->text(); 446 mEmailOtherMessage2 = mMessage2->text();
447 mEmailOtherMessageParameters2 = mParameters2->text(); 447 mEmailOtherMessageParameters2 = mParameters2->text();
448 } 448 }
449 else if ((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::OTHER_PHC)) 449 else if ((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::OTHER_PHC))
450 { 450 {
451 mPhoneOtherChannel = mChannel->text(); 451 mPhoneOtherChannel = mChannel->text();
452 mPhoneOtherMessage = mMessage->text(); 452 mPhoneOtherMessage = mMessage->text();
453 mPhoneOtherMessageParameters = mParameters->text(); 453 mPhoneOtherMessageParameters = mParameters->text();
454 } 454 }
455 else if ((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::OTHER_SMC)) 455 else if ((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::OTHER_SMC))
456 { 456 {
457 mSMSOtherChannel = mChannel->text(); 457 mSMSOtherChannel = mChannel->text();
458 mSMSOtherMessage = mMessage->text(); 458 mSMSOtherMessage = mMessage->text();
459 mSMSOtherMessageParameters = mParameters->text(); 459 mSMSOtherMessageParameters = mParameters->text();
460 } 460 }
461 else if ((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::OTHER_FAC)) 461 else if ((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::OTHER_FAC))
462 { 462 {
463 mFaxOtherChannel = mChannel->text(); 463 mFaxOtherChannel = mChannel->text();
464 mFaxOtherMessage = mMessage->text(); 464 mFaxOtherMessage = mMessage->text();
465 mFaxOtherMessageParameters = mParameters->text(); 465 mFaxOtherMessageParameters = mParameters->text();
466 } 466 }
467 else if ((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::OTHER_PAC)) 467 else if ((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::OTHER_PAC))
468 { 468 {
469 mPagerOtherChannel = mChannel->text(); 469 mPagerOtherChannel = mChannel->text();
470 mPagerOtherMessage = mMessage->text(); 470 mPagerOtherMessage = mMessage->text();
471 mPagerOtherMessageParameters = mParameters->text(); 471 mPagerOtherMessageParameters = mParameters->text();
472 } 472 }
473 else if ((mCurrentApp == ExternalAppHandler::SIP) && (mCurrentClient == KPimGlobalPrefs::OTHER_SIC)) 473 else if ((mCurrentApp == ExternalAppHandler::SIP) && (mCurrentClient == KPimGlobalPrefs::OTHER_SIC))
474 { 474 {
475 mSipOtherChannel = mChannel->text(); 475 mSipOtherChannel = mChannel->text();
476 mSipOtherMessage = mMessage->text(); 476 mSipOtherMessage = mMessage->text();
477 mSipOtherMessageParameters = mParameters->text(); 477 mSipOtherMessageParameters = mParameters->text();
478 } 478 }
479 479
480 480
481} 481}
482 482
483void KDEPIMConfigWidget::updateClientWidgets() 483void KDEPIMConfigWidget::updateClientWidgets()
484{ 484{
485 bool blocked = signalsBlocked(); 485 bool blocked = signalsBlocked();
486 blockSignals( true ); 486 blockSignals( true );
487 487
488 // at this point we assume, that mCurrentApp and mCurrentClient are set to the values that we want to display 488 // at this point we assume, that mCurrentApp and mCurrentClient are set to the values that we want to display
489 QMap<ExternalAppHandler::Types, QString>::Iterator it = mExternalAppsMap.find ( mCurrentApp ); 489 QMap<ExternalAppHandler::Types, QString>::Iterator it = mExternalAppsMap.find ( mCurrentApp );
490 if (it == mExternalAppsMap.end()) 490 if (it == mExternalAppsMap.end())
491 return; 491 return;
492 492
493 // update group box 493 // update group box
494 mExternalAppGroupBox->setTitle(i18n( "Used %1 Client" ).arg(it.data())); 494 mExternalAppGroupBox->setTitle(i18n( "Used %1 Client" ).arg(it.data()));
495 495
496 //update the entries in the client combobox 496 //update the entries in the client combobox
497 mClient->clear(); 497 mClient->clear();
498 498
499 QList<DefaultAppItem> items = ExternalAppHandler::instance()->getAvailableDefaultItems(mCurrentApp); 499 QList<DefaultAppItem> items = ExternalAppHandler::instance()->getAvailableDefaultItems(mCurrentApp);
500 DefaultAppItem* dai; 500 DefaultAppItem* dai;
501 for ( dai=items.first(); dai != 0; dai=items.next() ) 501 for ( dai=items.first(); dai != 0; dai=items.next() )
502 { 502 {
503 mClient->insertItem( i18n(dai->_label), dai->_id ); 503 mClient->insertItem( i18n(dai->_label), dai->_id );
504 504
505 if (dai->_id == mCurrentClient) 505 if (dai->_id == mCurrentClient)
506 { 506 {
507 //restore the edit fields with the data of the local membervariables if we had set it to "other". 507 //restore the edit fields with the data of the local membervariables if we had set it to "other".
508 //Otherwise take the default data from externalapphandler. 508 //Otherwise take the default data from externalapphandler.
509 mChannel->setText(dai->_channel); 509 mChannel->setText(dai->_channel);
510 mMessage->setText(dai->_message); 510 mMessage->setText(dai->_message);
511 mParameters->setText(dai->_parameters); 511 mParameters->setText(dai->_parameters);
512 mMessage2->setText(dai->_message2); 512 mMessage2->setText(dai->_message2);
513 mParameters2->setText(dai->_parameters2); 513 mParameters2->setText(dai->_parameters2);
514 514
515 515
516 if ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::OTHER_EMC)) 516 if ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::OTHER_EMC))
517 { 517 {
518 mChannel->setText(mEmailOtherChannel); 518 mChannel->setText(mEmailOtherChannel);
519 mMessage->setText(mEmailOtherMessage); 519 mMessage->setText(mEmailOtherMessage);
520 mParameters->setText(mEmailOtherMessageParameters); 520 mParameters->setText(mEmailOtherMessageParameters);
521 mMessage2->setText(mEmailOtherMessage2); 521 mMessage2->setText(mEmailOtherMessage2);
522 mParameters2->setText(mEmailOtherMessageParameters2); 522 mParameters2->setText(mEmailOtherMessageParameters2);
523 } 523 }
524 else if ((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::OTHER_PHC)) 524 else if ((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::OTHER_PHC))
525 { 525 {
526 mChannel->setText(mPhoneOtherChannel); 526 mChannel->setText(mPhoneOtherChannel);
527 mMessage->setText(mPhoneOtherMessage); 527 mMessage->setText(mPhoneOtherMessage);
528 mParameters->setText(mPhoneOtherMessageParameters); 528 mParameters->setText(mPhoneOtherMessageParameters);
529 } 529 }
530 else if ((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::OTHER_SMC)) 530 else if ((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::OTHER_SMC))
531 { 531 {
532 mChannel->setText(mSMSOtherChannel); 532 mChannel->setText(mSMSOtherChannel);
533 mMessage->setText(mSMSOtherMessage); 533 mMessage->setText(mSMSOtherMessage);
534 mParameters->setText(mSMSOtherMessageParameters); 534 mParameters->setText(mSMSOtherMessageParameters);
535 } 535 }
536 else if ((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::OTHER_FAC)) 536 else if ((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::OTHER_FAC))
537 { 537 {
538 mChannel->setText(mFaxOtherChannel); 538 mChannel->setText(mFaxOtherChannel);
539 mMessage->setText(mFaxOtherMessage); 539 mMessage->setText(mFaxOtherMessage);
540 mParameters->setText(mFaxOtherMessageParameters); 540 mParameters->setText(mFaxOtherMessageParameters);
541 } 541 }
542 else if ((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::OTHER_PAC)) 542 else if ((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::OTHER_PAC))
543 { 543 {
544 mChannel->setText(mPagerOtherChannel); 544 mChannel->setText(mPagerOtherChannel);
545 mMessage->setText(mPagerOtherMessage); 545 mMessage->setText(mPagerOtherMessage);
546 mParameters->setText(mPagerOtherMessageParameters); 546 mParameters->setText(mPagerOtherMessageParameters);
547 } 547 }
548 else if ((mCurrentApp == ExternalAppHandler::SIP) && (mCurrentClient == KPimGlobalPrefs::OTHER_SIC)) 548 else if ((mCurrentApp == ExternalAppHandler::SIP) && (mCurrentClient == KPimGlobalPrefs::OTHER_SIC))
549 { 549 {
550 mChannel->setText(mSipOtherChannel); 550 mChannel->setText(mSipOtherChannel);
551 mMessage->setText(mSipOtherMessage); 551 mMessage->setText(mSipOtherMessage);
552 mParameters->setText(mSipOtherMessageParameters); 552 mParameters->setText(mSipOtherMessageParameters);
553 } 553 }
554 } 554 }
555 555
556 } 556 }
557 557
558 bool readonly; 558 bool readonly;
559 bool enabled; 559 bool enabled;
560 if ( ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::OTHER_EMC)) 560 if ( ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::OTHER_EMC))
561 ||((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::OTHER_PHC)) 561 ||((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::OTHER_PHC))
562 ||((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::OTHER_SMC)) 562 ||((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::OTHER_SMC))
563 ||((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::OTHER_FAC)) 563 ||((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::OTHER_FAC))
564 ||((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::OTHER_PAC)) 564 ||((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::OTHER_PAC))
565 ||((mCurrentApp == ExternalAppHandler::SIP) && (mCurrentClient == KPimGlobalPrefs::OTHER_SIC))) 565 ||((mCurrentApp == ExternalAppHandler::SIP) && (mCurrentClient == KPimGlobalPrefs::OTHER_SIC)))
566 { 566 {
567 readonly = false; 567 readonly = false;
568 } 568 }
569 else 569 else
570 { 570 {
571 readonly = true; 571 readonly = true;
572 } 572 }
573 573
574 if ( ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::NONE_EMC)) 574 if ( ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::NONE_EMC))
575 ||((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::NONE_PHC)) 575 ||((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::NONE_PHC))
576 ||((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::NONE_SMC)) 576 ||((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::NONE_SMC))
577 ||((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::NONE_FAC)) 577 ||((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::NONE_FAC))
578 ||((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::NONE_PAC)) 578 ||((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::NONE_PAC))
579 ||((mCurrentApp == ExternalAppHandler::SIP) && (mCurrentClient == KPimGlobalPrefs::NONE_SIC))) 579 ||((mCurrentApp == ExternalAppHandler::SIP) && (mCurrentClient == KPimGlobalPrefs::NONE_SIC)))
580 { 580 {
581 enabled = false; 581 enabled = false;
582 } 582 }
583 else 583 else
584 { 584 {
585 enabled = true; 585 enabled = true;
586 } 586 }
587 587
588 588
589 mChannel->setReadOnly(readonly); 589 mChannel->setReadOnly(readonly);
590 mMessage->setReadOnly(readonly); 590 mMessage->setReadOnly(readonly);
591 mParameters->setReadOnly(readonly); 591 mParameters->setReadOnly(readonly);
592 mMessage2->setReadOnly(readonly); 592 mMessage2->setReadOnly(readonly);
593 mParameters2->setReadOnly(readonly); 593 mParameters2->setReadOnly(readonly);
594 594
595 mChannel->setEnabled(enabled); 595 mChannel->setEnabled(enabled);
596 mMessage->setEnabled(enabled); 596 mMessage->setEnabled(enabled);
597 mParameters->setEnabled(enabled); 597 mParameters->setEnabled(enabled);
598 mMessage2->setEnabled(enabled); 598 mMessage2->setEnabled(enabled);
599 mParameters2->setEnabled(enabled); 599 mParameters2->setEnabled(enabled);
600 600
601 601
602 602
603 mClient->setCurrentItem(mCurrentClient); 603 mClient->setCurrentItem(mCurrentClient);
604 604
605 605
606 // enable/disable the extra message/parameter field 606 // enable/disable the extra message/parameter field
607 if (mCurrentApp == ExternalAppHandler::EMAIL) 607 if (mCurrentApp == ExternalAppHandler::EMAIL)
608 { 608 {
609 } 609 }
610 else 610 else
611 { 611 {
612 mMessage2->setText( "" ); 612 mMessage2->setText( "" );
613 mParameters2->setText( "" ); 613 mParameters2->setText( "" );
614 } 614 }
615 615
616 if (enabled == true) { 616 if (enabled == true) {
617 mMessage2->setEnabled(mCurrentApp == ExternalAppHandler::EMAIL); 617 mMessage2->setEnabled(mCurrentApp == ExternalAppHandler::EMAIL);
618 mParameters2->setEnabled(mCurrentApp == ExternalAppHandler::EMAIL); 618 mParameters2->setEnabled(mCurrentApp == ExternalAppHandler::EMAIL);
619 } 619 }
620 620
621 621
622 blockSignals( blocked ); 622 blockSignals( blocked );
623 623
624} 624}
625 625
626void KDEPIMConfigWidget::usrReadConfig() 626void KDEPIMConfigWidget::usrReadConfig()
627{ 627{
628 KPimGlobalPrefs* prefs = KPimGlobalPrefs::instance(); 628 KPimGlobalPrefs* prefs = KPimGlobalPrefs::instance();
629 629
630 bool blocked = signalsBlocked(); 630 bool blocked = signalsBlocked();
631 blockSignals( true ); 631 blockSignals( true );
632 632
633 QString dummy = prefs->mUserDateFormatLong; 633 QString dummy = prefs->mUserDateFormatLong;
634 mUserDateFormatLong->setText(dummy.replace( QRegExp("K"), QString(",") )); 634 mUserDateFormatLong->setText(dummy.replace( QRegExp("K"), QString(",") ));
635 dummy = prefs->mUserDateFormatShort; 635 dummy = prefs->mUserDateFormatShort;
636 mUserDateFormatShort->setText(dummy.replace( QRegExp("K"), QString(",") )); 636 mUserDateFormatShort->setText(dummy.replace( QRegExp("K"), QString(",") ));
637 637
638 QDate current ( 2001, 1,1); 638 QDate current ( 2001, 1,1);
639 mStartDateSavingEdit->setDate(current.addDays(prefs->mDaylightsavingStart-1)); 639 mStartDateSavingEdit->setDate(current.addDays(prefs->mDaylightsavingStart-1));
640 mEndDateSavingEdit->setDate(current.addDays(prefs->mDaylightsavingEnd-1)); 640 mEndDateSavingEdit->setDate(current.addDays(prefs->mDaylightsavingEnd-1));
641 setCombo(mTimeZoneCombo,i18n(prefs->mTimeZoneId)); 641 setCombo(mTimeZoneCombo,i18n(prefs->mTimeZoneId));
642 642
643 643
644 644
645 645
646 mEmailClient = prefs->mEmailClient; 646 mEmailClient = prefs->mEmailClient;
647 mEmailOtherChannel = prefs->mEmailOtherChannel; 647 mEmailOtherChannel = prefs->mEmailOtherChannel;
648 mEmailOtherMessage = prefs->mEmailOtherMessage; 648 mEmailOtherMessage = prefs->mEmailOtherMessage;
649 mEmailOtherMessageParameters = prefs->mEmailOtherMessageParameters; 649 mEmailOtherMessageParameters = prefs->mEmailOtherMessageParameters;
650 mEmailOtherMessage2 = prefs->mEmailOtherMessage2; 650 mEmailOtherMessage2 = prefs->mEmailOtherMessage2;
651 mEmailOtherMessageParameters2 = prefs->mEmailOtherMessageParameters2; 651 mEmailOtherMessageParameters2 = prefs->mEmailOtherMessageParameters2;
652 652
653 mPhoneClient = prefs->mPhoneClient; 653 mPhoneClient = prefs->mPhoneClient;
654 mPhoneOtherChannel = prefs->mPhoneOtherChannel; 654 mPhoneOtherChannel = prefs->mPhoneOtherChannel;
655 mPhoneOtherMessage = prefs->mPhoneOtherMessage; 655 mPhoneOtherMessage = prefs->mPhoneOtherMessage;
656 mPhoneOtherMessageParameters = prefs->mPhoneOtherMessageParameters; 656 mPhoneOtherMessageParameters = prefs->mPhoneOtherMessageParameters;
657 657
658 mFaxClient = prefs->mFaxClient; 658 mFaxClient = prefs->mFaxClient;
659 mFaxOtherChannel = prefs->mFaxOtherChannel; 659 mFaxOtherChannel = prefs->mFaxOtherChannel;
660 mFaxOtherMessage = prefs->mFaxOtherMessage; 660 mFaxOtherMessage = prefs->mFaxOtherMessage;
661 mFaxOtherMessageParameters = prefs->mFaxOtherMessageParameters; 661 mFaxOtherMessageParameters = prefs->mFaxOtherMessageParameters;
662 662
663 mSMSClient = prefs->mSMSClient; 663 mSMSClient = prefs->mSMSClient;
664 mSMSOtherChannel = prefs->mSMSOtherChannel; 664 mSMSOtherChannel = prefs->mSMSOtherChannel;
665 mSMSOtherMessage = prefs->mSMSOtherMessage; 665 mSMSOtherMessage = prefs->mSMSOtherMessage;
666 mSMSOtherMessageParameters = prefs->mSMSOtherMessageParameters; 666 mSMSOtherMessageParameters = prefs->mSMSOtherMessageParameters;
667 667
668 mPagerClient = prefs->mPagerClient; 668 mPagerClient = prefs->mPagerClient;
669 mPagerOtherChannel = prefs->mPagerOtherChannel; 669 mPagerOtherChannel = prefs->mPagerOtherChannel;
670 mPagerOtherMessage = prefs->mPagerOtherMessage; 670 mPagerOtherMessage = prefs->mPagerOtherMessage;
671 mPagerOtherMessageParameters = prefs->mPagerOtherMessageParameters; 671 mPagerOtherMessageParameters = prefs->mPagerOtherMessageParameters;
672 672
673 mSipClient = prefs->mPagerClient; 673 mSipClient = prefs->mPagerClient;
674 mSipOtherChannel = prefs->mSipOtherChannel; 674 mSipOtherChannel = prefs->mSipOtherChannel;
675 mSipOtherMessage = prefs->mSipOtherMessage; 675 mSipOtherMessage = prefs->mSipOtherMessage;
676 mSipOtherMessageParameters = prefs->mSipOtherMessageParameters; 676 mSipOtherMessageParameters = prefs->mSipOtherMessageParameters;
677 677
678 mCurrentApp = ExternalAppHandler::EMAIL; 678 mCurrentApp = ExternalAppHandler::EMAIL;
679 mCurrentClient = mEmailClient; 679 mCurrentClient = mEmailClient;
680 680
681 updateClientWidgets(); 681 updateClientWidgets();
682 682
683 blockSignals( blocked ); 683 blockSignals( blocked );
684 684
685} 685}
686 686
687void KDEPIMConfigWidget::usrWriteConfig() 687void KDEPIMConfigWidget::usrWriteConfig()
688{ 688{
689 KPimGlobalPrefs* prefs = KPimGlobalPrefs::instance(); 689 KPimGlobalPrefs* prefs = KPimGlobalPrefs::instance();
690 690
691 saveEditFieldSettings(); 691 saveEditFieldSettings();
692 692
693 693
694 prefs->mUserDateFormatShort = mUserDateFormatShort->text().replace( QRegExp(","), QString("K") ); 694 prefs->mUserDateFormatShort = mUserDateFormatShort->text().replace( QRegExp(","), QString("K") );
695 prefs->mUserDateFormatLong = mUserDateFormatLong->text().replace( QRegExp(","), QString("K") ); 695 prefs->mUserDateFormatLong = mUserDateFormatLong->text().replace( QRegExp(","), QString("K") );
696 696
697 prefs->mTimeZoneId = mTimeZoneCombo->currentText(); 697 prefs->mTimeZoneId = mTimeZoneCombo->currentText();
698 QDate date; 698 QDate date;
699 date = mStartDateSavingEdit->date(); 699 date = mStartDateSavingEdit->date();
700 int sub = 0; 700 int sub = 0;
701 if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 ) 701 if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 )
702 sub = 1; 702 sub = 1;
703 prefs->mDaylightsavingStart = date.dayOfYear()-sub; 703 prefs->mDaylightsavingStart = date.dayOfYear()-sub;
704 date = mEndDateSavingEdit->date(); 704 date = mEndDateSavingEdit->date();
705 if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 ) 705 if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 )
706 sub = 1; 706 sub = 1;
707 else 707 else
708 sub = 0; 708 sub = 0;
709 prefs->mDaylightsavingEnd = date.dayOfYear()-sub; 709 prefs->mDaylightsavingEnd = date.dayOfYear()-sub;
710 710
711 711
712 prefs->mEmailClient = mEmailClient; 712 prefs->mEmailClient = mEmailClient;
713 prefs->mEmailOtherChannel = mEmailOtherChannel; 713 prefs->mEmailOtherChannel = mEmailOtherChannel;
714 prefs->mEmailOtherMessage = mEmailOtherMessage; 714 prefs->mEmailOtherMessage = mEmailOtherMessage;
715 prefs->mEmailOtherMessageParameters = mEmailOtherMessageParameters; 715 prefs->mEmailOtherMessageParameters = mEmailOtherMessageParameters;
716 prefs->mEmailOtherMessage2 = mEmailOtherMessage2; 716 prefs->mEmailOtherMessage2 = mEmailOtherMessage2;
717 prefs->mEmailOtherMessageParameters2 = mEmailOtherMessageParameters2; 717 prefs->mEmailOtherMessageParameters2 = mEmailOtherMessageParameters2;
718 718
719 prefs->mPhoneClient = mPhoneClient; 719 prefs->mPhoneClient = mPhoneClient;
720 prefs->mPhoneOtherChannel = mPhoneOtherChannel; 720 prefs->mPhoneOtherChannel = mPhoneOtherChannel;
721 prefs->mPhoneOtherMessage = mPhoneOtherMessage; 721 prefs->mPhoneOtherMessage = mPhoneOtherMessage;
722 prefs->mPhoneOtherMessageParameters = mPhoneOtherMessageParameters; 722 prefs->mPhoneOtherMessageParameters = mPhoneOtherMessageParameters;
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
@@ -1,115 +1,132 @@
1/* 1/*
2 This file is part of libkdepim. 2 This file is part of libkdepim.
3 Copyright (c) 2002 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2002 Cornelius Schumacher <schumacher@kde.org>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
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#include <kglobal.h> 31#include <kglobal.h>
32#include <kconfig.h> 32#include <kconfig.h>
33#include <klocale.h> 33#include <klocale.h>
34#include <kdebug.h> 34#include <kdebug.h>
35#include <kstaticdeleter.h> 35#include <kstaticdeleter.h>
36 36
37#include "kpimglobalprefs.h" 37#include "kpimglobalprefs.h"
38 38
39KPimGlobalPrefs *KPimGlobalPrefs::sInstance = 0; 39KPimGlobalPrefs *KPimGlobalPrefs::sInstance = 0;
40static KStaticDeleter<KPimGlobalPrefs> staticDeleter; 40static KStaticDeleter<KPimGlobalPrefs> staticDeleter;
41 41
42 42
43KPimGlobalPrefs::KPimGlobalPrefs( const QString &name ) 43KPimGlobalPrefs::KPimGlobalPrefs( const QString &name )
44 : KPrefs("microkdeglobalrc") 44 : KPrefs("microkdeglobalrc")
45{ 45{
46 46
47 KPrefs::setCurrentGroup("Locale"); 47 KPrefs::setCurrentGroup("Locale");
48 addItemInt("PreferredLanguage",&mPreferredLanguage,0); 48 addItemInt("PreferredLanguage",&mPreferredLanguage,0);
49 addItemInt("PreferredTime",&mPreferredTime,0); 49 addItemInt("PreferredTime",&mPreferredTime,0);
50 addItemInt("PreferredDate",&mPreferredDate,0); 50 addItemInt("PreferredDate",&mPreferredDate,0);
51 addItemBool("WeekStartsOnSunday",&mWeekStartsOnSunday,false); 51 addItemBool("WeekStartsOnSunday",&mWeekStartsOnSunday,false);
52 //addItemBool("QuickSavingWOUnicode",&mUseQuicksave,false); 52 //addItemBool("QuickSavingWOUnicode",&mUseQuicksave,false);
53 // addItemBool("ShortDateInViewer",&mShortDateInViewer,false); 53 // addItemBool("ShortDateInViewer",&mShortDateInViewer,false);
54 addItemString("UserDateFormatLong", &mUserDateFormatLong, "%A %d %b %y"); 54 addItemString("UserDateFormatLong", &mUserDateFormatLong, "%A %d %b %y");
55 addItemString("UserDateFormatShort", &mUserDateFormatShort, "%aK %d.%m.%y"); 55 addItemString("UserDateFormatShort", &mUserDateFormatShort, "%aK %d.%m.%y");
56 56
57 KPrefs::setCurrentGroup("Time & Date"); 57 KPrefs::setCurrentGroup("Time & Date");
58 58
59 addItemString("TimeZoneName",&mTimeZoneId,i18n ("+01:00 Europe/Oslo(CET)") ); 59 addItemString("TimeZoneName",&mTimeZoneId,i18n ("+01:00 Europe/Oslo(CET)") );
60 addItemBool("UseDaylightsaving",&mUseDaylightsaving,true); 60 addItemBool("UseDaylightsaving",&mUseDaylightsaving,true);
61 addItemInt("DaylightsavingStart",&mDaylightsavingStart,90); 61 addItemInt("DaylightsavingStart",&mDaylightsavingStart,90);
62 addItemInt("DaylightsavingEnd",&mDaylightsavingEnd,304); 62 addItemInt("DaylightsavingEnd",&mDaylightsavingEnd,304);
63 63
64 64
65 65
66 66
67 KPrefs::setCurrentGroup( "ExternalApplications" ); 67 KPrefs::setCurrentGroup( "ExternalApplications" );
68 68
69 addItemInt( "EmailChannelType", &mEmailClient, OMPI_EMC ); 69 addItemInt( "EmailChannelType", &mEmailClient, OMPI_EMC );
70 addItemString( "EmailChannel", &mEmailOtherChannel, "" ); 70 addItemString( "EmailChannel", &mEmailOtherChannel, "" );
71 addItemString( "EmailChannelMessage", &mEmailOtherMessage, "" ); 71 addItemString( "EmailChannelMessage", &mEmailOtherMessage, "" );
72 addItemString( "EmailChannelParameters", &mEmailOtherMessageParameters, "" ); 72 addItemString( "EmailChannelParameters", &mEmailOtherMessageParameters, "" );
73 addItemString( "EmailChannelMessage2", &mEmailOtherMessage2, "" ); 73 addItemString( "EmailChannelMessage2", &mEmailOtherMessage2, "" );
74 addItemString( "EmailChannelParameters2", &mEmailOtherMessageParameters2, "" ); 74 addItemString( "EmailChannelParameters2", &mEmailOtherMessageParameters2, "" );
75 75
76 addItemInt( "PhoneChannelType", &mPhoneClient, KPPI_PHC ); 76 addItemInt( "PhoneChannelType", &mPhoneClient, KPPI_PHC );
77 addItemString( "PhoneChannel", &mPhoneOtherChannel, "" ); 77 addItemString( "PhoneChannel", &mPhoneOtherChannel, "" );
78 addItemString( "PhoneChannelMessage", &mPhoneOtherMessage, "" ); 78 addItemString( "PhoneChannelMessage", &mPhoneOtherMessage, "" );
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
@@ -1,137 +1,135 @@
1/* 1/*
2 This file is part of libkdepim. 2 This file is part of libkdepim.
3 Copyright (c) 2004 Ulf Schenk 3 Copyright (c) 2004 Ulf Schenk
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
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 };
64 65
65 enum SMSClients { 66 enum SMSClients {
66 NONE_SMC = 0, 67 NONE_SMC = 0,
67 OTHER_SMC = 1 68 OTHER_SMC = 1
68 }; 69 };
69 70
70 enum PagerClients { 71 enum PagerClients {
71 NONE_PAC = 0, 72 NONE_PAC = 0,
72 OTHER_PAC = 1 73 OTHER_PAC = 1
73 }; 74 };
74 75
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;
126 QString mPagerOtherMessage; 124 QString mPagerOtherMessage;
127 QString mPagerOtherMessageParameters; 125 QString mPagerOtherMessageParameters;
128 126
129 int mSipClient; 127 int mSipClient;
130 QString mSipOtherChannel; 128 QString mSipOtherChannel;
131 QString mSipOtherMessage; 129 QString mSipOtherMessage;
132 QString mSipOtherMessageParameters; 130 QString mSipOtherMessageParameters;
133 131
134 132
135}; 133};
136 134
137#endif 135#endif