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