summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/wellenreiter/README4
-rw-r--r--noncore/net/wellenreiter/gui/hexwindow.cpp13
-rw-r--r--noncore/net/wellenreiter/gui/hexwindow.h6
-rw-r--r--noncore/net/wellenreiter/gui/logwindow.cpp15
-rw-r--r--noncore/net/wellenreiter/gui/statwindow.cpp36
-rw-r--r--noncore/net/wellenreiter/gui/statwindow.h11
-rw-r--r--noncore/net/wellenreiter/gui/wellenreiter.cpp18
-rwxr-xr-xnoncore/net/wellenreiter/makedist.sh2
8 files changed, 47 insertions, 58 deletions
diff --git a/noncore/net/wellenreiter/README b/noncore/net/wellenreiter/README
index 291f1fe..ec621b9 100644
--- a/noncore/net/wellenreiter/README
+++ b/noncore/net/wellenreiter/README
@@ -4,3 +4,3 @@
/*
-/* Version: ALPHA-2-April
+/* Version: April BETA
/************************************************************************
@@ -8,3 +8,3 @@
----------------------------------------------------
-Release Notes for Opie-ALPHA Version April 2003
+Release Notes for Opie-Wellenreiter Version BETA April 2003
----------------------------------------------------
diff --git a/noncore/net/wellenreiter/gui/hexwindow.cpp b/noncore/net/wellenreiter/gui/hexwindow.cpp
index 8b17285..2f011ca 100644
--- a/noncore/net/wellenreiter/gui/hexwindow.cpp
+++ b/noncore/net/wellenreiter/gui/hexwindow.cpp
@@ -23,12 +23,11 @@ MHexWindow::MHexWindow( QWidget * parent, const char * name, WFlags f )
ledit->setFont( QFont( "fixed", 10 ) );
-
- // FIXME: Set properties( font, read-only, etc...)
-
+ ledit->setReadOnly( true );
};
-void MHexWindow::log( QString text )
+void MHexWindow::log( const QString& text )
{
-
- ledit->append( text );
-
+ int col;
+ int row;
+ ledit->getCursorPosition( &col, &row );
+ ledit->insertAt( text, col, row );
};
diff --git a/noncore/net/wellenreiter/gui/hexwindow.h b/noncore/net/wellenreiter/gui/hexwindow.h
index f2f870c..3d4ec0f 100644
--- a/noncore/net/wellenreiter/gui/hexwindow.h
+++ b/noncore/net/wellenreiter/gui/hexwindow.h
@@ -28,7 +28,7 @@ class MHexWindow: public QVBox
MHexWindow( QWidget * parent = 0, const char * name = "MHexWindow", WFlags f = 0 );
-
- void log( QString text );
+
+ void log( const QString& text );
const QString getLog() const;
void clear();
-
+
protected:
diff --git a/noncore/net/wellenreiter/gui/logwindow.cpp b/noncore/net/wellenreiter/gui/logwindow.cpp
index 55e2ccb..12f74fd 100644
--- a/noncore/net/wellenreiter/gui/logwindow.cpp
+++ b/noncore/net/wellenreiter/gui/logwindow.cpp
@@ -23,7 +23,6 @@ MLogWindow::MLogWindow( QWidget * parent, const char * name, WFlags f )
ledit = new QMultiLineEdit( this );
-
- // FIXME: Set properties( font, read-only, etc...)
-
+ ledit->setReadOnly( true );
}
+
void MLogWindow::log( QString text )
@@ -32,8 +31,11 @@ void MLogWindow::log( QString text )
QString line;
- line.sprintf( "[%s] %s", (const char*) time.toString(), (const char*) text );
- ledit->append( line );
+ line.sprintf( "[%s] %s\n", (const char*) time.toString(), (const char*) text );
+ int col;
+ int row;
+ ledit->getCursorPosition( &col, &row );
+ ledit->insertAt( line, col, row );
qDebug( line );
-
}
+
void MLogWindow::clear()
@@ -43,2 +45,3 @@ void MLogWindow::clear()
+
const QString MLogWindow::getLog() const
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 @@
#include "statwindow.h"
-#include <qmultilineedit.h>
+#include <opie2/olistview.h>
@@ -21,24 +21,22 @@ MStatWindow::MStatWindow( QWidget * parent, const char * name, WFlags 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 ) );
}
diff --git a/noncore/net/wellenreiter/gui/statwindow.h b/noncore/net/wellenreiter/gui/statwindow.h
index bbdf777..0ab4b50 100644
--- a/noncore/net/wellenreiter/gui/statwindow.h
+++ b/noncore/net/wellenreiter/gui/statwindow.h
@@ -21,3 +21,3 @@
class QString;
-class QMultiLineEdit;
+class OListView;
@@ -25,2 +25,3 @@ class MStatWindow: public QVBox
{
+ Q_OBJECT
@@ -28,3 +29,3 @@ class MStatWindow: public QVBox
MStatWindow( QWidget * parent = 0, const char * name = "MStatWindow", WFlags f = 0 );
-
+
void log( QString text );
@@ -32,5 +33,7 @@ class MStatWindow: public QVBox
void clear();
-
+
+ void updateCounter( const QString&, int );
+
protected:
- QMultiLineEdit* ledit;
+ OListView* table;
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.cpp b/noncore/net/wellenreiter/gui/wellenreiter.cpp
index 0105e09..5ec9ee4 100644
--- a/noncore/net/wellenreiter/gui/wellenreiter.cpp
+++ b/noncore/net/wellenreiter/gui/wellenreiter.cpp
@@ -34,2 +34,3 @@ using namespace Opie;
#include <qcombobox.h>
+#include <qdatetime.h>
#include <qpushbutton.h>
@@ -259,19 +260,4 @@ void Wellenreiter::stopClicked()
// print out statistics
- statwindow->log( "-----------------------------------------" );
- statwindow->log( "- Wellenreiter II Capturing Statistic -" );
- statwindow->log( "-----------------------------------------" );
- statwindow->log( "Packet Type | Receive Count" );
-
for( QMap<QString,int>::ConstIterator it = pcap->statistics().begin(); it != pcap->statistics().end(); ++it )
- {
- QString left;
- left.sprintf( "%s", (const char*) it.key() );
- left = left.leftJustify( 20 );
- left.append( '|' );
- QString right;
- right.sprintf( "%d", it.data() );
- right = right.rightJustify( 7 );
- statwindow->log( left + right );
- }
-
+ statwindow->updateCounter( it.key(), it.data() );
}
diff --git a/noncore/net/wellenreiter/makedist.sh b/noncore/net/wellenreiter/makedist.sh
index 1795ae5..cfb0b16 100755
--- a/noncore/net/wellenreiter/makedist.sh
+++ b/noncore/net/wellenreiter/makedist.sh
@@ -1,2 +1,2 @@
-VERSION=2-alpha2
+VERSION=2-beta