summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/net/opietooth/manager/bluebase.cpp19
-rw-r--r--noncore/net/opietooth/manager/bluebase.h2
-rw-r--r--noncore/net/opietooth/manager/scandialog.cpp8
-rw-r--r--noncore/net/opietooth/manager/scandialog.h4
4 files changed, 22 insertions, 11 deletions
diff --git a/noncore/net/opietooth/manager/bluebase.cpp b/noncore/net/opietooth/manager/bluebase.cpp
index 71da82e..c993c7c 100644
--- a/noncore/net/opietooth/manager/bluebase.cpp
+++ b/noncore/net/opietooth/manager/bluebase.cpp
@@ -25,32 +25,34 @@
#include <qlayout.h>
#include <qvariant.h>
#include <qwhatsthis.h>
#include <qimage.h>
#include <qpixmap.h>
#include <qtabwidget.h>
#include <qscrollview.h>
#include <qvbox.h>
#include <qmessagebox.h>
#include <qapplication.h>
#include <qcheckbox.h>
#include <qlineedit.h>
+#include <qlistview.h>
#include <qpe/resource.h>
#include <qpe/config.h>
namespace OpieTooth {
- class RemoteDevices;
+
+ #include <remotedevice.h>
BlueBase::BlueBase( QWidget* parent, const char* name, WFlags fl )
: BluetoothBase( parent, name, fl ) {
QObject::connect( (QObject*) PushButton2, SIGNAL( clicked() ), this, SLOT(startScan()));
QObject::connect((QObject*)configApplyButton, SIGNAL(clicked() ), this, SLOT(applyConfigChanges()));
QPalette pal = this->palette();
@@ -144,38 +146,47 @@ namespace OpieTooth {
enableInquiryscan = inquiryscanCheckBox->isChecked();
writeConfig();
QMessageBox* box = new QMessageBox(this, "Test");
box->setText(tr("Changes applied"));
box->show();
// falls nötig hcid killhupen - die funktionalität adden
}
- void BlueBase::addSearchedDevices( QList<RemoteDevices> &newDevices ) {
+ void BlueBase::addSearchedDevices( QList<RemoteDevice> &newDevices ) {
+
+ QListViewItem * deviceItem;
+ QListIterator<RemoteDevice> it(newDevices);
+ for( ; it.current(); ++it ) {
+
+ RemoteDevice *dev = it.current();
+ deviceItem = new QListViewItem( ListView4, dev->name() );
+ deviceItem->setText(1, dev->mac() );
+ }
}
/**
* Open the "scan for devices" dialog
*/
void BlueBase::startScan() {
ScanDialog *scan = new ScanDialog( this, "", true);
- QObject::connect((QObject*)scan, SIGNAL( selectedDevices(QList<RemoteDevices>&) ),
- this, SLOT( addSearchedDevices(QList<RemoteDevices>& ) ));
+ QObject::connect((QObject*)scan, SIGNAL( selectedDevices(QList<RemoteDevice>&) ),
+ this, SLOT( addSearchedDevices(QList<RemoteDevice>& ) ));
scan->showMaximized();
}
/**
* Decontructor
*/
BlueBase::~BlueBase(){
}
}
diff --git a/noncore/net/opietooth/manager/bluebase.h b/noncore/net/opietooth/manager/bluebase.h
index 5364e51..c8ceed2 100644
--- a/noncore/net/opietooth/manager/bluebase.h
+++ b/noncore/net/opietooth/manager/bluebase.h
@@ -44,20 +44,20 @@ namespace OpieTooth {
QString getStatus();
void initGui();
QString deviceName;
QString defaultPasskey;
int useEncryption;
int enableAuthentification;
int enablePagescan;
int enableInquiryscan;
private slots:
- void addSearchedDevices( QList<RemoteDevices> &newDevices );
+ void addSearchedDevices( QList<RemoteDevice> &newDevices );
void applyConfigChanges();
};
}
#endif
diff --git a/noncore/net/opietooth/manager/scandialog.cpp b/noncore/net/opietooth/manager/scandialog.cpp
index 8a7ea01..bd7d23c 100644
--- a/noncore/net/opietooth/manager/scandialog.cpp
+++ b/noncore/net/opietooth/manager/scandialog.cpp
@@ -115,52 +115,52 @@ namespace OpieTooth {
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) {
+ void ScanDialog::fillList(const QString& device, RemoteDevice::ValueList deviceList) {
QCheckListItem * deviceItem;
- RemoteDevices::ValueList::Iterator it;
+ RemoteDevice::ValueList::Iterator it;
for( it = deviceList.begin(); it != deviceList.end(); ++it ) {
deviceItem = new QCheckListItem( ListView1, (*it).name() );
deviceItem->setText(1, (*it).mac() );
}
}
/*
* 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() {
if (!ListView1) {
return;
}
- QList<RemoteDevices> *deviceList = new QList<RemoteDevices>;
+ QList<RemoteDevice> *deviceList = new QList<RemoteDevice>;
QListViewItemIterator it( ListView1 );
for ( ; it.current(); ++it ) {
if ( ((QCheckListItem*)it.current())->isOn() ) {
- RemoteDevices* device = new RemoteDevices( it.current()->text(1), it.current()->text(0));
+ RemoteDevice * device = new RemoteDevice( it.current()->text(1), it.current()->text(0));
deviceList->append( device );
}
}
emit selectedDevices( *deviceList );
}
/*
* Cleanup
*/
ScanDialog::~ScanDialog() {
emitToManager();
delete localDevice;
diff --git a/noncore/net/opietooth/manager/scandialog.h b/noncore/net/opietooth/manager/scandialog.h
index 0ca302a..adc960c 100644
--- a/noncore/net/opietooth/manager/scandialog.h
+++ b/noncore/net/opietooth/manager/scandialog.h
@@ -51,27 +51,27 @@ class Device;
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);
+ void fillList(const QString& device, RemoteDevice::ValueList list);
private:
void emitToManager();
Manager *localDevice;
int progressStat;
signals:
- void selectedDevices(QList<RemoteDevices>&);
+ void selectedDevices(QList<RemoteDevice>&);
};
}
#endif // SCANDIALOG_H