241 } |
246 } |
242 else |
247 else |
243 { |
248 { |
244 cbaContainer->SetCommandSetL(R_AVKON_SOFTKEYS_CANCEL); |
249 cbaContainer->SetCommandSetL(R_AVKON_SOFTKEYS_CANCEL); |
245 } |
250 } |
246 //LSK / SK1’s visibility is determined by the screen context, if single click support enabled. |
|
247 //As suggested by Avkon, disable the CEikCba’s item specific softkey default behavior. |
|
248 CEikCba* eikCba = static_cast<CEikCba*>( cbaContainer->ButtonGroup() ); |
|
249 if( eikCba ) |
|
250 { |
|
251 eikCba->EnableItemSpecificSoftkey( EFalse ); |
|
252 } |
|
253 cbaContainer->DrawDeferred(); |
251 cbaContainer->DrawDeferred(); |
|
252 |
254 } |
253 } |
255 listBox->DrawDeferred(); |
254 listBox->DrawDeferred(); |
256 |
255 |
257 //Forward for default processing, if static item is selected(i.e. For Tags) |
256 //Forward for default processing, if static item is selected(i.e. For Tags) |
258 //or if List Box's Multiple selection is Disabled(i.e. For Albums) |
257 //or if List Box's Multiple selection is Disabled(i.e. For Albums) |
333 // |
332 // |
334 TKeyResponse CGlxSingleGraphicPopupMenuStyleListBox::OfferKeyEventL( |
333 TKeyResponse CGlxSingleGraphicPopupMenuStyleListBox::OfferKeyEventL( |
335 const TKeyEvent& aKeyEvent, TEventCode aType) |
334 const TKeyEvent& aKeyEvent, TEventCode aType) |
336 { |
335 { |
337 TRACER("CGlxSingleGraphicPopupMenuStyleListBox::OfferKeyEventL"); |
336 TRACER("CGlxSingleGraphicPopupMenuStyleListBox::OfferKeyEventL"); |
338 //Note: To add custom implementation to OfferKeyEventL(), change |
337 |
339 //CAknSingleGraphicPopupMenuStyleListBox to CGlxSingleGraphicPopupMenuStyleListBox. |
|
340 |
|
341 //Based on the selected item index, disable the MultipleSelection flag |
338 //Based on the selected item index, disable the MultipleSelection flag |
342 //to stop the flickering of 'marked box', when Highlighted 'New Tag' is selected. |
339 //to stop the flickering of 'marked box', when Highlighted 'New Tag' is selected. |
343 CGlxMediaListAdaptor* mediaListAdaptor = |
340 CGlxMediaListAdaptor* mediaListAdaptor = |
344 static_cast<CGlxMediaListAdaptor*> (Model()->ItemTextArray()); |
341 static_cast<CGlxMediaListAdaptor*> (Model()->ItemTextArray()); |
345 TInt currItemIndx = View()->CurrentItemIndex(); |
342 TInt currItemIndx = View()->CurrentItemIndex(); |
486 aAccepted = EFalse; |
483 aAccepted = EFalse; |
487 } |
484 } |
488 |
485 |
489 iMediaList->RemoveMediaListObserver(this); // We no longer require any callbacks from the media list |
486 iMediaList->RemoveMediaListObserver(this); // We no longer require any callbacks from the media list |
490 |
487 |
|
488 |
491 CMPXCollectionPath* path = NULL; |
489 CMPXCollectionPath* path = NULL; |
492 if (aAccepted) |
490 if (aAccepted) |
493 { |
491 { |
|
492 |
494 //Check if a static item is selected |
493 //Check if a static item is selected |
495 if (iMediaListAdaptor->IsStaticItemSelected()) |
494 if (iMediaListAdaptor->IsStaticItemSelected()) |
496 { |
495 { |
497 TFileName uiutilitiesrscfile; |
496 TFileName uiutilitiesrscfile; |
498 uiutilitiesrscfile.Append( |
497 uiutilitiesrscfile.Append( |
883 KGlxMediaCollectionPluginSpecificNewMediaItemTitle); |
883 KGlxMediaCollectionPluginSpecificNewMediaItemTitle); |
884 attributeContext->AddAttributeL( |
884 attributeContext->AddAttributeL( |
885 KGlxMediaCollectionPluginSpecificSelectMediaPopupTitle); |
885 KGlxMediaCollectionPluginSpecificSelectMediaPopupTitle); |
886 rootList->AddContextL(attributeContext, KGlxFetchContextPriorityBlocking); |
886 rootList->AddContextL(attributeContext, KGlxFetchContextPriorityBlocking); |
887 |
887 |
888 // Media list must not have been deleted when the destructor of |
888 // TGlxContextRemover will remove the context when it goes out of scope |
889 // TGlxContextRemover is called while going out-of-scope. |
889 // Used here to avoid a trap and still have safe cleanup |
890 { |
890 TGlxFetchContextRemover contextRemover(attributeContext, *rootList); |
891 // TGlxContextRemover will remove the context when it goes out of scope |
891 CleanupClosePushL(contextRemover); |
892 // Used here to avoid a trap and still have safe cleanup |
892 User::LeaveIfError(GlxAttributeRetriever::RetrieveL(*attributeContext, |
893 TGlxFetchContextRemover contextRemover(attributeContext, *rootList); |
893 *rootList, EFalse)); |
894 CleanupClosePushL(contextRemover); |
894 // context off the list |
895 User::LeaveIfError(GlxAttributeRetriever::RetrieveL( |
895 CleanupStack::PopAndDestroy(&contextRemover); |
896 *attributeContext, *rootList, EFalse)); |
|
897 // context off the list |
|
898 CleanupStack::PopAndDestroy(&contextRemover); |
|
899 } // Limiting scope of contextRemover |
|
900 |
896 |
901 TInt index = rootList->Index(KGlxIdSpaceIdRoot, iCollectionId); |
897 TInt index = rootList->Index(KGlxIdSpaceIdRoot, iCollectionId); |
902 |
898 |
903 __ASSERT_DEBUG(index> KErrNotFound, Panic(EGlxPanicRequiredItemNotFound)); |
899 __ASSERT_DEBUG(index> KErrNotFound, Panic(EGlxPanicRequiredItemNotFound)); |
904 TGlxMedia item = rootList->Item(index); |
900 TGlxMedia item = rootList->Item(index); |