Changeset View
Changeset View
Standalone View
Standalone View
libkdepim/prefs/kprefsdialog.cpp
Show First 20 Lines • Show All 115 Lines • ▼ Show 20 Lines | KPrefsWidBool::KPrefsWidBool( KConfigSkeleton::ItemBool *item, QWidget *parent ) | ||||
if ( !whatsThis.isEmpty() ) { | if ( !whatsThis.isEmpty() ) { | ||||
mCheck->setWhatsThis( whatsThis ); | mCheck->setWhatsThis( whatsThis ); | ||||
} | } | ||||
} | } | ||||
void KPrefsWidBool::readConfig() | void KPrefsWidBool::readConfig() | ||||
{ | { | ||||
mCheck->setChecked( mItem->value() ); | mCheck->setChecked( mItem->value() ); | ||||
mCheck->setEnabled(!mItem->isImmutable()); | |||||
} | } | ||||
void KPrefsWidBool::writeConfig() | void KPrefsWidBool::writeConfig() | ||||
{ | { | ||||
mItem->setValue( mCheck->isChecked() ); | mItem->setValue( mCheck->isChecked() ); | ||||
} | } | ||||
QCheckBox *KPrefsWidBool::checkBox() | QCheckBox *KPrefsWidBool::checkBox() | ||||
Show All 31 Lines | if ( !whatsThis.isEmpty() ) { | ||||
mLabel->setWhatsThis( whatsThis ); | mLabel->setWhatsThis( whatsThis ); | ||||
mSpin->setWhatsThis( whatsThis ); | mSpin->setWhatsThis( whatsThis ); | ||||
} | } | ||||
} | } | ||||
void KPrefsWidInt::readConfig() | void KPrefsWidInt::readConfig() | ||||
{ | { | ||||
mSpin->setValue( mItem->value() ); | mSpin->setValue( mItem->value() ); | ||||
mSpin->setEnabled(!mItem->isImmutable()); | |||||
} | } | ||||
void KPrefsWidInt::writeConfig() | void KPrefsWidInt::writeConfig() | ||||
{ | { | ||||
mItem->setValue( mSpin->value() ); | mItem->setValue( mSpin->value() ); | ||||
} | } | ||||
QLabel *KPrefsWidInt::label() | QLabel *KPrefsWidInt::label() | ||||
Show All 33 Lines | |||||
KPrefsWidColor::~KPrefsWidColor() | KPrefsWidColor::~KPrefsWidColor() | ||||
{ | { | ||||
} | } | ||||
void KPrefsWidColor::readConfig() | void KPrefsWidColor::readConfig() | ||||
{ | { | ||||
mButton->setColor( mItem->value() ); | mButton->setColor( mItem->value() ); | ||||
mButton->setEnabled(!mItem->isImmutable()); | |||||
} | } | ||||
void KPrefsWidColor::writeConfig() | void KPrefsWidColor::writeConfig() | ||||
{ | { | ||||
mItem->setValue( mButton->color() ); | mItem->setValue( mButton->color() ); | ||||
} | } | ||||
QLabel *KPrefsWidColor::label() | QLabel *KPrefsWidColor::label() | ||||
Show All 31 Lines | |||||
KPrefsWidFont::~KPrefsWidFont() | KPrefsWidFont::~KPrefsWidFont() | ||||
{ | { | ||||
} | } | ||||
void KPrefsWidFont::readConfig() | void KPrefsWidFont::readConfig() | ||||
{ | { | ||||
mPreview->setFont( mItem->value() ); | mPreview->setFont( mItem->value() ); | ||||
mPreview->setEnabled(!mItem->isImmutable()); | |||||
} | } | ||||
void KPrefsWidFont::writeConfig() | void KPrefsWidFont::writeConfig() | ||||
{ | { | ||||
mItem->setValue( mPreview->font() ); | mItem->setValue( mPreview->font() ); | ||||
} | } | ||||
QLabel *KPrefsWidFont::label() | QLabel *KPrefsWidFont::label() | ||||
Show All 39 Lines | KPrefsWidTime::KPrefsWidTime( KConfigSkeleton::ItemDateTime *item, QWidget *parent ) | ||||
if ( !whatsThis.isEmpty() ) { | if ( !whatsThis.isEmpty() ) { | ||||
mTimeEdit->setWhatsThis( whatsThis ); | mTimeEdit->setWhatsThis( whatsThis ); | ||||
} | } | ||||
} | } | ||||
void KPrefsWidTime::readConfig() | void KPrefsWidTime::readConfig() | ||||
{ | { | ||||
mTimeEdit->setTime( mItem->value().time() ); | mTimeEdit->setTime( mItem->value().time() ); | ||||
mTimeEdit->setEnabled(!mItem->isImmutable()); | |||||
} | } | ||||
void KPrefsWidTime::writeConfig() | void KPrefsWidTime::writeConfig() | ||||
{ | { | ||||
// Don't overwrite the date value of the QDateTime, so we can use a | // Don't overwrite the date value of the QDateTime, so we can use a | ||||
// KPrefsWidTime and a KPrefsWidDate on the same config entry! | // KPrefsWidTime and a KPrefsWidDate on the same config entry! | ||||
QDateTime dt( mItem->value() ); | QDateTime dt( mItem->value() ); | ||||
dt.setTime( mTimeEdit->time() ); | dt.setTime( mTimeEdit->time() ); | ||||
Show All 33 Lines | KPrefsWidDuration::KPrefsWidDuration( KConfigSkeleton::ItemDateTime *item, | ||||
if ( !whatsThis.isEmpty() ) { | if ( !whatsThis.isEmpty() ) { | ||||
mTimeEdit->setWhatsThis( whatsThis ); | mTimeEdit->setWhatsThis( whatsThis ); | ||||
} | } | ||||
} | } | ||||
void KPrefsWidDuration::readConfig() | void KPrefsWidDuration::readConfig() | ||||
{ | { | ||||
mTimeEdit->setTime( mItem->value().time() ); | mTimeEdit->setTime( mItem->value().time() ); | ||||
mTimeEdit->setEnabled(!mItem->isImmutable()); | |||||
} | } | ||||
void KPrefsWidDuration::writeConfig() | void KPrefsWidDuration::writeConfig() | ||||
{ | { | ||||
QDateTime dt( mItem->value() ); | QDateTime dt( mItem->value() ); | ||||
dt.setTime( mTimeEdit->time() ); | dt.setTime( mTimeEdit->time() ); | ||||
mItem->setValue( dt ); | mItem->setValue( dt ); | ||||
} | } | ||||
Show All 27 Lines | |||||
void KPrefsWidDate::readConfig() | void KPrefsWidDate::readConfig() | ||||
{ | { | ||||
if ( !mItem->value().date().isValid() ) { | if ( !mItem->value().date().isValid() ) { | ||||
mItem->setValue( QDateTime::currentDateTime() ); | mItem->setValue( QDateTime::currentDateTime() ); | ||||
} | } | ||||
mDateEdit->setDate( mItem->value().date().isValid() ? | mDateEdit->setDate( mItem->value().date().isValid() ? | ||||
mItem->value().date() : QDate::currentDate() ); | mItem->value().date() : QDate::currentDate() ); | ||||
mDateEdit->setEnabled(!mItem->isImmutable()); | |||||
} | } | ||||
void KPrefsWidDate::writeConfig() | void KPrefsWidDate::writeConfig() | ||||
{ | { | ||||
QDateTime dt( mItem->value() ); | QDateTime dt( mItem->value() ); | ||||
dt.setDate( mDateEdit->date() ); | dt.setDate( mDateEdit->date() ); | ||||
mItem->setValue( dt ); | mItem->setValue( dt ); | ||||
if ( !mItem->value().date().isValid() ) { | if ( !mItem->value().date().isValid() ) { | ||||
▲ Show 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | QGroupBox *KPrefsWidRadios::groupBox() const | ||||
return mBox; | return mBox; | ||||
} | } | ||||
void KPrefsWidRadios::readConfig() | void KPrefsWidRadios::readConfig() | ||||
{ | { | ||||
if ( !mGroup->button( mItem->value() ) ) | if ( !mGroup->button( mItem->value() ) ) | ||||
return; | return; | ||||
mGroup->button( mItem->value() )->setChecked( true ); | mGroup->button( mItem->value() )->setChecked( true ); | ||||
mGroup->button(mItem->value())->setEnabled(!mItem->isImmutable()); | |||||
} | } | ||||
void KPrefsWidRadios::writeConfig() | void KPrefsWidRadios::writeConfig() | ||||
{ | { | ||||
mItem->setValue( mGroup->checkedId() ); | mItem->setValue( mGroup->checkedId() ); | ||||
} | } | ||||
QList<QWidget *> KPrefsWidRadios::widgets() const | QList<QWidget *> KPrefsWidRadios::widgets() const | ||||
Show All 14 Lines | |||||
KPrefsWidCombo::~KPrefsWidCombo() | KPrefsWidCombo::~KPrefsWidCombo() | ||||
{ | { | ||||
} | } | ||||
void KPrefsWidCombo::readConfig() | void KPrefsWidCombo::readConfig() | ||||
{ | { | ||||
mCombo->setCurrentIndex( mItem->value() ); | mCombo->setCurrentIndex( mItem->value() ); | ||||
mCombo->setEnabled(!mItem->isImmutable()); | |||||
} | } | ||||
void KPrefsWidCombo::writeConfig() | void KPrefsWidCombo::writeConfig() | ||||
{ | { | ||||
mItem->setValue( mCombo->currentIndex() ); | mItem->setValue( mCombo->currentIndex() ); | ||||
} | } | ||||
QList<QWidget *> KPrefsWidCombo::widgets() const | QList<QWidget *> KPrefsWidCombo::widgets() const | ||||
Show All 34 Lines | |||||
KPrefsWidString::~KPrefsWidString() | KPrefsWidString::~KPrefsWidString() | ||||
{ | { | ||||
} | } | ||||
void KPrefsWidString::readConfig() | void KPrefsWidString::readConfig() | ||||
{ | { | ||||
mEdit->setText( mItem->value() ); | mEdit->setText( mItem->value() ); | ||||
mEdit->setEnabled(!mItem->isImmutable()); | |||||
} | } | ||||
void KPrefsWidString::writeConfig() | void KPrefsWidString::writeConfig() | ||||
{ | { | ||||
mItem->setValue( mEdit->text() ); | mItem->setValue( mEdit->text() ); | ||||
} | } | ||||
QLabel *KPrefsWidString::label() | QLabel *KPrefsWidString::label() | ||||
Show All 36 Lines | |||||
KPrefsWidPath::~KPrefsWidPath() | KPrefsWidPath::~KPrefsWidPath() | ||||
{ | { | ||||
} | } | ||||
void KPrefsWidPath::readConfig() | void KPrefsWidPath::readConfig() | ||||
{ | { | ||||
mURLRequester->setUrl( KUrl( mItem->value() ) ); | mURLRequester->setUrl( KUrl( mItem->value() ) ); | ||||
mURLRequester->setEnabled(!mItem->isImmutable()); | |||||
} | } | ||||
void KPrefsWidPath::writeConfig() | void KPrefsWidPath::writeConfig() | ||||
{ | { | ||||
mItem->setValue( mURLRequester->url().path() ); | mItem->setValue( mURLRequester->url().path() ); | ||||
} | } | ||||
QLabel *KPrefsWidPath::label() | QLabel *KPrefsWidPath::label() | ||||
▲ Show 20 Lines • Show All 331 Lines • Show Last 20 Lines |