summaryrefslogtreecommitdiffabout
path: root/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
Unidiff
Diffstat (limited to 'libkdepim/kcmconfigs/kdepimconfigwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libkdepim/kcmconfigs/kdepimconfigwidget.cpp33
1 files changed, 28 insertions, 5 deletions
diff --git a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
index 6eaf2f2..bbed38d 100644
--- a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
+++ b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
@@ -1,179 +1,181 @@
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 <qvbox.h> 39#include <qvbox.h>
40#include <qdir.h> 40#include <qdir.h>
41#include <qregexp.h> 41#include <qregexp.h>
42 42
43#include <kdialog.h> 43#include <kdialog.h>
44#include <kprefsdialog.h>
44#include <klocale.h> 45#include <klocale.h>
45#include <kdateedit.h> 46#include <kdateedit.h>
46#include <kglobal.h> 47#include <kglobal.h>
47#include <stdlib.h> 48#include <stdlib.h>
48 49
49/*US 50/*US
50#include <qcheckbox.h> 51#include <qcheckbox.h>
51#include <qframe.h> 52#include <qframe.h>
52#include <qpushbutton.h> 53#include <qpushbutton.h>
53#include <qcombobox.h> 54#include <qcombobox.h>
54#include <qlineedit.h> 55#include <qlineedit.h>
55#include <qlabel.h> 56#include <qlabel.h>
56#include <qfile.h> 57#include <qfile.h>
57 58
58#include <kconfig.h> 59#include <kconfig.h>
59#include <kdebug.h> 60#include <kdebug.h>
60#include <kdialog.h> 61#include <kdialog.h>
61#include <klistview.h> 62#include <klistview.h>
62#include <klocale.h> 63#include <klocale.h>
63#include <kglobal.h> 64#include <kglobal.h>
64#include <kmessagebox.h> 65#include <kmessagebox.h>
65#include <kstandarddirs.h> 66#include <kstandarddirs.h>
66 67
67#ifndef KAB_EMBEDDED 68#ifndef KAB_EMBEDDED
68#include <ktrader.h> 69#include <ktrader.h>
69#else // KAB_EMBEDDED 70#else // KAB_EMBEDDED
70#include <mergewidget.h> 71#include <mergewidget.h>
71#include <distributionlistwidget.h> 72#include <distributionlistwidget.h>
72#endif // KAB_EMBEDDED 73#endif // KAB_EMBEDDED
73 74
74#include "addresseewidget.h" 75#include "addresseewidget.h"
75#include "extensionconfigdialog.h" 76#include "extensionconfigdialog.h"
76#include "extensionwidget.h" 77#include "extensionwidget.h"
77*/ 78*/
78 79
79#include "qapplication.h" 80#include "qapplication.h"
80 81
81#include "kpimglobalprefs.h" 82#include "kpimglobalprefs.h"
82 83
83#include "kdepimconfigwidget.h" 84#include "kdepimconfigwidget.h"
85#include <kprefs.h>
84 86
85 87
86KDEPIMConfigWidget::KDEPIMConfigWidget(KPimGlobalPrefs *prefs, QWidget *parent, const char *name ) 88KDEPIMConfigWidget::KDEPIMConfigWidget(KPimGlobalPrefs *prefs, QWidget *parent, const char *name )
87 : KPrefsWidget(prefs, parent, name ) 89 : KPrefsWidget(prefs, parent, name )
88{ 90{
89 mExternalAppsMap.insert(ExternalAppHandler::EMAIL, i18n("Email")); 91 mExternalAppsMap.insert(ExternalAppHandler::EMAIL, i18n("Email"));
90 mExternalAppsMap.insert(ExternalAppHandler::PHONE, i18n("Phone")); 92 mExternalAppsMap.insert(ExternalAppHandler::PHONE, i18n("Phone"));
91 mExternalAppsMap.insert(ExternalAppHandler::SMS, i18n("SMS")); 93 mExternalAppsMap.insert(ExternalAppHandler::SMS, i18n("SMS"));
92 mExternalAppsMap.insert(ExternalAppHandler::FAX, i18n("Fax")); 94 mExternalAppsMap.insert(ExternalAppHandler::FAX, i18n("Fax"));
93 mExternalAppsMap.insert(ExternalAppHandler::PAGER, i18n("Pager")); 95 mExternalAppsMap.insert(ExternalAppHandler::PAGER, i18n("Pager"));
94 mExternalAppsMap.insert(ExternalAppHandler::SIP, i18n("SIP")); 96 mExternalAppsMap.insert(ExternalAppHandler::SIP, i18n("SIP"));
95 97
96 98
97 QVBoxLayout *topLayout = new QVBoxLayout( this, 0, 99 QVBoxLayout *topLayout = new QVBoxLayout( this, 0,
98 KDialog::spacingHint() ); 100 KDialog::spacingHint() );
99 101
100 tabWidget = new QTabWidget( this ); 102 tabWidget = new QTabWidget( this );
101 topLayout->addWidget( tabWidget ); 103 topLayout->addWidget( tabWidget );
102 104
103 105
104 setupLocaleTab(); 106 setupLocaleTab();
105 setupLocaleDateTab(); 107 setupLocaleDateTab();
106 setupTimeZoneTab(); 108 setupTimeZoneTab();
107 setupExternalAppTab(); 109 setupExternalAppTab();
108 setupStoreTab(); 110 setupStoreTab();
109 111
110} 112}
111void KDEPIMConfigWidget::showTimeZoneTab() 113void KDEPIMConfigWidget::showTimeZoneTab()
112{ 114{
113 tabWidget->setCurrentPage ( 3 ) ; 115 tabWidget->setCurrentPage ( 3 ) ;
114} 116}
115void KDEPIMConfigWidget::setupStoreTab() 117void KDEPIMConfigWidget::setupStoreTab()
116{ 118{
117 QVBox *storePage = new QVBox( this ); 119 QVBox *storePage = new QVBox( this );
118 new QLabel( i18n("Your current storage dir is:\n%1\nYour mail is stored in:\n(storagedir)/apps/kopiemail/localmail").arg(KGlobal::dirs()->localkdedir()), storePage ); 120 new QLabel( i18n("Your current storage dir is:\n%1\nYour mail is stored in:\n(storagedir)/apps/kopiemail/localmail").arg(KGlobal::dirs()->localkdedir()), storePage );
119 new QLabel( i18n("<b>New data storage dir:</b>"), storePage ); 121 new QLabel( i18n("<b>New data storage dir:</b>"), storePage );
120 mStoreUrl = new KURLRequester( storePage ); 122 mStoreUrl = new KURLRequester( storePage );
121 mStoreUrl->setURL( KGlobal::dirs()->localkdedir() ); 123 mStoreUrl->setURL( KGlobal::dirs()->localkdedir() );
122 new QLabel( i18n("New dirs are created automatically"), storePage ); 124 new QLabel( i18n("New dirs are created automatically"), storePage );
123 QHBox *bb = new QHBox( storePage ); 125 QHBox *bb = new QHBox( storePage );
124 QPushButton * pb; 126 QPushButton * pb;
125 if ( QApplication::desktop()->width() < 640 ) 127 if ( QApplication::desktop()->width() < 640 )
126 pb = new QPushButton ( i18n("Save"), bb ); 128 pb = new QPushButton ( i18n("Save"), bb );
127 else 129 else
128 pb = new QPushButton ( i18n("Save settings"), bb ); 130 pb = new QPushButton ( i18n("Save settings"), bb );
129 connect(pb, SIGNAL( clicked() ), this, SLOT ( saveStoreSettings() ) ); 131 connect(pb, SIGNAL( clicked() ), this, SLOT ( saveStoreSettings() ) );
130 pb = new QPushButton ( i18n("Save standard"), bb ); 132 pb = new QPushButton ( i18n("Save standard"), bb );
131 connect(pb, SIGNAL( clicked() ), this, SLOT ( setStandardStore() ) ); 133 connect(pb, SIGNAL( clicked() ), this, SLOT ( setStandardStore() ) );
132 new QLabel( i18n("<b>New settings are used\nafter a restart</b>"), storePage ); 134 new QLabel( i18n("<b>New settings are used\nafter a restart</b>"), storePage );
133 new QLabel( i18n("Settings are stored in\n%1").arg(QDir::homeDirPath() + "/.microkdehome" ), storePage ); 135 new QLabel( i18n("Settings are stored in\n%1").arg(QDir::homeDirPath() + "/.microkdehome" ), storePage );
134 tabWidget->addTab( storePage, i18n( "Data storage path" ) ); 136 tabWidget->addTab( storePage, i18n( "Data storage path" ) );
135} 137}
136void KDEPIMConfigWidget::setStandardStore() 138void KDEPIMConfigWidget::setStandardStore()
137{ 139{
138 mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" ); 140 mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" );
139 saveStoreSettings(); 141 saveStoreSettings();
140} 142}
141void KDEPIMConfigWidget::saveStoreSettings() 143void KDEPIMConfigWidget::saveStoreSettings()
142{ 144{
143 if ( !mStoreUrl->url().isEmpty() ) { 145 if ( !mStoreUrl->url().isEmpty() ) {
144 KConfig cfg ( QDir::homeDirPath() + "/.microkdehome" ); 146 KConfig cfg ( QDir::homeDirPath() + "/.microkdehome" );
145 cfg.setGroup("Global"); 147 cfg.setGroup("Global");
146 cfg.writeEntry( "MICROKDEHOME", mStoreUrl->url() ); 148 cfg.writeEntry( "MICROKDEHOME", mStoreUrl->url() );
147 qDebug("cfg.writeEntry( MICROKDEHOME, mStoreUrl->url() ); "); 149 qDebug("cfg.writeEntry( MICROKDEHOME, mStoreUrl->url() ); ");
148 cfg.sync(); 150 cfg.sync();
149 } else { 151 } else {
150 mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" ); 152 mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" );
151 saveStoreSettings(); 153 saveStoreSettings();
152 } 154 }
153} 155}
154void KDEPIMConfigWidget::setupExternalAppTab() 156void KDEPIMConfigWidget::setupExternalAppTab()
155{ 157{
156 QWidget *externalAppsPage = new QWidget( this ); 158 QWidget *externalAppsPage = new QWidget( this );
157 QVBoxLayout* layout = new QVBoxLayout( externalAppsPage, KDialog::marginHintSmall(), 159 QVBoxLayout* layout = new QVBoxLayout( externalAppsPage, KDialog::marginHintSmall(),
158 KDialog::spacingHintSmall() ); 160 KDialog::spacingHintSmall() );
159 161
160 mExternalApps = new QComboBox( externalAppsPage ); 162 mExternalApps = new QComboBox( externalAppsPage );
161 163
162 QMap<ExternalAppHandler::Types, QString>::Iterator it; 164 QMap<ExternalAppHandler::Types, QString>::Iterator it;
163 for( it = mExternalAppsMap.begin(); it != mExternalAppsMap.end(); ++it ) 165 for( it = mExternalAppsMap.begin(); it != mExternalAppsMap.end(); ++it )
164 mExternalApps->insertItem( it.data(), it.key() ); 166 mExternalApps->insertItem( it.data(), it.key() );
165 167
166 layout->addWidget( mExternalApps ); 168 layout->addWidget( mExternalApps );
167 169
168 connect( mExternalApps, SIGNAL( activated( int ) ), 170 connect( mExternalApps, SIGNAL( activated( int ) ),
169 this, SLOT (externalapp_changed( int ) ) ); 171 this, SLOT (externalapp_changed( int ) ) );
170 172
171 173
172 mExternalAppGroupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Used Mail Client" ), externalAppsPage ); 174 mExternalAppGroupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Used Mail Client" ), externalAppsPage );
173 QGridLayout *boxLayout = new QGridLayout( mExternalAppGroupBox->layout(), 4, 2, -1, "gridlayout" ); 175 QGridLayout *boxLayout = new QGridLayout( mExternalAppGroupBox->layout(), 4, 2, -1, "gridlayout" );
174 mExternalAppGroupBox->layout()->setMargin(5); 176 mExternalAppGroupBox->layout()->setMargin(5);
175 177
176 mClient = new QComboBox( mExternalAppGroupBox ); 178 mClient = new QComboBox( mExternalAppGroupBox );
177 boxLayout->addMultiCellWidget( mClient, 0, 0, 0, 1 ); 179 boxLayout->addMultiCellWidget( mClient, 0, 0, 0, 1 );
178 180
179 connect( mClient, SIGNAL( activated( int ) ), 181 connect( mClient, SIGNAL( activated( int ) ),
@@ -255,265 +257,286 @@ void KDEPIMConfigWidget::setupLocaleDateTab()
255 syncPrefsGroup->addRadio(i18n("03.24.2004 "+format)); 257 syncPrefsGroup->addRadio(i18n("03.24.2004 "+format));
256 if ( QApplication::desktop()->width() < 480 ) 258 if ( QApplication::desktop()->width() < 480 )
257 format = "(%Y-%m-%d)"; 259 format = "(%Y-%m-%d)";
258 else 260 else
259 format = "(%Y-%m-%d|%A %Y %B %d)"; 261 format = "(%Y-%m-%d|%A %Y %B %d)";
260 syncPrefsGroup->addRadio(i18n("2004-03-24 "+format)); 262 syncPrefsGroup->addRadio(i18n("2004-03-24 "+format));
261 syncPrefsGroup->addRadio(i18n("User defined")); 263 syncPrefsGroup->addRadio(i18n("User defined"));
262 if ( QApplication::desktop()->width() < 480 ) { 264 if ( QApplication::desktop()->width() < 480 ) {
263 syncPrefsGroup->groupBox()->layout()->setMargin( 5 ); 265 syncPrefsGroup->groupBox()->layout()->setMargin( 5 );
264 syncPrefsGroup->groupBox()->layout()->setSpacing( 0 ); 266 syncPrefsGroup->groupBox()->layout()->setSpacing( 0 );
265 } 267 }
266 topLayout->addMultiCellWidget( (QWidget*)syncPrefsGroup->groupBox(),iii,iii,0,1); 268 topLayout->addMultiCellWidget( (QWidget*)syncPrefsGroup->groupBox(),iii,iii,0,1);
267 ++iii; 269 ++iii;
268 ++iii; 270 ++iii;
269 QLabel * lab; 271 QLabel * lab;
270 mUserDateFormatLong = new QLineEdit(topFrame); 272 mUserDateFormatLong = new QLineEdit(topFrame);
271 lab = new QLabel(mUserDateFormatLong, i18n("User long date:"), topFrame); 273 lab = new QLabel(mUserDateFormatLong, i18n("User long date:"), topFrame);
272 topLayout->addWidget(lab ,iii,0); 274 topLayout->addWidget(lab ,iii,0);
273 topLayout->addWidget(mUserDateFormatLong,iii,1); 275 topLayout->addWidget(mUserDateFormatLong,iii,1);
274 ++iii; 276 ++iii;
275 mUserDateFormatShort = new QLineEdit(topFrame); 277 mUserDateFormatShort = new QLineEdit(topFrame);
276 lab = new QLabel(mUserDateFormatShort, i18n("User short date:"), topFrame); 278 lab = new QLabel(mUserDateFormatShort, i18n("User short date:"), topFrame);
277 topLayout->addWidget(lab ,iii,0); 279 topLayout->addWidget(lab ,iii,0);
278 topLayout->addWidget(mUserDateFormatShort,iii,1); 280 topLayout->addWidget(mUserDateFormatShort,iii,1);
279 ++iii; 281 ++iii;
280 lab = new QLabel( i18n("Monday 19 April 2004: %A %d %B %Y"), topFrame); 282 lab = new QLabel( i18n("Monday 19 April 2004: %A %d %B %Y"), topFrame);
281 topLayout->addMultiCellWidget(lab ,iii,iii,0,1); 283 topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
282 ++iii; 284 ++iii;
283 lab = new QLabel( i18n("Mon 19.04.04: %a %d.%m.%y"), topFrame); 285 lab = new QLabel( i18n("Mon 19.04.04: %a %d.%m.%y"), topFrame);
284 topLayout->addMultiCellWidget(lab ,iii,iii,0,1); 286 topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
285 ++iii; 287 ++iii;
286 lab = new QLabel( i18n("Mon, 19.Apr.04: %a, %d.%b.%y"), topFrame); 288 lab = new QLabel( i18n("Mon, 19.Apr.04: %a, %d.%b.%y"), topFrame);
287 topLayout->addMultiCellWidget(lab ,iii,iii,0,1); 289 topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
288 ++iii; 290 ++iii;
289 291
290 connect( mUserDateFormatLong, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 292 connect( mUserDateFormatLong, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
291 connect( mUserDateFormatShort, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 293 connect( mUserDateFormatShort, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
292 294
293 295
294 tabWidget->addTab( topFrame, i18n( "Date Format" ) ); 296 tabWidget->addTab( topFrame, i18n( "Date Format" ) );
295} 297}
296 298
297void KDEPIMConfigWidget::setupLocaleTab() 299void KDEPIMConfigWidget::setupLocaleTab()
298{ 300{
299 301
300 QWidget *topFrame = new QWidget( this ); 302 QWidget *topFrame = new QWidget( this );
301 QGridLayout *topLayout = new QGridLayout(topFrame,4,2); 303 QGridLayout *topLayout = new QGridLayout(topFrame,4,2);
302 304
303 topLayout->setSpacing(KDialog::spacingHint()); 305 topLayout->setSpacing(KDialog::spacingHint());
304 topLayout->setMargin(KDialog::marginHint()); 306 topLayout->setMargin(KDialog::marginHint());
305 int iii = 0; 307 int iii = 0;
306 KPrefsWidRadios *syncPrefsGroup = 308 KPrefsWidRadios *syncPrefsGroup =
307 addWidRadios(i18n("Language:(needs restart)"),&(KPimGlobalPrefs::instance()->mPreferredLanguage),topFrame); 309 addWidRadios(i18n("Language:(needs restart)"),&(KPimGlobalPrefs::instance()->mPreferredLanguage),topFrame);
308 syncPrefsGroup->addRadio(i18n("English")); 310 syncPrefsGroup->addRadio(i18n("English"));
309 syncPrefsGroup->addRadio(i18n("German")); 311 syncPrefsGroup->addRadio(i18n("German"));
310 syncPrefsGroup->addRadio(i18n("French")); 312 syncPrefsGroup->addRadio(i18n("French"));
311 syncPrefsGroup->addRadio(i18n("Italian")); 313 syncPrefsGroup->addRadio(i18n("Italian"));
312 syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)")); 314 syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)"));
313 if ( QApplication::desktop()->width() < 300 ) { 315 if ( QApplication::desktop()->width() < 300 ) {
314 syncPrefsGroup->groupBox()->layout()->setMargin( 5 ); 316 syncPrefsGroup->groupBox()->layout()->setMargin( 5 );
315 syncPrefsGroup->groupBox()->layout()->setSpacing( 0 ); 317 syncPrefsGroup->groupBox()->layout()->setSpacing( 0 );
316 } 318 }
317 topLayout->addMultiCellWidget( (QWidget*)syncPrefsGroup->groupBox(),iii,iii,0,1); 319 topLayout->addMultiCellWidget( (QWidget*)syncPrefsGroup->groupBox(),iii,iii,0,1);
318 ++iii; 320 ++iii;
319 321
320 322
321 tabWidget->addTab( topFrame, i18n( "Language" ) ); 323 tabWidget->addTab( topFrame, i18n( "Language" ) );
322 topFrame = new QWidget( this ); 324 topFrame = new QWidget( this );
323 topLayout = new QGridLayout(topFrame,4,2); 325 topLayout = new QGridLayout(topFrame,4,2);
324 326
325 topLayout->setSpacing(KDialog::spacingHint()); 327 topLayout->setSpacing(KDialog::spacingHint());
326 topLayout->setMargin(KDialog::marginHint()); 328 topLayout->setMargin(KDialog::marginHint());
327 iii = 0; 329 iii = 0;
328 syncPrefsGroup = 330 syncPrefsGroup =
329 addWidRadios(i18n("Time Format(nr):"),&(KPimGlobalPrefs::instance()->mPreferredTime),topFrame); 331 addWidRadios(i18n("Time Format(nr):"),&(KPimGlobalPrefs::instance()->mPreferredTime),topFrame);
330 if ( QApplication::desktop()->width() > 300 ) 332 if ( QApplication::desktop()->width() > 300 )
331 syncPrefsGroup->groupBox()->setOrientation (Qt::Vertical); 333 syncPrefsGroup->groupBox()->setOrientation (Qt::Vertical);
332 syncPrefsGroup->addRadio(i18n("24:00")); 334 syncPrefsGroup->addRadio(i18n("24:00"));
333 syncPrefsGroup->addRadio(i18n("12:00am")); 335 syncPrefsGroup->addRadio(i18n("12:00am"));
334 syncPrefsGroup->groupBox()->setOrientation (Qt::Vertical); 336 syncPrefsGroup->groupBox()->setOrientation (Qt::Vertical);
335 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); 337 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1);
336 ++iii; 338 ++iii;
337 339
338 KPrefsWidBool *sb = addWidBool(i18n("Week starts on Sunday"), 340 KPrefsWidBool *sb = addWidBool(i18n("Week starts on Sunday"),
339 &(KPimGlobalPrefs::instance()->mWeekStartsOnSunday),topFrame); 341 &(KPimGlobalPrefs::instance()->mWeekStartsOnSunday),topFrame);
340 topLayout->addMultiCellWidget((QWidget*)sb->checkBox(), iii,iii,0,1); 342 topLayout->addMultiCellWidget((QWidget*)sb->checkBox(), iii,iii,0,1);
341 ++iii; 343 ++iii;
342 344
343 345
344 tabWidget->addTab( topFrame, i18n( "Time Format" ) ); 346 tabWidget->addTab( topFrame, i18n( "Time Format" ) );
345 347
346} 348}
347 349
348 350
349void KDEPIMConfigWidget::setupTimeZoneTab() 351void KDEPIMConfigWidget::setupTimeZoneTab()
350{ 352{
351 QWidget *topFrame = new QWidget( this ); 353 QWidget *topFrame;
352 QGridLayout *topLayout = new QGridLayout( topFrame, 5, 2); 354 QGridLayout *topLayout ;
355
356
357
358
359
360
361 topFrame = new QWidget( this );
362 topLayout = new QGridLayout( topFrame, 5, 2);
353 topLayout->setSpacing(KDialog::spacingHintSmall()); 363 topLayout->setSpacing(KDialog::spacingHintSmall());
354 topLayout->setMargin(KDialog::marginHintSmall()); 364 topLayout->setMargin(KDialog::marginHintSmall());
355 365
356 QHBox *timeZoneBox = new QHBox( topFrame ); 366 QHBox *timeZoneBox = new QHBox( topFrame );
357 topLayout->addMultiCellWidget( timeZoneBox, 0, 0, 0, 1 ); 367 topLayout->addMultiCellWidget( timeZoneBox, 0, 0, 0, 1 );
358 368
359 new QLabel( i18n("Timezone:"), timeZoneBox ); 369 new QLabel( i18n("Timezone:"), timeZoneBox );
360 mTimeZoneCombo = new QComboBox( timeZoneBox ); 370 mTimeZoneCombo = new QComboBox( timeZoneBox );
361 if ( QApplication::desktop()->width() < 300 ) { 371 if ( QApplication::desktop()->width() < 300 ) {
362 mTimeZoneCombo->setMaximumWidth(150); 372 mTimeZoneCombo->setMaximumWidth(150);
363 } 373 }
364 374
365 QStringList list; 375 QStringList list;
366 list = KGlobal::locale()->timeZoneList(); 376 list = KGlobal::locale()->timeZoneList();
367 mTimeZoneCombo->insertStringList(list); 377 mTimeZoneCombo->insertStringList(list);
368 378
369 // find the currently set time zone and select it 379 // find the currently set time zone and select it
370 QString sCurrentlySet = KPimGlobalPrefs::instance()->mTimeZoneId; 380 QString sCurrentlySet = KPimGlobalPrefs::instance()->mTimeZoneId;
371 int nCurrentlySet = 11; 381 int nCurrentlySet = 11;
372 for (int i = 0; i < mTimeZoneCombo->count(); i++) 382 for (int i = 0; i < mTimeZoneCombo->count(); i++)
373 { 383 {
374 if (mTimeZoneCombo->text(i) == sCurrentlySet) 384 if (mTimeZoneCombo->text(i) == sCurrentlySet)
375 { 385 {
376 nCurrentlySet = i; 386 nCurrentlySet = i;
377 break; 387 break;
378 } 388 }
379 } 389 }
380 mTimeZoneCombo->setCurrentItem(nCurrentlySet); 390 mTimeZoneCombo->setCurrentItem(nCurrentlySet);
381 int iii = 1; 391 int iii = 1;
382 KPrefsWidBool *sb = 392 KPrefsWidBool *sb =
383 addWidBool(i18n("Add 30 min to selected Timezone"), 393 addWidBool(i18n("Add 30 min to selected Timezone"),
384 &(KPimGlobalPrefs::instance()->mTimeZoneAdd30min),topFrame); 394 &(KPimGlobalPrefs::instance()->mTimeZoneAdd30min),topFrame);
385 topLayout->addMultiCellWidget((QWidget*)sb->checkBox(), iii,iii,0,1); 395 topLayout->addMultiCellWidget((QWidget*)sb->checkBox(), iii,iii,0,1);
386 ++iii; 396 ++iii;
387 sb = 397 sb =
388 addWidBool(i18n("Timezone has daylight saving"), 398 addWidBool(i18n("Timezone has daylight saving"),
389 &(KPimGlobalPrefs::instance()->mUseDaylightsaving),topFrame); 399 &(KPimGlobalPrefs::instance()->mUseDaylightsaving),topFrame);
390 topLayout->addMultiCellWidget((QWidget*)sb->checkBox(), iii,iii,0,1); 400 topLayout->addMultiCellWidget((QWidget*)sb->checkBox(), iii,iii,0,1);
391 ++iii; 401 ++iii;
392 QLabel* lab; 402 QLabel* lab;
393 403
394 lab = new QLabel( i18n("Actual start and end is the\nsunday before this date."), topFrame ); 404 lab = new QLabel( i18n("Actual start and end is the\nsunday before this date."), topFrame );
395 topLayout->addMultiCellWidget(lab, iii,iii,0,1); 405 topLayout->addMultiCellWidget(lab, iii,iii,0,1);
396 ++iii; 406 ++iii;
397 407
398 lab = new QLabel( i18n("The year in the date is ignored."), topFrame ); 408 lab = new QLabel( i18n("The year in the date is ignored."), topFrame );
399 topLayout->addMultiCellWidget(lab, iii,iii,0,1); 409 topLayout->addMultiCellWidget(lab, iii,iii,0,1);
400 ++iii; 410 ++iii;
401 lab = new QLabel( i18n("Daylight start:"), topFrame ); 411 lab = new QLabel( i18n("Daylight start:"), topFrame );
402 topLayout->addWidget(lab, iii,0); 412 topLayout->addWidget(lab, iii,0);
403 mStartDateSavingEdit = new KDateEdit(topFrame); 413 mStartDateSavingEdit = new KDateEdit(topFrame);
404 topLayout->addWidget(mStartDateSavingEdit, iii,1); 414 topLayout->addWidget(mStartDateSavingEdit, iii,1);
405 ++iii; 415 ++iii;
406 416
407 lab = new QLabel( i18n("Daylight end:"), topFrame ); 417 lab = new QLabel( i18n("Daylight end:"), topFrame );
408 topLayout->addWidget(lab, iii,0); 418 topLayout->addWidget(lab, iii,0);
409 mEndDateSavingEdit = new KDateEdit(topFrame); 419 mEndDateSavingEdit = new KDateEdit(topFrame);
410 topLayout->addWidget(mEndDateSavingEdit, iii,1); 420 topLayout->addWidget(mEndDateSavingEdit, iii,1);
411 ++iii; 421 ++iii;
412 QDate current ( 2001, 1,1); 422 QDate current ( 2001, 1,1);
413 mStartDateSavingEdit->setDate(current.addDays(KPimGlobalPrefs::instance()->mDaylightsavingStart-1)); 423 mStartDateSavingEdit->setDate(current.addDays(KPimGlobalPrefs::instance()->mDaylightsavingStart-1));
414 mEndDateSavingEdit->setDate(current.addDays(KPimGlobalPrefs::instance()->mDaylightsavingEnd-1)); 424 mEndDateSavingEdit->setDate(current.addDays(KPimGlobalPrefs::instance()->mDaylightsavingEnd-1));
415 425
416 connect( mStartDateSavingEdit, SIGNAL( dateChanged(QDate)), this, SLOT( modified()) ); 426 connect( mStartDateSavingEdit, SIGNAL( dateChanged(QDate)), this, SLOT( modified()) );
417 connect( mEndDateSavingEdit, SIGNAL( dateChanged(QDate)), this, SLOT( modified()) ); 427 connect( mEndDateSavingEdit, SIGNAL( dateChanged(QDate)), this, SLOT( modified()) );
418 connect( mTimeZoneCombo, SIGNAL( activated( int ) ), this, SLOT (modified() ) ); 428 connect( mTimeZoneCombo, SIGNAL( activated( int ) ), this, SLOT (modified() ) );
419
420
421
422 tabWidget->addTab( topFrame, i18n( "Time Zone" ) ); 429 tabWidget->addTab( topFrame, i18n( "Time Zone" ) );
423 430
431
432 topFrame = new QWidget( this );
433 topLayout = new QGridLayout( topFrame, 3, 2);
434 topLayout->setSpacing(KDialog::spacingHintSmall());
435 topLayout->setMargin(KDialog::marginHintSmall());
436 tabWidget->addTab( topFrame, i18n( "Fonts" ) );
437
438 QLabel* labb = new QLabel( i18n("Global application font for all apps:"), topFrame );
439 topLayout->addMultiCellWidget(labb,0,0,0,2);
440 int i = 1;
441 KPrefsWidFont *timeLabelsFont =
442 addWidFont(i18n("Kx/Pi"),i18n("Application Font"),
443 &(KPimGlobalPrefs::instance()->mApplicationFont),topFrame);
444 topLayout->addWidget(timeLabelsFont->label(),i,0);
445 topLayout->addWidget(timeLabelsFont->preview(),i,1);
446 topLayout->addWidget(timeLabelsFont->button(),i,2);
424} 447}
425 448
426void KDEPIMConfigWidget::externalapp_changed( int newApp ) 449void KDEPIMConfigWidget::externalapp_changed( int newApp )
427{ 450{
428 // first store the current data 451 // first store the current data
429 saveEditFieldSettings(); 452 saveEditFieldSettings();
430 453
431 // set mCurrentApp 454 // set mCurrentApp
432 mCurrentApp = (ExternalAppHandler::Types)newApp; 455 mCurrentApp = (ExternalAppHandler::Types)newApp;
433 456
434 // set mCurrentClient 457 // set mCurrentClient
435 switch(mCurrentApp) 458 switch(mCurrentApp)
436 { 459 {
437 case(ExternalAppHandler::EMAIL): 460 case(ExternalAppHandler::EMAIL):
438 mCurrentClient = mEmailClient; 461 mCurrentClient = mEmailClient;
439 break; 462 break;
440 case(ExternalAppHandler::PHONE): 463 case(ExternalAppHandler::PHONE):
441 mCurrentClient = mPhoneClient; 464 mCurrentClient = mPhoneClient;
442 break; 465 break;
443 case(ExternalAppHandler::SMS): 466 case(ExternalAppHandler::SMS):
444 mCurrentClient = mSMSClient; 467 mCurrentClient = mSMSClient;
445 break; 468 break;
446 case(ExternalAppHandler::FAX): 469 case(ExternalAppHandler::FAX):
447 mCurrentClient = mFaxClient; 470 mCurrentClient = mFaxClient;
448 break; 471 break;
449 case(ExternalAppHandler::PAGER): 472 case(ExternalAppHandler::PAGER):
450 mCurrentClient = mPagerClient; 473 mCurrentClient = mPagerClient;
451 break; 474 break;
452 case(ExternalAppHandler::SIP): 475 case(ExternalAppHandler::SIP):
453 mCurrentClient = mSipClient; 476 mCurrentClient = mSipClient;
454 break; 477 break;
455 default: 478 default:
456 return; 479 return;
457 } 480 }
458 481
459 // and at last update the widgets 482 // and at last update the widgets
460 updateClientWidgets(); 483 updateClientWidgets();
461} 484}
462 485
463 486
464 487
465void KDEPIMConfigWidget::client_changed( int newClient ) 488void KDEPIMConfigWidget::client_changed( int newClient )
466{ 489{
467 if (newClient == mCurrentClient) 490 if (newClient == mCurrentClient)
468 return; 491 return;
469 492
470 // first store the current data 493 // first store the current data
471 saveEditFieldSettings(); 494 saveEditFieldSettings();
472 495
473 496
474 //then reset the clientvariable 497 //then reset the clientvariable
475 mCurrentClient = newClient; 498 mCurrentClient = newClient;
476 499
477 // and at last update the widgets 500 // and at last update the widgets
478 updateClientWidgets(); 501 updateClientWidgets();
479 502
480 KPrefsWidget::modified(); 503 KPrefsWidget::modified();
481} 504}
482 505
483void KDEPIMConfigWidget::saveEditFieldSettings() 506void KDEPIMConfigWidget::saveEditFieldSettings()
484{ 507{
485 508
486 switch(mCurrentApp) 509 switch(mCurrentApp)
487 { 510 {
488 case(ExternalAppHandler::EMAIL): 511 case(ExternalAppHandler::EMAIL):
489 mEmailClient = mClient->currentItem(); 512 mEmailClient = mClient->currentItem();
490 break; 513 break;
491 case(ExternalAppHandler::PHONE): 514 case(ExternalAppHandler::PHONE):
492 mPhoneClient= mClient->currentItem(); 515 mPhoneClient= mClient->currentItem();
493 break; 516 break;
494 case(ExternalAppHandler::SMS): 517 case(ExternalAppHandler::SMS):
495 mSMSClient = mClient->currentItem(); 518 mSMSClient = mClient->currentItem();
496 break; 519 break;
497 case(ExternalAppHandler::FAX): 520 case(ExternalAppHandler::FAX):
498 mFaxClient = mClient->currentItem(); 521 mFaxClient = mClient->currentItem();
499 break; 522 break;
500 case(ExternalAppHandler::PAGER): 523 case(ExternalAppHandler::PAGER):
501 mPagerClient = mClient->currentItem(); 524 mPagerClient = mClient->currentItem();
502 break; 525 break;
503 case(ExternalAppHandler::SIP): 526 case(ExternalAppHandler::SIP):
504 mSipClient = mClient->currentItem(); 527 mSipClient = mClient->currentItem();
505 break; 528 break;
506 default: 529 default:
507 return; 530 return;
508 } 531 }
509 532
510 //store the current data back to the apropriate membervariables if we had set it to "other" 533 //store the current data back to the apropriate membervariables if we had set it to "other"
511 if ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::OTHER_EMC)) 534 if ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::OTHER_EMC))
512 { 535 {
513 mEmailOtherChannel = mChannel->text(); 536 mEmailOtherChannel = mChannel->text();
514 mEmailOtherMessage = mMessage->text(); 537 mEmailOtherMessage = mMessage->text();
515 mEmailOtherMessageParameters = mParameters->text(); 538 mEmailOtherMessageParameters = mParameters->text();
516 mEmailOtherMessage2 = mMessage2->text(); 539 mEmailOtherMessage2 = mMessage2->text();
517 mEmailOtherMessageParameters2 = mParameters2->text(); 540 mEmailOtherMessageParameters2 = mParameters2->text();
518 } 541 }
519 else if ((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::OTHER_PHC)) 542 else if ((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::OTHER_PHC))