summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-02-02 10:58:10 (UTC)
committer zautrix <zautrix>2005-02-02 10:58:10 (UTC)
commitd2f6c50fb3b236e37aaa46ade819ab163f19868a (patch) (unidiff)
tree02b2c7bbcd6d78140def0650fa4b440199e04ef7
parent5bc675bc7e9d5d6fa2d2bc48675a7cfa985ab2c7 (diff)
downloadkdepimpi-d2f6c50fb3b236e37aaa46ade819ab163f19868a.zip
kdepimpi-d2f6c50fb3b236e37aaa46ade819ab163f19868a.tar.gz
kdepimpi-d2f6c50fb3b236e37aaa46ade819ab163f19868a.tar.bz2
qwt added
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koagendaitem.cpp23
-rw-r--r--korganizer/koagendaitem.h1
-rw-r--r--korganizer/kolistview.cpp28
-rw-r--r--korganizer/kolistview.h1
-rw-r--r--korganizer/kotodoview.cpp28
-rw-r--r--korganizer/kotodoview.h1
6 files changed, 80 insertions, 2 deletions
diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp
index 5f9ed92..df7d612 100644
--- a/korganizer/koagendaitem.cpp
+++ b/korganizer/koagendaitem.cpp
@@ -47,41 +47,61 @@ extern int globalFlagBlockAgendaItemUpdate;
47#include "koprefs.h" 47#include "koprefs.h"
48 48
49#include "koagendaitem.h" 49#include "koagendaitem.h"
50//#include "koagendaitem.moc" 50//#include "koagendaitem.moc"
51 51
52 52
53//-------------------------------------------------------------------------- 53//--------------------------------------------------------------------------
54 54
55QToolTipGroup *KOAgendaItem::mToolTipGroup = 0; 55QToolTipGroup *KOAgendaItem::mToolTipGroup = 0;
56 56
57//-------------------------------------------------------------------------- 57//--------------------------------------------------------------------------
58 58
59class KOAgendaItemWhatsThis :public QWhatsThis
60{
61public:
62 KOAgendaItemWhatsThis( KOAgendaItem* view ) : QWhatsThis( view ),_view (view) { };
63
64protected:
65 virtual QString text( const QPoint& )
66 {
67 return _view->getWhatsThisText() ;
68 }
69private:
70 KOAgendaItem * _view;
71};
72
59KOAgendaItem::KOAgendaItem(Incidence *incidence, QDate qd, QWidget *parent,bool allday, 73KOAgendaItem::KOAgendaItem(Incidence *incidence, QDate qd, QWidget *parent,bool allday,
60 const char *name,WFlags) : 74 const char *name,WFlags) :
61 QWidget(parent, name), mIncidence(incidence), mDate(qd) 75 QWidget(parent, name), mIncidence(incidence), mDate(qd)
62{ 76{
63#ifndef DESKTOP_VERSION 77#ifndef DESKTOP_VERSION
64 QPEApplication::setStylusOperation( this, QPEApplication::RightOnHold ); 78 QPEApplication::setStylusOperation( this, QPEApplication::RightOnHold );
65#endif 79#endif
80 new KOAgendaItemWhatsThis(this);
66 int wflags = getWFlags() |WRepaintNoErase;// WResizeNoErase 81 int wflags = getWFlags() |WRepaintNoErase;// WResizeNoErase
67 setWFlags ( wflags); 82 setWFlags ( wflags);
68 mAllDay = allday; 83 mAllDay = allday;
69 init ( incidence, qd ); 84 init ( incidence, qd );
70 setMouseTracking(true); 85 setMouseTracking(true);
71 //setAcceptDrops(true); 86 //setAcceptDrops(true);
72 xPaintCoord = -1; 87 xPaintCoord = -1;
73 yPaintCoord = -1; 88 yPaintCoord = -1;
74} 89}
75 90QString KOAgendaItem::getWhatsThisText()
91{
92 if ( mIncidence )
93 return KIncidenceFormatter::instance()->getFormattedText( mIncidence );
94 return "KOAgendaItem::getWhatsThisText()::internal error";
95}
76void KOAgendaItem::init ( Incidence *incidence, QDate qd ) 96void KOAgendaItem::init ( Incidence *incidence, QDate qd )
77{ 97{
78 mIncidence = incidence; 98 mIncidence = incidence;
79 mDate = qd; 99 mDate = qd;
80 mFirstMultiItem = 0; 100 mFirstMultiItem = 0;
81 mNextMultiItem = 0; 101 mNextMultiItem = 0;
82 mLastMultiItem = 0; 102 mLastMultiItem = 0;
83 computeText(); 103 computeText();
84 104
85 if ( (incidence->type() == "Todo") && 105 if ( (incidence->type() == "Todo") &&
86 ( !((static_cast<Todo*>(incidence))->isCompleted()) && 106 ( !((static_cast<Todo*>(incidence))->isCompleted()) &&
87 ((static_cast<Todo*>(incidence))->dtDue().date() <= QDate::currentDate()) ) ) { 107 ((static_cast<Todo*>(incidence))->dtDue().date() <= QDate::currentDate()) ) ) {
@@ -495,25 +515,24 @@ void KOAgendaItem::computeText()
495 515
496 } 516 }
497 517
498 if ( !mIncidence->location().isEmpty() ) { 518 if ( !mIncidence->location().isEmpty() ) {
499 if ( mAllDay ) 519 if ( mAllDay )
500 mDisplayedText += " ("; 520 mDisplayedText += " (";
501 else 521 else
502 mDisplayedText += "\n("; 522 mDisplayedText += "\n(";
503 mDisplayedText += mIncidence->location() +")"; 523 mDisplayedText += mIncidence->location() +")";
504 } 524 }
505 525
506 QString tipText = mIncidence->summary(); 526 QString tipText = mIncidence->summary();
507 QWhatsThis::add(this,KIncidenceFormatter::instance()->getFormattedText( mIncidence ));
508 if ( !mIncidence->doesFloat() ) { 527 if ( !mIncidence->doesFloat() ) {
509 if ( mIncidence->type() == "Event" ) { 528 if ( mIncidence->type() == "Event" ) {
510 if ( (static_cast<Event*>(mIncidence))->isMultiDay() ) { 529 if ( (static_cast<Event*>(mIncidence))->isMultiDay() ) {
511 tipText += "\n"+i18n("From: ")+mIncidence->dtStartStr(); 530 tipText += "\n"+i18n("From: ")+mIncidence->dtStartStr();
512 tipText += "\n"+i18n("To: ")+(static_cast<Event*>(mIncidence))->dtEndStr(); 531 tipText += "\n"+i18n("To: ")+(static_cast<Event*>(mIncidence))->dtEndStr();
513 } 532 }
514 else { 533 else {
515 tipText += "\n"+i18n("Time: ")+mIncidence->dtStartTimeStr(); 534 tipText += "\n"+i18n("Time: ")+mIncidence->dtStartTimeStr();
516 tipText += " - "+(static_cast<Event*>(mIncidence))->dtEndTimeStr(); 535 tipText += " - "+(static_cast<Event*>(mIncidence))->dtEndTimeStr();
517 } 536 }
518 } 537 }
519 else if ( mIncidence->type() == "Todo" ) { 538 else if ( mIncidence->type() == "Todo" ) {
diff --git a/korganizer/koagendaitem.h b/korganizer/koagendaitem.h
index 7321af2..5b8f420 100644
--- a/korganizer/koagendaitem.h
+++ b/korganizer/koagendaitem.h
@@ -37,24 +37,25 @@ using namespace KCal;
37 The KOAgendaItem has to make sure that it receives all mouse events, which are 37 The KOAgendaItem has to make sure that it receives all mouse events, which are
38 to be used for dragging and resizing. That means it has to be installed as 38 to be used for dragging and resizing. That means it has to be installed as
39 eventfiler for its children, if it has children, and it has to pass mouse 39 eventfiler for its children, if it has children, and it has to pass mouse
40 events from the cildren to itself. See eventFilter(). 40 events from the cildren to itself. See eventFilter().
41*/ 41*/
42class KOAgendaItem : public QWidget 42class KOAgendaItem : public QWidget
43{ 43{
44 Q_OBJECT 44 Q_OBJECT
45 public: 45 public:
46 KOAgendaItem(Incidence *incidence, QDate qd, QWidget *parent, bool allday, const char *name=0, 46 KOAgendaItem(Incidence *incidence, QDate qd, QWidget *parent, bool allday, const char *name=0,
47 WFlags f=0 ); 47 WFlags f=0 );
48 ~KOAgendaItem(); 48 ~KOAgendaItem();
49 QString getWhatsThisText();
49 void init ( Incidence *incidence, QDate qd ); 50 void init ( Incidence *incidence, QDate qd );
50 int cellX() { return mCellX; } 51 int cellX() { return mCellX; }
51 int cellXWidth() { return mCellXWidth; } 52 int cellXWidth() { return mCellXWidth; }
52 int cellYTop() { return mCellYTop; } 53 int cellYTop() { return mCellYTop; }
53 int cellYBottom() { return mCellYBottom; } 54 int cellYBottom() { return mCellYBottom; }
54 int cellHeight(); 55 int cellHeight();
55 int cellWidth(); 56 int cellWidth();
56 int subCell() { return mSubCell; } 57 int subCell() { return mSubCell; }
57 int subCells() { return mSubCells; } 58 int subCells() { return mSubCells; }
58 59
59 void setCellXY(int X, int YTop, int YBottom); 60 void setCellXY(int X, int YTop, int YBottom);
60 void setCellY(int YTop, int YBottom); 61 void setCellY(int YTop, int YBottom);
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp
index b21b419..732fc46 100644
--- a/korganizer/kolistview.cpp
+++ b/korganizer/kolistview.cpp
@@ -23,54 +23,73 @@
23*/ 23*/
24 24
25#include <qlistview.h> 25#include <qlistview.h>
26#include <qlayout.h> 26#include <qlayout.h>
27#include <qlabel.h> 27#include <qlabel.h>
28#include <qpopupmenu.h> 28#include <qpopupmenu.h>
29#include <qprogressbar.h> 29#include <qprogressbar.h>
30#include <qfileinfo.h> 30#include <qfileinfo.h>
31#include <qmessagebox.h> 31#include <qmessagebox.h>
32#include <qdialog.h> 32#include <qdialog.h>
33#include <qtextstream.h> 33#include <qtextstream.h>
34#include <qdir.h> 34#include <qdir.h>
35#include <qwhatsthis.h>
35#include <qregexp.h> 36#include <qregexp.h>
36 37
37#include <klocale.h> 38#include <klocale.h>
38#include <kdebug.h> 39#include <kdebug.h>
39#include <kiconloader.h> 40#include <kiconloader.h>
40#include <kglobal.h> 41#include <kglobal.h>
41 42
42#include <libkdepim/kpimglobalprefs.h> 43#include <libkdepim/kpimglobalprefs.h>
43#include <libkcal/calendar.h> 44#include <libkcal/calendar.h>
44#include <libkcal/calendarlocal.h> 45#include <libkcal/calendarlocal.h>
45#include <libkcal/icalformat.h> 46#include <libkcal/icalformat.h>
46#include <libkcal/vcalformat.h> 47#include <libkcal/vcalformat.h>
47#include <libkcal/recurrence.h> 48#include <libkcal/recurrence.h>
48#include <libkcal/filestorage.h> 49#include <libkcal/filestorage.h>
49#include <libkdepim/categoryselectdialog.h> 50#include <libkdepim/categoryselectdialog.h>
51#include <libkcal/kincidenceformatter.h>
50#ifndef DESKTOP_VERSION 52#ifndef DESKTOP_VERSION
51#include <qpe/qpeapplication.h> 53#include <qpe/qpeapplication.h>
52#else 54#else
53#include <qapplication.h> 55#include <qapplication.h>
54#endif 56#endif
55 57
56#ifndef KORG_NOPRINTER 58#ifndef KORG_NOPRINTER
57#include "calprinter.h" 59#include "calprinter.h"
58#endif 60#endif
59#include "koglobals.h" 61#include "koglobals.h"
60#include "koprefs.h" 62#include "koprefs.h"
61#include "kfiledialog.h" 63#include "kfiledialog.h"
62 64
63#include "kolistview.h" 65#include "kolistview.h"
64 66
67
68class KOListViewWhatsThis :public QWhatsThis
69{
70public:
71 KOListViewWhatsThis( QWidget *wid, KOListView* view ) : QWhatsThis( wid ), _wid(wid),_view (view) { };
72
73protected:
74 virtual QString text( const QPoint& p)
75 {
76 return _view->getWhatsThisText(p) ;
77 }
78private:
79 QWidget* _wid;
80 KOListView * _view;
81};
82
83
65ListItemVisitor::ListItemVisitor(KOListViewItem *item, QDate date ) 84ListItemVisitor::ListItemVisitor(KOListViewItem *item, QDate date )
66{ 85{
67 mItem = item; 86 mItem = item;
68 mDate = date; 87 mDate = date;
69} 88}
70 89
71ListItemVisitor::~ListItemVisitor() 90ListItemVisitor::~ListItemVisitor()
72{ 91{
73} 92}
74 93
75bool ListItemVisitor::visit(Event *e) 94bool ListItemVisitor::visit(Event *e)
76{ 95{
@@ -215,24 +234,25 @@ KOListView::KOListView(Calendar *calendar, QWidget *parent,
215 mListView->setColumnAlignment(0,AlignLeft); 234 mListView->setColumnAlignment(0,AlignLeft);
216 mListView->setColumnAlignment(1,AlignLeft); 235 mListView->setColumnAlignment(1,AlignLeft);
217 mListView->setColumnAlignment(2,AlignHCenter); 236 mListView->setColumnAlignment(2,AlignHCenter);
218 mListView->setColumnAlignment(3,AlignLeft); 237 mListView->setColumnAlignment(3,AlignLeft);
219 mListView->setColumnAlignment(4,AlignHCenter); 238 mListView->setColumnAlignment(4,AlignHCenter);
220 mListView->setColumnAlignment(5,AlignLeft); 239 mListView->setColumnAlignment(5,AlignLeft);
221 mListView->setColumnAlignment(6,AlignLeft); 240 mListView->setColumnAlignment(6,AlignLeft);
222 mListView->setColumnAlignment(7,AlignLeft); 241 mListView->setColumnAlignment(7,AlignLeft);
223 mListView->setColumnAlignment(8,AlignLeft); 242 mListView->setColumnAlignment(8,AlignLeft);
224 mListView->setColumnAlignment(9,AlignLeft); 243 mListView->setColumnAlignment(9,AlignLeft);
225 mListView->setColumnAlignment(10,AlignLeft); 244 mListView->setColumnAlignment(10,AlignLeft);
226 mListView->setColumnWidthMode(10, QListView::Manual); 245 mListView->setColumnWidthMode(10, QListView::Manual);
246 new KOListViewWhatsThis(mListView->viewport(),this);
227 247
228 int iii = 0; 248 int iii = 0;
229 for ( iii = 0; iii< 10 ; ++iii ) 249 for ( iii = 0; iii< 10 ; ++iii )
230 mListView->setColumnWidthMode( iii, QListView::Manual ); 250 mListView->setColumnWidthMode( iii, QListView::Manual );
231 251
232 QBoxLayout *layoutTop = new QVBoxLayout(this); 252 QBoxLayout *layoutTop = new QVBoxLayout(this);
233 layoutTop->addWidget(mListView); 253 layoutTop->addWidget(mListView);
234 mListView->setFont ( KOPrefs::instance()->mListViewFont ); 254 mListView->setFont ( KOPrefs::instance()->mListViewFont );
235 mPopupMenu = eventPopup(); 255 mPopupMenu = eventPopup();
236 mPopupMenu->addAdditionalItem(QIconSet(QPixmap()), 256 mPopupMenu->addAdditionalItem(QIconSet(QPixmap()),
237 i18n("Select all"),this, 257 i18n("Select all"),this,
238 SLOT(allSelection()),true); 258 SLOT(allSelection()),true);
@@ -286,24 +306,32 @@ KOListView::KOListView(Calendar *calendar, QWidget *parent,
286 QObject::connect(mListView,SIGNAL(currentChanged(QListViewItem *)), 306 QObject::connect(mListView,SIGNAL(currentChanged(QListViewItem *)),
287 SLOT(processSelectionChange(QListViewItem *))); 307 SLOT(processSelectionChange(QListViewItem *)));
288 QObject::connect(mListView,SIGNAL(showIncidence(Incidence *)), 308 QObject::connect(mListView,SIGNAL(showIncidence(Incidence *)),
289 SIGNAL(showIncidenceSignal(Incidence *)) ); 309 SIGNAL(showIncidenceSignal(Incidence *)) );
290 310
291 readSettings(KOGlobals::config(),"KOListView Layout"); 311 readSettings(KOGlobals::config(),"KOListView Layout");
292} 312}
293 313
294KOListView::~KOListView() 314KOListView::~KOListView()
295{ 315{
296 delete mPopupMenu; 316 delete mPopupMenu;
297} 317}
318QString KOListView::getWhatsThisText(QPoint p)
319{
320 KOListViewItem* item = ( KOListViewItem* ) mListView->itemAt( p );
321 if ( item )
322 return KIncidenceFormatter::instance()->getFormattedText( item->data() );
323 return i18n("That is the list view" );
324
325}
298 326
299void KOListView::updateList() 327void KOListView::updateList()
300{ 328{
301 // qDebug(" KOListView::updateList() "); 329 // qDebug(" KOListView::updateList() ");
302 330
303} 331}
304 332
305void KOListView::addCat( ) 333void KOListView::addCat( )
306{ 334{
307 setCategories( false ); 335 setCategories( false );
308} 336}
309void KOListView::setCat() 337void KOListView::setCat()
diff --git a/korganizer/kolistview.h b/korganizer/kolistview.h
index 23afdb1..be9b09c 100644
--- a/korganizer/kolistview.h
+++ b/korganizer/kolistview.h
@@ -110,24 +110,25 @@ class KOListView : public KOEventView
110 void showDates(bool show); 110 void showDates(bool show);
111 Incidence* currentItem(); 111 Incidence* currentItem();
112 void addTodos(QPtrList<Todo> eventList); 112 void addTodos(QPtrList<Todo> eventList);
113 void addJournals(QPtrList<Journal> eventList); 113 void addJournals(QPtrList<Journal> eventList);
114 virtual void printPreview(CalPrinter *calPrinter, 114 virtual void printPreview(CalPrinter *calPrinter,
115 const QDate &, const QDate &); 115 const QDate &, const QDate &);
116 116
117 void readSettings(KConfig *config, QString setting = "KOListView Layout"); 117 void readSettings(KConfig *config, QString setting = "KOListView Layout");
118 void writeSettings(KConfig *config, QString setting = "KOListView Layout"); 118 void writeSettings(KConfig *config, QString setting = "KOListView Layout");
119 void updateList(); 119 void updateList();
120 void setStartDate(const QDate &start); 120 void setStartDate(const QDate &start);
121 int count(); 121 int count();
122 QString getWhatsThisText(QPoint p);
122 signals: 123 signals:
123 void signalNewEvent(); 124 void signalNewEvent();
124 void beamIncidenceList(QPtrList<Incidence>); 125 void beamIncidenceList(QPtrList<Incidence>);
125 126
126 public slots: 127 public slots:
127 virtual void updateView(); 128 virtual void updateView();
128 virtual void showDates(const QDate &start, const QDate &end); 129 virtual void showDates(const QDate &start, const QDate &end);
129 virtual void showEvents(QPtrList<Event> eventList); 130 virtual void showEvents(QPtrList<Event> eventList);
130 void clearSelection(); 131 void clearSelection();
131 void allSelection(); 132 void allSelection();
132 133
133 void clear(); 134 void clear();
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp
index da8b4bc..c5b9a21 100644
--- a/korganizer/kotodoview.cpp
+++ b/korganizer/kotodoview.cpp
@@ -15,53 +15,71 @@
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
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>
33#include <kiconloader.h> 34#include <kiconloader.h>
34#include <kmessagebox.h> 35#include <kmessagebox.h>
35 36
36#include <libkcal/icaldrag.h> 37#include <libkcal/icaldrag.h>
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
49#include "calprinter.h" 51#include "calprinter.h"
50#endif 52#endif
51#include "docprefs.h" 53#include "docprefs.h"
52 54
53#include "kotodoview.h" 55#include "kotodoview.h"
54using namespace KOrg; 56using namespace KOrg;
55 57
58
59class KOTodoViewWhatsThis :public QWhatsThis
60{
61public:
62 KOTodoViewWhatsThis( QWidget *wid, KOTodoView* view ) : QWhatsThis( wid ), _wid(wid),_view (view) { };
63
64protected:
65 virtual QString text( const QPoint& p)
66 {
67 return _view->getWhatsThisText(p) ;
68 }
69private:
70 QWidget* _wid;
71 KOTodoView * _view;
72};
73
56KOTodoListView::KOTodoListView(Calendar *calendar,QWidget *parent, 74KOTodoListView::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;
62#ifndef DESKTOP_VERSION 80#ifndef DESKTOP_VERSION
63 QPEApplication::setStylusOperation(viewport(), QPEApplication::RightOnHold ); 81 QPEApplication::setStylusOperation(viewport(), QPEApplication::RightOnHold );
64#endif 82#endif
65 mOldCurrent = 0; 83 mOldCurrent = 0;
66 mMousePressed = false; 84 mMousePressed = false;
67 85
@@ -386,24 +404,26 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) :
386 mTodoListView->setColumnWidth( 0, 120 ); 404 mTodoListView->setColumnWidth( 0, 120 );
387 mTodoListView->setColumnWidthMode(0, QListView::Manual); 405 mTodoListView->setColumnWidthMode(0, QListView::Manual);
388 mTodoListView->setColumnWidthMode(1, QListView::Manual); 406 mTodoListView->setColumnWidthMode(1, QListView::Manual);
389 mTodoListView->setColumnWidthMode(2, QListView::Manual); 407 mTodoListView->setColumnWidthMode(2, QListView::Manual);
390 mTodoListView->setColumnWidthMode(3, QListView::Manual); 408 mTodoListView->setColumnWidthMode(3, QListView::Manual);
391 mTodoListView->setColumnWidthMode(4, QListView::Manual); 409 mTodoListView->setColumnWidthMode(4, QListView::Manual);
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)));
404 424
405 mPercentageCompletedPopupMenu = new QPopupMenu(this); 425 mPercentageCompletedPopupMenu = new QPopupMenu(this);
406 for (int i = 0; i <= 100; i+=20) { 426 for (int i = 0; i <= 100; i+=20) {
407 QString label = QString ("%1 %").arg (i); 427 QString label = QString ("%1 %").arg (i);
408 mPercentage[mPercentageCompletedPopupMenu->insertItem (label)] = i; 428 mPercentage[mPercentageCompletedPopupMenu->insertItem (label)] = i;
409 } 429 }
@@ -523,24 +543,32 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) :
523 543
524 connect( mTodoListView, SIGNAL(selectionChanged() ), 544 connect( mTodoListView, SIGNAL(selectionChanged() ),
525 SLOT( processSelectionChange() ) ); 545 SLOT( processSelectionChange() ) );
526 connect( mQuickAdd, SIGNAL( returnPressed () ), 546 connect( mQuickAdd, SIGNAL( returnPressed () ),
527 SLOT( addQuickTodo() ) ); 547 SLOT( addQuickTodo() ) );
528 548
529} 549}
530 550
531KOTodoView::~KOTodoView() 551KOTodoView::~KOTodoView()
532{ 552{
533 delete mDocPrefs; 553 delete mDocPrefs;
534} 554}
555QString 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
536void KOTodoView::jumpToDate () 564void 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() )
541// emit mActiveItem->todo()jumpToTime( mTodo->dtDue().date() ); 569// emit mActiveItem->todo()jumpToTime( mTodo->dtDue().date() );
542} 570}
543void KOTodoView::paintNeeded() 571void KOTodoView::paintNeeded()
544{ 572{
545 if ( mPendingUpdateBeforeRepaint ) { 573 if ( mPendingUpdateBeforeRepaint ) {
546 updateView(); 574 updateView();
diff --git a/korganizer/kotodoview.h b/korganizer/kotodoview.h
index 2a9e737..1642132 100644
--- a/korganizer/kotodoview.h
+++ b/korganizer/kotodoview.h
@@ -125,24 +125,25 @@ class KOTodoView : public KOrg::BaseView
125 /** Return number of shown dates. TodoView does not show dates, */ 125 /** Return number of shown dates. TodoView does not show dates, */
126 int currentDateCount() { return 0; } 126 int currentDateCount() { return 0; }
127 127
128 void printPreview(CalPrinter *calPrinter, const QDate &fd, const QDate &td); 128 void printPreview(CalPrinter *calPrinter, const QDate &fd, const QDate &td);
129 129
130 void setDocumentId( const QString & ); 130 void setDocumentId( const QString & );
131 131
132 void saveLayout(KConfig *config, const QString &group) const; 132 void saveLayout(KConfig *config, const QString &group) const;
133 void restoreLayout(KConfig *config, const QString &group); 133 void restoreLayout(KConfig *config, const QString &group);
134 /** Create a popup menu to set categories */ 134 /** Create a popup menu to set categories */
135 QPopupMenu *getCategoryPopupMenu (KOTodoViewItem *todoItem); 135 QPopupMenu *getCategoryPopupMenu (KOTodoViewItem *todoItem);
136 void setNavigator( DateNavigator* nav ) {mNavigator = nav;} 136 void setNavigator( DateNavigator* nav ) {mNavigator = nav;}
137 QString getWhatsThisText(QPoint p);
137 138
138 public slots: 139 public slots:
139 void updateView(); 140 void updateView();
140 void updateConfig(); 141 void updateConfig();
141 142
142 void changeEventDisplay(Event *, int); 143 void changeEventDisplay(Event *, int);
143 144
144 void showDates(const QDate &start, const QDate &end); 145 void showDates(const QDate &start, const QDate &end);
145 void showEvents(QPtrList<Event> eventList); 146 void showEvents(QPtrList<Event> eventList);
146 147
147 void clearSelection(); 148 void clearSelection();
148 void jumpToDate (); 149 void jumpToDate ();