author | zautrix <zautrix> | 2004-10-16 13:36:11 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-10-16 13:36:11 (UTC) |
commit | c3325ebbb92a2814fcb622caaf71316cfa0c2908 (patch) (side-by-side diff) | |
tree | b53545c39f84fc6ce694f371509b4a9fe2ddd743 | |
parent | 023b3c542a6dd4d1c4b53dba6bb2c68f605a7917 (diff) | |
download | kdepimpi-c3325ebbb92a2814fcb622caaf71316cfa0c2908.zip kdepimpi-c3325ebbb92a2814fcb622caaf71316cfa0c2908.tar.gz kdepimpi-c3325ebbb92a2814fcb622caaf71316cfa0c2908.tar.bz2 |
made todos reparentable
-rw-r--r-- | bin/kdepim/WhatsNew.txt | 8 | ||||
-rw-r--r-- | korganizer/calendarview.cpp | 16 | ||||
-rw-r--r-- | korganizer/calendarview.h | 1 | ||||
-rw-r--r-- | korganizer/kotodoview.cpp | 88 | ||||
-rw-r--r-- | korganizer/kotodoview.h | 3 | ||||
-rw-r--r-- | korganizer/koviewmanager.cpp | 2 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 3 | ||||
-rw-r--r-- | microkde/kdeui/klistview.cpp | 7 | ||||
-rw-r--r-- | microkde/kdeui/klistview.h | 1 |
9 files changed, 122 insertions, 7 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt index eb232fa..e17297a 100644 --- a/bin/kdepim/WhatsNew.txt +++ b/bin/kdepim/WhatsNew.txt @@ -1,10 +1,18 @@ Info about the changes in new versions of KDE-Pim/Pi +********** VERSION 1.9.8 ************ + +Fixed character decoding in OM/Pi. +(e.g. German "Umlaute" were not displayed properly.) + +Made is possible to reparent todos in KO/Pi. +Use contextmenu or keys (look at Help-Keys + Colors) for that. + ********** VERSION 1.9.7 ************ KO/Pi - KA/Pi on Windows: Now a directory can be defined by the user, where the application/config data should be saved. Define your desired path in the evironment variable MICROKDEHOME before starting KO/Pi or KA/Pi. diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index e4a11f5..1f8ad5b 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp @@ -414,16 +414,18 @@ void CalendarView::init() connect( mTodoList, SIGNAL( moveTodoSignal( Incidence * ) ), this, SLOT ( moveIncidence( Incidence * ) ) ); connect( mTodoList, SIGNAL( beamTodoSignal( Incidence * ) ), this, SLOT ( beamIncidence( Incidence * ) ) ); connect( mTodoList, SIGNAL( unparentTodoSignal( Todo * ) ), this, SLOT ( todo_unsub( Todo * ) ) ); + connect( mTodoList, SIGNAL( reparentTodoSignal( Todo *,Todo * ) ), + this, SLOT ( todo_resub( Todo *,Todo * ) ) ); connect( this, SIGNAL( todoModified( Todo *, int )), mTodoList, SLOT( updateTodo( Todo *, int ) ) ); connect( this, SIGNAL( todoModified( Todo *, int )), this, SLOT( changeTodoDisplay( Todo *, int ) ) ); connect( mFilterView, SIGNAL( filterChanged() ), SLOT( updateFilter() ) ); connect( mFilterView, SIGNAL( editFilters() ), SLOT( editFilters() ) ); @@ -2741,16 +2743,30 @@ void CalendarView::appointment_delete() if (!anEvent) { KNotifyClient::beep(); return; } deleteEvent(anEvent); } +void CalendarView::todo_resub( Todo * parent, Todo * sub ) +{ + if (!sub) return; + if (!parent) return; + if ( sub->relatedTo() ) + sub->relatedTo()->removeRelation(sub); + sub->setRelatedTo(parent); + sub->setRelatedToUid(parent->uid()); + parent->addRelation(sub); + sub->updated(); + parent->updated(); + setModified(true); + updateView(); +} void CalendarView::todo_unsub(Todo *anTodo ) { // Todo *anTodo = selectedTodo(); if (!anTodo) return; if (!anTodo->relatedTo()) return; anTodo->relatedTo()->removeRelation(anTodo); anTodo->setRelatedTo(0); anTodo->updated(); diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h index 660cce7..9f56cc8 100644 --- a/korganizer/calendarview.h +++ b/korganizer/calendarview.h @@ -349,16 +349,17 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser void appointment_delete(); /** mails the currently selected event to a particular user as a vCalendar attachment. */ void action_mail(); /* frees a subtodo from it's relation */ void todo_unsub( Todo * ); + void todo_resub( Todo * parent, Todo * sub ); /** Take ownership of selected event. */ void takeOverEvent(); /** Take ownership of all events in calendar. */ void takeOverCalendar(); /** query whether or not the calendar is "dirty". */ diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp index ca5eadd..a8143a0 100644 --- a/korganizer/kotodoview.cpp +++ b/korganizer/kotodoview.cpp @@ -206,16 +206,17 @@ void KOTodoListView::contentsMousePressEvent(QMouseEvent* e) } } } #endif } void KOTodoListView::contentsMouseMoveEvent(QMouseEvent* e) { + #ifndef KORG_NODND // kdDebug() << "KOTodoListView::contentsMouseMoveEvent()" << endl; QListView::contentsMouseMoveEvent(e); if (mMousePressed && (mPressPos - e->pos()).manhattanLength() > QApplication::startDragDistance()) { mMousePressed = false; QListViewItem *item = itemAt(contentsToViewport(mPressPos)); if (item) { @@ -269,16 +270,18 @@ void KOTodoListView::keyPressEvent ( QKeyEvent * e ) switch ( e->key() ) { case Qt::Key_Down: case Qt::Key_Up: QListView::keyPressEvent ( e ); break; case Qt::Key_Left: case Qt::Key_Right: QListView::keyPressEvent ( e ); + e->accept(); + return; break; default: e->ignore(); break; } return; } e->ignore(); @@ -409,17 +412,19 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : SLOT (cancelTodo())); mItemPopupMenu->insertSeparator(); mItemPopupMenu->insertItem( i18n("New Todo..."), this, SLOT (newTodo())); mItemPopupMenu->insertItem(i18n("New Sub-Todo..."), this, SLOT (newSubTodo())); mItemPopupMenu->insertItem(i18n("Unparent Todo"), this, - SLOT (unparentTodo())); + SLOT (unparentTodo()),0,21); + mItemPopupMenu->insertItem(i18n("Reparent Todo"), this, + SLOT (reparentTodo()),0,22); mItemPopupMenu->insertSeparator(); mItemPopupMenu->insertItem(i18n("Delete completed To-Dos","Purge Completed"), this, SLOT( purgeCompleted() ) ); mItemPopupMenu->insertItem(i18n("toggle completed To-Dos","Show Completed"), this, SLOT( toggleCompleted() ),0, 33 ); mItemPopupMenu->insertItem(i18n("toggle quick todo","Show Quick Todo"), this, SLOT( toggleQuickTodo() ),0, 34 ); @@ -434,19 +439,24 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : this, SLOT( toggleQuickTodo() ),0,4 ); mDocPrefs = new DocPrefs( name ); mPopupMenu->setCheckable( true ); mItemPopupMenu->setCheckable( true ); // Double clicking conflicts with opening/closing the subtree connect( mTodoListView, SIGNAL( doubleClicked( QListViewItem *) ), SLOT( editItem( QListViewItem *) ) ); + /* connect( mTodoListView, SIGNAL( rightButtonClicked ( QListViewItem *, const QPoint &,int ) ), SLOT( popupMenu( QListViewItem *, const QPoint & ,int) ) ); + */ + connect( mTodoListView, SIGNAL( contextRequest ( QListViewItem *, + const QPoint &,int ) ), + SLOT( popupMenu( QListViewItem *, const QPoint & ,int) ) ); connect( mTodoListView, SIGNAL( clicked( QListViewItem * ) ), SLOT( itemClicked( QListViewItem * ) ) ); connect( mTodoListView, SIGNAL( double_Clicked( QListViewItem * ) ), SLOT( itemDoubleClicked( QListViewItem * ) ) ); connect( mTodoListView, SIGNAL( todoDropped( Todo * ) ), SLOT( updateView() ) ); connect( mTodoListView, SIGNAL( expanded( QListViewItem * ) ), SLOT( itemStateChanged( QListViewItem * ) ) ); @@ -690,17 +700,16 @@ void KOTodoView::editItem(QListViewItem *item ) void KOTodoView::showItem(QListViewItem *item,const QPoint &,int) { emit showTodoSignal(((KOTodoViewItem *)item)->todo()); } void KOTodoView::popupMenu(QListViewItem *item,const QPoint &,int column) { - mActiveItem = (KOTodoViewItem *)item; if (item) { switch (column){ case 1: mPriorityPopupMenu->popup(QCursor::pos ()); break; case 2: mPercentageCompletedPopupMenu->popup(QCursor::pos ()); break; case 3: @@ -725,16 +734,25 @@ void KOTodoView::newSubTodo() } } 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() { @@ -838,32 +856,62 @@ void KOTodoView::changedCategories(int index) mActiveItem->todo()->setCategories (categories); mActiveItem->construct(); mActiveItem->todo()->setRevision( mActiveItem->todo()->revision()+1 ); todoModified (mActiveItem->todo (), KOGlobals::CATEGORY_MODIFIED); } } void KOTodoView::itemDoubleClicked(QListViewItem *item) { + if ( pendingSubtodo != 0 ) { + topLevelWidget()->setCaption(i18n("Reparenting aborted!")); + } + pendingSubtodo = 0; if (!item) { newTodo(); return; } if ( KOPrefs::instance()->mEditOnDoubleClick ) editItem( item ); else showItem( item , QPoint(), 0 ); } void KOTodoView::itemClicked(QListViewItem *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; + } + } int completed = todoItem->todo()->isCompleted(); // Completed or not? if (todoItem->isOn()) { if (!completed) { todoItem->todo()->setCompleted(QDateTime::currentDateTime()); } } else { if (completed) { @@ -969,26 +1017,58 @@ void KOTodoView::addQuickTodo() mQuickAdd->setText(""); todoModified (todo, KOGlobals::EVENTADDED ); updateView(); } void KOTodoView::keyPressEvent ( QKeyEvent * e ) { // e->ignore(); //return; + //qDebug("KOTodoView::keyPressEvent "); switch ( e->key() ) { case Qt::Key_Down: case Qt::Key_Up: QWidget::keyPressEvent ( e ); break; case Qt::Key_Q: toggleQuickTodo(); break; - + case Qt::Key_U: + if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) { + mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem(); + unparentTodo(); + e->accept(); + } else + e->ignore(); + break; + case Qt::Key_S: + if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) { + mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem(); + reparentTodo(); + e->accept(); + } else + e->ignore(); + break; + case Qt::Key_P: + if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) { + mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem(); + if ( pendingSubtodo ) + itemClicked(mActiveItem); + e->accept(); + } else + e->ignore(); + break; + case Qt::Key_Escape: + if ( pendingSubtodo ) { + itemClicked(0); + e->accept(); + } else + e->ignore(); + break; default: e->ignore(); } if ( true ) { if ( e->key() == Qt::Key_I ) { KOTodoViewItem*cn = (KOTodoViewItem*)mTodoListView->currentItem(); if ( cn ) { diff --git a/korganizer/kotodoview.h b/korganizer/kotodoview.h index 6bf0203..0c08677 100644 --- a/korganizer/kotodoview.h +++ b/korganizer/kotodoview.h @@ -142,16 +142,17 @@ class KOTodoView : public KOrg::BaseView void jumpToDate (); void editItem(QListViewItem *item); void showItem(QListViewItem *item,const QPoint &,int); void popupMenu(QListViewItem *item,const QPoint &,int); void newTodo(); void newSubTodo(); void unparentTodo(); + void reparentTodo(); void showTodo(); void editTodo(); void cloneTodo(); void cancelTodo(); void moveTodo(); void beamTodo(); void deleteTodo(); @@ -168,16 +169,17 @@ class KOTodoView : public KOrg::BaseView void itemStateChanged(QListViewItem *); void modified(bool); void itemDoubleClicked(QListViewItem *item); signals: void newTodoSignal(); void newSubTodoSignal(Todo *); void unparentTodoSignal(Todo *); + void reparentTodoSignal( Todo *,Todo * ); void showTodoSignal(Todo *); void editTodoSignal(Todo *); void deleteTodoSignal(Todo *); void todoModifiedSignal (Todo *, int); void isModified(bool); void cloneTodoSignal( Incidence * ); @@ -221,11 +223,12 @@ class KOTodoView : public KOrg::BaseView QString mName; DocPrefs *mDocPrefs; QString mCurrentDoc; KOQuickTodo *mQuickAdd; bool mBlockUpdate; void todoModified(Todo *, int ); void keyPressEvent ( QKeyEvent * ) ; + KOTodoViewItem * pendingSubtodo; }; #endif diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp index 8e6cc53..391f98c 100644 --- a/korganizer/koviewmanager.cpp +++ b/korganizer/koviewmanager.cpp @@ -493,16 +493,18 @@ void KOViewManager::showTodoView() connect( mTodoView, SIGNAL( todoModifiedSignal( Todo *, int ) ), mMainView, SIGNAL ( todoModified( Todo *, int ) ) ); connect( mTodoView, SIGNAL( cloneTodoSignal( Incidence * ) ), mMainView, SLOT ( cloneIncidence( Incidence * ) ) ); connect( mTodoView, SIGNAL( cancelTodoSignal( Incidence * ) ), mMainView, SLOT ( cancelIncidence( Incidence * ) ) ); connect( mTodoView, SIGNAL( unparentTodoSignal( Todo * ) ), mMainView, SLOT ( todo_unsub( Todo * ) ) ); + connect( mTodoView, SIGNAL( reparentTodoSignal( Todo *,Todo * ) ), + mMainView, SLOT ( todo_resub( Todo *, Todo *) ) ); connect( mTodoView, SIGNAL( moveTodoSignal( Incidence * ) ), mMainView, SLOT ( moveIncidence( Incidence * ) ) ); connect( mTodoView, SIGNAL( beamTodoSignal( Incidence * ) ), mMainView, SLOT ( beamIncidence( Incidence * ) ) ); KConfig *config = KOGlobals::config(); mTodoView->restoreLayout(config,"Todo View"); } diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 8daacc7..06470b8 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp @@ -1142,16 +1142,19 @@ void MainWindow::keyBindings() i18n("<p><b>B</b>: Edit description (details) of selected item</p>\n")+ i18n("<p><b>right</b>: Next week | <b>right+ctrl</b>: Next month</p>\n")+ i18n("<p><b>left</b>: Prev. week | <b>left+ctrl</b>: Prev. month</p>\n")+ i18n("<p><b>del,backspace</b>: Delete selected item</p>\n")+ i18n("<p><h3>In agenda view:</h3></p>\n") + i18n("<p><b>up/down</b>: Scroll agenda view</p>\n")+ i18n("<p><b>ctrl+up/down</b>: Scroll small todo view</p>\n")+ i18n("<p><h3>In todo view:</h3></p>\n") + + i18n("<p><b>shift+U</b>: <b>U</b>nparent todo (make root todo)</p>\n")+ + i18n("<p><b>shift+S</b>: Make <b>S</b>ubtodo (reparent todo)</p>\n")+ + i18n("<p><b>shift+P</b>: Make new <b>P</b>arent for todo selected with shift+S</p>\n")+ i18n("<p><b>Q</b>: Toggle quick todo line edit.</p>\n")+ i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ i18n("<p><b>return</b>: Mark item as completed+one step down.</p>\n")+ i18n("<p><b>return+shift</b>: Mark item as not completed+one step down</p>\n")+ i18n("<p><h3>In list view:</h3></p>\n") + i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ i18n("<p><b>return</b>: Select item+one step down</p>\n")+ i18n("<p><b>return+shift</b>: Deselect item+one step down</p>\n")+ diff --git a/microkde/kdeui/klistview.cpp b/microkde/kdeui/klistview.cpp index 2856f2d..6477d11 100644 --- a/microkde/kdeui/klistview.cpp +++ b/microkde/kdeui/klistview.cpp @@ -1882,20 +1882,21 @@ void KListView::emitContextMenu (KListView*, QListViewItem* i) if (i) p = viewport()->mapToGlobal(itemRect(i).center()); else p = mapToGlobal(rect().center()); emit contextMenu (this, i, p); } -void KListView::emitContextMenu (QListViewItem* i, const QPoint& p, int) +void KListView::emitContextMenu (QListViewItem* i, const QPoint& p, int col) { - qDebug("KListView::emitContextMenu "); - emit contextMenu (this, i, p); + qDebug("KListView::emitContextMenu col"); + emit contextRequest( i, p, col ); + emit contextMenu (this, i, p); } void KListView::setAcceptDrops (bool val) { QListView::setAcceptDrops (val); viewport()->setAcceptDrops (val); } diff --git a/microkde/kdeui/klistview.h b/microkde/kdeui/klistview.h index f7d9f85..8d933f6 100644 --- a/microkde/kdeui/klistview.h +++ b/microkde/kdeui/klistview.h @@ -408,16 +408,17 @@ signals: * Note that you may not delete any @ref QListViewItem objects in slots * connected to this signal. * * This signal is more or less here for the sake of completeness. * You should normally not need to use this. In most cases its better * to use @ref #executed() instead. */ void doubleClicked( QListViewItem *item, const QPoint &pos, int c ); + void contextRequest( QListViewItem *item, const QPoint &pos, int c ); /** * This signal gets emitted whenever something acceptable is * dropped onto the listview. * * @param e is the drop event itself (it has already been accepted) * @param after is the item after which the drop occured (or 0L, if * the drop was above all items) |