author | harlekin <harlekin> | 2002-06-15 21:29:57 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-06-15 21:29:57 (UTC) |
commit | 8ab6f33e6bd35266bed38952f149a328bea3c544 (patch) (side-by-side diff) | |
tree | aee29787d61e58c6a8b345de40acaf36d0fdc424 | |
parent | e7712c9535a461c6f5f98e78b856af0bb9eca0c6 (diff) | |
download | opie-8ab6f33e6bd35266bed38952f149a328bea3c544.zip opie-8ab6f33e6bd35266bed38952f149a328bea3c544.tar.gz opie-8ab6f33e6bd35266bed38952f149a328bea3c544.tar.bz2 |
update
-rw-r--r-- | noncore/net/opietooth/manager/scandialog.cpp | 5 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/scandialog.h | 2 |
2 files changed, 2 insertions, 5 deletions
diff --git a/noncore/net/opietooth/manager/scandialog.cpp b/noncore/net/opietooth/manager/scandialog.cpp index b0ffbb3..63c5472 100644 --- a/noncore/net/opietooth/manager/scandialog.cpp +++ b/noncore/net/opietooth/manager/scandialog.cpp @@ -30,99 +30,96 @@ #include <qprogressbar.h> #include <manager.h> #include <device.h> #include <remotedevice.h> namespace OpieTooth { /* */ 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->setSpacing( 6 ); Layout11->setMargin( 0 ); - progress = new QProgressBar(privateLayoutWidget, "progbar"); progress->setTotalSteps(20); - QFrame *buttonFrame = new QFrame(Frame7, ""); StartButton = new QPushButton( buttonFrame, "StartButton" ); StartButton->setText( tr( "Start" ) ); StopButton = new QPushButton( buttonFrame, "StopButton" ); StopButton->setText( tr( "Cancel" ) ); - QHBoxLayout *buttonLayout = new QHBoxLayout(buttonFrame); buttonLayout->addWidget(StartButton); buttonLayout->addWidget(StopButton); ListView1 = new QListView( privateLayoutWidget, "ListView1" ); ListView1->addColumn( tr( "Add" ) ); ListView1->addColumn( tr( "Device Name" ) ); //ListView1->addColumn( tr( "Type" ) ); Layout11->addWidget( ListView1); Layout11->addWidget(progress); Layout11->addWidget( buttonFrame); localDevice = new Manager( "hci0" ); connect( (QObject*)StartButton, SIGNAL( clicked() ), this, SLOT( startSearch() ) ); connect( (QObject*)StopButton, SIGNAL( clicked() ), this, SLOT( stopSearch() ) ); connect( (QObject*)localDevice, SIGNAL( foundDevices( const QString& , RemoteDevices::ValueList ) ), this, SLOT(fillList(const QString& , RemoteDevices::ValueList ) ) ) ; progressStat = 0; } // hack, make cleaner later void ScanDialog::progressTimer() { progressStat++; if (progressStat++ < 20) { QTimer::singleShot( 1000, this, SLOT(progressTimer() ) ); } + progress->setProgress(progressStat++); } void ScanDialog::startSearch() { progress->setProgress(0); progressStat = 0; progressTimer(); // when finished, it emmite foundDevices() // checken ob initialisiert , qcop ans applet. localDevice->searchDevices(); } void ScanDialog::stopSearch() { } void ScanDialog::fillList(const QString& device, RemoteDevices::ValueList deviceList) { QListViewItem * deviceItem; RemoteDevices::ValueList::Iterator it; for( it = deviceList.begin(); it != deviceList.end(); ++it ) { diff --git a/noncore/net/opietooth/manager/scandialog.h b/noncore/net/opietooth/manager/scandialog.h index 22ee01d..fcaee6e 100644 --- a/noncore/net/opietooth/manager/scandialog.h +++ b/noncore/net/opietooth/manager/scandialog.h @@ -39,35 +39,35 @@ namespace OpieTooth { class Manager; class Device; class ScanDialog : public QDialog { Q_OBJECT public: ScanDialog( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); ~ScanDialog(); QFrame* Frame7; QProgressBar* progress; QPushButton* StartButton; QPushButton* StopButton; QListView* ListView1; protected: QVBoxLayout* Layout11; private slots: void stopSearch(); void startSearch(); + void progressTimer(); void fillList(const QString& device, RemoteDevices::ValueList list); private: - void progressTimer(int maxSeconds); Manager *localDevice; int progressStat; }; } #endif // SCANDIALOG_H |