alarmui/src/AlmAlarmControl.cpp
changeset 45 b6db4fd4947b
parent 23 fd30d51f876b
child 89 b57382753122
equal deleted inserted replaced
23:fd30d51f876b 45:b6db4fd4947b
   175                 * (try to prevent accidental key presses from going through the key or security lock)
   175                 * (try to prevent accidental key presses from going through the key or security lock)
   176                 */
   176                 */
   177                 iAlarmUtils->StartKeyBlocker();
   177                 iAlarmUtils->StartKeyBlocker();
   178 
   178 
   179                 // reset the key guard
   179                 // reset the key guard
   180                 iAlarmUtils->SetKeyGuard( ETrue );
   180                 //iAlarmUtils->SetKeyGuard( ETrue );
   181             }
   181             }
   182 
   182 
   183             break;
   183             break;
   184         }
   184         }
   185 
   185 
   225     iAlarmUtils->CancelAutoSnooze();
   225     iAlarmUtils->CancelAutoSnooze();
   226 
   226 
   227     // Allow auto-snooze only while waiting user input
   227     // Allow auto-snooze only while waiting user input
   228     if( IsState( EStateWaitingInput ) )
   228     if( IsState( EStateWaitingInput ) )
   229         {
   229         {
   230         SetState( EStateAfterInput );
   230         SetState( EStateAfterInput );       
   231         if( iAlarmUtils->IsCalendarAlarm() )
   231         iAlarmUtils->TryToSnoozeActiveAlarm();
   232             {    
   232         DoCancelDialog();        
   233             if( iAlarmUtils->IsCalendarAlarmViewer() )
       
   234                 {                
       
   235                 iAlarmUtils->SetCalendarAlarmViewer(EFalse);           
       
   236                 }
       
   237             else
       
   238                 {
       
   239                 TRAP_IGNORE( StoreMissedAlarmDataL() );
       
   240                 }
       
   241             iAlarmUtils->DoStopAlarm();             
       
   242             DoCancelDialog();
       
   243                    	             
       
   244             }
       
   245         else
       
   246             {        
       
   247             iAlarmUtils->TryToSnoozeActiveAlarm();
       
   248             DoCancelDialog();
       
   249             }
       
   250         }
   233         }
   251     TRACE_EXIT_POINT;
   234     TRACE_EXIT_POINT;
   252     }
   235     }
   253 
   236 
   254 // ---------------------------------------------------------
   237 // ---------------------------------------------------------
   527                 TBuf<1> time;
   510                 TBuf<1> time;
   528                 TRAP( err, iGlobalNoteId = iAlarmUtils->NotifierDialogController()->DisplayAlarmL( cba, *text, timenot used ) );
   511                 TRAP( err, iGlobalNoteId = iAlarmUtils->NotifierDialogController()->DisplayAlarmL( cba, *text, timenot used ) );
   529                 delete text; // only delete if GetAlarmLabelL call was successfull
   512                 delete text; // only delete if GetAlarmLabelL call was successfull
   530                 ASSERT( !err ); */     
   513                 ASSERT( !err ); */     
   531                 iAlarmUtils->NotifierDialogController()->showAlarmAlert(alarmInfo);
   514                 iAlarmUtils->NotifierDialogController()->showAlarmAlert(alarmInfo);
   532                 iAlarmUtils->StartAutoSnoozeTimer();
   515                 //iAlarmUtils->StartAutoSnoozeTimer();
   533                 iAlarmUtils->PlayAlarmSound();
   516                 //iAlarmUtils->PlayAlarmSound();
   534                 SetState( EStateWaitingInput );
   517                 //SetState( EStateWaitingInput );
   535 
   518 
   536                 if( err ) // failed to fetch alarm data or show the notification
   519                 if( err ) // failed to fetch alarm data or show the notification
   537                 {
   520                 {
   538                     // this happens if user has deleted calendar entry with a snoozed alarm or removed alarm from a snoozed calendar entry.
   521                     // this happens if user has deleted calendar entry with a snoozed alarm or removed alarm from a snoozed calendar entry.
   539                     // (or if the DisplayAlarmL call fails)
   522                     // (or if the DisplayAlarmL call fails)
   960     {
   943     {
   961         case EStateWaitingDisplayRequest:
   944         case EStateWaitingDisplayRequest:
   962         {
   945         {
   963             iAlarmUtils->StartAutoSnoozeTimer();
   946             iAlarmUtils->StartAutoSnoozeTimer();
   964             iAlarmUtils->PlayAlarmSound();
   947             iAlarmUtils->PlayAlarmSound();
   965             iAlarmUtils->SetKeyGuard( EFalse );
   948             //iAlarmUtils->SetKeyGuard( EFalse );
   966             SetState( EStateWaitingInput );
   949             SetState( EStateWaitingInput );
   967             iAlarmUtils->StartKeyBlocker();  // block all input for 0.5 seconds
   950             iAlarmUtils->StartKeyBlocker();  // block all input for 0.5 seconds
   968         }
   951         }
   969         break;
   952         break;
   970 
   953 
  1383      {
  1366      {
  1384          case EStateWaitingDisplayRequest:
  1367          case EStateWaitingDisplayRequest:
  1385          {
  1368          {
  1386              iAlarmUtils->StartAutoSnoozeTimer();
  1369              iAlarmUtils->StartAutoSnoozeTimer();
  1387              iAlarmUtils->PlayAlarmSound();
  1370              iAlarmUtils->PlayAlarmSound();
  1388              iAlarmUtils->SetKeyGuard( EFalse );
  1371              //iAlarmUtils->SetKeyGuard( EFalse );
  1389              SetState( EStateWaitingInput );
  1372              SetState( EStateWaitingInput );
  1390              iAlarmUtils->StartKeyBlocker();  // block all input for 0.5 seconds
  1373              iAlarmUtils->StartKeyBlocker();  // block all input for 0.5 seconds
  1391          }
  1374          }
  1392          break;
  1375          break;
  1393 
  1376