videocollection/videocollectionview/src/videolistview.cpp
changeset 67 72c709219fcd
parent 66 adb51f74b890
--- a/videocollection/videocollectionview/src/videolistview.cpp	Tue Oct 05 09:26:49 2010 +0300
+++ b/videocollection/videocollectionview/src/videolistview.cpp	Fri Oct 15 16:29:10 2010 +0300
@@ -15,7 +15,7 @@
 *
 */
 
-// Version : %version: 113.1.15 %
+// Version : %version: mcl_114 %
 
 // INCLUDE FILES
 #include <hbinstance.h>
@@ -354,6 +354,15 @@
 	// can modify the mModelReady flag.
     showHint();
     updateSubLabel();
+
+    VideoCollectionCommon::TCollectionLevels level = mCurrentList->getLevel();
+    
+    if (level == VideoCollectionCommon::ELevelDefaultColl ||
+            level == VideoCollectionCommon::ELevelAlbum ||
+            level == VideoCollectionCommon::ELevelVideos)
+    {
+        updateMenuShowState();        
+    }    
 }
 
 // ---------------------------------------------------------------------------
@@ -585,12 +594,12 @@
 			    // no content label is shown instead.
 			    if (itemCount)
 			    {
-	                subLabel->setHeading(hbTrId("txt_videos_subtitle_all_videos_l1", itemCount));
+	                subLabel->setHeading(hbTrId("txt_videos_subtitle_all_videos_l1").arg( itemCount ) );
 			    }
 			}
 			else if (mCurrentList->getLevel() == VideoCollectionCommon::ELevelCategory)
 			{
-				subLabel->setHeading(hbTrId("txt_videos_subtitle_collections_l1", itemCount));
+				subLabel->setHeading(hbTrId("txt_videos_subtitle_collections_l1" ).arg( itemCount) );
 			}
 			else
 			{
@@ -602,6 +611,26 @@
 }
 
 // ---------------------------------------------------------------------------
+// updateMenuShowState()
+// ---------------------------------------------------------------------------
+//
+void VideoListView::updateMenuShowState()
+{
+    VideoProxyModelGeneric *model = mCurrentList->getModel();
+    
+    if (!model || !model->rowCount())
+    {
+        takeMenu();
+    }
+    else
+    {
+        // ensure that our menu is used
+        HbMenu *ourMenu = mUiLoader->findWidget<HbMenu>(DOCML_NAME_OPTIONS_MENU);
+        setMenu(ourMenu);
+    }
+}
+
+// ---------------------------------------------------------------------------
 // activateMainView()
 // ---------------------------------------------------------------------------
 //
@@ -753,9 +782,17 @@
 
         // the collection view is not empty, so we should hide the hint in advance.
         showHint(false);
-        
+
         // also update the sublabel immediatelly, as the data is up to date almost always.
         updateSubLabel();
+
+        // collection view has always some actions in menu -> ensure that our menu is set
+        HbMenu *ourMenu = mUiLoader->findWidget<HbMenu>(DOCML_NAME_OPTIONS_MENU);
+        if (menu() != ourMenu)
+        {
+            setMenu(ourMenu);
+        }
+        
     }
 }