radioapp/radiowidgets/src/radiofrequencyscanner.cpp
changeset 32 189d20c34778
parent 28 075425b8d9a4
child 33 11b6825f0862
equal deleted inserted replaced
28:075425b8d9a4 32:189d20c34778
    98         static_cast<RadioMainView*>( parent() )->setScanningMode( true );
    98         static_cast<RadioMainView*>( parent() )->setScanningMode( true );
    99         frequencyStrip->setScanningMode( true );
    99         frequencyStrip->setScanningMode( true );
   100     } else {
   100     } else {
   101         RadioUtil::setScanStatus( Scan::ScanningInStationsView );
   101         RadioUtil::setScanStatus( Scan::ScanningInStationsView );
   102         mScanningProgressNote = new HbProgressDialog( HbProgressDialog::ProgressDialog );
   102         mScanningProgressNote = new HbProgressDialog( HbProgressDialog::ProgressDialog );
   103         mScanningProgressNote->setModal( true );
   103         mScanningProgressNote.data()->setModal( true );
   104         mScanningProgressNote->setAutoClose( true );
   104         mScanningProgressNote.data()->setAutoClose( true );
   105 
   105 
   106         // Add some extra to the maximum value to allow room for the station at the low band edge
   106         // Add some extra to the maximum value to allow room for the station at the low band edge
   107         mScanningProgressNote->setRange( mUiEngine.minFrequency(), mUiEngine.maxFrequency() + EXTRA_TO_PROGRESS_MAX_VALUE );
   107         mScanningProgressNote.data()->setRange( mUiEngine.minFrequency(), mUiEngine.maxFrequency() + EXTRA_TO_PROGRESS_MAX_VALUE );
   108         mScanningProgressNote->setProgressValue( mUiEngine.minFrequency() );
   108         mScanningProgressNote.data()->setProgressValue( mUiEngine.minFrequency() );
   109         mScanningProgressNote->setText( hbTrId( "txt_rad_info_searching_local_stations_please_wait" ) );
   109         mScanningProgressNote.data()->setText( hbTrId( "txt_rad_info_searching_local_stations_please_wait" ) );
   110         mScanningProgressNote->setAttribute( Qt::WA_DeleteOnClose, true );
   110         mScanningProgressNote.data()->setAttribute( Qt::WA_DeleteOnClose, true );
   111         mScanningProgressNote->open();
   111         mScanningProgressNote.data()->open();
   112 
   112 
   113         Radio::connect( mScanningProgressNote.data(),   SIGNAL(cancelled()),
   113         Radio::connect( mScanningProgressNote.data(),   SIGNAL(cancelled()),
   114                         this,                           SLOT(cancelScanning()) );
   114                         this,                           SLOT(cancelScanning()) );
   115     }
   115     }
   116 
   116 
   168         // Check for special case that can happen during scanning.
   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
   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
   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.
   171         // be lower than the previous one. The progress value is set to maximum when the scanner finishes.
   172         if ( frequency != mUiEngine.minFrequency() ) {
   172         if ( frequency != mUiEngine.minFrequency() ) {
   173             mScanningProgressNote->setProgressValue( frequency );
   173             mScanningProgressNote.data()->setProgressValue( frequency );
   174         }
   174         }
   175 
   175 
   176         mScannerEngine->continueScanning();
   176         mScannerEngine->continueScanning();
   177     }
   177     }
   178 }
   178 }
   233 
   233 
   234             Radio::connect( carousel,   SIGNAL(scrollingEnded()),
   234             Radio::connect( carousel,   SIGNAL(scrollingEnded()),
   235                             this,       SLOT(restoreUiControls()) );
   235                             this,       SLOT(restoreUiControls()) );
   236 
   236 
   237             const uint frequency = model.stationAt( 0 ).frequency();
   237             const uint frequency = model.stationAt( 0 ).frequency();
       
   238 
       
   239             mUiEngine.setFrequency( frequency, TuneReason::StationScanFinalize );
   238             frequencyStrip->setFrequency( frequency, TuneReason::StationScanFinalize, Scroll::Right );
   240             frequencyStrip->setFrequency( frequency, TuneReason::StationScanFinalize, Scroll::Right );
   239             carousel->setFrequency( frequency, TuneReason::StationScanFinalize, Scroll::Right );
   241             carousel->setFrequency( frequency, TuneReason::StationScanFinalize, Scroll::Right );
   240 
   242 
   241             frequencyStrip->setAutoScrollTime( mStripScrollTime );
   243             frequencyStrip->setAutoScrollTime( mStripScrollTime );
   242             carousel->setAutoScrollTime( mCarouselScrollTime );
   244             carousel->setAutoScrollTime( mCarouselScrollTime );
   258         }
   260         }
   259 
   261 
   260     } else {
   262     } else {
   261         if ( !mUserCanceled ) {
   263         if ( !mUserCanceled ) {
   262             if ( mScanningProgressNote ) {
   264             if ( mScanningProgressNote ) {
   263                 mScanningProgressNote->setProgressValue( mScanningProgressNote->maximum() );
   265                 mScanningProgressNote.data()->setProgressValue( mScanningProgressNote.data()->maximum() );
   264                 mScanningProgressNote->close();
   266                 mScanningProgressNote.data()->close();
   265             }
   267             }
   266 
   268 
   267             if ( stationCount == 0 ) {
   269             if ( stationCount == 0 ) {
   268                 HbMessageBox* box = new HbMessageBox( HbMessageBox::MessageTypeInformation );
   270                 HbMessageBox* box = new HbMessageBox( HbMessageBox::MessageTypeInformation );
   269                 box->setTimeout( HbPopup::NoTimeout );
   271                 box->setTimeout( HbPopup::NoTimeout );