35
|
1 |
/*
|
|
2 |
* Copyright (c) 2006-2010 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: GSFW implementation for Presence Settings UI GS plugin.
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
|
|
21 |
// INCLUDE FILES
|
|
22 |
#include <bautils.h>
|
|
23 |
#include <gsprivatepluginproviderids.h>
|
|
24 |
#include <gsfwviewuids.h>
|
|
25 |
#include <psuigspluginrsc.rsg>
|
|
26 |
#include <psuigsplugin.mbg>
|
|
27 |
#include <gsbaseview.h>
|
|
28 |
#include <eiktxlbx.h>
|
|
29 |
#include <eikmenup.h>
|
|
30 |
#include <eiktxlbm.h>
|
|
31 |
#include <featmgr.h>
|
|
32 |
#include <hlplch.h>
|
|
33 |
#include <coeaui.h>
|
|
34 |
#include <aknlists.h>
|
|
35 |
#include <aknPopup.h>
|
|
36 |
#include <StringLoader.h>
|
|
37 |
#include <AknQueryDialog.h>
|
|
38 |
|
|
39 |
#include "psuigsplugin.h"
|
|
40 |
#include "psuigsplugin.hrh"
|
|
41 |
#include "psuigsplugincontainer.h"
|
|
42 |
#include "psuigspluginids.hrh"
|
|
43 |
#include "psuigspluginmodel.h"
|
|
44 |
#include "psuigspluginsettingview.h"
|
|
45 |
|
|
46 |
// CONSTANTS
|
|
47 |
_LIT( KPSUIGSPluginResourceFileName, "z:\\resource\\psuigspluginrsc.rsc" );
|
|
48 |
|
|
49 |
#ifdef __SCALABLE_ICONS
|
|
50 |
// bitmap
|
|
51 |
_LIT( KPSUIGSPluginIconFileName, "\\resource\\apps\\psuigsplugin.mif");
|
|
52 |
#else //__SCALABLE_ICONS
|
|
53 |
// svg file
|
|
54 |
_LIT( KPSUIGSPluginIconFileName, "\\resource\\apps\\psuigsplugin.mbm");
|
|
55 |
#endif //__SCALABLE_ICONS
|
|
56 |
|
|
57 |
// ========================= MEMBER FUNCTIONS ================================
|
|
58 |
|
|
59 |
// ---------------------------------------------------------------------------
|
|
60 |
// CPSUIGSPlugin::CPSUIGSPlugin()
|
|
61 |
// C++ default constructor can NOT contain any code, that
|
|
62 |
// might leave.
|
|
63 |
// ---------------------------------------------------------------------------
|
|
64 |
//
|
|
65 |
CPSUIGSPlugin::CPSUIGSPlugin()
|
|
66 |
: iClosing ( EFalse )
|
|
67 |
{
|
|
68 |
}
|
|
69 |
|
|
70 |
// ---------------------------------------------------------------------------
|
|
71 |
// CPSUIGSPlugin::~CPSUIGSPlugin()
|
|
72 |
// Destructor
|
|
73 |
// ---------------------------------------------------------------------------
|
|
74 |
//
|
|
75 |
CPSUIGSPlugin::~CPSUIGSPlugin()
|
|
76 |
{
|
|
77 |
delete iPSModel;
|
|
78 |
FeatureManager::UnInitializeLib();
|
|
79 |
}
|
|
80 |
|
|
81 |
// ---------------------------------------------------------------------------
|
|
82 |
// CPSUIGSPlugin::ConstructL
|
|
83 |
// Symbian 2nd phase constructor can leave.
|
|
84 |
// ---------------------------------------------------------------------------
|
|
85 |
//
|
|
86 |
void CPSUIGSPlugin::ConstructL()
|
|
87 |
{
|
|
88 |
// preparing resources for use
|
|
89 |
TFileName fileName( KPSUIGSPluginResourceFileName );
|
|
90 |
BaflUtils::NearestLanguageFile( iCoeEnv->FsSession(), fileName );
|
|
91 |
iResourceLoader.OpenL( fileName );
|
|
92 |
// base construct (base needs the resources to be loaded 1st)
|
|
93 |
BaseConstructL( R_PSUI_MAIN_VIEW );
|
|
94 |
FeatureManager::InitializeLibL();
|
|
95 |
}
|
|
96 |
|
|
97 |
// ---------------------------------------------------------------------------
|
|
98 |
// CPSUIGSPlugin::NewL()
|
|
99 |
// Two-phased constructor.
|
|
100 |
// ---------------------------------------------------------------------------
|
|
101 |
//
|
|
102 |
CPSUIGSPlugin* CPSUIGSPlugin::NewL( TAny* /*aAppUi*/ )
|
|
103 |
{
|
|
104 |
CPSUIGSPlugin* self = new( ELeave ) CPSUIGSPlugin();
|
|
105 |
CleanupStack::PushL( self );
|
|
106 |
self->ConstructL();
|
|
107 |
CleanupStack::Pop( self );
|
|
108 |
return self;
|
|
109 |
}
|
|
110 |
|
|
111 |
// ---------------------------------------------------------------------------
|
|
112 |
// CPSUIGSPlugin::Id()
|
|
113 |
// See header for details.
|
|
114 |
// ---------------------------------------------------------------------------
|
|
115 |
//
|
|
116 |
TUid CPSUIGSPlugin::Id() const
|
|
117 |
{
|
|
118 |
return TUid::Uid( PSUIGSPluginImplUid );
|
|
119 |
}
|
|
120 |
|
|
121 |
// ---------------------------------------------------------------------------
|
|
122 |
// CPSUIGSPlugin::NewContainerL()
|
|
123 |
// See header for details.
|
|
124 |
// ---------------------------------------------------------------------------
|
|
125 |
//
|
|
126 |
void CPSUIGSPlugin::NewContainerL()
|
|
127 |
{
|
|
128 |
iContainer = new ( ELeave ) CPSUIGSPluginContainer( this );
|
|
129 |
}
|
|
130 |
|
|
131 |
// ---------------------------------------------------------------------------
|
|
132 |
// CPSUIGSPlugin::DoActivateL()
|
|
133 |
// See header for details.
|
|
134 |
// ---------------------------------------------------------------------------
|
|
135 |
//
|
|
136 |
void CPSUIGSPlugin::DoActivateL( const TVwsViewId& aPrevViewId,
|
|
137 |
TUid aCustomMessageId,
|
|
138 |
const TDesC8& aCustomMessage )
|
|
139 |
{
|
|
140 |
if ( KPreSettingViewId != aPrevViewId.iViewUid )
|
|
141 |
{
|
|
142 |
iPSUIGSPrevViewId = aPrevViewId;
|
|
143 |
}
|
|
144 |
|
|
145 |
// model & observer constructed only when needed
|
|
146 |
if ( !iPSModel )
|
|
147 |
{
|
|
148 |
iPSModel = CPSUIGSPluginModel::NewL();
|
|
149 |
iAppUi->AddViewDeactivationObserverL( this );
|
|
150 |
}
|
|
151 |
|
|
152 |
const TInt id = iPSModel->SettingsId();
|
|
153 |
if ( id )
|
|
154 |
{// readjust the focus
|
|
155 |
SetCurrentItem( iPSModel->SettingsIDArray().Find( id ));
|
|
156 |
}
|
|
157 |
|
|
158 |
iClosing = EFalse;
|
|
159 |
CGSBaseView::DoActivateL( aPrevViewId, aCustomMessageId, aCustomMessage );
|
|
160 |
UpdateMSK();
|
|
161 |
}
|
|
162 |
|
|
163 |
// ---------------------------------------------------------------------------
|
|
164 |
// CPSUIGSPlugin::DoDeactivate()
|
|
165 |
// See header for details.
|
|
166 |
// ---------------------------------------------------------------------------
|
|
167 |
//
|
|
168 |
void CPSUIGSPlugin::DoDeactivate()
|
|
169 |
{
|
|
170 |
CGSBaseView::DoDeactivate();
|
|
171 |
if ( iClosing )
|
|
172 |
{// PSUI plugin is going to be closed so it is safe to free some memory
|
|
173 |
delete iPSModel;
|
|
174 |
iPSModel = NULL;
|
|
175 |
delete iSettingView;
|
|
176 |
iSettingView = NULL;
|
|
177 |
}
|
|
178 |
}
|
|
179 |
|
|
180 |
// ---------------------------------------------------------------------------
|
|
181 |
// CPSUIGSPlugin::HandleViewDeactivation()
|
|
182 |
// See header for details.
|
|
183 |
// ---------------------------------------------------------------------------
|
|
184 |
//
|
|
185 |
void CPSUIGSPlugin::HandleViewDeactivation(
|
|
186 |
const TVwsViewId& aViewIdToBeDeactivated,
|
|
187 |
const TVwsViewId& aNewlyActivatedViewId)
|
|
188 |
{
|
|
189 |
if ( TUid::Uid( PSUIGSPluginImplUid ) == aViewIdToBeDeactivated.iViewUid &&
|
|
190 |
iPSUIGSPrevViewId.iViewUid == aNewlyActivatedViewId.iViewUid )
|
|
191 |
{
|
|
192 |
iClosing = ETrue;
|
|
193 |
iAppUi->RemoveViewDeactivationObserver( this );
|
|
194 |
}
|
|
195 |
}
|
|
196 |
|
|
197 |
// ---------------------------------------------------------------------------
|
|
198 |
// CPSUIGSPlugin::HandleCommandL()
|
|
199 |
// See header for details.
|
|
200 |
// ---------------------------------------------------------------------------
|
|
201 |
//
|
|
202 |
void CPSUIGSPlugin::HandleCommandL( TInt aCommand )
|
|
203 |
{
|
|
204 |
switch ( aCommand )
|
|
205 |
{
|
|
206 |
case EAknSoftkeyBack:
|
|
207 |
{
|
|
208 |
RemoveSettingView();
|
|
209 |
iAppUi->ActivateLocalViewL( iPSUIGSPrevViewId.iViewUid );
|
|
210 |
break;
|
|
211 |
}
|
|
212 |
case EPSUICmdEdit:
|
|
213 |
{
|
|
214 |
HandleListBoxSelectionL();
|
|
215 |
break;
|
|
216 |
}
|
|
217 |
case EPSUICmdDelete:
|
|
218 |
{
|
|
219 |
DeleteSettingsL();
|
|
220 |
break;
|
|
221 |
}
|
|
222 |
case EPSUICmdNewSettingsDefault:
|
|
223 |
{
|
|
224 |
CreateNewDefaultSettingsL();
|
|
225 |
break;
|
|
226 |
}
|
|
227 |
case EPSUICmdNewSettingsExisting:
|
|
228 |
{
|
|
229 |
CreateCopyOfExistingSettingsL();
|
|
230 |
break;
|
|
231 |
}
|
|
232 |
case EAknCmdHelp:
|
|
233 |
{
|
|
234 |
if( FeatureManager::FeatureSupported( KFeatureIdHelp ) )
|
|
235 |
{
|
|
236 |
HlpLauncher::LaunchHelpApplicationL(
|
|
237 |
iEikonEnv->WsSession(), iAppUi->AppHelpContextL() );
|
|
238 |
}
|
|
239 |
break;
|
|
240 |
}
|
|
241 |
default:
|
|
242 |
{
|
|
243 |
iAppUi->HandleCommandL( aCommand );
|
|
244 |
break;
|
|
245 |
}
|
|
246 |
}
|
|
247 |
}
|
|
248 |
|
|
249 |
// ---------------------------------------------------------------------------
|
|
250 |
// CPSUIGSPlugin::SettingCountAndIndex()
|
|
251 |
// See header for details.
|
|
252 |
// ---------------------------------------------------------------------------
|
|
253 |
//
|
|
254 |
TInt CPSUIGSPlugin::SettingCountAndIndex( TInt& aIndex )
|
|
255 |
{
|
|
256 |
CEikTextListBox* listbox = Container()->iListBox;// not owned
|
|
257 |
TInt count = listbox->Model()->NumberOfItems();
|
|
258 |
aIndex = count ? listbox->CurrentItemIndex() : KErrNotFound;
|
|
259 |
|
|
260 |
return count;
|
|
261 |
}
|
|
262 |
|
|
263 |
// ---------------------------------------------------------------------------
|
|
264 |
// CPSUIGSPlugin::HandleListBoxSelectionL()
|
|
265 |
// See header for details.
|
|
266 |
// ---------------------------------------------------------------------------
|
|
267 |
//
|
|
268 |
void CPSUIGSPlugin::HandleListBoxSelectionL()
|
|
269 |
{
|
|
270 |
TInt index = KErrNotFound;
|
|
271 |
if ( SettingCountAndIndex( index ))
|
|
272 |
{
|
|
273 |
iPSModel->EditSettingsL( index );
|
|
274 |
|
|
275 |
ConstructSettingViewL();
|
|
276 |
iAppUi->ActivateLocalViewL( KPreSettingViewId );
|
|
277 |
}
|
|
278 |
}
|
|
279 |
|
|
280 |
// ---------------------------------------------------------------------------
|
|
281 |
// CPSUIGSPlugin::DeleteSettingsL()
|
|
282 |
// See header for details.
|
|
283 |
// ---------------------------------------------------------------------------
|
|
284 |
//
|
|
285 |
void CPSUIGSPlugin::DeleteSettingsL()
|
|
286 |
{
|
|
287 |
TInt index = KErrNotFound;
|
|
288 |
TInt count = SettingCountAndIndex( index );
|
|
289 |
if ( count )
|
|
290 |
{
|
|
291 |
if ( AcceptDeletionL( count, index ))
|
|
292 |
{
|
|
293 |
iPSModel->DeleteSettingsL( index, ETrue );
|
|
294 |
CEikTextListBox* listbox = Container()->iListBox;// not owned
|
|
295 |
AknListBoxUtils::HandleItemRemovalAndPositionHighlightL(
|
|
296 |
listbox, index, ETrue );
|
|
297 |
listbox->DrawNow();
|
|
298 |
UpdateMSK();
|
|
299 |
}
|
|
300 |
}
|
|
301 |
}
|
|
302 |
|
|
303 |
// ---------------------------------------------------------------------------
|
|
304 |
// CPSUIGSPlugin::AcceptDeletionL()
|
|
305 |
// See header for details.
|
|
306 |
// ---------------------------------------------------------------------------
|
|
307 |
//
|
|
308 |
TBool CPSUIGSPlugin::AcceptDeletionL( TInt aCount, TInt aIndex )
|
|
309 |
{
|
|
310 |
HBufC* currentName = iPSModel->SettingNameLC( aIndex );
|
|
311 |
HBufC* string = NULL;
|
|
312 |
if ( aCount == 1 )
|
|
313 |
{
|
|
314 |
string = StringLoader::LoadLC( R_QTN_PRESENCE_SETTINGS_DELETE_LAST, *currentName );
|
|
315 |
}
|
|
316 |
else
|
|
317 |
{
|
|
318 |
string = StringLoader::LoadLC( R_QTN_QUERY_COMMON_CONF_DELETE, *currentName );
|
|
319 |
}
|
|
320 |
|
|
321 |
CAknQueryDialog* query = CAknQueryDialog::NewL( CAknQueryDialog::EConfirmationTone );
|
|
322 |
TInt ok = query->ExecuteLD( R_PSUI_CONF_QUERY, *string );
|
|
323 |
|
|
324 |
CleanupStack::PopAndDestroy( 2, currentName );//currentName, string
|
|
325 |
|
|
326 |
return ( ok );
|
|
327 |
}
|
|
328 |
|
|
329 |
// ---------------------------------------------------------------------------
|
|
330 |
// CPSUIGSPlugin::GetCaptionL()
|
|
331 |
// See header for details.
|
|
332 |
// ---------------------------------------------------------------------------
|
|
333 |
//
|
|
334 |
void CPSUIGSPlugin::GetCaptionL( TDes& aCaption ) const
|
|
335 |
{
|
|
336 |
StringLoader::Load( aCaption, R_QTN_SET_FOLDER_PRESENCE );
|
|
337 |
}
|
|
338 |
|
|
339 |
// ---------------------------------------------------------------------------
|
|
340 |
// CPSUIGSPlugin::PluginProviderCategory()
|
|
341 |
// See header for details.
|
|
342 |
// ---------------------------------------------------------------------------
|
|
343 |
//
|
|
344 |
TInt CPSUIGSPlugin::PluginProviderCategory() const
|
|
345 |
{
|
|
346 |
return KGSPluginProviderInternal;
|
|
347 |
}
|
|
348 |
|
|
349 |
// ---------------------------------------------------------------------------
|
|
350 |
// CPSUIGSPlugin::CreateIconL()
|
|
351 |
// See header for details.
|
|
352 |
// ---------------------------------------------------------------------------
|
|
353 |
//
|
|
354 |
CGulIcon* CPSUIGSPlugin::CreateIconL( const TUid aIconType )
|
|
355 |
{
|
|
356 |
CGulIcon* icon = NULL;
|
|
357 |
if( aIconType == KGSIconTypeLbxItem )
|
|
358 |
{
|
|
359 |
icon = AknsUtils::CreateGulIconL(
|
|
360 |
AknsUtils::SkinInstance(),
|
|
361 |
KAknsIIDQgnPropSetConnPresence,
|
|
362 |
KPSUIGSPluginIconFileName,
|
|
363 |
EMbmPsuigspluginQgn_prop_set_conn_presence,
|
|
364 |
EMbmPsuigspluginQgn_prop_set_conn_presence_mask );
|
|
365 |
}
|
|
366 |
else
|
|
367 |
{
|
|
368 |
icon = CGSPluginInterface::CreateIconL( aIconType );
|
|
369 |
}
|
|
370 |
|
|
371 |
return icon;
|
|
372 |
}
|
|
373 |
|
|
374 |
// ---------------------------------------------------------------------------
|
|
375 |
// CPSUIGSPlugin::DynInitMenuPaneL()
|
|
376 |
// See header for details.
|
|
377 |
// ---------------------------------------------------------------------------
|
|
378 |
//
|
|
379 |
void CPSUIGSPlugin::DynInitMenuPaneL( TInt aResourceId, CEikMenuPane *aMenuPane )
|
|
380 |
{
|
|
381 |
// remove some of the items if no settings available
|
|
382 |
const TInt count = Container()->iListBox->Model()->NumberOfItems();
|
|
383 |
if ( aResourceId == R_PSUI_MAINVIEW_MENUPANE &&
|
|
384 |
0 == count )
|
|
385 |
{
|
|
386 |
aMenuPane->DeleteMenuItem( EPSUICmdEdit );
|
|
387 |
aMenuPane->DeleteMenuItem( EPSUICmdDelete );
|
|
388 |
}
|
|
389 |
if ( aResourceId == R_PSUI_NEWSETTINGS_MENU &&
|
|
390 |
0 == count )
|
|
391 |
{
|
|
392 |
aMenuPane->DeleteMenuItem( EPSUICmdNewSettingsExisting );
|
|
393 |
}
|
|
394 |
|
|
395 |
// help-item handling
|
|
396 |
if ( aResourceId == R_PSUI_MAINVIEW_MENUPANE &&
|
|
397 |
!FeatureManager::FeatureSupported( KFeatureIdHelp ) )
|
|
398 |
{
|
|
399 |
aMenuPane->DeleteMenuItem( EAknCmdHelp );
|
|
400 |
}
|
|
401 |
|
|
402 |
TInt index( KErrNotFound );
|
|
403 |
SettingCountAndIndex( index );
|
|
404 |
|
|
405 |
if ( KErrNotFound < index )
|
|
406 |
{
|
|
407 |
// Hide delete option if sip profile used with presence settings
|
|
408 |
// is registered.
|
|
409 |
if ( iPSModel->IsSipProfileRegisteredL( index ) )
|
|
410 |
{
|
|
411 |
TInt pos( KErrNotFound );
|
|
412 |
if ( aMenuPane->MenuItemExists( EPSUICmdDelete, pos ) )
|
|
413 |
{
|
|
414 |
aMenuPane->SetItemSpecific( EPSUICmdDelete, EFalse );
|
|
415 |
aMenuPane->SetItemDimmed( EPSUICmdDelete, ETrue );
|
|
416 |
}
|
|
417 |
}
|
|
418 |
else
|
|
419 |
{
|
|
420 |
TInt pos( KErrNotFound );
|
|
421 |
if ( aMenuPane->MenuItemExists( EPSUICmdDelete, pos ) )
|
|
422 |
{
|
|
423 |
aMenuPane->SetItemSpecific( EPSUICmdDelete, ETrue );
|
|
424 |
aMenuPane->SetItemDimmed( EPSUICmdDelete, EFalse );
|
|
425 |
}
|
|
426 |
}
|
|
427 |
}
|
|
428 |
}
|
|
429 |
|
|
430 |
// ---------------------------------------------------------------------------
|
|
431 |
// CPSUIGSPlugin::PSModel()
|
|
432 |
// See header for details.
|
|
433 |
// ---------------------------------------------------------------------------
|
|
434 |
//
|
|
435 |
CPSUIGSPluginModel* CPSUIGSPlugin::PSModel()
|
|
436 |
{
|
|
437 |
__ASSERT_DEBUG( iPSModel,User::Panic( KPSUIGSPluginPanicCategory, KErrNotFound ));
|
|
438 |
return iPSModel;
|
|
439 |
}
|
|
440 |
|
|
441 |
// ---------------------------------------------------------------------------
|
|
442 |
// CPSUIGSPlugin::ConstructSettingViewL()
|
|
443 |
// See header for details.
|
|
444 |
// ---------------------------------------------------------------------------
|
|
445 |
//
|
|
446 |
void CPSUIGSPlugin::ConstructSettingViewL()
|
|
447 |
{
|
|
448 |
if ( !iSettingView )
|
|
449 |
{// no view yet, construct it
|
|
450 |
CAknView* view = CPSUIGSPluginSettingView::NewL( this );
|
|
451 |
CleanupStack::PushL( view );
|
|
452 |
iAppUi->AddViewL( view );
|
|
453 |
CleanupStack::Pop( view );
|
|
454 |
iSettingView = view;
|
|
455 |
}
|
|
456 |
}
|
|
457 |
|
|
458 |
// ---------------------------------------------------------------------------
|
|
459 |
// CPSUIGSPlugin::RemoveSettingView()
|
|
460 |
// See header for details.
|
|
461 |
// ---------------------------------------------------------------------------
|
|
462 |
//
|
|
463 |
void CPSUIGSPlugin::RemoveSettingView()
|
|
464 |
{
|
|
465 |
// Remove view from iAppUi -> View is deleted by iAppUi automatically.
|
|
466 |
if ( iSettingView )
|
|
467 |
{
|
|
468 |
iAppUi->RemoveView( KPreSettingViewId );
|
|
469 |
iSettingView = NULL;
|
|
470 |
}
|
|
471 |
}
|
|
472 |
|
|
473 |
// ---------------------------------------------------------------------------
|
|
474 |
// CPSUIGSPlugin::CreateNewDefaultSettingsL()
|
|
475 |
// See header for details.
|
|
476 |
// ---------------------------------------------------------------------------
|
|
477 |
//
|
|
478 |
void CPSUIGSPlugin::CreateNewDefaultSettingsL()
|
|
479 |
{
|
|
480 |
iPSModel->CreateDefaultSettingsL();
|
|
481 |
ConstructSettingViewL();
|
|
482 |
iAppUi->ActivateLocalViewL( KPreSettingViewId );
|
|
483 |
}
|
|
484 |
|
|
485 |
// ---------------------------------------------------------------------------
|
|
486 |
// CPSUIGSPlugin::CreateCopyOfExistingSettingsL()
|
|
487 |
// See header for details.
|
|
488 |
// ---------------------------------------------------------------------------
|
|
489 |
//
|
|
490 |
void CPSUIGSPlugin::CreateCopyOfExistingSettingsL()
|
|
491 |
{
|
|
492 |
CAknSinglePopupMenuStyleListBox* list =
|
|
493 |
new ( ELeave ) CAknSinglePopupMenuStyleListBox;
|
|
494 |
CleanupStack::PushL( list );
|
|
495 |
|
|
496 |
CAknPopupList* popupList =
|
|
497 |
CAknPopupList::NewL( list, R_AVKON_SOFTKEYS_OK_CANCEL );
|
|
498 |
CleanupStack::PushL( popupList );
|
|
499 |
|
|
500 |
HBufC* title = StringLoader::LoadLC( R_QTN_PRESENCE_PROPMT_USE_EXIST );
|
|
501 |
popupList->SetTitleL( *title );
|
|
502 |
CleanupStack::PopAndDestroy( title );
|
|
503 |
|
|
504 |
list->ConstructL( popupList, CEikListBox::ELeftDownInViewRect );
|
|
505 |
list->CreateScrollBarFrameL( ETrue );
|
|
506 |
list->ScrollBarFrame()->SetScrollBarVisibilityL(
|
|
507 |
CEikScrollBarFrame::EOff,
|
|
508 |
CEikScrollBarFrame::EAuto );
|
|
509 |
|
|
510 |
CTextListBoxModel* model = list->Model();
|
|
511 |
model->SetItemTextArray( iPSModel->SettingNames() );// setting names not owned
|
|
512 |
model->SetOwnershipType( ELbmDoesNotOwnItemArray );
|
|
513 |
list->HandleItemAdditionL();
|
|
514 |
|
|
515 |
CleanupStack::Pop( popupList );
|
|
516 |
TInt keyPress = popupList->ExecuteLD();
|
|
517 |
|
|
518 |
if ( keyPress )
|
|
519 |
{
|
|
520 |
iPSModel->DuplicateExistingSettingsL( list->CurrentItemIndex() );
|
|
521 |
ConstructSettingViewL();
|
|
522 |
iAppUi->ActivateLocalViewL( KPreSettingViewId );
|
|
523 |
}
|
|
524 |
|
|
525 |
CleanupStack::PopAndDestroy( list );
|
|
526 |
}
|
|
527 |
|
|
528 |
// ---------------------------------------------------------------------------
|
|
529 |
// CPSUIGSPlugin::UpdateMSK()
|
|
530 |
// See header for details.
|
|
531 |
// ---------------------------------------------------------------------------
|
|
532 |
//
|
|
533 |
void CPSUIGSPlugin::UpdateMSK()
|
|
534 |
{
|
|
535 |
if ( !Cba() )
|
|
536 |
{
|
|
537 |
return;
|
|
538 |
}
|
|
539 |
|
|
540 |
TBool showEdit = ( 0 < Container()->iListBox->Model()->NumberOfItems());
|
|
541 |
CEikCba* cba = static_cast< CEikCba* >( Cba()->ButtonGroup() );
|
|
542 |
cba->MakeCommandVisible( EPSUICmdEdit, showEdit );
|
|
543 |
cba->DrawNow();
|
|
544 |
}
|
|
545 |
|
|
546 |
// ---------------------------------------------------------------------------
|
|
547 |
// CPSUIGSPlugin::HandleListBoxEventL()
|
|
548 |
// ---------------------------------------------------------------------------
|
|
549 |
//
|
|
550 |
void CPSUIGSPlugin::HandleListBoxEventL(
|
|
551 |
CEikListBox* /*aListBox*/, TListBoxEvent aListBoxEvent)
|
|
552 |
{
|
|
553 |
// if the Select Key has been pressed
|
|
554 |
if ((aListBoxEvent == MEikListBoxObserver::EEventEnterKeyPressed) ||
|
|
555 |
(aListBoxEvent == MEikListBoxObserver::EEventItemSingleClicked))
|
|
556 |
{
|
|
557 |
HandleListBoxSelectionL();
|
|
558 |
}
|
|
559 |
}
|
|
560 |
|
|
561 |
// End of file
|