author | Sebastian Brannstrom <sebastianb@symbian.org> |
Thu, 21 Oct 2010 21:36:03 +0100 | |
branch | 3rded |
changeset 262 | 81bb9210fd4c |
parent 186 | 32aedca70582 |
child 280 | 001f04bc4964 |
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 "PodcastQueueView.h" |
|
20 |
#include "PodcastAppUi.h" |
|
21 |
#include "ShowEngine.h" |
|
22 |
#include "SettingsEngine.h" |
|
23 |
#include "PodcastApp.h" |
|
24 |
#include "Constants.h" |
|
25 |
#include "imagehandler.h" |
|
26 |
#include "PodcastShowsView.h" |
|
27 |
||
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 |
||
38 |
CPodcastQueueView* CPodcastQueueView::NewL(CPodcastModel& aPodcastModel) |
|
39 |
{ |
|
40 |
CPodcastQueueView* self = CPodcastQueueView::NewLC(aPodcastModel); |
|
41 |
CleanupStack::Pop(self); |
|
42 |
return self; |
|
43 |
} |
|
44 |
||
45 |
CPodcastQueueView* CPodcastQueueView::NewLC(CPodcastModel& aPodcastModel) |
|
46 |
{ |
|
47 |
CPodcastQueueView* self = new ( ELeave ) CPodcastQueueView(aPodcastModel); |
|
48 |
CleanupStack::PushL(self); |
|
49 |
self->ConstructL(); |
|
50 |
return self; |
|
51 |
} |
|
52 |
||
53 |
CPodcastQueueView::CPodcastQueueView(CPodcastModel& aPodcastModel) : |
|
60 | 54 |
CPodcastShowsView(aPodcastModel) |
2 | 55 |
{ |
56 |
} |
|
57 |
||
58 |
void CPodcastQueueView::ConstructL() |
|
59 |
{ |
|
60 |
BaseConstructL(R_PODCAST_QUEUEVIEW); |
|
61 |
CPodcastListView::ConstructL(); |
|
60 | 62 |
|
63 |
CreateIconsL(); |
|
64 |
||
2 | 65 |
iListContainer->Listbox()->SetListBoxObserver(this); |
66 |
||
67 |
iPodcastModel.FeedEngine().AddObserver(this); |
|
68 |
iPodcastModel.ShowEngine().AddObserver(this); |
|
69 |
||
70 |
SetEmptyTextL(R_PODCAST_EMPTY_QUEUE); |
|
71 |
} |
|
72 |
||
73 |
TKeyResponse CPodcastQueueView::OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType) |
|
74 |
{ |
|
75 |
if (aType == EEventKey) |
|
76 |
{ |
|
77 |
CShowInfo *activeShow = NULL; |
|
78 |
||
79 |
TInt index = iListContainer->Listbox()->CurrentItemIndex(); |
|
80 |
if(index >= 0 && index < iPodcastModel.ActiveShowList().Count()) |
|
81 |
{ |
|
82 |
activeShow = iPodcastModel.ActiveShowList()[index]; |
|
83 |
} |
|
84 |
||
85 |
if (activeShow != NULL) { |
|
86 |
DP1("aKeyEvent.iCode=%d", aKeyEvent.iCode); |
|
87 |
switch (aKeyEvent.iCode) { |
|
88 |
case EKeyBackspace: |
|
89 |
case EKeyDelete: |
|
90 |
HandleCommandL(EPodcastRemoveDownload); |
|
91 |
break; |
|
92 |
default: |
|
93 |
break; |
|
94 |
} |
|
95 |
} |
|
96 |
} |
|
97 |
return CPodcastListView::OfferKeyEventL(aKeyEvent, aType); |
|
98 |
} |
|
99 |
||
100 |
CPodcastQueueView::~CPodcastQueueView() |
|
101 |
{ |
|
102 |
iPodcastModel.ShowEngine().RemoveObserver(this); |
|
103 |
iPodcastModel.FeedEngine().RemoveObserver(this); |
|
104 |
} |
|
105 |
||
106 |
||
107 |
TUid CPodcastQueueView::Id() const |
|
108 |
{ |
|
109 |
return KUidPodcastQueueViewID; |
|
110 |
} |
|
111 |
||
112 |
void CPodcastQueueView::DoActivateL(const TVwsViewId& aPrevViewId, |
|
113 |
TUid aCustomMessageId, const TDesC8& aCustomMessage) |
|
114 |
{ |
|
115 |
DP("CPodcastQueueView::DoActivateL BEGIN"); |
|
116 |
||
117 |
CPodcastListView::DoActivateL(aPrevViewId, aCustomMessageId, aCustomMessage); |
|
45
56d4e0784e5d
Nicer way to handle back from queue view to feed/show view
teknolog
parents:
36
diff
changeset
|
118 |
iPreviousView = aPrevViewId; |
2 | 119 |
|
120 |
UpdateFeedUpdateStateL(); |
|
121 |
DP("CPodcastQueueView::DoActivateL END"); |
|
122 |
} |
|
123 |
||
124 |
void CPodcastQueueView::DoDeactivate() |
|
125 |
{ |
|
126 |
CPodcastListView::DoDeactivate(); |
|
127 |
} |
|
128 |
||
129 |
void CPodcastQueueView::HandleListBoxEventL(CEikListBox* /*aListBox*/, |
|
130 |
TListBoxEvent aEventType) |
|
131 |
{ |
|
132 |
switch (aEventType) |
|
133 |
{ |
|
134 |
case EEventEnterKeyPressed: |
|
135 |
case EEventItemActioned: |
|
136 |
case EEventItemDoubleClicked: |
|
137 |
break; |
|
138 |
default: |
|
139 |
break; |
|
140 |
} |
|
141 |
} |
|
142 |
||
143 |
void CPodcastQueueView::UpdateListboxItemsL() |
|
144 |
{ |
|
186
32aedca70582
Merged queue view fix from 5th; merged Spanish language support; Updated SIS 0.90(4).
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
145 |
if (iListContainer->IsVisible() && !iDontUpdateList) |
2 | 146 |
{ |
147 |
TListItemProperties itemProps; |
|
148 |
TInt len = 0; |
|
149 |
||
8 | 150 |
iPodcastModel.GetShowsDownloadingL(); |
2 | 151 |
|
152 |
RShowInfoArray &fItems = iPodcastModel.ActiveShowList(); |
|
153 |
len = fItems.Count(); |
|
154 |
||
155 |
if (iListContainer->Listbox() != NULL) |
|
156 |
{ |
|
157 |
TBool allUidsMatch = EFalse; |
|
158 |
||
159 |
if (len == iListContainer->Listbox()->Model()->NumberOfItems()) |
|
160 |
{ |
|
161 |
allUidsMatch = ETrue; |
|
162 |
TUint itemId = 0; |
|
163 |
for (TInt loop = 0; loop< len; loop++) |
|
164 |
{ |
|
165 |
itemId = iItemIdArray[loop]; |
|
166 |
if (fItems[loop]->Uid() != itemId) |
|
167 |
{ |
|
168 |
allUidsMatch = EFalse; |
|
169 |
break; |
|
170 |
} |
|
171 |
} |
|
172 |
} |
|
173 |
||
174 |
if (allUidsMatch && len > 0) |
|
175 |
{ |
|
176 |
for (TInt loop = 0; loop< len; loop++) |
|
177 |
{ |
|
178 |
UpdateShowItemDataL(fItems[loop], loop); |
|
179 |
iListContainer->Listbox()->DrawItem(loop); |
|
180 |
} |
|
181 |
} |
|
182 |
else |
|
183 |
{ |
|
184 |
iListContainer->Listbox()->ItemDrawer()->ClearAllPropertiesL(); |
|
185 |
iListContainer->Listbox()->Reset(); |
|
186 |
iItemIdArray.Reset(); |
|
187 |
iItemArray->Reset(); |
|
188 |
||
189 |
if (len > 0) |
|
190 |
{ |
|
191 |
for (TInt i=0; i<len; i++) |
|
192 |
{ |
|
193 |
CShowInfo *si = fItems[i]; |
|
194 |
FormatShowInfoListBoxItemL(*si); |
|
195 |
iItemIdArray.Append(si->Uid()); |
|
196 |
iItemArray->AppendL(iListboxFormatbuffer); |
|
197 |
} |
|
198 |
} |
|
199 |
else |
|
200 |
{ |
|
201 |
iItemArray->Reset(); |
|
202 |
iItemIdArray.Reset(); |
|
203 |
||
204 |
itemProps.SetDimmed(ETrue); |
|
205 |
itemProps.SetHiddenSelection(ETrue); |
|
206 |
} |
|
207 |
iListContainer->Listbox()->HandleItemAdditionL(); |
|
208 |
} |
|
209 |
} |
|
210 |
} |
|
211 |
} |
|
212 |
||
213 |
/** |
|
214 |
* Command handling function intended for overriding by sub classes. |
|
215 |
* Default implementation is empty. |
|
216 |
* @param aCommand ID of the command to respond to. |
|
217 |
*/ |
|
218 |
void CPodcastQueueView::HandleCommandL(TInt aCommand) |
|
219 |
{ |
|
220 |
switch (aCommand) |
|
221 |
{ |
|
222 |
case EPodcastRemoveAllDownloads: |
|
223 |
{ |
|
224 |
TBuf<KMaxMessageLength> msg; |
|
225 |
iEikonEnv->ReadResourceL(msg, R_CLEAR_QUERY); |
|
226 |
||
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
23
diff
changeset
|
227 |
if(ShowQueryMessageL(msg)) |
2 | 228 |
{ |
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
23
diff
changeset
|
229 |
iPodcastModel.ShowEngine().RemoveAllDownloadsL(); |
2 | 230 |
UpdateListboxItemsL(); |
231 |
} |
|
232 |
} |
|
233 |
break; |
|
234 |
case EPodcastRemoveDownload: |
|
235 |
{ |
|
236 |
TInt index = iListContainer->Listbox()->CurrentItemIndex(); |
|
237 |
if (index >= 0 && index < iPodcastModel.ActiveShowList().Count()) |
|
238 |
{ |
|
186
32aedca70582
Merged queue view fix from 5th; merged Spanish language support; Updated SIS 0.90(4).
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
239 |
// this is an ugly hack to prevent UpdateListboxItemsL from being |
32aedca70582
Merged queue view fix from 5th; merged Spanish language support; Updated SIS 0.90(4).
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
240 |
// triggered from the show engine, which causes focus to jump |
32aedca70582
Merged queue view fix from 5th; merged Spanish language support; Updated SIS 0.90(4).
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
241 |
// around in an ugly fashion |
32aedca70582
Merged queue view fix from 5th; merged Spanish language support; Updated SIS 0.90(4).
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
242 |
iDontUpdateList = ETrue; |
60 | 243 |
TRAP_IGNORE(iPodcastModel.ShowEngine().RemoveDownloadL(iPodcastModel.ActiveShowList()[index]->Uid())); |
186
32aedca70582
Merged queue view fix from 5th; merged Spanish language support; Updated SIS 0.90(4).
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
244 |
iDontUpdateList = EFalse; |
32aedca70582
Merged queue view fix from 5th; merged Spanish language support; Updated SIS 0.90(4).
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
245 |
} |
32aedca70582
Merged queue view fix from 5th; merged Spanish language support; Updated SIS 0.90(4).
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
246 |
UpdateListboxItemsL(); |
32aedca70582
Merged queue view fix from 5th; merged Spanish language support; Updated SIS 0.90(4).
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
247 |
if (index > 0) |
32aedca70582
Merged queue view fix from 5th; merged Spanish language support; Updated SIS 0.90(4).
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
248 |
{ |
32aedca70582
Merged queue view fix from 5th; merged Spanish language support; Updated SIS 0.90(4).
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
249 |
iListContainer->Listbox()->SetCurrentItemIndex(index - 1); |
2 | 250 |
} |
251 |
} |
|
252 |
break; |
|
145
cc0182a5da39
Fix for Bug 2604 and bulk of the work towards implementing Bug 2737
Brendan Donegan <brendand@symbian.org>
parents:
70
diff
changeset
|
253 |
case EPodcastMoveDownloadUp: |
cc0182a5da39
Fix for Bug 2604 and bulk of the work towards implementing Bug 2737
Brendan Donegan <brendand@symbian.org>
parents:
70
diff
changeset
|
254 |
{ |
cc0182a5da39
Fix for Bug 2604 and bulk of the work towards implementing Bug 2737
Brendan Donegan <brendand@symbian.org>
parents:
70
diff
changeset
|
255 |
TInt index = iListContainer->Listbox()->CurrentItemIndex(); |
149
70b2f592a460
Enabled Brendan's download queue operations; Fixed minor bug in queue swapping method
teknolog
parents:
146
diff
changeset
|
256 |
TBool resumeAfterMove = EFalse; |
70b2f592a460
Enabled Brendan's download queue operations; Fixed minor bug in queue swapping method
teknolog
parents:
146
diff
changeset
|
257 |
if (index == 1 && !iPodcastModel.SettingsEngine().DownloadSuspended()) |
70b2f592a460
Enabled Brendan's download queue operations; Fixed minor bug in queue swapping method
teknolog
parents:
146
diff
changeset
|
258 |
{ |
70b2f592a460
Enabled Brendan's download queue operations; Fixed minor bug in queue swapping method
teknolog
parents:
146
diff
changeset
|
259 |
iPodcastModel.ShowEngine().SuspendDownloads(); |
70b2f592a460
Enabled Brendan's download queue operations; Fixed minor bug in queue swapping method
teknolog
parents:
146
diff
changeset
|
260 |
resumeAfterMove = ETrue; |
70b2f592a460
Enabled Brendan's download queue operations; Fixed minor bug in queue swapping method
teknolog
parents:
146
diff
changeset
|
261 |
} |
70b2f592a460
Enabled Brendan's download queue operations; Fixed minor bug in queue swapping method
teknolog
parents:
146
diff
changeset
|
262 |
|
145
cc0182a5da39
Fix for Bug 2604 and bulk of the work towards implementing Bug 2737
Brendan Donegan <brendand@symbian.org>
parents:
70
diff
changeset
|
263 |
if (index >= 0 && index < iPodcastModel.ActiveShowList().Count()) |
cc0182a5da39
Fix for Bug 2604 and bulk of the work towards implementing Bug 2737
Brendan Donegan <brendand@symbian.org>
parents:
70
diff
changeset
|
264 |
{ |
cc0182a5da39
Fix for Bug 2604 and bulk of the work towards implementing Bug 2737
Brendan Donegan <brendand@symbian.org>
parents:
70
diff
changeset
|
265 |
TRAP_IGNORE(iPodcastModel.ShowEngine().MoveDownloadUpL(iPodcastModel.ActiveShowList()[index]->Uid())); |
cc0182a5da39
Fix for Bug 2604 and bulk of the work towards implementing Bug 2737
Brendan Donegan <brendand@symbian.org>
parents:
70
diff
changeset
|
266 |
} |
149
70b2f592a460
Enabled Brendan's download queue operations; Fixed minor bug in queue swapping method
teknolog
parents:
146
diff
changeset
|
267 |
|
70b2f592a460
Enabled Brendan's download queue operations; Fixed minor bug in queue swapping method
teknolog
parents:
146
diff
changeset
|
268 |
if(resumeAfterMove) |
70b2f592a460
Enabled Brendan's download queue operations; Fixed minor bug in queue swapping method
teknolog
parents:
146
diff
changeset
|
269 |
{ |
70b2f592a460
Enabled Brendan's download queue operations; Fixed minor bug in queue swapping method
teknolog
parents:
146
diff
changeset
|
270 |
iPodcastModel.ShowEngine().ResumeDownloadsL(); |
70b2f592a460
Enabled Brendan's download queue operations; Fixed minor bug in queue swapping method
teknolog
parents:
146
diff
changeset
|
271 |
} |
70b2f592a460
Enabled Brendan's download queue operations; Fixed minor bug in queue swapping method
teknolog
parents:
146
diff
changeset
|
272 |
|
173
8466fe8528b6
Minor fix for highlight move in queue view
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
169
diff
changeset
|
273 |
UpdateListboxItemsL(); |
169
9c77455964f8
Improvement to queue shifting function - move the highlight too.
Brendan Donegan <brendand@symbian.org>
parents:
164
diff
changeset
|
274 |
iListContainer->Listbox()->SetCurrentItemIndex(index - 1); |
145
cc0182a5da39
Fix for Bug 2604 and bulk of the work towards implementing Bug 2737
Brendan Donegan <brendand@symbian.org>
parents:
70
diff
changeset
|
275 |
} |
cc0182a5da39
Fix for Bug 2604 and bulk of the work towards implementing Bug 2737
Brendan Donegan <brendand@symbian.org>
parents:
70
diff
changeset
|
276 |
break; |
cc0182a5da39
Fix for Bug 2604 and bulk of the work towards implementing Bug 2737
Brendan Donegan <brendand@symbian.org>
parents:
70
diff
changeset
|
277 |
case EPodcastMoveDownloadDown: |
cc0182a5da39
Fix for Bug 2604 and bulk of the work towards implementing Bug 2737
Brendan Donegan <brendand@symbian.org>
parents:
70
diff
changeset
|
278 |
{ |
cc0182a5da39
Fix for Bug 2604 and bulk of the work towards implementing Bug 2737
Brendan Donegan <brendand@symbian.org>
parents:
70
diff
changeset
|
279 |
TInt index = iListContainer->Listbox()->CurrentItemIndex(); |
149
70b2f592a460
Enabled Brendan's download queue operations; Fixed minor bug in queue swapping method
teknolog
parents:
146
diff
changeset
|
280 |
TBool resumeAfterMove = EFalse; |
70b2f592a460
Enabled Brendan's download queue operations; Fixed minor bug in queue swapping method
teknolog
parents:
146
diff
changeset
|
281 |
if (index == 0 && !iPodcastModel.SettingsEngine().DownloadSuspended()) |
70b2f592a460
Enabled Brendan's download queue operations; Fixed minor bug in queue swapping method
teknolog
parents:
146
diff
changeset
|
282 |
{ |
70b2f592a460
Enabled Brendan's download queue operations; Fixed minor bug in queue swapping method
teknolog
parents:
146
diff
changeset
|
283 |
iPodcastModel.ShowEngine().SuspendDownloads(); |
70b2f592a460
Enabled Brendan's download queue operations; Fixed minor bug in queue swapping method
teknolog
parents:
146
diff
changeset
|
284 |
resumeAfterMove = ETrue; |
70b2f592a460
Enabled Brendan's download queue operations; Fixed minor bug in queue swapping method
teknolog
parents:
146
diff
changeset
|
285 |
} |
70b2f592a460
Enabled Brendan's download queue operations; Fixed minor bug in queue swapping method
teknolog
parents:
146
diff
changeset
|
286 |
|
145
cc0182a5da39
Fix for Bug 2604 and bulk of the work towards implementing Bug 2737
Brendan Donegan <brendand@symbian.org>
parents:
70
diff
changeset
|
287 |
if (index >= 0 && index < iPodcastModel.ActiveShowList().Count()) |
cc0182a5da39
Fix for Bug 2604 and bulk of the work towards implementing Bug 2737
Brendan Donegan <brendand@symbian.org>
parents:
70
diff
changeset
|
288 |
{ |
cc0182a5da39
Fix for Bug 2604 and bulk of the work towards implementing Bug 2737
Brendan Donegan <brendand@symbian.org>
parents:
70
diff
changeset
|
289 |
TRAP_IGNORE(iPodcastModel.ShowEngine().MoveDownloadDownL(iPodcastModel.ActiveShowList()[index]->Uid())); |
cc0182a5da39
Fix for Bug 2604 and bulk of the work towards implementing Bug 2737
Brendan Donegan <brendand@symbian.org>
parents:
70
diff
changeset
|
290 |
} |
149
70b2f592a460
Enabled Brendan's download queue operations; Fixed minor bug in queue swapping method
teknolog
parents:
146
diff
changeset
|
291 |
|
70b2f592a460
Enabled Brendan's download queue operations; Fixed minor bug in queue swapping method
teknolog
parents:
146
diff
changeset
|
292 |
if(resumeAfterMove) |
70b2f592a460
Enabled Brendan's download queue operations; Fixed minor bug in queue swapping method
teknolog
parents:
146
diff
changeset
|
293 |
{ |
70b2f592a460
Enabled Brendan's download queue operations; Fixed minor bug in queue swapping method
teknolog
parents:
146
diff
changeset
|
294 |
iPodcastModel.ShowEngine().ResumeDownloadsL(); |
70b2f592a460
Enabled Brendan's download queue operations; Fixed minor bug in queue swapping method
teknolog
parents:
146
diff
changeset
|
295 |
} |
70b2f592a460
Enabled Brendan's download queue operations; Fixed minor bug in queue swapping method
teknolog
parents:
146
diff
changeset
|
296 |
|
145
cc0182a5da39
Fix for Bug 2604 and bulk of the work towards implementing Bug 2737
Brendan Donegan <brendand@symbian.org>
parents:
70
diff
changeset
|
297 |
UpdateListboxItemsL(); |
173
8466fe8528b6
Minor fix for highlight move in queue view
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
169
diff
changeset
|
298 |
iListContainer->Listbox()->SetCurrentItemIndex(index + 1); |
145
cc0182a5da39
Fix for Bug 2604 and bulk of the work towards implementing Bug 2737
Brendan Donegan <brendand@symbian.org>
parents:
70
diff
changeset
|
299 |
} |
cc0182a5da39
Fix for Bug 2604 and bulk of the work towards implementing Bug 2737
Brendan Donegan <brendand@symbian.org>
parents:
70
diff
changeset
|
300 |
break; |
2 | 301 |
case EPodcastSuspendDownloads: |
302 |
{ |
|
303 |
iPodcastModel.ShowEngine().SuspendDownloads(); |
|
304 |
UpdateListboxItemsL(); |
|
305 |
} |
|
306 |
break; |
|
307 |
case EPodcastResumeDownloads: |
|
308 |
{ |
|
309 |
iPodcastModel.ShowEngine().ResumeDownloadsL(); |
|
310 |
UpdateListboxItemsL(); |
|
311 |
} |
|
312 |
break; |
|
313 |
default: |
|
314 |
CPodcastListView::HandleCommandL(aCommand); |
|
315 |
break; |
|
316 |
} |
|
317 |
} |
|
318 |
||
319 |
void CPodcastQueueView::DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane) |
|
145
cc0182a5da39
Fix for Bug 2604 and bulk of the work towards implementing Bug 2737
Brendan Donegan <brendand@symbian.org>
parents:
70
diff
changeset
|
320 |
{ |
177
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
175
diff
changeset
|
321 |
if(aResourceId == R_QUEUE_SHOW_MENU) |
2 | 322 |
{ |
177
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
175
diff
changeset
|
323 |
TBool dimDown = (iListContainer->Listbox()->CurrentItemIndex() >= iPodcastModel.ActiveShowList().Count() - 1 ? |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
175
diff
changeset
|
324 |
ETrue : EFalse); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
175
diff
changeset
|
325 |
TBool dimUp = (iListContainer->Listbox()->CurrentItemIndex() <= 0 ? |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
175
diff
changeset
|
326 |
ETrue : EFalse); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
175
diff
changeset
|
327 |
|
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
175
diff
changeset
|
328 |
aMenuPane->SetItemDimmed(EPodcastMoveDownloadDown, dimDown); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
175
diff
changeset
|
329 |
aMenuPane->SetItemDimmed(EPodcastMoveDownloadUp, dimUp); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
175
diff
changeset
|
330 |
} |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
175
diff
changeset
|
331 |
else if (aResourceId == R_PODCAST_QUEUEVIEW_MENU) |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
175
diff
changeset
|
332 |
{ |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
175
diff
changeset
|
333 |
aMenuPane->SetItemDimmed(EPodcastQueueShowMenu, iPodcastModel.ActiveShowList().Count() == 0); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
175
diff
changeset
|
334 |
aMenuPane->SetItemDimmed(EPodcastRemoveAllDownloads, iPodcastModel.ActiveShowList().Count() == 0); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
175
diff
changeset
|
335 |
aMenuPane->SetItemDimmed(EPodcastSuspendDownloads, iPodcastModel.SettingsEngine().DownloadSuspended()); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
175
diff
changeset
|
336 |
aMenuPane->SetItemDimmed(EPodcastResumeDownloads, !iPodcastModel.SettingsEngine().DownloadSuspended()); |
2 | 337 |
} |
145
cc0182a5da39
Fix for Bug 2604 and bulk of the work towards implementing Bug 2737
Brendan Donegan <brendand@symbian.org>
parents:
70
diff
changeset
|
338 |
} |