232 } |
232 } |
233 } |
233 } |
234 |
234 |
235 void CPodcastQueueView::ShowDownloadFinishedL(TUint /*aShowUid*/, TInt aError) |
235 void CPodcastQueueView::ShowDownloadFinishedL(TUint /*aShowUid*/, TInt aError) |
236 { |
236 { |
237 iProgressAdded = EFalse; |
237 if (iListContainer->IsVisible()) |
238 |
238 { |
239 iPodcastModel.GetShowsDownloadingL(); |
239 |
240 UpdateListboxItemsL(); |
240 iProgressAdded = EFalse; |
241 UpdateToolbar(); |
241 |
242 |
242 iPodcastModel.GetShowsDownloadingL(); |
243 switch(aError) |
243 UpdateListboxItemsL(); |
244 { |
244 UpdateToolbar(); |
245 case KErrCouldNotConnect: |
245 |
246 { |
246 switch(aError) |
247 TBuf<KMaxMessageLength> message; |
247 { |
248 iEikonEnv->ReadResourceL(message, R_PODCAST_CONNECTION_ERROR); |
248 case KErrCouldNotConnect: |
249 ShowErrorMessageL(message); |
249 { |
250 } |
250 TBuf<KMaxMessageLength> message; |
251 break; |
251 iEikonEnv->ReadResourceL(message, R_PODCAST_CONNECTION_ERROR); |
252 default: // Do nothing |
252 ShowErrorMessageL(message); |
253 break; |
253 } |
|
254 break; |
|
255 default: // Do nothing |
|
256 break; |
|
257 } |
254 } |
258 } |
255 } |
259 } |
256 |
260 |
257 |
261 |
258 void CPodcastQueueView::FeedDownloadStartedL(TFeedState /*aState*/, TUint aFeedUid) |
262 void CPodcastQueueView::FeedDownloadStartedL(TFeedState /*aState*/, TUint aFeedUid) |
299 } |
303 } |
300 |
304 |
301 void CPodcastQueueView::GetShowIcons(CShowInfo* aShowInfo, TInt& aIconIndex) |
305 void CPodcastQueueView::GetShowIcons(CShowInfo* aShowInfo, TInt& aIconIndex) |
302 { |
306 { |
303 TBool dlStop = iPodcastModel.SettingsEngine().DownloadSuspended(); |
307 TBool dlStop = iPodcastModel.SettingsEngine().DownloadSuspended(); |
304 TUint showDownloadingUid = iPodcastModel.ShowEngine().ShowDownloading() ? iPodcastModel.ShowEngine().ShowDownloading()->Uid() : 0; |
308 |
305 |
309 switch (aShowInfo->DownloadState()) |
306 if (showDownloadingUid == aShowInfo->Uid()) |
310 { |
307 { |
311 case EDownloaded: |
308 aIconIndex = dlStop ? ESuspendedShowIcon : EDownloadingShowIcon; |
312 if (aShowInfo->PlayState() == ENeverPlayed) { |
309 } |
313 aIconIndex = EDownloadedNewShowIcon; |
310 else |
314 } else { |
311 { |
315 aIconIndex = EDownloadedShowIcon; |
312 switch (aShowInfo->DownloadState()) |
316 } |
313 { |
317 break; |
314 case EQueued: |
318 case ENotDownloaded: |
315 aIconIndex = dlStop ? ESuspendedShowIcon : EQuedShowIcon; |
319 if (aShowInfo->PlayState() == ENeverPlayed) { |
316 break; |
320 aIconIndex = ENewShowIcon; |
317 case EDownloading: |
321 } else { |
318 aIconIndex = dlStop ? ESuspendedShowIcon : EDownloadingShowIcon; |
322 aIconIndex = EShowIcon; |
319 break; |
323 } |
320 case EFailedDownload: |
324 break; |
321 aIconIndex = EFailedShowIcon; |
325 case EQueued: |
322 break; |
326 aIconIndex = dlStop ? ESuspendedShowIcon : EQuedShowIcon; |
323 default: |
327 break; |
324 DP("Wrong download state for queue view!"); |
328 case EDownloading: |
325 break; |
329 aIconIndex = dlStop ? ESuspendedShowIcon : EDownloadingShowIcon; |
326 } |
330 break; |
|
331 case EFailedDownload: |
|
332 aIconIndex = EFailedShowIcon; |
|
333 break; |
327 } |
334 } |
328 } |
335 } |
329 |
336 |
330 void CPodcastQueueView::UpdateFeedUpdateStateL() |
337 void CPodcastQueueView::UpdateFeedUpdateStateL() |
331 { |
338 { |