author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Wed, 13 Oct 2010 15:01:35 +0300 | |
branch | RCL_3 |
changeset 55 | ea98413ce11f |
parent 49 | 10852b179f64 |
permissions | -rw-r--r-- |
45 | 1 |
/* |
2 |
* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). |
|
3 |
* All rights reserved. |
|
4 |
* This component and the accompanying materials are made available |
|
5 |
* under the terms of "Eclipse Public License v1.0" |
|
6 |
* which accompanies this distribution, and is available |
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 |
* |
|
9 |
* Initial Contributors: |
|
10 |
* Nokia Corporation - initial contribution. |
|
11 |
* |
|
12 |
* Contributors: |
|
13 |
* |
|
14 |
* Description: Implements the CLocSUPLServerEditor class |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
||
20 |
#include <aknappui.h> |
|
21 |
#include <AknIconArray.h> // Icon Array |
|
22 |
#include <aknlocationed.h> |
|
23 |
#include <aknlistquerydialog.h> |
|
24 |
#include <AknPopupFieldText.h> |
|
25 |
#include <aknnotewrappers.h> |
|
26 |
#include <AknsUtils.h> |
|
27 |
#include <AknsSkinInstance.h> |
|
28 |
#include <aknselectionlist.h> |
|
29 |
#include <akntitle.h> // CAknTitlePane |
|
30 |
#include <AknWaitDialog.h> |
|
31 |
#include <aknuniteditor.h> |
|
32 |
#include <avkon.rsg> |
|
33 |
#include <avkon.hrh> |
|
34 |
#include <e32math.h> |
|
35 |
#include <eikapp.h> |
|
36 |
#include <eikaufty.h> |
|
37 |
#include <eikcapc.h> |
|
38 |
#include <eikedwin.h> |
|
39 |
#include <eikenv.h> |
|
40 |
#include <eikmenup.h> |
|
41 |
#include <eikmenub.h> |
|
42 |
#include <eikserverapp.h> |
|
43 |
#include <eikspane.h> // Status pane |
|
44 |
#include <barsread.h> // For TResourceReader |
|
45 |
#include <bautils.h> |
|
46 |
#include <data_caging_path_literals.hrh> |
|
47 |
#include <gulicon.h> // Gul Icon |
|
48 |
#include <StringLoader.h> |
|
49 |
#include <hlplch.h> |
|
50 |
||
51 |
#include <epos_csuplsettingsconstants.h> |
|
52 |
#include <epos_csuplsettingparams.h> |
|
53 |
||
54 |
#include <locsuplsettingsui.rsg> |
|
55 |
#include "locsuplsettings.hrh" |
|
56 |
#include "locsuplservereditor.h" |
|
57 |
#include "locsuplsettingsuiengine.h" |
|
58 |
#include "locsupldebug.h" |
|
59 |
||
60 |
// ============================ LOCAL FUNCTIONS =============================== |
|
61 |
||
62 |
// ============================ MEMBER FUNCTIONS =============================== |
|
63 |
||
64 |
// ----------------------------------------------------------------------------- |
|
65 |
// CLocSUPLServerEditor::CLocSUPLServerEditor() |
|
66 |
// ----------------------------------------------------------------------------- |
|
67 |
// |
|
68 |
CLocSUPLServerEditor::CLocSUPLServerEditor( |
|
69 |
TBool aIsEditable, |
|
70 |
CLocSUPLSettingsUiEngine& aEngine, |
|
71 |
TInt64 aSlpId |
|
55
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
72 |
):iIsEditMode( aIsEditable ), iEngine( aEngine ), iSlpId( aSlpId ) |
45 | 73 |
{ |
74 |
if( aIsEditable ) |
|
75 |
{ |
|
76 |
iIsNewServer = ETrue; |
|
77 |
iSlpId = NULL; |
|
78 |
} |
|
79 |
} |
|
80 |
||
81 |
// ----------------------------------------------------------------------------- |
|
82 |
// CLocSUPLServerEditor::ConstructL() |
|
83 |
// ----------------------------------------------------------------------------- |
|
84 |
// |
|
85 |
void CLocSUPLServerEditor::ConstructL() |
|
86 |
{ |
|
87 |
DEBUG( + CLocSUPLServerEditor::ConstructL ); |
|
88 |
CAknForm::ConstructL( R_SUPLSERVER_EDITOR_MENU_BAR ); |
|
89 |
||
90 |
// Save original title |
|
91 |
CEikStatusPane* statusPane = iAvkonAppUi->StatusPane(); |
|
92 |
iTitlePane = ( CAknTitlePane* ) statusPane->ControlL( |
|
93 |
TUid::Uid( EEikStatusPaneUidTitle ) ); |
|
94 |
iOriginalTitle = iTitlePane->Text()->AllocL(); |
|
95 |
||
96 |
// Allocate memory for Server address buffer & Access point buffer |
|
97 |
iServerAddress = HBufC16::NewL( KMaxHSLPAddrLen ); |
|
98 |
iIap = HBufC16::NewL( KMaxIAPLen ); |
|
99 |
||
100 |
DEBUG( - CLocSUPLServerEditor::ConstructL ); |
|
101 |
} |
|
102 |
||
103 |
// ----------------------------------------------------------------------------- |
|
104 |
// CLocSUPLServerEditor::NewL() |
|
105 |
// ----------------------------------------------------------------------------- |
|
106 |
// |
|
107 |
CLocSUPLServerEditor* CLocSUPLServerEditor::NewL( |
|
108 |
TBool aIsEditable, |
|
109 |
CLocSUPLSettingsUiEngine& aEngine, |
|
110 |
TInt64 aSlpId |
|
111 |
) |
|
112 |
{ |
|
113 |
CLocSUPLServerEditor* self = NewLC( aIsEditable, aEngine, aSlpId ); |
|
114 |
CleanupStack::Pop( self ); |
|
115 |
return self; |
|
116 |
} |
|
117 |
||
118 |
// ----------------------------------------------------------------------------- |
|
119 |
// CLocSUPLServerEditor::NewLC() |
|
120 |
// ----------------------------------------------------------------------------- |
|
121 |
// |
|
122 |
CLocSUPLServerEditor* CLocSUPLServerEditor::NewLC( |
|
123 |
TBool aIsEditable, |
|
124 |
CLocSUPLSettingsUiEngine& aEngine, |
|
125 |
TInt64 aSlpId |
|
126 |
) |
|
127 |
{ |
|
128 |
CLocSUPLServerEditor* self = new ( ELeave ) |
|
129 |
CLocSUPLServerEditor( aIsEditable, aEngine, aSlpId ); |
|
130 |
CleanupStack::PushL( self ); |
|
131 |
self->ConstructL(); |
|
132 |
return self; |
|
133 |
} |
|
134 |
||
135 |
// ----------------------------------------------------------------------------- |
|
136 |
// CLocSUPLServerEditor::~CLocSUPLServerEditor() |
|
137 |
// ----------------------------------------------------------------------------- |
|
138 |
// |
|
139 |
CLocSUPLServerEditor::~CLocSUPLServerEditor() |
|
140 |
{ |
|
141 |
DEBUG( + CLocSUPLServerEditor::~CLocSUPLServerEditor ); |
|
142 |
// Restore title pane. Ownership of iTitlePane transferred. |
|
143 |
if ( iTitlePane && iOriginalTitle ) |
|
144 |
{ |
|
145 |
iTitlePane->SetText( iOriginalTitle ); |
|
146 |
} |
|
147 |
delete iServerAddress; |
|
148 |
iServerAddress = NULL; |
|
149 |
||
150 |
delete iIap; |
|
151 |
iIap = NULL; |
|
152 |
DEBUG( - CLocSUPLServerEditor::~CLocSUPLServerEditor ); |
|
153 |
} |
|
154 |
||
155 |
// ----------------------------------------------------------------------------- |
|
156 |
// CLocSUPLServerEditor::DynInitMenuPaneL() |
|
157 |
// ----------------------------------------------------------------------------- |
|
158 |
// |
|
159 |
void CLocSUPLServerEditor::DynInitMenuPaneL( |
|
160 |
TInt aResourceId, |
|
161 |
CEikMenuPane* aMenuPane ) |
|
162 |
{ |
|
163 |
DEBUG( + CLocSUPLServerEditor::DynInitMenuPaneL ); |
|
164 |
CAknForm::DynInitMenuPaneL( aResourceId, aMenuPane ); |
|
165 |
||
166 |
if ( aResourceId == R_AVKON_FORM_MENUPANE ) |
|
167 |
{ |
|
168 |
// We do not want to allow the user to modify our Form therefore |
|
169 |
// Disable the Label, Add, Delete, and Save Field |
|
170 |
aMenuPane->SetItemDimmed( EAknFormCmdLabel, ETrue ); |
|
171 |
aMenuPane->SetItemDimmed( EAknFormCmdAdd, ETrue ); |
|
172 |
aMenuPane->SetItemDimmed( EAknFormCmdDelete,ETrue ); |
|
173 |
aMenuPane->SetItemDimmed( EAknFormCmdSave, ETrue ); |
|
174 |
||
175 |
if( IsEditable() ) |
|
176 |
{ |
|
177 |
aMenuPane->SetItemDimmed( EAknFormCmdEdit, ETrue ); |
|
178 |
aMenuPane->SetItemDimmed( ELocServerEditorDisable, ETrue ); |
|
179 |
aMenuPane->SetItemDimmed( ELocServerEditorEnable, ETrue ); |
|
180 |
aMenuPane->SetItemDimmed( ELocServerEditorDelete, ETrue ); |
|
181 |
||
182 |
switch( IdOfFocusControl() ) |
|
183 |
{ |
|
184 |
case ELocSuplServerIdServerAddr: |
|
185 |
{ |
|
186 |
aMenuPane->SetItemDimmed( ELocServerEditorDefine, ETrue ); |
|
55
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
187 |
aMenuPane->SetItemDimmed( ELocServerEditorChange, ETrue ); |
45 | 188 |
break; |
189 |
} |
|
190 |
case ELocSuplServerIdAccessPoint: |
|
191 |
{ |
|
55
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
192 |
TInt isIapChanged = EFalse; |
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
193 |
CEikEdwin* apSelector = |
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
194 |
static_cast < CEikEdwin* > ( ControlOrNull( IdOfFocusControl() ) ); |
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
195 |
if( apSelector ) |
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
196 |
{ |
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
197 |
if( iIap->Length() > 0 ) |
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
198 |
isIapChanged = ETrue; |
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
199 |
} |
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
200 |
|
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
201 |
if( isIapChanged ) |
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
202 |
{ |
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
203 |
aMenuPane->SetItemDimmed( ELocServerEditorDefine, ETrue ); |
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
204 |
} |
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
205 |
else |
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
206 |
{ |
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
207 |
aMenuPane->SetItemDimmed( ELocServerEditorChange, ETrue ); |
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
208 |
} |
45 | 209 |
break; |
210 |
} |
|
211 |
case ELocSuplServerIdUsageInHomeNw: |
|
212 |
{ |
|
213 |
aMenuPane->SetItemDimmed( ELocServerEditorDefine, ETrue ); |
|
214 |
||
215 |
TBool editableFlag = ETrue; |
|
216 |
if( iSlpId ) |
|
217 |
TRAP_IGNORE( iEngine.GetEditableFlagL( iSlpId, editableFlag ) ); |
|
55
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
218 |
if( editableFlag == EFalse ) |
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
219 |
aMenuPane->SetItemDimmed( ELocServerEditorChange, ETrue ); |
45 | 220 |
|
221 |
break; |
|
222 |
} |
|
223 |
default: |
|
224 |
break; |
|
225 |
} |
|
226 |
} |
|
227 |
else |
|
228 |
{ |
|
229 |
TBool enabledFlag; |
|
230 |
TRAP_IGNORE( iEngine.GetServerEnabledFlagL( iSlpId, enabledFlag ) ); |
|
231 |
||
232 |
if( enabledFlag ) |
|
233 |
aMenuPane->SetItemDimmed( ELocServerEditorEnable, ETrue ); |
|
234 |
else |
|
235 |
aMenuPane->SetItemDimmed( ELocServerEditorDisable, ETrue ); |
|
236 |
||
237 |
||
238 |
TBool editableFlag = ETrue; |
|
239 |
if( iSlpId ) |
|
240 |
TRAP_IGNORE( iEngine.GetEditableFlagL( iSlpId, editableFlag ) ); |
|
241 |
if( editableFlag == EFalse ) |
|
242 |
{ |
|
243 |
switch( IdOfFocusControl() ) |
|
244 |
{ |
|
245 |
case ELocSuplServerIdServerAddr: |
|
246 |
case ELocSuplServerIdUsageInHomeNw: |
|
247 |
{ |
|
248 |
aMenuPane->SetItemDimmed( EAknFormCmdEdit, ETrue ); |
|
249 |
break; |
|
250 |
} |
|
251 |
default: |
|
252 |
break; |
|
253 |
} |
|
254 |
} |
|
255 |
||
256 |
aMenuPane->SetItemDimmed( ELocServerEditorDefine, ETrue ); |
|
55
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
257 |
aMenuPane->SetItemDimmed( ELocServerEditorChange, ETrue ); |
45 | 258 |
aMenuPane->SetItemDimmed( ELocServerEditorRemove, ETrue ); |
259 |
} |
|
260 |
} |
|
261 |
DEBUG( - CLocSUPLServerEditor::DynInitMenuPaneL ); |
|
262 |
} |
|
263 |
||
264 |
// ----------------------------------------------------------------------------- |
|
265 |
// CLocSUPLServerEditor::ProcessCommandL() |
|
266 |
// ----------------------------------------------------------------------------- |
|
267 |
// |
|
268 |
void CLocSUPLServerEditor::ProcessCommandL( TInt aCommandId ) |
|
269 |
{ |
|
270 |
DEBUG1( + CLocSUPLServerEditor::ProcessCommandL aCommandId=%d, aCommandId ); |
|
271 |
CAknForm::ProcessCommandL( aCommandId ); |
|
272 |
||
273 |
switch (aCommandId) |
|
274 |
{ |
|
275 |
case EAknFormCmdEdit: |
|
276 |
{ |
|
277 |
iIsEditMode = ETrue; |
|
278 |
SetCursorToEndL(); |
|
279 |
HandleMSKCaptionL(); |
|
280 |
break; |
|
281 |
} |
|
282 |
case ELocServerEditorDelete: |
|
283 |
case ELocServerEditorRemove: |
|
284 |
{ |
|
285 |
if (DeleteConfirmationQueryL()) |
|
286 |
{ |
|
287 |
TRAP_IGNORE( iEngine.RemoveServerL( iSlpId ) ); |
|
288 |
// Return back to server view |
|
289 |
TryExitL(EAknSoftkeyBack); |
|
290 |
} |
|
291 |
break; |
|
292 |
} |
|
293 |
case ELocServerEditorDisable: |
|
294 |
{ |
|
295 |
TRAP_IGNORE( iEngine.SetServerEnabledFlagL( iSlpId, EFalse ) ); |
|
296 |
break; |
|
297 |
} |
|
298 |
case ELocServerEditorEnable: |
|
299 |
{ |
|
300 |
TRAP_IGNORE( iEngine.SetServerEnabledFlagL( iSlpId, ETrue ) ); |
|
301 |
break; |
|
302 |
} |
|
55
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
303 |
case ELocServerEditorDefine: |
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
304 |
{ |
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
305 |
TRAP_IGNORE( iEngine.LaunchApConfiguratorL( iSlpId, this ) ); |
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
306 |
break; |
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
307 |
} |
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
308 |
case ELocServerEditorChange: |
45 | 309 |
case ELocServerEditorMSKChange: |
310 |
{ |
|
311 |
CEikEdwin* usageInHomeNWPopupFieldText = (CEikEdwin*) Control( |
|
312 |
ELocSuplServerIdUsageInHomeNw); |
|
55
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
313 |
if (IdOfFocusControl() == ELocSuplServerIdAccessPoint) |
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
314 |
{ |
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
315 |
TRAP_IGNORE( iEngine.LaunchApConfiguratorL( iSlpId, this ) ); |
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
316 |
} |
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
317 |
else |
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
318 |
{ |
49
10852b179f64
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
319 |
HBufC* string; |
10852b179f64
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
320 |
string = StringLoader::LoadLC( |
10852b179f64
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
321 |
R_LOC_SERVER_USAGEINHOMENETWORK_NO, iCoeEnv); |
45 | 322 |
if (iIsNewServer) |
323 |
{ |
|
324 |
TBuf<KMaxUsageTextSize> des; |
|
325 |
usageInHomeNWPopupFieldText->GetText(des); |
|
49
10852b179f64
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
326 |
if (!des.CompareC(string->Des())) |
45 | 327 |
{ |
328 |
SetUsageinHomeNetwork(ETrue); |
|
329 |
} |
|
330 |
else |
|
331 |
{ |
|
332 |
SetUsageinHomeNetwork(EFalse); |
|
333 |
} |
|
334 |
} |
|
335 |
else |
|
336 |
{ |
|
337 |
TBool editableFlag; |
|
338 |
TRAP_IGNORE( iEngine.GetEditableFlagL( iSlpId, editableFlag ) ); |
|
339 |
if (editableFlag) |
|
340 |
{ |
|
341 |
TBuf<KMaxUsageTextSize> des; |
|
342 |
usageInHomeNWPopupFieldText->GetText(des); |
|
49
10852b179f64
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
343 |
if (!des.CompareC(string->Des())) |
45 | 344 |
{ |
345 |
SetUsageinHomeNetwork(ETrue); |
|
346 |
} |
|
347 |
else |
|
348 |
{ |
|
349 |
SetUsageinHomeNetwork(EFalse); |
|
350 |
} |
|
351 |
} |
|
55
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
352 |
} |
49
10852b179f64
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
353 |
CleanupStack::PopAndDestroy(string); |
55
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
354 |
} |
45 | 355 |
break; |
356 |
} |
|
357 |
case EAknCmdHelp: |
|
358 |
{ |
|
359 |
HlpLauncher::LaunchHelpApplicationL(iCoeEnv->WsSession(), |
|
360 |
iAvkonAppUi->AppHelpContextL()); |
|
361 |
break; |
|
362 |
} |
|
363 |
case EEikCmdExit: |
|
364 |
{ |
|
365 |
// The Exit is handled by the Application UI |
|
366 |
TryExitL(EEikCmdExit); |
|
367 |
break; |
|
368 |
} |
|
369 |
default: |
|
370 |
break; |
|
371 |
}DEBUG( - CLocSUPLServerEditor::ProcessCommandL ); |
|
372 |
} |
|
373 |
||
374 |
// --------------------------------------------------------------------------- |
|
375 |
// Derived from CEikDialog |
|
376 |
// --------------------------------------------------------------------------- |
|
377 |
||
378 |
// ----------------------------------------------------------------------------- |
|
379 |
// CLocSUPLServerEditor::OfferKeyEventL |
|
380 |
// Receives and handles key events |
|
381 |
// ----------------------------------------------------------------------------- |
|
382 |
// |
|
383 |
TKeyResponse CLocSUPLServerEditor::OfferKeyEventL( const TKeyEvent& aKeyEvent, |
|
384 |
TEventCode aType ) |
|
385 |
{ |
|
386 |
DEBUG( CLocSUPLServerEditor::OfferKeyEventL ); |
|
387 |
if ( aType == EEventKey ) |
|
388 |
{ |
|
389 |
if( aKeyEvent.iCode == EKeyBackspace && IsEditable() == EFalse ) |
|
390 |
{ |
|
391 |
ProcessCommandL( ELocServerEditorDelete ); |
|
392 |
return EKeyWasConsumed; |
|
393 |
} |
|
394 |
||
395 |
if( !iIsNewServer && IsEditable() ) |
|
396 |
{ |
|
397 |
// check if current opened server is editable |
|
398 |
// if its not editable then return with no action on it. |
|
399 |
TBool editableFlag = ETrue; |
|
400 |
if( iSlpId ) |
|
401 |
TRAP_IGNORE( iEngine.GetEditableFlagL( iSlpId, editableFlag ) ); |
|
402 |
||
403 |
if( editableFlag == EFalse ) |
|
404 |
{ |
|
405 |
if( ( aKeyEvent.iScanCode != EStdKeyUpArrow || aKeyEvent.iScanCode != EStdKeyDownArrow ) |
|
406 |
== EFalse ) |
|
407 |
{ |
|
408 |
switch( IdOfFocusControl() ) |
|
409 |
{ |
|
410 |
case ELocSuplServerIdServerAddr: |
|
411 |
case ELocSuplServerIdUsageInHomeNw: |
|
412 |
{ |
|
413 |
return EKeyWasConsumed; |
|
414 |
} |
|
415 |
default: |
|
416 |
break; |
|
417 |
} |
|
418 |
} |
|
419 |
} |
|
420 |
} |
|
421 |
||
422 |
if ( aKeyEvent.iCode == EKeyEnter || aKeyEvent.iScanCode == EStdKeyEnter ) |
|
423 |
{ |
|
424 |
if ( !( IsEditable() && IdOfFocusControl() == ELocSuplServerIdServerAddr ) ) |
|
425 |
{ |
|
426 |
TKeyEvent enterKeyEvent( aKeyEvent ); |
|
427 |
enterKeyEvent.iCode = EKeyOK; |
|
428 |
CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current(); |
|
429 |
return cba->OfferKeyEventL( enterKeyEvent, aType ); |
|
430 |
} |
|
431 |
} |
|
432 |
} |
|
433 |
TKeyResponse response= CAknForm::OfferKeyEventL( aKeyEvent, aType ); |
|
434 |
return response; |
|
435 |
} |
|
436 |
||
437 |
// --------------------------------------------------------------------------- |
|
438 |
// CLocSUPLServerEditor ::OkToExitL() |
|
439 |
// --------------------------------------------------------------------------- |
|
440 |
// |
|
441 |
TBool CLocSUPLServerEditor::OkToExitL( TInt aButtonId ) |
|
442 |
{ |
|
443 |
DEBUG1( + CLocSUPLServerEditor::OkToExitL aButtonId=%d, aButtonId ); |
|
444 |
TBool retVal = ETrue; |
|
445 |
||
446 |
switch( aButtonId ) |
|
447 |
{ |
|
448 |
case EAknFormCmdEdit: // when MSK is pressed |
|
449 |
{ |
|
450 |
//Handle MSK operation based on focused line. |
|
451 |
if( IsEditable() == EFalse ) |
|
452 |
{ |
|
453 |
ProcessCommandL( EAknFormCmdEdit ); |
|
454 |
HandleMSKCaptionL(); |
|
455 |
} |
|
456 |
//dont close editor |
|
457 |
retVal = EFalse; |
|
458 |
break; |
|
459 |
} |
|
460 |
case ELocServerEditorNoCmd: |
|
461 |
{ |
|
462 |
//dont close editor |
|
463 |
retVal = EFalse; |
|
464 |
break; |
|
465 |
} |
|
55
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
466 |
case ELocServerEditorMSKDefine: |
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
467 |
{ |
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
468 |
TRAP_IGNORE( iEngine.LaunchApConfiguratorL( iSlpId, this ) ); |
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
469 |
//dont close editor |
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
470 |
retVal = EFalse; |
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
471 |
break; |
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
472 |
} |
45 | 473 |
case ELocServerEditorMSKChange: |
474 |
{ |
|
475 |
ProcessCommandL( ELocServerEditorMSKChange ); |
|
476 |
//dont close editor |
|
477 |
retVal = EFalse; |
|
478 |
break; |
|
479 |
} |
|
480 |
case EAknSoftkeyOptions: //when LSK is pressed |
|
481 |
{ |
|
482 |
//display menu specific to editor |
|
483 |
DisplayMenuL(); |
|
484 |
//don't close editor |
|
485 |
retVal = EFalse; |
|
486 |
break; |
|
487 |
} |
|
488 |
case EAknSoftkeyBack: |
|
489 |
{ |
|
490 |
break; |
|
491 |
} |
|
492 |
case EAknSoftkeyDone: // when RSK is pressed in edit mode |
|
493 |
{ |
|
494 |
if( SaveFormDataL() ) |
|
495 |
{ |
|
496 |
if( iIsNewServer ) |
|
497 |
{ |
|
498 |
TRAPD( err, iEngine.AddNewServerL( |
|
499 |
iServerAddress->Des(), |
|
55
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
500 |
iIap->Des(), |
45 | 501 |
iUsageInHomeNw ) ); |
502 |
if( err == KErrNone ) |
|
503 |
{ |
|
504 |
iIsNewServer = EFalse; |
|
505 |
} |
|
506 |
else if( err == KErrAlreadyExists ) |
|
507 |
{ |
|
508 |
ShowServerValidationInfoNoteL( R_LOC_SERVER_ALREADY_EXIST_INFO_NOTE ); |
|
509 |
iIsEditMode = ETrue; |
|
510 |
SetEditableL( iIsEditMode ); |
|
511 |
SetInitialCurrentLine(); |
|
512 |
SetCursorToEndL(); |
|
513 |
//dont close editor |
|
514 |
retVal = EFalse; |
|
515 |
} |
|
516 |
else if( err == KErrArgument ) |
|
517 |
{ |
|
518 |
ShowServerValidationInfoNoteL( R_LOC_SERVER_INFO_NOTE ); |
|
519 |
iIsEditMode = ETrue; |
|
520 |
SetEditableL( iIsEditMode ); |
|
521 |
SetInitialCurrentLine(); |
|
522 |
SetCursorToEndL(); |
|
523 |
//dont close editor |
|
524 |
retVal = EFalse; |
|
525 |
} |
|
526 |
} |
|
527 |
else |
|
528 |
{ // save the existing slp entry info |
|
529 |
if( iSlpId ) |
|
530 |
{ |
|
531 |
TRAPD( err, iEngine.SetServerAddressL( |
|
532 |
iSlpId, iServerAddress->Des() ) ); |
|
533 |
if( err == KErrNone ) |
|
534 |
{ |
|
535 |
if( iIap->Length() > 0 ) |
|
536 |
iEngine.SetIapNameL( iSlpId, iIap->Des() ); |
|
537 |
iEngine.SetUsageInHomwNwFlagL( iSlpId, iUsageInHomeNw ); |
|
538 |
||
539 |
iIsEditMode = EFalse; |
|
540 |
SetEditableL( iIsEditMode ); |
|
541 |
} |
|
542 |
else if( err == KErrAlreadyExists ) |
|
543 |
{ |
|
544 |
ShowServerValidationInfoNoteL( R_LOC_SERVER_ALREADY_EXIST_INFO_NOTE ); |
|
545 |
iIsEditMode = ETrue; |
|
546 |
SetEditableL( iIsEditMode ); |
|
547 |
SetInitialCurrentLine(); |
|
548 |
SetCursorToEndL(); |
|
549 |
} |
|
550 |
else if( err == KErrArgument ) |
|
551 |
{ |
|
552 |
ShowServerValidationInfoNoteL( R_LOC_SERVER_INFO_NOTE ); |
|
553 |
iIsEditMode = ETrue; |
|
554 |
SetEditableL( iIsEditMode ); |
|
555 |
SetInitialCurrentLine(); |
|
556 |
SetCursorToEndL(); |
|
557 |
//dont close editor |
|
558 |
retVal = EFalse; |
|
559 |
} |
|
560 |
} |
|
561 |
HandleMSKCaptionL(); |
|
562 |
//dont close editor |
|
563 |
retVal = EFalse; |
|
564 |
} |
|
565 |
} |
|
566 |
else |
|
567 |
{ |
|
568 |
//if control's state is changed and manadatory contain is not added then show the popup message |
|
569 |
if( iIsModified ) |
|
570 |
{ |
|
571 |
ShowServerValidationInfoNoteL( R_LOC_SERVER_INFO_NOTE ); |
|
572 |
iIsEditMode = ETrue; |
|
573 |
SetEditableL( iIsEditMode ); |
|
574 |
SetInitialCurrentLine(); |
|
575 |
SetCursorToEndL(); |
|
576 |
//dont close editor |
|
577 |
retVal = EFalse; |
|
578 |
} |
|
579 |
else |
|
580 |
{ |
|
581 |
retVal = ETrue; |
|
582 |
} |
|
583 |
} |
|
584 |
break; |
|
585 |
} |
|
586 |
default: // close editor in all other cases |
|
587 |
{ |
|
588 |
break; |
|
589 |
} |
|
590 |
} |
|
591 |
DEBUG1( - CLocSUPLServerEditor::OkToExitL retVal=%d, retVal ); |
|
592 |
return retVal; |
|
593 |
} |
|
594 |
||
595 |
// ----------------------------------------------------------------------------- |
|
596 |
// CLocSUPLServerEditor::SaveFormDataL() |
|
597 |
// Deals with the occasion of a change from edit->view mode and the user wishes |
|
598 |
// to save the changes. |
|
599 |
// ----------------------------------------------------------------------------- |
|
600 |
// |
|
601 |
TBool CLocSUPLServerEditor::SaveFormDataL() |
|
602 |
{ |
|
603 |
DEBUG( + CLocSUPLServerEditor::SaveFormDataL ); |
|
604 |
TBool retVal = EFalse; |
|
605 |
||
606 |
//Retrieve server address text |
|
607 |
CEikEdwin* serverAddress = |
|
608 |
static_cast < CEikEdwin* > ( ControlOrNull( ELocSuplServerIdServerAddr ) ); |
|
609 |
if( serverAddress ) |
|
610 |
{ |
|
611 |
HBufC* address = serverAddress->GetTextInHBufL(); |
|
612 |
if( address ) |
|
613 |
{ |
|
614 |
iServerAddress->Des().Copy( address->Des() ); |
|
615 |
} |
|
616 |
else |
|
617 |
iServerAddress->Des().Copy( KNullDesC ); |
|
618 |
delete address; |
|
619 |
} |
|
620 |
||
621 |
//Retrieve Access Point |
|
622 |
CEikEdwin* accessPoint = |
|
623 |
static_cast < CEikEdwin* > ( ControlOrNull( ELocSuplServerIdAccessPoint ) ); |
|
624 |
if( accessPoint ) |
|
625 |
{ |
|
626 |
HBufC* apText = accessPoint->GetTextInHBufL(); |
|
627 |
if( apText ) |
|
628 |
{ |
|
629 |
iIap->Des().Copy( apText->Des() ); |
|
630 |
} |
|
631 |
delete apText; |
|
632 |
||
633 |
HBufC* apString = StringLoader::LoadL( R_LOC_SERVER_NONE ); |
|
49
10852b179f64
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
634 |
if (apString->CompareC(iIap->Des()) == 0) |
45 | 635 |
{ |
636 |
iIap->Des().Copy( KNullDesC ); |
|
637 |
} |
|
638 |
delete apString; |
|
639 |
} |
|
640 |
||
641 |
//Retrieve Usage In Home Nw Field value |
|
642 |
CEikEdwin* usageInHomeNWPopupFieldText = (CEikEdwin*) Control( |
|
643 |
ELocSuplServerIdUsageInHomeNw); |
|
644 |
if (usageInHomeNWPopupFieldText) |
|
645 |
{ |
|
646 |
TBuf<KMaxUsageTextSize> des; |
|
49
10852b179f64
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
647 |
HBufC* string; |
10852b179f64
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
648 |
string = StringLoader::LoadLC( |
10852b179f64
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
649 |
R_LOC_SERVER_USAGEINHOMENETWORK_NO, iCoeEnv); |
45 | 650 |
usageInHomeNWPopupFieldText->GetText(des); |
49
10852b179f64
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
651 |
if (!des.CompareC(string->Des())) |
10852b179f64
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
652 |
{ |
55
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
653 |
iUsageInHomeNw = ETrue; |
49
10852b179f64
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
654 |
} |
10852b179f64
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
655 |
else |
45 | 656 |
{ |
55
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
657 |
iUsageInHomeNw = EFalse; |
45 | 658 |
} |
49
10852b179f64
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
659 |
CleanupStack::PopAndDestroy(string); |
45 | 660 |
} |
661 |
||
662 |
if( iServerAddress->Length() > 0 ) |
|
663 |
{ |
|
664 |
retVal = ETrue; |
|
665 |
} |
|
666 |
||
667 |
DEBUG( - CLocSUPLServerEditor::SaveFormDataL ); |
|
668 |
return retVal; |
|
669 |
} |
|
670 |
||
671 |
// ----------------------------------------------------------------------------- |
|
672 |
// LocSUPLServerEditor::PreLayoutDynInitL() |
|
673 |
// Initialises the dialog's controls before the dialog is sized and layed out. |
|
674 |
// ----------------------------------------------------------------------------- |
|
675 |
// |
|
676 |
void CLocSUPLServerEditor::PreLayoutDynInitL() |
|
677 |
{ |
|
678 |
DEBUG( + CLocSUPLServerEditor::PreLayoutDynInitL ); |
|
679 |
CAknForm::PreLayoutDynInitL(); |
|
680 |
||
681 |
DEBUG( - CLocSUPLServerEditor::PreLayoutDynInitL ); |
|
682 |
} |
|
683 |
||
684 |
// ----------------------------------------------------------------------------- |
|
685 |
// CLocSUPLServerEditor::PostLayoutDynInitL |
|
686 |
// Initialises the dialog's controls after the dialog |
|
687 |
// has been sized but before it has been activated. |
|
688 |
// ----------------------------------------------------------------------------- |
|
689 |
// |
|
690 |
void CLocSUPLServerEditor::PostLayoutDynInitL() |
|
691 |
{ |
|
692 |
DEBUG( + CLocSUPLServerEditor::PostLayoutDynInitL ); |
|
693 |
CAknForm::PostLayoutDynInitL(); |
|
694 |
SetEditableL( iIsEditMode ); |
|
695 |
LoadFormValuesFromDataL(); |
|
696 |
||
697 |
CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current(); |
|
698 |
CleanupStack::PushL( cba ); |
|
699 |
if( IsEditable() ) |
|
700 |
{ |
|
701 |
cba->SetCommandSetL( R_SUPLSERVER_EDITOR_OPTIONS_NOMSK_DONE ); |
|
702 |
} |
|
703 |
else |
|
704 |
{ |
|
705 |
TBool editableFlag = ETrue; |
|
706 |
if( iSlpId ) |
|
707 |
TRAP_IGNORE( iEngine.GetEditableFlagL( iSlpId, editableFlag ) ); |
|
708 |
||
709 |
if( editableFlag ) |
|
710 |
cba->SetCommandSetL( R_SUPLSERVER_EDITOR_OPTIONS_EDIT_BACK ); |
|
711 |
else |
|
712 |
cba->SetCommandSetL( R_SUPLSERVER_EDITOR_OPTIONS_NOMSK_BACK ); |
|
713 |
} |
|
714 |
CleanupStack::Pop( cba ); |
|
715 |
||
716 |
DEBUG( - CLocSUPLServerEditor::PostLayoutDynInitL ); |
|
717 |
} |
|
718 |
||
719 |
// ----------------------------------------------------------------------------- |
|
720 |
// CLocSUPLServerEditor::LineChangedL() |
|
721 |
// ----------------------------------------------------------------------------- |
|
722 |
// |
|
723 |
void CLocSUPLServerEditor::LineChangedL(TInt /*aControlId*/) |
|
724 |
{ |
|
725 |
HandleMSKCaptionL(); |
|
726 |
} |
|
727 |
||
728 |
// ----------------------------------------------------------------------------- |
|
729 |
// CLocSUPLServerEditor::SetInitialCurrentLine() |
|
730 |
// Selects desired line on startup |
|
731 |
// ----------------------------------------------------------------------------- |
|
732 |
// |
|
733 |
void CLocSUPLServerEditor::SetInitialCurrentLine() |
|
734 |
{ |
|
735 |
CAknForm::SetInitialCurrentLine(); |
|
736 |
||
737 |
// set focus to server address field |
|
738 |
if ( ControlOrNull( ELocSuplServerIdServerAddr ) ) |
|
739 |
{ |
|
740 |
TRAP_IGNORE( TryChangeFocusToL( ELocSuplServerIdServerAddr ) ); |
|
741 |
} |
|
742 |
} |
|
743 |
||
744 |
// ----------------------------------------------------------------------------- |
|
745 |
// CLocSUPLServerEditor::HandleResourceChange() |
|
746 |
// Handles layout switch |
|
747 |
// ----------------------------------------------------------------------------- |
|
748 |
// |
|
749 |
void CLocSUPLServerEditor::HandleResourceChange( TInt aType ) |
|
750 |
{ |
|
751 |
if ( aType == KEikDynamicLayoutVariantSwitch ) |
|
752 |
{ |
|
753 |
CAknForm::HandleResourceChange( aType ); |
|
754 |
} |
|
755 |
} |
|
756 |
||
757 |
// ----------------------------------------------------------------------------- |
|
758 |
// CLocSUPLServerEditor::ExecuteLD |
|
759 |
// Executes the Dialog |
|
760 |
// ----------------------------------------------------------------------------- |
|
761 |
// |
|
762 |
TInt CLocSUPLServerEditor::ExecuteLD() |
|
55
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
763 |
{ |
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
764 |
return CAknForm::ExecuteLD( R_SUPLSERVER_EDITOR_FORM_DIALOG ); |
45 | 765 |
} |
766 |
||
767 |
// ----------------------------------------------------------------------------- |
|
768 |
// CLocSUPLServerEditor::HandleControlStateChangeL |
|
769 |
// ----------------------------------------------------------------------------- |
|
770 |
// |
|
771 |
void CLocSUPLServerEditor::HandleControlStateChangeL( TInt aControlId ) |
|
772 |
{ |
|
773 |
DEBUG( + CLocSUPLServerEditor::HandleControlStateChangeL ); |
|
774 |
iIsModified = ETrue; |
|
775 |
switch( aControlId ) |
|
776 |
{ |
|
777 |
case ELocSuplServerIdServerAddr: |
|
778 |
{ |
|
779 |
//Retrieve server address text |
|
780 |
CEikEdwin* serverAddress = |
|
781 |
static_cast < CEikEdwin* > ( ControlOrNull( ELocSuplServerIdServerAddr ) ); |
|
782 |
if( serverAddress ) |
|
783 |
{ |
|
784 |
HBufC* address = serverAddress->GetTextInHBufL(); |
|
785 |
if( address ) |
|
786 |
{ |
|
787 |
CleanupStack::PushL( address ); |
|
788 |
// update the title pane caption |
|
789 |
ChangeTitlePaneTextL( *address ); |
|
790 |
CleanupStack::PopAndDestroy( address ); |
|
791 |
} |
|
792 |
else |
|
793 |
{ |
|
794 |
// update the title pane caption |
|
795 |
TBuf<1> nullDes; |
|
796 |
nullDes.Copy( KNullDesC ); |
|
797 |
ChangeTitlePaneTextL( nullDes ); |
|
798 |
} |
|
799 |
} |
|
800 |
break; |
|
801 |
} |
|
802 |
default: |
|
803 |
break; |
|
804 |
} |
|
805 |
DEBUG( - CLocSUPLServerEditor::HandleControlStateChangeL ); |
|
806 |
} |
|
807 |
||
808 |
// --------------------------------------------------------------------------- |
|
809 |
// CLocSUPLServerEditor ::LoadFormValuesFromDataL() |
|
810 |
// Called when the form is executed and when the user chooses to discard changes |
|
811 |
// in QuerySaveChangesL (via DoNotSaveFormDataL). |
|
812 |
// --------------------------------------------------------------------------- |
|
813 |
// |
|
814 |
void CLocSUPLServerEditor::LoadFormValuesFromDataL() |
|
815 |
{ |
|
816 |
DEBUG( + CLocSUPLServerEditor::LoadFormValuesFromDataL ); |
|
817 |
if( IsEditable() && iIsNewServer ) //if create new server |
|
818 |
{ |
|
55
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
819 |
CEikEdwin* apSelector = |
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
820 |
static_cast < CEikEdwin* > ( ControlOrNull( ELocSuplServerIdAccessPoint ) ); |
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
821 |
if( apSelector ) |
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
822 |
{ |
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
823 |
HBufC* apString = StringLoader::LoadL( R_LOC_SERVER_NONE ); |
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
824 |
apSelector->SetTextL( apString ); |
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
825 |
delete apString; |
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
826 |
} |
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
827 |
apSelector->DrawNow(); |
45 | 828 |
|
829 |
CEikEdwin* usageInHNWPopupFieldText = (CEikEdwin*) Control( |
|
830 |
ELocSuplServerIdUsageInHomeNw); |
|
831 |
if (usageInHNWPopupFieldText) |
|
832 |
{ |
|
833 |
HBufC* usageString = StringLoader::LoadL( |
|
834 |
R_LOC_SERVER_USAGEINHOMENETWORK_YES); |
|
835 |
usageInHNWPopupFieldText->SetTextL(usageString); |
|
836 |
delete usageString; |
|
837 |
} |
|
838 |
usageInHNWPopupFieldText->DrawNow(); |
|
839 |
||
840 |
// update the title pane caption |
|
841 |
HBufC* serverTitle = StringLoader::LoadL( R_LOC_SERVER_EDITOR_TITLE ); |
|
842 |
if( serverTitle ) |
|
843 |
{ |
|
844 |
ChangeTitlePaneTextL( *serverTitle ); |
|
845 |
} |
|
846 |
delete serverTitle; |
|
847 |
serverTitle=NULL; |
|
848 |
} |
|
849 |
else |
|
850 |
{ |
|
851 |
CServerParams *params = CServerParams::NewL(); |
|
852 |
CleanupStack::PushL( params ); |
|
853 |
TRAP_IGNORE( iEngine.GetSlpInfoFromIdL( iSlpId, params ) ); |
|
854 |
||
855 |
HBufC* hslpAddr = HBufC::NewL( KMaxHSLPAddrLen ); |
|
856 |
HBufC* iapName = HBufC::NewL( KMaxIAPLen ); |
|
857 |
TInt64 slpId; |
|
858 |
TBool enabledFlag, simChangeFlag, usageInHomeNwFlag, editFlag; |
|
859 |
||
860 |
TInt errParams = params->Get( |
|
861 |
slpId, |
|
862 |
hslpAddr->Des(), |
|
863 |
iapName->Des(), |
|
864 |
enabledFlag, |
|
865 |
simChangeFlag, |
|
866 |
usageInHomeNwFlag, |
|
867 |
editFlag |
|
868 |
); |
|
869 |
if ( errParams != KErrNone ) |
|
870 |
{ |
|
871 |
// Error has occured |
|
872 |
} |
|
55
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
873 |
|
45 | 874 |
CEikEdwin* serverAddress = |
875 |
static_cast < CEikEdwin* > ( ControlOrNull( ELocSuplServerIdServerAddr ) ); |
|
876 |
if( serverAddress ) |
|
877 |
{ |
|
878 |
serverAddress->SetTextL( hslpAddr ); |
|
879 |
if( editFlag == EFalse ) |
|
880 |
serverAddress->SetReadOnly( ETrue ); |
|
881 |
serverAddress->DrawDeferred(); |
|
882 |
iServerAddress->Des().Copy( hslpAddr->Des() ); |
|
883 |
} |
|
55
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
884 |
|
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
885 |
CEikEdwin* apSelector = |
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
886 |
static_cast < CEikEdwin* > ( ControlOrNull( ELocSuplServerIdAccessPoint ) ); |
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
887 |
if( apSelector ) |
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
888 |
{ |
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
889 |
if( iapName->Length() > 0 ) |
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
890 |
{ |
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
891 |
apSelector->SetTextL( iapName ); |
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
892 |
} |
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
893 |
else |
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
894 |
{ |
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
895 |
HBufC* apString = StringLoader::LoadL( R_LOC_SERVER_NONE ); |
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
896 |
apSelector->SetTextL( apString ); |
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
897 |
delete apString; |
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
898 |
} |
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
899 |
|
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
900 |
apSelector->DrawNow(); |
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
901 |
iIap->Des().Copy( iapName->Des() ); |
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
902 |
} |
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
903 |
|
45 | 904 |
CEikEdwin* usageInHNWPopupFieldText = (CEikEdwin*) Control( |
905 |
ELocSuplServerIdUsageInHomeNw); |
|
906 |
if (usageInHNWPopupFieldText) |
|
907 |
{ |
|
55
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
908 |
if (usageInHomeNwFlag) |
45 | 909 |
SetUsageinHomeNetwork(EFalse); |
910 |
else |
|
911 |
SetUsageinHomeNetwork(ETrue); |
|
912 |
||
913 |
UpdatePageL(ETrue); |
|
914 |
iUsageInHomeNw = usageInHomeNwFlag; |
|
915 |
} |
|
916 |
||
917 |
delete iapName; |
|
918 |
delete hslpAddr; |
|
919 |
CleanupStack::PopAndDestroy( params ); |
|
920 |
||
921 |
// update the title pane caption |
|
922 |
ChangeTitlePaneTextL( *iServerAddress ); |
|
923 |
||
924 |
} |
|
925 |
DEBUG( - CLocSUPLServerEditor::LoadFormValuesFromDataL ); |
|
926 |
} |
|
927 |
||
928 |
// --------------------------------------------------------------------------- |
|
929 |
// CLocSUPLServerEditor::ChangeTitlePaneTextL() |
|
930 |
// Set the Title Text |
|
931 |
// --------------------------------------------------------------------------- |
|
932 |
// |
|
933 |
void CLocSUPLServerEditor::ChangeTitlePaneTextL( TDesC& aText ) |
|
934 |
{ |
|
935 |
DEBUG( + CLocSUPLServerEditor::ChangeTitlePaneTextL ); |
|
936 |
// Obtain the title from the Status Pane |
|
937 |
CAknTitlePane* title = static_cast < CAknTitlePane* >( iEikonEnv->AppUiFactory()-> |
|
938 |
StatusPane()->ControlL( TUid::Uid( EEikStatusPaneUidTitle ) ) ); |
|
939 |
||
940 |
// Set the Title's buffer |
|
941 |
HBufC* buf = aText.AllocL(); |
|
942 |
title->SetText( buf ); // Takes ownership of buf |
|
943 |
title->DrawNow(); |
|
944 |
DEBUG( - CLocSUPLServerEditor::ChangeTitlePaneTextL ); |
|
945 |
} |
|
946 |
||
947 |
// --------------------------------------------------------------------------- |
|
948 |
// CLocSUPLServerEditor::TogglePopupFieldControlL() |
|
949 |
// it toggles value of popupfield control |
|
950 |
// This method is no longer in use since TB 9.2 |
|
951 |
// --------------------------------------------------------------------------- |
|
952 |
// |
|
953 |
void CLocSUPLServerEditor::TogglePopupFieldControlL( TInt aControlId ) |
|
954 |
{ |
|
955 |
DEBUG( + CLocSUPLServerEditor::TogglePopupFieldControlL ); |
|
956 |
CAknPopupFieldText* popupFieldText = |
|
957 |
( CAknPopupFieldText* ) Control( aControlId ); |
|
958 |
||
959 |
if( popupFieldText ) |
|
960 |
{ |
|
961 |
if( popupFieldText->CurrentValueIndex() == 0 ) |
|
962 |
popupFieldText->SetCurrentValueIndex( 1 ); |
|
963 |
else |
|
964 |
popupFieldText->SetCurrentValueIndex( 0 ); |
|
965 |
||
966 |
UpdatePageL( ETrue ); |
|
967 |
} |
|
968 |
DEBUG( - CLocSUPLServerEditor::TogglePopupFieldControlL ); |
|
969 |
} |
|
970 |
||
971 |
// ----------------------------------------------------------------------------- |
|
972 |
// CLocSUPLServerEditor::HandleMSKCaptionL() |
|
973 |
// It changes caption of MSK key |
|
974 |
// ----------------------------------------------------------------------------- |
|
975 |
// |
|
976 |
void CLocSUPLServerEditor::HandleMSKCaptionL() |
|
977 |
{ |
|
978 |
DEBUG( + CLocSUPLServerEditor::HandleMSKCaptionL ); |
|
979 |
CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current(); |
|
980 |
CleanupStack::PushL( cba ); |
|
981 |
//attribute specific cba |
|
982 |
if( IsEditable() ) |
|
983 |
{ |
|
984 |
switch ( IdOfFocusControl() ) |
|
985 |
{ |
|
986 |
case ELocSuplServerIdServerAddr: |
|
987 |
{ |
|
988 |
cba->SetCommandSetL( R_SUPLSERVER_EDITOR_OPTIONS_NOMSK_DONE ); |
|
989 |
break; |
|
990 |
} |
|
991 |
case ELocSuplServerIdAccessPoint: |
|
992 |
{ |
|
55
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
993 |
TInt isIapChanged = EFalse; |
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
994 |
CEikEdwin* apSelector = |
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
995 |
static_cast < CEikEdwin* > ( ControlOrNull( IdOfFocusControl() ) ); |
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
996 |
if( apSelector && iIap ) |
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
997 |
{ |
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
998 |
if( iIap->Length() > 0 ) |
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
999 |
isIapChanged = ETrue; |
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
1000 |
} |
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
1001 |
if( isIapChanged ) |
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
1002 |
{ |
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
1003 |
cba->SetCommandSetL( R_SUPLSERVER_EDITOR_OPTIONS_CHANGE_DONE ); |
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
1004 |
} |
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
1005 |
else |
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
1006 |
{ |
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
1007 |
cba->SetCommandSetL( R_SUPLSERVER_EDITOR_OPTIONS_DEFINE_DONE ); |
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
1008 |
} |
45 | 1009 |
break; |
1010 |
} |
|
1011 |
case ELocSuplServerIdUsageInHomeNw: |
|
1012 |
{ |
|
1013 |
TBool editableFlag = ETrue; |
|
1014 |
if( iSlpId ) |
|
1015 |
{ |
|
1016 |
TRAP_IGNORE( iEngine.GetEditableFlagL( iSlpId, editableFlag ) ); |
|
1017 |
} |
|
1018 |
if( editableFlag ) |
|
1019 |
cba->SetCommandSetL( R_SUPLSERVER_EDITOR_OPTIONS_CHANGE_DONE ); |
|
1020 |
else |
|
1021 |
cba->SetCommandSetL( R_SUPLSERVER_EDITOR_OPTIONS_NOMSK_DONE ); |
|
1022 |
break; |
|
1023 |
} |
|
1024 |
default: |
|
1025 |
break; |
|
1026 |
} |
|
1027 |
} |
|
1028 |
else |
|
1029 |
{ |
|
1030 |
TBool editableFlag = ETrue; |
|
1031 |
TBool changeMSK = ETrue; |
|
1032 |
||
1033 |
if( iSlpId ) |
|
1034 |
TRAP_IGNORE( iEngine.GetEditableFlagL( iSlpId, editableFlag ) ); |
|
1035 |
||
1036 |
if( editableFlag == EFalse && ( IdOfFocusControl() == ELocSuplServerIdServerAddr || |
|
1037 |
IdOfFocusControl() == ELocSuplServerIdUsageInHomeNw ) ) |
|
1038 |
changeMSK = EFalse; |
|
1039 |
||
1040 |
if( changeMSK ) |
|
1041 |
cba->SetCommandSetL( R_SUPLSERVER_EDITOR_OPTIONS_EDIT_BACK ); |
|
1042 |
else |
|
1043 |
cba->SetCommandSetL( R_SUPLSERVER_EDITOR_OPTIONS_NOMSK_BACK ); |
|
1044 |
} |
|
1045 |
cba->DrawDeferred(); |
|
1046 |
CleanupStack::Pop( cba ); |
|
1047 |
DEBUG( - CLocSUPLServerEditor::HandleMSKCaptionL ); |
|
1048 |
} |
|
1049 |
||
1050 |
// ----------------------------------------------------------------------------- |
|
1051 |
// CLocSUPLServerEditor::UpdateIapL() |
|
1052 |
// It changes IAP value in AP field |
|
1053 |
// ----------------------------------------------------------------------------- |
|
1054 |
// |
|
1055 |
void CLocSUPLServerEditor::UpdateIapL( const TDesC& aIapName ) |
|
1056 |
{ |
|
1057 |
DEBUG( + CLocSUPLServerEditor::UpdateIapL ); |
|
1058 |
if( aIapName.Length() > 0 ) |
|
1059 |
{ |
|
1060 |
iIap->Des().Copy( aIapName ); |
|
1061 |
CEikEdwin* apSelector = |
|
1062 |
static_cast < CEikEdwin* > ( ControlOrNull( ELocSuplServerIdAccessPoint ) ); |
|
1063 |
if( apSelector ) |
|
1064 |
{ |
|
1065 |
apSelector->SetTextL( iIap ); |
|
1066 |
} |
|
1067 |
apSelector->DrawNow(); |
|
1068 |
HandleMSKCaptionL(); |
|
1069 |
if (iIsNewServer) |
|
1070 |
{ |
|
1071 |
iIsModified = ETrue; |
|
1072 |
} |
|
1073 |
} |
|
1074 |
DEBUG( - CLocSUPLServerEditor::UpdateIapL ); |
|
1075 |
} |
|
1076 |
||
1077 |
// ----------------------------------------------------------------------------- |
|
1078 |
// CLocSUPLServerEditor::DeleteConfirmationQueryL |
|
1079 |
// Pops the delete confirmation query note |
|
1080 |
// ---------------------------------------------------------------------------- |
|
1081 |
// |
|
1082 |
TInt CLocSUPLServerEditor::DeleteConfirmationQueryL() |
|
1083 |
{ |
|
1084 |
HBufC* noteText = NULL; |
|
1085 |
noteText = StringLoader::LoadL( R_LOC_DETAIL_CONF_DELETE_SERVER ); |
|
1086 |
CAknQueryDialog* query = new( ELeave ) CAknQueryDialog( *noteText ); |
|
1087 |
TInt ret = query->ExecuteLD( R_LOC_SUPL_DELETE_QUERY ); |
|
1088 |
delete noteText; //noteText |
|
1089 |
noteText = NULL; |
|
1090 |
return ret; |
|
1091 |
} |
|
1092 |
||
1093 |
// ----------------------------------------------------------------------------- |
|
1094 |
// CLocSUPLServerEditor::ShowServerValidationInfoNoteL |
|
1095 |
// Shows Validation Info note for server address entry |
|
1096 |
// ---------------------------------------------------------------------------- |
|
1097 |
// |
|
1098 |
void CLocSUPLServerEditor::ShowServerValidationInfoNoteL( TInt aResourceId ) |
|
1099 |
{ |
|
1100 |
// Show the information note to add server address before closing |
|
1101 |
HBufC* noteText = StringLoader::LoadL( aResourceId ); |
|
1102 |
CAknInformationNote* dialog = |
|
1103 |
new( ELeave ) CAknInformationNote( R_AKN_INFORMATION_NOTE_WAIT ); |
|
1104 |
dialog->ExecuteLD( *noteText ); |
|
1105 |
delete noteText; //noteText |
|
1106 |
noteText = NULL; |
|
1107 |
} |
|
1108 |
||
1109 |
// ---------------------------------------------------------------------------------- |
|
1110 |
// CLocSUPLServerEditor::SetCursorToEndL |
|
1111 |
// Moves the cursor position at end if focus is on server address field in edit mode |
|
1112 |
// ---------------------------------------------------------------------------------- |
|
1113 |
// |
|
1114 |
void CLocSUPLServerEditor::SetCursorToEndL() |
|
1115 |
{ |
|
1116 |
if ( IdOfFocusControl() == ELocSuplServerIdServerAddr ) |
|
1117 |
{ |
|
1118 |
CEikEdwin* serverAddress = |
|
1119 |
static_cast < CEikEdwin* > ( ControlOrNull( ELocSuplServerIdServerAddr ) ); |
|
1120 |
if( serverAddress ) |
|
1121 |
{ |
|
1122 |
HBufC* address = serverAddress->GetTextInHBufL(); |
|
1123 |
if( address ) |
|
1124 |
{ |
|
1125 |
serverAddress->SetCursorPosL( address->Length(), EFalse ); |
|
1126 |
serverAddress->DrawDeferred(); |
|
1127 |
} |
|
1128 |
delete address; |
|
1129 |
} |
|
1130 |
} |
|
1131 |
} |
|
1132 |
// ---------------------------------------------------------------------------------- |
|
1133 |
// CLocSUPLServerEditor::HandleDialogPageEventL |
|
1134 |
// ---------------------------------------------------------------------------------- |
|
1135 |
// |
|
1136 |
void CLocSUPLServerEditor::HandleDialogPageEventL(TInt aEventID) |
|
1137 |
{ |
|
1138 |
DEBUG( +CLocSUPLServerEditor::HandleDialogPageEventL ); |
|
1139 |
||
1140 |
CAknForm::HandleDialogPageEventL(aEventID); |
|
1141 |
CEikEdwin* iapEditor = static_cast<CEikEdwin*> (ControlOrNull( |
|
1142 |
ELocSuplServerIdAccessPoint)); |
|
1143 |
CEikEdwin* usageInHomeNWPopupFieldText = (CEikEdwin*) Control( |
|
1144 |
ELocSuplServerIdUsageInHomeNw); |
|
1145 |
TInt focusControl(IdOfFocusControl()); |
|
1146 |
||
1147 |
if (!IsEditable()) |
|
1148 |
{ |
|
1149 |
if (focusControl == ELocSuplServerIdUsageInHomeNw |
|
55
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
1150 |
|| ELocSuplServerIdServerAddr || ELocSuplServerIdAccessPoint) |
45 | 1151 |
{ |
1152 |
ProcessCommandL(EAknFormCmdEdit); |
|
1153 |
} |
|
1154 |
} |
|
1155 |
else if (aEventID == MEikDialogPageObserver::EDialogPageTapped) |
|
1156 |
{ |
|
1157 |
if (focusControl == ELocSuplServerIdUsageInHomeNw) |
|
1158 |
{ |
|
1159 |
if (usageInHomeNWPopupFieldText) |
|
1160 |
{ |
|
49
10852b179f64
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
1161 |
HBufC* string; |
10852b179f64
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
1162 |
string = StringLoader::LoadLC( |
10852b179f64
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
1163 |
R_LOC_SERVER_USAGEINHOMENETWORK_NO, iCoeEnv); |
45 | 1164 |
TBuf<KMaxUsageTextSize> des; |
1165 |
usageInHomeNWPopupFieldText->GetText(des); |
|
49
10852b179f64
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
1166 |
if (!des.CompareC(string->Des())) |
45 | 1167 |
{ |
1168 |
SetUsageinHomeNetwork(ETrue); |
|
1169 |
} |
|
1170 |
else |
|
1171 |
{ |
|
1172 |
SetUsageinHomeNetwork(EFalse); |
|
1173 |
} |
|
1174 |
if (iIsNewServer) |
|
1175 |
{ |
|
1176 |
iIsModified = ETrue; |
|
1177 |
} |
|
49
10852b179f64
Revision: 201035
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
45
diff
changeset
|
1178 |
CleanupStack::PopAndDestroy(string); |
45 | 1179 |
} |
1180 |
return; |
|
1181 |
} |
|
55
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
1182 |
if (focusControl == ELocSuplServerIdAccessPoint) |
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
1183 |
{ |
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
1184 |
if (iapEditor) |
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
1185 |
{ |
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
1186 |
//Launch IAP Dialog |
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
1187 |
TRAP_IGNORE( iEngine.LaunchApConfiguratorL( iSlpId, this ) ); |
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
1188 |
} |
ea98413ce11f
Revision: 201038
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
49
diff
changeset
|
1189 |
} |
45 | 1190 |
}DEBUG( -CLocSUPLServerEditor::HandleDialogPageEventL ); |
1191 |
} |
|
1192 |
||
1193 |
// ----------------------------------------------------------------------------- |
|
1194 |
// CLocSUPLServerEditor::SetUsageinHomeNetwork |
|
1195 |
// Set usage in network field on or off |
|
1196 |
// ----------------------------------------------------------------------------- |
|
1197 |
// |
|
1198 |
void CLocSUPLServerEditor::SetUsageinHomeNetwork(TBool aOnOff) |
|
1199 |
{ |
|
1200 |
HBufC* string; |
|
1201 |
CEikEdwin* usageInHomeNWPopupFieldText = (CEikEdwin*) Control( |
|
1202 |
ELocSuplServerIdUsageInHomeNw); |
|
1203 |
if (aOnOff) |
|
1204 |
{ |
|
1205 |
// load string 'ON' |
|
1206 |
string = StringLoader::LoadLC(R_LOC_SERVER_USAGEINHOMENETWORK_YES, |
|
1207 |
iCoeEnv); |
|
1208 |
} |
|
1209 |
else |
|
1210 |
{ |
|
1211 |
// load string 'OFF' |
|
1212 |
string = StringLoader::LoadLC(R_LOC_SERVER_USAGEINHOMENETWORK_NO, |
|
1213 |
iCoeEnv); |
|
1214 |
} |
|
1215 |
// set Usage in Network field string as 'ON'/'OFF' |
|
1216 |
usageInHomeNWPopupFieldText->SetTextL(string); |
|
1217 |
CleanupStack::PopAndDestroy(string); |
|
1218 |
} |
|
1219 |
||
1220 |
// End of file |