summaryrefslogtreecommitdiffabout
path: root/korganizer/kotodoview.cpp
authorzautrix <zautrix>2005-04-14 18:10:19 (UTC)
committer zautrix <zautrix>2005-04-14 18:10:19 (UTC)
commitd334d77ab00b91b9527bb5992b476c656c88b2fa (patch) (side-by-side diff)
tree59679cec875179b5b469830e43303cb9480ab1ac /korganizer/kotodoview.cpp
parentbbdca90c599aaea557d31552c6bc33fc15e397cd (diff)
downloadkdepimpi-d334d77ab00b91b9527bb5992b476c656c88b2fa.zip
kdepimpi-d334d77ab00b91b9527bb5992b476c656c88b2fa.tar.gz
kdepimpi-d334d77ab00b91b9527bb5992b476c656c88b2fa.tar.bz2
transl fix
Diffstat (limited to 'korganizer/kotodoview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kotodoview.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp
index 7817a75..dd2c081 100644
--- a/korganizer/kotodoview.cpp
+++ b/korganizer/kotodoview.cpp
@@ -140,50 +140,50 @@ void KOTodoListView::contentsDropEvent(QDropEvent *e)
if ( !ICalDrag::canDecode( e ) && !VCalDrag::canDecode( e ) &&
!QTextDrag::canDecode( e ) ) {
e->ignore();
return;
}
DndFactory factory( mCalendar );
Todo *todo = factory.createDropTodo(e);
if (todo) {
e->acceptAction();
KOTodoViewItem *destination =
(KOTodoViewItem *)itemAt(contentsToViewport(e->pos()));
Todo *destinationEvent = 0;
if (destination) destinationEvent = destination->todo();
Todo *existingTodo = mCalendar->todo(todo->uid());
if(existingTodo) {
Incidence *to = destinationEvent;
while(to) {
if (to->uid() == todo->uid()) {
KMessageBox::sorry(this,
- i18n("Cannot move To-Do to itself\nor a child of itself"),
- i18n("Drop To-Do"));
+ i18n("Cannot move Todo to itself\nor a child of itself"),
+ i18n("Drop Todo"));
delete todo;
return;
}
to = to->relatedTo();
}
internalDrop = true;
if ( destinationEvent )
reparentTodoSignal( destinationEvent, existingTodo );
else
unparentTodoSignal(existingTodo);
delete todo;
} else {
mCalendar->addTodo(todo);
emit todoDropped(todo, KOGlobals::EVENTADDED);
if ( destinationEvent )
reparentTodoSignal( destinationEvent, todo );
}
}
else {
QString text;
if (QTextDrag::decode(e,text)) {
//QListViewItem *qlvi = itemAt( contentsToViewport(e->pos()) );
KOTodoViewItem *todoi = static_cast<KOTodoViewItem *>(itemAt( contentsToViewport(e->pos()) ));
qDebug("Dropped : " + text);
@@ -941,49 +941,48 @@ void KOTodoView::popupMenu(QListViewItem *item,const QPoint &p,int column)
}
} else mPopupMenu->popup(QCursor::pos());
}
void KOTodoView::newTodo()
{
emit newTodoSignal();
}
void KOTodoView::newSubTodo()
{
if (mActiveItem) {
emit newSubTodoSignal(mActiveItem->todo());
}
}
void KOTodoView::unparentTodo()
{
if (mActiveItem) {
emit unparentTodoSignal(mActiveItem->todo());
}
}
void KOTodoView::reparentTodo()
{
if (mActiveItem) {
- qDebug("KOTodoView::reparentTodo() ");
topLevelWidget()->setCaption(i18n("Click on new parent item"));
pendingSubtodo = mActiveItem;
}
}
void KOTodoView::editTodo()
{
if (mActiveItem) {
emit editTodoSignal(mActiveItem->todo());
}
}
void KOTodoView::cloneTodo()
{
if (mActiveItem) {
emit cloneTodoSignal((Incidence*)mActiveItem->todo());
}
}
void KOTodoView::cancelTodo()
{
if (mActiveItem) {
emit cancelTodoSignal((Incidence*)mActiveItem->todo());
}
}
void KOTodoView::moveTodo()
{
@@ -1141,82 +1140,80 @@ void KOTodoView::toggleRunningItem()
void KOTodoView::itemClicked(QListViewItem *item)
{
//qDebug("KOTodoView::itemClicked %d", item);
if (!item) {
if ( pendingSubtodo != 0 ) {
topLevelWidget()->setCaption(i18n("Reparenting aborted!"));
}
pendingSubtodo = 0;
return;
}
KOTodoViewItem *todoItem = (KOTodoViewItem *)item;
if ( pendingSubtodo != 0 ) {
bool allowReparent = true;
QListViewItem *par = item;
while ( par ) {
if ( par == pendingSubtodo ) {
allowReparent = false;
break;
}
par = par->parent();
}
if ( !allowReparent ) {
topLevelWidget()->setCaption(i18n("Recursive reparenting not possible!"));
- qDebug("Recursive reparenting not possible ");
pendingSubtodo = 0;
} else {
Todo* newParent = todoItem->todo();
Todo* newSub = pendingSubtodo->todo();
pendingSubtodo = 0;
emit reparentTodoSignal( newParent,newSub );
return;
}
}
#if 0
// handled by the item itself
bool completed = todoItem->todo()->isCompleted(); // Completed or not?
qDebug("com %d ",completed );
qDebug("itemclicked ");
if (todoItem->isOn()) {
qDebug("on ");
if (!completed) {
qDebug("set true ");
todoItem->todo()->setCompleted(QDateTime::currentDateTime());
}
} else {
qDebug("not on ");
if (completed) {
qDebug("set false ");
todoItem->todo()->setCompleted(false);
}
}
#endif
}
void KOTodoView::setDocumentId( const QString &id )
{
- kdDebug() << "KOTodoView::setDocumentId()" << endl;
mDocPrefs->setDoc( id );
}
void KOTodoView::itemStateChanged( QListViewItem *item )
{
if (!item) return;
KOTodoViewItem *todoItem = (KOTodoViewItem *)item;
// kdDebug() << "KOTodoView::itemStateChanged(): " << todoItem->todo()->summary() << endl;
if( mDocPrefs ) mDocPrefs->writeEntry( todoItem->todo()->uid(), todoItem->isOpen() );
}
void KOTodoView::saveLayout(KConfig *config, const QString &group) const
{
mTodoListView->saveLayout(config,group);
}
void KOTodoView::restoreLayout(KConfig *config, const QString &group)
{
mTodoListView->restoreLayout(config,group);
}