mpviewplugins/mpcollectionviewplugin/src/mpcollectioncontainerallsongs.cpp
changeset 54 c5b304f4d89b
parent 48 af3740e3753f
equal deleted inserted replaced
48:af3740e3753f 54:c5b304f4d89b
    39 
    39 
    40 /*!
    40 /*!
    41  Constructs the collection container.
    41  Constructs the collection container.
    42  */
    42  */
    43 MpCollectionContainerAllSongs::MpCollectionContainerAllSongs( HbDocumentLoader *loader, QGraphicsItem *parent )
    43 MpCollectionContainerAllSongs::MpCollectionContainerAllSongs( HbDocumentLoader *loader, QGraphicsItem *parent )
    44     : MpCollectionListContainer(loader, parent),
    44     : MpCollectionListContainer(loader, parent)
    45       mInfoBar(0)
       
    46 {
    45 {
    47     TX_LOG
    46     TX_LOG
    48     mCollectionContext = ECollectionContextAllSongs;
    47     mCollectionContext = ECollectionContextAllSongs;
    49 }
    48 }
    50 
    49 
    52  Destructs the collection container.
    51  Destructs the collection container.
    53  */
    52  */
    54 MpCollectionContainerAllSongs::~MpCollectionContainerAllSongs()
    53 MpCollectionContainerAllSongs::~MpCollectionContainerAllSongs()
    55 {
    54 {
    56     TX_ENTRY
    55     TX_ENTRY
    57     delete mInfoBar;
       
    58     delete mList;
    56     delete mList;
    59     TX_EXIT
    57     TX_EXIT
    60 }
    58 }
    61 
    59 
    62 /*!
    60 /*!
    89  \reimp
    87  \reimp
    90  */
    88  */
    91 void MpCollectionContainerAllSongs::setupContainer()
    89 void MpCollectionContainerAllSongs::setupContainer()
    92 {
    90 {
    93     TX_ENTRY
    91     TX_ENTRY
       
    92     
       
    93     mDocumentLoader->load(QString(":/docml/musiccollection.docml"), "showInfoBar");
       
    94     
    94     if ( mCollectionData->count() ) {
    95     if ( mCollectionData->count() ) {
    95         bool ok = false;
    96         bool ok = false;
       
    97         QGraphicsWidget *widget;
       
    98         
    96         mDocumentLoader->load(QString(":/docml/musiccollection.docml"), "allSongs", &ok);
    99         mDocumentLoader->load(QString(":/docml/musiccollection.docml"), "allSongs", &ok);
    97         if ( !ok ) {
   100         if ( !ok ) {
    98             TX_LOG_ARGS("Error: invalid xml file.");
   101             TX_LOG_ARGS("Error: invalid xml file.");
    99             Q_ASSERT_X(ok, "MpCollectionContainerAllSongs::setupContainer", "invalid xml file");
   102             Q_ASSERT_X(ok, "MpCollectionContainerAllSongs::setupContainer", "invalid xml file");
   100         }
   103         }
   101         QGraphicsWidget *widget;
       
   102         widget = mDocumentLoader->findWidget(QString("allSongsDetail"));
       
   103         mInfoBar = qobject_cast<HbGroupBox*>(widget);
       
   104 
   104 
   105         widget = mDocumentLoader->findWidget(QString("allSongsList"));
   105         widget = mDocumentLoader->findWidget(QString("allSongsList"));
   106         mList = qobject_cast<HbListView*>(widget);
   106         mList = qobject_cast<HbListView*>(widget);
   107         mIndexFeedback->setItemView(mList);
   107         mIndexFeedback->setItemView(mList);
   108         initializeList();
   108         initializeList();
   109 
   109 
   110         QString details;
   110         QString details;
   111         if ( mViewMode == MpCommon::FetchView ) {
   111         if ( mViewMode == MpCommon::FetchView ) {
   112             details = hbTrId("txt_mus_subtitle_select_a_song");
   112             details = hbTrId("txt_mus_subtitle_select_song");
   113         }
   113         }
   114         else {
   114         else {
   115             int count = mCollectionData->count();
   115             details = hbTrId("txt_mus_subhead_songs_l1").arg(mCollectionData->count());
   116             details = hbTrId("txt_mus_subhead_songs_l1").arg( count );
       
   117         }
   116         }
   118         mInfoBar->setHeading(details);
   117         mInfoBar->setHeading(details);
   119     }
   118     }
   120     else {
   119     else {
       
   120         mInfoBar->setHeading(hbTrId("txt_mus_subhead_songs_l1").arg(0));
       
   121 
   121         // Call empty list from base class
   122         // Call empty list from base class
   122         setupEmptyListContainer();
   123         setupEmptyListContainer();
   123     }
   124     }
   124     TX_EXIT
   125     TX_EXIT
   125 }
   126 }