presencesettingsui/src/psuigsplugin.cpp
branchRCL_3
changeset 11 52d91a16fec3
parent 6 aca99fb8a3dd
--- a/presencesettingsui/src/psuigsplugin.cpp	Tue Apr 27 17:03:39 2010 +0300
+++ b/presencesettingsui/src/psuigsplugin.cpp	Tue May 11 16:35:18 2010 +0300
@@ -1,5 +1,5 @@
 /*
-* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2006-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"
@@ -398,6 +398,33 @@
         {
         aMenuPane->DeleteMenuItem( EAknCmdHelp );
         }
+    
+    TInt index( KErrNotFound );
+    SettingCountAndIndex( index );
+    
+    if ( KErrNotFound < index )
+        {
+        // Hide delete option if sip profile used with presence settings
+        // is registered.
+        if ( iPSModel->IsSipProfileRegisteredL( index ) )
+            {
+            TInt pos( KErrNotFound );
+            if ( aMenuPane->MenuItemExists( EPSUICmdDelete, pos ) )
+                {
+                aMenuPane->SetItemSpecific( EPSUICmdDelete, EFalse );
+                aMenuPane->SetItemDimmed( EPSUICmdDelete, ETrue );
+                }
+            }
+        else
+            {
+            TInt pos( KErrNotFound );
+            if ( aMenuPane->MenuItemExists( EPSUICmdDelete, pos ) )
+                {
+                aMenuPane->SetItemSpecific( EPSUICmdDelete, ETrue );
+                aMenuPane->SetItemDimmed( EPSUICmdDelete, EFalse );
+                }
+            }
+        }
     }
 
 // ---------------------------------------------------------------------------