summaryrefslogtreecommitdiffabout
path: root/libkdepim/kcmconfigs
Unidiff
Diffstat (limited to 'libkdepim/kcmconfigs') (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 073ab74..03034b4 100644
--- a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
+++ b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
@@ -1,422 +1,423 @@
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 40
40#include <kdialog.h> 41#include <kdialog.h>
41#include <klocale.h> 42#include <klocale.h>
42#include <kdateedit.h> 43#include <kdateedit.h>
43#include <kglobal.h> 44#include <kglobal.h>
44#include <stdlib.h> 45#include <stdlib.h>
45 46
46/*US 47/*US
47#include <qcheckbox.h> 48#include <qcheckbox.h>
48#include <qframe.h> 49#include <qframe.h>
49#include <qpushbutton.h> 50#include <qpushbutton.h>
50#include <qcombobox.h> 51#include <qcombobox.h>
51#include <qlineedit.h> 52#include <qlineedit.h>
52#include <qlabel.h> 53#include <qlabel.h>
53#include <qfile.h> 54#include <qfile.h>
54 55
55#include <kconfig.h> 56#include <kconfig.h>
56#include <kdebug.h> 57#include <kdebug.h>
57#include <kdialog.h> 58#include <kdialog.h>
58#include <klistview.h> 59#include <klistview.h>
59#include <klocale.h> 60#include <klocale.h>
60#include <kglobal.h> 61#include <kglobal.h>
61#include <kmessagebox.h> 62#include <kmessagebox.h>
62#include <kstandarddirs.h> 63#include <kstandarddirs.h>
63 64
64#ifndef KAB_EMBEDDED 65#ifndef KAB_EMBEDDED
65#include <ktrader.h> 66#include <ktrader.h>
66#else // KAB_EMBEDDED 67#else // KAB_EMBEDDED
67#include <mergewidget.h> 68#include <mergewidget.h>
68#include <distributionlistwidget.h> 69#include <distributionlistwidget.h>
69#endif // KAB_EMBEDDED 70#endif // KAB_EMBEDDED
70 71
71#include "addresseewidget.h" 72#include "addresseewidget.h"
72#include "extensionconfigdialog.h" 73#include "extensionconfigdialog.h"
73#include "extensionwidget.h" 74#include "extensionwidget.h"
74*/ 75*/
75 76
76#include "qapplication.h" 77#include "qapplication.h"
77 78
78#include "kpimglobalprefs.h" 79#include "kpimglobalprefs.h"
79 80
80#include "kdepimconfigwidget.h" 81#include "kdepimconfigwidget.h"
81 82
82 83
83KDEPIMConfigWidget::KDEPIMConfigWidget(KPimGlobalPrefs *prefs, QWidget *parent, const char *name ) 84KDEPIMConfigWidget::KDEPIMConfigWidget(KPimGlobalPrefs *prefs, QWidget *parent, const char *name )
84 : KPrefsWidget(prefs, parent, name ) 85 : KPrefsWidget(prefs, parent, name )
85{ 86{
86 mExternalAppsMap.insert(ExternalAppHandler::EMAIL, i18n("Email")); 87 mExternalAppsMap.insert(ExternalAppHandler::EMAIL, i18n("Email"));
87 mExternalAppsMap.insert(ExternalAppHandler::PHONE, i18n("Phone")); 88 mExternalAppsMap.insert(ExternalAppHandler::PHONE, i18n("Phone"));
88 mExternalAppsMap.insert(ExternalAppHandler::SMS, i18n("SMS")); 89 mExternalAppsMap.insert(ExternalAppHandler::SMS, i18n("SMS"));
89 mExternalAppsMap.insert(ExternalAppHandler::FAX, i18n("Fax")); 90 mExternalAppsMap.insert(ExternalAppHandler::FAX, i18n("Fax"));
90 mExternalAppsMap.insert(ExternalAppHandler::PAGER, i18n("Pager")); 91 mExternalAppsMap.insert(ExternalAppHandler::PAGER, i18n("Pager"));
91 mExternalAppsMap.insert(ExternalAppHandler::SIP, i18n("SIP")); 92 mExternalAppsMap.insert(ExternalAppHandler::SIP, i18n("SIP"));
92 93
93 94
94 QVBoxLayout *topLayout = new QVBoxLayout( this, 0, 95 QVBoxLayout *topLayout = new QVBoxLayout( this, 0,
95 KDialog::spacingHint() ); 96 KDialog::spacingHint() );
96 97
97 tabWidget = new QTabWidget( this ); 98 tabWidget = new QTabWidget( this );
98 topLayout->addWidget( tabWidget ); 99 topLayout->addWidget( tabWidget );
99 100
100 101
101 setupLocaleTab(); 102 setupLocaleTab();
102 setupLocaleDateTab(); 103 setupLocaleDateTab();
103 setupTimeZoneTab(); 104 setupTimeZoneTab();
104 setupExternalAppTab(); 105 setupExternalAppTab();
105 106
106} 107}
107void KDEPIMConfigWidget::showTimeZoneTab() 108void KDEPIMConfigWidget::showTimeZoneTab()
108{ 109{
109 tabWidget->setCurrentPage ( 2 ) ; 110 tabWidget->setCurrentPage ( 2 ) ;
110} 111}
111void KDEPIMConfigWidget::setupExternalAppTab() 112void KDEPIMConfigWidget::setupExternalAppTab()
112{ 113{
113 QWidget *externalAppsPage = new QWidget( this ); 114 QWidget *externalAppsPage = new QWidget( this );
114 QVBoxLayout* layout = new QVBoxLayout( externalAppsPage, KDialog::marginHintSmall(), 115 QVBoxLayout* layout = new QVBoxLayout( externalAppsPage, KDialog::marginHintSmall(),
115 KDialog::spacingHintSmall() ); 116 KDialog::spacingHintSmall() );
116 117
117 mExternalApps = new QComboBox( externalAppsPage ); 118 mExternalApps = new QComboBox( externalAppsPage );
118 119
119 QMap<ExternalAppHandler::Types, QString>::Iterator it; 120 QMap<ExternalAppHandler::Types, QString>::Iterator it;
120 for( it = mExternalAppsMap.begin(); it != mExternalAppsMap.end(); ++it ) 121 for( it = mExternalAppsMap.begin(); it != mExternalAppsMap.end(); ++it )
121 mExternalApps->insertItem( it.data(), it.key() ); 122 mExternalApps->insertItem( it.data(), it.key() );
122 123
123 layout->addWidget( mExternalApps ); 124 layout->addWidget( mExternalApps );
124 125
125 connect( mExternalApps, SIGNAL( activated( int ) ), 126 connect( mExternalApps, SIGNAL( activated( int ) ),
126 this, SLOT (externalapp_changed( int ) ) ); 127 this, SLOT (externalapp_changed( int ) ) );
127 128
128 129
129 mExternalAppGroupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Used Mail Client" ), externalAppsPage ); 130 mExternalAppGroupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Used Mail Client" ), externalAppsPage );
130 QGridLayout *boxLayout = new QGridLayout( mExternalAppGroupBox->layout(), 4, 2, -1, "gridlayout" ); 131 QGridLayout *boxLayout = new QGridLayout( mExternalAppGroupBox->layout(), 4, 2, -1, "gridlayout" );
131 132
132 133
133 mClient = new QComboBox( mExternalAppGroupBox ); 134 mClient = new QComboBox( mExternalAppGroupBox );
134 boxLayout->addMultiCellWidget( mClient, 0, 0, 0, 1 ); 135 boxLayout->addMultiCellWidget( mClient, 0, 0, 0, 1 );
135 136
136 connect( mClient, SIGNAL( activated( int ) ), 137 connect( mClient, SIGNAL( activated( int ) ),
137 this, SLOT (client_changed( int ) ) ); 138 this, SLOT (client_changed( int ) ) );
138 139
139 QLabel* lab = new QLabel( i18n("Channel:"), mExternalAppGroupBox); 140 QLabel* lab = new QLabel( i18n("Channel:"), mExternalAppGroupBox);
140 boxLayout->addWidget( lab, 1, 0 ); 141 boxLayout->addWidget( lab, 1, 0 );
141 mChannel = new QLineEdit(mExternalAppGroupBox); 142 mChannel = new QLineEdit(mExternalAppGroupBox);
142 mChannel->setReadOnly(true); 143 mChannel->setReadOnly(true);
143 boxLayout->addMultiCellWidget( mChannel, 2 , 2, 0, 1 ); 144 boxLayout->addMultiCellWidget( mChannel, 2 , 2, 0, 1 );
144 145
145 lab = new QLabel( i18n("Message:"), mExternalAppGroupBox); 146 lab = new QLabel( i18n("Message:"), mExternalAppGroupBox);
146 boxLayout->addWidget( lab, 3, 0 ); 147 boxLayout->addWidget( lab, 3, 0 );
147 mMessage = new QLineEdit(mExternalAppGroupBox); 148 mMessage = new QLineEdit(mExternalAppGroupBox);
148 mMessage->setReadOnly(true); 149 mMessage->setReadOnly(true);
149 boxLayout->addWidget( mMessage , 4, 0); 150 boxLayout->addWidget( mMessage , 4, 0);
150 151
151 lab = new QLabel( i18n("Parameters:"), mExternalAppGroupBox); 152 lab = new QLabel( i18n("Parameters:"), mExternalAppGroupBox);
152 boxLayout->addWidget( lab, 3, 1 ); 153 boxLayout->addWidget( lab, 3, 1 );
153 mParameters = new QLineEdit(mExternalAppGroupBox); 154 mParameters = new QLineEdit(mExternalAppGroupBox);
154 mParameters->setReadOnly(true); 155 mParameters->setReadOnly(true);
155 boxLayout->addWidget( mParameters, 4, 1 ); 156 boxLayout->addWidget( mParameters, 4, 1 );
156 157
157 lab = new QLabel( i18n("HINT: Delimiter=; Name=%1,Email=%2"), mExternalAppGroupBox); 158 lab = new QLabel( i18n("HINT: Delimiter=; Name=%1,Email=%2"), mExternalAppGroupBox);
158 boxLayout->addMultiCellWidget( lab, 5, 5, 0, 1 ); 159 boxLayout->addMultiCellWidget( lab, 5, 5, 0, 1 );
159 160
160 lab = new QLabel( i18n("extra Message:"), mExternalAppGroupBox); 161 lab = new QLabel( i18n("extra Message:"), mExternalAppGroupBox);
161 boxLayout->addWidget( lab, 6, 0 ); 162 boxLayout->addWidget( lab, 6, 0 );
162 mMessage2 = new QLineEdit(mExternalAppGroupBox); 163 mMessage2 = new QLineEdit(mExternalAppGroupBox);
163 mMessage2->setReadOnly(true); 164 mMessage2->setReadOnly(true);
164 boxLayout->addWidget( mMessage2 , 7, 0); 165 boxLayout->addWidget( mMessage2 , 7, 0);
165 166
166 lab = new QLabel( i18n("extra Parameters:"), mExternalAppGroupBox); 167 lab = new QLabel( i18n("extra Parameters:"), mExternalAppGroupBox);
167 boxLayout->addWidget( lab, 6, 1 ); 168 boxLayout->addWidget( lab, 6, 1 );
168 mParameters2 = new QLineEdit(mExternalAppGroupBox); 169 mParameters2 = new QLineEdit(mExternalAppGroupBox);
169 mParameters2->setReadOnly(true); 170 mParameters2->setReadOnly(true);
170 boxLayout->addWidget( mParameters2, 7, 1 ); 171 boxLayout->addWidget( mParameters2, 7, 1 );
171 172
172 lab = new QLabel( i18n("HINT: Emails=%1,Attachments=%2"), mExternalAppGroupBox); 173 lab = new QLabel( i18n("HINT: Emails=%1,Attachments=%2"), mExternalAppGroupBox);
173 boxLayout->addMultiCellWidget( lab, 8, 8, 0, 1 ); 174 boxLayout->addMultiCellWidget( lab, 8, 8, 0, 1 );
174 175
175 176
176 connect( mChannel, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 177 connect( mChannel, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
177 connect( mMessage, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 178 connect( mMessage, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
178 connect( mParameters, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 179 connect( mParameters, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
179 connect( mMessage2, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 180 connect( mMessage2, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
180 connect( mParameters2, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 181 connect( mParameters2, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
181 182
182 183
183 layout->addWidget( mExternalAppGroupBox ); 184 layout->addWidget( mExternalAppGroupBox );
184 tabWidget->addTab( externalAppsPage, i18n( "External Apps." ) ); 185 tabWidget->addTab( externalAppsPage, i18n( "External Apps." ) );
185 186
186} 187}
187 188
188 189
189void KDEPIMConfigWidget::setupLocaleDateTab() 190void KDEPIMConfigWidget::setupLocaleDateTab()
190{ 191{
191 QWidget *topFrame = new QWidget( this ); 192 QWidget *topFrame = new QWidget( this );
192 QGridLayout *topLayout = new QGridLayout( topFrame, 3, 2); 193 QGridLayout *topLayout = new QGridLayout( topFrame, 3, 2);
193 194
194 topLayout->setSpacing(KDialog::spacingHint()); 195 topLayout->setSpacing(KDialog::spacingHint());
195 topLayout->setMargin(KDialog::marginHint()); 196 topLayout->setMargin(KDialog::marginHint());
196 int iii = 0; 197 int iii = 0;
197 198
198 199
199 KPrefsWidRadios *syncPrefsGroup = 200 KPrefsWidRadios *syncPrefsGroup =
200 addWidRadios(i18n("Date Format:"),&(KPimGlobalPrefs::instance()->mPreferredDate),topFrame); 201 addWidRadios(i18n("Date Format:"),&(KPimGlobalPrefs::instance()->mPreferredDate),topFrame);
201 QString format; 202 QString format;
202 if ( QApplication::desktop()->width() < 480 ) 203 if ( QApplication::desktop()->width() < 480 )
203 format = "(%d.%m.%Y)"; 204 format = "(%d.%m.%Y)";
204 else 205 else
205 format = "(%d.%m.%Y|%A %d %B %Y)"; 206 format = "(%d.%m.%Y|%A %d %B %Y)";
206 syncPrefsGroup->addRadio(i18n("24.03.2004 "+format)); 207 syncPrefsGroup->addRadio(i18n("24.03.2004 "+format));
207 if ( QApplication::desktop()->width() < 480 ) 208 if ( QApplication::desktop()->width() < 480 )
208 format = "(%m.%d.%Y)"; 209 format = "(%m.%d.%Y)";
209 else 210 else
210 format = "(%m.%d.%Y|%A %B %d %Y)"; 211 format = "(%m.%d.%Y|%A %B %d %Y)";
211 syncPrefsGroup->addRadio(i18n("03.24.2004 "+format)); 212 syncPrefsGroup->addRadio(i18n("03.24.2004 "+format));
212 if ( QApplication::desktop()->width() < 480 ) 213 if ( QApplication::desktop()->width() < 480 )
213 format = "(%Y-%m-%d)"; 214 format = "(%Y-%m-%d)";
214 else 215 else
215 format = "(%Y-%m-%d|%A %Y %B %d)"; 216 format = "(%Y-%m-%d|%A %Y %B %d)";
216 syncPrefsGroup->addRadio(i18n("2004-03-24 "+format)); 217 syncPrefsGroup->addRadio(i18n("2004-03-24 "+format));
217 syncPrefsGroup->addRadio(i18n("User defined")); 218 syncPrefsGroup->addRadio(i18n("User defined"));
218 topLayout->addMultiCellWidget( (QWidget*)syncPrefsGroup->groupBox(),iii,iii,0,1); 219 topLayout->addMultiCellWidget( (QWidget*)syncPrefsGroup->groupBox(),iii,iii,0,1);
219 ++iii; 220 ++iii;
220 ++iii; 221 ++iii;
221 QLabel * lab; 222 QLabel * lab;
222 mUserDateFormatLong = new QLineEdit(topFrame); 223 mUserDateFormatLong = new QLineEdit(topFrame);
223 lab = new QLabel(mUserDateFormatLong, i18n("User long date:"), topFrame); 224 lab = new QLabel(mUserDateFormatLong, i18n("User long date:"), topFrame);
224 topLayout->addWidget(lab ,iii,0); 225 topLayout->addWidget(lab ,iii,0);
225 topLayout->addWidget(mUserDateFormatLong,iii,1); 226 topLayout->addWidget(mUserDateFormatLong,iii,1);
226 ++iii; 227 ++iii;
227 mUserDateFormatShort = new QLineEdit(topFrame); 228 mUserDateFormatShort = new QLineEdit(topFrame);
228 lab = new QLabel(mUserDateFormatShort, i18n("User short date:"), topFrame); 229 lab = new QLabel(mUserDateFormatShort, i18n("User short date:"), topFrame);
229 topLayout->addWidget(lab ,iii,0); 230 topLayout->addWidget(lab ,iii,0);
230 topLayout->addWidget(mUserDateFormatShort,iii,1); 231 topLayout->addWidget(mUserDateFormatShort,iii,1);
231 ++iii; 232 ++iii;
232 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);
233 topLayout->addMultiCellWidget(lab ,iii,iii,0,1); 234 topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
234 ++iii; 235 ++iii;
235 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);
236 topLayout->addMultiCellWidget(lab ,iii,iii,0,1); 237 topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
237 ++iii; 238 ++iii;
238 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);
239 topLayout->addMultiCellWidget(lab ,iii,iii,0,1); 240 topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
240 ++iii; 241 ++iii;
241 242
242 connect( mUserDateFormatLong, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 243 connect( mUserDateFormatLong, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
243 connect( mUserDateFormatShort, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 244 connect( mUserDateFormatShort, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
244 245
245 246
246 tabWidget->addTab( topFrame, i18n( "Date Format" ) ); 247 tabWidget->addTab( topFrame, i18n( "Date Format" ) );
247} 248}
248 249
249void KDEPIMConfigWidget::setupLocaleTab() 250void KDEPIMConfigWidget::setupLocaleTab()
250{ 251{
251 252
252 QWidget *topFrame = new QWidget( this ); 253 QWidget *topFrame = new QWidget( this );
253 QGridLayout *topLayout = new QGridLayout(topFrame,4,2); 254 QGridLayout *topLayout = new QGridLayout(topFrame,4,2);
254 255
255 topLayout->setSpacing(KDialog::spacingHint()); 256 topLayout->setSpacing(KDialog::spacingHint());
256 topLayout->setMargin(KDialog::marginHint()); 257 topLayout->setMargin(KDialog::marginHint());
257 int iii = 0; 258 int iii = 0;
258 KPrefsWidRadios *syncPrefsGroup = 259 KPrefsWidRadios *syncPrefsGroup =
259 addWidRadios(i18n("Language:(needs restart)"),&(KPimGlobalPrefs::instance()->mPreferredLanguage),topFrame); 260 addWidRadios(i18n("Language:(needs restart)"),&(KPimGlobalPrefs::instance()->mPreferredLanguage),topFrame);
260 syncPrefsGroup->addRadio(i18n("English")); 261 syncPrefsGroup->addRadio(i18n("English"));
261 syncPrefsGroup->addRadio(i18n("German")); 262 syncPrefsGroup->addRadio(i18n("German"));
262 syncPrefsGroup->addRadio(i18n("French")); 263 syncPrefsGroup->addRadio(i18n("French"));
263 syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)")); 264 syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)"));
264 if ( QApplication::desktop()->width() < 300 ) 265 if ( QApplication::desktop()->width() < 300 )
265 ;// syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); 266 ;// syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical);
266 topLayout->addMultiCellWidget( (QWidget*)syncPrefsGroup->groupBox(),iii,iii,0,1); 267 topLayout->addMultiCellWidget( (QWidget*)syncPrefsGroup->groupBox(),iii,iii,0,1);
267 ++iii; 268 ++iii;
268 269
269 syncPrefsGroup = 270 syncPrefsGroup =
270 addWidRadios(i18n("Time Format(nr):"),&(KPimGlobalPrefs::instance()->mPreferredTime),topFrame); 271 addWidRadios(i18n("Time Format(nr):"),&(KPimGlobalPrefs::instance()->mPreferredTime),topFrame);
271 if ( QApplication::desktop()->width() > 300 ) 272 if ( QApplication::desktop()->width() > 300 )
272 syncPrefsGroup->groupBox()->setOrientation (Qt::Vertical); 273 syncPrefsGroup->groupBox()->setOrientation (Qt::Vertical);
273 syncPrefsGroup->addRadio(i18n("24:00")); 274 syncPrefsGroup->addRadio(i18n("24:00"));
274 syncPrefsGroup->addRadio(i18n("12:00am")); 275 syncPrefsGroup->addRadio(i18n("12:00am"));
275 syncPrefsGroup->groupBox()->setOrientation (Qt::Vertical); 276 syncPrefsGroup->groupBox()->setOrientation (Qt::Vertical);
276 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); 277 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1);
277 ++iii; 278 ++iii;
278 279
279 KPrefsWidBool *sb = addWidBool(i18n("Week starts on Sunday"), 280 KPrefsWidBool *sb = addWidBool(i18n("Week starts on Sunday"),
280 &(KPimGlobalPrefs::instance()->mWeekStartsOnSunday),topFrame); 281 &(KPimGlobalPrefs::instance()->mWeekStartsOnSunday),topFrame);
281 topLayout->addMultiCellWidget((QWidget*)sb->checkBox(), iii,iii,0,1); 282 topLayout->addMultiCellWidget((QWidget*)sb->checkBox(), iii,iii,0,1);
282 ++iii; 283 ++iii;
283 284
284 285
285 tabWidget->addTab( topFrame, i18n( "Locale" ) ); 286 tabWidget->addTab( topFrame, i18n( "Locale" ) );
286 287
287} 288}
288 289
289 290
290void KDEPIMConfigWidget::setupTimeZoneTab() 291void KDEPIMConfigWidget::setupTimeZoneTab()
291{ 292{
292 QWidget *topFrame = new QWidget( this ); 293 QWidget *topFrame = new QWidget( this );
293 QGridLayout *topLayout = new QGridLayout( topFrame, 5, 2); 294 QGridLayout *topLayout = new QGridLayout( topFrame, 5, 2);
294 topLayout->setSpacing(KDialog::spacingHint()); 295 topLayout->setSpacing(KDialog::spacingHint());
295 topLayout->setMargin(KDialog::marginHint()); 296 topLayout->setMargin(KDialog::marginHint());
296 297
297 QHBox *timeZoneBox = new QHBox( topFrame ); 298 QHBox *timeZoneBox = new QHBox( topFrame );
298 topLayout->addMultiCellWidget( timeZoneBox, 0, 0, 0, 1 ); 299 topLayout->addMultiCellWidget( timeZoneBox, 0, 0, 0, 1 );
299 300
300 new QLabel( i18n("Timezone:"), timeZoneBox ); 301 new QLabel( i18n("Timezone:"), timeZoneBox );
301 mTimeZoneCombo = new QComboBox( timeZoneBox ); 302 mTimeZoneCombo = new QComboBox( timeZoneBox );
302 if ( QApplication::desktop()->width() < 300 ) { 303 if ( QApplication::desktop()->width() < 300 ) {
303 mTimeZoneCombo->setMaximumWidth(150); 304 mTimeZoneCombo->setMaximumWidth(150);
304 } 305 }
305 306
306 QStringList list; 307 QStringList list;
307 list = KGlobal::locale()->timeZoneList(); 308 list = KGlobal::locale()->timeZoneList();
308 mTimeZoneCombo->insertStringList(list); 309 mTimeZoneCombo->insertStringList(list);
309 310
310 // find the currently set time zone and select it 311 // find the currently set time zone and select it
311 QString sCurrentlySet = KPimGlobalPrefs::instance()->mTimeZoneId; 312 QString sCurrentlySet = KPimGlobalPrefs::instance()->mTimeZoneId;
312 int nCurrentlySet = 11; 313 int nCurrentlySet = 11;
313 for (int i = 0; i < mTimeZoneCombo->count(); i++) 314 for (int i = 0; i < mTimeZoneCombo->count(); i++)
314 { 315 {
315 if (mTimeZoneCombo->text(i) == sCurrentlySet) 316 if (mTimeZoneCombo->text(i) == sCurrentlySet)
316 { 317 {
317 nCurrentlySet = i; 318 nCurrentlySet = i;
318 break; 319 break;
319 } 320 }
320 } 321 }
321 mTimeZoneCombo->setCurrentItem(nCurrentlySet); 322 mTimeZoneCombo->setCurrentItem(nCurrentlySet);
322 int iii = 1; 323 int iii = 1;
323 KPrefsWidBool *sb = 324 KPrefsWidBool *sb =
324 addWidBool(i18n("Timezone has daylight saving"), 325 addWidBool(i18n("Timezone has daylight saving"),
325 &(KPimGlobalPrefs::instance()->mUseDaylightsaving),topFrame); 326 &(KPimGlobalPrefs::instance()->mUseDaylightsaving),topFrame);
326 topLayout->addMultiCellWidget((QWidget*)sb->checkBox(), iii,iii,0,1); 327 topLayout->addMultiCellWidget((QWidget*)sb->checkBox(), iii,iii,0,1);
327 ++iii; 328 ++iii;
328 QLabel* lab = new QLabel( i18n("Actual start and end is the\nsunday before this date."), topFrame ); 329 QLabel* lab = new QLabel( i18n("Actual start and end is the\nsunday before this date."), topFrame );
329 topLayout->addMultiCellWidget(lab, iii,iii,0,1); 330 topLayout->addMultiCellWidget(lab, iii,iii,0,1);
330 ++iii; 331 ++iii;
331 lab = new QLabel( i18n("The year in the date is ignored."), topFrame ); 332 lab = new QLabel( i18n("The year in the date is ignored."), topFrame );
332 topLayout->addMultiCellWidget(lab, iii,iii,0,1); 333 topLayout->addMultiCellWidget(lab, iii,iii,0,1);
333 ++iii; 334 ++iii;
334 lab = new QLabel( i18n("Daylight start:"), topFrame ); 335 lab = new QLabel( i18n("Daylight start:"), topFrame );
335 topLayout->addWidget(lab, iii,0); 336 topLayout->addWidget(lab, iii,0);
336 mStartDateSavingEdit = new KDateEdit(topFrame); 337 mStartDateSavingEdit = new KDateEdit(topFrame);
337 topLayout->addWidget(mStartDateSavingEdit, iii,1); 338 topLayout->addWidget(mStartDateSavingEdit, iii,1);
338 ++iii; 339 ++iii;
339 340
340 lab = new QLabel( i18n("Daylight end:"), topFrame ); 341 lab = new QLabel( i18n("Daylight end:"), topFrame );
341 topLayout->addWidget(lab, iii,0); 342 topLayout->addWidget(lab, iii,0);
342 mEndDateSavingEdit = new KDateEdit(topFrame); 343 mEndDateSavingEdit = new KDateEdit(topFrame);
343 topLayout->addWidget(mEndDateSavingEdit, iii,1); 344 topLayout->addWidget(mEndDateSavingEdit, iii,1);
344 ++iii; 345 ++iii;
345 QDate current ( 2001, 1,1); 346 QDate current ( 2001, 1,1);
346 mStartDateSavingEdit->setDate(current.addDays(KPimGlobalPrefs::instance()->mDaylightsavingStart-1)); 347 mStartDateSavingEdit->setDate(current.addDays(KPimGlobalPrefs::instance()->mDaylightsavingStart-1));
347 mEndDateSavingEdit->setDate(current.addDays(KPimGlobalPrefs::instance()->mDaylightsavingEnd-1)); 348 mEndDateSavingEdit->setDate(current.addDays(KPimGlobalPrefs::instance()->mDaylightsavingEnd-1));
348 349
349 connect( mStartDateSavingEdit, SIGNAL( dateChanged(QDate)), this, SLOT( modified()) ); 350 connect( mStartDateSavingEdit, SIGNAL( dateChanged(QDate)), this, SLOT( modified()) );
350 connect( mEndDateSavingEdit, SIGNAL( dateChanged(QDate)), this, SLOT( modified()) ); 351 connect( mEndDateSavingEdit, SIGNAL( dateChanged(QDate)), this, SLOT( modified()) );
351 connect( mTimeZoneCombo, SIGNAL( activated( int ) ), this, SLOT (modified() ) ); 352 connect( mTimeZoneCombo, SIGNAL( activated( int ) ), this, SLOT (modified() ) );
352 353
353 354
354 355
355 tabWidget->addTab( topFrame, i18n( "Time Zone" ) ); 356 tabWidget->addTab( topFrame, i18n( "Time Zone" ) );
356 357
357} 358}
358 359
359void KDEPIMConfigWidget::externalapp_changed( int newApp ) 360void KDEPIMConfigWidget::externalapp_changed( int newApp )
360{ 361{
361 // first store the current data 362 // first store the current data
362 saveEditFieldSettings(); 363 saveEditFieldSettings();
363 364
364 // set mCurrentApp 365 // set mCurrentApp
365 mCurrentApp = (ExternalAppHandler::Types)newApp; 366 mCurrentApp = (ExternalAppHandler::Types)newApp;
366 367
367 // set mCurrentClient 368 // set mCurrentClient
368 switch(mCurrentApp) 369 switch(mCurrentApp)
369 { 370 {
370 case(ExternalAppHandler::EMAIL): 371 case(ExternalAppHandler::EMAIL):
371 mCurrentClient = mEmailClient; 372 mCurrentClient = mEmailClient;
372 break; 373 break;
373 case(ExternalAppHandler::PHONE): 374 case(ExternalAppHandler::PHONE):
374 mCurrentClient = mPhoneClient; 375 mCurrentClient = mPhoneClient;
375 break; 376 break;
376 case(ExternalAppHandler::SMS): 377 case(ExternalAppHandler::SMS):
377 mCurrentClient = mSMSClient; 378 mCurrentClient = mSMSClient;
378 break; 379 break;
379 case(ExternalAppHandler::FAX): 380 case(ExternalAppHandler::FAX):
380 mCurrentClient = mFaxClient; 381 mCurrentClient = mFaxClient;
381 break; 382 break;
382 case(ExternalAppHandler::PAGER): 383 case(ExternalAppHandler::PAGER):
383 mCurrentClient = mPagerClient; 384 mCurrentClient = mPagerClient;
384 break; 385 break;
385 case(ExternalAppHandler::SIP): 386 case(ExternalAppHandler::SIP):
386 mCurrentClient = mSipClient; 387 mCurrentClient = mSipClient;
387 break; 388 break;
388 default: 389 default:
389 return; 390 return;
390 } 391 }
391 392
392 // and at last update the widgets 393 // and at last update the widgets
393 updateClientWidgets(); 394 updateClientWidgets();
394} 395}
395 396
396 397
397 398
398void KDEPIMConfigWidget::client_changed( int newClient ) 399void KDEPIMConfigWidget::client_changed( int newClient )
399{ 400{
400 if (newClient == mCurrentClient) 401 if (newClient == mCurrentClient)
401 return; 402 return;
402 403
403 // first store the current data 404 // first store the current data
404 saveEditFieldSettings(); 405 saveEditFieldSettings();
405 406
406 407
407 //then reset the clientvariable 408 //then reset the clientvariable
408 mCurrentClient = newClient; 409 mCurrentClient = newClient;
409 410
410 // and at last update the widgets 411 // and at last update the widgets
411 updateClientWidgets(); 412 updateClientWidgets();
412 413
413 KPrefsWidget::modified(); 414 KPrefsWidget::modified();
414} 415}
415 416
416void KDEPIMConfigWidget::saveEditFieldSettings() 417void KDEPIMConfigWidget::saveEditFieldSettings()
417{ 418{
418 419
419 switch(mCurrentApp) 420 switch(mCurrentApp)
420 { 421 {
421 case(ExternalAppHandler::EMAIL): 422 case(ExternalAppHandler::EMAIL):
422 mEmailClient = mClient->currentItem(); 423 mEmailClient = mClient->currentItem();