summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings2/opietooth2/Opietooth.cpp
Unidiff
Diffstat (limited to 'noncore/settings/networksettings2/opietooth2/Opietooth.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings2/opietooth2/Opietooth.cpp46
1 files changed, 31 insertions, 15 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;
23#include <qpushbutton.h> 23#include <qpushbutton.h>
24#include <qscrollbar.h>
24#include <qtextstream.h> 25#include <qtextstream.h>
26#include <qtextview.h>
25 27
@@ -122,3 +124,2 @@ OTSniffing::OTSniffing( QWidget * parent ) : OTSniffGUI( parent ) {
122 HciDump = 0; 124 HciDump = 0;
123 Sys = new System();
124} 125}
@@ -126,11 +127,16 @@ OTSniffing::OTSniffing( QWidget * parent ) : OTSniffGUI( parent ) {
126OTSniffing::~OTSniffing() { 127OTSniffing::~OTSniffing() {
127 printf( "CLOSE \n" ); 128 SLOT_Trace( 0 );
128 if ( HciDump ) {
129 HciDump->process().kill();
130 delete HciDump;
131 }
132 delete Sys;
133} 129}
134 130
135void OTSniffing::SLOT_Trace( bool ) { 131void OTSniffing::SLOT_Trace( bool Run ) {
132
133 if( ! Run ) {
134 if ( HciDump ) {
135 HciDump->process().kill();
136 delete HciDump;
137 }
138 HciDump = 0;
139 return;
140 }
141
136 HciDump = new MyProcess(); 142 HciDump = new MyProcess();
@@ -138,3 +144,3 @@ void OTSniffing::SLOT_Trace( bool ) {
138 144
139 SL << "hcidump"; 145 SL << "/usr/sbin/hcidump";
140 switch( DataFormat_CB->currentItem() ) { 146 switch( DataFormat_CB->currentItem() ) {
@@ -164,3 +170,7 @@ void OTSniffing::SLOT_Trace( bool ) {
164 170
165 if( ! Sys->runAsRoot( SL, HciDump ) ) { 171 HciDump->process() << SL;
172
173 if( ! HciDump->process().start( OProcess::DontCare,
174 OProcess::AllOutput )
175 ) {
166 QMessageBox::warning(0, 176 QMessageBox::warning(0,
@@ -177,5 +187,9 @@ void OTSniffing::SLOT_Show( const QString & S ) {
177 printf( "%s\n", S.latin1() ); 187 printf( "%s\n", S.latin1() );
178 Output_LB->insertItem( S ); 188 Output_TV->setText( Output_TV->text() + S + "\n" );
179 Output_LB->setCurrentItem( Output_LB->count()-1 ); 189
180 Output_LB->ensureCurrentVisible(); 190 QScrollBar *scroll = Output_TV->verticalScrollBar();
191 scroll->setValue(scroll->maxValue());
192 //Output_LB->insertItem( S );
193 //Output_LB->setCurrentItem( Output_LB->count()-1 );
194 //Output_LB->ensureCurrentVisible();
181} 195}
@@ -230,3 +244,4 @@ void OTSniffing::SLOT_Load( void ) {
230 S = TS.read(); 244 S = TS.read();
231 Output_LB->insertStringList( QStringList::split( "\n", S ) ); 245 // Output_LB->insertStringList( QStringList::split( "\n", S ) );
246 Output_TV->setText( S );
232 } 247 }
@@ -235,3 +250,4 @@ void OTSniffing::SLOT_Load( void ) {
235void OTSniffing::SLOT_ClearLog( void ) { 250void OTSniffing::SLOT_ClearLog( void ) {
236 Output_LB->clear(); 251 // Output_LB->clear();
252 Output_TV->setText( "" );
237} 253}