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