summaryrefslogtreecommitdiffabout
path: root/korganizer/kotodoview.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/kotodoview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kotodoview.cpp28
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
@@ -24,6 +24,7 @@
#include <qlayout.h>
#include <qheader.h>
#include <qcursor.h>
+#include <qwhatsthis.h>
#include <qvbox.h>
#include <kdebug.h>
@@ -40,6 +41,7 @@
#include <libkcal/calendarresources.h>
#include <libkcal/resourcecalendar.h>
#include <kresources/resourceselectdialog.h>
+#include <libkcal/kincidenceformatter.h>
#ifndef DESKTOP_VERSION
#include <qpe/qpeapplication.h>
#else
@@ -53,6 +55,22 @@
#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)
@@ -395,6 +413,8 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) :
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);
@@ -532,6 +552,14 @@ 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 ()
{