Diffstat (limited to 'libkdepim/kcmconfigs/kdepimconfigwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libkdepim/kcmconfigs/kdepimconfigwidget.cpp | 91 |
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 @@ -173,13 +173,14 @@ void KDEPIMConfigWidget::setupStoreTab() &(KPimGlobalPrefs::instance()->mAlternateColor),cw); QHBoxLayout *topLayout = new QHBoxLayout(cw); topLayout->addWidget(holidayColor->label()); topLayout->addWidget( (QWidget* )holidayColor->button()); - QVBox *storePage = new QVBox( this ); + QVBox *storePage = new QVBox( this ); + if ( QApplication::desktop()->height() > 240 ) 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 ); new QLabel( i18n("<b>New data storage dir:</b>"), storePage ); mStoreUrl = new KURLRequester( storePage ); mStoreUrl->setURL( KGlobal::dirs()->localkdedir() ); #ifdef DESKTOP_VERSION QString confFile = qApp->applicationDirPath ()+ "/.microkdehome" ; @@ -287,38 +288,41 @@ void KDEPIMConfigWidget::setupExternalAppTab() lab = new QLabel( i18n("Parameters:"), mExternalAppGroupBox); boxLayout->addWidget( lab, 3, 1 ); mParameters = new QLineEdit(mExternalAppGroupBox); mParameters->setReadOnly(true); boxLayout->addWidget( mParameters, 4, 1 ); - - lab = new QLabel( i18n("HINT: Delimiter=; Name=%1,Email=%2"), mExternalAppGroupBox); - boxLayout->addMultiCellWidget( lab, 5, 5, 0, 1 ); - - - lab = new QLabel( i18n("extra Message:"), mExternalAppGroupBox); - boxLayout->addWidget( lab, 6, 0 ); - mMessage2 = new QLineEdit(mExternalAppGroupBox); - mMessage2->setReadOnly(true); - boxLayout->addWidget( mMessage2 , 7, 0); - - lab = new QLabel( i18n("extra Parameters:"), mExternalAppGroupBox); - boxLayout->addWidget( lab, 6, 1 ); - mParameters2 = new QLineEdit(mExternalAppGroupBox); - mParameters2->setReadOnly(true); - boxLayout->addWidget( mParameters2, 7, 1 ); - - lab = new QLabel( i18n("HINT: Emails=%1,Attachments=%2"), mExternalAppGroupBox); - boxLayout->addMultiCellWidget( lab, 8, 8, 0, 1 ); - + lab = new QLabel( i18n("HINT: Delimiter=; Name=%1,Email=%2"), mExternalAppGroupBox); + boxLayout->addMultiCellWidget( lab, 5, 5, 0, 1 ); + + + if ( QApplication::desktop()->height() > 240 ) { + lab = new QLabel( i18n("extra Message:"), mExternalAppGroupBox); + boxLayout->addWidget( lab, 6, 0 ); + mMessage2 = new QLineEdit(mExternalAppGroupBox); + mMessage2->setReadOnly(true); + boxLayout->addWidget( mMessage2 , 7, 0); + + lab = new QLabel( i18n("extra Parameters:"), mExternalAppGroupBox); + boxLayout->addWidget( lab, 6, 1 ); + mParameters2 = new QLineEdit(mExternalAppGroupBox); + mParameters2->setReadOnly(true); + boxLayout->addWidget( mParameters2, 7, 1 ); + + lab = new QLabel( i18n("HINT: Emails=%1,Attachments=%2"), mExternalAppGroupBox); + boxLayout->addMultiCellWidget( lab, 8, 8, 0, 1 ); + connect( mMessage2, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); + connect( mParameters2, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); + } else { + mMessage2 = 0; + mParameters2 = 0; + } connect( mChannel, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); connect( mMessage, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); connect( mParameters, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); - connect( mMessage2, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); - connect( mParameters2, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); layout->addWidget( mExternalAppGroupBox ); tabWidget->addTab( externalAppsPage, i18n( "External Apps." ) ); } @@ -371,18 +375,21 @@ void KDEPIMConfigWidget::setupLocaleDateTab() topLayout->addWidget(lab ,iii,0); topLayout->addWidget(mUserDateFormatShort,iii,1); ++iii; lab = new QLabel( i18n("Monday 19 April 2004: %A %d %B %Y"), topFrame); topLayout->addMultiCellWidget(lab ,iii,iii,0,1); ++iii; - lab = new QLabel( i18n("Mon 19.04.04: %a %d.%m.%y"), topFrame); - topLayout->addMultiCellWidget(lab ,iii,iii,0,1); - ++iii; - lab = new QLabel( i18n("Mon, 19.Apr.04: %a, %d.%b.%y"), topFrame); - topLayout->addMultiCellWidget(lab ,iii,iii,0,1); - ++iii; + //qDebug(" QApplication::desktop()->height()xx %d ", QApplication::desktop()->height() ); + if ( QApplication::desktop()->height() > 240 ) { + lab = new QLabel( i18n("Mon 19.04.04: %a %d.%m.%y"), topFrame); + topLayout->addMultiCellWidget(lab ,iii,iii,0,1); + ++iii; + lab = new QLabel( i18n("Mon, 19.Apr.04: %a, %d.%b.%y"), topFrame); + topLayout->addMultiCellWidget(lab ,iii,iii,0,1); + ++iii; + } connect( mUserDateFormatLong, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); connect( mUserDateFormatShort, SIGNAL( textChanged ( const QString & )), this, SLOT( textChanged ( const QString & )) ); tabWidget->addTab( topFrame, i18n( "Date Format" ) ); @@ -625,14 +632,16 @@ void KDEPIMConfigWidget::saveEditFieldSettings() //store the current data back to the apropriate membervariables if we had set it to "other" if ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::OTHER_EMC)) { mEmailOtherChannel = mChannel->text(); mEmailOtherMessage = mMessage->text(); mEmailOtherMessageParameters = mParameters->text(); - mEmailOtherMessage2 = mMessage2->text(); - mEmailOtherMessageParameters2 = mParameters2->text(); + if ( mMessage2 ) + mEmailOtherMessage2 = mMessage2->text(); + if ( mParameters2 ) + mEmailOtherMessageParameters2 = mParameters2->text(); } else if ((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::OTHER_PHC)) { mPhoneOtherChannel = mChannel->text(); mPhoneOtherMessage = mMessage->text(); mPhoneOtherMessageParameters = mParameters->text(); @@ -690,23 +699,27 @@ void KDEPIMConfigWidget::updateClientWidgets() if (dai->_id == mCurrentClient) { //restore the edit fields with the data of the local membervariables if we had set it to "other". //Otherwise take the default data from externalapphandler. mChannel->setText(dai->_channel); mMessage->setText(dai->_message); - mParameters->setText(dai->_parameters); - mMessage2->setText(dai->_message2); + mParameters->setText(dai->_parameters); + if ( mMessage2 ) + mMessage2->setText(dai->_message2); + if ( mParameters2 ) mParameters2->setText(dai->_parameters2); if ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::OTHER_EMC)) { mChannel->setText(mEmailOtherChannel); mMessage->setText(mEmailOtherMessage); - mParameters->setText(mEmailOtherMessageParameters); + mParameters->setText(mEmailOtherMessageParameters); + if ( mMessage2 ) mMessage2->setText(mEmailOtherMessage2); + if ( mParameters2 ) mParameters2->setText(mEmailOtherMessageParameters2); } else if ((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::OTHER_PHC)) { mChannel->setText(mPhoneOtherChannel); mMessage->setText(mPhoneOtherMessage); @@ -770,20 +783,24 @@ void KDEPIMConfigWidget::updateClientWidgets() enabled = true; } mChannel->setReadOnly(readonly); mMessage->setReadOnly(readonly); - mParameters->setReadOnly(readonly); + mParameters->setReadOnly(readonly); + if ( mMessage2 ) mMessage2->setReadOnly(readonly); + if ( mParameters2 ) mParameters2->setReadOnly(readonly); mChannel->setEnabled(enabled); mMessage->setEnabled(enabled); mParameters->setEnabled(enabled); + if ( mMessage2 ) mMessage2->setEnabled(enabled); + if ( mParameters2 ) mParameters2->setEnabled(enabled); mClient->setCurrentItem(mCurrentClient); @@ -791,18 +808,22 @@ void KDEPIMConfigWidget::updateClientWidgets() // enable/disable the extra message/parameter field if (mCurrentApp == ExternalAppHandler::EMAIL) { } else { + if ( mMessage2 ) mMessage2->setText( "" ); + if ( mParameters2 ) mParameters2->setText( "" ); } if (enabled == true) { + if ( mMessage2 ) mMessage2->setEnabled(mCurrentApp == ExternalAppHandler::EMAIL); + if ( mParameters2 ) mParameters2->setEnabled(mCurrentApp == ExternalAppHandler::EMAIL); } blockSignals( blocked ); |