summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-03-21 10:47:16 (UTC)
committer zautrix <zautrix>2005-03-21 10:47:16 (UTC)
commitb40a7cc0a8cf0bd06b0f404f58e89980d1291beb (patch) (unidiff)
tree62e02fdc8eb02039eb7fa8a181b8ca879ef13e77
parent5b9e0451514d65ab576b51e0f9d3515fa6b9e4e6 (diff)
downloadkdepimpi-b40a7cc0a8cf0bd06b0f404f58e89980d1291beb.zip
kdepimpi-b40a7cc0a8cf0bd06b0f404f58e89980d1291beb.tar.gz
kdepimpi-b40a7cc0a8cf0bd06b0f404f58e89980d1291beb.tar.bz2
nf
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/datenavigatorcontainer.cpp10
-rw-r--r--korganizer/koagendaitem.cpp4
-rw-r--r--korganizer/koagendaitem.h2
-rw-r--r--korganizer/kodaymatrix.cpp6
-rw-r--r--korganizer/kodaymatrix.h2
-rw-r--r--korganizer/kotodoview.cpp3
-rw-r--r--korganizer/kotodoview.h2
7 files changed, 21 insertions, 8 deletions
diff --git a/korganizer/datenavigatorcontainer.cpp b/korganizer/datenavigatorcontainer.cpp
index 5cdaa83..5941337 100644
--- a/korganizer/datenavigatorcontainer.cpp
+++ b/korganizer/datenavigatorcontainer.cpp
@@ -193,35 +193,39 @@ void DateNavigatorContainer::resizeEvent( QResizeEvent * e )
193 fontchange = true; 193 fontchange = true;
194 fo = KOPrefs::instance()->mDateNavigatorFont; 194 fo = KOPrefs::instance()->mDateNavigatorFont;
195 mNavigatorView->changeFont( fo ); 195 mNavigatorView->changeFont( fo );
196 mNavigatorView->unsetFontChanged(); 196 mNavigatorView->unsetFontChanged();
197 } 197 }
198 } 198 }
199 199
200 while ( count > ( mExtraViews.count() + 1 ) ) { 200 while ( count > ( mExtraViews.count() + 1 ) ) {
201 KDateNavigator *n = new KDateNavigator( this ); 201 KDateNavigator *n = new KDateNavigator( this );
202 n->setMonthSignalOffset ( mExtraViews.count()+1 ); 202 n->setMonthSignalOffset ( mExtraViews.count()+1 );
203 mExtraViews.append( n ); 203 mExtraViews.append( n );
204 n->setCalendar( mCalendar ); 204 n->setCalendar( mCalendar );
205 setBaseDates(); 205 setBaseDates();
206 connectNavigatorView( n ); 206 connectNavigatorView( n );
207 n->show(); 207 n->show();
208 } 208 }
209 209 int iii = 0;
210 while ( count < ( mExtraViews.count() + 1 ) ) { 210 while ( iii < ( mExtraViews.count() ) ) {
211 mExtraViews.removeLast(); 211 if ( iii < count-1 )
212 mExtraViews.at( iii )->show();
213 else
214 mExtraViews.at( iii )->hide();
215 ++iii;
212 } 216 }
213 if ( fontchange ) { 217 if ( fontchange ) {
214 //mNavigatorView->changeFont( fo ); 218 //mNavigatorView->changeFont( fo );
215 uint i; 219 uint i;
216 for( i = 0; i < mExtraViews.count(); ++i ) { 220 for( i = 0; i < mExtraViews.count(); ++i ) {
217 KDateNavigator *view = mExtraViews.at( i ); 221 KDateNavigator *view = mExtraViews.at( i );
218 view->changeFont( fo ); 222 view->changeFont( fo );
219 } 223 }
220 } 224 }
221 mHorizontalCount = horizontalCount; 225 mHorizontalCount = horizontalCount;
222 mVerticalCount = verticalCount; 226 mVerticalCount = verticalCount;
223 } 227 }
224 int height = size().height() / verticalCount; 228 int height = size().height() / verticalCount;
225 int width = size().width() / horizontalCount; 229 int width = size().width() / horizontalCount;
226 230
227 NavigatorBar *bar = mNavigatorView->navigatorBar(); 231 NavigatorBar *bar = mNavigatorView->navigatorBar();
diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp
index 0ea2860..19cc0e3 100644
--- a/korganizer/koagendaitem.cpp
+++ b/korganizer/koagendaitem.cpp
@@ -64,33 +64,33 @@ public:
64protected: 64protected:
65 virtual QString text( const QPoint& ) 65 virtual QString text( const QPoint& )
66 { 66 {
67 return _view->getWhatsThisText() ; 67 return _view->getWhatsThisText() ;
68 } 68 }
69private: 69private:
70 KOAgendaItem * _view; 70 KOAgendaItem * _view;
71}; 71};
72 72
73KOAgendaItem::KOAgendaItem(Incidence *incidence, QDate qd, QWidget *parent,bool allday, 73KOAgendaItem::KOAgendaItem(Incidence *incidence, QDate qd, QWidget *parent,bool allday,
74 const char *name,WFlags) : 74 const char *name,WFlags) :
75 QWidget(parent, name), mIncidence(incidence), mDate(qd) 75 QWidget(parent, name), mIncidence(incidence), mDate(qd)
76{ 76{
77#ifndef DESKTOP_VERSION 77#ifndef DESKTOP_VERSION
78 //QPEApplication::setStylusOperation( this, QPEApplication::RightOnHold ); 78 //QPEApplication::setStylusOperation( this, QPEApplication::RightOnHold );
79#endif 79#endif
80 new KOAgendaItemWhatsThis(this); 80 mKOAgendaItemWhatsThis = new KOAgendaItemWhatsThis(this);
81 int wflags = getWFlags() |WRepaintNoErase;// WResizeNoErase 81 int wflags = getWFlags() |WRepaintNoErase;// WResizeNoErase
82 setWFlags ( wflags); 82 setWFlags ( wflags);
83 mAllDay = allday; 83 mAllDay = allday;
84 init ( incidence, qd ); 84 init ( incidence, qd );
85 //setMouseTracking(true); 85 //setMouseTracking(true);
86 //setAcceptDrops(true); 86 //setAcceptDrops(true);
87 xPaintCoord = -1; 87 xPaintCoord = -1;
88 yPaintCoord = -1; 88 yPaintCoord = -1;
89} 89}
90QString KOAgendaItem::getWhatsThisText() 90QString KOAgendaItem::getWhatsThisText()
91{ 91{
92 if ( mIncidence ) 92 if ( mIncidence )
93 return KIncidenceFormatter::instance()->getFormattedText( mIncidence, 93 return KIncidenceFormatter::instance()->getFormattedText( mIncidence,
94 KOPrefs::instance()->mWTshowDetails, 94 KOPrefs::instance()->mWTshowDetails,
95 KOPrefs::instance()->mWTshowCreated, 95 KOPrefs::instance()->mWTshowCreated,
96 KOPrefs::instance()->mWTshowChanged); 96 KOPrefs::instance()->mWTshowChanged);
@@ -142,33 +142,33 @@ void KOAgendaItem::init ( Incidence *incidence, QDate qd )
142 setSubCells(1); 142 setSubCells(1);
143 setMultiItem(0,0,0); 143 setMultiItem(0,0,0);
144 startMove(); 144 startMove();
145 mSelected = true; 145 mSelected = true;
146 select(false); 146 select(false);
147 QFontMetrics fontinf(KOPrefs::instance()->mAgendaViewFont); 147 QFontMetrics fontinf(KOPrefs::instance()->mAgendaViewFont);
148 mFontPixelSize = fontinf.height();; 148 mFontPixelSize = fontinf.height();;
149 hide(); 149 hide();
150 xPaintCoord = -1; 150 xPaintCoord = -1;
151 yPaintCoord = -1; 151 yPaintCoord = -1;
152} 152}
153 153
154 154
155KOAgendaItem::~KOAgendaItem() 155KOAgendaItem::~KOAgendaItem()
156{ 156{
157 // qDebug("deleteKOAgendaItem::~KOAgendaItem( "); 157 // qDebug("deleteKOAgendaItem::~KOAgendaItem( ");
158 158 delete mKOAgendaItemWhatsThis;
159} 159}
160 160
161void KOAgendaItem::recreateIncidence() 161void KOAgendaItem::recreateIncidence()
162{ 162{
163#if 0 163#if 0
164 Incidence* newInc = mIncidence->clone(); 164 Incidence* newInc = mIncidence->clone();
165 newInc->recreate(); 165 newInc->recreate();
166 if ( mIncidence->doesRecur() ) { 166 if ( mIncidence->doesRecur() ) {
167 mIncidence->addExDate( mDate ); 167 mIncidence->addExDate( mDate );
168 newInc->recurrence()->unsetRecurs(); 168 newInc->recurrence()->unsetRecurs();
169 int len = mIncidence->dtStart().secsTo( ((Event*)mIncidence)->dtEnd()); 169 int len = mIncidence->dtStart().secsTo( ((Event*)mIncidence)->dtEnd());
170 QTime tim = mIncidence->dtStart().time(); 170 QTime tim = mIncidence->dtStart().time();
171 newInc->setDtStart( QDateTime(mDate, tim) ); 171 newInc->setDtStart( QDateTime(mDate, tim) );
172 ((Event*)newInc)->setDtEnd( newInc->dtStart().addSecs( len ) ); 172 ((Event*)newInc)->setDtEnd( newInc->dtStart().addSecs( len ) );
173 } 173 }
174#endif 174#endif
diff --git a/korganizer/koagendaitem.h b/korganizer/koagendaitem.h
index b4dba79..53658c0 100644
--- a/korganizer/koagendaitem.h
+++ b/korganizer/koagendaitem.h
@@ -14,32 +14,33 @@
14 14
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#ifndef KOAGENDAITEM_H 19#ifndef KOAGENDAITEM_H
20#define KOAGENDAITEM_H 20#define KOAGENDAITEM_H
21 21
22#include <qframe.h> 22#include <qframe.h>
23#include <qlabel.h> 23#include <qlabel.h>
24#include <qpixmap.h> 24#include <qpixmap.h>
25#include <qdatetime.h> 25#include <qdatetime.h>
26#include <qpalette.h> 26#include <qpalette.h>
27 27
28#include <libkcal/incidence.h> 28#include <libkcal/incidence.h>
29 29
30class KOAgendaItemWhatsThis;
30class QToolTipGroup; 31class QToolTipGroup;
31class QDragEnterEvent; 32class QDragEnterEvent;
32class QDropEvent; 33class QDropEvent;
33 34
34using namespace KCal; 35using namespace KCal;
35 36
36/* 37/*
37 The KOAgendaItem has to make sure that it receives all mouse events, which are 38 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 39 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 40 eventfiler for its children, if it has children, and it has to pass mouse
40 events from the cildren to itself. See eventFilter(). 41 events from the cildren to itself. See eventFilter().
41*/ 42*/
42class KOAgendaItem : public QWidget 43class KOAgendaItem : public QWidget
43{ 44{
44 Q_OBJECT 45 Q_OBJECT
45 public: 46 public:
@@ -106,32 +107,33 @@ class KOAgendaItem : public QWidget
106 static QPixmap * paintPixAllday(); 107 static QPixmap * paintPixAllday();
107 void updateItem(); 108 void updateItem();
108 void computeText(); 109 void computeText();
109 void recreateIncidence(); 110 void recreateIncidence();
110 bool checkLayout(); 111 bool checkLayout();
111 public slots: 112 public slots:
112 bool updateIcons( QPainter *, bool ); 113 bool updateIcons( QPainter *, bool );
113 void select(bool=true); 114 void select(bool=true);
114 115
115 protected: 116 protected:
116 void dragEnterEvent(QDragEnterEvent *e); 117 void dragEnterEvent(QDragEnterEvent *e);
117 void dropEvent(QDropEvent *e); 118 void dropEvent(QDropEvent *e);
118 void paintEvent ( QPaintEvent * ); 119 void paintEvent ( QPaintEvent * );
119 void resizeEvent ( QResizeEvent *ev ); 120 void resizeEvent ( QResizeEvent *ev );
120 121
121 private: 122 private:
123 KOAgendaItemWhatsThis* mKOAgendaItemWhatsThis;
122 bool mAllDay; 124 bool mAllDay;
123 int mCellX; 125 int mCellX;
124 int mCellXWidth; 126 int mCellXWidth;
125 int mCellYTop,mCellYBottom; 127 int mCellYTop,mCellYBottom;
126 int mSubCell; // subcell number of this item 128 int mSubCell; // subcell number of this item
127 int mSubCells; // Total number of subcells in cell of this item 129 int mSubCells; // Total number of subcells in cell of this item
128 int xPaintCoord; 130 int xPaintCoord;
129 int yPaintCoord; 131 int yPaintCoord;
130 int wPaintCoord; 132 int wPaintCoord;
131 int hPaintCoord; 133 int hPaintCoord;
132 // Variables to remember start position 134 // Variables to remember start position
133 int mStartCellX; 135 int mStartCellX;
134 int mStartCellXWidth; 136 int mStartCellXWidth;
135 int mStartCellYTop,mStartCellYBottom; 137 int mStartCellYTop,mStartCellYBottom;
136 int mLastMovePos; 138 int mLastMovePos;
137 139
diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp
index ae0a051..5133519 100644
--- a/korganizer/kodaymatrix.cpp
+++ b/korganizer/kodaymatrix.cpp
@@ -49,33 +49,34 @@
49 49
50#include "kodaymatrix.h" 50#include "kodaymatrix.h"
51 51
52// ============================================================================ 52// ============================================================================
53// D Y N A M I C T I P 53// D Y N A M I C T I P
54// ============================================================================ 54// ============================================================================
55 55
56DynamicTip::DynamicTip( QWidget * parent ) 56DynamicTip::DynamicTip( QWidget * parent )
57 : QToolTip( parent ) 57 : QToolTip( parent )
58{ 58{
59 matrix = (KODayMatrix*)parent; 59 matrix = (KODayMatrix*)parent;
60} 60}
61 61
62class KODaymatrixWhatsThis :public QWhatsThis 62class KODaymatrixWhatsThis :public QWhatsThis
63{ 63{
64public: 64public:
65 KODaymatrixWhatsThis( KODayMatrix* view ) : QWhatsThis( view ),_view (view) { }; 65 KODaymatrixWhatsThis( KODayMatrix* view ) : QWhatsThis( view ),_view (view) { ;};
66 ~KODaymatrixWhatsThis() { ; };
66 67
67protected: 68protected:
68 virtual QString text( const QPoint& p ) 69 virtual QString text( const QPoint& p )
69 { 70 {
70 return _view->getWhatsThisText( p ) ; 71 return _view->getWhatsThisText( p ) ;
71 } 72 }
72private: 73private:
73 KODayMatrix * _view; 74 KODayMatrix * _view;
74}; 75};
75 76
76void DynamicTip::maybeTip( const QPoint &pos ) 77void DynamicTip::maybeTip( const QPoint &pos )
77{ 78{
78 //calculate which cell of the matrix the mouse is in 79 //calculate which cell of the matrix the mouse is in
79 QRect sz = matrix->frameRect(); 80 QRect sz = matrix->frameRect();
80 int dheight = sz.height()*7 / 42; 81 int dheight = sz.height()*7 / 42;
81 int dwidth = sz.width() / 7; 82 int dwidth = sz.width() / 7;
@@ -96,33 +97,33 @@ void DynamicTip::maybeTip( const QPoint &pos )
96 97
97// ============================================================================ 98// ============================================================================
98// K O D A Y M A T R I X 99// K O D A Y M A T R I X
99// ============================================================================ 100// ============================================================================
100 101
101const int KODayMatrix::NOSELECTION = -1000; 102const int KODayMatrix::NOSELECTION = -1000;
102const int KODayMatrix::NUMDAYS = 42; 103const int KODayMatrix::NUMDAYS = 42;
103 104
104KODayMatrix::KODayMatrix( QWidget *parent, const char *name ) 105KODayMatrix::KODayMatrix( QWidget *parent, const char *name )
105 : QFrame( parent, name ), mCalendar( 0 ) 106 : QFrame( parent, name ), mCalendar( 0 )
106 107
107#if 0 108#if 0
108KODayMatrix::KODayMatrix(QWidget *parent, Calendar* calendar, QDate date, const char *name) : 109KODayMatrix::KODayMatrix(QWidget *parent, Calendar* calendar, QDate date, const char *name) :
109 QFrame(parent, name) 110 QFrame(parent, name)
110#endif 111#endif
111{ 112{
112 new KODaymatrixWhatsThis(this); 113 mKODaymatrixWhatsThis = new KODaymatrixWhatsThis(this);
113 mPendingUpdateBeforeRepaint = false; 114 mPendingUpdateBeforeRepaint = false;
114 mouseDown = false; 115 mouseDown = false;
115 // initialize dynamic arrays 116 // initialize dynamic arrays
116 bDays.resize ( NUMDAYS ); 117 bDays.resize ( NUMDAYS );
117 days = new QDate[NUMDAYS]; 118 days = new QDate[NUMDAYS];
118 daylbls = new QString[NUMDAYS]; 119 daylbls = new QString[NUMDAYS];
119 events = new int[NUMDAYS]; 120 events = new int[NUMDAYS];
120 mToolTip = new DynamicTip(this); 121 mToolTip = new DynamicTip(this);
121 122
122 // set default values used for drawing the matrix 123 // set default values used for drawing the matrix
123 mDefaultBackColor = palette().active().base(); 124 mDefaultBackColor = palette().active().base();
124 mDefaultTextColor = palette().active().foreground(); 125 mDefaultTextColor = palette().active().foreground();
125 mDefaultTextColorShaded = getShadedColor(mDefaultTextColor); 126 mDefaultTextColorShaded = getShadedColor(mDefaultTextColor);
126 mHolidayColorShaded = getShadedColor(KOPrefs::instance()->mHolidayColor); 127 mHolidayColorShaded = getShadedColor(KOPrefs::instance()->mHolidayColor);
127 mSelectedDaysColor = QColor("white"); 128 mSelectedDaysColor = QColor("white");
128 mTodayMarginWidth = 2; 129 mTodayMarginWidth = 2;
@@ -209,32 +210,33 @@ void KODayMatrix::setCalendar( Calendar *cal )
209QColor KODayMatrix::getShadedColor(QColor color) 210QColor KODayMatrix::getShadedColor(QColor color)
210{ 211{
211 QColor shaded; 212 QColor shaded;
212 int h=0; 213 int h=0;
213 int s=0; 214 int s=0;
214 int v=0; 215 int v=0;
215 color.hsv(&h,&s,&v); 216 color.hsv(&h,&s,&v);
216 s = s/4; 217 s = s/4;
217 v = 192+v/4; 218 v = 192+v/4;
218 shaded.setHsv(h,s,v); 219 shaded.setHsv(h,s,v);
219 220
220 return shaded; 221 return shaded;
221} 222}
222 223
223KODayMatrix::~KODayMatrix() 224KODayMatrix::~KODayMatrix()
224{ 225{
226 delete mKODaymatrixWhatsThis;
225 delete [] days; 227 delete [] days;
226 delete [] daylbls; 228 delete [] daylbls;
227 delete [] events; 229 delete [] events;
228 delete mToolTip; 230 delete mToolTip;
229} 231}
230 232
231/* 233/*
232void KODayMatrix::setStartDate(QDate start) 234void KODayMatrix::setStartDate(QDate start)
233{ 235{
234 updateView(start); 236 updateView(start);
235} 237}
236*/ 238*/
237 239
238void KODayMatrix::addSelectedDaysTo(DateList& selDays) 240void KODayMatrix::addSelectedDaysTo(DateList& selDays)
239{ 241{
240 242
diff --git a/korganizer/kodaymatrix.h b/korganizer/kodaymatrix.h
index f4016b6..10f4b05 100644
--- a/korganizer/kodaymatrix.h
+++ b/korganizer/kodaymatrix.h
@@ -28,32 +28,33 @@
28#include <qstring.h> 28#include <qstring.h>
29#include <qframe.h> 29#include <qframe.h>
30#include <qcolor.h> 30#include <qcolor.h>
31#include <qpen.h> 31#include <qpen.h>
32#include <qdatetime.h> 32#include <qdatetime.h>
33#include <qtooltip.h> 33#include <qtooltip.h>
34#include <qpixmap.h> 34#include <qpixmap.h>
35#include <qbitarray.h> 35#include <qbitarray.h>
36#include <qmap.h> 36#include <qmap.h>
37 37
38class QDragEnterEvent; 38class QDragEnterEvent;
39class QDragMoveEvent; 39class QDragMoveEvent;
40class QDragLeaveEvent; 40class QDragLeaveEvent;
41class QDropEvent; 41class QDropEvent;
42 42
43class KODayMatrix; 43class KODayMatrix;
44class KODaymatrixWhatsThis;
44 45
45using namespace KCal; 46using namespace KCal;
46 47
47 48
48/** 49/**
49 * small helper class to dynamically show tooltips inside the day matrix. 50 * small helper class to dynamically show tooltips inside the day matrix.
50 * This class asks the day matrix object for a appropriate label which 51 * This class asks the day matrix object for a appropriate label which
51 * is in our special case the name of the holiday or null if this day is no holiday. 52 * is in our special case the name of the holiday or null if this day is no holiday.
52 */ 53 */
53class DynamicTip : public QToolTip 54class DynamicTip : public QToolTip
54{ 55{
55public: 56public:
56 57
57 /** 58 /**
58 * Constructor that expects a KODayMatrix object as parent. 59 * Constructor that expects a KODayMatrix object as parent.
59 * 60 *
@@ -213,32 +214,33 @@ protected:
213 214
214 void mouseReleaseEvent (QMouseEvent* e); 215 void mouseReleaseEvent (QMouseEvent* e);
215 216
216 void mouseMoveEvent (QMouseEvent* e); 217 void mouseMoveEvent (QMouseEvent* e);
217 218
218 void dragEnterEvent(QDragEnterEvent *); 219 void dragEnterEvent(QDragEnterEvent *);
219 220
220 void dragMoveEvent(QDragMoveEvent *); 221 void dragMoveEvent(QDragMoveEvent *);
221 222
222 void dragLeaveEvent(QDragLeaveEvent *); 223 void dragLeaveEvent(QDragLeaveEvent *);
223 224
224 void dropEvent(QDropEvent *); 225 void dropEvent(QDropEvent *);
225 226
226 void resizeEvent(QResizeEvent *); 227 void resizeEvent(QResizeEvent *);
227 228
228private: 229private:
230 KODaymatrixWhatsThis* mKODaymatrixWhatsThis;
229 bool mouseDown; 231 bool mouseDown;
230 QBitArray bDays; 232 QBitArray bDays;
231 QPixmap myPix; 233 QPixmap myPix;
232 QTimer* mUpdateTimer; 234 QTimer* mUpdateTimer;
233 QTimer* mRepaintTimer; 235 QTimer* mRepaintTimer;
234 bool mDayChanged; 236 bool mDayChanged;
235 bool mPendingUpdateBeforeRepaint; 237 bool mPendingUpdateBeforeRepaint;
236 238
237 /** returns the index of the day located at the matrix's widget (x,y) position. 239 /** returns the index of the day located at the matrix's widget (x,y) position.
238 * 240 *
239 * @param x horizontal coordinate 241 * @param x horizontal coordinate
240 * @param y vertical coordinate 242 * @param y vertical coordinate
241 */ 243 */
242 int getDayIndexFrom(int x, int y); 244 int getDayIndexFrom(int x, int y);
243 245
244 /** calculates a "shaded" color from the supplied color object. 246 /** calculates a "shaded" color from the supplied color object.
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp
index 5e8ea27..2b01c23 100644
--- a/korganizer/kotodoview.cpp
+++ b/korganizer/kotodoview.cpp
@@ -400,33 +400,33 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) :
400 400
401 mTodoListView->setMinimumHeight( 60 ); 401 mTodoListView->setMinimumHeight( 60 );
402 mTodoListView->setItemsRenameable( true ); 402 mTodoListView->setItemsRenameable( true );
403 mTodoListView->setRenameable( 0 ); 403 mTodoListView->setRenameable( 0 );
404 mTodoListView->setColumnWidth( 0, 120 ); 404 mTodoListView->setColumnWidth( 0, 120 );
405 mTodoListView->setColumnWidthMode(0, QListView::Manual); 405 mTodoListView->setColumnWidthMode(0, QListView::Manual);
406 mTodoListView->setColumnWidthMode(1, QListView::Manual); 406 mTodoListView->setColumnWidthMode(1, QListView::Manual);
407 mTodoListView->setColumnWidthMode(2, QListView::Manual); 407 mTodoListView->setColumnWidthMode(2, QListView::Manual);
408 mTodoListView->setColumnWidthMode(3, QListView::Manual); 408 mTodoListView->setColumnWidthMode(3, QListView::Manual);
409 mTodoListView->setColumnWidthMode(4, QListView::Manual); 409 mTodoListView->setColumnWidthMode(4, QListView::Manual);
410 mTodoListView->setColumnWidthMode(5, QListView::Manual); 410 mTodoListView->setColumnWidthMode(5, QListView::Manual);
411 mTodoListView->setColumnWidthMode(6, QListView::Manual); 411 mTodoListView->setColumnWidthMode(6, QListView::Manual);
412 mTodoListView->setColumnWidthMode(7, QListView::Manual); 412 mTodoListView->setColumnWidthMode(7, QListView::Manual);
413 mTodoListView->setColumnWidthMode(8, QListView::Manual); 413 mTodoListView->setColumnWidthMode(8, QListView::Manual);
414 414
415 415
416 new KOTodoViewWhatsThis(mTodoListView->viewport(),this); 416 mKOTodoViewWhatsThis = new KOTodoViewWhatsThis(mTodoListView->viewport(),this);
417 417
418 mPriorityPopupMenu = new QPopupMenu(this); 418 mPriorityPopupMenu = new QPopupMenu(this);
419 for (int i = 1; i <= 5; i++) { 419 for (int i = 1; i <= 5; i++) {
420 QString label = QString ("%1").arg (i); 420 QString label = QString ("%1").arg (i);
421 mPriority[mPriorityPopupMenu->insertItem (label)] = i; 421 mPriority[mPriorityPopupMenu->insertItem (label)] = i;
422 } 422 }
423 connect (mPriorityPopupMenu, SIGNAL(activated (int)), SLOT (setNewPriority(int))); 423 connect (mPriorityPopupMenu, SIGNAL(activated (int)), SLOT (setNewPriority(int)));
424 424
425 mPercentageCompletedPopupMenu = new QPopupMenu(this); 425 mPercentageCompletedPopupMenu = new QPopupMenu(this);
426 for (int i = 0; i <= 100; i+=20) { 426 for (int i = 0; i <= 100; i+=20) {
427 QString label = QString ("%1 %").arg (i); 427 QString label = QString ("%1 %").arg (i);
428 mPercentage[mPercentageCompletedPopupMenu->insertItem (label)] = i; 428 mPercentage[mPercentageCompletedPopupMenu->insertItem (label)] = i;
429 } 429 }
430 connect (mPercentageCompletedPopupMenu, SIGNAL (activated (int)), SLOT (setNewPercentage (int))); 430 connect (mPercentageCompletedPopupMenu, SIGNAL (activated (int)), SLOT (setNewPercentage (int)));
431 431
432 432
@@ -537,32 +537,33 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) :
537 SLOT(selectionChanged(QListViewItem *))); 537 SLOT(selectionChanged(QListViewItem *)));
538#endif 538#endif
539 539
540 connect( mTodoListView, SIGNAL(reparentTodoSignal( Todo *,Todo * ) ), SIGNAL(reparentTodoSignal( Todo *,Todo * ) )); 540 connect( mTodoListView, SIGNAL(reparentTodoSignal( Todo *,Todo * ) ), SIGNAL(reparentTodoSignal( Todo *,Todo * ) ));
541 connect( mTodoListView, SIGNAL(unparentTodoSignal(Todo *) ), SIGNAL(unparentTodoSignal(Todo *) )); 541 connect( mTodoListView, SIGNAL(unparentTodoSignal(Todo *) ), SIGNAL(unparentTodoSignal(Todo *) ));
542 connect( mTodoListView, SIGNAL( deleteTodo(Todo *) ), SIGNAL(deleteTodoSignal(Todo *) )); 542 connect( mTodoListView, SIGNAL( deleteTodo(Todo *) ), SIGNAL(deleteTodoSignal(Todo *) ));
543 543
544 connect( mTodoListView, SIGNAL(selectionChanged() ), 544 connect( mTodoListView, SIGNAL(selectionChanged() ),
545 SLOT( processSelectionChange() ) ); 545 SLOT( processSelectionChange() ) );
546 connect( mQuickAdd, SIGNAL( returnPressed () ), 546 connect( mQuickAdd, SIGNAL( returnPressed () ),
547 SLOT( addQuickTodo() ) ); 547 SLOT( addQuickTodo() ) );
548 548
549} 549}
550 550
551KOTodoView::~KOTodoView() 551KOTodoView::~KOTodoView()
552{ 552{
553 delete mKOTodoViewWhatsThis;
553 delete mDocPrefs; 554 delete mDocPrefs;
554} 555}
555QString KOTodoView::getWhatsThisText(QPoint p) 556QString KOTodoView::getWhatsThisText(QPoint p)
556{ 557{
557 KOTodoViewItem* item = ( KOTodoViewItem* ) mTodoListView->itemAt( p ); 558 KOTodoViewItem* item = ( KOTodoViewItem* ) mTodoListView->itemAt( p );
558 if ( item ) 559 if ( item )
559 return KIncidenceFormatter::instance()->getFormattedText( item->todo(), 560 return KIncidenceFormatter::instance()->getFormattedText( item->todo(),
560 KOPrefs::instance()->mWTshowDetails, 561 KOPrefs::instance()->mWTshowDetails,
561 KOPrefs::instance()->mWTshowCreated, 562 KOPrefs::instance()->mWTshowCreated,
562 KOPrefs::instance()->mWTshowChanged); 563 KOPrefs::instance()->mWTshowChanged);
563 return i18n("That is the todo view" ); 564 return i18n("That is the todo view" );
564 565
565} 566}
566 567
567void KOTodoView::jumpToDate () 568void KOTodoView::jumpToDate ()
568{ 569{
diff --git a/korganizer/kotodoview.h b/korganizer/kotodoview.h
index 462f0a6..eab0754 100644
--- a/korganizer/kotodoview.h
+++ b/korganizer/kotodoview.h
@@ -36,32 +36,33 @@
36#include <klistview.h> 36#include <klistview.h>
37 37
38#include <libkcal/calendar.h> 38#include <libkcal/calendar.h>
39#include <libkcal/todo.h> 39#include <libkcal/todo.h>
40 40
41#include <korganizer/baseview.h> 41#include <korganizer/baseview.h>
42 42
43#include "kotodoviewitem.h" 43#include "kotodoviewitem.h"
44#include "koprefs.h" 44#include "koprefs.h"
45#include "koglobals.h" 45#include "koglobals.h"
46#include "datenavigator.h" 46#include "datenavigator.h"
47 47
48class QDragEnterEvent; 48class QDragEnterEvent;
49class QDragMoveEvent; 49class QDragMoveEvent;
50class QDragLeaveEvent; 50class QDragLeaveEvent;
51class QDropEvent; 51class QDropEvent;
52class KOTodoViewWhatsThis;
52 53
53class DocPrefs; 54class DocPrefs;
54 55
55class KOTodoListView : public KListView 56class KOTodoListView : public KListView
56{ 57{
57 Q_OBJECT 58 Q_OBJECT
58 public: 59 public:
59 KOTodoListView(Calendar *,QWidget *parent=0,const char *name=0); 60 KOTodoListView(Calendar *,QWidget *parent=0,const char *name=0);
60 virtual ~KOTodoListView() {} 61 virtual ~KOTodoListView() {}
61 62
62 signals: 63 signals:
63 void paintNeeded(); 64 void paintNeeded();
64 void todoDropped(Todo *, int); 65 void todoDropped(Todo *, int);
65 void double_Clicked(QListViewItem *item); 66 void double_Clicked(QListViewItem *item);
66 void reparentTodoSignal( Todo *,Todo * ); 67 void reparentTodoSignal( Todo *,Todo * );
67 void unparentTodoSignal(Todo *); 68 void unparentTodoSignal(Todo *);
@@ -205,32 +206,33 @@ class KOTodoView : public KOrg::BaseView
205 void paintNeeded(); 206 void paintNeeded();
206 void processSelectionChange(); 207 void processSelectionChange();
207 void addQuickTodo(); 208 void addQuickTodo();
208 void setTodoModified( Todo* ); 209 void setTodoModified( Todo* );
209 void todoModified(Todo *, int ); 210 void todoModified(Todo *, int );
210 211
211 private: 212 private:
212 /* 213 /*
213 * the TodoEditor approach is rather unscaling in the long 214 * the TodoEditor approach is rather unscaling in the long
214 * run. 215 * run.
215 * Korganizer keeps it in memory and we need to update 216 * Korganizer keeps it in memory and we need to update
216 * 1. make KOTodoViewItem a QObject again? 217 * 1. make KOTodoViewItem a QObject again?
217 * 2. add a public method for setting one todo modified? 218 * 2. add a public method for setting one todo modified?
218 * 3. add a private method for setting a todo modified + friend here? 219 * 3. add a private method for setting a todo modified + friend here?
219 * -- zecke 2002-07-08 220 * -- zecke 2002-07-08
220 */ 221 */
222 KOTodoViewWhatsThis* mKOTodoViewWhatsThis;
221 friend class KOTodoListView; 223 friend class KOTodoListView;
222 void paintEvent(QPaintEvent * pevent); 224 void paintEvent(QPaintEvent * pevent);
223 bool mPendingUpdateBeforeRepaint; 225 bool mPendingUpdateBeforeRepaint;
224 friend class KOTodoViewItem; 226 friend class KOTodoViewItem;
225 QMap<Todo *,KOTodoViewItem *>::ConstIterator insertTodoItem(Todo *todo); 227 QMap<Todo *,KOTodoViewItem *>::ConstIterator insertTodoItem(Todo *todo);
226 void restoreItemState( QListViewItem * ); 228 void restoreItemState( QListViewItem * );
227 229
228 bool checkTodo( Todo * ); 230 bool checkTodo( Todo * );
229 bool isFlatDisplay; 231 bool isFlatDisplay;
230 void setOpen( QListViewItem*, bool setOpen); 232 void setOpen( QListViewItem*, bool setOpen);
231 KOTodoListView *mTodoListView; 233 KOTodoListView *mTodoListView;
232 QPopupMenu *mItemPopupMenu; 234 QPopupMenu *mItemPopupMenu;
233 QPopupMenu *mPopupMenu; 235 QPopupMenu *mPopupMenu;
234 QPopupMenu *mPriorityPopupMenu; 236 QPopupMenu *mPriorityPopupMenu;
235 QPopupMenu *mPercentageCompletedPopupMenu; 237 QPopupMenu *mPercentageCompletedPopupMenu;
236 QPopupMenu *mCategoryPopupMenu; 238 QPopupMenu *mCategoryPopupMenu;