XDMSettingsUI/src/XDMPlugin.cpp
branchRCL_3
changeset 18 52d91a16fec3
parent 8 aca99fb8a3dd
child 19 10246e066a50
--- a/XDMSettingsUI/src/XDMPlugin.cpp	Tue Apr 27 17:03:39 2010 +0300
+++ b/XDMSettingsUI/src/XDMPlugin.cpp	Tue May 11 16:35:18 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
@@ -42,6 +42,9 @@
 
 
 // Constants
+
+const TInt KMaxNameLength = 255;
+
 _LIT( KGSXDMPluginResourceFileName, "z:\\resource\\XDMPluginRsc.rsc" );
 
 #ifdef __SCALABLE_ICONS
@@ -404,6 +407,35 @@
             aMenuPane->SetItemDimmed(EGSXDMPluginCmdNewExisting, ETrue);
             }
         }
+    
+    if ( iSettingListContainer )
+        {
+        TBool inUse( EFalse );
+        HBufC* currentSetName = iMainListContainer->GetCurrentSetNameLC();
+        TBuf<KMaxNameLength> setName;
+        setName.Copy( currentSetName->Des() );
+        TRAP_IGNORE( inUse = iSettingListContainer->SettingsApInUseL( setName ) );
+        CleanupStack::PopAndDestroy( currentSetName );
+    
+        if ( inUse )
+            {
+            TInt pos( KErrNotFound );
+            if ( aMenuPane->MenuItemExists( EGSXDMPluginCmdDelete, pos ) )
+                {
+                aMenuPane->SetItemSpecific( EGSXDMPluginCmdDelete, EFalse );
+                aMenuPane->SetItemDimmed(EGSXDMPluginCmdDelete, ETrue);
+                }
+            }
+        else
+            {
+            TInt pos( KErrNotFound );
+            if ( aMenuPane->MenuItemExists( EGSXDMPluginCmdDelete, pos ) )
+                {
+                aMenuPane->SetItemSpecific( EGSXDMPluginCmdDelete, ETrue );
+                aMenuPane->SetItemDimmed(EGSXDMPluginCmdDelete, EFalse);
+                }
+            }
+        }
     }
 
 // ---------------------------------------------------------