summaryrefslogtreecommitdiff
authorharlekin <harlekin>2003-02-16 10:04:28 (UTC)
committer harlekin <harlekin>2003-02-16 10:04:28 (UTC)
commitfb16f3317916704eca14d35271d48130bfa78c6c (patch) (side-by-side diff)
tree2a68df6a2938466c6d8e7e446730c5794bd61a8d
parentf1737ebd1afc35528c2452f6a281039c39a28f1f (diff)
downloadopie-fb16f3317916704eca14d35271d48130bfa78c6c.zip
opie-fb16f3317916704eca14d35271d48130bfa78c6c.tar.gz
opie-fb16f3317916704eca14d35271d48130bfa78c6c.tar.bz2
cleaned the scandialog
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/net/opietooth/manager/scandialog.cpp47
-rw-r--r--noncore/net/opietooth/manager/scandialog.h7
2 files changed, 10 insertions, 44 deletions
diff --git a/noncore/net/opietooth/manager/scandialog.cpp b/noncore/net/opietooth/manager/scandialog.cpp
index 9ce1b6a..de4f742 100644
--- a/noncore/net/opietooth/manager/scandialog.cpp
+++ b/noncore/net/opietooth/manager/scandialog.cpp
@@ -18,9 +18,7 @@
#include "scandialog.h"
-#include <qframe.h>
#include <qheader.h>
-#include <qlabel.h>
#include <qlistview.h>
#include <qpushbutton.h>
#include <qlayout.h>
@@ -34,47 +32,28 @@
#include <device.h>
-
namespace OpieTooth {
#include <remotedevice.h>
-/*
+/**
*/
ScanDialog::ScanDialog( QWidget* parent, const char* name, bool modal, WFlags fl )
: QDialog( parent, name, modal, fl ) {
- if ( !name )
- setName( "ScanDialog" );
- resize( 240, 320 );
setCaption( tr( "Scan for devices" ) );
- Frame7 = new QFrame( this, "Frame7" );
- Frame7->setGeometry( QRect( 0, 0, 240, 331 ) );
- Frame7->setFrameShape( QFrame::StyledPanel );
- Frame7->setFrameShadow( QFrame::Raised );
-
- QWidget* privateLayoutWidget = new QWidget( Frame7, "Layout11" );
- privateLayoutWidget->setGeometry( QRect( 10, 9, 221, 280 ) );
- Layout11 = new QVBoxLayout( privateLayoutWidget );
+ Layout11 = new QVBoxLayout( this );
Layout11->setSpacing( 6 );
Layout11->setMargin( 0 );
- progress = new QProgressBar(privateLayoutWidget, "progbar");
+ progress = new QProgressBar( this, "progbar");
progress->setTotalSteps(20);
- QFrame *buttonFrame = new QFrame(Frame7, "");
-
- StartStopButton = new QPushButton( buttonFrame, "StartButton" );
+ StartStopButton = new QPushButton( this, "StartButton" );
StartStopButton->setText( tr( "Start scan" ) );
-
- QHBoxLayout *buttonLayout = new QHBoxLayout(buttonFrame);
-
- buttonLayout->addWidget(StartStopButton);
-// buttonLayout->addWidget(StopButton);
-
- ListView1 = new QListView( privateLayoutWidget, "ListView1" );
+ ListView1 = new QListView( this, "ListView1" );
//ListView1->addColumn( tr( "Add" ) );
ListView1->addColumn( tr( "Add Device" ) );
@@ -82,14 +61,14 @@ namespace OpieTooth {
Layout11->addWidget( ListView1);
Layout11->addWidget(progress);
- Layout11->addWidget( buttonFrame);
+ Layout11->addWidget( StartStopButton );
localDevice = new Manager( "hci0" );
connect( StartStopButton, SIGNAL( clicked() ), this, SLOT( startSearch() ) );
connect( localDevice, SIGNAL( foundDevices( const QString& , RemoteDevice::ValueList ) ),
this, SLOT(fillList(const QString& , RemoteDevice::ValueList ) ) ) ;
- // connect( this, SIGNAL( accept() ), this, SLOT( emitToManager() ));
+
progressStat = 0;
m_search = false;
}
@@ -102,7 +81,6 @@ namespace OpieTooth {
QTimer::singleShot( 2000, this, SLOT(progressTimer() ) );
progress->setProgress(progressStat++);
}
-
}
void ScanDialog::accept() {
@@ -123,9 +101,6 @@ namespace OpieTooth {
// empty list before a new scan
ListView1->clear();
- QCheckListItem *deviceItem2 = new QCheckListItem( ListView1, "Test1", QCheckListItem::CheckBox );
- deviceItem2->setText(1, "BLAH" );
-
progressTimer();
// when finished, it emmite foundDevices()
// checken ob initialisiert , qcop ans applet.
@@ -142,7 +117,6 @@ namespace OpieTooth {
void ScanDialog::fillList(const QString&, RemoteDevice::ValueList deviceList) {
progress->setProgress(0);
progressStat = 0;
- qDebug("fill List");
QCheckListItem * deviceItem;
RemoteDevice::ValueList::Iterator it;
@@ -155,12 +129,11 @@ namespace OpieTooth {
StartStopButton->setText(tr ("Start scan") );
}
-/*
+/**
* Iterates trough the items, and collects the checked items.
* Then it emits it, so the manager can connect to the signal to fill the listing.
*/
void ScanDialog::emitToManager() {
- qDebug("vor liste durchsuchen");
if (!ListView1) {
return;
@@ -175,16 +148,14 @@ namespace OpieTooth {
deviceList.append( device );
}
}
- qDebug("vor emit");
emit selectedDevices( deviceList );
}
-/*
+/**
* Cleanup
*/
ScanDialog::~ScanDialog() {
qWarning("delete scan dialog");
delete localDevice;
}
-
}
diff --git a/noncore/net/opietooth/manager/scandialog.h b/noncore/net/opietooth/manager/scandialog.h
index 8f8d39a..a644e96 100644
--- a/noncore/net/opietooth/manager/scandialog.h
+++ b/noncore/net/opietooth/manager/scandialog.h
@@ -23,9 +23,7 @@
#include <remotedevice.h>
class QVBoxLayout;
-class QHBoxLayout;
class QGridLayout;
-class QFrame;
class QLabel;
class QListView;
class QListViewItem;
@@ -35,7 +33,6 @@ class QProgressBar;
namespace OpieTooth {
-
class Manager;
class Device;
@@ -46,11 +43,9 @@ class Device;
ScanDialog( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
~ScanDialog();
- private: // make them private -zecke
- QFrame* Frame7;
+ private:
QProgressBar* progress;
QPushButton* StartStopButton;
-// QPushButton* StopButton;
QListView* ListView1;
public slots: