ui/viewmanagement/viewmanager/src/glxmenumanager.cpp
changeset 49 f291796e213d
parent 29 2c833fc9e98f
child 50 a0f57508af73
child 55 fb37077c270f
--- a/ui/viewmanagement/viewmanager/src/glxmenumanager.cpp	Wed Jun 23 18:12:48 2010 +0300
+++ b/ui/viewmanagement/viewmanager/src/glxmenumanager.cpp	Tue Jul 06 14:16:16 2010 +0300
@@ -20,7 +20,8 @@
 #include <hbaction.h>
 #include <hbmenu.h>
 #include <hbmainwindow.h>
-
+#include <featdiscovery.h>
+#include <publicruntimeids.hrh>
 //user include
 #include "glxviewids.h"
 #include "glxmenumanager.h"
@@ -29,7 +30,6 @@
 #include "glxlocalisationstrings.h"
 
 
-
 GlxMenuManager::GlxMenuManager(HbMainWindow* mainWindow)
     : mModel( 0),
       mMainWindow( mainWindow ),
@@ -48,11 +48,13 @@
     
     action = menu->addAction(GLX_OPTION_MARK_ALL);
     action->setData(EGlxCmdMarkAll);
+    action->setObjectName( "Menu MarkAll" );
     connect(action, SIGNAL(triggered()), this, SLOT(menuItemSelected()));
     
     action = menu->addAction(GLX_OPTION_UN_MARK_ALL);
     action->setDisabled(true);  //Dim UnMarkAll when no images are marked
     action->setData(EGlxCmdUnMarkAll);
+    action->setObjectName( "Menu UnMarkAll" );
     connect(action, SIGNAL(triggered()), this, SLOT(menuItemSelected()));    
 }
 
@@ -61,11 +63,12 @@
     QList<QAction*> actionList = menu->actions();
     for ( int i = 0 ; i < actionList.count(); i++) {
         if(actionList.at(i)->data()==EGlxCmdUnMarkAll) {
-               actionList.at(i)->setDisabled(disable);
-               break;
+            actionList.at(i)->setDisabled(disable);
+            break;
         }
      }
 }
+
 void GlxMenuManager::addMenu(qint32 viewId, HbMenu* menu)
 {
     switch(viewId) {
@@ -108,29 +111,39 @@
 {
     qDebug()<<"GlxMenuManager::CreateGridMenu";
     HbAction *action = NULL;
+    menu->setObjectName( "GridMenu" );
     
     action = menu->addAction(GLX_OPTION_SHARE);
     action->setData(EGlxCmdSend);
+    action->setObjectName( "GridMenu Send" );
     connect(action, SIGNAL(triggered()), this, SLOT(menuItemSelected()));
    
     mSubMenu = menu->addMenu(GLX_OPTION_SLIDESHOW);
+    mSubMenu->setObjectName( "GridMenu SlideShow" );
+	
     action = mSubMenu->addAction(GLX_OPTION_SS_PLAY); 
     action->setData(EGlxCmdFirstSlideshow);
+    action->setObjectName( "GridMenu Play" );
     connect(action, SIGNAL(triggered()), this, SLOT(menuItemSelected()));
     
     action = mSubMenu->addAction(GLX_OPTION_SS_SETTINGS);
     action->setData(EGlxCmdSlideshowSettings);
+    action->setObjectName( "GridMenu Setting" );
     connect(action, SIGNAL(triggered()), this, SLOT(menuItemSelected())); 
+    
     action = menu->addAction(GLX_OPTION_ADD_TO_ALBUM);
     action->setData(EGlxCmdAddToAlbum);
+    action->setObjectName( "GridMenu AddToAlbum" );
     connect(action, SIGNAL(triggered()), this, SLOT(menuItemSelected()));
     
     action = menu->addAction(GLX_OPTION_REMOVE_FROM_ALBUM);
     action->setData(EGlxCmdRemoveFrom);
+    action->setObjectName( "GridMenu RemoveAlbum" );
     connect(action, SIGNAL(triggered()), this, SLOT(menuItemSelected()));
 
     action = menu->addAction(GLX_OPTION_DELETE);
     action->setData(EGlxCmdDelete);
+    action->setObjectName( "GridMenu Delete" );
     connect(action, SIGNAL(triggered()), this, SLOT(menuItemSelected()));
 }
 
@@ -138,9 +151,11 @@
 {
     qDebug()<<"GlxMenuManager::CreateListMenu";
     HbAction *action = NULL;
+    menu->setObjectName( "Listmenu" );
     
     action = menu->addAction(GLX_OPTION_NEW_ALBUM);
     action->setData(EGlxCmdAddMedia);
+    action->setObjectName( "ListMenu NewAlbum" );
     connect(action, SIGNAL(triggered()), this, SLOT(menuItemSelected()));
 }
 
@@ -148,21 +163,47 @@
 {
     qDebug()<<"GlxMenuManager::CreateFullscreenMenu";
     HbAction *action = NULL;
+    menu->setObjectName( "FSMenu" );
     
     action = menu->addAction(GLX_OPTION_SHARE);
     action->setData(EGlxCmdSend);
+    action->setObjectName( "FSMenu Share" );
     connect(action, SIGNAL(triggered()), this, SLOT(menuItemSelected()));
     
     mSubMenu = menu->addMenu(GLX_OPTION_SLIDESHOW);
-    action = mSubMenu->addAction(GLX_OPTION_SS_PLAY); 
+    mSubMenu->setObjectName( "FSMenu SlideShow" );
+    
+    action = mSubMenu->addAction(GLX_OPTION_SS_PLAY);
     action->setData(EGlxCmdSelectSlideshow);
-    connect(action, SIGNAL(triggered()), this, SLOT(menuItemSelected())); 
+    action->setObjectName( "FSMenu Play" );
+    connect(action, SIGNAL(triggered()), this, SLOT(menuItemSelected()));
+    
     action = mSubMenu->addAction(GLX_OPTION_SS_SETTINGS);
     action->setData(EGlxCmdSlideshowSettings);
+    action->setObjectName( "FSMenu Setting" );
     connect(action, SIGNAL(triggered()), this, SLOT(menuItemSelected()));
+#ifndef __WINSCW__
+	CFeatureDiscovery* featManager = CFeatureDiscovery::NewL();
+    if(featManager->IsFeatureSupportedL(KFeatureIdFfImageEditor))
+        {
+		mSubMenu = menu->addMenu(QString("Rotate"));
+		action = mSubMenu->addAction(QString("90 CW")); 
+		action->setData(EGlxCmdRotateImgCW);
+		connect(action, SIGNAL(triggered()), this, SLOT(menuItemSelected())); 
+		action = mSubMenu->addAction(QString("90 CCW"));
+		action->setData(EGlxCmdRotateImgCCW);
+		connect(action, SIGNAL(triggered()), this, SLOT(menuItemSelected()));
+		
+		action = menu->addAction(QString("Crop"));
+		action->setData(EGlxCmdRotateImgCrop);
+		connect(action, SIGNAL(triggered()), this, SLOT(menuItemSelected()));   
+        }
+    delete featManager;
+#endif //__WINSCW__	
     
     action = menu->addAction(GLX_OPTION_ADD_TO_ALBUM);
     action->setData(EGlxCmdAddToAlbum);
+    action->setObjectName( "FSMenu AddToAlbum" );
     connect(action, SIGNAL(triggered()), this, SLOT(menuItemSelected()));
 }
 
@@ -249,30 +290,36 @@
 {
     qDebug("GlxMenuManager::showContextMenu " );
     mContextMenu = new HbMenu();
+    mContextMenu->setObjectName( "ContextMenu" );
     HbAction *action = NULL;
 
     switch ( viewId ) {
 	    case GLX_GRIDVIEW_ID :
 	        action = mContextMenu->addAction(GLX_MENU_SHARE);
 	        action->setData(EGlxCmdContextSend);
+	        action->setObjectName( "CM Send" );
 	        connect(action, SIGNAL(triggered()), this, SLOT(menuItemSelected()));
 	        
 	        action = mContextMenu->addAction(GLX_MENU_SLIDESHOW);
 	        action->setData(EGlxCmdSelectSlideshow);
+	        action->setObjectName( "CM SlideShow" );
 	        connect(action, SIGNAL(triggered()), this, SLOT(menuItemSelected()));
 
 	        if ( viewSubState() == ALBUM_ITEM_S ) {        
-	        action = mContextMenu->addAction(GLX_OPTION_REMOVE_FROM_ALBUM);
-	        action->setData(EGlxCmdContextRemoveFrom);
-	        connect(action, SIGNAL(triggered()), this, SLOT(menuItemSelected()));
+                action = mContextMenu->addAction(GLX_OPTION_REMOVE_FROM_ALBUM);
+                action->setData(EGlxCmdContextRemoveFrom);
+                action->setObjectName( "CM RemoveAlbum" );
+                connect(action, SIGNAL(triggered()), this, SLOT(menuItemSelected()));
 	        }
 	        
 	        action = mContextMenu->addAction(GLX_MENU_ADD_TO_ALBUM);
 		    action->setData(EGlxCmdContextAddToAlbum);
+		    action->setObjectName( "CM AddToAlbum" );
 		    connect(action, SIGNAL(triggered()), this, SLOT(menuItemSelected()));
 		    
 		    action = mContextMenu->addAction(GLX_MENU_DELETE);
 		    action->setData(EGlxCmdContextDelete);
+		    action->setObjectName( "CM Delete" );
 		    connect(action, SIGNAL(triggered()), this, SLOT(menuItemSelected()));
 			break;
 	    	
@@ -286,6 +333,7 @@
 	        if ( count ) {
                 action = mContextMenu->addAction(GLX_MENU_SLIDESHOW);
                 action->setData(EGlxCmdAlbumSlideShow);
+                action->setObjectName( "CM Album SlideShow" );
                 connect(action, SIGNAL(triggered()), this, SLOT(menuItemSelected()));
 	        }
 	        
@@ -293,10 +341,12 @@
             if ( variant.isValid() &&  variant.canConvert<bool> () && ( variant.value<bool>() == false ) ) {           
                 action = mContextMenu->addAction(GLX_MENU_RENAME);
                 action->setData(EGlxCmdContextRename);
+                action->setObjectName( "CM Rename" );
                 connect(action, SIGNAL(triggered()), this, SLOT(menuItemSelected()));
                             
                 action = mContextMenu->addAction(GLX_MENU_DELETE);
                 action->setData(EGlxCmdContextAlbumDelete);
+                action->setObjectName( "CM Album Delete" );
                 connect(action, SIGNAL(triggered()), this, SLOT(menuItemSelected()));
             }
 	    }