summaryrefslogtreecommitdiff
path: root/noncore/net/opietooth/manager/scandialog.cpp
Side-by-side diff
Diffstat (limited to 'noncore/net/opietooth/manager/scandialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opietooth/manager/scandialog.cpp21
1 files changed, 15 insertions, 6 deletions
diff --git a/noncore/net/opietooth/manager/scandialog.cpp b/noncore/net/opietooth/manager/scandialog.cpp
index f8f7b15..ec8df82 100644
--- a/noncore/net/opietooth/manager/scandialog.cpp
+++ b/noncore/net/opietooth/manager/scandialog.cpp
@@ -87,12 +87,13 @@ namespace OpieTooth {
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 ) ) ) ;
+ connect( StartButton, SIGNAL( clicked() ), this, SLOT( startSearch() ) );
+ connect( StopButton, SIGNAL( clicked() ), this, SLOT( stopSearch() ) );
+ connect( localDevice, SIGNAL( foundDevices( const QString& , RemoteDevice::ValueList ) ),
+ this, SLOT(fillList(const QString& , RemoteDevice::ValueList ) ) ) ;
+ // connect( this, SIGNAL( accept() ), this, SLOT( emitToManager() ));
progressStat = 0;
}
// hack, make cleaner later
@@ -105,8 +106,14 @@ namespace OpieTooth {
progress->setProgress(progressStat++);
}
+ void ScanDialog::accept() {
+ emitToManager();
+ QDialog::accept();
+ }
+
+
void ScanDialog::startSearch() {
progress->setProgress(0);
progressStat = 0;
@@ -125,14 +132,15 @@ namespace OpieTooth {
}
void ScanDialog::fillList(const QString& device, RemoteDevice::ValueList deviceList) {
+ qDebug("fill List");
QCheckListItem * deviceItem;
RemoteDevice::ValueList::Iterator it;
for( it = deviceList.begin(); it != deviceList.end(); ++it ) {
- deviceItem = new QCheckListItem( ListView1, (*it).name() );
+ deviceItem = new QCheckListItem( ListView1, (*it).name(), QCheckListItem::CheckBox );
deviceItem->setText(1, (*it).mac() );
}
}
@@ -140,8 +148,9 @@ namespace OpieTooth {
* 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;
}
@@ -155,17 +164,17 @@ namespace OpieTooth {
RemoteDevice * device = new RemoteDevice( it.current()->text(1), it.current()->text(0));
deviceList->append( device );
}
}
+ qDebug("vor emit");
emit selectedDevices( *deviceList );
delete deviceList;
}
/*
* Cleanup
*/
ScanDialog::~ScanDialog() {
- emitToManager();
delete localDevice;
}
}