16 */ |
16 */ |
17 |
17 |
18 #include "sifuiprivate.h" // CSifUiPrivate |
18 #include "sifuiprivate.h" // CSifUiPrivate |
19 #include "sifuicertificateinfo.h" // CSifUiCertificateInfo |
19 #include "sifuicertificateinfo.h" // CSifUiCertificateInfo |
20 #include "sifuiappinfo.h" // CSifUiAppInfo |
20 #include "sifuiappinfo.h" // CSifUiAppInfo |
|
21 #include "sifuierrorinfo.h" // CSifUiErrorInfo |
|
22 #include "sifuiinstallindicatordefinitions.h" // indicator type label and parameter names |
21 #include <hb/hbcore/hbsymbianvariant.h> // CHbSymbianVariantMap |
23 #include <hb/hbcore/hbsymbianvariant.h> // CHbSymbianVariantMap |
22 #include <hb/hbwidgets/hbdevicenotificationdialogsymbian.h> // CHbDeviceNotificationDialogSymbian |
24 #include <hb/hbwidgets/hbdevicenotificationdialogsymbian.h> // CHbDeviceNotificationDialogSymbian |
23 #include <apgicnfl.h> // CApaMaskedBitmap |
25 #include <apgicnfl.h> // CApaMaskedBitmap |
24 #include <s32mem.h> // RDesReadStream |
26 #include <s32mem.h> // RDesReadStream |
25 #include <e32property.h> // RProperty |
27 #include <e32property.h> // RProperty |
26 |
28 |
27 const TInt KDriveLettersLen = 32; |
29 const TInt KDriveLettersLen = 32; |
28 const TInt KCertificateBufferGranularity = 1024; |
30 const TInt KBufferGranularity = 1024; |
29 const TInt KProgFull = 100; // 100% |
31 const TInt KProgFull = 100; // 100% |
30 |
32 |
31 const TUid KInstallIndicatorCategory = { 0x20022FC5 }; |
33 const TUid KInstallIndicatorCategory = { 0x20022FC5 }; |
32 const TUint KInstallIndicatorStatus = 0x2002E690; |
34 const TUint KInstallIndicatorStatus = 0x2002E690; |
33 |
35 |
34 _LIT( KSifUiDefaultApplicationIcon, "qtg_large_application" ); |
36 _LIT( KSifUiDefaultApplicationIcon, "qtg_large_application" ); |
35 |
37 |
|
38 // TODO: replace with proper logging |
|
39 #ifdef _DEBUG |
|
40 #define FLOG(x) RDebug::Print(x); |
|
41 #define FLOG_1(x,y) RDebug::Print(x, y); |
|
42 #define FLOG_2(x,y,z) RDebug::Print(x, y, z); |
|
43 #define FLOG_3(x,y,z,v) RDebug::Print(x, y, z, v); |
|
44 #else |
|
45 #define FLOG(x) |
|
46 #define FLOG_1(x,y) |
|
47 #define FLOG_2(x,y,z) |
|
48 #define FLOG_3(x,y,z,v) |
|
49 #endif |
|
50 |
36 |
51 |
37 // ======== MEMBER FUNCTIONS ======== |
52 // ======== MEMBER FUNCTIONS ======== |
38 |
53 |
39 // --------------------------------------------------------------------------- |
54 // --------------------------------------------------------------------------- |
40 // CSifUiPrivate::NewL() |
55 // CSifUiPrivate::NewL() |
41 // --------------------------------------------------------------------------- |
56 // --------------------------------------------------------------------------- |
42 // |
57 // |
43 CSifUiPrivate* CSifUiPrivate::NewL() |
58 CSifUiPrivate* CSifUiPrivate::NewL() |
44 { |
59 { |
|
60 FLOG( _L("CSifUiPrivate::NewL") ); |
|
61 |
45 CSifUiPrivate* self = new( ELeave ) CSifUiPrivate(); |
62 CSifUiPrivate* self = new( ELeave ) CSifUiPrivate(); |
46 CleanupStack::PushL( self ); |
63 CleanupStack::PushL( self ); |
47 self->ConstructL(); |
64 self->ConstructL(); |
48 CleanupStack::Pop( self ); |
65 CleanupStack::Pop( self ); |
49 return self; |
66 return self; |
64 delete iSelectableDrives; |
83 delete iSelectableDrives; |
65 delete iCertificateBuffer; |
84 delete iCertificateBuffer; |
66 } |
85 } |
67 |
86 |
68 // --------------------------------------------------------------------------- |
87 // --------------------------------------------------------------------------- |
69 // CSifUiPrivate::ShowConfirmationL() |
88 // CSifUiPrivate::ShowPreparingL() |
70 // --------------------------------------------------------------------------- |
89 // --------------------------------------------------------------------------- |
71 // |
90 // |
72 TBool CSifUiPrivate::ShowConfirmationL( const CSifUiAppInfo& aAppInfo ) |
91 void CSifUiPrivate::ShowPreparingL() |
73 { |
92 { |
74 ChangeNoteTypeL( ESifUiConfirmationQuery ); |
93 // TODO: implement |
75 |
|
76 AddParamsAppInfoL( aAppInfo ); |
|
77 if( iSelectableDrives ) |
|
78 { |
|
79 AddParamL( KSifUiMemorySelection, *iSelectableDrives ); |
|
80 } |
|
81 AddParamsCertificatesL(); |
|
82 |
|
83 UpdateDialogAndWaitForResponseL(); |
|
84 return( iDialogReturnValue == KErrNone ); |
|
85 } |
94 } |
86 |
95 |
87 // --------------------------------------------------------------------------- |
96 // --------------------------------------------------------------------------- |
88 // CSifUiPrivate::SetMemorySelectionL() |
97 // CSifUiPrivate::SetMemorySelectionL() |
89 // --------------------------------------------------------------------------- |
98 // --------------------------------------------------------------------------- |
90 // |
99 // |
91 void CSifUiPrivate::SetMemorySelectionL( const RArray<TInt>& aDriveNumbers ) |
100 void CSifUiPrivate::SetMemorySelectionL( const RArray<TInt>& aDriveNumbers ) |
92 { |
101 { |
|
102 FLOG( _L("CSifUiPrivate::SetMemorySelectionL") ); |
|
103 |
93 if( iSelectableDrives ) |
104 if( iSelectableDrives ) |
94 { |
105 { |
95 delete iSelectableDrives; |
106 delete iSelectableDrives; |
96 iSelectableDrives = NULL; |
107 iSelectableDrives = NULL; |
97 } |
108 } |
103 TBuf<KDriveLettersLen> driveList; |
114 TBuf<KDriveLettersLen> driveList; |
104 for( TInt index = 0; index < driveCount; ++index ) |
115 for( TInt index = 0; index < driveCount; ++index ) |
105 { |
116 { |
106 TChar driveLetter; |
117 TChar driveLetter; |
107 TInt err = RFs::DriveToChar( aDriveNumbers[ index ], driveLetter ); |
118 TInt err = RFs::DriveToChar( aDriveNumbers[ index ], driveLetter ); |
|
119 FLOG_3( _L("CSifUiPrivate::SetMemorySelectionL, index %d, drive %d, err %d"), |
|
120 index, aDriveNumbers[ index ], err ); |
108 if( !err ) |
121 if( !err ) |
109 { |
122 { |
110 driveList.Append( driveLetter ); |
123 driveList.Append( driveLetter ); |
111 driveList.Append( KComma ); |
124 driveList.Append( KComma ); |
112 } |
125 } |
113 } |
126 } |
114 iSelectableDrives = driveList.AllocL(); |
127 iSelectableDrives = driveList.AllocL(); |
115 } |
128 } |
116 } |
129 FLOG_1( _L("CSifUiPrivate::SetMemorySelectionL, iSelectableDrives=%S"), iSelectableDrives ); |
117 |
|
118 // --------------------------------------------------------------------------- |
|
119 // CSifUiPrivate::SelectedDrive() |
|
120 // --------------------------------------------------------------------------- |
|
121 // |
|
122 TInt CSifUiPrivate::SelectedDrive( TInt& aDriveNumber ) |
|
123 { |
|
124 if( iSelectedDriveSet ) |
|
125 { |
|
126 return RFs::CharToDrive( iSelectedDrive, aDriveNumber ); |
|
127 } |
|
128 return KErrNotFound; |
|
129 } |
130 } |
130 |
131 |
131 // --------------------------------------------------------------------------- |
132 // --------------------------------------------------------------------------- |
132 // CSifUiPrivate::SetCertificateInfoL() |
133 // CSifUiPrivate::SetCertificateInfoL() |
133 // --------------------------------------------------------------------------- |
134 // --------------------------------------------------------------------------- |
134 // |
135 // |
135 void CSifUiPrivate::SetCertificateInfoL( |
136 void CSifUiPrivate::SetCertificateInfoL( |
136 const RPointerArray<CSifUiCertificateInfo>& aCertificates ) |
137 const RPointerArray<CSifUiCertificateInfo>& aCertificates ) |
137 { |
138 { |
|
139 FLOG( _L("CSifUiPrivate::SetCertificateInfoL") ); |
|
140 |
138 if( iCertificateBuffer ) |
141 if( iCertificateBuffer ) |
139 { |
142 { |
140 delete iCertificateBuffer; |
143 delete iCertificateBuffer; |
141 iCertificateBuffer = NULL; |
144 iCertificateBuffer = NULL; |
142 } |
145 } |
143 if( aCertificates.Count() ) |
146 if( aCertificates.Count() ) |
144 { |
147 { |
145 iCertificateBuffer = CBufFlat::NewL( KCertificateBufferGranularity ); |
148 iCertificateBuffer = CBufFlat::NewL( KBufferGranularity ); |
146 RBufWriteStream writeStream( *iCertificateBuffer ); |
149 RBufWriteStream writeStream( *iCertificateBuffer ); |
147 CleanupClosePushL( writeStream ); |
150 CleanupClosePushL( writeStream ); |
148 |
151 |
149 TInt32 count = aCertificates.Count(); |
152 TInt32 count = aCertificates.Count(); |
150 writeStream.WriteInt32L( count ); |
153 writeStream.WriteInt32L( count ); |
156 CleanupStack::PopAndDestroy( &writeStream ); |
159 CleanupStack::PopAndDestroy( &writeStream ); |
157 } |
160 } |
158 } |
161 } |
159 |
162 |
160 // --------------------------------------------------------------------------- |
163 // --------------------------------------------------------------------------- |
|
164 // CSifUiPrivate::ShowConfirmationL() |
|
165 // --------------------------------------------------------------------------- |
|
166 // |
|
167 TBool CSifUiPrivate::ShowConfirmationL( const CSifUiAppInfo& aAppInfo ) |
|
168 { |
|
169 FLOG( _L("CSifUiPrivate::ShowConfirmationL") ); |
|
170 |
|
171 ChangeNoteTypeL( ESifUiConfirmationQuery ); |
|
172 |
|
173 AddParamsAppInfoL( aAppInfo ); |
|
174 if( iSelectableDrives ) |
|
175 { |
|
176 AddParamL( KSifUiMemorySelection, *iSelectableDrives ); |
|
177 } |
|
178 AddParamsCertificatesL(); |
|
179 |
|
180 UpdateDialogAndWaitForResponseL(); |
|
181 return( iDialogReturnValue == KErrNone ); |
|
182 } |
|
183 |
|
184 // --------------------------------------------------------------------------- |
|
185 // CSifUiPrivate::SelectedDrive() |
|
186 // --------------------------------------------------------------------------- |
|
187 // |
|
188 TInt CSifUiPrivate::SelectedDrive( TInt& aDriveNumber ) |
|
189 { |
|
190 FLOG( _L("CSifUiPrivate::SelectedDrive") ); |
|
191 |
|
192 if( iSelectedDriveSet ) |
|
193 { |
|
194 TInt err = RFs::CharToDrive( iSelectedDrive, aDriveNumber ); |
|
195 FLOG_2( _L("CSifUiPrivate::SelectedDrive, aDriveNumber=%d, err=%d"), aDriveNumber, err ); |
|
196 return err; |
|
197 } |
|
198 FLOG( _L("CSifUiPrivate::SelectedDrive, KErrNotFound") ); |
|
199 return KErrNotFound; |
|
200 } |
|
201 |
|
202 // --------------------------------------------------------------------------- |
161 // CSifUiPrivate::ShowProgressL() |
203 // CSifUiPrivate::ShowProgressL() |
162 // --------------------------------------------------------------------------- |
204 // --------------------------------------------------------------------------- |
163 // |
205 // |
164 void CSifUiPrivate::ShowProgressL( const CSifUiAppInfo& aAppInfo, |
206 void CSifUiPrivate::ShowProgressL( const CSifUiAppInfo& aAppInfo, |
165 TInt aProgressBarFinalValue, CSifUi::TInstallingPhase aPhase ) |
207 TInt aProgressBarFinalValue, CSifUi::TInstallingPhase aPhase ) |
166 { |
208 { |
|
209 FLOG( _L("CSifUiPrivate::ShowProgressL") ); |
|
210 |
167 ChangeNoteTypeL( ESifUiProgressNote ); |
211 ChangeNoteTypeL( ESifUiProgressNote ); |
168 |
212 |
169 AddParamsAppInfoL( aAppInfo ); |
213 AddParamsAppInfoL( aAppInfo ); |
170 AddParamL( KSifUiProgressNoteFinalValue, aProgressBarFinalValue ); |
214 AddParamL( KSifUiProgressNoteFinalValue, aProgressBarFinalValue ); |
171 iProgressBarFinalValue = aProgressBarFinalValue; |
215 iProgressBarFinalValue = aProgressBarFinalValue; |
180 // CSifUiPrivate::IncreaseProgressBarValueL() |
224 // CSifUiPrivate::IncreaseProgressBarValueL() |
181 // --------------------------------------------------------------------------- |
225 // --------------------------------------------------------------------------- |
182 // |
226 // |
183 void CSifUiPrivate::IncreaseProgressBarValueL( TInt aNewValue ) |
227 void CSifUiPrivate::IncreaseProgressBarValueL( TInt aNewValue ) |
184 { |
228 { |
|
229 FLOG_1( _L("CSifUiPrivate::IncreaseProgressBarValueL, aNewValue=%d"), aNewValue ); |
|
230 |
185 ChangeNoteTypeL( ESifUiProgressNote ); |
231 ChangeNoteTypeL( ESifUiProgressNote ); |
186 |
232 |
187 AddParamL( KSifUiProgressNoteValue, aNewValue ); |
233 AddParamL( KSifUiProgressNoteValue, aNewValue ); |
188 iProgressBarCurrentValue += aNewValue; |
234 iProgressBarCurrentValue += aNewValue; |
189 AddParamsHiddenButtonsL(); |
235 AddParamsHiddenButtonsL(); |
199 { |
245 { |
200 return( iDialogReturnValue == KErrCancel ); |
246 return( iDialogReturnValue == KErrCancel ); |
201 } |
247 } |
202 |
248 |
203 // --------------------------------------------------------------------------- |
249 // --------------------------------------------------------------------------- |
|
250 // CSifUiPrivate::ShowCompleteL() |
|
251 // --------------------------------------------------------------------------- |
|
252 // |
|
253 void CSifUiPrivate::ShowCompleteL() |
|
254 { |
|
255 FLOG( _L("CSifUiPrivate::ShowCompleteL") ); |
|
256 |
|
257 ChangeNoteTypeL( ESifUiCompleteNote ); |
|
258 |
|
259 AddParamsHiddenButtonsL(); |
|
260 |
|
261 CompleteDialogOrIndicatorAndWaitForResponseL( KErrNone ); |
|
262 } |
|
263 |
|
264 // --------------------------------------------------------------------------- |
|
265 // CSifUiPrivate::ShowFailedL() |
|
266 // --------------------------------------------------------------------------- |
|
267 // |
|
268 void CSifUiPrivate::ShowFailedL( const CSifUiErrorInfo& aErrorInfo ) |
|
269 { |
|
270 FLOG_1( _L("CSifUiPrivate::ShowFailedL, aErrorCode=%d"), aErrorInfo.ErrorCode() ); |
|
271 |
|
272 ChangeNoteTypeL( ESifUiErrorNote ); |
|
273 |
|
274 AddParamL( KSifUiErrorCategory, aErrorInfo.ErrorCategory() ); |
|
275 AddParamL( KSifUiErrorCode, aErrorInfo.ErrorCode() ); |
|
276 AddParamL( KSifUiErrorCodeExtended, aErrorInfo.ExtendedErrorCode() ); |
|
277 AddParamL( KSifUiErrorMessage, aErrorInfo.ErrorMessage() ); |
|
278 AddParamL( KSifUiErrorDetails, aErrorInfo.ErrorMessageDetails() ); |
|
279 AddParamsHiddenButtonsL(); |
|
280 |
|
281 CompleteDialogOrIndicatorAndWaitForResponseL( aErrorInfo.ErrorCode() ); |
|
282 } |
|
283 |
|
284 // --------------------------------------------------------------------------- |
204 // CSifUiPrivate::SetButtonVisible() |
285 // CSifUiPrivate::SetButtonVisible() |
205 // --------------------------------------------------------------------------- |
286 // --------------------------------------------------------------------------- |
206 // |
287 // |
207 void CSifUiPrivate::SetButtonVisible( CSifUi::TOptionalButton aButton, TBool aIsVisible ) |
288 void CSifUiPrivate::SetButtonVisible( CSifUi::TOptionalButton aButton, TBool aIsVisible ) |
208 { |
289 { |
|
290 FLOG( _L("CSifUiPrivate::SetButtonVisible") ); |
|
291 |
209 switch( aButton ) |
292 switch( aButton ) |
210 { |
293 { |
211 case CSifUi::EHideProgressButton: |
294 case CSifUi::EHideProgressButton: |
212 iNoHideProgressButton = !aIsVisible; |
295 iNoHideProgressButton = !aIsVisible; |
213 break; |
296 break; |
224 break; |
307 break; |
225 } |
308 } |
226 } |
309 } |
227 |
310 |
228 // --------------------------------------------------------------------------- |
311 // --------------------------------------------------------------------------- |
229 // CSifUiPrivate::ShowCompleteL() |
312 // CSifUiPrivate::ShowGrantCapabilitiesL() |
230 // --------------------------------------------------------------------------- |
313 // --------------------------------------------------------------------------- |
231 // |
314 // |
232 void CSifUiPrivate::ShowCompleteL() |
315 TBool CSifUiPrivate::ShowGrantCapabilitiesL( const TCapabilitySet& aCapabilities ) |
233 { |
316 { |
234 ChangeNoteTypeL( ESifUiCompleteNote ); |
317 CBufFlat* buffer = CBufFlat::NewL( KBufferGranularity ); |
235 |
318 CleanupStack::PushL( buffer ); |
236 AddParamsHiddenButtonsL(); |
319 |
237 |
320 RBufWriteStream writeStream( *buffer ); |
238 CompleteDialogOrIndicatorAndWaitForResponseL( KErrNone ); |
321 CleanupClosePushL( writeStream ); |
239 } |
322 TPckg<TCapabilitySet> capabilitySetPackage( aCapabilities ); |
240 |
323 writeStream.WriteL( capabilitySetPackage ); |
241 // --------------------------------------------------------------------------- |
324 writeStream.CommitL(); |
242 // CSifUiPrivate::ShowFailedL() |
325 CleanupStack::PopAndDestroy( &writeStream ); |
243 // --------------------------------------------------------------------------- |
326 |
244 // |
327 AddParamBinaryL( KSifUiGrantCapabilities, *buffer ); |
245 void CSifUiPrivate::ShowFailedL( TInt aErrorCode, const TDesC& aErrorMessage, |
328 UpdateDialogAndWaitForResponseL(); |
246 const TDesC& aErrorDetails ) |
329 |
247 { |
330 CleanupStack::PopAndDestroy( buffer ); |
248 ChangeNoteTypeL( ESifUiErrorNote ); |
331 return( iDialogReturnValue == KErrNone ); |
249 |
332 } |
250 AddParamL( KSifUiErrorCode, aErrorCode ); |
333 |
251 AddParamL( KSifUiErrorMessage, aErrorMessage ); |
334 // --------------------------------------------------------------------------- |
252 if( aErrorDetails != KNullDesC ) |
335 // CSifUiPrivate::ShowSingleSelectionL() |
253 { |
336 // --------------------------------------------------------------------------- |
254 AddParamL( KSifUiErrorDetails, aErrorDetails ); |
337 // |
255 } |
338 TBool CSifUiPrivate::ShowSingleSelectionL( const TDesC& /*aTitle*/, |
256 |
339 const MDesCArray& /*aSelectableItems*/, TInt& aSelectedIndex ) |
257 CompleteDialogOrIndicatorAndWaitForResponseL( aErrorCode ); |
340 { |
|
341 // TODO: implement |
|
342 aSelectedIndex = 0; |
|
343 return ETrue; |
|
344 } |
|
345 |
|
346 // --------------------------------------------------------------------------- |
|
347 // CSifUiPrivate::ShowMultiSelectionL() |
|
348 // --------------------------------------------------------------------------- |
|
349 // |
|
350 TBool CSifUiPrivate::ShowMultiSelectionL( const TDesC& /*aTitle*/, |
|
351 const MDesCArray& /*aSelectableItems*/, RArray<TInt>& aSelectedIndexes ) |
|
352 { |
|
353 // TODO: implement |
|
354 aSelectedIndexes.Reset(); |
|
355 return ETrue; |
258 } |
356 } |
259 |
357 |
260 // --------------------------------------------------------------------------- |
358 // --------------------------------------------------------------------------- |
261 // CSifUiPrivate::DoCancel() |
359 // CSifUiPrivate::DoCancel() |
262 // --------------------------------------------------------------------------- |
360 // --------------------------------------------------------------------------- |
263 // |
361 // |
264 void CSifUiPrivate::DoCancel() |
362 void CSifUiPrivate::DoCancel() |
265 { |
363 { |
|
364 FLOG( _L("CSifUiPrivate::DoCancel") ); |
|
365 |
266 if( iWait && iWait->IsStarted() && iWait->CanStopNow() ) |
366 if( iWait && iWait->IsStarted() && iWait->CanStopNow() ) |
267 { |
367 { |
268 iWaitCompletionCode = KErrCancel; |
368 iWaitCompletionCode = KErrCancel; |
269 iWait->AsyncStop(); |
369 iWait->AsyncStop(); |
270 } |
370 } |
286 // CSifUiPrivate::DataReceived() |
388 // CSifUiPrivate::DataReceived() |
287 // --------------------------------------------------------------------------- |
389 // --------------------------------------------------------------------------- |
288 // |
390 // |
289 void CSifUiPrivate::DataReceived( CHbSymbianVariantMap& aData ) |
391 void CSifUiPrivate::DataReceived( CHbSymbianVariantMap& aData ) |
290 { |
392 { |
|
393 FLOG( _L("CSifUiPrivate::DataReceived") ); |
|
394 |
291 const CHbSymbianVariant* selectedDriveVariant = aData.Get( KSifUiSelectedMemory ); |
395 const CHbSymbianVariant* selectedDriveVariant = aData.Get( KSifUiSelectedMemory ); |
292 if( selectedDriveVariant ) |
396 if( selectedDriveVariant ) |
293 { |
397 { |
294 iSelectedDrive = *( selectedDriveVariant->Value<TChar>() ); |
398 iSelectedDrive = *( selectedDriveVariant->Value<TChar>() ); |
295 iSelectedDriveSet = ETrue; |
399 iSelectedDriveSet = ETrue; |
|
400 FLOG_1( _L("CSifUiPrivate::DataReceived, iSelectedDrive=%d"), (TUint)iSelectedDrive ); |
296 } |
401 } |
297 |
402 |
298 const CHbSymbianVariant* variant = aData.Get( KSifUiQueryReturnValue ); |
403 const CHbSymbianVariant* variant = aData.Get( KSifUiQueryReturnValue ); |
299 if( variant ) |
404 if( variant ) |
300 { |
405 { |
332 // CSifUiPrivate::DeviceDialogClosed() |
437 // CSifUiPrivate::DeviceDialogClosed() |
333 // --------------------------------------------------------------------------- |
438 // --------------------------------------------------------------------------- |
334 // |
439 // |
335 void CSifUiPrivate::DeviceDialogClosed( TInt aCompletionCode ) |
440 void CSifUiPrivate::DeviceDialogClosed( TInt aCompletionCode ) |
336 { |
441 { |
|
442 FLOG_1( _L("CSifUiPrivate::DeviceDialogClosed, aCompletionCode=%d"), aCompletionCode ); |
|
443 |
337 iIsDisplayingDialog = EFalse; |
444 iIsDisplayingDialog = EFalse; |
338 WaitedResponseReceived( aCompletionCode ); |
445 WaitedResponseReceived( aCompletionCode ); |
339 } |
446 } |
340 |
447 |
341 // --------------------------------------------------------------------------- |
448 // --------------------------------------------------------------------------- |
343 // --------------------------------------------------------------------------- |
450 // --------------------------------------------------------------------------- |
344 // |
451 // |
345 void CSifUiPrivate::IndicatorUserActivated( const TDesC& aType, |
452 void CSifUiPrivate::IndicatorUserActivated( const TDesC& aType, |
346 CHbSymbianVariantMap& /*aData*/ ) |
453 CHbSymbianVariantMap& /*aData*/ ) |
347 { |
454 { |
|
455 FLOG( _L("CSifUiPrivate::IndicatorUserActivated") ); |
|
456 |
348 if( aType == KSifUiInstallIndicatorType ) |
457 if( aType == KSifUiInstallIndicatorType ) |
349 { |
458 { |
350 CloseInstallIndicator(); |
459 CloseInstallIndicator(); |
351 iIsFirstTimeToDisplay = ETrue; |
460 iIsFirstTimeToDisplay = ETrue; |
352 TRAP_IGNORE( DisplayDeviceDialogL() ); |
461 TRAP_IGNORE( DisplayDeviceDialogL() ); |
443 variant = CHbSymbianVariant::NewL( &aList, CHbSymbianVariant::EDesArray ); |
552 variant = CHbSymbianVariant::NewL( &aList, CHbSymbianVariant::EDesArray ); |
444 User::LeaveIfError( VariantMapL()->Add( aKey, variant ) ); |
553 User::LeaveIfError( VariantMapL()->Add( aKey, variant ) ); |
445 } |
554 } |
446 |
555 |
447 // --------------------------------------------------------------------------- |
556 // --------------------------------------------------------------------------- |
|
557 // CSifUiPrivate::AddParamBinaryL() |
|
558 // --------------------------------------------------------------------------- |
|
559 // |
|
560 void CSifUiPrivate::AddParamBinaryL( const TDesC& aKey, const CBufBase& aBinary ) |
|
561 { |
|
562 CHbSymbianVariant* variant = NULL; |
|
563 const TPtrC8 ptr( const_cast<CBufBase&>( aBinary ).Ptr( 0 ).Ptr(), aBinary.Size() ); |
|
564 variant = CHbSymbianVariant::NewL( &ptr, CHbSymbianVariant::EBinary ); |
|
565 CleanupStack::PushL( variant ); |
|
566 User::LeaveIfError( VariantMapL()->Add( aKey, variant ) ); |
|
567 CleanupStack::Pop( variant ); |
|
568 } |
|
569 |
|
570 // --------------------------------------------------------------------------- |
448 // CSifUiPrivate::AddParamsAppInfoL() |
571 // CSifUiPrivate::AddParamsAppInfoL() |
449 // --------------------------------------------------------------------------- |
572 // --------------------------------------------------------------------------- |
450 // |
573 // |
451 void CSifUiPrivate::AddParamsAppInfoL( const CSifUiAppInfo& aAppInfo ) |
574 void CSifUiPrivate::AddParamsAppInfoL( const CSifUiAppInfo& aAppInfo ) |
452 { |
575 { |
453 AddParamL( KSifUiApplicationName, aAppInfo.Name() ); |
576 AddParamL( KSifUiApplicationName, aAppInfo.Name() ); |
454 const TVersion& version( aAppInfo.Version() ); |
577 const TVersion& version( aAppInfo.Version() ); |
455 if( version.iBuild || version.iMajor || version.iMinor ) |
578 if( version.iMajor || version.iMinor ) |
456 { |
579 { |
457 AddParamL( KSifUiApplicationVersion, version.Name() ); |
580 TVersionName versionName; |
|
581 versionName.AppendNum( version.iMajor ); |
|
582 versionName.Append( TChar('.') ); |
|
583 versionName.AppendNum( version.iMinor ); |
|
584 AddParamL( KSifUiApplicationVersion, versionName ); |
458 } |
585 } |
459 if( aAppInfo.Vendor().Length() ) |
586 if( aAppInfo.Vendor().Length() ) |
460 { |
587 { |
461 AddParamL( KSifUiApplicationDetails, aAppInfo.Vendor() ); |
588 AddParamL( KSifUiApplicationDetails, aAppInfo.Vendor() ); |
462 } |
589 } |
483 // |
610 // |
484 void CSifUiPrivate::AddParamsCertificatesL() |
611 void CSifUiPrivate::AddParamsCertificatesL() |
485 { |
612 { |
486 if( iCertificateBuffer ) |
613 if( iCertificateBuffer ) |
487 { |
614 { |
488 const TPtrC8 dataPtr( iCertificateBuffer->Ptr( 0 ).Ptr(), |
615 AddParamBinaryL( KSifUiCertificates, *iCertificateBuffer ); |
489 iCertificateBuffer->Size() ); |
|
490 CHbSymbianVariant* certificates = CHbSymbianVariant::NewL( &dataPtr, |
|
491 CHbSymbianVariant::EBinary ); |
|
492 CleanupStack::PushL( certificates ); |
|
493 User::LeaveIfError( VariantMapL()->Add( KSifUiCertificates, certificates ) ); |
|
494 CleanupStack::Pop( certificates ); |
|
495 } |
616 } |
496 } |
617 } |
497 |
618 |
498 // --------------------------------------------------------------------------- |
619 // --------------------------------------------------------------------------- |
499 // CSifUiPrivate::AddParamsHiddenButtonsL() |
620 // CSifUiPrivate::AddParamsHiddenButtonsL() |