summaryrefslogtreecommitdiff
path: root/noncore/net/wellenreiter/gui/statwindow.cpp
Unidiff
Diffstat (limited to 'noncore/net/wellenreiter/gui/statwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/wellenreiter/gui/statwindow.cpp36
1 files changed, 17 insertions, 19 deletions
diff --git a/noncore/net/wellenreiter/gui/statwindow.cpp b/noncore/net/wellenreiter/gui/statwindow.cpp
index 07d34ef..2c8c774 100644
--- a/noncore/net/wellenreiter/gui/statwindow.cpp
+++ b/noncore/net/wellenreiter/gui/statwindow.cpp
@@ -11,35 +11,33 @@
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14**********************************************************************/ 14**********************************************************************/
15 15
16#include "statwindow.h" 16#include "statwindow.h"
17#include <qmultilineedit.h> 17#include <opie2/olistview.h>
18 18
19MStatWindow::MStatWindow( QWidget * parent, const char * name, WFlags f ) 19MStatWindow::MStatWindow( QWidget * parent, const char * name, WFlags f )
20 :QVBox( parent, name, f ) 20 :QVBox( parent, name, f )
21{ 21{
22 ledit = new QMultiLineEdit( this ); 22 table = new OListView( this );
23 ledit->setFont( QFont( "fixed", 10 ) ); 23 table->addColumn( "Protocol" );
24 24 table->addColumn( "Count" );
25 // FIXME: Set properties( font, read-only, etc...) 25 table->setItemMargin( 2 );
26
27}; 26};
28 27
29void MStatWindow::log( QString text )
30{
31
32 ledit->append( text );
33
34};
35
36const QString MStatWindow::getLog() const
37{
38 return ledit->text();
39}
40 28
41void MStatWindow::clear() 29void MStatWindow::updateCounter( const QString& protocol, int counter )
42{ 30{
43 ledit->clear(); 31 QListViewItemIterator it( table );
32 for ( ; it.current(); ++it )
33 {
34 if ( it.current()->text( 0 ) == protocol )
35 {
36 it.current()->setText( 1, QString::number( counter ) );
37 return;
38 }
39 }
40
41 new OListViewItem( table, protocol, QString::number( counter ) );
44} 42}
45 43