svnno****@sourc*****
svnno****@sourc*****
2009年 7月 20日 (月) 19:26:59 JST
Revision: 2458 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2458 Author: nogu Date: 2009-07-20 19:26:59 +0900 (Mon, 20 Jul 2009) Log Message: ----------- prefs.{cpp,h} -> preferences.{cpp,h} Modified Paths: -------------- kita/branches/KITA-KDE4/kita/src/mainwindow.cpp kita/branches/KITA-KDE4/kita/src/prefs/CMakeLists.txt Added Paths: ----------- kita/branches/KITA-KDE4/kita/src/prefs/preferences.cpp kita/branches/KITA-KDE4/kita/src/prefs/preferences.h Removed Paths: ------------- kita/branches/KITA-KDE4/kita/src/prefs/prefs.cpp kita/branches/KITA-KDE4/kita/src/prefs/prefs.h Modified: kita/branches/KITA-KDE4/kita/src/mainwindow.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/mainwindow.cpp 2009-07-20 10:24:22 UTC (rev 2457) +++ kita/branches/KITA-KDE4/kita/src/mainwindow.cpp 2009-07-20 10:26:59 UTC (rev 2458) @@ -47,7 +47,7 @@ #include "libkita/favoritethreads.h" #include "libkita/kita_misc.h" #include "libkita/threadinfo.h" -#include "prefs/prefs.h" +#include "prefs/preferences.h" using namespace Kita; Modified: kita/branches/KITA-KDE4/kita/src/prefs/CMakeLists.txt =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/CMakeLists.txt 2009-07-20 10:24:22 UTC (rev 2457) +++ kita/branches/KITA-KDE4/kita/src/prefs/CMakeLists.txt 2009-07-20 10:26:59 UTC (rev 2458) @@ -10,7 +10,7 @@ aboneprefpage.cpp loginprefpage.cpp faceprefpage.cpp - prefs.cpp + preferences.cpp uiprefpage.cpp writeprefpage.cpp) Copied: kita/branches/KITA-KDE4/kita/src/prefs/preferences.cpp (from rev 2457, kita/branches/KITA-KDE4/kita/src/prefs/prefs.cpp) =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/preferences.cpp (rev 0) +++ kita/branches/KITA-KDE4/kita/src/prefs/preferences.cpp 2009-07-20 10:26:59 UTC (rev 2458) @@ -0,0 +1,101 @@ +/*************************************************************************** +* Copyright (C) 2003 by Hideki Ikemoto * +* ikemo****@users***** * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +***************************************************************************/ + +#include "preferences.h" + +#include "aboneprefpage.h" +#include "asciiartprefpage.h" +#include "faceprefpage.h" +#include "loginprefpage.h" +#include "uiprefpage.h" +#include "writeprefpage.h" +#include "libkita/config_xt.h" + +using namespace Kita; + +Preferences::Preferences(QWidget* parent) + : KConfigDialog(parent, "Kita Preferences", Config::self()) +{ + enableButtonApply(false); + enableButton(Help, false); + + // this is the base class for your preferences dialog. it is now + // a Treelist dialog.. but there are a number of other + // possibilities (including Tab, Swallow, and just Plain) + FacePrefPage* facePage = new FacePrefPage(0); + addPage(facePage, i18n("Face"), "view-list-details"); + connect(facePage, SIGNAL(fontChanged(const QFont&)), + SIGNAL(fontChanged(const QFont&))); + connect(facePage, SIGNAL(changed()), SLOT(slotChanged())); + m_pageList.append(facePage); + + AsciiArtPrefPage* asciiArtPage = new AsciiArtPrefPage(0); + addPage(asciiArtPage, i18n("AsciiArt"), "kita"); + connect(asciiArtPage, SIGNAL(changed()), SLOT(slotChanged())); + m_pageList.append(asciiArtPage); + + UIPrefPage* uiPage = new UIPrefPage(0); + addPage(uiPage, i18n("User Interface"), "configure"); + connect(uiPage, SIGNAL(changed()), SLOT(slotChanged())); + m_pageList.append(uiPage); + + AbonePrefPage* abonePage = new AbonePrefPage(0); + addPage(abonePage, i18n("Abone"), "kita"); + connect(abonePage, SIGNAL(changed()), SLOT(slotChanged())); + m_pageList.append(abonePage); + + LoginPrefPage* loginPage = new LoginPrefPage(0); + addPage(loginPage, i18n("Login"), "network-connect"); + connect(loginPage, SIGNAL(changed()), SLOT(slotChanged())); + m_pageList.append(loginPage); + + WritePrefPage* writePage = new WritePrefPage(0); + addPage(writePage, i18n("Write"), "document-edit"); + connect(writePage, SIGNAL(changed()), SLOT(slotChanged())); + m_pageList.append(writePage); +} + +void Preferences::load() +{ + for (int i = 0, j = m_pageList.count(); i < j; i++) { + m_pageList.at(i)->load(); + } + enableButtonApply(false); +} + +void Preferences::apply() +{ + for (int i = 0, j = m_pageList.count(); i < j; i++) { + m_pageList.at(i)->apply(); + } + enableButtonApply(false); +} + +void Preferences::reset() +{ + for (int i = 0, j = m_pageList.count(); i < j; i++) { + m_pageList.at(i)->reset(); + } +} + +void Preferences::slotButtonClicked(int button) +{ + if (button == Ok || button == Apply) { + apply(); + } else if (button == Default) { + reset(); + } + KConfigDialog::slotButtonClicked(button); +} + +void Preferences::slotChanged() +{ + enableButtonApply(true); +} Property changes on: kita/branches/KITA-KDE4/kita/src/prefs/preferences.cpp ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:mergeinfo + Added: svn:eol-style + native Copied: kita/branches/KITA-KDE4/kita/src/prefs/preferences.h (from rev 2457, kita/branches/KITA-KDE4/kita/src/prefs/prefs.h) =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/preferences.h (rev 0) +++ kita/branches/KITA-KDE4/kita/src/prefs/preferences.h 2009-07-20 10:26:59 UTC (rev 2458) @@ -0,0 +1,46 @@ +/*************************************************************************** +* Copyright (C) 2003 by Hideki Ikemoto * +* ikemo****@users***** * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +***************************************************************************/ + +#ifndef KITAPREFS_H +#define KITAPREFS_H + +#include <QtCore/QList> + +#include <kconfigdialog.h> + +namespace Kita +{ + class AbstractPrefPage; + + class KDE_EXPORT Preferences : public KConfigDialog + { + Q_OBJECT + + public: + Preferences(QWidget* parent); + void load(); + + private: + QList<AbstractPrefPage*> m_pageList; + void apply(); + void reset(); + Preferences(const Preferences&); + Preferences& operator=(const Preferences&); + + private slots: + virtual void slotButtonClicked(int button); + void slotChanged(); + + signals: + void fontChanged(const QFont&); + }; +} + +#endif // KITAPREFS_H Property changes on: kita/branches/KITA-KDE4/kita/src/prefs/preferences.h ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:mergeinfo + Added: svn:eol-style + native Deleted: kita/branches/KITA-KDE4/kita/src/prefs/prefs.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/prefs.cpp 2009-07-20 10:24:22 UTC (rev 2457) +++ kita/branches/KITA-KDE4/kita/src/prefs/prefs.cpp 2009-07-20 10:26:59 UTC (rev 2458) @@ -1,101 +0,0 @@ -/*************************************************************************** -* Copyright (C) 2003 by Hideki Ikemoto * -* ikemo****@users***** * -* * -* This program is free software; you can redistribute it and/or modify * -* it under the terms of the GNU General Public License as published by * -* the Free Software Foundation; either version 2 of the License, or * -* (at your option) any later version. * -***************************************************************************/ - -#include "prefs.h" - -#include "aboneprefpage.h" -#include "asciiartprefpage.h" -#include "faceprefpage.h" -#include "loginprefpage.h" -#include "uiprefpage.h" -#include "writeprefpage.h" -#include "libkita/config_xt.h" - -using namespace Kita; - -Preferences::Preferences(QWidget* parent) - : KConfigDialog(parent, "Kita Preferences", Config::self()) -{ - enableButtonApply(false); - enableButton(Help, false); - - // this is the base class for your preferences dialog. it is now - // a Treelist dialog.. but there are a number of other - // possibilities (including Tab, Swallow, and just Plain) - FacePrefPage* facePage = new FacePrefPage(0); - addPage(facePage, i18n("Face"), "view-list-details"); - connect(facePage, SIGNAL(fontChanged(const QFont&)), - SIGNAL(fontChanged(const QFont&))); - connect(facePage, SIGNAL(changed()), SLOT(slotChanged())); - m_pageList.append(facePage); - - AsciiArtPrefPage* asciiArtPage = new AsciiArtPrefPage(0); - addPage(asciiArtPage, i18n("AsciiArt"), "kita"); - connect(asciiArtPage, SIGNAL(changed()), SLOT(slotChanged())); - m_pageList.append(asciiArtPage); - - UIPrefPage* uiPage = new UIPrefPage(0); - addPage(uiPage, i18n("User Interface"), "configure"); - connect(uiPage, SIGNAL(changed()), SLOT(slotChanged())); - m_pageList.append(uiPage); - - AbonePrefPage* abonePage = new AbonePrefPage(0); - addPage(abonePage, i18n("Abone"), "kita"); - connect(abonePage, SIGNAL(changed()), SLOT(slotChanged())); - m_pageList.append(abonePage); - - LoginPrefPage* loginPage = new LoginPrefPage(0); - addPage(loginPage, i18n("Login"), "network-connect"); - connect(loginPage, SIGNAL(changed()), SLOT(slotChanged())); - m_pageList.append(loginPage); - - WritePrefPage* writePage = new WritePrefPage(0); - addPage(writePage, i18n("Write"), "document-edit"); - connect(writePage, SIGNAL(changed()), SLOT(slotChanged())); - m_pageList.append(writePage); -} - -void Preferences::load() -{ - for (int i = 0, j = m_pageList.count(); i < j; i++) { - m_pageList.at(i)->load(); - } - enableButtonApply(false); -} - -void Preferences::apply() -{ - for (int i = 0, j = m_pageList.count(); i < j; i++) { - m_pageList.at(i)->apply(); - } - enableButtonApply(false); -} - -void Preferences::reset() -{ - for (int i = 0, j = m_pageList.count(); i < j; i++) { - m_pageList.at(i)->reset(); - } -} - -void Preferences::slotButtonClicked(int button) -{ - if (button == Ok || button == Apply) { - apply(); - } else if (button == Default) { - reset(); - } - KConfigDialog::slotButtonClicked(button); -} - -void Preferences::slotChanged() -{ - enableButtonApply(true); -} Deleted: kita/branches/KITA-KDE4/kita/src/prefs/prefs.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/prefs.h 2009-07-20 10:24:22 UTC (rev 2457) +++ kita/branches/KITA-KDE4/kita/src/prefs/prefs.h 2009-07-20 10:26:59 UTC (rev 2458) @@ -1,46 +0,0 @@ -/*************************************************************************** -* Copyright (C) 2003 by Hideki Ikemoto * -* ikemo****@users***** * -* * -* This program is free software; you can redistribute it and/or modify * -* it under the terms of the GNU General Public License as published by * -* the Free Software Foundation; either version 2 of the License, or * -* (at your option) any later version. * -***************************************************************************/ - -#ifndef KITAPREFS_H -#define KITAPREFS_H - -#include <QtCore/QList> - -#include <kconfigdialog.h> - -namespace Kita -{ - class AbstractPrefPage; - - class KDE_EXPORT Preferences : public KConfigDialog - { - Q_OBJECT - - public: - Preferences(QWidget* parent); - void load(); - - private: - QList<AbstractPrefPage*> m_pageList; - void apply(); - void reset(); - Preferences(const Preferences&); - Preferences& operator=(const Preferences&); - - private slots: - virtual void slotButtonClicked(int button); - void slotChanged(); - - signals: - void fontChanged(const QFont&); - }; -} - -#endif // KITAPREFS_H