-rw-r--r-- | noncore/net/opietooth/manager/scandialog.cpp | 69 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/scandialog.h | 13 |
2 files changed, 24 insertions, 58 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 | |||
@@ -20,5 +20,3 @@ | |||
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> |
@@ -36,3 +34,2 @@ | |||
36 | 34 | ||
37 | |||
38 | namespace OpieTooth { | 35 | namespace OpieTooth { |
@@ -41,3 +38,3 @@ namespace OpieTooth { | |||
41 | 38 | ||
42 | /* | 39 | /** |
43 | */ | 40 | */ |
@@ -46,15 +43,5 @@ namespace OpieTooth { | |||
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 ); |
@@ -62,17 +49,9 @@ namespace OpieTooth { | |||
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 | ||
@@ -82,5 +61,5 @@ 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 | ||
@@ -90,4 +69,4 @@ namespace OpieTooth { | |||
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; |
@@ -100,7 +79,6 @@ namespace OpieTooth { | |||
100 | progressStat++; | 79 | progressStat++; |
101 | if (progressStat++ < 20 && m_search ) { | 80 | if ( progressStat++ < 20 && m_search ) { |
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 | } |
@@ -125,5 +103,2 @@ namespace OpieTooth { | |||
125 | 103 | ||
126 | QCheckListItem *deviceItem2 = new QCheckListItem( ListView1, "Test1", QCheckListItem::CheckBox ); | ||
127 | deviceItem2->setText(1, "BLAH" ); | ||
128 | |||
129 | progressTimer(); | 104 | progressTimer(); |
@@ -131,3 +106,3 @@ namespace OpieTooth { | |||
131 | // checken ob initialisiert , qcop ans applet. | 106 | // checken ob initialisiert , qcop ans applet. |
132 | StartStopButton->setText( tr("Stop scan")); | 107 | StartStopButton->setText( tr( "Stop scan" ) ); |
133 | 108 | ||
@@ -144,3 +119,2 @@ namespace OpieTooth { | |||
144 | progressStat = 0; | 119 | progressStat = 0; |
145 | qDebug("fill List"); | ||
146 | QCheckListItem * deviceItem; | 120 | QCheckListItem * deviceItem; |
@@ -151,9 +125,9 @@ namespace OpieTooth { | |||
151 | deviceItem = new QCheckListItem( ListView1, (*it).name(), QCheckListItem::CheckBox ); | 125 | deviceItem = new QCheckListItem( ListView1, (*it).name(), QCheckListItem::CheckBox ); |
152 | deviceItem->setText(1, (*it).mac() ); | 126 | deviceItem->setText( 1, (*it).mac() ); |
153 | } | 127 | } |
154 | m_search = false; | 128 | m_search = false; |
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. |
@@ -162,3 +136,2 @@ namespace OpieTooth { | |||
162 | void ScanDialog::emitToManager() { | 136 | void ScanDialog::emitToManager() { |
163 | qDebug("vor liste durchsuchen"); | ||
164 | 137 | ||
@@ -172,4 +145,4 @@ namespace OpieTooth { | |||
172 | for ( ; it.current(); ++it ) { | 145 | for ( ; it.current(); ++it ) { |
173 | if ( ((QCheckListItem*)it.current())->isOn() ) { | 146 | if ( ( (QCheckListItem*)it.current() )->isOn() ) { |
174 | RemoteDevice device( it.current()->text(1), it.current()->text(0)); | 147 | RemoteDevice device( it.current()->text(1), it.current()->text(0) ); |
175 | deviceList.append( device ); | 148 | deviceList.append( device ); |
@@ -177,3 +150,2 @@ namespace OpieTooth { | |||
177 | } | 150 | } |
178 | qDebug("vor emit"); | ||
179 | emit selectedDevices( deviceList ); | 151 | emit selectedDevices( deviceList ); |
@@ -181,3 +153,3 @@ namespace OpieTooth { | |||
181 | 153 | ||
182 | /* | 154 | /** |
183 | * Cleanup | 155 | * Cleanup |
@@ -188,3 +160,2 @@ namespace OpieTooth { | |||
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 | |||
@@ -25,5 +25,3 @@ | |||
25 | class QVBoxLayout; | 25 | class QVBoxLayout; |
26 | class QHBoxLayout; | ||
27 | class QGridLayout; | 26 | class QGridLayout; |
28 | class QFrame; | ||
29 | class QLabel; | 27 | class QLabel; |
@@ -37,3 +35,2 @@ namespace OpieTooth { | |||
37 | 35 | ||
38 | |||
39 | class Manager; | 36 | class Manager; |
@@ -48,7 +45,5 @@ class Device; | |||
48 | 45 | ||
49 | private: // make them private -zecke | 46 | private: |
50 | QFrame* Frame7; | 47 | QProgressBar* progress; |
51 | QProgressBar* progress; | ||
52 | QPushButton* StartStopButton; | 48 | QPushButton* StartStopButton; |
53 | // QPushButton* StopButton; | ||
54 | QListView* ListView1; | 49 | QListView* ListView1; |
@@ -65,3 +60,3 @@ class Device; | |||
65 | void progressTimer(); | 60 | void progressTimer(); |
66 | void fillList(const QString& device, RemoteDevice::ValueList list); | 61 | void fillList( const QString& device, RemoteDevice::ValueList list ); |
67 | 62 | ||
@@ -74,3 +69,3 @@ class Device; | |||
74 | signals: | 69 | signals: |
75 | void selectedDevices(const QValueList<RemoteDevice>&); | 70 | void selectedDevices( const QValueList<RemoteDevice>& ); |
76 | }; | 71 | }; |