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