summaryrefslogtreecommitdiffabout
path: root/korganizer
authorzautrix <zautrix>2005-03-21 12:34:49 (UTC)
committer zautrix <zautrix>2005-03-21 12:34:49 (UTC)
commitad4ecbb0cbf79f37140041eb9a14e71e6fd393f1 (patch) (unidiff)
treeb92ef416aa5542e06f1fc472d19619804ff897c8 /korganizer
parent3b7ba9f46c78816bae8c4b30a455e261d7da9f4a (diff)
downloadkdepimpi-ad4ecbb0cbf79f37140041eb9a14e71e6fd393f1.zip
kdepimpi-ad4ecbb0cbf79f37140041eb9a14e71e6fd393f1.tar.gz
kdepimpi-ad4ecbb0cbf79f37140041eb9a14e71e6fd393f1.tar.bz2
fixes
Diffstat (limited to 'korganizer') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/koagendaitem.cpp2
-rw-r--r--korganizer/kodaymatrix.cpp2
-rw-r--r--korganizer/kotodoview.cpp2
3 files changed, 2 insertions, 4 deletions
diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp
index 19cc0e3..5ee433a 100644
--- a/korganizer/koagendaitem.cpp
+++ b/korganizer/koagendaitem.cpp
@@ -110,97 +110,97 @@ void KOAgendaItem::init ( Incidence *incidence, QDate qd )
110 ((static_cast<Todo*>(incidence))->dtDue().date() <= QDate::currentDate()) ) ) { 110 ((static_cast<Todo*>(incidence))->dtDue().date() <= QDate::currentDate()) ) ) {
111 if ( (static_cast<Todo*>(incidence))->dtDue() < QDateTime::currentDateTime().date()) 111 if ( (static_cast<Todo*>(incidence))->dtDue() < QDateTime::currentDateTime().date())
112 mBackgroundColor = KOPrefs::instance()->mTodoOverdueColor ; 112 mBackgroundColor = KOPrefs::instance()->mTodoOverdueColor ;
113 else 113 else
114 mBackgroundColor = KOPrefs::instance()->mTodoDueTodayColor; 114 mBackgroundColor = KOPrefs::instance()->mTodoDueTodayColor;
115 } 115 }
116 else { 116 else {
117 QStringList categories = mIncidence->categories(); 117 QStringList categories = mIncidence->categories();
118 QString cat = categories.first(); 118 QString cat = categories.first();
119 if (cat.isEmpty()) { 119 if (cat.isEmpty()) {
120 if ( (incidence->type() == "Todo") &&((static_cast<Todo*>(incidence))->isCompleted()) ) 120 if ( (incidence->type() == "Todo") &&((static_cast<Todo*>(incidence))->isCompleted()) )
121 mBackgroundColor =KOPrefs::instance()->mTodoDoneColor; 121 mBackgroundColor =KOPrefs::instance()->mTodoDoneColor;
122 else 122 else
123 mBackgroundColor =KOPrefs::instance()->mEventColor; 123 mBackgroundColor =KOPrefs::instance()->mEventColor;
124 } else { 124 } else {
125 mBackgroundColor = *KOPrefs::instance()->categoryColor(cat); 125 mBackgroundColor = *KOPrefs::instance()->categoryColor(cat);
126 if ( (incidence->type() == "Todo") &&((static_cast<Todo*>(incidence))->isCompleted()) ) { 126 if ( (incidence->type() == "Todo") &&((static_cast<Todo*>(incidence))->isCompleted()) ) {
127 if ( mBackgroundColor == KOPrefs::instance()->mEventColor ) 127 if ( mBackgroundColor == KOPrefs::instance()->mEventColor )
128 mBackgroundColor =KOPrefs::instance()->mTodoDoneColor; 128 mBackgroundColor =KOPrefs::instance()->mTodoDoneColor;
129 } 129 }
130 } 130 }
131 131
132 } 132 }
133 mColorGroup = QColorGroup( mBackgroundColor.light(), 133 mColorGroup = QColorGroup( mBackgroundColor.light(),
134 mBackgroundColor.dark(),mBackgroundColor.light(), 134 mBackgroundColor.dark(),mBackgroundColor.light(),
135 mBackgroundColor.dark(),mBackgroundColor, black, mBackgroundColor) ; 135 mBackgroundColor.dark(),mBackgroundColor, black, mBackgroundColor) ;
136 setBackgroundColor( mBackgroundColor ); 136 setBackgroundColor( mBackgroundColor );
137 137
138 mConflictItems.clear(); 138 mConflictItems.clear();
139 setCellXY(0,0,1); 139 setCellXY(0,0,1);
140 setCellXWidth(0); 140 setCellXWidth(0);
141 setSubCell(0); 141 setSubCell(0);
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 delete mKOAgendaItemWhatsThis; 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
175 mIncidence = mIncidence->recreateCloneException( mDate ); 175 mIncidence = mIncidence->recreateCloneException( mDate );
176} 176}
177bool KOAgendaItem::updateIcons(QPainter * p, bool horLayout) 177bool KOAgendaItem::updateIcons(QPainter * p, bool horLayout)
178{ 178{
179 int size = AGENDA_ICON_SIZE; 179 int size = AGENDA_ICON_SIZE;
180 180
181 int yOff = 0; 181 int yOff = 0;
182 int xOff = 0; 182 int xOff = 0;
183 int x = pos().x() +3; 183 int x = pos().x() +3;
184 int y; 184 int y;
185 if ( mAllDay ) 185 if ( mAllDay )
186 y = pos().y()+3; 186 y = pos().y()+3;
187 else 187 else
188 y = mCellYTop * ( height() / cellHeight() ) +3; 188 y = mCellYTop * ( height() / cellHeight() ) +3;
189 if (mIncidence->cancelled()) { 189 if (mIncidence->cancelled()) {
190 int xpos = xOff*( 1 +AGENDA_ICON_SIZE )+x; 190 int xpos = xOff*( 1 +AGENDA_ICON_SIZE )+x;
191 int ypos = yOff*( 1 +AGENDA_ICON_SIZE)+y; 191 int ypos = yOff*( 1 +AGENDA_ICON_SIZE)+y;
192 p->drawLine( xpos, ypos, xpos+AGENDA_ICON_SIZE-1, ypos+AGENDA_ICON_SIZE-1 ); 192 p->drawLine( xpos, ypos, xpos+AGENDA_ICON_SIZE-1, ypos+AGENDA_ICON_SIZE-1 );
193 p->drawLine( xpos, ypos+AGENDA_ICON_SIZE-1, xpos+AGENDA_ICON_SIZE-1, ypos ); 193 p->drawLine( xpos, ypos+AGENDA_ICON_SIZE-1, xpos+AGENDA_ICON_SIZE-1, ypos );
194 if ( horLayout ) 194 if ( horLayout )
195 ++xOff; 195 ++xOff;
196 else 196 else
197 ++yOff; 197 ++yOff;
198 } 198 }
199 if (mIncidence->isAlarmEnabled()) { 199 if (mIncidence->isAlarmEnabled()) {
200 p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, red ); 200 p->fillRect ( xOff*( 1 +AGENDA_ICON_SIZE )+x, yOff*( 1 +AGENDA_ICON_SIZE)+y, AGENDA_ICON_SIZE, AGENDA_ICON_SIZE, red );
201 if ( horLayout ) 201 if ( horLayout )
202 ++xOff; 202 ++xOff;
203 else 203 else
204 ++yOff; 204 ++yOff;
205 } 205 }
206 if (mIncidence->recurrence()->doesRecur()) { 206 if (mIncidence->recurrence()->doesRecur()) {
diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp
index 9c1f5f3..582b2ef 100644
--- a/korganizer/kodaymatrix.cpp
+++ b/korganizer/kodaymatrix.cpp
@@ -135,127 +135,125 @@ KODayMatrix::KODayMatrix(QWidget *parent, Calendar* calendar, QDate date, const
135 mUpdateTimer = new QTimer( this ); 135 mUpdateTimer = new QTimer( this );
136 connect (mUpdateTimer ,SIGNAL(timeout()), this, SLOT ( updateViewTimed() )); 136 connect (mUpdateTimer ,SIGNAL(timeout()), this, SLOT ( updateViewTimed() ));
137 mRepaintTimer = new QTimer( this ); 137 mRepaintTimer = new QTimer( this );
138 connect (mRepaintTimer ,SIGNAL(timeout()), this, SLOT ( repaintViewTimed() )); 138 connect (mRepaintTimer ,SIGNAL(timeout()), this, SLOT ( repaintViewTimed() ));
139 mDayChanged = false; 139 mDayChanged = false;
140 updateView(); 140 updateView();
141} 141}
142QString KODayMatrix::getWhatsThisText( QPoint p ) 142QString KODayMatrix::getWhatsThisText( QPoint p )
143{ 143{
144 144
145 int tmp = getDayIndexFrom(p.x(), p.y()); 145 int tmp = getDayIndexFrom(p.x(), p.y());
146 if ( tmp < 0 || tmp > NUMDAYS-1 || !mCalendar ) 146 if ( tmp < 0 || tmp > NUMDAYS-1 || !mCalendar )
147 return QString(); 147 return QString();
148 QDate mDate = days[tmp]; 148 QDate mDate = days[tmp];
149 QPtrList<Event> eventlist = mCalendar->events(mDate); 149 QPtrList<Event> eventlist = mCalendar->events(mDate);
150 Event *event; 150 Event *event;
151 QStringList mToolTip; 151 QStringList mToolTip;
152 for(event=eventlist.first();event != 0;event=eventlist.next()) { 152 for(event=eventlist.first();event != 0;event=eventlist.next()) {
153 QString mToolTipText; 153 QString mToolTipText;
154 QString text; 154 QString text;
155 int multiday = 0;// 1 = start, 2 = midddle, 3 = end day 155 int multiday = 0;// 1 = start, 2 = midddle, 3 = end day
156 if (event->isMultiDay()) { 156 if (event->isMultiDay()) {
157 QString prefix = "<->";multiday = 2; 157 QString prefix = "<->";multiday = 2;
158 QString time; 158 QString time;
159 if ( event->doesRecur() ) { 159 if ( event->doesRecur() ) {
160 if ( event->recursOn( mDate) ) { 160 if ( event->recursOn( mDate) ) {
161 prefix ="->" ;multiday = 1; 161 prefix ="->" ;multiday = 1;
162 } 162 }
163 else { 163 else {
164 int days = event->dtStart().date().daysTo ( event->dtEnd().date() ); 164 int days = event->dtStart().date().daysTo ( event->dtEnd().date() );
165 if ( event->recursOn( mDate.addDays( -days)) ) { 165 if ( event->recursOn( mDate.addDays( -days)) ) {
166 prefix ="<-" ;multiday = 3; 166 prefix ="<-" ;multiday = 3;
167 } 167 }
168 } 168 }
169 } else { 169 } else {
170 if (mDate == event->dtStart().date()) { 170 if (mDate == event->dtStart().date()) {
171 prefix ="->" ;multiday = 1; 171 prefix ="->" ;multiday = 1;
172 } else if (mDate == event->dtEnd().date()) { 172 } else if (mDate == event->dtEnd().date()) {
173 prefix ="<-" ;multiday = 3; 173 prefix ="<-" ;multiday = 3;
174 } 174 }
175 } 175 }
176 if ( !event->doesFloat() ) { 176 if ( !event->doesFloat() ) {
177 if ( mDate == event->dtStart().date () ) 177 if ( mDate == event->dtStart().date () )
178 time = KGlobal::locale()->formatTime(event->dtStart().time())+" "; 178 time = KGlobal::locale()->formatTime(event->dtStart().time())+" ";
179 else if ( mDate == event->dtEnd().date () ) 179 else if ( mDate == event->dtEnd().date () )
180 time = KGlobal::locale()->formatTime(event->dtEnd().time())+" "; 180 time = KGlobal::locale()->formatTime(event->dtEnd().time())+" ";
181 181
182 } 182 }
183 qDebug("event->isMultiDay() %s", event->summary().latin1() );
184 text = time + event->summary(); 183 text = time + event->summary();
185 mToolTipText += prefix + text; 184 mToolTipText += prefix + text;
186 } else { 185 } else {
187 if (event->doesFloat()) { 186 if (event->doesFloat()) {
188 text = event->summary(); 187 text = event->summary();
189 mToolTipText += text; 188 mToolTipText += text;
190 } 189 }
191 else { 190 else {
192 text = KGlobal::locale()->formatTime(event->dtStart().time()); 191 text = KGlobal::locale()->formatTime(event->dtStart().time());
193 text += " " + event->summary(); 192 text += " " + event->summary();
194 mToolTipText += KGlobal::locale()->formatTime(event->dtStart().time()) +"-"+KGlobal::locale()->formatTime(event->dtEnd().time())+" " + event->summary(); 193 mToolTipText += KGlobal::locale()->formatTime(event->dtStart().time()) +"-"+KGlobal::locale()->formatTime(event->dtEnd().time())+" " + event->summary();
195 } 194 }
196 } 195 }
197 if ( !event->location().isEmpty() ) 196 if ( !event->location().isEmpty() )
198 mToolTipText += " (" + event->location() + ")"; 197 mToolTipText += " (" + event->location() + ")";
199#if QT_VERSION >= 0x030000 198#if QT_VERSION >= 0x030000
200 mToolTipText.replace( '<' , "&lt;" ); 199 mToolTipText.replace( '<' , "&lt;" );
201 mToolTipText.replace( '>' , "&gt;" ); 200 mToolTipText.replace( '>' , "&gt;" );
202#else 201#else
203 if ( mToolTipText.find ('<') > 0 ) { 202 if ( mToolTipText.find ('<') > 0 ) {
204 mToolTipText.replace( QRegExp("<") , "&lt;" ); 203 mToolTipText.replace( QRegExp("<") , "&lt;" );
205 } 204 }
206 if ( mToolTipText.find ('>') > 0 ) { 205 if ( mToolTipText.find ('>') > 0 ) {
207 mToolTipText.replace( QRegExp(">") , "&gt;" ); 206 mToolTipText.replace( QRegExp(">") , "&gt;" );
208 } 207 }
209#endif 208#endif
210 mToolTip.append( mToolTipText ); 209 mToolTip.append( mToolTipText );
211 } 210 }
212 mToolTip.sort(); 211 mToolTip.sort();
213 qDebug("%s ", mToolTip.join("<br>").latin1());
214 return "<b>"+KGlobal::locale()->formatDate(days[tmp]) + "</b><br>" + mToolTip.join("<br>"); 212 return "<b>"+KGlobal::locale()->formatDate(days[tmp]) + "</b><br>" + mToolTip.join("<br>");
215} 213}
216void KODayMatrix::setCalendar( Calendar *cal ) 214void KODayMatrix::setCalendar( Calendar *cal )
217{ 215{
218 mCalendar = cal; 216 mCalendar = cal;
219 217
220 setAcceptDrops( mCalendar ); 218 setAcceptDrops( mCalendar );
221 219
222 updateEvents(); 220 updateEvents();
223} 221}
224 222
225QColor KODayMatrix::getShadedColor(QColor color) 223QColor KODayMatrix::getShadedColor(QColor color)
226{ 224{
227 QColor shaded; 225 QColor shaded;
228 int h=0; 226 int h=0;
229 int s=0; 227 int s=0;
230 int v=0; 228 int v=0;
231 color.hsv(&h,&s,&v); 229 color.hsv(&h,&s,&v);
232 s = s/4; 230 s = s/4;
233 v = 192+v/4; 231 v = 192+v/4;
234 shaded.setHsv(h,s,v); 232 shaded.setHsv(h,s,v);
235 233
236 return shaded; 234 return shaded;
237} 235}
238 236
239KODayMatrix::~KODayMatrix() 237KODayMatrix::~KODayMatrix()
240{ 238{
241 // delete mKODaymatrixWhatsThis; 239 // delete mKODaymatrixWhatsThis;
242 delete [] days; 240 delete [] days;
243 delete [] daylbls; 241 delete [] daylbls;
244 delete [] events; 242 delete [] events;
245 delete mToolTip; 243 delete mToolTip;
246} 244}
247 245
248/* 246/*
249void KODayMatrix::setStartDate(QDate start) 247void KODayMatrix::setStartDate(QDate start)
250{ 248{
251 updateView(start); 249 updateView(start);
252} 250}
253*/ 251*/
254 252
255void KODayMatrix::addSelectedDaysTo(DateList& selDays) 253void KODayMatrix::addSelectedDaysTo(DateList& selDays)
256{ 254{
257 255
258 if (mSelStart == NOSELECTION) { 256 if (mSelStart == NOSELECTION) {
259 return; 257 return;
260 } 258 }
261 259
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp
index 2b01c23..e008625 100644
--- a/korganizer/kotodoview.cpp
+++ b/korganizer/kotodoview.cpp
@@ -505,97 +505,97 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) :
505 // Double clicking conflicts with opening/closing the subtree 505 // Double clicking conflicts with opening/closing the subtree
506 connect( mTodoListView, SIGNAL( doubleClicked( QListViewItem *) ), 506 connect( mTodoListView, SIGNAL( doubleClicked( QListViewItem *) ),
507 SLOT( editItem( QListViewItem *) ) ); 507 SLOT( editItem( QListViewItem *) ) );
508 /* 508 /*
509 connect( mTodoListView, SIGNAL( rightButtonClicked ( QListViewItem *, 509 connect( mTodoListView, SIGNAL( rightButtonClicked ( QListViewItem *,
510 const QPoint &,int ) ), 510 const QPoint &,int ) ),
511 SLOT( popupMenu( QListViewItem *, const QPoint & ,int) ) ); 511 SLOT( popupMenu( QListViewItem *, const QPoint & ,int) ) );
512 */ 512 */
513 connect( mTodoListView, SIGNAL( contextRequest ( QListViewItem *, 513 connect( mTodoListView, SIGNAL( contextRequest ( QListViewItem *,
514 const QPoint &,int ) ), 514 const QPoint &,int ) ),
515 SLOT( popupMenu( QListViewItem *, const QPoint & ,int) ) ); 515 SLOT( popupMenu( QListViewItem *, const QPoint & ,int) ) );
516 connect( mTodoListView, SIGNAL( clicked( QListViewItem * ) ), 516 connect( mTodoListView, SIGNAL( clicked( QListViewItem * ) ),
517 SLOT( itemClicked( QListViewItem * ) ) ); 517 SLOT( itemClicked( QListViewItem * ) ) );
518 connect( mTodoListView, SIGNAL( double_Clicked( QListViewItem * ) ), 518 connect( mTodoListView, SIGNAL( double_Clicked( QListViewItem * ) ),
519 SLOT( itemDoubleClicked( QListViewItem * ) ) ); 519 SLOT( itemDoubleClicked( QListViewItem * ) ) );
520 connect( mTodoListView, SIGNAL( todoDropped( Todo *, int ) ), 520 connect( mTodoListView, SIGNAL( todoDropped( Todo *, int ) ),
521 SLOT( updateView() ) ); 521 SLOT( updateView() ) );
522 connect( mTodoListView, SIGNAL( todoDropped( Todo *, int ) ), 522 connect( mTodoListView, SIGNAL( todoDropped( Todo *, int ) ),
523 SLOT( todoModified(Todo *, int) ) ); 523 SLOT( todoModified(Todo *, int) ) );
524 connect( mTodoListView, SIGNAL( expanded( QListViewItem * ) ), 524 connect( mTodoListView, SIGNAL( expanded( QListViewItem * ) ),
525 SLOT( itemStateChanged( QListViewItem * ) ) ); 525 SLOT( itemStateChanged( QListViewItem * ) ) );
526 connect( mTodoListView, SIGNAL( collapsed( QListViewItem * ) ), 526 connect( mTodoListView, SIGNAL( collapsed( QListViewItem * ) ),
527 SLOT( itemStateChanged( QListViewItem * ) ) ); 527 SLOT( itemStateChanged( QListViewItem * ) ) );
528 connect( mTodoListView, SIGNAL( paintNeeded() ), 528 connect( mTodoListView, SIGNAL( paintNeeded() ),
529 SLOT( paintNeeded()) ); 529 SLOT( paintNeeded()) );
530 530
531#if 0 531#if 0
532 connect(mTodoListView,SIGNAL(selectionChanged(QListViewItem *)), 532 connect(mTodoListView,SIGNAL(selectionChanged(QListViewItem *)),
533 SLOT(selectionChanged(QListViewItem *))); 533 SLOT(selectionChanged(QListViewItem *)));
534 connect(mTodoListView,SIGNAL(clicked(QListViewItem *)), 534 connect(mTodoListView,SIGNAL(clicked(QListViewItem *)),
535 SLOT(selectionChanged(QListViewItem *))); 535 SLOT(selectionChanged(QListViewItem *)));
536 connect(mTodoListView,SIGNAL(pressed(QListViewItem *)), 536 connect(mTodoListView,SIGNAL(pressed(QListViewItem *)),
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 mKOTodoViewWhatsThis;
554 delete mDocPrefs; 554 delete mDocPrefs;
555} 555}
556QString KOTodoView::getWhatsThisText(QPoint p) 556QString KOTodoView::getWhatsThisText(QPoint p)
557{ 557{
558 KOTodoViewItem* item = ( KOTodoViewItem* ) mTodoListView->itemAt( p ); 558 KOTodoViewItem* item = ( KOTodoViewItem* ) mTodoListView->itemAt( p );
559 if ( item ) 559 if ( item )
560 return KIncidenceFormatter::instance()->getFormattedText( item->todo(), 560 return KIncidenceFormatter::instance()->getFormattedText( item->todo(),
561 KOPrefs::instance()->mWTshowDetails, 561 KOPrefs::instance()->mWTshowDetails,
562 KOPrefs::instance()->mWTshowCreated, 562 KOPrefs::instance()->mWTshowCreated,
563 KOPrefs::instance()->mWTshowChanged); 563 KOPrefs::instance()->mWTshowChanged);
564 return i18n("That is the todo view" ); 564 return i18n("That is the todo view" );
565 565
566} 566}
567 567
568void KOTodoView::jumpToDate () 568void KOTodoView::jumpToDate ()
569{ 569{
570 // if (mActiveItem) { 570 // if (mActiveItem) {
571// mActiveItem->todo()); 571// mActiveItem->todo());
572// if ( mActiveItem->todo()->hasDueDate() ) 572// if ( mActiveItem->todo()->hasDueDate() )
573// emit mActiveItem->todo()jumpToTime( mTodo->dtDue().date() ); 573// emit mActiveItem->todo()jumpToTime( mTodo->dtDue().date() );
574} 574}
575void KOTodoView::paintNeeded() 575void KOTodoView::paintNeeded()
576{ 576{
577 if ( mPendingUpdateBeforeRepaint ) { 577 if ( mPendingUpdateBeforeRepaint ) {
578 updateView(); 578 updateView();
579 mPendingUpdateBeforeRepaint = false; 579 mPendingUpdateBeforeRepaint = false;
580 } 580 }
581} 581}
582void KOTodoView::paintEvent(QPaintEvent * pevent) 582void KOTodoView::paintEvent(QPaintEvent * pevent)
583{ 583{
584 if ( mPendingUpdateBeforeRepaint ) { 584 if ( mPendingUpdateBeforeRepaint ) {
585 updateView(); 585 updateView();
586 mPendingUpdateBeforeRepaint = false; 586 mPendingUpdateBeforeRepaint = false;
587 } 587 }
588 KOrg::BaseView::paintEvent( pevent); 588 KOrg::BaseView::paintEvent( pevent);
589} 589}
590 590
591void KOTodoView::updateView() 591void KOTodoView::updateView()
592{ 592{
593 pendingSubtodo = 0; 593 pendingSubtodo = 0;
594 if ( mBlockUpdate ) { 594 if ( mBlockUpdate ) {
595 return; 595 return;
596 } 596 }
597 if ( !isVisible() ) { 597 if ( !isVisible() ) {
598 mPendingUpdateBeforeRepaint = true; 598 mPendingUpdateBeforeRepaint = true;
599 return; 599 return;
600 } 600 }
601 //qDebug("KOTodoView::updateView() %x", this); 601 //qDebug("KOTodoView::updateView() %x", this);