author | hgs |
Fri, 06 Aug 2010 09:29:48 +0300 | |
changeset 39 | ac7857bd5fdb |
parent 34 | bc10a61bd7d3 |
child 47 | 74b7c6e79031 |
permissions | -rw-r--r-- |
24 | 1 |
/* |
2 |
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 |
* All rights reserved. |
|
4 |
* This component and the accompanying materials are made available |
|
5 |
* under the terms of "Eclipse Public License v1.0" |
|
6 |
* which accompanies this distribution, and is available |
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 |
* |
|
9 |
* Initial Contributors: |
|
10 |
* Nokia Corporation - initial contribution. |
|
11 |
* |
|
12 |
* Contributors: |
|
13 |
* |
|
14 |
* Description: |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
// System includes |
|
19 |
#include <HbProgressDialog> |
|
20 |
#include <QTimer> |
|
21 |
#include <HbLabel> |
|
22 |
#include <HbPushButton> |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
23 |
#include <HbMessageBox> |
24 | 24 |
|
25 |
// User includes |
|
26 |
#include "radiofrequencyscanner.h" |
|
27 |
#include "radioscannerengine.h" |
|
28 |
#include "radiouiengine.h" |
|
29 |
#include "radiologger.h" |
|
30 |
#include "radiostationmodel.h" |
|
31 |
#include "radiofrequencystrip.h" |
|
32 |
#include "radiostationcarousel.h" |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
33 |
#include "radioutil.h" |
24 | 34 |
#include "radiomainview.h" |
35 |
||
36 |
// Constants |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
37 |
const int EXTRA_TO_PROGRESS_MAX_VALUE = 100000; |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
38 |
const int CAROUSEL_FINISH_SCROLL_TIME = 1000; |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
39 |
const int STRIP_FINISH_SCROLL_TIME = 1100; |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
40 |
const int CAROUSEL_SCROLL_TIME = 1000; |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
41 |
const int STRIP_SCROLL_TIME = 1100; |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
42 |
const int START_DELAY = 1000; |
24 | 43 |
|
44 |
/*! |
|
45 |
* |
|
46 |
*/ |
|
47 |
RadioFrequencyScanner::RadioFrequencyScanner( RadioUiEngine& uiEngine, QObject* parent ) : |
|
48 |
QObject( parent ), |
|
49 |
mUiEngine( uiEngine ), |
|
50 |
mInMainView( parent->metaObject()->className() == RadioMainView::staticMetaObject.className() ), |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
51 |
mScannerEngine( mUiEngine.createScannerEngine() ), |
24 | 52 |
mStripScrollTime( 0 ), |
53 |
mCarouselScrollTime( 0 ), |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
54 |
mIsAlive( false ), |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
55 |
mUserCanceled( false ) |
24 | 56 |
{ |
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
57 |
RadioUtil::setFrequencyScanner( this ); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
58 |
|
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
59 |
Radio::connect( mScannerEngine.data(), SIGNAL(stationFound(RadioStation)), |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
60 |
this, SLOT(updateScanProgress(RadioStation)) ); |
24 | 61 |
} |
62 |
||
63 |
/*! |
|
64 |
* |
|
65 |
*/ |
|
66 |
RadioFrequencyScanner::~RadioFrequencyScanner() |
|
67 |
{ |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
68 |
RadioUtil::setScanStatus( Scan::NotScanning ); |
24 | 69 |
} |
70 |
||
71 |
/*! |
|
72 |
* |
|
73 |
*/ |
|
74 |
void RadioFrequencyScanner::startScanning() |
|
75 |
{ |
|
76 |
mIsAlive = true; |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
77 |
RadioFrequencyStrip* frequencyStrip = RadioUtil::frequencyStrip(); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
78 |
RadioStationCarousel* carousel = RadioUtil::carousel(); |
24 | 79 |
|
80 |
if ( mInMainView ) { |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
81 |
|
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
82 |
// If this is the first time start, bring application to foreground |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
83 |
if ( mUiEngine.isFirstTimeStart() ) { |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
84 |
static_cast<RadioMainView*>( parent() )->bringToForeground(); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
85 |
} |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
86 |
|
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
87 |
RadioUtil::setScanStatus( Scan::ScanningInMainView ); |
24 | 88 |
mStripScrollTime = frequencyStrip->autoScrollTime(); |
89 |
mCarouselScrollTime = carousel->autoScrollTime(); |
|
90 |
||
91 |
carousel->setScanningMode( true ); |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
92 |
carousel->setAutoScrollTime( CAROUSEL_SCROLL_TIME ); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
93 |
frequencyStrip->setAutoScrollTime( STRIP_SCROLL_TIME ); |
24 | 94 |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
95 |
Radio::connect( carousel, SIGNAL(scanAnimationFinished()), |
24 | 96 |
this, SLOT(continueScanning()) ); |
97 |
||
98 |
static_cast<RadioMainView*>( parent() )->setScanningMode( true ); |
|
99 |
frequencyStrip->setScanningMode( true ); |
|
100 |
} else { |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
101 |
RadioUtil::setScanStatus( Scan::ScanningInStationsView ); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
102 |
mScanningProgressNote = new HbProgressDialog( HbProgressDialog::ProgressDialog ); |
34 | 103 |
mScanningProgressNote.data()->setModal( true ); |
104 |
mScanningProgressNote.data()->setAutoClose( true ); |
|
24 | 105 |
|
106 |
// Add some extra to the maximum value to allow room for the station at the low band edge |
|
34 | 107 |
mScanningProgressNote.data()->setRange( mUiEngine.minFrequency(), mUiEngine.maxFrequency() + EXTRA_TO_PROGRESS_MAX_VALUE ); |
108 |
mScanningProgressNote.data()->setProgressValue( mUiEngine.minFrequency() ); |
|
109 |
mScanningProgressNote.data()->setText( hbTrId( "txt_rad_info_searching_local_stations_please_wait" ) ); |
|
110 |
mScanningProgressNote.data()->setAttribute( Qt::WA_DeleteOnClose, true ); |
|
111 |
mScanningProgressNote.data()->open(); |
|
24 | 112 |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
113 |
Radio::connect( mScanningProgressNote.data(), SIGNAL(cancelled()), |
24 | 114 |
this, SLOT(cancelScanning()) ); |
115 |
} |
|
116 |
||
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
117 |
QTimer::singleShot( START_DELAY, this, SLOT(delayedStart()) ); |
24 | 118 |
} |
119 |
||
120 |
/*! |
|
121 |
* |
|
122 |
*/ |
|
123 |
bool RadioFrequencyScanner::isAlive() const |
|
124 |
{ |
|
125 |
return mIsAlive; |
|
126 |
} |
|
127 |
||
128 |
/*! |
|
129 |
* Public slot |
|
130 |
* |
|
131 |
*/ |
|
132 |
void RadioFrequencyScanner::cancelScanning() |
|
133 |
{ |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
134 |
mUserCanceled = true; |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
135 |
RadioUtil::carousel()->cancelAnimation(); |
24 | 136 |
finishScanning(); |
137 |
} |
|
138 |
||
139 |
/*! |
|
140 |
* Private slot |
|
141 |
* |
|
142 |
*/ |
|
143 |
void RadioFrequencyScanner::delayedStart() |
|
144 |
{ |
|
145 |
mScannerEngine->startScanning(); |
|
146 |
} |
|
147 |
||
148 |
/*! |
|
149 |
* Private slot |
|
150 |
* |
|
151 |
*/ |
|
152 |
void RadioFrequencyScanner::updateScanProgress( const RadioStation& station ) |
|
153 |
{ |
|
154 |
if ( !station.isValid() ) { |
|
155 |
finishScanning(); |
|
156 |
return; |
|
157 |
} |
|
158 |
||
159 |
const uint frequency = station.frequency(); |
|
160 |
LOG_FORMAT( "RadioFrequencyScanner::updateScanAndSaveProgress frequency: %d", frequency ); |
|
161 |
||
162 |
if ( mInMainView ) { |
|
163 |
||
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
164 |
RadioUtil::frequencyStrip()->setFrequency( frequency, TuneReason::StationScan ); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
165 |
RadioUtil::carousel()->animateNewStation( station ); |
24 | 166 |
|
167 |
} else { |
|
168 |
// Check for special case that can happen during scanning. |
|
169 |
// If there is a valid radio station at the low frequency band edge it will be reported last after |
|
170 |
// all of the higher frequencies. We don't update the progress value here because the value would |
|
171 |
// be lower than the previous one. The progress value is set to maximum when the scanner finishes. |
|
172 |
if ( frequency != mUiEngine.minFrequency() ) { |
|
34 | 173 |
mScanningProgressNote.data()->setProgressValue( frequency ); |
24 | 174 |
} |
175 |
||
176 |
mScannerEngine->continueScanning(); |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
177 |
} |
24 | 178 |
} |
179 |
||
180 |
/*! |
|
181 |
* Private slot |
|
182 |
* |
|
183 |
*/ |
|
184 |
void RadioFrequencyScanner::continueScanning() |
|
185 |
{ |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
186 |
if ( !mUserCanceled ) { |
39 | 187 |
RadioUtil::frequencyStrip()->addScannedStation( mUiEngine.stationModel().currentStation().frequency() ); |
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
188 |
mScannerEngine->continueScanning(); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
189 |
} |
24 | 190 |
} |
191 |
||
192 |
/*! |
|
193 |
* Private slot |
|
194 |
* |
|
195 |
*/ |
|
196 |
void RadioFrequencyScanner::restoreUiControls() |
|
197 |
{ |
|
198 |
if ( mInMainView ) { |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
199 |
disconnect( RadioUtil::carousel(), SIGNAL(scrollingEnded()), this, 0 ); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
200 |
|
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
201 |
RadioUtil::frequencyStrip()->setScanningMode( false ); |
24 | 202 |
static_cast<RadioMainView*>( parent() )->setScanningMode( false ); |
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
203 |
RadioUtil::carousel()->setScanningMode( false ); |
24 | 204 |
} |
205 |
||
206 |
deleteLater(); |
|
207 |
} |
|
208 |
||
209 |
/*! |
|
210 |
* |
|
211 |
*/ |
|
212 |
void RadioFrequencyScanner::finishScanning() |
|
213 |
{ |
|
214 |
mScannerEngine->cancel(); |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
215 |
RadioUtil::setScanStatus( Scan::NotScanning ); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
216 |
RadioUtil::setFrequencyScanner( NULL ); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
217 |
RadioFrequencyStrip* frequencyStrip = RadioUtil::frequencyStrip(); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
218 |
RadioStationCarousel* carousel = RadioUtil::carousel(); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
219 |
|
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
220 |
disconnect( mScannerEngine.data(), SIGNAL(stationFound(RadioStation)), this, 0 ); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
221 |
|
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
222 |
RadioStationModel& model = mUiEngine.stationModel(); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
223 |
const int stationCount = model.rowCount(); |
24 | 224 |
|
225 |
if ( mInMainView ) { |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
226 |
|
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
227 |
disconnect( carousel, SIGNAL(scanAnimationFinished()), this, 0 ); |
24 | 228 |
|
229 |
// Scroll the carousel and frequency strip through all of the scanned stations |
|
230 |
if ( stationCount > 1 ) { |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
231 |
frequencyStrip->setAutoScrollTime( STRIP_FINISH_SCROLL_TIME ); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
232 |
carousel->setAutoScrollTime( CAROUSEL_FINISH_SCROLL_TIME ); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
233 |
|
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
234 |
Radio::connect( carousel, SIGNAL(scrollingEnded()), |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
235 |
this, SLOT(restoreUiControls()) ); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
236 |
|
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
237 |
const uint frequency = model.stationAt( 0 ).frequency(); |
34 | 238 |
|
239 |
mUiEngine.setFrequency( frequency, TuneReason::StationScanFinalize ); |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
240 |
frequencyStrip->setFrequency( frequency, TuneReason::StationScanFinalize, Scroll::Right ); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
241 |
carousel->setFrequency( frequency, TuneReason::StationScanFinalize, Scroll::Right ); |
24 | 242 |
|
243 |
frequencyStrip->setAutoScrollTime( mStripScrollTime ); |
|
244 |
carousel->setAutoScrollTime( mCarouselScrollTime ); |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
245 |
} else { |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
246 |
const uint frequency = mUiEngine.minFrequency(); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
247 |
frequencyStrip->setFrequency( frequency, TuneReason::Unspecified ); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
248 |
carousel->setFrequency( frequency, TuneReason::Unspecified ); |
24 | 249 |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
250 |
if ( !mUserCanceled ) { |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
251 |
HbMessageBox* box = new HbMessageBox( HbMessageBox::MessageTypeInformation ); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
252 |
box->setTimeout( HbPopup::NoTimeout ); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
253 |
box->setText( hbTrId( "txt_rad_dpophead_no_stations_found_try_searching" ) ); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
254 |
box->setDismissPolicy( HbPopup::NoDismiss ); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
255 |
box->setAttribute( Qt::WA_DeleteOnClose, true ); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
256 |
box->open(); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
257 |
} |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
258 |
|
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
259 |
restoreUiControls(); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
260 |
} |
24 | 261 |
|
262 |
} else { |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
263 |
if ( !mUserCanceled ) { |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
264 |
if ( mScanningProgressNote ) { |
34 | 265 |
mScanningProgressNote.data()->setProgressValue( mScanningProgressNote.data()->maximum() ); |
266 |
mScanningProgressNote.data()->close(); |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
267 |
} |
24 | 268 |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
269 |
if ( stationCount == 0 ) { |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
270 |
HbMessageBox* box = new HbMessageBox( HbMessageBox::MessageTypeInformation ); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
271 |
box->setTimeout( HbPopup::NoTimeout ); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
272 |
box->setText( hbTrId( "txt_rad_dpophead_no_stations_found_try_searching" ) ); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
273 |
box->setDismissPolicy( HbPopup::NoDismiss ); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
274 |
box->setAttribute( Qt::WA_DeleteOnClose, true ); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
275 |
box->open(); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
276 |
} |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
277 |
} |
34 | 278 |
const uint frequency = model.stationAt( 0 ).frequency(); |
279 |
mUiEngine.setFrequency( frequency, TuneReason::StationScanFinalize ); |
|
24 | 280 |
} |
281 |
||
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
282 |
mIsAlive = false; |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
283 |
emit frequencyScannerFinished(); |
24 | 284 |
|
28
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
285 |
if ( !mInMainView ) { |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
286 |
if ( mUserCanceled ) { |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
287 |
deleteLater(); |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
288 |
} else { |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
289 |
delete this; //TODO: Remove this weird hack once the problem with deleteLater is clear |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
290 |
} |
075425b8d9a4
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
24
diff
changeset
|
291 |
} |
24 | 292 |
} |