120 |
137 |
121 CleanupStack::PopAndDestroy( 3, &appNames ); // data, appIcons, appNames |
138 CleanupStack::PopAndDestroy( 3, &appNames ); // data, appIcons, appNames |
122 } |
139 } |
123 |
140 |
124 // --------------------------------------------------------------------------- |
141 // --------------------------------------------------------------------------- |
|
142 // CSisxSifPluginUiHandlerBase::PublishStartL() |
|
143 // --------------------------------------------------------------------------- |
|
144 // |
|
145 void CSisxSifPluginUiHandlerBase::PublishStartL( const CComponentEntry& aEntry ) |
|
146 { |
|
147 RPointerArray<HBufC> appNames; |
|
148 CleanupResetAndDestroyPushL( appNames ); |
|
149 RPointerArray<HBufC> appIcons; |
|
150 CleanupResetAndDestroyPushL( appIcons ); |
|
151 |
|
152 if( iGlobalComponentId ) |
|
153 { |
|
154 delete iGlobalComponentId; |
|
155 iGlobalComponentId = NULL; |
|
156 } |
|
157 iGlobalComponentId = aEntry.GlobalId().AllocL(); |
|
158 |
|
159 CSifOperationStartData* data = CSifOperationStartData::NewLC( *iGlobalComponentId, |
|
160 aEntry.Name(), appNames, appIcons, aEntry.ComponentSize(), |
|
161 KNullDesC, KNullDesC, aEntry.SoftwareType(), iOperationPhase ); |
|
162 |
|
163 if( !iPublishSifOperationInfo ) |
|
164 { |
|
165 iPublishSifOperationInfo = CPublishSifOperationInfo::NewL(); |
|
166 } |
|
167 iPublishSifOperationInfo->PublishStartL( *data ); |
|
168 |
|
169 CleanupStack::PopAndDestroy( 3, &appNames ); // data, appIcons, appNames |
|
170 } |
|
171 |
|
172 // --------------------------------------------------------------------------- |
125 // CSisxSifPluginUiHandlerBase::PublishProgressL() |
173 // CSisxSifPluginUiHandlerBase::PublishProgressL() |
126 // --------------------------------------------------------------------------- |
174 // --------------------------------------------------------------------------- |
127 // |
175 // |
128 void CSisxSifPluginUiHandlerBase::PublishProgressL( TSifOperationPhase aPhase, |
176 void CSisxSifPluginUiHandlerBase::PublishProgressL( TSifOperationSubPhase aSubPhase ) |
129 TSifOperationSubPhase aSubPhase, TInt aCurrentProgress, TInt aTotal ) |
|
130 { |
177 { |
131 User::LeaveIfNull( iPublishSifOperationInfo ); |
178 User::LeaveIfNull( iPublishSifOperationInfo ); |
132 CSifOperationProgressData* data = CSifOperationProgressData::NewLC( *iGlobalComponentId, |
179 CSifOperationProgressData* data = CSifOperationProgressData::NewLC( *iGlobalComponentId, |
133 aPhase, aSubPhase, aCurrentProgress, aTotal ); |
180 iOperationPhase, aSubPhase, iProgressBarCurrentValue, iProgressBarFinalValue ); |
134 iPublishSifOperationInfo->PublishProgressL( *data ); |
181 iPublishSifOperationInfo->PublishProgressL( *data ); |
135 CleanupStack::PopAndDestroy( data ); |
182 CleanupStack::PopAndDestroy( data ); |
136 } |
183 } |
137 |
184 |
138 // --------------------------------------------------------------------------- |
185 // --------------------------------------------------------------------------- |
139 // CSisxSifPluginUiHandlerBase::PublishCompletionL() |
186 // CSisxSifPluginUiHandlerBase::PublishCompletionL() |
140 // --------------------------------------------------------------------------- |
187 // --------------------------------------------------------------------------- |
141 // |
188 // |
142 void CSisxSifPluginUiHandlerBase::PublishCompletionL( const CSisxSifPluginErrorHandler& aError ) |
189 void CSisxSifPluginUiHandlerBase::PublishCompletionL() |
143 { |
190 { |
144 User::LeaveIfNull( iPublishSifOperationInfo ); |
191 User::LeaveIfNull( iPublishSifOperationInfo ); |
145 CSifOperationEndData* data = CSifOperationEndData::NewLC( *iGlobalComponentId, |
192 CSifOperationEndData* data = CSifOperationEndData::NewLC( *iGlobalComponentId, |
146 aError.ErrorCategory(), aError.ErrorCode(), aError.ErrorMessage(), |
193 iErrorHandler.ErrorCategory(), iErrorHandler.ErrorCode(), |
147 aError.ErrorMessageDetails() ); |
194 iErrorHandler.ErrorMessage(), iErrorHandler.ErrorMessageDetails() ); |
148 iPublishSifOperationInfo->PublishCompletionL( *data ); |
195 iPublishSifOperationInfo->PublishCompletionL( *data ); |
149 CleanupStack::PopAndDestroy( data ); |
196 CleanupStack::PopAndDestroy( data ); |
150 } |
197 } |
151 |
198 |
152 // --------------------------------------------------------------------------- |
199 // --------------------------------------------------------------------------- |
153 // CSisxSifPluginUiHandlerBase::SetDisplayErrorL() |
200 // CSisxSifPluginUiHandlerBase::SetErrorL() |
154 // --------------------------------------------------------------------------- |
201 // --------------------------------------------------------------------------- |
155 // |
202 // |
156 void CSisxSifPluginUiHandlerBase::SetDisplayErrorL( Swi::TErrorDialog aType, const TDesC& aParam ) |
203 void CSisxSifPluginUiHandlerBase::SetErrorL( TInt aErrorCode, TInt aExtErrorCode ) |
157 { |
204 { |
158 iErrorHandler.SetExtendedErrorCode( aType ); |
205 iErrorHandler.SetErrorCode( aErrorCode ); |
159 |
206 iErrorHandler.SetExtendedErrorCode( aExtErrorCode ); |
|
207 |
|
208 // TODO: localized UI strings needed |
|
209 switch( iErrorHandler.ErrorCategory() ) |
|
210 { |
|
211 case ELowMemory: |
|
212 // txt_error_info_there_is_not_enough_memory_currentl |
|
213 iErrorHandler.SetErrorMessage( _L("There is not enough memory currently.") ); |
|
214 break; |
|
215 case ELowDiskSpace: |
|
216 // txt_error_info_there_is_not_enough_space_currently |
|
217 iErrorHandler.SetErrorMessage( _L("There is not enough space currently in this drive.") ); |
|
218 break; |
|
219 case ENetworkUnavailable: |
|
220 // txt_error_info_network_is_unavailable_currently |
|
221 iErrorHandler.SetErrorMessage( _L("Network is unavailable currently.") ); |
|
222 break; |
|
223 case EInstallerBusy: |
|
224 // txt_error_info_installer_is_busy_currently |
|
225 iErrorHandler.SetErrorMessage( _L("Installer is busy currently.") ); |
|
226 break; |
|
227 case ECorruptedPackage: |
|
228 // txt_error_info_installation_package_is_corrupted |
|
229 iErrorHandler.SetErrorMessage( _L("Installation package is corrupted. You may want to try again.") ); |
|
230 break; |
|
231 case EApplicationNotCompatible: |
|
232 // txt_error_info_application_is_not_compatible_with |
|
233 iErrorHandler.SetErrorMessage( _L("Application is not compatible with this device.") ); |
|
234 break; |
|
235 case ESecurityError: |
|
236 // txt_error_info_there_is_a_security_issue_with_this |
|
237 iErrorHandler.SetErrorMessage( _L("There is a security issue with this application.") ); |
|
238 break; |
|
239 case EUnexpectedError: |
|
240 case EUnknown: |
|
241 // txt_error_info_an_unexpected_error_occurred |
|
242 iErrorHandler.SetErrorMessage( _L("An unexpected error occurred.") ); |
|
243 break; |
|
244 case EUserCancelled: |
|
245 if( iOperationPhase == EInstalling ) |
|
246 { |
|
247 // txt_error_info_application_not_installed |
|
248 iErrorHandler.SetErrorMessage( _L("Application not installed.") ); |
|
249 } |
|
250 else |
|
251 { |
|
252 // txt_error_info_application_not_deleted |
|
253 iErrorHandler.SetErrorMessage( _L("Application not deleted. ") ); |
|
254 } |
|
255 break; |
|
256 case EUninstallationBlocked: |
|
257 // txt_error_info_application_cannot_be_deleted |
|
258 iErrorHandler.SetErrorMessage( _L("Application cannot be deleted.") ); |
|
259 break; |
|
260 case ENone: |
|
261 default: |
|
262 break; |
|
263 } |
|
264 } |
|
265 |
|
266 // --------------------------------------------------------------------------- |
|
267 // CSisxSifPluginUiHandlerBase::SetErrorL() |
|
268 // --------------------------------------------------------------------------- |
|
269 // |
|
270 void CSisxSifPluginUiHandlerBase::SetErrorL( TInt aErrorCode, TInt aExtErrorCode, |
|
271 const TDesC& aErrMsgDetails ) |
|
272 { |
|
273 SetErrorL( aErrorCode, aExtErrorCode ); |
|
274 iErrorHandler.SetErrorMessageDetails( aErrMsgDetails ); |
|
275 } |
|
276 |
|
277 // --------------------------------------------------------------------------- |
|
278 // CSisxSifPluginUiHandlerBase::SetErrorSwiErrorL() |
|
279 // --------------------------------------------------------------------------- |
|
280 // |
|
281 void CSisxSifPluginUiHandlerBase::SetErrorSwiErrorL( Swi::TErrorDialog aType, |
|
282 const TDesC& /*aParam*/ ) |
|
283 { |
160 // TODO: localised detailed error messages |
284 // TODO: localised detailed error messages |
|
285 // TODO: append aParam when message supports parameters |
161 TBuf<512> details; |
286 TBuf<512> details; |
162 switch( aType ) |
287 switch( aType ) |
163 { |
288 { |
164 case Swi::EUiAlreadyInRom: |
289 case Swi::EUiAlreadyInRom: |
165 details.Copy(_L("EUiAlreadyInRom")); |
290 details.Copy(_L("EUiAlreadyInRom")); |
229 break; |
355 break; |
230 default: |
356 default: |
231 break; |
357 break; |
232 } |
358 } |
233 |
359 |
234 if( aParam.Length() ) |
360 SetErrorL( KErrGeneral, aType, details ); |
235 { |
361 } |
236 details.Append( _L("\n") ); |
362 |
237 details.Append( aParam ); |
363 // --------------------------------------------------------------------------- |
238 } |
364 // CSisxSifPluginUiHandlerBase::SetOcspErrorL() |
239 } |
365 // --------------------------------------------------------------------------- |
240 |
366 // |
|
367 void CSisxSifPluginUiHandlerBase::SetOcspErrorL( Swi::TRevocationDialogMessage aMessage ) |
|
368 { |
|
369 // TODO: localised error strings needed |
|
370 iErrorHandler.SetErrorMessage( _L("Unable to check certificate validity online." ) ); |
|
371 iErrorHandler.SetExtendedErrorCode( aMessage ); |
|
372 switch( aMessage ) |
|
373 { |
|
374 case Swi::EInvalidRevocationServerUrl: |
|
375 iErrorHandler.SetErrorCode( KErrGeneral ); |
|
376 iErrorHandler.SetErrorMessageDetails( _L("Invalid server URL. Check settings.") ); |
|
377 break; |
|
378 case Swi::EUnableToObtainCertificateStatus: |
|
379 iErrorHandler.SetErrorCode( KErrGeneral ); |
|
380 iErrorHandler.SetErrorMessageDetails( _L("Unable to obtain certificate status. Try again later.") ); |
|
381 break; |
|
382 case Swi::EResponseSignatureValidationFailure: |
|
383 iErrorHandler.SetErrorCode( KErrGeneral ); |
|
384 iErrorHandler.SetErrorMessageDetails( _L("Response signature validation failure. Check settings.") ); |
|
385 break; |
|
386 case Swi::EInvalidRevocationServerResponse: |
|
387 iErrorHandler.SetErrorCode( KErrGeneral ); |
|
388 iErrorHandler.SetErrorMessageDetails( _L("The OCSP server reply is invalid. Check settings.") ); |
|
389 break; |
|
390 case Swi::EInvalidCertificateStatusInformation: |
|
391 case Swi::ECertificateStatusIsUnknownSelfSigned: |
|
392 iErrorHandler.SetErrorCode( KErrGeneral ); |
|
393 iErrorHandler.SetErrorMessageDetails( _L("Invalid certificate status information. Try again later.") ); |
|
394 break; |
|
395 case Swi::ECertificateStatusIsUnknown: |
|
396 iErrorHandler.SetErrorCode( KErrGeneral ); |
|
397 iErrorHandler.SetErrorMessageDetails( _L("Unknown certificate. Try again later.") ); |
|
398 break; |
|
399 case Swi::ECertificateStatusIsRevoked: |
|
400 iErrorHandler.SetErrorCode( KErrAccessDenied ); |
|
401 iErrorHandler.SetErrorMessageDetails( _L("The certificate has been revoked.") ); |
|
402 break; |
|
403 default: |
|
404 break; |
|
405 } |
|
406 } |
|
407 |
|
408 // --------------------------------------------------------------------------- |
|
409 // CSisxSifPluginUiHandlerBase::ShowQuestionL() |
|
410 // --------------------------------------------------------------------------- |
|
411 // |
|
412 TBool CSisxSifPluginUiHandlerBase::ShowQuestionL( const TDesC& aText ) const |
|
413 { |
|
414 TBool questionAccepted = EFalse; |
|
415 |
|
416 CHbDeviceMessageBoxSymbian *note = NULL; |
|
417 note = CHbDeviceMessageBoxSymbian::NewL( CHbDeviceMessageBoxSymbian::EQuestion ); |
|
418 CleanupStack::PushL( note ); |
|
419 |
|
420 note->SetTextL( aText ); |
|
421 note->SetTimeout( 0 ); |
|
422 if( note->ExecL() == CHbDeviceMessageBoxSymbian::EAcceptButton ) |
|
423 { |
|
424 questionAccepted = ETrue; |
|
425 } |
|
426 |
|
427 CleanupStack::PopAndDestroy( note ); |
|
428 return questionAccepted; |
|
429 } |
|
430 |
|
431 // --------------------------------------------------------------------------- |
|
432 // CSisxSifPluginUiHandlerBase::ShowQuestionWithContinueL() |
|
433 // --------------------------------------------------------------------------- |
|
434 // |
|
435 void CSisxSifPluginUiHandlerBase::ShowQuestionWithContinueL( const TDesC& aText ) const |
|
436 { |
|
437 CHbDeviceMessageBoxSymbian *note = NULL; |
|
438 note = CHbDeviceMessageBoxSymbian::NewL( CHbDeviceMessageBoxSymbian::EQuestion ); |
|
439 CleanupStack::PushL( note ); |
|
440 |
|
441 note->SetTextL( aText ); |
|
442 note->SetTimeout( 0 ); |
|
443 note->SetButton( CHbDeviceMessageBoxSymbian::EAcceptButton, EFalse ); |
|
444 note->SetButton( CHbDeviceMessageBoxSymbian::ERejectButton, ETrue ); |
|
445 // TODO: localized UI string needed |
|
446 note->SetButtonTextL( CHbDeviceMessageBoxSymbian::ERejectButton, _L("Continue") ); |
|
447 (void)note->ExecL(); |
|
448 |
|
449 CleanupStack::PopAndDestroy( note ); |
|
450 } |
|
451 |