author | zautrix <zautrix> | 2005-02-02 10:58:10 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-02-02 10:58:10 (UTC) |
commit | d2f6c50fb3b236e37aaa46ade819ab163f19868a (patch) (unidiff) | |
tree | 02b2c7bbcd6d78140def0650fa4b440199e04ef7 | |
parent | 5bc675bc7e9d5d6fa2d2bc48675a7cfa985ab2c7 (diff) | |
download | kdepimpi-d2f6c50fb3b236e37aaa46ade819ab163f19868a.zip kdepimpi-d2f6c50fb3b236e37aaa46ade819ab163f19868a.tar.gz kdepimpi-d2f6c50fb3b236e37aaa46ade819ab163f19868a.tar.bz2 |
qwt added
-rw-r--r-- | korganizer/koagendaitem.cpp | 23 | ||||
-rw-r--r-- | korganizer/koagendaitem.h | 1 | ||||
-rw-r--r-- | korganizer/kolistview.cpp | 28 | ||||
-rw-r--r-- | korganizer/kolistview.h | 1 | ||||
-rw-r--r-- | korganizer/kotodoview.cpp | 28 | ||||
-rw-r--r-- | korganizer/kotodoview.h | 1 |
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 | |||
@@ -56,6 +56,20 @@ QToolTipGroup *KOAgendaItem::mToolTipGroup = 0; | |||
56 | 56 | ||
57 | //-------------------------------------------------------------------------- | 57 | //-------------------------------------------------------------------------- |
58 | 58 | ||
59 | class KOAgendaItemWhatsThis :public QWhatsThis | ||
60 | { | ||
61 | public: | ||
62 | KOAgendaItemWhatsThis( KOAgendaItem* view ) : QWhatsThis( view ),_view (view) { }; | ||
63 | |||
64 | protected: | ||
65 | virtual QString text( const QPoint& ) | ||
66 | { | ||
67 | return _view->getWhatsThisText() ; | ||
68 | } | ||
69 | private: | ||
70 | KOAgendaItem * _view; | ||
71 | }; | ||
72 | |||
59 | KOAgendaItem::KOAgendaItem(Incidence *incidence, QDate qd, QWidget *parent,bool allday, | 73 | KOAgendaItem::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) |
@@ -63,6 +77,7 @@ KOAgendaItem::KOAgendaItem(Incidence *incidence, QDate qd, QWidget *parent,bool | |||
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; |
@@ -72,7 +87,12 @@ KOAgendaItem::KOAgendaItem(Incidence *incidence, QDate qd, QWidget *parent,bool | |||
72 | xPaintCoord = -1; | 87 | xPaintCoord = -1; |
73 | yPaintCoord = -1; | 88 | yPaintCoord = -1; |
74 | } | 89 | } |
75 | 90 | QString KOAgendaItem::getWhatsThisText() | |
91 | { | ||
92 | if ( mIncidence ) | ||
93 | return KIncidenceFormatter::instance()->getFormattedText( mIncidence ); | ||
94 | return "KOAgendaItem::getWhatsThisText()::internal error"; | ||
95 | } | ||
76 | void KOAgendaItem::init ( Incidence *incidence, QDate qd ) | 96 | void KOAgendaItem::init ( Incidence *incidence, QDate qd ) |
77 | { | 97 | { |
78 | mIncidence = incidence; | 98 | mIncidence = incidence; |
@@ -504,7 +524,6 @@ void KOAgendaItem::computeText() | |||
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() ) { |
diff --git a/korganizer/koagendaitem.h b/korganizer/koagendaitem.h index 7321af2..5b8f420 100644 --- a/korganizer/koagendaitem.h +++ b/korganizer/koagendaitem.h | |||
@@ -46,6 +46,7 @@ class KOAgendaItem : public QWidget | |||
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; } |
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp index b21b419..732fc46 100644 --- a/korganizer/kolistview.cpp +++ b/korganizer/kolistview.cpp | |||
@@ -32,6 +32,7 @@ | |||
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> |
@@ -47,6 +48,7 @@ | |||
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 |
@@ -62,6 +64,23 @@ | |||
62 | 64 | ||
63 | #include "kolistview.h" | 65 | #include "kolistview.h" |
64 | 66 | ||
67 | |||
68 | class KOListViewWhatsThis :public QWhatsThis | ||
69 | { | ||
70 | public: | ||
71 | KOListViewWhatsThis( QWidget *wid, KOListView* view ) : QWhatsThis( wid ), _wid(wid),_view (view) { }; | ||
72 | |||
73 | protected: | ||
74 | virtual QString text( const QPoint& p) | ||
75 | { | ||
76 | return _view->getWhatsThisText(p) ; | ||
77 | } | ||
78 | private: | ||
79 | QWidget* _wid; | ||
80 | KOListView * _view; | ||
81 | }; | ||
82 | |||
83 | |||
65 | ListItemVisitor::ListItemVisitor(KOListViewItem *item, QDate date ) | 84 | ListItemVisitor::ListItemVisitor(KOListViewItem *item, QDate date ) |
66 | { | 85 | { |
67 | mItem = item; | 86 | mItem = item; |
@@ -224,6 +243,7 @@ KOListView::KOListView(Calendar *calendar, QWidget *parent, | |||
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 ) |
@@ -295,6 +315,14 @@ KOListView::~KOListView() | |||
295 | { | 315 | { |
296 | delete mPopupMenu; | 316 | delete mPopupMenu; |
297 | } | 317 | } |
318 | QString 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 | ||
299 | void KOListView::updateList() | 327 | void KOListView::updateList() |
300 | { | 328 | { |
diff --git a/korganizer/kolistview.h b/korganizer/kolistview.h index 23afdb1..be9b09c 100644 --- a/korganizer/kolistview.h +++ b/korganizer/kolistview.h | |||
@@ -119,6 +119,7 @@ class KOListView : public KOEventView | |||
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>); |
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 @@ | |||
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> |
@@ -40,6 +41,7 @@ | |||
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 |
@@ -53,6 +55,22 @@ | |||
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) |
@@ -395,6 +413,8 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : | |||
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); |
@@ -532,6 +552,14 @@ 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 | { |
diff --git a/korganizer/kotodoview.h b/korganizer/kotodoview.h index 2a9e737..1642132 100644 --- a/korganizer/kotodoview.h +++ b/korganizer/kotodoview.h | |||
@@ -134,6 +134,7 @@ class KOTodoView : public KOrg::BaseView | |||
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(); |