calendarui/controller/src/calendeleteui.cpp
changeset 57 bb2d3e476f29
parent 55 2c54b51f39c4
child 70 a5ed90760192
equal deleted inserted replaced
55:2c54b51f39c4 57:bb2d3e476f29
   320 				if ((entry.isRepeating() || !entry.recurrenceId().isNull()) 
   320 				if ((entry.isRepeating() || !entry.recurrenceId().isNull()) 
   321 							&& (AgendaEntry::TypeAnniversary != entry.type())) {
   321 							&& (AgendaEntry::TypeAnniversary != entry.type())) {
   322 					// Show a confirmation note whether the user
   322 					// Show a confirmation note whether the user
   323 					// wants to delete the single instance or all of them
   323 					// wants to delete the single instance or all of them
   324 					showRepeatingEntryDeleteQuery();
   324 					showRepeatingEntryDeleteQuery();
       
   325 				} else if (CalenAgendaUtils::isAlldayEvent(entry)) {
       
   326 					showDeleteQuery(EDeleteEvent);
   325 				} else {
   327 				} else {
   326 					// If the entry is not a repeating entry,
   328 					// If the entry is not a repeating entry,
   327 					// delete it directly
   329 					// delete it directly
   328 					// Save the entry for later reference in the slot
   330 					// Save the entry for later reference in the slot
   329 					showDeleteQuery(EDeleteEntry);
   331 					showDeleteQuery(EDeleteEntry);
   543 				// User wants to delete all the occurences
   545 				// User wants to delete all the occurences
   544 				iController.Services().agendaInterface()->deleteRepeatedEntry(
   546 				iController.Services().agendaInterface()->deleteRepeatedEntry(
   545 									instance, AgendaUtil::ThisAndAll);
   547 									instance, AgendaUtil::ThisAndAll);
   546 				break;
   548 				break;
   547 		}
   549 		}
       
   550 	}else {
       
   551 	    iController.BroadcastNotification(ECalenNotifyDeleteFailed);
   548 	}
   552 	}
   549 	OstTraceFunctionExit0( CALENDELETEUI_HANDLEREPEATEDENTRYDELETE_EXIT );
   553 	OstTraceFunctionExit0( CALENDELETEUI_HANDLEREPEATEDENTRYDELETE_EXIT );
   550 }
   554 }
   551 
   555 
   552 // ----------------------------------------------------------------------------
   556 // ----------------------------------------------------------------------------
   586             break;
   590             break;
   587             }
   591             }
   588         case EDeleteAll:
   592         case EDeleteAll:
   589             {
   593             {
   590             text.append(hbTrId("txt_calendar_info_delete_all_calendar_entries"));
   594             text.append(hbTrId("txt_calendar_info_delete_all_calendar_entries"));
       
   595             break;
       
   596             }
       
   597         case EDeleteEvent:
       
   598             {
       
   599             text.append(hbTrId("txt_calendar_info_delete_allday_event"));
   591             break;
   600             break;
   592             }
   601             }
   593         default:
   602         default:
   594             break;
   603             break;
   595         }
   604         }
   655 					if( !child || mRecurrenceRange == AgendaUtil::ThisOnly 
   664 					if( !child || mRecurrenceRange == AgendaUtil::ThisOnly 
   656 							|| mRecurrenceRange == AgendaUtil::ThisAndAll) {
   665 							|| mRecurrenceRange == AgendaUtil::ThisAndAll) {
   657 						iController.Services().agendaInterface()->deleteRepeatedEntry( 
   666 						iController.Services().agendaInterface()->deleteRepeatedEntry( 
   658 								instance, mRecurrenceRange );
   667 								instance, mRecurrenceRange );
   659 					}
   668 					}
       
   669 				}else {
       
   670 				    iController.BroadcastNotification(ECalenNotifyDeleteFailed); 
   660 				}
   671 				}
   661 			}
   672 			}
   662 				break;
   673 				break;
   663 			
   674 			
   664 			case ECalenDeleteAllEntries:
   675 			case ECalenDeleteAllEntries:
   670 			
   681 			
   671 			default:
   682 			default:
   672 				break;
   683 				break;
   673 				
   684 				
   674 		}
   685 		}
   675 	}
   686 	} else {
   676 	// If the user presses cancel button the notification will be
   687 		// If the user presses cancel button the notification will be
   677 	// ECalenNotifyDeleteFailed as default.
   688 		// ECalenNotifyDeleteFailed as default.
   678 	// Notify the status
   689 		// Notify the status
   679 	iController.BroadcastNotification(notification);
   690 		iController.BroadcastNotification(notification);
       
   691 	}
   680 	
   692 	
   681 	// Reset the member variables
   693 	// Reset the member variables
   682 	mDeleteAction = NULL;
   694 	mDeleteAction = NULL;
   683 	mCancelAction = NULL;
   695 	mCancelAction = NULL;
   684 	
   696