summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings2/opietooth2/Opietooth.cpp
Side-by-side diff
Diffstat (limited to 'noncore/settings/networksettings2/opietooth2/Opietooth.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/networksettings2/opietooth2/Opietooth.cpp38
1 files changed, 27 insertions, 11 deletions
diff --git a/noncore/settings/networksettings2/opietooth2/Opietooth.cpp b/noncore/settings/networksettings2/opietooth2/Opietooth.cpp
index 5a890da..b14cc2f 100644
--- a/noncore/settings/networksettings2/opietooth2/Opietooth.cpp
+++ b/noncore/settings/networksettings2/opietooth2/Opietooth.cpp
@@ -23,3 +23,5 @@ using namespace Opie::Ui;
#include <qpushbutton.h>
+#include <qscrollbar.h>
#include <qtextstream.h>
+#include <qtextview.h>
@@ -122,3 +124,2 @@ OTSniffing::OTSniffing( QWidget * parent ) : OTSniffGUI( parent ) {
HciDump = 0;
- Sys = new System();
}
@@ -126,3 +127,8 @@ OTSniffing::OTSniffing( QWidget * parent ) : OTSniffGUI( parent ) {
OTSniffing::~OTSniffing() {
- printf( "CLOSE \n" );
+ SLOT_Trace( 0 );
+}
+
+void OTSniffing::SLOT_Trace( bool Run ) {
+
+ if( ! Run ) {
if ( HciDump ) {
@@ -131,6 +137,6 @@ OTSniffing::~OTSniffing() {
}
- delete Sys;
+ HciDump = 0;
+ return;
}
-void OTSniffing::SLOT_Trace( bool ) {
HciDump = new MyProcess();
@@ -138,3 +144,3 @@ void OTSniffing::SLOT_Trace( bool ) {
- SL << "hcidump";
+ SL << "/usr/sbin/hcidump";
switch( DataFormat_CB->currentItem() ) {
@@ -164,3 +170,7 @@ void OTSniffing::SLOT_Trace( bool ) {
- if( ! Sys->runAsRoot( SL, HciDump ) ) {
+ HciDump->process() << SL;
+
+ if( ! HciDump->process().start( OProcess::DontCare,
+ OProcess::AllOutput )
+ ) {
QMessageBox::warning(0,
@@ -177,5 +187,9 @@ void OTSniffing::SLOT_Show( const QString & S ) {
printf( "%s\n", S.latin1() );
- Output_LB->insertItem( S );
- Output_LB->setCurrentItem( Output_LB->count()-1 );
- Output_LB->ensureCurrentVisible();
+ Output_TV->setText( Output_TV->text() + S + "\n" );
+
+ QScrollBar *scroll = Output_TV->verticalScrollBar();
+ scroll->setValue(scroll->maxValue());
+ //Output_LB->insertItem( S );
+ //Output_LB->setCurrentItem( Output_LB->count()-1 );
+ //Output_LB->ensureCurrentVisible();
}
@@ -230,3 +244,4 @@ void OTSniffing::SLOT_Load( void ) {
S = TS.read();
- Output_LB->insertStringList( QStringList::split( "\n", S ) );
+ // Output_LB->insertStringList( QStringList::split( "\n", S ) );
+ Output_TV->setText( S );
}
@@ -235,3 +250,4 @@ void OTSniffing::SLOT_Load( void ) {
void OTSniffing::SLOT_ClearLog( void ) {
- Output_LB->clear();
+ // Output_LB->clear();
+ Output_TV->setText( "" );
}