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