summaryrefslogtreecommitdiff
path: root/noncore/net/opietooth/manager/scandialog.cpp
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 /noncore/net/opietooth/manager/scandialog.cpp
parent1eca76c99326afc111efeb2bf55a306a4f37eb1e (diff)
downloadopie-8dde6abcd14717bd362248c365fe140efe0f0386.zip
opie-8dde6abcd14717bd362248c365fe140efe0f0386.tar.gz
opie-8dde6abcd14717bd362248c365fe140efe0f0386.tar.bz2
update
Diffstat (limited to 'noncore/net/opietooth/manager/scandialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opietooth/manager/scandialog.cpp46
1 files changed, 39 insertions, 7 deletions
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
@@ -28,14 +28,17 @@
#include <qtooltip.h>
#include <qwhatsthis.h>
#include <qprogressbar.h>
+#include <qlist.h>
#include <manager.h>
#include <device.h>
-#include <remotedevice.h>
+
namespace OpieTooth {
+#include <remotedevice.h>
+
/*
*/
ScanDialog::ScanDialog( QWidget* parent, const char* name, bool modal, WFlags fl )
@@ -63,19 +66,20 @@ namespace OpieTooth {
QFrame *buttonFrame = new QFrame(Frame7, "");
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);
buttonLayout->addWidget(StopButton);
ListView1 = new QListView( privateLayoutWidget, "ListView1" );
- ListView1->addColumn( tr( "Add" ) );
- ListView1->addColumn( tr( "Device Name" ) );
+ //ListView1->addColumn( tr( "Add" ) );
+ ListView1->addColumn( tr( "Add Device" ) );
//ListView1->addColumn( tr( "Type" ) );
Layout11->addWidget( ListView1);
@@ -106,6 +110,9 @@ namespace OpieTooth {
progress->setProgress(0);
progressStat = 0;
+ QCheckListItem *deviceItem2 = new QCheckListItem( ListView1, "Test1", QCheckListItem::CheckBox );
+ deviceItem2->setText(1, "BLAH" );
+
progressTimer();
// when finished, it emmite foundDevices()
// checken ob initialisiert , qcop ans applet.
@@ -119,19 +126,44 @@ namespace OpieTooth {
void ScanDialog::fillList(const QString& device, RemoteDevices::ValueList deviceList) {
- QListViewItem * deviceItem;
+ QCheckListItem * deviceItem;
RemoteDevices::ValueList::Iterator it;
for( it = deviceList.begin(); it != deviceList.end(); ++it ) {
- 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 );
}
/*
* Cleanup
*/
ScanDialog::~ScanDialog() {
+ emitToManager();
delete localDevice;
}