Diffstat (limited to 'noncore/net/opietooth/manager/scandialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/opietooth/manager/scandialog.cpp | 37 |
1 files changed, 23 insertions, 14 deletions
diff --git a/noncore/net/opietooth/manager/scandialog.cpp b/noncore/net/opietooth/manager/scandialog.cpp index 3d6c928..9ce1b6a 100644 --- a/noncore/net/opietooth/manager/scandialog.cpp +++ b/noncore/net/opietooth/manager/scandialog.cpp | |||
@@ -67,7 +67,5 @@ namespace OpieTooth { | |||
67 | 67 | ||
68 | StartButton = new QPushButton( buttonFrame, "StartButton" ); | 68 | StartStopButton = new QPushButton( buttonFrame, "StartButton" ); |
69 | StartButton->setText( tr( "Start scan" ) ); | 69 | StartStopButton->setText( tr( "Start scan" ) ); |
70 | 70 | ||
71 | StopButton = new QPushButton( buttonFrame, "StopButton" ); | ||
72 | StopButton->setText( tr( "Cancel scan" ) ); | ||
73 | 71 | ||
@@ -75,4 +73,4 @@ namespace OpieTooth { | |||
75 | 73 | ||
76 | buttonLayout->addWidget(StartButton); | 74 | buttonLayout->addWidget(StartStopButton); |
77 | buttonLayout->addWidget(StopButton); | 75 | //buttonLayout->addWidget(StopButton); |
78 | 76 | ||
@@ -90,4 +88,3 @@ namespace OpieTooth { | |||
90 | 88 | ||
91 | connect( StartButton, SIGNAL( clicked() ), this, SLOT( startSearch() ) ); | 89 | connect( StartStopButton, SIGNAL( clicked() ), this, SLOT( startSearch() ) ); |
92 | connect( StopButton, SIGNAL( clicked() ), this, SLOT( stopSearch() ) ); | ||
93 | connect( localDevice, SIGNAL( foundDevices( const QString& , RemoteDevice::ValueList ) ), | 90 | connect( localDevice, SIGNAL( foundDevices( const QString& , RemoteDevice::ValueList ) ), |
@@ -96,2 +93,3 @@ namespace OpieTooth { | |||
96 | progressStat = 0; | 93 | progressStat = 0; |
94 | m_search = false; | ||
97 | } | 95 | } |
@@ -102,6 +100,6 @@ namespace OpieTooth { | |||
102 | progressStat++; | 100 | progressStat++; |
103 | if (progressStat++ < 20) { | 101 | if (progressStat++ < 20 && m_search ) { |
104 | QTimer::singleShot( 2000, this, SLOT(progressTimer() ) ); | 102 | QTimer::singleShot( 2000, this, SLOT(progressTimer() ) ); |
105 | } | ||
106 | progress->setProgress(progressStat++); | 103 | progress->setProgress(progressStat++); |
104 | } | ||
107 | 105 | ||
@@ -116,2 +114,7 @@ namespace OpieTooth { | |||
116 | void ScanDialog::startSearch() { | 114 | void ScanDialog::startSearch() { |
115 | if ( m_search ) { | ||
116 | stopSearch(); | ||
117 | return; | ||
118 | } | ||
119 | m_search = true; | ||
117 | progress->setProgress(0); | 120 | progress->setProgress(0); |
@@ -128,2 +131,4 @@ namespace OpieTooth { | |||
128 | // checken ob initialisiert , qcop ans applet. | 131 | // checken ob initialisiert , qcop ans applet. |
132 | StartStopButton->setText( tr("Stop scan")); | ||
133 | |||
129 | localDevice->searchDevices(); | 134 | localDevice->searchDevices(); |
@@ -133,7 +138,8 @@ namespace OpieTooth { | |||
133 | void ScanDialog::stopSearch() { | 138 | void ScanDialog::stopSearch() { |
134 | 139 | m_search = true; | |
135 | } | 140 | } |
136 | 141 | ||
137 | void ScanDialog::fillList(const QString& device, RemoteDevice::ValueList deviceList) { | 142 | void ScanDialog::fillList(const QString&, RemoteDevice::ValueList deviceList) { |
138 | 143 | progress->setProgress(0); | |
144 | progressStat = 0; | ||
139 | qDebug("fill List"); | 145 | qDebug("fill List"); |
@@ -147,2 +153,4 @@ namespace OpieTooth { | |||
147 | } | 153 | } |
154 | m_search = false; | ||
155 | StartStopButton->setText(tr ("Start scan") ); | ||
148 | } | 156 | } |
@@ -177,2 +185,3 @@ namespace OpieTooth { | |||
177 | ScanDialog::~ScanDialog() { | 185 | ScanDialog::~ScanDialog() { |
186 | qWarning("delete scan dialog"); | ||
178 | delete localDevice; | 187 | delete localDevice; |