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
@@ -23,8 +23,9 @@
#include <qlayout.h>
#include <qheader.h>
#include <qcursor.h>
+#include <qwhatsthis.h>
#include <qvbox.h>
#include <kdebug.h>
#include "koprefs.h"
@@ -39,8 +40,9 @@
#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>
@@ -52,8 +54,24 @@
#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)
{
@@ -394,8 +412,10 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) :
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;
@@ -531,8 +551,16 @@ 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) {