summaryrefslogtreecommitdiffabout
path: root/korganizer
Side-by-side diff
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp2
-rw-r--r--korganizer/koagenda.cpp2
-rw-r--r--korganizer/kotodoeditor.cpp5
-rw-r--r--korganizer/kotodoview.cpp62
-rw-r--r--korganizer/kotodoview.h7
5 files changed, 73 insertions, 5 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index e7b6755..0c39590 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -2716,7 +2716,7 @@ void CalendarView::newSubTodo(Todo *parentEvent)
{
showTodoEditor();
- mTodoEditor->newTodo(QDateTime::currentDateTime().addDays(7),parentEvent,true);
+ mTodoEditor->newTodo(QDateTime(),parentEvent,true);
}
void CalendarView::newFloatingEvent()
diff --git a/korganizer/koagenda.cpp b/korganizer/koagenda.cpp
index 0eeacb3..002234d 100644
--- a/korganizer/koagenda.cpp
+++ b/korganizer/koagenda.cpp
@@ -438,7 +438,7 @@ bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me)
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;
diff --git a/korganizer/kotodoeditor.cpp b/korganizer/kotodoeditor.cpp
index abeb068..16c19a4 100644
--- a/korganizer/kotodoeditor.cpp
+++ b/korganizer/kotodoeditor.cpp
@@ -273,8 +273,11 @@ void KOTodoEditor::setDefaults(QDateTime due,Todo *relatedEvent,bool allDay)
mGeneral->setDefaults(due,allDay);
mDetails->setDefaults();
showPage( 0 );
- if ( mRelatedTodo )
+ if ( mRelatedTodo ) {
mGeneral->setCategories (mRelatedTodo->categoriesStr ());
+ mGeneral->setSecrecy (mRelatedTodo->secrecy ());
+
+ }
mGeneral->setFocusOn( 2 );
}
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp
index 30adb06..22486ba 100644
--- a/korganizer/kotodoview.cpp
+++ b/korganizer/kotodoview.cpp
@@ -429,6 +429,7 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) :
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"),
@@ -438,6 +439,7 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) :
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);
@@ -449,8 +451,15 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) :
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 );
@@ -522,6 +531,10 @@ void KOTodoView::updateView()
//qDebug("blocked ");
return;
}
+ if ( isFlatDisplay ) {
+ setAllFlat();
+ return;
+ }
//qDebug("update ");
// kdDebug() << "KOTodoView::updateView()" << endl;
QFont fo = KOPrefs::instance()->mTodoViewFont;
@@ -997,6 +1010,53 @@ 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()
{
diff --git a/korganizer/kotodoview.h b/korganizer/kotodoview.h
index 5ca0362..f11518d 100644
--- a/korganizer/kotodoview.h
+++ b/korganizer/kotodoview.h
@@ -161,6 +161,10 @@ class KOTodoView : public KOrg::BaseView
void setNewPercentage(int);
void changedCategories(int);
+ void setAllOpen();
+ void setAllClose();
+ void setAllFlat();
+
void purgeCompleted();
void toggleCompleted();
void toggleRunning();
@@ -210,7 +214,8 @@ class KOTodoView : public KOrg::BaseView
void restoreItemState( QListViewItem * );
bool checkTodo( Todo * );
-
+ bool isFlatDisplay;
+ void setOpen( QListViewItem*, bool setOpen);
KOTodoListView *mTodoListView;
QPopupMenu *mItemPopupMenu;
QPopupMenu *mPopupMenu;