Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
--- a/application/data/PodcastClient_english.rls Tue Oct 26 15:58:11 2010 +0100
+++ b/application/data/PodcastClient_english.rls Fri Nov 12 20:48:14 2010 +0000
@@ -157,6 +157,6 @@
rls_string STRING_r_error_http "Error: HTTP error %d"
rls_string STRING_r_error_disk_full "Error: Disk full"
rls_string STRING_r_add_url_or_search "Add feed"
-rls_string STRING_r_add_url "Enter URL"
+rls_string STRING_r_add_url "Enter address"
rls_string STRING_r_add_search "Search for feed"
rls_string STRING_r_search_feed_prompt "Enter search terms:"
--- a/application/data/PodcastFeedView.ra Tue Oct 26 15:58:11 2010 +0100
+++ b/application/data/PodcastFeedView.ra Fri Nov 12 20:48:14 2010 +0000
@@ -257,6 +257,11 @@
{
STYLUS_POPUP_MENU_ITEM
{
+ txt = STRING_r_view_show_info_cmd;
+ command = EPodcastShowInfo;
+ },
+ STYLUS_POPUP_MENU_ITEM
+ {
txt = STRING_r_view_edit_feed_cmd_short;
command = EPodcastEditFeed;
},
--- a/application/data/PodcastQueueView.ra Tue Oct 26 15:58:11 2010 +0100
+++ b/application/data/PodcastQueueView.ra Fri Nov 12 20:48:14 2010 +0000
@@ -19,7 +19,7 @@
RESOURCE AVKON_VIEW r_podcast_queueview
{
menubar = r_podcast_queueview_menubar;
- cba = R_AVKON_SOFTKEYS_OPTIONS_BACK;
+ cba = r_podcast_cba;
toolbar = r_queueview_toolbar;
}
--- a/application/data/PodcastSearchView.ra Tue Oct 26 15:58:11 2010 +0100
+++ b/application/data/PodcastSearchView.ra Fri Nov 12 20:48:14 2010 +0000
@@ -20,7 +20,6 @@
{
menubar = r_podcast_searchview_menubar;
cba = R_AVKON_SOFTKEYS_OPTIONS_BACK;
-// toolbar = r_searchview_toolbar;
}
@@ -55,69 +54,6 @@
}
-RESOURCE AVKON_TOOLBAR r_searchview_toolbar
- {
- flags = KAknToolbarFixed;
- items =
- {
- TBAR_CTRL
- {
- type = EAknCtButton;
- id = EPodcastSearch;
- control = AVKON_BUTTON
- {
- states =
- {
- AVKON_BUTTON_STATE
- {
- //bmpfile = AVKON_BITMAP_FILE;
- //bmpid = EMbmAvkonQgn_indi_find_goto;
- txt = STRING_r_search;
- helptxt = STRING_r_update_all_feeds_cmd;
- }
- };
- };
- },
- TBAR_CTRL
- {
- type = EAknCtButton;
- id = EPodcastCancelUpdateAllFeeds;
- control = AVKON_BUTTON
- {
- states =
- {
- AVKON_BUTTON_STATE
- {
- //bmpfile = AVKON_BITMAP_FILE;
- //bmpid = EMbmAvkonQgn_indi_find_goto;
- txt = STRING_r_cancel_update_all_feeds_short_cmd;
- helptxt = STRING_r_cancel_update_all_feeds_cmd;
- }
- };
- };
- }/*,
- TBAR_CTRL
- {
- type = EAknCtButton;
- id = EPodcastAddSearchResult;
- control = AVKON_BUTTON
- {
- states =
- {
- AVKON_BUTTON_STATE
- {
- //bmpfile = AVKON_BITMAP_FILE;
- //bmpid = EMbmAvkonQgn_indi_find_goto;
- txt = STRING_r_view_add_feed_cmd_short;
- helptxt = STRING_r_view_add_feed_cmd;
- }
- };
- };
- }*/
- };// items
- }
-
-
RESOURCE CBA r_podcast_search_cba
{
buttons =
@@ -128,6 +64,7 @@
{id=EAknSoftkeyCancel; txt = STRING_r_cba_cancel;}
};
}
+
RESOURCE DIALOG r_podcast_search_dlg
{
buttons = r_podcast_search_cba;
@@ -155,7 +92,6 @@
};
}
-
RESOURCE DIALOG r_waitdlg
{
flags = EAknWaitNoteFlags;
@@ -179,4 +115,3 @@
}
};
}
-
--- a/application/data/PodcastStrings.ra Tue Oct 26 15:58:11 2010 +0100
+++ b/application/data/PodcastStrings.ra Fri Nov 12 20:48:14 2010 +0000
@@ -78,4 +78,3 @@
RESOURCE TBUF r_about_text {buf = STRING_r_about_text_s60;}
RESOURCE TBUF r_error_playback_failed {buf = STRING_r_error_playback_failed; }
RESOURCE TBUF r_podcast_searchfeed_prompt {buf = STRING_r_search_feed_prompt;}
-
--- a/application/inc/PodcastFeedView.h Tue Oct 26 15:58:11 2010 +0100
+++ b/application/inc/PodcastFeedView.h Fri Nov 12 20:48:14 2010 +0000
@@ -39,11 +39,13 @@
static CPodcastFeedView* NewLC(CPodcastModel& aPodcastModel);
~CPodcastFeedView();
void UpdateItemL(TInt aIndex);
+ void UpdateItemsComplete();
void CheckResumeDownloadL();
void UpdateToolbar(TBool aVisible=ETrue);
TBool ViewingShows();
void CheckConfirmExit();
+ void ShowItem(TUint aUid);
protected:
void ConstructL();
@@ -114,10 +116,11 @@
void HandleUpdateFeedL();
void GetFeedErrorText(TDes &aErrorMessage, TInt aErrorCode);
void OpmlParsingCompleteL(TInt aError, TUint aNumFeedsImported);
-
+ void LoadIcons();
+ void DisplayFeedInfoDialogL();
private:
CPodcastModel& iPodcastModel;
- TBool iUpdatingRunning;
+ TUint iFeedUpdating;
HBufC* iFeedsFormat;
HBufC* iNeverUpdated;
CPodcastFeedViewUpdater* iUpdater;
@@ -125,6 +128,7 @@
TOpmlState iOpmlState;
TBool iViewingShows;
RArray<TInt> iFeedIdForIconArray;
+ TBool iListingFirstTime;
};
#endif // PODCASTFEEDVIEWH
--- a/application/inc/PodcastListView.h Tue Oct 26 15:58:11 2010 +0100
+++ b/application/inc/PodcastListView.h Fri Nov 12 20:48:14 2010 +0000
@@ -35,13 +35,10 @@
class CEikFormattedCellListBox;
-class MKeyEventListener {
+class MContainerListener {
public:
virtual TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType) = 0;
-};
-
-class MPointerListener {
-public:
+virtual void SizeChanged() = 0;
virtual void PointerEventL(const TPointerEvent& aPointerEvent) = 0;
};
@@ -56,41 +53,46 @@
CCoeControl* ComponentControl( TInt aIndex ) const;
void HandleResourceChange(TInt aType);
virtual TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
- void SetKeyEventListener(MKeyEventListener *aKeyEventListener);
- void SetPointerListener(MPointerListener *aPointerListener);
-
- CEikFormattedCellListBox* Listbox();
+ void SetContainerListener(MContainerListener *aContainerListener);
+ void SetListboxObserver(MEikListBoxObserver *aObserver);
+ CEikColumnListBox* Listbox();
+ void SetListboxIcons(CArrayPtr< CGulIcon >* aIcons);
+ CArrayPtr<CGulIcon>* ListboxIcons();
+ void SetListboxTextArrays(CDesCArray* aPortraitArray, CDesCArray* aLandscapeArray);
+ void SetEmptyText(const TDesC &aText);
void ScrollToVisible();
void Draw(const TRect& aRect) const;
void SetLongTapDetectedL(TBool aLongTapDetected);
- CEikFormattedCellListBox * iListbox;
-
protected:
TTypeUid::Ptr MopSupplyObject( TTypeUid aId );
virtual void HandlePointerEventL(const TPointerEvent& aPointerEvent);
private:
- MKeyEventListener* iKeyEventListener;
- MPointerListener* iPointerListener;
+ CAknSingleLargeStyleListBox * iListboxLandscape;
+ CAknDoubleLargeStyleListBox * iListboxPortrait;
+ MContainerListener* iContainerListener;
CAknsBasicBackgroundControlContext* iBgContext;
- TBool iLongTapDetected;
+ TBool iLongTapDetected;
+ CEikColumnListBox * iListbox;
+ TBool iLandscape;
};
class CPodcastListView : public CAknView, public MAknToolbarObserver,
-public MPointerListener, public MAknLongTapDetectorCallBack,
-public MProgressDialogCallback, public MKeyEventListener
+public MAknLongTapDetectorCallBack, public MEikListBoxObserver,
+public MProgressDialogCallback, public MContainerListener
{
public:
~CPodcastListView();
virtual void UpdateToolbar(TBool aVisible=ETrue) = 0;
TBool IsVisible();
-
+
protected:
- void ConstructL();
+ void SwitchListbox();
+ void ConstructL();
CPodcastListView();
/**
@@ -125,7 +127,7 @@
* Default implementation is empty.
* @param aCommand ID of the command to respond to.
*/
- void HandleCommandL(TInt aCommand);
+ virtual void HandleCommandL(TInt aCommand);
void OfferToolbarEventL(TInt aCommand);
void DynInitToolbarL (TInt aResourceId, CAknToolbar *aToolbar);
@@ -149,6 +151,8 @@
// from MKeyEventListener
virtual TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
+ virtual void SizeChanged() {};
+ void ResetContainer();
// from MPointerListener
void PointerEventL(const TPointerEvent& aPointerEvent);
@@ -162,9 +166,11 @@
TInt iListboxFlags;
CDesCArray* iItemArray;
+ CDesCArray* iItemArrayShort;
RArray<TUint> iItemIdArray;
-
+
TBuf<1024> iListboxFormatbuffer;
+ TBuf<1024> iListboxFormatbufferShort;
CAknToolbar *iToolbar;
CAknStylusPopUpMenu* iStylusPopupMenu;
--- a/application/inc/PodcastShowsView.h Tue Oct 26 15:58:11 2010 +0100
+++ b/application/inc/PodcastShowsView.h Fri Nov 12 20:48:14 2010 +0000
@@ -100,7 +100,7 @@
void GetShowIcons(CShowInfo* aShowInfo, TInt& aIconIndex);
void CreateIconsL();
-private:
+protected:
void DisplayShowInfoDialogL();
void HandleSetShowPlayedL(TBool aPlayed);
void HandleDeleteShowL();
@@ -109,7 +109,7 @@
void HandleDeleteShow();
void UpdateViewTitleL();
void GetShowErrorText(TDes &aErrorMessage, TInt aErrorCode);
-
+
protected:
CPodcastModel& iPodcastModel;
--- a/application/inc/buildno.h Tue Oct 26 15:58:11 2010 +0100
+++ b/application/inc/buildno.h Fri Nov 12 20:48:14 2010 +0000
@@ -1,2 +1,2 @@
// Build number generated by increment_buildno.py, do not edit manually
-#define BUILD_NO 31
\ No newline at end of file
+#define BUILD_NO 32
\ No newline at end of file
--- a/application/sis/buildno.txt Tue Oct 26 15:58:11 2010 +0100
+++ b/application/sis/buildno.txt Fri Nov 12 20:48:14 2010 +0000
@@ -1,1 +1,1 @@
-31
\ No newline at end of file
+32
\ No newline at end of file
--- a/application/sis/podcatcher_udeb.pkg Tue Oct 26 15:58:11 2010 +0100
+++ b/application/sis/podcatcher_udeb.pkg Fri Nov 12 20:48:14 2010 +0000
@@ -1,7 +1,7 @@
&EN,SP
:"Symbian Foundation"
%{"Podcatcher","Podcatcher"}
-#{"Podcatcher","Podcatcher"},(0xA0009D00), 1, 00, 31, TYPE=SA
+#{"Podcatcher","Podcatcher"},(0xA0009D00), 1, 00, 32, TYPE=SA
;Supports Symbian^1
[0x1028315F], 0, 0, 0, {"Series60ProductID","Series60ProductID"}
Binary file application/sis/podcatcher_udeb.sis has changed
Binary file application/sis/podcatcher_udeb_signed.sis has changed
--- a/application/sis/podcatcher_urel.pkg Tue Oct 26 15:58:11 2010 +0100
+++ b/application/sis/podcatcher_urel.pkg Fri Nov 12 20:48:14 2010 +0000
@@ -1,7 +1,7 @@
&EN,SP
:"Symbian Foundation"
%{"Podcatcher","Podcatcher"}
-#{"Podcatcher","Podcatcher"},(0xA0009D00), 1, 00, 31, TYPE=SA
+#{"Podcatcher","Podcatcher"},(0xA0009D00), 1, 00, 32, TYPE=SA
;Supports Symbian^1
[0x1028315F], 0, 0, 0, {"Series60ProductID","Series60ProductID"}
--- a/application/src/PodcastAppui.cpp Tue Oct 26 15:58:11 2010 +0100
+++ b/application/src/PodcastAppui.cpp Fri Nov 12 20:48:14 2010 +0000
@@ -205,31 +205,9 @@
void CPodcastAppUi::NaviShowTabGroupL()
{
-// if (iNaviStyle != ENaviEmpty) {
-// iNaviPane->Pop();
-// }
-//
-// iNaviTabGroup = iNaviPane->CreateTabGroupL();
-
iTabGroup = STATIC_CAST(CAknTabGroup*, iNaviPane->ResourceDecorator()->DecoratedControl());
iTabGroup->SetObserver(this);
-
-// iTabGroup->SetTabFixedWidthL(EAknTabWidthWithTwoTabs);
-//
-// HBufC *label1 = iEikonEnv->AllocReadResourceLC(R_TABGROUP_FEEDS);
-// iTabGroup->AddTabL(KTabIdFeeds,*label1);
-//
-// HBufC *label3 = iEikonEnv->AllocReadResourceLC(R_TABGROUP_QUEUE);
-// iTabGroup->AddTabL(KTabIdQueue,*label3);
-//
-// CleanupStack::PopAndDestroy(label3);
-// CleanupStack::PopAndDestroy(label1);
-//
-// iTabGroup->SetActiveTabByIndex(0);
-//
-// iNaviPane->PushL(*iNaviTabGroup);
iNaviStyle = ENaviTabGroup;
-//
UpdateQueueTabL(iPodcastModel->ShowEngine().GetNumDownloadingShows());
}
--- a/application/src/PodcastFeedView.cpp Tue Oct 26 15:58:11 2010 +0100
+++ b/application/src/PodcastFeedView.cpp Fri Nov 12 20:48:14 2010 +0000
@@ -33,6 +33,7 @@
#include <pathinfo.h>
#include <akncommondialogsdynmem.h>
#include "Podcatcher.pan"
+#include <aknmessagequerydialog.h>
const TInt KMaxFeedNameLength = 100;
const TInt KMaxUnplayedFeedsLength =64;
@@ -40,7 +41,8 @@
#define KMaxMessageLength 200
#define KMaxTitleLength 100
-_LIT(KFeedFormat, "%d\t%S\t%S%S");
+_LIT(KFeedFormatPortrait, "%d\t%S\t%S%S");
+_LIT(KFeedFormatLandscape, "%d\t%S");
enum
{
EFeedIcon
@@ -102,10 +104,8 @@
// Append the feed icon to icon array
icons->AppendL( CGulIcon::NewL( bitmap, mask ) );
CleanupStack::Pop(2); // bitmap, mask
- iListContainer->Listbox()->ItemDrawer()->FormattedCellData()->SetIconArrayL( icons );
+ iListContainer->SetListboxIcons( icons );
CleanupStack::Pop(icons); // icons
-
- iListContainer->Listbox()->SetListBoxObserver(this);
iStylusPopupMenu = CAknStylusPopUpMenu::NewL( this , TPoint(0,0));
TResourceReader reader;
@@ -139,7 +139,7 @@
iItemIdArray[aIndex] = sortedItems[aIndex]->Uid();
// Prepare data to update the listbox item with
- FormatFeedInfoListBoxItemL(*sortedItems[aIndex], EFalse);
+ FormatFeedInfoListBoxItemL(*sortedItems[aIndex], sortedItems[aIndex]->Uid() == iFeedUpdating);
// If nothing has changed, we are done here
if (iListboxFormatbuffer == iItemArray->MdcaPoint(aIndex))
@@ -152,15 +152,22 @@
itemProps.SetDimmed(EFalse);
iItemArray->Delete(aIndex);
iItemArray->InsertL(aIndex, iListboxFormatbuffer);
- iListContainer->Listbox()->ItemDrawer()->SetPropertiesL(aIndex, itemProps);
+ iItemArrayShort->Delete(aIndex);
+ iItemArrayShort->InsertL(aIndex, iListboxFormatbufferShort);
+
+ //iListContainer->Listbox()->ItemDrawer()->SetPropertiesL(aIndex, itemProps);
// If item is visible, redraw it
if (iListContainer->Listbox()->TopItemIndex() <= aIndex
- && iListContainer->Listbox()->BottomItemIndex() >= aIndex)
+ && iListContainer->Listbox()->BottomItemIndex() > aIndex)
{
iListContainer->Listbox()->DrawItem(aIndex);
}
}
+void CPodcastFeedView::UpdateItemsComplete()
+ {
+ }
+
TUid CPodcastFeedView::Id() const
{
return KUidPodcastFeedViewID;
@@ -170,6 +177,7 @@
TUid aCustomMessageId,
const TDesC8& aCustomMessage)
{
+ DP("CPodcastFeedView::DoActivateL BEGIN");
CPodcastListView::DoActivateL(aPrevViewId, aCustomMessageId, aCustomMessage);
if (aPrevViewId.iViewUid == KUidPodcastShowsViewID)
@@ -181,11 +189,26 @@
UpdateListboxItemsL();
UpdateToolbar();
+ // when we receive a UID argument, this comes from search view after
+ // a new feed has been added
+ if (aCustomMessageId.iUid != 0)
+ {
+ TUint feedUid = aCustomMessageId.iUid;
+ ShowItem(feedUid);
+ TBuf<KMaxMessageLength> message;
+ iEikonEnv->ReadResourceL(message, R_ADD_FEED_SUCCESS);
+ if(ShowQueryMessageL(message))
+ {
+ iPodcastModel.FeedEngine().UpdateFeedL(feedUid);
+ }
+ }
+
if (iFirstActivateAfterLaunch)
{
iFirstActivateAfterLaunch = EFalse;
- iListContainer->Listbox()->ScrollToMakeItemVisible(0);
}
+
+ DP("CPodcastFeedView::DoActivateL END");
}
void CPodcastFeedView::DoDeactivate()
@@ -197,7 +220,7 @@
void CPodcastFeedView::HandleListBoxEventL(CEikListBox* /* aListBox */, TListBoxEvent aEventType)
{
- DP("CPodcastFeedView::HandleListBoxEventL BEGIN");
+// DP("CPodcastFeedView::HandleListBoxEventL BEGIN");
switch(aEventType)
{
@@ -220,19 +243,20 @@
default:
break;
}
- DP("CPodcastFeedView::HandleListBoxEventL END");
+// DP("CPodcastFeedView::HandleListBoxEventL END");
}
void CPodcastFeedView::FeedUpdateAllCompleteL(TFeedState /*aState*/)
{
- iUpdatingRunning = EFalse;
+ DP("FeedUpdateAllCompleteL");
+ iFeedUpdating = 0;
UpdateToolbar();
}
void CPodcastFeedView::FeedDownloadStartedL(TFeedState /*aState*/, TUint aFeedUid)
{
// Update status text
- iUpdatingRunning = ETrue;
+ iFeedUpdating = aFeedUid;
UpdateFeedInfoStatusL(aFeedUid, ETrue);
UpdateToolbar();
@@ -260,6 +284,7 @@
void CPodcastFeedView::UpdateFeedInfoStatusL(TUint aFeedUid, TBool aIsUpdating)
{
+ DP("CPodcastFeedView::UpdateFeedInfoStatusL BEGIN");
const RFeedInfoArray& feeds = iPodcastModel.FeedEngine().GetSortedFeeds();
// Find the index for the feed i both the feed-array and the listbox
@@ -293,6 +318,8 @@
iItemIdArray.InsertL(aFeedUid, feedsIdx);
iItemArray->Delete(listboxIdx);
iItemArray->InsertL(feedsIdx, KNullDesC);
+ iItemArrayShort->Delete(listboxIdx);
+ iItemArrayShort->InsertL(feedsIdx, KNullDesC);
iListContainer->Listbox()->HandleItemAdditionL();
}
// Update the listbox info
@@ -306,10 +333,12 @@
{
iListContainer->Listbox()->DrawItem(k);
}
+ DP("CPodcastFeedView::UpdateFeedInfoStatusL END");
}
void CPodcastFeedView::FormatFeedInfoListBoxItemL(CFeedInfo& aFeedInfo, TBool aIsUpdating)
{
+ DP("CPodcastFeedView::FormatFeedInfoListBoxItemL BEGIN");
TBuf<KMaxShortDateFormatSpec*2> updatedDate;
TBuf<KMaxUnplayedFeedsLength> unplayedShows;
TUint unplayedCount = 0;
@@ -359,8 +388,9 @@
updatedDate.Zero();
}
}
- CArrayPtr<CGulIcon>* icons = iListContainer->Listbox()->ItemDrawer()->FormattedCellData()->IconArray();
+
iconIndex = iFeedIdForIconArray.Find(aFeedInfo.Uid());
+ DP1(" iconIndex = %d", iconIndex);
if(iconIndex == KErrNotFound && aFeedInfo.FeedIcon() != NULL && aFeedInfo.ImageFileName().Length() > 0 &&
aFeedInfo.FeedIcon()->SizeInPixels().iHeight > 0 &&
aFeedInfo.FeedIcon()->SizeInPixels().iWidth > 0)
@@ -370,7 +400,10 @@
CFbsBitmap* bmpCopy = new (ELeave) CFbsBitmap;
CleanupStack::PushL(bmpCopy);
bmpCopy->Duplicate(aFeedInfo.FeedIcon()->Handle());
- icons->AppendL( CGulIcon::NewL(bmpCopy, NULL));
+ CArrayPtr<CGulIcon>* icons = iListContainer->ListboxIcons();
+
+ icons->AppendL( CGulIcon::NewL(AknIconUtils::CreateIconL(bmpCopy), NULL));
+
iFeedIdForIconArray.Append(aFeedInfo.Uid());
CleanupStack::Pop(bmpCopy);
iconIndex = icons->Count()-1;
@@ -383,8 +416,10 @@
if (unplayedShows.Length() > 0 && updatedDate.Length() > 0) {
unplayedShows.Insert(0,_L(", "));
}
-
- iListboxFormatbuffer.Format(KFeedFormat(), iconIndex, &(aFeedInfo.Title()), &updatedDate, &unplayedShows);
+
+ iListboxFormatbuffer.Format(KFeedFormatPortrait(), iconIndex, &(aFeedInfo.Title()), &updatedDate, &unplayedShows);
+ iListboxFormatbufferShort.Format(KFeedFormatLandscape(), iconIndex, &(aFeedInfo.Title()));
+ DP("CPodcastFeedView::FormatFeedInfoListBoxItemL END");
}
void CPodcastFeedView::ImageOperationCompleteL(TInt aError, TUint aHandle, CPodcastModel& /*aPodcastModel*/)
@@ -395,7 +430,8 @@
}
void CPodcastFeedView::UpdateFeedInfoDataL(CFeedInfo* aFeedInfo, TInt aIndex, TBool aIsUpdating )
- {
+ {
+ DP("CPodcastFeedView::UpdateFeedInfoDataL BEGIN");
TListItemProperties itemProps;
itemProps.SetDimmed(aIsUpdating);
FormatFeedInfoListBoxItemL(*aFeedInfo, aIsUpdating);
@@ -404,16 +440,20 @@
if (iListboxFormatbuffer.Compare(compareTo) != 0) {
iItemArray->Delete(aIndex);
+ iItemArrayShort->Delete(aIndex);
if(aIndex>= iItemArray->MdcaCount())
{
iItemArray->AppendL(iListboxFormatbuffer);
+ iItemArrayShort->AppendL(iListboxFormatbufferShort);
}
else
{
iItemArray->InsertL(aIndex, iListboxFormatbuffer);
+ iItemArrayShort->InsertL(aIndex, iListboxFormatbufferShort);
}
}
- iListContainer->Listbox()->ItemDrawer()->SetPropertiesL(aIndex, itemProps);
+ //iListContainer->Listbox()->ItemDrawer()->SetPropertiesL(aIndex, itemProps);
+ DP("CPodcastFeedView::UpdateFeedInfoDataL END");
}
@@ -443,12 +483,14 @@
while (iItemArray->Count() < nbrItems)
{
iItemArray->AppendL(KNullDesC);
+ iItemArrayShort->AppendL(KNullDesC);
TListItemProperties itemProps;
- iListContainer->Listbox()->ItemDrawer()->SetPropertiesL(iItemArray->Count() - 1, itemProps);
+ //iListContainer->Listbox()->ItemDrawer()->SetPropertiesL(iItemArray->Count() - 1, itemProps);
}
while (iItemArray->Count() > nbrItems)
{
iItemArray->Delete(iItemArray->Count() - 1);
+ iItemArrayShort->Delete(iItemArray->Count() - 1);
}
iUpdater->StartUpdate(nbrItems);
}
@@ -458,12 +500,13 @@
TBuf<KMaxFeedNameLength> itemName;
iEikonEnv->ReadResourceL(itemName, R_PODCAST_FEEDS_NO_FEEDS);
iItemArray->Reset();
+ iItemArrayShort->Reset();
iItemIdArray.Reset();
TListItemProperties itemProps;
itemProps.SetDimmed(ETrue);
itemProps.SetHiddenSelection(ETrue);
- iListContainer->Listbox()->ItemDrawer()->SetPropertiesL(0, itemProps);
+ //iListContainer->Listbox()->ItemDrawer()->SetPropertiesL(0, itemProps);
}
iListContainer->Listbox()->HandleItemAdditionL();
DP("CPodcastFeedView::UpdateListboxItemsL END");
@@ -480,9 +523,6 @@
switch(aCommand)
{
- case EPodcastHide:
- AppUi()->HandleCommandL(EEikCmdExit);
- break;
case EPodcastAddFeed:
HandleAddFeedL();
break;
@@ -510,35 +550,13 @@
}break;
case EPodcastCancelUpdateAllFeeds:
{
- if(iUpdatingRunning)
+ if(iFeedUpdating)
{
iPodcastModel.FeedEngine().CancelUpdateAllFeeds();
}
}break;
- case EAknSoftkeyExit:
- {
- RShowInfoArray dlQueue;
- iPodcastModel.ShowEngine().GetShowsDownloadingL(dlQueue);
- TUint queueCount = dlQueue.Count();
- dlQueue.ResetAndDestroy();
- dlQueue.Close();
-
- if (queueCount > 0 && !iPodcastModel.SettingsEngine().DownloadSuspended())
- {
- TBuf<KMaxMessageLength> message;
- iEikonEnv->ReadResourceL(message, R_EXIT_SHOWS_DOWNLOADING);
- if(ShowQueryMessageL(message))
- {
- // pass it on to AppUi, which will exit for us
- CPodcastListView::HandleCommandL(aCommand);
- }
- }
- else
- {
- // nothing in queue, or downloading suspended
- CPodcastListView::HandleCommandL(aCommand);
- }
- }
+ case EPodcastShowInfo:
+ DisplayFeedInfoDialogL();
break;
default:
CPodcastListView::HandleCommandL(aCommand);
@@ -550,6 +568,23 @@
DP("CPodcastFeedView::HandleCommandL END");
}
+void CPodcastFeedView::DisplayFeedInfoDialogL()
+ {
+ const RFeedInfoArray* sortedItems = NULL;
+ TInt index = iListContainer->Listbox()->CurrentItemIndex();
+ sortedItems = &iPodcastModel.FeedEngine().GetSortedFeeds();
+
+ if(index >= 0 && index < sortedItems->Count())
+ {
+ CFeedInfo *info = (*sortedItems)[index];
+ HBufC* description = info->Description().AllocL();
+ HBufC* title = info->Title().AllocL();
+ CAknMessageQueryDialog* note = new ( ELeave ) CAknMessageQueryDialog( description, title );
+
+ note->PrepareLC( R_SHOW_INFO_NOTE ); // Adds to CleanupStack
+ note->RunLD();
+ }
+ }
void CPodcastFeedView::UpdateToolbar(TBool aVisible)
{
DP("CPodcastFeedView::UpdateToolbar BEGIN");
@@ -560,10 +595,10 @@
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 );
+ toolbar->HideItem(EPodcastUpdateAllFeeds, iFeedUpdating, ETrue);
+ toolbar->HideItem(EPodcastCancelUpdateAllFeeds, !iFeedUpdating, ETrue );
+ toolbar->SetItemDimmed(EPodcastAddFeed, iFeedUpdating, ETrue );
+ toolbar->SetItemDimmed(EPodcastSettings, iFeedUpdating, ETrue );
}
DP("CPodcastFeedView::UpdateToolbar END");
}
@@ -598,6 +633,22 @@
CleanupStack::PopAndDestroy( array );
}
+void CPodcastFeedView::ShowItem(TUint aUid)
+ {
+ TInt listIndex = -1;
+ for (TUint i=0;i<iItemIdArray.Count();i++)
+ {
+ if (iItemIdArray[i] == aUid)
+ {
+ listIndex = i;
+ }
+ }
+
+ if (listIndex != -1)
+ iListContainer->Listbox()->ScrollToMakeItemVisible(listIndex);
+
+ }
+
void CPodcastFeedView::HandleAddFeedUrlL()
{
TBuf<KFeedUrlLength> url;
@@ -630,10 +681,7 @@
iEikonEnv->ReadResourceL(message, R_ADD_FEED_SUCCESS);
if(ShowQueryMessageL(message))
{
- CFeedInfo *info = iPodcastModel.FeedEngine().GetFeedInfoByUid(newFeedInfo->Uid());
-
- iPodcastModel.SetActiveFeedInfo(info);
- AppUi()->ActivateLocalViewL(KUidPodcastShowsViewID, TUid::Uid(0), KNullDesC8());
+ ShowItem(newFeedInfo->Uid());
iPodcastModel.FeedEngine().UpdateFeedL(newFeedInfo->Uid());
}
}
@@ -762,6 +810,7 @@
{
iPodcastModel.FeedEngine().RemoveFeedL(iItemIdArray[index]);
iItemArray->Delete(index);
+ iItemArrayShort->Delete(index);
iItemIdArray.Remove(index);
iListContainer->Listbox()->HandleItemRemovalL();
iListContainer->Listbox()->DrawNow();
@@ -883,10 +932,14 @@
void CPodcastFeedView::CheckConfirmExit()
{
+ DP("CPodcastFeedView::CheckConfirmExit");
RShowInfoArray showsDownloading;
iPodcastModel.ShowEngine().GetShowsDownloadingL(showsDownloading);
+ TUint count = showsDownloading.Count();
+ showsDownloading.ResetAndDestroy();
+ showsDownloading.Close();
- if (showsDownloading.Count() > 0 && !iPodcastModel.SettingsEngine().DownloadSuspended())
+ if (count > 0 && !iPodcastModel.SettingsEngine().DownloadSuspended())
{
TBuf<256> msg;
iEikonEnv->ReadResourceL(msg, R_EXIT_SHOWS_DOWNLOADING);
@@ -954,6 +1007,7 @@
}
else
{
+ iToolbar->SetToolbarVisibility(EFalse);
AppUi()->ActivateLocalViewL(KUidPodcastSearchViewID, TUid::Uid(0), KNullDesC8());
}
iOpmlState = EOpmlIdle;
@@ -988,6 +1042,12 @@
if(iStylusPopupMenu && aPenEventLocation.iY < lbHeight)
{
+ TInt index = iListContainer->Listbox()->CurrentItemIndex();
+
+ CFeedInfo *info = iPodcastModel.FeedEngine().GetSortedFeeds()[index];
+
+ iStylusPopupMenu->SetItemDimmed(EPodcastShowInfo, info->Description().Length() == 0);
+
iStylusPopupMenu->ShowMenu();
iStylusPopupMenu->SetPosition(aPenEventLocation);
}
--- a/application/src/PodcastFeedViewUpdater.cpp Tue Oct 26 15:58:11 2010 +0100
+++ b/application/src/PodcastFeedViewUpdater.cpp Fri Nov 12 20:48:14 2010 +0000
@@ -73,6 +73,7 @@
else
{
StopUpdate();
+ iPodcastFeedView.UpdateItemsComplete();
}
}
--- a/application/src/PodcastListView.cpp Tue Oct 26 15:58:11 2010 +0100
+++ b/application/src/PodcastListView.cpp Fri Nov 12 20:48:14 2010 +0000
@@ -30,6 +30,8 @@
#include <aknquerydialog.h>
#include <barsread.h>
#include <akntitle.h>
+#include <akniconarray.h>
+#include <EIKCLBD.H>
#include "buildno.h"
@@ -39,46 +41,69 @@
{
}
-void CPodcastListContainer::SetKeyEventListener(MKeyEventListener *aKeyEventListener)
+void CPodcastListContainer::SetContainerListener(MContainerListener *aContainerListener)
{
- iKeyEventListener = aKeyEventListener;
+ iContainerListener = aContainerListener;
}
TKeyResponse CPodcastListContainer::OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType)
{
TKeyResponse response = iListbox->OfferKeyEventL(aKeyEvent, aType);
- if (iKeyEventListener)
- iKeyEventListener->OfferKeyEventL(aKeyEvent, aType);
+ if (iContainerListener)
+ iContainerListener->OfferKeyEventL(aKeyEvent, aType);
return response;
}
void CPodcastListContainer::ConstructL( const TRect& aRect, TInt aListboxFlags )
{
+ DP("CPodcastListContainer::ConstructL BEGIN");
CreateWindowL();
iBgContext =
CAknsBasicBackgroundControlContext::NewL( KAknsIIDQsnBgAreaMain,
aRect,
ETrue );
-
+
+ iListboxLandscape = new (ELeave) CAknSingleLargeStyleListBox;
+ iListboxLandscape->ConstructL(this, aListboxFlags);
+ iListboxLandscape->SetMopParent( this );
+ iListboxLandscape->SetContainerWindowL(*this);
+ iListboxLandscape->CreateScrollBarFrameL(ETrue);
+ iListboxLandscape->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EAuto, CEikScrollBarFrame::EAuto );
+ iListboxLandscape->SetSize(aRect.Size());
+ iListboxLandscape->MakeVisible(EFalse);
+
+ iListboxPortrait = new (ELeave) CAknDoubleLargeStyleListBox;
+ iListboxPortrait->ConstructL(this, aListboxFlags);
+ iListboxPortrait->SetMopParent( this );
+ iListboxPortrait->SetContainerWindowL(*this);
+ iListboxPortrait->CreateScrollBarFrameL(ETrue);
+ iListboxPortrait->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EAuto, CEikScrollBarFrame::EAuto );
+ iListboxPortrait->SetSize(aRect.Size());
+ iListboxPortrait->MakeVisible(EFalse);
+
+ if (aRect.Width() > aRect.Height())
+ {
+ iLandscape = ETrue;
+ iListbox = iListboxLandscape;
+ iListboxLandscape->MakeVisible(ETrue);
+ }
+ else
+ {
+ iLandscape = EFalse;
+ iListboxPortrait->MakeVisible(ETrue);
+ iListbox = (CEikColumnListBox*) iListboxPortrait;
+ }
+
+ MakeVisible(EFalse);
+
// Set the windows size
- SetRect( aRect );
- iListbox =static_cast<CEikFormattedCellListBox*>( new (ELeave) CAknDoubleLargeStyleListBox);
- iListbox->ConstructL(this, aListboxFlags);
- iListbox->SetMopParent( this );
- iListbox->SetContainerWindowL(*this);
- iListbox->CreateScrollBarFrameL(ETrue);
- iListbox->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EAuto, CEikScrollBarFrame::EAuto );
-
- iListbox->ItemDrawer()->FormattedCellData()->EnableMarqueeL( ETrue );
+ SetRect( aRect );
- iListbox->SetSize(aRect.Size());
- iListbox->MakeVisible(ETrue);
- MakeVisible(EFalse);
-
// Activate the window, which makes it ready to be drawn
ActivateL();
+ DP("CPodcastListContainer::ConstructL END");
}
TInt CPodcastListContainer::CountComponentControls() const
@@ -91,7 +116,10 @@
switch ( aIndex )
{
case 0:
- return iListbox;
+ if (iLandscape)
+ return iListboxLandscape;
+ else
+ return iListboxPortrait;
default:
return NULL;
}
@@ -128,25 +156,88 @@
}
void CPodcastListContainer::SizeChanged()
{
- DP2("CPodcastListContainer::SizeChanged(), width=%d, height=%d",Size().iWidth, Size().iHeight);
- if(iListbox != NULL)
- {
- iListbox->SetSize(Size());
- }
+ DP2("CPodcastListContainer::SizeChanged() BEGIN, width=%d, height=%d",Size().iWidth, Size().iHeight);
+
+ iLandscape = Size().iWidth > Size().iHeight;
+
+ if (iContainerListener)
+ iContainerListener->SizeChanged();
+
+ if (iLandscape)
+ {
+ iListboxPortrait->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff, CEikScrollBarFrame::EOff );
+ iListboxPortrait->UpdateScrollBarsL();
+ iListboxPortrait->MakeVisible(EFalse);
+
+ iListboxLandscape->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EAuto, CEikScrollBarFrame::EAuto );
+ iListboxLandscape->MakeVisible(ETrue);
+ iListboxLandscape->SetFocus(ETrue, EDrawNow);
+ iListbox = iListboxLandscape;
+ }
+ else
+ {
+ iListboxLandscape->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff, CEikScrollBarFrame::EOff );
+ iListboxLandscape->UpdateScrollBarsL();
+ iListboxLandscape->MakeVisible(EFalse);
+
+ iListboxPortrait->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EAuto, CEikScrollBarFrame::EAuto );
+ iListboxPortrait->MakeVisible(ETrue);
+ iListboxPortrait->SetFocus(ETrue, EDrawNow);
+ iListbox = (CEikColumnListBox*) iListboxPortrait;
+ }
+
+ iListbox->SetSize(Size());
+ ActivateL();
+ DrawNow();
+ DP("CPodcastListContainer::SizeChanged END");
}
-CEikFormattedCellListBox* CPodcastListContainer::Listbox()
+CEikColumnListBox* CPodcastListContainer::Listbox()
{
return iListbox;
}
+void CPodcastListContainer::SetListboxObserver(MEikListBoxObserver *aObserver)
+ {
+ iListboxLandscape->SetListBoxObserver(aObserver);
+ iListboxPortrait->SetListBoxObserver(aObserver);
+ }
+
+void CPodcastListContainer::SetListboxIcons(CArrayPtr< CGulIcon >* aIcons)
+{
+ iListboxLandscape->ItemDrawer()->ColumnData()->SetIconArray(aIcons);
+ iListboxPortrait->ItemDrawer()->FormattedCellData()->SetIconArrayL(aIcons);
+}
+
+CArrayPtr<CGulIcon>* CPodcastListContainer::ListboxIcons()
+ {
+ if (iListboxLandscape == iListbox)
+ return iListboxLandscape->ItemDrawer()->ColumnData()->IconArray();
+ else
+ return iListboxPortrait->ItemDrawer()->FormattedCellData()->IconArray();
+ }
+
+void CPodcastListContainer::SetListboxTextArrays(CDesCArray* aPortraitArray, CDesCArray* aLandscapeArray)
+ {
+ iListboxLandscape->Model()->SetOwnershipType(ELbmDoesNotOwnItemArray);
+ iListboxLandscape->Model()->SetItemTextArray(aLandscapeArray);
+ iListboxPortrait->Model()->SetOwnershipType(ELbmDoesNotOwnItemArray);
+ iListboxPortrait->Model()->SetItemTextArray(aPortraitArray);
+ }
CPodcastListContainer::~CPodcastListContainer()
{
- delete iListbox;
+ iListboxLandscape->ItemDrawer()->ColumnData()->SetIconArray(NULL);
+ delete iListboxPortrait;
+ delete iListboxLandscape;
delete iBgContext;
}
+void CPodcastListContainer::SetEmptyText(const TDesC &aText)
+ {
+ iListboxPortrait->View()->SetListEmptyTextL(aText);
+ iListboxLandscape->View()->SetListEmptyTextL(aText);
+ }
void CPodcastListContainer::Draw(const TRect& aRect) const
{
@@ -169,8 +260,8 @@
void CPodcastListContainer::HandlePointerEventL(const TPointerEvent& aPointerEvent)
{
- if (iPointerListener)
- iPointerListener->PointerEventL(aPointerEvent);
+ if (iContainerListener)
+ iContainerListener->PointerEventL(aPointerEvent);
// Call base class HandlePointerEventL() if not a long tap
if (!iLongTapDetected)
@@ -179,13 +270,6 @@
}
}
-
-void CPodcastListContainer::SetPointerListener(MPointerListener *aPointerListener)
- {
- iPointerListener = aPointerListener;
- }
-
-
CPodcastListView::CPodcastListView()
{
}
@@ -193,29 +277,36 @@
void CPodcastListView::ConstructL()
{
DP("CPodcastListView::ConstructL BEGIN");
+
iListContainer = new (ELeave) CPodcastListContainer;
- iListContainer->ConstructL(ClientRect(), iListboxFlags);
+ TRect rect = ClientRect();
+
+ iListContainer->ConstructL(rect, iListboxFlags);
iListContainer->SetMopParent(this);
iListContainer->ActivateL();
+
iItemArray = new (ELeave)CDesCArrayFlat(KDefaultGran);
- iListContainer->Listbox()->Model()->SetItemTextArray(iItemArray);
- iListContainer->Listbox()->Model()->SetOwnershipType(ELbmDoesNotOwnItemArray);
-
+ iItemArrayShort = new (ELeave)CDesCArrayFlat(KDefaultGran);
+
+ iListContainer->SetListboxTextArrays(iItemArray, iItemArrayShort);
+ iListContainer->SetContainerListener(this);
+ iListContainer->SetListboxObserver(this);
+
if (Toolbar()) {
iToolbar = Toolbar();
iToolbar->SetToolbarObserver(this);
}
iLongTapDetector = CAknLongTapDetector::NewL(this);
- iListContainer->SetPointerListener(this);
- iListContainer->SetKeyEventListener(this);
DP("CPodcastListView::ConstructL END");
}
void CPodcastListView::HandleViewRectChange()
-{
- if ( iListContainer )
+{
+ TBool wasVisible = iListContainer->IsVisible();
+
+ if ( iListContainer )
{
iListContainer->SetRect( ClientRect() );
}
@@ -225,11 +316,7 @@
{
DP2("CPodcastListView::HandleStatusPaneSizeChange(), width=%d, height=%d", ClientRect().Width(), ClientRect().Height());
- if ( iListContainer )
- {
- iListContainer->SetRect( ClientRect() );
- }
-
+ HandleViewRectChange();
}
@@ -242,6 +329,7 @@
}
delete iItemArray;
+ delete iItemArrayShort;
delete iLongTapDetector;
iItemIdArray.Close();
}
@@ -291,12 +379,9 @@
DP1("CPodcastListView::HandleCommandL=%d", aCommand);
switch(aCommand)
{
- case EAknSoftkeyExit:
- case EEikCmdExit:
- {
- AppUi()->Exit();
- break;
- }
+ case EPodcastHide:
+ AppUi()->HandleCommandL(EEikCmdExit);
+ break;
case EAknSoftkeyBack:
{
AppUi()->ActivateViewL(iPreviousView);
@@ -333,7 +418,7 @@
void CPodcastListView::SetEmptyTextL(TInt aResourceId)
{
HBufC* emptyText = iEikonEnv->AllocReadResourceLC(aResourceId);
- iListContainer->Listbox()->View()->SetListEmptyTextL(*emptyText);
+ iListContainer->SetEmptyText(*emptyText);
CleanupStack::PopAndDestroy(emptyText);
}
--- a/application/src/PodcastQueueView.cpp Tue Oct 26 15:58:11 2010 +0100
+++ b/application/src/PodcastQueueView.cpp Fri Nov 12 20:48:14 2010 +0000
@@ -61,8 +61,6 @@
CPodcastListView::ConstructL();
CreateIconsL();
-
- iListContainer->Listbox()->SetListBoxObserver(this);
iPodcastModel.FeedEngine().AddObserver(this);
iPodcastModel.ShowEngine().AddObserver(this);
@@ -155,6 +153,7 @@
void CPodcastQueueView::UpdateListboxItemsL()
{
+ DP("CPodcastQueueView::UpdateListboxItemsL BEGIN");
if (iListContainer->IsVisible() && !iDontUpdateList)
{
TListItemProperties itemProps;
@@ -194,10 +193,11 @@
}
else
{
- iListContainer->Listbox()->ItemDrawer()->ClearAllPropertiesL();
+ //iListContainer->Listbox()->ItemDrawer()->ClearAllPropertiesL();
iListContainer->Listbox()->Reset();
iItemIdArray.Reset();
iItemArray->Reset();
+ iItemArrayShort->Reset();
if (len > 0)
{
@@ -207,11 +207,13 @@
FormatShowInfoListBoxItemL(*si);
iItemIdArray.Append(si->Uid());
iItemArray->AppendL(iListboxFormatbuffer);
+ iItemArrayShort->AppendL(iListboxFormatbufferShort);
}
}
else
{
iItemArray->Reset();
+ iItemArrayShort->Reset();
iItemIdArray.Reset();
itemProps.SetDimmed(ETrue);
@@ -221,6 +223,7 @@
}
}
}
+ DP("CPodcastQueueView::UpdateListboxItemsL END");
}
/**
@@ -327,6 +330,11 @@
UpdateListboxItemsL();
}
break;
+ case EPodcastShowInfo:
+ {
+ DisplayShowInfoDialogL();
+ }
+ break;
default:
CPodcastListView::HandleCommandL(aCommand);
break;
--- a/application/src/PodcastSearchView.cpp Tue Oct 26 15:58:11 2010 +0100
+++ b/application/src/PodcastSearchView.cpp Fri Nov 12 20:48:14 2010 +0000
@@ -26,6 +26,7 @@
#include <caknfileselectiondialog.h>
#include <podcast.rsg>
#include <podcast.mbg>
+#include <akntitle.h>
#include <gulicon.h>
#include <eikenv.h>
#include <e32const.h>
@@ -42,6 +43,7 @@
#define KMaxMessageLength 200
#define KMaxTitleLength 100
_LIT(KSearchResultFormat, "%d\t%S\t%S");
+_LIT(KSearchResultFormatLandscape, "%d\t%S");
CPodcastSearchView* CPodcastSearchView::NewL(CPodcastModel& aPodcastModel)
{
@@ -83,10 +85,8 @@
icons->AppendL( CGulIcon::NewL( bitmap, mask ) );
CleanupStack::Pop(2); // bitmap, mask
- iListContainer->Listbox()->ItemDrawer()->FormattedCellData()->SetIconArrayL( icons );
+ iListContainer->SetListboxIcons(icons);
CleanupStack::Pop(icons); // icons
-
- iListContainer->Listbox()->SetListBoxObserver(this);
SetEmptyTextL(R_PODCAST_EMPTY_SEARCH);
}
@@ -114,16 +114,25 @@
{
CPodcastListView::DoActivateL(aPrevViewId, aCustomMessageId, aCustomMessage);
iPreviousView = TVwsViewId(KUidPodcast, KUidPodcastFeedViewID);
+
+ HBufC* text = iEikonEnv->AllocReadResourceLC(R_SEARCH_RESULTS);
+
+ CAknTitlePane* titlePane = static_cast<CAknTitlePane*>
+ ( StatusPane()->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) );
- ((CPodcastAppUi*)AppUi())->NaviSetTextL(R_SEARCH_RESULTS);
-
+ titlePane->SetTextL(*text , ETrue );
+ CleanupStack::PopAndDestroy(text);
UpdateListboxItemsL();
}
void CPodcastSearchView::DoDeactivate()
{
CPodcastListView::DoDeactivate();
- TRAP_IGNORE(((CPodcastAppUi*)AppUi())->NaviShowTabGroupL());
+
+ CAknTitlePane* titlePane = static_cast<CAknTitlePane*>
+ ( StatusPane()->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) );
+
+ titlePane->SetTextToDefaultL();
}
@@ -157,7 +166,7 @@
TInt len = searchItems->Count();
TListItemProperties itemProps;
iListContainer->Listbox()->Reset();
- iListContainer->Listbox()->ItemDrawer()->ClearAllPropertiesL();
+ //iListContainer->Listbox()->ItemDrawer()->ClearAllPropertiesL();
iItemIdArray.Reset();
iItemArray->Reset();
@@ -174,7 +183,9 @@
PodcastUtils::RemoveAllFormatting(descr);
iListboxFormatbuffer.Format(KSearchResultFormat(), iconIndex, &fi->Title(), &descr);
iItemArray->AppendL(iListboxFormatbuffer);
- iListContainer->Listbox()->ItemDrawer()->SetPropertiesL(i, itemProps);
+ iListboxFormatbufferShort.Format(KSearchResultFormatLandscape(), iconIndex, &fi->Title());
+ iItemArrayShort->AppendL(iListboxFormatbufferShort);
+ //iListContainer->Listbox()->ItemDrawer()->SetPropertiesL(i, itemProps);
}
}
else
@@ -182,12 +193,13 @@
TBuf<KMaxFeedNameLength> itemName;
iEikonEnv->ReadResourceL(itemName, R_PODCAST_NO_SEARCH_RESULTS);
iItemArray->Reset();
+ iItemArrayShort->Reset();
iItemIdArray.Reset();
TListItemProperties itemProps;
itemProps.SetDimmed(ETrue);
itemProps.SetHiddenSelection(ETrue);
- iListContainer->Listbox()->ItemDrawer()->SetPropertiesL(0, itemProps);
+ //iListContainer->Listbox()->ItemDrawer()->SetPropertiesL(0, itemProps);
}
iListContainer->Listbox()->HandleItemAdditionL();
DP("CPodcastSearchView::UpdateListboxItemsL END");
@@ -221,18 +233,12 @@
TBool added = iPodcastModel.FeedEngine().AddFeedL(*newInfo);
if (added)
- {
- // ask if user wants to update it now
- TBuf<KMaxMessageLength> message;
- iEikonEnv->ReadResourceL(message, R_ADD_FEED_SUCCESS);
- if(ShowQueryMessageL(message))
- {
- CFeedInfo *info = iPodcastModel.FeedEngine().GetFeedInfoByUid(newInfo->Uid());
-
- iPodcastModel.SetActiveFeedInfo(info);
- AppUi()->ActivateLocalViewL(KUidPodcastShowsViewID, TUid::Uid(0), KNullDesC8());
- iPodcastModel.FeedEngine().UpdateFeedL(info->Uid());
- }
+ {
+ // this is a bit of a hack, first we activate the feeds view normally
+ AppUi()->ActivateLocalViewL(KUidPodcastFeedViewID, TUid::Uid(0), KNullDesC8);
+ // and then we send the UID of the recently added feed back to feed view for updating
+ // this is needed so the update? query comes on top of feed view, not search view
+ AppUi()->ActivateLocalViewL(KUidPodcastFeedViewID, TUid::Uid(newInfo->Uid()), KNullDesC8);
}
else
{
--- a/application/src/PodcastShowsView.cpp Tue Oct 26 15:58:11 2010 +0100
+++ b/application/src/PodcastShowsView.cpp Fri Nov 12 20:48:14 2010 +0000
@@ -37,7 +37,8 @@
_LIT(KSizeDownloadingOf, "%.1f/%.1f MB");
_LIT(KShowsSizeFormatS60, "%.1f MB");
-_LIT(KShowFormat, "%d\t%S\t%S%S\t");
+_LIT(KShowFormat, "%d\t%S\t%S%S");
+_LIT(KShowFormatLandscape, "%d\t%S");
// these must correspond with TShowsIconIndex
@@ -109,9 +110,7 @@
CPodcastListView::ConstructL();
CreateIconsL();
-
- iListContainer->Listbox()->SetListBoxObserver(this);
-
+
iPodcastModel.FeedEngine().AddObserver(this);
iPodcastModel.ShowEngine().AddObserver(this);
@@ -147,7 +146,8 @@
pos+=2;
}
- iListContainer->Listbox()->ItemDrawer()->FormattedCellData()->SetIconArrayL(icons);
+ //iListContainer->Listbox()->ItemDrawer()->FormattedCellData()->SetIconArrayL(icons);
+ iListContainer->SetListboxIcons(icons);
CleanupStack::Pop(icons); // icons
}
@@ -219,7 +219,6 @@
UpdateViewTitleL();
UpdateFeedUpdateStateL();
- UpdateToolbar();
DP("CPodcastShowsView::DoActivateL END");
}
@@ -461,6 +460,7 @@
}
iListboxFormatbuffer.Format(KShowFormat(), iconIndex, &aShowInfo.Title(), &showDate, &infoSize);
+ iListboxFormatbufferShort.Format(KShowFormatLandscape(), iconIndex, &aShowInfo.Title());
}
void CPodcastShowsView::GetShowErrorText(TDes &aErrorMessage, TInt aErrorCode)
@@ -472,13 +472,17 @@
{
FormatShowInfoListBoxItemL(*aShowInfo, aSizeDownloaded);
iItemArray->Delete(aIndex);
+ iItemArrayShort->Delete(aIndex);
+
if(aIndex>= iItemArray->MdcaCount())
{
iItemArray->AppendL(iListboxFormatbuffer);
+ iItemArrayShort->AppendL(iListboxFormatbufferShort);
}
else
{
iItemArray->InsertL(aIndex, iListboxFormatbuffer);
+ iItemArrayShort->InsertL(aIndex, iListboxFormatbufferShort);
}
}
@@ -499,6 +503,7 @@
void CPodcastShowsView::UpdateListboxItemsL()
{
+ DP("CPodcastShowsView::UpdateListboxItemsL BEGIN");
if (iListContainer->IsVisible())
{
TListItemProperties itemProps;
@@ -538,11 +543,12 @@
}
else
{
- iListContainer->Listbox()->ItemDrawer()->ClearAllPropertiesL();
+ //iListContainer->Listbox()->ItemDrawer()->ClearAllPropertiesL();
iListContainer->Listbox()->Reset();
iItemIdArray.Reset();
iItemArray->Reset();
-
+ iItemArrayShort->Reset();
+
if (len > 0)
{
for (TInt i=0; i<len; i++)
@@ -551,11 +557,14 @@
FormatShowInfoListBoxItemL(*si);
iItemIdArray.Append(si->Uid());
iItemArray->AppendL(iListboxFormatbuffer);
+ iItemArrayShort->AppendL(iListboxFormatbufferShort);
+
}
}
else
{
iItemArray->Reset();
+ iItemArrayShort->Reset();
iItemIdArray.Reset();
itemProps.SetDimmed(ETrue);
@@ -565,6 +574,7 @@
}
}
}
+ DP("CPodcastShowsView::UpdateListboxItemsL END");
}
/**
--- a/engine/inc/Podcatcher.pan Tue Oct 26 15:58:11 2010 +0100
+++ b/engine/inc/Podcatcher.pan Fri Nov 12 20:48:14 2010 +0000
@@ -24,7 +24,8 @@
EPodcatcherPanicDB = 1,
EPodcatcherPanicAlreadyActive,
EPodcatcherPanicFeedEngineState,
- EPodcatcherPanicFeedView
+ EPodcatcherPanicFeedView,
+ EPodcatcherDownloadDrive
};
--- a/engine/inc/ShowEngine.h Tue Oct 26 15:58:11 2010 +0100
+++ b/engine/inc/ShowEngine.h Fri Nov 12 20:48:14 2010 +0000
@@ -147,7 +147,7 @@
CPodcastModel& iPodcastModel;
// observers that will receive callbacks
- RArray<MShowEngineObserver*> iObservers;
+ RArray<MShowEngineObserver*> iObservers;
// The show we are currently downloading
CShowInfo* iShowDownloading;
--- a/engine/src/ConnectionEngine.cpp Tue Oct 26 15:58:11 2010 +0100
+++ b/engine/src/ConnectionEngine.cpp Fri Nov 12 20:48:14 2010 +0000
@@ -56,8 +56,8 @@
void CConnectionEngine::RunL()
{
- DP1("CConnectionEngine::RunL BEGIN, iStatus.Int()=%d", iStatus.Int());
- if ( iStatus.Int() == KErrNone && iMobility == NULL)
+ DP2("CConnectionEngine::RunL BEGIN, iStatus.Int()=%d, iConnectionState=%d", iStatus.Int(), iConnectionState);
+ if ( iStatus.Int() == KErrNone && iMobility == NULL && iConnectionState == EConnected)
{
TRAPD(err, iMobility = CActiveCommsMobilityApiExt::NewL( iConnection, *this ));
--- a/engine/src/FeedEngine.cpp Tue Oct 26 15:58:11 2010 +0100
+++ b/engine/src/FeedEngine.cpp Fri Nov 12 20:48:14 2010 +0000
@@ -101,6 +101,7 @@
CFeedEngine::~CFeedEngine()
{
+ DP("~CFeedEngine BEGIN");
iObservers.Close();
iFeedsUpdating.Close();
@@ -112,6 +113,7 @@
delete iOpmlParser;
//
delete iRepository;
+ DP("~CFeedEngine END");
}
/**
@@ -173,7 +175,7 @@
}
//
iAutoUpdatedInitiator = aAutoUpdate;
- if ((iFeedsUpdating.Count() > 0) || (isOfflineProfile && aAutoUpdate))
+ if ((iFeedsUpdating.Count() > 0) || (isOfflineProfile && aAutoUpdate))
{
DP("Cancelling update");
iFeedClient->Stop();
@@ -299,7 +301,7 @@
void CFeedEngine::NewShowL(CShowInfo& aItem)
{
- DP1("NewShowL, aItem.Title()=%S", &aItem.Title());
+ DP1("CFeedEngine::NewShowL BEGIN, aItem.Title()=%S", &aItem.Title());
HBufC* description = HBufC::NewLC(KMaxDescriptionLength);
TPtr ptr(description->Des());
ptr.Copy(aItem.Description());
@@ -326,6 +328,7 @@
}
showsAdded++;
+ DP("CFeedEngine::NewShowL END");
}
void CFeedEngine::GetFeedImageL(CFeedInfo *aFeedInfo)
@@ -342,6 +345,11 @@
TFileName fileName;
PodcastUtils::FileNameFromUrl(aFeedInfo->ImageUrl(), fileName);
+ fileName.Trim();
+
+ if (fileName.Length() == 0)
+ User::Leave(KErrNotFound);
+
relPath.Append(fileName);
PodcastUtils::EnsureProperPathName(relPath);
@@ -982,7 +990,7 @@
const void *linkz = sqlite3_column_text16(st, 5);
TPtrC16 link((const TUint16*)linkz);
- feedInfo->SetDescriptionL(link);
+ feedInfo->SetLinkL(link);
sqlite3_int64 built = sqlite3_column_int64(st, 6);
TTime buildtime(built);
@@ -1056,11 +1064,11 @@
const void *imagefilez = sqlite3_column_text16(st, 4);
TPtrC16 imagefile((const TUint16*)imagefilez);
- feedInfo->SetDescriptionL(imagefile);
+ feedInfo->SetImageFileNameL(imagefile, &iPodcastModel);
const void *linkz = sqlite3_column_text16(st, 5);
TPtrC16 link((const TUint16*)linkz);
- feedInfo->SetDescriptionL(link);
+ feedInfo->SetLinkL(link);
sqlite3_int64 built = sqlite3_column_int64(st, 6);
TTime buildtime(built);
--- a/engine/src/FeedInfo.cpp Tue Oct 26 15:58:11 2010 +0100
+++ b/engine/src/FeedInfo.cpp Fri Nov 12 20:48:14 2010 +0000
@@ -225,7 +225,7 @@
{
// If this fails, no reason to worry
iFeedIcon = new CFbsBitmap();
- TRAP_IGNORE(aPodcastModel->ImageHandler().LoadFileAndScaleL(FeedIcon(), ImageFileName(), TSize(64,56), *this, Uid()));
+ TRAP_IGNORE(aPodcastModel->ImageHandler().LoadFileAndScaleL(FeedIcon(), ImageFileName(), TSize(128,128), *this, Uid()));
}
DP("CFeedInfo::SetImageFileNameL END");
}
--- a/engine/src/FeedParser.cpp Tue Oct 26 15:58:11 2010 +0100
+++ b/engine/src/FeedParser.cpp Fri Nov 12 20:48:14 2010 +0000
@@ -309,11 +309,11 @@
iItemsParsed++;
DP2("iItemsParsed: %d, iMaxItems: %d", iItemsParsed, iMaxItems);
-// if (iItemsParsed >= iMaxItems)
-// {
-// iStoppedParsing = ETrue;
-// DP("*** Too many items, aborting parsing");
-// }
+ if (iItemsParsed >= iMaxItems)
+ {
+ iStoppedParsing = ETrue;
+ DP("*** Too many items, aborting parsing");
+ }
iFeedState=EStateChannel;
}
@@ -321,57 +321,64 @@
case EStateItemPubDate:
DP1("PubDate END: iBuffer='%S'", &iBuffer);
if (str.CompareF(KTagPubDate) == 0) {
- // hack for feeds that don't always write day as two digits
- TChar five(iBuffer[5]);
- TChar six(iBuffer[6]);
+ DP1("iBuffer.Length()=%d", iBuffer.Length());
- if (five.IsDigit() && !six.IsDigit()) {
- TBuf<KMaxStringBuffer> fix;
- fix.Copy(iBuffer.Left(4));
- fix.Append(_L(" 0"));
- fix.Append(iBuffer.Mid(5));
- iBuffer.Copy(fix);
- }
- // end hack
+ if (iBuffer.Length() > 6)
+ {
+ // hack for feeds that don't always write day as two digits
+ TChar five(iBuffer[5]);
+ TChar six(iBuffer[6]);
+
+ if (five.IsDigit() && !six.IsDigit()) {
+ TBuf<KMaxStringBuffer> fix;
+ fix.Copy(iBuffer.Left(4));
+ fix.Append(_L(" 0"));
+ fix.Append(iBuffer.Mid(5));
+ iBuffer.Copy(fix);
+ }
+ // end hack
+ }
- // hack for feeds that write out months in full
-
- if (iBuffer[11] != ' ') {
- TPtrC midPtr = iBuffer.Mid(8);
+ if (iBuffer.Length() > 11)
+ {
+ // hack for feeds that write out months in full
- int spacePos = midPtr.Find(_L(" "));
-
- if (spacePos != KErrNotFound) {
- //DP1("Month: %S", &midPtr.Left(spacePos));
+ if (iBuffer[11] != ' ') {
+ TPtrC midPtr = iBuffer.Mid(8);
+
+ int spacePos = midPtr.Find(_L(" "));
- TBuf16<KBufferLength> newBuffer;
- newBuffer.Copy(iBuffer.Left(11));
- newBuffer.Append(_L(" "));
- newBuffer.Append(iBuffer.Mid(11+spacePos));
- //DP1("newBuffer: %S", &newBuffer);
- iBuffer.Copy(newBuffer);
+ if (spacePos != KErrNotFound) {
+ //DP1("Month: %S", &midPtr.Left(spacePos));
+
+ TBuf16<KBufferLength> newBuffer;
+ newBuffer.Copy(iBuffer.Left(11));
+ newBuffer.Append(_L(" "));
+ newBuffer.Append(iBuffer.Mid(11+spacePos));
+ //DP1("newBuffer: %S", &newBuffer);
+ iBuffer.Copy(newBuffer);
+ }
}
- }
-
- // hack for feeds that write days and months as UPPERCASE
- TChar one(iBuffer[1]);
- TChar two(iBuffer[2]);
- TChar nine(iBuffer[9]);
- TChar ten(iBuffer[10]);
+
+ // hack for feeds that write days and months as UPPERCASE
+ TChar one(iBuffer[1]);
+ TChar two(iBuffer[2]);
+ TChar nine(iBuffer[9]);
+ TChar ten(iBuffer[10]);
+
+ one.LowerCase();
+ two.LowerCase();
+ nine.LowerCase();
+ ten.LowerCase();
+
+ iBuffer[1] = one;
+ iBuffer[2] = two;
+ iBuffer[9] = nine;
+ iBuffer[10] = ten;
+ }
- one.LowerCase();
- two.LowerCase();
- nine.LowerCase();
- ten.LowerCase();
-
- iBuffer[1] = one;
- iBuffer[2] = two;
- iBuffer[9] = nine;
- iBuffer[10] = ten;
-
TBuf8<128> temp;
temp.Copy(iBuffer);
-
TInternetDate internetDate;
TRAPD(parseError, internetDate.SetDateL(temp));
if(parseError == KErrNone) {
--- a/engine/src/HttpClient.cpp Tue Oct 26 15:58:11 2010 +0100
+++ b/engine/src/HttpClient.cpp Fri Nov 12 20:48:14 2010 +0000
@@ -121,23 +121,17 @@
iWaitingForGet = EFalse;
if( aErrorCode == KErrNone)
{
- TRAP_IGNORE(iSession.OpenL());
- DP(" one");
+ //TRAP_IGNORE(iSession.OpenL());
RHTTPConnectionInfo connInfo = iSession.ConnectionInfo();
- DP(" one point five");
RStringPool pool = iSession.StringPool();
// Attach to socket server
- DP(" two");
connInfo.SetPropertyL(pool.StringF(HTTP::EHttpSocketServ, RHTTPSession::GetTable()), THTTPHdrVal(iPodcastModel.ConnectionEngine().SockServ().Handle()));
// Attach to connection
- DP(" three");
TInt connPtr = REINTERPRET_CAST(TInt, &iPodcastModel.ConnectionEngine().Connection());
connInfo.SetPropertyL(pool.StringF(HTTP::EHttpSocketConnection, RHTTPSession::GetTable()), THTTPHdrVal(connPtr));
- DP(" four");
iPodcastModel.SetProxyUsageIfNeededL(iSession);
DoGetAfterConnectL();
- //iWaitingForGet = EFalse; // set to true by DoGetAfterConnectL
}
else
{
@@ -205,6 +199,7 @@
TBool CHttpClient::GetL(const TDesC& aUrl, const TDesC& aFileName, TBool aSilent) {
DP("CHttpClient::Get START");
+ DP2("Getting '%S' to '%S'", &aUrl, &aFileName);
if (iIsActive)
{
@@ -271,7 +266,7 @@
}
void CHttpClient::ClientRequestCompleteL(TInt aErrorCode) {
- DP1("CHttpClient::ClientRequestCompleteL, aErrorCode=%d", aErrorCode);
+ DP1("CHttpClient::ClientRequestCompleteL BEGIN, aErrorCode=%d", aErrorCode);
iIsActive = EFalse;
iObserver.CompleteL(this, aErrorCode);
DP1(" iTransactionCount=%d", iTransactionCount);
@@ -287,4 +282,5 @@
iSession.Close();
}
}
+ DP("CHttpClient::ClientRequestCompleteL END");
}
--- a/engine/src/HttpEventHandler.cpp Tue Oct 26 15:58:11 2010 +0100
+++ b/engine/src/HttpEventHandler.cpp Fri Nov 12 20:48:14 2010 +0000
@@ -23,6 +23,7 @@
#include "HttpEventHandler.h"
#include "bautils.h"
#include "Httpclient.h"
+#include "Podcatcher.pan"
const TInt64 KMinDiskSpace = 1024 * 1024; // at least 1 MB must remain
@@ -61,7 +62,7 @@
void CHttpEventHandler::MHFRunL(RHTTPTransaction aTransaction, const THTTPEvent& aEvent)
{
- DP1("CHttpEventHandler::MHFRunL, aEvent.iStatus=%d", aEvent.iStatus);
+ //DP1("CHttpEventHandler::MHFRunL, aEvent.iStatus=%d", aEvent.iStatus);
switch (aEvent.iStatus)
{
case THTTPEvent::EGotResponseHeaders:
@@ -259,6 +260,7 @@
switch(fName[0])
{
case 'C':
+ case '\\':
iDriveNo = EDriveC;
break;
case 'E':
@@ -271,7 +273,7 @@
iDriveNo = EDriveG;
break;
default:
- iDriveNo = -1;
+ Panic(EPodcatcherDownloadDrive);
break;
}
DP1("iDriveNo set to %d", iDriveNo);
--- a/engine/src/PodcastModel.cpp Tue Oct 26 15:58:11 2010 +0100
+++ b/engine/src/PodcastModel.cpp Fri Nov 12 20:48:14 2010 +0000
@@ -16,9 +16,6 @@
*
*/
-// when enabled this macro copies the database to c:\data on launch for debug purposes
-//#define COPY_DB
-
#include <commdb.h>
#include "PodcastModel.h"
#include "FeedEngine.h"
@@ -318,7 +315,14 @@
dbTemplate.Copy(iSettingsEngine->PrivatePath());
dbTemplate.Append(KDBTemplateFileName);
+ DP1("Copy template DB from: %S", &dbTemplate);
+ DP1("Copy template DB to: %S", &dbFileName);
+
BaflUtils::CopyFile(iFsSession, dbTemplate,dbFileName);
+
+ // important to set this file to not be read only if copying from Z:
+ iFsSession.SetAtt(dbFileName, 0, KEntryAttReadOnly);
+
iIsFirstStartup = ETrue;
DP("CPodcastModel::ResetDB END");
}
--- a/engine/src/PodcastUtils.cpp Tue Oct 26 15:58:11 2010 +0100
+++ b/engine/src/PodcastUtils.cpp Fri Nov 12 20:48:14 2010 +0000
@@ -73,18 +73,16 @@
{
return;
}
-
- DP(" miscellaneous");
// miscellaneous cleanup
+ DP(" miscellaneous cleanup");
const TChar KLineBreak(CEditableText::ELineBreak);
_LIT(KNewLine, "\n");
_LIT(KNewLineWindows, "\r\n");
ReplaceString(str, KNewLine, KNullDesC);
ReplaceString(str, KNewLineWindows, KNullDesC);
- DP(" strip HTML");
// strip out HTML tags
-
+ DP(" strip out HTML tags");
TInt startPos = str.Locate('<');
TInt endPos = str.Locate('>');
HBufC* tmpBuf = HBufC::NewLC(KMaxDescriptionLength);
@@ -116,8 +114,8 @@
endPos = str.Locate('>');
}
+// change HTML encoded chars to unicode
DP(" change HTML encoded chars to unicode");
-// change HTML encoded chars to unicode
startPos = str.Locate('&');
endPos = str.Locate(';');
while (startPos != KErrNotFound && endPos != KErrNotFound && endPos > startPos)
@@ -207,20 +205,17 @@
CleanupStack::PopAndDestroy(tmpBuf);
- DP(" trim");
if(str.Length()>1)
{
- DP1("str.Length() ==%d", str.Length());
// chop away newlines at start
- while (str.Length() && (str[0] == KLineBreak)) {
- DP("mid");
+ DP(" chop away newlines at start");
+ while (str.Length() > 0 && (str[0] == KLineBreak)) {
str = str.Mid(1);
}
// chop away newlines at end
-
- while (str.Length() && (str[str.Length()-1] == KLineBreak)) {
- DP("left");
+ DP(" chop away newlines at end");
+ while (str.Length() > 0 && (str[str.Length()-1] == KLineBreak)) {
str = str.Left(str.Length()-1);
}
--- a/engine/src/ShowEngine.cpp Tue Oct 26 15:58:11 2010 +0100
+++ b/engine/src/ShowEngine.cpp Fri Nov 12 20:48:14 2010 +0000
@@ -207,7 +207,7 @@
else
{
// no extension found, we'll have to rely on magic numbers
- newFilename.Copy(fileName);
+ newFilename.Format(_L("%u"), info->Uid());
}
relPath.Append(newFilename);