summaryrefslogtreecommitdiff
authorharlekin <harlekin>2002-06-16 19:26:43 (UTC)
committer harlekin <harlekin>2002-06-16 19:26:43 (UTC)
commit8dde6abcd14717bd362248c365fe140efe0f0386 (patch) (side-by-side diff)
treef9e97c987e5197d4cbb3d0a0d5afe99fe12b1eba
parent1eca76c99326afc111efeb2bf55a306a4f37eb1e (diff)
downloadopie-8dde6abcd14717bd362248c365fe140efe0f0386.zip
opie-8dde6abcd14717bd362248c365fe140efe0f0386.tar.gz
opie-8dde6abcd14717bd362248c365fe140efe0f0386.tar.bz2
update
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opietooth/manager/bluebase.cpp14
-rw-r--r--noncore/net/opietooth/manager/bluebase.h5
-rw-r--r--noncore/net/opietooth/manager/scandialog.cpp46
-rw-r--r--noncore/net/opietooth/manager/scandialog.h10
4 files changed, 64 insertions, 11 deletions
diff --git a/noncore/net/opietooth/manager/bluebase.cpp b/noncore/net/opietooth/manager/bluebase.cpp
index e3b9e53..71da82e 100644
--- a/noncore/net/opietooth/manager/bluebase.cpp
+++ b/noncore/net/opietooth/manager/bluebase.cpp
@@ -43,2 +43,3 @@ namespace OpieTooth {
+ class RemoteDevices;
@@ -51,2 +52,5 @@ namespace OpieTooth {
+
+
+
QPalette pal = this->palette();
@@ -151,2 +155,9 @@ namespace OpieTooth {
+ void BlueBase::addSearchedDevices( QList<RemoteDevices> &newDevices ) {
+
+
+
+ }
+
+
/**
@@ -156,2 +167,5 @@ namespace OpieTooth {
ScanDialog *scan = new ScanDialog( this, "", true);
+ QObject::connect((QObject*)scan, SIGNAL( selectedDevices(QList<RemoteDevices>&) ),
+ this, SLOT( addSearchedDevices(QList<RemoteDevices>& ) ));
+
scan->showMaximized();
diff --git a/noncore/net/opietooth/manager/bluebase.h b/noncore/net/opietooth/manager/bluebase.h
index 023af7a..ae5ce67 100644
--- a/noncore/net/opietooth/manager/bluebase.h
+++ b/noncore/net/opietooth/manager/bluebase.h
@@ -8,2 +8,3 @@
#include <qsplitter.h>
+#include <qlist.h>
@@ -22,2 +23,4 @@ namespace OpieTooth {
+
+
class BlueBase : public BluetoothBase {
@@ -50,3 +53,3 @@ namespace OpieTooth {
private slots:
-
+ void addSearchedDevices( QList<RemoteDevices> &newDevices );
void applyConfigChanges();
diff --git a/noncore/net/opietooth/manager/scandialog.cpp b/noncore/net/opietooth/manager/scandialog.cpp
index 63c5472..70ea77a 100644
--- a/noncore/net/opietooth/manager/scandialog.cpp
+++ b/noncore/net/opietooth/manager/scandialog.cpp
@@ -30,2 +30,3 @@
#include <qprogressbar.h>
+#include <qlist.h>
@@ -33,3 +34,3 @@
#include <device.h>
-#include <remotedevice.h>
+
@@ -38,2 +39,4 @@ namespace OpieTooth {
+#include <remotedevice.h>
+
/*
@@ -65,8 +68,9 @@ namespace OpieTooth {
StartButton = new QPushButton( buttonFrame, "StartButton" );
- StartButton->setText( tr( "Start" ) );
+ StartButton->setText( tr( "Start scan" ) );
StopButton = new QPushButton( buttonFrame, "StopButton" );
- StopButton->setText( tr( "Cancel" ) );
+ StopButton->setText( tr( "Cancel scan" ) );
QHBoxLayout *buttonLayout = new QHBoxLayout(buttonFrame);
+
buttonLayout->addWidget(StartButton);
@@ -76,4 +80,4 @@ namespace OpieTooth {
- ListView1->addColumn( tr( "Add" ) );
- ListView1->addColumn( tr( "Device Name" ) );
+ //ListView1->addColumn( tr( "Add" ) );
+ ListView1->addColumn( tr( "Add Device" ) );
//ListView1->addColumn( tr( "Type" ) );
@@ -108,2 +112,5 @@ namespace OpieTooth {
+ QCheckListItem *deviceItem2 = new QCheckListItem( ListView1, "Test1", QCheckListItem::CheckBox );
+ deviceItem2->setText(1, "BLAH" );
+
progressTimer();
@@ -121,3 +128,3 @@ namespace OpieTooth {
- QListViewItem * deviceItem;
+ QCheckListItem * deviceItem;
@@ -126,4 +133,28 @@ namespace OpieTooth {
- deviceItem = new QListViewItem( ListView1, (*it).name() );
+ 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>;
+
+ QListViewItemIterator it( ListView1 );
+ for ( ; it.current(); ++it ) {
+ if ( it.current()->isSelected() ) {
+ RemoteDevices* device = new RemoteDevices( it.current()->text(1), it.current()->text(0));
+ deviceList->append( device );
+ }
}
+ emit selectedDevices( *deviceList );
}
@@ -134,2 +165,3 @@ namespace OpieTooth {
ScanDialog::~ScanDialog() {
+ emitToManager();
delete localDevice;
diff --git a/noncore/net/opietooth/manager/scandialog.h b/noncore/net/opietooth/manager/scandialog.h
index fcaee6e..4785a62 100644
--- a/noncore/net/opietooth/manager/scandialog.h
+++ b/noncore/net/opietooth/manager/scandialog.h
@@ -21,6 +21,5 @@
#include <qdialog.h>
+#include <qlist.h>
-#include <remotedevice.h>
-
class QVBoxLayout;
@@ -38,3 +37,3 @@ namespace OpieTooth {
-
+#include <remotedevices.h>
class Manager;
@@ -66,6 +65,11 @@ class Device;
private:
+ void emitToManager();
Manager *localDevice;
int progressStat;
+
+ signals:
+ void selectedDevices(QList<RemoteDevices>&);
};
+
}