radioapp/radiowidgets/src/radiohistoryview.cpp
changeset 51 bbebb0235466
parent 36 ba22309243a1
child 54 a8ba0c289b44
--- a/radioapp/radiowidgets/src/radiohistoryview.cpp	Fri Sep 03 12:25:04 2010 +0300
+++ b/radioapp/radiowidgets/src/radiohistoryview.cpp	Mon Sep 20 18:04:48 2010 +0300
@@ -42,7 +42,7 @@
 };
 const Song KRecognizedSongs[] = {
     { "Red Hot Chili Peppers", "Under The Bridge" },
-    { "Queens Of The Stone Age", "No One Knows" },
+    { "", "No One Knows" },
     { "The Presidents of the United States of America", "Dune Buggy" },
     { "System of a Down", "Aerials" },
     { "The White Stripes", "Seven Nation Army" },
@@ -265,8 +265,7 @@
     mHistoryList->setModel( historyModel );
     mHistoryList->setSelectionMode( HbListView::NoSelection );
     mHistoryList->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding );
-    //TODO: Uncomment after MCL wk28 release to improve scrolling FPS rate
-    //mHistoryList->setItemPixmapCacheEnabled( true );
+    mHistoryList->setItemPixmapCacheEnabled( true ); // Improves scrolling FPS rate
 
     mAllSongsButton = mUiLoader->findObject<HbAction>( DOCML::HV_NAME_ALL_SONGS_BUTTON );
     mTaggedSongsButton = mUiLoader->findObject<HbAction>( DOCML::HV_NAME_TAGGED_SONGS_BUTTON );
@@ -290,13 +289,8 @@
     connectCommonMenuItem( MenuItem::Exit );
     connectCommonMenuItem( MenuItem::UseLoudspeaker );
 
-    // Context menu actions
-    connectXmlElement( DOCML::HV_NAME_TOGGLE_TAG_ACTION,    SIGNAL(triggered()),
-                       this,                                SLOT(toggleTagging()) );
-    connectXmlElement( DOCML::HV_NAME_OVI_STORE_ACTION,     SIGNAL(triggered()),
-                       this,                                SLOT(openOviStore()) );
-    connectXmlElement( DOCML::HV_NAME_OTHER_STORE_ACTION,   SIGNAL(triggered()),
-                       this,                                SLOT(openOtherStore()) );
+    initContextMenu();
+
     initBackAction();
 
     updateViewMode();
@@ -335,6 +329,24 @@
 /*!
  *
  */
+void RadioHistoryView::initContextMenu()
+{
+    // Context menu actions
+    connectXmlElement( DOCML::HV_NAME_TOGGLE_TAG_ACTION,    SIGNAL(triggered()),
+                       this,                                SLOT(toggleTagging()) );
+    connectXmlElement( DOCML::HV_NAME_OVI_STORE_ACTION,     SIGNAL(triggered()),
+                       this,                                SLOT(openOviStore()) );
+
+    // TODO: Get additional music stores. For now use "Amazon" for demonstration purposes
+    const QString otherStoreFormatter = hbTrId( "txt_rad_menu_search_from_other_store" );
+    if ( HbMenu* contextMenu = mUiLoader->findObject<HbMenu>( DOCML::HV_NAME_CONTEXT_MENU ) ) {
+        contextMenu->addAction( otherStoreFormatter.arg( "Amazon" ), this, SLOT(openOtherStore()) );
+    }
+}
+
+/*!
+ *
+ */
 RadioHistoryModel& RadioHistoryView::historyModel() const
 {
     return *static_cast<RadioHistoryModel*>( mHistoryList->model() );