Diffstat (limited to 'noncore/net/wellenreiter/gui/statwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/wellenreiter/gui/statwindow.cpp | 36 |
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 | |||
@@ -16,3 +16,3 @@ | |||
16 | #include "statwindow.h" | 16 | #include "statwindow.h" |
17 | #include <qmultilineedit.h> | 17 | #include <opie2/olistview.h> |
18 | 18 | ||
@@ -21,24 +21,22 @@ MStatWindow::MStatWindow( QWidget * parent, const char * name, WFlags 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 | ||
29 | void MStatWindow::log( QString text ) | ||
30 | { | ||
31 | |||
32 | ledit->append( text ); | ||
33 | |||
34 | }; | ||
35 | |||
36 | const QString MStatWindow::getLog() const | ||
37 | { | ||
38 | return ledit->text(); | ||
39 | } | ||
40 | 28 | ||
41 | void MStatWindow::clear() | 29 | void 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 | } |