summaryrefslogtreecommitdiff
path: root/noncore/net/opietooth/manager/scandialog.cpp
Unidiff
Diffstat (limited to 'noncore/net/opietooth/manager/scandialog.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/net/opietooth/manager/scandialog.cpp113
1 files changed, 113 insertions, 0 deletions
diff --git a/noncore/net/opietooth/manager/scandialog.cpp b/noncore/net/opietooth/manager/scandialog.cpp
new file mode 100644
index 0000000..3ddba3e
--- a/dev/null
+++ b/noncore/net/opietooth/manager/scandialog.cpp
@@ -0,0 +1,113 @@
1/* main.cpp
2 *
3 * ---------------------
4 *
5 * copyright : (c) 2002 by Maximilian Reiß
6 * email : max.reiss@gmx.de
7 *
8 */
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17
18
19#include "scandialog.h"
20
21#include <qframe.h>
22#include <qheader.h>
23#include <qlabel.h>
24#include <qlistview.h>
25#include <qpushbutton.h>
26#include <qlayout.h>
27#include <qvariant.h>
28#include <qtooltip.h>
29#include <qwhatsthis.h>
30
31#include <manager.h>
32#include <device.h>
33#include <remotedevice.h>
34
35
36namespace OpieTooth {
37
38/*
39
40 */
41 ScanDialog::ScanDialog( QWidget* parent, const char* name, bool modal, WFlags fl )
42 : QDialog( parent, name, modal, fl ) {
43
44 if ( !name )
45 setName( "ScanDialog" );
46 resize( 360, 392 );
47 setCaption( tr( "Scan for devices" ) );
48
49 Frame7 = new QFrame( this, "Frame7" );
50 Frame7->setGeometry( QRect( 0, 0, 240, 331 ) );
51 Frame7->setFrameShape( QFrame::StyledPanel );
52 Frame7->setFrameShadow( QFrame::Raised );
53
54 QWidget* privateLayoutWidget = new QWidget( Frame7, "Layout11" );
55 privateLayoutWidget->setGeometry( QRect( 10, 9, 221, 310 ) );
56 Layout11 = new QGridLayout( privateLayoutWidget );
57 Layout11->setSpacing( 6 );
58 Layout11->setMargin( 0 );
59
60
61 TextLabel10 = new QLabel( privateLayoutWidget, "TextLabel10" );
62 TextLabel10->setText( tr( "ersetzen durch qprogressbar" ) );
63
64 Layout11->addMultiCellWidget( TextLabel10, 1, 1, 0, 1 );
65
66 StartButton = new QPushButton( privateLayoutWidget, "PushButton13" );
67 StartButton->setText( tr( "Start" ) );
68
69 Layout11->addWidget( StartButton, 2, 0 );
70
71 PushButton6 = new QPushButton( privateLayoutWidget, "PushButton6" );
72 PushButton6->setText( tr( "Stop" ) );
73
74 Layout11->addWidget( PushButton6, 2, 1 );
75
76 ListView1 = new QListView( privateLayoutWidget, "ListView1" );
77
78 // ListView1->addColumn( tr( "In List" ) );
79 ListView1->addColumn( tr( "Device Name" ) );
80 //ListView1->addColumn( tr( "Type" ) );
81
82 Layout11->addMultiCellWidget( ListView1, 0, 0, 0, 1 );
83
84 connect( (QObject*)StartButton, SIGNAL( clicked() ), this, SLOT( startSearch() ) );
85 connect( (QObject*)localDevice, SIGNAL( foundDevices( const QString& , RemoteDevices::ValueList ) ),
86 this, SLOT(fillList(const QString& , RemoteDevices::ValueList ) ) ) ;
87 }
88
89 void ScanDialog::startSearch() {
90 // read it from config later
91 localDevice = new Manager( "hci0" );
92 localDevice->searchDevices();
93 }
94
95
96 void ScanDialog::fillList(const QString& device, RemoteDevices::ValueList deviceList) {
97
98
99 RemoteDevices::ValueList::Iterator it;
100 for( it = deviceList.begin(); it != deviceList.end(); ++it ) {
101
102
103 }
104 }
105
106/*
107 * Cleanup
108 */
109 ScanDialog::~ScanDialog() {
110 delete localDevice;
111 }
112
113}