radioapp/radiowidgets/src/radiowindow.cpp
changeset 38 f8c3d4e6102c
parent 34 bc10a61bd7d3
child 47 74b7c6e79031
equal deleted inserted replaced
36:ba22309243a1 38:f8c3d4e6102c
    66 }
    66 }
    67 
    67 
    68 /*!
    68 /*!
    69  *
    69  *
    70  */
    70  */
    71 void RadioWindow::init( QSystemDeviceInfo* deviceInfo )
    71 void RadioWindow::init()
    72 {
    72 {
    73     mDeviceInfo.reset( deviceInfo );
       
    74 
       
    75     Radio::connect( this,                   SIGNAL(viewReady()),
    73     Radio::connect( this,                   SIGNAL(viewReady()),
    76                     this,                   SLOT(initView()) );
    74                     this,                   SLOT(initView()) );
    77     Radio::connect( mDeviceInfo.data(),     SIGNAL(currentProfileChanged(QSystemDeviceInfo::Profile)),
       
    78                     this,                   SLOT(queryOfflineUsage(QSystemDeviceInfo::Profile)) );
       
    79 
    75 
    80     activateMainView();
    76     activateMainView();
    81 }
    77 }
    82 
    78 
    83 /*!
    79 /*!
   209         mMessageBox.reset();
   205         mMessageBox.reset();
   210     }
   206     }
   211 }
   207 }
   212 
   208 
   213 /*!
   209 /*!
   214  * Private slot
       
   215  *
       
   216  */
       
   217 void RadioWindow::queryOfflineUsage( QSystemDeviceInfo::Profile profile )
       
   218 {
       
   219     if ( profile == QSystemDeviceInfo::OfflineProfile ) {
       
   220         bool okToContinue = false;
       
   221         HbDeviceMessageBox box( hbTrId( "txt_rad_info_continue_using_the_radio_in_offline" ), HbMessageBox::MessageTypeQuestion );
       
   222         box.setTimeout( HbPopup::NoTimeout );
       
   223         box.exec();
       
   224 
       
   225         okToContinue = box.isAcceptAction( box.triggeredAction() );
       
   226 
       
   227         if ( okToContinue ) {
       
   228             // Radio stays on
       
   229         } else {
       
   230             qApp->quit(); // Close radio
       
   231         }
       
   232     } // other profiles are not interesting
       
   233 }
       
   234 
       
   235 /*!
       
   236  *
   210  *
   237  */
   211  */
   238 void RadioWindow::activateView( RadioViewBase* aMember, const QString& docmlFile, Hb::ViewSwitchFlags flags )
   212 void RadioWindow::activateView( RadioViewBase* aMember, const QString& docmlFile, Hb::ViewSwitchFlags flags )
   239 {
   213 {
   240     LOG_METHOD;
   214     LOG_METHOD;