# HG changeset patch # User Sebastian Brannstrom # Date 1278716327 -3600 # Node ID cd124c4eb6b95b503d496409fd76ee735f73321d # Parent 982b1ad423f4d2f7cc65d4f71b6b84f630e65a6a Started port to 3rd edition diff -r 982b1ad423f4 -r cd124c4eb6b9 application/group/Podcast.mmp --- a/application/group/Podcast.mmp Fri Jul 09 23:00:03 2010 +0100 +++ b/application/group/Podcast.mmp Fri Jul 09 23:58:47 2010 +0100 @@ -75,7 +75,6 @@ LIBRARY esock.lib LIBRARY mmfcontrollerframework.lib LIBRARY cmmanager.lib -LIBRARY libc.lib LIBRARY imageconversion.lib LIBRARY bitmaptransforms.lib LIBRARY euser.lib diff -r 982b1ad423f4 -r cd124c4eb6b9 application/inc/PodcastFeedView.h --- a/application/inc/PodcastFeedView.h Fri Jul 09 23:00:03 2010 +0100 +++ b/application/inc/PodcastFeedView.h Fri Jul 09 23:58:47 2010 +0100 @@ -40,7 +40,6 @@ ~CPodcastFeedView(); void UpdateItemL(TInt aIndex); void CheckResumeDownloadL(); - void UpdateToolbar(TBool aVisible=ETrue); TBool ViewingShows(); protected: @@ -98,8 +97,6 @@ // from MImageHandlerCallback void ImageOperationCompleteL(TInt aError, TUint aHandle, CPodcastModel& aPodcastModel); - void HandleLongTapEventL( const TPoint& aPenEventLocation, const TPoint& aPenEventScreenLocation); - private: void FormatFeedInfoListBoxItemL(CFeedInfo& aFeedInfo, TBool aIsUpdating = EFalse); void HandleAddFeedL(); diff -r 982b1ad423f4 -r cd124c4eb6b9 application/inc/PodcastListView.h --- a/application/inc/PodcastListView.h Fri Jul 09 23:00:03 2010 +0100 +++ b/application/inc/PodcastListView.h Fri Jul 09 23:58:47 2010 +0100 @@ -23,10 +23,6 @@ #include #include #include -#include -#include -#include -#include #include #include #include "PodcastModel.h" @@ -63,8 +59,6 @@ void ScrollToVisible(); void Draw(const TRect& aRect) const; - void SetLongTapDetectedL(TBool aLongTapDetected); - CEikFormattedCellListBox * iListbox; protected: @@ -75,18 +69,15 @@ MKeyEventListener* iKeyEventListener; MPointerListener* iPointerListener; CAknsBasicBackgroundControlContext* iBgContext; - TBool iLongTapDetected; }; -class CPodcastListView : public CAknView, public MAknToolbarObserver, -public MPointerListener, public MAknLongTapDetectorCallBack, +class CPodcastListView : public CAknView, public MPointerListener, public MProgressDialogCallback, public MKeyEventListener { public: ~CPodcastListView(); - virtual void UpdateToolbar(TBool aVisible=ETrue) = 0; TBool IsVisible(); protected: @@ -137,12 +128,8 @@ void ShowOkMessageL(TDesC &aText); void ShowErrorMessageL(TDesC &aText); TInt ShowQueryMessageL(TDesC &aText); - void CloseToolbarExtension(); void ShowWaitDialogL(TDesC &aWaitText); void CloseWaitDialog(); - - // From MAknLongTapDetectorCallBack - virtual void HandleLongTapEventL( const TPoint& aPenEventLocation, const TPoint& aPenEventScreenLocation ); // from MProgressDialogCallback void DialogDismissedL(TInt /*aButtonId*/) {} @@ -166,9 +153,6 @@ TBuf<1024> iListboxFormatbuffer; - CAknToolbar *iToolbar; - CAknStylusPopUpMenu* iStylusPopupMenu; - CAknLongTapDetector* iLongTapDetector; CAknWaitDialog *iWaitDialog; }; diff -r 982b1ad423f4 -r cd124c4eb6b9 application/inc/PodcastQueueView.h --- a/application/inc/PodcastQueueView.h Fri Jul 09 23:00:03 2010 +0100 +++ b/application/inc/PodcastQueueView.h Fri Jul 09 23:58:47 2010 +0100 @@ -22,8 +22,6 @@ #include #include #include -#include -#include #include "ShowEngine.h" #include "FeedEngine.h" #include "PodcastModel.h" @@ -36,7 +34,6 @@ static CPodcastQueueView* NewL(CPodcastModel& aPodcastModel); static CPodcastQueueView* NewLC(CPodcastModel& aPodcastModel); ~CPodcastQueueView(); - void UpdateToolbar(TBool aVisible=ETrue); protected: void ConstructL(); CPodcastQueueView(CPodcastModel& aPodcastModel); @@ -78,8 +75,6 @@ void HandleCommandL(TInt aCommand); TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType); void DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane); - - virtual void HandleLongTapEventL( const TPoint& aPenEventLocation, const TPoint& aPenEventScreenLocation); }; #endif diff -r 982b1ad423f4 -r cd124c4eb6b9 application/inc/PodcastSearchView.h --- a/application/inc/PodcastSearchView.h Fri Jul 09 23:00:03 2010 +0100 +++ b/application/inc/PodcastSearchView.h Fri Jul 09 23:58:47 2010 +0100 @@ -32,7 +32,6 @@ static CPodcastSearchView* NewL(CPodcastModel& aPodcastModel); static CPodcastSearchView* NewLC(CPodcastModel& aPodcastModel); ~CPodcastSearchView(); - void UpdateToolbar(TBool aVisible=EFalse) {}; protected: void ConstructL(); diff -r 982b1ad423f4 -r cd124c4eb6b9 application/inc/PodcastShowsView.h --- a/application/inc/PodcastShowsView.h Fri Jul 09 23:00:03 2010 +0100 +++ b/application/inc/PodcastShowsView.h Fri Jul 09 23:58:47 2010 +0100 @@ -22,8 +22,6 @@ #include #include #include -#include -#include #include "ShowEngine.h" #include "FeedEngine.h" #include "PodcastModel.h" @@ -37,7 +35,6 @@ static CPodcastShowsView* NewL(CPodcastModel& aPodcastModel); static CPodcastShowsView* NewLC(CPodcastModel& aPodcastModel); ~CPodcastShowsView(); - void UpdateToolbar(TBool aVisible=ETrue); protected: void ConstructL(); @@ -95,8 +92,6 @@ void UpdateShowItemDataL(CShowInfo* aShowInfo,TInt aIndex, TInt aSizeDownloaded = KErrNotFound); void DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane); void FormatShowInfoListBoxItemL(CShowInfo& aShowInfo, TInt aSizeDownloaded = 0); - - virtual void HandleLongTapEventL( const TPoint& aPenEventLocation, const TPoint& aPenEventScreenLocation); void GetShowIcons(CShowInfo* aShowInfo, TInt& aIconIndex); void CreateIconsL(); diff -r 982b1ad423f4 -r cd124c4eb6b9 application/src/PodcastAppui.cpp --- a/application/src/PodcastAppui.cpp Fri Jul 09 23:00:03 2010 +0100 +++ b/application/src/PodcastAppui.cpp Fri Jul 09 23:58:47 2010 +0100 @@ -330,20 +330,12 @@ void CPodcastAppUi::ConnectionSelectionStart() { DP("CPodcastAppUi::ConnectionSelectionStart() BEGIN"); - iFeedView->UpdateToolbar(EFalse); - iShowsView->UpdateToolbar(EFalse); - iQueueView->UpdateToolbar(EFalse); - iSearchView->UpdateToolbar(EFalse); DP("CPodcastAppUi::ConnectionSelectionStart() END"); } void CPodcastAppUi::ConnectionSelectionEnd() { DP("CPodcastAppUi::ConnectionSelectionEnd() BEGIN"); - iFeedView->UpdateToolbar(ETrue); - iShowsView->UpdateToolbar(ETrue); - iQueueView->UpdateToolbar(ETrue); - iSearchView->UpdateToolbar(ETrue); DP("CPodcastAppUi::ConnectionSelectionEnd() END"); } diff -r 982b1ad423f4 -r cd124c4eb6b9 application/src/PodcastFeedView.cpp --- a/application/src/PodcastFeedView.cpp Fri Jul 09 23:00:03 2010 +0100 +++ b/application/src/PodcastFeedView.cpp Fri Jul 09 23:58:47 2010 +0100 @@ -106,13 +106,7 @@ CleanupStack::Pop(icons); // icons iListContainer->Listbox()->SetListBoxObserver(this); - - iStylusPopupMenu = CAknStylusPopUpMenu::NewL( this , TPoint(0,0)); - TResourceReader reader; - iCoeEnv->CreateResourceReaderLC(reader,R_FEEDVIEW_POPUP_MENU); - iStylusPopupMenu->ConstructFromResourceL(reader); - CleanupStack::PopAndDestroy(); - + iUpdater = CPodcastFeedViewUpdater::NewL(*this); DP("CPodcastFeedView::ConstructL END"); } @@ -122,7 +116,6 @@ iPodcastModel.FeedEngine().RemoveObserver(this); delete iFeedsFormat; delete iNeverUpdated; - delete iStylusPopupMenu; delete iUpdater; iFeedIdForIconArray.Close(); } @@ -179,7 +172,6 @@ } UpdateListboxItemsL(); - UpdateToolbar(); if (iFirstActivateAfterLaunch) { @@ -225,7 +217,6 @@ void CPodcastFeedView::FeedUpdateAllCompleteL(TFeedState /*aState*/) { iUpdatingRunning = EFalse; - UpdateToolbar(); } void CPodcastFeedView::FeedDownloadStartedL(TFeedState /*aState*/, TUint aFeedUid) @@ -233,8 +224,6 @@ // Update status text iUpdatingRunning = ETrue; UpdateFeedInfoStatusL(aFeedUid, ETrue); - - UpdateToolbar(); } void CPodcastFeedView::FeedDownloadFinishedL(TFeedState aState,TUint aFeedUid, TInt aError) @@ -501,7 +490,6 @@ case EPodcastUpdateAllFeeds: { iPodcastModel.FeedEngine().UpdateAllFeedsL(); - UpdateToolbar(); }break; case EPodcastUpdateFeed: { @@ -544,29 +532,9 @@ break; } - iListContainer->SetLongTapDetectedL(EFalse); // in case we got here by long tapping - UpdateToolbar(); DP("CPodcastFeedView::HandleCommandL END"); } -void CPodcastFeedView::UpdateToolbar(TBool aVisible) -{ - DP("CPodcastFeedView::UpdateToolbar BEGIN"); - CAknToolbar* toolbar = Toolbar(); - - if (toolbar) - { - if (iListContainer->IsVisible()) { - toolbar->SetToolbarVisibility(aVisible); - } - toolbar->HideItem(EPodcastUpdateAllFeeds, iUpdatingRunning, ETrue); - toolbar->HideItem(EPodcastCancelUpdateAllFeeds, !iUpdatingRunning, ETrue ); - toolbar->SetItemDimmed(EPodcastAddFeed, iUpdatingRunning, ETrue ); - toolbar->SetItemDimmed(EPodcastSettings, iUpdatingRunning, ETrue ); - } - DP("CPodcastFeedView::UpdateToolbar END"); -} - void CPodcastFeedView::HandleAddFeedL() { TBuf url; @@ -915,24 +883,6 @@ TRAP_IGNORE(((CPodcastAppUi*)AppUi())->GetErrorTextL(aErrorMessage,aErrorCode)); } -void CPodcastFeedView::HandleLongTapEventL( const TPoint& aPenEventLocation, const TPoint& /* aPenEventScreenLocation */) -{ - DP("CPodcastListView::HandleLongTapEventL BEGIN"); - - iListContainer->SetLongTapDetectedL(ETrue); - - const TInt KListboxDefaultHeight = 19; // for some reason it returns 19 for an empty listbox in S^1 - TInt lbHeight = iListContainer->Listbox()->CalcHeightBasedOnNumOfItems( - iListContainer->Listbox()->Model()->NumberOfItems()) - KListboxDefaultHeight; - - if(iStylusPopupMenu && aPenEventLocation.iY < lbHeight) - { - iStylusPopupMenu->ShowMenu(); - iStylusPopupMenu->SetPosition(aPenEventLocation); - } - DP("CPodcastListView::HandleLongTapEventL END"); -} - TBool CPodcastFeedView::ViewingShows() { return iViewingShows; diff -r 982b1ad423f4 -r cd124c4eb6b9 application/src/PodcastListView.cpp --- a/application/src/PodcastListView.cpp Fri Jul 09 23:00:03 2010 +0100 +++ b/application/src/PodcastListView.cpp Fri Jul 09 23:58:47 2010 +0100 @@ -26,7 +26,6 @@ #include #include #include -#include #include #include #include @@ -97,20 +96,6 @@ } } -void CPodcastListContainer::SetLongTapDetectedL(TBool aLongTapDetected) - { - DP("CPodcastListContainer::SetLongTapDetectedL BEGIN"); - iLongTapDetected = aLongTapDetected; - - if (aLongTapDetected == EFalse) - { - TPointerEvent event; - event.iType = TPointerEvent::EButton1Up; - //CCoeControl::HandlePointerEventL(event); - } - DP("CPodcastListContainer::SetLongTapDetectedL END"); - } - void CPodcastListContainer::HandleResourceChange(TInt aType) { switch( aType ) @@ -173,10 +158,7 @@ iPointerListener->PointerEventL(aPointerEvent); // Call base class HandlePointerEventL() if not a long tap - if (!iLongTapDetected) - { - CCoeControl::HandlePointerEventL(aPointerEvent); - } + CCoeControl::HandlePointerEventL(aPointerEvent); } @@ -201,12 +183,6 @@ iListContainer->Listbox()->Model()->SetItemTextArray(iItemArray); iListContainer->Listbox()->Model()->SetOwnershipType(ELbmDoesNotOwnItemArray); - if (Toolbar()) { - iToolbar = Toolbar(); - iToolbar->SetToolbarObserver(this); - } - - iLongTapDetector = CAknLongTapDetector::NewL(this); iListContainer->SetPointerListener(this); iListContainer->SetKeyEventListener(this); @@ -242,7 +218,6 @@ } delete iItemArray; - delete iLongTapDetector; iItemIdArray.Close(); } @@ -365,44 +340,13 @@ return dlg->ExecuteLD(R_QUERYDLG); } -void CPodcastListView::CloseToolbarExtension() -{ - CAknToolbar* toolbar = Toolbar(); - if (toolbar) { - CAknToolbarExtension* toolbarExtension = toolbar->ToolbarExtension(); - if (toolbarExtension) { - toolbarExtension->SetShown( EFalse ); - } - } -} - void CPodcastListView::PointerEventL(const TPointerEvent& aPointerEvent) { //DP1("CPodcastListView::PointerEventL, iType=%d", aPointerEvent.iType); // Pass the pointer event to Long tap detector component - iLongTapDetector->PointerEventL(aPointerEvent); } -void CPodcastListView::HandleLongTapEventL( const TPoint& aPenEventLocation, const TPoint& /* aPenEventScreenLocation */) -{ - DP("CPodcastListView::HandleLongTapEventL BEGIN"); - iListContainer->SetLongTapDetectedL(ETrue); - - const TInt KListboxDefaultHeight = 19; // for some reason it returns 19 for an empty listbox in S^1 - TInt lbHeight = iListContainer->Listbox()->CalcHeightBasedOnNumOfItems( - iListContainer->Listbox()->Model()->NumberOfItems()) - KListboxDefaultHeight; - - if(iStylusPopupMenu && aPenEventLocation.iY < lbHeight) - { - iStylusPopupMenu->ShowMenu(); - iStylusPopupMenu->SetPosition(aPenEventLocation); - } - - DP("CPodcastListView::HandleLongTapEventL END"); -} - - void CPodcastListView::DynInitToolbarL (TInt /*aResourceId*/, CAknToolbar * /*aToolbar*/) { } diff -r 982b1ad423f4 -r cd124c4eb6b9 application/src/PodcastQueueView.cpp --- a/application/src/PodcastQueueView.cpp Fri Jul 09 23:00:03 2010 +0100 +++ b/application/src/PodcastQueueView.cpp Fri Jul 09 23:58:47 2010 +0100 @@ -67,11 +67,6 @@ iPodcastModel.FeedEngine().AddObserver(this); iPodcastModel.ShowEngine().AddObserver(this); - iStylusPopupMenu = CAknStylusPopUpMenu::NewL( this , TPoint(0,0)); - TResourceReader reader; - iCoeEnv->CreateResourceReaderLC(reader,R_QUEUEVIEW_POPUP_MENU); - iStylusPopupMenu->ConstructFromResourceL(reader); - CleanupStack::PopAndDestroy(); SetEmptyTextL(R_PODCAST_EMPTY_QUEUE); @@ -99,7 +94,6 @@ default: break; } - UpdateToolbar(); } } return CPodcastListView::OfferKeyEventL(aKeyEvent, aType); @@ -109,9 +103,6 @@ { iPodcastModel.ShowEngine().RemoveObserver(this); iPodcastModel.FeedEngine().RemoveObserver(this); - - if(iStylusPopupMenu) - delete iStylusPopupMenu, iStylusPopupMenu = NULL; } @@ -129,7 +120,6 @@ iPreviousView = aPrevViewId; UpdateFeedUpdateStateL(); - UpdateToolbar(); DP("CPodcastQueueView::DoActivateL END"); } @@ -150,7 +140,6 @@ default: break; } - UpdateToolbar(); } void CPodcastQueueView::UpdateListboxItemsL() @@ -317,8 +306,6 @@ CPodcastListView::HandleCommandL(aCommand); break; } - iListContainer->SetLongTapDetectedL(EFalse); // in case we got here by long tapping - UpdateToolbar(); } void CPodcastQueueView::DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane) @@ -328,50 +315,3 @@ aMenuPane->SetItemDimmed(EPodcastMarkAllPlayed, ETrue); } } - -void CPodcastQueueView::UpdateToolbar(TBool aVisible) - { - CAknToolbar* toolbar = Toolbar(); - - if (toolbar) - { - RShowInfoArray &fItems = iPodcastModel.ActiveShowList(); - TInt itemCnt = fItems.Count(); - if (iListContainer->IsVisible()) - { - toolbar->SetToolbarVisibility(aVisible); - } - - toolbar->HideItem(EPodcastRemoveAllDownloads, EFalse, ETrue); - toolbar->SetItemDimmed(EPodcastRemoveAllDownloads, itemCnt == 0, ETrue); - toolbar->HideItem(EPodcastSuspendDownloads,iPodcastModel.SettingsEngine().DownloadSuspended(), ETrue); - toolbar->HideItem(EPodcastResumeDownloads,!iPodcastModel.SettingsEngine().DownloadSuspended(), ETrue); - toolbar->SetItemDimmed(EPodcastRemoveDownload, itemCnt == 0, ETrue); - } - } - -void CPodcastQueueView::HandleLongTapEventL( const TPoint& aPenEventLocation, const TPoint& /* aPenEventScreenLocation */) -{ - DP("CPodcastQueueView::HandleLongTapEventL BEGIN"); - iListContainer->SetLongTapDetectedL(ETrue); - - const TInt KListboxDefaultHeight = 19; // for some reason it returns 19 for an empty listbox in S^1 - TInt lbHeight = iListContainer->Listbox()->CalcHeightBasedOnNumOfItems( - iListContainer->Listbox()->Model()->NumberOfItems()) - KListboxDefaultHeight; - - if(iStylusPopupMenu && aPenEventLocation.iY < lbHeight) - { - TBool dimDown = (iListContainer->Listbox()->CurrentItemIndex() >= iPodcastModel.ActiveShowList().Count() - 1 ? - ETrue : EFalse); - TBool dimUp = (iListContainer->Listbox()->CurrentItemIndex() <= 0 ? - ETrue : EFalse); - - iStylusPopupMenu->SetItemDimmed(EPodcastMoveDownloadDown, dimDown); - iStylusPopupMenu->SetItemDimmed(EPodcastMoveDownloadUp, dimUp); - - iStylusPopupMenu->ShowMenu(); - iStylusPopupMenu->SetPosition(aPenEventLocation); - } - - DP("CPodcastQueueView::HandleLongTapEventL END"); -} diff -r 982b1ad423f4 -r cd124c4eb6b9 application/src/PodcastSearchView.cpp --- a/application/src/PodcastSearchView.cpp Fri Jul 09 23:00:03 2010 +0100 +++ b/application/src/PodcastSearchView.cpp Fri Jul 09 23:58:47 2010 +0100 @@ -36,7 +36,6 @@ #include #include #include -#include const TInt KMaxFeedNameLength = 100; #define KMaxMessageLength 200 @@ -94,14 +93,7 @@ CPodcastSearchView::~CPodcastSearchView() { iPodcastModel.FeedEngine().RemoveObserver(this); - - if(iLongTapDetector) - delete iLongTapDetector, iLongTapDetector = NULL; - - if(iStylusPopupMenu) - delete iStylusPopupMenu, iStylusPopupMenu = NULL; - - } + } TUid CPodcastSearchView::Id() const { @@ -248,7 +240,6 @@ CPodcastListView::HandleCommandL(aCommand); break; } - UpdateToolbar(); } void CPodcastSearchView::OpmlParsingComplete(TInt /*aError*/, TUint /*aNumFeedsImported*/) diff -r 982b1ad423f4 -r cd124c4eb6b9 application/src/PodcastShowsView.cpp --- a/application/src/PodcastShowsView.cpp Fri Jul 09 23:00:03 2010 +0100 +++ b/application/src/PodcastShowsView.cpp Fri Jul 09 23:58:47 2010 +0100 @@ -115,11 +115,6 @@ iPodcastModel.FeedEngine().AddObserver(this); iPodcastModel.ShowEngine().AddObserver(this); - iStylusPopupMenu = CAknStylusPopUpMenu::NewL( this , TPoint(0,0)); - TResourceReader reader; - iCoeEnv->CreateResourceReaderLC(reader,R_SHOWVIEW_POPUP_MENU); - iStylusPopupMenu->ConstructFromResourceL(reader); - CleanupStack::PopAndDestroy(); } @@ -188,7 +183,6 @@ default: break; } - UpdateToolbar(); } } return CPodcastListView::OfferKeyEventL(aKeyEvent, aType); @@ -199,8 +193,6 @@ iPodcastModel.ShowEngine().RemoveObserver(this); iPodcastModel.FeedEngine().RemoveObserver(this); - if(iStylusPopupMenu) - delete iStylusPopupMenu, iStylusPopupMenu = NULL; } @@ -219,7 +211,6 @@ UpdateViewTitleL(); UpdateFeedUpdateStateL(); - UpdateToolbar(); DP("CPodcastShowsView::DoActivateL END"); } @@ -290,7 +281,6 @@ && iPodcastModel.ActiveFeedInfo()->Uid() == aFeedUid) { UpdateFeedUpdateStateL(); - UpdateToolbar(); } } @@ -354,7 +344,6 @@ default: break; } - UpdateToolbar(); } void CPodcastShowsView::GetShowIcons(CShowInfo* aShowInfo, TInt& aIconIndex) @@ -410,7 +399,6 @@ iListContainer->Listbox()->SetDimmed(listboxDimmed); } UpdateListboxItemsL(); - UpdateToolbar(); } void CPodcastShowsView::FormatShowInfoListBoxItemL(CShowInfo& aShowInfo, TInt aSizeDownloaded) @@ -644,9 +632,6 @@ CPodcastListView::HandleCommandL(aCommand); break; } - iListContainer->SetLongTapDetectedL(EFalse); - - UpdateToolbar(); } void CPodcastShowsView::DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane) @@ -675,111 +660,6 @@ } } -void CPodcastShowsView::UpdateToolbar(TBool aVisible) -{ - CAknToolbar* toolbar = Toolbar(); - - if (toolbar) { - if (iListContainer->IsVisible()) { - toolbar->SetToolbarVisibility(aVisible); - } - - TBool updatingState = iPodcastModel.FeedEngine().ClientState() != EIdle && iPodcastModel.ActiveFeedInfo() && - iPodcastModel.FeedEngine().ActiveClientUid() == iPodcastModel.ActiveFeedInfo()->Uid(); - - toolbar->HideItem(EPodcastUpdateFeed, updatingState, ETrue ); - toolbar->HideItem(EPodcastCancelUpdateAllFeeds, !updatingState, ETrue ); - RShowInfoArray &fItems = iPodcastModel.ActiveShowList(); - TInt itemCnt = fItems.Count(); - - TBool hideDownloadShowCmd = EFalse; - TBool dimDownloadShowCmd = EFalse; - TBool hideSetPlayed = EFalse; - - if(iListContainer->Listbox() != NULL) - { - TInt index = iListContainer->Listbox()->CurrentItemIndex(); - - if(index>= 0 && index < itemCnt) - { - switch(fItems[index]->DownloadState()) - { - case ENotDownloaded: - case EFailedDownload: - hideDownloadShowCmd = EFalse; - dimDownloadShowCmd = EFalse; - break; - case EQueued: - case EDownloading: - hideDownloadShowCmd = EFalse; - dimDownloadShowCmd = ETrue; - break; - case EDownloaded: - hideDownloadShowCmd = ETrue; - break; - } - - if(fItems[index]->PlayState() == EPlayed) { - hideSetPlayed = ETrue; - } - } - } - - if (hideDownloadShowCmd) { - toolbar->HideItem(EPodcastDownloadShow, ETrue, ETrue ); - toolbar->HideItem(EPodcastDeleteShow, EFalse, ETrue); - toolbar->SetItemDimmed(EPodcastDeleteShow, updatingState, ETrue); - } else { - toolbar->HideItem(EPodcastDownloadShow, EFalse, ETrue ); - toolbar->HideItem(EPodcastDeleteShow, ETrue, ETrue); - toolbar->SetItemDimmed(EPodcastDownloadShow, updatingState || dimDownloadShowCmd, ETrue); - } - - if (hideSetPlayed) { - toolbar->HideItem(EPodcastMarkAsPlayed, ETrue, ETrue ); - toolbar->HideItem(EPodcastMarkAsUnplayed, EFalse, ETrue ); - toolbar->SetItemDimmed(EPodcastMarkAsUnplayed, updatingState, ETrue); - } else { - toolbar->HideItem(EPodcastMarkAsPlayed, EFalse, ETrue ); - toolbar->HideItem(EPodcastMarkAsUnplayed, ETrue, ETrue ); - toolbar->SetItemDimmed(EPodcastMarkAsPlayed, updatingState, ETrue); - } - } -} - -void CPodcastShowsView::HandleLongTapEventL( const TPoint& aPenEventLocation, const TPoint& /* aPenEventScreenLocation */) -{ - DP("CPodcastShowsView::HandleLongTapEventL BEGIN"); - - iListContainer->SetLongTapDetectedL(ETrue); - - const TInt KListboxDefaultHeight = 19; // for some reason it returns 19 for an empty listbox in S^1 - TInt lbHeight = iListContainer->Listbox()->CalcHeightBasedOnNumOfItems( - iListContainer->Listbox()->Model()->NumberOfItems()) - KListboxDefaultHeight; - - if(iStylusPopupMenu && aPenEventLocation.iY < lbHeight) - { - TInt index = iListContainer->Listbox()->CurrentItemIndex(); - if (index >= 0 && index < iPodcastModel.ActiveShowList().Count()) - { - CShowInfo *info = iPodcastModel.ActiveShowList()[index]; - TBool hideDownloadShowCmd = info->DownloadState() != ENotDownloaded; - TBool hideDeleteShowCmd = info->DownloadState() != EDownloaded; - TBool hideMarkOld = info->PlayState() == EPlayed; - - iStylusPopupMenu->SetItemDimmed(EPodcastMarkAsPlayed, hideMarkOld); - iStylusPopupMenu->SetItemDimmed(EPodcastMarkAsUnplayed, !hideMarkOld); - - iStylusPopupMenu->SetItemDimmed(EPodcastDownloadShow, hideDownloadShowCmd); - iStylusPopupMenu->SetItemDimmed(EPodcastDeleteShow, hideDeleteShowCmd); - } - - iStylusPopupMenu->ShowMenu(); - iStylusPopupMenu->SetPosition(aPenEventLocation); - } - DP("CPodcastShowsView::HandleLongTapEventL END"); -} - void CPodcastShowsView::HandleSetShowPlayedL(TBool aPlayed) { @@ -831,7 +711,6 @@ void CPodcastShowsView::FeedUpdateAllCompleteL(TFeedState /*aState*/) { UpdateListboxItemsL(); - UpdateToolbar(); } void CPodcastShowsView::UpdateViewTitleL() diff -r 982b1ad423f4 -r cd124c4eb6b9 engine/group/bld.inf --- a/engine/group/bld.inf Fri Jul 09 23:00:03 2010 +0100 +++ b/engine/group/bld.inf Fri Jul 09 23:58:47 2010 +0100 @@ -22,14 +22,14 @@ WINSCW PRJ_MMPFILES -//..\sqlite\group\sqlite.mmp +..\sqlite\group\sqlite.mmp engine.mmp PRJ_EXPORTS // export pre-build sqlite -..\sqlite\sqlite_podcatcher_winscw.lib \epoc32\release\winscw\udeb\sqlite_podcatcher.lib -..\sqlite\sqlite_podcatcher_gcce.lib \epoc32\release\armv5\udeb\sqlite_podcatcher.lib -..\sqlite\sqlite_podcatcher_gcce.lib \epoc32\release\armv5\urel\sqlite_podcatcher.lib +//..\sqlite\sqlite_podcatcher_winscw.lib \epoc32\release\winscw\udeb\sqlite_podcatcher.lib +//..\sqlite\sqlite_podcatcher_gcce.lib \epoc32\release\armv5\udeb\sqlite_podcatcher.lib +//..\sqlite\sqlite_podcatcher_gcce.lib \epoc32\release\armv5\urel\sqlite_podcatcher.lib ..\config\podcatcher.sqlite \epoc32\winscw\c\private\A0009D00\podcatcher.sqlite.template ..\config\defaultfeeds.xml \epoc32\winscw\c\private\A0009D00\defaultfeeds.xml diff -r 982b1ad423f4 -r cd124c4eb6b9 engine/sqlite/group/sqlite.mmp --- a/engine/sqlite/group/sqlite.mmp Fri Jul 09 23:00:03 2010 +0100 +++ b/engine/sqlite/group/sqlite.mmp Fri Jul 09 23:58:47 2010 +0100 @@ -58,4 +58,5 @@ SYSTEMINCLUDE \Epoc32\include SYSTEMINCLUDE \Epoc32\include\libc SYSTEMINCLUDE ..\inc + macro OS_SYMBIAN