uifw/AvKon/src/aknlistquerydialog.cpp
branchRCL_3
changeset 23 3d340a0166ff
parent 15 08e69e956a8c
child 25 941195f2d488
--- a/uifw/AvKon/src/aknlistquerydialog.cpp	Tue Apr 27 16:55:05 2010 +0300
+++ b/uifw/AvKon/src/aknlistquerydialog.cpp	Tue May 11 16:27:42 2010 +0300
@@ -19,7 +19,7 @@
 #include <AknMediatorFacade.h>
 #include <MediatorEventProvider.h>
 #include <MediatorDomainUIDs.h>
-#include <SecondaryDisplay/AknSecondaryDisplayDefs.h>
+#include <secondarydisplay/AknSecondaryDisplayDefs.h>
 
 #include "aknPopupHeadingPane.h"
 #include "aknlistquerycontrol.h"
@@ -262,9 +262,17 @@
 		listbox->SetListBoxObserver(this);
     
 		CAknListQueryControl* listControl = ListControl();
-		if (listControl)
-			listControl->SetLayout(&iLayout);
-		}
+        if ( listControl )
+            {
+            listControl->SetLayout( &iLayout );
+            }            
+        
+        if ( iAvkonAppUi->IsSingleClickCompatible() && 
+             !IsLeftSoftkeyShown() )
+            {
+            MakeLeftSoftkeyVisible( EFalse );
+            }    
+        }
 
     if (FindBox())
         {
@@ -461,6 +469,16 @@
                         iIdle->Start(TCallBack(ClosePopupAcceptingChanges, this));
                         }
                     }  
+                
+                if( iAvkonAppUi->IsSingleClickCompatible() && 
+                        aListBox->IsMultiselection() )
+                    {
+                    CEikListBox* listbox = ListBox();
+                    if( listbox )
+                        {
+                        MakeLeftSoftkeyVisible( IsLeftSoftkeyShown() );
+                        }    
+                    }
                 }
                 break;
             default:
@@ -565,16 +583,22 @@
 	        }
 
         TInt currentSelection = listbox->CurrentItemIndex();
-        if( currentSelection == KErrNotFound )
+        TBool isSingleClick = iAvkonAppUi->IsSingleClickCompatible(); 
+        if ( currentSelection == KErrNotFound )
             {
-            MakeLeftSoftkeyVisible(EFalse);
+            MakeLeftSoftkeyVisible( EFalse );
             }
-        else
+        else if ( isSingleClick )
             {
-            MakeLeftSoftkeyVisible(ETrue);
+            MakeLeftSoftkeyVisible( IsLeftSoftkeyShown() );
             }
             
         TKeyResponse response = listbox->OfferKeyEventL( aKeyEvent, aType);
+        
+        if ( isSingleClick && IsLeftSoftkeyShown() )
+            {
+            MakeLeftSoftkeyVisible( ETrue );
+            }
         if (currentSelection != listbox->CurrentItemIndex() && iMediatorObs)
             {
             iMediatorObs->UpdateL(listbox->CurrentItemIndex());
@@ -770,6 +794,18 @@
     return NULL;
     }
 
+TBool CAknListQueryDialog::IsLeftSoftkeyShown()
+	{
+    CEikListBox* listbox = ListBox();
+    __ASSERT_DEBUG( listbox, Panic(EAknPanicNullPointer));
+    // This flag indicators that listbox is a viewer listbox.    
+    TBool isViewMode = listbox->View()->ItemDrawer()->Flags() & 
+                           CListItemDrawer::EDisableHighlight; 
+
+    return listbox->IsHighlightEnabled() || 
+               listbox->SelectionIndexes()->Count() > 0 || isViewMode;
+	}
+
 EXPORT_C void CAknListQueryDialog::SetTone(TInt aTone)
 	{
 	iTone = (TTone)aTone;