58
|
1 |
/*
|
|
2 |
* Copyright (c) 2006 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: base class for connection method plugin dialogs
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
// INCLUDE FILES
|
|
20 |
|
|
21 |
// System
|
|
22 |
#include <cmmanager.rsg>
|
|
23 |
#include <aknnavide.h>
|
|
24 |
#include <StringLoader.h>
|
|
25 |
#include <akntitle.h>
|
|
26 |
#include <aknradiobuttonsettingpage.h>
|
|
27 |
#include <data_caging_path_literals.hrh>
|
|
28 |
#include <akntextsettingpage.h>
|
|
29 |
#include <aknpasswordsettingpage.h>
|
|
30 |
#include <in_sock.h>
|
|
31 |
#include <aknmfnesettingpage.h>
|
|
32 |
#include <AknQueryDialog.h>
|
|
33 |
#include <featmgr.h>
|
|
34 |
|
|
35 |
#include <hlplch.h>
|
|
36 |
|
|
37 |
// User
|
|
38 |
#include <mcmdexec.h>
|
|
39 |
#include <cmpbasesettingsdlg.h>
|
|
40 |
#include <cmmanager.h>
|
|
41 |
#include <cmpluginbaseeng.h>
|
|
42 |
#include "cmmanagerimpl.h"
|
|
43 |
#include "cmmanager.hrh"
|
|
44 |
#include <cmcommonui.h>
|
|
45 |
#include <cmcommonconstants.h>
|
|
46 |
#include <cmpsettingsconsts.h>
|
|
47 |
#include "cmpluginmultilinedialog.h"
|
|
48 |
#include "cmlogger.h"
|
|
49 |
#include "ccmdexec.h"
|
|
50 |
|
|
51 |
using namespace CMManager;
|
|
52 |
|
|
53 |
// Maximum speed mapping
|
|
54 |
struct TIPv6DNSMapping
|
|
55 |
{
|
|
56 |
TInt iResId;
|
|
57 |
TInt iSettingValue;
|
|
58 |
};
|
|
59 |
|
|
60 |
// Mapping for IPv6 DNS types
|
|
61 |
const TIPv6DNSMapping KTIPv6DNSItems[] =
|
|
62 |
{
|
|
63 |
{ R_QTN_SET_DNS_SERVERS_AUTOMATIC, EIPv6Unspecified },
|
|
64 |
{ R_QTN_SET_IP_WELL_KNOWN, EIPv6WellKnown },
|
|
65 |
{ R_QTN_SET_IP_USER_DEFINED, EIPv6UserDefined },
|
|
66 |
{ 0, 0 }
|
|
67 |
};
|
|
68 |
|
|
69 |
const TUint32 KMaxInt32Length = 10;
|
|
70 |
|
|
71 |
// ================= MEMBER FUNCTIONS =======================================
|
|
72 |
|
|
73 |
// --------------------------------------------------------------------------
|
|
74 |
// CmPluginBaseSettingsDlg::ConstructAndRunLD
|
|
75 |
// Constructs the dialog and runs it.
|
|
76 |
// --------------------------------------------------------------------------
|
|
77 |
//
|
|
78 |
EXPORT_C TInt CmPluginBaseSettingsDlg::ConstructAndRunLD( )
|
|
79 |
{
|
|
80 |
CleanupStack::PushL( this );
|
|
81 |
FeatureManager::InitializeLibL();
|
|
82 |
iHelp = FeatureManager::FeatureSupported( KFeatureIdHelp );
|
|
83 |
FeatureManager::UnInitializeLib();
|
|
84 |
ConstructL( R_PLUGIN_BASE_MENUBAR );
|
|
85 |
PrepareLC( R_PLUGIN_BASE_DIALOG );
|
|
86 |
CleanupStack::Pop( this );
|
|
87 |
iSettingIndex = new ( ELeave ) CArrayFixFlat<TUint>( 4 );
|
|
88 |
|
|
89 |
if (!iHasSettingChanged)
|
|
90 |
{
|
|
91 |
iHasSettingChanged = ETrue;
|
|
92 |
}
|
|
93 |
|
|
94 |
return RunLD();
|
|
95 |
}
|
|
96 |
|
|
97 |
|
|
98 |
// --------------------------------------------------------------------------
|
|
99 |
// CmPluginBaseSettingsDlg::CmPluginBaseSettingsDlg()
|
|
100 |
// --------------------------------------------------------------------------
|
|
101 |
//
|
|
102 |
EXPORT_C CmPluginBaseSettingsDlg::CmPluginBaseSettingsDlg(
|
|
103 |
CCmPluginBaseEng& aCmPluginBase ) :
|
|
104 |
iCmPluginBaseEng( aCmPluginBase ),
|
|
105 |
iExitReason( KDialogUserBack ),
|
|
106 |
iResourceReader( *CCoeEnv::Static() ),
|
|
107 |
iIsPossibleToSaveSetting( ETrue ),
|
|
108 |
iHasSettingChanged( EFalse )
|
|
109 |
{
|
|
110 |
}
|
|
111 |
|
|
112 |
// --------------------------------------------------------------------------
|
|
113 |
// CmPluginBaseSettingsDlg::~CApSelectorDialog
|
|
114 |
// --------------------------------------------------------------------------
|
|
115 |
//
|
|
116 |
EXPORT_C CmPluginBaseSettingsDlg::~CmPluginBaseSettingsDlg()
|
|
117 |
{
|
|
118 |
// iModel is deleted by the ListBox because LB owns the model...
|
|
119 |
// of course only after we passed ownership...
|
|
120 |
if ( iNaviDecorator )
|
|
121 |
{
|
|
122 |
delete iNaviDecorator;
|
|
123 |
}
|
|
124 |
if ( iTitlePane )
|
|
125 |
{
|
|
126 |
// set old text back, if we have it...
|
|
127 |
if ( iOldTitleText )
|
|
128 |
{
|
|
129 |
TRAP_IGNORE( iTitlePane->SetTextL( *iOldTitleText ) );
|
|
130 |
delete iOldTitleText;
|
|
131 |
}
|
|
132 |
}
|
|
133 |
if ( iSettingIndex )
|
|
134 |
{
|
|
135 |
delete iSettingIndex;
|
|
136 |
}
|
|
137 |
iResourceReader.Close();
|
|
138 |
|
|
139 |
delete iCmdExec;
|
|
140 |
iCmdExec = NULL;
|
|
141 |
}
|
|
142 |
|
|
143 |
// --------------------------------------------------------------------------
|
|
144 |
// CmPluginBaseSettingsDlg::PreLayoutDynInitL();
|
|
145 |
// called by framework before dialog is shown
|
|
146 |
// --------------------------------------------------------------------------
|
|
147 |
//
|
|
148 |
EXPORT_C void CmPluginBaseSettingsDlg::PreLayoutDynInitL()
|
|
149 |
{
|
|
150 |
iListbox = STATIC_CAST( CAknSettingStyleListBox*,
|
|
151 |
Control( KPluginBaseListboxId ) );
|
|
152 |
iListbox->CreateScrollBarFrameL( ETrue );
|
|
153 |
iListbox->ScrollBarFrame()->SetScrollBarVisibilityL
|
|
154 |
( CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto );
|
|
155 |
iListbox->SetListBoxObserver( this );
|
|
156 |
|
|
157 |
HandleListboxDataChangeL();
|
|
158 |
iListbox->HandleItemAdditionL();
|
|
159 |
InitTextsL();
|
|
160 |
}
|
|
161 |
|
|
162 |
// --------------------------------------------------------------------------
|
|
163 |
// CmPluginBaseSettingsDlg::UpdateListBoxContentL
|
|
164 |
// --------------------------------------------------------------------------
|
|
165 |
//
|
|
166 |
EXPORT_C void CmPluginBaseSettingsDlg::UpdateListBoxContentL()
|
|
167 |
{
|
|
168 |
// Must save listbox indexes because content will be deleted
|
|
169 |
TInt lastListBoxPos = iListbox->CurrentItemIndex();
|
|
170 |
TInt lastListBoxTopPos = iListbox->TopItemIndex();
|
|
171 |
|
|
172 |
// deleting listbox content
|
|
173 |
MDesCArray* itemList = iListbox->Model()->ItemTextArray();
|
|
174 |
CDesCArray* itemArray = (CDesCArray*)itemList;
|
|
175 |
|
|
176 |
while ( itemArray->Count() )
|
|
177 |
{
|
|
178 |
itemArray->Delete( 0 );
|
|
179 |
}
|
|
180 |
while ( iSettingIndex->Count() )
|
|
181 |
{
|
|
182 |
iSettingIndex->Delete( 0 );
|
|
183 |
}
|
|
184 |
|
|
185 |
// CONNECTION NAME
|
|
186 |
AppendSettingTextsL( *itemArray, ECmName );
|
|
187 |
|
|
188 |
// BEARER SPECIFIC SETTINGS
|
|
189 |
UpdateListBoxContentBearerSpecificL( *itemArray );
|
|
190 |
|
|
191 |
//-----------------------------------------------------------------------
|
|
192 |
// Handle content changes
|
|
193 |
iListbox->Reset();
|
|
194 |
iListbox->HandleItemAdditionL();
|
|
195 |
|
|
196 |
// Listbox might not have index
|
|
197 |
if ( lastListBoxPos != -1 )
|
|
198 |
{
|
|
199 |
iListbox->SetCurrentItemIndex( lastListBoxPos );
|
|
200 |
iListbox->SetTopItemIndex( lastListBoxTopPos );
|
|
201 |
}
|
|
202 |
iListbox->DrawNow();
|
|
203 |
}
|
|
204 |
|
|
205 |
// --------------------------------------------------------------------------
|
|
206 |
// CmPluginBaseSettingsDlg::AppendSettingTextsL
|
|
207 |
// --------------------------------------------------------------------------
|
|
208 |
//
|
|
209 |
EXPORT_C void CmPluginBaseSettingsDlg::AppendSettingTextsL(
|
|
210 |
CDesCArray& aItemArray,
|
|
211 |
const TInt aSettingItemId,
|
|
212 |
const TInt aValueResId )
|
|
213 |
{
|
|
214 |
HBufC* value = StringLoader::LoadLC( aValueResId );
|
|
215 |
|
|
216 |
AppendSettingTextsL( aItemArray, aSettingItemId, value );
|
|
217 |
|
|
218 |
CleanupStack::PopAndDestroy( value );
|
|
219 |
}
|
|
220 |
|
|
221 |
// --------------------------------------------------------------------------
|
|
222 |
// CmPluginBaseSettingsDlg::AppendSettingTextsL
|
|
223 |
// --------------------------------------------------------------------------
|
|
224 |
//
|
|
225 |
EXPORT_C void CmPluginBaseSettingsDlg::AppendSettingTextsL(
|
|
226 |
CDesCArray& aItemArray,
|
|
227 |
const TInt aSettingItemId,
|
|
228 |
const HBufC* aValueString )
|
|
229 |
{
|
|
230 |
const TCmAttribConvTable* convItem =
|
|
231 |
iCmPluginBaseEng.ConvTableItem( aSettingItemId );
|
|
232 |
HBufC* value = NULL;
|
|
233 |
|
|
234 |
if ( aValueString )
|
|
235 |
{
|
|
236 |
value = (HBufC*)aValueString;
|
|
237 |
}
|
|
238 |
else
|
|
239 |
{
|
|
240 |
if ( convItem->iAttribFlags & EConvNumber )
|
|
241 |
{
|
|
242 |
TUint32 num = iCmPluginBaseEng.GetIntAttributeL( aSettingItemId );
|
|
243 |
|
|
244 |
if( !num && convItem->iDefSettingResId )
|
|
245 |
{
|
|
246 |
value = StringLoader::LoadL( convItem->iDefSettingResId );
|
|
247 |
}
|
|
248 |
else
|
|
249 |
{
|
|
250 |
value = HBufC::NewL( KMaxInt32Length );
|
|
251 |
value->Des().AppendNum( num );
|
|
252 |
|
|
253 |
TPtr number( value->Des() );
|
|
254 |
AknTextUtils::LanguageSpecificNumberConversion( number );
|
|
255 |
}
|
|
256 |
}
|
|
257 |
else
|
|
258 |
{
|
|
259 |
if( convItem->iAttribFlags & EConv8Bits )
|
|
260 |
// make 16bits copy of this 8bits buffer
|
|
261 |
{
|
|
262 |
HBufC8* value8 = iCmPluginBaseEng.GetString8AttributeL( aSettingItemId );
|
|
263 |
CleanupStack::PushL( value8 );
|
|
264 |
value = HBufC::NewL( value8->Length() );
|
|
265 |
value->Des().Copy( *value8 );
|
|
266 |
CleanupStack::PopAndDestroy( value8 );
|
|
267 |
}
|
|
268 |
else
|
|
269 |
{
|
|
270 |
value = iCmPluginBaseEng.GetStringAttributeL( aSettingItemId );
|
|
271 |
}
|
|
272 |
|
|
273 |
if ( convItem->iDefSettingResId )
|
|
274 |
// We have default value in resource.
|
|
275 |
// Check if we have use it, instead of current value.
|
|
276 |
{
|
|
277 |
if ( convItem->iAttribFlags & EConvIPv4 )
|
|
278 |
// This is an IPv4 text attribute
|
|
279 |
{
|
|
280 |
if ( IsUnspecifiedIPv4Address( *value ) )
|
|
281 |
// Use default value from resource instead of
|
|
282 |
// displaying unspecified IP address
|
|
283 |
{
|
|
284 |
delete value; value = NULL;
|
|
285 |
}
|
|
286 |
}
|
|
287 |
else if ( convItem->iAttribFlags & EConvIPv6 )
|
|
288 |
// This is an IPv4 text attribute
|
|
289 |
{
|
|
290 |
}
|
|
291 |
else if( convItem->iAttribFlags & EConvPassword )
|
|
292 |
// In case of password, we can show only the resource
|
|
293 |
// string.
|
|
294 |
{
|
|
295 |
delete value; value = NULL;
|
|
296 |
}
|
|
297 |
else if ( *value == KNullDesC && convItem->iDefSettingResId )
|
|
298 |
// empty string, but it has a default value in resource
|
|
299 |
// Use the resource value.
|
|
300 |
{
|
|
301 |
delete value; value = NULL;
|
|
302 |
}
|
|
303 |
|
|
304 |
if ( !value )
|
|
305 |
// use default value from resource.
|
|
306 |
{
|
|
307 |
value = StringLoader::LoadL( convItem->iDefSettingResId );
|
|
308 |
}
|
|
309 |
}
|
|
310 |
}
|
|
311 |
|
|
312 |
CleanupStack::PushL( value );
|
|
313 |
}
|
|
314 |
|
|
315 |
HBufC* title = StringLoader::LoadLC( convItem->iTitleId );
|
|
316 |
|
|
317 |
_LIT( KSettingListFormat, "\t%S\t\t%S" );
|
|
318 |
HBufC* itemTextBuf = HBufC::NewLC( KSettingListFormat().Length() +
|
|
319 |
title->Length() +
|
|
320 |
value->Length() +
|
|
321 |
KTxtCompulsory().Length() );
|
|
322 |
|
|
323 |
TPtr itemText = itemTextBuf->Des();
|
|
324 |
|
|
325 |
itemText.Format( KSettingListFormat, title, value );
|
|
326 |
|
|
327 |
// indicator for compulsory settings
|
|
328 |
if ( convItem->iAttribFlags & EConvCompulsory )
|
|
329 |
{
|
|
330 |
itemText.Append( KTxtCompulsory );
|
|
331 |
}
|
|
332 |
|
|
333 |
aItemArray.AppendL( itemText );
|
|
334 |
CleanupStack::PopAndDestroy( 2, title ); // itemTextBuf, title
|
|
335 |
|
|
336 |
if ( !aValueString )
|
|
337 |
{
|
|
338 |
CleanupStack::PopAndDestroy( (HBufC*)value );
|
|
339 |
}
|
|
340 |
|
|
341 |
iSettingIndex->AppendL( aSettingItemId );
|
|
342 |
}
|
|
343 |
|
|
344 |
// --------------------------------------------------------------------------
|
|
345 |
// CmPluginBaseSettingsDlg::AppendSettingTextsL
|
|
346 |
// --------------------------------------------------------------------------
|
|
347 |
//
|
|
348 |
|
|
349 |
EXPORT_C void CmPluginBaseSettingsDlg::AppendSettingTextsL(
|
|
350 |
CDesCArray& aItemArray,
|
|
351 |
const TInt aSettingItemId,
|
|
352 |
const TInt aTitleResId,
|
|
353 |
const TInt aValueResId,
|
|
354 |
const TBool aCompulsory ) const
|
|
355 |
{
|
|
356 |
HBufC* value = NULL;
|
|
357 |
if ( aValueResId )
|
|
358 |
{
|
|
359 |
value = StringLoader::LoadLC( aValueResId );
|
|
360 |
}
|
|
361 |
else
|
|
362 |
{
|
|
363 |
value = KNullDesC().AllocL();
|
|
364 |
CleanupStack::PushL( value );
|
|
365 |
}
|
|
366 |
TPtr ptrValue = value->Des();
|
|
367 |
|
|
368 |
AppendSettingTextsL( aItemArray, aSettingItemId,
|
|
369 |
aTitleResId, ptrValue, aCompulsory );
|
|
370 |
|
|
371 |
CleanupStack::PopAndDestroy( value );
|
|
372 |
}
|
|
373 |
|
|
374 |
// --------------------------------------------------------------------------
|
|
375 |
// CmPluginBaseSettingsDlg::AppendSettingTextsL
|
|
376 |
// --------------------------------------------------------------------------
|
|
377 |
//
|
|
378 |
EXPORT_C void CmPluginBaseSettingsDlg::AppendSettingTextsL(
|
|
379 |
CDesCArray& aItemArray,
|
|
380 |
const TInt aSettingItemId,
|
|
381 |
const TInt aTitleResId,
|
|
382 |
const TDesC& aValueString,
|
|
383 |
const TBool aCompulsory ) const
|
|
384 |
{
|
|
385 |
// Title
|
|
386 |
HBufC* title = StringLoader::LoadLC( aTitleResId );
|
|
387 |
|
|
388 |
_LIT( KSettingListFormat, "\t%S\t\t%S" );
|
|
389 |
HBufC* itemTextBuf = HBufC::NewLC( KSettingListFormat().Length() +
|
|
390 |
title->Length() +
|
|
391 |
aValueString.Length() +
|
|
392 |
KTxtCompulsory().Length() );
|
|
393 |
|
|
394 |
TPtr itemText = itemTextBuf->Des();
|
|
395 |
|
|
396 |
itemText.Format( KSettingListFormat, title, &aValueString );
|
|
397 |
|
|
398 |
// indicator for compulsory settings
|
|
399 |
if ( aCompulsory )
|
|
400 |
{
|
|
401 |
itemText.Append( KTxtCompulsory );
|
|
402 |
}
|
|
403 |
|
|
404 |
aItemArray.AppendL( itemText );
|
|
405 |
CleanupStack::PopAndDestroy( 2, title ); // itemTextBuf, title
|
|
406 |
iSettingIndex->AppendL( aSettingItemId );
|
|
407 |
}
|
|
408 |
|
|
409 |
// --------------------------------------------------------------------------
|
|
410 |
// CmPluginBaseSettingsDlg::DynInitMenuPaneL
|
|
411 |
// --------------------------------------------------------------------------
|
|
412 |
//
|
|
413 |
EXPORT_C void CmPluginBaseSettingsDlg::DynInitMenuPaneL(
|
|
414 |
TInt aResourceId,
|
|
415 |
CEikMenuPane* aMenuPane )
|
|
416 |
{
|
|
417 |
CAknDialog::DynInitMenuPaneL( aResourceId, aMenuPane );
|
|
418 |
|
|
419 |
if ( aResourceId == R_PLUGIN_BASE_MENU )
|
|
420 |
{
|
|
421 |
if (!iHelp)
|
|
422 |
{
|
|
423 |
aMenuPane->DeleteMenuItem( EAknCmdHelp );
|
|
424 |
}
|
|
425 |
TInt currentItem = iSettingIndex->At( iListbox->CurrentItemIndex() );
|
|
426 |
if ( currentItem == ECmBearerSettingName )
|
|
427 |
{
|
|
428 |
|
|
429 |
aMenuPane->SetItemDimmed( EPluginBaseCmdChange, ETrue );
|
|
430 |
}
|
|
431 |
}
|
|
432 |
}
|
|
433 |
|
|
434 |
// --------------------------------------------------------------------------
|
|
435 |
// CmPluginBaseSettingsDlg::ProcessCommandL
|
|
436 |
// --------------------------------------------------------------------------
|
|
437 |
//
|
|
438 |
EXPORT_C void CmPluginBaseSettingsDlg::ProcessCommandL( TInt aCommandId )
|
|
439 |
{
|
|
440 |
if ( MenuShowing() )
|
|
441 |
{
|
|
442 |
HideMenu();
|
|
443 |
}
|
|
444 |
|
|
445 |
switch ( aCommandId )
|
|
446 |
{
|
|
447 |
case EAknSoftkeyOptions:
|
|
448 |
{
|
|
449 |
DisplayMenuL();
|
|
450 |
break;
|
|
451 |
}
|
|
452 |
case EPluginBaseCmdExit:
|
|
453 |
{
|
|
454 |
iExitReason = KDialogUserExit;
|
|
455 |
if( iIsPossibleToSaveSetting && iHasSettingChanged )
|
|
456 |
{
|
|
457 |
iCmPluginBaseEng.UpdateL();
|
|
458 |
iHasSettingChanged = EFalse;
|
|
459 |
}
|
|
460 |
|
|
461 |
TryExitL( iExitReason );
|
|
462 |
break;
|
|
463 |
}
|
|
464 |
case EAknSoftkeyOk:
|
|
465 |
case EAknSoftkeyChange:
|
|
466 |
{
|
|
467 |
// Function CheckSpaceBelowCriticalLevelL may User::Leave with KLeaveWithoutAlert
|
|
468 |
// if no space available to save changes. The User::Leave message will be caught
|
|
469 |
// by iCmdExec. So,it is not caught here.
|
|
470 |
iCmPluginBaseEng.CheckSpaceBelowCriticalLevelL();
|
|
471 |
|
|
472 |
ShowPopupSettingPageL(
|
|
473 |
iSettingIndex->At( iListbox->CurrentItemIndex() ),
|
|
474 |
aCommandId );
|
|
475 |
|
|
476 |
break;
|
|
477 |
}
|
|
478 |
case EAknCmdHelp:
|
|
479 |
{
|
|
480 |
// Help context (the default value) has been set so this value is used.
|
|
481 |
HlpLauncher::LaunchHelpApplicationL( iEikonEnv->WsSession(),
|
|
482 |
iEikonEnv->EikAppUi()->AppHelpContextL() );
|
|
483 |
}
|
|
484 |
break;
|
|
485 |
default:
|
|
486 |
{
|
|
487 |
break;
|
|
488 |
}
|
|
489 |
}
|
|
490 |
}
|
|
491 |
|
|
492 |
// --------------------------------------------------------------------------
|
|
493 |
// CmPluginBaseSettingsDlg::InitTextsL
|
|
494 |
// called before the dialog is shown
|
|
495 |
// to initialize localized textual data
|
|
496 |
// --------------------------------------------------------------------------
|
|
497 |
//
|
|
498 |
EXPORT_C void CmPluginBaseSettingsDlg::InitTextsL()
|
|
499 |
{
|
|
500 |
// set pane text if neccessary...
|
|
501 |
// pane text needed if not pop-up...
|
|
502 |
if ( iEikonEnv )
|
|
503 |
{
|
|
504 |
iStatusPane = iEikonEnv->AppUiFactory()->StatusPane();
|
|
505 |
iTitlePane = ( CAknTitlePane* )iStatusPane->ControlL(
|
|
506 |
TUid::Uid( EEikStatusPaneUidTitle ) );
|
|
507 |
|
|
508 |
iOldTitleText = iTitlePane->Text()->AllocL();
|
|
509 |
HBufC* pdConnName = iCmPluginBaseEng.GetStringAttributeL( ECmName );
|
|
510 |
CleanupStack::PushL( pdConnName ); // 1
|
|
511 |
|
|
512 |
if ( pdConnName )
|
|
513 |
{
|
|
514 |
iTitlePane->SetTextL( *pdConnName );
|
|
515 |
}
|
|
516 |
else
|
|
517 |
{
|
|
518 |
iTitlePane->SetTextL( KNullDesC );
|
|
519 |
}
|
|
520 |
CleanupStack::PopAndDestroy( pdConnName ); // 0
|
|
521 |
|
|
522 |
|
|
523 |
iNaviPane = ( CAknNavigationControlContainer* )iStatusPane->ControlL(
|
|
524 |
TUid::Uid( EEikStatusPaneUidNavi ) );
|
|
525 |
iNaviDecorator = iNaviPane->CreateNavigationLabelL( KNullDesC );
|
|
526 |
iNaviPane->PushL( *iNaviDecorator );
|
|
527 |
}
|
|
528 |
}
|
|
529 |
|
|
530 |
// --------------------------------------------------------------------------
|
|
531 |
// CmPluginBaseSettingsDlg::OkToExitL
|
|
532 |
// Good to know : EAknSoftkeyCancel is never called, because
|
|
533 |
// EEikDialogFlagNotifyEsc flag is not set in the resource.
|
|
534 |
// --------------------------------------------------------------------------
|
|
535 |
//
|
|
536 |
EXPORT_C TBool CmPluginBaseSettingsDlg::OkToExitL( TInt aButtonId )
|
|
537 |
{
|
|
538 |
// Translate the button presses into commands for the appui & current
|
|
539 |
// view to handle
|
|
540 |
TBool retval( EFalse );
|
|
541 |
|
|
542 |
switch ( aButtonId )
|
|
543 |
{
|
|
544 |
case EAknSoftkeyOk:
|
|
545 |
case EAknSoftkeyChange:
|
|
546 |
{
|
|
547 |
ProcessCommandL( aButtonId );
|
|
548 |
break;
|
|
549 |
}
|
|
550 |
case EAknSoftkeyBack:
|
|
551 |
case EAknSoftkeyExit:
|
|
552 |
case KDialogUserExit:
|
|
553 |
{
|
|
554 |
|
|
555 |
if ( iIsPossibleToSaveSetting && iHasSettingChanged )
|
|
556 |
{
|
|
557 |
iCmPluginBaseEng.UpdateL();
|
|
558 |
iHasSettingChanged = EFalse;
|
|
559 |
}
|
|
560 |
retval = ETrue;
|
|
561 |
break;
|
|
562 |
}
|
|
563 |
case EAknSoftkeyOptions:
|
|
564 |
{
|
|
565 |
DisplayMenuL();
|
|
566 |
break;
|
|
567 |
}
|
|
568 |
default:
|
|
569 |
{
|
|
570 |
retval = ETrue;
|
|
571 |
break;
|
|
572 |
}
|
|
573 |
}
|
|
574 |
|
|
575 |
return retval;
|
|
576 |
}
|
|
577 |
|
|
578 |
// --------------------------------------------------------------------------
|
|
579 |
// CmPluginBaseSettingsDlg::HandleListBoxEventL
|
|
580 |
// --------------------------------------------------------------------------
|
|
581 |
//
|
|
582 |
EXPORT_C void CmPluginBaseSettingsDlg::HandleListBoxEventL(
|
|
583 |
CEikListBox* /*aListBox*/, TListBoxEvent aEventType )
|
|
584 |
{
|
|
585 |
switch ( aEventType )
|
|
586 |
{
|
|
587 |
case EEventEnterKeyPressed:
|
|
588 |
case EEventItemSingleClicked:
|
|
589 |
{
|
|
590 |
if ( !iProcessing )
|
|
591 |
{
|
|
592 |
delete iCmdExec;
|
|
593 |
iCmdExec = NULL;
|
|
594 |
iCmdExec = new (ELeave) CCmdExec(*this);
|
|
595 |
iCmdExec->Execute();
|
|
596 |
}
|
|
597 |
break;
|
|
598 |
}
|
|
599 |
case EEventEditingStarted:
|
|
600 |
{
|
|
601 |
break;
|
|
602 |
}
|
|
603 |
case EEventEditingStopped:
|
|
604 |
{
|
|
605 |
break;
|
|
606 |
}
|
|
607 |
default:
|
|
608 |
{
|
|
609 |
break;
|
|
610 |
// User::Leave( KErrNotSupported );
|
|
611 |
}
|
|
612 |
}
|
|
613 |
}
|
|
614 |
|
|
615 |
// ---------------------------------------------------------------------------
|
|
616 |
// CmPluginBaseSettingsDlg::OfferKeyEventL
|
|
617 |
// ---------------------------------------------------------------------------
|
|
618 |
//
|
|
619 |
EXPORT_C TKeyResponse CmPluginBaseSettingsDlg::OfferKeyEventL( const TKeyEvent& aKeyEvent,
|
|
620 |
TEventCode aType )
|
|
621 |
{
|
|
622 |
TKeyResponse retVal ( EKeyWasNotConsumed );
|
|
623 |
switch( aKeyEvent.iCode )
|
|
624 |
{
|
|
625 |
// Add processing for case EKeyEscape to support status pane event in IAP-related editing
|
|
626 |
// views (Dlg view, AdvDlg view and IPv4 and IPv6 views and so on)
|
|
627 |
case EKeyEscape:
|
|
628 |
TryExitL( iExitReason );
|
|
629 |
retVal = EKeyWasConsumed;
|
|
630 |
break;
|
|
631 |
default:
|
|
632 |
retVal = iListbox->OfferKeyEventL( aKeyEvent, aType );
|
|
633 |
break;
|
|
634 |
}
|
|
635 |
|
|
636 |
return retVal;
|
|
637 |
}
|
|
638 |
|
|
639 |
//---------------------------------------------------------------------------
|
|
640 |
// CmPluginBaseSettingsDlg::LoadResourceL
|
|
641 |
//---------------------------------------------------------------------------
|
|
642 |
//
|
|
643 |
EXPORT_C TInt CmPluginBaseSettingsDlg::LoadResourceL (
|
|
644 |
const TDesC& aResFileName )
|
|
645 |
{
|
|
646 |
TInt err( KErrNone );
|
|
647 |
// Add resource file.
|
|
648 |
TParse* fp = new ( ELeave ) TParse();
|
|
649 |
err = fp->Set( aResFileName,
|
|
650 |
&KDC_RESOURCE_FILES_DIR,
|
|
651 |
NULL );
|
|
652 |
if ( err )
|
|
653 |
{
|
|
654 |
User::Leave( err );
|
|
655 |
}
|
|
656 |
|
|
657 |
TFileName resourceFileNameBuf = fp->FullName();
|
|
658 |
delete fp;
|
|
659 |
|
|
660 |
iResourceReader.OpenL( resourceFileNameBuf );
|
|
661 |
return err;
|
|
662 |
}
|
|
663 |
|
|
664 |
//---------------------------------------------------------------------------
|
|
665 |
// CmPluginBaseSettingsDlg::HandleListboxDataChangeL
|
|
666 |
// called before the dialog is shown to initialize listbox data
|
|
667 |
//---------------------------------------------------------------------------
|
|
668 |
//
|
|
669 |
EXPORT_C void CmPluginBaseSettingsDlg::HandleListboxDataChangeL()
|
|
670 |
{
|
|
671 |
UpdateListBoxContentL();
|
|
672 |
iListbox->HandleItemAdditionL();
|
|
673 |
}
|
|
674 |
|
|
675 |
//---------------------------------------------------------------------------
|
|
676 |
// CmPluginBaseSettingsDlg::ShowPopupSettingPageL
|
|
677 |
//---------------------------------------------------------------------------
|
|
678 |
//
|
|
679 |
EXPORT_C TBool CmPluginBaseSettingsDlg::ShowPopupSettingPageL(
|
|
680 |
TUint32 aAttribute, TInt /*aCommandId*/ )
|
|
681 |
{
|
|
682 |
TBool retval( EFalse );
|
|
683 |
|
|
684 |
switch ( aAttribute )
|
|
685 |
{
|
|
686 |
case ECmBearerSettingName:
|
|
687 |
{
|
|
688 |
TCmCommonUi::ShowNoteL ( R_PLUGIN_BASE_INFO_BEARER_NOT_EDITABLE,
|
|
689 |
TCmCommonUi::ECmInfoNote );
|
|
690 |
break;
|
|
691 |
}
|
|
692 |
case ECmName:
|
|
693 |
default:
|
|
694 |
{
|
|
695 |
retval = ShowPopupTextSettingPageL( aAttribute );
|
|
696 |
break;
|
|
697 |
}
|
|
698 |
}
|
|
699 |
return retval;
|
|
700 |
}
|
|
701 |
|
|
702 |
//---------------------------------------------------------------------------
|
|
703 |
// CmPluginBaseSettingsDlg::SelectItem
|
|
704 |
//---------------------------------------------------------------------------
|
|
705 |
//
|
|
706 |
EXPORT_C void CmPluginBaseSettingsDlg::SelectItem( TInt aItemIndex )
|
|
707 |
{
|
|
708 |
iListbox->ScrollToMakeItemVisible( aItemIndex );
|
|
709 |
iListbox->SetCurrentItemIndexAndDraw( aItemIndex );
|
|
710 |
}
|
|
711 |
|
|
712 |
//---------------------------------------------------------------------------
|
|
713 |
// CmPluginBaseSettingsDlg::StringAttributeWithDefaultL
|
|
714 |
//---------------------------------------------------------------------------
|
|
715 |
//
|
|
716 |
EXPORT_C HBufC* CmPluginBaseSettingsDlg::StringAttributeWithDefaultL(
|
|
717 |
TUint32 aAttribute, TUint32 aDefRes )
|
|
718 |
{
|
|
719 |
HBufC* value = iCmPluginBaseEng.GetStringAttributeL( aAttribute );
|
|
720 |
if ( *value == KNullDesC )
|
|
721 |
{
|
|
722 |
delete value;
|
|
723 |
value = NULL;
|
|
724 |
value = StringLoader::LoadL( aDefRes );
|
|
725 |
}
|
|
726 |
|
|
727 |
return value;
|
|
728 |
}
|
|
729 |
|
|
730 |
// --------------------------------------------------------------------------
|
|
731 |
// CmPluginBaseSettingsDlg::GetHelpContext
|
|
732 |
// --------------------------------------------------------------------------
|
|
733 |
//
|
|
734 |
EXPORT_C void CmPluginBaseSettingsDlg::GetHelpContext( TCoeHelpContext& aContext ) const
|
|
735 |
{
|
|
736 |
aContext.iMajor = KHelpUidPlugin;
|
|
737 |
aContext.iContext = iHelpContext;
|
|
738 |
}
|
|
739 |
|
|
740 |
// --------------------------------------------------------------------------
|
|
741 |
// CmPluginBaseSettingsDlg::ShowPopupIpSettingPageL
|
|
742 |
// --------------------------------------------------------------------------
|
|
743 |
//
|
|
744 |
EXPORT_C TBool CmPluginBaseSettingsDlg::ShowPopupIpSettingPageL(
|
|
745 |
TUint32 aAttribute,
|
|
746 |
TUint32 aTitleId )
|
|
747 |
|
|
748 |
{
|
|
749 |
TBool retval = EFalse;
|
|
750 |
const TCmAttribConvTable* convItem =
|
|
751 |
iCmPluginBaseEng.ConvTableItem( aAttribute );
|
|
752 |
|
|
753 |
HBufC* servName = HBufC::NewLC( convItem->iMaxLength );
|
|
754 |
TPtr ptrServName ( servName->Des() );
|
|
755 |
|
|
756 |
HBufC* orig = iCmPluginBaseEng.GetStringAttributeL( aAttribute );
|
|
757 |
CleanupStack::PushL( orig );
|
|
758 |
ptrServName.Copy( *orig );
|
|
759 |
|
|
760 |
TInetAddr addr;
|
|
761 |
addr.Input( ptrServName );
|
|
762 |
|
|
763 |
TInt resId = EditorId( convItem->iEditorResId, R_TEXT_SETTING_PAGE_IP );
|
|
764 |
|
|
765 |
CAknIpFieldSettingPage* dlg =
|
|
766 |
new ( ELeave ) CAknIpFieldSettingPage(
|
|
767 |
resId,
|
|
768 |
addr );
|
|
769 |
|
|
770 |
CleanupStack::PushL( dlg );
|
|
771 |
SetTitleL( dlg, convItem->iTitleId, aTitleId );
|
|
772 |
CleanupStack::Pop( dlg );
|
|
773 |
|
|
774 |
if ( dlg->ExecuteLD( CAknSettingPage::EUpdateWhenAccepted ) )
|
|
775 |
{
|
|
776 |
addr.Output( ptrServName );
|
|
777 |
|
|
778 |
if ( orig->Des().CompareF( ptrServName ) )
|
|
779 |
// User modified IP address
|
|
780 |
{
|
|
781 |
iCmPluginBaseEng.SetStringAttributeL( aAttribute, ptrServName );
|
|
782 |
retval = ETrue;
|
|
783 |
UpdateListBoxContentL();
|
|
784 |
}
|
|
785 |
}
|
|
786 |
|
|
787 |
CleanupStack::PopAndDestroy( 2, servName ); // orig, servName
|
|
788 |
return retval;
|
|
789 |
}
|
|
790 |
|
|
791 |
// --------------------------------------------------------------------------
|
|
792 |
// CmPluginBaseSettingsDlg::ShowRadioButtonSettingPageL
|
|
793 |
// --------------------------------------------------------------------------
|
|
794 |
//
|
|
795 |
EXPORT_C TInt CmPluginBaseSettingsDlg::ShowRadioButtonSettingPageL(
|
|
796 |
const TUint32* aResIds,
|
|
797 |
TInt& aCurrentItem,
|
|
798 |
TUint32 aTitleId )
|
|
799 |
{
|
|
800 |
CDesCArrayFlat* items =
|
|
801 |
new ( ELeave ) CDesCArrayFlat( KCmArraySmallGranularity );
|
|
802 |
|
|
803 |
CleanupStack::PushL( items );
|
|
804 |
TInt count( 0 );
|
|
805 |
for( ; aResIds[count]; ++count )
|
|
806 |
{
|
|
807 |
HBufC* item = StringLoader::LoadLC( aResIds[count] );
|
|
808 |
items->AppendL( *item );
|
|
809 |
}
|
|
810 |
|
|
811 |
TUint32 resId = EditorId( 0, R_RADIO_BUTTON_SETTING_PAGE_OK_CANCEL );
|
|
812 |
CAknRadioButtonSettingPage* dlg =
|
|
813 |
new ( ELeave ) CAknRadioButtonSettingPage(
|
|
814 |
resId,
|
|
815 |
aCurrentItem,
|
|
816 |
items );
|
|
817 |
CleanupStack::PushL( dlg );
|
|
818 |
SetTitleL( dlg, 0, aTitleId );
|
|
819 |
CleanupStack::Pop( dlg );
|
|
820 |
|
|
821 |
TBool retVal = dlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged );
|
|
822 |
|
|
823 |
CleanupStack::PopAndDestroy( count ); // selection items
|
|
824 |
CleanupStack::PopAndDestroy( items );
|
|
825 |
|
|
826 |
return retVal;
|
|
827 |
}
|
|
828 |
|
|
829 |
// --------------------------------------------------------------------------
|
|
830 |
// CmPluginBaseSettingsDlg::ShowRadioButtonSettingPageL
|
|
831 |
// --------------------------------------------------------------------------
|
|
832 |
//
|
|
833 |
EXPORT_C TInt CmPluginBaseSettingsDlg::ShowRadioButtonSettingPageL(
|
|
834 |
CDesCArrayFlat& aItems,
|
|
835 |
TInt& aCurrentItem,
|
|
836 |
TUint32 aTitleId )
|
|
837 |
{
|
|
838 |
TUint32 resId = EditorId( 0, R_RADIO_BUTTON_SETTING_PAGE_OK_CANCEL );
|
|
839 |
CAknRadioButtonSettingPage* dlg =
|
|
840 |
new ( ELeave ) CAknRadioButtonSettingPage(
|
|
841 |
resId,
|
|
842 |
aCurrentItem,
|
|
843 |
&aItems );
|
|
844 |
CleanupStack::PushL( dlg );
|
|
845 |
SetTitleL( dlg, 0, aTitleId );
|
|
846 |
CleanupStack::Pop( dlg );
|
|
847 |
|
|
848 |
TBool retVal = dlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged );
|
|
849 |
|
|
850 |
return retVal;
|
|
851 |
}
|
|
852 |
|
|
853 |
//---------------------------------------------------------------------------
|
|
854 |
// CmPluginBaseSettingsDlg::ShowPopupTextSettingPageL
|
|
855 |
//---------------------------------------------------------------------------
|
|
856 |
//
|
|
857 |
EXPORT_C TBool CmPluginBaseSettingsDlg::ShowPopupTextSettingPageL(
|
|
858 |
TUint32 aAttribute,
|
|
859 |
TUint32 aTitleId )
|
|
860 |
{
|
|
861 |
TBool retval( EFalse );
|
|
862 |
const TCmAttribConvTable* convItem =
|
|
863 |
iCmPluginBaseEng.ConvTableItem( aAttribute );
|
|
864 |
|
|
865 |
HBufC* textToChange = HBufC::NewLC( convItem->iMaxLength );
|
|
866 |
TPtr ptrTextToChange( textToChange->Des() );
|
|
867 |
|
|
868 |
HBufC* value = HBufC::NewLC( convItem->iMaxLength );
|
|
869 |
if ( convItem->iAttribFlags & EConv8Bits )
|
|
870 |
// convert 8bits attribute to 16bits
|
|
871 |
{
|
|
872 |
HBufC8* stringFromCm =
|
|
873 |
iCmPluginBaseEng.GetString8AttributeL( aAttribute );
|
|
874 |
value->Des().Copy( *stringFromCm );
|
|
875 |
|
|
876 |
delete stringFromCm; stringFromCm = NULL;
|
|
877 |
}
|
|
878 |
else
|
|
879 |
{
|
|
880 |
HBufC* stringFromCm =
|
|
881 |
iCmPluginBaseEng.GetStringAttributeL( aAttribute );
|
|
882 |
value->Des().Copy( *stringFromCm );
|
|
883 |
|
|
884 |
delete stringFromCm; stringFromCm = NULL;
|
|
885 |
}
|
|
886 |
|
|
887 |
if( *value == KNullDesC && convItem->iDefValueResId )
|
|
888 |
// empty string is replaced with the default value from resource
|
|
889 |
{
|
|
890 |
HBufC* stringFromCm = StringLoader::LoadL( convItem->iDefValueResId );
|
|
891 |
|
|
892 |
value->Des().Copy( *stringFromCm );
|
|
893 |
|
|
894 |
delete stringFromCm; stringFromCm = NULL;
|
|
895 |
}
|
|
896 |
|
|
897 |
TPtr ptrValue( value->Des() );
|
|
898 |
ptrTextToChange.Copy( ptrValue );
|
|
899 |
|
|
900 |
TInt textSettingPageFlags( EAknSettingPageNoOrdinalDisplayed );
|
|
901 |
|
|
902 |
if ( !(convItem->iAttribFlags & EConvNoZeroLength) )
|
|
903 |
{
|
|
904 |
textSettingPageFlags = CAknTextSettingPage::EZeroLengthAllowed;
|
|
905 |
}
|
|
906 |
|
|
907 |
TUint32 resId = EditorId( convItem->iEditorResId, 0 );
|
|
908 |
|
|
909 |
CAknTextSettingPage* dlg = new ( ELeave ) CAknTextSettingPage(
|
|
910 |
resId,
|
|
911 |
ptrTextToChange,
|
|
912 |
textSettingPageFlags );
|
|
913 |
|
|
914 |
CleanupStack::PushL( dlg );
|
|
915 |
SetTitleL( dlg, convItem->iTitleId, aTitleId );
|
|
916 |
CleanupStack::Pop( dlg );
|
|
917 |
|
|
918 |
if ( dlg->ExecuteLD( CAknSettingPage::EUpdateWhenAccepted ) )
|
|
919 |
{
|
|
920 |
if ( aAttribute == ECmName )
|
|
921 |
{
|
|
922 |
iTitlePane->SetTextL( ptrTextToChange );
|
|
923 |
}
|
|
924 |
if ( ptrTextToChange.Compare( ptrValue ) )
|
|
925 |
// user modified the value
|
|
926 |
{
|
|
927 |
if ( convItem->iAttribFlags & EConv8Bits )
|
|
928 |
// convert back from 16bits to 8bits
|
|
929 |
{
|
|
930 |
HBufC8* stringTo = HBufC8::NewLC( ptrTextToChange.Length() );
|
|
931 |
|
|
932 |
stringTo->Des().Copy( ptrTextToChange );
|
|
933 |
iCmPluginBaseEng.SetString8AttributeL( aAttribute, *stringTo );
|
|
934 |
|
|
935 |
CleanupStack::PopAndDestroy( stringTo );
|
|
936 |
}
|
|
937 |
else
|
|
938 |
{
|
|
939 |
if( aAttribute == ECmName )
|
|
940 |
{
|
|
941 |
SetUniqueNameL( ptrTextToChange );
|
|
942 |
}
|
|
943 |
else
|
|
944 |
{
|
|
945 |
iCmPluginBaseEng.SetStringAttributeL( aAttribute,
|
|
946 |
ptrTextToChange );
|
|
947 |
}
|
|
948 |
}
|
|
949 |
|
|
950 |
retval = ETrue;
|
|
951 |
UpdateListBoxContentL();
|
|
952 |
}
|
|
953 |
}
|
|
954 |
|
|
955 |
CleanupStack::PopAndDestroy( 2, textToChange );
|
|
956 |
return retval;
|
|
957 |
}
|
|
958 |
|
|
959 |
|
|
960 |
void CmPluginBaseSettingsDlg::SetUniqueNameL( TPtr aPtrTextToChange )
|
|
961 |
{
|
|
962 |
// Saves the recent naming method and set it to "Not accept"
|
|
963 |
TUint32 savedNM = iCmPluginBaseEng.GetIntAttributeL( ECmNamingMethod );
|
|
964 |
iCmPluginBaseEng.SetIntAttributeL( ECmNamingMethod, ENamingNotAccept );
|
|
965 |
|
|
966 |
// Tries to save the nem name. If it is not unique
|
|
967 |
// then ret == KErrArgument
|
|
968 |
TRAPD( err, iCmPluginBaseEng.SetStringAttributeL( ECmName, aPtrTextToChange ) );
|
|
969 |
|
|
970 |
if( KErrArgument == err )
|
|
971 |
{
|
|
972 |
// Opens a info note
|
|
973 |
HBufC* noteLine = StringLoader::LoadLC(
|
|
974 |
R_CMMANAGERUI_INFO_DEST_ALREADY_IN_USE, aPtrTextToChange );
|
|
975 |
|
|
976 |
TCmCommonUi::ShowNoteL( *noteLine, TCmCommonUi::ECmInfoNote );
|
|
977 |
|
|
978 |
CleanupStack::PopAndDestroy( noteLine );
|
|
979 |
}
|
|
980 |
|
|
981 |
// Sets back the original naming method
|
|
982 |
iCmPluginBaseEng.SetIntAttributeL( ECmNamingMethod, savedNM );
|
|
983 |
}
|
|
984 |
|
|
985 |
|
|
986 |
|
|
987 |
//---------------------------------------------------------------------------
|
|
988 |
// CmPluginBaseSettingsDlg::ShowPopupPasswordSettingPageL
|
|
989 |
//---------------------------------------------------------------------------
|
|
990 |
//
|
|
991 |
EXPORT_C TBool CmPluginBaseSettingsDlg::ShowPopupPasswordSettingPageL(
|
|
992 |
TUint32 aAttribute,
|
|
993 |
TUint32 aTitleId )
|
|
994 |
{
|
|
995 |
TBool retVal( EFalse );
|
|
996 |
|
|
997 |
const TCmAttribConvTable* convItem =
|
|
998 |
iCmPluginBaseEng.ConvTableItem( aAttribute );
|
|
999 |
HBufC* newPassword = HBufC::NewLC( KCmMaxPasswordLength );
|
|
1000 |
TPtr16 ptrNewPassword = newPassword->Des();
|
|
1001 |
|
|
1002 |
HBufC* oldPassword = NULL;
|
|
1003 |
oldPassword = iCmPluginBaseEng.GetStringAttributeL( aAttribute );
|
|
1004 |
CleanupStack::PushL( oldPassword );
|
|
1005 |
|
|
1006 |
TUint32 resId = EditorId( convItem->iEditorResId,
|
|
1007 |
R_TEXT_SETTING_PAGE_PASSWD );
|
|
1008 |
CAknAlphaPasswordSettingPage* dlg =
|
|
1009 |
new ( ELeave ) CAknAlphaPasswordSettingPage(
|
|
1010 |
resId,
|
|
1011 |
ptrNewPassword,
|
|
1012 |
*oldPassword );
|
|
1013 |
CleanupStack::PushL( dlg );
|
|
1014 |
SetTitleL( dlg, convItem->iTitleId, aTitleId );
|
|
1015 |
CleanupStack::Pop( dlg );
|
|
1016 |
|
|
1017 |
if ( dlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged ) )
|
|
1018 |
{
|
|
1019 |
iCmPluginBaseEng.SetStringAttributeL( aAttribute, newPassword->Des() );
|
|
1020 |
UpdateListBoxContentL();
|
|
1021 |
|
|
1022 |
retVal = ETrue;
|
|
1023 |
}
|
|
1024 |
CleanupStack::PopAndDestroy( 2, newPassword );
|
|
1025 |
|
|
1026 |
return retVal;
|
|
1027 |
}
|
|
1028 |
|
|
1029 |
//---------------------------------------------------------------------------
|
|
1030 |
// CmPluginBaseSettingsDlg::ShowNumSettingPageL
|
|
1031 |
//---------------------------------------------------------------------------
|
|
1032 |
//
|
|
1033 |
EXPORT_C TBool CmPluginBaseSettingsDlg::ShowPopupPortNumSettingPageL(
|
|
1034 |
TUint32 aAttribute, TUint32 aTitleId )
|
|
1035 |
{
|
|
1036 |
TBool retVal( EFalse );
|
|
1037 |
const TCmAttribConvTable* convItem =
|
|
1038 |
iCmPluginBaseEng.ConvTableItem( aAttribute );
|
|
1039 |
|
|
1040 |
TInt value( 0 );
|
|
1041 |
value = iCmPluginBaseEng.GetIntAttributeL( aAttribute );
|
|
1042 |
|
|
1043 |
TInt origVal = value;
|
|
1044 |
|
|
1045 |
HBufC* buf = HBufC::NewLC( convItem->iMaxLength );
|
|
1046 |
TPtr ptr( buf->Des() );
|
|
1047 |
|
|
1048 |
ptr.Num( value );
|
|
1049 |
|
|
1050 |
TInt flags = EAknSettingPageNoOrdinalDisplayed;
|
|
1051 |
|
|
1052 |
if ( !(convItem->iAttribFlags & EConvNoZeroLength) )
|
|
1053 |
{
|
|
1054 |
flags |= CAknTextSettingPage::EZeroLengthAllowed;
|
|
1055 |
}
|
|
1056 |
|
|
1057 |
TUint32 resId = EditorId( convItem->iEditorResId,
|
|
1058 |
R_PORT_NUMBER_SETTING_PAGE );
|
|
1059 |
CAknTextSettingPage* dlg = new ( ELeave ) CAknTextSettingPage(
|
|
1060 |
resId,
|
|
1061 |
ptr,
|
|
1062 |
flags );
|
|
1063 |
|
|
1064 |
CleanupStack::PushL( dlg );
|
|
1065 |
SetTitleL( dlg, convItem->iTitleId, aTitleId );
|
|
1066 |
CleanupStack::Pop( dlg );
|
|
1067 |
|
|
1068 |
if ( dlg->ExecuteLD( CAknSettingPage::EUpdateWhenAccepted ) )
|
|
1069 |
{
|
|
1070 |
TLex lex ( buf->Des() );
|
|
1071 |
|
|
1072 |
// An empty string should be treated as default
|
|
1073 |
if ( buf->Des() == KNullDesC )
|
|
1074 |
{
|
|
1075 |
value = 0;
|
|
1076 |
}
|
|
1077 |
else
|
|
1078 |
{
|
|
1079 |
lex.Val( value );
|
|
1080 |
}
|
|
1081 |
if ( value != origVal )
|
|
1082 |
{
|
|
1083 |
iCmPluginBaseEng.SetIntAttributeL( aAttribute, value );
|
|
1084 |
retVal = ETrue;
|
|
1085 |
UpdateListBoxContentL();
|
|
1086 |
}
|
|
1087 |
}
|
|
1088 |
|
|
1089 |
CleanupStack::PopAndDestroy( buf );
|
|
1090 |
return retVal;
|
|
1091 |
}
|
|
1092 |
|
|
1093 |
//---------------------------------------------------------------------------
|
|
1094 |
// CmPluginBaseSettingsDlg::ShowPopupIPv4DNSEditorL
|
|
1095 |
//---------------------------------------------------------------------------
|
|
1096 |
//
|
|
1097 |
EXPORT_C TBool CmPluginBaseSettingsDlg::ShowPopupIPv4DNSEditorL(
|
|
1098 |
TUint32 aDNSUsageAttribute,
|
|
1099 |
TUint32 aDNS1ServAttribute,
|
|
1100 |
TUint32 aDNS2ServAttribute,
|
|
1101 |
TUint32 aTitleId )
|
|
1102 |
{
|
|
1103 |
// In default the return value is 'Automatic'
|
|
1104 |
TBool retVal( EFalse );
|
|
1105 |
// In default DNS setting is automatic.
|
|
1106 |
const TCmAttribConvTable* convItem =
|
|
1107 |
iCmPluginBaseEng.ConvTableItem( aDNSUsageAttribute );
|
|
1108 |
|
|
1109 |
HBufC* primServ = iCmPluginBaseEng.GetStringAttributeL( aDNS1ServAttribute );
|
|
1110 |
CleanupStack::PushL( primServ );
|
|
1111 |
HBufC* secServ = iCmPluginBaseEng.GetStringAttributeL( aDNS2ServAttribute );
|
|
1112 |
CleanupStack::PushL( secServ );
|
|
1113 |
|
|
1114 |
TBuf<KIpAddressWidth> newPrim;
|
|
1115 |
TBuf<KIpAddressWidth> newSec;
|
|
1116 |
|
|
1117 |
newPrim.Copy( *primServ );
|
|
1118 |
newSec.Copy( *secServ );
|
|
1119 |
|
|
1120 |
TInetAddr dns1Addr;
|
|
1121 |
TInetAddr dns2Addr;
|
|
1122 |
|
|
1123 |
dns1Addr.Input( newPrim );
|
|
1124 |
dns2Addr.Input( newSec );
|
|
1125 |
|
|
1126 |
CAknMultiLineIpQueryDialog* dlg =
|
|
1127 |
CAknMultiLineIpQueryDialog::NewL( dns1Addr,
|
|
1128 |
dns2Addr );
|
|
1129 |
|
|
1130 |
CleanupStack::PushL( dlg );
|
|
1131 |
|
|
1132 |
TUint32 editorId = EditorId( convItem->iEditorResId, R_DNSIP4_QUERY );
|
|
1133 |
dlg->PrepareLC( editorId );
|
|
1134 |
|
|
1135 |
TUint32 titleId = TitleId( convItem->iTitleId, aTitleId );
|
|
1136 |
if ( titleId )
|
|
1137 |
{
|
|
1138 |
dlg->SetTitleL( titleId );
|
|
1139 |
}
|
|
1140 |
|
|
1141 |
CleanupStack::Pop( dlg );
|
|
1142 |
|
|
1143 |
if ( dlg->RunLD() )
|
|
1144 |
{
|
|
1145 |
dns1Addr.Output( newPrim );
|
|
1146 |
dns2Addr.Output( newSec );
|
|
1147 |
|
|
1148 |
if ( newPrim.CompareF( *primServ ) ||
|
|
1149 |
newSec.CompareF( *secServ ) )
|
|
1150 |
// User modified the DNS setting
|
|
1151 |
{
|
|
1152 |
iCmPluginBaseEng.SetDNSServerAddressL(
|
|
1153 |
aDNS1ServAttribute,
|
|
1154 |
newPrim,
|
|
1155 |
aDNS2ServAttribute,
|
|
1156 |
newSec,
|
|
1157 |
aDNSUsageAttribute,
|
|
1158 |
EFalse );
|
|
1159 |
|
|
1160 |
UpdateListBoxContentL();
|
|
1161 |
|
|
1162 |
retVal = ETrue;
|
|
1163 |
}
|
|
1164 |
}
|
|
1165 |
|
|
1166 |
CleanupStack::PopAndDestroy( 2, primServ );
|
|
1167 |
|
|
1168 |
return retVal;
|
|
1169 |
}
|
|
1170 |
|
|
1171 |
//---------------------------------------------------------------------------
|
|
1172 |
// CmPluginBaseSettingsDlg::ShowPopupIPv6DNSEditorL
|
|
1173 |
//---------------------------------------------------------------------------
|
|
1174 |
//
|
|
1175 |
EXPORT_C TInt CmPluginBaseSettingsDlg::ShowPopupIPv6DNSEditorL(
|
|
1176 |
const TUint32* aSelectionItems,
|
|
1177 |
TUint32 aDNSUsageAttribute,
|
|
1178 |
TUint32 aDNS1ServAttribute,
|
|
1179 |
TUint32 aDNS2ServAttribute )
|
|
1180 |
{
|
|
1181 |
TBool update( EFalse );
|
|
1182 |
TInt selected = GetIPv6DNSTypeL( aDNS1ServAttribute, aDNS2ServAttribute );
|
|
1183 |
|
|
1184 |
// convert the current setting value to the selection index
|
|
1185 |
TInt resId = KTIPv6DNSItems[selected].iResId;
|
|
1186 |
TInt i = 0;
|
|
1187 |
while ( aSelectionItems[i] )
|
|
1188 |
{
|
|
1189 |
if ( resId == aSelectionItems[i] )
|
|
1190 |
{
|
|
1191 |
selected = i;
|
|
1192 |
break;
|
|
1193 |
}
|
|
1194 |
i++;
|
|
1195 |
}
|
|
1196 |
|
|
1197 |
if ( ShowRadioButtonSettingPageL( aSelectionItems,
|
|
1198 |
selected,
|
|
1199 |
R_QTN_SET_DNS_SERVERS_IP ) )
|
|
1200 |
{
|
|
1201 |
// convert the selection to the setting value
|
|
1202 |
resId = aSelectionItems[selected];
|
|
1203 |
TInt j = 0;
|
|
1204 |
|
|
1205 |
while ( KTIPv6DNSItems[j].iResId )
|
|
1206 |
{
|
|
1207 |
if ( resId == KTIPv6DNSItems[j].iResId )
|
|
1208 |
{
|
|
1209 |
selected = KTIPv6DNSItems[j].iSettingValue;
|
|
1210 |
break;
|
|
1211 |
}
|
|
1212 |
j++;
|
|
1213 |
}
|
|
1214 |
|
|
1215 |
switch ( selected )
|
|
1216 |
{
|
|
1217 |
case EIPv6WellKnown:
|
|
1218 |
{
|
|
1219 |
iCmPluginBaseEng.SetStringAttributeL(
|
|
1220 |
aDNS1ServAttribute, KKnownIp6NameServer1 );
|
|
1221 |
iCmPluginBaseEng.SetStringAttributeL(
|
|
1222 |
aDNS2ServAttribute, KKnownIp6NameServer2 );
|
|
1223 |
|
|
1224 |
iCmPluginBaseEng.SetBoolAttributeL(
|
|
1225 |
aDNSUsageAttribute, EFalse );
|
|
1226 |
|
|
1227 |
update = ETrue;
|
|
1228 |
}
|
|
1229 |
break;
|
|
1230 |
|
|
1231 |
case EIPv6Unspecified:
|
|
1232 |
{
|
|
1233 |
iCmPluginBaseEng.SetStringAttributeL(
|
|
1234 |
aDNS1ServAttribute, KDynamicIpv6Address );
|
|
1235 |
iCmPluginBaseEng.SetStringAttributeL(
|
|
1236 |
aDNS2ServAttribute, KDynamicIpv6Address );
|
|
1237 |
iCmPluginBaseEng.SetBoolAttributeL(
|
|
1238 |
aDNSUsageAttribute, ETrue );
|
|
1239 |
|
|
1240 |
update = ETrue;
|
|
1241 |
}
|
|
1242 |
break;
|
|
1243 |
|
|
1244 |
case EIPv6UserDefined:
|
|
1245 |
{
|
|
1246 |
TInt err1;
|
|
1247 |
TInt err2;
|
|
1248 |
TBool cancelled(EFalse);
|
|
1249 |
do
|
|
1250 |
{
|
|
1251 |
// These has to be reset to KErrNone in case of
|
|
1252 |
// inputting an invalid address (DLAN-7FJD68).
|
|
1253 |
err1 = KErrNone;
|
|
1254 |
err2 = KErrNone;
|
|
1255 |
|
|
1256 |
HBufC* dns1 = HBufC::NewLC( KMaxIPv6NameServerLength );
|
|
1257 |
HBufC* dns2 = HBufC::NewLC( KMaxIPv6NameServerLength );
|
|
1258 |
|
|
1259 |
TPtr dns1ptr( dns1->Des() );
|
|
1260 |
TPtr dns2ptr( dns2->Des() );
|
|
1261 |
|
|
1262 |
HBufC* temp = iCmPluginBaseEng.GetStringAttributeL(
|
|
1263 |
aDNS1ServAttribute );
|
|
1264 |
dns1ptr.Copy( *temp );
|
|
1265 |
delete temp; temp = NULL;
|
|
1266 |
|
|
1267 |
temp = iCmPluginBaseEng.GetStringAttributeL(
|
|
1268 |
aDNS2ServAttribute );
|
|
1269 |
dns2ptr.Copy( *temp );
|
|
1270 |
delete temp; temp = NULL;
|
|
1271 |
|
|
1272 |
// KDynamicIpv6Address is offered instead of empty string
|
|
1273 |
if ( dns1ptr.Length() == 0 )
|
|
1274 |
{
|
|
1275 |
dns1ptr = KDynamicIpv6Address;
|
|
1276 |
}
|
|
1277 |
if ( dns2ptr.Length() == 0 )
|
|
1278 |
{
|
|
1279 |
dns2ptr = KDynamicIpv6Address;
|
|
1280 |
}
|
|
1281 |
|
|
1282 |
|
|
1283 |
if ( ( dns1ptr.Compare( KKnownIp6NameServer1 ) == 0 ) &&
|
|
1284 |
( dns2ptr.Compare( KKnownIp6NameServer2 ) == 0 ) )
|
|
1285 |
{ // special value, well-known
|
|
1286 |
// in this case 'dynamic' string must be offered so
|
|
1287 |
// temp data must be changed to 'dynamic'
|
|
1288 |
dns1ptr = KDynamicIpv6Address;
|
|
1289 |
dns2ptr = KDynamicIpv6Address;
|
|
1290 |
}
|
|
1291 |
|
|
1292 |
CCmPluginMultiLineDialog* ipquery =
|
|
1293 |
CCmPluginMultiLineDialog::NewL( dns1ptr,
|
|
1294 |
dns2ptr );
|
|
1295 |
|
|
1296 |
if ( ipquery->ExecuteLD( R_DNSIP6_QUERY ) )
|
|
1297 |
{
|
|
1298 |
TInetAddr dns1Addr;
|
|
1299 |
TInetAddr dns2Addr;
|
|
1300 |
|
|
1301 |
if ( dns1ptr.Compare( KNullDesC ) )
|
|
1302 |
{
|
|
1303 |
err1 = dns1Addr.Input( dns1ptr );
|
|
1304 |
}
|
|
1305 |
if ( dns2ptr.Compare( KNullDesC ) )
|
|
1306 |
{
|
|
1307 |
err2 = dns2Addr.Input( dns2ptr );
|
|
1308 |
}
|
|
1309 |
if ( err1 || err2 )
|
|
1310 |
{
|
|
1311 |
TCmCommonUi::ShowNoteL
|
|
1312 |
( R_QTN_SET_INFO_INVALID_IP,
|
|
1313 |
TCmCommonUi::ECmErrorNote );
|
|
1314 |
}
|
|
1315 |
else
|
|
1316 |
{
|
|
1317 |
iCmPluginBaseEng.SetDNSServerAddressL(
|
|
1318 |
aDNS1ServAttribute,
|
|
1319 |
dns1ptr,
|
|
1320 |
aDNS2ServAttribute,
|
|
1321 |
dns2ptr,
|
|
1322 |
aDNSUsageAttribute,
|
|
1323 |
ETrue );
|
|
1324 |
|
|
1325 |
update = ETrue;
|
|
1326 |
}
|
|
1327 |
}
|
|
1328 |
else
|
|
1329 |
{
|
|
1330 |
cancelled = ETrue;
|
|
1331 |
}
|
|
1332 |
CleanupStack::PopAndDestroy( dns2 );
|
|
1333 |
CleanupStack::PopAndDestroy( dns1 );
|
|
1334 |
} while ( (err1 || err2) && (!cancelled) );
|
|
1335 |
break;
|
|
1336 |
}
|
|
1337 |
default:
|
|
1338 |
{
|
|
1339 |
User::Leave( KErrNotSupported );
|
|
1340 |
}
|
|
1341 |
}
|
|
1342 |
}
|
|
1343 |
|
|
1344 |
if( update )
|
|
1345 |
{
|
|
1346 |
UpdateListBoxContentL();
|
|
1347 |
}
|
|
1348 |
|
|
1349 |
return selected;
|
|
1350 |
}
|
|
1351 |
|
|
1352 |
//---------------------------------------------------------------------------
|
|
1353 |
// CmPluginBaseSettingsDlg::TitleId
|
|
1354 |
//---------------------------------------------------------------------------
|
|
1355 |
//
|
|
1356 |
TUint32 CmPluginBaseSettingsDlg::TitleId( TUint32 aConvTitleId,
|
|
1357 |
TUint32 aTitleId ) const
|
|
1358 |
{
|
|
1359 |
TUint32 titleId( 0 );
|
|
1360 |
if ( aTitleId )
|
|
1361 |
{
|
|
1362 |
titleId = aTitleId;
|
|
1363 |
}
|
|
1364 |
else if ( !titleId )
|
|
1365 |
{
|
|
1366 |
titleId = aConvTitleId;
|
|
1367 |
}
|
|
1368 |
|
|
1369 |
return titleId;
|
|
1370 |
}
|
|
1371 |
|
|
1372 |
//---------------------------------------------------------------------------
|
|
1373 |
// CmPluginBaseSettingsDlg::SetTitleL
|
|
1374 |
//---------------------------------------------------------------------------
|
|
1375 |
//
|
|
1376 |
void CmPluginBaseSettingsDlg::SetTitleL( CAknSettingPage* aDlg,
|
|
1377 |
TUint32 aConvTitleId,
|
|
1378 |
TUint32 aTitleId ) const
|
|
1379 |
{
|
|
1380 |
TUint32 titleId( TitleId( aConvTitleId, aTitleId ) );
|
|
1381 |
|
|
1382 |
if ( titleId )
|
|
1383 |
{
|
|
1384 |
HBufC* title = StringLoader::LoadLC( titleId );
|
|
1385 |
aDlg->SetSettingTextL( *title );
|
|
1386 |
CleanupStack::PopAndDestroy( title );
|
|
1387 |
}
|
|
1388 |
}
|
|
1389 |
|
|
1390 |
//---------------------------------------------------------------------------
|
|
1391 |
// CmPluginBaseSettingsDlg::EditorId
|
|
1392 |
//---------------------------------------------------------------------------
|
|
1393 |
//
|
|
1394 |
TUint32 CmPluginBaseSettingsDlg::EditorId( TUint32 aConvEditorId,
|
|
1395 |
TUint32 aEditorId ) const
|
|
1396 |
{
|
|
1397 |
TUint32 resId( 0 );
|
|
1398 |
if ( aConvEditorId )
|
|
1399 |
{
|
|
1400 |
resId = aConvEditorId;
|
|
1401 |
}
|
|
1402 |
if ( !resId )
|
|
1403 |
{
|
|
1404 |
resId = aEditorId;
|
|
1405 |
}
|
|
1406 |
|
|
1407 |
return resId;
|
|
1408 |
}
|
|
1409 |
|
|
1410 |
// --------------------------------------------------------------------------
|
|
1411 |
// CmPluginBaseSettingsDlg::GetIPv6DNSTypeL
|
|
1412 |
// --------------------------------------------------------------------------
|
|
1413 |
//
|
|
1414 |
EXPORT_C TInt CmPluginBaseSettingsDlg::GetIPv6DNSTypeL(
|
|
1415 |
TUint32 aDNS1ServAttribute,
|
|
1416 |
TUint32 aDNS2ServAttribute )
|
|
1417 |
{
|
|
1418 |
TIPv6Types retval( EIPv6UserDefined );
|
|
1419 |
|
|
1420 |
HBufC* priServ = NULL;
|
|
1421 |
priServ = iCmPluginBaseEng.GetStringAttributeL( aDNS1ServAttribute );
|
|
1422 |
CleanupStack::PushL( priServ );
|
|
1423 |
TPtr16 ptr1( priServ->Des() );
|
|
1424 |
|
|
1425 |
HBufC* secServ = NULL;
|
|
1426 |
secServ = iCmPluginBaseEng.GetStringAttributeL( aDNS2ServAttribute );
|
|
1427 |
CleanupStack::PushL( secServ );
|
|
1428 |
TPtr16 ptr2( secServ->Des() );
|
|
1429 |
|
|
1430 |
// net type 6: if IspIPv6NameServ <> 0.0.0.0
|
|
1431 |
// => User defined OR well-known
|
|
1432 |
|
|
1433 |
if ( ( !ptr1.Compare( KKnownIp6NameServer1 ) )
|
|
1434 |
&& ( !ptr2.Compare( KKnownIp6NameServer2 ) ) )
|
|
1435 |
{ // special value, well-known
|
|
1436 |
retval = EIPv6WellKnown;
|
|
1437 |
}
|
|
1438 |
else
|
|
1439 |
{
|
|
1440 |
// dynamic, if 0:0:...
|
|
1441 |
// OR EMPTY text...
|
|
1442 |
if ( ( ( !ptr1.Compare( KDynamicIpv6Address ) )
|
|
1443 |
|| ( !ptr1.Compare( KNullDesC ) ) )
|
|
1444 |
&&( ( !ptr2.Compare( KDynamicIpv6Address ) )
|
|
1445 |
||( !ptr2.Compare( KDynamicIpv6Address ) ) ) )
|
|
1446 |
{ // dynamic, 0:0:...
|
|
1447 |
retval = EIPv6Unspecified;
|
|
1448 |
}
|
|
1449 |
else
|
|
1450 |
{ // other value, user defined
|
|
1451 |
retval = EIPv6UserDefined;
|
|
1452 |
}
|
|
1453 |
}
|
|
1454 |
|
|
1455 |
CleanupStack::PopAndDestroy( 2, priServ );
|
|
1456 |
|
|
1457 |
return retval;
|
|
1458 |
}
|
|
1459 |
|
|
1460 |
// --------------------------------------------------------------------------
|
|
1461 |
// CmPluginBaseSettingsDlg::HandleResourceChange
|
|
1462 |
// --------------------------------------------------------------------------
|
|
1463 |
//
|
|
1464 |
|
|
1465 |
EXPORT_C void CmPluginBaseSettingsDlg::HandleResourceChange( TInt aType )
|
|
1466 |
{
|
|
1467 |
CCoeControl::HandleResourceChange( aType );
|
|
1468 |
|
|
1469 |
CAknDialog::HandleResourceChange(aType);
|
|
1470 |
|
|
1471 |
if( aType == KEikDynamicLayoutVariantSwitch )
|
|
1472 |
{
|
|
1473 |
DrawNow();
|
|
1474 |
}
|
|
1475 |
}
|
|
1476 |
|
|
1477 |
// --------------------------------------------------------------------------
|
|
1478 |
// CmPluginBaseSettingsDlg::Execute
|
|
1479 |
// --------------------------------------------------------------------------
|
|
1480 |
//
|
|
1481 |
EXPORT_C void CmPluginBaseSettingsDlg::Execute()
|
|
1482 |
{
|
|
1483 |
iProcessing = ETrue;
|
|
1484 |
|
|
1485 |
TRAPD( err, ProcessCommandL( EAknSoftkeyChange ) );
|
|
1486 |
if ( err )
|
|
1487 |
{
|
|
1488 |
HandleLeaveError( err );
|
|
1489 |
}
|
|
1490 |
iProcessing = EFalse;
|
|
1491 |
}
|
|
1492 |
|
|
1493 |
// --------------------------------------------------------------------------
|
|
1494 |
// CmPluginBaseSettingsDlg::HandleLeaveError
|
|
1495 |
// --------------------------------------------------------------------------
|
|
1496 |
//
|
|
1497 |
EXPORT_C void CmPluginBaseSettingsDlg::HandleLeaveError( TInt aError )
|
|
1498 |
{
|
|
1499 |
switch( aError )
|
|
1500 |
{
|
|
1501 |
case KLeaveWithoutAlert:
|
|
1502 |
case KErrNoMemory:
|
|
1503 |
// Indicate no memory to save setting changes
|
|
1504 |
iIsPossibleToSaveSetting = EFalse;
|
|
1505 |
|
|
1506 |
if (iProcessing)
|
|
1507 |
{
|
|
1508 |
// Release processing protection so that the next processing can be done
|
|
1509 |
iProcessing = EFalse;
|
|
1510 |
}
|
|
1511 |
break;
|
|
1512 |
default:
|
|
1513 |
// More leave errors may be handled if necessary
|
|
1514 |
// Now other leave errors are ignored here
|
|
1515 |
break;
|
|
1516 |
}
|
|
1517 |
}
|