summaryrefslogtreecommitdiffabout
Unidiff
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
@@ -51,33 +51,53 @@ extern int globalFlagBlockAgendaItemUpdate;
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();
@@ -499,17 +519,16 @@ void KOAgendaItem::computeText()
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();
diff --git a/korganizer/koagendaitem.h b/korganizer/koagendaitem.h
index 7321af2..5b8f420 100644
--- a/korganizer/koagendaitem.h
+++ b/korganizer/koagendaitem.h
@@ -41,16 +41,17 @@ using namespace KCal;
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; }
diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp
index b21b419..732fc46 100644
--- a/korganizer/kolistview.cpp
+++ b/korganizer/kolistview.cpp
@@ -27,46 +27,65 @@
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{
@@ -219,16 +238,17 @@ KOListView::KOListView(Calendar *calendar, QWidget *parent,
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 );
@@ -290,16 +310,24 @@ KOListView::KOListView(Calendar *calendar, QWidget *parent,
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( )
diff --git a/korganizer/kolistview.h b/korganizer/kolistview.h
index 23afdb1..be9b09c 100644
--- a/korganizer/kolistview.h
+++ b/korganizer/kolistview.h
@@ -114,16 +114,17 @@ class KOListView : public KOEventView
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);
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp
index da8b4bc..c5b9a21 100644
--- a/korganizer/kotodoview.cpp
+++ b/korganizer/kotodoview.cpp
@@ -19,45 +19,63 @@
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 );
@@ -390,16 +408,18 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) :
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);
@@ -527,16 +547,24 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) :
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}
diff --git a/korganizer/kotodoview.h b/korganizer/kotodoview.h
index 2a9e737..1642132 100644
--- a/korganizer/kotodoview.h
+++ b/korganizer/kotodoview.h
@@ -129,16 +129,17 @@ class KOTodoView : public KOrg::BaseView
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);