From 87edccc6633bbda100c0b4ed45b08edce44d3699 Mon Sep 17 00:00:00 2001 From: ikemo Date: Wed, 9 Jun 2004 15:15:52 +0000 Subject: [PATCH] add afterShowNum UI git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/kita/kita/trunk@1157 56b19765-1e22-0410-a548-a0f45d66c51a --- kita/src/kita.cpp | 2 ++ kita/src/libkita/kitaconfig.cpp | 3 ++- kita/src/libkita/kitaconfig.h | 3 +++ kita/src/part/kitathreadview.cpp | 11 +++++--- kita/src/part/kitathreadview.h | 1 - kita/src/pref.cpp | 3 +++ kita/src/uiprefbase.ui | 55 +++++++++++++++++++++++++++++++++++++--- 7 files changed, 68 insertions(+), 10 deletions(-) diff --git a/kita/src/kita.cpp b/kita/src/kita.cpp index 5bf43a4..6898389 100644 --- a/kita/src/kita.cpp +++ b/kita/src/kita.cpp @@ -288,6 +288,7 @@ void KitaMainWindow::writeConfig( KConfig* config ) config->writeEntry( "SortOrder", KitaConfig::sortOrder() ); config->writeEntry( "AlwaysUseTab", KitaConfig::alwaysUseTab() ); config->writeEntry( "ShowAA", KitaConfig::showAA() ); + config->writeEntry( "AfterShowNum", KitaConfig::afterShowNum() ); config->setGroup( "Color" ); config->writeEntry( "Popup", KitaConfig::popupColor() ); @@ -316,6 +317,7 @@ void KitaMainWindow::readConfig( KConfig* config ) KitaConfig::setSortOrder( config->readNumEntry( "SortOrder", KitaConfig::Order_Mark ) ); KitaConfig::setAlwaysUseTab( config->readBoolEntry( "AlwaysUseTab", false ) ); KitaConfig::setShowAA( config->readBoolEntry( "ShowAA", false ) ); + KitaConfig::setAfterShowNum( config->readNumEntry( "AfterShowNum", 100 ) ); setFont( KitaConfig::font() ); diff --git a/kita/src/libkita/kitaconfig.cpp b/kita/src/libkita/kitaconfig.cpp index 0b6c942..0a1bcfe 100644 --- a/kita/src/libkita/kitaconfig.cpp +++ b/kita/src/libkita/kitaconfig.cpp @@ -24,7 +24,8 @@ KitaConfig::KitaConfig() : m_threadColor( "black" ), m_threadBackgroundColor( "white" ), m_popupColor( "black" ), m_popupBackgroundColor( "yellow" ), m_showMailAddress( false ), m_MarkTime( 24 ), m_alwaysUseTab( false ), - m_viewMode( View_2pane ), m_sortOrder( Order_Mark ), m_showAA( false ) + m_viewMode( View_2pane ), m_sortOrder( Order_Mark ), m_showAA( false ), + m_afterShowNum( 100 ) {} KitaConfig::~KitaConfig() diff --git a/kita/src/libkita/kitaconfig.h b/kita/src/libkita/kitaconfig.h index 29743a3..321fcd9 100644 --- a/kita/src/libkita/kitaconfig.h +++ b/kita/src/libkita/kitaconfig.h @@ -51,6 +51,7 @@ private: ViewMode m_viewMode; SortOrder m_sortOrder; bool m_showAA; + int m_afterShowNum; KitaConfig(); virtual ~KitaConfig(); @@ -97,6 +98,8 @@ public: static void setSortOrder( int order ) { getInstance() ->m_sortOrder = static_cast( order ); } static bool showAA() { return getInstance() ->m_showAA; } static void setShowAA( bool on ) { getInstance() ->m_showAA = on; } + static int afterShowNum() { return getInstance() ->m_afterShowNum; } + static void setAfterShowNum( int value ) { getInstance() ->m_afterShowNum = value; } }; #endif diff --git a/kita/src/part/kitathreadview.cpp b/kita/src/part/kitathreadview.cpp index 69fca41..645d72c 100644 --- a/kita/src/part/kitathreadview.cpp +++ b/kita/src/part/kitathreadview.cpp @@ -612,10 +612,8 @@ void KitaThreadView::setupEx( const Kita::Thread* thread, int serverTime, int mo { /* config. */ - /* show m_preShowNum responses before 'kokomade yonda', - and m_afterShowNum responses after 'kokomade yonda' */ + /* show m_preShowNum responses before 'kokomade yonda' */ m_preShowNum = 50; - m_afterShowNum = 100; /* max size of responses in the popup window */ m_maxpopup = 10; @@ -732,7 +730,12 @@ void KitaThreadView::slotReloadButton() if( m_online ) { m_domtree->StopParseThread(); - m_showNum = m_domtree->getBottomResNumber() + m_afterShowNum; + if ( KitaConfig::afterShowNum() != 0 ) { + m_showNum = m_domtree->getBottomResNumber() + KitaConfig::afterShowNum(); + } else { + // TODO: fix it. + m_showNum = 5000; + } Kita::DatManager::updateCache(m_datURL,this); m_threadPart->view()->setFocus(); showStatusBar( Kita::ParseMisc::utf8ToUnicode( KITAUTF8_NOWRENEW ) ); diff --git a/kita/src/part/kitathreadview.h b/kita/src/part/kitathreadview.h index a8f1768..35b9bf5 100644 --- a/kita/src/part/kitathreadview.h +++ b/kita/src/part/kitathreadview.h @@ -116,7 +116,6 @@ private: // Private attributes /* for config */ int m_preShowNum; - int m_afterShowNum; QString m_mailaddr; int m_maxpopup; bool m_online; diff --git a/kita/src/pref.cpp b/kita/src/pref.cpp index 08b742c..4ff7daa 100644 --- a/kita/src/pref.cpp +++ b/kita/src/pref.cpp @@ -241,12 +241,14 @@ UIPrefPage::UIPrefPage( QWidget* parent ) showMailCheckBox->setChecked( KitaConfig::showMailAddress() ); viewGroup->setButton( KitaConfig::viewMode() ); orderGroup->setButton( KitaConfig::sortOrder() ); + afterShowNumSpin->setValue( KitaConfig::afterShowNum() ); connect( useTabCheckBox, SIGNAL( clicked() ), SIGNAL( changed() ) ); connect( MarkTimespinBox, SIGNAL( valueChanged( int ) ), SIGNAL( changed() ) ); connect( showMailCheckBox, SIGNAL( clicked() ), SIGNAL( changed() ) ); connect( viewGroup, SIGNAL( clicked( int ) ), SIGNAL( changed() ) ); connect( orderGroup, SIGNAL( clicked( int ) ), SIGNAL( changed() ) ); + connect( afterShowNumSpin, SIGNAL( valueChanged( int ) ), SIGNAL( changed() ) ); } void UIPrefPage::apply() @@ -256,6 +258,7 @@ void UIPrefPage::apply() KitaConfig::setShowMailAddresss( showMailCheckBox->isChecked() ); KitaConfig::setViewMode( viewGroup->id( viewGroup->selected() ) ); KitaConfig::setSortOrder( orderGroup->id( orderGroup->selected() ) ); + KitaConfig::setAfterShowNum( afterShowNumSpin->value() ); } #include "pref.moc" diff --git a/kita/src/uiprefbase.ui b/kita/src/uiprefbase.ui index bfc5ced..0b64616 100644 --- a/kita/src/uiprefbase.ui +++ b/kita/src/uiprefbase.ui @@ -21,7 +21,7 @@ - layout5 + layout4 @@ -29,7 +29,7 @@ - layout4 + layout3 @@ -143,6 +143,53 @@ this option affects from the next thread. + + + afterShowNumSpin + + + + 11 + 71 + 105 + 19 + + + + Display + + + res + + + Display all res + + + 1000 + + + 50 + + + 100 + + + + + textLabel3 + + + + 122 + 71 + 144 + 19 + + + + from the last read response. + + @@ -256,7 +303,7 @@ - 285 + 279 31 @@ -276,7 +323,7 @@ 30 - 180 + 94 -- 2.11.0