-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 @@ | |||
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | #include <qlayout.h> | 24 | #include <qlayout.h> |
25 | #include <qheader.h> | 25 | #include <qheader.h> |
26 | #include <qcursor.h> | 26 | #include <qcursor.h> |
27 | #include <qwhatsthis.h> | ||
27 | 28 | ||
28 | #include <qvbox.h> | 29 | #include <qvbox.h> |
29 | #include <kdebug.h> | 30 | #include <kdebug.h> |
30 | #include "koprefs.h" | 31 | #include "koprefs.h" |
31 | #include <klocale.h> | 32 | #include <klocale.h> |
32 | #include <kglobal.h> | 33 | #include <kglobal.h> |
@@ -37,12 +38,13 @@ | |||
37 | #include <libkcal/vcaldrag.h> | 38 | #include <libkcal/vcaldrag.h> |
38 | #include <libkcal/calfilter.h> | 39 | #include <libkcal/calfilter.h> |
39 | #include <libkcal/dndfactory.h> | 40 | #include <libkcal/dndfactory.h> |
40 | #include <libkcal/calendarresources.h> | 41 | #include <libkcal/calendarresources.h> |
41 | #include <libkcal/resourcecalendar.h> | 42 | #include <libkcal/resourcecalendar.h> |
42 | #include <kresources/resourceselectdialog.h> | 43 | #include <kresources/resourceselectdialog.h> |
44 | #include <libkcal/kincidenceformatter.h> | ||
43 | #ifndef DESKTOP_VERSION | 45 | #ifndef DESKTOP_VERSION |
44 | #include <qpe/qpeapplication.h> | 46 | #include <qpe/qpeapplication.h> |
45 | #else | 47 | #else |
46 | #include <qapplication.h> | 48 | #include <qapplication.h> |
47 | #endif | 49 | #endif |
48 | #ifndef KORG_NOPRINTER | 50 | #ifndef KORG_NOPRINTER |
@@ -50,12 +52,28 @@ | |||
50 | #endif | 52 | #endif |
51 | #include "docprefs.h" | 53 | #include "docprefs.h" |
52 | 54 | ||
53 | #include "kotodoview.h" | 55 | #include "kotodoview.h" |
54 | using namespace KOrg; | 56 | using namespace KOrg; |
55 | 57 | ||
58 | |||
59 | class KOTodoViewWhatsThis :public QWhatsThis | ||
60 | { | ||
61 | public: | ||
62 | KOTodoViewWhatsThis( QWidget *wid, KOTodoView* view ) : QWhatsThis( wid ), _wid(wid),_view (view) { }; | ||
63 | |||
64 | protected: | ||
65 | virtual QString text( const QPoint& p) | ||
66 | { | ||
67 | return _view->getWhatsThisText(p) ; | ||
68 | } | ||
69 | private: | ||
70 | QWidget* _wid; | ||
71 | KOTodoView * _view; | ||
72 | }; | ||
73 | |||
56 | KOTodoListView::KOTodoListView(Calendar *calendar,QWidget *parent, | 74 | KOTodoListView::KOTodoListView(Calendar *calendar,QWidget *parent, |
57 | const char *name) : | 75 | const char *name) : |
58 | KListView(parent,name) | 76 | KListView(parent,name) |
59 | { | 77 | { |
60 | mName = QString ( name ); | 78 | mName = QString ( name ); |
61 | mCalendar = calendar; | 79 | mCalendar = calendar; |
@@ -392,12 +410,14 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : | |||
392 | mTodoListView->setColumnWidthMode(5, QListView::Manual); | 410 | mTodoListView->setColumnWidthMode(5, QListView::Manual); |
393 | mTodoListView->setColumnWidthMode(6, QListView::Manual); | 411 | mTodoListView->setColumnWidthMode(6, QListView::Manual); |
394 | mTodoListView->setColumnWidthMode(7, QListView::Manual); | 412 | mTodoListView->setColumnWidthMode(7, QListView::Manual); |
395 | mTodoListView->setColumnWidthMode(8, QListView::Manual); | 413 | mTodoListView->setColumnWidthMode(8, QListView::Manual); |
396 | 414 | ||
397 | 415 | ||
416 | new KOTodoViewWhatsThis(mTodoListView->viewport(),this); | ||
417 | |||
398 | mPriorityPopupMenu = new QPopupMenu(this); | 418 | mPriorityPopupMenu = new QPopupMenu(this); |
399 | for (int i = 1; i <= 5; i++) { | 419 | for (int i = 1; i <= 5; i++) { |
400 | QString label = QString ("%1").arg (i); | 420 | QString label = QString ("%1").arg (i); |
401 | mPriority[mPriorityPopupMenu->insertItem (label)] = i; | 421 | mPriority[mPriorityPopupMenu->insertItem (label)] = i; |
402 | } | 422 | } |
403 | connect (mPriorityPopupMenu, SIGNAL(activated (int)), SLOT (setNewPriority(int))); | 423 | connect (mPriorityPopupMenu, SIGNAL(activated (int)), SLOT (setNewPriority(int))); |
@@ -529,12 +549,20 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : | |||
529 | } | 549 | } |
530 | 550 | ||
531 | KOTodoView::~KOTodoView() | 551 | KOTodoView::~KOTodoView() |
532 | { | 552 | { |
533 | delete mDocPrefs; | 553 | delete mDocPrefs; |
534 | } | 554 | } |
555 | QString KOTodoView::getWhatsThisText(QPoint p) | ||
556 | { | ||
557 | KOTodoViewItem* item = ( KOTodoViewItem* ) mTodoListView->itemAt( p ); | ||
558 | if ( item ) | ||
559 | return KIncidenceFormatter::instance()->getFormattedText( item->todo() ); | ||
560 | return i18n("That is the todo view" ); | ||
561 | |||
562 | } | ||
535 | 563 | ||
536 | void KOTodoView::jumpToDate () | 564 | void KOTodoView::jumpToDate () |
537 | { | 565 | { |
538 | // if (mActiveItem) { | 566 | // if (mActiveItem) { |
539 | // mActiveItem->todo()); | 567 | // mActiveItem->todo()); |
540 | // if ( mActiveItem->todo()->hasDueDate() ) | 568 | // if ( mActiveItem->todo()->hasDueDate() ) |