photosgallery/viewframework/commandhandlers/commoncommandhandlers/src/glxcommandhandleraiwedit.cpp
branchRCL_3
changeset 14 ce1c7ad1f18b
parent 9 6b87b143d312
child 18 bcb43dc84c44
--- a/photosgallery/viewframework/commandhandlers/commoncommandhandlers/src/glxcommandhandleraiwedit.cpp	Fri Mar 12 15:42:44 2010 +0200
+++ b/photosgallery/viewframework/commandhandlers/commoncommandhandlers/src/glxcommandhandleraiwedit.cpp	Mon Mar 15 12:40:30 2010 +0200
@@ -38,8 +38,7 @@
 #include <AiwGenericParam.h>                // for passing data between applications
 #include "AiwServiceHandler.h"                  // AIW service handler
 #include "glxmedia.h"
-
-
+#include <featdiscovery.h>
 // -----------------------------------------------------------------------------
 // NewL
 // -----------------------------------------------------------------------------
@@ -61,6 +60,7 @@
 //
 EXPORT_C CGlxCommandHandlerAiwEdit::~CGlxCommandHandlerAiwEdit()
     {
+    delete iFeatManager;
     delete iServiceHandler;
 
     if (NULL != iImageViewerInstance)
@@ -94,6 +94,7 @@
         }
 
     iImageViewerInstance = CGlxImageViewerManager::InstanceL();
+    iFeatManager = CFeatureDiscovery::NewL();
     }
 
 // -----------------------------------------------------------------------------
@@ -132,7 +133,12 @@
         //If stylus menu is present, hide it for multiple selection
         if (iCommandSingleClick && aMenuPane->MenuItemExists(
                 EGlxCmdAiwSingleClickEdit, pos)
-                && (mediaList.SelectionCount() > 1))
+
+                && ((mediaList.SelectionCount() > 1)
+                        || (!iFeatManager->IsFeatureSupportedL(
+                                KFeatureIdFfImageEditor)
+                                && !iFeatManager->IsFeatureSupportedL(
+                                        KFeatureIdFfVideoEditor))))
             {
             aMenuPane->SetItemDimmed(EGlxCmdAiwSingleClickEdit, ETrue);
             }
@@ -141,9 +147,13 @@
             {
             // If the image path is private or view is in grid & 
             // selection is not equal to 1, we should hide Edit menu item 
-            if (iImageViewerInstance->IsPrivate() || 
-                    (mediaList.SelectionCount() != 1 
+            if ((iImageViewerInstance->IsPrivate()
+                    || (mediaList.SelectionCount() != 1
                             && !IsInFullScreenViewingModeL()))
+                    || (!iFeatManager->IsFeatureSupportedL(
+                            KFeatureIdFfImageEditor)
+                            && !iFeatManager->IsFeatureSupportedL(
+                                    KFeatureIdFfVideoEditor)))
                 {
                 aMenuPane->SetItemDimmed(EGlxCmdAiwEdit, ETrue);
                 }