-rw-r--r-- | korganizer/calendarview.cpp | 52 | ||||
-rw-r--r-- | korganizer/calendarview.h | 2 | ||||
-rw-r--r-- | korganizer/koeditorgeneral.cpp | 20 | ||||
-rw-r--r-- | korganizer/koeditorgeneral.h | 1 | ||||
-rw-r--r-- | korganizer/kotodoview.cpp | 5 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 11 |
6 files changed, 65 insertions, 26 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 8f05276..038da54 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -2186,7 +2186,7 @@ void CalendarView::updateUnmanagedViews() | |||
2186 | } | 2186 | } |
2187 | 2187 | ||
2188 | int CalendarView::msgItemDelete() | 2188 | int CalendarView::msgItemDelete(const QString name) |
2189 | { | 2189 | { |
2190 | return KMessageBox::warningContinueCancel(this, | 2190 | return KMessageBox::warningContinueCancel(this,name +"\n\n"+ |
2191 | i18n("This item will be\npermanently deleted."), | 2191 | i18n("This item will be\npermanently deleted."), |
2192 | i18n("KO/Pi Confirmation"),i18n("Delete")); | 2192 | i18n("KO/Pi Confirmation"),i18n("Delete")); |
@@ -2889,10 +2889,17 @@ void CalendarView::deleteTodo(Todo *todo) | |||
2889 | } | 2889 | } |
2890 | if (KOPrefs::instance()->mConfirm) { | 2890 | if (KOPrefs::instance()->mConfirm) { |
2891 | switch (msgItemDelete()) { | 2891 | QString text = todo->summary().left(20); |
2892 | if (!todo->relations().isEmpty()) { | ||
2893 | text += i18n("\nhas sub-todos.\nAll completed sub-todos\nwill be deleted as well!"); | ||
2894 | |||
2895 | } | ||
2896 | switch (msgItemDelete(text)) { | ||
2892 | case KMessageBox::Continue: // OK | 2897 | case KMessageBox::Continue: // OK |
2898 | bool deleteT = false; | ||
2893 | if (!todo->relations().isEmpty()) { | 2899 | if (!todo->relations().isEmpty()) { |
2894 | KMessageBox::sorry(this,i18n("Cannot delete To-Do\nwhich has children."), | 2900 | deleteT = removeCompletedSubTodos( todo ); |
2895 | i18n("Delete To-Do")); | 2901 | } |
2896 | } else { | 2902 | // deleteT == true: todo already deleted in removeCompletedSubTodos |
2903 | if ( !deleteT ) { | ||
2897 | checkExternalId( todo ); | 2904 | checkExternalId( todo ); |
2898 | calendar()->deleteTodo(todo); | 2905 | calendar()->deleteTodo(todo); |
@@ -2903,14 +2910,10 @@ void CalendarView::deleteTodo(Todo *todo) | |||
2903 | } // switch | 2910 | } // switch |
2904 | } else { | 2911 | } else { |
2905 | if (!todo->relations().isEmpty()) { | 2912 | checkExternalId( todo ); |
2906 | KMessageBox::sorry(this,i18n("Cannot delete To-Do\nwhich has children."), | 2913 | mCalendar->deleteTodo(todo); |
2907 | i18n("Delete To-Do")); | 2914 | changeTodoDisplay( todo,KOGlobals::EVENTDELETED ); |
2908 | } else { | 2915 | updateView(); |
2909 | checkExternalId( todo ); | ||
2910 | mCalendar->deleteTodo(todo); | ||
2911 | changeTodoDisplay( todo,KOGlobals::EVENTDELETED ); | ||
2912 | updateView(); | ||
2913 | } | ||
2914 | } | 2916 | } |
2917 | |||
2915 | emit updateSearchDialog(); | 2918 | emit updateSearchDialog(); |
2916 | } | 2919 | } |
@@ -2922,5 +2925,5 @@ void CalendarView::deleteJournal(Journal *jour) | |||
2922 | } | 2925 | } |
2923 | if (KOPrefs::instance()->mConfirm) { | 2926 | if (KOPrefs::instance()->mConfirm) { |
2924 | switch (msgItemDelete()) { | 2927 | switch (msgItemDelete( jour->description().left(20))) { |
2925 | case KMessageBox::Continue: // OK | 2928 | case KMessageBox::Continue: // OK |
2926 | calendar()->deleteJournal(jour); | 2929 | calendar()->deleteJournal(jour); |
@@ -3484,4 +3487,21 @@ void CalendarView::showDates(const DateList &selectedDates) | |||
3484 | if (selectedDates.first() < selectedDates.last() ) | 3487 | if (selectedDates.first() < selectedDates.last() ) |
3485 | selDates += " - " + KGlobal::locale()->formatDate( selectedDates.last(),true); | 3488 | selDates += " - " + KGlobal::locale()->formatDate( selectedDates.last(),true); |
3489 | else { | ||
3490 | QString addString; | ||
3491 | if ( selectedDates.first() == QDateTime::currentDateTime().date() ) | ||
3492 | addString = i18n("Today"); | ||
3493 | else if ( selectedDates.first() == QDateTime::currentDateTime().date().addDays(1) ) | ||
3494 | addString = i18n("Tomorrow"); | ||
3495 | else if ( selectedDates.first() == QDateTime::currentDateTime().date().addDays(-1) ) | ||
3496 | addString = i18n("Yesterday"); | ||
3497 | else if ( selectedDates.first() == QDateTime::currentDateTime().date().addDays(-2) ) | ||
3498 | addString = i18n("Day before yesterday"); | ||
3499 | else if ( selectedDates.first() == QDateTime::currentDateTime().date().addDays(2) ) | ||
3500 | addString = i18n("Day after tomorrow"); | ||
3501 | if ( !addString.isEmpty() ) { | ||
3502 | topLevelWidget()->setCaption( addString+", " + selDates ); | ||
3503 | return; | ||
3504 | } | ||
3505 | } | ||
3486 | topLevelWidget()->setCaption( i18n("Dates: ") + selDates ); | 3506 | topLevelWidget()->setCaption( i18n("Dates: ") + selDates ); |
3487 | 3507 | ||
diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h index e27da9a..c8d6bdd 100644 --- a/korganizer/calendarview.h +++ b/korganizer/calendarview.h | |||
@@ -486,5 +486,5 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser | |||
486 | 486 | ||
487 | // returns KMsgBox::OKCandel() | 487 | // returns KMsgBox::OKCandel() |
488 | int msgItemDelete(); | 488 | int msgItemDelete(const QString name); |
489 | void showEventEditor(); | 489 | void showEventEditor(); |
490 | void showTodoEditor(); | 490 | void showTodoEditor(); |
diff --git a/korganizer/koeditorgeneral.cpp b/korganizer/koeditorgeneral.cpp index 94e1f4c..b4fe965 100644 --- a/korganizer/koeditorgeneral.cpp +++ b/korganizer/koeditorgeneral.cpp | |||
@@ -284,4 +284,18 @@ void KOEditorGeneral::pickAlarmProgram() | |||
284 | 284 | ||
285 | 285 | ||
286 | QString KOEditorGeneral::getFittingPath( const QString s ) | ||
287 | { | ||
288 | int maxlen = 50; | ||
289 | if ( QApplication::desktop()->width() < 640 ) { | ||
290 | if ( QApplication::desktop()->width() < 320 ) | ||
291 | maxlen = 22; | ||
292 | else | ||
293 | maxlen = 35; | ||
294 | } | ||
295 | if ( s.length() > maxlen ) { | ||
296 | return "..."+s.right(maxlen -3); | ||
297 | } | ||
298 | return s; | ||
299 | } | ||
286 | 300 | ||
287 | void KOEditorGeneral::enableAlarmEdit(bool enable) | 301 | void KOEditorGeneral::enableAlarmEdit(bool enable) |
@@ -298,10 +312,10 @@ void KOEditorGeneral::enableAlarmEdit(bool enable) | |||
298 | } | 312 | } |
299 | if (mAlarmProgramButton->isOn()) | 313 | if (mAlarmProgramButton->isOn()) |
300 | ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + mAlarmProgram ); | 314 | ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + getFittingPath(mAlarmProgram) ); |
301 | if (!mAlarmSound.isEmpty() && mAlarmSoundButton->isOn()) | 315 | if (!mAlarmSound.isEmpty() && mAlarmSoundButton->isOn()) |
302 | ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Sound.Al.: ") + mAlarmSound ); | 316 | ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Audio Al.: ") + getFittingPath(mAlarmSound) ); |
303 | } | 317 | } |
304 | else { | 318 | else { |
305 | ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Alarm disabled")); | 319 | ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Alarm disabled for this item")); |
306 | 320 | ||
307 | } | 321 | } |
diff --git a/korganizer/koeditorgeneral.h b/korganizer/koeditorgeneral.h index c58335e..de8edaf 100644 --- a/korganizer/koeditorgeneral.h +++ b/korganizer/koeditorgeneral.h | |||
@@ -106,4 +106,5 @@ class KOEditorGeneral : public QObject | |||
106 | 106 | ||
107 | private: | 107 | private: |
108 | QString getFittingPath( const QString ) ; | ||
108 | QString mAlarmSound; | 109 | QString mAlarmSound; |
109 | QString mAlarmProgram; | 110 | QString mAlarmProgram; |
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp index 97b4a03..30adb06 100644 --- a/korganizer/kotodoview.cpp +++ b/korganizer/kotodoview.cpp | |||
@@ -819,10 +819,5 @@ void KOTodoView::deleteTodo() | |||
819 | { | 819 | { |
820 | if (mActiveItem) { | 820 | if (mActiveItem) { |
821 | if (mActiveItem->childCount()) { | ||
822 | KMessageBox::sorry(this,i18n("Cannot delete To-Do which has children."), | ||
823 | i18n("Delete To-Do")); | ||
824 | } else { | ||
825 | emit deleteTodoSignal(mActiveItem->todo()); | 821 | emit deleteTodoSignal(mActiveItem->todo()); |
826 | } | ||
827 | } | 822 | } |
828 | } | 823 | } |
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 151b55b..7b07a2e 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -1705,5 +1705,14 @@ void MainWindow::setCaptionToDates() | |||
1705 | selDates = KGlobal::locale()->formatDate(mView->startDate(), true); | 1705 | selDates = KGlobal::locale()->formatDate(mView->startDate(), true); |
1706 | if (mView->startDate() < mView->endDate() ) | 1706 | if (mView->startDate() < mView->endDate() ) |
1707 | selDates += " - " + KGlobal::locale()->formatDate(mView->endDate(), true); | 1707 | selDates += " - " + KGlobal::locale()->formatDate(mView->endDate(), true); |
1708 | else { | ||
1709 | QString addString; | ||
1710 | if ( mView->startDate() == QDateTime::currentDateTime().date() ) | ||
1711 | addString = i18n("Today"); | ||
1712 | else if ( mView->startDate() == QDateTime::currentDateTime().date().addDays(1) ) | ||
1713 | addString = i18n("Tomorrow"); | ||
1714 | if ( !addString.isEmpty() ) | ||
1715 | selDates = addString+", "+selDates ; | ||
1716 | } | ||
1708 | setCaption( i18n("Dates: ") + selDates ); | 1717 | setCaption( i18n("Dates: ") + selDates ); |
1709 | 1718 | ||