author | zautrix <zautrix> | 2005-01-05 14:17:14 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-01-05 14:17:14 (UTC) |
commit | df0200487afbfa59b80a79e548d70b5203019003 (patch) (side-by-side diff) | |
tree | 2240de4162736461316c8cb3cd00f87a8a9bf2bd | |
parent | b8410daa179dbff2ebb833071ba50b9da36e6330 (diff) | |
download | kdepimpi-df0200487afbfa59b80a79e548d70b5203019003.zip kdepimpi-df0200487afbfa59b80a79e548d70b5203019003.tar.gz kdepimpi-df0200487afbfa59b80a79e548d70b5203019003.tar.bz2 |
todo enhancements/fixes
-rw-r--r-- | bin/kdepim/WhatsNew.txt | 8 | ||||
-rw-r--r-- | korganizer/calendarview.cpp | 4 | ||||
-rw-r--r-- | korganizer/koagendaitem.cpp | 2 | ||||
-rw-r--r-- | korganizer/kodialogmanager.cpp | 2 | ||||
-rw-r--r-- | korganizer/koprefs.cpp | 2 | ||||
-rw-r--r-- | korganizer/koprefs.h | 2 | ||||
-rw-r--r-- | korganizer/koprefsdialog.cpp | 13 | ||||
-rw-r--r-- | korganizer/kotodoview.cpp | 78 | ||||
-rw-r--r-- | korganizer/kotodoview.h | 7 | ||||
-rw-r--r-- | korganizer/kotodoviewitem.cpp | 33 | ||||
-rw-r--r-- | korganizer/koviewmanager.cpp | 1 | ||||
-rw-r--r-- | version | 2 |
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,6 +1,14 @@ Info about the changes in new versions of KDE-Pim/Pi +********** VERSION 1.9.16 ************ + +KO/Pi: +Fixed search dialog size on Z 6000 (480x640 display). +Added setting to hide/show time in agenda items. +Added setting to hide not running todos in todo view. +Added columns for start date/time in todo view. + ********** VERSION 1.9.15 ************ Usebilty enhancements in KO/Pi: When clicking on the date in a month view cell, the day view is shown. diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index a46cd87..7ddbe23 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp @@ -265,8 +265,9 @@ void CalendarView::init() mDateNavigator = new KDateNavigator(mLeftSplitter, mCalendar, TRUE, "CalendarView::DateNavigator", QDate::currentDate() ); mLeftSplitter->setResizeMode(mDateNavigator,QSplitter::KeepSize); mTodoList = new KOTodoView(mCalendar, mLeftSplitter, "todolist_small2"); + mTodoList->setNavigator( mNavigator ); mFilterView = new KOFilterView(&mFilters,mLeftSplitter,"CalendarView::FilterView"); #ifdef KORG_NORESOURCEVIEW mResourceView = 0; @@ -310,8 +311,9 @@ void CalendarView::init() // mDateNavigator->blockSignals( true ); leftFrameLayout->addWidget( mDateNavigator ); mFilterView = new KOFilterView(&mFilters,leftFrame,"CalendarView::FilterView"); mTodoList = new KOTodoView(mCalendar, leftFrame, "todolistsmall"); + mTodoList->setNavigator( mNavigator ); if ( QApplication::desktop()->width() < 480 ) { leftFrameLayout->addWidget(mFilterView); leftFrameLayout->addWidget(mTodoList, 2 ); @@ -2143,8 +2145,10 @@ void CalendarView::updateView() DateList tmpList = mNavigator->selectedDates(); // We assume that the navigator only selects consecutive days. updateView( tmpList.first(), tmpList.last() ); + if ( KOPrefs::instance()->mHideNonStartedTodos ) + mTodoList->updateView(); } void CalendarView::updateUnmanagedViews() { diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp index 46184ac..6965ba7 100644 --- a/korganizer/koagendaitem.cpp +++ b/korganizer/koagendaitem.cpp @@ -497,9 +497,9 @@ void KOAgendaItem::computeText() } else { - if ( !(mIncidence->doesFloat())) + if ( !(mIncidence->doesFloat()) && KOPrefs::instance()->mShowTimeInAgenda) mDisplayedText += ": " +KGlobal::locale()->formatTime((static_cast<Event*>(mIncidence))->dtStart().time()) + "-" + KGlobal::locale()->formatTime((static_cast<Event*>(mIncidence))->dtEnd().time()) ; if ( mAllDay ) { if ( mIncidence->dtStart().date().addDays(3) < mIncidence->dtEnd().date() ) { diff --git a/korganizer/kodialogmanager.cpp b/korganizer/kodialogmanager.cpp index db7c3f2..c99c0cb 100644 --- a/korganizer/kodialogmanager.cpp +++ b/korganizer/kodialogmanager.cpp @@ -190,9 +190,9 @@ void KODialogManager::showSearchDialog() connect(mMainView, SIGNAL(updateSearchDialog()), mSearchDialog, SLOT(updateList())); // connect( lview, SIGNAL( incidenceSelected( Incidence * ) ), // mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); #ifndef DESKTOP_VERSION - mSearchDialog->setMaximumSize( 640, 480 ); + mSearchDialog->setMaximumSize( QApplication::desktop()->size()); //mSearchDialog->setGeometry( 40,40, 400, 300); mSearchDialog->showMaximized(); #else KConfig *config = KOGlobals::config(); diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp index 1cdb2fb..aae4692 100644 --- a/korganizer/koprefs.cpp +++ b/korganizer/koprefs.cpp @@ -109,8 +109,10 @@ KOPrefs::KOPrefs() : addItemInt("Whats Next Days",&mWhatsNextDays,3); addItemInt("Whats Next Prios",&mWhatsNextPrios,1); addItemBool("ShowTodoInAgenda",&mShowTodoInAgenda,true); + addItemBool("ShowTimeInAgenda",&mShowTimeInAgenda,true); + addItemBool("HideNonStartedTodos",&mHideNonStartedTodos,false); addItemBool("ShowCompletedTodo",&mShowCompletedTodo,true); addItemInt("AllDay Size",&mAllDaySize,28); QString defAlarm = KGlobal::iconLoader()->iconPath()+"koalarm.wav"; addItemString("DefaultAlarmFile",&mDefaultAlarmFile,defAlarm ); diff --git a/korganizer/koprefs.h b/korganizer/koprefs.h index f2fe77a..69722a1 100644 --- a/korganizer/koprefs.h +++ b/korganizer/koprefs.h @@ -189,8 +189,10 @@ class KOPrefs : public KPimPrefs bool mAskForQuit; bool mUsePassWd; bool mShowSyncEvents; bool mShowTodoInAgenda; + bool mShowTimeInAgenda; + bool mHideNonStartedTodos; int mLastSyncTime; void setCategoryColor(QString cat,const QColor & color); QColor *categoryColor(QString cat); diff --git a/korganizer/koprefsdialog.cpp b/korganizer/koprefsdialog.cpp index 578c0e9..8aa24ee 100644 --- a/korganizer/koprefsdialog.cpp +++ b/korganizer/koprefsdialog.cpp @@ -92,8 +92,11 @@ KOPrefsDialog::KOPrefsDialog(QWidget *parent, char *name, bool modal) : //setupSyncAlgTab(); //setupPrinterTab(); //setupGroupSchedulingTab(); //setupGroupAutomationTab(); + + if ( QApplication::desktop()->height() == 480 ) + hideButtons(); } KOPrefsDialog::~KOPrefsDialog() @@ -601,8 +604,13 @@ void KOPrefsDialog::setupViewsTab() &(KOPrefs::instance()->mEditOnDoubleClick),topFrame); topLayout->addWidget(dummy->checkBox(),ii++,0); dummy = + addWidBool(i18n("Show time in agenda items"), + &(KOPrefs::instance()->mShowTimeInAgenda),topFrame); + topLayout->addWidget(dummy->checkBox(),ii++,0); + + dummy = addWidBool(i18n("Highlight current day in agenda"), &(KOPrefs::instance()->mHighlightCurrentDay),topFrame); topLayout->addWidget(dummy->checkBox(),ii++,0); @@ -832,8 +840,13 @@ void KOPrefsDialog::setupViewsTab() topLayout = new QGridLayout(topFrame,4,1); topLayout->setSpacing(spacingHint()); topLayout->setMargin(marginHint()); ii = 0; +dummy = + addWidBool(i18n("Hide not running Todos in To-do view"), + &(KOPrefs::instance()->mHideNonStartedTodos),topFrame); + topLayout->addWidget(dummy->checkBox(),ii++,0); + KPrefsDialogWidBool *showCompletedTodo = addWidBool(i18n("To-do view shows completed Todos"), &(KOPrefs::instance()->mShowCompletedTodo),topFrame); diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp index 9cafc60..5d7b066 100644 --- a/korganizer/kotodoview.cpp +++ b/korganizer/kotodoview.cpp @@ -331,8 +331,9 @@ void KOQuickTodo::focusOutEvent(QFocusEvent *ev) KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : KOrg::BaseView(calendar,parent,name) { + mNavigator = 0; QBoxLayout *topLayout = new QVBoxLayout(this); mName = QString ( name ); mBlockUpdate = false; mQuickAdd = new KOQuickTodo(this); @@ -351,13 +352,20 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : mTodoListView->addColumn(i18n("Todo")); mTodoListView->addColumn(i18n("Prio")); mTodoListView->setColumnAlignment(1,AlignHCenter); mTodoListView->addColumn(i18n("Complete")); - mTodoListView->setColumnAlignment(2,AlignHCenter); + mTodoListView->setColumnAlignment(2,AlignCenter); + mTodoListView->addColumn(i18n("Due Date")); mTodoListView->setColumnAlignment(3,AlignLeft); mTodoListView->addColumn(i18n("Due Time")); mTodoListView->setColumnAlignment(4,AlignHCenter); + + mTodoListView->addColumn(i18n("Start Date")); + mTodoListView->setColumnAlignment(5,AlignLeft); + mTodoListView->addColumn(i18n("Start Time")); + mTodoListView->setColumnAlignment(6,AlignHCenter); + mTodoListView->addColumn(i18n("Cancelled")); mTodoListView->addColumn(i18n("Categories")); #if 0 mTodoListView->addColumn(i18n("Sort Id")); @@ -374,12 +382,11 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : mTodoListView->setColumnWidthMode(3, QListView::Manual); mTodoListView->setColumnWidthMode(4, QListView::Manual); mTodoListView->setColumnWidthMode(5, QListView::Manual); mTodoListView->setColumnWidthMode(6, QListView::Manual); - mTodoListView->setColumnAlignment( 2, AlignCenter ); -#if 0 - mTodoListView->setColumnWidthMode(6, QListView::Manual); -#endif + mTodoListView->setColumnWidthMode(7, QListView::Manual); + mTodoListView->setColumnWidthMode(8, QListView::Manual); + mPriorityPopupMenu = new QPopupMenu(this); for (int i = 1; i <= 5; i++) { QString label = QString ("%1").arg (i); @@ -427,8 +434,10 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : 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 ); mPopupMenu = new QPopupMenu(this); mPopupMenu->insertItem(SmallIconSet("todo"), i18n("New Todo..."), this, SLOT (newTodo()),0,1); @@ -437,12 +446,26 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : 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 ); mDocPrefs = new DocPrefs( name ); 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 *) ), SLOT( editItem( QListViewItem *) ) ); /* @@ -475,13 +498,8 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : connect( mTodoListView, SIGNAL(selectionChanged() ), SLOT( processSelectionChange() ) ); connect( mQuickAdd, SIGNAL( returnPressed () ), SLOT( addQuickTodo() ) ); -// if ( QApplication::desktop()->width() < 480 ) { -// setNarrow(); - // mTodoListView->setColumnWidth( 0, 100 ); - - // } } KOTodoView::~KOTodoView() @@ -496,18 +514,8 @@ void KOTodoView::jumpToDate () // if ( mActiveItem->todo()->hasDueDate() ) // emit mActiveItem->todo()jumpToTime( mTodo->dtDue().date() ); } -void KOTodoView::setNarrow() -{ - //mTodoListView->setColumnWidth( 0, 120 ); - mTodoListView->setColumnWidth( 1, 35 ); - mTodoListView->setColumnWidth( 2, 40 ); - mTodoListView->setColumnWidth( 3, 80 ); - mTodoListView->setColumnWidth( 4, 40 ); - mTodoListView->setColumnWidth( 5, 90 ); - -} void KOTodoView::updateView() { pendingSubtodo = 0; if ( mBlockUpdate ) { @@ -586,9 +594,9 @@ void KOTodoView::updateView() // qDebug("yytodo %s ", todo->summary().latin1()); // } //qDebug("for "); for(todo = todoList.first(); todo; todo = todoList.next()) { - if (!mTodoMap.contains(todo) && ( KOPrefs::instance()->mShowCompletedTodo || !todo->isCompleted() ) ) + if (!mTodoMap.contains(todo) && checkTodo( todo ) ) { insertTodoItem(todo); } } @@ -600,8 +608,24 @@ void KOTodoView::updateView() mTodoListView->setFocus(); processSelectionChange(); } +bool KOTodoView::checkTodo( Todo * todo ) +{ + + if ( !KOPrefs::instance()->mShowCompletedTodo && todo->isCompleted() ) + return false; + if ( KOPrefs::instance()->mHideNonStartedTodos && mNavigator ) { + if ( todo->hasStartDate() ) + if ( mNavigator->selectedDates().last() < todo->dtStart().date() ) + return false; + if ( todo->hasDueDate() ) + if ( mNavigator->selectedDates().first() > todo->dtDue().date() ) + return false; + } + return true; +} + void KOTodoView::restoreItemState( QListViewItem *item ) { pendingSubtodo = 0; while( item ) { @@ -615,8 +639,9 @@ void KOTodoView::restoreItemState( QListViewItem *item ) QMap<Todo *,KOTodoViewItem *>::ConstIterator KOTodoView::insertTodoItem(Todo *todo) { + // kdDebug() << "KOTodoView::insertTodoItem(): " << todo->getSummary() << endl; // TODO: Check, if dynmaic cast is necessary pendingSubtodo = 0; @@ -717,9 +742,9 @@ void KOTodoView::popupMenu(QListViewItem *item,const QPoint &,int column) mPercentageCompletedPopupMenu->popup(QCursor::pos ()); break; case 3: moveTodo(); break; - case 6: + case 8: getCategoryPopupMenu((KOTodoViewItem *)item)->popup(QCursor::pos ()); break; default: mItemPopupMenu->popup(QCursor::pos()); } @@ -994,8 +1019,17 @@ void KOTodoView::toggleQuickTodo() } mPopupMenu->setItemChecked(4,KOPrefs::instance()->mEnableQuickTodo); mItemPopupMenu->setItemChecked( 34 , KOPrefs::instance()->mEnableQuickTodo ); } + +void KOTodoView::toggleRunning() +{ + KOPrefs::instance()->mHideNonStartedTodos = !KOPrefs::instance()->mHideNonStartedTodos; + mPopupMenu->setItemChecked(5,KOPrefs::instance()->mHideNonStartedTodos); + mItemPopupMenu->setItemChecked( 35 , KOPrefs::instance()->mHideNonStartedTodos ); + updateView(); +} + void KOTodoView::toggleCompleted() { KOPrefs::instance()->mShowCompletedTodo = !KOPrefs::instance()->mShowCompletedTodo; mPopupMenu->setItemChecked( 3,KOPrefs::instance()->mShowCompletedTodo ); diff --git a/korganizer/kotodoview.h b/korganizer/kotodoview.h index 0c08677..5ca0362 100644 --- a/korganizer/kotodoview.h +++ b/korganizer/kotodoview.h @@ -42,8 +42,9 @@ #include "kotodoviewitem.h" #include "koprefs.h" #include "koglobals.h" +#include "datenavigator.h" class QDragEnterEvent; class QDragMoveEvent; class QDragLeaveEvent; @@ -117,9 +118,8 @@ class KOTodoView : public KOrg::BaseView return q;} /** Return number of shown dates. TodoView does not show dates, */ int currentDateCount() { return 0; } - void setNarrow(); void printPreview(CalPrinter *calPrinter, const QDate &fd, const QDate &td); void setDocumentId( const QString & ); @@ -127,8 +127,9 @@ class KOTodoView : public KOrg::BaseView void saveLayout(KConfig *config, const QString &group) const; void restoreLayout(KConfig *config, const QString &group); /** Create a popup menu to set categories */ QPopupMenu *getCategoryPopupMenu (KOTodoViewItem *todoItem); + void setNavigator( DateNavigator* nav ) {mNavigator = nav;} public slots: void updateView(); void updateConfig(); @@ -161,8 +162,9 @@ class KOTodoView : public KOrg::BaseView void changedCategories(int); void purgeCompleted(); void toggleCompleted(); + void toggleRunning(); void toggleQuickTodo(); void updateTodo( Todo *, int ); void itemClicked(QListViewItem *); @@ -206,8 +208,10 @@ class KOTodoView : public KOrg::BaseView void setTodoModified( Todo* ); QMap<Todo *,KOTodoViewItem *>::ConstIterator insertTodoItem(Todo *todo); void restoreItemState( QListViewItem * ); + bool checkTodo( Todo * ); + KOTodoListView *mTodoListView; QPopupMenu *mItemPopupMenu; QPopupMenu *mPopupMenu; QPopupMenu *mPriorityPopupMenu; @@ -228,7 +232,8 @@ class KOTodoView : public KOrg::BaseView bool mBlockUpdate; void todoModified(Todo *, int ); void keyPressEvent ( QKeyEvent * ) ; KOTodoViewItem * pendingSubtodo; + DateNavigator* mNavigator; }; #endif diff --git a/korganizer/kotodoviewitem.cpp b/korganizer/kotodoviewitem.cpp index ae0b334..347d982 100644 --- a/korganizer/kotodoviewitem.cpp +++ b/korganizer/kotodoviewitem.cpp @@ -78,8 +78,10 @@ void KOTodoViewItem::construct() // qDebug("KOTodoViewItem::construct() "); m_init = true; QString keyd = "=="; QString keyt = "=="; + QString skeyd = "=="; + QString skeyt = "=="; setOn(mTodo->isCompleted()); setText(0,mTodo->summary()); setText(1,QString::number(mTodo->priority())); @@ -95,17 +97,17 @@ void KOTodoViewItem::construct() if (mTodo->hasDueDate()) { setText(3, mTodo->dtDueDateStr()); QDate d = mTodo->dtDue().date(); keyd.sprintf("%04d%02d%02d",d.year(),d.month(),d.day()); - setSortKey(3,keyd); + // setSortKey(3,keyd); if (mTodo->doesFloat()) { setText(4,""); } else { setText(4,mTodo->dtDueTimeStr()); QTime t = mTodo->dtDue().time(); keyt.sprintf("%02d%02d",t.hour(),t.minute()); - setSortKey(4,keyt); + //setSortKey(4,keyt); } } else { setText(3,""); setText(4,""); @@ -115,10 +117,33 @@ void KOTodoViewItem::construct() if (mTodo->isCompleted()) setSortKey(1,"6" + QString::number(mTodo->priority())+keyd+keyt); else setSortKey(1,QString::number(mTodo->priority())+keyd+keyt); - setText(5,mTodo->cancelled() ? i18n("Yes") : i18n("No")); - setText(6,mTodo->categoriesStr()); + + + if (mTodo->hasStartDate()) { + setText(5, mTodo->dtStartDateStr()); + QDate d = mTodo->dtStart().date(); + skeyd.sprintf("%04d%02d%02d",d.year(),d.month(),d.day()); + + if (mTodo->doesFloat()) { + setText(6,""); + } + else { + setText(6,mTodo->dtStartTimeStr()); + QTime t = mTodo->dtStart().time(); + skeyt.sprintf("%02d%02d",t.hour(),t.minute()); + + } + } else { + setText(5,""); + setText(6,""); + } + setSortKey(5,skeyd); + setSortKey(6,skeyt); + + setText(7,mTodo->cancelled() ? i18n("Yes") : i18n("No")); + setText(8,mTodo->categoriesStr()); #if 0 // Find sort id in description. It's the text behind the last '#' character // found in the description. White spaces are removed from beginning and end diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp index 6e151f9..b2dd266 100644 --- a/korganizer/koviewmanager.cpp +++ b/korganizer/koviewmanager.cpp @@ -508,8 +508,9 @@ void KOViewManager::showTodoView() connect( mTodoView, SIGNAL( beamTodoSignal( Incidence * ) ), mMainView, SLOT ( beamIncidence( Incidence * ) ) ); KConfig *config = KOGlobals::config(); mTodoView->restoreLayout(config,"Todo View"); + mTodoView->setNavigator( mMainView->dateNavigator() ); } globalFlagBlockAgenda = 1; showView( mTodoView, true ); @@ -1 +1 @@ -version = "1.9.15"; +version = "1.9.16"; |