summaryrefslogtreecommitdiffabout
path: root/libkdepim
Unidiff
Diffstat (limited to 'libkdepim') (more/less context) (ignore whitespace changes)
-rw-r--r--libkdepim/kcmconfigs/kdepimconfigwidget.cpp91
1 files changed, 56 insertions, 35 deletions
diff --git a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
index 93538ec..d3797ae 100644
--- a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
+++ b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
@@ -1,963 +1,984 @@
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 <qcheckbox.h> 38#include <qcheckbox.h>
39#include <qfile.h> 39#include <qfile.h>
40#include <qvbox.h> 40#include <qvbox.h>
41#include <qdir.h> 41#include <qdir.h>
42#include <qregexp.h> 42#include <qregexp.h>
43#include <qspinbox.h> 43#include <qspinbox.h>
44 44
45#include <kdialog.h> 45#include <kdialog.h>
46#include <kprefsdialog.h> 46#include <kprefsdialog.h>
47#include <klocale.h> 47#include <klocale.h>
48#include <kglobalsettings.h> 48#include <kglobalsettings.h>
49#include <kdateedit.h> 49#include <kdateedit.h>
50#include <kglobal.h> 50#include <kglobal.h>
51#include <stdlib.h> 51#include <stdlib.h>
52 52
53/*US 53/*US
54#include <qcheckbox.h> 54#include <qcheckbox.h>
55#include <qframe.h> 55#include <qframe.h>
56#include <qpushbutton.h> 56#include <qpushbutton.h>
57#include <qcombobox.h> 57#include <qcombobox.h>
58#include <qlineedit.h> 58#include <qlineedit.h>
59#include <qlabel.h> 59#include <qlabel.h>
60#include <qfile.h> 60#include <qfile.h>
61 61
62#include <kconfig.h> 62#include <kconfig.h>
63#include <kdebug.h> 63#include <kdebug.h>
64#include <kdialog.h> 64#include <kdialog.h>
65#include <klistview.h> 65#include <klistview.h>
66#include <klocale.h> 66#include <klocale.h>
67#include <kglobal.h> 67#include <kglobal.h>
68#include <kmessagebox.h> 68#include <kmessagebox.h>
69#include <kstandarddirs.h> 69#include <kstandarddirs.h>
70 70
71#ifndef KAB_EMBEDDED 71#ifndef KAB_EMBEDDED
72#include <ktrader.h> 72#include <ktrader.h>
73#else // KAB_EMBEDDED 73#else // KAB_EMBEDDED
74#include <mergewidget.h> 74#include <mergewidget.h>
75#include <distributionlistwidget.h> 75#include <distributionlistwidget.h>
76#endif // KAB_EMBEDDED 76#endif // KAB_EMBEDDED
77 77
78#include "addresseewidget.h" 78#include "addresseewidget.h"
79#include "extensionconfigdialog.h" 79#include "extensionconfigdialog.h"
80#include "extensionwidget.h" 80#include "extensionwidget.h"
81*/ 81*/
82 82
83#include "qapplication.h" 83#include "qapplication.h"
84 84
85#include "kpimglobalprefs.h" 85#include "kpimglobalprefs.h"
86 86
87#include "kdepimconfigwidget.h" 87#include "kdepimconfigwidget.h"
88#include <kprefs.h> 88#include <kprefs.h>
89#include <kmessagebox.h> 89#include <kmessagebox.h>
90 90
91 91
92KDEPIMConfigWidget::KDEPIMConfigWidget(KPimGlobalPrefs *prefs, QWidget *parent, const char *name ) 92KDEPIMConfigWidget::KDEPIMConfigWidget(KPimGlobalPrefs *prefs, QWidget *parent, const char *name )
93 : KPrefsWidget(prefs, parent, name ) 93 : KPrefsWidget(prefs, parent, name )
94{ 94{
95 mExternalAppsMap.insert(ExternalAppHandler::EMAIL, i18n("Email")); 95 mExternalAppsMap.insert(ExternalAppHandler::EMAIL, i18n("Email"));
96 mExternalAppsMap.insert(ExternalAppHandler::PHONE, i18n("Phone")); 96 mExternalAppsMap.insert(ExternalAppHandler::PHONE, i18n("Phone"));
97 mExternalAppsMap.insert(ExternalAppHandler::SMS, i18n("SMS")); 97 mExternalAppsMap.insert(ExternalAppHandler::SMS, i18n("SMS"));
98 mExternalAppsMap.insert(ExternalAppHandler::FAX, i18n("Fax")); 98 mExternalAppsMap.insert(ExternalAppHandler::FAX, i18n("Fax"));
99 mExternalAppsMap.insert(ExternalAppHandler::PAGER, i18n("Pager")); 99 mExternalAppsMap.insert(ExternalAppHandler::PAGER, i18n("Pager"));
100 mExternalAppsMap.insert(ExternalAppHandler::SIP, i18n("SIP")); 100 mExternalAppsMap.insert(ExternalAppHandler::SIP, i18n("SIP"));
101 101
102 102
103 QVBoxLayout *topLayout = new QVBoxLayout( this, 0, 103 QVBoxLayout *topLayout = new QVBoxLayout( this, 0,
104 KDialog::spacingHint() ); 104 KDialog::spacingHint() );
105 105
106 tabWidget = new QTabWidget( this ); 106 tabWidget = new QTabWidget( this );
107 topLayout->addWidget( tabWidget ); 107 topLayout->addWidget( tabWidget );
108 108
109 109
110 setupLocaleTab(); 110 setupLocaleTab();
111 setupLocaleDateTab(); 111 setupLocaleDateTab();
112 setupTimeZoneTab(); 112 setupTimeZoneTab();
113 setupExternalAppTab(); 113 setupExternalAppTab();
114 setupStoreTab(); 114 setupStoreTab();
115 setupBackupTab(); 115 setupBackupTab();
116} 116}
117void KDEPIMConfigWidget::showTimeZoneTab() 117void KDEPIMConfigWidget::showTimeZoneTab()
118{ 118{
119 tabWidget->setCurrentPage ( 3 ) ; 119 tabWidget->setCurrentPage ( 3 ) ;
120} 120}
121void KDEPIMConfigWidget::setupBackupTab() 121void KDEPIMConfigWidget::setupBackupTab()
122{ 122{
123 QVBox *colorPage = new QVBox( this ); 123 QVBox *colorPage = new QVBox( this );
124 tabWidget->addTab( colorPage, i18n( "Backup" ) ); 124 tabWidget->addTab( colorPage, i18n( "Backup" ) );
125 QWidget* topFrame = new QWidget( colorPage ); 125 QWidget* topFrame = new QWidget( colorPage );
126 QVBoxLayout *topLayout = new QVBoxLayout(topFrame); 126 QVBoxLayout *topLayout = new QVBoxLayout(topFrame);
127 KPrefsWidBool *sb = addWidBool(i18n("Backup enabled"), 127 KPrefsWidBool *sb = addWidBool(i18n("Backup enabled"),
128 &(KPimGlobalPrefs::instance()->mBackupEnabled),topFrame); 128 &(KPimGlobalPrefs::instance()->mBackupEnabled),topFrame);
129 topLayout->addWidget((QWidget*)sb->checkBox()); 129 topLayout->addWidget((QWidget*)sb->checkBox());
130 QWidget* bupFrame = new QWidget( topFrame ); 130 QWidget* bupFrame = new QWidget( topFrame );
131 topLayout->addWidget((bupFrame)); 131 topLayout->addWidget((bupFrame));
132 QObject::connect ( sb->checkBox(), SIGNAL (toggled ( bool ) ), bupFrame, SLOT ( setEnabled( bool ) ) ); 132 QObject::connect ( sb->checkBox(), SIGNAL (toggled ( bool ) ), bupFrame, SLOT ( setEnabled( bool ) ) );
133 QVBoxLayout *bupLayout = new QVBoxLayout(bupFrame); 133 QVBoxLayout *bupLayout = new QVBoxLayout(bupFrame);
134 sb = addWidBool(i18n("Use standard backup dir"), 134 sb = addWidBool(i18n("Use standard backup dir"),
135 &(KPimGlobalPrefs::instance()->mBackupUseDefaultDir),bupFrame); 135 &(KPimGlobalPrefs::instance()->mBackupUseDefaultDir),bupFrame);
136 bupLayout->addWidget((QWidget*)sb->checkBox()); 136 bupLayout->addWidget((QWidget*)sb->checkBox());
137 mBackupUrl = new KURLRequester( bupFrame ); 137 mBackupUrl = new KURLRequester( bupFrame );
138 mBackupUrl->setURL( KGlobalSettings::backupDataDir() ); 138 mBackupUrl->setURL( KGlobalSettings::backupDataDir() );
139 QObject::connect ( sb->checkBox(), SIGNAL (toggled ( bool ) ), mBackupUrl ,SLOT ( setDisabled( bool ) ) ); 139 QObject::connect ( sb->checkBox(), SIGNAL (toggled ( bool ) ), mBackupUrl ,SLOT ( setDisabled( bool ) ) );
140 bupLayout->addWidget( mBackupUrl ); 140 bupLayout->addWidget( mBackupUrl );
141 141
142 mBackupUrl->setEnabled( !KPimGlobalPrefs::instance()->mBackupUseDefaultDir ); 142 mBackupUrl->setEnabled( !KPimGlobalPrefs::instance()->mBackupUseDefaultDir );
143 bupFrame->setEnabled( KPimGlobalPrefs::instance()->mBackupEnabled ); 143 bupFrame->setEnabled( KPimGlobalPrefs::instance()->mBackupEnabled );
144 QHBox *dummy = new QHBox(bupFrame); 144 QHBox *dummy = new QHBox(bupFrame);
145 new QLabel(i18n("Number of Backups:"),dummy); 145 new QLabel(i18n("Number of Backups:"),dummy);
146 mBackupNumbersSpin = new QSpinBox(1,21,1,dummy); 146 mBackupNumbersSpin = new QSpinBox(1,21,1,dummy);
147 new QLabel(i18n(" "),dummy); 147 new QLabel(i18n(" "),dummy);
148 bupLayout->addWidget( dummy ); 148 bupLayout->addWidget( dummy );
149 149
150 dummy = new QHBox(bupFrame); 150 dummy = new QHBox(bupFrame);
151 new QLabel(i18n("Make backup every "),dummy); 151 new QLabel(i18n("Make backup every "),dummy);
152 mBackupDayCountSpin = new QSpinBox(1,28,1,dummy); 152 mBackupDayCountSpin = new QSpinBox(1,28,1,dummy);
153 new QLabel(i18n(" days"),dummy); 153 new QLabel(i18n(" days"),dummy);
154 new QLabel(i18n(" "),dummy); 154 new QLabel(i18n(" "),dummy);
155 bupLayout->addWidget( dummy ); 155 bupLayout->addWidget( dummy );
156 QString localKdeDir; 156 QString localKdeDir;
157 localKdeDir = readEnvPath("LOCALMICROKDEHOME"); 157 localKdeDir = readEnvPath("LOCALMICROKDEHOME");
158 if ( ! localKdeDir.isEmpty() ) { 158 if ( ! localKdeDir.isEmpty() ) {
159 sb->checkBox()->setEnabled( false ); 159 sb->checkBox()->setEnabled( false );
160 sb->checkBox()->setChecked( true ); 160 sb->checkBox()->setChecked( true );
161 mBackupUrl->setEnabled( false ); 161 mBackupUrl->setEnabled( false );
162 KPimGlobalPrefs::instance()->mBackupUseDefaultDir = true; 162 KPimGlobalPrefs::instance()->mBackupUseDefaultDir = true;
163 } 163 }
164 164
165} 165}
166void KDEPIMConfigWidget::setupStoreTab() 166void KDEPIMConfigWidget::setupStoreTab()
167{ 167{
168 QVBox *colorPage = new QVBox( this ); 168 QVBox *colorPage = new QVBox( this );
169 tabWidget->addTab( colorPage, i18n( "Colors" ) ); 169 tabWidget->addTab( colorPage, i18n( "Colors" ) );
170 QWidget* cw = new QWidget( colorPage ); 170 QWidget* cw = new QWidget( colorPage );
171 KPrefsWidColor *holidayColor = 171 KPrefsWidColor *holidayColor =
172 addWidColor(i18n("Alternating background of list views"), 172 addWidColor(i18n("Alternating background of list views"),
173 &(KPimGlobalPrefs::instance()->mAlternateColor),cw); 173 &(KPimGlobalPrefs::instance()->mAlternateColor),cw);
174 QHBoxLayout *topLayout = new QHBoxLayout(cw); 174 QHBoxLayout *topLayout = new QHBoxLayout(cw);
175 topLayout->addWidget(holidayColor->label()); 175 topLayout->addWidget(holidayColor->label());
176 topLayout->addWidget( (QWidget* )holidayColor->button()); 176 topLayout->addWidget( (QWidget* )holidayColor->button());
177 177
178 178
179 QVBox *storePage = new QVBox( this ); 179 QVBox *storePage = new QVBox( this );
180 if ( QApplication::desktop()->height() > 240 )
180 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 ); 181 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 );
181 new QLabel( i18n("<b>New data storage dir:</b>"), storePage ); 182 new QLabel( i18n("<b>New data storage dir:</b>"), storePage );
182 mStoreUrl = new KURLRequester( storePage ); 183 mStoreUrl = new KURLRequester( storePage );
183 mStoreUrl->setURL( KGlobal::dirs()->localkdedir() ); 184 mStoreUrl->setURL( KGlobal::dirs()->localkdedir() );
184#ifdef DESKTOP_VERSION 185#ifdef DESKTOP_VERSION
185 QString confFile = qApp->applicationDirPath ()+ "/.microkdehome" ; 186 QString confFile = qApp->applicationDirPath ()+ "/.microkdehome" ;
186 QFileInfo fi ( confFile ); 187 QFileInfo fi ( confFile );
187 if ( fi.exists() ) { 188 if ( fi.exists() ) {
188 KConfig cfg ( confFile ); 189 KConfig cfg ( confFile );
189 cfg.setGroup("Global"); 190 cfg.setGroup("Global");
190 QString localKdeDir = cfg.readEntry( "MICROKDEHOME", "x_x_x" ); 191 QString localKdeDir = cfg.readEntry( "MICROKDEHOME", "x_x_x" );
191 if ( localKdeDir != "x_x_x" ) { 192 if ( localKdeDir != "x_x_x" ) {
192 mStoreUrl->setURL( localKdeDir ); 193 mStoreUrl->setURL( localKdeDir );
193 qDebug("Reading config from %s ", confFile.latin1()); 194 qDebug("Reading config from %s ", confFile.latin1());
194 } 195 }
195 } 196 }
196 197
197#endif 198#endif
198 new QLabel( i18n("New dirs are created automatically"), storePage ); 199 new QLabel( i18n("New dirs are created automatically"), storePage );
199 QHBox *bb = new QHBox( storePage ); 200 QHBox *bb = new QHBox( storePage );
200 QPushButton * pb; 201 QPushButton * pb;
201 if ( QApplication::desktop()->width() < 640 ) 202 if ( QApplication::desktop()->width() < 640 )
202 pb = new QPushButton ( i18n("Save"), bb ); 203 pb = new QPushButton ( i18n("Save"), bb );
203 else 204 else
204 pb = new QPushButton ( i18n("Save settings"), bb ); 205 pb = new QPushButton ( i18n("Save settings"), bb );
205 connect(pb, SIGNAL( clicked() ), this, SLOT ( saveStoreSettings() ) ); 206 connect(pb, SIGNAL( clicked() ), this, SLOT ( saveStoreSettings() ) );
206 pb = new QPushButton ( i18n("Save standard"), bb ); 207 pb = new QPushButton ( i18n("Save standard"), bb );
207 connect(pb, SIGNAL( clicked() ), this, SLOT ( setStandardStore() ) ); 208 connect(pb, SIGNAL( clicked() ), this, SLOT ( setStandardStore() ) );
208#ifdef DESKTOP_VERSION 209#ifdef DESKTOP_VERSION
209 pb = new QPushButton ( i18n("Save using LOCAL storage"), bb ); 210 pb = new QPushButton ( i18n("Save using LOCAL storage"), bb );
210 connect(pb, SIGNAL( clicked() ), this, SLOT ( setLocalStore() ) ); 211 connect(pb, SIGNAL( clicked() ), this, SLOT ( setLocalStore() ) );
211#endif 212#endif
212 new QLabel( i18n("<b>New settings are used\nafter a restart</b>"), storePage ); 213 new QLabel( i18n("<b>New settings are used\nafter a restart</b>"), storePage );
213 new QLabel( i18n("Settings are stored in\n%1").arg(QDir::homeDirPath() + "/.microkdehome" ), storePage ); 214 new QLabel( i18n("Settings are stored in\n%1").arg(QDir::homeDirPath() + "/.microkdehome" ), storePage );
214 tabWidget->addTab( storePage, i18n( "Data storage path" ) ); 215 tabWidget->addTab( storePage, i18n( "Data storage path" ) );
215} 216}
216void KDEPIMConfigWidget::setLocalStore() 217void KDEPIMConfigWidget::setLocalStore()
217{ 218{
218 mStoreUrl->setURL( "LOCAL:kdepimpi" ); 219 mStoreUrl->setURL( "LOCAL:kdepimpi" );
219 saveStoreSettings(); 220 saveStoreSettings();
220 QString message = i18n("'LOCAL' mode makes is possible to run\nKA/Pi and KO/Pi from a USB memory stick.\nIn LOCAL mode the data is stored\nin a path relative to the executable.\nNote, that in LOCAL mode only addressbook\nresource files in\n <path of the executable>/<dirname after LOCAL:>/apps/kabc/*.vcf\n are supported.\nIf you use the standard addressbook settings\nyou do not have to reconfigure any path,\njust restart the application and import\nyour addressbook and calendar data."); 221 QString message = i18n("'LOCAL' mode makes is possible to run\nKA/Pi and KO/Pi from a USB memory stick.\nIn LOCAL mode the data is stored\nin a path relative to the executable.\nNote, that in LOCAL mode only addressbook\nresource files in\n <path of the executable>/<dirname after LOCAL:>/apps/kabc/*.vcf\n are supported.\nIf you use the standard addressbook settings\nyou do not have to reconfigure any path,\njust restart the application and import\nyour addressbook and calendar data.");
221 KMessageBox::information( this, message); 222 KMessageBox::information( this, message);
222} 223}
223void KDEPIMConfigWidget::setStandardStore() 224void KDEPIMConfigWidget::setStandardStore()
224{ 225{
225 mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" ); 226 mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" );
226 saveStoreSettings(); 227 saveStoreSettings();
227} 228}
228void KDEPIMConfigWidget::saveStoreSettings() 229void KDEPIMConfigWidget::saveStoreSettings()
229{ 230{
230 if ( !mStoreUrl->url().isEmpty() ) { 231 if ( !mStoreUrl->url().isEmpty() ) {
231 QString path = QDir::homeDirPath(); 232 QString path = QDir::homeDirPath();
232 QString url = mStoreUrl->url(); 233 QString url = mStoreUrl->url();
233#ifdef DESKTOP_VERSION 234#ifdef DESKTOP_VERSION
234 if ( url.startsWith( "LOCAL:" ) ) { 235 if ( url.startsWith( "LOCAL:" ) ) {
235 path = qApp->applicationDirPath () ; 236 path = qApp->applicationDirPath () ;
236 } 237 }
237#endif 238#endif
238 KConfig cfg ( path + "/.microkdehome" ); 239 KConfig cfg ( path + "/.microkdehome" );
239 cfg.setGroup("Global"); 240 cfg.setGroup("Global");
240 cfg.writeEntry( "MICROKDEHOME", url ); 241 cfg.writeEntry( "MICROKDEHOME", url );
241 qDebug("cfg.writeEntry( MICROKDEHOME, %s ", url.latin1()); 242 qDebug("cfg.writeEntry( MICROKDEHOME, %s ", url.latin1());
242 cfg.sync(); 243 cfg.sync();
243 } else { 244 } else {
244 mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" ); 245 mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" );
245 saveStoreSettings(); 246 saveStoreSettings();
246 } 247 }
247} 248}
248void KDEPIMConfigWidget::setupExternalAppTab() 249void KDEPIMConfigWidget::setupExternalAppTab()
249{ 250{
250 QWidget *externalAppsPage = new QWidget( this ); 251 QWidget *externalAppsPage = new QWidget( this );
251 QVBoxLayout* layout = new QVBoxLayout( externalAppsPage, KDialog::marginHintSmall(), 252 QVBoxLayout* layout = new QVBoxLayout( externalAppsPage, KDialog::marginHintSmall(),
252 KDialog::spacingHintSmall() ); 253 KDialog::spacingHintSmall() );
253 254
254 mExternalApps = new QComboBox( externalAppsPage ); 255 mExternalApps = new QComboBox( externalAppsPage );
255 256
256 QMap<ExternalAppHandler::Types, QString>::Iterator it; 257 QMap<ExternalAppHandler::Types, QString>::Iterator it;
257 for( it = mExternalAppsMap.begin(); it != mExternalAppsMap.end(); ++it ) 258 for( it = mExternalAppsMap.begin(); it != mExternalAppsMap.end(); ++it )
258 mExternalApps->insertItem( it.data(), it.key() ); 259 mExternalApps->insertItem( it.data(), it.key() );
259 260
260 layout->addWidget( mExternalApps ); 261 layout->addWidget( mExternalApps );
261 262
262 connect( mExternalApps, SIGNAL( activated( int ) ), 263 connect( mExternalApps, SIGNAL( activated( int ) ),
263 this, SLOT (externalapp_changed( int ) ) ); 264 this, SLOT (externalapp_changed( int ) ) );
264 265
265 266
266 mExternalAppGroupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Used Mail Client" ), externalAppsPage ); 267 mExternalAppGroupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Used Mail Client" ), externalAppsPage );
267 QGridLayout *boxLayout = new QGridLayout( mExternalAppGroupBox->layout(), 4, 2, -1, "gridlayout" ); 268 QGridLayout *boxLayout = new QGridLayout( mExternalAppGroupBox->layout(), 4, 2, -1, "gridlayout" );
268 mExternalAppGroupBox->layout()->setMargin(4); 269 mExternalAppGroupBox->layout()->setMargin(4);
269 270
270 mClient = new QComboBox( mExternalAppGroupBox ); 271 mClient = new QComboBox( mExternalAppGroupBox );
271 boxLayout->addMultiCellWidget( mClient, 0, 0, 0, 1 ); 272 boxLayout->addMultiCellWidget( mClient, 0, 0, 0, 1 );
272 273
273 connect( mClient, SIGNAL( activated( int ) ), 274 connect( mClient, SIGNAL( activated( int ) ),
274 this, SLOT (client_changed( int ) ) ); 275 this, SLOT (client_changed( int ) ) );
275 276
276 QLabel* lab = new QLabel( i18n("Channel:"), mExternalAppGroupBox); 277 QLabel* lab = new QLabel( i18n("Channel:"), mExternalAppGroupBox);
277 boxLayout->addWidget( lab, 1, 0 ); 278 boxLayout->addWidget( lab, 1, 0 );
278 mChannel = new QLineEdit(mExternalAppGroupBox); 279 mChannel = new QLineEdit(mExternalAppGroupBox);
279 mChannel->setReadOnly(true); 280 mChannel->setReadOnly(true);
280 boxLayout->addMultiCellWidget( mChannel, 2 , 2, 0, 1 ); 281 boxLayout->addMultiCellWidget( mChannel, 2 , 2, 0, 1 );
281 282
282 lab = new QLabel( i18n("Message:"), mExternalAppGroupBox); 283 lab = new QLabel( i18n("Message:"), mExternalAppGroupBox);
283 boxLayout->addWidget( lab, 3, 0 ); 284 boxLayout->addWidget( lab, 3, 0 );
284 mMessage = new QLineEdit(mExternalAppGroupBox); 285 mMessage = new QLineEdit(mExternalAppGroupBox);
285 mMessage->setReadOnly(true); 286 mMessage->setReadOnly(true);
286 boxLayout->addWidget( mMessage , 4, 0); 287 boxLayout->addWidget( mMessage , 4, 0);
287 288
288 lab = new QLabel( i18n("Parameters:"), mExternalAppGroupBox); 289 lab = new QLabel( i18n("Parameters:"), mExternalAppGroupBox);
289 boxLayout->addWidget( lab, 3, 1 ); 290 boxLayout->addWidget( lab, 3, 1 );
290 mParameters = new QLineEdit(mExternalAppGroupBox); 291 mParameters = new QLineEdit(mExternalAppGroupBox);
291 mParameters->setReadOnly(true); 292 mParameters->setReadOnly(true);
292 boxLayout->addWidget( mParameters, 4, 1 ); 293 boxLayout->addWidget( mParameters, 4, 1 );
293 294 lab = new QLabel( i18n("HINT: Delimiter=; Name=%1,Email=%2"), mExternalAppGroupBox);
294 lab = new QLabel( i18n("HINT: Delimiter=; Name=%1,Email=%2"), mExternalAppGroupBox); 295 boxLayout->addMultiCellWidget( lab, 5, 5, 0, 1 );
295 boxLayout->addMultiCellWidget( lab, 5, 5, 0, 1 ); 296
296 297
297 298 if ( QApplication::desktop()->height() > 240 ) {
298 lab = new QLabel( i18n("extra Message:"), mExternalAppGroupBox); 299 lab = new QLabel( i18n("extra Message:"), mExternalAppGroupBox);
299 boxLayout->addWidget( lab, 6, 0 ); 300 boxLayout->addWidget( lab, 6, 0 );
300 mMessage2 = new QLineEdit(mExternalAppGroupBox); 301 mMessage2 = new QLineEdit(mExternalAppGroupBox);
301 mMessage2->setReadOnly(true); 302 mMessage2->setReadOnly(true);
302 boxLayout->addWidget( mMessage2 , 7, 0); 303 boxLayout->addWidget( mMessage2 , 7, 0);
303 304
304 lab = new QLabel( i18n("extra Parameters:"), mExternalAppGroupBox); 305 lab = new QLabel( i18n("extra Parameters:"), mExternalAppGroupBox);
305 boxLayout->addWidget( lab, 6, 1 ); 306 boxLayout->addWidget( lab, 6, 1 );
306 mParameters2 = new QLineEdit(mExternalAppGroupBox); 307 mParameters2 = new QLineEdit(mExternalAppGroupBox);
307 mParameters2->setReadOnly(true); 308 mParameters2->setReadOnly(true);
308 boxLayout->addWidget( mParameters2, 7, 1 ); 309 boxLayout->addWidget( mParameters2, 7, 1 );
309 310
310 lab = new QLabel( i18n("HINT: Emails=%1,Attachments=%2"), mExternalAppGroupBox); 311 lab = new QLabel( i18n("HINT: Emails=%1,Attachments=%2"), mExternalAppGroupBox);
311 boxLayout->addMultiCellWidget( lab, 8, 8, 0, 1 ); 312 boxLayout->addMultiCellWidget( lab, 8, 8, 0, 1 );
312 313 connect( mMessage2, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
314 connect( mParameters2, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
315 } else {
316 mMessage2 = 0;
317 mParameters2 = 0;
318 }
313 319
314 connect( mChannel, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 320 connect( mChannel, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
315 connect( mMessage, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 321 connect( mMessage, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
316 connect( mParameters, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 322 connect( mParameters, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
317 connect( mMessage2, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
318 connect( mParameters2, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
319 323
320 324
321 layout->addWidget( mExternalAppGroupBox ); 325 layout->addWidget( mExternalAppGroupBox );
322 tabWidget->addTab( externalAppsPage, i18n( "External Apps." ) ); 326 tabWidget->addTab( externalAppsPage, i18n( "External Apps." ) );
323 327
324} 328}
325 329
326 330
327void KDEPIMConfigWidget::setupLocaleDateTab() 331void KDEPIMConfigWidget::setupLocaleDateTab()
328{ 332{
329 QWidget *topFrame = new QWidget( this ); 333 QWidget *topFrame = new QWidget( this );
330 QGridLayout *topLayout = new QGridLayout( topFrame, 3, 2); 334 QGridLayout *topLayout = new QGridLayout( topFrame, 3, 2);
331 335
332 topLayout->setSpacing(KDialog::spacingHintSmall()); 336 topLayout->setSpacing(KDialog::spacingHintSmall());
333 topLayout->setMargin(KDialog::marginHintSmall()); 337 topLayout->setMargin(KDialog::marginHintSmall());
334 int iii = 0; 338 int iii = 0;
335 339
336 340
337 KPrefsWidRadios *syncPrefsGroup = 341 KPrefsWidRadios *syncPrefsGroup =
338 addWidRadios(i18n("Date Format:"),&(KPimGlobalPrefs::instance()->mPreferredDate),topFrame); 342 addWidRadios(i18n("Date Format:"),&(KPimGlobalPrefs::instance()->mPreferredDate),topFrame);
339 QString format; 343 QString format;
340 if ( QApplication::desktop()->width() < 480 ) 344 if ( QApplication::desktop()->width() < 480 )
341 format = "(%d.%m.%Y)"; 345 format = "(%d.%m.%Y)";
342 else 346 else
343 format = "(%d.%m.%Y|%A %d %B %Y)"; 347 format = "(%d.%m.%Y|%A %d %B %Y)";
344 syncPrefsGroup->addRadio(i18n("24.03.2004 "+format)); 348 syncPrefsGroup->addRadio(i18n("24.03.2004 "+format));
345 if ( QApplication::desktop()->width() < 480 ) 349 if ( QApplication::desktop()->width() < 480 )
346 format = "(%m.%d.%Y)"; 350 format = "(%m.%d.%Y)";
347 else 351 else
348 format = "(%m.%d.%Y|%A %B %d %Y)"; 352 format = "(%m.%d.%Y|%A %B %d %Y)";
349 syncPrefsGroup->addRadio(i18n("03.24.2004 "+format)); 353 syncPrefsGroup->addRadio(i18n("03.24.2004 "+format));
350 if ( QApplication::desktop()->width() < 480 ) 354 if ( QApplication::desktop()->width() < 480 )
351 format = "(%Y-%m-%d)"; 355 format = "(%Y-%m-%d)";
352 else 356 else
353 format = "(%Y-%m-%d|%A %Y %B %d)"; 357 format = "(%Y-%m-%d|%A %Y %B %d)";
354 syncPrefsGroup->addRadio(i18n("2004-03-24 "+format)); 358 syncPrefsGroup->addRadio(i18n("2004-03-24 "+format));
355 syncPrefsGroup->addRadio(i18n("User defined")); 359 syncPrefsGroup->addRadio(i18n("User defined"));
356 if ( QApplication::desktop()->width() < 480 ) { 360 if ( QApplication::desktop()->width() < 480 ) {
357 syncPrefsGroup->groupBox()->layout()->setMargin( 5 ); 361 syncPrefsGroup->groupBox()->layout()->setMargin( 5 );
358 syncPrefsGroup->groupBox()->layout()->setSpacing( 0 ); 362 syncPrefsGroup->groupBox()->layout()->setSpacing( 0 );
359 } 363 }
360 topLayout->addMultiCellWidget( (QWidget*)syncPrefsGroup->groupBox(),iii,iii,0,1); 364 topLayout->addMultiCellWidget( (QWidget*)syncPrefsGroup->groupBox(),iii,iii,0,1);
361 ++iii; 365 ++iii;
362 ++iii; 366 ++iii;
363 QLabel * lab; 367 QLabel * lab;
364 mUserDateFormatLong = new QLineEdit(topFrame); 368 mUserDateFormatLong = new QLineEdit(topFrame);
365 lab = new QLabel(mUserDateFormatLong, i18n("User long date:"), topFrame); 369 lab = new QLabel(mUserDateFormatLong, i18n("User long date:"), topFrame);
366 topLayout->addWidget(lab ,iii,0); 370 topLayout->addWidget(lab ,iii,0);
367 topLayout->addWidget(mUserDateFormatLong,iii,1); 371 topLayout->addWidget(mUserDateFormatLong,iii,1);
368 ++iii; 372 ++iii;
369 mUserDateFormatShort = new QLineEdit(topFrame); 373 mUserDateFormatShort = new QLineEdit(topFrame);
370 lab = new QLabel(mUserDateFormatShort, i18n("User short date:"), topFrame); 374 lab = new QLabel(mUserDateFormatShort, i18n("User short date:"), topFrame);
371 topLayout->addWidget(lab ,iii,0); 375 topLayout->addWidget(lab ,iii,0);
372 topLayout->addWidget(mUserDateFormatShort,iii,1); 376 topLayout->addWidget(mUserDateFormatShort,iii,1);
373 ++iii; 377 ++iii;
374 lab = new QLabel( i18n("Monday 19 April 2004: %A %d %B %Y"), topFrame); 378 lab = new QLabel( i18n("Monday 19 April 2004: %A %d %B %Y"), topFrame);
375 topLayout->addMultiCellWidget(lab ,iii,iii,0,1); 379 topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
376 ++iii; 380 ++iii;
377 lab = new QLabel( i18n("Mon 19.04.04: %a %d.%m.%y"), topFrame); 381 //qDebug(" QApplication::desktop()->height()xx %d ", QApplication::desktop()->height() );
378 topLayout->addMultiCellWidget(lab ,iii,iii,0,1); 382 if ( QApplication::desktop()->height() > 240 ) {
379 ++iii; 383 lab = new QLabel( i18n("Mon 19.04.04: %a %d.%m.%y"), topFrame);
380 lab = new QLabel( i18n("Mon, 19.Apr.04: %a, %d.%b.%y"), topFrame); 384 topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
381 topLayout->addMultiCellWidget(lab ,iii,iii,0,1); 385 ++iii;
382 ++iii; 386 lab = new QLabel( i18n("Mon, 19.Apr.04: %a, %d.%b.%y"), topFrame);
387 topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
388 ++iii;
389 }
383 390
384 connect( mUserDateFormatLong, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 391 connect( mUserDateFormatLong, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
385 connect( mUserDateFormatShort, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 392 connect( mUserDateFormatShort, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
386 393
387 394
388 tabWidget->addTab( topFrame, i18n( "Date Format" ) ); 395 tabWidget->addTab( topFrame, i18n( "Date Format" ) );
389} 396}
390 397
391void KDEPIMConfigWidget::setupLocaleTab() 398void KDEPIMConfigWidget::setupLocaleTab()
392{ 399{
393 400
394 QWidget *topFrame = new QWidget( this ); 401 QWidget *topFrame = new QWidget( this );
395 QGridLayout *topLayout = new QGridLayout(topFrame,4,2); 402 QGridLayout *topLayout = new QGridLayout(topFrame,4,2);
396 403
397 topLayout->setSpacing(KDialog::spacingHint()); 404 topLayout->setSpacing(KDialog::spacingHint());
398 topLayout->setMargin(KDialog::marginHint()); 405 topLayout->setMargin(KDialog::marginHint());
399 int iii = 0; 406 int iii = 0;
400 KPrefsWidRadios *syncPrefsGroup = 407 KPrefsWidRadios *syncPrefsGroup =
401 addWidRadios(i18n("Language:(needs restart)"),&(KPimGlobalPrefs::instance()->mPreferredLanguage),topFrame); 408 addWidRadios(i18n("Language:(needs restart)"),&(KPimGlobalPrefs::instance()->mPreferredLanguage),topFrame);
402 syncPrefsGroup->addRadio(i18n("English")); 409 syncPrefsGroup->addRadio(i18n("English"));
403 syncPrefsGroup->addRadio(i18n("German")); 410 syncPrefsGroup->addRadio(i18n("German"));
404 syncPrefsGroup->addRadio(i18n("French")); 411 syncPrefsGroup->addRadio(i18n("French"));
405 syncPrefsGroup->addRadio(i18n("Italian")); 412 syncPrefsGroup->addRadio(i18n("Italian"));
406 syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)")); 413 syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)"));
407 if ( QApplication::desktop()->width() < 300 ) { 414 if ( QApplication::desktop()->width() < 300 ) {
408 syncPrefsGroup->groupBox()->layout()->setMargin( 5 ); 415 syncPrefsGroup->groupBox()->layout()->setMargin( 5 );
409 syncPrefsGroup->groupBox()->layout()->setSpacing( 0 ); 416 syncPrefsGroup->groupBox()->layout()->setSpacing( 0 );
410 } 417 }
411 topLayout->addMultiCellWidget( (QWidget*)syncPrefsGroup->groupBox(),iii,iii,0,1); 418 topLayout->addMultiCellWidget( (QWidget*)syncPrefsGroup->groupBox(),iii,iii,0,1);
412 ++iii; 419 ++iii;
413 420
414 421
415 tabWidget->addTab( topFrame, i18n( "Language" ) ); 422 tabWidget->addTab( topFrame, i18n( "Language" ) );
416 topFrame = new QWidget( this ); 423 topFrame = new QWidget( this );
417 topLayout = new QGridLayout(topFrame,4,2); 424 topLayout = new QGridLayout(topFrame,4,2);
418 425
419 topLayout->setSpacing(KDialog::spacingHint()); 426 topLayout->setSpacing(KDialog::spacingHint());
420 topLayout->setMargin(KDialog::marginHint()); 427 topLayout->setMargin(KDialog::marginHint());
421 iii = 0; 428 iii = 0;
422 syncPrefsGroup = 429 syncPrefsGroup =
423 addWidRadios(i18n("Time Format(nr):"),&(KPimGlobalPrefs::instance()->mPreferredTime),topFrame); 430 addWidRadios(i18n("Time Format(nr):"),&(KPimGlobalPrefs::instance()->mPreferredTime),topFrame);
424 if ( QApplication::desktop()->width() > 300 ) 431 if ( QApplication::desktop()->width() > 300 )
425 syncPrefsGroup->groupBox()->setOrientation (Qt::Vertical); 432 syncPrefsGroup->groupBox()->setOrientation (Qt::Vertical);
426 syncPrefsGroup->addRadio(i18n("24:00")); 433 syncPrefsGroup->addRadio(i18n("24:00"));
427 syncPrefsGroup->addRadio(i18n("12:00am")); 434 syncPrefsGroup->addRadio(i18n("12:00am"));
428 syncPrefsGroup->groupBox()->setOrientation (Qt::Vertical); 435 syncPrefsGroup->groupBox()->setOrientation (Qt::Vertical);
429 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); 436 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1);
430 ++iii; 437 ++iii;
431 438
432 KPrefsWidBool *sb = addWidBool(i18n("Week starts on Sunday"), 439 KPrefsWidBool *sb = addWidBool(i18n("Week starts on Sunday"),
433 &(KPimGlobalPrefs::instance()->mWeekStartsOnSunday),topFrame); 440 &(KPimGlobalPrefs::instance()->mWeekStartsOnSunday),topFrame);
434 topLayout->addMultiCellWidget((QWidget*)sb->checkBox(), iii,iii,0,1); 441 topLayout->addMultiCellWidget((QWidget*)sb->checkBox(), iii,iii,0,1);
435 ++iii; 442 ++iii;
436 443
437 444
438 tabWidget->addTab( topFrame, i18n( "Time Format" ) ); 445 tabWidget->addTab( topFrame, i18n( "Time Format" ) );
439 446
440} 447}
441 448
442 449
443void KDEPIMConfigWidget::setupTimeZoneTab() 450void KDEPIMConfigWidget::setupTimeZoneTab()
444{ 451{
445 QWidget *topFrame; 452 QWidget *topFrame;
446 QGridLayout *topLayout ; 453 QGridLayout *topLayout ;
447 454
448 455
449 456
450 457
451 458
452 459
453 topFrame = new QWidget( this ); 460 topFrame = new QWidget( this );
454 topLayout = new QGridLayout( topFrame, 5, 2); 461 topLayout = new QGridLayout( topFrame, 5, 2);
455 topLayout->setSpacing(KDialog::spacingHintSmall()); 462 topLayout->setSpacing(KDialog::spacingHintSmall());
456 topLayout->setMargin(KDialog::marginHintSmall()); 463 topLayout->setMargin(KDialog::marginHintSmall());
457 464
458 QHBox *timeZoneBox = new QHBox( topFrame ); 465 QHBox *timeZoneBox = new QHBox( topFrame );
459 topLayout->addMultiCellWidget( timeZoneBox, 0, 0, 0, 1 ); 466 topLayout->addMultiCellWidget( timeZoneBox, 0, 0, 0, 1 );
460 467
461 new QLabel( i18n("Timezone:"), timeZoneBox ); 468 new QLabel( i18n("Timezone:"), timeZoneBox );
462 mTimeZoneCombo = new QComboBox( timeZoneBox ); 469 mTimeZoneCombo = new QComboBox( timeZoneBox );
463 if ( QApplication::desktop()->width() < 300 ) { 470 if ( QApplication::desktop()->width() < 300 ) {
464 mTimeZoneCombo->setMaximumWidth(150); 471 mTimeZoneCombo->setMaximumWidth(150);
465 } 472 }
466 473
467 QStringList list; 474 QStringList list;
468 list = KGlobal::locale()->timeZoneList(); 475 list = KGlobal::locale()->timeZoneList();
469 mTimeZoneCombo->insertStringList(list); 476 mTimeZoneCombo->insertStringList(list);
470 477
471 // find the currently set time zone and select it 478 // find the currently set time zone and select it
472 QString sCurrentlySet = KPimGlobalPrefs::instance()->mTimeZoneId; 479 QString sCurrentlySet = KPimGlobalPrefs::instance()->mTimeZoneId;
473 int nCurrentlySet = 11; 480 int nCurrentlySet = 11;
474 for (int i = 0; i < mTimeZoneCombo->count(); i++) 481 for (int i = 0; i < mTimeZoneCombo->count(); i++)
475 { 482 {
476 if (mTimeZoneCombo->text(i) == sCurrentlySet) 483 if (mTimeZoneCombo->text(i) == sCurrentlySet)
477 { 484 {
478 nCurrentlySet = i; 485 nCurrentlySet = i;
479 break; 486 break;
480 } 487 }
481 } 488 }
482 mTimeZoneCombo->setCurrentItem(nCurrentlySet); 489 mTimeZoneCombo->setCurrentItem(nCurrentlySet);
483 int iii = 1; 490 int iii = 1;
484 KPrefsWidBool *sb = 491 KPrefsWidBool *sb =
485 addWidBool(i18n("Add 30 min to selected Timezone"), 492 addWidBool(i18n("Add 30 min to selected Timezone"),
486 &(KPimGlobalPrefs::instance()->mTimeZoneAdd30min),topFrame); 493 &(KPimGlobalPrefs::instance()->mTimeZoneAdd30min),topFrame);
487 topLayout->addMultiCellWidget((QWidget*)sb->checkBox(), iii,iii,0,1); 494 topLayout->addMultiCellWidget((QWidget*)sb->checkBox(), iii,iii,0,1);
488 ++iii; 495 ++iii;
489 sb = 496 sb =
490 addWidBool(i18n("Timezone has daylight saving"), 497 addWidBool(i18n("Timezone has daylight saving"),
491 &(KPimGlobalPrefs::instance()->mUseDaylightsaving),topFrame); 498 &(KPimGlobalPrefs::instance()->mUseDaylightsaving),topFrame);
492 topLayout->addMultiCellWidget((QWidget*)sb->checkBox(), iii,iii,0,1); 499 topLayout->addMultiCellWidget((QWidget*)sb->checkBox(), iii,iii,0,1);
493 ++iii; 500 ++iii;
494 QLabel* lab; 501 QLabel* lab;
495 502
496 lab = new QLabel( i18n("Actual start and end is the\nsunday before this date."), topFrame ); 503 lab = new QLabel( i18n("Actual start and end is the\nsunday before this date."), topFrame );
497 topLayout->addMultiCellWidget(lab, iii,iii,0,1); 504 topLayout->addMultiCellWidget(lab, iii,iii,0,1);
498 ++iii; 505 ++iii;
499 506
500 lab = new QLabel( i18n("The year in the date is ignored."), topFrame ); 507 lab = new QLabel( i18n("The year in the date is ignored."), topFrame );
501 topLayout->addMultiCellWidget(lab, iii,iii,0,1); 508 topLayout->addMultiCellWidget(lab, iii,iii,0,1);
502 ++iii; 509 ++iii;
503 lab = new QLabel( i18n("Daylight start:"), topFrame ); 510 lab = new QLabel( i18n("Daylight start:"), topFrame );
504 topLayout->addWidget(lab, iii,0); 511 topLayout->addWidget(lab, iii,0);
505 mStartDateSavingEdit = new KDateEdit(topFrame); 512 mStartDateSavingEdit = new KDateEdit(topFrame);
506 topLayout->addWidget(mStartDateSavingEdit, iii,1); 513 topLayout->addWidget(mStartDateSavingEdit, iii,1);
507 ++iii; 514 ++iii;
508 515
509 lab = new QLabel( i18n("Daylight end:"), topFrame ); 516 lab = new QLabel( i18n("Daylight end:"), topFrame );
510 topLayout->addWidget(lab, iii,0); 517 topLayout->addWidget(lab, iii,0);
511 mEndDateSavingEdit = new KDateEdit(topFrame); 518 mEndDateSavingEdit = new KDateEdit(topFrame);
512 topLayout->addWidget(mEndDateSavingEdit, iii,1); 519 topLayout->addWidget(mEndDateSavingEdit, iii,1);
513 ++iii; 520 ++iii;
514 QDate current ( 2001, 1,1); 521 QDate current ( 2001, 1,1);
515 mStartDateSavingEdit->setDate(current.addDays(KPimGlobalPrefs::instance()->mDaylightsavingStart-1)); 522 mStartDateSavingEdit->setDate(current.addDays(KPimGlobalPrefs::instance()->mDaylightsavingStart-1));
516 mEndDateSavingEdit->setDate(current.addDays(KPimGlobalPrefs::instance()->mDaylightsavingEnd-1)); 523 mEndDateSavingEdit->setDate(current.addDays(KPimGlobalPrefs::instance()->mDaylightsavingEnd-1));
517 524
518 connect( mStartDateSavingEdit, SIGNAL( dateChanged(QDate)), this, SLOT( modified()) ); 525 connect( mStartDateSavingEdit, SIGNAL( dateChanged(QDate)), this, SLOT( modified()) );
519 connect( mEndDateSavingEdit, SIGNAL( dateChanged(QDate)), this, SLOT( modified()) ); 526 connect( mEndDateSavingEdit, SIGNAL( dateChanged(QDate)), this, SLOT( modified()) );
520 connect( mTimeZoneCombo, SIGNAL( activated( int ) ), this, SLOT (modified() ) ); 527 connect( mTimeZoneCombo, SIGNAL( activated( int ) ), this, SLOT (modified() ) );
521 tabWidget->addTab( topFrame, i18n( "Time Zone" ) ); 528 tabWidget->addTab( topFrame, i18n( "Time Zone" ) );
522 529
523 530
524 topFrame = new QWidget( this ); 531 topFrame = new QWidget( this );
525 topLayout = new QGridLayout( topFrame, 3, 2); 532 topLayout = new QGridLayout( topFrame, 3, 2);
526 topLayout->setSpacing(KDialog::spacingHintSmall()); 533 topLayout->setSpacing(KDialog::spacingHintSmall());
527 topLayout->setMargin(KDialog::marginHintSmall()); 534 topLayout->setMargin(KDialog::marginHintSmall());
528 tabWidget->addTab( topFrame, i18n( "Fonts" ) ); 535 tabWidget->addTab( topFrame, i18n( "Fonts" ) );
529 536
530 QLabel* labb = new QLabel( i18n("Global application font for all apps:"), topFrame ); 537 QLabel* labb = new QLabel( i18n("Global application font for all apps:"), topFrame );
531 topLayout->addMultiCellWidget(labb,0,0,0,2); 538 topLayout->addMultiCellWidget(labb,0,0,0,2);
532 int i = 1; 539 int i = 1;
533 KPrefsWidFont *timeLabelsFont = 540 KPrefsWidFont *timeLabelsFont =
534 addWidFont(i18n("Kx/Pi"),i18n("Application Font"), 541 addWidFont(i18n("Kx/Pi"),i18n("Application Font"),
535 &(KPimGlobalPrefs::instance()->mApplicationFont),topFrame); 542 &(KPimGlobalPrefs::instance()->mApplicationFont),topFrame);
536 topLayout->addWidget(timeLabelsFont->label(),i,0); 543 topLayout->addWidget(timeLabelsFont->label(),i,0);
537 topLayout->addWidget(timeLabelsFont->preview(),i,1); 544 topLayout->addWidget(timeLabelsFont->preview(),i,1);
538 topLayout->addWidget(timeLabelsFont->button(),i,2); 545 topLayout->addWidget(timeLabelsFont->button(),i,2);
539} 546}
540 547
541void KDEPIMConfigWidget::externalapp_changed( int newApp ) 548void KDEPIMConfigWidget::externalapp_changed( int newApp )
542{ 549{
543 // first store the current data 550 // first store the current data
544 saveEditFieldSettings(); 551 saveEditFieldSettings();
545 552
546 // set mCurrentApp 553 // set mCurrentApp
547 mCurrentApp = (ExternalAppHandler::Types)newApp; 554 mCurrentApp = (ExternalAppHandler::Types)newApp;
548 555
549 // set mCurrentClient 556 // set mCurrentClient
550 switch(mCurrentApp) 557 switch(mCurrentApp)
551 { 558 {
552 case(ExternalAppHandler::EMAIL): 559 case(ExternalAppHandler::EMAIL):
553 mCurrentClient = mEmailClient; 560 mCurrentClient = mEmailClient;
554 break; 561 break;
555 case(ExternalAppHandler::PHONE): 562 case(ExternalAppHandler::PHONE):
556 mCurrentClient = mPhoneClient; 563 mCurrentClient = mPhoneClient;
557 break; 564 break;
558 case(ExternalAppHandler::SMS): 565 case(ExternalAppHandler::SMS):
559 mCurrentClient = mSMSClient; 566 mCurrentClient = mSMSClient;
560 break; 567 break;
561 case(ExternalAppHandler::FAX): 568 case(ExternalAppHandler::FAX):
562 mCurrentClient = mFaxClient; 569 mCurrentClient = mFaxClient;
563 break; 570 break;
564 case(ExternalAppHandler::PAGER): 571 case(ExternalAppHandler::PAGER):
565 mCurrentClient = mPagerClient; 572 mCurrentClient = mPagerClient;
566 break; 573 break;
567 case(ExternalAppHandler::SIP): 574 case(ExternalAppHandler::SIP):
568 mCurrentClient = mSipClient; 575 mCurrentClient = mSipClient;
569 break; 576 break;
570 default: 577 default:
571 return; 578 return;
572 } 579 }
573 580
574 // and at last update the widgets 581 // and at last update the widgets
575 updateClientWidgets(); 582 updateClientWidgets();
576} 583}
577 584
578 585
579 586
580void KDEPIMConfigWidget::client_changed( int newClient ) 587void KDEPIMConfigWidget::client_changed( int newClient )
581{ 588{
582 if (newClient == mCurrentClient) 589 if (newClient == mCurrentClient)
583 return; 590 return;
584 591
585 // first store the current data 592 // first store the current data
586 saveEditFieldSettings(); 593 saveEditFieldSettings();
587 594
588 595
589 //then reset the clientvariable 596 //then reset the clientvariable
590 mCurrentClient = newClient; 597 mCurrentClient = newClient;
591 598
592 // and at last update the widgets 599 // and at last update the widgets
593 updateClientWidgets(); 600 updateClientWidgets();
594 601
595 KPrefsWidget::modified(); 602 KPrefsWidget::modified();
596} 603}
597 604
598void KDEPIMConfigWidget::saveEditFieldSettings() 605void KDEPIMConfigWidget::saveEditFieldSettings()
599{ 606{
600 607
601 switch(mCurrentApp) 608 switch(mCurrentApp)
602 { 609 {
603 case(ExternalAppHandler::EMAIL): 610 case(ExternalAppHandler::EMAIL):
604 mEmailClient = mClient->currentItem(); 611 mEmailClient = mClient->currentItem();
605 break; 612 break;
606 case(ExternalAppHandler::PHONE): 613 case(ExternalAppHandler::PHONE):
607 mPhoneClient= mClient->currentItem(); 614 mPhoneClient= mClient->currentItem();
608 break; 615 break;
609 case(ExternalAppHandler::SMS): 616 case(ExternalAppHandler::SMS):
610 mSMSClient = mClient->currentItem(); 617 mSMSClient = mClient->currentItem();
611 break; 618 break;
612 case(ExternalAppHandler::FAX): 619 case(ExternalAppHandler::FAX):
613 mFaxClient = mClient->currentItem(); 620 mFaxClient = mClient->currentItem();
614 break; 621 break;
615 case(ExternalAppHandler::PAGER): 622 case(ExternalAppHandler::PAGER):
616 mPagerClient = mClient->currentItem(); 623 mPagerClient = mClient->currentItem();
617 break; 624 break;
618 case(ExternalAppHandler::SIP): 625 case(ExternalAppHandler::SIP):
619 mSipClient = mClient->currentItem(); 626 mSipClient = mClient->currentItem();
620 break; 627 break;
621 default: 628 default:
622 return; 629 return;
623 } 630 }
624 631
625 //store the current data back to the apropriate membervariables if we had set it to "other" 632 //store the current data back to the apropriate membervariables if we had set it to "other"
626 if ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::OTHER_EMC)) 633 if ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::OTHER_EMC))
627 { 634 {
628 mEmailOtherChannel = mChannel->text(); 635 mEmailOtherChannel = mChannel->text();
629 mEmailOtherMessage = mMessage->text(); 636 mEmailOtherMessage = mMessage->text();
630 mEmailOtherMessageParameters = mParameters->text(); 637 mEmailOtherMessageParameters = mParameters->text();
631 mEmailOtherMessage2 = mMessage2->text(); 638 if ( mMessage2 )
632 mEmailOtherMessageParameters2 = mParameters2->text(); 639 mEmailOtherMessage2 = mMessage2->text();
640 if ( mParameters2 )
641 mEmailOtherMessageParameters2 = mParameters2->text();
633 } 642 }
634 else if ((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::OTHER_PHC)) 643 else if ((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::OTHER_PHC))
635 { 644 {
636 mPhoneOtherChannel = mChannel->text(); 645 mPhoneOtherChannel = mChannel->text();
637 mPhoneOtherMessage = mMessage->text(); 646 mPhoneOtherMessage = mMessage->text();
638 mPhoneOtherMessageParameters = mParameters->text(); 647 mPhoneOtherMessageParameters = mParameters->text();
639 } 648 }
640 else if ((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::OTHER_SMC)) 649 else if ((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::OTHER_SMC))
641 { 650 {
642 mSMSOtherChannel = mChannel->text(); 651 mSMSOtherChannel = mChannel->text();
643 mSMSOtherMessage = mMessage->text(); 652 mSMSOtherMessage = mMessage->text();
644 mSMSOtherMessageParameters = mParameters->text(); 653 mSMSOtherMessageParameters = mParameters->text();
645 } 654 }
646 else if ((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::OTHER_FAC)) 655 else if ((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::OTHER_FAC))
647 { 656 {
648 mFaxOtherChannel = mChannel->text(); 657 mFaxOtherChannel = mChannel->text();
649 mFaxOtherMessage = mMessage->text(); 658 mFaxOtherMessage = mMessage->text();
650 mFaxOtherMessageParameters = mParameters->text(); 659 mFaxOtherMessageParameters = mParameters->text();
651 } 660 }
652 else if ((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::OTHER_PAC)) 661 else if ((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::OTHER_PAC))
653 { 662 {
654 mPagerOtherChannel = mChannel->text(); 663 mPagerOtherChannel = mChannel->text();
655 mPagerOtherMessage = mMessage->text(); 664 mPagerOtherMessage = mMessage->text();
656 mPagerOtherMessageParameters = mParameters->text(); 665 mPagerOtherMessageParameters = mParameters->text();
657 } 666 }
658 else if ((mCurrentApp == ExternalAppHandler::SIP) && (mCurrentClient == KPimGlobalPrefs::OTHER_SIC)) 667 else if ((mCurrentApp == ExternalAppHandler::SIP) && (mCurrentClient == KPimGlobalPrefs::OTHER_SIC))
659 { 668 {
660 mSipOtherChannel = mChannel->text(); 669 mSipOtherChannel = mChannel->text();
661 mSipOtherMessage = mMessage->text(); 670 mSipOtherMessage = mMessage->text();
662 mSipOtherMessageParameters = mParameters->text(); 671 mSipOtherMessageParameters = mParameters->text();
663 } 672 }
664 673
665 674
666} 675}
667 676
668void KDEPIMConfigWidget::updateClientWidgets() 677void KDEPIMConfigWidget::updateClientWidgets()
669{ 678{
670 bool blocked = signalsBlocked(); 679 bool blocked = signalsBlocked();
671 blockSignals( true ); 680 blockSignals( true );
672 681
673 // at this point we assume, that mCurrentApp and mCurrentClient are set to the values that we want to display 682 // at this point we assume, that mCurrentApp and mCurrentClient are set to the values that we want to display
674 QMap<ExternalAppHandler::Types, QString>::Iterator it = mExternalAppsMap.find ( mCurrentApp ); 683 QMap<ExternalAppHandler::Types, QString>::Iterator it = mExternalAppsMap.find ( mCurrentApp );
675 if (it == mExternalAppsMap.end()) 684 if (it == mExternalAppsMap.end())
676 return; 685 return;
677 686
678 // update group box 687 // update group box
679 mExternalAppGroupBox->setTitle(i18n( "Used %1 Client" ).arg(it.data())); 688 mExternalAppGroupBox->setTitle(i18n( "Used %1 Client" ).arg(it.data()));
680 689
681 //update the entries in the client combobox 690 //update the entries in the client combobox
682 mClient->clear(); 691 mClient->clear();
683 692
684 QList<DefaultAppItem> items = ExternalAppHandler::instance()->getAvailableDefaultItems(mCurrentApp); 693 QList<DefaultAppItem> items = ExternalAppHandler::instance()->getAvailableDefaultItems(mCurrentApp);
685 DefaultAppItem* dai; 694 DefaultAppItem* dai;
686 for ( dai=items.first(); dai != 0; dai=items.next() ) 695 for ( dai=items.first(); dai != 0; dai=items.next() )
687 { 696 {
688 mClient->insertItem( i18n(dai->_label), dai->_id ); 697 mClient->insertItem( i18n(dai->_label), dai->_id );
689 698
690 if (dai->_id == mCurrentClient) 699 if (dai->_id == mCurrentClient)
691 { 700 {
692 //restore the edit fields with the data of the local membervariables if we had set it to "other". 701 //restore the edit fields with the data of the local membervariables if we had set it to "other".
693 //Otherwise take the default data from externalapphandler. 702 //Otherwise take the default data from externalapphandler.
694 mChannel->setText(dai->_channel); 703 mChannel->setText(dai->_channel);
695 mMessage->setText(dai->_message); 704 mMessage->setText(dai->_message);
696 mParameters->setText(dai->_parameters); 705 mParameters->setText(dai->_parameters);
697 mMessage2->setText(dai->_message2); 706 if ( mMessage2 )
707 mMessage2->setText(dai->_message2);
708 if ( mParameters2 )
698 mParameters2->setText(dai->_parameters2); 709 mParameters2->setText(dai->_parameters2);
699 710
700 711
701 if ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::OTHER_EMC)) 712 if ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::OTHER_EMC))
702 { 713 {
703 mChannel->setText(mEmailOtherChannel); 714 mChannel->setText(mEmailOtherChannel);
704 mMessage->setText(mEmailOtherMessage); 715 mMessage->setText(mEmailOtherMessage);
705 mParameters->setText(mEmailOtherMessageParameters); 716 mParameters->setText(mEmailOtherMessageParameters);
717 if ( mMessage2 )
706 mMessage2->setText(mEmailOtherMessage2); 718 mMessage2->setText(mEmailOtherMessage2);
719 if ( mParameters2 )
707 mParameters2->setText(mEmailOtherMessageParameters2); 720 mParameters2->setText(mEmailOtherMessageParameters2);
708 } 721 }
709 else if ((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::OTHER_PHC)) 722 else if ((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::OTHER_PHC))
710 { 723 {
711 mChannel->setText(mPhoneOtherChannel); 724 mChannel->setText(mPhoneOtherChannel);
712 mMessage->setText(mPhoneOtherMessage); 725 mMessage->setText(mPhoneOtherMessage);
713 mParameters->setText(mPhoneOtherMessageParameters); 726 mParameters->setText(mPhoneOtherMessageParameters);
714 } 727 }
715 else if ((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::OTHER_SMC)) 728 else if ((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::OTHER_SMC))
716 { 729 {
717 mChannel->setText(mSMSOtherChannel); 730 mChannel->setText(mSMSOtherChannel);
718 mMessage->setText(mSMSOtherMessage); 731 mMessage->setText(mSMSOtherMessage);
719 mParameters->setText(mSMSOtherMessageParameters); 732 mParameters->setText(mSMSOtherMessageParameters);
720 } 733 }
721 else if ((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::OTHER_FAC)) 734 else if ((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::OTHER_FAC))
722 { 735 {
723 mChannel->setText(mFaxOtherChannel); 736 mChannel->setText(mFaxOtherChannel);
724 mMessage->setText(mFaxOtherMessage); 737 mMessage->setText(mFaxOtherMessage);
725 mParameters->setText(mFaxOtherMessageParameters); 738 mParameters->setText(mFaxOtherMessageParameters);
726 } 739 }
727 else if ((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::OTHER_PAC)) 740 else if ((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::OTHER_PAC))
728 { 741 {
729 mChannel->setText(mPagerOtherChannel); 742 mChannel->setText(mPagerOtherChannel);
730 mMessage->setText(mPagerOtherMessage); 743 mMessage->setText(mPagerOtherMessage);
731 mParameters->setText(mPagerOtherMessageParameters); 744 mParameters->setText(mPagerOtherMessageParameters);
732 } 745 }
733 else if ((mCurrentApp == ExternalAppHandler::SIP) && (mCurrentClient == KPimGlobalPrefs::OTHER_SIC)) 746 else if ((mCurrentApp == ExternalAppHandler::SIP) && (mCurrentClient == KPimGlobalPrefs::OTHER_SIC))
734 { 747 {
735 mChannel->setText(mSipOtherChannel); 748 mChannel->setText(mSipOtherChannel);
736 mMessage->setText(mSipOtherMessage); 749 mMessage->setText(mSipOtherMessage);
737 mParameters->setText(mSipOtherMessageParameters); 750 mParameters->setText(mSipOtherMessageParameters);
738 } 751 }
739 } 752 }
740 753
741 } 754 }
742 755
743 bool readonly; 756 bool readonly;
744 bool enabled; 757 bool enabled;
745 if ( ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::OTHER_EMC)) 758 if ( ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::OTHER_EMC))
746 ||((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::OTHER_PHC)) 759 ||((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::OTHER_PHC))
747 ||((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::OTHER_SMC)) 760 ||((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::OTHER_SMC))
748 ||((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::OTHER_FAC)) 761 ||((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::OTHER_FAC))
749 ||((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::OTHER_PAC)) 762 ||((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::OTHER_PAC))
750 ||((mCurrentApp == ExternalAppHandler::SIP) && (mCurrentClient == KPimGlobalPrefs::OTHER_SIC))) 763 ||((mCurrentApp == ExternalAppHandler::SIP) && (mCurrentClient == KPimGlobalPrefs::OTHER_SIC)))
751 { 764 {
752 readonly = false; 765 readonly = false;
753 } 766 }
754 else 767 else
755 { 768 {
756 readonly = true; 769 readonly = true;
757 } 770 }
758 771
759 if ( ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::NONE_EMC)) 772 if ( ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::NONE_EMC))
760 ||((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::NONE_PHC)) 773 ||((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::NONE_PHC))
761 ||((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::NONE_SMC)) 774 ||((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::NONE_SMC))
762 ||((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::NONE_FAC)) 775 ||((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::NONE_FAC))
763 ||((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::NONE_PAC)) 776 ||((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::NONE_PAC))
764 ||((mCurrentApp == ExternalAppHandler::SIP) && (mCurrentClient == KPimGlobalPrefs::NONE_SIC))) 777 ||((mCurrentApp == ExternalAppHandler::SIP) && (mCurrentClient == KPimGlobalPrefs::NONE_SIC)))
765 { 778 {
766 enabled = false; 779 enabled = false;
767 } 780 }
768 else 781 else
769 { 782 {
770 enabled = true; 783 enabled = true;
771 } 784 }
772 785
773 786
774 mChannel->setReadOnly(readonly); 787 mChannel->setReadOnly(readonly);
775 mMessage->setReadOnly(readonly); 788 mMessage->setReadOnly(readonly);
776 mParameters->setReadOnly(readonly); 789 mParameters->setReadOnly(readonly);
790 if ( mMessage2 )
777 mMessage2->setReadOnly(readonly); 791 mMessage2->setReadOnly(readonly);
792 if ( mParameters2 )
778 mParameters2->setReadOnly(readonly); 793 mParameters2->setReadOnly(readonly);
779 794
780 mChannel->setEnabled(enabled); 795 mChannel->setEnabled(enabled);
781 mMessage->setEnabled(enabled); 796 mMessage->setEnabled(enabled);
782 mParameters->setEnabled(enabled); 797 mParameters->setEnabled(enabled);
798 if ( mMessage2 )
783 mMessage2->setEnabled(enabled); 799 mMessage2->setEnabled(enabled);
800 if ( mParameters2 )
784 mParameters2->setEnabled(enabled); 801 mParameters2->setEnabled(enabled);
785 802
786 803
787 804
788 mClient->setCurrentItem(mCurrentClient); 805 mClient->setCurrentItem(mCurrentClient);
789 806
790 807
791 // enable/disable the extra message/parameter field 808 // enable/disable the extra message/parameter field
792 if (mCurrentApp == ExternalAppHandler::EMAIL) 809 if (mCurrentApp == ExternalAppHandler::EMAIL)
793 { 810 {
794 } 811 }
795 else 812 else
796 { 813 {
814 if ( mMessage2 )
797 mMessage2->setText( "" ); 815 mMessage2->setText( "" );
816 if ( mParameters2 )
798 mParameters2->setText( "" ); 817 mParameters2->setText( "" );
799 } 818 }
800 819
801 if (enabled == true) { 820 if (enabled == true) {
821 if ( mMessage2 )
802 mMessage2->setEnabled(mCurrentApp == ExternalAppHandler::EMAIL); 822 mMessage2->setEnabled(mCurrentApp == ExternalAppHandler::EMAIL);
823 if ( mParameters2 )
803 mParameters2->setEnabled(mCurrentApp == ExternalAppHandler::EMAIL); 824 mParameters2->setEnabled(mCurrentApp == ExternalAppHandler::EMAIL);
804 } 825 }
805 826
806 827
807 blockSignals( blocked ); 828 blockSignals( blocked );
808 829
809} 830}
810 831
811void KDEPIMConfigWidget::usrReadConfig() 832void KDEPIMConfigWidget::usrReadConfig()
812{ 833{
813 KPimGlobalPrefs* prefs = KPimGlobalPrefs::instance(); 834 KPimGlobalPrefs* prefs = KPimGlobalPrefs::instance();
814 835
815 bool blocked = signalsBlocked(); 836 bool blocked = signalsBlocked();
816 blockSignals( true ); 837 blockSignals( true );
817 838
818 if (KPimGlobalPrefs::instance()->mBackupUseDefaultDir ) 839 if (KPimGlobalPrefs::instance()->mBackupUseDefaultDir )
819 mBackupUrl->setURL( KGlobalSettings::backupDataDir() ); 840 mBackupUrl->setURL( KGlobalSettings::backupDataDir() );
820 else 841 else
821 mBackupUrl->setURL(prefs->mBackupDatadir); 842 mBackupUrl->setURL(prefs->mBackupDatadir);
822 mBackupNumbersSpin->setValue( prefs->mBackupNumbers ); 843 mBackupNumbersSpin->setValue( prefs->mBackupNumbers );
823 mBackupDayCountSpin->setValue( prefs->mBackupDayCount); 844 mBackupDayCountSpin->setValue( prefs->mBackupDayCount);
824 845
825 QString dummy = prefs->mUserDateFormatLong; 846 QString dummy = prefs->mUserDateFormatLong;
826 mUserDateFormatLong->setText(dummy.replace( QRegExp("K"), QString(",") )); 847 mUserDateFormatLong->setText(dummy.replace( QRegExp("K"), QString(",") ));
827 dummy = prefs->mUserDateFormatShort; 848 dummy = prefs->mUserDateFormatShort;
828 mUserDateFormatShort->setText(dummy.replace( QRegExp("K"), QString(",") )); 849 mUserDateFormatShort->setText(dummy.replace( QRegExp("K"), QString(",") ));
829 850
830 QDate current ( 2001, 1,1); 851 QDate current ( 2001, 1,1);
831 mStartDateSavingEdit->setDate(current.addDays(prefs->mDaylightsavingStart-1)); 852 mStartDateSavingEdit->setDate(current.addDays(prefs->mDaylightsavingStart-1));
832 mEndDateSavingEdit->setDate(current.addDays(prefs->mDaylightsavingEnd-1)); 853 mEndDateSavingEdit->setDate(current.addDays(prefs->mDaylightsavingEnd-1));
833 setCombo(mTimeZoneCombo,i18n(prefs->mTimeZoneId)); 854 setCombo(mTimeZoneCombo,i18n(prefs->mTimeZoneId));
834 855
835 mEmailClient = prefs->mEmailClient; 856 mEmailClient = prefs->mEmailClient;
836 mEmailOtherChannel = prefs->mEmailOtherChannel; 857 mEmailOtherChannel = prefs->mEmailOtherChannel;
837 mEmailOtherMessage = prefs->mEmailOtherMessage; 858 mEmailOtherMessage = prefs->mEmailOtherMessage;
838 mEmailOtherMessageParameters = prefs->mEmailOtherMessageParameters; 859 mEmailOtherMessageParameters = prefs->mEmailOtherMessageParameters;
839 mEmailOtherMessage2 = prefs->mEmailOtherMessage2; 860 mEmailOtherMessage2 = prefs->mEmailOtherMessage2;
840 mEmailOtherMessageParameters2 = prefs->mEmailOtherMessageParameters2; 861 mEmailOtherMessageParameters2 = prefs->mEmailOtherMessageParameters2;
841 862
842 mPhoneClient = prefs->mPhoneClient; 863 mPhoneClient = prefs->mPhoneClient;
843 mPhoneOtherChannel = prefs->mPhoneOtherChannel; 864 mPhoneOtherChannel = prefs->mPhoneOtherChannel;
844 mPhoneOtherMessage = prefs->mPhoneOtherMessage; 865 mPhoneOtherMessage = prefs->mPhoneOtherMessage;
845 mPhoneOtherMessageParameters = prefs->mPhoneOtherMessageParameters; 866 mPhoneOtherMessageParameters = prefs->mPhoneOtherMessageParameters;
846 867
847 mFaxClient = prefs->mFaxClient; 868 mFaxClient = prefs->mFaxClient;
848 mFaxOtherChannel = prefs->mFaxOtherChannel; 869 mFaxOtherChannel = prefs->mFaxOtherChannel;
849 mFaxOtherMessage = prefs->mFaxOtherMessage; 870 mFaxOtherMessage = prefs->mFaxOtherMessage;
850 mFaxOtherMessageParameters = prefs->mFaxOtherMessageParameters; 871 mFaxOtherMessageParameters = prefs->mFaxOtherMessageParameters;
851 872
852 mSMSClient = prefs->mSMSClient; 873 mSMSClient = prefs->mSMSClient;
853 mSMSOtherChannel = prefs->mSMSOtherChannel; 874 mSMSOtherChannel = prefs->mSMSOtherChannel;
854 mSMSOtherMessage = prefs->mSMSOtherMessage; 875 mSMSOtherMessage = prefs->mSMSOtherMessage;
855 mSMSOtherMessageParameters = prefs->mSMSOtherMessageParameters; 876 mSMSOtherMessageParameters = prefs->mSMSOtherMessageParameters;
856 877
857 mPagerClient = prefs->mPagerClient; 878 mPagerClient = prefs->mPagerClient;
858 mPagerOtherChannel = prefs->mPagerOtherChannel; 879 mPagerOtherChannel = prefs->mPagerOtherChannel;
859 mPagerOtherMessage = prefs->mPagerOtherMessage; 880 mPagerOtherMessage = prefs->mPagerOtherMessage;
860 mPagerOtherMessageParameters = prefs->mPagerOtherMessageParameters; 881 mPagerOtherMessageParameters = prefs->mPagerOtherMessageParameters;
861 882
862 mSipClient = prefs->mSipClient; 883 mSipClient = prefs->mSipClient;
863 mSipOtherChannel = prefs->mSipOtherChannel; 884 mSipOtherChannel = prefs->mSipOtherChannel;
864 mSipOtherMessage = prefs->mSipOtherMessage; 885 mSipOtherMessage = prefs->mSipOtherMessage;
865 mSipOtherMessageParameters = prefs->mSipOtherMessageParameters; 886 mSipOtherMessageParameters = prefs->mSipOtherMessageParameters;
866 887
867 mCurrentApp = ExternalAppHandler::EMAIL; 888 mCurrentApp = ExternalAppHandler::EMAIL;
868 mCurrentClient = mEmailClient; 889 mCurrentClient = mEmailClient;
869 890
870 updateClientWidgets(); 891 updateClientWidgets();
871 892
872 blockSignals( blocked ); 893 blockSignals( blocked );
873 894
874} 895}
875 896
876void KDEPIMConfigWidget::usrWriteConfig() 897void KDEPIMConfigWidget::usrWriteConfig()
877{ 898{
878 KPimGlobalPrefs* prefs = KPimGlobalPrefs::instance(); 899 KPimGlobalPrefs* prefs = KPimGlobalPrefs::instance();
879 900
880 saveEditFieldSettings(); 901 saveEditFieldSettings();
881 902
882 prefs->mBackupNumbers = mBackupNumbersSpin->value(); 903 prefs->mBackupNumbers = mBackupNumbersSpin->value();
883 prefs->mBackupDayCount = mBackupDayCountSpin->value(); 904 prefs->mBackupDayCount = mBackupDayCountSpin->value();
884 prefs->mBackupDatadir = mBackupUrl->url(); 905 prefs->mBackupDatadir = mBackupUrl->url();
885 906
886 prefs->mUserDateFormatShort = mUserDateFormatShort->text().replace( QRegExp(","), QString("K") ); 907 prefs->mUserDateFormatShort = mUserDateFormatShort->text().replace( QRegExp(","), QString("K") );
887 prefs->mUserDateFormatLong = mUserDateFormatLong->text().replace( QRegExp(","), QString("K") ); 908 prefs->mUserDateFormatLong = mUserDateFormatLong->text().replace( QRegExp(","), QString("K") );
888 909
889 prefs->mTimeZoneId = mTimeZoneCombo->currentText(); 910 prefs->mTimeZoneId = mTimeZoneCombo->currentText();
890 QDate date; 911 QDate date;
891 date = mStartDateSavingEdit->date(); 912 date = mStartDateSavingEdit->date();
892 int sub = 0; 913 int sub = 0;
893 if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 ) 914 if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 )
894 sub = 1; 915 sub = 1;
895 prefs->mDaylightsavingStart = date.dayOfYear()-sub; 916 prefs->mDaylightsavingStart = date.dayOfYear()-sub;
896 date = mEndDateSavingEdit->date(); 917 date = mEndDateSavingEdit->date();
897 if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 ) 918 if ( QDate::leapYear( date.year() ) && date.dayOfYear() > 59 )
898 sub = 1; 919 sub = 1;
899 else 920 else
900 sub = 0; 921 sub = 0;
901 prefs->mDaylightsavingEnd = date.dayOfYear()-sub; 922 prefs->mDaylightsavingEnd = date.dayOfYear()-sub;
902 923
903 924
904 prefs->mEmailClient = mEmailClient; 925 prefs->mEmailClient = mEmailClient;
905 prefs->mEmailOtherChannel = mEmailOtherChannel; 926 prefs->mEmailOtherChannel = mEmailOtherChannel;
906 prefs->mEmailOtherMessage = mEmailOtherMessage; 927 prefs->mEmailOtherMessage = mEmailOtherMessage;
907 prefs->mEmailOtherMessageParameters = mEmailOtherMessageParameters; 928 prefs->mEmailOtherMessageParameters = mEmailOtherMessageParameters;
908 prefs->mEmailOtherMessage2 = mEmailOtherMessage2; 929 prefs->mEmailOtherMessage2 = mEmailOtherMessage2;
909 prefs->mEmailOtherMessageParameters2 = mEmailOtherMessageParameters2; 930 prefs->mEmailOtherMessageParameters2 = mEmailOtherMessageParameters2;
910 931
911 prefs->mPhoneClient = mPhoneClient; 932 prefs->mPhoneClient = mPhoneClient;
912 prefs->mPhoneOtherChannel = mPhoneOtherChannel; 933 prefs->mPhoneOtherChannel = mPhoneOtherChannel;
913 prefs->mPhoneOtherMessage = mPhoneOtherMessage; 934 prefs->mPhoneOtherMessage = mPhoneOtherMessage;
914 prefs->mPhoneOtherMessageParameters = mPhoneOtherMessageParameters; 935 prefs->mPhoneOtherMessageParameters = mPhoneOtherMessageParameters;
915 936
916 prefs->mFaxClient = mFaxClient; 937 prefs->mFaxClient = mFaxClient;
917 prefs->mFaxOtherChannel = mFaxOtherChannel; 938 prefs->mFaxOtherChannel = mFaxOtherChannel;
918 prefs->mFaxOtherMessage = mFaxOtherMessage; 939 prefs->mFaxOtherMessage = mFaxOtherMessage;
919 prefs->mFaxOtherMessageParameters = mFaxOtherMessageParameters; 940 prefs->mFaxOtherMessageParameters = mFaxOtherMessageParameters;
920 941
921 prefs->mSMSClient = mSMSClient; 942 prefs->mSMSClient = mSMSClient;
922 prefs->mSMSOtherChannel = mSMSOtherChannel; 943 prefs->mSMSOtherChannel = mSMSOtherChannel;
923 prefs->mSMSOtherMessage = mSMSOtherMessage; 944 prefs->mSMSOtherMessage = mSMSOtherMessage;
924 prefs->mSMSOtherMessageParameters = mSMSOtherMessageParameters; 945 prefs->mSMSOtherMessageParameters = mSMSOtherMessageParameters;
925 946
926 prefs->mPagerClient = mPagerClient; 947 prefs->mPagerClient = mPagerClient;
927 prefs->mPagerOtherChannel = mPagerOtherChannel; 948 prefs->mPagerOtherChannel = mPagerOtherChannel;
928 prefs->mPagerOtherMessage = mPagerOtherMessage; 949 prefs->mPagerOtherMessage = mPagerOtherMessage;
929 prefs->mPagerOtherMessageParameters = mPagerOtherMessageParameters; 950 prefs->mPagerOtherMessageParameters = mPagerOtherMessageParameters;
930 951
931 952
932 prefs->mSipClient = mSipClient; 953 prefs->mSipClient = mSipClient;
933 prefs->mSipOtherChannel = mSipOtherChannel; 954 prefs->mSipOtherChannel = mSipOtherChannel;
934 prefs->mSipOtherMessage = mSipOtherMessage; 955 prefs->mSipOtherMessage = mSipOtherMessage;
935 prefs->mSipOtherMessageParameters = mSipOtherMessageParameters; 956 prefs->mSipOtherMessageParameters = mSipOtherMessageParameters;
936 957
937 //release the cache that other views can access the changed values instantanious 958 //release the cache that other views can access the changed values instantanious
938 ExternalAppHandler::instance()->loadConfig(); 959 ExternalAppHandler::instance()->loadConfig();
939 KPimGlobalPrefs::instance()->setGlobalConfig(); 960 KPimGlobalPrefs::instance()->setGlobalConfig();
940} 961}
941 962
942 963
943void KDEPIMConfigWidget::setCombo(QComboBox *combo, const QString & text, 964void KDEPIMConfigWidget::setCombo(QComboBox *combo, const QString & text,
944 const QStringList *tags) 965 const QStringList *tags)
945{ 966{
946 if (tags) { 967 if (tags) {
947 int i = tags->findIndex(text); 968 int i = tags->findIndex(text);
948 if (i > 0) combo->setCurrentItem(i); 969 if (i > 0) combo->setCurrentItem(i);
949 } else { 970 } else {
950 for(int i=0;i<combo->count();++i) { 971 for(int i=0;i<combo->count();++i) {
951 if (combo->text(i) == text) { 972 if (combo->text(i) == text) {
952 combo->setCurrentItem(i); 973 combo->setCurrentItem(i);
953 break; 974 break;
954 } 975 }
955 } 976 }
956 } 977 }
957} 978}
958 979
959 980
960void KDEPIMConfigWidget::textChanged( const QString& text ) 981void KDEPIMConfigWidget::textChanged( const QString& text )
961{ 982{
962 emit changed( true ); 983 emit changed( true );
963} 984}