author | Sebastian Brannstrom <sebastianb@symbian.org> |
Fri, 19 Nov 2010 22:51:53 +0000 | |
branch | symbian1 |
changeset 378 | b3487e8973c7 |
parent 377 | 684802056d6f |
child 384 | 004e149c6f0b |
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 |
||
336
3d6c1417e8bd
Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
288
diff
changeset
|
40 |
_LIT(KShowFormat, "%d\t%S\t%S%S"); |
3d6c1417e8bd
Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
288
diff
changeset
|
41 |
_LIT(KShowFormatLandscape, "%d\t%S"); |
2 | 42 |
|
43 |
// these must correspond with TShowsIconIndex |
|
44 |
||
45 |
const TUint KShowIconArrayIds[] = |
|
46 |
{ |
|
350
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
47 |
// EShowIcon = 0, |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
48 |
EMbmPodcastAudio, |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
49 |
EMbmPodcastAudio_mask, |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
50 |
// EShowIconNew, |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
51 |
EMbmPodcastAudio_new, |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
52 |
EMbmPodcastAudio_new_mask, |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
53 |
// EQuedShowIcon, |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
54 |
EMbmPodcastAudio_dl_queued, |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
55 |
EMbmPodcastAudio_dl_queued_mask, |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
56 |
// EQuedShowIconNew, |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
57 |
EMbmPodcastAudio_dl_queued_new, |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
58 |
EMbmPodcastAudio_dl_queued_new_mask, |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
59 |
// EDownloadingShowIcon, |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
60 |
EMbmPodcastAudio_dl_active, |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
61 |
EMbmPodcastAudio_dl_active_mask, |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
62 |
// EDownloadingShowIconNew, |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
63 |
EMbmPodcastAudio_dl_active_new, |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
64 |
EMbmPodcastAudio_dl_active_new_mask, |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
65 |
// EDownloadedShowIcon, |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
66 |
EMbmPodcastAudio_dl, |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
67 |
EMbmPodcastAudio_dl_mask, |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
68 |
// EDownloadedShowIconNew, |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
69 |
EMbmPodcastAudio_dl_new, |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
70 |
EMbmPodcastAudio_dl_new_mask, |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
71 |
// EFailedShowIcon, |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
72 |
EMbmPodcastAudio_dl_failed, |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
73 |
EMbmPodcastAudio_dl_failed_mask, |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
74 |
// EFailedShowIconNew, |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
75 |
EMbmPodcastAudio_dl_failed_new, |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
76 |
EMbmPodcastAudio_dl_failed_new_mask, |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
77 |
// ESuspendedShowIcon, |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
78 |
EMbmPodcastAudio_dl_suspended, |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
79 |
EMbmPodcastAudio_dl_suspended_mask, |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
80 |
// ESuspendedShowIconNew |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
81 |
EMbmPodcastAudio_dl_suspended_new, |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
82 |
EMbmPodcastAudio_dl_suspended_new_mask, |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
83 |
// EShowIcon = 0, |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
84 |
EMbmPodcastVideo, |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
85 |
EMbmPodcastVideo_mask, |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
86 |
// EShowIconNew, |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
87 |
EMbmPodcastVideo_new, |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
88 |
EMbmPodcastVideo_new_mask, |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
89 |
// EQuedShowIcon, |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
90 |
EMbmPodcastVideo_dl_queued, |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
91 |
EMbmPodcastVideo_dl_queued_mask, |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
92 |
// EQuedShowIconNew, |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
93 |
EMbmPodcastVideo_dl_queued_new, |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
94 |
EMbmPodcastVideo_dl_queued_new_mask, |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
95 |
// EDownloadingShowIcon, |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
96 |
EMbmPodcastVideo_dl_active, |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
97 |
EMbmPodcastVideo_dl_active_mask, |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
98 |
// EDownloadingShowIconNew, |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
99 |
EMbmPodcastVideo_dl_active_new, |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
100 |
EMbmPodcastVideo_dl_active_new_mask, |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
101 |
// EDownloadedShowIcon, |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
102 |
EMbmPodcastVideo_dl, |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
103 |
EMbmPodcastVideo_dl_mask, |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
104 |
// EDownloadedShowIconNew, |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
105 |
EMbmPodcastVideo_dl_new, |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
106 |
EMbmPodcastVideo_dl_new_mask, |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
107 |
// EFailedShowIcon, |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
108 |
EMbmPodcastVideo_dl_failed, |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
109 |
EMbmPodcastVideo_dl_failed_mask, |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
110 |
// EFailedShowIconNew, |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
111 |
EMbmPodcastVideo_dl_failed_new, |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
112 |
EMbmPodcastVideo_dl_failed_new_mask, |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
113 |
// ESuspendedShowIcon, |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
114 |
EMbmPodcastVideo_dl_suspended, |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
115 |
EMbmPodcastVideo_dl_suspended_mask, |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
116 |
// ESuspendedShowIconNew |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
117 |
EMbmPodcastVideo_dl_suspended_new, |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
118 |
EMbmPodcastVideo_dl_suspended_new_mask, |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
119 |
EMbmPodcastFeed, |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
120 |
EMbmPodcastFeed_mask, |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
121 |
0, |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
122 |
0 |
2 | 123 |
}; |
124 |
||
350
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
125 |
const TInt KVideoIconOffset = 12; |
60 | 126 |
|
2 | 127 |
CPodcastShowsView* CPodcastShowsView::NewL(CPodcastModel& aPodcastModel) |
128 |
{ |
|
129 |
CPodcastShowsView* self = CPodcastShowsView::NewLC(aPodcastModel); |
|
130 |
CleanupStack::Pop(self); |
|
131 |
return self; |
|
132 |
} |
|
133 |
||
134 |
CPodcastShowsView* CPodcastShowsView::NewLC(CPodcastModel& aPodcastModel) |
|
135 |
{ |
|
136 |
CPodcastShowsView* self = new ( ELeave ) CPodcastShowsView(aPodcastModel); |
|
137 |
CleanupStack::PushL(self); |
|
138 |
self->ConstructL(); |
|
139 |
return self; |
|
140 |
} |
|
141 |
||
142 |
CPodcastShowsView::CPodcastShowsView(CPodcastModel& aPodcastModel) : |
|
143 |
iPodcastModel(aPodcastModel) |
|
144 |
{ |
|
145 |
} |
|
146 |
||
147 |
void CPodcastShowsView::ConstructL() |
|
148 |
{ |
|
149 |
BaseConstructL(R_PODCAST_SHOWSVIEW); |
|
150 |
CPodcastListView::ConstructL(); |
|
151 |
||
152 |
CreateIconsL(); |
|
336
3d6c1417e8bd
Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
288
diff
changeset
|
153 |
|
2 | 154 |
iPodcastModel.FeedEngine().AddObserver(this); |
155 |
iPodcastModel.ShowEngine().AddObserver(this); |
|
156 |
||
157 |
iStylusPopupMenu = CAknStylusPopUpMenu::NewL( this , TPoint(0,0)); |
|
158 |
TResourceReader reader; |
|
159 |
iCoeEnv->CreateResourceReaderLC(reader,R_SHOWVIEW_POPUP_MENU); |
|
160 |
iStylusPopupMenu->ConstructFromResourceL(reader); |
|
161 |
||
162 |
CleanupStack::PopAndDestroy(); |
|
163 |
} |
|
164 |
||
165 |
void CPodcastShowsView::CreateIconsL() |
|
166 |
{ |
|
167 |
CArrayPtr< CGulIcon>* icons = new(ELeave) CArrayPtrFlat< CGulIcon>(1); |
|
168 |
CleanupStack::PushL(icons); |
|
169 |
TInt pos = 0; |
|
170 |
while (KShowIconArrayIds[pos] > 0) |
|
171 |
{ |
|
60 | 172 |
// Load the icon |
173 |
CFbsBitmap* bitmap= NULL; |
|
174 |
CFbsBitmap* mask= NULL; |
|
2 | 175 |
AknIconUtils::CreateIconL(bitmap, |
176 |
mask, |
|
177 |
iEikonEnv->EikAppUi()->Application()->BitmapStoreName(), |
|
178 |
KShowIconArrayIds[pos], |
|
179 |
KShowIconArrayIds[pos+1]); |
|
180 |
CleanupStack::PushL(bitmap); |
|
181 |
CleanupStack::PushL(mask); |
|
182 |
||
60 | 183 |
// Append the icon to icon array |
2 | 184 |
icons->AppendL(CGulIcon::NewL(bitmap, mask) ); |
185 |
CleanupStack::Pop(2); // bitmap, mask |
|
186 |
pos+=2; |
|
187 |
} |
|
188 |
||
336
3d6c1417e8bd
Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
288
diff
changeset
|
189 |
//iListContainer->Listbox()->ItemDrawer()->FormattedCellData()->SetIconArrayL(icons); |
3d6c1417e8bd
Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
288
diff
changeset
|
190 |
iListContainer->SetListboxIcons(icons); |
2 | 191 |
CleanupStack::Pop(icons); // icons |
192 |
} |
|
193 |
||
194 |
TKeyResponse CPodcastShowsView::OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType) |
|
195 |
{ |
|
196 |
if (aType == EEventKey) |
|
197 |
{ |
|
198 |
CShowInfo *activeShow = NULL; |
|
199 |
||
200 |
TInt index = iListContainer->Listbox()->CurrentItemIndex(); |
|
201 |
if(index >= 0 && index < iPodcastModel.ActiveShowList().Count()) |
|
202 |
{ |
|
203 |
activeShow = iPodcastModel.ActiveShowList()[index]; |
|
204 |
} |
|
205 |
||
206 |
if (activeShow != NULL) { |
|
207 |
DP1("aKeyEvent.iCode=%d", aKeyEvent.iCode); |
|
208 |
switch (aKeyEvent.iCode) { |
|
209 |
case 117: |
|
210 |
case '*': |
|
211 |
case EKeySpace: |
|
212 |
if (activeShow->PlayState() == EPlayed) { |
|
213 |
HandleCommandL(EPodcastMarkAsUnplayed); |
|
214 |
} else { |
|
215 |
HandleCommandL(EPodcastMarkAsPlayed); |
|
216 |
} |
|
217 |
break; |
|
218 |
case 106: |
|
219 |
case '#': |
|
220 |
if (activeShow->DownloadState() == ENotDownloaded) { |
|
221 |
HandleCommandL(EPodcastDownloadShow); |
|
222 |
} |
|
223 |
break; |
|
224 |
case EKeyBackspace: |
|
225 |
case EKeyDelete: |
|
226 |
HandleCommandL(EPodcastDeleteShow); |
|
227 |
break; |
|
228 |
default: |
|
229 |
break; |
|
230 |
} |
|
231 |
UpdateToolbar(); |
|
232 |
} |
|
233 |
} |
|
234 |
return CPodcastListView::OfferKeyEventL(aKeyEvent, aType); |
|
235 |
} |
|
236 |
||
237 |
CPodcastShowsView::~CPodcastShowsView() |
|
238 |
{ |
|
355
075b3a49cb55
Fixed more usability issues; Updated version to 1.10
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
354
diff
changeset
|
239 |
DP("CPodcastShowsView::~CPodcastShowsView BEGIN"); |
2 | 240 |
iPodcastModel.ShowEngine().RemoveObserver(this); |
241 |
iPodcastModel.FeedEngine().RemoveObserver(this); |
|
242 |
||
243 |
if(iStylusPopupMenu) |
|
244 |
delete iStylusPopupMenu, iStylusPopupMenu = NULL; |
|
355
075b3a49cb55
Fixed more usability issues; Updated version to 1.10
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
354
diff
changeset
|
245 |
|
075b3a49cb55
Fixed more usability issues; Updated version to 1.10
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
354
diff
changeset
|
246 |
DP("CPodcastShowsView::~CPodcastShowsView END"); |
2 | 247 |
} |
248 |
||
249 |
||
250 |
TUid CPodcastShowsView::Id() const |
|
251 |
{ |
|
252 |
return KUidPodcastShowsViewID; |
|
253 |
} |
|
254 |
||
255 |
void CPodcastShowsView::DoActivateL(const TVwsViewId& aPrevViewId, |
|
256 |
TUid aCustomMessageId, const TDesC8& aCustomMessage) |
|
257 |
{ |
|
258 |
DP("CPodcastShowsView::DoActivateL BEGIN"); |
|
49
43e204e6ae2e
Fix for accidental merge regressions. Text fixes for tool tip and settings.
teknolog
parents:
38
diff
changeset
|
259 |
CPodcastListView::DoActivateL(aPrevViewId, aCustomMessageId, aCustomMessage); |
43e204e6ae2e
Fix for accidental merge regressions. Text fixes for tool tip and settings.
teknolog
parents:
38
diff
changeset
|
260 |
|
43e204e6ae2e
Fix for accidental merge regressions. Text fixes for tool tip and settings.
teknolog
parents:
38
diff
changeset
|
261 |
iPreviousView = TVwsViewId(KUidPodcast, KUidPodcastFeedViewID); |
2 | 262 |
|
347
b8d687bb7ca1
Experimenting with adding a new view to list all new shows
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
336
diff
changeset
|
263 |
iShowNewShows = (aCustomMessageId.iUid == 1); |
b8d687bb7ca1
Experimenting with adding a new view to list all new shows
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
336
diff
changeset
|
264 |
|
b8d687bb7ca1
Experimenting with adding a new view to list all new shows
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
336
diff
changeset
|
265 |
if (iShowNewShows) |
b8d687bb7ca1
Experimenting with adding a new view to list all new shows
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
336
diff
changeset
|
266 |
{ |
b8d687bb7ca1
Experimenting with adding a new view to list all new shows
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
336
diff
changeset
|
267 |
CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current(); |
b8d687bb7ca1
Experimenting with adding a new view to list all new shows
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
336
diff
changeset
|
268 |
cba->SetCommandSetL(R_PODCAST_CBA); |
b8d687bb7ca1
Experimenting with adding a new view to list all new shows
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
336
diff
changeset
|
269 |
cba->DrawDeferred(); |
b8d687bb7ca1
Experimenting with adding a new view to list all new shows
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
336
diff
changeset
|
270 |
} |
b8d687bb7ca1
Experimenting with adding a new view to list all new shows
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
336
diff
changeset
|
271 |
else |
b8d687bb7ca1
Experimenting with adding a new view to list all new shows
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
336
diff
changeset
|
272 |
{ |
b8d687bb7ca1
Experimenting with adding a new view to list all new shows
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
336
diff
changeset
|
273 |
CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current(); |
b8d687bb7ca1
Experimenting with adding a new view to list all new shows
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
336
diff
changeset
|
274 |
cba->SetCommandSetL(R_AVKON_SOFTKEYS_OPTIONS_BACK); |
b8d687bb7ca1
Experimenting with adding a new view to list all new shows
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
336
diff
changeset
|
275 |
cba->DrawDeferred(); |
b8d687bb7ca1
Experimenting with adding a new view to list all new shows
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
336
diff
changeset
|
276 |
} |
b8d687bb7ca1
Experimenting with adding a new view to list all new shows
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
336
diff
changeset
|
277 |
|
2 | 278 |
UpdateViewTitleL(); |
279 |
UpdateFeedUpdateStateL(); |
|
280 |
DP("CPodcastShowsView::DoActivateL END"); |
|
281 |
} |
|
282 |
||
283 |
void CPodcastShowsView::DoDeactivate() |
|
284 |
{ |
|
285 |
CPodcastListView::DoDeactivate(); |
|
286 |
} |
|
287 |
||
288 |
// Engine callback when new shows are available |
|
289 |
void CPodcastShowsView::ShowListUpdatedL() |
|
290 |
{ |
|
291 |
UpdateListboxItemsL(); |
|
292 |
} |
|
293 |
||
294 |
void CPodcastShowsView::ShowDownloadUpdatedL(TInt aBytesOfCurrentDownload, TInt /*aBytesTotal*/) |
|
295 |
{ |
|
296 |
if (!iListContainer->IsVisible()) |
|
297 |
{ |
|
298 |
return; |
|
299 |
} |
|
300 |
||
301 |
CShowInfo *info = iPodcastModel.ShowEngine().ShowDownloading(); |
|
302 |
if (info) |
|
303 |
{ |
|
304 |
UpdateShowItemL(info->Uid(), aBytesOfCurrentDownload); |
|
305 |
} |
|
306 |
} |
|
307 |
||
34 | 308 |
void CPodcastShowsView::ShowDownloadFinishedL(TUint aShowUid, TInt aError) |
2 | 309 |
{ |
310 |
iProgressAdded = EFalse; |
|
34 | 311 |
CShowInfo *info = NULL; |
312 |
RShowInfoArray &fItems = iPodcastModel.ActiveShowList(); |
|
313 |
||
314 |
for (TInt i=0;i<fItems.Count();i++) |
|
315 |
{ |
|
316 |
if (fItems[i]->Uid() == aShowUid) |
|
317 |
{ |
|
318 |
info = fItems[i]; |
|
319 |
} |
|
320 |
} |
|
321 |
||
322 |
if (info == NULL) { |
|
323 |
return; |
|
324 |
} |
|
2 | 325 |
|
326 |
switch(aError) |
|
327 |
{ |
|
328 |
case KErrCouldNotConnect: |
|
329 |
{ |
|
330 |
TBuf<KMaxMessageLength> message; |
|
331 |
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
|
332 |
ShowErrorMessageL(message); |
2 | 333 |
} |
334 |
break; |
|
6 | 335 |
default: |
2 | 336 |
break; |
337 |
} |
|
6 | 338 |
UpdateListboxItemsL(); |
2 | 339 |
} |
340 |
||
341 |
||
342 |
void CPodcastShowsView::FeedDownloadStartedL(TFeedState /*aState*/, TUint aFeedUid) |
|
343 |
{ |
|
344 |
// TODO make use of the fact that we know that the feed download is |
|
345 |
// started instead of checking feed engine states in UpdateFeedUpdateStateL. |
|
346 |
if (iPodcastModel.ActiveFeedInfo() != NULL |
|
347 |
&& iPodcastModel.ActiveFeedInfo()->Uid() == aFeedUid) |
|
348 |
{ |
|
8 | 349 |
UpdateFeedUpdateStateL(); |
2 | 350 |
UpdateToolbar(); |
351 |
} |
|
352 |
} |
|
353 |
||
354 |
void CPodcastShowsView::FeedDownloadFinishedL(TFeedState /*aState*/, TUint aFeedUid, TInt /*aError*/) |
|
355 |
{ |
|
356 |
DP("CPodcastShowsView::FeedDownloadFinishedL BEGIN"); |
|
166
58268495eb35
Fix for 2608 - Title is sometimes not reset to "Podcatcher" after leaving ShowsView
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
164
diff
changeset
|
357 |
if (iListContainer->IsVisible() && |
58268495eb35
Fix for 2608 - Title is sometimes not reset to "Podcatcher" after leaving ShowsView
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
164
diff
changeset
|
358 |
iPodcastModel.ActiveFeedInfo() != NULL && |
58268495eb35
Fix for 2608 - Title is sometimes not reset to "Podcatcher" after leaving ShowsView
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
164
diff
changeset
|
359 |
iPodcastModel.ActiveFeedInfo()->Uid() == aFeedUid) |
2 | 360 |
{ |
8 | 361 |
UpdateFeedUpdateStateL(); |
362 |
UpdateViewTitleL(); |
|
2 | 363 |
} |
364 |
DP("CPodcastShowsView::FeedDownloadFinishedL END"); |
|
365 |
} |
|
366 |
||
367 |
void CPodcastShowsView::HandleListBoxEventL(CEikListBox* /*aListBox*/, |
|
368 |
TListBoxEvent aEventType) |
|
369 |
{ |
|
370 |
switch (aEventType) |
|
371 |
{ |
|
372 |
case EEventEnterKeyPressed: |
|
373 |
case EEventItemActioned: |
|
374 |
case EEventItemDoubleClicked: |
|
375 |
{ |
|
376 |
RShowInfoArray &fItems = iPodcastModel.ActiveShowList(); |
|
377 |
TInt index = iListContainer->Listbox()->CurrentItemIndex(); |
|
378 |
if (index>=0 && index< fItems.Count()) |
|
379 |
{ |
|
380 |
DP2("Handle event for podcast %S, downloadState is %d", &(fItems[index]->Title()), fItems[index]->DownloadState()); |
|
381 |
CShowInfo *showInfo = fItems[index]; |
|
382 |
||
383 |
switch (showInfo->DownloadState()) { |
|
384 |
case ENotDownloaded: |
|
38
c11e52c5acd2
Fix for download state not taking user from shows view to queue view
teknolog
parents:
34
diff
changeset
|
385 |
case EFailedDownload: |
2 | 386 |
HandleCommandL(EPodcastDownloadShow); |
387 |
break; |
|
38
c11e52c5acd2
Fix for download state not taking user from shows view to queue view
teknolog
parents:
34
diff
changeset
|
388 |
case EDownloading: |
2 | 389 |
case EQueued: |
390 |
AppUi()->ActivateLocalViewL(KUidPodcastQueueViewID, TUid::Uid(0), KNullDesC8()); |
|
391 |
((CPodcastAppUi*)AppUi())->SetActiveTab(KTabIdQueue); |
|
392 |
break; |
|
393 |
case EDownloaded: |
|
136
cee38af14bcf
Merged show playback error handling from S^3 branch
teknolog
parents:
130
diff
changeset
|
394 |
{ |
cee38af14bcf
Merged show playback error handling from S^3 branch
teknolog
parents:
130
diff
changeset
|
395 |
TRAPD(err, iPodcastModel.PlayPausePodcastL(showInfo, ETrue)); |
cee38af14bcf
Merged show playback error handling from S^3 branch
teknolog
parents:
130
diff
changeset
|
396 |
if (err != KErrNone) |
cee38af14bcf
Merged show playback error handling from S^3 branch
teknolog
parents:
130
diff
changeset
|
397 |
{ |
cee38af14bcf
Merged show playback error handling from S^3 branch
teknolog
parents:
130
diff
changeset
|
398 |
HBufC *error = iEikonEnv->AllocReadResourceLC(R_ERROR_PLAYBACK_FAILED); |
cee38af14bcf
Merged show playback error handling from S^3 branch
teknolog
parents:
130
diff
changeset
|
399 |
ShowErrorMessageL(*error); |
cee38af14bcf
Merged show playback error handling from S^3 branch
teknolog
parents:
130
diff
changeset
|
400 |
CleanupStack::PopAndDestroy(error); |
cee38af14bcf
Merged show playback error handling from S^3 branch
teknolog
parents:
130
diff
changeset
|
401 |
} |
90
d0c0c3e6f7a1
Added support for launching music and video player when tapping on a downloaded show
teknolog
parents:
70
diff
changeset
|
402 |
UpdateListboxItemsL(); |
136
cee38af14bcf
Merged show playback error handling from S^3 branch
teknolog
parents:
130
diff
changeset
|
403 |
} |
2 | 404 |
break; |
405 |
default: |
|
406 |
break; |
|
407 |
} |
|
408 |
} |
|
409 |
} |
|
410 |
break; |
|
411 |
default: |
|
412 |
break; |
|
413 |
} |
|
414 |
UpdateToolbar(); |
|
415 |
} |
|
416 |
||
417 |
void CPodcastShowsView::GetShowIcons(CShowInfo* aShowInfo, TInt& aIconIndex) |
|
418 |
{ |
|
419 |
TBool dlStop = iPodcastModel.SettingsEngine().DownloadSuspended(); |
|
350
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
420 |
TBool isNew = aShowInfo->PlayState() == ENeverPlayed; |
34 | 421 |
switch (aShowInfo->DownloadState()) |
2 | 422 |
{ |
34 | 423 |
case EDownloaded: |
350
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
424 |
aIconIndex = isNew ? EDownloadedShowIconNew : EDownloadedShowIcon; |
34 | 425 |
break; |
426 |
case ENotDownloaded: |
|
350
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
427 |
aIconIndex = isNew ? EShowIconNew : EShowIcon; |
34 | 428 |
break; |
429 |
case EQueued: |
|
350
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
430 |
aIconIndex = dlStop ? (isNew ? ESuspendedShowIconNew : ESuspendedShowIcon) : |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
431 |
(isNew ? EQuedShowIconNew : EQuedShowIcon); |
34 | 432 |
break; |
433 |
case EDownloading: |
|
350
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
434 |
aIconIndex = dlStop ? (isNew ? ESuspendedShowIconNew : ESuspendedShowIcon) : |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
435 |
(isNew ? EDownloadingShowIconNew : EDownloadingShowIcon); |
34 | 436 |
break; |
437 |
case EFailedDownload: |
|
350
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
438 |
aIconIndex = dlStop ? (isNew ? ESuspendedShowIconNew : ESuspendedShowIcon) : |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
439 |
(isNew ? EFailedShowIconNew : EFailedShowIconNew); |
34 | 440 |
break; |
2 | 441 |
} |
60 | 442 |
|
443 |
if (aShowInfo->ShowType() == EVideoPodcast) |
|
444 |
{ |
|
445 |
aIconIndex += KVideoIconOffset; |
|
446 |
} |
|
350
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
447 |
|
354
a2713e6a41a9
Further UI tweaks
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
352
diff
changeset
|
448 |
//DP3("dlStop=%d, isNew=%d, aIconIndex=%d", dlStop, isNew, aIconIndex); |
2 | 449 |
} |
450 |
||
451 |
||
452 |
void CPodcastShowsView::UpdateFeedUpdateStateL() |
|
453 |
{ |
|
454 |
TBool listboxDimmed = EFalse; |
|
455 |
||
456 |
if (iPodcastModel.FeedEngine().ClientState() != EIdle && iPodcastModel.ActiveFeedInfo() |
|
457 |
!= NULL && iPodcastModel.FeedEngine().ActiveClientUid() == iPodcastModel.ActiveFeedInfo()->Uid()) |
|
458 |
{ |
|
459 |
listboxDimmed = ETrue; |
|
460 |
} |
|
461 |
||
462 |
if ((iListContainer->Listbox()->IsDimmed() && !listboxDimmed) || (!iListContainer->Listbox()->IsDimmed() && listboxDimmed)) |
|
463 |
{ |
|
464 |
iListContainer->Listbox()->SetDimmed(listboxDimmed); |
|
465 |
} |
|
466 |
UpdateListboxItemsL(); |
|
467 |
UpdateToolbar(); |
|
468 |
} |
|
469 |
||
470 |
void CPodcastShowsView::FormatShowInfoListBoxItemL(CShowInfo& aShowInfo, TInt aSizeDownloaded) |
|
471 |
{ |
|
472 |
TBuf<32> infoSize; |
|
473 |
TInt iconIndex = 0; |
|
474 |
TBuf<KMaxShortDateFormatSpec*2> showDate; |
|
475 |
GetShowIcons(&aShowInfo, iconIndex); |
|
476 |
||
477 |
if(aSizeDownloaded > 0) |
|
478 |
{ |
|
479 |
if (aShowInfo.ShowSize() > 0) |
|
480 |
{ |
|
361
861a25b8306b
Fix for mark all old visibility
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
358
diff
changeset
|
481 |
TUint showSize = aShowInfo.ShowSize() >= (TUint) aSizeDownloaded ? aShowInfo.ShowSize() : (TUint) aSizeDownloaded; |
2 | 482 |
infoSize.Format(KSizeDownloadingOf(), ((float) aSizeDownloaded / (float) KSizeMb), |
354
a2713e6a41a9
Further UI tweaks
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
352
diff
changeset
|
483 |
((float) showSize / (float)KSizeMb)); |
2 | 484 |
} |
485 |
else |
|
486 |
{ |
|
487 |
infoSize.Format(KShowsSizeFormatS60(), (float)aSizeDownloaded / (float)KSizeMb); |
|
488 |
} |
|
489 |
} |
|
490 |
else if (aShowInfo.ShowSize() > 0) |
|
491 |
{ |
|
492 |
infoSize.Format(KShowsSizeFormatS60(), (float)aShowInfo.ShowSize() / (float)KSizeMb); |
|
493 |
} |
|
494 |
else { |
|
495 |
infoSize = KNullDesC(); |
|
496 |
} |
|
497 |
||
498 |
if (aShowInfo.PubDate().Int64() == 0) |
|
499 |
{ |
|
500 |
showDate = KNullDesC(); |
|
501 |
} |
|
502 |
else |
|
503 |
{ |
|
504 |
aShowInfo.PubDate().FormatL(showDate, KDateFormatShort()); |
|
505 |
} |
|
506 |
||
507 |
if(aShowInfo.LastError() != KErrNone) |
|
508 |
{ |
|
6 | 509 |
GetShowErrorText(infoSize, aShowInfo.LastError()); |
60 | 510 |
showDate.Zero(); |
2 | 511 |
} |
6 | 512 |
|
60 | 513 |
if (infoSize.Length() > 0 && showDate.Length() > 0) |
2 | 514 |
{ |
6 | 515 |
infoSize.Insert(0,_L(", ")); |
2 | 516 |
} |
517 |
||
6 | 518 |
iListboxFormatbuffer.Format(KShowFormat(), iconIndex, &aShowInfo.Title(), &showDate, &infoSize); |
336
3d6c1417e8bd
Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
288
diff
changeset
|
519 |
iListboxFormatbufferShort.Format(KShowFormatLandscape(), iconIndex, &aShowInfo.Title()); |
2 | 520 |
} |
521 |
||
522 |
void CPodcastShowsView::GetShowErrorText(TDes &aErrorMessage, TInt aErrorCode) |
|
523 |
{ |
|
60 | 524 |
TRAP_IGNORE(((CPodcastAppUi*)AppUi())->GetErrorTextL(aErrorMessage,aErrorCode)); |
2 | 525 |
} |
526 |
||
527 |
void CPodcastShowsView::UpdateShowItemDataL(CShowInfo* aShowInfo,TInt aIndex, TInt aSizeDownloaded) |
|
528 |
{ |
|
529 |
FormatShowInfoListBoxItemL(*aShowInfo, aSizeDownloaded); |
|
530 |
iItemArray->Delete(aIndex); |
|
336
3d6c1417e8bd
Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
288
diff
changeset
|
531 |
iItemArrayShort->Delete(aIndex); |
3d6c1417e8bd
Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
288
diff
changeset
|
532 |
|
2 | 533 |
if(aIndex>= iItemArray->MdcaCount()) |
534 |
{ |
|
535 |
iItemArray->AppendL(iListboxFormatbuffer); |
|
336
3d6c1417e8bd
Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
288
diff
changeset
|
536 |
iItemArrayShort->AppendL(iListboxFormatbufferShort); |
2 | 537 |
} |
538 |
else |
|
539 |
{ |
|
540 |
iItemArray->InsertL(aIndex, iListboxFormatbuffer); |
|
336
3d6c1417e8bd
Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
288
diff
changeset
|
541 |
iItemArrayShort->InsertL(aIndex, iListboxFormatbufferShort); |
2 | 542 |
} |
543 |
} |
|
544 |
||
545 |
void CPodcastShowsView::UpdateShowItemL(TUint aUid, TInt aSizeDownloaded) |
|
546 |
{ |
|
547 |
RShowInfoArray& array = iPodcastModel.ActiveShowList(); |
|
548 |
||
549 |
for (int i=0;i<array.Count();i++) { |
|
550 |
if (array[i]->Uid() == aUid) { |
|
551 |
UpdateShowItemDataL(array[i], i, aSizeDownloaded); |
|
552 |
if (iListContainer->Listbox()->TopItemIndex() <= i && |
|
553 |
iListContainer->Listbox()->BottomItemIndex() >= i) { |
|
554 |
iListContainer->Listbox()->DrawItem(i); |
|
555 |
} |
|
556 |
} |
|
557 |
} |
|
558 |
} |
|
559 |
||
560 |
void CPodcastShowsView::UpdateListboxItemsL() |
|
561 |
{ |
|
336
3d6c1417e8bd
Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
288
diff
changeset
|
562 |
DP("CPodcastShowsView::UpdateListboxItemsL BEGIN"); |
2 | 563 |
if (iListContainer->IsVisible()) |
564 |
{ |
|
565 |
TListItemProperties itemProps; |
|
566 |
TInt len = 0; |
|
567 |
||
347
b8d687bb7ca1
Experimenting with adding a new view to list all new shows
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
336
diff
changeset
|
568 |
if (iShowNewShows) |
b8d687bb7ca1
Experimenting with adding a new view to list all new shows
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
336
diff
changeset
|
569 |
{ |
b8d687bb7ca1
Experimenting with adding a new view to list all new shows
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
336
diff
changeset
|
570 |
iPodcastModel.GetNewShowsL(); |
b8d687bb7ca1
Experimenting with adding a new view to list all new shows
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
336
diff
changeset
|
571 |
} |
b8d687bb7ca1
Experimenting with adding a new view to list all new shows
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
336
diff
changeset
|
572 |
else |
b8d687bb7ca1
Experimenting with adding a new view to list all new shows
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
336
diff
changeset
|
573 |
{ |
b8d687bb7ca1
Experimenting with adding a new view to list all new shows
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
336
diff
changeset
|
574 |
iPodcastModel.GetShowsByFeedL(iPodcastModel.ActiveFeedInfo()->Uid()); |
b8d687bb7ca1
Experimenting with adding a new view to list all new shows
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
336
diff
changeset
|
575 |
} |
b8d687bb7ca1
Experimenting with adding a new view to list all new shows
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
336
diff
changeset
|
576 |
|
2 | 577 |
RShowInfoArray &fItems = iPodcastModel.ActiveShowList(); |
578 |
len = fItems.Count(); |
|
579 |
||
580 |
if (iListContainer->Listbox() != NULL) |
|
581 |
{ |
|
582 |
TBool allUidsMatch = EFalse; |
|
583 |
||
584 |
if (len == iListContainer->Listbox()->Model()->NumberOfItems()) |
|
585 |
{ |
|
586 |
allUidsMatch = ETrue; |
|
587 |
TUint itemId = 0; |
|
588 |
for (TInt loop = 0; loop< len; loop++) |
|
589 |
{ |
|
590 |
itemId = iItemIdArray[loop]; |
|
591 |
if (fItems[loop]->Uid() != itemId) |
|
592 |
{ |
|
593 |
allUidsMatch = EFalse; |
|
594 |
break; |
|
595 |
} |
|
596 |
} |
|
597 |
} |
|
598 |
||
599 |
if (allUidsMatch && len > 0) |
|
600 |
{ |
|
601 |
for (TInt loop = 0; loop< len; loop++) |
|
34 | 602 |
{ |
6 | 603 |
UpdateShowItemDataL(fItems[loop], loop); |
2 | 604 |
} |
31
8a5ead064c4f
Shows view now updates correctl after Mark all played
teknolog
parents:
28
diff
changeset
|
605 |
iListContainer->Listbox()->DrawNow(); |
2 | 606 |
} |
607 |
else |
|
608 |
{ |
|
336
3d6c1417e8bd
Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
288
diff
changeset
|
609 |
//iListContainer->Listbox()->ItemDrawer()->ClearAllPropertiesL(); |
2 | 610 |
iListContainer->Listbox()->Reset(); |
611 |
iItemIdArray.Reset(); |
|
612 |
iItemArray->Reset(); |
|
336
3d6c1417e8bd
Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
288
diff
changeset
|
613 |
iItemArrayShort->Reset(); |
3d6c1417e8bd
Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
288
diff
changeset
|
614 |
|
2 | 615 |
if (len > 0) |
616 |
{ |
|
617 |
for (TInt i=0; i<len; i++) |
|
618 |
{ |
|
619 |
CShowInfo *si = fItems[i]; |
|
620 |
FormatShowInfoListBoxItemL(*si); |
|
621 |
iItemIdArray.Append(si->Uid()); |
|
622 |
iItemArray->AppendL(iListboxFormatbuffer); |
|
336
3d6c1417e8bd
Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
288
diff
changeset
|
623 |
iItemArrayShort->AppendL(iListboxFormatbufferShort); |
3d6c1417e8bd
Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
288
diff
changeset
|
624 |
|
2 | 625 |
} |
626 |
} |
|
627 |
else |
|
628 |
{ |
|
629 |
iItemArray->Reset(); |
|
336
3d6c1417e8bd
Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
288
diff
changeset
|
630 |
iItemArrayShort->Reset(); |
2 | 631 |
iItemIdArray.Reset(); |
632 |
||
633 |
itemProps.SetDimmed(ETrue); |
|
634 |
itemProps.SetHiddenSelection(ETrue); |
|
635 |
} |
|
636 |
iListContainer->Listbox()->HandleItemAdditionL(); |
|
637 |
} |
|
638 |
} |
|
639 |
} |
|
336
3d6c1417e8bd
Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
288
diff
changeset
|
640 |
DP("CPodcastShowsView::UpdateListboxItemsL END"); |
2 | 641 |
} |
642 |
||
643 |
/** |
|
644 |
* Command handling function intended for overriding by sub classes. |
|
645 |
* Default implementation is empty. |
|
646 |
* @param aCommand ID of the command to respond to. |
|
647 |
*/ |
|
648 |
void CPodcastShowsView::HandleCommandL(TInt aCommand) |
|
649 |
{ |
|
650 |
switch (aCommand) |
|
651 |
{ |
|
652 |
case EPodcastMarkAsPlayed: |
|
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
28
diff
changeset
|
653 |
HandleSetShowPlayedL(ETrue); |
2 | 654 |
break; |
655 |
case EPodcastMarkAsUnplayed: |
|
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
28
diff
changeset
|
656 |
HandleSetShowPlayedL(EFalse); |
2 | 657 |
break; |
658 |
case EPodcastMarkAllPlayed: |
|
364
998e9d114bd5
Sync with symbian3 branch
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
361
diff
changeset
|
659 |
{ |
358
d2ce95126703
Added query before marking all shows played in new list
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
355
diff
changeset
|
660 |
if (iShowNewShows) { |
d2ce95126703
Added query before marking all shows played in new list
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
355
diff
changeset
|
661 |
TBuf<KMaxMessageLength> msg; |
d2ce95126703
Added query before marking all shows played in new list
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
355
diff
changeset
|
662 |
iEikonEnv->ReadResourceL(msg, R_MARK_ALL_OLD_QUERY); |
d2ce95126703
Added query before marking all shows played in new list
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
355
diff
changeset
|
663 |
if (!ShowQueryMessageL(msg)) |
d2ce95126703
Added query before marking all shows played in new list
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
355
diff
changeset
|
664 |
{ |
d2ce95126703
Added query before marking all shows played in new list
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
355
diff
changeset
|
665 |
break; |
d2ce95126703
Added query before marking all shows played in new list
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
355
diff
changeset
|
666 |
} |
d2ce95126703
Added query before marking all shows played in new list
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
355
diff
changeset
|
667 |
} |
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
28
diff
changeset
|
668 |
iPodcastModel.MarkSelectionPlayedL(); |
2 | 669 |
UpdateListboxItemsL(); |
364
998e9d114bd5
Sync with symbian3 branch
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
361
diff
changeset
|
670 |
} |
2 | 671 |
break; |
672 |
case EPodcastDeleteShow: |
|
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
28
diff
changeset
|
673 |
HandleDeleteShowL(); |
2 | 674 |
break; |
350
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
675 |
case EPodcastDownloadAll: |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
676 |
HandleDownloadAllL(); |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
677 |
break; |
2 | 678 |
case EPodcastDownloadShow: |
679 |
{ |
|
680 |
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
|
681 |
|
2 | 682 |
if (index >= 0 && index < iPodcastModel.ActiveShowList().Count()) |
683 |
{ |
|
684 |
iPodcastModel.ShowEngine().AddDownloadL(*iPodcastModel.ActiveShowList()[index]); |
|
685 |
UpdateShowItemL(iPodcastModel.ActiveShowList()[index]->Uid(),-1); |
|
686 |
} |
|
687 |
} |
|
688 |
break; |
|
689 |
case EPodcastUpdateFeed: |
|
690 |
{ |
|
691 |
||
692 |
if (iPodcastModel.ActiveFeedInfo()->Url().Length()>0) |
|
693 |
{ |
|
694 |
TRAPD(error, iPodcastModel.FeedEngine().UpdateFeedL(iPodcastModel.ActiveFeedInfo()->Uid())); |
|
695 |
||
696 |
if (error != KErrNone) |
|
697 |
{ |
|
5 | 698 |
HBufC* str = |
2 | 699 |
iEikonEnv->AllocReadResourceLC(R_PODCAST_FEEDS_UPDATE_ERROR); |
700 |
User::InfoPrint(*str); |
|
701 |
CleanupStack::PopAndDestroy(str); |
|
702 |
} |
|
703 |
} |
|
704 |
} |
|
705 |
break; |
|
347
b8d687bb7ca1
Experimenting with adding a new view to list all new shows
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
336
diff
changeset
|
706 |
case EPodcastUpdateAllFeeds: |
b8d687bb7ca1
Experimenting with adding a new view to list all new shows
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
336
diff
changeset
|
707 |
{ |
b8d687bb7ca1
Experimenting with adding a new view to list all new shows
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
336
diff
changeset
|
708 |
iPodcastModel.FeedEngine().UpdateAllFeedsL(); |
b8d687bb7ca1
Experimenting with adding a new view to list all new shows
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
336
diff
changeset
|
709 |
UpdateToolbar(); |
b8d687bb7ca1
Experimenting with adding a new view to list all new shows
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
336
diff
changeset
|
710 |
}break; |
2 | 711 |
case EPodcastCancelUpdateAllFeeds: |
712 |
iPodcastModel.FeedEngine().CancelUpdateAllFeeds(); |
|
713 |
break; |
|
714 |
case EPodcastShowInfo: |
|
715 |
{ |
|
716 |
DisplayShowInfoDialogL(); |
|
717 |
}break; |
|
718 |
default: |
|
719 |
CPodcastListView::HandleCommandL(aCommand); |
|
720 |
break; |
|
721 |
} |
|
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
28
diff
changeset
|
722 |
iListContainer->SetLongTapDetectedL(EFalse); |
28 | 723 |
|
2 | 724 |
UpdateToolbar(); |
725 |
} |
|
726 |
||
727 |
void CPodcastShowsView::DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane) |
|
728 |
{ |
|
361
861a25b8306b
Fix for mark all old visibility
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
358
diff
changeset
|
729 |
if(aResourceId == R_PODCAST_SHOWSVIEW_MENU) |
2 | 730 |
{ |
361
861a25b8306b
Fix for mark all old visibility
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
358
diff
changeset
|
731 |
TBool hideMarkAllPlayed = ETrue; |
288
757e84a30b9a
Added selective availability of the mark all played command
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
166
diff
changeset
|
732 |
for (int i=0;i<iPodcastModel.ActiveShowList().Count();i++) |
757e84a30b9a
Added selective availability of the mark all played command
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
166
diff
changeset
|
733 |
{ |
757e84a30b9a
Added selective availability of the mark all played command
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
166
diff
changeset
|
734 |
CShowInfo* info = iPodcastModel.ActiveShowList()[i]; |
757e84a30b9a
Added selective availability of the mark all played command
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
166
diff
changeset
|
735 |
if (info->PlayState() == ENeverPlayed) |
757e84a30b9a
Added selective availability of the mark all played command
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
166
diff
changeset
|
736 |
{ |
361
861a25b8306b
Fix for mark all old visibility
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
358
diff
changeset
|
737 |
hideMarkAllPlayed = EFalse; |
288
757e84a30b9a
Added selective availability of the mark all played command
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
166
diff
changeset
|
738 |
break; |
757e84a30b9a
Added selective availability of the mark all played command
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
166
diff
changeset
|
739 |
} |
757e84a30b9a
Added selective availability of the mark all played command
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
166
diff
changeset
|
740 |
|
757e84a30b9a
Added selective availability of the mark all played command
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
166
diff
changeset
|
741 |
} |
757e84a30b9a
Added selective availability of the mark all played command
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
166
diff
changeset
|
742 |
|
2 | 743 |
TBool updatingState = iPodcastModel.FeedEngine().ClientState() != EIdle && iPodcastModel.FeedEngine().ActiveClientUid() == iPodcastModel.ActiveFeedInfo()->Uid(); |
361
861a25b8306b
Fix for mark all old visibility
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
358
diff
changeset
|
744 |
aMenuPane->SetItemDimmed(EPodcastMarkAllPlayed, updatingState || hideMarkAllPlayed || iShowNewShows); |
2 | 745 |
} |
746 |
} |
|
747 |
||
748 |
void CPodcastShowsView::DisplayShowInfoDialogL() |
|
749 |
{ |
|
750 |
TInt index = iListContainer->Listbox()->CurrentItemIndex(); |
|
751 |
if (index >= 0 && index < iPodcastModel.ActiveShowList().Count()) |
|
752 |
{ |
|
753 |
CShowInfo* info = iPodcastModel.ActiveShowList()[index]; |
|
24
ca50ea154990
Moved search result title to navipane. Fixed but 1832
teknolog
parents:
23
diff
changeset
|
754 |
|
ca50ea154990
Moved search result title to navipane. Fixed but 1832
teknolog
parents:
23
diff
changeset
|
755 |
HBufC *title = info->Title().AllocL(); |
ca50ea154990
Moved search result title to navipane. Fixed but 1832
teknolog
parents:
23
diff
changeset
|
756 |
HBufC *description = info->Description().AllocL(); |
2 | 757 |
|
24
ca50ea154990
Moved search result title to navipane. Fixed but 1832
teknolog
parents:
23
diff
changeset
|
758 |
CAknMessageQueryDialog* note = new ( ELeave ) CAknMessageQueryDialog( description, title ); |
2 | 759 |
|
760 |
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
|
761 |
note->RunLD(); |
2 | 762 |
} |
763 |
} |
|
764 |
||
350
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
765 |
void CPodcastShowsView::HandleDownloadAllL() |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
766 |
{ |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
767 |
|
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
768 |
TBuf<KMaxMessageLength> msg; |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
769 |
iEikonEnv->ReadResourceL(msg, R_DOWNLOAD_ALL_QUERY); |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
770 |
if (!ShowQueryMessageL(msg)) |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
771 |
{ |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
772 |
return; |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
773 |
} |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
774 |
|
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
775 |
for (int i=0;i<iPodcastModel.ActiveShowList().Count();i++) |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
776 |
{ |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
777 |
CShowInfo* info = iPodcastModel.ActiveShowList()[i]; |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
778 |
|
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
779 |
if (info->DownloadState() == ENotDownloaded) |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
780 |
{ |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
781 |
TRAP_IGNORE(iPodcastModel.ShowEngine().AddDownloadL(*info)); |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
782 |
} |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
783 |
} |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
784 |
} |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
785 |
|
13 | 786 |
void CPodcastShowsView::UpdateToolbar(TBool aVisible) |
2 | 787 |
{ |
788 |
CAknToolbar* toolbar = Toolbar(); |
|
13 | 789 |
|
23
cf4b850bbffb
Added macro SYMBIAN1_UI that toggles between single and double tap UI
teknolog
parents:
16
diff
changeset
|
790 |
if (toolbar) { |
cf4b850bbffb
Added macro SYMBIAN1_UI that toggles between single and double tap UI
teknolog
parents:
16
diff
changeset
|
791 |
if (iListContainer->IsVisible()) { |
cf4b850bbffb
Added macro SYMBIAN1_UI that toggles between single and double tap UI
teknolog
parents:
16
diff
changeset
|
792 |
toolbar->SetToolbarVisibility(aVisible); |
cf4b850bbffb
Added macro SYMBIAN1_UI that toggles between single and double tap UI
teknolog
parents:
16
diff
changeset
|
793 |
} |
2 | 794 |
|
156
48cdb40709e7
Fix for bug 2819 - Crash when updating and connection set to "Always ask"
teknolog
parents:
136
diff
changeset
|
795 |
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
|
796 |
iPodcastModel.FeedEngine().ActiveClientUid() == iPodcastModel.ActiveFeedInfo()->Uid(); |
14
4e75731546eb
Fix so toolbars only change visibility for the visible view
teknolog
parents:
13
diff
changeset
|
797 |
|
347
b8d687bb7ca1
Experimenting with adding a new view to list all new shows
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
336
diff
changeset
|
798 |
if (iShowNewShows) |
b8d687bb7ca1
Experimenting with adding a new view to list all new shows
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
336
diff
changeset
|
799 |
{ |
b8d687bb7ca1
Experimenting with adding a new view to list all new shows
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
336
diff
changeset
|
800 |
updatingState = iPodcastModel.FeedEngine().ClientState(); |
b8d687bb7ca1
Experimenting with adding a new view to list all new shows
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
336
diff
changeset
|
801 |
toolbar->HideItem(EPodcastUpdateFeed, ETrue, ETrue ); |
b8d687bb7ca1
Experimenting with adding a new view to list all new shows
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
336
diff
changeset
|
802 |
toolbar->HideItem(EPodcastUpdateAllFeeds, updatingState, ETrue ); |
b8d687bb7ca1
Experimenting with adding a new view to list all new shows
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
336
diff
changeset
|
803 |
} |
b8d687bb7ca1
Experimenting with adding a new view to list all new shows
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
336
diff
changeset
|
804 |
else |
b8d687bb7ca1
Experimenting with adding a new view to list all new shows
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
336
diff
changeset
|
805 |
{ |
b8d687bb7ca1
Experimenting with adding a new view to list all new shows
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
336
diff
changeset
|
806 |
toolbar->HideItem(EPodcastUpdateFeed, updatingState, ETrue ); |
b8d687bb7ca1
Experimenting with adding a new view to list all new shows
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
336
diff
changeset
|
807 |
toolbar->HideItem(EPodcastUpdateAllFeeds, ETrue, ETrue ); |
b8d687bb7ca1
Experimenting with adding a new view to list all new shows
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
336
diff
changeset
|
808 |
} |
b8d687bb7ca1
Experimenting with adding a new view to list all new shows
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
336
diff
changeset
|
809 |
|
23
cf4b850bbffb
Added macro SYMBIAN1_UI that toggles between single and double tap UI
teknolog
parents:
16
diff
changeset
|
810 |
toolbar->HideItem(EPodcastCancelUpdateAllFeeds, !updatingState, ETrue ); |
350
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
811 |
toolbar->HideItem(EPodcastDownloadAll, !iShowNewShows, ETrue); |
352
31f9864a37ac
Various fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
350
diff
changeset
|
812 |
toolbar->HideItem(EPodcastMarkAllPlayed, !iShowNewShows, ETrue ); |
347
b8d687bb7ca1
Experimenting with adding a new view to list all new shows
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
336
diff
changeset
|
813 |
|
350
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
814 |
if (iShowNewShows) |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
815 |
{ |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
816 |
toolbar->HideItem(EPodcastDownloadShow, ETrue, ETrue ); |
352
31f9864a37ac
Various fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
350
diff
changeset
|
817 |
toolbar->HideItem(EPodcastDownloadShow, ETrue, ETrue ); |
31f9864a37ac
Various fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
350
diff
changeset
|
818 |
toolbar->HideItem(EPodcastDeleteShow, ETrue, ETrue); |
31f9864a37ac
Various fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
350
diff
changeset
|
819 |
toolbar->HideItem(EPodcastMarkAsPlayed, ETrue, ETrue ); |
31f9864a37ac
Various fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
350
diff
changeset
|
820 |
toolbar->HideItem(EPodcastMarkAsUnplayed, ETrue, ETrue ); |
350
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
821 |
|
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
822 |
TBool showDownloadAll = EFalse; |
354
a2713e6a41a9
Further UI tweaks
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
352
diff
changeset
|
823 |
TInt count = iPodcastModel.ActiveShowList().Count(); |
a2713e6a41a9
Further UI tweaks
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
352
diff
changeset
|
824 |
for (int i=0;i<count;i++) |
350
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
825 |
{ |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
826 |
CShowInfo* info = iPodcastModel.ActiveShowList()[i]; |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
827 |
if (info->DownloadState() == ENotDownloaded) |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
828 |
{ |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
829 |
showDownloadAll = ETrue; |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
830 |
} |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
831 |
} |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
832 |
|
354
a2713e6a41a9
Further UI tweaks
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
352
diff
changeset
|
833 |
toolbar->SetItemDimmed(EPodcastMarkAllPlayed, !count, ETrue); |
350
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
834 |
toolbar->SetItemDimmed(EPodcastDownloadAll, !showDownloadAll, ETrue); |
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
835 |
} |
352
31f9864a37ac
Various fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
350
diff
changeset
|
836 |
else |
31f9864a37ac
Various fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
350
diff
changeset
|
837 |
{ |
31f9864a37ac
Various fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
350
diff
changeset
|
838 |
RShowInfoArray &fItems = iPodcastModel.ActiveShowList(); |
31f9864a37ac
Various fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
350
diff
changeset
|
839 |
TInt itemCnt = fItems.Count(); |
350
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
840 |
|
352
31f9864a37ac
Various fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
350
diff
changeset
|
841 |
TBool hideDownloadShowCmd = EFalse; |
31f9864a37ac
Various fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
350
diff
changeset
|
842 |
TBool dimDownloadShowCmd = EFalse; |
31f9864a37ac
Various fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
350
diff
changeset
|
843 |
TBool hideSetPlayed = EFalse; |
31f9864a37ac
Various fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
350
diff
changeset
|
844 |
|
31f9864a37ac
Various fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
350
diff
changeset
|
845 |
if(iListContainer->Listbox() != NULL) |
350
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
846 |
{ |
352
31f9864a37ac
Various fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
350
diff
changeset
|
847 |
TInt index = iListContainer->Listbox()->CurrentItemIndex(); |
31f9864a37ac
Various fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
350
diff
changeset
|
848 |
|
31f9864a37ac
Various fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
350
diff
changeset
|
849 |
if(index>= 0 && index < itemCnt) |
31f9864a37ac
Various fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
350
diff
changeset
|
850 |
{ |
31f9864a37ac
Various fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
350
diff
changeset
|
851 |
switch(fItems[index]->DownloadState()) |
31f9864a37ac
Various fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
350
diff
changeset
|
852 |
{ |
31f9864a37ac
Various fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
350
diff
changeset
|
853 |
case ENotDownloaded: |
31f9864a37ac
Various fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
350
diff
changeset
|
854 |
case EFailedDownload: |
31f9864a37ac
Various fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
350
diff
changeset
|
855 |
hideDownloadShowCmd = EFalse; |
31f9864a37ac
Various fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
350
diff
changeset
|
856 |
dimDownloadShowCmd = EFalse; |
31f9864a37ac
Various fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
350
diff
changeset
|
857 |
break; |
31f9864a37ac
Various fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
350
diff
changeset
|
858 |
case EQueued: |
31f9864a37ac
Various fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
350
diff
changeset
|
859 |
case EDownloading: |
31f9864a37ac
Various fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
350
diff
changeset
|
860 |
hideDownloadShowCmd = EFalse; |
31f9864a37ac
Various fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
350
diff
changeset
|
861 |
dimDownloadShowCmd = ETrue; |
31f9864a37ac
Various fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
350
diff
changeset
|
862 |
break; |
31f9864a37ac
Various fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
350
diff
changeset
|
863 |
case EDownloaded: |
31f9864a37ac
Various fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
350
diff
changeset
|
864 |
hideDownloadShowCmd = ETrue; |
31f9864a37ac
Various fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
350
diff
changeset
|
865 |
break; |
31f9864a37ac
Various fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
350
diff
changeset
|
866 |
} |
31f9864a37ac
Various fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
350
diff
changeset
|
867 |
|
31f9864a37ac
Various fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
350
diff
changeset
|
868 |
if(fItems[index]->PlayState() == EPlayed) { |
31f9864a37ac
Various fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
350
diff
changeset
|
869 |
hideSetPlayed = ETrue; |
350
9c4fd008e20f
Updated icons and other UI fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
348
diff
changeset
|
870 |
} |
23
cf4b850bbffb
Added macro SYMBIAN1_UI that toggles between single and double tap UI
teknolog
parents:
16
diff
changeset
|
871 |
} |
352
31f9864a37ac
Various fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
350
diff
changeset
|
872 |
} |
31f9864a37ac
Various fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
350
diff
changeset
|
873 |
|
31f9864a37ac
Various fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
350
diff
changeset
|
874 |
if (hideDownloadShowCmd) { |
31f9864a37ac
Various fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
350
diff
changeset
|
875 |
toolbar->HideItem(EPodcastDownloadShow, ETrue, ETrue ); |
31f9864a37ac
Various fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
350
diff
changeset
|
876 |
toolbar->HideItem(EPodcastDeleteShow, EFalse, ETrue); |
31f9864a37ac
Various fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
350
diff
changeset
|
877 |
toolbar->SetItemDimmed(EPodcastDeleteShow, updatingState , ETrue); |
31f9864a37ac
Various fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
350
diff
changeset
|
878 |
} else { |
31f9864a37ac
Various fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
350
diff
changeset
|
879 |
toolbar->HideItem(EPodcastDownloadShow, EFalse, ETrue ); |
31f9864a37ac
Various fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
350
diff
changeset
|
880 |
toolbar->HideItem(EPodcastDeleteShow, ETrue, ETrue); |
31f9864a37ac
Various fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
350
diff
changeset
|
881 |
toolbar->SetItemDimmed(EPodcastDownloadShow, updatingState || dimDownloadShowCmd || !itemCnt, ETrue); |
31f9864a37ac
Various fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
350
diff
changeset
|
882 |
} |
31f9864a37ac
Various fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
350
diff
changeset
|
883 |
|
31f9864a37ac
Various fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
350
diff
changeset
|
884 |
if (hideSetPlayed) { |
31f9864a37ac
Various fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
350
diff
changeset
|
885 |
toolbar->HideItem(EPodcastMarkAsPlayed, ETrue, ETrue ); |
31f9864a37ac
Various fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
350
diff
changeset
|
886 |
toolbar->HideItem(EPodcastMarkAsUnplayed, EFalse, ETrue ); |
31f9864a37ac
Various fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
350
diff
changeset
|
887 |
toolbar->SetItemDimmed(EPodcastMarkAsUnplayed, updatingState, ETrue); |
31f9864a37ac
Various fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
350
diff
changeset
|
888 |
} else { |
31f9864a37ac
Various fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
350
diff
changeset
|
889 |
toolbar->HideItem(EPodcastMarkAsPlayed, EFalse, ETrue ); |
31f9864a37ac
Various fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
350
diff
changeset
|
890 |
toolbar->HideItem(EPodcastMarkAsUnplayed, ETrue, ETrue ); |
31f9864a37ac
Various fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
350
diff
changeset
|
891 |
toolbar->SetItemDimmed(EPodcastMarkAsPlayed, updatingState|| !itemCnt, ETrue); |
31f9864a37ac
Various fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
350
diff
changeset
|
892 |
} |
31f9864a37ac
Various fixes
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
350
diff
changeset
|
893 |
} |
2 | 894 |
} |
895 |
} |
|
896 |
||
897 |
void CPodcastShowsView::HandleLongTapEventL( const TPoint& aPenEventLocation, const TPoint& /* aPenEventScreenLocation */) |
|
898 |
{ |
|
899 |
DP("CPodcastShowsView::HandleLongTapEventL BEGIN"); |
|
28 | 900 |
|
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
28
diff
changeset
|
901 |
iListContainer->SetLongTapDetectedL(ETrue); |
28 | 902 |
|
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
|
903 |
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
|
904 |
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
|
905 |
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
|
906 |
|
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
|
907 |
if(iStylusPopupMenu && aPenEventLocation.iY < lbHeight) |
2 | 908 |
{ |
909 |
TInt index = iListContainer->Listbox()->CurrentItemIndex(); |
|
910 |
if (index >= 0 && index < iPodcastModel.ActiveShowList().Count()) |
|
911 |
{ |
|
912 |
CShowInfo *info = iPodcastModel.ActiveShowList()[index]; |
|
913 |
TBool hideDownloadShowCmd = info->DownloadState() != ENotDownloaded; |
|
914 |
TBool hideDeleteShowCmd = info->DownloadState() != EDownloaded; |
|
915 |
TBool hideMarkOld = info->PlayState() == EPlayed; |
|
916 |
||
373
f5de49b27caf
Popup menus tweaked
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
364
diff
changeset
|
917 |
iStylusPopupMenu->SetItemDimmed(EPodcastMarkAsPlayed, hideMarkOld); |
f5de49b27caf
Popup menus tweaked
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
364
diff
changeset
|
918 |
iStylusPopupMenu->SetItemDimmed(EPodcastMarkAsUnplayed, !hideMarkOld); |
2 | 919 |
|
920 |
iStylusPopupMenu->SetItemDimmed(EPodcastDownloadShow, hideDownloadShowCmd); |
|
921 |
iStylusPopupMenu->SetItemDimmed(EPodcastDeleteShow, hideDeleteShowCmd); |
|
922 |
} |
|
923 |
||
924 |
iStylusPopupMenu->ShowMenu(); |
|
925 |
iStylusPopupMenu->SetPosition(aPenEventLocation); |
|
926 |
} |
|
927 |
DP("CPodcastShowsView::HandleLongTapEventL END"); |
|
928 |
} |
|
929 |
||
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
28
diff
changeset
|
930 |
void CPodcastShowsView::HandleSetShowPlayedL(TBool aPlayed) |
2 | 931 |
{ |
932 |
||
933 |
TInt index = iListContainer->Listbox()->CurrentItemIndex(); |
|
934 |
||
935 |
if (index >= 0 && index < iPodcastModel.ActiveShowList().Count()) |
|
936 |
{ |
|
937 |
CShowInfo *info = iPodcastModel.ActiveShowList()[index]; |
|
938 |
info->SetPlayState(aPlayed ? EPlayed : ENeverPlayed); |
|
354
a2713e6a41a9
Further UI tweaks
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
352
diff
changeset
|
939 |
if (aPlayed) |
a2713e6a41a9
Further UI tweaks
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
352
diff
changeset
|
940 |
{ |
a2713e6a41a9
Further UI tweaks
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
352
diff
changeset
|
941 |
// PostPlayHandling calls UpdateShow, which is slow, so we don't need to do it again |
a2713e6a41a9
Further UI tweaks
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
352
diff
changeset
|
942 |
iPodcastModel.ShowEngine().PostPlayHandling(info); |
a2713e6a41a9
Further UI tweaks
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
352
diff
changeset
|
943 |
} |
a2713e6a41a9
Further UI tweaks
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
352
diff
changeset
|
944 |
else |
a2713e6a41a9
Further UI tweaks
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
352
diff
changeset
|
945 |
{ |
a2713e6a41a9
Further UI tweaks
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
352
diff
changeset
|
946 |
iPodcastModel.ShowEngine().UpdateShowL(*info); |
a2713e6a41a9
Further UI tweaks
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
352
diff
changeset
|
947 |
} |
a2713e6a41a9
Further UI tweaks
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
352
diff
changeset
|
948 |
|
a2713e6a41a9
Further UI tweaks
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
352
diff
changeset
|
949 |
if (iShowNewShows) |
a2713e6a41a9
Further UI tweaks
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
352
diff
changeset
|
950 |
{ |
a2713e6a41a9
Further UI tweaks
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
352
diff
changeset
|
951 |
UpdateListboxItemsL(); |
a2713e6a41a9
Further UI tweaks
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
352
diff
changeset
|
952 |
|
a2713e6a41a9
Further UI tweaks
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
352
diff
changeset
|
953 |
if (index > 0) |
a2713e6a41a9
Further UI tweaks
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
352
diff
changeset
|
954 |
{ |
a2713e6a41a9
Further UI tweaks
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
352
diff
changeset
|
955 |
iListContainer->Listbox()->SetCurrentItemIndex(index - 1); |
a2713e6a41a9
Further UI tweaks
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
352
diff
changeset
|
956 |
} |
a2713e6a41a9
Further UI tweaks
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
352
diff
changeset
|
957 |
} |
a2713e6a41a9
Further UI tweaks
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
352
diff
changeset
|
958 |
else |
a2713e6a41a9
Further UI tweaks
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
352
diff
changeset
|
959 |
{ |
a2713e6a41a9
Further UI tweaks
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
352
diff
changeset
|
960 |
UpdateShowItemDataL(iPodcastModel.ActiveShowList()[index], index, 0); |
a2713e6a41a9
Further UI tweaks
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
352
diff
changeset
|
961 |
iListContainer->Listbox()->DrawItem(index); |
a2713e6a41a9
Further UI tweaks
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
352
diff
changeset
|
962 |
} |
2 | 963 |
} |
964 |
} |
|
965 |
||
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
28
diff
changeset
|
966 |
void CPodcastShowsView::HandleDeleteShowL() |
2 | 967 |
{ |
968 |
TInt index = iListContainer->Listbox()->CurrentItemIndex(); |
|
969 |
||
970 |
if (index >= 0 && index < iPodcastModel.ActiveShowList().Count()) |
|
971 |
{ |
|
972 |
CShowInfo *info = iPodcastModel.ActiveShowList()[index]; |
|
973 |
TBuf<KMaxMessageLength> msg; |
|
974 |
TBuf<KMaxMessageLength> templ; |
|
975 |
iEikonEnv->ReadResourceL(templ, R_PODCAST_DELETE_SHOW_PROMPT); |
|
976 |
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
|
977 |
if (ShowQueryMessageL(msg)) |
2 | 978 |
{ |
979 |
iPodcastModel.ShowEngine().DeleteShowL(iPodcastModel.ActiveShowList()[index]->Uid()); |
|
980 |
||
981 |
// and mark as played, and not downloaded |
|
982 |
||
983 |
info->SetDownloadState(ENotDownloaded); |
|
984 |
info->SetPlayState(EPlayed); |
|
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
28
diff
changeset
|
985 |
iPodcastModel.ShowEngine().UpdateShowL(*info); |
377
684802056d6f
Fix so delete show in new shows list removes the show from the list
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
373
diff
changeset
|
986 |
|
684802056d6f
Fix so delete show in new shows list removes the show from the list
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
373
diff
changeset
|
987 |
if (iShowNewShows) |
684802056d6f
Fix so delete show in new shows list removes the show from the list
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
373
diff
changeset
|
988 |
{ |
684802056d6f
Fix so delete show in new shows list removes the show from the list
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
373
diff
changeset
|
989 |
UpdateListboxItemsL(); |
684802056d6f
Fix so delete show in new shows list removes the show from the list
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
373
diff
changeset
|
990 |
|
684802056d6f
Fix so delete show in new shows list removes the show from the list
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
373
diff
changeset
|
991 |
if (index > 0) |
684802056d6f
Fix so delete show in new shows list removes the show from the list
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
373
diff
changeset
|
992 |
{ |
684802056d6f
Fix so delete show in new shows list removes the show from the list
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
373
diff
changeset
|
993 |
iListContainer->Listbox()->SetCurrentItemIndex(index - 1); |
684802056d6f
Fix so delete show in new shows list removes the show from the list
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
373
diff
changeset
|
994 |
} |
684802056d6f
Fix so delete show in new shows list removes the show from the list
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
373
diff
changeset
|
995 |
} |
684802056d6f
Fix so delete show in new shows list removes the show from the list
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
373
diff
changeset
|
996 |
else |
684802056d6f
Fix so delete show in new shows list removes the show from the list
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
373
diff
changeset
|
997 |
{ |
684802056d6f
Fix so delete show in new shows list removes the show from the list
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
373
diff
changeset
|
998 |
UpdateShowItemDataL(iPodcastModel.ActiveShowList()[index], index, 0); |
684802056d6f
Fix so delete show in new shows list removes the show from the list
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
373
diff
changeset
|
999 |
iListContainer->Listbox()->DrawItem(index); |
684802056d6f
Fix so delete show in new shows list removes the show from the list
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
373
diff
changeset
|
1000 |
} |
2 | 1001 |
} |
1002 |
} |
|
1003 |
} |
|
1004 |
||
16 | 1005 |
void CPodcastShowsView::DownloadQueueUpdatedL(TInt aDownloadingShows, TInt aQueuedShows) |
2 | 1006 |
{ |
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
28
diff
changeset
|
1007 |
((CPodcastAppUi*)AppUi())->UpdateQueueTabL(aDownloadingShows+aQueuedShows); |
34 | 1008 |
UpdateListboxItemsL(); |
2 | 1009 |
} |
1010 |
||
1011 |
void CPodcastShowsView::FeedUpdateAllCompleteL(TFeedState /*aState*/) |
|
1012 |
{ |
|
1013 |
UpdateListboxItemsL(); |
|
1014 |
UpdateToolbar(); |
|
1015 |
} |
|
1016 |
||
1017 |
void CPodcastShowsView::UpdateViewTitleL() |
|
1018 |
{ |
|
1019 |
DP("CPodcastShowsView::UpdateViewTitleL BEGIN"); |
|
1020 |
CAknTitlePane* titlePane = static_cast<CAknTitlePane*> |
|
1021 |
( StatusPane()->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) ); |
|
1022 |
||
347
b8d687bb7ca1
Experimenting with adding a new view to list all new shows
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
336
diff
changeset
|
1023 |
TBool updatingState = iPodcastModel.FeedEngine().ClientState() != EIdle && iPodcastModel.ActiveFeedInfo() && |
2 | 1024 |
iPodcastModel.FeedEngine().ActiveClientUid() == iPodcastModel.ActiveFeedInfo()->Uid(); |
1025 |
||
1026 |
if (updatingState) { |
|
1027 |
SetEmptyTextL(R_PODCAST_EMPTY_LIST_UPDATING); |
|
1028 |
} else { |
|
1029 |
SetEmptyTextL(R_PODCAST_EMPTY_LIST); |
|
1030 |
} |
|
1031 |
||
347
b8d687bb7ca1
Experimenting with adding a new view to list all new shows
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
336
diff
changeset
|
1032 |
if(iShowNewShows) |
b8d687bb7ca1
Experimenting with adding a new view to list all new shows
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
336
diff
changeset
|
1033 |
{ |
b8d687bb7ca1
Experimenting with adding a new view to list all new shows
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
336
diff
changeset
|
1034 |
HBufC *title = iEikonEnv->AllocReadResourceLC(R_NEW_SHOWS); |
b8d687bb7ca1
Experimenting with adding a new view to list all new shows
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
336
diff
changeset
|
1035 |
titlePane->SetTextL(*title); |
b8d687bb7ca1
Experimenting with adding a new view to list all new shows
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
336
diff
changeset
|
1036 |
CleanupStack::PopAndDestroy(title); |
b8d687bb7ca1
Experimenting with adding a new view to list all new shows
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
336
diff
changeset
|
1037 |
} |
b8d687bb7ca1
Experimenting with adding a new view to list all new shows
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
336
diff
changeset
|
1038 |
else if(iPodcastModel.ActiveFeedInfo()) |
2 | 1039 |
{ |
1040 |
if (iPodcastModel.ActiveFeedInfo()->Title() != KNullDesC) |
|
1041 |
{ |
|
1042 |
titlePane->SetTextL( iPodcastModel.ActiveFeedInfo()->Title(), ETrue ); |
|
1043 |
} |
|
1044 |
} |
|
1045 |
else |
|
1046 |
{ |
|
1047 |
titlePane->SetTextToDefaultL(); |
|
1048 |
} |
|
1049 |
||
1050 |
DP("CPodcastShowsView::UpdateViewTitleL END"); |
|
1051 |
} |