author | teknolog |
Thu, 27 May 2010 12:31:17 +0100 | |
changeset 137 | eefed4bda2e2 |
parent 134 | 46baf9a7cadd |
child 155 | 4ec84fbc7b27 |
permissions | -rw-r--r-- |
2 | 1 |
/* |
2 |
* Copyright (c) 2007-2010 Sebastian Brannstrom, Lars Persson, EmbedDev AB |
|
3 |
* |
|
4 |
* All rights reserved. |
|
5 |
* This component and the accompanying materials are made available |
|
6 |
* under the terms of the License "Eclipse Public License v1.0" |
|
7 |
* which accompanies this distribution, and is available |
|
8 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
9 |
* |
|
10 |
* Initial Contributors: |
|
11 |
* EmbedDev AB - initial contribution. |
|
12 |
* |
|
13 |
* Contributors: |
|
14 |
* |
|
15 |
* Description: |
|
16 |
* |
|
17 |
*/ |
|
18 |
||
19 |
#include "PodcastShowsView.h" |
|
20 |
#include "PodcastAppUi.h" |
|
21 |
#include "ShowEngine.h" |
|
22 |
#include "SettingsEngine.h" |
|
23 |
#include "PodcastApp.h" |
|
24 |
#include "imagehandler.h" |
|
25 |
#include "constants.h" |
|
26 |
||
27 |
#include <akntitle.h> |
|
28 |
#include <podcast.rsg> |
|
29 |
#include <podcast.mbg> |
|
30 |
#include <gulicon.h> |
|
31 |
#include <barsread.h> |
|
32 |
#include <aknnotedialog.h> |
|
33 |
#include <aknmessagequerydialog.h> |
|
34 |
||
35 |
#define KMaxMessageLength 200 |
|
36 |
||
37 |
_LIT(KSizeDownloadingOf, "%.1f/%.1f MB"); |
|
38 |
_LIT(KShowsSizeFormatS60, "%.1f MB"); |
|
39 |
||
5 | 40 |
_LIT(KShowFormat, "%d\t%S\t%S%S\t"); |
126 | 41 |
//_LIT(KShowErrorFormat, "%d\t%S\t%S\t"); |
42 |
//_LIT(KShowQueueFormat, "%d\t%S\t%S%S\t"); |
|
2 | 43 |
|
44 |
// these must correspond with TShowsIconIndex |
|
45 |
||
46 |
const TUint KShowIconArrayIds[] = |
|
47 |
{ |
|
48 |
EMbmPodcastAudio, |
|
49 |
EMbmPodcastAudio_mask, |
|
50 |
EMbmPodcastAudio_new, |
|
51 |
EMbmPodcastAudio_new_mask, |
|
52 |
EMbmPodcastAudio_queued, |
|
53 |
EMbmPodcastAudio_queued_mask, |
|
54 |
EMbmPodcastAudio_downloading, |
|
55 |
EMbmPodcastAudio_downloading_mask, |
|
56 |
EMbmPodcastAudio_downloaded, |
|
57 |
EMbmPodcastAudio_downloaded_mask, |
|
58 |
EMbmPodcastAudio_downloaded_new, |
|
59 |
EMbmPodcastAudio_downloaded_new_mask, |
|
60 |
EMbmPodcastAudio_failed, |
|
61 |
EMbmPodcastAudio_failed_mask, |
|
62 |
EMbmPodcastAudio_suspended, |
|
63 |
EMbmPodcastAudio_suspended_mask, |
|
120
31d05afa1a52
Added video podcast icons, but they don't work correctly yet.
teknolog
parents:
117
diff
changeset
|
64 |
EMbmPodcastVideo, |
31d05afa1a52
Added video podcast icons, but they don't work correctly yet.
teknolog
parents:
117
diff
changeset
|
65 |
EMbmPodcastVideo_mask, |
31d05afa1a52
Added video podcast icons, but they don't work correctly yet.
teknolog
parents:
117
diff
changeset
|
66 |
EMbmPodcastVideo_new, |
31d05afa1a52
Added video podcast icons, but they don't work correctly yet.
teknolog
parents:
117
diff
changeset
|
67 |
EMbmPodcastVideo_new_mask, |
31d05afa1a52
Added video podcast icons, but they don't work correctly yet.
teknolog
parents:
117
diff
changeset
|
68 |
EMbmPodcastVideo_queued, |
31d05afa1a52
Added video podcast icons, but they don't work correctly yet.
teknolog
parents:
117
diff
changeset
|
69 |
EMbmPodcastVideo_queued_mask, |
31d05afa1a52
Added video podcast icons, but they don't work correctly yet.
teknolog
parents:
117
diff
changeset
|
70 |
EMbmPodcastVideo_downloading, |
31d05afa1a52
Added video podcast icons, but they don't work correctly yet.
teknolog
parents:
117
diff
changeset
|
71 |
EMbmPodcastVideo_downloading_mask, |
31d05afa1a52
Added video podcast icons, but they don't work correctly yet.
teknolog
parents:
117
diff
changeset
|
72 |
EMbmPodcastVideo_downloaded, |
31d05afa1a52
Added video podcast icons, but they don't work correctly yet.
teknolog
parents:
117
diff
changeset
|
73 |
EMbmPodcastVideo_downloaded_mask, |
31d05afa1a52
Added video podcast icons, but they don't work correctly yet.
teknolog
parents:
117
diff
changeset
|
74 |
EMbmPodcastVideo_downloaded_new, |
31d05afa1a52
Added video podcast icons, but they don't work correctly yet.
teknolog
parents:
117
diff
changeset
|
75 |
EMbmPodcastVideo_downloaded_new_mask, |
31d05afa1a52
Added video podcast icons, but they don't work correctly yet.
teknolog
parents:
117
diff
changeset
|
76 |
EMbmPodcastVideo_failed, |
31d05afa1a52
Added video podcast icons, but they don't work correctly yet.
teknolog
parents:
117
diff
changeset
|
77 |
EMbmPodcastVideo_failed_mask, |
31d05afa1a52
Added video podcast icons, but they don't work correctly yet.
teknolog
parents:
117
diff
changeset
|
78 |
EMbmPodcastVideo_suspended, |
31d05afa1a52
Added video podcast icons, but they don't work correctly yet.
teknolog
parents:
117
diff
changeset
|
79 |
EMbmPodcastVideo_suspended_mask, |
31d05afa1a52
Added video podcast icons, but they don't work correctly yet.
teknolog
parents:
117
diff
changeset
|
80 |
EMbmPodcastFeed, |
31d05afa1a52
Added video podcast icons, but they don't work correctly yet.
teknolog
parents:
117
diff
changeset
|
81 |
EMbmPodcastFeed_mask, |
2 | 82 |
0, |
83 |
0 |
|
84 |
}; |
|
85 |
||
120
31d05afa1a52
Added video podcast icons, but they don't work correctly yet.
teknolog
parents:
117
diff
changeset
|
86 |
const TInt KVideoIconOffset = 8; |
31d05afa1a52
Added video podcast icons, but they don't work correctly yet.
teknolog
parents:
117
diff
changeset
|
87 |
|
2 | 88 |
CPodcastShowsView* CPodcastShowsView::NewL(CPodcastModel& aPodcastModel) |
89 |
{ |
|
90 |
CPodcastShowsView* self = CPodcastShowsView::NewLC(aPodcastModel); |
|
91 |
CleanupStack::Pop(self); |
|
92 |
return self; |
|
93 |
} |
|
94 |
||
95 |
CPodcastShowsView* CPodcastShowsView::NewLC(CPodcastModel& aPodcastModel) |
|
96 |
{ |
|
97 |
CPodcastShowsView* self = new ( ELeave ) CPodcastShowsView(aPodcastModel); |
|
98 |
CleanupStack::PushL(self); |
|
99 |
self->ConstructL(); |
|
100 |
return self; |
|
101 |
} |
|
102 |
||
103 |
CPodcastShowsView::CPodcastShowsView(CPodcastModel& aPodcastModel) : |
|
104 |
iPodcastModel(aPodcastModel) |
|
105 |
{ |
|
106 |
} |
|
107 |
||
108 |
void CPodcastShowsView::ConstructL() |
|
109 |
{ |
|
110 |
BaseConstructL(R_PODCAST_SHOWSVIEW); |
|
111 |
CPodcastListView::ConstructL(); |
|
112 |
||
113 |
CreateIconsL(); |
|
114 |
||
115 |
iListContainer->Listbox()->SetListBoxObserver(this); |
|
116 |
||
117 |
iPodcastModel.FeedEngine().AddObserver(this); |
|
118 |
iPodcastModel.ShowEngine().AddObserver(this); |
|
119 |
||
120 |
iStylusPopupMenu = CAknStylusPopUpMenu::NewL( this , TPoint(0,0)); |
|
121 |
TResourceReader reader; |
|
122 |
iCoeEnv->CreateResourceReaderLC(reader,R_SHOWVIEW_POPUP_MENU); |
|
123 |
iStylusPopupMenu->ConstructFromResourceL(reader); |
|
124 |
||
125 |
CleanupStack::PopAndDestroy(); |
|
126 |
} |
|
127 |
||
128 |
void CPodcastShowsView::CreateIconsL() |
|
129 |
{ |
|
130 |
CArrayPtr< CGulIcon>* icons = new(ELeave) CArrayPtrFlat< CGulIcon>(1); |
|
131 |
CleanupStack::PushL(icons); |
|
132 |
TInt pos = 0; |
|
133 |
while (KShowIconArrayIds[pos] > 0) |
|
134 |
{ |
|
120
31d05afa1a52
Added video podcast icons, but they don't work correctly yet.
teknolog
parents:
117
diff
changeset
|
135 |
// Load the icon |
31d05afa1a52
Added video podcast icons, but they don't work correctly yet.
teknolog
parents:
117
diff
changeset
|
136 |
CFbsBitmap* bitmap= NULL; |
31d05afa1a52
Added video podcast icons, but they don't work correctly yet.
teknolog
parents:
117
diff
changeset
|
137 |
CFbsBitmap* mask= NULL; |
2 | 138 |
AknIconUtils::CreateIconL(bitmap, |
139 |
mask, |
|
140 |
iEikonEnv->EikAppUi()->Application()->BitmapStoreName(), |
|
141 |
KShowIconArrayIds[pos], |
|
142 |
KShowIconArrayIds[pos+1]); |
|
143 |
CleanupStack::PushL(bitmap); |
|
144 |
CleanupStack::PushL(mask); |
|
145 |
||
120
31d05afa1a52
Added video podcast icons, but they don't work correctly yet.
teknolog
parents:
117
diff
changeset
|
146 |
// Append the icon to icon array |
2 | 147 |
icons->AppendL(CGulIcon::NewL(bitmap, mask) ); |
148 |
CleanupStack::Pop(2); // bitmap, mask |
|
149 |
pos+=2; |
|
150 |
} |
|
151 |
||
152 |
iListContainer->Listbox()->ItemDrawer()->FormattedCellData()->SetIconArrayL(icons); |
|
153 |
CleanupStack::Pop(icons); // icons |
|
154 |
} |
|
155 |
||
156 |
TKeyResponse CPodcastShowsView::OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType) |
|
157 |
{ |
|
158 |
if (aType == EEventKey) |
|
159 |
{ |
|
160 |
CShowInfo *activeShow = NULL; |
|
161 |
||
162 |
TInt index = iListContainer->Listbox()->CurrentItemIndex(); |
|
163 |
if(index >= 0 && index < iPodcastModel.ActiveShowList().Count()) |
|
164 |
{ |
|
165 |
activeShow = iPodcastModel.ActiveShowList()[index]; |
|
166 |
} |
|
167 |
||
168 |
if (activeShow != NULL) { |
|
169 |
DP1("aKeyEvent.iCode=%d", aKeyEvent.iCode); |
|
170 |
switch (aKeyEvent.iCode) { |
|
171 |
case 117: |
|
172 |
case '*': |
|
173 |
case EKeySpace: |
|
174 |
if (activeShow->PlayState() == EPlayed) { |
|
175 |
HandleCommandL(EPodcastMarkAsUnplayed); |
|
176 |
} else { |
|
177 |
HandleCommandL(EPodcastMarkAsPlayed); |
|
178 |
} |
|
179 |
break; |
|
180 |
case 106: |
|
181 |
case '#': |
|
182 |
if (activeShow->DownloadState() == ENotDownloaded) { |
|
183 |
HandleCommandL(EPodcastDownloadShow); |
|
184 |
} |
|
185 |
break; |
|
186 |
case EKeyBackspace: |
|
187 |
case EKeyDelete: |
|
188 |
HandleCommandL(EPodcastDeleteShow); |
|
189 |
break; |
|
190 |
default: |
|
191 |
break; |
|
192 |
} |
|
193 |
UpdateToolbar(); |
|
194 |
} |
|
195 |
} |
|
196 |
return CPodcastListView::OfferKeyEventL(aKeyEvent, aType); |
|
197 |
} |
|
198 |
||
199 |
CPodcastShowsView::~CPodcastShowsView() |
|
200 |
{ |
|
201 |
iPodcastModel.ShowEngine().RemoveObserver(this); |
|
202 |
iPodcastModel.FeedEngine().RemoveObserver(this); |
|
203 |
||
204 |
if(iStylusPopupMenu) |
|
205 |
delete iStylusPopupMenu, iStylusPopupMenu = NULL; |
|
206 |
} |
|
207 |
||
208 |
||
209 |
TUid CPodcastShowsView::Id() const |
|
210 |
{ |
|
211 |
return KUidPodcastShowsViewID; |
|
212 |
} |
|
213 |
||
214 |
void CPodcastShowsView::DoActivateL(const TVwsViewId& aPrevViewId, |
|
215 |
TUid aCustomMessageId, const TDesC8& aCustomMessage) |
|
216 |
{ |
|
217 |
DP("CPodcastShowsView::DoActivateL BEGIN"); |
|
49
43e204e6ae2e
Fix for accidental merge regressions. Text fixes for tool tip and settings.
teknolog
parents:
38
diff
changeset
|
218 |
CPodcastListView::DoActivateL(aPrevViewId, aCustomMessageId, aCustomMessage); |
43e204e6ae2e
Fix for accidental merge regressions. Text fixes for tool tip and settings.
teknolog
parents:
38
diff
changeset
|
219 |
|
43e204e6ae2e
Fix for accidental merge regressions. Text fixes for tool tip and settings.
teknolog
parents:
38
diff
changeset
|
220 |
iPreviousView = TVwsViewId(KUidPodcast, KUidPodcastFeedViewID); |
2 | 221 |
|
222 |
UpdateViewTitleL(); |
|
223 |
UpdateFeedUpdateStateL(); |
|
224 |
UpdateToolbar(); |
|
225 |
DP("CPodcastShowsView::DoActivateL END"); |
|
226 |
} |
|
227 |
||
228 |
void CPodcastShowsView::DoDeactivate() |
|
229 |
{ |
|
230 |
CPodcastListView::DoDeactivate(); |
|
231 |
} |
|
232 |
||
233 |
// Engine callback when new shows are available |
|
234 |
void CPodcastShowsView::ShowListUpdatedL() |
|
235 |
{ |
|
236 |
UpdateListboxItemsL(); |
|
237 |
} |
|
238 |
||
239 |
void CPodcastShowsView::ShowDownloadUpdatedL(TInt aBytesOfCurrentDownload, TInt /*aBytesTotal*/) |
|
240 |
{ |
|
241 |
if (!iListContainer->IsVisible()) |
|
242 |
{ |
|
243 |
return; |
|
244 |
} |
|
245 |
||
246 |
CShowInfo *info = iPodcastModel.ShowEngine().ShowDownloading(); |
|
247 |
if (info) |
|
248 |
{ |
|
249 |
UpdateShowItemL(info->Uid(), aBytesOfCurrentDownload); |
|
250 |
} |
|
251 |
} |
|
252 |
||
34 | 253 |
void CPodcastShowsView::ShowDownloadFinishedL(TUint aShowUid, TInt aError) |
2 | 254 |
{ |
255 |
iProgressAdded = EFalse; |
|
34 | 256 |
CShowInfo *info = NULL; |
257 |
RShowInfoArray &fItems = iPodcastModel.ActiveShowList(); |
|
258 |
||
259 |
for (TInt i=0;i<fItems.Count();i++) |
|
260 |
{ |
|
261 |
if (fItems[i]->Uid() == aShowUid) |
|
262 |
{ |
|
263 |
info = fItems[i]; |
|
264 |
} |
|
265 |
} |
|
266 |
||
267 |
if (info == NULL) { |
|
268 |
return; |
|
269 |
} |
|
2 | 270 |
|
271 |
switch(aError) |
|
272 |
{ |
|
273 |
case KErrCouldNotConnect: |
|
274 |
{ |
|
275 |
TBuf<KMaxMessageLength> message; |
|
276 |
iEikonEnv->ReadResourceL(message, R_PODCAST_CONNECTION_ERROR); |
|
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
28
diff
changeset
|
277 |
ShowErrorMessageL(message); |
2 | 278 |
} |
279 |
break; |
|
6 | 280 |
default: |
2 | 281 |
break; |
282 |
} |
|
6 | 283 |
UpdateListboxItemsL(); |
2 | 284 |
} |
285 |
||
286 |
||
287 |
void CPodcastShowsView::FeedDownloadStartedL(TFeedState /*aState*/, TUint aFeedUid) |
|
288 |
{ |
|
289 |
// TODO make use of the fact that we know that the feed download is |
|
290 |
// started instead of checking feed engine states in UpdateFeedUpdateStateL. |
|
291 |
if (iPodcastModel.ActiveFeedInfo() != NULL |
|
292 |
&& iPodcastModel.ActiveFeedInfo()->Uid() == aFeedUid) |
|
293 |
{ |
|
8 | 294 |
UpdateFeedUpdateStateL(); |
2 | 295 |
UpdateToolbar(); |
296 |
} |
|
297 |
} |
|
298 |
||
299 |
void CPodcastShowsView::FeedDownloadFinishedL(TFeedState /*aState*/, TUint aFeedUid, TInt /*aError*/) |
|
300 |
{ |
|
301 |
DP("CPodcastShowsView::FeedDownloadFinishedL BEGIN"); |
|
302 |
// TODO make use of the fact that we know that the feed download is |
|
303 |
// finished instead of checking feed engine states in UpdateFeedUpdateStateL. |
|
304 |
if (iPodcastModel.ActiveFeedInfo() != NULL |
|
305 |
&& iPodcastModel.ActiveFeedInfo()->Uid() == aFeedUid) |
|
306 |
{ |
|
8 | 307 |
UpdateFeedUpdateStateL(); |
308 |
UpdateViewTitleL(); |
|
2 | 309 |
} |
310 |
DP("CPodcastShowsView::FeedDownloadFinishedL END"); |
|
311 |
} |
|
312 |
||
313 |
void CPodcastShowsView::HandleListBoxEventL(CEikListBox* /*aListBox*/, |
|
314 |
TListBoxEvent aEventType) |
|
315 |
{ |
|
316 |
switch (aEventType) |
|
317 |
{ |
|
137
eefed4bda2e2
Minor fixes to comply with single tap technical solution description. By this I consider bug 2056 closed.
teknolog
parents:
134
diff
changeset
|
318 |
case EEventItemSingleClicked: |
2 | 319 |
case EEventEnterKeyPressed: |
320 |
case EEventItemActioned: |
|
321 |
case EEventItemDoubleClicked: |
|
322 |
{ |
|
323 |
RShowInfoArray &fItems = iPodcastModel.ActiveShowList(); |
|
324 |
TInt index = iListContainer->Listbox()->CurrentItemIndex(); |
|
325 |
if (index>=0 && index< fItems.Count()) |
|
326 |
{ |
|
327 |
DP2("Handle event for podcast %S, downloadState is %d", &(fItems[index]->Title()), fItems[index]->DownloadState()); |
|
328 |
CShowInfo *showInfo = fItems[index]; |
|
329 |
||
330 |
switch (showInfo->DownloadState()) { |
|
331 |
case ENotDownloaded: |
|
38
c11e52c5acd2
Fix for download state not taking user from shows view to queue view
teknolog
parents:
34
diff
changeset
|
332 |
case EFailedDownload: |
2 | 333 |
HandleCommandL(EPodcastDownloadShow); |
334 |
break; |
|
38
c11e52c5acd2
Fix for download state not taking user from shows view to queue view
teknolog
parents:
34
diff
changeset
|
335 |
case EDownloading: |
2 | 336 |
case EQueued: |
337 |
AppUi()->ActivateLocalViewL(KUidPodcastQueueViewID, TUid::Uid(0), KNullDesC8()); |
|
338 |
((CPodcastAppUi*)AppUi())->SetActiveTab(KTabIdQueue); |
|
339 |
break; |
|
340 |
case EDownloaded: |
|
134
46baf9a7cadd
Fix for KErrCorrupted bug in ShowEngine; Capabilities added to allow interaction with music player and MPXCollection
teknolog
parents:
133
diff
changeset
|
341 |
{ |
46baf9a7cadd
Fix for KErrCorrupted bug in ShowEngine; Capabilities added to allow interaction with music player and MPXCollection
teknolog
parents:
133
diff
changeset
|
342 |
TRAPD(err, iPodcastModel.PlayPausePodcastL(showInfo, ETrue)); |
46baf9a7cadd
Fix for KErrCorrupted bug in ShowEngine; Capabilities added to allow interaction with music player and MPXCollection
teknolog
parents:
133
diff
changeset
|
343 |
if (err != KErrNone) |
46baf9a7cadd
Fix for KErrCorrupted bug in ShowEngine; Capabilities added to allow interaction with music player and MPXCollection
teknolog
parents:
133
diff
changeset
|
344 |
{ |
46baf9a7cadd
Fix for KErrCorrupted bug in ShowEngine; Capabilities added to allow interaction with music player and MPXCollection
teknolog
parents:
133
diff
changeset
|
345 |
HBufC *error = iEikonEnv->AllocReadResourceLC(R_ERROR_PLAYBACK_FAILED); |
46baf9a7cadd
Fix for KErrCorrupted bug in ShowEngine; Capabilities added to allow interaction with music player and MPXCollection
teknolog
parents:
133
diff
changeset
|
346 |
ShowErrorMessageL(*error); |
46baf9a7cadd
Fix for KErrCorrupted bug in ShowEngine; Capabilities added to allow interaction with music player and MPXCollection
teknolog
parents:
133
diff
changeset
|
347 |
CleanupStack::PopAndDestroy(error); |
46baf9a7cadd
Fix for KErrCorrupted bug in ShowEngine; Capabilities added to allow interaction with music player and MPXCollection
teknolog
parents:
133
diff
changeset
|
348 |
} |
133
5f9e7e14eb11
Merged playback functionality from FCL Symbian1 branch
teknolog
parents:
126
diff
changeset
|
349 |
UpdateListboxItemsL(); |
134
46baf9a7cadd
Fix for KErrCorrupted bug in ShowEngine; Capabilities added to allow interaction with music player and MPXCollection
teknolog
parents:
133
diff
changeset
|
350 |
} |
2 | 351 |
break; |
352 |
default: |
|
353 |
break; |
|
354 |
} |
|
355 |
} |
|
356 |
} |
|
357 |
break; |
|
358 |
default: |
|
359 |
break; |
|
360 |
} |
|
361 |
UpdateToolbar(); |
|
362 |
} |
|
363 |
||
364 |
void CPodcastShowsView::GetShowIcons(CShowInfo* aShowInfo, TInt& aIconIndex) |
|
365 |
{ |
|
366 |
TBool dlStop = iPodcastModel.SettingsEngine().DownloadSuspended(); |
|
34 | 367 |
|
368 |
switch (aShowInfo->DownloadState()) |
|
2 | 369 |
{ |
34 | 370 |
case EDownloaded: |
371 |
if (aShowInfo->PlayState() == ENeverPlayed) { |
|
372 |
aIconIndex = EDownloadedNewShowIcon; |
|
373 |
} else { |
|
374 |
aIconIndex = EDownloadedShowIcon; |
|
2 | 375 |
} |
34 | 376 |
break; |
377 |
case ENotDownloaded: |
|
378 |
if (aShowInfo->PlayState() == ENeverPlayed) { |
|
379 |
aIconIndex = ENewShowIcon; |
|
380 |
} else { |
|
381 |
aIconIndex = EShowIcon; |
|
382 |
} |
|
383 |
break; |
|
384 |
case EQueued: |
|
385 |
aIconIndex = dlStop ? ESuspendedShowIcon : EQuedShowIcon; |
|
386 |
break; |
|
387 |
case EDownloading: |
|
388 |
aIconIndex = dlStop ? ESuspendedShowIcon : EDownloadingShowIcon; |
|
389 |
break; |
|
390 |
case EFailedDownload: |
|
391 |
aIconIndex = EFailedShowIcon; |
|
392 |
break; |
|
2 | 393 |
} |
120
31d05afa1a52
Added video podcast icons, but they don't work correctly yet.
teknolog
parents:
117
diff
changeset
|
394 |
|
31d05afa1a52
Added video podcast icons, but they don't work correctly yet.
teknolog
parents:
117
diff
changeset
|
395 |
if (aShowInfo->ShowType() == EVideoPodcast) |
31d05afa1a52
Added video podcast icons, but they don't work correctly yet.
teknolog
parents:
117
diff
changeset
|
396 |
{ |
31d05afa1a52
Added video podcast icons, but they don't work correctly yet.
teknolog
parents:
117
diff
changeset
|
397 |
aIconIndex += KVideoIconOffset; |
31d05afa1a52
Added video podcast icons, but they don't work correctly yet.
teknolog
parents:
117
diff
changeset
|
398 |
} |
2 | 399 |
} |
400 |
||
401 |
||
402 |
void CPodcastShowsView::UpdateFeedUpdateStateL() |
|
403 |
{ |
|
404 |
TBool listboxDimmed = EFalse; |
|
405 |
||
406 |
if (iPodcastModel.FeedEngine().ClientState() != EIdle && iPodcastModel.ActiveFeedInfo() |
|
407 |
!= NULL && iPodcastModel.FeedEngine().ActiveClientUid() == iPodcastModel.ActiveFeedInfo()->Uid()) |
|
408 |
{ |
|
409 |
listboxDimmed = ETrue; |
|
410 |
} |
|
411 |
||
412 |
if ((iListContainer->Listbox()->IsDimmed() && !listboxDimmed) || (!iListContainer->Listbox()->IsDimmed() && listboxDimmed)) |
|
413 |
{ |
|
414 |
iListContainer->Listbox()->SetDimmed(listboxDimmed); |
|
415 |
} |
|
416 |
UpdateListboxItemsL(); |
|
417 |
UpdateToolbar(); |
|
418 |
} |
|
419 |
||
420 |
void CPodcastShowsView::FormatShowInfoListBoxItemL(CShowInfo& aShowInfo, TInt aSizeDownloaded) |
|
421 |
{ |
|
422 |
TBuf<32> infoSize; |
|
423 |
TInt iconIndex = 0; |
|
424 |
TBuf<KMaxShortDateFormatSpec*2> showDate; |
|
425 |
GetShowIcons(&aShowInfo, iconIndex); |
|
426 |
||
427 |
if(aSizeDownloaded > 0) |
|
428 |
{ |
|
429 |
if (aShowInfo.ShowSize() > 0) |
|
430 |
{ |
|
431 |
infoSize.Format(KSizeDownloadingOf(), ((float) aSizeDownloaded / (float) KSizeMb), |
|
432 |
((float)aShowInfo.ShowSize() / (float)KSizeMb)); |
|
433 |
} |
|
434 |
else |
|
435 |
{ |
|
436 |
infoSize.Format(KShowsSizeFormatS60(), (float)aSizeDownloaded / (float)KSizeMb); |
|
437 |
} |
|
438 |
} |
|
439 |
else if (aShowInfo.ShowSize() > 0) |
|
440 |
{ |
|
441 |
infoSize.Format(KShowsSizeFormatS60(), (float)aShowInfo.ShowSize() / (float)KSizeMb); |
|
442 |
} |
|
443 |
else { |
|
444 |
infoSize = KNullDesC(); |
|
445 |
} |
|
446 |
||
447 |
if (aShowInfo.PubDate().Int64() == 0) |
|
448 |
{ |
|
449 |
showDate = KNullDesC(); |
|
450 |
} |
|
451 |
else |
|
452 |
{ |
|
453 |
aShowInfo.PubDate().FormatL(showDate, KDateFormatShort()); |
|
454 |
} |
|
455 |
||
456 |
if(aShowInfo.LastError() != KErrNone) |
|
457 |
{ |
|
6 | 458 |
GetShowErrorText(infoSize, aShowInfo.LastError()); |
112 | 459 |
showDate.Zero(); |
2 | 460 |
} |
6 | 461 |
|
112 | 462 |
if (infoSize.Length() > 0 && showDate.Length() > 0) |
2 | 463 |
{ |
6 | 464 |
infoSize.Insert(0,_L(", ")); |
2 | 465 |
} |
466 |
||
6 | 467 |
iListboxFormatbuffer.Format(KShowFormat(), iconIndex, &aShowInfo.Title(), &showDate, &infoSize); |
2 | 468 |
} |
469 |
||
470 |
void CPodcastShowsView::GetShowErrorText(TDes &aErrorMessage, TInt aErrorCode) |
|
471 |
{ |
|
117
3b59b88b089e
Fixed Code Scanner L-issues; Further improvements to HTTP robustness
teknolog
parents:
115
diff
changeset
|
472 |
TRAP_IGNORE(((CPodcastAppUi*)AppUi())->GetErrorTextL(aErrorMessage,aErrorCode)); |
2 | 473 |
} |
474 |
||
475 |
void CPodcastShowsView::UpdateShowItemDataL(CShowInfo* aShowInfo,TInt aIndex, TInt aSizeDownloaded) |
|
476 |
{ |
|
477 |
FormatShowInfoListBoxItemL(*aShowInfo, aSizeDownloaded); |
|
478 |
iItemArray->Delete(aIndex); |
|
479 |
if(aIndex>= iItemArray->MdcaCount()) |
|
480 |
{ |
|
481 |
iItemArray->AppendL(iListboxFormatbuffer); |
|
482 |
} |
|
483 |
else |
|
484 |
{ |
|
485 |
iItemArray->InsertL(aIndex, iListboxFormatbuffer); |
|
486 |
} |
|
487 |
} |
|
488 |
||
489 |
void CPodcastShowsView::UpdateShowItemL(TUint aUid, TInt aSizeDownloaded) |
|
490 |
{ |
|
491 |
RShowInfoArray& array = iPodcastModel.ActiveShowList(); |
|
492 |
||
493 |
for (int i=0;i<array.Count();i++) { |
|
494 |
if (array[i]->Uid() == aUid) { |
|
495 |
UpdateShowItemDataL(array[i], i, aSizeDownloaded); |
|
496 |
if (iListContainer->Listbox()->TopItemIndex() <= i && |
|
497 |
iListContainer->Listbox()->BottomItemIndex() >= i) { |
|
498 |
iListContainer->Listbox()->DrawItem(i); |
|
499 |
} |
|
500 |
} |
|
501 |
} |
|
502 |
} |
|
503 |
||
504 |
void CPodcastShowsView::UpdateListboxItemsL() |
|
505 |
{ |
|
506 |
if (iListContainer->IsVisible()) |
|
507 |
{ |
|
508 |
TListItemProperties itemProps; |
|
509 |
TInt len = 0; |
|
510 |
||
8 | 511 |
iPodcastModel.GetShowsByFeedL(iPodcastModel.ActiveFeedInfo()->Uid()); |
2 | 512 |
|
513 |
RShowInfoArray &fItems = iPodcastModel.ActiveShowList(); |
|
514 |
len = fItems.Count(); |
|
515 |
||
516 |
if (iListContainer->Listbox() != NULL) |
|
517 |
{ |
|
518 |
TBool allUidsMatch = EFalse; |
|
519 |
||
520 |
if (len == iListContainer->Listbox()->Model()->NumberOfItems()) |
|
521 |
{ |
|
522 |
allUidsMatch = ETrue; |
|
523 |
TUint itemId = 0; |
|
524 |
for (TInt loop = 0; loop< len; loop++) |
|
525 |
{ |
|
526 |
itemId = iItemIdArray[loop]; |
|
527 |
if (fItems[loop]->Uid() != itemId) |
|
528 |
{ |
|
529 |
allUidsMatch = EFalse; |
|
530 |
break; |
|
531 |
} |
|
532 |
} |
|
533 |
} |
|
534 |
||
535 |
if (allUidsMatch && len > 0) |
|
536 |
{ |
|
537 |
for (TInt loop = 0; loop< len; loop++) |
|
34 | 538 |
{ |
6 | 539 |
UpdateShowItemDataL(fItems[loop], loop); |
2 | 540 |
} |
31
8a5ead064c4f
Shows view now updates correctl after Mark all played
teknolog
parents:
28
diff
changeset
|
541 |
iListContainer->Listbox()->DrawNow(); |
2 | 542 |
} |
543 |
else |
|
544 |
{ |
|
545 |
iListContainer->Listbox()->ItemDrawer()->ClearAllPropertiesL(); |
|
546 |
iListContainer->Listbox()->Reset(); |
|
547 |
iItemIdArray.Reset(); |
|
548 |
iItemArray->Reset(); |
|
549 |
||
550 |
if (len > 0) |
|
551 |
{ |
|
552 |
for (TInt i=0; i<len; i++) |
|
553 |
{ |
|
554 |
CShowInfo *si = fItems[i]; |
|
555 |
FormatShowInfoListBoxItemL(*si); |
|
556 |
iItemIdArray.Append(si->Uid()); |
|
557 |
iItemArray->AppendL(iListboxFormatbuffer); |
|
558 |
} |
|
559 |
} |
|
560 |
else |
|
561 |
{ |
|
562 |
iItemArray->Reset(); |
|
563 |
iItemIdArray.Reset(); |
|
564 |
||
565 |
itemProps.SetDimmed(ETrue); |
|
566 |
itemProps.SetHiddenSelection(ETrue); |
|
567 |
} |
|
568 |
iListContainer->Listbox()->HandleItemAdditionL(); |
|
569 |
} |
|
570 |
} |
|
571 |
} |
|
572 |
} |
|
573 |
||
574 |
/** |
|
575 |
* Command handling function intended for overriding by sub classes. |
|
576 |
* Default implementation is empty. |
|
577 |
* @param aCommand ID of the command to respond to. |
|
578 |
*/ |
|
579 |
void CPodcastShowsView::HandleCommandL(TInt aCommand) |
|
580 |
{ |
|
581 |
switch (aCommand) |
|
582 |
{ |
|
583 |
case EPodcastMarkAsPlayed: |
|
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
28
diff
changeset
|
584 |
HandleSetShowPlayedL(ETrue); |
2 | 585 |
break; |
586 |
case EPodcastMarkAsUnplayed: |
|
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
28
diff
changeset
|
587 |
HandleSetShowPlayedL(EFalse); |
2 | 588 |
break; |
589 |
case EPodcastMarkAllPlayed: |
|
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
28
diff
changeset
|
590 |
iPodcastModel.MarkSelectionPlayedL(); |
2 | 591 |
UpdateListboxItemsL(); |
592 |
break; |
|
593 |
case EPodcastDeleteShow: |
|
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
28
diff
changeset
|
594 |
HandleDeleteShowL(); |
2 | 595 |
break; |
596 |
case EPodcastDownloadShow: |
|
597 |
{ |
|
598 |
TInt index = iListContainer->Listbox()->CurrentItemIndex(); |
|
33
64ed1227e68d
Fix for problem when new download can not be started after one is completed
teknolog
parents:
32
diff
changeset
|
599 |
|
2 | 600 |
if (index >= 0 && index < iPodcastModel.ActiveShowList().Count()) |
601 |
{ |
|
602 |
iPodcastModel.ShowEngine().AddDownloadL(*iPodcastModel.ActiveShowList()[index]); |
|
603 |
UpdateShowItemL(iPodcastModel.ActiveShowList()[index]->Uid(),-1); |
|
604 |
} |
|
605 |
} |
|
606 |
break; |
|
607 |
case EPodcastUpdateFeed: |
|
608 |
{ |
|
609 |
||
610 |
if (iPodcastModel.ActiveFeedInfo()->Url().Length()>0) |
|
611 |
{ |
|
612 |
TRAPD(error, iPodcastModel.FeedEngine().UpdateFeedL(iPodcastModel.ActiveFeedInfo()->Uid())); |
|
613 |
||
614 |
if (error != KErrNone) |
|
615 |
{ |
|
5 | 616 |
HBufC* str = |
2 | 617 |
iEikonEnv->AllocReadResourceLC(R_PODCAST_FEEDS_UPDATE_ERROR); |
618 |
User::InfoPrint(*str); |
|
619 |
CleanupStack::PopAndDestroy(str); |
|
620 |
} |
|
621 |
} |
|
622 |
} |
|
623 |
break; |
|
624 |
case EPodcastCancelUpdateAllFeeds: |
|
625 |
iPodcastModel.FeedEngine().CancelUpdateAllFeeds(); |
|
626 |
break; |
|
627 |
case EPodcastShowInfo: |
|
628 |
{ |
|
629 |
DisplayShowInfoDialogL(); |
|
630 |
}break; |
|
631 |
default: |
|
632 |
CPodcastListView::HandleCommandL(aCommand); |
|
633 |
break; |
|
634 |
} |
|
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
28
diff
changeset
|
635 |
iListContainer->SetLongTapDetectedL(EFalse); |
28 | 636 |
|
2 | 637 |
UpdateToolbar(); |
638 |
} |
|
639 |
||
640 |
void CPodcastShowsView::DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane) |
|
641 |
{ |
|
642 |
if(aResourceId == R_PODCAST_SHOWSVIEW_MENU) |
|
643 |
{ |
|
644 |
TBool updatingState = iPodcastModel.FeedEngine().ClientState() != EIdle && iPodcastModel.FeedEngine().ActiveClientUid() == iPodcastModel.ActiveFeedInfo()->Uid(); |
|
645 |
aMenuPane->SetItemDimmed(EPodcastMarkAllPlayed, updatingState); |
|
646 |
} |
|
647 |
} |
|
648 |
||
649 |
void CPodcastShowsView::DisplayShowInfoDialogL() |
|
650 |
{ |
|
651 |
TInt index = iListContainer->Listbox()->CurrentItemIndex(); |
|
652 |
if (index >= 0 && index < iPodcastModel.ActiveShowList().Count()) |
|
653 |
{ |
|
654 |
CShowInfo* info = iPodcastModel.ActiveShowList()[index]; |
|
24
ca50ea154990
Moved search result title to navipane. Fixed but 1832
teknolog
parents:
23
diff
changeset
|
655 |
|
ca50ea154990
Moved search result title to navipane. Fixed but 1832
teknolog
parents:
23
diff
changeset
|
656 |
HBufC *title = info->Title().AllocL(); |
ca50ea154990
Moved search result title to navipane. Fixed but 1832
teknolog
parents:
23
diff
changeset
|
657 |
HBufC *description = info->Description().AllocL(); |
2 | 658 |
|
24
ca50ea154990
Moved search result title to navipane. Fixed but 1832
teknolog
parents:
23
diff
changeset
|
659 |
CAknMessageQueryDialog* note = new ( ELeave ) CAknMessageQueryDialog( description, title ); |
2 | 660 |
|
661 |
note->PrepareLC( R_SHOW_INFO_NOTE ); // Adds to CleanupStack |
|
24
ca50ea154990
Moved search result title to navipane. Fixed but 1832
teknolog
parents:
23
diff
changeset
|
662 |
note->RunLD(); |
2 | 663 |
} |
664 |
} |
|
665 |
||
13 | 666 |
void CPodcastShowsView::UpdateToolbar(TBool aVisible) |
2 | 667 |
{ |
668 |
CAknToolbar* toolbar = Toolbar(); |
|
13 | 669 |
|
23
cf4b850bbffb
Added macro SYMBIAN1_UI that toggles between single and double tap UI
teknolog
parents:
16
diff
changeset
|
670 |
if (toolbar) { |
cf4b850bbffb
Added macro SYMBIAN1_UI that toggles between single and double tap UI
teknolog
parents:
16
diff
changeset
|
671 |
if (iListContainer->IsVisible()) { |
cf4b850bbffb
Added macro SYMBIAN1_UI that toggles between single and double tap UI
teknolog
parents:
16
diff
changeset
|
672 |
toolbar->SetToolbarVisibility(aVisible); |
cf4b850bbffb
Added macro SYMBIAN1_UI that toggles between single and double tap UI
teknolog
parents:
16
diff
changeset
|
673 |
} |
2 | 674 |
|
23
cf4b850bbffb
Added macro SYMBIAN1_UI that toggles between single and double tap UI
teknolog
parents:
16
diff
changeset
|
675 |
TBool updatingState = iPodcastModel.FeedEngine().ClientState() != EIdle && |
cf4b850bbffb
Added macro SYMBIAN1_UI that toggles between single and double tap UI
teknolog
parents:
16
diff
changeset
|
676 |
iPodcastModel.FeedEngine().ActiveClientUid() == iPodcastModel.ActiveFeedInfo()->Uid(); |
14
4e75731546eb
Fix so toolbars only change visibility for the visible view
teknolog
parents:
13
diff
changeset
|
677 |
|
23
cf4b850bbffb
Added macro SYMBIAN1_UI that toggles between single and double tap UI
teknolog
parents:
16
diff
changeset
|
678 |
toolbar->HideItem(EPodcastUpdateFeed, updatingState, ETrue ); |
cf4b850bbffb
Added macro SYMBIAN1_UI that toggles between single and double tap UI
teknolog
parents:
16
diff
changeset
|
679 |
toolbar->HideItem(EPodcastCancelUpdateAllFeeds, !updatingState, ETrue ); |
54
21ffe6559297
Fix for middle toolbar button being drawn in single tap mode when there is only 1 button
teknolog
parents:
50
diff
changeset
|
680 |
// there seems to be drawing bugs in the toolbar if there is only |
21ffe6559297
Fix for middle toolbar button being drawn in single tap mode when there is only 1 button
teknolog
parents:
50
diff
changeset
|
681 |
// one or two buttons defined in the resource, so we have download |
21ffe6559297
Fix for middle toolbar button being drawn in single tap mode when there is only 1 button
teknolog
parents:
50
diff
changeset
|
682 |
// there but always hidden |
21ffe6559297
Fix for middle toolbar button being drawn in single tap mode when there is only 1 button
teknolog
parents:
50
diff
changeset
|
683 |
toolbar->HideItem(EPodcastDownloadShow, ETrue, ETrue ); |
2 | 684 |
} |
685 |
} |
|
686 |
||
687 |
void CPodcastShowsView::HandleLongTapEventL( const TPoint& aPenEventLocation, const TPoint& /* aPenEventScreenLocation */) |
|
688 |
{ |
|
689 |
DP("CPodcastShowsView::HandleLongTapEventL BEGIN"); |
|
28 | 690 |
|
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
28
diff
changeset
|
691 |
iListContainer->SetLongTapDetectedL(ETrue); |
28 | 692 |
|
4
be243543a361
Added primitive detection if long tap is on a listbox item or not. Could use a better version of this going forward.
teknolog
parents:
3
diff
changeset
|
693 |
const TInt KListboxDefaultHeight = 19; // for some reason it returns 19 for an empty listbox in S^1 |
be243543a361
Added primitive detection if long tap is on a listbox item or not. Could use a better version of this going forward.
teknolog
parents:
3
diff
changeset
|
694 |
TInt lbHeight = iListContainer->Listbox()->CalcHeightBasedOnNumOfItems( |
be243543a361
Added primitive detection if long tap is on a listbox item or not. Could use a better version of this going forward.
teknolog
parents:
3
diff
changeset
|
695 |
iListContainer->Listbox()->Model()->NumberOfItems()) - KListboxDefaultHeight; |
be243543a361
Added primitive detection if long tap is on a listbox item or not. Could use a better version of this going forward.
teknolog
parents:
3
diff
changeset
|
696 |
|
be243543a361
Added primitive detection if long tap is on a listbox item or not. Could use a better version of this going forward.
teknolog
parents:
3
diff
changeset
|
697 |
if(iStylusPopupMenu && aPenEventLocation.iY < lbHeight) |
2 | 698 |
{ |
699 |
TInt index = iListContainer->Listbox()->CurrentItemIndex(); |
|
700 |
if (index >= 0 && index < iPodcastModel.ActiveShowList().Count()) |
|
701 |
{ |
|
702 |
CShowInfo *info = iPodcastModel.ActiveShowList()[index]; |
|
703 |
TBool hideDownloadShowCmd = info->DownloadState() != ENotDownloaded; |
|
704 |
TBool hideDeleteShowCmd = info->DownloadState() != EDownloaded; |
|
705 |
TBool hideMarkOld = info->PlayState() == EPlayed; |
|
706 |
||
707 |
iStylusPopupMenu->SetItemDimmed(EPodcastMarkAsPlayed, hideMarkOld); |
|
708 |
iStylusPopupMenu->SetItemDimmed(EPodcastMarkAsUnplayed, !hideMarkOld); |
|
709 |
||
710 |
iStylusPopupMenu->SetItemDimmed(EPodcastDownloadShow, hideDownloadShowCmd); |
|
711 |
iStylusPopupMenu->SetItemDimmed(EPodcastDeleteShow, hideDeleteShowCmd); |
|
712 |
} |
|
713 |
||
714 |
iStylusPopupMenu->ShowMenu(); |
|
715 |
iStylusPopupMenu->SetPosition(aPenEventLocation); |
|
716 |
} |
|
717 |
DP("CPodcastShowsView::HandleLongTapEventL END"); |
|
718 |
} |
|
719 |
||
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
28
diff
changeset
|
720 |
void CPodcastShowsView::HandleSetShowPlayedL(TBool aPlayed) |
2 | 721 |
{ |
722 |
||
723 |
TInt index = iListContainer->Listbox()->CurrentItemIndex(); |
|
724 |
||
725 |
if (index >= 0 && index < iPodcastModel.ActiveShowList().Count()) |
|
726 |
{ |
|
727 |
CShowInfo *info = iPodcastModel.ActiveShowList()[index]; |
|
728 |
info->SetPlayState(aPlayed ? EPlayed : ENeverPlayed); |
|
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
28
diff
changeset
|
729 |
iPodcastModel.ShowEngine().UpdateShowL(*info); |
2 | 730 |
UpdateShowItemDataL(iPodcastModel.ActiveShowList()[index], index, 0); |
731 |
iListContainer->Listbox()->DrawItem(index); |
|
732 |
} |
|
733 |
} |
|
734 |
||
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
28
diff
changeset
|
735 |
void CPodcastShowsView::HandleDeleteShowL() |
2 | 736 |
{ |
737 |
TInt index = iListContainer->Listbox()->CurrentItemIndex(); |
|
738 |
||
739 |
if (index >= 0 && index < iPodcastModel.ActiveShowList().Count()) |
|
740 |
{ |
|
741 |
CShowInfo *info = iPodcastModel.ActiveShowList()[index]; |
|
742 |
TBuf<KMaxMessageLength> msg; |
|
743 |
TBuf<KMaxMessageLength> templ; |
|
744 |
iEikonEnv->ReadResourceL(templ, R_PODCAST_DELETE_SHOW_PROMPT); |
|
745 |
msg.Format(templ, &(info->Title())); |
|
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
28
diff
changeset
|
746 |
if (ShowQueryMessageL(msg)) |
2 | 747 |
{ |
748 |
iPodcastModel.ShowEngine().DeleteShowL(iPodcastModel.ActiveShowList()[index]->Uid()); |
|
749 |
||
750 |
// and mark as played, and not downloaded |
|
751 |
||
752 |
info->SetDownloadState(ENotDownloaded); |
|
753 |
info->SetPlayState(EPlayed); |
|
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
28
diff
changeset
|
754 |
iPodcastModel.ShowEngine().UpdateShowL(*info); |
2 | 755 |
|
756 |
UpdateShowItemDataL(iPodcastModel.ActiveShowList()[index], index, 0); |
|
757 |
iListContainer->Listbox()->DrawItem(index); |
|
758 |
} |
|
759 |
} |
|
760 |
} |
|
761 |
||
16 | 762 |
void CPodcastShowsView::DownloadQueueUpdatedL(TInt aDownloadingShows, TInt aQueuedShows) |
2 | 763 |
{ |
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
28
diff
changeset
|
764 |
((CPodcastAppUi*)AppUi())->UpdateQueueTabL(aDownloadingShows+aQueuedShows); |
34 | 765 |
UpdateListboxItemsL(); |
2 | 766 |
} |
767 |
||
768 |
void CPodcastShowsView::FeedUpdateAllCompleteL(TFeedState /*aState*/) |
|
769 |
{ |
|
770 |
UpdateListboxItemsL(); |
|
771 |
UpdateToolbar(); |
|
772 |
} |
|
773 |
||
774 |
void CPodcastShowsView::UpdateViewTitleL() |
|
775 |
{ |
|
776 |
DP("CPodcastShowsView::UpdateViewTitleL BEGIN"); |
|
777 |
CAknTitlePane* titlePane = static_cast<CAknTitlePane*> |
|
778 |
( StatusPane()->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) ); |
|
779 |
||
780 |
TBool updatingState = iPodcastModel.FeedEngine().ClientState() != EIdle && |
|
781 |
iPodcastModel.FeedEngine().ActiveClientUid() == iPodcastModel.ActiveFeedInfo()->Uid(); |
|
782 |
||
783 |
if (updatingState) { |
|
784 |
SetEmptyTextL(R_PODCAST_EMPTY_LIST_UPDATING); |
|
785 |
} else { |
|
786 |
SetEmptyTextL(R_PODCAST_EMPTY_LIST); |
|
787 |
} |
|
788 |
||
789 |
if(iPodcastModel.ActiveFeedInfo()) |
|
790 |
{ |
|
791 |
if (iPodcastModel.ActiveFeedInfo()->Title() != KNullDesC) |
|
792 |
{ |
|
793 |
titlePane->SetTextL( iPodcastModel.ActiveFeedInfo()->Title(), ETrue ); |
|
794 |
} |
|
795 |
} |
|
796 |
else |
|
797 |
{ |
|
798 |
titlePane->SetTextToDefaultL(); |
|
799 |
} |
|
800 |
||
801 |
DP("CPodcastShowsView::UpdateViewTitleL END"); |
|
802 |
} |