[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    extragear/network/ktorrent
From:       Joris Guisson <joris.guisson () gmail ! com>
Date:       2010-08-25 18:56:44
Message-ID: 20100825185644.503C5AC857 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1167948 by guisson:

Add option to configure the number of log lines shown in the logviewer

BUG: 223887

 M  +1 -0      ChangeLog  
 M  +5 -0      plugins/logviewer/ktlogviewerplugin.kcfg  
 M  +47 -12    plugins/logviewer/logprefwidget.ui  
 M  +6 -0      plugins/logviewer/logviewer.cpp  
 M  +1 -0      plugins/logviewer/logviewer.h  
 M  +1 -0      plugins/logviewer/logviewerplugin.cpp  


--- trunk/extragear/network/ktorrent/ChangeLog #1167947:1167948
@@ -17,6 +17,7 @@
 - Make file view of FileSelectDlg sortable (248090)
 - Clicking item in day list of AddItemDlg of bwscheduler plugin now toggles it \
                (225953)
 - Add support for emule blocklists (194915)
+- Add option to configure the number of log lines shown in the logviewer (223887)
 
 Changes in 4.0.3:
 - Fix bug causing wrong encoding to be used when the default save location of a \
                group is read (244873)
--- trunk/extragear/network/ktorrent/plugins/logviewer/ktlogviewerplugin.kcfg \
#1167947:1167948 @@ -17,5 +17,10 @@
 			<min>0</min>
 			<max>2</max>
 		</entry>
+		<entry name="maxBlockCount" type="Int">
+			<default>200</default>
+			<min>50</min>
+			<max>500000</max>
+		</entry>
 	</group>
 </kcfg>
--- trunk/extragear/network/ktorrent/plugins/logviewer/logprefwidget.ui \
#1167947:1167948 @@ -1,3 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
 <ui version="4.0" >
  <class>LogPrefWidget</class>
  <widget class="QWidget" name="LogPrefWidget" >
@@ -6,24 +7,24 @@
     <x>0</x>
     <y>0</y>
     <width>456</width>
-    <height>394</height>
+    <height>421</height>
    </rect>
   </property>
   <layout class="QVBoxLayout" name="verticalLayout_2" >
    <item>
     <widget class="QTreeView" name="m_logging_flags" >
      <property name="toolTip" >
-      <string>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" \
                "http://www.w3.org/TR/REC-html40/strict.dtd">
-&lt;html>&lt;head>&lt;meta name="qrichtext" content="1" />&lt;style type="text/css">
+      <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; \
&quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt; \
+&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; \
/&gt;&lt;style type=&quot;text/css&quot;&gt;  p, li { white-space: pre-wrap; }
-&lt;/style>&lt;/head>&lt;body style=" font-family:'Bitstream Vera Sans'; \
                font-size:8pt; font-weight:400; font-style:normal;">
-&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
-qt-block-indent:0; text-indent:0px;">Double click on the log level to alter it. The \
                possible levels are :&lt;/p>
-&lt;p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; \
                margin-left:0px; margin-right:0px; -qt-block-indent:0; \
                text-indent:0px;">&lt;/p>
-&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
-qt-block-indent:0; text-indent:0px;">&lt;span style=" font-weight:600;">All: \
                &lt;/span>All messages are shown&lt;/p>
-&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
-qt-block-indent:0; text-indent:0px;">&lt;span style=" font-weight:600;">Important: \
                &lt;/span>Only important messages are shown&lt;/p>
-&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
-qt-block-indent:0; text-indent:0px;">&lt;span style=" font-weight:600;">Notice: \
                &lt;/span>Only notice and important messages are shown&lt;/p>
-&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
-qt-block-indent:0; text-indent:0px;">&lt;span style=" font-weight:600;">Debug: \
                &lt;/span>Debug, notice and important messages are shown&lt;/p>
-&lt;p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
-qt-block-indent:0; text-indent:0px;">&lt;span style=" \
font-weight:600;">None:&lt;/span> No messages are \
shown&lt;/p>&lt;/body>&lt;/html></string> +&lt;/style&gt;&lt;/head&gt;&lt;body \
style=&quot; font-family:'Bitstream Vera Sans'; font-size:8pt; font-weight:400; \
font-style:normal;&quot;&gt; +&lt;p style=&quot; margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; \
text-indent:0px;&quot;&gt;Double click on the log level to alter it. The possible \
levels are :&lt;/p&gt; +&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; \
margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; \
text-indent:0px;&quot;&gt;&lt;/p&gt; +&lt;p style=&quot; margin-top:0px; \
margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; \
text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;All: \
&lt;/span&gt;All messages are shown&lt;/p&gt; +&lt;p style=&quot; margin-top:0px; \
margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; \
text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Important: \
&lt;/span&gt;Only important messages are shown&lt;/p&gt; +&lt;p style=&quot; \
margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
-qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; \
font-weight:600;&quot;&gt;Notice: &lt;/span&gt;Only notice and important messages are \
shown&lt;/p&gt; +&lt;p style=&quot; margin-top:0px; margin-bottom:0px; \
margin-left:0px; margin-right:0px; -qt-block-indent:0; \
text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;Debug: \
&lt;/span&gt;Debug, notice and important messages are shown&lt;/p&gt; +&lt;p \
style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; \
-qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; \
font-weight:600;&quot;&gt;None:&lt;/span&gt; No messages are \
shown&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>  </property>
      <property name="alternatingRowColors" >
       <bool>true</bool>
@@ -61,7 +62,7 @@
         <item>
          <widget class="QComboBox" name="kcfg_logWidgetPosition" >
           <property name="sizePolicy" >
-           <sizepolicy vsizetype="Fixed" hsizetype="Preferred" >
+           <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
             <horstretch>0</horstretch>
             <verstretch>0</verstretch>
            </sizepolicy>
@@ -98,11 +99,45 @@
         </item>
        </layout>
       </item>
+      <item>
+       <layout class="QHBoxLayout" name="horizontalLayout_2">
+        <item>
+         <widget class="QLabel" name="label_2">
+          <property name="text">
+           <string>Maximum nuber of visible lines:</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="KIntSpinBox" name="kcfg_maxBlockCount"/>
+        </item>
+        <item>
+         <spacer name="horizontalSpacer_2">
+          <property name="orientation">
+           <enum>Qt::Horizontal</enum>
+          </property>
+          <property name="sizeHint" stdset="0">
+           <size>
+            <width>40</width>
+            <height>20</height>
+           </size>
+          </property>
+         </spacer>
+        </item>
      </layout>
+      </item>
+     </layout>
     </widget>
    </item>
   </layout>
  </widget>
+ <customwidgets>
+  <customwidget>
+   <class>KIntSpinBox</class>
+   <extends>QSpinBox</extends>
+   <header>knuminput.h</header>
+  </customwidget>
+ </customwidgets>
  <resources/>
  <connections/>
 </ui>
--- trunk/extragear/network/ktorrent/plugins/logviewer/logviewer.cpp #1167947:1167948
@@ -111,6 +111,12 @@
 		use_rich_text = val;
 	}
 		
+	void LogViewer::setMaxBlockCount(int max)
+	{
+		output->document()->setMaximumBlockCount(max);
+	}
+
+		
 	void LogViewer::showMenu(const QPoint& pos)
 	{
 		if (!menu)
--- trunk/extragear/network/ktorrent/plugins/logviewer/logviewer.h #1167947:1167948
@@ -41,6 +41,7 @@
 		virtual void customEvent(QEvent* ev);
 		
 		void setRichText(bool val);
+		void setMaxBlockCount(int max);
 		
 	public slots:
 		void showMenu(const QPoint & pos);
--- trunk/extragear/network/ktorrent/plugins/logviewer/logviewerplugin.cpp \
#1167947:1167948 @@ -89,6 +89,7 @@
 	void LogViewerPlugin::applySettings()
 	{
 		lv->setRichText(LogViewerPluginSettings::useRichText());
+		lv->setMaxBlockCount(LogViewerPluginSettings::maxBlockCount());
 		LogViewerPosition p = \
(LogViewerPosition)LogViewerPluginSettings::logWidgetPosition();  if (pos != p)
 		{


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic