00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #include "statwindow.h"
00017 #include <opie2/olistview.h>
00018
00019 using namespace Opie::Ui;
00020 using namespace Opie::Ui;
00021 using namespace Opie::Ui;
00022 MStatWindow::MStatWindow( QWidget * parent, const char * name, WFlags f )
00023 :QVBox( parent, name, f )
00024 {
00025 table = new OListView( this );
00026 table->addColumn( tr( "Protocol" ) );
00027 table->addColumn( tr( "Count" ) );
00028 table->setItemMargin( 2 );
00029 };
00030
00031
00032 void MStatWindow::updateCounter( const QString& protocol, int counter )
00033 {
00034 QListViewItemIterator it( table );
00035 for ( ; it.current(); ++it )
00036 {
00037 if ( it.current()->text( 0 ) == protocol )
00038 {
00039 it.current()->setText( 1, QString::number( counter ) );
00040 return;
00041 }
00042 }
00043
00044 new OListViewItem( table, protocol, QString::number( counter ) );
00045 }
00046