-rw-r--r-- | bin/kdepim/korganizer/germantranslation.txt | 7 | ||||
-rw-r--r-- | korganizer/calendarview.cpp | 2 | ||||
-rw-r--r-- | korganizer/koagenda.cpp | 2 | ||||
-rw-r--r-- | korganizer/kotodoeditor.cpp | 5 | ||||
-rw-r--r-- | korganizer/kotodoview.cpp | 62 | ||||
-rw-r--r-- | korganizer/kotodoview.h | 7 |
6 files changed, 80 insertions, 5 deletions
diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt index 8572bf9..0538511 100644 --- a/bin/kdepim/korganizer/germantranslation.txt +++ b/bin/kdepim/korganizer/germantranslation.txt @@ -1187,19 +1187,26 @@ { "\nhas sub-todos.\nAll completed sub-todos\nwill be deleted as well!","\nhat Unter-Todos.\nAlle erledigten Unter-Todos\nwerden auch gelöscht!" }, { "Yesterday","Gestern" }, { "Day after tomorrow","Übermorgen" }, { "Tomorrow","Morgen" }, { "Day before yesterday","Vorgestern" }, { "Size %1","Größe %1" }, { "New Agendasize: %1","Neue Agendagröße: %1" }, { " (%1 y.)"," (%1 J.)" }, { "Allday:","Ganztägig:" }, { "compl.todos","erled.Todos" }, { "Day view","Tagesansicht" }, { "Next days","Nächste Tage" }, { "Next week","Nächste Woche" }, { "Next two weeks","Nächste zwei Wochen" }, { "Next month","Nächster Monat" }, { "Journal view","Journal" }, +{ "Display all opened","Zeige alle geöffnet" }, +{ "Display all closed","Zeige alle geschlossen" }, +{ "Display all flat","Zeige alle flach" }, +{ "","" }, +{ "","" }, +{ "","" }, +{ "","" }, { "","" }, { "","" }, { "","" }, diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index e7b6755..0c39590 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp @@ -2703,33 +2703,33 @@ void CalendarView::newTodoDateTime( QDateTime dt, bool allday ) void CalendarView::newTodo() { newTodoDateTime( QDateTime(),true ); } void CalendarView::newSubTodo() { Todo *todo = selectedTodo(); if ( todo ) newSubTodo( todo ); } void CalendarView::newSubTodo(Todo *parentEvent) { showTodoEditor(); - mTodoEditor->newTodo(QDateTime::currentDateTime().addDays(7),parentEvent,true); + mTodoEditor->newTodo(QDateTime(),parentEvent,true); } void CalendarView::newFloatingEvent() { DateList tmpList = mNavigator->selectedDates(); QDate date = tmpList.first(); newEvent( QDateTime( date, QTime( 12, 0, 0 ) ), QDateTime( date, QTime( 12, 0, 0 ) ), true ); } void CalendarView::editEvent( Event *event ) { if ( !event ) return; diff --git a/korganizer/koagenda.cpp b/korganizer/koagenda.cpp index 0eeacb3..002234d 100644 --- a/korganizer/koagenda.cpp +++ b/korganizer/koagenda.cpp @@ -425,33 +425,33 @@ bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me) Incidence *incidence = mActionItem->incidence(); if ( incidence->isReadOnly() /*|| incidence->recurrence()->doesRecur() */) { mActionItem = 0; } else { startItemAction(viewportPos); startX = viewportPos.x(); startY = viewportPos.y(); block = true; } } } } else { selectItem(0); mActionItem = 0; if (me->button() == RightButton ) { blockNewEvent = true; - qDebug("right "); + //qDebug("right "); int x,y; viewportToContents(viewportPos.x(),viewportPos.y(),x,y); int gx,gy; contentsToGrid(x,y,gx,gy); mStartCellX = gx; mStartCellY = gy; mCurrentCellX = gx; mCurrentCellY = gy; mNewItemPopup->popup( viewport()->mapToGlobal( me->pos() ) ); } else { blockNewEvent = false; setCursor(arrowCursor); startSelectAction(viewportPos); } } diff --git a/korganizer/kotodoeditor.cpp b/korganizer/kotodoeditor.cpp index abeb068..16c19a4 100644 --- a/korganizer/kotodoeditor.cpp +++ b/korganizer/kotodoeditor.cpp @@ -260,34 +260,37 @@ void KOTodoEditor::deleteTodo() 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 ) + if ( mRelatedTodo ) { mGeneral->setCategories (mRelatedTodo->categoriesStr ()); + mGeneral->setSecrecy (mRelatedTodo->secrecy ()); + + } 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) { diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp index 30adb06..22486ba 100644 --- a/korganizer/kotodoview.cpp +++ b/korganizer/kotodoview.cpp @@ -416,54 +416,63 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : SLOT (moveTodo())); mItemPopupMenu->insertItem( i18n("Beam..."), this, SLOT (beamTodo())); mItemPopupMenu->insertItem( i18n("Toggle Cancel"), this, 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()),0,21); mItemPopupMenu->insertItem(i18n("Reparent Todo"), this, SLOT (reparentTodo()),0,22); mItemPopupMenu->insertSeparator(); +#if 0 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 ); mItemPopupMenu->insertItem(i18n("toggle running todo","Hide not Running"), this, SLOT( toggleRunning() ),0, 35 ); +#endif mPopupMenu = new QPopupMenu(this); mPopupMenu->insertItem(SmallIconSet("todo"), i18n("New Todo..."), this, SLOT (newTodo()),0,1); mPopupMenu->insertItem(i18n("delete completed To-Dos","Purge Completed"), this, SLOT(purgeCompleted()),0,2); mPopupMenu->insertItem(i18n("Show Completed"), this, SLOT( toggleCompleted() ),0,3 ); mPopupMenu->insertItem(i18n("toggle quick todo","Show Quick Todo"), this, SLOT( toggleQuickTodo() ),0,4 ); mPopupMenu->insertItem(i18n("toggle running todo","Hide not Running"), this, SLOT( toggleRunning() ),0,5 ); + mPopupMenu->insertItem(i18n(" set all open","Display all opened"), + this, SLOT( setAllOpen() ),0,6 ); + mPopupMenu->insertItem(i18n(" set all close","Display all closed"), + this, SLOT( setAllClose() ),0,7 ); + mPopupMenu->insertItem(i18n(" set all flat","Display all flat"), + this, SLOT( setAllFlat() ),0,8 ); mDocPrefs = new DocPrefs( name ); - + + mItemPopupMenu->insertItem(i18n("Todo View"),mPopupMenu ); mPopupMenu->setCheckable( true ); mItemPopupMenu->setCheckable( true ); mPopupMenu->setItemChecked( 3,KOPrefs::instance()->mShowCompletedTodo ); mItemPopupMenu->setItemChecked( 33 , KOPrefs::instance()->mShowCompletedTodo ); mPopupMenu->setItemChecked(4,KOPrefs::instance()->mEnableQuickTodo); mItemPopupMenu->setItemChecked( 34 , KOPrefs::instance()->mEnableQuickTodo ); mPopupMenu->setItemChecked(5,KOPrefs::instance()->mHideNonStartedTodos); mItemPopupMenu->setItemChecked( 35 , KOPrefs::instance()->mHideNonStartedTodos ); // Double clicking conflicts with opening/closing the subtree connect( mTodoListView, SIGNAL( doubleClicked( QListViewItem *) ), @@ -509,32 +518,36 @@ KOTodoView::~KOTodoView() void KOTodoView::jumpToDate () { // if (mActiveItem) { // mActiveItem->todo()); // if ( mActiveItem->todo()->hasDueDate() ) // emit mActiveItem->todo()jumpToTime( mTodo->dtDue().date() ); } void KOTodoView::updateView() { pendingSubtodo = 0; if ( mBlockUpdate ) { //qDebug("blocked "); return; } + if ( isFlatDisplay ) { + setAllFlat(); + return; + } //qDebug("update "); // kdDebug() << "KOTodoView::updateView()" << endl; QFont fo = KOPrefs::instance()->mTodoViewFont; mTodoListView->clear(); if ( mName == "todolistsmall" ) { if ( KOPrefs::instance()->mTodoViewUsesSmallFont ) { int ps = fo.pointSize() -2; if ( ps > 12 ) ps -= 2; fo.setPointSize( ps ); } } mTodoListView->setFont( fo ); // QFontMetrics fm ( KOPrefs::instance()->mTodoViewFont ); //mTodoListView->header()->setMaximumHeight(fm.height()); @@ -984,32 +997,79 @@ void KOTodoView::processSelectionChange() emit incidenceSelected( item->todo() ); } } void KOTodoView::modified(bool b) { emit isModified(b); } void KOTodoView::setTodoModified( Todo* todo ) { todoModified( todo, KOGlobals::UNKNOWN_MODIFIED ); } void KOTodoView::clearSelection() { mTodoListView->selectAll( false ); } +void KOTodoView::setAllOpen() +{ + if ( isFlatDisplay ) { + isFlatDisplay = false; + mPopupMenu->setItemChecked( 8,false ); + updateView(); + } + setOpen(mTodoListView->firstChild(), true); +} +void KOTodoView::setAllClose() +{ + if ( isFlatDisplay ) { + isFlatDisplay = false; + mPopupMenu->setItemChecked( 8,false ); + updateView(); + } + setOpen(mTodoListView->firstChild(), false); +} +void KOTodoView::setOpen( QListViewItem* item, bool setOpenI) +{ + + while ( item ) { + setOpen( item->firstChild(), setOpenI ); + item->setOpen( setOpenI ); + item = item->nextSibling(); + } +} + +void KOTodoView::setAllFlat() +{ + pendingSubtodo = 0; + if ( mBlockUpdate ) { + return; + } + mPopupMenu->setItemChecked( 8,true ); + isFlatDisplay = true; + QPtrList<Todo> todoList = calendar()->todos(); + mTodoMap.clear(); + mTodoListView->clear(); + Todo *todo; + for(todo = todoList.first(); todo; todo = todoList.next()) { + KOTodoViewItem *todoItem = new KOTodoViewItem(mTodoListView,todo,this); + mTodoMap.insert(todo,todoItem); + } + mTodoListView->setFocus(); + processSelectionChange(); +} void KOTodoView::purgeCompleted() { emit purgeCompletedSignal(); } void KOTodoView::toggleQuickTodo() { if ( mQuickAdd->isVisible() ) { mQuickAdd->hide(); KOPrefs::instance()->mEnableQuickTodo = false; } else { mQuickAdd->show(); KOPrefs::instance()->mEnableQuickTodo = true; } mPopupMenu->setItemChecked(4,KOPrefs::instance()->mEnableQuickTodo); diff --git a/korganizer/kotodoview.h b/korganizer/kotodoview.h index 5ca0362..f11518d 100644 --- a/korganizer/kotodoview.h +++ b/korganizer/kotodoview.h @@ -148,32 +148,36 @@ class KOTodoView : public KOrg::BaseView void newTodo(); void newSubTodo(); void unparentTodo(); void reparentTodo(); void showTodo(); void editTodo(); void cloneTodo(); void cancelTodo(); void moveTodo(); void beamTodo(); void deleteTodo(); void setNewPriority(int); void setNewPercentage(int); void changedCategories(int); + void setAllOpen(); + void setAllClose(); + void setAllFlat(); + void purgeCompleted(); void toggleCompleted(); void toggleRunning(); void toggleQuickTodo(); void updateTodo( Todo *, int ); void itemClicked(QListViewItem *); void itemStateChanged(QListViewItem *); void modified(bool); void itemDoubleClicked(QListViewItem *item); signals: void newTodoSignal(); void newSubTodoSignal(Todo *); void unparentTodoSignal(Todo *); void reparentTodoSignal( Todo *,Todo * ); @@ -197,33 +201,34 @@ class KOTodoView : public KOrg::BaseView private: /* * the TodoEditor approach is rather unscaling in the long * run. * Korganizer keeps it in memory and we need to update * 1. make KOTodoViewItem a QObject again? * 2. add a public method for setting one todo modified? * 3. add a private method for setting a todo modified + friend here? * -- zecke 2002-07-08 */ friend class KOTodoViewItem; void setTodoModified( Todo* ); QMap<Todo *,KOTodoViewItem *>::ConstIterator insertTodoItem(Todo *todo); void restoreItemState( QListViewItem * ); bool checkTodo( Todo * ); - + bool isFlatDisplay; + void setOpen( QListViewItem*, bool setOpen); KOTodoListView *mTodoListView; QPopupMenu *mItemPopupMenu; QPopupMenu *mPopupMenu; QPopupMenu *mPriorityPopupMenu; QPopupMenu *mPercentageCompletedPopupMenu; QPopupMenu *mCategoryPopupMenu; QMap<int, int> mPercentage; QMap<int, int> mPriority; QMap<int, QString> mCategory; KOTodoViewItem *mActiveItem; QMap<Todo *,KOTodoViewItem *> mTodoMap; QString mName; DocPrefs *mDocPrefs; |