summaryrefslogtreecommitdiffabout
path: root/korganizer
authorzautrix <zautrix>2005-10-22 14:49:34 (UTC)
committer zautrix <zautrix>2005-10-22 14:49:34 (UTC)
commit30550b912b291ccedc8ab100004ba8c5ed216097 (patch) (unidiff)
tree9b815bc396ce304b1e975226306da5a498e70259 /korganizer
parent2e5c0a288f7c54cce7e0327ddbbd160f242758f1 (diff)
downloadkdepimpi-30550b912b291ccedc8ab100004ba8c5ed216097.zip
kdepimpi-30550b912b291ccedc8ab100004ba8c5ed216097.tar.gz
kdepimpi-30550b912b291ccedc8ab100004ba8c5ed216097.tar.bz2
fix
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 2ba8528..e31a6e1 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -3951,130 +3951,130 @@ void CalendarView::appointment_edit()
3951 return; 3951 return;
3952 } 3952 }
3953 3953
3954 editEvent(anEvent); 3954 editEvent(anEvent);
3955} 3955}
3956 3956
3957void CalendarView::appointment_delete() 3957void CalendarView::appointment_delete()
3958{ 3958{
3959 Event *anEvent = 0; 3959 Event *anEvent = 0;
3960 3960
3961 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); 3961 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first();
3962 3962
3963 if (mViewManager->currentView()->isEventView()) { 3963 if (mViewManager->currentView()->isEventView()) {
3964 if ( incidence && incidence->typeID() == eventID ) { 3964 if ( incidence && incidence->typeID() == eventID ) {
3965 anEvent = static_cast<Event *>(incidence); 3965 anEvent = static_cast<Event *>(incidence);
3966 } 3966 }
3967 } 3967 }
3968 3968
3969 if (!anEvent) { 3969 if (!anEvent) {
3970 KNotifyClient::beep(); 3970 KNotifyClient::beep();
3971 return; 3971 return;
3972 } 3972 }
3973 3973
3974 deleteEvent(anEvent); 3974 deleteEvent(anEvent);
3975} 3975}
3976 3976
3977void CalendarView::todo_resub( Todo * parent, Todo * sub ) 3977void CalendarView::todo_resub( Todo * parent, Todo * sub )
3978{ 3978{
3979 if (!sub) return; 3979 if (!sub) return;
3980 if ( sub->relatedTo() == parent ) 3980 if ( sub->relatedTo() == parent )
3981 return; 3981 return;
3982 sub->setRelatedTo(parent); 3982 sub->setRelatedTo(parent);
3983 sub->updated(); 3983 sub->updated();
3984 setModified(true); 3984 setModified(true);
3985 updateView(); 3985 updateView();
3986} 3986}
3987void CalendarView::todo_unsub(Todo *anTodo ) 3987void CalendarView::todo_unsub(Todo *anTodo )
3988{ 3988{
3989 todo_resub( 0, anTodo ); 3989 todo_resub( 0, anTodo );
3990} 3990}
3991 3991
3992void CalendarView::deleteTodo(Todo *todo) 3992void CalendarView::deleteTodo(Todo *todo)
3993{ 3993{
3994 if (!todo) { 3994 if (!todo) {
3995 KNotifyClient::beep(); 3995 KNotifyClient::beep();
3996 return; 3996 return;
3997 } 3997 }
3998 if (KOPrefs::instance()->mConfirm) { 3998 if (KOPrefs::instance()->mConfirm) {
3999 QString text = KGlobal::formatMessage ( todo->summary(),0 ); 3999 QString text = KGlobal::formatMessage ( todo->summary(),0 );
4000 if (!todo->relations().isEmpty()) { 4000 if (!todo->relations().isEmpty()) {
4001 text += i18n("\nhas sub-todos.\nAll completed sub-todos\nwill be deleted as well!"); 4001 text += i18n("\nhas sub-todos.\nAll completed sub-todos\nwill be deleted as well!");
4002 4002
4003 } 4003 }
4004 switch (msgItemDelete(i18n("Todo:") +"\n"+text)) { 4004 switch (msgItemDelete(i18n("Todo:") +"\n"+text)) {
4005 case KMessageBox::Continue: // OK 4005 case KMessageBox::Continue: // OK
4006 bool deleteT = false; 4006 bool deleteT = false;
4007 if (!todo->relations().isEmpty()) { 4007 if (!todo->relations().isEmpty()) {
4008 deleteT = removeCompletedSubTodos( todo ); 4008 deleteT = removeCompletedSubTodos( todo );
4009 } 4009 }
4010 // deleteT == true: todo already deleted in removeCompletedSubTodos 4010 // deleteT == true: todo already deleted in removeCompletedSubTodos
4011 if ( !deleteT ) { 4011 if ( !deleteT ) {
4012 checkExternalId( todo ); 4012 checkExternalId( todo );
4013 calendar()->deleteTodo(todo); 4013 calendar()->deleteTodo(todo);
4014 changeTodoDisplay( todo,KOGlobals::EVENTDELETED ); 4014 changeTodoDisplay( todo,KOGlobals::EVENTDELETED );
4015 updateView();
4016 } 4015 }
4016 updateView();
4017 break; 4017 break;
4018 } // switch 4018 } // switch
4019 } else { 4019 } else {
4020 checkExternalId( todo ); 4020 checkExternalId( todo );
4021 mCalendar->deleteTodo(todo); 4021 mCalendar->deleteTodo(todo);
4022 changeTodoDisplay( todo,KOGlobals::EVENTDELETED ); 4022 changeTodoDisplay( todo,KOGlobals::EVENTDELETED );
4023 updateView(); 4023 updateView();
4024 } 4024 }
4025 4025
4026 emit updateSearchDialog(); 4026 emit updateSearchDialog();
4027} 4027}
4028void CalendarView::deleteJournal(Journal *jour) 4028void CalendarView::deleteJournal(Journal *jour)
4029{ 4029{
4030 if (!jour) { 4030 if (!jour) {
4031 KNotifyClient::beep(); 4031 KNotifyClient::beep();
4032 return; 4032 return;
4033 } 4033 }
4034 if (KOPrefs::instance()->mConfirm) { 4034 if (KOPrefs::instance()->mConfirm) {
4035 4035
4036 QString des; 4036 QString des;
4037 if ( !jour->summary().isEmpty() ) { 4037 if ( !jour->summary().isEmpty() ) {
4038 des = jour->summary(); 4038 des = jour->summary();
4039 } else { 4039 } else {
4040 des = jour->description().left(30); 4040 des = jour->description().left(30);
4041 des = des.simplifyWhiteSpace (); 4041 des = des.simplifyWhiteSpace ();
4042 des.replace (QRegExp ("\\n"),"" ); 4042 des.replace (QRegExp ("\\n"),"" );
4043 des.replace (QRegExp ("\\r"),"" ); 4043 des.replace (QRegExp ("\\r"),"" );
4044 } 4044 }
4045 switch (msgItemDelete( i18n("Journal:") +"\n"+KGlobal::formatMessage ( des,0 ))) { 4045 switch (msgItemDelete( i18n("Journal:") +"\n"+KGlobal::formatMessage ( des,0 ))) {
4046 case KMessageBox::Continue: // OK 4046 case KMessageBox::Continue: // OK
4047 calendar()->deleteJournal(jour); 4047 calendar()->deleteJournal(jour);
4048 updateView(); 4048 updateView();
4049 break; 4049 break;
4050 } // switch 4050 } // switch
4051 } else { 4051 } else {
4052 calendar()->deleteJournal(jour);; 4052 calendar()->deleteJournal(jour);;
4053 updateView(); 4053 updateView();
4054 } 4054 }
4055 emit updateSearchDialog(); 4055 emit updateSearchDialog();
4056} 4056}
4057 4057
4058void CalendarView::deleteEvent(Event *anEvent) 4058void CalendarView::deleteEvent(Event *anEvent)
4059{ 4059{
4060 if (!anEvent) { 4060 if (!anEvent) {
4061 KNotifyClient::beep(); 4061 KNotifyClient::beep();
4062 return; 4062 return;
4063 } 4063 }
4064 4064
4065 if (anEvent->doesRecur()) { 4065 if (anEvent->doesRecur()) {
4066 QDate itemDate = mViewManager->currentSelectionDate(); 4066 QDate itemDate = mViewManager->currentSelectionDate();
4067 int km; 4067 int km;
4068 if (!itemDate.isValid()) { 4068 if (!itemDate.isValid()) {
4069 //kdDebug() << "Date Not Valid" << endl; 4069 //kdDebug() << "Date Not Valid" << endl;
4070 if (KOPrefs::instance()->mConfirm) { 4070 if (KOPrefs::instance()->mConfirm) {
4071 km = KMessageBox::warningContinueCancel(this,KGlobal::formatMessage ( anEvent->summary(),0 ) + 4071 km = KMessageBox::warningContinueCancel(this,KGlobal::formatMessage ( anEvent->summary(),0 ) +
4072 i18n("\nThis event recurs\nover multiple dates.\nAre you sure you want\nto delete this event\nand all its recurrences?"), 4072 i18n("\nThis event recurs\nover multiple dates.\nAre you sure you want\nto delete this event\nand all its recurrences?"),
4073 i18n("KO/Pi Confirmation"),i18n("Delete All")); 4073 i18n("KO/Pi Confirmation"),i18n("Delete All"));
4074 if ( km == KMessageBox::Continue ) 4074 if ( km == KMessageBox::Continue )
4075 km = KMessageBox::No; // No = all below 4075 km = KMessageBox::No; // No = all below
4076 } else 4076 } else
4077 km = KMessageBox::No; 4077 km = KMessageBox::No;
4078 } else { 4078 } else {
4079 km = KMessageBox::warningYesNoCancel(this,KGlobal::formatMessage ( anEvent->summary(),0 ) + 4079 km = KMessageBox::warningYesNoCancel(this,KGlobal::formatMessage ( anEvent->summary(),0 ) +
4080 i18n("\nThis event recurs\nover multiple dates.\nDo you want to delete\nall it's recurrences,\nor only the current one on:\n")+ 4080 i18n("\nThis event recurs\nover multiple dates.\nDo you want to delete\nall it's recurrences,\nor only the current one on:\n")+