-rw-r--r-- | korganizer/kotodoview.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp index 8d8fc2a..82437d8 100644 --- a/korganizer/kotodoview.cpp +++ b/korganizer/kotodoview.cpp | |||
@@ -325,24 +325,25 @@ void KOQuickTodo::focusInEvent(QFocusEvent *ev) | |||
325 | 325 | ||
326 | void KOQuickTodo::focusOutEvent(QFocusEvent *ev) | 326 | void KOQuickTodo::focusOutEvent(QFocusEvent *ev) |
327 | { | 327 | { |
328 | setText(i18n("Click to add a new Todo")); | 328 | setText(i18n("Click to add a new Todo")); |
329 | QLineEdit::focusOutEvent(ev); | 329 | QLineEdit::focusOutEvent(ev); |
330 | } | 330 | } |
331 | 331 | ||
332 | ///////////////////////////////////////////////////////////////////////////// | 332 | ///////////////////////////////////////////////////////////////////////////// |
333 | 333 | ||
334 | KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : | 334 | KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : |
335 | KOrg::BaseView(calendar,parent,name) | 335 | KOrg::BaseView(calendar,parent,name) |
336 | { | 336 | { |
337 | mPendingUpdateBeforeRepaint = false; | ||
337 | isFlatDisplay = false; | 338 | isFlatDisplay = false; |
338 | mNavigator = 0; | 339 | mNavigator = 0; |
339 | QBoxLayout *topLayout = new QVBoxLayout(this); | 340 | QBoxLayout *topLayout = new QVBoxLayout(this); |
340 | mName = QString ( name ); | 341 | mName = QString ( name ); |
341 | mBlockUpdate = false; | 342 | mBlockUpdate = false; |
342 | mQuickAdd = new KOQuickTodo(this); | 343 | mQuickAdd = new KOQuickTodo(this); |
343 | topLayout->addWidget(mQuickAdd); | 344 | topLayout->addWidget(mQuickAdd); |
344 | 345 | ||
345 | if ( !KOPrefs::instance()->mEnableQuickTodo ) mQuickAdd->hide(); | 346 | if ( !KOPrefs::instance()->mEnableQuickTodo ) mQuickAdd->hide(); |
346 | 347 | ||
347 | mTodoListView = new KOTodoListView(calendar,this, name ); | 348 | mTodoListView = new KOTodoListView(calendar,this, name ); |
348 | topLayout->addWidget(mTodoListView); | 349 | topLayout->addWidget(mTodoListView); |
@@ -524,32 +525,44 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : | |||
524 | KOTodoView::~KOTodoView() | 525 | KOTodoView::~KOTodoView() |
525 | { | 526 | { |
526 | delete mDocPrefs; | 527 | delete mDocPrefs; |
527 | } | 528 | } |
528 | 529 | ||
529 | void KOTodoView::jumpToDate () | 530 | void KOTodoView::jumpToDate () |
530 | { | 531 | { |
531 | // if (mActiveItem) { | 532 | // if (mActiveItem) { |
532 | // mActiveItem->todo()); | 533 | // mActiveItem->todo()); |
533 | // if ( mActiveItem->todo()->hasDueDate() ) | 534 | // if ( mActiveItem->todo()->hasDueDate() ) |
534 | // emit mActiveItem->todo()jumpToTime( mTodo->dtDue().date() ); | 535 | // emit mActiveItem->todo()jumpToTime( mTodo->dtDue().date() ); |
535 | } | 536 | } |
536 | 537 | void KOTodoView::paintEvent(QPaintEvent * pevent) | |
538 | { | ||
539 | if ( mPendingUpdateBeforeRepaint ) { | ||
540 | updateView(); | ||
541 | mPendingUpdateBeforeRepaint = false; | ||
542 | } | ||
543 | KOrg::BaseView::paintEvent( pevent); | ||
544 | } | ||
545 | bool mPendingUpdateBeforeRepaint; | ||
537 | void KOTodoView::updateView() | 546 | void KOTodoView::updateView() |
538 | { | 547 | { |
539 | pendingSubtodo = 0; | 548 | pendingSubtodo = 0; |
540 | if ( mBlockUpdate ) { | 549 | if ( mBlockUpdate ) { |
541 | //qDebug("blocked "); | ||
542 | return; | 550 | return; |
543 | } | 551 | } |
552 | if ( !isVisible() ) { | ||
553 | mPendingUpdateBeforeRepaint = true; | ||
554 | return; | ||
555 | } | ||
556 | //qDebug("KOTodoView::updateView() %x", this); | ||
544 | if ( isFlatDisplay ) { | 557 | if ( isFlatDisplay ) { |
545 | setAllFlat(); | 558 | setAllFlat(); |
546 | return; | 559 | return; |
547 | } | 560 | } |
548 | //qDebug("update "); | 561 | //qDebug("update "); |
549 | // kdDebug() << "KOTodoView::updateView()" << endl; | 562 | // kdDebug() << "KOTodoView::updateView()" << endl; |
550 | QFont fo = KOPrefs::instance()->mTodoViewFont; | 563 | QFont fo = KOPrefs::instance()->mTodoViewFont; |
551 | mTodoListView->clear(); | 564 | mTodoListView->clear(); |
552 | if ( mName == "todolistsmall" ) { | 565 | if ( mName == "todolistsmall" ) { |
553 | if ( KOPrefs::instance()->mTodoViewUsesSmallFont ) { | 566 | if ( KOPrefs::instance()->mTodoViewUsesSmallFont ) { |
554 | int ps = fo.pointSize() -2; | 567 | int ps = fo.pointSize() -2; |
555 | if ( ps > 12 ) | 568 | if ( ps > 12 ) |