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