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