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
@@ -55,15 +55,30 @@ extern int globalFlagBlockAgendaItemUpdate;
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 );
@@ -71,9 +86,14 @@ KOAgendaItem::KOAgendaItem(Incidence *incidence, QDate qd, QWidget *parent,bool
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;
@@ -503,9 +523,8 @@ void KOAgendaItem::computeText()
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();
diff --git a/korganizer/koagendaitem.h b/korganizer/koagendaitem.h
index 7321af2..5b8f420 100644
--- a/korganizer/koagendaitem.h
+++ b/korganizer/koagendaitem.h
@@ -45,8 +45,9 @@ class KOAgendaItem : public QWidget
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; }
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp
index b21b419..732fc46 100644
--- a/korganizer/kolistview.cpp
+++ b/korganizer/kolistview.cpp
@@ -31,8 +31,9 @@
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>
@@ -46,8 +47,9 @@
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>
@@ -61,8 +63,25 @@
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;
@@ -223,8 +242,9 @@ KOListView::KOListView(Calendar *calendar, QWidget *parent,
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 );
@@ -294,8 +314,16 @@ KOListView::KOListView(Calendar *calendar, QWidget *parent,
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() ");
diff --git a/korganizer/kolistview.h b/korganizer/kolistview.h
index 23afdb1..be9b09c 100644
--- a/korganizer/kolistview.h
+++ b/korganizer/kolistview.h
@@ -118,8 +118,9 @@ class KOListView : public KOEventView
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
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 @@
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"
@@ -39,8 +40,9 @@
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>
@@ -52,8 +54,24 @@
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{
@@ -394,8 +412,10 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) :
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;
@@ -531,8 +551,16 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) :
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) {
diff --git a/korganizer/kotodoview.h b/korganizer/kotodoview.h
index 2a9e737..1642132 100644
--- a/korganizer/kotodoview.h
+++ b/korganizer/kotodoview.h
@@ -133,8 +133,9 @@ class KOTodoView : public KOrg::BaseView
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();