summaryrefslogtreecommitdiffabout
path: root/libkdepim
authorzautrix <zautrix>2005-06-10 13:54:08 (UTC)
committer zautrix <zautrix>2005-06-10 13:54:08 (UTC)
commit31fed261955dcb25d06052a8154ac4cc630b0f7d (patch) (unidiff)
treeef2b4fe35255f9bf387407b6756c112a67088ad6 /libkdepim
parentd2f00fc2034450bc9a3cd1d2c3510bef1758d3bc (diff)
downloadkdepimpi-31fed261955dcb25d06052a8154ac4cc630b0f7d.zip
kdepimpi-31fed261955dcb25d06052a8154ac4cc630b0f7d.tar.gz
kdepimpi-31fed261955dcb25d06052a8154ac4cc630b0f7d.tar.bz2
fixxx
Diffstat (limited to 'libkdepim') (more/less context) (ignore whitespace changes)
-rw-r--r--libkdepim/kcmconfigs/kdepimconfigwidget.cpp91
1 files changed, 56 insertions, 35 deletions
diff --git a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
index 93538ec..d3797ae 100644
--- a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
+++ b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
@@ -147,65 +147,66 @@ void KDEPIMConfigWidget::setupBackupTab()
147 new QLabel(i18n(" "),dummy); 147 new QLabel(i18n(" "),dummy);
148 bupLayout->addWidget( dummy ); 148 bupLayout->addWidget( dummy );
149 149
150 dummy = new QHBox(bupFrame); 150 dummy = new QHBox(bupFrame);
151 new QLabel(i18n("Make backup every "),dummy); 151 new QLabel(i18n("Make backup every "),dummy);
152 mBackupDayCountSpin = new QSpinBox(1,28,1,dummy); 152 mBackupDayCountSpin = new QSpinBox(1,28,1,dummy);
153 new QLabel(i18n(" days"),dummy); 153 new QLabel(i18n(" days"),dummy);
154 new QLabel(i18n(" "),dummy); 154 new QLabel(i18n(" "),dummy);
155 bupLayout->addWidget( dummy ); 155 bupLayout->addWidget( dummy );
156 QString localKdeDir; 156 QString localKdeDir;
157 localKdeDir = readEnvPath("LOCALMICROKDEHOME"); 157 localKdeDir = readEnvPath("LOCALMICROKDEHOME");
158 if ( ! localKdeDir.isEmpty() ) { 158 if ( ! localKdeDir.isEmpty() ) {
159 sb->checkBox()->setEnabled( false ); 159 sb->checkBox()->setEnabled( false );
160 sb->checkBox()->setChecked( true ); 160 sb->checkBox()->setChecked( true );
161 mBackupUrl->setEnabled( false ); 161 mBackupUrl->setEnabled( false );
162 KPimGlobalPrefs::instance()->mBackupUseDefaultDir = true; 162 KPimGlobalPrefs::instance()->mBackupUseDefaultDir = true;
163 } 163 }
164 164
165} 165}
166void KDEPIMConfigWidget::setupStoreTab() 166void KDEPIMConfigWidget::setupStoreTab()
167{ 167{
168 QVBox *colorPage = new QVBox( this ); 168 QVBox *colorPage = new QVBox( this );
169 tabWidget->addTab( colorPage, i18n( "Colors" ) ); 169 tabWidget->addTab( colorPage, i18n( "Colors" ) );
170 QWidget* cw = new QWidget( colorPage ); 170 QWidget* cw = new QWidget( colorPage );
171 KPrefsWidColor *holidayColor = 171 KPrefsWidColor *holidayColor =
172 addWidColor(i18n("Alternating background of list views"), 172 addWidColor(i18n("Alternating background of list views"),
173 &(KPimGlobalPrefs::instance()->mAlternateColor),cw); 173 &(KPimGlobalPrefs::instance()->mAlternateColor),cw);
174 QHBoxLayout *topLayout = new QHBoxLayout(cw); 174 QHBoxLayout *topLayout = new QHBoxLayout(cw);
175 topLayout->addWidget(holidayColor->label()); 175 topLayout->addWidget(holidayColor->label());
176 topLayout->addWidget( (QWidget* )holidayColor->button()); 176 topLayout->addWidget( (QWidget* )holidayColor->button());
177 177
178 178
179 QVBox *storePage = new QVBox( this ); 179 QVBox *storePage = new QVBox( this );
180 if ( QApplication::desktop()->height() > 240 )
180 new QLabel( i18n("Your current storage dir is:\n%1\nYour mail is stored in:\n(storagedir)/apps/kopiemail/localmail").arg(KGlobal::dirs()->localkdedir()), storePage ); 181 new QLabel( i18n("Your current storage dir is:\n%1\nYour mail is stored in:\n(storagedir)/apps/kopiemail/localmail").arg(KGlobal::dirs()->localkdedir()), storePage );
181 new QLabel( i18n("<b>New data storage dir:</b>"), storePage ); 182 new QLabel( i18n("<b>New data storage dir:</b>"), storePage );
182 mStoreUrl = new KURLRequester( storePage ); 183 mStoreUrl = new KURLRequester( storePage );
183 mStoreUrl->setURL( KGlobal::dirs()->localkdedir() ); 184 mStoreUrl->setURL( KGlobal::dirs()->localkdedir() );
184#ifdef DESKTOP_VERSION 185#ifdef DESKTOP_VERSION
185 QString confFile = qApp->applicationDirPath ()+ "/.microkdehome" ; 186 QString confFile = qApp->applicationDirPath ()+ "/.microkdehome" ;
186 QFileInfo fi ( confFile ); 187 QFileInfo fi ( confFile );
187 if ( fi.exists() ) { 188 if ( fi.exists() ) {
188 KConfig cfg ( confFile ); 189 KConfig cfg ( confFile );
189 cfg.setGroup("Global"); 190 cfg.setGroup("Global");
190 QString localKdeDir = cfg.readEntry( "MICROKDEHOME", "x_x_x" ); 191 QString localKdeDir = cfg.readEntry( "MICROKDEHOME", "x_x_x" );
191 if ( localKdeDir != "x_x_x" ) { 192 if ( localKdeDir != "x_x_x" ) {
192 mStoreUrl->setURL( localKdeDir ); 193 mStoreUrl->setURL( localKdeDir );
193 qDebug("Reading config from %s ", confFile.latin1()); 194 qDebug("Reading config from %s ", confFile.latin1());
194 } 195 }
195 } 196 }
196 197
197#endif 198#endif
198 new QLabel( i18n("New dirs are created automatically"), storePage ); 199 new QLabel( i18n("New dirs are created automatically"), storePage );
199 QHBox *bb = new QHBox( storePage ); 200 QHBox *bb = new QHBox( storePage );
200 QPushButton * pb; 201 QPushButton * pb;
201 if ( QApplication::desktop()->width() < 640 ) 202 if ( QApplication::desktop()->width() < 640 )
202 pb = new QPushButton ( i18n("Save"), bb ); 203 pb = new QPushButton ( i18n("Save"), bb );
203 else 204 else
204 pb = new QPushButton ( i18n("Save settings"), bb ); 205 pb = new QPushButton ( i18n("Save settings"), bb );
205 connect(pb, SIGNAL( clicked() ), this, SLOT ( saveStoreSettings() ) ); 206 connect(pb, SIGNAL( clicked() ), this, SLOT ( saveStoreSettings() ) );
206 pb = new QPushButton ( i18n("Save standard"), bb ); 207 pb = new QPushButton ( i18n("Save standard"), bb );
207 connect(pb, SIGNAL( clicked() ), this, SLOT ( setStandardStore() ) ); 208 connect(pb, SIGNAL( clicked() ), this, SLOT ( setStandardStore() ) );
208#ifdef DESKTOP_VERSION 209#ifdef DESKTOP_VERSION
209 pb = new QPushButton ( i18n("Save using LOCAL storage"), bb ); 210 pb = new QPushButton ( i18n("Save using LOCAL storage"), bb );
210 connect(pb, SIGNAL( clicked() ), this, SLOT ( setLocalStore() ) ); 211 connect(pb, SIGNAL( clicked() ), this, SLOT ( setLocalStore() ) );
211#endif 212#endif
@@ -261,154 +262,160 @@ void KDEPIMConfigWidget::setupExternalAppTab()
261 262
262 connect( mExternalApps, SIGNAL( activated( int ) ), 263 connect( mExternalApps, SIGNAL( activated( int ) ),
263 this, SLOT (externalapp_changed( int ) ) ); 264 this, SLOT (externalapp_changed( int ) ) );
264 265
265 266
266 mExternalAppGroupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Used Mail Client" ), externalAppsPage ); 267 mExternalAppGroupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Used Mail Client" ), externalAppsPage );
267 QGridLayout *boxLayout = new QGridLayout( mExternalAppGroupBox->layout(), 4, 2, -1, "gridlayout" ); 268 QGridLayout *boxLayout = new QGridLayout( mExternalAppGroupBox->layout(), 4, 2, -1, "gridlayout" );
268 mExternalAppGroupBox->layout()->setMargin(4); 269 mExternalAppGroupBox->layout()->setMargin(4);
269 270
270 mClient = new QComboBox( mExternalAppGroupBox ); 271 mClient = new QComboBox( mExternalAppGroupBox );
271 boxLayout->addMultiCellWidget( mClient, 0, 0, 0, 1 ); 272 boxLayout->addMultiCellWidget( mClient, 0, 0, 0, 1 );
272 273
273 connect( mClient, SIGNAL( activated( int ) ), 274 connect( mClient, SIGNAL( activated( int ) ),
274 this, SLOT (client_changed( int ) ) ); 275 this, SLOT (client_changed( int ) ) );
275 276
276 QLabel* lab = new QLabel( i18n("Channel:"), mExternalAppGroupBox); 277 QLabel* lab = new QLabel( i18n("Channel:"), mExternalAppGroupBox);
277 boxLayout->addWidget( lab, 1, 0 ); 278 boxLayout->addWidget( lab, 1, 0 );
278 mChannel = new QLineEdit(mExternalAppGroupBox); 279 mChannel = new QLineEdit(mExternalAppGroupBox);
279 mChannel->setReadOnly(true); 280 mChannel->setReadOnly(true);
280 boxLayout->addMultiCellWidget( mChannel, 2 , 2, 0, 1 ); 281 boxLayout->addMultiCellWidget( mChannel, 2 , 2, 0, 1 );
281 282
282 lab = new QLabel( i18n("Message:"), mExternalAppGroupBox); 283 lab = new QLabel( i18n("Message:"), mExternalAppGroupBox);
283 boxLayout->addWidget( lab, 3, 0 ); 284 boxLayout->addWidget( lab, 3, 0 );
284 mMessage = new QLineEdit(mExternalAppGroupBox); 285 mMessage = new QLineEdit(mExternalAppGroupBox);
285 mMessage->setReadOnly(true); 286 mMessage->setReadOnly(true);
286 boxLayout->addWidget( mMessage , 4, 0); 287 boxLayout->addWidget( mMessage , 4, 0);
287 288
288 lab = new QLabel( i18n("Parameters:"), mExternalAppGroupBox); 289 lab = new QLabel( i18n("Parameters:"), mExternalAppGroupBox);
289 boxLayout->addWidget( lab, 3, 1 ); 290 boxLayout->addWidget( lab, 3, 1 );
290 mParameters = new QLineEdit(mExternalAppGroupBox); 291 mParameters = new QLineEdit(mExternalAppGroupBox);
291 mParameters->setReadOnly(true); 292 mParameters->setReadOnly(true);
292 boxLayout->addWidget( mParameters, 4, 1 ); 293 boxLayout->addWidget( mParameters, 4, 1 );
293 294 lab = new QLabel( i18n("HINT: Delimiter=; Name=%1,Email=%2"), mExternalAppGroupBox);
294 lab = new QLabel( i18n("HINT: Delimiter=; Name=%1,Email=%2"), mExternalAppGroupBox); 295 boxLayout->addMultiCellWidget( lab, 5, 5, 0, 1 );
295 boxLayout->addMultiCellWidget( lab, 5, 5, 0, 1 ); 296
296 297
297 298 if ( QApplication::desktop()->height() > 240 ) {
298 lab = new QLabel( i18n("extra Message:"), mExternalAppGroupBox); 299 lab = new QLabel( i18n("extra Message:"), mExternalAppGroupBox);
299 boxLayout->addWidget( lab, 6, 0 ); 300 boxLayout->addWidget( lab, 6, 0 );
300 mMessage2 = new QLineEdit(mExternalAppGroupBox); 301 mMessage2 = new QLineEdit(mExternalAppGroupBox);
301 mMessage2->setReadOnly(true); 302 mMessage2->setReadOnly(true);
302 boxLayout->addWidget( mMessage2 , 7, 0); 303 boxLayout->addWidget( mMessage2 , 7, 0);
303 304
304 lab = new QLabel( i18n("extra Parameters:"), mExternalAppGroupBox); 305 lab = new QLabel( i18n("extra Parameters:"), mExternalAppGroupBox);
305 boxLayout->addWidget( lab, 6, 1 ); 306 boxLayout->addWidget( lab, 6, 1 );
306 mParameters2 = new QLineEdit(mExternalAppGroupBox); 307 mParameters2 = new QLineEdit(mExternalAppGroupBox);
307 mParameters2->setReadOnly(true); 308 mParameters2->setReadOnly(true);
308 boxLayout->addWidget( mParameters2, 7, 1 ); 309 boxLayout->addWidget( mParameters2, 7, 1 );
309 310
310 lab = new QLabel( i18n("HINT: Emails=%1,Attachments=%2"), mExternalAppGroupBox); 311 lab = new QLabel( i18n("HINT: Emails=%1,Attachments=%2"), mExternalAppGroupBox);
311 boxLayout->addMultiCellWidget( lab, 8, 8, 0, 1 ); 312 boxLayout->addMultiCellWidget( lab, 8, 8, 0, 1 );
312 313 connect( mMessage2, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
314 connect( mParameters2, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
315 } else {
316 mMessage2 = 0;
317 mParameters2 = 0;
318 }
313 319
314 connect( mChannel, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 320 connect( mChannel, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
315 connect( mMessage, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 321 connect( mMessage, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
316 connect( mParameters, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 322 connect( mParameters, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
317 connect( mMessage2, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
318 connect( mParameters2, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
319 323
320 324
321 layout->addWidget( mExternalAppGroupBox ); 325 layout->addWidget( mExternalAppGroupBox );
322 tabWidget->addTab( externalAppsPage, i18n( "External Apps." ) ); 326 tabWidget->addTab( externalAppsPage, i18n( "External Apps." ) );
323 327
324} 328}
325 329
326 330
327void KDEPIMConfigWidget::setupLocaleDateTab() 331void KDEPIMConfigWidget::setupLocaleDateTab()
328{ 332{
329 QWidget *topFrame = new QWidget( this ); 333 QWidget *topFrame = new QWidget( this );
330 QGridLayout *topLayout = new QGridLayout( topFrame, 3, 2); 334 QGridLayout *topLayout = new QGridLayout( topFrame, 3, 2);
331 335
332 topLayout->setSpacing(KDialog::spacingHintSmall()); 336 topLayout->setSpacing(KDialog::spacingHintSmall());
333 topLayout->setMargin(KDialog::marginHintSmall()); 337 topLayout->setMargin(KDialog::marginHintSmall());
334 int iii = 0; 338 int iii = 0;
335 339
336 340
337 KPrefsWidRadios *syncPrefsGroup = 341 KPrefsWidRadios *syncPrefsGroup =
338 addWidRadios(i18n("Date Format:"),&(KPimGlobalPrefs::instance()->mPreferredDate),topFrame); 342 addWidRadios(i18n("Date Format:"),&(KPimGlobalPrefs::instance()->mPreferredDate),topFrame);
339 QString format; 343 QString format;
340 if ( QApplication::desktop()->width() < 480 ) 344 if ( QApplication::desktop()->width() < 480 )
341 format = "(%d.%m.%Y)"; 345 format = "(%d.%m.%Y)";
342 else 346 else
343 format = "(%d.%m.%Y|%A %d %B %Y)"; 347 format = "(%d.%m.%Y|%A %d %B %Y)";
344 syncPrefsGroup->addRadio(i18n("24.03.2004 "+format)); 348 syncPrefsGroup->addRadio(i18n("24.03.2004 "+format));
345 if ( QApplication::desktop()->width() < 480 ) 349 if ( QApplication::desktop()->width() < 480 )
346 format = "(%m.%d.%Y)"; 350 format = "(%m.%d.%Y)";
347 else 351 else
348 format = "(%m.%d.%Y|%A %B %d %Y)"; 352 format = "(%m.%d.%Y|%A %B %d %Y)";
349 syncPrefsGroup->addRadio(i18n("03.24.2004 "+format)); 353 syncPrefsGroup->addRadio(i18n("03.24.2004 "+format));
350 if ( QApplication::desktop()->width() < 480 ) 354 if ( QApplication::desktop()->width() < 480 )
351 format = "(%Y-%m-%d)"; 355 format = "(%Y-%m-%d)";
352 else 356 else
353 format = "(%Y-%m-%d|%A %Y %B %d)"; 357 format = "(%Y-%m-%d|%A %Y %B %d)";
354 syncPrefsGroup->addRadio(i18n("2004-03-24 "+format)); 358 syncPrefsGroup->addRadio(i18n("2004-03-24 "+format));
355 syncPrefsGroup->addRadio(i18n("User defined")); 359 syncPrefsGroup->addRadio(i18n("User defined"));
356 if ( QApplication::desktop()->width() < 480 ) { 360 if ( QApplication::desktop()->width() < 480 ) {
357 syncPrefsGroup->groupBox()->layout()->setMargin( 5 ); 361 syncPrefsGroup->groupBox()->layout()->setMargin( 5 );
358 syncPrefsGroup->groupBox()->layout()->setSpacing( 0 ); 362 syncPrefsGroup->groupBox()->layout()->setSpacing( 0 );
359 } 363 }
360 topLayout->addMultiCellWidget( (QWidget*)syncPrefsGroup->groupBox(),iii,iii,0,1); 364 topLayout->addMultiCellWidget( (QWidget*)syncPrefsGroup->groupBox(),iii,iii,0,1);
361 ++iii; 365 ++iii;
362 ++iii; 366 ++iii;
363 QLabel * lab; 367 QLabel * lab;
364 mUserDateFormatLong = new QLineEdit(topFrame); 368 mUserDateFormatLong = new QLineEdit(topFrame);
365 lab = new QLabel(mUserDateFormatLong, i18n("User long date:"), topFrame); 369 lab = new QLabel(mUserDateFormatLong, i18n("User long date:"), topFrame);
366 topLayout->addWidget(lab ,iii,0); 370 topLayout->addWidget(lab ,iii,0);
367 topLayout->addWidget(mUserDateFormatLong,iii,1); 371 topLayout->addWidget(mUserDateFormatLong,iii,1);
368 ++iii; 372 ++iii;
369 mUserDateFormatShort = new QLineEdit(topFrame); 373 mUserDateFormatShort = new QLineEdit(topFrame);
370 lab = new QLabel(mUserDateFormatShort, i18n("User short date:"), topFrame); 374 lab = new QLabel(mUserDateFormatShort, i18n("User short date:"), topFrame);
371 topLayout->addWidget(lab ,iii,0); 375 topLayout->addWidget(lab ,iii,0);
372 topLayout->addWidget(mUserDateFormatShort,iii,1); 376 topLayout->addWidget(mUserDateFormatShort,iii,1);
373 ++iii; 377 ++iii;
374 lab = new QLabel( i18n("Monday 19 April 2004: %A %d %B %Y"), topFrame); 378 lab = new QLabel( i18n("Monday 19 April 2004: %A %d %B %Y"), topFrame);
375 topLayout->addMultiCellWidget(lab ,iii,iii,0,1); 379 topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
376 ++iii; 380 ++iii;
377 lab = new QLabel( i18n("Mon 19.04.04: %a %d.%m.%y"), topFrame); 381 //qDebug(" QApplication::desktop()->height()xx %d ", QApplication::desktop()->height() );
378 topLayout->addMultiCellWidget(lab ,iii,iii,0,1); 382 if ( QApplication::desktop()->height() > 240 ) {
379 ++iii; 383 lab = new QLabel( i18n("Mon 19.04.04: %a %d.%m.%y"), topFrame);
380 lab = new QLabel( i18n("Mon, 19.Apr.04: %a, %d.%b.%y"), topFrame); 384 topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
381 topLayout->addMultiCellWidget(lab ,iii,iii,0,1); 385 ++iii;
382 ++iii; 386 lab = new QLabel( i18n("Mon, 19.Apr.04: %a, %d.%b.%y"), topFrame);
387 topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
388 ++iii;
389 }
383 390
384 connect( mUserDateFormatLong, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 391 connect( mUserDateFormatLong, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
385 connect( mUserDateFormatShort, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); 392 connect( mUserDateFormatShort, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) );
386 393
387 394
388 tabWidget->addTab( topFrame, i18n( "Date Format" ) ); 395 tabWidget->addTab( topFrame, i18n( "Date Format" ) );
389} 396}
390 397
391void KDEPIMConfigWidget::setupLocaleTab() 398void KDEPIMConfigWidget::setupLocaleTab()
392{ 399{
393 400
394 QWidget *topFrame = new QWidget( this ); 401 QWidget *topFrame = new QWidget( this );
395 QGridLayout *topLayout = new QGridLayout(topFrame,4,2); 402 QGridLayout *topLayout = new QGridLayout(topFrame,4,2);
396 403
397 topLayout->setSpacing(KDialog::spacingHint()); 404 topLayout->setSpacing(KDialog::spacingHint());
398 topLayout->setMargin(KDialog::marginHint()); 405 topLayout->setMargin(KDialog::marginHint());
399 int iii = 0; 406 int iii = 0;
400 KPrefsWidRadios *syncPrefsGroup = 407 KPrefsWidRadios *syncPrefsGroup =
401 addWidRadios(i18n("Language:(needs restart)"),&(KPimGlobalPrefs::instance()->mPreferredLanguage),topFrame); 408 addWidRadios(i18n("Language:(needs restart)"),&(KPimGlobalPrefs::instance()->mPreferredLanguage),topFrame);
402 syncPrefsGroup->addRadio(i18n("English")); 409 syncPrefsGroup->addRadio(i18n("English"));
403 syncPrefsGroup->addRadio(i18n("German")); 410 syncPrefsGroup->addRadio(i18n("German"));
404 syncPrefsGroup->addRadio(i18n("French")); 411 syncPrefsGroup->addRadio(i18n("French"));
405 syncPrefsGroup->addRadio(i18n("Italian")); 412 syncPrefsGroup->addRadio(i18n("Italian"));
406 syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)")); 413 syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)"));
407 if ( QApplication::desktop()->width() < 300 ) { 414 if ( QApplication::desktop()->width() < 300 ) {
408 syncPrefsGroup->groupBox()->layout()->setMargin( 5 ); 415 syncPrefsGroup->groupBox()->layout()->setMargin( 5 );
409 syncPrefsGroup->groupBox()->layout()->setSpacing( 0 ); 416 syncPrefsGroup->groupBox()->layout()->setSpacing( 0 );
410 } 417 }
411 topLayout->addMultiCellWidget( (QWidget*)syncPrefsGroup->groupBox(),iii,iii,0,1); 418 topLayout->addMultiCellWidget( (QWidget*)syncPrefsGroup->groupBox(),iii,iii,0,1);
412 ++iii; 419 ++iii;
413 420
414 421
@@ -599,140 +606,146 @@ void KDEPIMConfigWidget::saveEditFieldSettings()
599{ 606{
600 607
601 switch(mCurrentApp) 608 switch(mCurrentApp)
602 { 609 {
603 case(ExternalAppHandler::EMAIL): 610 case(ExternalAppHandler::EMAIL):
604 mEmailClient = mClient->currentItem(); 611 mEmailClient = mClient->currentItem();
605 break; 612 break;
606 case(ExternalAppHandler::PHONE): 613 case(ExternalAppHandler::PHONE):
607 mPhoneClient= mClient->currentItem(); 614 mPhoneClient= mClient->currentItem();
608 break; 615 break;
609 case(ExternalAppHandler::SMS): 616 case(ExternalAppHandler::SMS):
610 mSMSClient = mClient->currentItem(); 617 mSMSClient = mClient->currentItem();
611 break; 618 break;
612 case(ExternalAppHandler::FAX): 619 case(ExternalAppHandler::FAX):
613 mFaxClient = mClient->currentItem(); 620 mFaxClient = mClient->currentItem();
614 break; 621 break;
615 case(ExternalAppHandler::PAGER): 622 case(ExternalAppHandler::PAGER):
616 mPagerClient = mClient->currentItem(); 623 mPagerClient = mClient->currentItem();
617 break; 624 break;
618 case(ExternalAppHandler::SIP): 625 case(ExternalAppHandler::SIP):
619 mSipClient = mClient->currentItem(); 626 mSipClient = mClient->currentItem();
620 break; 627 break;
621 default: 628 default:
622 return; 629 return;
623 } 630 }
624 631
625 //store the current data back to the apropriate membervariables if we had set it to "other" 632 //store the current data back to the apropriate membervariables if we had set it to "other"
626 if ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::OTHER_EMC)) 633 if ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::OTHER_EMC))
627 { 634 {
628 mEmailOtherChannel = mChannel->text(); 635 mEmailOtherChannel = mChannel->text();
629 mEmailOtherMessage = mMessage->text(); 636 mEmailOtherMessage = mMessage->text();
630 mEmailOtherMessageParameters = mParameters->text(); 637 mEmailOtherMessageParameters = mParameters->text();
631 mEmailOtherMessage2 = mMessage2->text(); 638 if ( mMessage2 )
632 mEmailOtherMessageParameters2 = mParameters2->text(); 639 mEmailOtherMessage2 = mMessage2->text();
640 if ( mParameters2 )
641 mEmailOtherMessageParameters2 = mParameters2->text();
633 } 642 }
634 else if ((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::OTHER_PHC)) 643 else if ((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::OTHER_PHC))
635 { 644 {
636 mPhoneOtherChannel = mChannel->text(); 645 mPhoneOtherChannel = mChannel->text();
637 mPhoneOtherMessage = mMessage->text(); 646 mPhoneOtherMessage = mMessage->text();
638 mPhoneOtherMessageParameters = mParameters->text(); 647 mPhoneOtherMessageParameters = mParameters->text();
639 } 648 }
640 else if ((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::OTHER_SMC)) 649 else if ((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::OTHER_SMC))
641 { 650 {
642 mSMSOtherChannel = mChannel->text(); 651 mSMSOtherChannel = mChannel->text();
643 mSMSOtherMessage = mMessage->text(); 652 mSMSOtherMessage = mMessage->text();
644 mSMSOtherMessageParameters = mParameters->text(); 653 mSMSOtherMessageParameters = mParameters->text();
645 } 654 }
646 else if ((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::OTHER_FAC)) 655 else if ((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::OTHER_FAC))
647 { 656 {
648 mFaxOtherChannel = mChannel->text(); 657 mFaxOtherChannel = mChannel->text();
649 mFaxOtherMessage = mMessage->text(); 658 mFaxOtherMessage = mMessage->text();
650 mFaxOtherMessageParameters = mParameters->text(); 659 mFaxOtherMessageParameters = mParameters->text();
651 } 660 }
652 else if ((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::OTHER_PAC)) 661 else if ((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::OTHER_PAC))
653 { 662 {
654 mPagerOtherChannel = mChannel->text(); 663 mPagerOtherChannel = mChannel->text();
655 mPagerOtherMessage = mMessage->text(); 664 mPagerOtherMessage = mMessage->text();
656 mPagerOtherMessageParameters = mParameters->text(); 665 mPagerOtherMessageParameters = mParameters->text();
657 } 666 }
658 else if ((mCurrentApp == ExternalAppHandler::SIP) && (mCurrentClient == KPimGlobalPrefs::OTHER_SIC)) 667 else if ((mCurrentApp == ExternalAppHandler::SIP) && (mCurrentClient == KPimGlobalPrefs::OTHER_SIC))
659 { 668 {
660 mSipOtherChannel = mChannel->text(); 669 mSipOtherChannel = mChannel->text();
661 mSipOtherMessage = mMessage->text(); 670 mSipOtherMessage = mMessage->text();
662 mSipOtherMessageParameters = mParameters->text(); 671 mSipOtherMessageParameters = mParameters->text();
663 } 672 }
664 673
665 674
666} 675}
667 676
668void KDEPIMConfigWidget::updateClientWidgets() 677void KDEPIMConfigWidget::updateClientWidgets()
669{ 678{
670 bool blocked = signalsBlocked(); 679 bool blocked = signalsBlocked();
671 blockSignals( true ); 680 blockSignals( true );
672 681
673 // at this point we assume, that mCurrentApp and mCurrentClient are set to the values that we want to display 682 // at this point we assume, that mCurrentApp and mCurrentClient are set to the values that we want to display
674 QMap<ExternalAppHandler::Types, QString>::Iterator it = mExternalAppsMap.find ( mCurrentApp ); 683 QMap<ExternalAppHandler::Types, QString>::Iterator it = mExternalAppsMap.find ( mCurrentApp );
675 if (it == mExternalAppsMap.end()) 684 if (it == mExternalAppsMap.end())
676 return; 685 return;
677 686
678 // update group box 687 // update group box
679 mExternalAppGroupBox->setTitle(i18n( "Used %1 Client" ).arg(it.data())); 688 mExternalAppGroupBox->setTitle(i18n( "Used %1 Client" ).arg(it.data()));
680 689
681 //update the entries in the client combobox 690 //update the entries in the client combobox
682 mClient->clear(); 691 mClient->clear();
683 692
684 QList<DefaultAppItem> items = ExternalAppHandler::instance()->getAvailableDefaultItems(mCurrentApp); 693 QList<DefaultAppItem> items = ExternalAppHandler::instance()->getAvailableDefaultItems(mCurrentApp);
685 DefaultAppItem* dai; 694 DefaultAppItem* dai;
686 for ( dai=items.first(); dai != 0; dai=items.next() ) 695 for ( dai=items.first(); dai != 0; dai=items.next() )
687 { 696 {
688 mClient->insertItem( i18n(dai->_label), dai->_id ); 697 mClient->insertItem( i18n(dai->_label), dai->_id );
689 698
690 if (dai->_id == mCurrentClient) 699 if (dai->_id == mCurrentClient)
691 { 700 {
692 //restore the edit fields with the data of the local membervariables if we had set it to "other". 701 //restore the edit fields with the data of the local membervariables if we had set it to "other".
693 //Otherwise take the default data from externalapphandler. 702 //Otherwise take the default data from externalapphandler.
694 mChannel->setText(dai->_channel); 703 mChannel->setText(dai->_channel);
695 mMessage->setText(dai->_message); 704 mMessage->setText(dai->_message);
696 mParameters->setText(dai->_parameters); 705 mParameters->setText(dai->_parameters);
697 mMessage2->setText(dai->_message2); 706 if ( mMessage2 )
707 mMessage2->setText(dai->_message2);
708 if ( mParameters2 )
698 mParameters2->setText(dai->_parameters2); 709 mParameters2->setText(dai->_parameters2);
699 710
700 711
701 if ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::OTHER_EMC)) 712 if ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::OTHER_EMC))
702 { 713 {
703 mChannel->setText(mEmailOtherChannel); 714 mChannel->setText(mEmailOtherChannel);
704 mMessage->setText(mEmailOtherMessage); 715 mMessage->setText(mEmailOtherMessage);
705 mParameters->setText(mEmailOtherMessageParameters); 716 mParameters->setText(mEmailOtherMessageParameters);
717 if ( mMessage2 )
706 mMessage2->setText(mEmailOtherMessage2); 718 mMessage2->setText(mEmailOtherMessage2);
719 if ( mParameters2 )
707 mParameters2->setText(mEmailOtherMessageParameters2); 720 mParameters2->setText(mEmailOtherMessageParameters2);
708 } 721 }
709 else if ((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::OTHER_PHC)) 722 else if ((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::OTHER_PHC))
710 { 723 {
711 mChannel->setText(mPhoneOtherChannel); 724 mChannel->setText(mPhoneOtherChannel);
712 mMessage->setText(mPhoneOtherMessage); 725 mMessage->setText(mPhoneOtherMessage);
713 mParameters->setText(mPhoneOtherMessageParameters); 726 mParameters->setText(mPhoneOtherMessageParameters);
714 } 727 }
715 else if ((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::OTHER_SMC)) 728 else if ((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::OTHER_SMC))
716 { 729 {
717 mChannel->setText(mSMSOtherChannel); 730 mChannel->setText(mSMSOtherChannel);
718 mMessage->setText(mSMSOtherMessage); 731 mMessage->setText(mSMSOtherMessage);
719 mParameters->setText(mSMSOtherMessageParameters); 732 mParameters->setText(mSMSOtherMessageParameters);
720 } 733 }
721 else if ((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::OTHER_FAC)) 734 else if ((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::OTHER_FAC))
722 { 735 {
723 mChannel->setText(mFaxOtherChannel); 736 mChannel->setText(mFaxOtherChannel);
724 mMessage->setText(mFaxOtherMessage); 737 mMessage->setText(mFaxOtherMessage);
725 mParameters->setText(mFaxOtherMessageParameters); 738 mParameters->setText(mFaxOtherMessageParameters);
726 } 739 }
727 else if ((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::OTHER_PAC)) 740 else if ((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::OTHER_PAC))
728 { 741 {
729 mChannel->setText(mPagerOtherChannel); 742 mChannel->setText(mPagerOtherChannel);
730 mMessage->setText(mPagerOtherMessage); 743 mMessage->setText(mPagerOtherMessage);
731 mParameters->setText(mPagerOtherMessageParameters); 744 mParameters->setText(mPagerOtherMessageParameters);
732 } 745 }
733 else if ((mCurrentApp == ExternalAppHandler::SIP) && (mCurrentClient == KPimGlobalPrefs::OTHER_SIC)) 746 else if ((mCurrentApp == ExternalAppHandler::SIP) && (mCurrentClient == KPimGlobalPrefs::OTHER_SIC))
734 { 747 {
735 mChannel->setText(mSipOtherChannel); 748 mChannel->setText(mSipOtherChannel);
736 mMessage->setText(mSipOtherMessage); 749 mMessage->setText(mSipOtherMessage);
737 mParameters->setText(mSipOtherMessageParameters); 750 mParameters->setText(mSipOtherMessageParameters);
738 } 751 }
@@ -744,91 +757,99 @@ void KDEPIMConfigWidget::updateClientWidgets()
744 bool enabled; 757 bool enabled;
745 if ( ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::OTHER_EMC)) 758 if ( ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::OTHER_EMC))
746 ||((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::OTHER_PHC)) 759 ||((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::OTHER_PHC))
747 ||((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::OTHER_SMC)) 760 ||((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::OTHER_SMC))
748 ||((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::OTHER_FAC)) 761 ||((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::OTHER_FAC))
749 ||((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::OTHER_PAC)) 762 ||((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::OTHER_PAC))
750 ||((mCurrentApp == ExternalAppHandler::SIP) && (mCurrentClient == KPimGlobalPrefs::OTHER_SIC))) 763 ||((mCurrentApp == ExternalAppHandler::SIP) && (mCurrentClient == KPimGlobalPrefs::OTHER_SIC)))
751 { 764 {
752 readonly = false; 765 readonly = false;
753 } 766 }
754 else 767 else
755 { 768 {
756 readonly = true; 769 readonly = true;
757 } 770 }
758 771
759 if ( ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::NONE_EMC)) 772 if ( ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::NONE_EMC))
760 ||((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::NONE_PHC)) 773 ||((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::NONE_PHC))
761 ||((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::NONE_SMC)) 774 ||((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::NONE_SMC))
762 ||((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::NONE_FAC)) 775 ||((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::NONE_FAC))
763 ||((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::NONE_PAC)) 776 ||((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::NONE_PAC))
764 ||((mCurrentApp == ExternalAppHandler::SIP) && (mCurrentClient == KPimGlobalPrefs::NONE_SIC))) 777 ||((mCurrentApp == ExternalAppHandler::SIP) && (mCurrentClient == KPimGlobalPrefs::NONE_SIC)))
765 { 778 {
766 enabled = false; 779 enabled = false;
767 } 780 }
768 else 781 else
769 { 782 {
770 enabled = true; 783 enabled = true;
771 } 784 }
772 785
773 786
774 mChannel->setReadOnly(readonly); 787 mChannel->setReadOnly(readonly);
775 mMessage->setReadOnly(readonly); 788 mMessage->setReadOnly(readonly);
776 mParameters->setReadOnly(readonly); 789 mParameters->setReadOnly(readonly);
790 if ( mMessage2 )
777 mMessage2->setReadOnly(readonly); 791 mMessage2->setReadOnly(readonly);
792 if ( mParameters2 )
778 mParameters2->setReadOnly(readonly); 793 mParameters2->setReadOnly(readonly);
779 794
780 mChannel->setEnabled(enabled); 795 mChannel->setEnabled(enabled);
781 mMessage->setEnabled(enabled); 796 mMessage->setEnabled(enabled);
782 mParameters->setEnabled(enabled); 797 mParameters->setEnabled(enabled);
798 if ( mMessage2 )
783 mMessage2->setEnabled(enabled); 799 mMessage2->setEnabled(enabled);
800 if ( mParameters2 )
784 mParameters2->setEnabled(enabled); 801 mParameters2->setEnabled(enabled);
785 802
786 803
787 804
788 mClient->setCurrentItem(mCurrentClient); 805 mClient->setCurrentItem(mCurrentClient);
789 806
790 807
791 // enable/disable the extra message/parameter field 808 // enable/disable the extra message/parameter field
792 if (mCurrentApp == ExternalAppHandler::EMAIL) 809 if (mCurrentApp == ExternalAppHandler::EMAIL)
793 { 810 {
794 } 811 }
795 else 812 else
796 { 813 {
814 if ( mMessage2 )
797 mMessage2->setText( "" ); 815 mMessage2->setText( "" );
816 if ( mParameters2 )
798 mParameters2->setText( "" ); 817 mParameters2->setText( "" );
799 } 818 }
800 819
801 if (enabled == true) { 820 if (enabled == true) {
821 if ( mMessage2 )
802 mMessage2->setEnabled(mCurrentApp == ExternalAppHandler::EMAIL); 822 mMessage2->setEnabled(mCurrentApp == ExternalAppHandler::EMAIL);
823 if ( mParameters2 )
803 mParameters2->setEnabled(mCurrentApp == ExternalAppHandler::EMAIL); 824 mParameters2->setEnabled(mCurrentApp == ExternalAppHandler::EMAIL);
804 } 825 }
805 826
806 827
807 blockSignals( blocked ); 828 blockSignals( blocked );
808 829
809} 830}
810 831
811void KDEPIMConfigWidget::usrReadConfig() 832void KDEPIMConfigWidget::usrReadConfig()
812{ 833{
813 KPimGlobalPrefs* prefs = KPimGlobalPrefs::instance(); 834 KPimGlobalPrefs* prefs = KPimGlobalPrefs::instance();
814 835
815 bool blocked = signalsBlocked(); 836 bool blocked = signalsBlocked();
816 blockSignals( true ); 837 blockSignals( true );
817 838
818 if (KPimGlobalPrefs::instance()->mBackupUseDefaultDir ) 839 if (KPimGlobalPrefs::instance()->mBackupUseDefaultDir )
819 mBackupUrl->setURL( KGlobalSettings::backupDataDir() ); 840 mBackupUrl->setURL( KGlobalSettings::backupDataDir() );
820 else 841 else
821 mBackupUrl->setURL(prefs->mBackupDatadir); 842 mBackupUrl->setURL(prefs->mBackupDatadir);
822 mBackupNumbersSpin->setValue( prefs->mBackupNumbers ); 843 mBackupNumbersSpin->setValue( prefs->mBackupNumbers );
823 mBackupDayCountSpin->setValue( prefs->mBackupDayCount); 844 mBackupDayCountSpin->setValue( prefs->mBackupDayCount);
824 845
825 QString dummy = prefs->mUserDateFormatLong; 846 QString dummy = prefs->mUserDateFormatLong;
826 mUserDateFormatLong->setText(dummy.replace( QRegExp("K"), QString(",") )); 847 mUserDateFormatLong->setText(dummy.replace( QRegExp("K"), QString(",") ));
827 dummy = prefs->mUserDateFormatShort; 848 dummy = prefs->mUserDateFormatShort;
828 mUserDateFormatShort->setText(dummy.replace( QRegExp("K"), QString(",") )); 849 mUserDateFormatShort->setText(dummy.replace( QRegExp("K"), QString(",") ));
829 850
830 QDate current ( 2001, 1,1); 851 QDate current ( 2001, 1,1);
831 mStartDateSavingEdit->setDate(current.addDays(prefs->mDaylightsavingStart-1)); 852 mStartDateSavingEdit->setDate(current.addDays(prefs->mDaylightsavingStart-1));
832 mEndDateSavingEdit->setDate(current.addDays(prefs->mDaylightsavingEnd-1)); 853 mEndDateSavingEdit->setDate(current.addDays(prefs->mDaylightsavingEnd-1));
833 setCombo(mTimeZoneCombo,i18n(prefs->mTimeZoneId)); 854 setCombo(mTimeZoneCombo,i18n(prefs->mTimeZoneId));
834 855