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