summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp27
-rw-r--r--korganizer/kolistview.cpp6
2 files changed, 26 insertions, 7 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 98e0ac1..bc1c0c7 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -2816,13 +2816,13 @@ void CalendarView::slotSelectPickerDate( QDate d)
else
if (to->dtStart() > to->dtDue() )
to->setDtStart(to->dtDue().addDays( -3 ));
}
todoChanged( to );
- } else {
+ } else if ( mMoveIncidence->typeID() == eventID ) {
if ( mMoveIncidence->doesRecur() ) {
#if 0
// PENDING implement this
Incidence* newInc = mMoveIncidence->recreateCloneException( mMoveIncidenceOldDate );
mCalendar()->addIncidence( newInc );
if ( mMoveIncidence->typeID() == todoID )
@@ -2836,14 +2836,18 @@ void CalendarView::slotSelectPickerDate( QDate d)
QTime tim = mMoveIncidence->dtStart().time();
int secs = mMoveIncidence->dtStart().secsTo( mMoveIncidence->dtEnd());
QDateTime dt ( d,tim );
mMoveIncidence->setDtStart( dt );
((Event*)mMoveIncidence)->setDtEnd( dt.addSecs( secs ) );
changeEventDisplay((Event*)mMoveIncidence, KOGlobals::EVENTEDITED);
+ } else if ( mMoveIncidence->typeID() == journalID ) {
+ QTime tim = mMoveIncidence->dtStart().time();
+ QDateTime dt ( d,tim );
+ mMoveIncidence->setDtStart( dt );
+ updateView();
}
-
mMoveIncidence->setRevision( mMoveIncidence->revision()+1 );
}
}
void CalendarView::removeCategories()
{
@@ -3182,22 +3186,25 @@ void CalendarView::cloneIncidence(Incidence * orgInc )
updateView();
}
} else {
delete t;
}
}
- else {
+ else if ( newInc->typeID() == eventID ) {
Event* e = (Event*) newInc;
showEventEditor();
mEventEditor->editEvent( e );
if ( mEventEditor->exec() ) {
mCalendar->addEvent( e );
updateView();
} else {
delete e;
}
+ } if ( newInc->typeID() == journalID ) {
+ mCalendar->addJournal( (Journal*) newInc );
+ editJournal( (Journal*) newInc );
}
setActiveWindow();
}
void CalendarView::newEvent()
{
@@ -3495,13 +3502,13 @@ void CalendarView::deleteTodo(Todo *todo)
if (KOPrefs::instance()->mConfirm) {
QString text = todo->summary().left(20);
if (!todo->relations().isEmpty()) {
text += i18n("\nhas sub-todos.\nAll completed sub-todos\nwill be deleted as well!");
}
- switch (msgItemDelete(text)) {
+ switch (msgItemDelete(i18n("Todo:") +"\n"+text)) {
case KMessageBox::Continue: // OK
bool deleteT = false;
if (!todo->relations().isEmpty()) {
deleteT = removeCompletedSubTodos( todo );
}
// deleteT == true: todo already deleted in removeCompletedSubTodos
@@ -3526,13 +3533,23 @@ void CalendarView::deleteJournal(Journal *jour)
{
if (!jour) {
KNotifyClient::beep();
return;
}
if (KOPrefs::instance()->mConfirm) {
- switch (msgItemDelete( jour->description().left(20))) {
+
+ QString des;
+ if ( !jour->summary().isEmpty() ) {
+ des = jour->summary();
+ } else {
+ des = jour->description().left(30);
+ des = des.simplifyWhiteSpace ();
+ des.replace (QRegExp ("\\n"),"" );
+ des.replace (QRegExp ("\\r"),"" );
+ }
+ switch (msgItemDelete( i18n("Journal:") +"\n"+des.left(20))) {
case KMessageBox::Continue: // OK
calendar()->deleteJournal(jour);
updateView();
break;
} // switch
} else {
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp
index 5f90dc6..7783dd4 100644
--- a/korganizer/kolistview.cpp
+++ b/korganizer/kolistview.cpp
@@ -968,14 +968,16 @@ void KOListView::resetFocus()
topLevelWidget()->raise();
mListView->setFocus();
}
void KOListView::updateView()
{
mListView->setFocus();
- if ( mListView->firstChild () )
+ if ( mListView->firstChild () ) {
mListView->setCurrentItem( mListView->firstChild () );
+ }
+ processSelectionChange( mListView->firstChild () );
}
void KOListView::updateConfig()
{
mListView->setFont ( KOPrefs::instance()->mListViewFont );
updateView();
@@ -994,13 +996,13 @@ void KOListView::showDates(const QDate &start, const QDate &end)
while( date <= end ) {
addEvents(calendar()->events(date));
addTodos(calendar()->todos(date));
addJournals( calendar()->journals4Date(date) );
date = date.addDays( 1 );
}
- emit incidenceSelected( 0 );
+ //emit incidenceSelected( 0 );
updateView();
}
void KOListView::addEvents(QPtrList<Event> eventList)
{