Diffstat (limited to 'kaddressbook/kcmconfigs/kabconfigwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kaddressbook/kcmconfigs/kabconfigwidget.cpp | 110 |
1 files changed, 8 insertions, 102 deletions
diff --git a/kaddressbook/kcmconfigs/kabconfigwidget.cpp b/kaddressbook/kcmconfigs/kabconfigwidget.cpp index 1bac26f..b5309c0 100644 --- a/kaddressbook/kcmconfigs/kabconfigwidget.cpp +++ b/kaddressbook/kcmconfigs/kabconfigwidget.cpp @@ -154,103 +154,16 @@ KABConfigWidget::KABConfigWidget( QWidget *parent, const char *name ) connect( mAddresseeWidget, SIGNAL( modified() ), SLOT( modified() ) ); - // mailclient page - QWidget *mailclientPage = new QWidget( this ); - layout = new QVBoxLayout( mailclientPage, KDialog::marginHintSmall(), - KDialog::spacingHintSmall() ); - - groupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Used Mail Client" ), mailclientPage ); - boxLayout = new QVBoxLayout( groupBox->layout() ); - boxLayout->setAlignment( Qt::AlignTop ); -// boxLayout->setMargin(KDialog::marginHintSmall() ); -// groupBox->layout()->setMargin(KDialog::marginHintSmall()) ; -// groupBox->layout()->setSpacing(KDialog::spacingHintSmall()); -// boxLayout->setSpacing( KDialog::spacingHintSmall() ); - - mEmailClient = new QComboBox( groupBox ); - mEmailClient->insertItem( i18n("OM/Pi"), KABPrefs::OMPI ); - mEmailClient->insertItem( i18n("Qtopia mail"), KABPrefs::QTOPIA ); - mEmailClient->insertItem( i18n("Opie mail"), KABPrefs::OPIE ); - mEmailClient->insertItem( i18n("Other"), KABPrefs::OTHER ); - boxLayout->addWidget( mEmailClient ); - - connect( mEmailClient, SIGNAL( activated( int ) ), - this, SLOT (emailclient_changed( int ) ) ); - - QLabel* lab = new QLabel( i18n("Channel:"), groupBox); - boxLayout->addWidget( lab ); - mEmailChannel = new QLineEdit(groupBox); - mEmailChannel->setReadOnly(true); - boxLayout->addWidget( mEmailChannel ); - - layout->addWidget( groupBox ); - tabWidget->addTab( mailclientPage, i18n( "Mail" ) ); - - - } - -void KABConfigWidget::emailclient_changed( int newClient ) +void KABConfigWidget::restoreSettings(KABPrefs* prefs) { - if (newClient == KABPrefs::OTHER) - mEmailChannel->setReadOnly(false); - else - mEmailChannel->setReadOnly(true); - - QString opiepath = QString::fromLatin1( getenv("OPIEDIR") ); - QString qtopiapath = QString::fromLatin1( getenv("QPEDIR") ); - - if (opiepath.isEmpty()) - opiepath = qtopiapath; - - QString text = mEmailChannel->text(); - - if (newClient == KABPrefs::OPIE) - { - if ( QFile::exists( opiepath + "/bin/opiemail" )) - text = "QPE/Application/opiemail"; - else - text = "FILENOTFOUND: " + opiepath + "/bin/opiemail"; - } - else if (newClient == KABPrefs::QTOPIA) - { - if ( QFile::exists( qtopiapath + "/bin/qtmail" )) - text = "QPE/Application/qtmail"; - else - text = "FILENOTFOUND: " + qtopiapath + "/bin/qtmail"; +//US prefs was KABPrefs::instance() before - } - else if (newClient == KABPrefs::OMPI) - { - if ( QFile::exists( qtopiapath + "/bin/ompi" )) - text = "QPE/Application/ompi"; - else if ( QFile::exists( opiepath + "/bin/ompi" )) - text = "QPE/Application/ompi"; - else - text = "FILENOTFOUND: " + qtopiapath + "/bin/ompi"; - - } - else - { - //do nothing if we choosed other - } - - mEmailChannel->setText( text ); - - -} - - -void KABConfigWidget::restoreSettings() -{ bool blocked = signalsBlocked(); blockSignals( true ); - mNameParsing->setChecked( KABPrefs::instance()->mAutomaticNameParsing ); - mViewsSingleClickBox->setChecked( KABPrefs::instance()->mHonorSingleClick ); - - mEmailChannel->setText( KABPrefs::instance()->mEmailChannel ); - mEmailClient->setCurrentItem(KABPrefs::instance()->mEmailClient); + mNameParsing->setChecked( prefs->mAutomaticNameParsing ); + mViewsSingleClickBox->setChecked( prefs->mHonorSingleClick ); mAddresseeWidget->restoreSettings(); @@ -263,11 +176,8 @@ void KABConfigWidget::restoreSettings() } -void KABConfigWidget::saveSettings() +void KABConfigWidget::saveSettings(KABPrefs* prefs) { - KABPrefs::instance()->mAutomaticNameParsing = mNameParsing->isChecked(); - KABPrefs::instance()->mHonorSingleClick = mViewsSingleClickBox->isChecked(); - - KABPrefs::instance()->mEmailClient = mEmailClient->currentItem(); - KABPrefs::instance()->mEmailChannel = mEmailChannel->text(); + prefs->mAutomaticNameParsing = mNameParsing->isChecked(); + prefs->mHonorSingleClick = mViewsSingleClickBox->isChecked(); mAddresseeWidget->saveSettings(); @@ -279,13 +189,9 @@ void KABConfigWidget::saveSettings() } -void KABConfigWidget::defaults() +void KABConfigWidget::defaults(KABPrefs* prefs) { mNameParsing->setChecked( true ); mViewsSingleClickBox->setChecked( false ); - mEmailClient->setCurrentItem(KABPrefs::OMPI); - emailclient_changed( KABPrefs::OMPI ); - - emit changed( true ); } |