51
|
1 |
/*
|
|
2 |
* Copyright (c) 2009 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:
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#include "MemSpyViewHeapTrackingSettings.h"
|
|
19 |
|
|
20 |
// System includes
|
|
21 |
#include <hal.h>
|
|
22 |
#ifdef __EPOC32__
|
|
23 |
#include <e32rom.h>
|
|
24 |
#endif
|
|
25 |
#include <AknQueryDialog.h>
|
|
26 |
|
|
27 |
// Engine includes
|
|
28 |
#include <memspy/engine/memspyengine.h>
|
|
29 |
#include <memspy/engine/memspyengineobjectprocess.h>
|
|
30 |
#include <memspy/engine/memspyengineobjectthread.h>
|
|
31 |
#include <memspy/engine/memspyengineobjectcontainer.h>
|
|
32 |
#include <memspy/engine/memspyengineobjectthreadinfoobjects.h>
|
|
33 |
#include <memspy/engine/memspyengineobjectthreadinfocontainer.h>
|
|
34 |
#include <memspy/engine/memspyenginehelpersysmemtracker.h>
|
|
35 |
#include <memspy/engine/memspyenginehelpersysmemtrackerconfig.h>
|
|
36 |
#include <memspyui.rsg>
|
|
37 |
#include <memspysession.h>
|
|
38 |
|
|
39 |
// User includes
|
|
40 |
#include "MemSpyUiUtils.h"
|
|
41 |
#include "MemSpySettings.h"
|
|
42 |
#include "MemSpyViewHeapTracking.h"
|
|
43 |
#include "MemSpyContainerObserver.h"
|
|
44 |
|
|
45 |
/*
|
|
46 |
CMemSpyViewHeapTrackingSettings::CMemSpyViewHeapTrackingSettings( CMemSpyEngine& aEngine, MMemSpyViewObserver& aObserver )
|
|
47 |
: CMemSpyViewBase( aEngine, aObserver )
|
|
48 |
{
|
|
49 |
}
|
|
50 |
*/
|
|
51 |
CMemSpyViewHeapTrackingSettings::CMemSpyViewHeapTrackingSettings( RMemSpySession& aSession, MMemSpyViewObserver& aObserver )
|
|
52 |
: CMemSpyViewBase( aSession, aObserver )
|
|
53 |
{
|
|
54 |
}
|
|
55 |
|
|
56 |
|
|
57 |
CMemSpyViewHeapTrackingSettings::~CMemSpyViewHeapTrackingSettings()
|
|
58 |
{
|
|
59 |
}
|
|
60 |
|
|
61 |
|
|
62 |
void CMemSpyViewHeapTrackingSettings::ConstructL( const TRect& aRect, CCoeControl& aContainer, TAny* aSelectionRune )
|
|
63 |
{
|
|
64 |
_LIT( KTitle, "Settings" );
|
|
65 |
SetTitleL( KTitle );
|
|
66 |
//
|
|
67 |
CMemSpyViewBase::ConstructL( aRect, aContainer, aSelectionRune );
|
|
68 |
}
|
|
69 |
|
|
70 |
|
|
71 |
void CMemSpyViewHeapTrackingSettings::RefreshL()
|
|
72 |
{
|
|
73 |
SetListBoxModelL();
|
|
74 |
CMemSpyViewBase::SizeChanged();
|
|
75 |
CMemSpyViewBase::RefreshL();
|
|
76 |
}
|
|
77 |
|
|
78 |
|
|
79 |
TMemSpyViewType CMemSpyViewHeapTrackingSettings::ViewType() const
|
|
80 |
{
|
|
81 |
return EMemSpyViewTypeHeapTrackingSettings;
|
|
82 |
}
|
|
83 |
|
|
84 |
|
|
85 |
CMemSpyViewBase* CMemSpyViewHeapTrackingSettings::PrepareParentViewL()
|
|
86 |
{
|
|
87 |
CMemSpyViewHeapTracking* parent = new(ELeave) CMemSpyViewHeapTracking( iMemSpySession, iObserver );
|
|
88 |
CleanupStack::PushL( parent );
|
|
89 |
parent->ConstructL( Rect(), *Parent(), (TAny*) ViewType() );
|
|
90 |
CleanupStack::Pop( parent );
|
|
91 |
return parent;
|
|
92 |
}
|
|
93 |
|
|
94 |
|
|
95 |
CMemSpyViewBase* CMemSpyViewHeapTrackingSettings::PrepareChildViewL()
|
|
96 |
{
|
|
97 |
const TInt index = iListBox->CurrentItemIndex();
|
|
98 |
|
|
99 |
// Get current config
|
|
100 |
TMemSpyEngineHelperSysMemTrackerConfig config;
|
|
101 |
GetSwmtConfig( config );
|
|
102 |
|
|
103 |
// This view abuses the child view callback to toggle field values and/or
|
|
104 |
// display settings dialogs.
|
|
105 |
if ( index == 0 )
|
|
106 |
{
|
|
107 |
TInt period = config.iTimerPeriod.Int() / 1000000;
|
|
108 |
CAknNumberQueryDialog* dialog = new(ELeave) CAknNumberQueryDialog( period );
|
|
109 |
if ( dialog->ExecuteLD( R_MEMSPY_HEAP_TRACKER_TIMER_PERIOD ) )
|
|
110 |
{
|
|
111 |
config.iTimerPeriod = period * 1000000;
|
|
112 |
}
|
|
113 |
}
|
|
114 |
else if ( index == 1 )
|
|
115 |
{
|
|
116 |
TInt categories( config.iEnabledCategories );
|
|
117 |
CSWMTCategorySelectionCheckBoxSettingItem* settingItem = new (ELeave) CSWMTCategorySelectionCheckBoxSettingItem( 0, categories );
|
|
118 |
CleanupStack::PushL( settingItem );
|
|
119 |
settingItem->ConstructL( EFalse,
|
|
120 |
0,
|
|
121 |
_L("SWMT Categories"),
|
|
122 |
NULL,
|
|
123 |
R_MEMSPYUI_SWMT_CATEGORIES_SETTING_PAGE,
|
|
124 |
EAknCtPopupSettingList,
|
|
125 |
NULL,
|
|
126 |
NULL );
|
|
127 |
|
|
128 |
CMemSpySWMTCategorySelectionCheckBoxSettingPage* dlg = new(ELeave) CMemSpySWMTCategorySelectionCheckBoxSettingPage( R_MEMSPYUI_SWMT_CATEGORIES_SETTING_PAGE, settingItem->ItemArray() );
|
|
129 |
dlg->SetSettingPageObserver( settingItem );
|
|
130 |
if ( dlg->ExecuteLD( CAknSettingPage::EUpdateWhenChanged ) )
|
|
131 |
{
|
|
132 |
config.iEnabledCategories = categories;
|
|
133 |
}
|
|
134 |
CleanupStack::PopAndDestroy( settingItem );
|
|
135 |
}
|
|
136 |
else if ( index == 2 )
|
|
137 |
{
|
|
138 |
config.iDumpData = !config.iDumpData;
|
|
139 |
}
|
|
140 |
else if ( index == 3 )
|
|
141 |
{
|
|
142 |
TName nameFilter;
|
|
143 |
nameFilter.Copy( config.iThreadNameFilter );
|
|
144 |
CMemSpyAllowEmptyDataDialog* dialog = new (ELeave) CMemSpyAllowEmptyDataDialog( nameFilter );
|
|
145 |
if ( dialog->ExecuteLD( R_MEMSPY_HEAP_TRACKER_NAME_FILTER ) )
|
|
146 |
{
|
|
147 |
config.iThreadNameFilter = nameFilter;
|
|
148 |
}
|
|
149 |
}
|
|
150 |
|
|
151 |
// Push changes to SWMT
|
|
152 |
SetSwmtConfig( config );
|
|
153 |
Settings().StoreSettingsL();
|
|
154 |
|
|
155 |
RefreshL();
|
|
156 |
return NULL;
|
|
157 |
}
|
|
158 |
|
|
159 |
|
|
160 |
void CMemSpyViewHeapTrackingSettings::SetListBoxModelL()
|
|
161 |
{
|
|
162 |
CDesCArrayFlat* model = new(ELeave) CDesCArrayFlat(5);
|
|
163 |
CleanupStack::PushL( model );
|
|
164 |
|
|
165 |
TBuf<KMaxFullName + 1> item;
|
|
166 |
|
|
167 |
// Get current config
|
|
168 |
TMemSpyEngineHelperSysMemTrackerConfig config;
|
|
169 |
GetSwmtConfig( config );
|
|
170 |
|
|
171 |
// 1st item
|
|
172 |
_LIT( KItem1Format, "\tTracking timer period\t\t%d (sec)" );
|
|
173 |
item.Format( KItem1Format, config.iTimerPeriod.Int() / 1000000 );
|
|
174 |
model->AppendL( item );
|
|
175 |
|
|
176 |
// 2nd item
|
|
177 |
_LIT( KItem3Format, "\tCategories\t\t%d selected" );
|
|
178 |
|
|
179 |
TInt count(0);
|
|
180 |
for( TInt bit = TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryWindowGroups; bit > 0; bit = bit >> 1 )
|
|
181 |
{
|
|
182 |
if ( bit & config.iEnabledCategories )
|
|
183 |
{
|
|
184 |
count++;
|
|
185 |
}
|
|
186 |
}
|
|
187 |
|
|
188 |
item.Format( KItem3Format, count );
|
|
189 |
model->AppendL( item );
|
|
190 |
|
|
191 |
// following items are related only to User Heap category,
|
|
192 |
// so hide them if User Heap is not selected
|
|
193 |
if ( config.iEnabledCategories & TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryUserHeap )
|
|
194 |
{
|
|
195 |
// 3th item
|
|
196 |
_LIT( KItem2Format, "\tDump data" );
|
|
197 |
PrepareItemBufL( item, KItem2Format, config.iDumpData, config.iEnabledCategories & TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryUserHeap && config.iThreadNameFilter.Length() > 0 );
|
|
198 |
model->AppendL( item );
|
|
199 |
|
|
200 |
// 4th item
|
|
201 |
if ( config.iDumpData )
|
|
202 |
{
|
|
203 |
_LIT( KItem4Format, "\tHeap data thread filter\t\t%S" );
|
|
204 |
if ( config.iThreadNameFilter.Length() > 0 )
|
|
205 |
{
|
|
206 |
item.Format( KItem4Format, &config.iThreadNameFilter );
|
|
207 |
}
|
|
208 |
else
|
|
209 |
{
|
|
210 |
item.Format( KItem4Format, &_L("No filtering") );
|
|
211 |
}
|
|
212 |
model->AppendL( item );
|
|
213 |
}
|
|
214 |
}
|
|
215 |
|
|
216 |
// Set up list box
|
|
217 |
CAknSettingStyleListBox* listbox = static_cast< CAknSettingStyleListBox* >( iListBox );
|
|
218 |
listbox->Model()->SetItemTextArray( model );
|
|
219 |
listbox->Model()->SetOwnershipType( ELbmOwnsItemArray );
|
|
220 |
CleanupStack::Pop( model );
|
|
221 |
}
|
|
222 |
|
|
223 |
|
|
224 |
void CMemSpyViewHeapTrackingSettings::PrepareItemBufL( TDes& aBuf, const TDesC& aCaption, TBool aStatus, TBool aHeapCategorySelected )
|
|
225 |
{
|
|
226 |
aBuf.Copy( aCaption );
|
|
227 |
//
|
|
228 |
if ( aStatus )
|
|
229 |
{
|
|
230 |
if ( aHeapCategorySelected )
|
|
231 |
{
|
|
232 |
_LIT( KItemEnabled, "\t\tCustom" );
|
|
233 |
aBuf.Append( KItemEnabled );
|
|
234 |
}
|
|
235 |
else
|
|
236 |
{
|
|
237 |
_LIT( KItemEnabled, "\t\tAll user heaps" );
|
|
238 |
aBuf.Append( KItemEnabled );
|
|
239 |
}
|
|
240 |
}
|
|
241 |
else
|
|
242 |
{
|
|
243 |
_LIT( KItemDisabled, "\t\tDisabled" );
|
|
244 |
aBuf.Append( KItemDisabled );
|
|
245 |
}
|
|
246 |
}
|
|
247 |
|
|
248 |
void CMemSpyViewHeapTrackingSettings::GetSwmtConfig( TMemSpyEngineHelperSysMemTrackerConfig& aConfig )
|
|
249 |
{
|
|
250 |
TMemSpyEngineHelperSysMemTrackerConfig::TMemSpyEngineSysMemTrackerMode mode;
|
|
251 |
iMemSpySession.GetSwmtMode( mode );
|
|
252 |
aConfig.iMode = mode;
|
|
253 |
|
|
254 |
TInt categories = 0;
|
|
255 |
iMemSpySession.GetSwmtCategoriesL( categories );
|
|
256 |
aConfig.iEnabledCategories = categories;
|
|
257 |
|
|
258 |
TInt timerPeriod = 0;
|
|
259 |
iMemSpySession.GetSwmtTimerIntervalL( timerPeriod );
|
|
260 |
aConfig.iTimerPeriod = timerPeriod;
|
|
261 |
|
|
262 |
TBool dumpData = EFalse;
|
|
263 |
iMemSpySession.GetSwmtHeapDumpsEnabledL( dumpData );
|
|
264 |
aConfig.iDumpData = dumpData;
|
|
265 |
|
|
266 |
TName threadNameFilter;
|
|
267 |
iMemSpySession.GetSwmtFilter( threadNameFilter );
|
|
268 |
aConfig.iThreadNameFilter = threadNameFilter;
|
|
269 |
}
|
|
270 |
|
|
271 |
void CMemSpyViewHeapTrackingSettings::SetSwmtConfig( TMemSpyEngineHelperSysMemTrackerConfig& aConfig )
|
|
272 |
{
|
|
273 |
iMemSpySession.SetSwmtMode( aConfig.iMode );
|
|
274 |
iMemSpySession.SetSwmtCategoriesL( aConfig.iEnabledCategories );
|
|
275 |
iMemSpySession.SetSwmtTimerIntervalL( aConfig.iTimerPeriod.Int() );
|
|
276 |
iMemSpySession.SetSwmtHeapDumpsEnabledL( aConfig.iDumpData );
|
|
277 |
iMemSpySession.SetSwmtFilter( aConfig.iThreadNameFilter );
|
|
278 |
}
|
|
279 |
|
|
280 |
|
|
281 |
|
|
282 |
|
|
283 |
|
|
284 |
|
|
285 |
|
|
286 |
|
|
287 |
|
|
288 |
|
|
289 |
// --------------------------------------------------------------------------------------------
|
|
290 |
|
|
291 |
CSWMTCategorySelectionCheckBoxSettingItem::CSWMTCategorySelectionCheckBoxSettingItem( TInt aIdentifier, TInt& aCategories ):
|
|
292 |
CAknSettingItem(aIdentifier), iExtCategories( aCategories )
|
|
293 |
{
|
|
294 |
}
|
|
295 |
|
|
296 |
|
|
297 |
CSWMTCategorySelectionCheckBoxSettingItem::~CSWMTCategorySelectionCheckBoxSettingItem()
|
|
298 |
{
|
|
299 |
delete iSettingText;
|
|
300 |
if( iItemArray )
|
|
301 |
{
|
|
302 |
iItemArray->ResetAndDestroy();
|
|
303 |
delete iItemArray;
|
|
304 |
}
|
|
305 |
}
|
|
306 |
|
|
307 |
|
|
308 |
CSelectionItemList* CSWMTCategorySelectionCheckBoxSettingItem::ItemArray() const
|
|
309 |
{
|
|
310 |
return iItemArray;
|
|
311 |
}
|
|
312 |
|
|
313 |
|
|
314 |
void CSWMTCategorySelectionCheckBoxSettingItem::AddNewItemToArrayL(const TDesC& aLabel)
|
|
315 |
{
|
|
316 |
TBuf<64> buf;
|
|
317 |
buf.Copy( aLabel );
|
|
318 |
CSelectableItem* item = new (ELeave) CSelectableItem( buf, EFalse );
|
|
319 |
CleanupStack::PushL( item );
|
|
320 |
item->ConstructL();
|
|
321 |
iItemArray->AppendL( item ); // Ownership is transferred
|
|
322 |
CleanupStack::Pop(); // item
|
|
323 |
}
|
|
324 |
|
|
325 |
|
|
326 |
void CSWMTCategorySelectionCheckBoxSettingItem::CompleteConstructionL()
|
|
327 |
{
|
|
328 |
SetEmptyItemTextL(_L("Nothing selected"));
|
|
329 |
iItemArray = new(ELeave) CSelectionItemList(16);
|
|
330 |
AddNewItemToArrayL( _L("User Heap") ); // 0
|
|
331 |
AddNewItemToArrayL( _L("Kernel Heap") ); // 1
|
|
332 |
AddNewItemToArrayL( _L("User Stacks") ); // 2
|
|
333 |
AddNewItemToArrayL( _L("Global Data") ); // 3
|
|
334 |
AddNewItemToArrayL( _L("Disk Usage") ); // 4
|
|
335 |
AddNewItemToArrayL( _L("Open Files") ); // 5
|
|
336 |
AddNewItemToArrayL( _L("RAM-loaded Code") ); // 6
|
|
337 |
AddNewItemToArrayL( _L("System Memory") ); // 7
|
|
338 |
AddNewItemToArrayL( _L("Local Chunks") ); // 8
|
|
339 |
AddNewItemToArrayL( _L("Global Chunks") ); // 9
|
|
340 |
AddNewItemToArrayL( _L("RAM Drive") ); // 10
|
|
341 |
AddNewItemToArrayL( _L("FileServer Cache") );// 11
|
|
342 |
AddNewItemToArrayL( _L("Kernel Handles") ); // 12
|
|
343 |
AddNewItemToArrayL( _L("Bitmap Handles") ); // 13
|
|
344 |
AddNewItemToArrayL( _L("Window Groups") ); // 14
|
|
345 |
}
|
|
346 |
|
|
347 |
|
|
348 |
void CSWMTCategorySelectionCheckBoxSettingItem::StoreL()
|
|
349 |
{
|
|
350 |
iExtCategories = 0;
|
|
351 |
if ( iItemArray->At( 11 )->SelectionStatus() )
|
|
352 |
iExtCategories |= TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryFileServerCache;
|
|
353 |
if ( iItemArray->At( 13 )->SelectionStatus() )
|
|
354 |
iExtCategories |= TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryBitmapHandles;
|
|
355 |
if ( iItemArray->At( 0 )->SelectionStatus() )
|
|
356 |
iExtCategories |= TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryUserHeap;
|
|
357 |
if ( iItemArray->At( 1 )->SelectionStatus() )
|
|
358 |
iExtCategories |= TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryKernelHeap;
|
|
359 |
if ( iItemArray->At( 8 )->SelectionStatus() )
|
|
360 |
iExtCategories |= TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryLocalChunks;
|
|
361 |
if ( iItemArray->At( 9 )->SelectionStatus() )
|
|
362 |
iExtCategories |= TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryGlobalChunks;
|
|
363 |
if ( iItemArray->At( 10 )->SelectionStatus() )
|
|
364 |
iExtCategories |= TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryRAMDrive;
|
|
365 |
if ( iItemArray->At( 2 )->SelectionStatus() )
|
|
366 |
iExtCategories |= TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryUserStacks;
|
|
367 |
if ( iItemArray->At( 3 )->SelectionStatus() )
|
|
368 |
iExtCategories |= TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryGlobalData;
|
|
369 |
if ( iItemArray->At( 6 )->SelectionStatus() )
|
|
370 |
iExtCategories |= TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryRAMLoadedCode;
|
|
371 |
if ( iItemArray->At( 12 )->SelectionStatus() )
|
|
372 |
iExtCategories |= TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryKernelHandles;
|
|
373 |
if ( iItemArray->At( 5 )->SelectionStatus() )
|
|
374 |
iExtCategories |= TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryOpenFiles;
|
|
375 |
if ( iItemArray->At( 4 )->SelectionStatus() )
|
|
376 |
iExtCategories |= TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryDiskusage;
|
|
377 |
if ( iItemArray->At( 7 )->SelectionStatus() )
|
|
378 |
iExtCategories |= TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategorySystemMemory;
|
|
379 |
if ( iItemArray->At( 14 )->SelectionStatus() )
|
|
380 |
iExtCategories |= TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryWindowGroups;
|
|
381 |
}
|
|
382 |
|
|
383 |
|
|
384 |
void CSWMTCategorySelectionCheckBoxSettingItem::LoadL()
|
|
385 |
{
|
|
386 |
iItemArray->At( 11 )->SetSelectionStatus( iExtCategories & TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryFileServerCache );
|
|
387 |
iItemArray->At( 13 )->SetSelectionStatus( iExtCategories & TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryBitmapHandles );
|
|
388 |
iItemArray->At( 0 )->SetSelectionStatus( iExtCategories & TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryUserHeap );
|
|
389 |
iItemArray->At( 1 )->SetSelectionStatus( iExtCategories & TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryKernelHeap );
|
|
390 |
iItemArray->At( 8 )->SetSelectionStatus( iExtCategories & TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryLocalChunks );
|
|
391 |
iItemArray->At( 9 )->SetSelectionStatus( iExtCategories & TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryGlobalChunks );
|
|
392 |
iItemArray->At( 10 )->SetSelectionStatus( iExtCategories & TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryRAMDrive );
|
|
393 |
iItemArray->At( 2 )->SetSelectionStatus( iExtCategories & TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryUserStacks );
|
|
394 |
iItemArray->At( 3 )->SetSelectionStatus( iExtCategories & TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryGlobalData );
|
|
395 |
iItemArray->At( 6 )->SetSelectionStatus( iExtCategories & TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryRAMLoadedCode );
|
|
396 |
iItemArray->At( 12 )->SetSelectionStatus( iExtCategories & TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryKernelHandles );
|
|
397 |
iItemArray->At( 5 )->SetSelectionStatus( iExtCategories & TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryOpenFiles );
|
|
398 |
iItemArray->At( 4 )->SetSelectionStatus( iExtCategories & TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryDiskusage );
|
|
399 |
iItemArray->At( 7 )->SetSelectionStatus( iExtCategories & TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategorySystemMemory );
|
|
400 |
iItemArray->At( 14 )->SetSelectionStatus( iExtCategories & TMemSpyEngineHelperSysMemTrackerConfig::EMemSpyEngineSysMemTrackerCategoryWindowGroups );
|
|
401 |
}
|
|
402 |
|
|
403 |
|
|
404 |
void CSWMTCategorySelectionCheckBoxSettingItem::HandleSettingPageEventL( CAknSettingPage* aSettingPage, TAknSettingPageEvent aEventType )
|
|
405 |
{
|
|
406 |
switch( aEventType )
|
|
407 |
{
|
|
408 |
case EEventSettingOked:
|
|
409 |
{
|
|
410 |
// If settings oked, save new values
|
|
411 |
StoreL();
|
|
412 |
break;
|
|
413 |
}
|
|
414 |
case EEventSettingCancelled:
|
|
415 |
{
|
|
416 |
// If setting is cancelled, load old values
|
|
417 |
LoadL();
|
|
418 |
break;
|
|
419 |
}
|
|
420 |
case EEventSettingChanged:
|
|
421 |
{
|
|
422 |
// If setting has changed, update CBA visibility
|
|
423 |
static_cast<CMemSpySWMTCategorySelectionCheckBoxSettingPage*>( aSettingPage )->UpdateCba();
|
|
424 |
break;
|
|
425 |
}
|
|
426 |
default:
|
|
427 |
{
|
|
428 |
break;
|
|
429 |
}
|
|
430 |
}
|
|
431 |
CAknSettingItem::HandleSettingPageEventL( aSettingPage, aEventType );
|
|
432 |
}
|
|
433 |
|
|
434 |
|
|
435 |
CMemSpySWMTCategorySelectionCheckBoxSettingPage::CMemSpySWMTCategorySelectionCheckBoxSettingPage(TInt aResourceID, CSelectionItemList* aItemArray )
|
|
436 |
: CAknCheckBoxSettingPage( aResourceID, aItemArray )
|
|
437 |
{
|
|
438 |
}
|
|
439 |
|
|
440 |
|
|
441 |
void CMemSpySWMTCategorySelectionCheckBoxSettingPage::UpdateCba()
|
|
442 |
{
|
|
443 |
// Cache the pointer to button group container
|
|
444 |
CEikButtonGroupContainer* cba = Cba();
|
|
445 |
// Left softkey should be visible if there are items selected,
|
|
446 |
// i.e. the selection index array has items.
|
|
447 |
TBool visible( ListBoxControl()->View()->SelectionIndexes()->Count() > 0 );
|
|
448 |
// Resolve left softkey command id
|
|
449 |
TInt leftId( cba->ButtonGroup()->CommandId( 0 ) );
|
|
450 |
// Check if left softkey visibility has changed
|
|
451 |
if( visible != cba->IsCommandVisible( leftId ) )
|
|
452 |
{
|
|
453 |
// Left softkey visibility has changed, update it
|
|
454 |
cba->MakeCommandVisible( leftId, visible );
|
|
455 |
}
|
|
456 |
}
|
|
457 |
|
|
458 |
|
|
459 |
|
|
460 |
|
|
461 |
CMemSpyAllowEmptyDataDialog::CMemSpyAllowEmptyDataDialog( TDes& aText, const TTone& aTone )
|
|
462 |
: CAknTextQueryDialog( aText, aTone )
|
|
463 |
{
|
|
464 |
}
|
|
465 |
|
|
466 |
|
|
467 |
void CMemSpyAllowEmptyDataDialog::UpdateLeftSoftKeyL()
|
|
468 |
{
|
|
469 |
MakeLeftSoftkeyVisible( ETrue );
|
|
470 |
}
|