mpviewplugins/mpdetailsviewplugin/src/mpdetailsview.cpp
changeset 37 eb79a7c355bf
parent 36 a0afa279b8fe
child 43 0f32e550d9d8
child 48 af3740e3753f
equal deleted inserted replaced
36:a0afa279b8fe 37:eb79a7c355bf
    19 #include <QGraphicsLayoutItem>
    19 #include <QGraphicsLayoutItem>
    20 #include <QUrl>
    20 #include <QUrl>
    21 #include <QDomElement>
    21 #include <QDomElement>
    22 #include <QList>
    22 #include <QList>
    23 #include <QFile>
    23 #include <QFile>
    24 #include <QTranslator>
       
    25 #include <QLocale>
       
    26 #include <QGraphicsLinearLayout>
    24 #include <QGraphicsLinearLayout>
    27 #include <QSizeF>
    25 #include <QSizeF>
    28 
    26 
    29 
    27 
    30 
    28 
    76       mShareButton(0),
    74       mShareButton(0),
    77       mDocumentLoader( 0 ),
    75       mDocumentLoader( 0 ),
    78       mDetailList(0),
    76       mDetailList(0),
    79       mInspireList(0),
    77       mInspireList(0),
    80       mInspireMeProgressBar(0),
    78       mInspireMeProgressBar(0),
    81       mMpTranslator( 0 ),
       
    82       mCommonTranslator( 0 ),
       
    83       mMpQueryManager( 0 ),
    79       mMpQueryManager( 0 ),
    84       mInspireMeQueryOngoing( false ),
    80       mInspireMeQueryOngoing( false ),
    85       mInspireMeQueryRendered( false ),
    81       mInspireMeQueryRendered( false ),
    86       mInspireMeOpen(true),
    82       mInspireMeOpen(true),
    87       mSongDetailsGbOpen(false)
    83       mSongDetailsGbOpen(false)
   172 MpDetailsView::~MpDetailsView()
   168 MpDetailsView::~MpDetailsView()
   173 {
   169 {
   174     TX_ENTRY
   170     TX_ENTRY
   175     delete mSoftKeyBack;
   171     delete mSoftKeyBack;
   176     delete mDocumentLoader;
   172     delete mDocumentLoader;
   177     delete mMpTranslator;
       
   178     delete mCommonTranslator;
       
   179     delete mMpQueryManager;
   173     delete mMpQueryManager;
   180 
   174 
   181 #ifdef SHARE_FUNC_ENABLED
   175 #ifdef SHARE_FUNC_ENABLED
   182     closeShareDialog();
   176     closeShareDialog();
   183 #endif
   177 #endif
   189  Initializes the details view. Allocates all resources needed by the view.
   183  Initializes the details view. Allocates all resources needed by the view.
   190  */
   184  */
   191 void MpDetailsView::initializeView()
   185 void MpDetailsView::initializeView()
   192 {
   186 {
   193     TX_ENTRY
   187     TX_ENTRY
   194 
       
   195     //Load musicplayer and common translators
       
   196     QString lang = QLocale::system().name();
       
   197     QString path = QString( "z:/resource/qt/translations/" );
       
   198     bool translatorLoaded = false;
       
   199 
       
   200     mCommonTranslator = new QTranslator( this );
       
   201     translatorLoaded = mCommonTranslator->load( path + "common_" + lang );
       
   202     TX_LOG_ARGS( "Loading common translator ok=" << translatorLoaded );
       
   203     if ( translatorLoaded ) {
       
   204         qApp->installTranslator( mCommonTranslator );
       
   205     }
       
   206 
       
   207     mMpTranslator = new QTranslator( this );
       
   208     translatorLoaded = mMpTranslator->load( path + "musicplayer_" + lang );
       
   209     TX_LOG_ARGS( "Loading translator ok=" << translatorLoaded );
       
   210     if ( translatorLoaded ) {
       
   211         qApp->installTranslator( mMpTranslator );
       
   212     }
       
   213 
   188 
   214     mSoftKeyBack = new HbAction( Hb::BackNaviAction, this );
   189     mSoftKeyBack = new HbAction( Hb::BackNaviAction, this );
   215 
   190 
   216     mMpEngine = MpEngineFactory::sharedEngine();
   191     mMpEngine = MpEngineFactory::sharedEngine();
   217     mSongData = mMpEngine->songData();
   192     mSongData = mMpEngine->songData();