1 /***************************************************************************
2 * Copyright (C) 2003 by Hideki Ikemoto *
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 "aboneprefpage.h"
13 #include "libkita/abone.h"
17 AbonePrefPage::AbonePrefPage(QWidget *parent)
18 : AbstractPrefPage(parent)
22 connect(idAboneText, SIGNAL(textChanged()), SIGNAL(changed()));
23 connect(nameAboneText, SIGNAL(textChanged()), SIGNAL(changed()));
24 connect(wordAboneText, SIGNAL(textChanged()), SIGNAL(changed()));
27 void AbonePrefPage::apply()
29 QString idText = idAboneText->toPlainText();
30 QStringList idList = idText.split('\n', QString::SkipEmptyParts);
31 AboneConfig::setAboneIDList(idList);
33 QString nameText = nameAboneText->toPlainText();
34 QStringList nameList = nameText.split('\n', QString::SkipEmptyParts);
35 AboneConfig::setAboneNameList(nameList);
37 QString wordText = wordAboneText->toPlainText();
38 QStringList wordList = wordText.split('\n', QString::SkipEmptyParts);
39 AboneConfig::setAboneWordList(wordList);
42 void AbonePrefPage::load()
44 idAboneText->setText(AboneConfig::aboneIDList().join("\n"));
45 nameAboneText->setText(AboneConfig::aboneNameList().join("\n"));
46 wordAboneText->setText(AboneConfig::aboneWordList().join("\n"));
49 void AbonePrefPage::reset()
51 AboneConfig::self()->useDefaults(true);
53 AboneConfig::self()->useDefaults(false);