summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-01-05 14:17:14 (UTC)
committer zautrix <zautrix>2005-01-05 14:17:14 (UTC)
commitdf0200487afbfa59b80a79e548d70b5203019003 (patch) (unidiff)
tree2240de4162736461316c8cb3cd00f87a8a9bf2bd
parentb8410daa179dbff2ebb833071ba50b9da36e6330 (diff)
downloadkdepimpi-df0200487afbfa59b80a79e548d70b5203019003.zip
kdepimpi-df0200487afbfa59b80a79e548d70b5203019003.tar.gz
kdepimpi-df0200487afbfa59b80a79e548d70b5203019003.tar.bz2
todo enhancements/fixes
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/WhatsNew.txt8
-rw-r--r--korganizer/calendarview.cpp4
-rw-r--r--korganizer/koagendaitem.cpp2
-rw-r--r--korganizer/kodialogmanager.cpp2
-rw-r--r--korganizer/koprefs.cpp2
-rw-r--r--korganizer/koprefs.h2
-rw-r--r--korganizer/koprefsdialog.cpp13
-rw-r--r--korganizer/kotodoview.cpp78
-rw-r--r--korganizer/kotodoview.h7
-rw-r--r--korganizer/kotodoviewitem.cpp33
-rw-r--r--korganizer/koviewmanager.cpp1
-rw-r--r--version2
12 files changed, 124 insertions, 30 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt
index ec75fad..bfe87f0 100644
--- a/bin/kdepim/WhatsNew.txt
+++ b/bin/kdepim/WhatsNew.txt
@@ -1,10 +1,18 @@
1Info about the changes in new versions of KDE-Pim/Pi 1Info about the changes in new versions of KDE-Pim/Pi
2 2
3********** VERSION 1.9.16 ************
4
5KO/Pi:
6Fixed search dialog size on Z 6000 (480x640 display).
7Added setting to hide/show time in agenda items.
8Added setting to hide not running todos in todo view.
9Added columns for start date/time in todo view.
10
3********** VERSION 1.9.15 ************ 11********** VERSION 1.9.15 ************
4 12
5Usebilty enhancements in KO/Pi: 13Usebilty enhancements in KO/Pi:
6When clicking on the date in a month view cell, the day view is shown. 14When clicking on the date in a month view cell, the day view is shown.
7Old behaviour was, that the "new event" dialog popped up. 15Old behaviour was, that the "new event" dialog popped up.
8 16
9Added a one step "undo delete" in KO/Pi (Accessable in the "Action" menu). 17Added a one step "undo delete" in KO/Pi (Accessable in the "Action" menu).
10That means, you can restore the latest 18That means, you can restore the latest
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index a46cd87..7ddbe23 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -261,16 +261,17 @@ void CalendarView::init()
261 mLeftSplitter = new QSplitter(QSplitter::Vertical,mPanner, 261 mLeftSplitter = new QSplitter(QSplitter::Vertical,mPanner,
262 "CalendarView::LeftFrame"); 262 "CalendarView::LeftFrame");
263 mPanner->setResizeMode(mLeftSplitter,QSplitter::KeepSize); 263 mPanner->setResizeMode(mLeftSplitter,QSplitter::KeepSize);
264 264
265 mDateNavigator = new KDateNavigator(mLeftSplitter, mCalendar, TRUE, 265 mDateNavigator = new KDateNavigator(mLeftSplitter, mCalendar, TRUE,
266 "CalendarView::DateNavigator", QDate::currentDate() ); 266 "CalendarView::DateNavigator", QDate::currentDate() );
267 mLeftSplitter->setResizeMode(mDateNavigator,QSplitter::KeepSize); 267 mLeftSplitter->setResizeMode(mDateNavigator,QSplitter::KeepSize);
268 mTodoList = new KOTodoView(mCalendar, mLeftSplitter, "todolist_small2"); 268 mTodoList = new KOTodoView(mCalendar, mLeftSplitter, "todolist_small2");
269 mTodoList->setNavigator( mNavigator );
269 mFilterView = new KOFilterView(&mFilters,mLeftSplitter,"CalendarView::FilterView"); 270 mFilterView = new KOFilterView(&mFilters,mLeftSplitter,"CalendarView::FilterView");
270 271
271#ifdef KORG_NORESOURCEVIEW 272#ifdef KORG_NORESOURCEVIEW
272 mResourceView = 0; 273 mResourceView = 0;
273#else 274#else
274 if ( mResourceManager ) { 275 if ( mResourceManager ) {
275 mResourceView = new ResourceView( mResourceManager, mLeftSplitter ); 276 mResourceView = new ResourceView( mResourceManager, mLeftSplitter );
276 mResourceView->updateView(); 277 mResourceView->updateView();
@@ -306,16 +307,17 @@ void CalendarView::init()
306 topLayout->addWidget( mainBox ); 307 topLayout->addWidget( mainBox );
307 mainBoxLayout->addWidget (leftFrame); 308 mainBoxLayout->addWidget (leftFrame);
308 mDateNavigator = new KDateNavigator(leftFrame, mCalendar, TRUE, 309 mDateNavigator = new KDateNavigator(leftFrame, mCalendar, TRUE,
309 "CalendarView::DateNavigator", QDate::currentDate()); 310 "CalendarView::DateNavigator", QDate::currentDate());
310 // mDateNavigator->blockSignals( true ); 311 // mDateNavigator->blockSignals( true );
311 leftFrameLayout->addWidget( mDateNavigator ); 312 leftFrameLayout->addWidget( mDateNavigator );
312 mFilterView = new KOFilterView(&mFilters,leftFrame,"CalendarView::FilterView"); 313 mFilterView = new KOFilterView(&mFilters,leftFrame,"CalendarView::FilterView");
313 mTodoList = new KOTodoView(mCalendar, leftFrame, "todolistsmall"); 314 mTodoList = new KOTodoView(mCalendar, leftFrame, "todolistsmall");
315 mTodoList->setNavigator( mNavigator );
314 316
315 if ( QApplication::desktop()->width() < 480 ) { 317 if ( QApplication::desktop()->width() < 480 ) {
316 leftFrameLayout->addWidget(mFilterView); 318 leftFrameLayout->addWidget(mFilterView);
317 leftFrameLayout->addWidget(mTodoList, 2 ); 319 leftFrameLayout->addWidget(mTodoList, 2 );
318 320
319 } else { 321 } else {
320 leftFrameLayout->addWidget(mTodoList,2 ); 322 leftFrameLayout->addWidget(mTodoList,2 );
321 leftFrameLayout->addWidget(mFilterView ); 323 leftFrameLayout->addWidget(mFilterView );
@@ -2139,16 +2141,18 @@ void CalendarView::updateView(const QDate &start, const QDate &end)
2139} 2141}
2140 2142
2141void CalendarView::updateView() 2143void CalendarView::updateView()
2142{ 2144{
2143 DateList tmpList = mNavigator->selectedDates(); 2145 DateList tmpList = mNavigator->selectedDates();
2144 2146
2145 // We assume that the navigator only selects consecutive days. 2147 // We assume that the navigator only selects consecutive days.
2146 updateView( tmpList.first(), tmpList.last() ); 2148 updateView( tmpList.first(), tmpList.last() );
2149 if ( KOPrefs::instance()->mHideNonStartedTodos )
2150 mTodoList->updateView();
2147} 2151}
2148 2152
2149void CalendarView::updateUnmanagedViews() 2153void CalendarView::updateUnmanagedViews()
2150{ 2154{
2151 mDateNavigator->updateDayMatrix(); 2155 mDateNavigator->updateDayMatrix();
2152} 2156}
2153 2157
2154int CalendarView::msgItemDelete() 2158int CalendarView::msgItemDelete()
diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp
index 46184ac..6965ba7 100644
--- a/korganizer/koagendaitem.cpp
+++ b/korganizer/koagendaitem.cpp
@@ -493,17 +493,17 @@ void KOAgendaItem::computeText()
493 if ( static_cast<Todo*>(mIncidence)->dtDue().date() < QDate::currentDate() ) 493 if ( static_cast<Todo*>(mIncidence)->dtDue().date() < QDate::currentDate() )
494 mDisplayedText += i18n(" (") +KGlobal::locale()->formatDate((static_cast<Todo*>(mIncidence))->dtDue().date(), true)+")"; 494 mDisplayedText += i18n(" (") +KGlobal::locale()->formatDate((static_cast<Todo*>(mIncidence))->dtDue().date(), true)+")";
495 else if ( !(mIncidence->doesFloat())) 495 else if ( !(mIncidence->doesFloat()))
496 mDisplayedText += i18n(" (") +KGlobal::locale()->formatTime((static_cast<Todo*>(mIncidence))->dtDue().time())+")"; 496 mDisplayedText += i18n(" (") +KGlobal::locale()->formatTime((static_cast<Todo*>(mIncidence))->dtDue().time())+")";
497 497
498 498
499 499
500 } else { 500 } else {
501 if ( !(mIncidence->doesFloat())) 501 if ( !(mIncidence->doesFloat()) && KOPrefs::instance()->mShowTimeInAgenda)
502 mDisplayedText += ": " +KGlobal::locale()->formatTime((static_cast<Event*>(mIncidence))->dtStart().time()) + "-" + KGlobal::locale()->formatTime((static_cast<Event*>(mIncidence))->dtEnd().time()) ; 502 mDisplayedText += ": " +KGlobal::locale()->formatTime((static_cast<Event*>(mIncidence))->dtStart().time()) + "-" + KGlobal::locale()->formatTime((static_cast<Event*>(mIncidence))->dtEnd().time()) ;
503 503
504 if ( mAllDay ) { 504 if ( mAllDay ) {
505 if ( mIncidence->dtStart().date().addDays(3) < mIncidence->dtEnd().date() ) { 505 if ( mIncidence->dtStart().date().addDays(3) < mIncidence->dtEnd().date() ) {
506 mDisplayedText += ": " +KGlobal::locale()->formatDate((static_cast<Event*>(mIncidence))->dtStart().date(), true) + " - " + KGlobal::locale()->formatDate((static_cast<Event*>(mIncidence))->dtEnd().date(), true) ; 506 mDisplayedText += ": " +KGlobal::locale()->formatDate((static_cast<Event*>(mIncidence))->dtStart().date(), true) + " - " + KGlobal::locale()->formatDate((static_cast<Event*>(mIncidence))->dtEnd().date(), true) ;
507 } 507 }
508 } 508 }
509 509
diff --git a/korganizer/kodialogmanager.cpp b/korganizer/kodialogmanager.cpp
index db7c3f2..c99c0cb 100644
--- a/korganizer/kodialogmanager.cpp
+++ b/korganizer/kodialogmanager.cpp
@@ -186,17 +186,17 @@ void KODialogManager::showSearchDialog()
186 connect(lview, SIGNAL(beamIncidenceList(QPtrList<Incidence> )), 186 connect(lview, SIGNAL(beamIncidenceList(QPtrList<Incidence> )),
187 mMainView, SLOT(beamIncidenceList(QPtrList<Incidence> ))); 187 mMainView, SLOT(beamIncidenceList(QPtrList<Incidence> )));
188 188
189 connect(mMainView, SIGNAL(configChanged()), mSearchDialog, SLOT(updateConfig())); 189 connect(mMainView, SIGNAL(configChanged()), mSearchDialog, SLOT(updateConfig()));
190 connect(mMainView, SIGNAL(updateSearchDialog()), mSearchDialog, SLOT(updateList())); 190 connect(mMainView, SIGNAL(updateSearchDialog()), mSearchDialog, SLOT(updateList()));
191 // connect( lview, SIGNAL( incidenceSelected( Incidence * ) ), 191 // connect( lview, SIGNAL( incidenceSelected( Incidence * ) ),
192 // mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); 192 // mMainView, SLOT( processMainViewSelection( Incidence * ) ) );
193#ifndef DESKTOP_VERSION 193#ifndef DESKTOP_VERSION
194 mSearchDialog->setMaximumSize( 640, 480 ); 194 mSearchDialog->setMaximumSize( QApplication::desktop()->size());
195 //mSearchDialog->setGeometry( 40,40, 400, 300); 195 //mSearchDialog->setGeometry( 40,40, 400, 300);
196 mSearchDialog->showMaximized(); 196 mSearchDialog->showMaximized();
197#else 197#else
198 KConfig *config = KOGlobals::config(); 198 KConfig *config = KOGlobals::config();
199 config->setGroup("WidgetLayout"); 199 config->setGroup("WidgetLayout");
200 QStringList list; 200 QStringList list;
201 list = config->readListEntry("SearchLayout"); 201 list = config->readListEntry("SearchLayout");
202 int x,y,w,h; 202 int x,y,w,h;
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp
index 1cdb2fb..aae4692 100644
--- a/korganizer/koprefs.cpp
+++ b/korganizer/koprefs.cpp
@@ -105,16 +105,18 @@ KOPrefs::KOPrefs() :
105#endif 105#endif
106 addItemBool("ToolBarHor",&mToolBarHor, true ); 106 addItemBool("ToolBarHor",&mToolBarHor, true );
107 addItemBool("ToolBarUp",&mToolBarUp, false ); 107 addItemBool("ToolBarUp",&mToolBarUp, false );
108 addItemBool("ToolBarMiniIcons",&mToolBarMiniIcons, false ); 108 addItemBool("ToolBarMiniIcons",&mToolBarMiniIcons, false );
109 addItemInt("Whats Next Days",&mWhatsNextDays,3); 109 addItemInt("Whats Next Days",&mWhatsNextDays,3);
110 addItemInt("Whats Next Prios",&mWhatsNextPrios,1); 110 addItemInt("Whats Next Prios",&mWhatsNextPrios,1);
111 111
112 addItemBool("ShowTodoInAgenda",&mShowTodoInAgenda,true); 112 addItemBool("ShowTodoInAgenda",&mShowTodoInAgenda,true);
113 addItemBool("ShowTimeInAgenda",&mShowTimeInAgenda,true);
114 addItemBool("HideNonStartedTodos",&mHideNonStartedTodos,false);
113 addItemBool("ShowCompletedTodo",&mShowCompletedTodo,true); 115 addItemBool("ShowCompletedTodo",&mShowCompletedTodo,true);
114 addItemInt("AllDay Size",&mAllDaySize,28); 116 addItemInt("AllDay Size",&mAllDaySize,28);
115 QString defAlarm = KGlobal::iconLoader()->iconPath()+"koalarm.wav"; 117 QString defAlarm = KGlobal::iconLoader()->iconPath()+"koalarm.wav";
116 addItemString("DefaultAlarmFile",&mDefaultAlarmFile,defAlarm ); 118 addItemString("DefaultAlarmFile",&mDefaultAlarmFile,defAlarm );
117 119
118 addItemStringList("LocationDefaults",&mLocationDefaults ); 120 addItemStringList("LocationDefaults",&mLocationDefaults );
119 addItemStringList("EventSummary User",&mEventSummaryUser); 121 addItemStringList("EventSummary User",&mEventSummaryUser);
120 addItemStringList("TodoSummary User",&mTodoSummaryUser); 122 addItemStringList("TodoSummary User",&mTodoSummaryUser);
diff --git a/korganizer/koprefs.h b/korganizer/koprefs.h
index f2fe77a..69722a1 100644
--- a/korganizer/koprefs.h
+++ b/korganizer/koprefs.h
@@ -185,16 +185,18 @@ class KOPrefs : public KPimPrefs
185 bool mToolBarHor; 185 bool mToolBarHor;
186 bool mToolBarUp; 186 bool mToolBarUp;
187 bool mToolBarMiniIcons; 187 bool mToolBarMiniIcons;
188 188
189 bool mAskForQuit; 189 bool mAskForQuit;
190 bool mUsePassWd; 190 bool mUsePassWd;
191 bool mShowSyncEvents; 191 bool mShowSyncEvents;
192 bool mShowTodoInAgenda; 192 bool mShowTodoInAgenda;
193 bool mShowTimeInAgenda;
194 bool mHideNonStartedTodos;
193 195
194 int mLastSyncTime; 196 int mLastSyncTime;
195 void setCategoryColor(QString cat,const QColor & color); 197 void setCategoryColor(QString cat,const QColor & color);
196 QColor *categoryColor(QString cat); 198 QColor *categoryColor(QString cat);
197 199
198 QString mArchiveFile; 200 QString mArchiveFile;
199 QString mHtmlExportFile; 201 QString mHtmlExportFile;
200 bool mHtmlWithSave; 202 bool mHtmlWithSave;
diff --git a/korganizer/koprefsdialog.cpp b/korganizer/koprefsdialog.cpp
index 578c0e9..8aa24ee 100644
--- a/korganizer/koprefsdialog.cpp
+++ b/korganizer/koprefsdialog.cpp
@@ -88,16 +88,19 @@ KOPrefsDialog::KOPrefsDialog(QWidget *parent, char *name, bool modal) :
88 setupFontsTab(); 88 setupFontsTab();
89 setupColorsTab(); 89 setupColorsTab();
90 setupViewsTab(); 90 setupViewsTab();
91 //setupSyncTab(); 91 //setupSyncTab();
92 //setupSyncAlgTab(); 92 //setupSyncAlgTab();
93 //setupPrinterTab(); 93 //setupPrinterTab();
94 //setupGroupSchedulingTab(); 94 //setupGroupSchedulingTab();
95 //setupGroupAutomationTab(); 95 //setupGroupAutomationTab();
96
97 if ( QApplication::desktop()->height() == 480 )
98 hideButtons();
96} 99}
97 100
98 101
99KOPrefsDialog::~KOPrefsDialog() 102KOPrefsDialog::~KOPrefsDialog()
100{ 103{
101} 104}
102void KOPrefsDialog::setupGlobalTab() 105void KOPrefsDialog::setupGlobalTab()
103{ 106{
@@ -595,16 +598,21 @@ void KOPrefsDialog::setupViewsTab()
595// nextDaysLayout->addWidget(mNextXDaysSpin); 598// nextDaysLayout->addWidget(mNextXDaysSpin);
596 599
597 600
598 int ii = 0; 601 int ii = 0;
599 KPrefsDialogWidBool *dummy = 602 KPrefsDialogWidBool *dummy =
600 addWidBool(i18n("Edit item on doubleclick (if not, show)"), 603 addWidBool(i18n("Edit item on doubleclick (if not, show)"),
601 &(KOPrefs::instance()->mEditOnDoubleClick),topFrame); 604 &(KOPrefs::instance()->mEditOnDoubleClick),topFrame);
602 topLayout->addWidget(dummy->checkBox(),ii++,0); 605 topLayout->addWidget(dummy->checkBox(),ii++,0);
606
607 dummy =
608 addWidBool(i18n("Show time in agenda items"),
609 &(KOPrefs::instance()->mShowTimeInAgenda),topFrame);
610 topLayout->addWidget(dummy->checkBox(),ii++,0);
603 611
604 dummy = 612 dummy =
605 addWidBool(i18n("Highlight current day in agenda"), 613 addWidBool(i18n("Highlight current day in agenda"),
606 &(KOPrefs::instance()->mHighlightCurrentDay),topFrame); 614 &(KOPrefs::instance()->mHighlightCurrentDay),topFrame);
607 topLayout->addWidget(dummy->checkBox(),ii++,0); 615 topLayout->addWidget(dummy->checkBox(),ii++,0);
608 616
609 dummy = 617 dummy =
610 addWidBool(i18n("Use light color for highlight current day"), 618 addWidBool(i18n("Use light color for highlight current day"),
@@ -828,16 +836,21 @@ void KOPrefsDialog::setupViewsTab()
828 836
829 topFrame = addPage(i18n("Todo View"),0,0); 837 topFrame = addPage(i18n("Todo View"),0,0);
830 // DesktopIcon("viewmag",KIcon::SizeMedium)); 838 // DesktopIcon("viewmag",KIcon::SizeMedium));
831 839
832 topLayout = new QGridLayout(topFrame,4,1); 840 topLayout = new QGridLayout(topFrame,4,1);
833 topLayout->setSpacing(spacingHint()); 841 topLayout->setSpacing(spacingHint());
834 topLayout->setMargin(marginHint()); 842 topLayout->setMargin(marginHint());
835 ii = 0; 843 ii = 0;
844dummy =
845 addWidBool(i18n("Hide not running Todos in To-do view"),
846 &(KOPrefs::instance()->mHideNonStartedTodos),topFrame);
847 topLayout->addWidget(dummy->checkBox(),ii++,0);
848
836 849
837 KPrefsDialogWidBool *showCompletedTodo = 850 KPrefsDialogWidBool *showCompletedTodo =
838 addWidBool(i18n("To-do view shows completed Todos"), 851 addWidBool(i18n("To-do view shows completed Todos"),
839 &(KOPrefs::instance()->mShowCompletedTodo),topFrame); 852 &(KOPrefs::instance()->mShowCompletedTodo),topFrame);
840 topLayout->addWidget(showCompletedTodo->checkBox(),ii++,0); 853 topLayout->addWidget(showCompletedTodo->checkBox(),ii++,0);
841 dummy = 854 dummy =
842 addWidBool(i18n("To-do view shows complete as 'xx %'"), 855 addWidBool(i18n("To-do view shows complete as 'xx %'"),
843 &(KOPrefs::instance()->mTodoViewShowsPercentage),topFrame); 856 &(KOPrefs::instance()->mTodoViewShowsPercentage),topFrame);
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp
index 9cafc60..5d7b066 100644
--- a/korganizer/kotodoview.cpp
+++ b/korganizer/kotodoview.cpp
@@ -327,16 +327,17 @@ void KOQuickTodo::focusOutEvent(QFocusEvent *ev)
327 QLineEdit::focusOutEvent(ev); 327 QLineEdit::focusOutEvent(ev);
328} 328}
329 329
330///////////////////////////////////////////////////////////////////////////// 330/////////////////////////////////////////////////////////////////////////////
331 331
332KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : 332KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) :
333 KOrg::BaseView(calendar,parent,name) 333 KOrg::BaseView(calendar,parent,name)
334{ 334{
335 mNavigator = 0;
335 QBoxLayout *topLayout = new QVBoxLayout(this); 336 QBoxLayout *topLayout = new QVBoxLayout(this);
336 mName = QString ( name ); 337 mName = QString ( name );
337 mBlockUpdate = false; 338 mBlockUpdate = false;
338 mQuickAdd = new KOQuickTodo(this); 339 mQuickAdd = new KOQuickTodo(this);
339 topLayout->addWidget(mQuickAdd); 340 topLayout->addWidget(mQuickAdd);
340 341
341 if ( !KOPrefs::instance()->mEnableQuickTodo ) mQuickAdd->hide(); 342 if ( !KOPrefs::instance()->mEnableQuickTodo ) mQuickAdd->hide();
342 343
@@ -347,21 +348,28 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) :
347 mTodoListView->setAllColumnsShowFocus(true); 348 mTodoListView->setAllColumnsShowFocus(true);
348 349
349 mTodoListView->setShowSortIndicator(true); 350 mTodoListView->setShowSortIndicator(true);
350 351
351 mTodoListView->addColumn(i18n("Todo")); 352 mTodoListView->addColumn(i18n("Todo"));
352 mTodoListView->addColumn(i18n("Prio")); 353 mTodoListView->addColumn(i18n("Prio"));
353 mTodoListView->setColumnAlignment(1,AlignHCenter); 354 mTodoListView->setColumnAlignment(1,AlignHCenter);
354 mTodoListView->addColumn(i18n("Complete")); 355 mTodoListView->addColumn(i18n("Complete"));
355 mTodoListView->setColumnAlignment(2,AlignHCenter); 356 mTodoListView->setColumnAlignment(2,AlignCenter);
357
356 mTodoListView->addColumn(i18n("Due Date")); 358 mTodoListView->addColumn(i18n("Due Date"));
357 mTodoListView->setColumnAlignment(3,AlignLeft); 359 mTodoListView->setColumnAlignment(3,AlignLeft);
358 mTodoListView->addColumn(i18n("Due Time")); 360 mTodoListView->addColumn(i18n("Due Time"));
359 mTodoListView->setColumnAlignment(4,AlignHCenter); 361 mTodoListView->setColumnAlignment(4,AlignHCenter);
362
363 mTodoListView->addColumn(i18n("Start Date"));
364 mTodoListView->setColumnAlignment(5,AlignLeft);
365 mTodoListView->addColumn(i18n("Start Time"));
366 mTodoListView->setColumnAlignment(6,AlignHCenter);
367
360 mTodoListView->addColumn(i18n("Cancelled")); 368 mTodoListView->addColumn(i18n("Cancelled"));
361 mTodoListView->addColumn(i18n("Categories")); 369 mTodoListView->addColumn(i18n("Categories"));
362#if 0 370#if 0
363 mTodoListView->addColumn(i18n("Sort Id")); 371 mTodoListView->addColumn(i18n("Sort Id"));
364 mTodoListView->setColumnAlignment(4,AlignHCenter); 372 mTodoListView->setColumnAlignment(4,AlignHCenter);
365#endif 373#endif
366 374
367 mTodoListView->setMinimumHeight( 60 ); 375 mTodoListView->setMinimumHeight( 60 );
@@ -370,20 +378,19 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) :
370 mTodoListView->setColumnWidth( 0, 120 ); 378 mTodoListView->setColumnWidth( 0, 120 );
371 mTodoListView->setColumnWidthMode(0, QListView::Manual); 379 mTodoListView->setColumnWidthMode(0, QListView::Manual);
372 mTodoListView->setColumnWidthMode(1, QListView::Manual); 380 mTodoListView->setColumnWidthMode(1, QListView::Manual);
373 mTodoListView->setColumnWidthMode(2, QListView::Manual); 381 mTodoListView->setColumnWidthMode(2, QListView::Manual);
374 mTodoListView->setColumnWidthMode(3, QListView::Manual); 382 mTodoListView->setColumnWidthMode(3, QListView::Manual);
375 mTodoListView->setColumnWidthMode(4, QListView::Manual); 383 mTodoListView->setColumnWidthMode(4, QListView::Manual);
376 mTodoListView->setColumnWidthMode(5, QListView::Manual); 384 mTodoListView->setColumnWidthMode(5, QListView::Manual);
377 mTodoListView->setColumnWidthMode(6, QListView::Manual); 385 mTodoListView->setColumnWidthMode(6, QListView::Manual);
378 mTodoListView->setColumnAlignment( 2, AlignCenter ); 386 mTodoListView->setColumnWidthMode(7, QListView::Manual);
379#if 0 387 mTodoListView->setColumnWidthMode(8, QListView::Manual);
380 mTodoListView->setColumnWidthMode(6, QListView::Manual); 388
381#endif
382 389
383 mPriorityPopupMenu = new QPopupMenu(this); 390 mPriorityPopupMenu = new QPopupMenu(this);
384 for (int i = 1; i <= 5; i++) { 391 for (int i = 1; i <= 5; i++) {
385 QString label = QString ("%1").arg (i); 392 QString label = QString ("%1").arg (i);
386 mPriority[mPriorityPopupMenu->insertItem (label)] = i; 393 mPriority[mPriorityPopupMenu->insertItem (label)] = i;
387 } 394 }
388 connect (mPriorityPopupMenu, SIGNAL(activated (int)), SLOT (setNewPriority(int))); 395 connect (mPriorityPopupMenu, SIGNAL(activated (int)), SLOT (setNewPriority(int)));
389 396
@@ -423,30 +430,46 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) :
423 SLOT (reparentTodo()),0,22); 430 SLOT (reparentTodo()),0,22);
424 mItemPopupMenu->insertSeparator(); 431 mItemPopupMenu->insertSeparator();
425 mItemPopupMenu->insertItem(i18n("Delete completed To-Dos","Purge Completed"), 432 mItemPopupMenu->insertItem(i18n("Delete completed To-Dos","Purge Completed"),
426 this, SLOT( purgeCompleted() ) ); 433 this, SLOT( purgeCompleted() ) );
427 mItemPopupMenu->insertItem(i18n("toggle completed To-Dos","Show Completed"), 434 mItemPopupMenu->insertItem(i18n("toggle completed To-Dos","Show Completed"),
428 this, SLOT( toggleCompleted() ),0, 33 ); 435 this, SLOT( toggleCompleted() ),0, 33 );
429 mItemPopupMenu->insertItem(i18n("toggle quick todo","Show Quick Todo"), 436 mItemPopupMenu->insertItem(i18n("toggle quick todo","Show Quick Todo"),
430 this, SLOT( toggleQuickTodo() ),0, 34 ); 437 this, SLOT( toggleQuickTodo() ),0, 34 );
438 mItemPopupMenu->insertItem(i18n("toggle running todo","Hide not Running"),
439 this, SLOT( toggleRunning() ),0, 35 );
431 440
432 mPopupMenu = new QPopupMenu(this); 441 mPopupMenu = new QPopupMenu(this);
433 mPopupMenu->insertItem(SmallIconSet("todo"), i18n("New Todo..."), this, 442 mPopupMenu->insertItem(SmallIconSet("todo"), i18n("New Todo..."), this,
434 SLOT (newTodo()),0,1); 443 SLOT (newTodo()),0,1);
435 mPopupMenu->insertItem(i18n("delete completed To-Dos","Purge Completed"), 444 mPopupMenu->insertItem(i18n("delete completed To-Dos","Purge Completed"),
436 this, SLOT(purgeCompleted()),0,2); 445 this, SLOT(purgeCompleted()),0,2);
437 mPopupMenu->insertItem(i18n("Show Completed"), 446 mPopupMenu->insertItem(i18n("Show Completed"),
438 this, SLOT( toggleCompleted() ),0,3 ); 447 this, SLOT( toggleCompleted() ),0,3 );
439 mPopupMenu->insertItem(i18n("toggle quick todo","Show Quick Todo"), 448 mPopupMenu->insertItem(i18n("toggle quick todo","Show Quick Todo"),
440 this, SLOT( toggleQuickTodo() ),0,4 ); 449 this, SLOT( toggleQuickTodo() ),0,4 );
450 mPopupMenu->insertItem(i18n("toggle running todo","Hide not Running"),
451 this, SLOT( toggleRunning() ),0,5 );
441 mDocPrefs = new DocPrefs( name ); 452 mDocPrefs = new DocPrefs( name );
442 453
443 mPopupMenu->setCheckable( true ); 454 mPopupMenu->setCheckable( true );
444 mItemPopupMenu->setCheckable( true ); 455 mItemPopupMenu->setCheckable( true );
456
457
458 mPopupMenu->setItemChecked( 3,KOPrefs::instance()->mShowCompletedTodo );
459 mItemPopupMenu->setItemChecked( 33 , KOPrefs::instance()->mShowCompletedTodo );
460
461 mPopupMenu->setItemChecked(4,KOPrefs::instance()->mEnableQuickTodo);
462 mItemPopupMenu->setItemChecked( 34 , KOPrefs::instance()->mEnableQuickTodo );
463
464 mPopupMenu->setItemChecked(5,KOPrefs::instance()->mHideNonStartedTodos);
465 mItemPopupMenu->setItemChecked( 35 , KOPrefs::instance()->mHideNonStartedTodos );
466
467
445 // Double clicking conflicts with opening/closing the subtree 468 // Double clicking conflicts with opening/closing the subtree
446 connect( mTodoListView, SIGNAL( doubleClicked( QListViewItem *) ), 469 connect( mTodoListView, SIGNAL( doubleClicked( QListViewItem *) ),
447 SLOT( editItem( QListViewItem *) ) ); 470 SLOT( editItem( QListViewItem *) ) );
448 /* 471 /*
449 connect( mTodoListView, SIGNAL( rightButtonClicked ( QListViewItem *, 472 connect( mTodoListView, SIGNAL( rightButtonClicked ( QListViewItem *,
450 const QPoint &,int ) ), 473 const QPoint &,int ) ),
451 SLOT( popupMenu( QListViewItem *, const QPoint & ,int) ) ); 474 SLOT( popupMenu( QListViewItem *, const QPoint & ,int) ) );
452 */ 475 */
@@ -471,47 +494,32 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) :
471 SLOT(selectionChanged(QListViewItem *))); 494 SLOT(selectionChanged(QListViewItem *)));
472 connect(mTodoListView,SIGNAL(pressed(QListViewItem *)), 495 connect(mTodoListView,SIGNAL(pressed(QListViewItem *)),
473 SLOT(selectionChanged(QListViewItem *))); 496 SLOT(selectionChanged(QListViewItem *)));
474#endif 497#endif
475 connect( mTodoListView, SIGNAL(selectionChanged() ), 498 connect( mTodoListView, SIGNAL(selectionChanged() ),
476 SLOT( processSelectionChange() ) ); 499 SLOT( processSelectionChange() ) );
477 connect( mQuickAdd, SIGNAL( returnPressed () ), 500 connect( mQuickAdd, SIGNAL( returnPressed () ),
478 SLOT( addQuickTodo() ) ); 501 SLOT( addQuickTodo() ) );
479// if ( QApplication::desktop()->width() < 480 ) {
480// setNarrow();
481 // mTodoListView->setColumnWidth( 0, 100 );
482
483 // }
484 502
485} 503}
486 504
487KOTodoView::~KOTodoView() 505KOTodoView::~KOTodoView()
488{ 506{
489 delete mDocPrefs; 507 delete mDocPrefs;
490} 508}
491 509
492void KOTodoView::jumpToDate () 510void KOTodoView::jumpToDate ()
493{ 511{
494 // if (mActiveItem) { 512 // if (mActiveItem) {
495// mActiveItem->todo()); 513// mActiveItem->todo());
496// if ( mActiveItem->todo()->hasDueDate() ) 514// if ( mActiveItem->todo()->hasDueDate() )
497// emit mActiveItem->todo()jumpToTime( mTodo->dtDue().date() ); 515// emit mActiveItem->todo()jumpToTime( mTodo->dtDue().date() );
498} 516}
499 517
500void KOTodoView::setNarrow()
501{
502 //mTodoListView->setColumnWidth( 0, 120 );
503 mTodoListView->setColumnWidth( 1, 35 );
504 mTodoListView->setColumnWidth( 2, 40 );
505 mTodoListView->setColumnWidth( 3, 80 );
506 mTodoListView->setColumnWidth( 4, 40 );
507 mTodoListView->setColumnWidth( 5, 90 );
508
509}
510void KOTodoView::updateView() 518void KOTodoView::updateView()
511{ 519{
512 pendingSubtodo = 0; 520 pendingSubtodo = 0;
513 if ( mBlockUpdate ) { 521 if ( mBlockUpdate ) {
514 //qDebug("blocked "); 522 //qDebug("blocked ");
515 return; 523 return;
516 } 524 }
517 //qDebug("update "); 525 //qDebug("update ");
@@ -582,45 +590,62 @@ void KOTodoView::updateView()
582 } 590 }
583// qDebug("again .... "); 591// qDebug("again .... ");
584// for(todo = todoList.first(); todo; todo = todoList.next()) { 592// for(todo = todoList.first(); todo; todo = todoList.next()) {
585 593
586// qDebug("yytodo %s ", todo->summary().latin1()); 594// qDebug("yytodo %s ", todo->summary().latin1());
587// } 595// }
588 //qDebug("for "); 596 //qDebug("for ");
589 for(todo = todoList.first(); todo; todo = todoList.next()) { 597 for(todo = todoList.first(); todo; todo = todoList.next()) {
590 if (!mTodoMap.contains(todo) && ( KOPrefs::instance()->mShowCompletedTodo || !todo->isCompleted() ) ) 598 if (!mTodoMap.contains(todo) && checkTodo( todo ) )
591 { 599 {
592 insertTodoItem(todo); 600 insertTodoItem(todo);
593 } 601 }
594 } 602 }
595 //qDebug("for end "); 603 //qDebug("for end ");
596 // Restore opened/closed state 604 // Restore opened/closed state
597 mTodoListView->blockSignals( true ); 605 mTodoListView->blockSignals( true );
598 if( mDocPrefs ) restoreItemState( mTodoListView->firstChild() ); 606 if( mDocPrefs ) restoreItemState( mTodoListView->firstChild() );
599 mTodoListView->blockSignals( false ); 607 mTodoListView->blockSignals( false );
600 mTodoListView->setFocus(); 608 mTodoListView->setFocus();
601 processSelectionChange(); 609 processSelectionChange();
602} 610}
603 611
612bool KOTodoView::checkTodo( Todo * todo )
613{
614
615 if ( !KOPrefs::instance()->mShowCompletedTodo && todo->isCompleted() )
616 return false;
617 if ( KOPrefs::instance()->mHideNonStartedTodos && mNavigator ) {
618 if ( todo->hasStartDate() )
619 if ( mNavigator->selectedDates().last() < todo->dtStart().date() )
620 return false;
621 if ( todo->hasDueDate() )
622 if ( mNavigator->selectedDates().first() > todo->dtDue().date() )
623 return false;
624 }
625 return true;
626}
627
604void KOTodoView::restoreItemState( QListViewItem *item ) 628void KOTodoView::restoreItemState( QListViewItem *item )
605{ 629{
606 pendingSubtodo = 0; 630 pendingSubtodo = 0;
607 while( item ) { 631 while( item ) {
608 KOTodoViewItem *todoItem = (KOTodoViewItem *)item; 632 KOTodoViewItem *todoItem = (KOTodoViewItem *)item;
609 todoItem->setOpen( mDocPrefs->readBoolEntry( todoItem->todo()->uid() ) ); 633 todoItem->setOpen( mDocPrefs->readBoolEntry( todoItem->todo()->uid() ) );
610 if( item->childCount() > 0 ) restoreItemState( item->firstChild() ); 634 if( item->childCount() > 0 ) restoreItemState( item->firstChild() );
611 item = item->nextSibling(); 635 item = item->nextSibling();
612 } 636 }
613} 637}
614 638
615 639
616QMap<Todo *,KOTodoViewItem *>::ConstIterator 640QMap<Todo *,KOTodoViewItem *>::ConstIterator
617 KOTodoView::insertTodoItem(Todo *todo) 641 KOTodoView::insertTodoItem(Todo *todo)
618{ 642{
643
619// kdDebug() << "KOTodoView::insertTodoItem(): " << todo->getSummary() << endl; 644// kdDebug() << "KOTodoView::insertTodoItem(): " << todo->getSummary() << endl;
620 // TODO: Check, if dynmaic cast is necessary 645 // TODO: Check, if dynmaic cast is necessary
621 646
622 pendingSubtodo = 0; 647 pendingSubtodo = 0;
623 Incidence *incidence = todo->relatedTo(); 648 Incidence *incidence = todo->relatedTo();
624 if (incidence && incidence->type() == "Todo") { 649 if (incidence && incidence->type() == "Todo") {
625 Todo *relatedTodo = static_cast<Todo *>(incidence); 650 Todo *relatedTodo = static_cast<Todo *>(incidence);
626 651
@@ -713,17 +738,17 @@ void KOTodoView::popupMenu(QListViewItem *item,const QPoint &,int column)
713 switch (column){ 738 switch (column){
714 case 1: 739 case 1:
715 mPriorityPopupMenu->popup(QCursor::pos ()); break; 740 mPriorityPopupMenu->popup(QCursor::pos ()); break;
716 case 2: 741 case 2:
717 mPercentageCompletedPopupMenu->popup(QCursor::pos ()); break; 742 mPercentageCompletedPopupMenu->popup(QCursor::pos ()); break;
718 case 3: 743 case 3:
719 moveTodo(); 744 moveTodo();
720 break; 745 break;
721 case 6: 746 case 8:
722 getCategoryPopupMenu((KOTodoViewItem *)item)->popup(QCursor::pos ()); break; 747 getCategoryPopupMenu((KOTodoViewItem *)item)->popup(QCursor::pos ()); break;
723 default: 748 default:
724 mItemPopupMenu->popup(QCursor::pos()); 749 mItemPopupMenu->popup(QCursor::pos());
725 } 750 }
726 } else mPopupMenu->popup(QCursor::pos()); 751 } else mPopupMenu->popup(QCursor::pos());
727} 752}
728void KOTodoView::newTodo() 753void KOTodoView::newTodo()
729{ 754{
@@ -990,16 +1015,25 @@ void KOTodoView::toggleQuickTodo()
990 } 1015 }
991 else { 1016 else {
992 mQuickAdd->show(); 1017 mQuickAdd->show();
993 KOPrefs::instance()->mEnableQuickTodo = true; 1018 KOPrefs::instance()->mEnableQuickTodo = true;
994 } 1019 }
995 mPopupMenu->setItemChecked(4,KOPrefs::instance()->mEnableQuickTodo); 1020 mPopupMenu->setItemChecked(4,KOPrefs::instance()->mEnableQuickTodo);
996 mItemPopupMenu->setItemChecked( 34 , KOPrefs::instance()->mEnableQuickTodo ); 1021 mItemPopupMenu->setItemChecked( 34 , KOPrefs::instance()->mEnableQuickTodo );
997} 1022}
1023
1024void KOTodoView::toggleRunning()
1025{
1026 KOPrefs::instance()->mHideNonStartedTodos = !KOPrefs::instance()->mHideNonStartedTodos;
1027 mPopupMenu->setItemChecked(5,KOPrefs::instance()->mHideNonStartedTodos);
1028 mItemPopupMenu->setItemChecked( 35 , KOPrefs::instance()->mHideNonStartedTodos );
1029 updateView();
1030}
1031
998void KOTodoView::toggleCompleted() 1032void KOTodoView::toggleCompleted()
999{ 1033{
1000 KOPrefs::instance()->mShowCompletedTodo = !KOPrefs::instance()->mShowCompletedTodo; 1034 KOPrefs::instance()->mShowCompletedTodo = !KOPrefs::instance()->mShowCompletedTodo;
1001 mPopupMenu->setItemChecked( 3,KOPrefs::instance()->mShowCompletedTodo ); 1035 mPopupMenu->setItemChecked( 3,KOPrefs::instance()->mShowCompletedTodo );
1002 mItemPopupMenu->setItemChecked( 33 , KOPrefs::instance()->mShowCompletedTodo ); 1036 mItemPopupMenu->setItemChecked( 33 , KOPrefs::instance()->mShowCompletedTodo );
1003 updateView(); 1037 updateView();
1004} 1038}
1005 1039
diff --git a/korganizer/kotodoview.h b/korganizer/kotodoview.h
index 0c08677..5ca0362 100644
--- a/korganizer/kotodoview.h
+++ b/korganizer/kotodoview.h
@@ -38,16 +38,17 @@
38#include <libkcal/calendar.h> 38#include <libkcal/calendar.h>
39#include <libkcal/todo.h> 39#include <libkcal/todo.h>
40 40
41#include <korganizer/baseview.h> 41#include <korganizer/baseview.h>
42 42
43#include "kotodoviewitem.h" 43#include "kotodoviewitem.h"
44#include "koprefs.h" 44#include "koprefs.h"
45#include "koglobals.h" 45#include "koglobals.h"
46#include "datenavigator.h"
46 47
47class QDragEnterEvent; 48class QDragEnterEvent;
48class QDragMoveEvent; 49class QDragMoveEvent;
49class QDragLeaveEvent; 50class QDragLeaveEvent;
50class QDropEvent; 51class QDropEvent;
51 52
52class DocPrefs; 53class DocPrefs;
53 54
@@ -113,26 +114,26 @@ class KOTodoView : public KOrg::BaseView
113 QPtrList<Todo> selectedTodos(); 114 QPtrList<Todo> selectedTodos();
114 115
115 DateList selectedDates() 116 DateList selectedDates()
116 {DateList q; 117 {DateList q;
117 return q;} 118 return q;}
118 119
119 /** Return number of shown dates. TodoView does not show dates, */ 120 /** Return number of shown dates. TodoView does not show dates, */
120 int currentDateCount() { return 0; } 121 int currentDateCount() { return 0; }
121 void setNarrow();
122 122
123 void printPreview(CalPrinter *calPrinter, const QDate &fd, const QDate &td); 123 void printPreview(CalPrinter *calPrinter, const QDate &fd, const QDate &td);
124 124
125 void setDocumentId( const QString & ); 125 void setDocumentId( const QString & );
126 126
127 void saveLayout(KConfig *config, const QString &group) const; 127 void saveLayout(KConfig *config, const QString &group) const;
128 void restoreLayout(KConfig *config, const QString &group); 128 void restoreLayout(KConfig *config, const QString &group);
129 /** Create a popup menu to set categories */ 129 /** Create a popup menu to set categories */
130 QPopupMenu *getCategoryPopupMenu (KOTodoViewItem *todoItem); 130 QPopupMenu *getCategoryPopupMenu (KOTodoViewItem *todoItem);
131 void setNavigator( DateNavigator* nav ) {mNavigator = nav;}
131 132
132 public slots: 133 public slots:
133 void updateView(); 134 void updateView();
134 void updateConfig(); 135 void updateConfig();
135 136
136 void changeEventDisplay(Event *, int); 137 void changeEventDisplay(Event *, int);
137 138
138 void showDates(const QDate &start, const QDate &end); 139 void showDates(const QDate &start, const QDate &end);
@@ -157,16 +158,17 @@ class KOTodoView : public KOrg::BaseView
157 void deleteTodo(); 158 void deleteTodo();
158 159
159 void setNewPriority(int); 160 void setNewPriority(int);
160 void setNewPercentage(int); 161 void setNewPercentage(int);
161 void changedCategories(int); 162 void changedCategories(int);
162 163
163 void purgeCompleted(); 164 void purgeCompleted();
164 void toggleCompleted(); 165 void toggleCompleted();
166 void toggleRunning();
165 void toggleQuickTodo(); 167 void toggleQuickTodo();
166 void updateTodo( Todo *, int ); 168 void updateTodo( Todo *, int );
167 169
168 void itemClicked(QListViewItem *); 170 void itemClicked(QListViewItem *);
169 void itemStateChanged(QListViewItem *); 171 void itemStateChanged(QListViewItem *);
170 void modified(bool); 172 void modified(bool);
171 void itemDoubleClicked(QListViewItem *item); 173 void itemDoubleClicked(QListViewItem *item);
172 174
@@ -202,16 +204,18 @@ class KOTodoView : public KOrg::BaseView
202 * 3. add a private method for setting a todo modified + friend here? 204 * 3. add a private method for setting a todo modified + friend here?
203 * -- zecke 2002-07-08 205 * -- zecke 2002-07-08
204 */ 206 */
205 friend class KOTodoViewItem; 207 friend class KOTodoViewItem;
206 void setTodoModified( Todo* ); 208 void setTodoModified( Todo* );
207 QMap<Todo *,KOTodoViewItem *>::ConstIterator insertTodoItem(Todo *todo); 209 QMap<Todo *,KOTodoViewItem *>::ConstIterator insertTodoItem(Todo *todo);
208 void restoreItemState( QListViewItem * ); 210 void restoreItemState( QListViewItem * );
209 211
212 bool checkTodo( Todo * );
213
210 KOTodoListView *mTodoListView; 214 KOTodoListView *mTodoListView;
211 QPopupMenu *mItemPopupMenu; 215 QPopupMenu *mItemPopupMenu;
212 QPopupMenu *mPopupMenu; 216 QPopupMenu *mPopupMenu;
213 QPopupMenu *mPriorityPopupMenu; 217 QPopupMenu *mPriorityPopupMenu;
214 QPopupMenu *mPercentageCompletedPopupMenu; 218 QPopupMenu *mPercentageCompletedPopupMenu;
215 QPopupMenu *mCategoryPopupMenu; 219 QPopupMenu *mCategoryPopupMenu;
216 220
217 QMap<int, int> mPercentage; 221 QMap<int, int> mPercentage;
@@ -224,11 +228,12 @@ class KOTodoView : public KOrg::BaseView
224 228
225 DocPrefs *mDocPrefs; 229 DocPrefs *mDocPrefs;
226 QString mCurrentDoc; 230 QString mCurrentDoc;
227 KOQuickTodo *mQuickAdd; 231 KOQuickTodo *mQuickAdd;
228 bool mBlockUpdate; 232 bool mBlockUpdate;
229 void todoModified(Todo *, int ); 233 void todoModified(Todo *, int );
230 void keyPressEvent ( QKeyEvent * ) ; 234 void keyPressEvent ( QKeyEvent * ) ;
231 KOTodoViewItem * pendingSubtodo; 235 KOTodoViewItem * pendingSubtodo;
236 DateNavigator* mNavigator;
232}; 237};
233 238
234#endif 239#endif
diff --git a/korganizer/kotodoviewitem.cpp b/korganizer/kotodoviewitem.cpp
index ae0b334..347d982 100644
--- a/korganizer/kotodoviewitem.cpp
+++ b/korganizer/kotodoviewitem.cpp
@@ -74,16 +74,18 @@ void KOTodoViewItem::paintBranches(QPainter *p,const QColorGroup & cg,int w,
74#endif 74#endif
75 75
76void KOTodoViewItem::construct() 76void KOTodoViewItem::construct()
77{ 77{
78 // qDebug("KOTodoViewItem::construct() "); 78 // qDebug("KOTodoViewItem::construct() ");
79 m_init = true; 79 m_init = true;
80 QString keyd = "=="; 80 QString keyd = "==";
81 QString keyt = "=="; 81 QString keyt = "==";
82 QString skeyd = "==";
83 QString skeyt = "==";
82 84
83 setOn(mTodo->isCompleted()); 85 setOn(mTodo->isCompleted());
84 setText(0,mTodo->summary()); 86 setText(0,mTodo->summary());
85 setText(1,QString::number(mTodo->priority())); 87 setText(1,QString::number(mTodo->priority()));
86 setText(2,i18n("%1 %").arg(QString::number(mTodo->percentComplete()))); 88 setText(2,i18n("%1 %").arg(QString::number(mTodo->percentComplete())));
87 if (mTodo->percentComplete()<100) { 89 if (mTodo->percentComplete()<100) {
88 if (mTodo->isCompleted()) setSortKey(2,QString::number(999)); 90 if (mTodo->isCompleted()) setSortKey(2,QString::number(999));
89 else setSortKey(2,QString::number(mTodo->percentComplete())); 91 else setSortKey(2,QString::number(mTodo->percentComplete()));
@@ -91,38 +93,61 @@ void KOTodoViewItem::construct()
91 else { 93 else {
92 if (mTodo->isCompleted()) setSortKey(2,QString::number(999)); 94 if (mTodo->isCompleted()) setSortKey(2,QString::number(999));
93 else setSortKey(2,QString::number(99)); 95 else setSortKey(2,QString::number(99));
94 } 96 }
95 if (mTodo->hasDueDate()) { 97 if (mTodo->hasDueDate()) {
96 setText(3, mTodo->dtDueDateStr()); 98 setText(3, mTodo->dtDueDateStr());
97 QDate d = mTodo->dtDue().date(); 99 QDate d = mTodo->dtDue().date();
98 keyd.sprintf("%04d%02d%02d",d.year(),d.month(),d.day()); 100 keyd.sprintf("%04d%02d%02d",d.year(),d.month(),d.day());
99 setSortKey(3,keyd); 101 // setSortKey(3,keyd);
100 if (mTodo->doesFloat()) { 102 if (mTodo->doesFloat()) {
101 setText(4,""); 103 setText(4,"");
102 } 104 }
103 else { 105 else {
104 setText(4,mTodo->dtDueTimeStr()); 106 setText(4,mTodo->dtDueTimeStr());
105 QTime t = mTodo->dtDue().time(); 107 QTime t = mTodo->dtDue().time();
106 keyt.sprintf("%02d%02d",t.hour(),t.minute()); 108 keyt.sprintf("%02d%02d",t.hour(),t.minute());
107 setSortKey(4,keyt); 109 //setSortKey(4,keyt);
108 } 110 }
109 } else { 111 } else {
110 setText(3,""); 112 setText(3,"");
111 setText(4,""); 113 setText(4,"");
112 } 114 }
113 setSortKey(3,keyd); 115 setSortKey(3,keyd);
114 setSortKey(4,keyt); 116 setSortKey(4,keyt);
115 117
116 if (mTodo->isCompleted()) setSortKey(1,"6" + QString::number(mTodo->priority())+keyd+keyt); 118 if (mTodo->isCompleted()) setSortKey(1,"6" + QString::number(mTodo->priority())+keyd+keyt);
117 else setSortKey(1,QString::number(mTodo->priority())+keyd+keyt); 119 else setSortKey(1,QString::number(mTodo->priority())+keyd+keyt);
118 120
119 setText(5,mTodo->cancelled() ? i18n("Yes") : i18n("No")); 121
120 setText(6,mTodo->categoriesStr()); 122
123 if (mTodo->hasStartDate()) {
124 setText(5, mTodo->dtStartDateStr());
125 QDate d = mTodo->dtStart().date();
126 skeyd.sprintf("%04d%02d%02d",d.year(),d.month(),d.day());
127
128 if (mTodo->doesFloat()) {
129 setText(6,"");
130 }
131 else {
132 setText(6,mTodo->dtStartTimeStr());
133 QTime t = mTodo->dtStart().time();
134 skeyt.sprintf("%02d%02d",t.hour(),t.minute());
135
136 }
137 } else {
138 setText(5,"");
139 setText(6,"");
140 }
141 setSortKey(5,skeyd);
142 setSortKey(6,skeyt);
143
144 setText(7,mTodo->cancelled() ? i18n("Yes") : i18n("No"));
145 setText(8,mTodo->categoriesStr());
121 146
122#if 0 147#if 0
123 // Find sort id in description. It's the text behind the last '#' character 148 // Find sort id in description. It's the text behind the last '#' character
124 // found in the description. White spaces are removed from beginning and end 149 // found in the description. White spaces are removed from beginning and end
125 // of sort id. 150 // of sort id.
126 int pos = mTodo->description().findRev('#'); 151 int pos = mTodo->description().findRev('#');
127 if (pos < 0) { 152 if (pos < 0) {
128 setText(6,""); 153 setText(6,"");
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp
index 6e151f9..b2dd266 100644
--- a/korganizer/koviewmanager.cpp
+++ b/korganizer/koviewmanager.cpp
@@ -504,16 +504,17 @@ void KOViewManager::showTodoView()
504 connect( mTodoView, SIGNAL( reparentTodoSignal( Todo *,Todo * ) ), 504 connect( mTodoView, SIGNAL( reparentTodoSignal( Todo *,Todo * ) ),
505 mMainView, SLOT ( todo_resub( Todo *, Todo *) ) ); 505 mMainView, SLOT ( todo_resub( Todo *, Todo *) ) );
506 connect( mTodoView, SIGNAL( moveTodoSignal( Incidence * ) ), 506 connect( mTodoView, SIGNAL( moveTodoSignal( Incidence * ) ),
507 mMainView, SLOT ( moveIncidence( Incidence * ) ) ); 507 mMainView, SLOT ( moveIncidence( Incidence * ) ) );
508 connect( mTodoView, SIGNAL( beamTodoSignal( Incidence * ) ), 508 connect( mTodoView, SIGNAL( beamTodoSignal( Incidence * ) ),
509 mMainView, SLOT ( beamIncidence( Incidence * ) ) ); 509 mMainView, SLOT ( beamIncidence( Incidence * ) ) );
510 KConfig *config = KOGlobals::config(); 510 KConfig *config = KOGlobals::config();
511 mTodoView->restoreLayout(config,"Todo View"); 511 mTodoView->restoreLayout(config,"Todo View");
512 mTodoView->setNavigator( mMainView->dateNavigator() );
512 } 513 }
513 514
514 globalFlagBlockAgenda = 1; 515 globalFlagBlockAgenda = 1;
515 showView( mTodoView, true ); 516 showView( mTodoView, true );
516 517
517} 518}
518 519
519void KOViewManager::showJournalView() 520void KOViewManager::showJournalView()
diff --git a/version b/version
index ef03779..65eb8d1 100644
--- a/version
+++ b/version
@@ -1 +1 @@
version = "1.9.15"; version = "1.9.16";