OSDN Git Service

add preShowNum pref
authorikemo <ikemo@56b19765-1e22-0410-a548-a0f45d66c51a>
Sat, 3 Jul 2004 05:36:33 +0000 (05:36 +0000)
committerikemo <ikemo@56b19765-1e22-0410-a548-a0f45d66c51a>
Sat, 3 Jul 2004 05:36:33 +0000 (05:36 +0000)
git-svn-id: svn+ssh://svn.sourceforge.jp/svnroot/kita/kita/trunk@1218 56b19765-1e22-0410-a548-a0f45d66c51a

kita/src/kita.cpp
kita/src/libkita/kitaconfig.cpp
kita/src/libkita/kitaconfig.h
kita/src/part/kitahtmlpart.cpp
kita/src/pref.cpp
kita/src/uiprefbase.ui

index e08eeff..7583c76 100644 (file)
@@ -315,6 +315,7 @@ void KitaMainWindow::writeConfig( KConfig* config )
     config->writeEntry( "AlwaysUseTab", KitaConfig::alwaysUseTab() );
     config->writeEntry( "ShowAA", KitaConfig::showAA() );
     config->writeEntry( "AfterShowNum", KitaConfig::afterShowNum() );
+    config->writeEntry( "PreShowNum", KitaConfig::preShowNum() );
 
     config->setGroup( "Color" );
     config->writeEntry( "Popup", KitaConfig::popupColor() );
@@ -344,6 +345,7 @@ void KitaMainWindow::readConfig( KConfig* config )
     KitaConfig::setAlwaysUseTab( config->readBoolEntry( "AlwaysUseTab", false ) );
     KitaConfig::setShowAA( config->readBoolEntry( "ShowAA", false ) );
     KitaConfig::setAfterShowNum( config->readNumEntry( "AfterShowNum", 100 ) );
+    KitaConfig::setPreShowNum( config->readNumEntry( "PreShowNum", 50 ) );
 
     setFont( KitaConfig::font() );
 
index 0a1bcfe..3846ddf 100644 (file)
@@ -25,7 +25,7 @@ KitaConfig::KitaConfig()
         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_afterShowNum( 100 )
+        m_afterShowNum( 100 ), m_preShowNum( 50 )
 {}
 
 KitaConfig::~KitaConfig()
index 321fcd9..f6bccbf 100644 (file)
@@ -52,6 +52,7 @@ private:
     SortOrder m_sortOrder;
     bool m_showAA;
     int m_afterShowNum;
+    int m_preShowNum;
     
     KitaConfig();
     virtual ~KitaConfig();
@@ -100,6 +101,8 @@ public:
     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; }
+    static int preShowNum() { return getInstance() ->m_preShowNum; }
+    static void setPreShowNum( int value ) { getInstance() ->m_preShowNum = value; }
 };
 
 #endif
index 37e62da..0457ca9 100644 (file)
@@ -344,7 +344,8 @@ bool KitaHTMLPart::load( int centerNum ){
     
     /* config */
     
-    const int preShowNum = 50;
+    int preShowNum = KitaConfig::preShowNum();
+    if( preShowNum == 0 ) preShowNum = 5000;
     int afterShowNum = KitaConfig::afterShowNum();
     if( afterShowNum == 0 ) afterShowNum = 5000;  /* TODO: fix it. */
 
index 1e1e298..e4e17de 100644 (file)
@@ -253,6 +253,7 @@ UIPrefPage::UIPrefPage( QWidget* parent )
     viewGroup->setButton( KitaConfig::viewMode() );
     orderGroup->setButton( KitaConfig::sortOrder() );
     afterShowNumSpin->setValue( KitaConfig::afterShowNum() );
+    preShowNumSpin->setValue( KitaConfig::preShowNum() );
 
     connect( useTabCheckBox, SIGNAL( clicked() ), SIGNAL( changed() ) );
     connect( MarkTimespinBox, SIGNAL( valueChanged( int ) ), SIGNAL( changed() ) );
@@ -260,6 +261,7 @@ UIPrefPage::UIPrefPage( QWidget* parent )
     connect( viewGroup, SIGNAL( clicked( int ) ), SIGNAL( changed() ) );
     connect( orderGroup, SIGNAL( clicked( int ) ), SIGNAL( changed() ) );
     connect( afterShowNumSpin, SIGNAL( valueChanged( int ) ), SIGNAL( changed() ) );
+    connect( preShowNumSpin, SIGNAL( valueChanged( int ) ), SIGNAL( changed() ) );
 }
 
 void UIPrefPage::apply()
@@ -270,6 +272,7 @@ void UIPrefPage::apply()
     KitaConfig::setViewMode( viewGroup->id( viewGroup->selected() ) );
     KitaConfig::setSortOrder( orderGroup->id( orderGroup->selected() ) );
     KitaConfig::setAfterShowNum( afterShowNumSpin->value() );
+    KitaConfig::setPreShowNum( preShowNumSpin->value() );
 }
 
 #include "pref.moc"
index 5e71420..0d9ea57 100644 (file)
@@ -1,4 +1,4 @@
-<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
 <class>Kita::UIPrefBase</class>
 <widget class="QWidget">
     <property name="name">
         <property name="name">
             <cstring>unnamed</cstring>
         </property>
+        <widget class="QCheckBox">
+            <property name="name">
+                <cstring>useTabCheckBox</cstring>
+            </property>
+            <property name="text">
+                <string>Use new tab when opening the thread(board).</string>
+            </property>
+        </widget>
         <widget class="QLayoutWidget">
             <property name="name">
-                <cstring>layout3</cstring>
+                <cstring>layout2</cstring>
+            </property>
+            <hbox>
+                <property name="name">
+                    <cstring>unnamed</cstring>
+                </property>
+                <widget class="QLabel">
+                    <property name="name">
+                        <cstring>MarkLabel</cstring>
+                    </property>
+                    <property name="text">
+                        <string>Mark new thread to made:</string>
+                    </property>
+                </widget>
+                <spacer>
+                    <property name="name">
+                        <cstring>spacer6</cstring>
+                    </property>
+                    <property name="orientation">
+                        <enum>Horizontal</enum>
+                    </property>
+                    <property name="sizeType">
+                        <enum>Expanding</enum>
+                    </property>
+                    <property name="sizeHint">
+                        <size>
+                            <width>20</width>
+                            <height>20</height>
+                        </size>
+                    </property>
+                </spacer>
+                <widget class="QSpinBox">
+                    <property name="name">
+                        <cstring>MarkTimespinBox</cstring>
+                    </property>
+                    <property name="prefix">
+                        <string>within </string>
+                    </property>
+                    <property name="suffix">
+                        <string> hour</string>
+                    </property>
+                    <property name="specialValueText">
+                        <string>after last access</string>
+                    </property>
+                    <property name="maxValue">
+                        <number>24</number>
+                    </property>
+                    <property name="minValue">
+                        <number>0</number>
+                    </property>
+                    <property name="value">
+                        <number>24</number>
+                    </property>
+                    <property name="toolTip" stdset="0">
+                        <string></string>
+                    </property>
+                </widget>
+            </hbox>
+        </widget>
+        <widget class="QButtonGroup">
+            <property name="name">
+                <cstring>buttonGroup3</cstring>
+            </property>
+            <property name="title">
+                <string>Thread</string>
             </property>
             <vbox>
                 <property name="name">
                     <cstring>unnamed</cstring>
                 </property>
+                <widget class="QLabel">
+                    <property name="name">
+                        <cstring>textLabel1</cstring>
+                    </property>
+                    <property name="text">
+                        <string>this option affects from the next thread.</string>
+                    </property>
+                </widget>
                 <widget class="QCheckBox">
                     <property name="name">
-                        <cstring>useTabCheckBox</cstring>
+                        <cstring>showMailCheckBox</cstring>
                     </property>
                     <property name="text">
-                        <string>Use new tab when opening the thread(board).</string>
+                        <string>Show mail address in the thread.</string>
                     </property>
                 </widget>
                 <widget class="QLayoutWidget">
                     <property name="name">
-                        <cstring>layout2</cstring>
+                        <cstring>layout13_2</cstring>
                     </property>
                     <hbox>
                         <property name="name">
                             <cstring>unnamed</cstring>
                         </property>
+                        <widget class="QSpinBox">
+                            <property name="name">
+                                <cstring>preShowNumSpin</cstring>
+                            </property>
+                            <property name="prefix">
+                                <string>Display </string>
+                            </property>
+                            <property name="suffix">
+                                <string> res</string>
+                            </property>
+                            <property name="specialValueText">
+                                <string>Display all res</string>
+                            </property>
+                            <property name="wrapping">
+                                <bool>true</bool>
+                            </property>
+                            <property name="maxValue">
+                                <number>1000</number>
+                            </property>
+                            <property name="lineStep">
+                                <number>50</number>
+                            </property>
+                            <property name="value">
+                                <number>100</number>
+                            </property>
+                        </widget>
                         <widget class="QLabel">
                             <property name="name">
-                                <cstring>MarkLabel</cstring>
+                                <cstring>textLabel3_2</cstring>
                             </property>
                             <property name="text">
-                                <string>Mark new thread to made:</string>
+                                <string>before the last read response.</string>
                             </property>
                         </widget>
                         <spacer>
                             <property name="name">
-                                <cstring>spacer6</cstring>
+                                <cstring>spacer11_2_2</cstring>
                             </property>
                             <property name="orientation">
                                 <enum>Horizontal</enum>
                             </property>
                             <property name="sizeHint">
                                 <size>
-                                    <width>20</width>
+                                    <width>40</width>
                                     <height>20</height>
                                 </size>
                             </property>
                         </spacer>
+                    </hbox>
+                </widget>
+                <widget class="QLayoutWidget">
+                    <property name="name">
+                        <cstring>layout13</cstring>
+                    </property>
+                    <hbox>
+                        <property name="name">
+                            <cstring>unnamed</cstring>
+                        </property>
                         <widget class="QSpinBox">
                             <property name="name">
-                                <cstring>MarkTimespinBox</cstring>
+                                <cstring>afterShowNumSpin</cstring>
                             </property>
                             <property name="prefix">
-                                <string>within </string>
+                                <string>Display </string>
                             </property>
                             <property name="suffix">
-                                <string> hour</string>
+                                <string> res</string>
                             </property>
                             <property name="specialValueText">
-                                <string>after last access</string>
+                                <string>Display all res</string>
+                            </property>
+                            <property name="wrapping">
+                                <bool>true</bool>
                             </property>
                             <property name="maxValue">
-                                <number>24</number>
+                                <number>1000</number>
                             </property>
-                            <property name="minValue">
-                                <number>0</number>
+                            <property name="lineStep">
+                                <number>50</number>
                             </property>
                             <property name="value">
-                                <number>24</number>
-                            </property>
-                            <property name="toolTip" stdset="0">
-                                <string></string>
+                                <number>100</number>
                             </property>
                         </widget>
-                    </hbox>
-                </widget>
-                <widget class="QButtonGroup">
-                    <property name="name">
-                        <cstring>buttonGroup3</cstring>
-                    </property>
-                    <property name="title">
-                        <string>Thread</string>
-                    </property>
-                    <vbox>
-                        <property name="name">
-                            <cstring>unnamed</cstring>
-                        </property>
                         <widget class="QLabel">
                             <property name="name">
-                                <cstring>textLabel1</cstring>
+                                <cstring>textLabel3</cstring>
                             </property>
                             <property name="text">
-                                <string>this option affects from the next thread.</string>
+                                <string>from the last read response.</string>
                             </property>
                         </widget>
-                        <widget class="QCheckBox">
+                        <spacer>
                             <property name="name">
-                                <cstring>showMailCheckBox</cstring>
+                                <cstring>spacer11_2</cstring>
                             </property>
-                            <property name="text">
-                                <string>Show mail address in the thread.</string>
+                            <property name="orientation">
+                                <enum>Horizontal</enum>
                             </property>
-                        </widget>
-                        <widget class="QLayoutWidget">
-                            <property name="name">
-                                <cstring>layout13</cstring>
+                            <property name="sizeType">
+                                <enum>Expanding</enum>
                             </property>
-                            <hbox>
-                                <property name="name">
-                                    <cstring>unnamed</cstring>
-                                </property>
-                                <widget class="QSpinBox">
-                                    <property name="name">
-                                        <cstring>afterShowNumSpin</cstring>
-                                    </property>
-                                    <property name="prefix">
-                                        <string>Display </string>
-                                    </property>
-                                    <property name="suffix">
-                                        <string> res</string>
-                                    </property>
-                                    <property name="specialValueText">
-                                        <string>Display all res</string>
-                                    </property>
-                                    <property name="maxValue">
-                                        <number>1000</number>
-                                    </property>
-                                    <property name="lineStep">
-                                        <number>50</number>
-                                    </property>
-                                    <property name="value">
-                                        <number>100</number>
-                                    </property>
-                                </widget>
-                                <widget class="QLabel">
-                                    <property name="name">
-                                        <cstring>textLabel3</cstring>
-                                    </property>
-                                    <property name="text">
-                                        <string>from the last read response.</string>
-                                    </property>
-                                </widget>
-                                <spacer>
-                                    <property name="name">
-                                        <cstring>spacer11_2</cstring>
-                                    </property>
-                                    <property name="orientation">
-                                        <enum>Horizontal</enum>
-                                    </property>
-                                    <property name="sizeType">
-                                        <enum>Expanding</enum>
-                                    </property>
-                                    <property name="sizeHint">
-                                        <size>
-                                            <width>40</width>
-                                            <height>20</height>
-                                        </size>
-                                    </property>
-                                </spacer>
-                            </hbox>
-                        </widget>
-                    </vbox>
+                            <property name="sizeHint">
+                                <size>
+                                    <width>293</width>
+                                    <height>20</height>
+                                </size>
+                            </property>
+                        </spacer>
+                    </hbox>
                 </widget>
-                <widget class="QButtonGroup">
+            </vbox>
+        </widget>
+        <widget class="QButtonGroup">
+            <property name="name">
+                <cstring>viewGroup</cstring>
+            </property>
+            <property name="title">
+                <string>Views</string>
+            </property>
+            <vbox>
+                <property name="name">
+                    <cstring>unnamed</cstring>
+                </property>
+                <widget class="QRadioButton">
                     <property name="name">
-                        <cstring>viewGroup</cstring>
+                        <cstring>twoPaneRadio</cstring>
                     </property>
-                    <property name="title">
-                        <string>Views</string>
+                    <property name="text">
+                        <string>(pseudo) Two pane</string>
+                    </property>
+                    <property name="checked">
+                        <bool>true</bool>
+                    </property>
+                    <property name="buttonGroupId">
+                        <number>0</number>
                     </property>
-                    <vbox>
-                        <property name="name">
-                            <cstring>unnamed</cstring>
-                        </property>
-                        <widget class="QRadioButton">
-                            <property name="name">
-                                <cstring>twoPaneRadio</cstring>
-                            </property>
-                            <property name="text">
-                                <string>(pseudo) Two pane</string>
-                            </property>
-                            <property name="checked">
-                                <bool>true</bool>
-                            </property>
-                            <property name="buttonGroupId">
-                                <number>0</number>
-                            </property>
-                        </widget>
-                        <widget class="QRadioButton">
-                            <property name="name">
-                                <cstring>threePaneRadio</cstring>
-                            </property>
-                            <property name="text">
-                                <string>Three pane</string>
-                            </property>
-                            <property name="buttonGroupId">
-                                <number>1</number>
-                            </property>
-                        </widget>
-                    </vbox>
                 </widget>
-                <widget class="QButtonGroup">
+                <widget class="QRadioButton">
                     <property name="name">
-                        <cstring>orderGroup</cstring>
+                        <cstring>threePaneRadio</cstring>
                     </property>
-                    <property name="title">
-                        <string>When open the board</string>
+                    <property name="text">
+                        <string>Three pane</string>
+                    </property>
+                    <property name="buttonGroupId">
+                        <number>1</number>
+                    </property>
+                </widget>
+            </vbox>
+        </widget>
+        <widget class="QButtonGroup">
+            <property name="name">
+                <cstring>orderGroup</cstring>
+            </property>
+            <property name="title">
+                <string>When open the board</string>
+            </property>
+            <vbox>
+                <property name="name">
+                    <cstring>unnamed</cstring>
+                </property>
+                <widget class="QRadioButton">
+                    <property name="name">
+                        <cstring>unreadFirstRadio</cstring>
+                    </property>
+                    <property name="text">
+                        <string>Show unread thread first</string>
+                    </property>
+                    <property name="checked">
+                        <bool>true</bool>
+                    </property>
+                    <property name="buttonGroupId">
+                        <number>0</number>
+                    </property>
+                </widget>
+                <widget class="QRadioButton">
+                    <property name="name">
+                        <cstring>numOrderRadio</cstring>
+                    </property>
+                    <property name="text">
+                        <string>Show thread in numerical order</string>
+                    </property>
+                    <property name="buttonGroupId">
+                        <number>1</number>
                     </property>
-                    <vbox>
-                        <property name="name">
-                            <cstring>unnamed</cstring>
-                        </property>
-                        <widget class="QRadioButton">
-                            <property name="name">
-                                <cstring>unreadFirstRadio</cstring>
-                            </property>
-                            <property name="text">
-                                <string>Show unread thread first</string>
-                            </property>
-                            <property name="checked">
-                                <bool>true</bool>
-                            </property>
-                            <property name="buttonGroupId">
-                                <number>0</number>
-                            </property>
-                        </widget>
-                        <widget class="QRadioButton">
-                            <property name="name">
-                                <cstring>numOrderRadio</cstring>
-                            </property>
-                            <property name="text">
-                                <string>Show thread in numerical order</string>
-                            </property>
-                            <property name="buttonGroupId">
-                                <number>1</number>
-                            </property>
-                        </widget>
-                    </vbox>
                 </widget>
             </vbox>
         </widget>