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