author | Sebastian Brannstrom <sebastianb@symbian.org> |
Sun, 11 Jul 2010 11:36:24 +0100 | |
branch | 3rded |
changeset 177 | 269e3f3e544a |
parent 176 | 1c8b56cb6409 |
child 390 | d7abecc9d189 |
permissions | -rw-r--r-- |
2 | 1 |
/* |
2 |
* Copyright (c) 2007-2010 Sebastian Brannstrom, Lars Persson, EmbedDev AB |
|
3 |
* |
|
4 |
* All rights reserved. |
|
5 |
* This component and the accompanying materials are made available |
|
6 |
* under the terms of the License "Eclipse Public License v1.0" |
|
7 |
* which accompanies this distribution, and is available |
|
8 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
9 |
* |
|
10 |
* Initial Contributors: |
|
11 |
* EmbedDev AB - initial contribution. |
|
12 |
* |
|
13 |
* Contributors: |
|
14 |
* |
|
15 |
* Description: |
|
16 |
* |
|
17 |
*/ |
|
18 |
||
19 |
#include "PodcastSettingsView.h" |
|
20 |
#include "PodcastAppUi.h" |
|
21 |
#include "Podcast.hrh" |
|
22 |
#include <aknlists.h> |
|
23 |
#include <aknsettingitemlist.h> |
|
24 |
#include <aknnavide.h> |
|
25 |
#include <podcast.rsg> |
|
26 |
#include "SettingsEngine.h" |
|
177
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
27 |
#include <caknfileselectiondialog.h> |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
28 |
#include <caknmemoryselectiondialog.h> |
2 | 29 |
#include <pathinfo.h> |
60 | 30 |
#include <aknquerydialog.h> |
2 | 31 |
|
32 |
||
33 |
class CIapSetting: public CAknEnumeratedTextPopupSettingItem |
|
34 |
{ |
|
35 |
public: |
|
36 |
CIapSetting(TInt aResourceId, TInt& aValue, CPodcastModel &aPodcastModel) : |
|
37 |
CAknEnumeratedTextPopupSettingItem(aResourceId, aValue), iPodcastModel(aPodcastModel), iIap(aValue) |
|
38 |
{ |
|
39 |
} |
|
40 |
||
41 |
~CIapSetting() |
|
42 |
{ |
|
43 |
} |
|
44 |
||
45 |
void RefreshConnectionListL() |
|
46 |
{ |
|
47 |
CArrayPtr< CAknEnumeratedText > * enumeratedArr = EnumeratedTextArray(); |
|
48 |
CArrayPtr< HBufC > * poppedUpTextArray = PoppedUpTextArray(); |
|
49 |
||
50 |
CDesCArrayFlat *iapArray = iPodcastModel.IAPNames(); |
|
51 |
||
52 |
TBool valueExists = EFalse; |
|
53 |
DP2("InternalValue=%d, ExternalValue=%d", InternalValue(), ExternalValue()); |
|
54 |
for (int i=0;i<iapArray->Count();i++) { |
|
177
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
55 |
HBufC *buf = (*iapArray)[i].AllocL(); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
56 |
poppedUpTextArray->AppendL(buf); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
57 |
|
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
58 |
TInt iapId = iPodcastModel.IAPIds()[i].iIapId; |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
59 |
DP2("IAP name='%S', id=%d", buf, iapId); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
60 |
|
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
61 |
if (iapId == ExternalValue() || ExternalValue() == 0 || ExternalValue() == -1) |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
62 |
{ |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
63 |
valueExists = ETrue; |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
64 |
} |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
65 |
|
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
66 |
// both arrays destroy themselves, so we need two copies to prevent USER 44 |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
67 |
HBufC *buf2 = (*iapArray)[i].AllocL(); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
68 |
|
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
69 |
CAknEnumeratedText *enumerated = new CAknEnumeratedText(iapId, buf2); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
70 |
enumeratedArr->AppendL(enumerated); |
2 | 71 |
} |
72 |
||
73 |
DP1("valueExists=%d", valueExists); |
|
74 |
if (!valueExists && iPodcastModel.IAPIds().Count() > 0 ) { |
|
177
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
75 |
DP1("Setting iIap=%d", iPodcastModel.IAPIds()[0].iIapId); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
76 |
iIap = iPodcastModel.IAPIds()[0].iIapId; |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
77 |
LoadL(); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
78 |
DP2("InternalValue=%d, ExternalValue=%d", InternalValue(), ExternalValue()); |
2 | 79 |
} |
80 |
||
81 |
TRAPD(err, HandleTextArrayUpdateL()); |
|
82 |
||
83 |
if (err != KErrNone) { |
|
84 |
DP1("Leave in HandleTextArrayUpdateL, err=%d", err); |
|
85 |
} |
|
86 |
} |
|
87 |
||
88 |
void CompleteConstructionL() |
|
89 |
{ |
|
90 |
DP("CIapSetting::CompleteConstructionL BEGIN"); |
|
91 |
CAknEnumeratedTextPopupSettingItem::CompleteConstructionL(); |
|
92 |
RefreshConnectionListL(); |
|
93 |
DP("CIapSetting::CompleteConstructionL END"); |
|
94 |
} |
|
95 |
||
96 |
void EditItemL(TBool aCalledFromMenu) |
|
97 |
{ |
|
98 |
DP("CIapSetting::EditItemL BEGIN"); |
|
99 |
LoadL(); |
|
100 |
CAknEnumeratedTextPopupSettingItem::EditItemL(aCalledFromMenu); |
|
101 |
StoreL(); |
|
102 |
DP2("InternalValue=%d, ExternalValue=%d", InternalValue(), ExternalValue()); |
|
103 |
DP("CIapSetting::EditItemL END"); |
|
104 |
} |
|
105 |
||
106 |
void HandleSettingPageEventL(CAknSettingPage* aSettingPage, TAknSettingPageEvent aEventType) |
|
107 |
{ |
|
108 |
DP("CIapSetting::HandleSettingPageEventL BEGIN"); |
|
109 |
CAknSettingItem::HandleSettingPageEventL(aSettingPage, aEventType); |
|
110 |
/*if (aEventType == EEventSettingOked) |
|
111 |
{ |
|
112 |
DP2("InternalValue=%d, ExternalValue=%d", InternalValue(), ExternalValue()); |
|
113 |
StoreL(); |
|
114 |
}*/ |
|
115 |
DP("CIapSetting::HandleSettingPageEventL END"); |
|
116 |
} |
|
117 |
||
118 |
protected: |
|
119 |
CPodcastModel& iPodcastModel; |
|
120 |
TInt& iIap; |
|
121 |
}; |
|
122 |
||
123 |
||
177
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
124 |
//class CConnectionSetting: public CAknEnumeratedTextPopupSettingItem |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
125 |
//{ |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
126 |
//public: |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
127 |
// CConnectionSetting(TInt aResourceId, TInt& aValue, CPodcastModel &aPodcastModel) : |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
128 |
// CAknEnumeratedTextPopupSettingItem(aResourceId, aValue), iPodcastModel(aPodcastModel) |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
129 |
// { |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
130 |
// } |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
131 |
// |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
132 |
// ~CConnectionSetting() |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
133 |
// { |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
134 |
// } |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
135 |
// |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
136 |
// void RefreshConnectionListL() |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
137 |
// { |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
138 |
// CArrayPtr< CAknEnumeratedText > * enumeratedArr = EnumeratedTextArray(); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
139 |
// CArrayPtr< HBufC > * poppedUpTextArray = PoppedUpTextArray(); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
140 |
// |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
141 |
// CDesCArrayFlat *snapArray = iPodcastModel.SNAPNames(); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
142 |
// |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
143 |
// TBool valueExists = EFalse; |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
144 |
// DP2("InternalValue=%d, ExternalValue=%d", InternalValue(), ExternalValue()); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
145 |
// for (int i=0;i<snapArray->Count();i++) { |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
146 |
// HBufC *buf = (*snapArray)[i].AllocL(); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
147 |
// poppedUpTextArray->InsertL(EConnectionUseNetwork+i,buf); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
148 |
// |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
149 |
// TInt snapId = iPodcastModel.SNAPIds()[i].iIapId; |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
150 |
// DP2("SNAP name='%S', id=%d", buf, snapId); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
151 |
// |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
152 |
// if (snapId == ExternalValue()) { |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
153 |
// valueExists = ETrue; |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
154 |
// } |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
155 |
// // both arrays destroy themselves, so we need two copies to prevent USER 44 |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
156 |
// HBufC *buf2 = (*snapArray)[i].AllocL(); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
157 |
// |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
158 |
// CAknEnumeratedText *enumerated = new CAknEnumeratedText(EConnectionUseNetwork+i, buf2); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
159 |
// enumeratedArr->InsertL(EConnectionUseNetwork+i, enumerated); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
160 |
// } |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
161 |
// |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
162 |
// DP1("valueExists=%d", valueExists); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
163 |
// if (!valueExists && iPodcastModel.SNAPIds().Count() > 0 ) { |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
164 |
// DP1("Setting i=%d", iPodcastModel.SNAPIds()[0].iIapId); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
165 |
// LoadL(); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
166 |
// DP2("InternalValue=%d, ExternalValue=%d", InternalValue(), ExternalValue()); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
167 |
// } |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
168 |
// |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
169 |
// TRAPD(err, HandleTextArrayUpdateL()); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
170 |
// |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
171 |
// if (err != KErrNone) { |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
172 |
// DP1("Leave in HandleTextArrayUpdateL, err=%d", err); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
173 |
// } |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
174 |
// } |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
175 |
// |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
176 |
// void CompleteConstructionL() |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
177 |
// { |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
178 |
// DP("CIapSetting::CompleteConstructionL BEGIN"); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
179 |
// CAknEnumeratedTextPopupSettingItem::CompleteConstructionL(); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
180 |
// RefreshConnectionListL(); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
181 |
// DP("CIapSetting::CompleteConstructionL END"); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
182 |
// } |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
183 |
// |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
184 |
// void EditItemL(TBool aCalledFromMenu) |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
185 |
// { |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
186 |
// DP("CIapSetting::EditItemL BEGIN"); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
187 |
// LoadL(); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
188 |
// CAknEnumeratedTextPopupSettingItem::EditItemL(aCalledFromMenu); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
189 |
// StoreL(); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
190 |
// DP2("InternalValue=%d, ExternalValue=%d", InternalValue(), ExternalValue()); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
191 |
// DP("CIapSetting::EditItemL END"); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
192 |
// } |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
193 |
// |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
194 |
// void HandleSettingPageEventL(CAknSettingPage* aSettingPage, TAknSettingPageEvent aEventType) |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
195 |
// { |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
196 |
// DP("CIapSetting::HandleSettingPageEventL BEGIN"); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
197 |
// CAknSettingItem::HandleSettingPageEventL(aSettingPage, aEventType); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
198 |
// /*if (aEventType == EEventSettingOked) |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
199 |
// { |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
200 |
// DP2("InternalValue=%d, ExternalValue=%d", InternalValue(), ExternalValue()); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
201 |
// StoreL(); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
202 |
// }*/ |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
203 |
// DP("CIapSetting::HandleSettingPageEventL END"); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
204 |
// } |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
205 |
// |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
206 |
//protected: |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
207 |
// CPodcastModel& iPodcastModel; |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
208 |
//}; |
2 | 209 |
|
210 |
class CPodcastSettingItemList:public CAknSettingItemList |
|
211 |
{ |
|
212 |
public: |
|
213 |
CPodcastSettingItemList(CPodcastModel& aPodcastModel) : iPodcastModel(aPodcastModel) |
|
214 |
{ |
|
215 |
} |
|
216 |
||
217 |
~CPodcastSettingItemList() |
|
218 |
{ |
|
219 |
DP("CPodcastSettingItemList~"); |
|
220 |
} |
|
221 |
||
222 |
void StoreSettings() { |
|
223 |
DP("StoreSettings BEGIN"); |
|
224 |
StoreSettingsL(); |
|
225 |
CSettingsEngine &se = iPodcastModel.SettingsEngine(); |
|
226 |
se.SetBaseDir(iShowDir); |
|
227 |
DP1("Base Dir: %S", &iShowDir); |
|
228 |
se.SetUpdateAutomatically((TAutoUpdateSetting)iAutoUpdate); |
|
177
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
229 |
DP1("Update automatically: %d", iAutoUpdate); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
230 |
se.SetSpecificIAP(iIap); |
2 | 231 |
|
232 |
DP1("Download automatically: %d", iAutoDownload); |
|
233 |
se.SetDownloadAutomatically(iAutoDownload); |
|
234 |
se.SaveSettingsL(); |
|
235 |
DP("StoreSettings END"); |
|
236 |
} |
|
237 |
||
238 |
void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType) |
|
239 |
{ |
|
240 |
DP1("CPodcastSettingItemList::HandleListBoxEventL event %d", aEventType) |
|
241 |
CAknSettingItemList::HandleListBoxEventL(aListBox, aEventType); |
|
242 |
} |
|
243 |
||
244 |
void UpdateSettingVisibility() |
|
245 |
{ |
|
246 |
DP("UpdateSettingVisibility BEGIN"); |
|
247 |
LoadSettingsL(); |
|
177
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
248 |
TBool dimAutoUpdate = iIap == EConnectionAlwaysAsk; |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
249 |
// TBool dimIAP = EFalse; //iConnection < EConnectionUseIap; |
2 | 250 |
|
251 |
iSettingAutoUpdate->SetHidden(dimAutoUpdate); |
|
177
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
252 |
// iSettingIAP->SetHidden(dimIAP); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
253 |
// if(!dimIAP) |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
254 |
// { |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
255 |
// iSettingIAP->RefreshConnectionListL(); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
256 |
// } |
2 | 257 |
ListBox()->ScrollToMakeItemVisible(0); |
258 |
||
259 |
TRAP_IGNORE(HandleChangeInItemArrayOrVisibilityL()); |
|
260 |
DP("UpdateSettingVisibility END"); |
|
261 |
} |
|
262 |
||
263 |
void EditItemL (TInt aIndex, TBool aCalledFromMenu) |
|
264 |
{ |
|
177
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
265 |
if (aIndex == 0) { |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
266 |
CAknMemorySelectionDialog* memDlg = |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
267 |
CAknMemorySelectionDialog::NewL(ECFDDialogTypeNormal, ETrue); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
268 |
CleanupStack::PushL(memDlg); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
269 |
CAknMemorySelectionDialog::TMemory memory = |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
270 |
CAknMemorySelectionDialog::EPhoneMemory; |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
271 |
|
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
272 |
if (memDlg->ExecuteL(memory)) |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
273 |
{ |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
274 |
TFileName importName; |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
275 |
|
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
276 |
if (memory==CAknMemorySelectionDialog::EMemoryCard) |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
277 |
{ |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
278 |
importName = PathInfo:: MemoryCardRootPath(); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
279 |
} |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
280 |
else |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
281 |
{ |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
282 |
importName = PathInfo:: PhoneMemoryRootPath(); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
283 |
} |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
284 |
|
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
285 |
CAknFileSelectionDialog* dlg = CAknFileSelectionDialog::NewL(ECFDDialogTypeSave, R_PODCAST_SHOWDIR_SELECTOR); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
286 |
HBufC* select = iEikonEnv->AllocReadResourceLC(R_PODCAST_SOFTKEY_SELECT); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
287 |
dlg->SetLeftSoftkeyFileL(*select); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
288 |
CleanupStack::PopAndDestroy(select); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
289 |
CleanupStack::PushL(dlg); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
290 |
|
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
291 |
dlg->SetDefaultFolderL(importName); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
292 |
|
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
293 |
if(dlg->ExecuteL(importName)) |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
294 |
{ |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
295 |
importName.Append(_L("Podcasts")); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
296 |
iShowDir.Copy(importName); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
297 |
LoadSettingsL(); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
298 |
} |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
299 |
CleanupStack::PopAndDestroy(dlg); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
300 |
} |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
301 |
CleanupStack::PopAndDestroy(memDlg); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
302 |
} |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
303 |
else { |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
304 |
CAknSettingItemList::EditItemL(aIndex,aCalledFromMenu); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
305 |
} |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
306 |
StoreSettingsL(); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
307 |
UpdateSettingVisibility(); |
2 | 308 |
DP("EditItemL END"); |
309 |
} |
|
310 |
||
311 |
/** |
|
312 |
* Framework method to create a setting item based upon the user id aSettingId. The |
|
313 |
* client code decides what type to contruct. new (ELeave) must then be used and the resulting |
|
314 |
* pointer returned. Ownership is thereafter base class's responsiblity. |
|
315 |
* |
|
316 |
* @param aSettingId ID to use to determine the type of the setting item |
|
317 |
* @return a constructed (not 2nd-stage constructed) setting item. |
|
318 |
*/ |
|
319 |
CAknSettingItem* CreateSettingItemL( TInt aSettingId ) |
|
320 |
{ |
|
321 |
DP1("CreateSettingItemL BEGIN, aSettingId=%d", aSettingId); |
|
322 |
||
323 |
CSettingsEngine &se = iPodcastModel.SettingsEngine(); |
|
324 |
iShowDir.Copy(se.BaseDir()); |
|
325 |
iAutoUpdate = se.UpdateAutomatically(); |
|
326 |
iIap = se.SpecificIAP(); |
|
327 |
||
177
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
328 |
// if( iIap == 0) |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
329 |
// { |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
330 |
// iConnection = EConnectionDefault; |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
331 |
// } |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
332 |
// else if ( iIap == -1) |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
333 |
// { |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
334 |
// iConnection = EConnectionAlwaysAsk; |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
335 |
// } |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
336 |
// else if ( (iIap & KUseIAPFlag)) |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
337 |
// { |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
338 |
// iConnection = EConnectionUseIap; |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
339 |
// iIap = iIap& KUseIAPMask; |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
340 |
// } |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
341 |
// else |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
342 |
// { |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
343 |
// TInt snapIndex = 0; |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
344 |
// TInt cnt = iPodcastModel.SNAPIds().Count(); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
345 |
// while(snapIndex < cnt && ((TInt)iPodcastModel.SNAPIds()[snapIndex].iIapId) != iIap) |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
346 |
// { |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
347 |
// snapIndex++; |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
348 |
// } |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
349 |
// |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
350 |
// if(snapIndex != cnt) |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
351 |
// { |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
352 |
// iConnection = EConnectionUseI+snapIndex; |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
353 |
// } |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
354 |
// else |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
355 |
// { |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
356 |
// iConnection = EConnectionAlwaysAsk; |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
357 |
// } |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
358 |
// } |
2 | 359 |
|
360 |
iAutoDownload = se.DownloadAutomatically(); |
|
361 |
||
362 |
switch(aSettingId) |
|
363 |
{ |
|
364 |
case EPodcastSettingShowDir: |
|
365 |
DP("EPodcastSettingShowDir"); |
|
366 |
return new (ELeave) CAknTextSettingItem(aSettingId, iShowDir); |
|
367 |
break; |
|
368 |
case EPodcastSettingAutoUpdate: |
|
369 |
DP("EPodcastSettingAutoUpdate"); |
|
370 |
iSettingAutoUpdate = new (ELeave) CAknEnumeratedTextPopupSettingItem(aSettingId, iAutoUpdate); |
|
371 |
return iSettingAutoUpdate; |
|
372 |
break; |
|
177
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
373 |
// case EPodcastSettingConnection: |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
374 |
// DP("EPodcastSettingConnection"); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
375 |
// return new (ELeave) CConnectionSetting (aSettingId, iConnection, iPodcastModel); |
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
376 |
// break; |
2 | 377 |
case EPodcastSettingIAPList: |
378 |
DP("EPodcastSettingIAPList"); |
|
379 |
iSettingIAP = new (ELeave) CIapSetting (aSettingId, iIap, iPodcastModel); |
|
380 |
return iSettingIAP; |
|
381 |
break; |
|
382 |
case EPodcastSettingAutoDownload: |
|
383 |
DP("EPodcastSettingAutoDownload"); |
|
384 |
iSettingAutoDownload = new (ELeave) CAknBinaryPopupSettingItem (aSettingId, iAutoDownload); |
|
385 |
return iSettingAutoDownload; |
|
386 |
break; |
|
387 |
default: |
|
388 |
return CAknSettingItemList::CreateSettingItemL(aSettingId); |
|
389 |
break; |
|
390 |
} |
|
391 |
DP("CreateSettingItemL END"); |
|
392 |
return NULL; |
|
393 |
} |
|
394 |
||
395 |
TFileName iShowDir; |
|
396 |
||
397 |
TInt iAutoUpdate; |
|
398 |
CAknSettingItem *iSettingAutoUpdate; |
|
399 |
||
400 |
TInt iAutoDownload; |
|
401 |
CAknSettingItem *iSettingAutoDownload; |
|
402 |
||
177
269e3f3e544a
Lots of fixes for 3rd edition. First test SIS file, 0.90(3)
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
176
diff
changeset
|
403 |
// TInt iConnection; |
2 | 404 |
|
405 |
TInt iIap; |
|
406 |
CIapSetting *iSettingIAP; |
|
407 |
||
408 |
||
409 |
CPodcastModel &iPodcastModel; |
|
410 |
}; |
|
411 |
||
412 |
||
413 |
CPodcastSettingsView* CPodcastSettingsView::NewL(CPodcastModel& aPodcastModel) |
|
414 |
{ |
|
415 |
CPodcastSettingsView* self = CPodcastSettingsView::NewLC(aPodcastModel); |
|
416 |
CleanupStack::Pop( self ); |
|
417 |
return self; |
|
418 |
} |
|
419 |
||
420 |
CPodcastSettingsView* CPodcastSettingsView::NewLC(CPodcastModel& aPodcastModel) |
|
421 |
{ |
|
422 |
CPodcastSettingsView* self = new ( ELeave ) CPodcastSettingsView(aPodcastModel); |
|
423 |
CleanupStack::PushL( self ); |
|
424 |
self->ConstructL(); |
|
425 |
return self; |
|
426 |
} |
|
427 |
||
428 |
CPodcastSettingsView::CPodcastSettingsView(CPodcastModel& aPodcastModel):iPodcastModel(aPodcastModel) |
|
429 |
{ |
|
430 |
} |
|
431 |
||
432 |
void CPodcastSettingsView::ConstructL() |
|
433 |
{ |
|
434 |
BaseConstructL(R_PODCAST_SETTINGSVIEW); |
|
435 |
} |
|
436 |
||
437 |
CPodcastSettingsView::~CPodcastSettingsView() |
|
438 |
{ |
|
439 |
DP("CPodcastSettingsView::~CPodcastSettingsView()"); |
|
440 |
delete iListbox; |
|
441 |
} |
|
442 |
||
443 |
TUid CPodcastSettingsView::Id() const |
|
444 |
{ |
|
445 |
return KUidPodcastSettingsViewID; |
|
446 |
} |
|
447 |
||
448 |
void CPodcastSettingsView::DoActivateL(const TVwsViewId& aPrevViewId, |
|
449 |
TUid /*aCustomMessageId*/, |
|
450 |
const TDesC8& /*aCustomMessage*/) |
|
451 |
{ |
|
452 |
DP("CPodcastSettingsView::DoActivateL BEGIN"); |
|
453 |
iPreviousView = aPrevViewId; |
|
454 |
||
455 |
if (iListbox) { |
|
456 |
delete iListbox; |
|
457 |
iListbox = NULL; |
|
458 |
} |
|
459 |
||
460 |
DP("Creating listbox"); |
|
461 |
iPodcastModel.UpdateSNAPListL(); |
|
462 |
iPodcastModel.UpdateIAPListL(); |
|
463 |
||
464 |
iListbox =new (ELeave) CPodcastSettingItemList(iPodcastModel); |
|
465 |
iListbox->SetMopParent( this ); |
|
466 |
iListbox->ConstructFromResourceL(R_PODCAST_SETTINGS); |
|
467 |
iListbox->SetRect(ClientRect()); |
|
468 |
iListbox->ActivateL(); |
|
469 |
||
470 |
DP("Creating navipane"); |
|
471 |
iNaviPane =( CAknNavigationControlContainer * ) StatusPane()->ControlL( TUid::Uid( EEikStatusPaneUidNavi ) ); |
|
472 |
||
473 |
HBufC *titleBuffer = iEikonEnv->AllocReadResourceL(R_SETTINGS_TITLE); |
|
474 |
iNaviDecorator = iNaviPane->CreateNavigationLabelL(*titleBuffer); |
|
475 |
delete titleBuffer; |
|
476 |
||
477 |
DP("Updating listbox"); |
|
478 |
AppUi()->AddToStackL(*this, iListbox); |
|
479 |
iListbox->UpdateSettingVisibility(); |
|
480 |
iListbox->MakeVisible(ETrue); |
|
481 |
iListbox->DrawNow(); |
|
482 |
iListbox->SetFocus(ETrue); |
|
483 |
||
484 |
if(iNaviDecorator && iNaviPane) |
|
485 |
{ |
|
486 |
iNaviPane->PushL(*iNaviDecorator); |
|
487 |
} |
|
49
43e204e6ae2e
Fix for accidental merge regressions. Text fixes for tool tip and settings.
teknolog
parents:
2
diff
changeset
|
488 |
|
2 | 489 |
DP("CPodcastSettingsView::DoActivateL END"); |
490 |
} |
|
491 |
||
492 |
void CPodcastSettingsView::DoDeactivate() |
|
493 |
{ |
|
494 |
DP("CPodcastSettingsView::DoDeactivate BEGIN"); |
|
495 |
if (iListbox) { |
|
496 |
iListbox->MakeVisible(EFalse); |
|
497 |
||
498 |
AppUi()->RemoveFromViewStack( *this, iListbox ); |
|
499 |
||
500 |
} |
|
501 |
||
502 |
if(iNaviDecorator && iNaviPane) |
|
503 |
{ |
|
504 |
iNaviPane->Pop(iNaviDecorator); |
|
505 |
delete iNaviDecorator; |
|
506 |
iNaviDecorator = NULL; |
|
507 |
} |
|
508 |
DP("CPodcastSettingsView::DoDeactivate END"); |
|
509 |
} |
|
510 |
||
511 |
/** |
|
512 |
* Command handling function intended for overriding by sub classes. |
|
513 |
* Default implementation is empty. |
|
514 |
* @param aCommand ID of the command to respond to. |
|
515 |
*/ |
|
516 |
void CPodcastSettingsView::HandleCommandL(TInt aCommand) |
|
517 |
{ |
|
518 |
CAknView::HandleCommandL(aCommand); |
|
519 |
DP1("CPodcastListView::HandleCommandL=%d", aCommand); |
|
520 |
switch(aCommand) |
|
521 |
{ |
|
522 |
case EAknSoftkeyBack: |
|
523 |
{ |
|
524 |
iListbox->StoreSettings(); |
|
525 |
AppUi()->ActivateViewL(iPreviousView); |
|
526 |
} |
|
60 | 527 |
break; |
528 |
case EPodcastResetDb: |
|
164
000f9fc147b2
Catch up with default branch; New v 27 SIS
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
65
diff
changeset
|
529 |
{ |
60 | 530 |
CAknQueryDialog* dlg= new(ELeave) CAknQueryDialog(); |
531 |
||
532 |
CleanupStack::PushL(dlg); |
|
533 |
HBufC *text = iCoeEnv->AllocReadResourceLC(R_RESET_DB_QUERY); |
|
534 |
dlg->SetPromptL(*text); |
|
535 |
CleanupStack::PopAndDestroy(text); |
|
536 |
CleanupStack::Pop(dlg); |
|
537 |
if(dlg->ExecuteLD(R_QUERYDLG)) |
|
538 |
{ |
|
539 |
iPodcastModel.DropDB(); |
|
540 |
AppUi()->Exit(); |
|
541 |
} |
|
164
000f9fc147b2
Catch up with default branch; New v 27 SIS
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
65
diff
changeset
|
542 |
} |
60 | 543 |
break; |
2 | 544 |
default: |
164
000f9fc147b2
Catch up with default branch; New v 27 SIS
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
65
diff
changeset
|
545 |
{ |
2 | 546 |
AppUi()->HandleCommandL(aCommand); |
164
000f9fc147b2
Catch up with default branch; New v 27 SIS
Sebastian Brannstrom <sebastianb@symbian.org>
parents:
65
diff
changeset
|
547 |
} |
2 | 548 |
break; |
549 |
} |
|
550 |
} |
|
551 |
||
552 |
void CPodcastSettingsView::HandleStatusPaneSizeChange() |
|
553 |
{ |
|
554 |
CAknView::HandleStatusPaneSizeChange(); |
|
555 |
||
556 |
DP2("CPodcastSettingsView::HandleStatusPaneSizeChange() width=%d, height=%d", ClientRect().Width(), ClientRect().Height()); |
|
557 |
if (iListbox) { |
|
558 |
iListbox->SetRect( ClientRect()); |
|
559 |
} |
|
560 |
} |