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