1 /***************************************************************************
2 * Copyright (C) 2003 by Hideki Ikemoto *
3 * ikemo@users.sourceforge.jp *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
9 ***************************************************************************/
11 #include "writeprefpage.h"
13 #include "libkita/writeconfig.h"
17 WritePrefPage::WritePrefPage(QWidget* parent) : AbstractPrefPage(parent)
21 connect(kcfg_DefaultName, SIGNAL(textChanged(const QString &)),
23 connect(kcfg_DefaultMail, SIGNAL(textChanged(const QString &)),
25 connect(kcfg_DefaultNameUseAlways, SIGNAL(toggled(bool)),
27 connect(kcfg_DefaultSage, SIGNAL(toggled(bool)), SIGNAL(changed()));
28 connect(kcfg_DefaultSage, SIGNAL(toggled(bool)), SLOT(slotToggled(bool)));
31 void WritePrefPage::apply()
33 WriteConfig::setDefaultName(kcfg_DefaultName->text());
34 WriteConfig::setDefaultNameUseAlways(
35 kcfg_DefaultNameUseAlways->isChecked());
36 WriteConfig::setDefaultMail(kcfg_DefaultMail->text());
37 WriteConfig::setDefaultSage(kcfg_DefaultSage->isChecked());
40 void WritePrefPage::load()
42 kcfg_DefaultName->setText(WriteConfig::defaultName());
43 kcfg_DefaultNameUseAlways->setChecked(WriteConfig::defaultNameUseAlways());
44 kcfg_DefaultMail->setText(WriteConfig::defaultMail());
45 bool isSage = WriteConfig::defaultSage();
46 kcfg_DefaultMail->setReadOnly(isSage);
47 kcfg_DefaultSage->setChecked(isSage);
50 void WritePrefPage::reset()
52 WriteConfig::self()->useDefaults(true);
54 WriteConfig::self()->useDefaults(false);
57 void WritePrefPage::slotToggled(bool on)
59 kcfg_DefaultMail->setReadOnly(on);