radioapp/radiowidgets/src/radioviewbase.cpp
changeset 14 63aabac4416d
parent 13 46974bebc798
child 16 f54ebcfc1b80
equal deleted inserted replaced
13:46974bebc798 14:63aabac4416d
    13 *
    13 *
    14 * Description:
    14 * Description:
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 #include <hbmenu.h>
    18 #include <HbMenu>
    19 #include <hbaction.h>
    19 #include <HbAction>
    20 #include <hbeffect.h>
    20 #include <HbEffect>
    21 #include <qcoreapplication>
    21 #include <QCoreApplication>
    22 
    22 
    23 #include "radioviewbase.h"
    23 #include "radioviewbase.h"
    24 #include "radiomainwindow.h"
    24 #include "radiomainwindow.h"
    25 #include "radiostationmodel.h"
    25 #include "radiostationmodel.h"
    26 #include "radioxmluiloader.h"
    26 #include "radioxmluiloader.h"
    36     mMainWindow( 0 ),
    36     mMainWindow( 0 ),
    37     mModel( 0 ),
    37     mModel( 0 ),
    38     mUiLoader( uiLoader ),
    38     mUiLoader( uiLoader ),
    39     mTransientView( transient ),
    39     mTransientView( transient ),
    40     mUseLoudspeakerAction( 0 ),
    40     mUseLoudspeakerAction( 0 ),
    41     mSecondarySoftkeyction( 0 ),
       
    42     mOrientation( Qt::Vertical )
    41     mOrientation( Qt::Vertical )
    43 {
    42 {
    44 }
    43 }
    45 
    44 
    46 /*!
    45 /*!
    73 }
    72 }
    74 
    73 
    75 /*!
    74 /*!
    76  *
    75  *
    77  */
    76  */
    78 void RadioViewBase::initSecondarySoftkey()
       
    79 {
       
    80     // The default back button activates the tuning view
       
    81     mSecondarySoftkeyction = new HbAction( Hb::BackAction, this );
       
    82     connectAndTest( mSecondarySoftkeyction, SIGNAL(triggered()),
       
    83                     mMainWindow,            SLOT(activateTuningView()) );
       
    84 }
       
    85 
       
    86 /*!
       
    87  *
       
    88  */
       
    89 HbAction* RadioViewBase::secondarySoftkey() const
       
    90 {
       
    91     return mSecondarySoftkeyction;
       
    92 }
       
    93 
       
    94 /*!
       
    95  *
       
    96  */
       
    97 void RadioViewBase::updateOrientation( Qt::Orientation orientation, bool forceUpdate )
    77 void RadioViewBase::updateOrientation( Qt::Orientation orientation, bool forceUpdate )
    98 {
    78 {
    99     if ( orientation != mOrientation || forceUpdate )
    79     if ( orientation != mOrientation || forceUpdate ) {
   100     {
       
   101         mOrientation = orientation;
    80         mOrientation = orientation;
   102         setOrientation();
    81         setOrientation();
   103     }
    82     }
   104 }
    83 }
   105 
    84 
   108  *
    87  *
   109  */
    88  */
   110 void RadioViewBase::updateAudioRouting( bool loudspeaker )
    89 void RadioViewBase::updateAudioRouting( bool loudspeaker )
   111 {
    90 {
   112     if ( mUseLoudspeakerAction ) {
    91     if ( mUseLoudspeakerAction ) {
   113         mUseLoudspeakerAction->setText( loudspeaker ? TRANSLATE( KMenuUseHeadset ) : TRANSLATE( KMenuUseLoudspeaker ) );
    92         mUseLoudspeakerAction->setText( loudspeaker ? hbTrId( "txt_common_opt_deactivate_loudspeaker" )
       
    93                                                     : hbTrId( "txt_common_opt_activate_loudspeaker" ) );
   114     }
    94     }
   115 }
    95 }
   116 
    96 
   117 /*!
    97 /*!
   118  * Protected slot
    98  * Protected slot
   128  *
   108  *
   129  */
   109  */
   130 void RadioViewBase::quit()
   110 void RadioViewBase::quit()
   131 {
   111 {
   132     qApp->quit();
   112     qApp->quit();
       
   113 }
       
   114 
       
   115 /*!
       
   116  *
       
   117  */
       
   118 void RadioViewBase::initBackAction()
       
   119 {
       
   120     // The default back button activates the tuning view
       
   121     HbAction* backAction = new HbAction( Hb::BackNaviAction, this );
       
   122     connectAndTest( backAction,     SIGNAL(triggered()),
       
   123                     mMainWindow,    SLOT(activateTuningView()) );
       
   124     setNavigationAction( backAction );    
   133 }
   125 }
   134 
   126 
   135 /*!
   127 /*!
   136  *
   128  *
   137  */
   129  */