author | zautrix <zautrix> | 2005-06-10 13:54:08 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-06-10 13:54:08 (UTC) |
commit | 31fed261955dcb25d06052a8154ac4cc630b0f7d (patch) (side-by-side diff) | |
tree | ef2b4fe35255f9bf387407b6756c112a67088ad6 /libkdepim/kcmconfigs | |
parent | d2f00fc2034450bc9a3cd1d2c3510bef1758d3bc (diff) | |
download | kdepimpi-31fed261955dcb25d06052a8154ac4cc630b0f7d.zip kdepimpi-31fed261955dcb25d06052a8154ac4cc630b0f7d.tar.gz kdepimpi-31fed261955dcb25d06052a8154ac4cc630b0f7d.tar.bz2 |
fixxx
-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 @@ -115,332 +115,339 @@ KDEPIMConfigWidget::KDEPIMConfigWidget(KPimGlobalPrefs *prefs, QWidget *parent, setupBackupTab(); } void KDEPIMConfigWidget::showTimeZoneTab() { tabWidget->setCurrentPage ( 3 ) ; } void KDEPIMConfigWidget::setupBackupTab() { QVBox *colorPage = new QVBox( this ); tabWidget->addTab( colorPage, i18n( "Backup" ) ); QWidget* topFrame = new QWidget( colorPage ); QVBoxLayout *topLayout = new QVBoxLayout(topFrame); KPrefsWidBool *sb = addWidBool(i18n("Backup enabled"), &(KPimGlobalPrefs::instance()->mBackupEnabled),topFrame); topLayout->addWidget((QWidget*)sb->checkBox()); QWidget* bupFrame = new QWidget( topFrame ); topLayout->addWidget((bupFrame)); QObject::connect ( sb->checkBox(), SIGNAL (toggled ( bool ) ), bupFrame, SLOT ( setEnabled( bool ) ) ); QVBoxLayout *bupLayout = new QVBoxLayout(bupFrame); sb = addWidBool(i18n("Use standard backup dir"), &(KPimGlobalPrefs::instance()->mBackupUseDefaultDir),bupFrame); bupLayout->addWidget((QWidget*)sb->checkBox()); mBackupUrl = new KURLRequester( bupFrame ); mBackupUrl->setURL( KGlobalSettings::backupDataDir() ); QObject::connect ( sb->checkBox(), SIGNAL (toggled ( bool ) ), mBackupUrl ,SLOT ( setDisabled( bool ) ) ); bupLayout->addWidget( mBackupUrl ); mBackupUrl->setEnabled( !KPimGlobalPrefs::instance()->mBackupUseDefaultDir ); bupFrame->setEnabled( KPimGlobalPrefs::instance()->mBackupEnabled ); QHBox *dummy = new QHBox(bupFrame); new QLabel(i18n("Number of Backups:"),dummy); mBackupNumbersSpin = new QSpinBox(1,21,1,dummy); new QLabel(i18n(" "),dummy); bupLayout->addWidget( dummy ); dummy = new QHBox(bupFrame); new QLabel(i18n("Make backup every "),dummy); mBackupDayCountSpin = new QSpinBox(1,28,1,dummy); new QLabel(i18n(" days"),dummy); new QLabel(i18n(" "),dummy); bupLayout->addWidget( dummy ); QString localKdeDir; localKdeDir = readEnvPath("LOCALMICROKDEHOME"); if ( ! localKdeDir.isEmpty() ) { sb->checkBox()->setEnabled( false ); sb->checkBox()->setChecked( true ); mBackupUrl->setEnabled( false ); KPimGlobalPrefs::instance()->mBackupUseDefaultDir = true; } } void KDEPIMConfigWidget::setupStoreTab() { QVBox *colorPage = new QVBox( this ); tabWidget->addTab( colorPage, i18n( "Colors" ) ); QWidget* cw = new QWidget( colorPage ); KPrefsWidColor *holidayColor = addWidColor(i18n("Alternating background of list views"), &(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" ; QFileInfo fi ( confFile ); if ( fi.exists() ) { KConfig cfg ( confFile ); cfg.setGroup("Global"); QString localKdeDir = cfg.readEntry( "MICROKDEHOME", "x_x_x" ); if ( localKdeDir != "x_x_x" ) { mStoreUrl->setURL( localKdeDir ); qDebug("Reading config from %s ", confFile.latin1()); } } #endif new QLabel( i18n("New dirs are created automatically"), storePage ); QHBox *bb = new QHBox( storePage ); QPushButton * pb; if ( QApplication::desktop()->width() < 640 ) pb = new QPushButton ( i18n("Save"), bb ); else pb = new QPushButton ( i18n("Save settings"), bb ); connect(pb, SIGNAL( clicked() ), this, SLOT ( saveStoreSettings() ) ); pb = new QPushButton ( i18n("Save standard"), bb ); connect(pb, SIGNAL( clicked() ), this, SLOT ( setStandardStore() ) ); #ifdef DESKTOP_VERSION pb = new QPushButton ( i18n("Save using LOCAL storage"), bb ); connect(pb, SIGNAL( clicked() ), this, SLOT ( setLocalStore() ) ); #endif new QLabel( i18n("<b>New settings are used\nafter a restart</b>"), storePage ); new QLabel( i18n("Settings are stored in\n%1").arg(QDir::homeDirPath() + "/.microkdehome" ), storePage ); tabWidget->addTab( storePage, i18n( "Data storage path" ) ); } void KDEPIMConfigWidget::setLocalStore() { mStoreUrl->setURL( "LOCAL:kdepimpi" ); saveStoreSettings(); QString message = i18n("'LOCAL' mode makes is possible to run\nKA/Pi and KO/Pi from a USB memory stick.\nIn LOCAL mode the data is stored\nin a path relative to the executable.\nNote, that in LOCAL mode only addressbook\nresource files in\n <path of the executable>/<dirname after LOCAL:>/apps/kabc/*.vcf\n are supported.\nIf you use the standard addressbook settings\nyou do not have to reconfigure any path,\njust restart the application and import\nyour addressbook and calendar data."); KMessageBox::information( this, message); } void KDEPIMConfigWidget::setStandardStore() { mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" ); saveStoreSettings(); } void KDEPIMConfigWidget::saveStoreSettings() { if ( !mStoreUrl->url().isEmpty() ) { QString path = QDir::homeDirPath(); QString url = mStoreUrl->url(); #ifdef DESKTOP_VERSION if ( url.startsWith( "LOCAL:" ) ) { path = qApp->applicationDirPath () ; } #endif KConfig cfg ( path + "/.microkdehome" ); cfg.setGroup("Global"); cfg.writeEntry( "MICROKDEHOME", url ); qDebug("cfg.writeEntry( MICROKDEHOME, %s ", url.latin1()); cfg.sync(); } else { mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" ); saveStoreSettings(); } } void KDEPIMConfigWidget::setupExternalAppTab() { QWidget *externalAppsPage = new QWidget( this ); QVBoxLayout* layout = new QVBoxLayout( externalAppsPage, KDialog::marginHintSmall(), KDialog::spacingHintSmall() ); mExternalApps = new QComboBox( externalAppsPage ); QMap<ExternalAppHandler::Types, QString>::Iterator it; for( it = mExternalAppsMap.begin(); it != mExternalAppsMap.end(); ++it ) mExternalApps->insertItem( it.data(), it.key() ); layout->addWidget( mExternalApps ); connect( mExternalApps, SIGNAL( activated( int ) ), this, SLOT (externalapp_changed( int ) ) ); mExternalAppGroupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Used Mail Client" ), externalAppsPage ); QGridLayout *boxLayout = new QGridLayout( mExternalAppGroupBox->layout(), 4, 2, -1, "gridlayout" ); mExternalAppGroupBox->layout()->setMargin(4); mClient = new QComboBox( mExternalAppGroupBox ); boxLayout->addMultiCellWidget( mClient, 0, 0, 0, 1 ); connect( mClient, SIGNAL( activated( int ) ), this, SLOT (client_changed( int ) ) ); QLabel* lab = new QLabel( i18n("Channel:"), mExternalAppGroupBox); boxLayout->addWidget( lab, 1, 0 ); mChannel = new QLineEdit(mExternalAppGroupBox); mChannel->setReadOnly(true); boxLayout->addMultiCellWidget( mChannel, 2 , 2, 0, 1 ); lab = new QLabel( i18n("Message:"), mExternalAppGroupBox); boxLayout->addWidget( lab, 3, 0 ); mMessage = new QLineEdit(mExternalAppGroupBox); mMessage->setReadOnly(true); boxLayout->addWidget( mMessage , 4, 0); 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." ) ); } void KDEPIMConfigWidget::setupLocaleDateTab() { QWidget *topFrame = new QWidget( this ); QGridLayout *topLayout = new QGridLayout( topFrame, 3, 2); topLayout->setSpacing(KDialog::spacingHintSmall()); topLayout->setMargin(KDialog::marginHintSmall()); int iii = 0; KPrefsWidRadios *syncPrefsGroup = addWidRadios(i18n("Date Format:"),&(KPimGlobalPrefs::instance()->mPreferredDate),topFrame); QString format; if ( QApplication::desktop()->width() < 480 ) format = "(%d.%m.%Y)"; else format = "(%d.%m.%Y|%A %d %B %Y)"; syncPrefsGroup->addRadio(i18n("24.03.2004 "+format)); if ( QApplication::desktop()->width() < 480 ) format = "(%m.%d.%Y)"; else format = "(%m.%d.%Y|%A %B %d %Y)"; syncPrefsGroup->addRadio(i18n("03.24.2004 "+format)); if ( QApplication::desktop()->width() < 480 ) format = "(%Y-%m-%d)"; else format = "(%Y-%m-%d|%A %Y %B %d)"; syncPrefsGroup->addRadio(i18n("2004-03-24 "+format)); syncPrefsGroup->addRadio(i18n("User defined")); if ( QApplication::desktop()->width() < 480 ) { syncPrefsGroup->groupBox()->layout()->setMargin( 5 ); syncPrefsGroup->groupBox()->layout()->setSpacing( 0 ); } topLayout->addMultiCellWidget( (QWidget*)syncPrefsGroup->groupBox(),iii,iii,0,1); ++iii; ++iii; QLabel * lab; mUserDateFormatLong = new QLineEdit(topFrame); lab = new QLabel(mUserDateFormatLong, i18n("User long date:"), topFrame); topLayout->addWidget(lab ,iii,0); topLayout->addWidget(mUserDateFormatLong,iii,1); ++iii; mUserDateFormatShort = new QLineEdit(topFrame); lab = new QLabel(mUserDateFormatShort, i18n("User short date:"), topFrame); 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" ) ); } void KDEPIMConfigWidget::setupLocaleTab() { QWidget *topFrame = new QWidget( this ); QGridLayout *topLayout = new QGridLayout(topFrame,4,2); topLayout->setSpacing(KDialog::spacingHint()); topLayout->setMargin(KDialog::marginHint()); int iii = 0; KPrefsWidRadios *syncPrefsGroup = addWidRadios(i18n("Language:(needs restart)"),&(KPimGlobalPrefs::instance()->mPreferredLanguage),topFrame); syncPrefsGroup->addRadio(i18n("English")); syncPrefsGroup->addRadio(i18n("German")); syncPrefsGroup->addRadio(i18n("French")); syncPrefsGroup->addRadio(i18n("Italian")); syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)")); if ( QApplication::desktop()->width() < 300 ) { syncPrefsGroup->groupBox()->layout()->setMargin( 5 ); syncPrefsGroup->groupBox()->layout()->setSpacing( 0 ); } topLayout->addMultiCellWidget( (QWidget*)syncPrefsGroup->groupBox(),iii,iii,0,1); ++iii; tabWidget->addTab( topFrame, i18n( "Language" ) ); topFrame = new QWidget( this ); topLayout = new QGridLayout(topFrame,4,2); topLayout->setSpacing(KDialog::spacingHint()); topLayout->setMargin(KDialog::marginHint()); iii = 0; syncPrefsGroup = addWidRadios(i18n("Time Format(nr):"),&(KPimGlobalPrefs::instance()->mPreferredTime),topFrame); if ( QApplication::desktop()->width() > 300 ) syncPrefsGroup->groupBox()->setOrientation (Qt::Vertical); syncPrefsGroup->addRadio(i18n("24:00")); syncPrefsGroup->addRadio(i18n("12:00am")); syncPrefsGroup->groupBox()->setOrientation (Qt::Vertical); topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); ++iii; KPrefsWidBool *sb = addWidBool(i18n("Week starts on Sunday"), &(KPimGlobalPrefs::instance()->mWeekStartsOnSunday),topFrame); topLayout->addMultiCellWidget((QWidget*)sb->checkBox(), iii,iii,0,1); ++iii; tabWidget->addTab( topFrame, i18n( "Time Format" ) ); } void KDEPIMConfigWidget::setupTimeZoneTab() { QWidget *topFrame; QGridLayout *topLayout ; @@ -567,300 +574,314 @@ void KDEPIMConfigWidget::externalapp_changed( int newApp ) case(ExternalAppHandler::SIP): mCurrentClient = mSipClient; break; default: return; } // and at last update the widgets updateClientWidgets(); } void KDEPIMConfigWidget::client_changed( int newClient ) { if (newClient == mCurrentClient) return; // first store the current data saveEditFieldSettings(); //then reset the clientvariable mCurrentClient = newClient; // and at last update the widgets updateClientWidgets(); KPrefsWidget::modified(); } void KDEPIMConfigWidget::saveEditFieldSettings() { switch(mCurrentApp) { case(ExternalAppHandler::EMAIL): mEmailClient = mClient->currentItem(); break; case(ExternalAppHandler::PHONE): mPhoneClient= mClient->currentItem(); break; case(ExternalAppHandler::SMS): mSMSClient = mClient->currentItem(); break; case(ExternalAppHandler::FAX): mFaxClient = mClient->currentItem(); break; case(ExternalAppHandler::PAGER): mPagerClient = mClient->currentItem(); break; case(ExternalAppHandler::SIP): mSipClient = mClient->currentItem(); break; default: return; } //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(); } else if ((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::OTHER_SMC)) { mSMSOtherChannel = mChannel->text(); mSMSOtherMessage = mMessage->text(); mSMSOtherMessageParameters = mParameters->text(); } else if ((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::OTHER_FAC)) { mFaxOtherChannel = mChannel->text(); mFaxOtherMessage = mMessage->text(); mFaxOtherMessageParameters = mParameters->text(); } else if ((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::OTHER_PAC)) { mPagerOtherChannel = mChannel->text(); mPagerOtherMessage = mMessage->text(); mPagerOtherMessageParameters = mParameters->text(); } else if ((mCurrentApp == ExternalAppHandler::SIP) && (mCurrentClient == KPimGlobalPrefs::OTHER_SIC)) { mSipOtherChannel = mChannel->text(); mSipOtherMessage = mMessage->text(); mSipOtherMessageParameters = mParameters->text(); } } void KDEPIMConfigWidget::updateClientWidgets() { bool blocked = signalsBlocked(); blockSignals( true ); // at this point we assume, that mCurrentApp and mCurrentClient are set to the values that we want to display QMap<ExternalAppHandler::Types, QString>::Iterator it = mExternalAppsMap.find ( mCurrentApp ); if (it == mExternalAppsMap.end()) return; // update group box mExternalAppGroupBox->setTitle(i18n( "Used %1 Client" ).arg(it.data())); //update the entries in the client combobox mClient->clear(); QList<DefaultAppItem> items = ExternalAppHandler::instance()->getAvailableDefaultItems(mCurrentApp); DefaultAppItem* dai; for ( dai=items.first(); dai != 0; dai=items.next() ) { mClient->insertItem( i18n(dai->_label), dai->_id ); 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); mParameters->setText(mPhoneOtherMessageParameters); } else if ((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::OTHER_SMC)) { mChannel->setText(mSMSOtherChannel); mMessage->setText(mSMSOtherMessage); mParameters->setText(mSMSOtherMessageParameters); } else if ((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::OTHER_FAC)) { mChannel->setText(mFaxOtherChannel); mMessage->setText(mFaxOtherMessage); mParameters->setText(mFaxOtherMessageParameters); } else if ((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::OTHER_PAC)) { mChannel->setText(mPagerOtherChannel); mMessage->setText(mPagerOtherMessage); mParameters->setText(mPagerOtherMessageParameters); } else if ((mCurrentApp == ExternalAppHandler::SIP) && (mCurrentClient == KPimGlobalPrefs::OTHER_SIC)) { mChannel->setText(mSipOtherChannel); mMessage->setText(mSipOtherMessage); mParameters->setText(mSipOtherMessageParameters); } } } bool readonly; bool enabled; if ( ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::OTHER_EMC)) ||((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::OTHER_PHC)) ||((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::OTHER_SMC)) ||((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::OTHER_FAC)) ||((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::OTHER_PAC)) ||((mCurrentApp == ExternalAppHandler::SIP) && (mCurrentClient == KPimGlobalPrefs::OTHER_SIC))) { readonly = false; } else { readonly = true; } if ( ((mCurrentApp == ExternalAppHandler::EMAIL) && (mCurrentClient == KPimGlobalPrefs::NONE_EMC)) ||((mCurrentApp == ExternalAppHandler::PHONE) && (mCurrentClient == KPimGlobalPrefs::NONE_PHC)) ||((mCurrentApp == ExternalAppHandler::SMS) && (mCurrentClient == KPimGlobalPrefs::NONE_SMC)) ||((mCurrentApp == ExternalAppHandler::FAX) && (mCurrentClient == KPimGlobalPrefs::NONE_FAC)) ||((mCurrentApp == ExternalAppHandler::PAGER) && (mCurrentClient == KPimGlobalPrefs::NONE_PAC)) ||((mCurrentApp == ExternalAppHandler::SIP) && (mCurrentClient == KPimGlobalPrefs::NONE_SIC))) { enabled = false; } else { 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); // 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 ); } void KDEPIMConfigWidget::usrReadConfig() { KPimGlobalPrefs* prefs = KPimGlobalPrefs::instance(); bool blocked = signalsBlocked(); blockSignals( true ); if (KPimGlobalPrefs::instance()->mBackupUseDefaultDir ) mBackupUrl->setURL( KGlobalSettings::backupDataDir() ); else mBackupUrl->setURL(prefs->mBackupDatadir); mBackupNumbersSpin->setValue( prefs->mBackupNumbers ); mBackupDayCountSpin->setValue( prefs->mBackupDayCount); QString dummy = prefs->mUserDateFormatLong; mUserDateFormatLong->setText(dummy.replace( QRegExp("K"), QString(",") )); dummy = prefs->mUserDateFormatShort; mUserDateFormatShort->setText(dummy.replace( QRegExp("K"), QString(",") )); QDate current ( 2001, 1,1); mStartDateSavingEdit->setDate(current.addDays(prefs->mDaylightsavingStart-1)); mEndDateSavingEdit->setDate(current.addDays(prefs->mDaylightsavingEnd-1)); setCombo(mTimeZoneCombo,i18n(prefs->mTimeZoneId)); mEmailClient = prefs->mEmailClient; mEmailOtherChannel = prefs->mEmailOtherChannel; mEmailOtherMessage = prefs->mEmailOtherMessage; mEmailOtherMessageParameters = prefs->mEmailOtherMessageParameters; mEmailOtherMessage2 = prefs->mEmailOtherMessage2; mEmailOtherMessageParameters2 = prefs->mEmailOtherMessageParameters2; mPhoneClient = prefs->mPhoneClient; mPhoneOtherChannel = prefs->mPhoneOtherChannel; mPhoneOtherMessage = prefs->mPhoneOtherMessage; mPhoneOtherMessageParameters = prefs->mPhoneOtherMessageParameters; mFaxClient = prefs->mFaxClient; mFaxOtherChannel = prefs->mFaxOtherChannel; mFaxOtherMessage = prefs->mFaxOtherMessage; mFaxOtherMessageParameters = prefs->mFaxOtherMessageParameters; mSMSClient = prefs->mSMSClient; mSMSOtherChannel = prefs->mSMSOtherChannel; mSMSOtherMessage = prefs->mSMSOtherMessage; mSMSOtherMessageParameters = prefs->mSMSOtherMessageParameters; mPagerClient = prefs->mPagerClient; mPagerOtherChannel = prefs->mPagerOtherChannel; mPagerOtherMessage = prefs->mPagerOtherMessage; mPagerOtherMessageParameters = prefs->mPagerOtherMessageParameters; mSipClient = prefs->mSipClient; mSipOtherChannel = prefs->mSipOtherChannel; mSipOtherMessage = prefs->mSipOtherMessage; mSipOtherMessageParameters = prefs->mSipOtherMessageParameters; |