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