author | Sebastian Brannstrom <sebastianb@symbian.org> |
Sat, 13 Nov 2010 13:54:36 +0000 | |
branch | 3rded |
changeset 343 | 9c56bf585696 |
parent 206 | 9c3ebab9d24f |
child 390 | d7abecc9d189 |
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 "PodcastFeedView.h" |
|
20 |
#include "PodcastAppUi.h" |
|
21 |
#include "ShowEngine.h" |
|
22 |
#include "SettingsEngine.h" |
|
23 |
#include "PodcastApp.h" |
|
24 |
#include "PodcastUtils.h" |
|
25 |
#include "PodcastFeedViewUpdater.h" |
|
26 |
#include "Podcast.hrh" |
|
27 |
#include <caknfileselectiondialog.h> |
|
28 |
#include <podcast.rsg> |
|
29 |
#include <podcast.mbg> |
|
30 |
#include <gulicon.h> |
|
31 |
#include <aknquerydialog.h> |
|
32 |
#include <BAUTILS.H> |
|
33 |
#include <pathinfo.h> |
|
177
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
34 |
#include <caknmemoryselectiondialog.h> |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
35 |
#include <caknmemoryselectiondialog.h> |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
36 |
#include <caknfilenamepromptdialog.h> |
60 | 37 |
#include "Podcatcher.pan" |
343
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
38 |
#include <aknmessagequerydialog.h> |
2 | 39 |
|
40 |
const TInt KMaxFeedNameLength = 100; |
|
41 |
const TInt KMaxUnplayedFeedsLength =64; |
|
42 |
const TInt KADayInHours = 24; |
|
43 |
#define KMaxMessageLength 200 |
|
44 |
#define KMaxTitleLength 100 |
|
45 |
||
46 |
_LIT(KFeedFormat, "%d\t%S\t%S%S"); |
|
47 |
enum |
|
48 |
{ |
|
49 |
EFeedIcon |
|
50 |
}; |
|
51 |
||
52 |
CPodcastFeedView* CPodcastFeedView::NewL(CPodcastModel& aPodcastModel) |
|
53 |
{ |
|
54 |
CPodcastFeedView* self = CPodcastFeedView::NewLC(aPodcastModel); |
|
55 |
CleanupStack::Pop( self ); |
|
56 |
return self; |
|
57 |
} |
|
58 |
||
59 |
CPodcastFeedView* CPodcastFeedView::NewLC(CPodcastModel& aPodcastModel) |
|
60 |
{ |
|
61 |
CPodcastFeedView* self = new ( ELeave ) CPodcastFeedView(aPodcastModel); |
|
62 |
CleanupStack::PushL( self ); |
|
63 |
self->ConstructL(); |
|
64 |
return self; |
|
65 |
} |
|
66 |
||
67 |
CPodcastFeedView::CPodcastFeedView(CPodcastModel& aPodcastModel):iPodcastModel(aPodcastModel) |
|
68 |
{ |
|
69 |
iFirstActivateAfterLaunch = ETrue; |
|
70 |
} |
|
71 |
#define KAsterisk iEikonEnv->EikAppUi()->Application()->BitmapStoreName() |
|
72 |
void CPodcastFeedView::ConstructL() |
|
73 |
{ |
|
74 |
DP("CPodcastFeedView::ConstructL BEGIN"); |
|
75 |
//_LIT(KAsterisk, "*"); |
|
76 |
BaseConstructL(R_PODCAST_FEEDVIEW); |
|
77 |
iNeverUpdated = iEikonEnv->AllocReadResourceL(R_PODCAST_FEEDS_NEVER_UPDATED); |
|
78 |
iFeedsFormat = iEikonEnv->AllocReadResourceL(R_PODCAST_FEEDS_STATUS_FORMAT); |
|
79 |
CPodcastListView::ConstructL(); |
|
80 |
iPodcastModel.FeedEngine().AddObserver(this); |
|
81 |
CArrayPtr< CGulIcon >* icons = new(ELeave) CArrayPtrFlat< CGulIcon >(1); |
|
82 |
CleanupStack::PushL( icons ); |
|
83 |
||
84 |
CFbsBitmap* bitmap = NULL; |
|
85 |
CFbsBitmap* mask = NULL; |
|
86 |
// Load the bitmap for empty icon |
|
87 |
TFileName fname = KAsterisk; |
|
88 |
TParsePtr parser(fname); |
|
89 |
||
90 |
SetEmptyTextL(R_PODCAST_NO_FEEDS); |
|
91 |
||
92 |
// Load svg.-image and mask with a single call |
|
93 |
AknIconUtils::CreateIconL(bitmap, |
|
94 |
mask, |
|
95 |
iEikonEnv->EikAppUi()->Application()->BitmapStoreName(), |
|
96 |
EMbmPodcastFeed, |
|
97 |
EMbmPodcastFeed_mask); |
|
98 |
||
99 |
/*bitmap = iEikonEnv->CreateBitmapL(KAsterisk,EMbmPodcastFeed_40x40); |
|
100 |
* */ |
|
101 |
CleanupStack::PushL( bitmap ); |
|
102 |
// Load the mask for feed icon |
|
103 |
//mask = iEikonEnv->CreateBitmapL(KAsterisk,EMbmPodcastFeed_40x40m ); |
|
104 |
CleanupStack::PushL( mask ); |
|
105 |
// Append the feed icon to icon array |
|
106 |
icons->AppendL( CGulIcon::NewL( bitmap, mask ) ); |
|
107 |
CleanupStack::Pop(2); // bitmap, mask |
|
343
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
108 |
iListContainer->SetListboxIcons( icons ); |
2 | 109 |
CleanupStack::Pop(icons); // icons |
110 |
iUpdater = CPodcastFeedViewUpdater::NewL(*this); |
|
111 |
DP("CPodcastFeedView::ConstructL END"); |
|
112 |
} |
|
113 |
||
114 |
CPodcastFeedView::~CPodcastFeedView() |
|
115 |
{ |
|
116 |
iPodcastModel.FeedEngine().RemoveObserver(this); |
|
117 |
delete iFeedsFormat; |
|
118 |
delete iNeverUpdated; |
|
119 |
delete iUpdater; |
|
60 | 120 |
iFeedIdForIconArray.Close(); |
2 | 121 |
} |
122 |
||
123 |
void CPodcastFeedView::UpdateItemL(TInt aIndex) |
|
124 |
{ |
|
60 | 125 |
__ASSERT_DEBUG(iListContainer->IsVisible(), Panic(EPodcatcherPanicFeedView)); |
126 |
__ASSERT_ALWAYS(iItemIdArray.Count() > aIndex, Panic(EPodcatcherPanicFeedView)); |
|
2 | 127 |
|
128 |
const RFeedInfoArray& sortedItems = iPodcastModel.FeedEngine().GetSortedFeeds(); |
|
60 | 129 |
__ASSERT_ALWAYS(sortedItems.Count() > aIndex, Panic(EPodcatcherPanicFeedView)); |
2 | 130 |
|
131 |
// Update UID of for the feed at aIndex |
|
132 |
iItemIdArray[aIndex] = sortedItems[aIndex]->Uid(); |
|
133 |
||
134 |
// Prepare data to update the listbox item with |
|
135 |
FormatFeedInfoListBoxItemL(*sortedItems[aIndex], EFalse); |
|
136 |
||
137 |
// If nothing has changed, we are done here |
|
138 |
if (iListboxFormatbuffer == iItemArray->MdcaPoint(aIndex)) |
|
139 |
{ |
|
140 |
return; |
|
141 |
} |
|
142 |
||
143 |
// Something has changed, update the listbox item |
|
144 |
TListItemProperties itemProps; |
|
145 |
itemProps.SetDimmed(EFalse); |
|
146 |
iItemArray->Delete(aIndex); |
|
147 |
iItemArray->InsertL(aIndex, iListboxFormatbuffer); |
|
148 |
iListContainer->Listbox()->ItemDrawer()->SetPropertiesL(aIndex, itemProps); |
|
149 |
// If item is visible, redraw it |
|
150 |
if (iListContainer->Listbox()->TopItemIndex() <= aIndex |
|
151 |
&& iListContainer->Listbox()->BottomItemIndex() >= aIndex) |
|
152 |
{ |
|
153 |
iListContainer->Listbox()->DrawItem(aIndex); |
|
154 |
} |
|
155 |
} |
|
156 |
||
343
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
157 |
void CPodcastFeedView::UpdateItemsComplete() |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
158 |
{ |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
159 |
} |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
160 |
|
2 | 161 |
TUid CPodcastFeedView::Id() const |
162 |
{ |
|
163 |
return KUidPodcastFeedViewID; |
|
164 |
} |
|
165 |
||
166 |
void CPodcastFeedView::DoActivateL(const TVwsViewId& aPrevViewId, |
|
167 |
TUid aCustomMessageId, |
|
168 |
const TDesC8& aCustomMessage) |
|
169 |
{ |
|
343
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
170 |
DP("CPodcastFeedView::DoActivateL BEGIN"); |
2 | 171 |
CPodcastListView::DoActivateL(aPrevViewId, aCustomMessageId, aCustomMessage); |
49
43e204e6ae2e
Fix for accidental merge regressions. Text fixes for tool tip and settings.
teknolog
parents:
33
diff
changeset
|
172 |
|
25
ae65906c4347
Added feature to show showsview on return from queue if previously showed showsview
teknolog
parents:
24
diff
changeset
|
173 |
if (aPrevViewId.iViewUid == KUidPodcastShowsViewID) |
ae65906c4347
Added feature to show showsview on return from queue if previously showed showsview
teknolog
parents:
24
diff
changeset
|
174 |
{ |
ae65906c4347
Added feature to show showsview on return from queue if previously showed showsview
teknolog
parents:
24
diff
changeset
|
175 |
// back key from shows view |
ae65906c4347
Added feature to show showsview on return from queue if previously showed showsview
teknolog
parents:
24
diff
changeset
|
176 |
iViewingShows = EFalse; |
ae65906c4347
Added feature to show showsview on return from queue if previously showed showsview
teknolog
parents:
24
diff
changeset
|
177 |
} |
ae65906c4347
Added feature to show showsview on return from queue if previously showed showsview
teknolog
parents:
24
diff
changeset
|
178 |
|
33
64ed1227e68d
Fix for problem when new download can not be started after one is completed
teknolog
parents:
32
diff
changeset
|
179 |
UpdateListboxItemsL(); |
25
ae65906c4347
Added feature to show showsview on return from queue if previously showed showsview
teknolog
parents:
24
diff
changeset
|
180 |
|
343
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
181 |
// when we receive a UID argument, this comes from search view after |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
182 |
// a new feed has been added |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
183 |
if (aCustomMessageId.iUid != 0) |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
184 |
{ |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
185 |
TUint feedUid = aCustomMessageId.iUid; |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
186 |
ShowItem(feedUid); |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
187 |
TBuf<KMaxMessageLength> message; |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
188 |
iEikonEnv->ReadResourceL(message, R_ADD_FEED_SUCCESS); |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
189 |
if(ShowQueryMessageL(message)) |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
190 |
{ |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
191 |
iPodcastModel.FeedEngine().UpdateFeedL(feedUid); |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
192 |
} |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
193 |
} |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
194 |
|
50 | 195 |
if (iFirstActivateAfterLaunch) |
196 |
{ |
|
197 |
iFirstActivateAfterLaunch = EFalse; |
|
198 |
} |
|
343
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
199 |
|
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
200 |
DP("CPodcastFeedView::DoActivateL END"); |
2 | 201 |
} |
202 |
||
203 |
void CPodcastFeedView::DoDeactivate() |
|
204 |
{ |
|
205 |
iUpdater->StopUpdate(); |
|
206 |
CPodcastListView::DoDeactivate(); |
|
207 |
} |
|
208 |
||
209 |
||
210 |
void CPodcastFeedView::HandleListBoxEventL(CEikListBox* /* aListBox */, TListBoxEvent aEventType) |
|
211 |
{ |
|
343
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
212 |
// DP("CPodcastFeedView::HandleListBoxEventL BEGIN"); |
2 | 213 |
|
214 |
switch(aEventType) |
|
215 |
{ |
|
17
4bcc91e70483
Configuration changes to default podcasts. Changed Download to Get in toolbar
teknolog
parents:
14
diff
changeset
|
216 |
case EEventEnterKeyPressed: |
2 | 217 |
case EEventItemDoubleClicked: |
17
4bcc91e70483
Configuration changes to default podcasts. Changed Download to Get in toolbar
teknolog
parents:
14
diff
changeset
|
218 |
case EEventItemActioned: |
2 | 219 |
{ |
220 |
const RFeedInfoArray* sortedItems = NULL; |
|
221 |
TInt index = iListContainer->Listbox()->CurrentItemIndex(); |
|
222 |
sortedItems = &iPodcastModel.FeedEngine().GetSortedFeeds(); |
|
223 |
||
224 |
if(index >= 0 && index < sortedItems->Count()) |
|
225 |
{ |
|
226 |
iPodcastModel.SetActiveFeedInfo((*sortedItems)[index]); |
|
25
ae65906c4347
Added feature to show showsview on return from queue if previously showed showsview
teknolog
parents:
24
diff
changeset
|
227 |
iViewingShows = ETrue; |
2 | 228 |
AppUi()->ActivateLocalViewL(KUidPodcastShowsViewID, TUid::Uid(0), KNullDesC8()); |
229 |
} |
|
230 |
} |
|
231 |
break; |
|
232 |
default: |
|
233 |
break; |
|
234 |
} |
|
343
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
235 |
// DP("CPodcastFeedView::HandleListBoxEventL END"); |
2 | 236 |
} |
237 |
||
238 |
void CPodcastFeedView::FeedUpdateAllCompleteL(TFeedState /*aState*/) |
|
239 |
{ |
|
343
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
240 |
DP("FeedUpdateAllCompleteL"); |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
241 |
iFeedUpdating = 0; |
2 | 242 |
} |
243 |
||
244 |
void CPodcastFeedView::FeedDownloadStartedL(TFeedState /*aState*/, TUint aFeedUid) |
|
245 |
{ |
|
246 |
// Update status text |
|
343
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
247 |
iFeedUpdating = aFeedUid; |
2 | 248 |
UpdateFeedInfoStatusL(aFeedUid, ETrue); |
249 |
} |
|
250 |
||
251 |
void CPodcastFeedView::FeedDownloadFinishedL(TFeedState aState,TUint aFeedUid, TInt aError) |
|
252 |
{ |
|
253 |
switch(aError) |
|
254 |
{ |
|
255 |
case KErrCouldNotConnect: |
|
256 |
{ |
|
257 |
if(aState == MFeedEngineObserver::EFeedManualUpdate) |
|
258 |
{ |
|
259 |
TBuf<KMaxMessageLength> message; |
|
260 |
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:
26
diff
changeset
|
261 |
ShowErrorMessageL(message); |
2 | 262 |
} |
263 |
} |
|
264 |
break; |
|
265 |
default: // Do nothing |
|
266 |
break; |
|
267 |
} |
|
268 |
UpdateFeedInfoStatusL(aFeedUid, EFalse); |
|
269 |
} |
|
270 |
||
271 |
void CPodcastFeedView::UpdateFeedInfoStatusL(TUint aFeedUid, TBool aIsUpdating) |
|
272 |
{ |
|
343
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
273 |
DP("CPodcastFeedView::UpdateFeedInfoStatusL BEGIN"); |
2 | 274 |
const RFeedInfoArray& feeds = iPodcastModel.FeedEngine().GetSortedFeeds(); |
275 |
||
276 |
// Find the index for the feed i both the feed-array and the listbox |
|
277 |
TInt feedsIdx = KErrNotFound; |
|
278 |
TInt listboxIdx = KErrNotFound; |
|
279 |
for (TInt i = 0; i < feeds.Count(); i++) |
|
280 |
{ |
|
281 |
if (feeds[i]->Uid() == aFeedUid) |
|
282 |
{ |
|
283 |
feedsIdx = i; |
|
284 |
break; |
|
285 |
} |
|
286 |
} |
|
287 |
for (TInt j = 0; j < iItemIdArray.Count(); j++) |
|
288 |
{ |
|
289 |
if (iItemIdArray[j] == aFeedUid) |
|
290 |
{ |
|
291 |
listboxIdx = j; |
|
292 |
break; |
|
293 |
} |
|
294 |
} |
|
295 |
||
296 |
if (feedsIdx != KErrNotFound && listboxIdx != KErrNotFound) |
|
297 |
{ |
|
298 |
// TODO In the long run we want to move the sorting resposibility from |
|
299 |
// CFeedEngine to CPodcastFeedView. |
|
300 |
// Hackish fix to make sure the listbox is sorted. |
|
301 |
if (listboxIdx != feedsIdx) |
|
302 |
{ |
|
303 |
iItemIdArray.Remove(listboxIdx); |
|
304 |
iItemIdArray.InsertL(aFeedUid, feedsIdx); |
|
305 |
iItemArray->Delete(listboxIdx); |
|
306 |
iItemArray->InsertL(feedsIdx, KNullDesC); |
|
307 |
iListContainer->Listbox()->HandleItemAdditionL(); |
|
308 |
} |
|
309 |
// Update the listbox info |
|
310 |
UpdateFeedInfoDataL(feeds[feedsIdx], feedsIdx, aIsUpdating); |
|
311 |
//TODO sort the listbox after update |
|
312 |
} |
|
313 |
// Update all visible listbox items that are affected by sorting and update. |
|
314 |
TInt minIdx = Max(Min(feedsIdx, listboxIdx), iListContainer->Listbox()->TopItemIndex()); |
|
315 |
TInt maxIdx = Min(Max(feedsIdx, listboxIdx), iListContainer->Listbox()->BottomItemIndex()); |
|
316 |
for (TInt k = minIdx; k <= maxIdx; k++) |
|
317 |
{ |
|
318 |
iListContainer->Listbox()->DrawItem(k); |
|
319 |
} |
|
343
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
320 |
DP("CPodcastFeedView::UpdateFeedInfoStatusL END"); |
2 | 321 |
} |
322 |
||
323 |
void CPodcastFeedView::FormatFeedInfoListBoxItemL(CFeedInfo& aFeedInfo, TBool aIsUpdating) |
|
324 |
{ |
|
343
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
325 |
DP("CPodcastFeedView::FormatFeedInfoListBoxItemL BEGIN"); |
2 | 326 |
TBuf<KMaxShortDateFormatSpec*2> updatedDate; |
327 |
TBuf<KMaxUnplayedFeedsLength> unplayedShows; |
|
328 |
TUint unplayedCount = 0; |
|
329 |
TUint showCount = 0; |
|
330 |
TInt iconIndex = EFeedIcon; |
|
331 |
||
332 |
if(aIsUpdating) |
|
333 |
{ |
|
334 |
iEikonEnv->ReadResourceL(updatedDate, R_PODCAST_FEEDS_IS_UPDATING); |
|
335 |
unplayedShows = KNullDesC(); |
|
336 |
} |
|
337 |
else |
|
338 |
{ |
|
60 | 339 |
// we will get a leave if there are no shows for this feed, for instance, which is fine |
340 |
TRAP_IGNORE(iPodcastModel.FeedEngine().GetStatsByFeedL(aFeedInfo.Uid(), showCount, unplayedCount)); |
|
2 | 341 |
|
342 |
if (unplayedCount) { |
|
343 |
unplayedShows.Format(*iFeedsFormat, unplayedCount); |
|
344 |
} else { |
|
345 |
unplayedShows.Zero(); |
|
346 |
} |
|
347 |
||
348 |
if (aFeedInfo.LastUpdated().Int64() == 0) |
|
349 |
{ |
|
350 |
updatedDate.Copy(*iNeverUpdated); |
|
351 |
unplayedShows.Zero(); |
|
352 |
} |
|
353 |
else |
|
354 |
{ |
|
355 |
TTime now; |
|
356 |
TTimeIntervalHours interval; |
|
357 |
now.HomeTime(); |
|
358 |
now.HoursFrom(aFeedInfo.LastUpdated(), interval); |
|
359 |
if (interval.Int() < KADayInHours) |
|
360 |
{ |
|
361 |
aFeedInfo.LastUpdated().FormatL(updatedDate, KTimeFormat()); |
|
362 |
} |
|
363 |
else |
|
364 |
{ |
|
365 |
aFeedInfo.LastUpdated().FormatL(updatedDate, KDateFormatShort()); |
|
366 |
} |
|
367 |
} |
|
32
26a3f2dfba08
Fix for bug where we always load the feed icon a large number of times
teknolog
parents:
26
diff
changeset
|
368 |
|
26a3f2dfba08
Fix for bug where we always load the feed icon a large number of times
teknolog
parents:
26
diff
changeset
|
369 |
if(aFeedInfo.LastError() != KErrNone) |
26a3f2dfba08
Fix for bug where we always load the feed icon a large number of times
teknolog
parents:
26
diff
changeset
|
370 |
{ |
26a3f2dfba08
Fix for bug where we always load the feed icon a large number of times
teknolog
parents:
26
diff
changeset
|
371 |
GetFeedErrorText(unplayedShows, aFeedInfo.LastError()); |
60 | 372 |
updatedDate.Zero(); |
32
26a3f2dfba08
Fix for bug where we always load the feed icon a large number of times
teknolog
parents:
26
diff
changeset
|
373 |
} |
2 | 374 |
} |
343
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
375 |
|
60 | 376 |
iconIndex = iFeedIdForIconArray.Find(aFeedInfo.Uid()); |
343
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
377 |
DP1(" iconIndex = %d", iconIndex); |
60 | 378 |
if(iconIndex == KErrNotFound && aFeedInfo.FeedIcon() != NULL && aFeedInfo.ImageFileName().Length() > 0 && |
379 |
aFeedInfo.FeedIcon()->SizeInPixels().iHeight > 0 && |
|
380 |
aFeedInfo.FeedIcon()->SizeInPixels().iWidth > 0) |
|
381 |
{ |
|
382 |
// Hopefully temporary haxx to prevent double delete. I would prefer if |
|
383 |
// this could be solved with a little better design. |
|
384 |
CFbsBitmap* bmpCopy = new (ELeave) CFbsBitmap; |
|
385 |
CleanupStack::PushL(bmpCopy); |
|
386 |
bmpCopy->Duplicate(aFeedInfo.FeedIcon()->Handle()); |
|
343
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
387 |
CArrayPtr<CGulIcon>* icons = iListContainer->ListboxIcons(); |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
388 |
|
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
389 |
icons->AppendL( CGulIcon::NewL(AknIconUtils::CreateIconL(bmpCopy), NULL)); |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
390 |
|
60 | 391 |
iFeedIdForIconArray.Append(aFeedInfo.Uid()); |
392 |
CleanupStack::Pop(bmpCopy); |
|
393 |
iconIndex = icons->Count()-1; |
|
394 |
} |
|
395 |
else |
|
396 |
{ |
|
397 |
iconIndex++; |
|
398 |
} |
|
399 |
||
400 |
if (unplayedShows.Length() > 0 && updatedDate.Length() > 0) { |
|
2 | 401 |
unplayedShows.Insert(0,_L(", ")); |
402 |
} |
|
343
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
403 |
|
2 | 404 |
iListboxFormatbuffer.Format(KFeedFormat(), iconIndex, &(aFeedInfo.Title()), &updatedDate, &unplayedShows); |
343
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
405 |
DP("CPodcastFeedView::FormatFeedInfoListBoxItemL END"); |
2 | 406 |
} |
407 |
||
60 | 408 |
void CPodcastFeedView::ImageOperationCompleteL(TInt aError, TUint aHandle, CPodcastModel& /*aPodcastModel*/) |
2 | 409 |
{ |
410 |
if (aError == KErrNone) { |
|
60 | 411 |
UpdateFeedInfoStatusL(aHandle, EFalse); |
412 |
} |
|
2 | 413 |
} |
414 |
||
415 |
void CPodcastFeedView::UpdateFeedInfoDataL(CFeedInfo* aFeedInfo, TInt aIndex, TBool aIsUpdating ) |
|
343
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
416 |
{ |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
417 |
DP("CPodcastFeedView::UpdateFeedInfoDataL BEGIN"); |
2 | 418 |
TListItemProperties itemProps; |
419 |
itemProps.SetDimmed(aIsUpdating); |
|
420 |
FormatFeedInfoListBoxItemL(*aFeedInfo, aIsUpdating); |
|
421 |
||
422 |
TPtrC compareTo((*iItemArray)[aIndex]); |
|
423 |
||
424 |
if (iListboxFormatbuffer.Compare(compareTo) != 0) { |
|
425 |
iItemArray->Delete(aIndex); |
|
426 |
if(aIndex>= iItemArray->MdcaCount()) |
|
427 |
{ |
|
428 |
iItemArray->AppendL(iListboxFormatbuffer); |
|
429 |
} |
|
430 |
else |
|
431 |
{ |
|
432 |
iItemArray->InsertL(aIndex, iListboxFormatbuffer); |
|
433 |
} |
|
434 |
} |
|
343
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
435 |
//iListContainer->Listbox()->ItemDrawer()->SetPropertiesL(aIndex, itemProps); |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
436 |
DP("CPodcastFeedView::UpdateFeedInfoDataL END"); |
2 | 437 |
} |
438 |
||
439 |
||
440 |
void CPodcastFeedView::UpdateListboxItemsL() |
|
441 |
{ |
|
164
000f9fc147b2
Catch up with default branch; New v 27 SIS
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
154
diff
changeset
|
442 |
DP("CPodcastFeedView::UpdateListboxItemsL BEGIN"); |
2 | 443 |
// No reason to do any work if it isn't going to show.. |
444 |
if(!iListContainer->IsVisible()) |
|
445 |
{ |
|
446 |
return; |
|
447 |
} |
|
448 |
||
449 |
TInt nbrItems = iPodcastModel.FeedEngine().GetSortedFeeds().Count(); |
|
450 |
if (nbrItems > 0) |
|
451 |
{ |
|
452 |
// Ensure that there are as many elements in iItemIdArray as in FeedEngine |
|
453 |
while (iItemIdArray.Count() < nbrItems) |
|
454 |
{ |
|
455 |
iItemIdArray.AppendL(0); |
|
456 |
} |
|
457 |
while (iItemIdArray.Count() > nbrItems) |
|
458 |
{ |
|
459 |
iItemIdArray.Remove(iItemIdArray.Count() - 1); |
|
460 |
} |
|
461 |
||
462 |
// Ensure that there are as many elements in iItemArray as in FeedEngine |
|
463 |
while (iItemArray->Count() < nbrItems) |
|
464 |
{ |
|
465 |
iItemArray->AppendL(KNullDesC); |
|
466 |
TListItemProperties itemProps; |
|
467 |
iListContainer->Listbox()->ItemDrawer()->SetPropertiesL(iItemArray->Count() - 1, itemProps); |
|
468 |
} |
|
469 |
while (iItemArray->Count() > nbrItems) |
|
470 |
{ |
|
471 |
iItemArray->Delete(iItemArray->Count() - 1); |
|
472 |
} |
|
473 |
iUpdater->StartUpdate(nbrItems); |
|
474 |
} |
|
475 |
else |
|
476 |
{ |
|
477 |
// No feeds at all in the list , add dummy list item |
|
478 |
TBuf<KMaxFeedNameLength> itemName; |
|
479 |
iEikonEnv->ReadResourceL(itemName, R_PODCAST_FEEDS_NO_FEEDS); |
|
480 |
iItemArray->Reset(); |
|
481 |
iItemIdArray.Reset(); |
|
482 |
||
483 |
TListItemProperties itemProps; |
|
484 |
itemProps.SetDimmed(ETrue); |
|
485 |
itemProps.SetHiddenSelection(ETrue); |
|
486 |
iListContainer->Listbox()->ItemDrawer()->SetPropertiesL(0, itemProps); |
|
487 |
} |
|
164
000f9fc147b2
Catch up with default branch; New v 27 SIS
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
154
diff
changeset
|
488 |
iListContainer->Listbox()->HandleItemAdditionL(); |
000f9fc147b2
Catch up with default branch; New v 27 SIS
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
154
diff
changeset
|
489 |
DP("CPodcastFeedView::UpdateListboxItemsL END"); |
2 | 490 |
} |
491 |
||
492 |
/** |
|
493 |
* Command handling function intended for overriding by sub classes. |
|
494 |
* Default implementation is empty. |
|
495 |
* @param aCommand ID of the command to respond to. |
|
496 |
*/ |
|
497 |
void CPodcastFeedView::HandleCommandL(TInt aCommand) |
|
498 |
{ |
|
164
000f9fc147b2
Catch up with default branch; New v 27 SIS
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
154
diff
changeset
|
499 |
DP("CPodcastFeedView::HandleCommandL BEGIN"); |
000f9fc147b2
Catch up with default branch; New v 27 SIS
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
154
diff
changeset
|
500 |
|
2 | 501 |
switch(aCommand) |
502 |
{ |
|
503 |
case EPodcastAddFeed: |
|
504 |
HandleAddFeedL(); |
|
505 |
break; |
|
506 |
case EPodcastImportFeeds: |
|
507 |
HandleImportFeedsL(); |
|
508 |
break; |
|
509 |
case EPodcastExportFeeds: |
|
510 |
HandleExportFeedsL(); |
|
511 |
break; |
|
512 |
case EPodcastEditFeed: |
|
513 |
HandleEditFeedL(); |
|
514 |
break; |
|
515 |
case EPodcastDeleteFeedHardware: |
|
516 |
case EPodcastDeleteFeed: |
|
517 |
HandleRemoveFeedL(); |
|
518 |
break; |
|
519 |
case EPodcastUpdateAllFeeds: |
|
520 |
{ |
|
521 |
iPodcastModel.FeedEngine().UpdateAllFeedsL(); |
|
522 |
}break; |
|
523 |
case EPodcastUpdateFeed: |
|
524 |
{ |
|
525 |
HandleUpdateFeedL(); |
|
526 |
}break; |
|
527 |
case EPodcastCancelUpdateAllFeeds: |
|
528 |
{ |
|
343
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
529 |
if(iFeedUpdating) |
2 | 530 |
{ |
531 |
iPodcastModel.FeedEngine().CancelUpdateAllFeeds(); |
|
532 |
} |
|
533 |
}break; |
|
343
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
534 |
case EPodcastShowInfo: |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
535 |
DisplayFeedInfoDialogL(); |
2 | 536 |
break; |
537 |
default: |
|
538 |
CPodcastListView::HandleCommandL(aCommand); |
|
539 |
break; |
|
540 |
} |
|
26 | 541 |
|
164
000f9fc147b2
Catch up with default branch; New v 27 SIS
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
154
diff
changeset
|
542 |
DP("CPodcastFeedView::HandleCommandL END"); |
2 | 543 |
} |
544 |
||
343
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
545 |
void CPodcastFeedView::DisplayFeedInfoDialogL() |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
546 |
{ |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
547 |
const RFeedInfoArray* sortedItems = NULL; |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
548 |
TInt index = iListContainer->Listbox()->CurrentItemIndex(); |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
549 |
sortedItems = &iPodcastModel.FeedEngine().GetSortedFeeds(); |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
550 |
|
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
551 |
if(index >= 0 && index < sortedItems->Count()) |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
552 |
{ |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
553 |
CFeedInfo *info = (*sortedItems)[index]; |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
554 |
HBufC* description = info->Description().AllocL(); |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
555 |
HBufC* title = info->Title().AllocL(); |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
556 |
CAknMessageQueryDialog* note = new ( ELeave ) CAknMessageQueryDialog( description, title ); |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
557 |
|
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
558 |
note->PrepareLC( R_SHOW_INFO_NOTE ); // Adds to CleanupStack |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
559 |
note->RunLD(); |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
560 |
} |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
561 |
} |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
562 |
|
2 | 563 |
void CPodcastFeedView::HandleAddFeedL() |
564 |
{ |
|
206
9c3ebab9d24f
Bug 2865 - added option to search or enter URL for feed adding
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
565 |
TInt selection; |
9c3ebab9d24f
Bug 2865 - added option to search or enter URL for feed adding
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
566 |
CDesCArrayFlat* array = iCoeEnv->ReadDesC16ArrayResourceL(R_FEEDVIEW_ADD_URL_OR_SEARCH_ARRAY ); |
9c3ebab9d24f
Bug 2865 - added option to search or enter URL for feed adding
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
567 |
CleanupStack::PushL( array ); |
9c3ebab9d24f
Bug 2865 - added option to search or enter URL for feed adding
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
568 |
|
9c3ebab9d24f
Bug 2865 - added option to search or enter URL for feed adding
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
569 |
CAknListQueryDialog* dialog = new ( ELeave ) CAknListQueryDialog( &selection ); |
9c3ebab9d24f
Bug 2865 - added option to search or enter URL for feed adding
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
570 |
CleanupStack::PushL( dialog ); |
9c3ebab9d24f
Bug 2865 - added option to search or enter URL for feed adding
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
571 |
dialog->PrepareLC( R_FEEDVIEW_ADD_URL_OR_SEARCH ); |
9c3ebab9d24f
Bug 2865 - added option to search or enter URL for feed adding
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
572 |
CleanupStack::Pop( dialog ); |
9c3ebab9d24f
Bug 2865 - added option to search or enter URL for feed adding
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
573 |
|
9c3ebab9d24f
Bug 2865 - added option to search or enter URL for feed adding
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
574 |
dialog->SetItemTextArray( array ); |
9c3ebab9d24f
Bug 2865 - added option to search or enter URL for feed adding
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
575 |
dialog->SetOwnershipType( ELbmDoesNotOwnItemArray ); |
9c3ebab9d24f
Bug 2865 - added option to search or enter URL for feed adding
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
576 |
|
9c3ebab9d24f
Bug 2865 - added option to search or enter URL for feed adding
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
577 |
if ( dialog->RunLD() ) |
9c3ebab9d24f
Bug 2865 - added option to search or enter URL for feed adding
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
578 |
{ |
9c3ebab9d24f
Bug 2865 - added option to search or enter URL for feed adding
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
579 |
if (selection == 0) |
9c3ebab9d24f
Bug 2865 - added option to search or enter URL for feed adding
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
580 |
{ |
9c3ebab9d24f
Bug 2865 - added option to search or enter URL for feed adding
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
581 |
// Enter URL selected |
9c3ebab9d24f
Bug 2865 - added option to search or enter URL for feed adding
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
582 |
HandleAddFeedUrlL(); |
9c3ebab9d24f
Bug 2865 - added option to search or enter URL for feed adding
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
583 |
} |
9c3ebab9d24f
Bug 2865 - added option to search or enter URL for feed adding
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
584 |
else |
9c3ebab9d24f
Bug 2865 - added option to search or enter URL for feed adding
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
585 |
{ |
9c3ebab9d24f
Bug 2865 - added option to search or enter URL for feed adding
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
586 |
// Search selected |
9c3ebab9d24f
Bug 2865 - added option to search or enter URL for feed adding
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
587 |
HandleAddFeedSearchL(); |
9c3ebab9d24f
Bug 2865 - added option to search or enter URL for feed adding
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
588 |
} |
9c3ebab9d24f
Bug 2865 - added option to search or enter URL for feed adding
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
589 |
} |
9c3ebab9d24f
Bug 2865 - added option to search or enter URL for feed adding
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
590 |
CleanupStack::PopAndDestroy( array ); |
9c3ebab9d24f
Bug 2865 - added option to search or enter URL for feed adding
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
591 |
} |
9c3ebab9d24f
Bug 2865 - added option to search or enter URL for feed adding
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
592 |
|
343
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
593 |
void CPodcastFeedView::ShowItem(TUint aUid) |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
594 |
{ |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
595 |
TInt listIndex = -1; |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
596 |
for (TUint i=0;i<iItemIdArray.Count();i++) |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
597 |
{ |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
598 |
if (iItemIdArray[i] == aUid) |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
599 |
{ |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
600 |
listIndex = i; |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
601 |
} |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
602 |
} |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
603 |
|
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
604 |
if (listIndex != -1) |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
605 |
iListContainer->Listbox()->ScrollToMakeItemVisible(listIndex); |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
606 |
|
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
607 |
} |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
608 |
|
206
9c3ebab9d24f
Bug 2865 - added option to search or enter URL for feed adding
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
609 |
void CPodcastFeedView::HandleAddFeedUrlL() |
9c3ebab9d24f
Bug 2865 - added option to search or enter URL for feed adding
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
610 |
{ |
2 | 611 |
TBuf<KFeedUrlLength> url; |
612 |
url.Copy(_L("http://")); |
|
206
9c3ebab9d24f
Bug 2865 - added option to search or enter URL for feed adding
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
613 |
|
2 | 614 |
CAknTextQueryDialog * dlg =CAknTextQueryDialog::NewL(url); |
615 |
dlg->PrepareLC(R_PODCAST_ADD_FEED_DLG); |
|
206
9c3ebab9d24f
Bug 2865 - added option to search or enter URL for feed adding
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
616 |
|
2 | 617 |
HBufC* prompt = iEikonEnv->AllocReadResourceLC(R_PODCAST_ADDFEED_PROMPT); |
618 |
dlg->SetPromptL(*prompt); |
|
619 |
CleanupStack::PopAndDestroy(prompt); |
|
620 |
||
621 |
if(dlg->RunLD()) |
|
622 |
{ |
|
206
9c3ebab9d24f
Bug 2865 - added option to search or enter URL for feed adding
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
623 |
PodcastUtils::FixProtocolsL(url); |
9c3ebab9d24f
Bug 2865 - added option to search or enter URL for feed adding
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
624 |
|
9c3ebab9d24f
Bug 2865 - added option to search or enter URL for feed adding
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
625 |
CFeedInfo* newFeedInfo = CFeedInfo::NewL(); |
9c3ebab9d24f
Bug 2865 - added option to search or enter URL for feed adding
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
626 |
CleanupStack::PushL(newFeedInfo); |
9c3ebab9d24f
Bug 2865 - added option to search or enter URL for feed adding
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
627 |
newFeedInfo->SetUrlL(url); |
9c3ebab9d24f
Bug 2865 - added option to search or enter URL for feed adding
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
628 |
newFeedInfo->SetTitleL(newFeedInfo->Url()); |
2 | 629 |
|
206
9c3ebab9d24f
Bug 2865 - added option to search or enter URL for feed adding
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
630 |
TBool added = iPodcastModel.FeedEngine().AddFeedL(*newFeedInfo); |
9c3ebab9d24f
Bug 2865 - added option to search or enter URL for feed adding
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
631 |
|
9c3ebab9d24f
Bug 2865 - added option to search or enter URL for feed adding
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
632 |
if (added) |
2 | 633 |
{ |
206
9c3ebab9d24f
Bug 2865 - added option to search or enter URL for feed adding
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
634 |
UpdateListboxItemsL(); |
154
fd105a5a9dad
Fix for bug 3051 - search wait dialog doesn't close if search fails
teknolog
parents:
70
diff
changeset
|
635 |
|
206
9c3ebab9d24f
Bug 2865 - added option to search or enter URL for feed adding
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
636 |
// ask if users wants to update it now |
9c3ebab9d24f
Bug 2865 - added option to search or enter URL for feed adding
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
637 |
TBuf<KMaxMessageLength> message; |
9c3ebab9d24f
Bug 2865 - added option to search or enter URL for feed adding
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
638 |
iEikonEnv->ReadResourceL(message, R_ADD_FEED_SUCCESS); |
9c3ebab9d24f
Bug 2865 - added option to search or enter URL for feed adding
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
639 |
if(ShowQueryMessageL(message)) |
154
fd105a5a9dad
Fix for bug 3051 - search wait dialog doesn't close if search fails
teknolog
parents:
70
diff
changeset
|
640 |
{ |
343
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
641 |
ShowItem(newFeedInfo->Uid()); |
206
9c3ebab9d24f
Bug 2865 - added option to search or enter URL for feed adding
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
642 |
iPodcastModel.FeedEngine().UpdateFeedL(newFeedInfo->Uid()); |
154
fd105a5a9dad
Fix for bug 3051 - search wait dialog doesn't close if search fails
teknolog
parents:
70
diff
changeset
|
643 |
} |
2 | 644 |
} |
645 |
else |
|
646 |
{ |
|
206
9c3ebab9d24f
Bug 2865 - added option to search or enter URL for feed adding
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
647 |
TBuf<KMaxMessageLength> message; |
9c3ebab9d24f
Bug 2865 - added option to search or enter URL for feed adding
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
648 |
iEikonEnv->ReadResourceL(message, R_ADD_FEED_EXISTS); |
9c3ebab9d24f
Bug 2865 - added option to search or enter URL for feed adding
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
649 |
ShowErrorMessageL(message); |
9c3ebab9d24f
Bug 2865 - added option to search or enter URL for feed adding
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
650 |
} |
9c3ebab9d24f
Bug 2865 - added option to search or enter URL for feed adding
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
651 |
|
9c3ebab9d24f
Bug 2865 - added option to search or enter URL for feed adding
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
652 |
CleanupStack::PopAndDestroy(newFeedInfo); |
9c3ebab9d24f
Bug 2865 - added option to search or enter URL for feed adding
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
653 |
} |
9c3ebab9d24f
Bug 2865 - added option to search or enter URL for feed adding
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
654 |
} |
9c3ebab9d24f
Bug 2865 - added option to search or enter URL for feed adding
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
655 |
|
9c3ebab9d24f
Bug 2865 - added option to search or enter URL for feed adding
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
656 |
void CPodcastFeedView::HandleAddFeedSearchL() |
9c3ebab9d24f
Bug 2865 - added option to search or enter URL for feed adding
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
657 |
{ |
9c3ebab9d24f
Bug 2865 - added option to search or enter URL for feed adding
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
658 |
TBuf<KFeedUrlLength> url; |
2 | 659 |
|
206
9c3ebab9d24f
Bug 2865 - added option to search or enter URL for feed adding
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
660 |
CAknTextQueryDialog * dlg =CAknTextQueryDialog::NewL(url); |
9c3ebab9d24f
Bug 2865 - added option to search or enter URL for feed adding
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
661 |
dlg->PrepareLC(R_PODCAST_ADD_FEED_DLG); |
9c3ebab9d24f
Bug 2865 - added option to search or enter URL for feed adding
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
662 |
|
9c3ebab9d24f
Bug 2865 - added option to search or enter URL for feed adding
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
663 |
HBufC* prompt = iEikonEnv->AllocReadResourceLC(R_PODCAST_SEARCHFEED_PROMPT); |
9c3ebab9d24f
Bug 2865 - added option to search or enter URL for feed adding
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
664 |
dlg->SetPromptL(*prompt); |
343
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
665 |
dlg->SetPredictiveTextInputPermitted(ETrue); |
206
9c3ebab9d24f
Bug 2865 - added option to search or enter URL for feed adding
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
666 |
CleanupStack::PopAndDestroy(prompt); |
9c3ebab9d24f
Bug 2865 - added option to search or enter URL for feed adding
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
667 |
|
9c3ebab9d24f
Bug 2865 - added option to search or enter URL for feed adding
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
668 |
if(dlg->RunLD()) |
9c3ebab9d24f
Bug 2865 - added option to search or enter URL for feed adding
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
669 |
{ |
9c3ebab9d24f
Bug 2865 - added option to search or enter URL for feed adding
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
670 |
HBufC *waitText = iEikonEnv->AllocReadResourceLC(R_SEARCHING); |
9c3ebab9d24f
Bug 2865 - added option to search or enter URL for feed adding
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
671 |
ShowWaitDialogL(*waitText); |
9c3ebab9d24f
Bug 2865 - added option to search or enter URL for feed adding
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
672 |
CleanupStack::PopAndDestroy(waitText); |
9c3ebab9d24f
Bug 2865 - added option to search or enter URL for feed adding
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
673 |
|
9c3ebab9d24f
Bug 2865 - added option to search or enter URL for feed adding
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
674 |
iOpmlState = EOpmlSearching; |
9c3ebab9d24f
Bug 2865 - added option to search or enter URL for feed adding
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
675 |
TRAPD(err, iPodcastModel.FeedEngine().SearchForFeedL(url)); |
9c3ebab9d24f
Bug 2865 - added option to search or enter URL for feed adding
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
676 |
|
9c3ebab9d24f
Bug 2865 - added option to search or enter URL for feed adding
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
677 |
if (err != KErrNone) |
9c3ebab9d24f
Bug 2865 - added option to search or enter URL for feed adding
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
678 |
{ |
9c3ebab9d24f
Bug 2865 - added option to search or enter URL for feed adding
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
679 |
delete iWaitDialog; |
9c3ebab9d24f
Bug 2865 - added option to search or enter URL for feed adding
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
177
diff
changeset
|
680 |
iOpmlState = EOpmlIdle; |
2 | 681 |
} |
682 |
} |
|
683 |
} |
|
684 |
||
685 |
void CPodcastFeedView::HandleEditFeedL() |
|
686 |
{ |
|
687 |
TInt index = iListContainer->Listbox()->CurrentItemIndex(); |
|
688 |
||
689 |
if(index < iItemArray->MdcaCount() && index >= 0) |
|
690 |
{ |
|
691 |
CFeedInfo *info = iPodcastModel.FeedEngine().GetSortedFeeds()[index]; |
|
692 |
||
693 |
TBuf<KFeedTitleLength> title; |
|
694 |
title.Copy(info->Title()); |
|
695 |
TBuf<KFeedUrlLength> url; |
|
696 |
url.Copy(info->Url()); |
|
697 |
CAknMultiLineDataQueryDialog *dlg = CAknMultiLineDataQueryDialog ::NewL(title, url); |
|
698 |
||
699 |
if (dlg->ExecuteLD(R_PODCAST_EDIT_FEED_DLG)) |
|
700 |
{ |
|
701 |
||
702 |
if(info->Url().Compare(url) != 0) |
|
703 |
{ |
|
704 |
TBuf<KMaxMessageLength> dlgMessage; |
|
705 |
iEikonEnv->ReadResourceL(dlgMessage, R_ADD_FEED_REPLACE); |
|
706 |
||
707 |
// Ask the user if it is OK to remove all shows |
|
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
26
diff
changeset
|
708 |
if ( ShowQueryMessageL(dlgMessage)) |
2 | 709 |
{ |
710 |
PodcastUtils::FixProtocolsL(url); |
|
711 |
||
712 |
//----- HACK ---- // |
|
713 |
CFeedInfo* temp = CFeedInfo::NewLC(); |
|
714 |
temp->SetUrlL(url); |
|
715 |
TBool added = iPodcastModel.FeedEngine().AddFeedL(*temp); |
|
716 |
if (added) { |
|
717 |
// The Feed URL did not exist |
|
718 |
// Remove the temp entry so that the correct entry could be changed |
|
719 |
iPodcastModel.FeedEngine().RemoveFeedL(temp->Uid()); |
|
720 |
||
12 | 721 |
// we remove the existing feed |
722 |
iPodcastModel.FeedEngine().RemoveFeedL(info->Uid()); |
|
723 |
||
724 |
CFeedInfo* newFeed = CFeedInfo::NewLC(); |
|
725 |
newFeed->SetUrlL(url); |
|
726 |
newFeed->SetTitleL(title); |
|
727 |
||
728 |
iPodcastModel.FeedEngine().AddFeedL(*newFeed); |
|
729 |
CleanupStack::PopAndDestroy(newFeed); |
|
2 | 730 |
UpdateListboxItemsL(); |
731 |
} else { |
|
732 |
// the feed existed. Object deleted in AddFeed. |
|
733 |
TBuf<KMaxMessageLength> dlgMessage; |
|
734 |
iEikonEnv->ReadResourceL(dlgMessage, R_ADD_FEED_EXISTS); |
|
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
26
diff
changeset
|
735 |
ShowErrorMessageL(dlgMessage); |
2 | 736 |
} |
737 |
CleanupStack::PopAndDestroy(temp); |
|
738 |
} |
|
739 |
} else { // no url change, maybe title? |
|
740 |
// Update the title |
|
741 |
if (info->Title().Compare(title) != 0) |
|
742 |
{ |
|
743 |
info->SetTitleL(title); |
|
744 |
info->SetCustomTitle(); |
|
60 | 745 |
iPodcastModel.FeedEngine().UpdateFeedInfoL(info); |
2 | 746 |
UpdateListboxItemsL(); |
747 |
} |
|
748 |
} |
|
749 |
} |
|
750 |
} |
|
751 |
} |
|
752 |
||
753 |
void CPodcastFeedView::HandleRemoveFeedL() |
|
754 |
{ |
|
755 |
if(iListContainer->Listbox() != NULL) |
|
756 |
{ |
|
757 |
TInt index = iListContainer->Listbox()->CurrentItemIndex(); |
|
758 |
||
759 |
if(index < iItemArray->MdcaCount() && index >= 0) |
|
760 |
{ |
|
761 |
CFeedInfo *info = iPodcastModel.FeedEngine().GetFeedInfoByUid(iItemIdArray[index]); |
|
762 |
TBuf<KMaxMessageLength> templ; |
|
763 |
TBuf<KMaxMessageLength> message; |
|
764 |
iEikonEnv->ReadResourceL(templ, R_PODCAST_REMOVE_FEED_PROMPT); |
|
765 |
message.Format(templ, &info->Title()); |
|
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
26
diff
changeset
|
766 |
if(ShowQueryMessageL(message)) |
2 | 767 |
{ |
768 |
iPodcastModel.FeedEngine().RemoveFeedL(iItemIdArray[index]); |
|
769 |
iItemArray->Delete(index); |
|
770 |
iItemIdArray.Remove(index); |
|
771 |
iListContainer->Listbox()->HandleItemRemovalL(); |
|
772 |
iListContainer->Listbox()->DrawNow(); |
|
773 |
} |
|
774 |
} |
|
775 |
UpdateListboxItemsL(); |
|
776 |
} |
|
777 |
} |
|
778 |
||
779 |
void CPodcastFeedView::HandleUpdateFeedL() |
|
780 |
{ |
|
781 |
TInt index = iListContainer->Listbox()->CurrentItemIndex(); |
|
782 |
||
783 |
if(index < iItemArray->MdcaCount() && index >= 0) |
|
784 |
{ |
|
785 |
CFeedInfo *info = iPodcastModel.FeedEngine().GetSortedFeeds()[index]; |
|
786 |
iPodcastModel.FeedEngine().UpdateFeedL(info->Uid()); |
|
787 |
} |
|
788 |
} |
|
789 |
||
790 |
void CPodcastFeedView::HandleImportFeedsL() |
|
791 |
{ |
|
177
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
792 |
CAknMemorySelectionDialog* memDlg = |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
793 |
CAknMemorySelectionDialog::NewL(ECFDDialogTypeNormal, ETrue); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
794 |
CleanupStack::PushL(memDlg); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
795 |
CAknMemorySelectionDialog::TMemory memory = |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
796 |
CAknMemorySelectionDialog::EPhoneMemory; |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
797 |
|
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
798 |
if (memDlg->ExecuteL(memory)) |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
799 |
{ |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
800 |
TFileName importName; |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
801 |
|
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
802 |
if (memory==CAknMemorySelectionDialog::EMemoryCard) |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
803 |
{ |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
804 |
importName = PathInfo:: MemoryCardRootPath(); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
805 |
} |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
806 |
else |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
807 |
{ |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
808 |
importName = PathInfo:: PhoneMemoryRootPath(); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
809 |
} |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
810 |
|
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
811 |
CAknFileSelectionDialog* dlg = CAknFileSelectionDialog::NewL(ECFDDialogTypeNormal, R_PODCAST_IMPORT_PODCAST); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
812 |
CleanupStack::PushL(dlg); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
813 |
|
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
814 |
dlg->SetDefaultFolderL(importName); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
815 |
|
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
816 |
if(dlg->ExecuteL(importName)) |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
817 |
{ |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
818 |
if(importName.Length()>0) |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
819 |
{ |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
820 |
iPodcastModel.FeedEngine().ImportFeedsL(importName); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
821 |
UpdateListboxItemsL(); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
822 |
} |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
823 |
} |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
824 |
CleanupStack::PopAndDestroy(dlg); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
825 |
} |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
826 |
CleanupStack::PopAndDestroy(memDlg); |
2 | 827 |
} |
828 |
||
829 |
void CPodcastFeedView::HandleExportFeedsL() |
|
830 |
{ |
|
177
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
831 |
CAknMemorySelectionDialog* memDlg = |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
832 |
CAknMemorySelectionDialog::NewL(ECFDDialogTypeSave, ETrue); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
833 |
CleanupStack::PushL(memDlg); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
834 |
CAknMemorySelectionDialog::TMemory memory = |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
835 |
CAknMemorySelectionDialog::EPhoneMemory; |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
836 |
|
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
837 |
if (memDlg->ExecuteL(memory)) |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
838 |
{ |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
839 |
TFileName pathName; |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
840 |
|
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
841 |
if (memory==CAknMemorySelectionDialog::EMemoryCard) |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
842 |
{ |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
843 |
pathName = PathInfo::MemoryCardRootPath(); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
844 |
} |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
845 |
else |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
846 |
{ |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
847 |
pathName = PathInfo::PhoneMemoryRootPath(); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
848 |
} |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
849 |
|
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
850 |
CAknFileSelectionDialog* dlg = CAknFileSelectionDialog::NewL(ECFDDialogTypeSave, R_PODCAST_EXPORT_FEEDS); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
851 |
CleanupStack::PushL(dlg); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
852 |
|
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
853 |
if(dlg->ExecuteL(pathName)) |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
854 |
{ |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
855 |
CAknFileNamePromptDialog *fileDlg = CAknFileNamePromptDialog::NewL(R_PODCAST_FILENAME_PROMPT_DIALOG); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
856 |
CleanupStack::PushL(fileDlg); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
857 |
fileDlg->SetPathL(pathName); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
858 |
TFileName fileName; |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
859 |
if (fileDlg->ExecuteL(fileName) && fileName.Length() > 0) |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
860 |
{ |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
861 |
pathName.Append(fileName); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
862 |
TFileName temp; |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
863 |
iPodcastModel.FeedEngine().ExportFeedsL(temp); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
864 |
RFs fs; |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
865 |
fs.Connect(); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
866 |
BaflUtils::CopyFile(fs, temp, pathName); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
867 |
BaflUtils::DeleteFile(fs,temp); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
868 |
fs.Close(); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
869 |
} |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
870 |
CleanupStack::PopAndDestroy(fileDlg); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
871 |
} |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
872 |
CleanupStack::PopAndDestroy(dlg); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
873 |
} |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
874 |
CleanupStack::PopAndDestroy(memDlg); |
2 | 875 |
} |
876 |
||
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
26
diff
changeset
|
877 |
void CPodcastFeedView::CheckResumeDownloadL() |
2 | 878 |
{ |
879 |
// if there are shows queued for downloading, ask if we should resume now |
|
880 |
RShowInfoArray showsDownloading; |
|
881 |
iPodcastModel.ShowEngine().GetShowsDownloadingL(showsDownloading); |
|
882 |
||
883 |
if (showsDownloading.Count() > 0) |
|
884 |
{ |
|
885 |
TBuf<KMaxMessageLength> msg; |
|
886 |
iEikonEnv->ReadResourceL(msg, R_PODCAST_ENABLE_DOWNLOADS_PROMPT); |
|
887 |
||
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
26
diff
changeset
|
888 |
if (ShowQueryMessageL(msg)) |
2 | 889 |
{ |
890 |
// need to suspend downloads before ResumeDownloadL will work :) |
|
891 |
iPodcastModel.SettingsEngine().SetDownloadSuspended(ETrue); |
|
892 |
// resume downloading if user says yes |
|
893 |
iPodcastModel.ShowEngine().ResumeDownloadsL(); |
|
894 |
} |
|
895 |
else |
|
896 |
{ |
|
897 |
// we disable downloading if user says no |
|
898 |
iPodcastModel.SettingsEngine().SetDownloadSuspended(ETrue); |
|
899 |
} |
|
900 |
} |
|
901 |
||
902 |
// if no shows in queue, we keep whichever state suspend is in |
|
903 |
showsDownloading.ResetAndDestroy(); |
|
904 |
} |
|
905 |
||
7 | 906 |
void CPodcastFeedView::OpmlParsingComplete(TInt aError, TUint aNumFeedsImported) |
2 | 907 |
{ |
60 | 908 |
TRAP_IGNORE(OpmlParsingCompleteL(aError, aNumFeedsImported)); |
909 |
} |
|
910 |
||
911 |
void CPodcastFeedView::OpmlParsingCompleteL(TInt aError, TUint aNumFeedsImported) |
|
912 |
{ |
|
2 | 913 |
DP("CPodcastFeedView::OpmlParsingComplete BEGIN"); |
914 |
||
7 | 915 |
switch (aError) |
2 | 916 |
{ |
7 | 917 |
case KErrCouldNotConnect: |
2 | 918 |
{ |
919 |
TBuf<KMaxMessageLength> message; |
|
7 | 920 |
iEikonEnv->ReadResourceL(message, R_PODCAST_CONNECTION_ERROR); |
154
fd105a5a9dad
Fix for bug 3051 - search wait dialog doesn't close if search fails
teknolog
parents:
70
diff
changeset
|
921 |
delete iWaitDialog; |
fd105a5a9dad
Fix for bug 3051 - search wait dialog doesn't close if search fails
teknolog
parents:
70
diff
changeset
|
922 |
iOpmlState = EOpmlIdle; |
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
26
diff
changeset
|
923 |
ShowErrorMessageL(message); |
2 | 924 |
} |
925 |
break; |
|
7 | 926 |
case KErrNone: |
927 |
default: // we don't do more error handling here, just show 0 imported feeds |
|
928 |
switch (iOpmlState) |
|
929 |
{ |
|
930 |
case EOpmlIdle: |
|
931 |
break; |
|
932 |
case EOpmlImporting: |
|
2 | 933 |
{ |
7 | 934 |
UpdateListboxItemsL(); |
935 |
delete iWaitDialog; |
|
936 |
iOpmlState = EOpmlIdle; |
|
937 |
||
2 | 938 |
TBuf<KMaxMessageLength> message; |
7 | 939 |
TBuf<KMaxMessageLength> templ; |
940 |
iEikonEnv->ReadResourceL(templ, R_IMPORT_FEED_SUCCESS); |
|
941 |
message.Format(templ, aNumFeedsImported); |
|
942 |
||
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
26
diff
changeset
|
943 |
if(ShowQueryMessageL(message)) |
7 | 944 |
{ |
945 |
HandleCommandL(EPodcastUpdateAllFeeds); |
|
946 |
} |
|
2 | 947 |
} |
7 | 948 |
break; |
949 |
case EOpmlSearching: |
|
950 |
delete iWaitDialog; |
|
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
26
diff
changeset
|
951 |
iWaitDialog = NULL; |
7 | 952 |
if (iPodcastModel.FeedEngine().GetSearchResults().Count() == 0) |
953 |
{ |
|
954 |
TBuf<KMaxMessageLength> message; |
|
955 |
iEikonEnv->ReadResourceL(message, R_SEARCH_NORESULTS); |
|
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
26
diff
changeset
|
956 |
ShowErrorMessageL(message); |
7 | 957 |
} |
958 |
else |
|
959 |
{ |
|
960 |
AppUi()->ActivateLocalViewL(KUidPodcastSearchViewID, TUid::Uid(0), KNullDesC8()); |
|
961 |
} |
|
962 |
iOpmlState = EOpmlIdle; |
|
963 |
break; |
|
964 |
default: |
|
965 |
break; |
|
966 |
} |
|
2 | 967 |
} |
968 |
||
969 |
DP("CPodcastFeedView::OpmlParsingComplete END"); |
|
970 |
} |
|
971 |
||
972 |
void CPodcastFeedView::DialogDismissedL(TInt /*aButtonId*/) |
|
973 |
{ |
|
974 |
iPodcastModel.FeedEngine().CancelUpdateAllFeeds(); |
|
975 |
} |
|
5 | 976 |
|
977 |
void CPodcastFeedView::GetFeedErrorText(TDes &aErrorMessage, TInt aErrorCode) |
|
978 |
{ |
|
60 | 979 |
TRAP_IGNORE(((CPodcastAppUi*)AppUi())->GetErrorTextL(aErrorMessage,aErrorCode)); |
5 | 980 |
} |
8 | 981 |
|
45
56d4e0784e5d
Nicer way to handle back from queue view to feed/show view
teknolog
parents:
36
diff
changeset
|
982 |
TBool CPodcastFeedView::ViewingShows() |
56d4e0784e5d
Nicer way to handle back from queue view to feed/show view
teknolog
parents:
36
diff
changeset
|
983 |
{ |
56d4e0784e5d
Nicer way to handle back from queue view to feed/show view
teknolog
parents:
36
diff
changeset
|
984 |
return iViewingShows; |
56d4e0784e5d
Nicer way to handle back from queue view to feed/show view
teknolog
parents:
36
diff
changeset
|
985 |
} |
177
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
986 |
|
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
987 |
void CPodcastFeedView::DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane) |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
988 |
{ |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
989 |
if(aResourceId == R_PODCAST_FEEDVIEW_MENU) |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
990 |
{ |
343
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
991 |
aMenuPane->SetItemDimmed(EPodcastUpdateAllFeeds, iFeedUpdating); |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
992 |
aMenuPane->SetItemDimmed(EPodcastCancelUpdateAllFeeds, !iFeedUpdating); |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
993 |
aMenuPane->SetItemDimmed(EPodcastSettings, iFeedUpdating); |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
994 |
aMenuPane->SetItemDimmed(EPodcastFeedFeedMenu, iFeedUpdating); |
177
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
995 |
// aMenuPane->SetItemDimmed(EPodcastImportExportFeeds, iUpdatingRunning); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
996 |
} |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
997 |
} |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
998 |
|
343
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
999 |
void CPodcastFeedView::CheckConfirmExit() |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
1000 |
{ |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
1001 |
DP("CPodcastFeedView::CheckConfirmExit"); |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
1002 |
RShowInfoArray showsDownloading; |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
1003 |
iPodcastModel.ShowEngine().GetShowsDownloadingL(showsDownloading); |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
1004 |
TUint count = showsDownloading.Count(); |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
1005 |
showsDownloading.ResetAndDestroy(); |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
1006 |
showsDownloading.Close(); |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
1007 |
|
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
1008 |
if (count > 0 && !iPodcastModel.SettingsEngine().DownloadSuspended()) |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
1009 |
{ |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
1010 |
TBuf<256> msg; |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
1011 |
iEikonEnv->ReadResourceL(msg, R_EXIT_SHOWS_DOWNLOADING); |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
1012 |
|
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
1013 |
if (!ShowQueryMessageL(msg)) |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
1014 |
{ |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
1015 |
return; |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
1016 |
} |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
1017 |
} |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
1018 |
|
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
1019 |
AppUi()->Exit(); |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
1020 |
} |
9c56bf585696
Catching up with 5th edition
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
206
diff
changeset
|
1021 |
|
177
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
1022 |
TKeyResponse CPodcastFeedView::OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType) |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
1023 |
{ |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
1024 |
if (aType == EEventKey) |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
1025 |
{ |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
1026 |
switch (aKeyEvent.iCode) { |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
1027 |
case EKeyBackspace: |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
1028 |
case EKeyDelete: |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
1029 |
HandleCommandL(EPodcastDeleteFeedHardware); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
1030 |
break; |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
1031 |
default: |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
1032 |
break; |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
1033 |
} |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
1034 |
} |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
1035 |
return CPodcastListView::OfferKeyEventL(aKeyEvent, aType); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
1036 |
} |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
1037 |