summaryrefslogtreecommitdiff
authorharlekin <harlekin>2003-02-16 10:04:28 (UTC)
committer harlekin <harlekin>2003-02-16 10:04:28 (UTC)
commitfb16f3317916704eca14d35271d48130bfa78c6c (patch) (unidiff)
tree2a68df6a2938466c6d8e7e446730c5794bd61a8d
parentf1737ebd1afc35528c2452f6a281039c39a28f1f (diff)
downloadopie-fb16f3317916704eca14d35271d48130bfa78c6c.zip
opie-fb16f3317916704eca14d35271d48130bfa78c6c.tar.gz
opie-fb16f3317916704eca14d35271d48130bfa78c6c.tar.bz2
cleaned the scandialog
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/net/opietooth/manager/scandialog.cpp47
-rw-r--r--noncore/net/opietooth/manager/scandialog.h7
2 files changed, 10 insertions, 44 deletions
diff --git a/noncore/net/opietooth/manager/scandialog.cpp b/noncore/net/opietooth/manager/scandialog.cpp
index 9ce1b6a..de4f742 100644
--- a/noncore/net/opietooth/manager/scandialog.cpp
+++ b/noncore/net/opietooth/manager/scandialog.cpp
@@ -18,9 +18,7 @@
18 18
19#include "scandialog.h" 19#include "scandialog.h"
20 20
21#include <qframe.h>
22#include <qheader.h> 21#include <qheader.h>
23#include <qlabel.h>
24#include <qlistview.h> 22#include <qlistview.h>
25#include <qpushbutton.h> 23#include <qpushbutton.h>
26#include <qlayout.h> 24#include <qlayout.h>
@@ -34,47 +32,28 @@
34#include <device.h> 32#include <device.h>
35 33
36 34
37
38namespace OpieTooth { 35namespace OpieTooth {
39 36
40#include <remotedevice.h> 37#include <remotedevice.h>
41 38
42/* 39/**
43 */ 40 */
44 ScanDialog::ScanDialog( QWidget* parent, const char* name, bool modal, WFlags fl ) 41 ScanDialog::ScanDialog( QWidget* parent, const char* name, bool modal, WFlags fl )
45 : QDialog( parent, name, modal, fl ) { 42 : QDialog( parent, name, modal, fl ) {
46 43
47 if ( !name )
48 setName( "ScanDialog" );
49 resize( 240, 320 );
50 setCaption( tr( "Scan for devices" ) ); 44 setCaption( tr( "Scan for devices" ) );
51 45
52 Frame7 = new QFrame( this, "Frame7" ); 46 Layout11 = new QVBoxLayout( this );
53 Frame7->setGeometry( QRect( 0, 0, 240, 331 ) );
54 Frame7->setFrameShape( QFrame::StyledPanel );
55 Frame7->setFrameShadow( QFrame::Raised );
56
57 QWidget* privateLayoutWidget = new QWidget( Frame7, "Layout11" );
58 privateLayoutWidget->setGeometry( QRect( 10, 9, 221, 280 ) );
59 Layout11 = new QVBoxLayout( privateLayoutWidget );
60 Layout11->setSpacing( 6 ); 47 Layout11->setSpacing( 6 );
61 Layout11->setMargin( 0 ); 48 Layout11->setMargin( 0 );
62 49
63 progress = new QProgressBar(privateLayoutWidget, "progbar"); 50 progress = new QProgressBar( this, "progbar");
64 progress->setTotalSteps(20); 51 progress->setTotalSteps(20);
65 52
66 QFrame *buttonFrame = new QFrame(Frame7, ""); 53 StartStopButton = new QPushButton( this, "StartButton" );
67
68 StartStopButton = new QPushButton( buttonFrame, "StartButton" );
69 StartStopButton->setText( tr( "Start scan" ) ); 54 StartStopButton->setText( tr( "Start scan" ) );
70 55
71 56 ListView1 = new QListView( this, "ListView1" );
72 QHBoxLayout *buttonLayout = new QHBoxLayout(buttonFrame);
73
74 buttonLayout->addWidget(StartStopButton);
75 //buttonLayout->addWidget(StopButton);
76
77 ListView1 = new QListView( privateLayoutWidget, "ListView1" );
78 57
79 //ListView1->addColumn( tr( "Add" ) ); 58 //ListView1->addColumn( tr( "Add" ) );
80 ListView1->addColumn( tr( "Add Device" ) ); 59 ListView1->addColumn( tr( "Add Device" ) );
@@ -82,14 +61,14 @@ namespace OpieTooth {
82 61
83 Layout11->addWidget( ListView1); 62 Layout11->addWidget( ListView1);
84 Layout11->addWidget(progress); 63 Layout11->addWidget(progress);
85 Layout11->addWidget( buttonFrame); 64 Layout11->addWidget( StartStopButton );
86 65
87 localDevice = new Manager( "hci0" ); 66 localDevice = new Manager( "hci0" );
88 67
89 connect( StartStopButton, SIGNAL( clicked() ), this, SLOT( startSearch() ) ); 68 connect( StartStopButton, SIGNAL( clicked() ), this, SLOT( startSearch() ) );
90 connect( localDevice, SIGNAL( foundDevices( const QString& , RemoteDevice::ValueList ) ), 69 connect( localDevice, SIGNAL( foundDevices( const QString& , RemoteDevice::ValueList ) ),
91 this, SLOT(fillList(const QString& , RemoteDevice::ValueList ) ) ) ; 70 this, SLOT(fillList(const QString& , RemoteDevice::ValueList ) ) ) ;
92 // connect( this, SIGNAL( accept() ), this, SLOT( emitToManager() )); 71
93 progressStat = 0; 72 progressStat = 0;
94 m_search = false; 73 m_search = false;
95 } 74 }
@@ -102,7 +81,6 @@ namespace OpieTooth {
102 QTimer::singleShot( 2000, this, SLOT(progressTimer() ) ); 81 QTimer::singleShot( 2000, this, SLOT(progressTimer() ) );
103 progress->setProgress(progressStat++); 82 progress->setProgress(progressStat++);
104 } 83 }
105
106 } 84 }
107 85
108 void ScanDialog::accept() { 86 void ScanDialog::accept() {
@@ -123,9 +101,6 @@ namespace OpieTooth {
123 // empty list before a new scan 101 // empty list before a new scan
124 ListView1->clear(); 102 ListView1->clear();
125 103
126 QCheckListItem *deviceItem2 = new QCheckListItem( ListView1, "Test1", QCheckListItem::CheckBox );
127 deviceItem2->setText(1, "BLAH" );
128
129 progressTimer(); 104 progressTimer();
130 // when finished, it emmite foundDevices() 105 // when finished, it emmite foundDevices()
131 // checken ob initialisiert , qcop ans applet. 106 // checken ob initialisiert , qcop ans applet.
@@ -142,7 +117,6 @@ namespace OpieTooth {
142 void ScanDialog::fillList(const QString&, RemoteDevice::ValueList deviceList) { 117 void ScanDialog::fillList(const QString&, RemoteDevice::ValueList deviceList) {
143 progress->setProgress(0); 118 progress->setProgress(0);
144 progressStat = 0; 119 progressStat = 0;
145 qDebug("fill List");
146 QCheckListItem * deviceItem; 120 QCheckListItem * deviceItem;
147 121
148 RemoteDevice::ValueList::Iterator it; 122 RemoteDevice::ValueList::Iterator it;
@@ -155,12 +129,11 @@ namespace OpieTooth {
155 StartStopButton->setText(tr ("Start scan") ); 129 StartStopButton->setText(tr ("Start scan") );
156 } 130 }
157 131
158/* 132/**
159 * Iterates trough the items, and collects the checked items. 133 * Iterates trough the items, and collects the checked items.
160 * Then it emits it, so the manager can connect to the signal to fill the listing. 134 * Then it emits it, so the manager can connect to the signal to fill the listing.
161 */ 135 */
162 void ScanDialog::emitToManager() { 136 void ScanDialog::emitToManager() {
163 qDebug("vor liste durchsuchen");
164 137
165 if (!ListView1) { 138 if (!ListView1) {
166 return; 139 return;
@@ -175,16 +148,14 @@ namespace OpieTooth {
175 deviceList.append( device ); 148 deviceList.append( device );
176 } 149 }
177 } 150 }
178 qDebug("vor emit");
179 emit selectedDevices( deviceList ); 151 emit selectedDevices( deviceList );
180 } 152 }
181 153
182/* 154/**
183 * Cleanup 155 * Cleanup
184 */ 156 */
185 ScanDialog::~ScanDialog() { 157 ScanDialog::~ScanDialog() {
186 qWarning("delete scan dialog"); 158 qWarning("delete scan dialog");
187 delete localDevice; 159 delete localDevice;
188 } 160 }
189
190} 161}
diff --git a/noncore/net/opietooth/manager/scandialog.h b/noncore/net/opietooth/manager/scandialog.h
index 8f8d39a..a644e96 100644
--- a/noncore/net/opietooth/manager/scandialog.h
+++ b/noncore/net/opietooth/manager/scandialog.h
@@ -23,9 +23,7 @@
23 23
24#include <remotedevice.h> 24#include <remotedevice.h>
25class QVBoxLayout; 25class QVBoxLayout;
26class QHBoxLayout;
27class QGridLayout; 26class QGridLayout;
28class QFrame;
29class QLabel; 27class QLabel;
30class QListView; 28class QListView;
31class QListViewItem; 29class QListViewItem;
@@ -35,7 +33,6 @@ class QProgressBar;
35 33
36namespace OpieTooth { 34namespace OpieTooth {
37 35
38
39class Manager; 36class Manager;
40class Device; 37class Device;
41 38
@@ -46,11 +43,9 @@ class Device;
46 ScanDialog( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 ); 43 ScanDialog( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
47 ~ScanDialog(); 44 ~ScanDialog();
48 45
49 private: // make them private -zecke 46 private:
50 QFrame* Frame7;
51 QProgressBar* progress; 47 QProgressBar* progress;
52 QPushButton* StartStopButton; 48 QPushButton* StartStopButton;
53// QPushButton* StopButton;
54 QListView* ListView1; 49 QListView* ListView1;
55 50
56 public slots: 51 public slots: