From e6428d30a5dc90ed3ec6ca7e1cb3f92c81437cc0 Mon Sep 17 00:00:00 2001 From: mickeyl Date: Wed, 30 Apr 2003 18:50:47 +0000 Subject: - autoscrolling for hex- and logwindow - revamped statistics window --- (limited to 'noncore/net/wellenreiter/gui/statwindow.cpp') 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 @@ -14,32 +14,30 @@ **********************************************************************/ #include "statwindow.h" -#include +#include MStatWindow::MStatWindow( QWidget * parent, const char * name, WFlags f ) :QVBox( parent, name, f ) { - ledit = new QMultiLineEdit( this ); - ledit->setFont( QFont( "fixed", 10 ) ); - - // FIXME: Set properties( font, read-only, etc...) - + table = new OListView( this ); + table->addColumn( "Protocol" ); + table->addColumn( "Count" ); + table->setItemMargin( 2 ); }; -void MStatWindow::log( QString text ) -{ - - ledit->append( text ); - -}; - -const QString MStatWindow::getLog() const -{ - return ledit->text(); -} -void MStatWindow::clear() +void MStatWindow::updateCounter( const QString& protocol, int counter ) { - ledit->clear(); + QListViewItemIterator it( table ); + for ( ; it.current(); ++it ) + { + if ( it.current()->text( 0 ) == protocol ) + { + it.current()->setText( 1, QString::number( counter ) ); + return; + } + } + + new OListViewItem( table, protocol, QString::number( counter ) ); } -- cgit v0.9.0.2