author | Sebastian Brannstrom <sebastianb@symbian.org> |
Fri, 12 Nov 2010 20:48:14 +0000 | |
branch | symbian1 |
changeset 336 | 3d6c1417e8bd |
parent 263 | c71e68f962c6 |
child 347 | b8d687bb7ca1 |
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(); |
|
2 | 64 |
|
65 |
iPodcastModel.FeedEngine().AddObserver(this); |
|
66 |
iPodcastModel.ShowEngine().AddObserver(this); |
|
67 |
||
145
cc0182a5da39
Fix for Bug 2604 and bulk of the work towards implementing Bug 2737
Brendan Donegan <brendand@symbian.org>
parents:
70
diff
changeset
|
68 |
iStylusPopupMenu = CAknStylusPopUpMenu::NewL( this , TPoint(0,0)); |
cc0182a5da39
Fix for Bug 2604 and bulk of the work towards implementing Bug 2737
Brendan Donegan <brendand@symbian.org>
parents:
70
diff
changeset
|
69 |
TResourceReader reader; |
cc0182a5da39
Fix for Bug 2604 and bulk of the work towards implementing Bug 2737
Brendan Donegan <brendand@symbian.org>
parents:
70
diff
changeset
|
70 |
iCoeEnv->CreateResourceReaderLC(reader,R_QUEUEVIEW_POPUP_MENU); |
cc0182a5da39
Fix for Bug 2604 and bulk of the work towards implementing Bug 2737
Brendan Donegan <brendand@symbian.org>
parents:
70
diff
changeset
|
71 |
iStylusPopupMenu->ConstructFromResourceL(reader); |
cc0182a5da39
Fix for Bug 2604 and bulk of the work towards implementing Bug 2737
Brendan Donegan <brendand@symbian.org>
parents:
70
diff
changeset
|
72 |
|
cc0182a5da39
Fix for Bug 2604 and bulk of the work towards implementing Bug 2737
Brendan Donegan <brendand@symbian.org>
parents:
70
diff
changeset
|
73 |
CleanupStack::PopAndDestroy(); |
164
000f9fc147b2
Catch up with default branch; New v 27 SIS
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
149
diff
changeset
|
74 |
|
2 | 75 |
SetEmptyTextL(R_PODCAST_EMPTY_QUEUE); |
76 |
} |
|
77 |
||
78 |
TKeyResponse CPodcastQueueView::OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType) |
|
79 |
{ |
|
80 |
if (aType == EEventKey) |
|
81 |
{ |
|
82 |
CShowInfo *activeShow = NULL; |
|
83 |
||
84 |
TInt index = iListContainer->Listbox()->CurrentItemIndex(); |
|
85 |
if(index >= 0 && index < iPodcastModel.ActiveShowList().Count()) |
|
86 |
{ |
|
87 |
activeShow = iPodcastModel.ActiveShowList()[index]; |
|
88 |
} |
|
89 |
||
90 |
if (activeShow != NULL) { |
|
91 |
DP1("aKeyEvent.iCode=%d", aKeyEvent.iCode); |
|
92 |
switch (aKeyEvent.iCode) { |
|
93 |
case EKeyBackspace: |
|
94 |
case EKeyDelete: |
|
95 |
HandleCommandL(EPodcastRemoveDownload); |
|
96 |
break; |
|
97 |
default: |
|
98 |
break; |
|
99 |
} |
|
100 |
UpdateToolbar(); |
|
101 |
} |
|
102 |
} |
|
103 |
return CPodcastListView::OfferKeyEventL(aKeyEvent, aType); |
|
104 |
} |
|
105 |
||
106 |
CPodcastQueueView::~CPodcastQueueView() |
|
107 |
{ |
|
108 |
iPodcastModel.ShowEngine().RemoveObserver(this); |
|
109 |
iPodcastModel.FeedEngine().RemoveObserver(this); |
|
110 |
||
111 |
if(iStylusPopupMenu) |
|
112 |
delete iStylusPopupMenu, iStylusPopupMenu = NULL; |
|
113 |
} |
|
114 |
||
115 |
||
116 |
TUid CPodcastQueueView::Id() const |
|
117 |
{ |
|
118 |
return KUidPodcastQueueViewID; |
|
119 |
} |
|
120 |
||
121 |
void CPodcastQueueView::DoActivateL(const TVwsViewId& aPrevViewId, |
|
122 |
TUid aCustomMessageId, const TDesC8& aCustomMessage) |
|
123 |
{ |
|
124 |
DP("CPodcastQueueView::DoActivateL BEGIN"); |
|
125 |
||
126 |
CPodcastListView::DoActivateL(aPrevViewId, aCustomMessageId, aCustomMessage); |
|
45
56d4e0784e5d
Nicer way to handle back from queue view to feed/show view
teknolog
parents:
36
diff
changeset
|
127 |
iPreviousView = aPrevViewId; |
2 | 128 |
|
129 |
UpdateFeedUpdateStateL(); |
|
130 |
UpdateToolbar(); |
|
131 |
DP("CPodcastQueueView::DoActivateL END"); |
|
132 |
} |
|
133 |
||
134 |
void CPodcastQueueView::DoDeactivate() |
|
135 |
{ |
|
136 |
CPodcastListView::DoDeactivate(); |
|
137 |
} |
|
138 |
||
139 |
void CPodcastQueueView::HandleListBoxEventL(CEikListBox* /*aListBox*/, |
|
140 |
TListBoxEvent aEventType) |
|
141 |
{ |
|
142 |
switch (aEventType) |
|
143 |
{ |
|
144 |
case EEventEnterKeyPressed: |
|
145 |
case EEventItemActioned: |
|
146 |
case EEventItemDoubleClicked: |
|
147 |
break; |
|
148 |
default: |
|
149 |
break; |
|
150 |
} |
|
151 |
UpdateToolbar(); |
|
152 |
} |
|
153 |
||
154 |
void CPodcastQueueView::UpdateListboxItemsL() |
|
155 |
{ |
|
336
3d6c1417e8bd
Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
263
diff
changeset
|
156 |
DP("CPodcastQueueView::UpdateListboxItemsL BEGIN"); |
183
913f0f0e98fc
Fix so listbox position is kept when removing a show from queue
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
173
diff
changeset
|
157 |
if (iListContainer->IsVisible() && !iDontUpdateList) |
2 | 158 |
{ |
159 |
TListItemProperties itemProps; |
|
160 |
TInt len = 0; |
|
161 |
||
8 | 162 |
iPodcastModel.GetShowsDownloadingL(); |
2 | 163 |
|
164 |
RShowInfoArray &fItems = iPodcastModel.ActiveShowList(); |
|
165 |
len = fItems.Count(); |
|
166 |
||
167 |
if (iListContainer->Listbox() != NULL) |
|
168 |
{ |
|
169 |
TBool allUidsMatch = EFalse; |
|
170 |
||
171 |
if (len == iListContainer->Listbox()->Model()->NumberOfItems()) |
|
172 |
{ |
|
173 |
allUidsMatch = ETrue; |
|
174 |
TUint itemId = 0; |
|
175 |
for (TInt loop = 0; loop< len; loop++) |
|
176 |
{ |
|
177 |
itemId = iItemIdArray[loop]; |
|
178 |
if (fItems[loop]->Uid() != itemId) |
|
179 |
{ |
|
180 |
allUidsMatch = EFalse; |
|
181 |
break; |
|
182 |
} |
|
183 |
} |
|
184 |
} |
|
185 |
||
186 |
if (allUidsMatch && len > 0) |
|
187 |
{ |
|
188 |
for (TInt loop = 0; loop< len; loop++) |
|
189 |
{ |
|
190 |
UpdateShowItemDataL(fItems[loop], loop); |
|
191 |
} |
|
263
c71e68f962c6
Fix for bug 3853
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
183
diff
changeset
|
192 |
iListContainer->Listbox()->DrawNow(); |
2 | 193 |
} |
194 |
else |
|
195 |
{ |
|
336
3d6c1417e8bd
Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
263
diff
changeset
|
196 |
//iListContainer->Listbox()->ItemDrawer()->ClearAllPropertiesL(); |
2 | 197 |
iListContainer->Listbox()->Reset(); |
198 |
iItemIdArray.Reset(); |
|
199 |
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:
263
diff
changeset
|
200 |
iItemArrayShort->Reset(); |
2 | 201 |
|
202 |
if (len > 0) |
|
203 |
{ |
|
204 |
for (TInt i=0; i<len; i++) |
|
205 |
{ |
|
206 |
CShowInfo *si = fItems[i]; |
|
207 |
FormatShowInfoListBoxItemL(*si); |
|
208 |
iItemIdArray.Append(si->Uid()); |
|
209 |
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:
263
diff
changeset
|
210 |
iItemArrayShort->AppendL(iListboxFormatbufferShort); |
2 | 211 |
} |
212 |
} |
|
213 |
else |
|
214 |
{ |
|
215 |
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:
263
diff
changeset
|
216 |
iItemArrayShort->Reset(); |
2 | 217 |
iItemIdArray.Reset(); |
218 |
||
219 |
itemProps.SetDimmed(ETrue); |
|
220 |
itemProps.SetHiddenSelection(ETrue); |
|
221 |
} |
|
222 |
iListContainer->Listbox()->HandleItemAdditionL(); |
|
223 |
} |
|
224 |
} |
|
225 |
} |
|
336
3d6c1417e8bd
Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
263
diff
changeset
|
226 |
DP("CPodcastQueueView::UpdateListboxItemsL END"); |
2 | 227 |
} |
228 |
||
229 |
/** |
|
230 |
* Command handling function intended for overriding by sub classes. |
|
231 |
* Default implementation is empty. |
|
232 |
* @param aCommand ID of the command to respond to. |
|
233 |
*/ |
|
234 |
void CPodcastQueueView::HandleCommandL(TInt aCommand) |
|
235 |
{ |
|
236 |
switch (aCommand) |
|
237 |
{ |
|
238 |
case EPodcastRemoveAllDownloads: |
|
239 |
{ |
|
240 |
TBuf<KMaxMessageLength> msg; |
|
241 |
iEikonEnv->ReadResourceL(msg, R_CLEAR_QUERY); |
|
242 |
||
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
23
diff
changeset
|
243 |
if(ShowQueryMessageL(msg)) |
2 | 244 |
{ |
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
23
diff
changeset
|
245 |
iPodcastModel.ShowEngine().RemoveAllDownloadsL(); |
2 | 246 |
UpdateListboxItemsL(); |
247 |
} |
|
248 |
} |
|
249 |
break; |
|
250 |
case EPodcastRemoveDownload: |
|
251 |
{ |
|
252 |
TInt index = iListContainer->Listbox()->CurrentItemIndex(); |
|
253 |
if (index >= 0 && index < iPodcastModel.ActiveShowList().Count()) |
|
254 |
{ |
|
183
913f0f0e98fc
Fix so listbox position is kept when removing a show from queue
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
173
diff
changeset
|
255 |
// this is an ugly hack to prevent UpdateListboxItemsL from being |
913f0f0e98fc
Fix so listbox position is kept when removing a show from queue
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
173
diff
changeset
|
256 |
// triggered from the show engine, which causes focus to jump |
913f0f0e98fc
Fix so listbox position is kept when removing a show from queue
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
173
diff
changeset
|
257 |
// around in an ugly fashion |
913f0f0e98fc
Fix so listbox position is kept when removing a show from queue
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
173
diff
changeset
|
258 |
iDontUpdateList = ETrue; |
60 | 259 |
TRAP_IGNORE(iPodcastModel.ShowEngine().RemoveDownloadL(iPodcastModel.ActiveShowList()[index]->Uid())); |
183
913f0f0e98fc
Fix so listbox position is kept when removing a show from queue
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
173
diff
changeset
|
260 |
iDontUpdateList = EFalse; |
913f0f0e98fc
Fix so listbox position is kept when removing a show from queue
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
173
diff
changeset
|
261 |
} |
913f0f0e98fc
Fix so listbox position is kept when removing a show from queue
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
173
diff
changeset
|
262 |
UpdateListboxItemsL(); |
913f0f0e98fc
Fix so listbox position is kept when removing a show from queue
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
173
diff
changeset
|
263 |
if (index > 0) |
913f0f0e98fc
Fix so listbox position is kept when removing a show from queue
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
173
diff
changeset
|
264 |
{ |
913f0f0e98fc
Fix so listbox position is kept when removing a show from queue
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
173
diff
changeset
|
265 |
iListContainer->Listbox()->SetCurrentItemIndex(index - 1); |
2 | 266 |
} |
267 |
} |
|
268 |
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
|
269 |
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
|
270 |
{ |
cc0182a5da39
Fix for Bug 2604 and bulk of the work towards implementing Bug 2737
Brendan Donegan <brendand@symbian.org>
parents:
70
diff
changeset
|
271 |
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
|
272 |
TBool resumeAfterMove = EFalse; |
70b2f592a460
Enabled Brendan's download queue operations; Fixed minor bug in queue swapping method
teknolog
parents:
146
diff
changeset
|
273 |
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
|
274 |
{ |
70b2f592a460
Enabled Brendan's download queue operations; Fixed minor bug in queue swapping method
teknolog
parents:
146
diff
changeset
|
275 |
iPodcastModel.ShowEngine().SuspendDownloads(); |
70b2f592a460
Enabled Brendan's download queue operations; Fixed minor bug in queue swapping method
teknolog
parents:
146
diff
changeset
|
276 |
resumeAfterMove = ETrue; |
70b2f592a460
Enabled Brendan's download queue operations; Fixed minor bug in queue swapping method
teknolog
parents:
146
diff
changeset
|
277 |
} |
70b2f592a460
Enabled Brendan's download queue operations; Fixed minor bug in queue swapping method
teknolog
parents:
146
diff
changeset
|
278 |
|
145
cc0182a5da39
Fix for Bug 2604 and bulk of the work towards implementing Bug 2737
Brendan Donegan <brendand@symbian.org>
parents:
70
diff
changeset
|
279 |
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
|
280 |
{ |
cc0182a5da39
Fix for Bug 2604 and bulk of the work towards implementing Bug 2737
Brendan Donegan <brendand@symbian.org>
parents:
70
diff
changeset
|
281 |
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
|
282 |
} |
149
70b2f592a460
Enabled Brendan's download queue operations; Fixed minor bug in queue swapping method
teknolog
parents:
146
diff
changeset
|
283 |
|
70b2f592a460
Enabled Brendan's download queue operations; Fixed minor bug in queue swapping method
teknolog
parents:
146
diff
changeset
|
284 |
if(resumeAfterMove) |
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 |
iPodcastModel.ShowEngine().ResumeDownloadsL(); |
70b2f592a460
Enabled Brendan's download queue operations; Fixed minor bug in queue swapping method
teknolog
parents:
146
diff
changeset
|
287 |
} |
70b2f592a460
Enabled Brendan's download queue operations; Fixed minor bug in queue swapping method
teknolog
parents:
146
diff
changeset
|
288 |
|
173
8466fe8528b6
Minor fix for highlight move in queue view
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
169
diff
changeset
|
289 |
UpdateListboxItemsL(); |
169
9c77455964f8
Improvement to queue shifting function - move the highlight too.
Brendan Donegan <brendand@symbian.org>
parents:
164
diff
changeset
|
290 |
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
|
291 |
} |
cc0182a5da39
Fix for Bug 2604 and bulk of the work towards implementing Bug 2737
Brendan Donegan <brendand@symbian.org>
parents:
70
diff
changeset
|
292 |
break; |
cc0182a5da39
Fix for Bug 2604 and bulk of the work towards implementing Bug 2737
Brendan Donegan <brendand@symbian.org>
parents:
70
diff
changeset
|
293 |
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
|
294 |
{ |
cc0182a5da39
Fix for Bug 2604 and bulk of the work towards implementing Bug 2737
Brendan Donegan <brendand@symbian.org>
parents:
70
diff
changeset
|
295 |
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
|
296 |
TBool resumeAfterMove = EFalse; |
70b2f592a460
Enabled Brendan's download queue operations; Fixed minor bug in queue swapping method
teknolog
parents:
146
diff
changeset
|
297 |
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
|
298 |
{ |
70b2f592a460
Enabled Brendan's download queue operations; Fixed minor bug in queue swapping method
teknolog
parents:
146
diff
changeset
|
299 |
iPodcastModel.ShowEngine().SuspendDownloads(); |
70b2f592a460
Enabled Brendan's download queue operations; Fixed minor bug in queue swapping method
teknolog
parents:
146
diff
changeset
|
300 |
resumeAfterMove = ETrue; |
70b2f592a460
Enabled Brendan's download queue operations; Fixed minor bug in queue swapping method
teknolog
parents:
146
diff
changeset
|
301 |
} |
70b2f592a460
Enabled Brendan's download queue operations; Fixed minor bug in queue swapping method
teknolog
parents:
146
diff
changeset
|
302 |
|
145
cc0182a5da39
Fix for Bug 2604 and bulk of the work towards implementing Bug 2737
Brendan Donegan <brendand@symbian.org>
parents:
70
diff
changeset
|
303 |
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
|
304 |
{ |
cc0182a5da39
Fix for Bug 2604 and bulk of the work towards implementing Bug 2737
Brendan Donegan <brendand@symbian.org>
parents:
70
diff
changeset
|
305 |
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
|
306 |
} |
149
70b2f592a460
Enabled Brendan's download queue operations; Fixed minor bug in queue swapping method
teknolog
parents:
146
diff
changeset
|
307 |
|
70b2f592a460
Enabled Brendan's download queue operations; Fixed minor bug in queue swapping method
teknolog
parents:
146
diff
changeset
|
308 |
if(resumeAfterMove) |
70b2f592a460
Enabled Brendan's download queue operations; Fixed minor bug in queue swapping method
teknolog
parents:
146
diff
changeset
|
309 |
{ |
70b2f592a460
Enabled Brendan's download queue operations; Fixed minor bug in queue swapping method
teknolog
parents:
146
diff
changeset
|
310 |
iPodcastModel.ShowEngine().ResumeDownloadsL(); |
70b2f592a460
Enabled Brendan's download queue operations; Fixed minor bug in queue swapping method
teknolog
parents:
146
diff
changeset
|
311 |
} |
70b2f592a460
Enabled Brendan's download queue operations; Fixed minor bug in queue swapping method
teknolog
parents:
146
diff
changeset
|
312 |
|
145
cc0182a5da39
Fix for Bug 2604 and bulk of the work towards implementing Bug 2737
Brendan Donegan <brendand@symbian.org>
parents:
70
diff
changeset
|
313 |
UpdateListboxItemsL(); |
173
8466fe8528b6
Minor fix for highlight move in queue view
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
169
diff
changeset
|
314 |
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
|
315 |
} |
cc0182a5da39
Fix for Bug 2604 and bulk of the work towards implementing Bug 2737
Brendan Donegan <brendand@symbian.org>
parents:
70
diff
changeset
|
316 |
break; |
2 | 317 |
case EPodcastSuspendDownloads: |
318 |
{ |
|
263
c71e68f962c6
Fix for bug 3853
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
183
diff
changeset
|
319 |
iDontUpdateList = ETrue; |
2 | 320 |
iPodcastModel.ShowEngine().SuspendDownloads(); |
263
c71e68f962c6
Fix for bug 3853
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
183
diff
changeset
|
321 |
iDontUpdateList = EFalse; |
2 | 322 |
UpdateListboxItemsL(); |
323 |
} |
|
324 |
break; |
|
325 |
case EPodcastResumeDownloads: |
|
326 |
{ |
|
263
c71e68f962c6
Fix for bug 3853
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
183
diff
changeset
|
327 |
iDontUpdateList = ETrue; |
2 | 328 |
iPodcastModel.ShowEngine().ResumeDownloadsL(); |
263
c71e68f962c6
Fix for bug 3853
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
183
diff
changeset
|
329 |
iDontUpdateList = EFalse; |
2 | 330 |
UpdateListboxItemsL(); |
331 |
} |
|
332 |
break; |
|
336
3d6c1417e8bd
Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
263
diff
changeset
|
333 |
case EPodcastShowInfo: |
3d6c1417e8bd
Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
263
diff
changeset
|
334 |
{ |
3d6c1417e8bd
Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
263
diff
changeset
|
335 |
DisplayShowInfoDialogL(); |
3d6c1417e8bd
Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
263
diff
changeset
|
336 |
} |
3d6c1417e8bd
Merged all the later Symbian3 updates into Symbian1 branch; new SIS v. 1.00.32
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
263
diff
changeset
|
337 |
break; |
2 | 338 |
default: |
339 |
CPodcastListView::HandleCommandL(aCommand); |
|
340 |
break; |
|
341 |
} |
|
50 | 342 |
iListContainer->SetLongTapDetectedL(EFalse); // in case we got here by long tapping |
2 | 343 |
UpdateToolbar(); |
344 |
} |
|
345 |
||
346 |
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
|
347 |
{ |
2 | 348 |
if(aResourceId == R_PODCAST_SHOWSVIEW_MENU) |
349 |
{ |
|
350 |
aMenuPane->SetItemDimmed(EPodcastMarkAllPlayed, ETrue); |
|
351 |
} |
|
145
cc0182a5da39
Fix for Bug 2604 and bulk of the work towards implementing Bug 2737
Brendan Donegan <brendand@symbian.org>
parents:
70
diff
changeset
|
352 |
} |
2 | 353 |
|
13 | 354 |
void CPodcastQueueView::UpdateToolbar(TBool aVisible) |
145
cc0182a5da39
Fix for Bug 2604 and bulk of the work towards implementing Bug 2737
Brendan Donegan <brendand@symbian.org>
parents:
70
diff
changeset
|
355 |
{ |
2 | 356 |
CAknToolbar* toolbar = Toolbar(); |
357 |
||
145
cc0182a5da39
Fix for Bug 2604 and bulk of the work towards implementing Bug 2737
Brendan Donegan <brendand@symbian.org>
parents:
70
diff
changeset
|
358 |
if (toolbar) |
cc0182a5da39
Fix for Bug 2604 and bulk of the work towards implementing Bug 2737
Brendan Donegan <brendand@symbian.org>
parents:
70
diff
changeset
|
359 |
{ |
13 | 360 |
RShowInfoArray &fItems = iPodcastModel.ActiveShowList(); |
361 |
TInt itemCnt = fItems.Count(); |
|
145
cc0182a5da39
Fix for Bug 2604 and bulk of the work towards implementing Bug 2737
Brendan Donegan <brendand@symbian.org>
parents:
70
diff
changeset
|
362 |
if (iListContainer->IsVisible()) |
cc0182a5da39
Fix for Bug 2604 and bulk of the work towards implementing Bug 2737
Brendan Donegan <brendand@symbian.org>
parents:
70
diff
changeset
|
363 |
{ |
14
4e75731546eb
Fix so toolbars only change visibility for the visible view
teknolog
parents:
13
diff
changeset
|
364 |
toolbar->SetToolbarVisibility(aVisible); |
145
cc0182a5da39
Fix for Bug 2604 and bulk of the work towards implementing Bug 2737
Brendan Donegan <brendand@symbian.org>
parents:
70
diff
changeset
|
365 |
} |
cc0182a5da39
Fix for Bug 2604 and bulk of the work towards implementing Bug 2737
Brendan Donegan <brendand@symbian.org>
parents:
70
diff
changeset
|
366 |
|
13 | 367 |
toolbar->HideItem(EPodcastRemoveAllDownloads, EFalse, ETrue); |
368 |
toolbar->SetItemDimmed(EPodcastRemoveAllDownloads, itemCnt == 0, ETrue); |
|
369 |
toolbar->HideItem(EPodcastSuspendDownloads,iPodcastModel.SettingsEngine().DownloadSuspended(), ETrue); |
|
370 |
toolbar->HideItem(EPodcastResumeDownloads,!iPodcastModel.SettingsEngine().DownloadSuspended(), ETrue); |
|
23
cf4b850bbffb
Added macro SYMBIAN1_UI that toggles between single and double tap UI
teknolog
parents:
14
diff
changeset
|
371 |
toolbar->SetItemDimmed(EPodcastRemoveDownload, itemCnt == 0, ETrue); |
145
cc0182a5da39
Fix for Bug 2604 and bulk of the work towards implementing Bug 2737
Brendan Donegan <brendand@symbian.org>
parents:
70
diff
changeset
|
372 |
} |
13 | 373 |
} |
145
cc0182a5da39
Fix for Bug 2604 and bulk of the work towards implementing Bug 2737
Brendan Donegan <brendand@symbian.org>
parents:
70
diff
changeset
|
374 |
|
cc0182a5da39
Fix for Bug 2604 and bulk of the work towards implementing Bug 2737
Brendan Donegan <brendand@symbian.org>
parents:
70
diff
changeset
|
375 |
void CPodcastQueueView::HandleLongTapEventL( const TPoint& aPenEventLocation, const TPoint& /* aPenEventScreenLocation */) |
cc0182a5da39
Fix for Bug 2604 and bulk of the work towards implementing Bug 2737
Brendan Donegan <brendand@symbian.org>
parents:
70
diff
changeset
|
376 |
{ |
cc0182a5da39
Fix for Bug 2604 and bulk of the work towards implementing Bug 2737
Brendan Donegan <brendand@symbian.org>
parents:
70
diff
changeset
|
377 |
DP("CPodcastQueueView::HandleLongTapEventL BEGIN"); |
cc0182a5da39
Fix for Bug 2604 and bulk of the work towards implementing Bug 2737
Brendan Donegan <brendand@symbian.org>
parents:
70
diff
changeset
|
378 |
iListContainer->SetLongTapDetectedL(ETrue); |
cc0182a5da39
Fix for Bug 2604 and bulk of the work towards implementing Bug 2737
Brendan Donegan <brendand@symbian.org>
parents:
70
diff
changeset
|
379 |
|
cc0182a5da39
Fix for Bug 2604 and bulk of the work towards implementing Bug 2737
Brendan Donegan <brendand@symbian.org>
parents:
70
diff
changeset
|
380 |
const TInt KListboxDefaultHeight = 19; // for some reason it returns 19 for an empty listbox in S^1 |
cc0182a5da39
Fix for Bug 2604 and bulk of the work towards implementing Bug 2737
Brendan Donegan <brendand@symbian.org>
parents:
70
diff
changeset
|
381 |
TInt lbHeight = iListContainer->Listbox()->CalcHeightBasedOnNumOfItems( |
cc0182a5da39
Fix for Bug 2604 and bulk of the work towards implementing Bug 2737
Brendan Donegan <brendand@symbian.org>
parents:
70
diff
changeset
|
382 |
iListContainer->Listbox()->Model()->NumberOfItems()) - KListboxDefaultHeight; |
cc0182a5da39
Fix for Bug 2604 and bulk of the work towards implementing Bug 2737
Brendan Donegan <brendand@symbian.org>
parents:
70
diff
changeset
|
383 |
|
cc0182a5da39
Fix for Bug 2604 and bulk of the work towards implementing Bug 2737
Brendan Donegan <brendand@symbian.org>
parents:
70
diff
changeset
|
384 |
if(iStylusPopupMenu && aPenEventLocation.iY < lbHeight) |
cc0182a5da39
Fix for Bug 2604 and bulk of the work towards implementing Bug 2737
Brendan Donegan <brendand@symbian.org>
parents:
70
diff
changeset
|
385 |
{ |
cc0182a5da39
Fix for Bug 2604 and bulk of the work towards implementing Bug 2737
Brendan Donegan <brendand@symbian.org>
parents:
70
diff
changeset
|
386 |
TBool dimDown = (iListContainer->Listbox()->CurrentItemIndex() >= iPodcastModel.ActiveShowList().Count() - 1 ? |
cc0182a5da39
Fix for Bug 2604 and bulk of the work towards implementing Bug 2737
Brendan Donegan <brendand@symbian.org>
parents:
70
diff
changeset
|
387 |
ETrue : EFalse); |
cc0182a5da39
Fix for Bug 2604 and bulk of the work towards implementing Bug 2737
Brendan Donegan <brendand@symbian.org>
parents:
70
diff
changeset
|
388 |
TBool dimUp = (iListContainer->Listbox()->CurrentItemIndex() <= 0 ? |
cc0182a5da39
Fix for Bug 2604 and bulk of the work towards implementing Bug 2737
Brendan Donegan <brendand@symbian.org>
parents:
70
diff
changeset
|
389 |
ETrue : EFalse); |
cc0182a5da39
Fix for Bug 2604 and bulk of the work towards implementing Bug 2737
Brendan Donegan <brendand@symbian.org>
parents:
70
diff
changeset
|
390 |
|
cc0182a5da39
Fix for Bug 2604 and bulk of the work towards implementing Bug 2737
Brendan Donegan <brendand@symbian.org>
parents:
70
diff
changeset
|
391 |
iStylusPopupMenu->SetItemDimmed(EPodcastMoveDownloadDown, dimDown); |
cc0182a5da39
Fix for Bug 2604 and bulk of the work towards implementing Bug 2737
Brendan Donegan <brendand@symbian.org>
parents:
70
diff
changeset
|
392 |
iStylusPopupMenu->SetItemDimmed(EPodcastMoveDownloadUp, dimUp); |
cc0182a5da39
Fix for Bug 2604 and bulk of the work towards implementing Bug 2737
Brendan Donegan <brendand@symbian.org>
parents:
70
diff
changeset
|
393 |
|
cc0182a5da39
Fix for Bug 2604 and bulk of the work towards implementing Bug 2737
Brendan Donegan <brendand@symbian.org>
parents:
70
diff
changeset
|
394 |
iStylusPopupMenu->ShowMenu(); |
cc0182a5da39
Fix for Bug 2604 and bulk of the work towards implementing Bug 2737
Brendan Donegan <brendand@symbian.org>
parents:
70
diff
changeset
|
395 |
iStylusPopupMenu->SetPosition(aPenEventLocation); |
cc0182a5da39
Fix for Bug 2604 and bulk of the work towards implementing Bug 2737
Brendan Donegan <brendand@symbian.org>
parents:
70
diff
changeset
|
396 |
} |
cc0182a5da39
Fix for Bug 2604 and bulk of the work towards implementing Bug 2737
Brendan Donegan <brendand@symbian.org>
parents:
70
diff
changeset
|
397 |
|
cc0182a5da39
Fix for Bug 2604 and bulk of the work towards implementing Bug 2737
Brendan Donegan <brendand@symbian.org>
parents:
70
diff
changeset
|
398 |
DP("CPodcastQueueView::HandleLongTapEventL END"); |
2 | 399 |
} |