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 "loginprefpage.h"
13 #include "libkita/accountconfig.h"
17 LoginPrefPage::LoginPrefPage(QWidget* parent) : AbstractPrefPage(parent)
21 connect(kcfg_BeMailAddress, SIGNAL(textChanged(const QString &)),
23 connect(kcfg_BeAuthCode, SIGNAL(textChanged(const QString &)),
25 connect(kcfg_UserID, SIGNAL(textChanged(const QString &)),
27 connect(kcfg_AutoLogin, SIGNAL(toggled(bool)), SIGNAL(changed()));
28 connect(kcfg_Password, SIGNAL(textChanged(const QString &)),
32 void LoginPrefPage::apply()
34 AccountConfig::setBeMailAddress(kcfg_BeMailAddress->text());
35 AccountConfig::setBeAuthCode(kcfg_BeAuthCode->text());
36 AccountConfig::setUserID(kcfg_UserID->text());
37 AccountConfig::setAutoLogin(kcfg_AutoLogin->isChecked());
38 AccountConfig::setPassword(kcfg_Password->text());
41 void LoginPrefPage::load()
43 kcfg_BeMailAddress->setText(AccountConfig::beMailAddress());
44 kcfg_BeAuthCode->setText(AccountConfig::beAuthCode());
45 kcfg_UserID->setText(AccountConfig::userID());
46 kcfg_AutoLogin->setChecked(AccountConfig::autoLogin());
47 kcfg_Password->setText(AccountConfig::password());
50 void LoginPrefPage::reset()
52 AccountConfig::self()->useDefaults(true);
54 AccountConfig::self()->useDefaults(false);