106 // ----------------------------------------------------------------------------- |
141 // ----------------------------------------------------------------------------- |
107 // |
142 // |
108 void CDialogWrapper::ShowUntrustedResultL() |
143 void CDialogWrapper::ShowUntrustedResultL() |
109 { |
144 { |
110 FLOG( _L("Daemon: CDialogWrapper::ShowUntrustedResultL") ); |
145 FLOG( _L("Daemon: CDialogWrapper::ShowUntrustedResultL") ); |
111 |
146 |
112 #ifdef _SWIDAEMON_DISABLE_NOTES_ |
147 #ifdef _SWIDAEMON_DISABLE_NOTES_ |
113 FLOG( _L("Daemon: CDialogWrapper: iDisableAllNotes = ETrue") ); |
148 FLOG( _L("Daemon: CDialogWrapper: iDisableAllNotes = ETrue") ); |
114 iDisableAllNotes = ETrue; |
149 iDisableAllNotes = ETrue; |
115 #endif |
150 #endif |
116 |
151 |
117 // Let watcher to know that waiting note is canceled. |
152 // Let watcher to know that waiting note is canceled. |
118 iWatcher->CancelNoteRequest(); |
153 iWatcher->CancelNoteRequest(); |
119 |
154 |
120 // Inform watcher that we have request to show note. |
155 // Inform watcher that we have request to show note. |
121 iWatcher->CancelNoteRequest(); |
156 iWatcher->CancelNoteRequest(); |
122 |
157 |
123 if ( iDisableAllNotes == EFalse ) |
158 if ( !iDisableAllNotes ) |
124 { |
159 { |
125 CHbDeviceNotificationDialogSymbian* notificationDialog = |
160 CHbDeviceNotificationDialogSymbian* notificationDialog = |
126 CHbDeviceNotificationDialogSymbian::NewL( NULL ); |
161 CHbDeviceNotificationDialogSymbian::NewL( NULL ); |
127 |
162 |
128 CleanupStack::PushL( notificationDialog ); |
163 CleanupStack::PushL( notificationDialog ); |
129 |
164 |
130 //TODO get string from log file. |
165 //TODO get string from log file. |
131 _LIT( KTempIconText,"note_info"); |
166 _LIT( KTempIconText,"note_info"); |
132 _LIT( KTempTextTitle,"SW Silent Installer" ); |
167 _LIT( KTempTextTitle,"SW Silent Installer" ); |
133 _LIT( KTempTextForErrorMessage,"Untrusted software was found." ); |
168 _LIT( KTempTextForErrorMessage,"Untrusted software was found." ); |
134 |
169 |
135 //notificationDialog->SetTimeout( KHbLongNotificationDialogTimeout ); |
|
136 |
|
137 notificationDialog->NotificationL( KTempIconText, |
170 notificationDialog->NotificationL( KTempIconText, |
138 KTempTextTitle , |
171 KTempTextTitle , |
139 KTempTextForErrorMessage ); |
172 KTempTextForErrorMessage ); |
140 |
173 |
141 CleanupStack::PopAndDestroy( notificationDialog ); |
174 CleanupStack::PopAndDestroy( notificationDialog ); |
189 // ----------------------------------------------------------------------------- |
220 // ----------------------------------------------------------------------------- |
190 // |
221 // |
191 void CDialogWrapper::ShowWaitingNoteL() |
222 void CDialogWrapper::ShowWaitingNoteL() |
192 { |
223 { |
193 FLOG( _L("Daemon: CDialogWrapper::ShowWaitingNoteL") ); |
224 FLOG( _L("Daemon: CDialogWrapper::ShowWaitingNoteL") ); |
194 |
225 |
195 #ifdef _SWIDAEMON_DISABLE_NOTES_ |
226 #ifdef _SWIDAEMON_DISABLE_NOTES_ |
196 FLOG( _L("Daemon: CDialogWrapper: iDisableAllNotes = ETrue") ); |
227 FLOG( _L("Daemon: CDialogWrapper: iDisableAllNotes = ETrue") ); |
197 iDisableAllNotes = ETrue; |
228 iDisableAllNotes = ETrue; |
198 #endif |
229 #endif |
199 |
230 |
200 if ( iDisableAllNotes == EFalse ) |
231 FLOG_1( _L("Daemon: iDisableAllNotes: %d"), iDisableAllNotes ); |
|
232 FLOG_1( _L("Daemon: iIsProgressDialog: %d"), iIsProgressDialog ); |
|
233 FLOG_1( _L("Daemon: iTimeOffDisableProgress: %d"), iTimeOffDisableProgress ); |
|
234 |
|
235 if ( !iDisableAllNotes ) |
201 { |
236 { |
202 if ( !iIsProgressDialog ) |
237 if ( !iIsProgressDialog && !iTimeOffDisableProgress ) |
203 { |
238 { |
204 iHbProgressDialog = CHbDeviceProgressDialogSymbian::NewL( |
239 iHbProgressDialog = CHbDeviceProgressDialogSymbian::NewL( |
205 CHbDeviceProgressDialogSymbian::EWaitDialog, |
240 CHbDeviceProgressDialogSymbian::EWaitDialog, |
206 NULL ); |
241 NULL ); |
207 iIsProgressDialog = ETrue; |
242 iIsProgressDialog = ETrue; |
208 |
243 |
209 //TODO get string from log file. |
|
210 _LIT( KTempTextForProgressDialog,"Installing" ); |
244 _LIT( KTempTextForProgressDialog,"Installing" ); |
211 |
245 |
212 iHbProgressDialog->SetTextL( KTempTextForProgressDialog ); |
246 iHbProgressDialog->SetTextL( KTempTextForProgressDialog ); |
213 iHbProgressDialog->ShowL(); |
247 FLOG( _L("Daemon: ShowWaitingNoteL: ShowL") ); |
|
248 iHbProgressDialog->ShowL(); |
|
249 FLOG( _L("Daemon: ShowWaitingNoteL: StartDialogTimer") ); |
|
250 iTimer->StartDialogTimer( KDialogTimeOut ); |
214 } |
251 } |
215 } |
252 } |
216 else if ( iDisableAllNotes ) |
253 else if ( iDisableAllNotes ) |
217 { |
254 { |
218 // Let watcher to know that waiting note should be shown |
255 // Let watcher to know that waiting note should be shown |
277 #ifdef _SWIDAEMON_DISABLE_NOTES_ |
317 #ifdef _SWIDAEMON_DISABLE_NOTES_ |
278 FLOG( _L("Daemon: CDialogWrapper: iDisableAllNotes = ETrue") ); |
318 FLOG( _L("Daemon: CDialogWrapper: iDisableAllNotes = ETrue") ); |
279 iDisableAllNotes = ETrue; |
319 iDisableAllNotes = ETrue; |
280 #endif |
320 #endif |
281 |
321 |
282 //TODO: All resoureces nees to be rewriten for device dialogs (QT) |
322 FLOG_1( _L("Daemon: iDisableAllNotes: %d"), iDisableAllNotes ); |
283 if ( iDisableAllNotes == EFalse ) |
323 FLOG_1( _L("Daemon: iIsProgressDialog: %d"), iIsProgressDialog ); |
284 { |
324 FLOG_1( _L("Daemon: iTimeOffDisableProgress: %d"), iTimeOffDisableProgress ); |
285 if ( !iIsUninstallerProgressDialog ) |
325 |
|
326 if ( !iDisableAllNotes ) |
|
327 { |
|
328 if ( !iIsUninstallerProgressDialog && !iTimeOffDisableProgress ) |
286 { |
329 { |
287 iHbProgressDialogForUninstaller = |
330 iHbProgressDialogForUninstaller = |
288 CHbDeviceProgressDialogSymbian::NewL( |
331 CHbDeviceProgressDialogSymbian::NewL( |
289 CHbDeviceProgressDialogSymbian::EWaitDialog, |
332 CHbDeviceProgressDialogSymbian::EWaitDialog, |
290 NULL ); |
333 NULL ); |
291 iIsUninstallerProgressDialog = ETrue; |
334 iIsUninstallerProgressDialog = ETrue; |
292 //TODO get string from log file. |
335 //TODO get string from log file. |
293 _LIT( KTempTextForProgressDialog,"Uninstalling" ); |
336 _LIT( KTempTextForProgressDialog,"Uninstalling" ); |
294 iHbProgressDialogForUninstaller->SetTextL( KTempTextForProgressDialog ); |
337 iHbProgressDialogForUninstaller->SetTextL( KTempTextForProgressDialog ); |
|
338 FLOG( _L("Daemon: ShowWaitingNoteForUninstallerL: ShowL") ); |
295 iHbProgressDialogForUninstaller->ShowL(); |
339 iHbProgressDialogForUninstaller->ShowL(); |
|
340 FLOG( _L("Daemon: ShowWaitingNoteForUninstallerL: StartDialogTimer") ); |
|
341 iTimer->StartDialogTimer( KDialogTimeOut ); |
296 } |
342 } |
297 } |
343 } |
298 else if ( iDisableAllNotes ) |
344 else if ( iDisableAllNotes ) |
299 { |
345 { |
300 // Let watcher to know that waiting note should be shown |
346 // Let watcher to know that waiting note should be shown |
301 // after dialogs are enabled. |
347 // after dialogs are enabled. |
302 iWatcher->RequestToDisplayNote(); |
348 iWatcher->RequestToDisplayNote(); |
303 } |
349 } |
304 } |
350 } |
|
351 |
|
352 // ----------------------------------------------------------------------------- |
|
353 // CDialogWrapper::CancelWaitingNoteL |
|
354 // Cancel global waiting note after installing. |
|
355 // (other items were commented in a header). |
|
356 // ----------------------------------------------------------------------------- |
|
357 // |
|
358 void CDialogWrapper::CancelWaitingNoteForUninstaller() |
|
359 { |
|
360 FLOG( _L("Daemon: CDialogWrapper::CancelWaitingNoteForUninstallerL") ); |
|
361 |
|
362 if ( iIsUninstallerProgressDialog ) |
|
363 { |
|
364 iHbProgressDialogForUninstaller->Close(); |
|
365 delete iHbProgressDialogForUninstaller; |
|
366 //Make sure not to delete twice in destructor. |
|
367 iHbProgressDialogForUninstaller = NULL; |
|
368 iIsUninstallerProgressDialog = EFalse; |
|
369 |
|
370 iTimeOffDisableProgress = ETrue; |
|
371 } |
|
372 |
|
373 // Let watcher to know that waiting note is canceled. |
|
374 iWatcher->CancelNoteRequest(); |
|
375 } |
|
376 |
|
377 // ----------------------------------------------------------------------------- |
|
378 // CDialogWrapper::ActivateIndicatorL() |
|
379 // |
|
380 // ----------------------------------------------------------------------------- |
|
381 // |
|
382 void CDialogWrapper::ActivateIndicatorL( TReal aProcessValue ) |
|
383 { |
|
384 FLOG( _L("Daemon: CDialogWrapper::ActivateIndicatorL") ); |
|
385 |
|
386 if ( !iIsIndicator ) |
|
387 { |
|
388 FLOG( _L("Daemon: CHbIndicatorSymbian::NewL") ); |
|
389 iHbIndicator = CHbIndicatorSymbian::NewL(); |
|
390 iIsIndicator = ETrue; |
|
391 } |
|
392 |
|
393 TReal processValue = aProcessValue; |
|
394 |
|
395 CHbSymbianVariant* hbParam = CHbSymbianVariant::NewL( |
|
396 &processValue, |
|
397 CHbSymbianVariant::EReal ); |
|
398 CleanupStack::PushL( hbParam ); |
|
399 |
|
400 FLOG( _L("Daemon: ActivateIndicatorL: Activate") ); |
|
401 iHbIndicator->Activate( KIndicatorTypeSWIDaemon, hbParam ); |
|
402 |
|
403 CleanupStack::PopAndDestroy( hbParam ); |
|
404 } |
|
405 |
|
406 // ----------------------------------------------------------------------------- |
|
407 // CDialogWrapper::SetModeToIndicatorL() |
|
408 // |
|
409 // ----------------------------------------------------------------------------- |
|
410 // |
|
411 void CDialogWrapper::SetModeToIndicatorL( TInt aMode ) |
|
412 { |
|
413 FLOG_1( _L("Daemon: CDialogWrapper::SetModeToIndicatorL: aMode: %d"), |
|
414 aMode ); |
|
415 |
|
416 if ( !iIsIndicator ) |
|
417 { |
|
418 FLOG( _L("Daemon: CHbIndicatorSymbian::NewL") ); |
|
419 iHbIndicator = CHbIndicatorSymbian::NewL(); |
|
420 iIsIndicator = ETrue; |
|
421 } |
|
422 // Set mode. |
|
423 TReal mode = aMode; |
|
424 CHbSymbianVariant* hbParam = CHbSymbianVariant::NewL( |
|
425 &mode, |
|
426 CHbSymbianVariant::EReal ); |
|
427 CleanupStack::PushL( hbParam ); |
|
428 FLOG( _L("Daemon: SetModeToIndicatorL: Activate") ); |
|
429 iHbIndicator->Activate( KIndicatorTypeSWIDaemon, hbParam ); |
|
430 |
|
431 CleanupStack::PopAndDestroy( hbParam ); |
|
432 } |
|
433 |
|
434 |
|
435 // ----------------------------------------------------------------------------- |
|
436 // CDialogWrapper::CancelIndicatorL |
|
437 // |
|
438 // ----------------------------------------------------------------------------- |
|
439 // |
|
440 void CDialogWrapper::CancelIndicatorL() |
|
441 { |
|
442 FLOG( _L("Daemon: CDialogWrapper::CancelIndicatorL") ); |
|
443 |
|
444 if ( iIsIndicator ) |
|
445 { |
|
446 FLOG( _L("Daemon: CancelIndicatorL: Deactivate") ); |
|
447 iHbIndicator->Deactivate( KIndicatorTypeSWIDaemon ); |
|
448 delete iHbIndicator; |
|
449 iHbIndicator = NULL; //Make sure not to delete twice in destructor. |
|
450 iIsIndicator = EFalse; |
|
451 } |
|
452 } |
|
453 |
|
454 // ----------------------------------------------------------------------------- |
|
455 // CDialogWrapper::CheckSystemState() |
|
456 // |
|
457 // ----------------------------------------------------------------------------- |
|
458 // |
|
459 /* |
|
460 void CDialogWrapper::CheckSystemState() |
|
461 { |
|
462 FLOG( _L("Daemon: CDialogWrapper::CheckSystemState TEST") ); |
|
463 |
|
464 // We need to check this only if system is not ready to show |
|
465 // dialogs e.g. UI is not up. |
|
466 if ( !iSystemReadyToShowDialogs ) |
|
467 { |
|
468 RSsmStateAwareSession systemStateSession; |
|
469 |
|
470 TInt err = systemStateSession.Connect( KUIFrameworkDomain3 ); |
|
471 FLOG_1( _L("Daemon: systemStateSession.Connect err = %d"), err ); |
|
472 |
|
473 if ( err == KErrNone ) |
|
474 { |
|
475 TSsmState currentState = systemStateSession.State(); |
|
476 systemStateSession.Close(); |
|
477 |
|
478 FLOG_1( _L("Daemon: System main state = %d"), currentState.MainState() ); |
|
479 FLOG_1( _L("Daemon: System sub state = %d"), currentState.SubState() ); |
|
480 |
|
481 |
|
482 if ( currentState.MainState() == ESsmNormal ) |
|
483 { |
|
484 iSystemReadyToShowDialogs = ETrue; |
|
485 } |
|
486 else |
|
487 { |
|
488 iSystemReadyToShowDialogs = EFalse; |
|
489 } |
|
490 } |
|
491 else |
|
492 { |
|
493 iSystemReadyToShowDialogs = EFalse; |
|
494 } |
|
495 } |
|
496 FLOG_1( _L("Daemon: iSystemReadyToShowDialogs = %d"), |
|
497 iSystemReadyToShowDialogs ); |
|
498 } |
|
499 */ |
|
500 |
|
501 //------------------------------------------------------------------------------- |
|
502 |
|
503 // ----------------------------------------------------------------------------- |
|
504 // CDialogTimer::CDialogTimer() |
|
505 // |
|
506 // ----------------------------------------------------------------------------- |
|
507 // |
|
508 CDialogTimer::CDialogTimer() : CActive( EPriorityNormal ) |
|
509 { |
|
510 } |
|
511 |
|
512 // ----------------------------------------------------------------------------- |
|
513 // CDialogTimer::~CDialogTimer() |
|
514 // |
|
515 // ----------------------------------------------------------------------------- |
|
516 // |
|
517 CDialogTimer::~CDialogTimer() |
|
518 { |
|
519 FLOG( _L("Daemon: CDialogTimer::~CDialogTimer") ); |
|
520 // Cancel the outstanding request. Calls the active object’s |
|
521 // DoCancel function if request is outstanding. |
|
522 Cancel(); |
|
523 // Delete RTimer |
|
524 iRTimer.Close(); |
|
525 } |
|
526 |
|
527 // ----------------------------------------------------------------------------- |
|
528 // CDialogTimer::NewL() |
|
529 // |
|
530 // ----------------------------------------------------------------------------- |
|
531 // |
|
532 CDialogTimer* CDialogTimer::NewL( CDialogWrapper* aDialog ) |
|
533 { |
|
534 CDialogTimer* activeTimer = new (ELeave) CDialogTimer(); |
|
535 CleanupStack::PushL( activeTimer ); |
|
536 activeTimer->ConstructL( aDialog ); |
|
537 CleanupStack::Pop(); |
|
538 return activeTimer; |
|
539 } |
|
540 |
|
541 // ----------------------------------------------------------------------------- |
|
542 // CDialogTimer::ConstructL() |
|
543 // |
|
544 // ----------------------------------------------------------------------------- |
|
545 // |
|
546 void CDialogTimer::ConstructL( CDialogWrapper* aDialog ) |
|
547 { |
|
548 if ( aDialog == NULL ) |
|
549 { |
|
550 User::Leave( KErrArgument ); |
|
551 } |
|
552 iDialog = aDialog; |
|
553 CActiveScheduler::Add( this ); |
|
554 iRTimer.CreateLocal(); |
|
555 } |
|
556 |
|
557 // ----------------------------------------------------------------------------- |
|
558 // CDialogTimer::StartDialogTimer() |
|
559 // |
|
560 // ----------------------------------------------------------------------------- |
|
561 // |
|
562 void CDialogTimer::StartDialogTimer( TUint32 aRefreshTime ) |
|
563 { |
|
564 FLOG( _L("Daemon: CDialogTimer::StartDialogTimer") ); |
|
565 // Check first that we do not have request outstanding. |
|
566 if ( !IsActive() ) |
|
567 { |
|
568 // Set time interval for dialog. |
|
569 TimerSet( aRefreshTime ); |
|
570 } |
|
571 } |
|
572 |
|
573 // ----------------------------------------------------------------------------- |
|
574 // CDialogTimer::TimerSet() |
|
575 // |
|
576 // ----------------------------------------------------------------------------- |
|
577 // |
|
578 void CDialogTimer::TimerSet( TUint32 aRefreshTime ) |
|
579 { |
|
580 FLOG_1( _L("Daemon: CDialogTimer::TimerSet time: %d"), aRefreshTime ); |
|
581 // Set timer interval. |
|
582 iRTimer.After( iStatus, aRefreshTime ); |
|
583 // Set active. Start wait for timer. |
|
584 SetActive(); |
|
585 } |
|
586 |
|
587 // ----------------------------------------------------------------------------- |
|
588 // CDialogTimer::RunL() |
|
589 // |
|
590 // ----------------------------------------------------------------------------- |
|
591 // |
|
592 void CDialogTimer::RunL() |
|
593 { |
|
594 FLOG( _L("Daemon: CDialogTimer::RunL: Cancel waiting note") ); |
|
595 iDialog->CancelWaitingNote(); |
|
596 iDialog->CancelWaitingNoteForUninstaller(); |
|
597 } |
|
598 |
|
599 // ----------------------------------------------------------------------------- |
|
600 // CDialogTimer::DoCancel() |
|
601 // |
|
602 // ----------------------------------------------------------------------------- |
|
603 // |
|
604 void CDialogTimer::DoCancel() |
|
605 { |
|
606 // Cancel outstanding request for a timer event. |
|
607 iRTimer.Cancel(); |
|
608 } |
|
609 |
|
610 // ----------------------------------------------------------------------------- |
|
611 // CDialogTimer::RunError() |
|
612 // |
|
613 // ----------------------------------------------------------------------------- |
|
614 // |
|
615 TInt CDialogTimer::RunError( TInt aError ) |
|
616 { |
|
617 return aError; |
|
618 } |
|
619 |
|
620 |
305 // End of File |
621 // End of File |