author | Sebastian Brannstrom <sebastianb@symbian.org> |
Sat, 30 Oct 2010 12:36:47 +0100 | |
branch | RCL_3 |
changeset 309 | d9f6395a50ea |
parent 304 | 9d25c062a380 |
child 367 | 4b75876aa85a |
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 "PodcastAppui.h" |
|
20 |
#include <Podcast.rsg> |
|
21 |
#include "Podcast.hrh" |
|
22 |
#include "PodcastFeedView.h" |
|
23 |
#include "PodcastShowsView.h" |
|
24 |
#include "PodcastQueueView.h" |
|
25 |
#include "PodcastSettingsView.h" |
|
26 |
#include "PodcastSearchView.h" |
|
27 |
#include "ShowEngine.h" |
|
28 |
#include "PodcastModel.h" |
|
29 |
#include "debug.h" |
|
30 |
#include "..\help\podcatcher.hlp.hrh" |
|
31 |
#include "PodcastApp.h" |
|
104
4d1286f7f982
Fix for bug 2114 - Podcatcher wont close from the "open apps" menu
teknolog
parents:
99
diff
changeset
|
32 |
#include <APGWGNAM.H> |
2 | 33 |
#include <HLPLCH.H> |
34 |
#include <avkon.hrh> |
|
272
e6d095ba6756
Icons in tabs
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
243
diff
changeset
|
35 |
#include "Podcast.mbg" |
2 | 36 |
|
37 |
const TUint KDelayLaunch = 1000; |
|
38 |
||
39 |
CPodcastAppUi::CPodcastAppUi(CPodcastModel* aPodcastModel):iPodcastModel(aPodcastModel) |
|
40 |
{ |
|
41 |
||
42 |
} |
|
43 |
||
44 |
void CPodcastAppUi::ConstructL() |
|
45 |
{ |
|
46 |
DP("CPodcastAppUi::ConstructL() BEGIN"); |
|
243
44d205147a83
Fix for bug 3730 by switching to proper S3 context menu handling
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
203
diff
changeset
|
47 |
BaseConstructL(CAknAppUi::EAknEnableSkin | CAknAppUi::EAknEnableMSK | |
44d205147a83
Fix for bug 3730 by switching to proper S3 context menu handling
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
203
diff
changeset
|
48 |
CAknAppUi::EAknSingleClickCompatible | CAknAppUi::EAknTouchCompatible ); |
2 | 49 |
|
13 | 50 |
iPodcastModel->ConnectionEngine().AddObserver(this); |
51 |
||
2 | 52 |
DP("Constructing FeedView"); |
53 |
iFeedView = CPodcastFeedView::NewL(*iPodcastModel); |
|
54 |
this->AddViewL(iFeedView); |
|
55 |
||
56 |
DP("Constructing ShowsView"); |
|
57 |
iShowsView = CPodcastShowsView::NewL(*iPodcastModel); |
|
58 |
this->AddViewL(iShowsView); |
|
59 |
||
60 |
DP("Constructing QueueView"); |
|
61 |
iQueueView = CPodcastQueueView::NewL(*iPodcastModel); |
|
62 |
this->AddViewL(iQueueView); |
|
63 |
||
64 |
DP("Constructing SearchView"); |
|
65 |
iSearchView = CPodcastSearchView::NewL(*iPodcastModel); |
|
66 |
this->AddViewL(iSearchView); |
|
67 |
||
68 |
DP("Constructing SettingsView"); |
|
69 |
iSettingsView = CPodcastSettingsView::NewL(*iPodcastModel); |
|
70 |
this->AddViewL(iSettingsView); |
|
71 |
||
72 |
iNaviPane =( CAknNavigationControlContainer * ) StatusPane()->ControlL( TUid::Uid( EEikStatusPaneUidNavi ) ); |
|
73 |
NaviShowTabGroupL(); |
|
74 |
||
75 |
// start a timer to let ConstructL finish before we display any dialogs or start downloading |
|
76 |
// this provides another entry point in HandleTimeout below |
|
77 |
iStartTimer = CTimeout::NewL(*this); |
|
78 |
iStartTimer->After(KDelayLaunch); |
|
79 |
DP("CPodcastAppUi::ConstructL() END"); |
|
80 |
} |
|
81 |
||
82 |
CPodcastAppUi::~CPodcastAppUi() |
|
83 |
{ |
|
24
ca50ea154990
Moved search result title to navipane. Fixed but 1832
teknolog
parents:
16
diff
changeset
|
84 |
if (iNaviStyle != ENaviEmpty) |
ca50ea154990
Moved search result title to navipane. Fixed but 1832
teknolog
parents:
16
diff
changeset
|
85 |
{ |
ca50ea154990
Moved search result title to navipane. Fixed but 1832
teknolog
parents:
16
diff
changeset
|
86 |
iNaviPane->Pop(); |
ca50ea154990
Moved search result title to navipane. Fixed but 1832
teknolog
parents:
16
diff
changeset
|
87 |
} |
ca50ea154990
Moved search result title to navipane. Fixed but 1832
teknolog
parents:
16
diff
changeset
|
88 |
|
ca50ea154990
Moved search result title to navipane. Fixed but 1832
teknolog
parents:
16
diff
changeset
|
89 |
if(iNaviTabGroup) |
2 | 90 |
{ |
24
ca50ea154990
Moved search result title to navipane. Fixed but 1832
teknolog
parents:
16
diff
changeset
|
91 |
delete iNaviTabGroup; |
2 | 92 |
} |
24
ca50ea154990
Moved search result title to navipane. Fixed but 1832
teknolog
parents:
16
diff
changeset
|
93 |
|
ca50ea154990
Moved search result title to navipane. Fixed but 1832
teknolog
parents:
16
diff
changeset
|
94 |
if (iNaviText) |
ca50ea154990
Moved search result title to navipane. Fixed but 1832
teknolog
parents:
16
diff
changeset
|
95 |
{ |
ca50ea154990
Moved search result title to navipane. Fixed but 1832
teknolog
parents:
16
diff
changeset
|
96 |
delete iNaviText; |
ca50ea154990
Moved search result title to navipane. Fixed but 1832
teknolog
parents:
16
diff
changeset
|
97 |
} |
ca50ea154990
Moved search result title to navipane. Fixed but 1832
teknolog
parents:
16
diff
changeset
|
98 |
|
2 | 99 |
delete iStartTimer; |
100 |
} |
|
101 |
||
102 |
// ----------------------------------------------------------------------------- |
|
103 |
// CPodcastAppUi::DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane) |
|
104 |
// This function is called by the EIKON framework just before it displays |
|
105 |
// a menu pane. Its default implementation is empty, and by overriding it, |
|
106 |
// the application can set the state of menu items dynamically according |
|
107 |
// to the state of application data. |
|
108 |
// ------------------------------------------------------------------------------ |
|
109 |
// |
|
110 |
void CPodcastAppUi::DynInitMenuPaneL( |
|
111 |
TInt /*aResourceId*/,CEikMenuPane* /*aMenuPane*/) |
|
112 |
{ |
|
113 |
// no implementation required |
|
114 |
} |
|
115 |
||
116 |
// ----------------------------------------------------------------------------- |
|
117 |
// CPodcastAppUi::HandleCommandL(TInt aCommand) |
|
118 |
// takes care of command handling |
|
119 |
// ----------------------------------------------------------------------------- |
|
120 |
// |
|
121 |
void CPodcastAppUi::HandleCommandL( TInt aCommand ) |
|
122 |
{ |
|
123 |
switch ( aCommand ) |
|
124 |
{ |
|
125 |
case EAknSoftkeyExit: |
|
126 |
{ |
|
292
655dbce90b70
Added check and query when downloading is active while trying to exit
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
272
diff
changeset
|
127 |
iFeedView->CheckConfirmExit(); |
2 | 128 |
break; |
129 |
} |
|
130 |
case EEikCmdExit: |
|
131 |
{ |
|
104
4d1286f7f982
Fix for bug 2114 - Podcatcher wont close from the "open apps" menu
teknolog
parents:
99
diff
changeset
|
132 |
// we want to prevent red button from closing podcatcher, and |
4d1286f7f982
Fix for bug 2114 - Podcatcher wont close from the "open apps" menu
teknolog
parents:
99
diff
changeset
|
133 |
// instead we send it to background |
4d1286f7f982
Fix for bug 2114 - Podcatcher wont close from the "open apps" menu
teknolog
parents:
99
diff
changeset
|
134 |
// however, we want to respect the task manager (fast swap) close |
4d1286f7f982
Fix for bug 2114 - Podcatcher wont close from the "open apps" menu
teknolog
parents:
99
diff
changeset
|
135 |
// command, so we check if task manager is the focussed window group |
4d1286f7f982
Fix for bug 2114 - Podcatcher wont close from the "open apps" menu
teknolog
parents:
99
diff
changeset
|
136 |
|
4d1286f7f982
Fix for bug 2114 - Podcatcher wont close from the "open apps" menu
teknolog
parents:
99
diff
changeset
|
137 |
RWsSession& ws = iEikonEnv->WsSession(); |
4d1286f7f982
Fix for bug 2114 - Podcatcher wont close from the "open apps" menu
teknolog
parents:
99
diff
changeset
|
138 |
TInt wgid = ws.GetFocusWindowGroup(); |
4d1286f7f982
Fix for bug 2114 - Podcatcher wont close from the "open apps" menu
teknolog
parents:
99
diff
changeset
|
139 |
CApaWindowGroupName* gn = CApaWindowGroupName::NewLC(ws, wgid); |
4d1286f7f982
Fix for bug 2114 - Podcatcher wont close from the "open apps" menu
teknolog
parents:
99
diff
changeset
|
140 |
TUid activeAppUid = gn->AppUid(); |
4d1286f7f982
Fix for bug 2114 - Podcatcher wont close from the "open apps" menu
teknolog
parents:
99
diff
changeset
|
141 |
CleanupStack::PopAndDestroy(gn); |
4d1286f7f982
Fix for bug 2114 - Podcatcher wont close from the "open apps" menu
teknolog
parents:
99
diff
changeset
|
142 |
|
203
cc2d961dbe57
S^3 has a different UID for the new task switcher
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
155
diff
changeset
|
143 |
const TUid KUidFastSwapS3 = { 0x20016BF0 }; |
cc2d961dbe57
S^3 has a different UID for the new task switcher
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
155
diff
changeset
|
144 |
if (activeAppUid == KUidFastSwapS3) |
104
4d1286f7f982
Fix for bug 2114 - Podcatcher wont close from the "open apps" menu
teknolog
parents:
99
diff
changeset
|
145 |
{ |
302
cf14797d0023
Fix for broken check for active downloads when exiting
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
292
diff
changeset
|
146 |
DP("Exit called by task manager"); |
104
4d1286f7f982
Fix for bug 2114 - Podcatcher wont close from the "open apps" menu
teknolog
parents:
99
diff
changeset
|
147 |
// closed by task manager |
4d1286f7f982
Fix for bug 2114 - Podcatcher wont close from the "open apps" menu
teknolog
parents:
99
diff
changeset
|
148 |
Exit(); |
4d1286f7f982
Fix for bug 2114 - Podcatcher wont close from the "open apps" menu
teknolog
parents:
99
diff
changeset
|
149 |
} |
4d1286f7f982
Fix for bug 2114 - Podcatcher wont close from the "open apps" menu
teknolog
parents:
99
diff
changeset
|
150 |
else |
4d1286f7f982
Fix for bug 2114 - Podcatcher wont close from the "open apps" menu
teknolog
parents:
99
diff
changeset
|
151 |
{ |
302
cf14797d0023
Fix for broken check for active downloads when exiting
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
292
diff
changeset
|
152 |
DP("Red button pressed, going into background"); |
104
4d1286f7f982
Fix for bug 2114 - Podcatcher wont close from the "open apps" menu
teknolog
parents:
99
diff
changeset
|
153 |
// red button pressed |
4d1286f7f982
Fix for bug 2114 - Podcatcher wont close from the "open apps" menu
teknolog
parents:
99
diff
changeset
|
154 |
TApaTask task(iEikonEnv->WsSession()); |
4d1286f7f982
Fix for bug 2114 - Podcatcher wont close from the "open apps" menu
teknolog
parents:
99
diff
changeset
|
155 |
task.SetWgId(iEikonEnv->RootWin().Identifier()); |
4d1286f7f982
Fix for bug 2114 - Podcatcher wont close from the "open apps" menu
teknolog
parents:
99
diff
changeset
|
156 |
task.SendToBackground(); |
4d1286f7f982
Fix for bug 2114 - Podcatcher wont close from the "open apps" menu
teknolog
parents:
99
diff
changeset
|
157 |
} |
2 | 158 |
break; |
159 |
} |
|
160 |
case EPodcastHelp: |
|
48 | 161 |
{ |
162 |
HlpLauncher::LaunchHelpApplicationL(iEikonEnv->WsSession(), HelpContextL()); |
|
2 | 163 |
} |
164 |
break; |
|
165 |
default: |
|
166 |
break; |
|
167 |
} |
|
168 |
} |
|
169 |
||
170 |
CArrayFix<TCoeHelpContext>* CPodcastAppUi::HelpContextL() const |
|
171 |
{ |
|
172 |
CArrayFixFlat<TCoeHelpContext>* array = |
|
173 |
new(ELeave)CArrayFixFlat<TCoeHelpContext>(1); |
|
174 |
CleanupStack::PushL(array); |
|
48 | 175 |
|
176 |
if (iFeedView->IsVisible()) { |
|
177 |
array->AppendL(TCoeHelpContext(KUidPodcast,KContextFeedsView)); |
|
178 |
} else if (iShowsView->IsVisible()) { |
|
179 |
array->AppendL(TCoeHelpContext(KUidPodcast,KContextShowsView)); |
|
140 | 180 |
} else if (iSearchView->IsVisible()) { |
181 |
array->AppendL(TCoeHelpContext(KUidPodcast,KContextSearch)); |
|
48 | 182 |
} else if (iQueueView->IsVisible()) { |
183 |
array->AppendL(TCoeHelpContext(KUidPodcast,KContextDownloadQueue)); |
|
184 |
} else { |
|
2 | 185 |
array->AppendL(TCoeHelpContext(KUidPodcast,KContextSettings)); |
186 |
} |
|
187 |
||
188 |
CleanupStack::Pop(array); |
|
189 |
return array; |
|
190 |
} |
|
191 |
||
24
ca50ea154990
Moved search result title to navipane. Fixed but 1832
teknolog
parents:
16
diff
changeset
|
192 |
void CPodcastAppUi::NaviSetTextL(TInt aResourceId) |
ca50ea154990
Moved search result title to navipane. Fixed but 1832
teknolog
parents:
16
diff
changeset
|
193 |
{ |
ca50ea154990
Moved search result title to navipane. Fixed but 1832
teknolog
parents:
16
diff
changeset
|
194 |
|
ca50ea154990
Moved search result title to navipane. Fixed but 1832
teknolog
parents:
16
diff
changeset
|
195 |
if (iNaviStyle != ENaviEmpty) { |
ca50ea154990
Moved search result title to navipane. Fixed but 1832
teknolog
parents:
16
diff
changeset
|
196 |
iNaviPane->Pop(); |
ca50ea154990
Moved search result title to navipane. Fixed but 1832
teknolog
parents:
16
diff
changeset
|
197 |
} |
ca50ea154990
Moved search result title to navipane. Fixed but 1832
teknolog
parents:
16
diff
changeset
|
198 |
|
ca50ea154990
Moved search result title to navipane. Fixed but 1832
teknolog
parents:
16
diff
changeset
|
199 |
HBufC* naviText = iEikonEnv->AllocReadResourceLC(aResourceId); |
ca50ea154990
Moved search result title to navipane. Fixed but 1832
teknolog
parents:
16
diff
changeset
|
200 |
iNaviText = iNaviPane->CreateNavigationLabelL(*naviText); |
ca50ea154990
Moved search result title to navipane. Fixed but 1832
teknolog
parents:
16
diff
changeset
|
201 |
|
ca50ea154990
Moved search result title to navipane. Fixed but 1832
teknolog
parents:
16
diff
changeset
|
202 |
iNaviPane->PushL(*iNaviText); |
ca50ea154990
Moved search result title to navipane. Fixed but 1832
teknolog
parents:
16
diff
changeset
|
203 |
|
ca50ea154990
Moved search result title to navipane. Fixed but 1832
teknolog
parents:
16
diff
changeset
|
204 |
CleanupStack::PopAndDestroy(naviText); |
ca50ea154990
Moved search result title to navipane. Fixed but 1832
teknolog
parents:
16
diff
changeset
|
205 |
|
ca50ea154990
Moved search result title to navipane. Fixed but 1832
teknolog
parents:
16
diff
changeset
|
206 |
iNaviStyle = ENaviText; |
ca50ea154990
Moved search result title to navipane. Fixed but 1832
teknolog
parents:
16
diff
changeset
|
207 |
} |
ca50ea154990
Moved search result title to navipane. Fixed but 1832
teknolog
parents:
16
diff
changeset
|
208 |
|
2 | 209 |
void CPodcastAppUi::NaviShowTabGroupL() |
210 |
{ |
|
272
e6d095ba6756
Icons in tabs
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
243
diff
changeset
|
211 |
iTabGroup = STATIC_CAST(CAknTabGroup*, iNaviPane->ResourceDecorator()->DecoratedControl()); |
e6d095ba6756
Icons in tabs
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
243
diff
changeset
|
212 |
iTabGroup->SetObserver(this); |
24
ca50ea154990
Moved search result title to navipane. Fixed but 1832
teknolog
parents:
16
diff
changeset
|
213 |
iNaviStyle = ENaviTabGroup; |
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
24
diff
changeset
|
214 |
UpdateQueueTabL(iPodcastModel->ShowEngine().GetNumDownloadingShows()); |
2 | 215 |
} |
216 |
||
217 |
void CPodcastAppUi::TabChangedL (TInt aIndex) |
|
218 |
{ |
|
219 |
DP("CPodcastListView::TabChangedL "); |
|
220 |
||
24
ca50ea154990
Moved search result title to navipane. Fixed but 1832
teknolog
parents:
16
diff
changeset
|
221 |
if (iNaviStyle == ENaviTabGroup) |
11 | 222 |
{ |
24
ca50ea154990
Moved search result title to navipane. Fixed but 1832
teknolog
parents:
16
diff
changeset
|
223 |
TUid newview = TUid::Uid(0); |
ca50ea154990
Moved search result title to navipane. Fixed but 1832
teknolog
parents:
16
diff
changeset
|
224 |
TUid messageUid = TUid::Uid(0); |
49
43e204e6ae2e
Fix for accidental merge regressions. Text fixes for tool tip and settings.
teknolog
parents:
48
diff
changeset
|
225 |
if (aIndex == KTabIdFeeds) |
43e204e6ae2e
Fix for accidental merge regressions. Text fixes for tool tip and settings.
teknolog
parents:
48
diff
changeset
|
226 |
{ |
43e204e6ae2e
Fix for accidental merge regressions. Text fixes for tool tip and settings.
teknolog
parents:
48
diff
changeset
|
227 |
if (iFeedView->ViewingShows()) |
45
56d4e0784e5d
Nicer way to handle back from queue view to feed/show view
teknolog
parents:
35
diff
changeset
|
228 |
{ |
56d4e0784e5d
Nicer way to handle back from queue view to feed/show view
teknolog
parents:
35
diff
changeset
|
229 |
newview = KUidPodcastShowsViewID; |
56d4e0784e5d
Nicer way to handle back from queue view to feed/show view
teknolog
parents:
35
diff
changeset
|
230 |
} |
56d4e0784e5d
Nicer way to handle back from queue view to feed/show view
teknolog
parents:
35
diff
changeset
|
231 |
else |
56d4e0784e5d
Nicer way to handle back from queue view to feed/show view
teknolog
parents:
35
diff
changeset
|
232 |
{ |
56d4e0784e5d
Nicer way to handle back from queue view to feed/show view
teknolog
parents:
35
diff
changeset
|
233 |
newview = KUidPodcastFeedViewID; |
56d4e0784e5d
Nicer way to handle back from queue view to feed/show view
teknolog
parents:
35
diff
changeset
|
234 |
} |
49
43e204e6ae2e
Fix for accidental merge regressions. Text fixes for tool tip and settings.
teknolog
parents:
48
diff
changeset
|
235 |
} |
43e204e6ae2e
Fix for accidental merge regressions. Text fixes for tool tip and settings.
teknolog
parents:
48
diff
changeset
|
236 |
else if (aIndex == KTabIdQueue) |
43e204e6ae2e
Fix for accidental merge regressions. Text fixes for tool tip and settings.
teknolog
parents:
48
diff
changeset
|
237 |
{ |
24
ca50ea154990
Moved search result title to navipane. Fixed but 1832
teknolog
parents:
16
diff
changeset
|
238 |
newview = KUidPodcastQueueViewID; |
49
43e204e6ae2e
Fix for accidental merge regressions. Text fixes for tool tip and settings.
teknolog
parents:
48
diff
changeset
|
239 |
} |
43e204e6ae2e
Fix for accidental merge regressions. Text fixes for tool tip and settings.
teknolog
parents:
48
diff
changeset
|
240 |
else |
43e204e6ae2e
Fix for accidental merge regressions. Text fixes for tool tip and settings.
teknolog
parents:
48
diff
changeset
|
241 |
{ |
24
ca50ea154990
Moved search result title to navipane. Fixed but 1832
teknolog
parents:
16
diff
changeset
|
242 |
User::Leave(KErrTooBig); |
49
43e204e6ae2e
Fix for accidental merge regressions. Text fixes for tool tip and settings.
teknolog
parents:
48
diff
changeset
|
243 |
} |
24
ca50ea154990
Moved search result title to navipane. Fixed but 1832
teknolog
parents:
16
diff
changeset
|
244 |
|
ca50ea154990
Moved search result title to navipane. Fixed but 1832
teknolog
parents:
16
diff
changeset
|
245 |
if(newview.iUid != 0) |
ca50ea154990
Moved search result title to navipane. Fixed but 1832
teknolog
parents:
16
diff
changeset
|
246 |
{ |
ca50ea154990
Moved search result title to navipane. Fixed but 1832
teknolog
parents:
16
diff
changeset
|
247 |
ActivateLocalViewL(newview, messageUid, KNullDesC8()); |
ca50ea154990
Moved search result title to navipane. Fixed but 1832
teknolog
parents:
16
diff
changeset
|
248 |
} |
2 | 249 |
} |
250 |
} |
|
251 |
||
252 |
void CPodcastAppUi::SetActiveTab(TInt aIndex) { |
|
24
ca50ea154990
Moved search result title to navipane. Fixed but 1832
teknolog
parents:
16
diff
changeset
|
253 |
if (iNaviStyle == ENaviTabGroup) |
ca50ea154990
Moved search result title to navipane. Fixed but 1832
teknolog
parents:
16
diff
changeset
|
254 |
{ |
ca50ea154990
Moved search result title to navipane. Fixed but 1832
teknolog
parents:
16
diff
changeset
|
255 |
iTabGroup->SetActiveTabByIndex(aIndex); |
ca50ea154990
Moved search result title to navipane. Fixed but 1832
teknolog
parents:
16
diff
changeset
|
256 |
} |
2 | 257 |
} |
258 |
||
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
24
diff
changeset
|
259 |
void CPodcastAppUi::HandleTimeoutL(const CTimeout& /*aId*/, TInt /*aError*/) |
2 | 260 |
{ |
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
24
diff
changeset
|
261 |
iFeedView->CheckResumeDownloadL(); |
2 | 262 |
} |
263 |
||
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
24
diff
changeset
|
264 |
void CPodcastAppUi::UpdateQueueTabL(TInt aQueueLength) |
2 | 265 |
{ |
24
ca50ea154990
Moved search result title to navipane. Fixed but 1832
teknolog
parents:
16
diff
changeset
|
266 |
if (iNaviStyle == ENaviTabGroup) |
2 | 267 |
{ |
272
e6d095ba6756
Icons in tabs
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
243
diff
changeset
|
268 |
CFbsBitmap* bitmap; |
e6d095ba6756
Icons in tabs
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
243
diff
changeset
|
269 |
CFbsBitmap* mask; |
24
ca50ea154990
Moved search result title to navipane. Fixed but 1832
teknolog
parents:
16
diff
changeset
|
270 |
if (aQueueLength == 0) |
ca50ea154990
Moved search result title to navipane. Fixed but 1832
teknolog
parents:
16
diff
changeset
|
271 |
{ |
272
e6d095ba6756
Icons in tabs
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
243
diff
changeset
|
272 |
AknIconUtils::CreateIconL(bitmap, |
e6d095ba6756
Icons in tabs
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
243
diff
changeset
|
273 |
mask, |
e6d095ba6756
Icons in tabs
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
243
diff
changeset
|
274 |
iEikonEnv->EikAppUi()->Application()->BitmapStoreName(), |
e6d095ba6756
Icons in tabs
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
243
diff
changeset
|
275 |
EMbmPodcastTab_queue, |
e6d095ba6756
Icons in tabs
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
243
diff
changeset
|
276 |
EMbmPodcastTab_queue_mask); |
e6d095ba6756
Icons in tabs
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
243
diff
changeset
|
277 |
} |
e6d095ba6756
Icons in tabs
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
243
diff
changeset
|
278 |
else if (aQueueLength == 1) |
e6d095ba6756
Icons in tabs
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
243
diff
changeset
|
279 |
{ |
e6d095ba6756
Icons in tabs
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
243
diff
changeset
|
280 |
|
e6d095ba6756
Icons in tabs
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
243
diff
changeset
|
281 |
AknIconUtils::CreateIconL(bitmap, |
e6d095ba6756
Icons in tabs
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
243
diff
changeset
|
282 |
mask, |
e6d095ba6756
Icons in tabs
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
243
diff
changeset
|
283 |
iEikonEnv->EikAppUi()->Application()->BitmapStoreName(), |
e6d095ba6756
Icons in tabs
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
243
diff
changeset
|
284 |
EMbmPodcastTab_queue1, |
e6d095ba6756
Icons in tabs
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
243
diff
changeset
|
285 |
EMbmPodcastTab_queue1_mask); |
e6d095ba6756
Icons in tabs
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
243
diff
changeset
|
286 |
} |
e6d095ba6756
Icons in tabs
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
243
diff
changeset
|
287 |
else if (aQueueLength == 2) |
e6d095ba6756
Icons in tabs
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
243
diff
changeset
|
288 |
{ |
e6d095ba6756
Icons in tabs
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
243
diff
changeset
|
289 |
|
e6d095ba6756
Icons in tabs
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
243
diff
changeset
|
290 |
AknIconUtils::CreateIconL(bitmap, |
e6d095ba6756
Icons in tabs
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
243
diff
changeset
|
291 |
mask, |
e6d095ba6756
Icons in tabs
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
243
diff
changeset
|
292 |
iEikonEnv->EikAppUi()->Application()->BitmapStoreName(), |
e6d095ba6756
Icons in tabs
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
243
diff
changeset
|
293 |
EMbmPodcastTab_queue2, |
e6d095ba6756
Icons in tabs
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
243
diff
changeset
|
294 |
EMbmPodcastTab_queue2_mask); |
24
ca50ea154990
Moved search result title to navipane. Fixed but 1832
teknolog
parents:
16
diff
changeset
|
295 |
} |
ca50ea154990
Moved search result title to navipane. Fixed but 1832
teknolog
parents:
16
diff
changeset
|
296 |
else |
ca50ea154990
Moved search result title to navipane. Fixed but 1832
teknolog
parents:
16
diff
changeset
|
297 |
{ |
272
e6d095ba6756
Icons in tabs
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
243
diff
changeset
|
298 |
|
e6d095ba6756
Icons in tabs
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
243
diff
changeset
|
299 |
AknIconUtils::CreateIconL(bitmap, |
e6d095ba6756
Icons in tabs
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
243
diff
changeset
|
300 |
mask, |
e6d095ba6756
Icons in tabs
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
243
diff
changeset
|
301 |
iEikonEnv->EikAppUi()->Application()->BitmapStoreName(), |
e6d095ba6756
Icons in tabs
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
243
diff
changeset
|
302 |
EMbmPodcastTab_queue3, |
e6d095ba6756
Icons in tabs
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
243
diff
changeset
|
303 |
EMbmPodcastTab_queue3_mask); |
24
ca50ea154990
Moved search result title to navipane. Fixed but 1832
teknolog
parents:
16
diff
changeset
|
304 |
} |
272
e6d095ba6756
Icons in tabs
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
243
diff
changeset
|
305 |
|
e6d095ba6756
Icons in tabs
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
243
diff
changeset
|
306 |
iTabGroup->ReplaceTabL(EPodcastTabQueue, bitmap, mask); |
2 | 307 |
} |
308 |
} |
|
309 |
||
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
24
diff
changeset
|
310 |
void CPodcastAppUi::TabLeftL() |
2 | 311 |
{ |
24
ca50ea154990
Moved search result title to navipane. Fixed but 1832
teknolog
parents:
16
diff
changeset
|
312 |
if (iNaviStyle == ENaviTabGroup) |
11 | 313 |
{ |
24
ca50ea154990
Moved search result title to navipane. Fixed but 1832
teknolog
parents:
16
diff
changeset
|
314 |
TInt ati = iTabGroup->ActiveTabIndex(); |
ca50ea154990
Moved search result title to navipane. Fixed but 1832
teknolog
parents:
16
diff
changeset
|
315 |
if(ati > 0) |
ca50ea154990
Moved search result title to navipane. Fixed but 1832
teknolog
parents:
16
diff
changeset
|
316 |
{ |
ca50ea154990
Moved search result title to navipane. Fixed but 1832
teknolog
parents:
16
diff
changeset
|
317 |
SetActiveTab(ati-1); |
ca50ea154990
Moved search result title to navipane. Fixed but 1832
teknolog
parents:
16
diff
changeset
|
318 |
TabChangedL(ati-1); |
ca50ea154990
Moved search result title to navipane. Fixed but 1832
teknolog
parents:
16
diff
changeset
|
319 |
} |
11 | 320 |
} |
2 | 321 |
} |
322 |
||
35
66c5303f3610
A ton of CodeScanner fixes (high issues) - but not all
Brendan Donegan <brendand@symbian.org>
parents:
24
diff
changeset
|
323 |
void CPodcastAppUi::TabRightL() |
2 | 324 |
{ |
24
ca50ea154990
Moved search result title to navipane. Fixed but 1832
teknolog
parents:
16
diff
changeset
|
325 |
if (iNaviStyle == ENaviTabGroup) |
11 | 326 |
{ |
24
ca50ea154990
Moved search result title to navipane. Fixed but 1832
teknolog
parents:
16
diff
changeset
|
327 |
TInt ati = iTabGroup->ActiveTabIndex(); |
ca50ea154990
Moved search result title to navipane. Fixed but 1832
teknolog
parents:
16
diff
changeset
|
328 |
if(ati < iTabGroup->TabCount()-1) |
11 | 329 |
{ |
24
ca50ea154990
Moved search result title to navipane. Fixed but 1832
teknolog
parents:
16
diff
changeset
|
330 |
SetActiveTab(ati+1); |
ca50ea154990
Moved search result title to navipane. Fixed but 1832
teknolog
parents:
16
diff
changeset
|
331 |
TabChangedL(ati+1); |
11 | 332 |
} |
333 |
} |
|
334 |
} |
|
13 | 335 |
|
336 |
void CPodcastAppUi::ConnectionSelectionStart() |
|
337 |
{ |
|
155
4ec84fbc7b27
Fix for bug 2819 - Crash when updating and connection set to "Always ask"
teknolog
parents:
140
diff
changeset
|
338 |
DP("CPodcastAppUi::ConnectionSelectionStart() BEGIN"); |
13 | 339 |
iFeedView->UpdateToolbar(EFalse); |
340 |
iShowsView->UpdateToolbar(EFalse); |
|
341 |
iQueueView->UpdateToolbar(EFalse); |
|
342 |
iSearchView->UpdateToolbar(EFalse); |
|
155
4ec84fbc7b27
Fix for bug 2819 - Crash when updating and connection set to "Always ask"
teknolog
parents:
140
diff
changeset
|
343 |
DP("CPodcastAppUi::ConnectionSelectionStart() END"); |
13 | 344 |
} |
345 |
||
346 |
void CPodcastAppUi::ConnectionSelectionEnd() |
|
347 |
{ |
|
155
4ec84fbc7b27
Fix for bug 2819 - Crash when updating and connection set to "Always ask"
teknolog
parents:
140
diff
changeset
|
348 |
DP("CPodcastAppUi::ConnectionSelectionEnd() BEGIN"); |
13 | 349 |
iFeedView->UpdateToolbar(ETrue); |
350 |
iShowsView->UpdateToolbar(ETrue); |
|
351 |
iQueueView->UpdateToolbar(ETrue); |
|
352 |
iSearchView->UpdateToolbar(ETrue); |
|
155
4ec84fbc7b27
Fix for bug 2819 - Crash when updating and connection set to "Always ask"
teknolog
parents:
140
diff
changeset
|
353 |
DP("CPodcastAppUi::ConnectionSelectionEnd() END"); |
13 | 354 |
} |
115
d87e984bd8b8
Even more robustness improvements for HTTP client - specifically disk full problems
teknolog
parents:
104
diff
changeset
|
355 |
|
117
3b59b88b089e
Fixed Code Scanner L-issues; Further improvements to HTTP robustness
teknolog
parents:
115
diff
changeset
|
356 |
void CPodcastAppUi::GetErrorTextL(TDes &aErrorMessage, TInt aErrorCode) |
115
d87e984bd8b8
Even more robustness improvements for HTTP client - specifically disk full problems
teknolog
parents:
104
diff
changeset
|
357 |
{ |
d87e984bd8b8
Even more robustness improvements for HTTP client - specifically disk full problems
teknolog
parents:
104
diff
changeset
|
358 |
switch (aErrorCode) |
d87e984bd8b8
Even more robustness improvements for HTTP client - specifically disk full problems
teknolog
parents:
104
diff
changeset
|
359 |
{ |
d87e984bd8b8
Even more robustness improvements for HTTP client - specifically disk full problems
teknolog
parents:
104
diff
changeset
|
360 |
case KErrNotFound: |
d87e984bd8b8
Even more robustness improvements for HTTP client - specifically disk full problems
teknolog
parents:
104
diff
changeset
|
361 |
{ |
d87e984bd8b8
Even more robustness improvements for HTTP client - specifically disk full problems
teknolog
parents:
104
diff
changeset
|
362 |
HBufC* error = iCoeEnv->AllocReadResourceLC(R_ERROR_INVALID_ADDRESS); |
d87e984bd8b8
Even more robustness improvements for HTTP client - specifically disk full problems
teknolog
parents:
104
diff
changeset
|
363 |
aErrorMessage.Copy(*error); |
d87e984bd8b8
Even more robustness improvements for HTTP client - specifically disk full problems
teknolog
parents:
104
diff
changeset
|
364 |
CleanupStack::PopAndDestroy(error); |
d87e984bd8b8
Even more robustness improvements for HTTP client - specifically disk full problems
teknolog
parents:
104
diff
changeset
|
365 |
} |
d87e984bd8b8
Even more robustness improvements for HTTP client - specifically disk full problems
teknolog
parents:
104
diff
changeset
|
366 |
break; |
d87e984bd8b8
Even more robustness improvements for HTTP client - specifically disk full problems
teknolog
parents:
104
diff
changeset
|
367 |
case KErrDiskFull: |
d87e984bd8b8
Even more robustness improvements for HTTP client - specifically disk full problems
teknolog
parents:
104
diff
changeset
|
368 |
{ |
d87e984bd8b8
Even more robustness improvements for HTTP client - specifically disk full problems
teknolog
parents:
104
diff
changeset
|
369 |
HBufC* error = iCoeEnv->AllocReadResourceLC(R_ERROR_DISK_FULL); |
d87e984bd8b8
Even more robustness improvements for HTTP client - specifically disk full problems
teknolog
parents:
104
diff
changeset
|
370 |
aErrorMessage.Copy(*error); |
d87e984bd8b8
Even more robustness improvements for HTTP client - specifically disk full problems
teknolog
parents:
104
diff
changeset
|
371 |
CleanupStack::PopAndDestroy(error); |
d87e984bd8b8
Even more robustness improvements for HTTP client - specifically disk full problems
teknolog
parents:
104
diff
changeset
|
372 |
} |
d87e984bd8b8
Even more robustness improvements for HTTP client - specifically disk full problems
teknolog
parents:
104
diff
changeset
|
373 |
break; |
d87e984bd8b8
Even more robustness improvements for HTTP client - specifically disk full problems
teknolog
parents:
104
diff
changeset
|
374 |
case 404: |
d87e984bd8b8
Even more robustness improvements for HTTP client - specifically disk full problems
teknolog
parents:
104
diff
changeset
|
375 |
{ |
d87e984bd8b8
Even more robustness improvements for HTTP client - specifically disk full problems
teknolog
parents:
104
diff
changeset
|
376 |
HBufC* error = iCoeEnv->AllocReadResourceLC(R_ERROR_NOTFOUND); |
d87e984bd8b8
Even more robustness improvements for HTTP client - specifically disk full problems
teknolog
parents:
104
diff
changeset
|
377 |
aErrorMessage.Copy(*error); |
d87e984bd8b8
Even more robustness improvements for HTTP client - specifically disk full problems
teknolog
parents:
104
diff
changeset
|
378 |
CleanupStack::PopAndDestroy(error); |
d87e984bd8b8
Even more robustness improvements for HTTP client - specifically disk full problems
teknolog
parents:
104
diff
changeset
|
379 |
} |
d87e984bd8b8
Even more robustness improvements for HTTP client - specifically disk full problems
teknolog
parents:
104
diff
changeset
|
380 |
break; |
d87e984bd8b8
Even more robustness improvements for HTTP client - specifically disk full problems
teknolog
parents:
104
diff
changeset
|
381 |
default: |
d87e984bd8b8
Even more robustness improvements for HTTP client - specifically disk full problems
teknolog
parents:
104
diff
changeset
|
382 |
{ |
d87e984bd8b8
Even more robustness improvements for HTTP client - specifically disk full problems
teknolog
parents:
104
diff
changeset
|
383 |
if (aErrorCode > 200) |
d87e984bd8b8
Even more robustness improvements for HTTP client - specifically disk full problems
teknolog
parents:
104
diff
changeset
|
384 |
{ |
d87e984bd8b8
Even more robustness improvements for HTTP client - specifically disk full problems
teknolog
parents:
104
diff
changeset
|
385 |
HBufC* error = iCoeEnv->AllocReadResourceLC(R_ERROR_HTTP); |
d87e984bd8b8
Even more robustness improvements for HTTP client - specifically disk full problems
teknolog
parents:
104
diff
changeset
|
386 |
aErrorMessage.Format(*error, aErrorCode); |
d87e984bd8b8
Even more robustness improvements for HTTP client - specifically disk full problems
teknolog
parents:
104
diff
changeset
|
387 |
CleanupStack::PopAndDestroy(error); |
d87e984bd8b8
Even more robustness improvements for HTTP client - specifically disk full problems
teknolog
parents:
104
diff
changeset
|
388 |
} |
d87e984bd8b8
Even more robustness improvements for HTTP client - specifically disk full problems
teknolog
parents:
104
diff
changeset
|
389 |
else |
d87e984bd8b8
Even more robustness improvements for HTTP client - specifically disk full problems
teknolog
parents:
104
diff
changeset
|
390 |
{ |
d87e984bd8b8
Even more robustness improvements for HTTP client - specifically disk full problems
teknolog
parents:
104
diff
changeset
|
391 |
HBufC* error = iCoeEnv->AllocReadResourceLC(R_ERROR_GENERAL); |
d87e984bd8b8
Even more robustness improvements for HTTP client - specifically disk full problems
teknolog
parents:
104
diff
changeset
|
392 |
aErrorMessage.Format(*error, aErrorCode); |
d87e984bd8b8
Even more robustness improvements for HTTP client - specifically disk full problems
teknolog
parents:
104
diff
changeset
|
393 |
CleanupStack::PopAndDestroy(error); |
d87e984bd8b8
Even more robustness improvements for HTTP client - specifically disk full problems
teknolog
parents:
104
diff
changeset
|
394 |
} |
d87e984bd8b8
Even more robustness improvements for HTTP client - specifically disk full problems
teknolog
parents:
104
diff
changeset
|
395 |
} |
d87e984bd8b8
Even more robustness improvements for HTTP client - specifically disk full problems
teknolog
parents:
104
diff
changeset
|
396 |
break; |
d87e984bd8b8
Even more robustness improvements for HTTP client - specifically disk full problems
teknolog
parents:
104
diff
changeset
|
397 |
} |
d87e984bd8b8
Even more robustness improvements for HTTP client - specifically disk full problems
teknolog
parents:
104
diff
changeset
|
398 |
} |