svnno****@sourc*****
svnno****@sourc*****
2009年 7月 23日 (木) 21:58:22 JST
Revision: 2465 http://sourceforge.jp/projects/kita/svn/view?view=rev&revision=2465 Author: nogu Date: 2009-07-23 21:58:22 +0900 (Thu, 23 Jul 2009) Log Message: ----------- - Config -> GlobalConfig, config_xt.{h,kcfg{,c}} -> globalconfig.{h,{kcfg{,c}} - Write -> WriteConfig, write.{h,kcfg{,c}} -> writeconfig.{h,{kcfg{,c}} - add ColorConfig - KConfigDialog -> KPageDialog - remove tmpln to avoid a warning Modified Paths: -------------- kita/branches/KITA-KDE4/kita/src/bbsview.cpp kita/branches/KITA-KDE4/kita/src/boardview.cpp kita/branches/KITA-KDE4/kita/src/htmlpart.cpp kita/branches/KITA-KDE4/kita/src/libkita/CMakeLists.txt kita/branches/KITA-KDE4/kita/src/libkita/datinfo.cpp kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.cpp kita/branches/KITA-KDE4/kita/src/main.cpp kita/branches/KITA-KDE4/kita/src/mainwindow.cpp kita/branches/KITA-KDE4/kita/src/mainwindow.h kita/branches/KITA-KDE4/kita/src/prefs/asciiartprefpage.cpp kita/branches/KITA-KDE4/kita/src/prefs/faceprefpage.cpp kita/branches/KITA-KDE4/kita/src/prefs/preferences.cpp kita/branches/KITA-KDE4/kita/src/prefs/preferences.h kita/branches/KITA-KDE4/kita/src/prefs/uiprefpage.cpp kita/branches/KITA-KDE4/kita/src/prefs/writeprefpage.cpp kita/branches/KITA-KDE4/kita/src/respopup.cpp kita/branches/KITA-KDE4/kita/src/threadtabwidget.cpp kita/branches/KITA-KDE4/kita/src/writeview.cpp Added Paths: ----------- kita/branches/KITA-KDE4/kita/src/libkita/colorconfig.kcfg kita/branches/KITA-KDE4/kita/src/libkita/colorconfig.kcfgc kita/branches/KITA-KDE4/kita/src/libkita/globalconfig.kcfg kita/branches/KITA-KDE4/kita/src/libkita/globalconfig.kcfgc kita/branches/KITA-KDE4/kita/src/libkita/writeconfig.kcfg kita/branches/KITA-KDE4/kita/src/libkita/writeconfig.kcfgc Removed Paths: ------------- kita/branches/KITA-KDE4/kita/src/libkita/config_xt.kcfg kita/branches/KITA-KDE4/kita/src/libkita/config_xt.kcfgc kita/branches/KITA-KDE4/kita/src/libkita/write.kcfg kita/branches/KITA-KDE4/kita/src/libkita/write.kcfgc Modified: kita/branches/KITA-KDE4/kita/src/bbsview.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/bbsview.cpp 2009-07-22 21:44:40 UTC (rev 2464) +++ kita/branches/KITA-KDE4/kita/src/bbsview.cpp 2009-07-23 12:58:22 UTC (rev 2465) @@ -36,8 +36,8 @@ #include "viewmediator.h" #include "kitaui/listviewitem.h" #include "libkita/boardmanager.h" -#include "libkita/config_xt.h" #include "libkita/favoriteboards.h" +#include "libkita/globalconfig.h" #include "libkita/kita_misc.h" using namespace Kita; @@ -94,7 +94,7 @@ * download board list, parse, and write to "board_list" * * @see updateBoardList() - * @see Config::boardListURL() + * @see GlobalConfig::boardListURL() */ bool BBSView::downloadBoardList() { @@ -103,7 +103,7 @@ QList<QString> newURLs; QString tmpFile; - QString url = Config::boardListUrl(); + QString url = GlobalConfig::boardListUrl(); if (! KIO::NetAccess::download(url, tmpFile, 0)) { return false; } Modified: kita/branches/KITA-KDE4/kita/src/boardview.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/boardview.cpp 2009-07-22 21:44:40 UTC (rev 2464) +++ kita/branches/KITA-KDE4/kita/src/boardview.cpp 2009-07-23 12:58:22 UTC (rev 2465) @@ -24,8 +24,8 @@ #include "threadlistviewitem.h" #include "viewmediator.h" #include "libkita/boardmanager.h" -#include "libkita/config_xt.h" #include "libkita/datmanager.h" +#include "libkita/globalconfig.h" #include "libkita/kita_misc.h" #include "libkita/thread.h" @@ -151,11 +151,11 @@ } ViewMediator::getInstance()->setMainURLLine(m_boardURL); - switch (Config::listSortOrder()) { - case Config::EnumListSortOrder::Mark: + switch (GlobalConfig::listSortOrder()) { + case GlobalConfig::EnumListSortOrder::Mark: subjectList->sortItems(ColumnMark); break; - case Config::EnumListSortOrder::ID: + case GlobalConfig::EnumListSortOrder::ID: subjectList->sortItems(ColumnId); break; default: @@ -289,7 +289,7 @@ subjectList->item(row, ColumnMarkOrder) ->setText(QString::number((viewPos > 1000) ? Thread_Readed : Thread_Read)); - } else if (since.secsTo(current) < 3600 * Config::markTime()) { + } else if (since.secsTo(current) < 3600 * GlobalConfig::markTime()) { /* new thread */ subjectList->item(row, ColumnMark) ->setIcon(QIcon(SmallIcon("newthread"))); Modified: kita/branches/KITA-KDE4/kita/src/htmlpart.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/htmlpart.cpp 2009-07-22 21:44:40 UTC (rev 2464) +++ kita/branches/KITA-KDE4/kita/src/htmlpart.cpp 2009-07-23 12:58:22 UTC (rev 2465) @@ -31,8 +31,9 @@ #include "kitaui/htmlview.h" #include "libkita/abone.h" #include "libkita/boardmanager.h" -#include "libkita/config_xt.h" +#include "libkita/colorconfig.h" #include "libkita/datmanager.h" +#include "libkita/globalconfig.h" #include "libkita/kita_misc.h" using namespace Kita; @@ -162,10 +163,10 @@ { /* style */ QString style = QString("body { font-size: %1pt; font-family: \"%2\"; color: %3; background-color: %4; }") - .arg(Config::threadFont().pointSize()) - .arg(Config::threadFont().family()) - .arg(Config::threadColor().name()) - .arg(Config::threadBackground().name()); + .arg(GlobalConfig::threadFont().pointSize()) + .arg(GlobalConfig::threadFont().family()) + .arg(ColorConfig::thread().name()) + .arg(ColorConfig::threadBackground().name()); QString text = "<html><head><style>"; text += DEFAULT_STYLESHEET; @@ -259,7 +260,7 @@ /* change color of number of the res which is responsed. */ if (m_mode == HTMLPART_MODE_MAINPART) { - if (Config::checkResponsed()) { + if (GlobalConfig::checkResponsed()) { m_domtree->changeColorOfAllResponsedNumber(); } } @@ -298,13 +299,14 @@ /* public slot */ void HTMLPart::slotSetFaceOfHTMLPart() { - QFont font = Config::threadFont(); + QFont font = GlobalConfig::threadFont(); DOM::CSSStyleDeclaration style = htmlDocument().body().style(); style.setProperty("font-family", font.family(), ""); style.setProperty("font-size", QString("%1pt").arg(font.pointSize()), ""); - style.setProperty("color", Config::threadColor().name(), ""); - style.setProperty("background-color", Config::threadBackground().name(), ""); + style.setProperty("color", ColorConfig::thread().name(), ""); + style.setProperty("background-color", + ColorConfig::threadBackground().name(), ""); htmlDocument().applyChanges(); } Modified: kita/branches/KITA-KDE4/kita/src/libkita/CMakeLists.txt =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/CMakeLists.txt 2009-07-22 21:44:40 UTC (rev 2464) +++ kita/branches/KITA-KDE4/kita/src/libkita/CMakeLists.txt 2009-07-23 12:58:22 UTC (rev 2465) @@ -1,4 +1,3 @@ - include_directories(${KDE4_INCLUDES} ${KDE4_INCLUDE_DIR} ${QT_INCLUDES} ) @@ -29,8 +28,9 @@ kde4_add_kcfg_files(kita_LIB_SRCS abone.kcfgc asciiart.kcfgc - config_xt.kcfgc - write.kcfgc) + colorconfig.kcfgc + globalconfig.kcfgc + writeconfig.kcfgc) kde4_add_library(kitautil SHARED ${kita_LIB_SRCS}) @@ -42,7 +42,7 @@ ########### install files ############### -install(FILES abone.kcfg asciiart.kcfg config_xt.kcfg DESTINATION ${KCFG_INSTALL_DIR}) +install(FILES abone.kcfg asciiart.kcfg global.kcfg DESTINATION ${KCFG_INSTALL_DIR}) Added: kita/branches/KITA-KDE4/kita/src/libkita/colorconfig.kcfg =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/colorconfig.kcfg (rev 0) +++ kita/branches/KITA-KDE4/kita/src/libkita/colorconfig.kcfg 2009-07-23 12:58:22 UTC (rev 2465) @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="UTF-8"?> +<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 + http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" > + <kcfgfile name="kitarc" /> + <group name="Color"> + <entry name="Thread" type="Color"> + <label>Thread foreground color.</label> + <default>black</default> + </entry> + <entry name="ThreadBackground" type="Color"> + <label>Thread backgroupd color.</label> + <default>white</default> + </entry> + <entry name="Popup" type="Color"> + <label>Popup foreground color.</label> + <default>black</default> + </entry> + <entry name="PopupBackground" type="Color"> + <label>Popup background color.</label> + <default>yellow</default> + </entry> + </group> +</kcfg> Added: kita/branches/KITA-KDE4/kita/src/libkita/colorconfig.kcfgc =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/colorconfig.kcfgc (rev 0) +++ kita/branches/KITA-KDE4/kita/src/libkita/colorconfig.kcfgc 2009-07-23 12:58:22 UTC (rev 2465) @@ -0,0 +1,6 @@ +File=colorconfig.kcfg +ClassName=ColorConfig +NameSpace=Kita +Singleton=true +Mutators=true +Visibility=KDE_EXPORT Deleted: kita/branches/KITA-KDE4/kita/src/libkita/config_xt.kcfg =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/config_xt.kcfg 2009-07-22 21:44:40 UTC (rev 2464) +++ kita/branches/KITA-KDE4/kita/src/libkita/config_xt.kcfg 2009-07-23 12:58:22 UTC (rev 2465) @@ -1,117 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 - http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" > - <kcfgfile name="kitarc" /> - <group name="Global"> - <entry name="Font" type="Font"> - <label>List font.</label> - </entry> - <entry name="ThreadFont" type="Font"> - <label>Thread font.</label> - </entry> - <entry name="PopupFont" type="Font"> - <label>Popup font.</label> - </entry> - <entry name="ShowMailAddress" type="Bool"> - <label>Whether show mail address or not.</label> - <default>false</default> - </entry> - <entry name="UsePart" type="Bool"> - <label>Whether use embedded part or not.</label> - </entry> - <entry name="UseImageViewer" type="Bool"> - <label>Whether use image viewer or not.</label> - </entry> - <entry name="UseImagePopup" type="Bool"> - <label>Whether use image popup or not.</label> - </entry> - <entry name="UseMosaic" type="Bool"> - <label>Whether use mosaic or not.</label> - </entry> - <entry name="UseKitaNavi" type="Bool"> - <label>Whether use kitanavi or not.</label> - </entry> - <entry name="ShowNum" type="Int"> - <label>Number of responses displayed once.</label> - <default>100</default> - </entry> - <entry name="UseStyleSheet" type="Bool"> - <label>Whether use custom stylesheet or not.</label> - <default>false</default> - </entry> - <entry name="MarkTime" type="Int"> - <label>Time marked as newly arrived thread. (0 == after last access.)</label> - <default>24</default> - </entry> - <entry name="AboneChain" type="Bool"> - <label>Whether abone responses recursively(secret config).</label> - <default>false</default> - </entry> - <entry name="CheckResponsed" type="Bool"> - <label>Whether check responsed responses or not(secret config).</label> - </entry> - <entry name="CopyOnClick" type="Bool"> - <label>Whether copy URL on click or not(secret config).</label> - <default>false</default> - </entry> - <entry name="ListSortOrder" type="Enum"> - <label>Choice order of board list.</label> - <choices> - <choice name="Mark" /> - <choice name="ID" /> - </choices> - <default>Mark</default> - </entry> - <entry name="PartMimeList" type="StringList"> - <label>MIME list to use kpart.</label> - <default>image/gif,image/jpeg,image/png,image/x-bmp</default> - </entry> - <entry name="BoardListUrl" type="String"> - <label>URL of board list</label> - <default>http://menu.2ch.net/bbsmenu.html</default> - </entry> - </group> - <group name="Color"> - <entry name="ThreadColor" type="Color"> - <label>Thread foreground color.</label> - <default>black</default> - </entry> - <entry name="ThreadBackground" type="Color"> - <label>Thread backgroupd color.</label> - <default>white</default> - </entry> - <entry name="PopupColor" type="Color"> - <label>Popup foreground color.</label> - <default>black</default> - </entry> - <entry name="PopupBackground" type="Color"> - <label>Popup background color.</label> - <default>yellow</default> - </entry> - </group> - <group name="Account"> - <entry name="BeMailAddress" type="String"> - <label>Mail address of be.2ch.net</label> - </entry> - <entry name="BeAuthCode" type="String"> - <label>Auth code of be.2ch.net</label> - </entry> - <entry name="UserID" type="String"> - <label>Maru user id</label> - </entry> - <entry name="AutoLogin" type="Bool"> - <label>Whether login automatically or not.</label> - <default>false</default> - </entry> - <entry name="Password" type="Password"> - <label>Maru password</label> - </entry> - </group> - <group name="Completion"> - <entry name="NameCompletionList" type="StringList"> - <label>Name Completion list.</label> - </entry> - </group> -</kcfg> Deleted: kita/branches/KITA-KDE4/kita/src/libkita/config_xt.kcfgc =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/config_xt.kcfgc 2009-07-22 21:44:40 UTC (rev 2464) +++ kita/branches/KITA-KDE4/kita/src/libkita/config_xt.kcfgc 2009-07-23 12:58:22 UTC (rev 2465) @@ -1,6 +0,0 @@ -File=config_xt.kcfg -ClassName=Config -NameSpace=Kita -Singleton=true -Mutators=true -Visibility=KDE_EXPORT Modified: kita/branches/KITA-KDE4/kita/src/libkita/datinfo.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/datinfo.cpp 2009-07-22 21:44:40 UTC (rev 2464) +++ kita/branches/KITA-KDE4/kita/src/libkita/datinfo.cpp 2009-07-23 12:58:22 UTC (rev 2465) @@ -19,8 +19,8 @@ #include "access.h" #include "account.h" #include "cache.h" -#include "config_xt.h" #include "datmanager.h" +#include "globalconfig.h" #include "kita_misc.h" #include "kita-utf8.h" #include "thread.h" @@ -243,7 +243,7 @@ if (num == 1) parseDat(num); /* search all responses which are responsed by this line. */ - if (Config::checkResponsed()) { + if (GlobalConfig::checkResponsed()) { if (parseDat(num) && !checkAbonePrivate(num)) { /* parse line here to get AncList */ @@ -801,7 +801,7 @@ m_aboneByName = (!AboneConfig::aboneNameList().isEmpty()); m_aboneByBody = (!AboneConfig::aboneWordList().isEmpty()); m_aboneChain = (m_aboneByID | m_aboneByName | m_aboneByBody) - & Config::aboneChain() ; + & GlobalConfig::aboneChain() ; } Copied: kita/branches/KITA-KDE4/kita/src/libkita/globalconfig.kcfg (from rev 2464, kita/branches/KITA-KDE4/kita/src/libkita/config_xt.kcfg) =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/globalconfig.kcfg (rev 0) +++ kita/branches/KITA-KDE4/kita/src/libkita/globalconfig.kcfg 2009-07-23 12:58:22 UTC (rev 2465) @@ -0,0 +1,99 @@ +<?xml version="1.0" encoding="UTF-8"?> +<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 + http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" > + <kcfgfile name="kitarc" /> + <group name="Global"> + <entry name="Font" type="Font"> + <label>List font.</label> + </entry> + <entry name="ThreadFont" type="Font"> + <label>Thread font.</label> + </entry> + <entry name="PopupFont" type="Font"> + <label>Popup font.</label> + </entry> + <entry name="ShowMailAddress" type="Bool"> + <label>Whether show mail address or not.</label> + <default>false</default> + </entry> + <entry name="UsePart" type="Bool"> + <label>Whether use embedded part or not.</label> + </entry> + <entry name="UseImageViewer" type="Bool"> + <label>Whether use image viewer or not.</label> + </entry> + <entry name="UseImagePopup" type="Bool"> + <label>Whether use image popup or not.</label> + </entry> + <entry name="UseMosaic" type="Bool"> + <label>Whether use mosaic or not.</label> + </entry> + <entry name="UseKitaNavi" type="Bool"> + <label>Whether use kitanavi or not.</label> + </entry> + <entry name="ShowNum" type="Int"> + <label>Number of responses displayed once.</label> + <default>100</default> + </entry> + <entry name="UseStyleSheet" type="Bool"> + <label>Whether use custom stylesheet or not.</label> + <default>false</default> + </entry> + <entry name="MarkTime" type="Int"> + <label>Time marked as newly arrived thread. (0 == after last access.)</label> + <default>24</default> + </entry> + <entry name="AboneChain" type="Bool"> + <label>Whether abone responses recursively(secret config).</label> + <default>false</default> + </entry> + <entry name="CheckResponsed" type="Bool"> + <label>Whether check responsed responses or not(secret config).</label> + </entry> + <entry name="CopyOnClick" type="Bool"> + <label>Whether copy URL on click or not(secret config).</label> + <default>false</default> + </entry> + <entry name="ListSortOrder" type="Enum"> + <label>Choice order of board list.</label> + <choices> + <choice name="Mark" /> + <choice name="ID" /> + </choices> + <default>Mark</default> + </entry> + <entry name="PartMimeList" type="StringList"> + <label>MIME list to use kpart.</label> + <default>image/gif,image/jpeg,image/png,image/x-bmp</default> + </entry> + <entry name="BoardListUrl" type="String"> + <label>URL of board list</label> + <default>http://menu.2ch.net/bbsmenu.html</default> + </entry> + </group> + <group name="Account"> + <entry name="BeMailAddress" type="String"> + <label>Mail address of be.2ch.net</label> + </entry> + <entry name="BeAuthCode" type="String"> + <label>Auth code of be.2ch.net</label> + </entry> + <entry name="UserID" type="String"> + <label>Maru user id</label> + </entry> + <entry name="AutoLogin" type="Bool"> + <label>Whether login automatically or not.</label> + <default>false</default> + </entry> + <entry name="Password" type="Password"> + <label>Maru password</label> + </entry> + </group> + <group name="Completion"> + <entry name="NameCompletionList" type="StringList"> + <label>Name Completion list.</label> + </entry> + </group> +</kcfg> Property changes on: kita/branches/KITA-KDE4/kita/src/libkita/globalconfig.kcfg ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:mergeinfo + Added: svn:eol-style + native Copied: kita/branches/KITA-KDE4/kita/src/libkita/globalconfig.kcfgc (from rev 2413, kita/branches/KITA-KDE4/kita/src/libkita/config_xt.kcfgc) =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/globalconfig.kcfgc (rev 0) +++ kita/branches/KITA-KDE4/kita/src/libkita/globalconfig.kcfgc 2009-07-23 12:58:22 UTC (rev 2465) @@ -0,0 +1,6 @@ +File=globalconfig.kcfg +ClassName=GlobalConfig +NameSpace=Kita +Singleton=true +Mutators=true +Visibility=KDE_EXPORT Property changes on: kita/branches/KITA-KDE4/kita/src/libkita/globalconfig.kcfgc ___________________________________________________________________ Added: svn:keywords + Author Date Id Revision Added: svn:mergeinfo + Added: svn:eol-style + native Modified: kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.cpp 2009-07-22 21:44:40 UTC (rev 2464) +++ kita/branches/KITA-KDE4/kita/src/libkita/kita_misc.cpp 2009-07-23 12:58:22 UTC (rev 2465) @@ -18,9 +18,9 @@ #include <kurl.h> #include "boardmanager.h" -#include "config_xt.h" #include "datinfo.h" /* struct RESDAT is defined. */ #include "datmanager.h" +#include "globalconfig.h" #include "kita-utf8.h" #include "kita-utf16.h" @@ -1304,8 +1304,8 @@ titleHTML.clear(); if (!resdat.parsed) return ; - bool showMailAddress = Config::showMailAddress(); - bool useTableTag = Config::useStyleSheet(); + bool showMailAddress = GlobalConfig::showMailAddress(); + bool useTableTag = GlobalConfig::useStyleSheet(); if (m_colonstr.isEmpty()) { m_colonstr = utf8ToUnicode(KITAUTF8_COLON); Deleted: kita/branches/KITA-KDE4/kita/src/libkita/write.kcfg =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/write.kcfg 2009-07-22 21:44:40 UTC (rev 2464) +++ kita/branches/KITA-KDE4/kita/src/libkita/write.kcfg 2009-07-23 12:58:22 UTC (rev 2465) @@ -1,23 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 - http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" > - <kcfgfile name="kitarc" /> - <group name="Write"> - <entry name="DefaultName" type="String"> - <label>Default name.</label> - </entry> - <entry name="DefaultNameUseAlways" type="Bool"> - <label>Whether use default name or not.</label> - <default>false</default> - </entry> - <entry name="DefaultMail" type="String"> - <label>Default mail address.</label> - </entry> - <entry name="DefaultSage" type="Bool"> - <label>Whether use 'sage' as default or not.</label> - <default>true</default> - </entry> - </group> -</kcfg> Deleted: kita/branches/KITA-KDE4/kita/src/libkita/write.kcfgc =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/write.kcfgc 2009-07-22 21:44:40 UTC (rev 2464) +++ kita/branches/KITA-KDE4/kita/src/libkita/write.kcfgc 2009-07-23 12:58:22 UTC (rev 2465) @@ -1,6 +0,0 @@ -File=write.kcfg -ClassName=WriteConfig -NameSpace=Kita -Singleton=true -Mutators=true -Visibility=KDE_EXPORT Copied: kita/branches/KITA-KDE4/kita/src/libkita/writeconfig.kcfg (from rev 2464, kita/branches/KITA-KDE4/kita/src/libkita/write.kcfg) =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/writeconfig.kcfg (rev 0) +++ kita/branches/KITA-KDE4/kita/src/libkita/writeconfig.kcfg 2009-07-23 12:58:22 UTC (rev 2465) @@ -0,0 +1,23 @@ +<?xml version="1.0" encoding="UTF-8"?> +<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0 + http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" > + <kcfgfile name="kitarc" /> + <group name="Write"> + <entry name="DefaultName" type="String"> + <label>Default name.</label> + </entry> + <entry name="DefaultNameUseAlways" type="Bool"> + <label>Whether use default name or not.</label> + <default>false</default> + </entry> + <entry name="DefaultMail" type="String"> + <label>Default mail address.</label> + </entry> + <entry name="DefaultSage" type="Bool"> + <label>Whether use 'sage' as default or not.</label> + <default>true</default> + </entry> + </group> +</kcfg> Property changes on: kita/branches/KITA-KDE4/kita/src/libkita/writeconfig.kcfg ___________________________________________________________________ Added: svn:mergeinfo + Copied: kita/branches/KITA-KDE4/kita/src/libkita/writeconfig.kcfgc (from rev 2464, kita/branches/KITA-KDE4/kita/src/libkita/write.kcfgc) =================================================================== --- kita/branches/KITA-KDE4/kita/src/libkita/writeconfig.kcfgc (rev 0) +++ kita/branches/KITA-KDE4/kita/src/libkita/writeconfig.kcfgc 2009-07-23 12:58:22 UTC (rev 2465) @@ -0,0 +1,6 @@ +File=writeconfig.kcfg +ClassName=WriteConfig +NameSpace=Kita +Singleton=true +Mutators=true +Visibility=KDE_EXPORT Property changes on: kita/branches/KITA-KDE4/kita/src/libkita/writeconfig.kcfgc ___________________________________________________________________ Added: svn:mergeinfo + Modified: kita/branches/KITA-KDE4/kita/src/main.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/main.cpp 2009-07-22 21:44:40 UTC (rev 2464) +++ kita/branches/KITA-KDE4/kita/src/main.cpp 2009-07-23 12:58:22 UTC (rev 2465) @@ -16,7 +16,7 @@ #include <kcmdlineargs.h> #include <kuniqueapplication.h> -#include "libkita/config_xt.h" +#include "libkita/globalconfig.h" static const char *description = I18N_NOOP("Kita - 2ch client for KDE"); @@ -47,7 +47,7 @@ // app.dcopClient() ->registerAs(app.name(), FALSE); KCmdLineArgs* args = KCmdLineArgs::parsedArgs(); - Config::setBoardListUrl(QString(args->getOption("boardlist"))); + GlobalConfig::setBoardListUrl(QString(args->getOption("boardlist"))); // see if we are starting with session management if (app.isSessionRestored()) { Modified: kita/branches/KITA-KDE4/kita/src/mainwindow.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/mainwindow.cpp 2009-07-22 21:44:40 UTC (rev 2464) +++ kita/branches/KITA-KDE4/kita/src/mainwindow.cpp 2009-07-23 12:58:22 UTC (rev 2465) @@ -41,17 +41,17 @@ #include "libkita/abone.h" #include "libkita/account.h" #include "libkita/asciiart.h" -#include "libkita/config_xt.h" #include "libkita/datmanager.h" #include "libkita/favoriteboards.h" #include "libkita/favoritethreads.h" +#include "libkita/globalconfig.h" #include "libkita/kita_misc.h" #include "libkita/threadinfo.h" #include "prefs/preferences.h" using namespace Kita; -MainWindow::MainWindow() : KXmlGuiWindow(0) +MainWindow::MainWindow() : KXmlGuiWindow(0), m_prefDialog(0) { // FIXME: merge *.po KGlobal::locale() ->insertCatalog("kitapart"); @@ -94,7 +94,7 @@ // for compativility loadCompletion(); - Config::self()->readConfig(); + GlobalConfig::self()->readConfig(); // apply the saved mainwindow settings, if any, and ask the mainwindow // to automatically save settings if changed: window size, toolbar @@ -102,7 +102,7 @@ setAutoSaveSettings(); // set list font - setFont(Config::font()); + setFont(GlobalConfig::font()); // allow the view to change the statusbar and caption connect(m_urlLine, SIGNAL(returnPressed()), @@ -132,7 +132,7 @@ // update favorite list ViewMediator::getInstance()->updateFavoriteListView(); - if (Config::autoLogin()) { + if (GlobalConfig::autoLogin()) { login(); } } @@ -151,7 +151,7 @@ saveMainWindowSettings(KGlobal::config().data()->group("MainWindow")); - Config::self()->writeConfig(); + GlobalConfig::self()->writeConfig(); DatManager::deleteAllDatInfo(); } @@ -172,7 +172,7 @@ void MainWindow::login() { - if (Account::login(Config::userID(), Config::password())) { + if (Account::login(GlobalConfig::userID(), GlobalConfig::password())) { setMainStatus(i18n("Login succeeded.")); } else { setMainStatus(i18n("Login failed.")); @@ -224,18 +224,15 @@ void MainWindow::optionsPreferences() { - // popup some sort of preference dialog, here - if (KConfigDialog::showDialog("Kita Preferences")) { - return; + if (m_prefDialog == 0) { + m_prefDialog = new Preferences(this); + m_prefDialog->load(); + connect(m_prefDialog, SIGNAL(fontChanged(const QFont&)), + SLOT(setFont(const QFont&))); + m_prefDialog->show(); + } else { + m_prefDialog->raise(); } - - Preferences* dialog = new Preferences(this); - dialog->load(); - - connect(dialog, SIGNAL(fontChanged(const QFont&)), - SLOT(setFont(const QFont&))); - - dialog->show(); } void MainWindow::settingsMenuAboutToShow() @@ -433,7 +430,8 @@ QString configPath = KStandardDirs::locateLocal("appdata", "completion"); KConfig config(configPath); - Config::setNameCompletionList(config.group("").readEntry("name", QStringList() )); + GlobalConfig::setNameCompletionList( + config.group("").readEntry("name", QStringList())); } void MainWindow::loadAsciiArt() Modified: kita/branches/KITA-KDE4/kita/src/mainwindow.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/mainwindow.h 2009-07-22 21:44:40 UTC (rev 2464) +++ kita/branches/KITA-KDE4/kita/src/mainwindow.h 2009-07-23 12:58:22 UTC (rev 2465) @@ -21,7 +21,6 @@ class KToggleAction; class KUrl; - namespace KParts { class URLArgs; @@ -33,6 +32,7 @@ class BoardTabWidget; class ThreadTabWidget; class WriteTabWidget; + class Preferences; /** * This class serves as the main window for Kita. It handles the @@ -80,6 +80,7 @@ BoardTabWidget* m_boardTab; WriteTabWidget* m_writeTab; + Preferences *m_prefDialog; void setupActions(); void setupView(); void loadCache(); Modified: kita/branches/KITA-KDE4/kita/src/prefs/asciiartprefpage.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/asciiartprefpage.cpp 2009-07-22 21:44:40 UTC (rev 2464) +++ kita/branches/KITA-KDE4/kita/src/prefs/asciiartprefpage.cpp 2009-07-23 12:58:22 UTC (rev 2465) @@ -11,7 +11,7 @@ #include "asciiartprefpage.h" #include "libkita/asciiart.h" -#include "libkita/config_xt.h" +#include "libkita/globalconfig.h" using namespace Kita; @@ -33,7 +33,7 @@ void AsciiArtPrefPage::load() { asciiArtText->setText(AsciiArtConfig::asciiArtList().join("\n")); - asciiArtText->setFont(Config::threadFont()); + asciiArtText->setFont(GlobalConfig::threadFont()); } void AsciiArtPrefPage::reset() Modified: kita/branches/KITA-KDE4/kita/src/prefs/faceprefpage.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/faceprefpage.cpp 2009-07-22 21:44:40 UTC (rev 2464) +++ kita/branches/KITA-KDE4/kita/src/prefs/faceprefpage.cpp 2009-07-23 12:58:22 UTC (rev 2465) @@ -12,7 +12,8 @@ #include <kfontdialog.h> -#include "libkita/config_xt.h" +#include "libkita/colorconfig.h" +#include "libkita/globalconfig.h" #include "libkita/kita_misc.h" using namespace Kita; @@ -45,50 +46,52 @@ { // font QFont font = listFontButton->font(); - Config::setFont(font); + GlobalConfig::setFont(font); emit fontChanged(font); QFont threadFont = threadFontButton->font(); - Config::setThreadFont(threadFont); + GlobalConfig::setThreadFont(threadFont); QFont popupFont = popupFontButton->font(); - Config::setPopupFont(popupFont); + GlobalConfig::setPopupFont(popupFont); // color - Config::setThreadColor(threadColorButton->color()); - Config::setThreadBackground(threadBackgroundColorButton->color()); - Config::setPopupColor(popupColorButton->color()); - Config::setPopupBackground(popupBackgroundColorButton->color()); + ColorConfig::setThread(threadColorButton->color()); + ColorConfig::setThreadBackground(threadBackgroundColorButton->color()); + ColorConfig::setPopup(popupColorButton->color()); + ColorConfig::setPopupBackground(popupBackgroundColorButton->color()); } void FacePrefPage::load() { // font - QFont font = Config::font(); + QFont font = GlobalConfig::font(); listFontButton->setText(fontToString(font)); listFontButton->setFont(font); - QFont threadFont = Config::threadFont(); + QFont threadFont = GlobalConfig::threadFont(); threadFontButton->setText(fontToString(threadFont)); threadFontButton->setFont(threadFont); - QFont popupFont = Config::popupFont(); + QFont popupFont = GlobalConfig::popupFont(); popupFontButton->setText(fontToString(popupFont)); popupFontButton->setFont(popupFont); // color - threadColorButton->setColor(Config::threadColor()); - threadBackgroundColorButton->setColor(Config::threadBackground()); - popupColorButton->setColor(Config::popupColor()); - popupBackgroundColorButton->setColor(Config::popupBackground()); + threadColorButton->setColor(ColorConfig::thread()); + threadBackgroundColorButton->setColor(ColorConfig::threadBackground()); + popupColorButton->setColor(ColorConfig::popup()); + popupBackgroundColorButton->setColor(ColorConfig::popupBackground()); } void FacePrefPage::reset() { - Config::self()->useDefaults(true); + ColorConfig::self()->useDefaults(true); + GlobalConfig::self()->useDefaults(true); load(); - Config::self()->useDefaults(false); + GlobalConfig::self()->useDefaults(false); + ColorConfig::self()->useDefaults(false); } void FacePrefPage::slotThreadFontButtonClicked() Modified: kita/branches/KITA-KDE4/kita/src/prefs/preferences.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/preferences.cpp 2009-07-22 21:44:40 UTC (rev 2464) +++ kita/branches/KITA-KDE4/kita/src/prefs/preferences.cpp 2009-07-23 12:58:22 UTC (rev 2465) @@ -16,48 +16,61 @@ #include "loginprefpage.h" #include "uiprefpage.h" #include "writeprefpage.h" -#include "libkita/config_xt.h" +#include "libkita/globalconfig.h" using namespace Kita; -Preferences::Preferences(QWidget* parent) - : KConfigDialog(parent, "Kita Preferences", Config::self()) +Preferences::Preferences(QWidget* parent) : KPageDialog(parent) { + setWindowTitle("Kita Preferences"); + + setButtons(Ok | Apply | Cancel | Default); enableButtonApply(false); - enableButton(Help, false); + setDefaultButton(Ok); // 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"); + KPageWidgetItem* faceItem + = addPage(facePage, i18n("Face")); + faceItem->setIcon(KIcon("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"); + KPageWidgetItem* asciiArtItem + = addPage(asciiArtPage, i18n("AsciiArt")); + asciiArtItem->setIcon(KIcon("kita")); connect(asciiArtPage, SIGNAL(changed()), SLOT(slotChanged())); m_pageList.append(asciiArtPage); UIPrefPage* uiPage = new UIPrefPage(0); - addPage(uiPage, i18n("User Interface"), "configure"); + KPageWidgetItem* configureItem + = addPage(uiPage, i18n("User Interface")); + configureItem->setIcon(KIcon("configure")); connect(uiPage, SIGNAL(changed()), SLOT(slotChanged())); m_pageList.append(uiPage); AbonePrefPage* abonePage = new AbonePrefPage(0); - addPage(abonePage, i18n("Abone"), "kita"); + KPageWidgetItem* aboneItem = addPage(abonePage, i18n("Abone")); + aboneItem->setIcon(KIcon("kita")); connect(abonePage, SIGNAL(changed()), SLOT(slotChanged())); m_pageList.append(abonePage); LoginPrefPage* loginPage = new LoginPrefPage(0); - addPage(loginPage, i18n("Login"), "network-connect"); + KPageWidgetItem* loginItem + = addPage(loginPage, i18n("Login")); + loginItem->setIcon(KIcon("network-connect")); connect(loginPage, SIGNAL(changed()), SLOT(slotChanged())); m_pageList.append(loginPage); WritePrefPage* writePage = new WritePrefPage(0); - addPage(writePage, i18n("Write"), "document-edit"); + KPageWidgetItem* writeItem + = addPage(writePage, i18n("Write")); + writeItem->setIcon(KIcon("document-edit")); connect(writePage, SIGNAL(changed()), SLOT(slotChanged())); m_pageList.append(writePage); } @@ -91,9 +104,8 @@ apply(); } else if (button == Default) { reset(); - return; } - KConfigDialog::slotButtonClicked(button); + KPageDialog::slotButtonClicked(button); } void Preferences::slotChanged() Modified: kita/branches/KITA-KDE4/kita/src/prefs/preferences.h =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/preferences.h 2009-07-22 21:44:40 UTC (rev 2464) +++ kita/branches/KITA-KDE4/kita/src/prefs/preferences.h 2009-07-23 12:58:22 UTC (rev 2465) @@ -13,13 +13,13 @@ #include <QtCore/QList> -#include <kconfigdialog.h> +#include <kpagedialog.h> namespace Kita { class AbstractPrefPage; - class KDE_EXPORT Preferences : public KConfigDialog + class KDE_EXPORT Preferences : public KPageDialog { Q_OBJECT Modified: kita/branches/KITA-KDE4/kita/src/prefs/uiprefpage.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/uiprefpage.cpp 2009-07-22 21:44:40 UTC (rev 2464) +++ kita/branches/KITA-KDE4/kita/src/prefs/uiprefpage.cpp 2009-07-23 12:58:22 UTC (rev 2465) @@ -36,7 +36,7 @@ kcfg_MarkTime->setValue(24); kcfg_ShowMailAddress->setChecked(false); kcfg_ShowNum->setValue(100); - //kcfg_ListSortOrder->setButton(Config::EnumListSortOrder::Mark);TODO + //kcfg_ListSortOrder->setButton(GlobalConfig::EnumListSortOrder::Mark);TODO kcfg_PartMimeList->setText("image/gif,image/jpeg,image/png,image/x-bmp"); kcfg_UsePart->setChecked(true); } Modified: kita/branches/KITA-KDE4/kita/src/prefs/writeprefpage.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/prefs/writeprefpage.cpp 2009-07-22 21:44:40 UTC (rev 2464) +++ kita/branches/KITA-KDE4/kita/src/prefs/writeprefpage.cpp 2009-07-23 12:58:22 UTC (rev 2465) @@ -10,7 +10,7 @@ #include "writeprefpage.h" -#include "libkita/write.h" +#include "libkita/writeconfig.h" using namespace Kita; Modified: kita/branches/KITA-KDE4/kita/src/respopup.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/respopup.cpp 2009-07-22 21:44:40 UTC (rev 2464) +++ kita/branches/KITA-KDE4/kita/src/respopup.cpp 2009-07-23 12:58:22 UTC (rev 2465) @@ -20,7 +20,8 @@ #include "const.h" #include "htmlpart.h" #include "kitaui/htmlview.h" -#include "libkita/config_xt.h" +#include "libkita/colorconfig.h" +#include "libkita/globalconfig.h" using namespace Kita; @@ -61,10 +62,10 @@ " background-color: %4; " " border-width: 0;" "}") - .arg(Config::popupFont().pointSize()) - .arg(Config::popupFont().family()) - .arg(Config::popupColor().name()) - .arg(Config::popupBackground().name()); + .arg(GlobalConfig::popupFont().pointSize()) + .arg(GlobalConfig::popupFont().family()) + .arg(ColorConfig::popup().name()) + .arg(ColorConfig::popupBackground().name()); QString text = "<html><head><style>"; text += DEFAULT_STYLESHEET; Modified: kita/branches/KITA-KDE4/kita/src/threadtabwidget.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/threadtabwidget.cpp 2009-07-22 21:44:40 UTC (rev 2464) +++ kita/branches/KITA-KDE4/kita/src/threadtabwidget.cpp 2009-07-23 12:58:22 UTC (rev 2465) @@ -20,8 +20,8 @@ #include "threadview.h" #include "viewmediator.h" -#include "libkita/config_xt.h" #include "libkita/datmanager.h" +#include "libkita/globalconfig.h" #include "libkita/parsemisc.h" using namespace Kita; @@ -168,7 +168,7 @@ void ThreadTabWidget::slotFontChanged() { - QFont font = Config::threadFont(); + QFont font = GlobalConfig::threadFont(); setFont(font); } Modified: kita/branches/KITA-KDE4/kita/src/writeview.cpp =================================================================== --- kita/branches/KITA-KDE4/kita/src/writeview.cpp 2009-07-22 21:44:40 UTC (rev 2464) +++ kita/branches/KITA-KDE4/kita/src/writeview.cpp 2009-07-23 12:58:22 UTC (rev 2465) @@ -22,15 +22,15 @@ #include "libkita/account.h" #include "libkita/asciiart.h" #include "libkita/boardmanager.h" -#include "libkita/config_xt.h" #include "libkita/datmanager.h" #include "libkita/flashcgi.h" +#include "libkita/globalconfig.h" #include "libkita/jbbs.h" #include "libkita/kita_misc.h" #include "libkita/kita-utf8.h" #include "libkita/k2ch.h" #include "libkita/machibbs.h" -#include "libkita/write.h" +#include "libkita/writeconfig.h" using namespace Kita; @@ -73,7 +73,7 @@ qtw->setCurrentIndex(0); /* setup labels and edit lines */ - QFont font = Config::threadFont(); + QFont font = GlobalConfig::threadFont(); bodyText->setFont(font); bodyText->setTabChangesFocus(true); @@ -81,7 +81,7 @@ // setup name field. nameLine->setText(WriteConfig::defaultName()); - QStringList compList = Config::self()->nameCompletionList(); + QStringList compList = GlobalConfig::self()->nameCompletionList(); nameLine->completionObject()->setItems(compList); // setup mail field & 'sage' checkbox @@ -96,14 +96,14 @@ // setup 'be' checkbox QRegExp host_2ch(".+\\.2ch\\.net"); if (host_2ch.indexIn(m_bbscgi.host()) != -1 - && Config::beMailAddress().length() > 0 - && Config::beAuthCode().length() > 0) { + && GlobalConfig::beMailAddress().length() > 0 + && GlobalConfig::beAuthCode().length() > 0) { beBox->setChecked(true); } /* setup AA */ faceCombo->clear(); - faceCombo->setFont(Config::threadFont()); + faceCombo->setFont(GlobalConfig::threadFont()); faceCombo->addItem(""); QStringList list = AsciiArtConfig::asciiArtList(); QStringList::iterator it; @@ -197,9 +197,9 @@ if (!checkFields()) return; QString name = nameLine->text(); - QStringList list = Config::nameCompletionList(); + QStringList list = GlobalConfig::nameCompletionList(); list.append(name); - Config::setNameCompletionList(list); + GlobalConfig::setNameCompletionList(list); /* build post message */ QString postStr = buildPostMessage(); @@ -216,8 +216,8 @@ /* 2ch.net cookie modify */ if (m_bbstype == Board_2ch && beBox->isChecked()) { QString cookie = "Cookie: "; - QString BeMailAddress = Config::beMailAddress(); - QString BeAuthCode = Config::beAuthCode(); + QString BeMailAddress = GlobalConfig::beMailAddress(); + QString BeAuthCode = GlobalConfig::beAuthCode(); if (BeMailAddress.length() > 0 && BeAuthCode.length() > 0) { cookie += "DMDM=" + BeMailAddress + "; "; cookie += "MDMD=" + BeAuthCode + "; "; @@ -337,8 +337,8 @@ { QString text = bodyText->toPlainText(); int lines = text.count('\n') + 1; - int tmpln = text.length(); - int length = QTextCodec::codecForName("Shift_JIS")->fromUnicode(body()).length(); + int length + = QTextCodec::codecForName("Shift_JIS")->fromUnicode(body()).length(); /* replace '\n' -> " <br> ", '>' -> "<", and etc. */ length += ((body().count('\n')) * 5