-rw-r--r-- | libkdepim/kprefsdialog.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libkdepim/kprefsdialog.cpp b/libkdepim/kprefsdialog.cpp index dd9a602..b6ae775 100644 --- a/libkdepim/kprefsdialog.cpp +++ b/libkdepim/kprefsdialog.cpp @@ -155,256 +155,256 @@ QLabel *KPrefsDialogWidFont::label() QLabel *KPrefsDialogWidFont::preview() { return mPreview; } QPushButton *KPrefsDialogWidFont::button() { return mButton; } void KPrefsDialogWidFont::selectFont() { QFont myFont(mPreview->font()); bool ok; myFont = KFontDialog::getFont(myFont, ok); if ( ok ) { mPreview->setFont(myFont); } } KPrefsDialogWidTime::KPrefsDialogWidTime(const QString &text,int *reference, QWidget *parent) { mReference = reference; mLabel = new QLabel(text,parent); mSpin = new QSpinBox(0,23,1,parent); mSpin->setSuffix(":00"); } void KPrefsDialogWidTime::readConfig() { mSpin->setValue(*mReference); } void KPrefsDialogWidTime::writeConfig() { *mReference = mSpin->value(); } QLabel *KPrefsDialogWidTime::label() { return mLabel; } QSpinBox *KPrefsDialogWidTime::spinBox() { return mSpin; } KPrefsDialogWidRadios::KPrefsDialogWidRadios(const QString &text,int *reference, QWidget *parent) { mReference = reference; mBox = new QButtonGroup(1,Qt::Horizontal,text,parent); } KPrefsDialogWidRadios::~KPrefsDialogWidRadios() { } void KPrefsDialogWidRadios::addRadio(const QString &text) { new QRadioButton(text,mBox); } QButtonGroup *KPrefsDialogWidRadios::groupBox() { return mBox; } void KPrefsDialogWidRadios::readConfig() { mBox->setButton(*mReference); } void KPrefsDialogWidRadios::writeConfig() { *mReference = mBox->id(mBox->selected()); } KPrefsDialogWidString::KPrefsDialogWidString(const QString &text,QString *reference, QWidget *parent, QLineEdit::EchoMode echomode) { mReference = reference; mLabel = new QLabel(text,parent); mEdit = new QLineEdit(parent); mEdit->setEchoMode( echomode ); } KPrefsDialogWidString::~KPrefsDialogWidString() { } void KPrefsDialogWidString::readConfig() { mEdit->setText(*mReference); } void KPrefsDialogWidString::writeConfig() { *mReference = mEdit->text(); } QLabel *KPrefsDialogWidString::label() { return mLabel; } QLineEdit *KPrefsDialogWidString::lineEdit() { return mEdit; } KPrefsDialog::KPrefsDialog(KPrefs *prefs,QWidget *parent,char *name,bool modal) : KDialogBase(IconList,i18n("Preferences"),Ok|Cancel|Default,Ok,parent, name,modal,true) { mPrefs = prefs; // This seems to cause a crash on exit. Investigate later. -// mPrefsWids.setAutoDelete(true); + mPrefsWids.setAutoDelete(true); connect(this,SIGNAL(defaultClicked()),SLOT(slotDefault())); //connect(this,SIGNAL(cancelClicked()),SLOT(slotDefault())); //connect(this,SIGNAL(cancelClicked()),SLOT(reject())); } KPrefsDialog::~KPrefsDialog() { } void KPrefsDialog::addWid(KPrefsDialogWid *wid) { mPrefsWids.append(wid); } KPrefsDialogWidBool *KPrefsDialog::addWidBool(const QString &text,bool *reference,QWidget *parent) { KPrefsDialogWidBool *w = new KPrefsDialogWidBool(text,reference,parent); addWid(w); return w; } KPrefsDialogWidTime *KPrefsDialog::addWidTime(const QString &text,int *reference,QWidget *parent) { KPrefsDialogWidTime *w = new KPrefsDialogWidTime(text,reference,parent); addWid(w); return w; } KPrefsDialogWidColor *KPrefsDialog::addWidColor(const QString &text,QColor *reference,QWidget *parent) { KPrefsDialogWidColor *w = new KPrefsDialogWidColor(text,reference,parent); addWid(w); return w; } KPrefsDialogWidRadios *KPrefsDialog::addWidRadios(const QString &text,int *reference,QWidget *parent) { KPrefsDialogWidRadios *w = new KPrefsDialogWidRadios(text,reference,parent); addWid(w); return w; } KPrefsDialogWidString *KPrefsDialog::addWidString(const QString &text,QString *reference,QWidget *parent) { KPrefsDialogWidString *w = new KPrefsDialogWidString(text,reference,parent); addWid(w); return w; } KPrefsDialogWidString *KPrefsDialog::addWidPassword(const QString &text,QString *reference,QWidget *parent) { KPrefsDialogWidString *w = new KPrefsDialogWidString(text,reference,parent,QLineEdit::Password); addWid(w); return w; } KPrefsDialogWidFont *KPrefsDialog::addWidFont(const QString &sampleText,const QString &buttonText, QFont *reference,QWidget *parent) { KPrefsDialogWidFont *w = new KPrefsDialogWidFont(sampleText,buttonText,reference,parent); addWid(w); return w; } void KPrefsDialog::setDefaults() { mPrefs->setDefaults(); readConfig(); } void KPrefsDialog::readConfig() { // kdDebug(5300) << "KPrefsDialog::readConfig()" << endl; KPrefsDialogWid *wid; for(wid = mPrefsWids.first();wid;wid=mPrefsWids.next()) { wid->readConfig(); } usrReadConfig(); } void KPrefsDialog::writeConfig() { // kdDebug(5300) << "KPrefsDialog::writeConfig()" << endl; KPrefsDialogWid *wid; for(wid = mPrefsWids.first();wid;wid=mPrefsWids.next()) { wid->writeConfig(); } usrWriteConfig(); // kdDebug(5300) << "KPrefsDialog::writeConfig() now writing..." << endl; mPrefs->writeConfig(); // kdDebug(5300) << "KPrefsDialog::writeConfig() done" << endl; } void KPrefsDialog::slotApply() { writeConfig(); emit configChanged(); } void KPrefsDialog::slotOk() { slotApply(); QDialog::accept(); } void KPrefsDialog::accept() { slotOk(); } void KPrefsDialog::slotDefault() { if (KMessageBox::warningContinueCancel(this, i18n("You are about to set all\npreferences to default values.\nAll " "custom modifications will be lost."),i18n("Setting Default Preferences"), i18n("Continue")) == KMessageBox::Continue) setDefaults(); } |