summaryrefslogtreecommitdiffabout
path: root/korganizer
Side-by-side diff
Diffstat (limited to 'korganizer') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/koagenda.cpp2
-rw-r--r--korganizer/koagendaview.cpp3
-rw-r--r--korganizer/koeditorgeneraltodo.h1
-rw-r--r--korganizer/kotodoeditor.cpp12
4 files changed, 13 insertions, 5 deletions
diff --git a/korganizer/koagenda.cpp b/korganizer/koagenda.cpp
index 7c41cab..0aef929 100644
--- a/korganizer/koagenda.cpp
+++ b/korganizer/koagenda.cpp
@@ -1448,49 +1448,49 @@ void KOAgenda::updateTodo( Todo * todo, int days, bool remove)
globalFlagBlockAgendaItemUpdate = 1;
itemit->repaint();
}
blockSignals( false );
}
if ( remove ) {
//qDebug("remove****************************************** ");
return;
}
//qDebug("updateTodo+++++++++++++++++++++++++++++++++++++ ");
bool overdue = (!todo->isCompleted()) && (todo->dtDue() < QDate::currentDate())&& ( KOPrefs::instance()->mShowTodoInAgenda );
QDate currentDate;
QDateTime dt;
if ( todo->hasCompletedDate() )
dt = todo->completed();
else
dt = todo->dtDue();
if ( overdue ) {
currentDate = QDate::currentDate();
days += todo->dtDue().date().daysTo( currentDate );
}
else
currentDate = dt.date();
- if ( todo->doesFloat() || overdue ) {
+ if (( todo->doesFloat() || overdue) && !todo->hasCompletedDate() ) {
if ( ! mAllDayMode ) return;
// aldayagenda
globalFlagBlockAgendaItemPaint = 1;
item = insertAllDayItem(todo, currentDate,days, days);
item->show();
}
else {
if ( mAllDayMode ) return;
// mAgenda
globalFlagBlockAgendaItemPaint = 1;
int endY = timeToY(dt.time()) - 1;
int hi = 12/KOPrefs::instance()->mHourSize;
int startY = endY - 1-hi;
item = insertItem(todo,currentDate,days,startY,endY);
item->show();
}
qApp->processEvents();
globalFlagBlockAgendaItemPaint = 0;
QPtrList<KOAgendaItem> oldconflictItems = item->conflictItems();
KOAgendaItem *itemit;
for ( itemit=oldconflictItems.first(); itemit != 0;
itemit=oldconflictItems.next() ) {
globalFlagBlockAgendaItemUpdate = 0;
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp
index 42a6f7c..8b79788 100644
--- a/korganizer/koagendaview.cpp
+++ b/korganizer/koagendaview.cpp
@@ -1486,64 +1486,63 @@ void KOAgendaView::deleteSelectedDateTime()
void KOAgendaView::keyPressEvent ( QKeyEvent * e )
{
e->ignore();
}
void KOAgendaView::scrollOneHourUp()
{
mAgenda->scrollBy ( 0, -mAgenda->contentsHeight () / 24 );
}
void KOAgendaView::scrollOneHourDown()
{
mAgenda->scrollBy ( 0, mAgenda->contentsHeight () / 24 );
}
void KOAgendaView::setStartHour( int h )
{
mAgenda->setStartHour( h );
}
void KOAgendaView::updateTodo( Todo * t, int )
{
-
bool remove = false;
bool removeAD = false;
QDate da;
if ( t->hasCompletedDate() )
da = t->completed().date();
else
da = t->dtDue().date();
if ( ! t->hasDueDate() && !t->hasCompletedDate() ) {
remove = true;
removeAD = true;
}
else {
bool overdue = (!t->isCompleted()) && (t->dtDue() < QDate::currentDate()) && KOPrefs::instance()->mShowTodoInAgenda ;
if ( overdue &&
QDate::currentDate() >= mSelectedDates.first() &&
QDate::currentDate() <= mSelectedDates.last()) {
removeAD = false;
remove = true;
}
else {
if ( da < mSelectedDates.first() ||
da > mSelectedDates.last() ) {
remove = true;
removeAD = true;
} else {
remove = t->doesFloat() && !t->hasCompletedDate();
removeAD = !remove;
}
}
}
int days = mSelectedDates.first().daysTo( da );
- // qDebug("daysto %d ", days );
+ //qDebug("daysto %d %d %d", days, remove,removeAD );
mAgenda->updateTodo( t , days, remove);
if ( KOPrefs::instance()->mShowTodoInAgenda )
mAllDayAgenda->updateTodo( t , days, removeAD);
//qDebug("KOAgendaView::updateTodo( Todo *, int ) ");
}
diff --git a/korganizer/koeditorgeneraltodo.h b/korganizer/koeditorgeneraltodo.h
index f6c30f8..5f1c3cc 100644
--- a/korganizer/koeditorgeneraltodo.h
+++ b/korganizer/koeditorgeneraltodo.h
@@ -64,42 +64,43 @@ class KOEditorGeneralTodo : public KOEditorGeneral
/** Write todo settings to event object */
void writeTodo(Todo *);
/** Check if the input is valid. */
bool validateInput();
/** The todo has been modified externally */
void modified (Todo*, int);
signals:
void openCategoryDialog();
protected slots:
void completedChanged(int);
void enableDueEdit( bool enable );
void enableStartEdit( bool enable );
void enableTimeEdits( bool enable );
void showAlarm();
protected:
void setCompletedDate();
private:
+ friend class KOTodoEditor;
KDateEdit *mStartDateEdit;
KOTimeEdit *mStartTimeEdit;
QCheckBox *mTimeButton;
QCheckBox *mDueCheck;
KDateEdit *mDueDateEdit;
KOTimeEdit *mDueTimeEdit;
QComboBox *mCompletedCombo;
QLabel *mCompletedLabel;
QLabel *mPriorityLabel;
QComboBox *mPriorityCombo;
QCheckBox *mStartCheck;
QDateTime mCompleted;
};
#endif
diff --git a/korganizer/kotodoeditor.cpp b/korganizer/kotodoeditor.cpp
index 16c19a4..ec5c2d1 100644
--- a/korganizer/kotodoeditor.cpp
+++ b/korganizer/kotodoeditor.cpp
@@ -24,48 +24,49 @@
#include <qtooltip.h>
#include <qframe.h>
#include <qpixmap.h>
#include <qlayout.h>
#include <qhbox.h>
#include <qdir.h>
#include <qdatetime.h>
#include <qapplication.h>
#include <kiconloader.h>
#include <klocale.h>
#include <kfiledialog.h>
#include <kstandarddirs.h>
#include <kmessagebox.h>
#include <libkdepim/categoryselectdialog.h>
#include <libkcal/calendarlocal.h>
#include <libkcal/calendarresources.h>
#include <libkcal/resourcecalendar.h>
#include <libkcal/icalformat.h>
#include <kresources/resourceselectdialog.h>
#include "koprefs.h"
+#include "kolocationbox.h"
#include "kotodoeditor.h"
extern int globalFlagBlockAgenda;
KOTodoEditor::KOTodoEditor( Calendar *calendar, QWidget *parent ) :
KOIncidenceEditor( i18n("Edit To-Do"), calendar, parent )
{
mTodo = 0;
mRelatedTodo = 0;
findButton(User1)->hide();
init();
}
KOTodoEditor::~KOTodoEditor()
{
emit dialogClose( mTodo );
}
void KOTodoEditor::init()
{
setupGeneral();
setupAttendeesTab();
}
void KOTodoEditor::setCategories( QString s )
@@ -255,50 +256,57 @@ void KOTodoEditor::deleteTodo()
}
}
else {
emit todoToBeDeleted(mTodo);
emit dialogClose(mTodo);
mCalendar->deleteTodo(mTodo);
emit todoDeleted();
reject();
}
} else {
reject();
}
}
void KOTodoEditor::setDefaults(QDateTime due,Todo *relatedEvent,bool allDay)
{
mRelatedTodo = relatedEvent;
mGeneral->setDefaults(due,allDay);
mDetails->setDefaults();
showPage( 0 );
if ( mRelatedTodo ) {
mGeneral->setCategories (mRelatedTodo->categoriesStr ());
mGeneral->setSecrecy (mRelatedTodo->secrecy ());
-
- }
+ if ( mRelatedTodo->priority() < 3 )
+ mGeneral->mPriorityCombo->setCurrentItem(mRelatedTodo->priority()-1);
+ mGeneral->mSummaryEdit->lineEdit()->setText(mRelatedTodo->summary()+": ");
+ int len = mRelatedTodo->summary().length();
+ mGeneral->mSummaryEdit->lineEdit()->setSelection ( 0, len+2 );
+ mGeneral->mSummaryEdit->lineEdit()->setCursorPosition ( len+2 );
+ mGeneral->mSummaryEdit->lineEdit()->setFocus();
+
+ } else
mGeneral->setFocusOn( 2 );
}
void KOTodoEditor::readTodo(Todo *todo)
{
mGeneral->readTodo(todo);
mDetails->readEvent(todo);
mRelatedTodo = 0;//todo->relatedTo();
// categories
// mCategoryDialog->setSelected(todo->categories());
// We should handle read-only events here.
}
void KOTodoEditor::writeTodo(Todo *event)
{
mGeneral->writeTodo(event);
mDetails->writeEvent(event);
// set related event, i.e. parent to-do in this case.
if (mRelatedTodo) {
event->setRelatedTo(mRelatedTodo);
}
}