-rw-r--r-- | korganizer/kotodoview.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp index da8b4bc..c5b9a21 100644 --- a/korganizer/kotodoview.cpp +++ b/korganizer/kotodoview.cpp @@ -21,12 +21,13 @@ without including the source code for Qt in the source distribution. */ #include <qlayout.h> #include <qheader.h> #include <qcursor.h> +#include <qwhatsthis.h> #include <qvbox.h> #include <kdebug.h> #include "koprefs.h" #include <klocale.h> #include <kglobal.h> @@ -37,12 +38,13 @@ #include <libkcal/vcaldrag.h> #include <libkcal/calfilter.h> #include <libkcal/dndfactory.h> #include <libkcal/calendarresources.h> #include <libkcal/resourcecalendar.h> #include <kresources/resourceselectdialog.h> +#include <libkcal/kincidenceformatter.h> #ifndef DESKTOP_VERSION #include <qpe/qpeapplication.h> #else #include <qapplication.h> #endif #ifndef KORG_NOPRINTER @@ -50,12 +52,28 @@ #endif #include "docprefs.h" #include "kotodoview.h" using namespace KOrg; + +class KOTodoViewWhatsThis :public QWhatsThis +{ +public: + KOTodoViewWhatsThis( QWidget *wid, KOTodoView* view ) : QWhatsThis( wid ), _wid(wid),_view (view) { }; + +protected: + virtual QString text( const QPoint& p) + { + return _view->getWhatsThisText(p) ; + } +private: + QWidget* _wid; + KOTodoView * _view; +}; + KOTodoListView::KOTodoListView(Calendar *calendar,QWidget *parent, const char *name) : KListView(parent,name) { mName = QString ( name ); mCalendar = calendar; @@ -392,12 +410,14 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : mTodoListView->setColumnWidthMode(5, QListView::Manual); mTodoListView->setColumnWidthMode(6, QListView::Manual); mTodoListView->setColumnWidthMode(7, QListView::Manual); mTodoListView->setColumnWidthMode(8, QListView::Manual); + new KOTodoViewWhatsThis(mTodoListView->viewport(),this); + mPriorityPopupMenu = new QPopupMenu(this); for (int i = 1; i <= 5; i++) { QString label = QString ("%1").arg (i); mPriority[mPriorityPopupMenu->insertItem (label)] = i; } connect (mPriorityPopupMenu, SIGNAL(activated (int)), SLOT (setNewPriority(int))); @@ -529,12 +549,20 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : } KOTodoView::~KOTodoView() { delete mDocPrefs; } +QString KOTodoView::getWhatsThisText(QPoint p) +{ + KOTodoViewItem* item = ( KOTodoViewItem* ) mTodoListView->itemAt( p ); + if ( item ) + return KIncidenceFormatter::instance()->getFormattedText( item->todo() ); + return i18n("That is the todo view" ); + +} void KOTodoView::jumpToDate () { // if (mActiveItem) { // mActiveItem->todo()); // if ( mActiveItem->todo()->hasDueDate() ) |