author | Sebastian Brannstrom <sebastianb@symbian.org> |
Sat, 30 Oct 2010 12:36:47 +0100 | |
branch | RCL_3 |
changeset 309 | d9f6395a50ea |
parent 301 | f5af16df2425 |
child 314 | e7776f6a2198 |
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) : |
|
121
1cc7501102a8
CPodcastQueueView now inherits CPodcastShowsView instead of CPodcastListView. This removes the duplicated code between the two classes.
teknolog
parents:
117
diff
changeset
|
54 |
CPodcastShowsView(aPodcastModel) |
2 | 55 |
{ |
56 |
} |
|
57 |
||
58 |
void CPodcastQueueView::ConstructL() |
|
59 |
{ |
|
60 |
BaseConstructL(R_PODCAST_QUEUEVIEW); |
|
61 |
CPodcastListView::ConstructL(); |
|
121
1cc7501102a8
CPodcastQueueView now inherits CPodcastShowsView instead of CPodcastListView. This removes the duplicated code between the two classes.
teknolog
parents:
117
diff
changeset
|
62 |
|
1cc7501102a8
CPodcastQueueView now inherits CPodcastShowsView instead of CPodcastListView. This removes the duplicated code between the two classes.
teknolog
parents:
117
diff
changeset
|
63 |
CreateIconsL(); |
1cc7501102a8
CPodcastQueueView now inherits CPodcastShowsView instead of CPodcastListView. This removes the duplicated code between the two classes.
teknolog
parents:
117
diff
changeset
|
64 |
|
2 | 65 |
iListContainer->Listbox()->SetListBoxObserver(this); |
66 |
||
67 |
iPodcastModel.FeedEngine().AddObserver(this); |
|
68 |
iPodcastModel.ShowEngine().AddObserver(this); |
|
126 | 69 |
|
2 | 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 |
UpdateToolbar(); |
|
96 |
} |
|
97 |
} |
|
98 |
return CPodcastListView::OfferKeyEventL(aKeyEvent, aType); |
|
99 |
} |
|
100 |
||
101 |
CPodcastQueueView::~CPodcastQueueView() |
|
102 |
{ |
|
103 |
iPodcastModel.ShowEngine().RemoveObserver(this); |
|
104 |
iPodcastModel.FeedEngine().RemoveObserver(this); |
|
105 |
} |
|
106 |
||
107 |
||
108 |
TUid CPodcastQueueView::Id() const |
|
109 |
{ |
|
110 |
return KUidPodcastQueueViewID; |
|
111 |
} |
|
112 |
||
113 |
void CPodcastQueueView::DoActivateL(const TVwsViewId& aPrevViewId, |
|
114 |
TUid aCustomMessageId, const TDesC8& aCustomMessage) |
|
115 |
{ |
|
116 |
DP("CPodcastQueueView::DoActivateL BEGIN"); |
|
117 |
||
118 |
CPodcastListView::DoActivateL(aPrevViewId, aCustomMessageId, aCustomMessage); |
|
45
56d4e0784e5d
Nicer way to handle back from queue view to feed/show view
teknolog
parents:
36
diff
changeset
|
119 |
iPreviousView = aPrevViewId; |
2 | 120 |
|
121 |
UpdateFeedUpdateStateL(); |
|
122 |
UpdateToolbar(); |
|
123 |
DP("CPodcastQueueView::DoActivateL END"); |
|
124 |
} |
|
125 |
||
126 |
void CPodcastQueueView::DoDeactivate() |
|
127 |
{ |
|
128 |
CPodcastListView::DoDeactivate(); |
|
129 |
} |
|
130 |
||
131 |
void CPodcastQueueView::HandleListBoxEventL(CEikListBox* /*aListBox*/, |
|
132 |
TListBoxEvent aEventType) |
|
133 |
{ |
|
134 |
switch (aEventType) |
|
135 |
{ |
|
137
eefed4bda2e2
Minor fixes to comply with single tap technical solution description. By this I consider bug 2056 closed.
teknolog
parents:
126
diff
changeset
|
136 |
case EEventItemSingleClicked: |
2 | 137 |
case EEventEnterKeyPressed: |
138 |
case EEventItemActioned: |
|
139 |
case EEventItemDoubleClicked: |
|
140 |
break; |
|
141 |
default: |
|
142 |
break; |
|
143 |
} |
|
144 |
UpdateToolbar(); |
|
145 |
} |
|
146 |
||
147 |
void CPodcastQueueView::UpdateListboxItemsL() |
|
148 |
{ |
|
185
92eadaba67e6
Fix so listbox position is kept when removing a show from queue
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
168
diff
changeset
|
149 |
if (iListContainer->IsVisible() && !iDontUpdateList) |
2 | 150 |
{ |
151 |
TListItemProperties itemProps; |
|
152 |
TInt len = 0; |
|
153 |
||
8 | 154 |
iPodcastModel.GetShowsDownloadingL(); |
2 | 155 |
|
156 |
RShowInfoArray &fItems = iPodcastModel.ActiveShowList(); |
|
157 |
len = fItems.Count(); |
|
158 |
||
159 |
if (iListContainer->Listbox() != NULL) |
|
160 |
{ |
|
161 |
TBool allUidsMatch = EFalse; |
|
162 |
||
163 |
if (len == iListContainer->Listbox()->Model()->NumberOfItems()) |
|
164 |
{ |
|
165 |
allUidsMatch = ETrue; |
|
166 |
TUint itemId = 0; |
|
167 |
for (TInt loop = 0; loop< len; loop++) |
|
168 |
{ |
|
169 |
itemId = iItemIdArray[loop]; |
|
170 |
if (fItems[loop]->Uid() != itemId) |
|
171 |
{ |
|
172 |
allUidsMatch = EFalse; |
|
173 |
break; |
|
174 |
} |
|
175 |
} |
|
176 |
} |
|
177 |
||
178 |
if (allUidsMatch && len > 0) |
|
179 |
{ |
|
180 |
for (TInt loop = 0; loop< len; loop++) |
|
181 |
{ |
|
182 |
UpdateShowItemDataL(fItems[loop], loop); |
|
183 |
} |
|
265
72305c65726c
Fix for bug 3853
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
243
diff
changeset
|
184 |
iListContainer->Listbox()->DrawNow(); |
2 | 185 |
} |
186 |
else |
|
187 |
{ |
|
188 |
iListContainer->Listbox()->ItemDrawer()->ClearAllPropertiesL(); |
|
189 |
iListContainer->Listbox()->Reset(); |
|
190 |
iItemIdArray.Reset(); |
|
191 |
iItemArray->Reset(); |
|
192 |
||
193 |
if (len > 0) |
|
194 |
{ |
|
195 |
for (TInt i=0; i<len; i++) |
|
196 |
{ |
|
197 |
CShowInfo *si = fItems[i]; |
|
198 |
FormatShowInfoListBoxItemL(*si); |
|
199 |
iItemIdArray.Append(si->Uid()); |
|
200 |
iItemArray->AppendL(iListboxFormatbuffer); |
|
201 |
} |
|
202 |
} |
|
203 |
else |
|
204 |
{ |
|
205 |
iItemArray->Reset(); |
|
206 |
iItemIdArray.Reset(); |
|
207 |
||
208 |
itemProps.SetDimmed(ETrue); |
|
209 |
itemProps.SetHiddenSelection(ETrue); |
|
210 |
} |
|
211 |
iListContainer->Listbox()->HandleItemAdditionL(); |
|
212 |
} |
|
213 |
} |
|
214 |
} |
|
215 |
} |
|
216 |
||
217 |
/** |
|
218 |
* Command handling function intended for overriding by sub classes. |
|
219 |
* Default implementation is empty. |
|
220 |
* @param aCommand ID of the command to respond to. |
|
221 |
*/ |
|
222 |
void CPodcastQueueView::HandleCommandL(TInt aCommand) |
|
223 |
{ |
|
224 |
switch (aCommand) |
|
225 |
{ |
|
226 |
case EPodcastRemoveAllDownloads: |
|
227 |
{ |
|
228 |
TBuf<KMaxMessageLength> msg; |
|
229 |
iEikonEnv->ReadResourceL(msg, R_CLEAR_QUERY); |
|
230 |
||
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
23
diff
changeset
|
231 |
if(ShowQueryMessageL(msg)) |
2 | 232 |
{ |
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
23
diff
changeset
|
233 |
iPodcastModel.ShowEngine().RemoveAllDownloadsL(); |
2 | 234 |
UpdateListboxItemsL(); |
235 |
} |
|
236 |
} |
|
237 |
break; |
|
238 |
case EPodcastRemoveDownload: |
|
239 |
{ |
|
240 |
TInt index = iListContainer->Listbox()->CurrentItemIndex(); |
|
241 |
if (index >= 0 && index < iPodcastModel.ActiveShowList().Count()) |
|
242 |
{ |
|
185
92eadaba67e6
Fix so listbox position is kept when removing a show from queue
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
168
diff
changeset
|
243 |
// this is an ugly hack to prevent UpdateListboxItemsL from being |
92eadaba67e6
Fix so listbox position is kept when removing a show from queue
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
168
diff
changeset
|
244 |
// triggered from the show engine, which causes focus to jump |
92eadaba67e6
Fix so listbox position is kept when removing a show from queue
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
168
diff
changeset
|
245 |
// around in an ugly fashion |
92eadaba67e6
Fix so listbox position is kept when removing a show from queue
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
168
diff
changeset
|
246 |
iDontUpdateList = ETrue; |
116 | 247 |
TRAP_IGNORE(iPodcastModel.ShowEngine().RemoveDownloadL(iPodcastModel.ActiveShowList()[index]->Uid())); |
185
92eadaba67e6
Fix so listbox position is kept when removing a show from queue
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
168
diff
changeset
|
248 |
iDontUpdateList = EFalse; |
92eadaba67e6
Fix so listbox position is kept when removing a show from queue
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
168
diff
changeset
|
249 |
} |
92eadaba67e6
Fix so listbox position is kept when removing a show from queue
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
168
diff
changeset
|
250 |
UpdateListboxItemsL(); |
92eadaba67e6
Fix so listbox position is kept when removing a show from queue
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
168
diff
changeset
|
251 |
if (index > 0) |
92eadaba67e6
Fix so listbox position is kept when removing a show from queue
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
168
diff
changeset
|
252 |
{ |
92eadaba67e6
Fix so listbox position is kept when removing a show from queue
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
168
diff
changeset
|
253 |
iListContainer->Listbox()->SetCurrentItemIndex(index - 1); |
2 | 254 |
} |
255 |
} |
|
256 |
break; |
|
151 | 257 |
case EPodcastMoveDownloadUp: |
258 |
{ |
|
259 |
TInt index = iListContainer->Listbox()->CurrentItemIndex(); |
|
260 |
TBool resumeAfterMove = EFalse; |
|
261 |
if (index == 1 && !iPodcastModel.SettingsEngine().DownloadSuspended()) |
|
262 |
{ |
|
263 |
iPodcastModel.ShowEngine().SuspendDownloads(); |
|
264 |
resumeAfterMove = ETrue; |
|
265 |
} |
|
266 |
||
267 |
if (index >= 0 && index < iPodcastModel.ActiveShowList().Count()) |
|
268 |
{ |
|
269 |
TRAP_IGNORE(iPodcastModel.ShowEngine().MoveDownloadUpL(iPodcastModel.ActiveShowList()[index]->Uid())); |
|
270 |
} |
|
271 |
||
272 |
if(resumeAfterMove) |
|
273 |
{ |
|
274 |
iPodcastModel.ShowEngine().ResumeDownloadsL(); |
|
275 |
} |
|
276 |
||
295
67f53e831ab0
Fix for bug 3876
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
265
diff
changeset
|
277 |
UpdateListboxItemsL(); |
168
9d3b805af5ab
Improvement to queue shifting function - move the highlight too.
Brendan Donegan <brendand@symbian.org>
parents:
163
diff
changeset
|
278 |
iListContainer->Listbox()->SetCurrentItemIndex(index - 1); |
151 | 279 |
} |
280 |
break; |
|
281 |
case EPodcastMoveDownloadDown: |
|
282 |
{ |
|
283 |
TInt index = iListContainer->Listbox()->CurrentItemIndex(); |
|
284 |
TBool resumeAfterMove = EFalse; |
|
285 |
if (index == 0 && !iPodcastModel.SettingsEngine().DownloadSuspended()) |
|
286 |
{ |
|
287 |
iPodcastModel.ShowEngine().SuspendDownloads(); |
|
288 |
resumeAfterMove = ETrue; |
|
289 |
} |
|
290 |
||
291 |
if (index >= 0 && index < iPodcastModel.ActiveShowList().Count()) |
|
292 |
{ |
|
293 |
TRAP_IGNORE(iPodcastModel.ShowEngine().MoveDownloadDownL(iPodcastModel.ActiveShowList()[index]->Uid())); |
|
294 |
} |
|
295 |
||
296 |
if(resumeAfterMove) |
|
297 |
{ |
|
298 |
iPodcastModel.ShowEngine().ResumeDownloadsL(); |
|
299 |
} |
|
300 |
||
301 |
UpdateListboxItemsL(); |
|
295
67f53e831ab0
Fix for bug 3876
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
265
diff
changeset
|
302 |
iListContainer->Listbox()->SetCurrentItemIndex(index + 1); |
151 | 303 |
} |
304 |
break; |
|
2 | 305 |
case EPodcastSuspendDownloads: |
306 |
{ |
|
265
72305c65726c
Fix for bug 3853
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
243
diff
changeset
|
307 |
iDontUpdateList = ETrue; |
2 | 308 |
iPodcastModel.ShowEngine().SuspendDownloads(); |
265
72305c65726c
Fix for bug 3853
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
243
diff
changeset
|
309 |
iDontUpdateList = EFalse; |
2 | 310 |
UpdateListboxItemsL(); |
311 |
} |
|
312 |
break; |
|
313 |
case EPodcastResumeDownloads: |
|
314 |
{ |
|
265
72305c65726c
Fix for bug 3853
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
243
diff
changeset
|
315 |
iDontUpdateList = ETrue; |
2 | 316 |
iPodcastModel.ShowEngine().ResumeDownloadsL(); |
265
72305c65726c
Fix for bug 3853
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
243
diff
changeset
|
317 |
iDontUpdateList = EFalse; |
2 | 318 |
UpdateListboxItemsL(); |
319 |
} |
|
320 |
break; |
|
301
f5af16df2425
Added Info menu option to queue view
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
295
diff
changeset
|
321 |
case EPodcastShowInfo: |
f5af16df2425
Added Info menu option to queue view
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
295
diff
changeset
|
322 |
{ |
f5af16df2425
Added Info menu option to queue view
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
295
diff
changeset
|
323 |
DisplayShowInfoDialogL(); |
f5af16df2425
Added Info menu option to queue view
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
295
diff
changeset
|
324 |
} |
f5af16df2425
Added Info menu option to queue view
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
295
diff
changeset
|
325 |
break; |
2 | 326 |
default: |
327 |
CPodcastListView::HandleCommandL(aCommand); |
|
328 |
break; |
|
329 |
} |
|
330 |
UpdateToolbar(); |
|
331 |
} |
|
332 |
||
333 |
void CPodcastQueueView::DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane) |
|
163
f94dbd678dda
Fix for bug 3183; merging minor differences with symbian1 branch
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
151
diff
changeset
|
334 |
{ |
295
67f53e831ab0
Fix for bug 3876
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
265
diff
changeset
|
335 |
if(aResourceId == R_PODCAST_QUEUEVIEW_MENU) |
2 | 336 |
{ |
243
44d205147a83
Fix for bug 3730 by switching to proper S3 context menu handling
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
185
diff
changeset
|
337 |
TBool dimDown = (iListContainer->Listbox()->CurrentItemIndex() >= iPodcastModel.ActiveShowList().Count() - 1 ? |
44d205147a83
Fix for bug 3730 by switching to proper S3 context menu handling
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
185
diff
changeset
|
338 |
ETrue : EFalse); |
44d205147a83
Fix for bug 3730 by switching to proper S3 context menu handling
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
185
diff
changeset
|
339 |
TBool dimUp = (iListContainer->Listbox()->CurrentItemIndex() <= 0 ? |
44d205147a83
Fix for bug 3730 by switching to proper S3 context menu handling
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
185
diff
changeset
|
340 |
ETrue : EFalse); |
44d205147a83
Fix for bug 3730 by switching to proper S3 context menu handling
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
185
diff
changeset
|
341 |
|
44d205147a83
Fix for bug 3730 by switching to proper S3 context menu handling
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
185
diff
changeset
|
342 |
TInt index = iListContainer->Listbox()->CurrentItemIndex(); |
44d205147a83
Fix for bug 3730 by switching to proper S3 context menu handling
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
185
diff
changeset
|
343 |
|
44d205147a83
Fix for bug 3730 by switching to proper S3 context menu handling
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
185
diff
changeset
|
344 |
if (index >= 0 && index < iPodcastModel.ActiveShowList().Count()) |
44d205147a83
Fix for bug 3730 by switching to proper S3 context menu handling
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
185
diff
changeset
|
345 |
{ |
44d205147a83
Fix for bug 3730 by switching to proper S3 context menu handling
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
185
diff
changeset
|
346 |
CShowInfo* info = iPodcastModel.ActiveShowList()[index]; |
44d205147a83
Fix for bug 3730 by switching to proper S3 context menu handling
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
185
diff
changeset
|
347 |
|
44d205147a83
Fix for bug 3730 by switching to proper S3 context menu handling
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
185
diff
changeset
|
348 |
aMenuPane->SetItemDimmed(EPodcastMoveDownloadDown, dimDown); |
44d205147a83
Fix for bug 3730 by switching to proper S3 context menu handling
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
185
diff
changeset
|
349 |
aMenuPane->SetItemDimmed(EPodcastMoveDownloadUp, dimUp); |
44d205147a83
Fix for bug 3730 by switching to proper S3 context menu handling
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
185
diff
changeset
|
350 |
|
44d205147a83
Fix for bug 3730 by switching to proper S3 context menu handling
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
185
diff
changeset
|
351 |
} |
2 | 352 |
} |
163
f94dbd678dda
Fix for bug 3183; merging minor differences with symbian1 branch
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
151
diff
changeset
|
353 |
} |
2 | 354 |
|
13 | 355 |
void CPodcastQueueView::UpdateToolbar(TBool aVisible) |
163
f94dbd678dda
Fix for bug 3183; merging minor differences with symbian1 branch
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
151
diff
changeset
|
356 |
{ |
2 | 357 |
CAknToolbar* toolbar = Toolbar(); |
358 |
||
163
f94dbd678dda
Fix for bug 3183; merging minor differences with symbian1 branch
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
151
diff
changeset
|
359 |
if (toolbar) |
f94dbd678dda
Fix for bug 3183; merging minor differences with symbian1 branch
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
151
diff
changeset
|
360 |
{ |
13 | 361 |
RShowInfoArray &fItems = iPodcastModel.ActiveShowList(); |
362 |
TInt itemCnt = fItems.Count(); |
|
163
f94dbd678dda
Fix for bug 3183; merging minor differences with symbian1 branch
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
151
diff
changeset
|
363 |
if (iListContainer->IsVisible()) |
f94dbd678dda
Fix for bug 3183; merging minor differences with symbian1 branch
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
151
diff
changeset
|
364 |
{ |
14
4e75731546eb
Fix so toolbars only change visibility for the visible view
teknolog
parents:
13
diff
changeset
|
365 |
toolbar->SetToolbarVisibility(aVisible); |
163
f94dbd678dda
Fix for bug 3183; merging minor differences with symbian1 branch
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
151
diff
changeset
|
366 |
} |
f94dbd678dda
Fix for bug 3183; merging minor differences with symbian1 branch
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
151
diff
changeset
|
367 |
|
13 | 368 |
toolbar->HideItem(EPodcastRemoveAllDownloads, EFalse, ETrue); |
369 |
toolbar->SetItemDimmed(EPodcastRemoveAllDownloads, itemCnt == 0, ETrue); |
|
370 |
toolbar->HideItem(EPodcastSuspendDownloads,iPodcastModel.SettingsEngine().DownloadSuspended(), ETrue); |
|
371 |
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
|
372 |
toolbar->SetItemDimmed(EPodcastRemoveDownload, itemCnt == 0, ETrue); |
163
f94dbd678dda
Fix for bug 3183; merging minor differences with symbian1 branch
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
151
diff
changeset
|
373 |
} |
13 | 374 |
} |