author | zautrix <zautrix> | 2005-02-04 23:05:50 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-02-04 23:05:50 (UTC) |
commit | c6dceabcb41f6300ca97e69872fc801451944a32 (patch) (unidiff) | |
tree | 40a47b4c306329f47645f1ac7f2bc9420a67066c | |
parent | 53099ae3a9ef02549536dab3dd6870b7a2874284 (diff) | |
download | kdepimpi-c6dceabcb41f6300ca97e69872fc801451944a32.zip kdepimpi-c6dceabcb41f6300ca97e69872fc801451944a32.tar.gz kdepimpi-c6dceabcb41f6300ca97e69872fc801451944a32.tar.bz2 |
nochn fixxx
-rw-r--r-- | bin/kdepim/WhatsNew.txt | 2 | ||||
-rw-r--r-- | korganizer/kotodoview.cpp | 21 | ||||
-rw-r--r-- | korganizer/kotodoview.h | 1 |
3 files changed, 16 insertions, 8 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt index 7214035..14dcdac 100644 --- a/bin/kdepim/WhatsNew.txt +++ b/bin/kdepim/WhatsNew.txt | |||
@@ -1,115 +1,117 @@ | |||
1 | Info about the changes in new versions of KDE-Pim/Pi | 1 | Info about the changes in new versions of KDE-Pim/Pi |
2 | 2 | ||
3 | ********** VERSION 2.0.3 ************ | 3 | ********** VERSION 2.0.3 ************ |
4 | 4 | ||
5 | KO/Pi: | 5 | KO/Pi: |
6 | Added feature for changing alarm settings for many items at once: | 6 | Added feature for changing alarm settings for many items at once: |
7 | Open list view (or search dialog), select the desired items and choose in | 7 | Open list view (or search dialog), select the desired items and choose in |
8 | the popup menu: Set alarm for selected... | 8 | the popup menu: Set alarm for selected... |
9 | 9 | ||
10 | Added to the event/todo viewer the option to send an email to | 10 | Added to the event/todo viewer the option to send an email to |
11 | all attendees or all selected (with RSVP) attendees. | 11 | all attendees or all selected (with RSVP) attendees. |
12 | 12 | ||
13 | Made the week-month mode changing in month view faster. | 13 | Made the week-month mode changing in month view faster. |
14 | 14 | ||
15 | Made month view better useable with keyboard. | 15 | Made month view better useable with keyboard. |
16 | Now TAB key jumps to next cell with an event/todo. | 16 | Now TAB key jumps to next cell with an event/todo. |
17 | Scroll in cell with coursor keys, scroll in time (next week) with | 17 | Scroll in cell with coursor keys, scroll in time (next week) with |
18 | Shift/Control + coursorkeys. | 18 | Shift/Control + coursorkeys. |
19 | 19 | ||
20 | Fixeg bug that the todo view flat mode was reset after first view update. | ||
21 | |||
20 | ********** VERSION 2.0.2 ************ | 22 | ********** VERSION 2.0.2 ************ |
21 | 23 | ||
22 | KO/Pi: | 24 | KO/Pi: |
23 | Fixed the layout problem of the day label buttons | 25 | Fixed the layout problem of the day label buttons |
24 | of the agenda view introduced in version 2.0.1. | 26 | of the agenda view introduced in version 2.0.1. |
25 | 27 | ||
26 | Added WhatsThis support for the todo view and the list view. | 28 | Added WhatsThis support for the todo view and the list view. |
27 | 29 | ||
28 | Added a quite useful feature to the montview. | 30 | Added a quite useful feature to the montview. |
29 | Just click on the week numbers on the left. | 31 | Just click on the week numbers on the left. |
30 | And in the top right corner of month view/agenda view | 32 | And in the top right corner of month view/agenda view |
31 | there is now a "week number quick selector". | 33 | there is now a "week number quick selector". |
32 | (Click on the black triangle). | 34 | (Click on the black triangle). |
33 | 35 | ||
34 | Made the quite difficult timezone change in KO/Pi easy. | 36 | Made the quite difficult timezone change in KO/Pi easy. |
35 | 37 | ||
36 | OM/Pi: | 38 | OM/Pi: |
37 | Fixed too small icons on desktop. | 39 | Fixed too small icons on desktop. |
38 | Fixed non visible icons in mainwindow on Z with fastload enabled. | 40 | Fixed non visible icons in mainwindow on Z with fastload enabled. |
39 | Added signature file setting to smtp account config. | 41 | Added signature file setting to smtp account config. |
40 | And the signature can be edited and saved in the edit mail dialog. | 42 | And the signature can be edited and saved in the edit mail dialog. |
41 | That does mean: | 43 | That does mean: |
42 | Simply edit the signature for the selected smtp account in the | 44 | Simply edit the signature for the selected smtp account in the |
43 | edit new mail dialog and press the "save signature" button there. | 45 | edit new mail dialog and press the "save signature" button there. |
44 | Then the signature is saved to the file specified in the smtp account settings. | 46 | Then the signature is saved to the file specified in the smtp account settings. |
45 | If there is no file specified, it is saved automatically to the file | 47 | If there is no file specified, it is saved automatically to the file |
46 | kdepim/apps/kopiemail/<accountname>.sig. | 48 | kdepim/apps/kopiemail/<accountname>.sig. |
47 | 49 | ||
48 | 50 | ||
49 | 51 | ||
50 | ********** VERSION 2.0.1 ************ | 52 | ********** VERSION 2.0.1 ************ |
51 | 53 | ||
52 | Oooops ... I forgot to test on the Zaurus 5500 ... | 54 | Oooops ... I forgot to test on the Zaurus 5500 ... |
53 | 55 | ||
54 | Fixed many problems of new (english) strings (and german translations) | 56 | Fixed many problems of new (english) strings (and german translations) |
55 | introduced in the latest versions, where the text was not fitting on the | 57 | introduced in the latest versions, where the text was not fitting on the |
56 | 240x320 display of the Zaurus 5500. | 58 | 240x320 display of the Zaurus 5500. |
57 | 59 | ||
58 | KO/Pi: | 60 | KO/Pi: |
59 | Added a popup menu ( press pen and hold to get popup ) to the agenda view | 61 | Added a popup menu ( press pen and hold to get popup ) to the agenda view |
60 | with many useful items (add event/todo, show next week, two weeks, month, journal). | 62 | with many useful items (add event/todo, show next week, two weeks, month, journal). |
61 | 63 | ||
62 | Added items to the todolist popup menu for: | 64 | Added items to the todolist popup menu for: |
63 | Display all opened, all closed or all todos flat. | 65 | Display all opened, all closed or all todos flat. |
64 | The "flat" view makes is possible to sort all todos after ,e.g., prio or date. | 66 | The "flat" view makes is possible to sort all todos after ,e.g., prio or date. |
65 | Made the reparenting of todos on the desktop possible via Drag&Drop. | 67 | Made the reparenting of todos on the desktop possible via Drag&Drop. |
66 | Fixed several bugs in setting the completed datetime for todos. | 68 | Fixed several bugs in setting the completed datetime for todos. |
67 | Added info about completed datetime of todos to the todo viewer. | 69 | Added info about completed datetime of todos to the todo viewer. |
68 | Now displaying a completed todo (with completed datetime set) in the agenda view | 70 | Now displaying a completed todo (with completed datetime set) in the agenda view |
69 | at the time of the completion. Such that now it is possible to see in the agenda view | 71 | at the time of the completion. Such that now it is possible to see in the agenda view |
70 | when what todo was completed. | 72 | when what todo was completed. |
71 | Fixed behaviour of automatic setting completion of todos with sub-todos/parent todos. | 73 | Fixed behaviour of automatic setting completion of todos with sub-todos/parent todos. |
72 | Now the behaviour is: | 74 | Now the behaviour is: |
73 | Setting a parent to complete sets all (sub)childs to complete. | 75 | Setting a parent to complete sets all (sub)childs to complete. |
74 | Setting a parent to uncomplete does not change the childs. | 76 | Setting a parent to uncomplete does not change the childs. |
75 | Setting a child to uncomplete sets all parent to uncomplete. | 77 | Setting a child to uncomplete sets all parent to uncomplete. |
76 | Setting a child to complete does not change the parents. | 78 | Setting a child to complete does not change the parents. |
77 | 79 | ||
78 | Smart updating and double buffering of the daymatrix. | 80 | Smart updating and double buffering of the daymatrix. |
79 | Showing holidays in the day matrix. | 81 | Showing holidays in the day matrix. |
80 | Many other small performance updates. | 82 | Many other small performance updates. |
81 | 83 | ||
82 | Made day labels in agenda clickable. By clicking a label, the day is displayed in single day mode. | 84 | Made day labels in agenda clickable. By clicking a label, the day is displayed in single day mode. |
83 | 85 | ||
84 | Now the translation file usertranslation.txt is supposed to be in utf8 format. | 86 | Now the translation file usertranslation.txt is supposed to be in utf8 format. |
85 | If you want to translate a language from western europe, just change the germantranslation.txt file. Please read the updated Usertranslation HowTo in KO/Pi Help menu. | 87 | If you want to translate a language from western europe, just change the germantranslation.txt file. Please read the updated Usertranslation HowTo in KO/Pi Help menu. |
86 | 88 | ||
87 | 89 | ||
88 | ********** VERSION 2.0.0 ************ | 90 | ********** VERSION 2.0.0 ************ |
89 | 91 | ||
90 | Stable release 2.0.0! | 92 | Stable release 2.0.0! |
91 | 93 | ||
92 | KO/Pi: | 94 | KO/Pi: |
93 | Fixed problem in edit dialog recreation at startup. | 95 | Fixed problem in edit dialog recreation at startup. |
94 | Made "toggle view*" menu items enabled context sensitive. | 96 | Made "toggle view*" menu items enabled context sensitive. |
95 | Changed agenda size menu to items 1-10. | 97 | Changed agenda size menu to items 1-10. |
96 | Made it possible to change agenda size quickly by pressing mouse on timelabels in agenda view and move mouse up/down. | 98 | Made it possible to change agenda size quickly by pressing mouse on timelabels in agenda view and move mouse up/down. |
97 | Usebility enhancements in the KO/Pi menus. | 99 | Usebility enhancements in the KO/Pi menus. |
98 | Birthday import now adds year to summary. | 100 | Birthday import now adds year to summary. |
99 | What's Next view shows age in years for birthday. | 101 | What's Next view shows age in years for birthday. |
100 | 102 | ||
101 | OM/Pi: | 103 | OM/Pi: |
102 | Added three info lines to display subject, from and to of selected mails. | 104 | Added three info lines to display subject, from and to of selected mails. |
103 | 105 | ||
104 | KA/Pi: | 106 | KA/Pi: |
105 | Fixed jump bar behaviour on Zaurus. | 107 | Fixed jump bar behaviour on Zaurus. |
106 | Now KA/Pi search field supports searching for a range of starting characters. | 108 | Now KA/Pi search field supports searching for a range of starting characters. |
107 | E.g. to search for all contact beginning with b to n, type | 109 | E.g. to search for all contact beginning with b to n, type |
108 | b-n | 110 | b-n |
109 | in the search field. | 111 | in the search field. |
110 | 112 | ||
111 | ********** VERSION 1.9.20 ************ | 113 | ********** VERSION 1.9.20 ************ |
112 | 114 | ||
113 | KO/Pi: | 115 | KO/Pi: |
114 | Added for the "dislplay one day" agenda mode | 116 | Added for the "dislplay one day" agenda mode |
115 | info in the caption and in the day lables: | 117 | info in the caption and in the day lables: |
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp index 03a8f1c..1a1bce5 100644 --- a/korganizer/kotodoview.cpp +++ b/korganizer/kotodoview.cpp | |||
@@ -503,193 +503,193 @@ KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : | |||
503 | 503 | ||
504 | 504 | ||
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 | ||
551 | KOTodoView::~KOTodoView() | 551 | KOTodoView::~KOTodoView() |
552 | { | 552 | { |
553 | delete mDocPrefs; | 553 | delete mDocPrefs; |
554 | } | 554 | } |
555 | QString KOTodoView::getWhatsThisText(QPoint p) | 555 | QString KOTodoView::getWhatsThisText(QPoint p) |
556 | { | 556 | { |
557 | KOTodoViewItem* item = ( KOTodoViewItem* ) mTodoListView->itemAt( p ); | 557 | KOTodoViewItem* item = ( KOTodoViewItem* ) mTodoListView->itemAt( p ); |
558 | if ( item ) | 558 | if ( item ) |
559 | return KIncidenceFormatter::instance()->getFormattedText( item->todo() ); | 559 | return KIncidenceFormatter::instance()->getFormattedText( item->todo() ); |
560 | return i18n("That is the todo view" ); | 560 | return i18n("That is the todo view" ); |
561 | 561 | ||
562 | } | 562 | } |
563 | 563 | ||
564 | void KOTodoView::jumpToDate () | 564 | void KOTodoView::jumpToDate () |
565 | { | 565 | { |
566 | // if (mActiveItem) { | 566 | // if (mActiveItem) { |
567 | // mActiveItem->todo()); | 567 | // mActiveItem->todo()); |
568 | // if ( mActiveItem->todo()->hasDueDate() ) | 568 | // if ( mActiveItem->todo()->hasDueDate() ) |
569 | // emit mActiveItem->todo()jumpToTime( mTodo->dtDue().date() ); | 569 | // emit mActiveItem->todo()jumpToTime( mTodo->dtDue().date() ); |
570 | } | 570 | } |
571 | void KOTodoView::paintNeeded() | 571 | void KOTodoView::paintNeeded() |
572 | { | 572 | { |
573 | if ( mPendingUpdateBeforeRepaint ) { | 573 | if ( mPendingUpdateBeforeRepaint ) { |
574 | updateView(); | 574 | updateView(); |
575 | mPendingUpdateBeforeRepaint = false; | 575 | mPendingUpdateBeforeRepaint = false; |
576 | } | 576 | } |
577 | } | 577 | } |
578 | void KOTodoView::paintEvent(QPaintEvent * pevent) | 578 | void KOTodoView::paintEvent(QPaintEvent * pevent) |
579 | { | 579 | { |
580 | if ( mPendingUpdateBeforeRepaint ) { | 580 | if ( mPendingUpdateBeforeRepaint ) { |
581 | updateView(); | 581 | updateView(); |
582 | mPendingUpdateBeforeRepaint = false; | 582 | mPendingUpdateBeforeRepaint = false; |
583 | } | 583 | } |
584 | KOrg::BaseView::paintEvent( pevent); | 584 | KOrg::BaseView::paintEvent( pevent); |
585 | } | 585 | } |
586 | 586 | ||
587 | void KOTodoView::updateView() | 587 | void KOTodoView::updateView() |
588 | { | 588 | { |
589 | pendingSubtodo = 0; | 589 | pendingSubtodo = 0; |
590 | if ( mBlockUpdate ) { | 590 | if ( mBlockUpdate ) { |
591 | return; | 591 | return; |
592 | } | 592 | } |
593 | if ( !isVisible() ) { | 593 | if ( !isVisible() ) { |
594 | mPendingUpdateBeforeRepaint = true; | 594 | mPendingUpdateBeforeRepaint = true; |
595 | return; | 595 | return; |
596 | } | 596 | } |
597 | //qDebug("KOTodoView::updateView() %x", this); | 597 | //qDebug("KOTodoView::updateView() %x", this); |
598 | if ( isFlatDisplay ) { | 598 | if ( isFlatDisplay ) { |
599 | setAllFlat(); | 599 | displayAllFlat(); |
600 | return; | 600 | return; |
601 | } | 601 | } |
602 | //qDebug("update "); | 602 | //qDebug("update "); |
603 | // kdDebug() << "KOTodoView::updateView()" << endl; | 603 | // kdDebug() << "KOTodoView::updateView()" << endl; |
604 | QFont fo = KOPrefs::instance()->mTodoViewFont; | 604 | QFont fo = KOPrefs::instance()->mTodoViewFont; |
605 | mTodoListView->clear(); | 605 | mTodoListView->clear(); |
606 | if ( mName == "todolistsmall" ) { | 606 | if ( mName == "todolistsmall" ) { |
607 | if ( KOPrefs::instance()->mTodoViewUsesSmallFont ) { | 607 | if ( KOPrefs::instance()->mTodoViewUsesSmallFont ) { |
608 | int ps = fo.pointSize() -2; | 608 | int ps = fo.pointSize() -2; |
609 | if ( ps > 12 ) | 609 | if ( ps > 12 ) |
610 | ps -= 2; | 610 | ps -= 2; |
611 | fo.setPointSize( ps ); | 611 | fo.setPointSize( ps ); |
612 | } | 612 | } |
613 | } | 613 | } |
614 | 614 | ||
615 | mTodoListView->setFont( fo ); | 615 | mTodoListView->setFont( fo ); |
616 | // QFontMetrics fm ( KOPrefs::instance()->mTodoViewFont ); | 616 | // QFontMetrics fm ( KOPrefs::instance()->mTodoViewFont ); |
617 | //mTodoListView->header()->setMaximumHeight(fm.height()); | 617 | //mTodoListView->header()->setMaximumHeight(fm.height()); |
618 | QPtrList<Todo> todoList = calendar()->todos(); | 618 | QPtrList<Todo> todoList = calendar()->todos(); |
619 | 619 | ||
620 | /* | 620 | /* |
621 | kdDebug() << "KOTodoView::updateView(): Todo List:" << endl; | 621 | kdDebug() << "KOTodoView::updateView(): Todo List:" << endl; |
622 | Event *t; | 622 | Event *t; |
623 | for(t = todoList.first(); t; t = todoList.next()) { | 623 | for(t = todoList.first(); t; t = todoList.next()) { |
624 | kdDebug() << " " << t->getSummary() << endl; | 624 | kdDebug() << " " << t->getSummary() << endl; |
625 | 625 | ||
626 | if (t->getRelatedTo()) { | 626 | if (t->getRelatedTo()) { |
627 | kdDebug() << " (related to " << t->getRelatedTo()->getSummary() << ")" << endl; | 627 | kdDebug() << " (related to " << t->getRelatedTo()->getSummary() << ")" << endl; |
628 | } | 628 | } |
629 | 629 | ||
630 | QPtrList<Event> l = t->getRelations(); | 630 | QPtrList<Event> l = t->getRelations(); |
631 | Event *c; | 631 | Event *c; |
632 | for(c=l.first();c;c=l.next()) { | 632 | for(c=l.first();c;c=l.next()) { |
633 | kdDebug() << " - relation: " << c->getSummary() << endl; | 633 | kdDebug() << " - relation: " << c->getSummary() << endl; |
634 | } | 634 | } |
635 | } | 635 | } |
636 | */ | 636 | */ |
637 | 637 | ||
638 | // Put for each Event a KOTodoViewItem in the list view. Don't rely on a | 638 | // Put for each Event a KOTodoViewItem in the list view. Don't rely on a |
639 | // specific order of events. That means that we have to generate parent items | 639 | // specific order of events. That means that we have to generate parent items |
640 | // recursively for proper hierarchical display of Todos. | 640 | // recursively for proper hierarchical display of Todos. |
641 | mTodoMap.clear(); | 641 | mTodoMap.clear(); |
642 | Todo *todo; | 642 | Todo *todo; |
643 | todo = todoList.first();// todo; todo = todoList.next()) { | 643 | todo = todoList.first();// todo; todo = todoList.next()) { |
644 | while ( todo ) { | 644 | while ( todo ) { |
645 | bool next = true; | 645 | bool next = true; |
646 | // qDebug("todo %s ", todo->summary().latin1()); | 646 | // qDebug("todo %s ", todo->summary().latin1()); |
647 | Incidence *incidence = todo->relatedTo(); | 647 | Incidence *incidence = todo->relatedTo(); |
648 | while ( incidence ) { | 648 | while ( incidence ) { |
649 | if ( incidence->type() == "Todo") { | 649 | if ( incidence->type() == "Todo") { |
650 | //qDebug("related %s ",incidence->summary().latin1() ); | 650 | //qDebug("related %s ",incidence->summary().latin1() ); |
651 | if ( !(todoList.contains ( ((Todo* )incidence ) ) )) { | 651 | if ( !(todoList.contains ( ((Todo* )incidence ) ) )) { |
652 | //qDebug("related not found "); | 652 | //qDebug("related not found "); |
653 | todoList.remove( ); | 653 | todoList.remove( ); |
654 | todo = todoList.current(); | 654 | todo = todoList.current(); |
655 | next = false; | 655 | next = false; |
656 | incidence = 0; | 656 | incidence = 0; |
657 | 657 | ||
658 | } else { | 658 | } else { |
659 | //qDebug("related found "); | 659 | //qDebug("related found "); |
660 | incidence = incidence->relatedTo(); | 660 | incidence = incidence->relatedTo(); |
661 | } | 661 | } |
662 | } else | 662 | } else |
663 | incidence = 0; | 663 | incidence = 0; |
664 | } | 664 | } |
665 | if ( next ) | 665 | if ( next ) |
666 | todo = todoList.next(); | 666 | todo = todoList.next(); |
667 | } | 667 | } |
668 | // qDebug("again .... "); | 668 | // qDebug("again .... "); |
669 | // for(todo = todoList.first(); todo; todo = todoList.next()) { | 669 | // for(todo = todoList.first(); todo; todo = todoList.next()) { |
670 | 670 | ||
671 | // qDebug("yytodo %s ", todo->summary().latin1()); | 671 | // qDebug("yytodo %s ", todo->summary().latin1()); |
672 | // } | 672 | // } |
673 | //qDebug("for "); | 673 | //qDebug("for "); |
674 | for(todo = todoList.first(); todo; todo = todoList.next()) { | 674 | for(todo = todoList.first(); todo; todo = todoList.next()) { |
675 | if (!mTodoMap.contains(todo) && checkTodo( todo ) ) | 675 | if (!mTodoMap.contains(todo) && checkTodo( todo ) ) |
676 | { | 676 | { |
677 | insertTodoItem(todo); | 677 | insertTodoItem(todo); |
678 | } | 678 | } |
679 | } | 679 | } |
680 | //qDebug("for end "); | 680 | //qDebug("for end "); |
681 | // Restore opened/closed state | 681 | // Restore opened/closed state |
682 | mTodoListView->blockSignals( true ); | 682 | mTodoListView->blockSignals( true ); |
683 | if( mDocPrefs ) restoreItemState( mTodoListView->firstChild() ); | 683 | if( mDocPrefs ) restoreItemState( mTodoListView->firstChild() ); |
684 | mTodoListView->blockSignals( false ); | 684 | mTodoListView->blockSignals( false ); |
685 | mTodoListView->setFocus(); | 685 | mTodoListView->setFocus(); |
686 | processSelectionChange(); | 686 | processSelectionChange(); |
687 | } | 687 | } |
688 | 688 | ||
689 | bool KOTodoView::checkTodo( Todo * todo ) | 689 | bool KOTodoView::checkTodo( Todo * todo ) |
690 | { | 690 | { |
691 | 691 | ||
692 | if ( !KOPrefs::instance()->mShowCompletedTodo && todo->isCompleted() ) | 692 | if ( !KOPrefs::instance()->mShowCompletedTodo && todo->isCompleted() ) |
693 | return false; | 693 | return false; |
694 | if ( !todo->isCompleted() ) { | 694 | if ( !todo->isCompleted() ) { |
695 | if ( todo->hasDueDate() && todo->dtDue().date() <= QDate::currentDate() ) | 695 | if ( todo->hasDueDate() && todo->dtDue().date() <= QDate::currentDate() ) |
@@ -1030,218 +1030,223 @@ void KOTodoView::itemClicked(QListViewItem *item) | |||
1030 | if (!completed) { | 1030 | if (!completed) { |
1031 | qDebug("set true "); | 1031 | qDebug("set true "); |
1032 | todoItem->todo()->setCompleted(QDateTime::currentDateTime()); | 1032 | todoItem->todo()->setCompleted(QDateTime::currentDateTime()); |
1033 | } | 1033 | } |
1034 | } else { | 1034 | } else { |
1035 | qDebug("not on "); | 1035 | qDebug("not on "); |
1036 | if (completed) { | 1036 | if (completed) { |
1037 | qDebug("set false "); | 1037 | qDebug("set false "); |
1038 | todoItem->todo()->setCompleted(false); | 1038 | todoItem->todo()->setCompleted(false); |
1039 | } | 1039 | } |
1040 | } | 1040 | } |
1041 | #endif | 1041 | #endif |
1042 | } | 1042 | } |
1043 | 1043 | ||
1044 | void KOTodoView::setDocumentId( const QString &id ) | 1044 | void KOTodoView::setDocumentId( const QString &id ) |
1045 | { | 1045 | { |
1046 | kdDebug() << "KOTodoView::setDocumentId()" << endl; | 1046 | kdDebug() << "KOTodoView::setDocumentId()" << endl; |
1047 | 1047 | ||
1048 | mDocPrefs->setDoc( id ); | 1048 | mDocPrefs->setDoc( id ); |
1049 | } | 1049 | } |
1050 | 1050 | ||
1051 | void KOTodoView::itemStateChanged( QListViewItem *item ) | 1051 | void KOTodoView::itemStateChanged( QListViewItem *item ) |
1052 | { | 1052 | { |
1053 | if (!item) return; | 1053 | if (!item) return; |
1054 | 1054 | ||
1055 | KOTodoViewItem *todoItem = (KOTodoViewItem *)item; | 1055 | KOTodoViewItem *todoItem = (KOTodoViewItem *)item; |
1056 | 1056 | ||
1057 | // kdDebug() << "KOTodoView::itemStateChanged(): " << todoItem->todo()->summary() << endl; | 1057 | // kdDebug() << "KOTodoView::itemStateChanged(): " << todoItem->todo()->summary() << endl; |
1058 | 1058 | ||
1059 | if( mDocPrefs ) mDocPrefs->writeEntry( todoItem->todo()->uid(), todoItem->isOpen() ); | 1059 | if( mDocPrefs ) mDocPrefs->writeEntry( todoItem->todo()->uid(), todoItem->isOpen() ); |
1060 | } | 1060 | } |
1061 | 1061 | ||
1062 | void KOTodoView::saveLayout(KConfig *config, const QString &group) const | 1062 | void KOTodoView::saveLayout(KConfig *config, const QString &group) const |
1063 | { | 1063 | { |
1064 | mTodoListView->saveLayout(config,group); | 1064 | mTodoListView->saveLayout(config,group); |
1065 | } | 1065 | } |
1066 | 1066 | ||
1067 | void KOTodoView::restoreLayout(KConfig *config, const QString &group) | 1067 | void KOTodoView::restoreLayout(KConfig *config, const QString &group) |
1068 | { | 1068 | { |
1069 | mTodoListView->restoreLayout(config,group); | 1069 | mTodoListView->restoreLayout(config,group); |
1070 | } | 1070 | } |
1071 | 1071 | ||
1072 | void KOTodoView::processSelectionChange() | 1072 | void KOTodoView::processSelectionChange() |
1073 | { | 1073 | { |
1074 | // kdDebug() << "KOTodoView::processSelectionChange()" << endl; | 1074 | // kdDebug() << "KOTodoView::processSelectionChange()" << endl; |
1075 | 1075 | ||
1076 | KOTodoViewItem *item = | 1076 | KOTodoViewItem *item = |
1077 | static_cast<KOTodoViewItem *>( mTodoListView->selectedItem() ); | 1077 | static_cast<KOTodoViewItem *>( mTodoListView->selectedItem() ); |
1078 | 1078 | ||
1079 | if ( !item ) { | 1079 | if ( !item ) { |
1080 | emit incidenceSelected( 0 ); | 1080 | emit incidenceSelected( 0 ); |
1081 | } else { | 1081 | } else { |
1082 | emit incidenceSelected( item->todo() ); | 1082 | emit incidenceSelected( item->todo() ); |
1083 | } | 1083 | } |
1084 | } | 1084 | } |
1085 | 1085 | ||
1086 | void KOTodoView::modified(bool b) | 1086 | void KOTodoView::modified(bool b) |
1087 | { | 1087 | { |
1088 | emit isModified(b); | 1088 | emit isModified(b); |
1089 | } | 1089 | } |
1090 | void KOTodoView::setTodoModified( Todo* todo ) | 1090 | void KOTodoView::setTodoModified( Todo* todo ) |
1091 | { | 1091 | { |
1092 | todoModified( todo, KOGlobals::UNKNOWN_MODIFIED ); | 1092 | todoModified( todo, KOGlobals::UNKNOWN_MODIFIED ); |
1093 | } | 1093 | } |
1094 | void KOTodoView::clearSelection() | 1094 | void KOTodoView::clearSelection() |
1095 | { | 1095 | { |
1096 | mTodoListView->selectAll( false ); | 1096 | mTodoListView->selectAll( false ); |
1097 | } | 1097 | } |
1098 | void KOTodoView::setAllOpen() | 1098 | void KOTodoView::setAllOpen() |
1099 | { | 1099 | { |
1100 | if ( isFlatDisplay ) { | 1100 | if ( isFlatDisplay ) { |
1101 | isFlatDisplay = false; | 1101 | isFlatDisplay = false; |
1102 | mPopupMenu->setItemChecked( 8,false ); | 1102 | mPopupMenu->setItemChecked( 8,false ); |
1103 | updateView(); | 1103 | updateView(); |
1104 | } | 1104 | } |
1105 | setOpen(mTodoListView->firstChild(), true); | 1105 | setOpen(mTodoListView->firstChild(), true); |
1106 | } | 1106 | } |
1107 | void KOTodoView::setAllClose() | 1107 | void KOTodoView::setAllClose() |
1108 | { | 1108 | { |
1109 | if ( isFlatDisplay ) { | 1109 | if ( isFlatDisplay ) { |
1110 | isFlatDisplay = false; | 1110 | isFlatDisplay = false; |
1111 | mPopupMenu->setItemChecked( 8,false ); | 1111 | mPopupMenu->setItemChecked( 8,false ); |
1112 | updateView(); | 1112 | updateView(); |
1113 | } | 1113 | } |
1114 | setOpen(mTodoListView->firstChild(), false); | 1114 | setOpen(mTodoListView->firstChild(), false); |
1115 | } | 1115 | } |
1116 | void KOTodoView::setOpen( QListViewItem* item, bool setOpenI) | 1116 | void KOTodoView::setOpen( QListViewItem* item, bool setOpenI) |
1117 | { | 1117 | { |
1118 | 1118 | ||
1119 | while ( item ) { | 1119 | while ( item ) { |
1120 | setOpen( item->firstChild(), setOpenI ); | 1120 | setOpen( item->firstChild(), setOpenI ); |
1121 | item->setOpen( setOpenI ); | 1121 | item->setOpen( setOpenI ); |
1122 | item = item->nextSibling(); | 1122 | item = item->nextSibling(); |
1123 | } | 1123 | } |
1124 | } | 1124 | } |
1125 | 1125 | ||
1126 | void KOTodoView::setAllFlat() | 1126 | void KOTodoView::displayAllFlat() |
1127 | { | 1127 | { |
1128 | if ( isFlatDisplay ) { | ||
1129 | isFlatDisplay = false; | ||
1130 | mPopupMenu->setItemChecked( 8,false ); | ||
1131 | updateView(); | ||
1132 | return; | ||
1133 | } | ||
1134 | pendingSubtodo = 0; | 1128 | pendingSubtodo = 0; |
1135 | if ( mBlockUpdate ) { | 1129 | if ( mBlockUpdate ) { |
1136 | return; | 1130 | return; |
1137 | } | 1131 | } |
1138 | mPopupMenu->setItemChecked( 8,true ); | 1132 | mPopupMenu->setItemChecked( 8,true ); |
1139 | isFlatDisplay = true; | 1133 | isFlatDisplay = true; |
1140 | QPtrList<Todo> todoList = calendar()->todos(); | 1134 | QPtrList<Todo> todoList = calendar()->todos(); |
1141 | mTodoMap.clear(); | 1135 | mTodoMap.clear(); |
1142 | mTodoListView->clear(); | 1136 | mTodoListView->clear(); |
1143 | Todo *todo; | 1137 | Todo *todo; |
1144 | for(todo = todoList.first(); todo; todo = todoList.next()) { | 1138 | for(todo = todoList.first(); todo; todo = todoList.next()) { |
1145 | KOTodoViewItem *todoItem = new KOTodoViewItem(mTodoListView,todo,this); | 1139 | KOTodoViewItem *todoItem = new KOTodoViewItem(mTodoListView,todo,this); |
1146 | mTodoMap.insert(todo,todoItem); | 1140 | mTodoMap.insert(todo,todoItem); |
1147 | } | 1141 | } |
1148 | mTodoListView->setFocus(); | 1142 | mTodoListView->setFocus(); |
1149 | processSelectionChange(); | 1143 | processSelectionChange(); |
1150 | } | 1144 | } |
1151 | 1145 | ||
1146 | void KOTodoView::setAllFlat() | ||
1147 | { | ||
1148 | if ( isFlatDisplay ) { | ||
1149 | isFlatDisplay = false; | ||
1150 | mPopupMenu->setItemChecked( 8,false ); | ||
1151 | updateView(); | ||
1152 | return; | ||
1153 | } | ||
1154 | displayAllFlat(); | ||
1155 | } | ||
1156 | |||
1152 | void KOTodoView::purgeCompleted() | 1157 | void KOTodoView::purgeCompleted() |
1153 | { | 1158 | { |
1154 | emit purgeCompletedSignal(); | 1159 | emit purgeCompletedSignal(); |
1155 | } | 1160 | } |
1156 | void KOTodoView::toggleQuickTodo() | 1161 | void KOTodoView::toggleQuickTodo() |
1157 | { | 1162 | { |
1158 | if ( mQuickAdd->isVisible() ) { | 1163 | if ( mQuickAdd->isVisible() ) { |
1159 | mQuickAdd->hide(); | 1164 | mQuickAdd->hide(); |
1160 | KOPrefs::instance()->mEnableQuickTodo = false; | 1165 | KOPrefs::instance()->mEnableQuickTodo = false; |
1161 | } | 1166 | } |
1162 | else { | 1167 | else { |
1163 | mQuickAdd->show(); | 1168 | mQuickAdd->show(); |
1164 | KOPrefs::instance()->mEnableQuickTodo = true; | 1169 | KOPrefs::instance()->mEnableQuickTodo = true; |
1165 | } | 1170 | } |
1166 | mPopupMenu->setItemChecked(4,KOPrefs::instance()->mEnableQuickTodo); | 1171 | mPopupMenu->setItemChecked(4,KOPrefs::instance()->mEnableQuickTodo); |
1167 | mItemPopupMenu->setItemChecked( 34 , KOPrefs::instance()->mEnableQuickTodo ); | 1172 | mItemPopupMenu->setItemChecked( 34 , KOPrefs::instance()->mEnableQuickTodo ); |
1168 | } | 1173 | } |
1169 | 1174 | ||
1170 | void KOTodoView::toggleRunning() | 1175 | void KOTodoView::toggleRunning() |
1171 | { | 1176 | { |
1172 | KOPrefs::instance()->mHideNonStartedTodos = !KOPrefs::instance()->mHideNonStartedTodos; | 1177 | KOPrefs::instance()->mHideNonStartedTodos = !KOPrefs::instance()->mHideNonStartedTodos; |
1173 | mPopupMenu->setItemChecked(5,KOPrefs::instance()->mHideNonStartedTodos); | 1178 | mPopupMenu->setItemChecked(5,KOPrefs::instance()->mHideNonStartedTodos); |
1174 | mItemPopupMenu->setItemChecked( 35 , KOPrefs::instance()->mHideNonStartedTodos ); | 1179 | mItemPopupMenu->setItemChecked( 35 , KOPrefs::instance()->mHideNonStartedTodos ); |
1175 | updateView(); | 1180 | updateView(); |
1176 | } | 1181 | } |
1177 | 1182 | ||
1178 | void KOTodoView::toggleCompleted() | 1183 | void KOTodoView::toggleCompleted() |
1179 | { | 1184 | { |
1180 | KOPrefs::instance()->mShowCompletedTodo = !KOPrefs::instance()->mShowCompletedTodo; | 1185 | KOPrefs::instance()->mShowCompletedTodo = !KOPrefs::instance()->mShowCompletedTodo; |
1181 | mPopupMenu->setItemChecked( 3,KOPrefs::instance()->mShowCompletedTodo ); | 1186 | mPopupMenu->setItemChecked( 3,KOPrefs::instance()->mShowCompletedTodo ); |
1182 | mItemPopupMenu->setItemChecked( 33 , KOPrefs::instance()->mShowCompletedTodo ); | 1187 | mItemPopupMenu->setItemChecked( 33 , KOPrefs::instance()->mShowCompletedTodo ); |
1183 | updateView(); | 1188 | updateView(); |
1184 | } | 1189 | } |
1185 | 1190 | ||
1186 | void KOTodoView::addQuickTodo() | 1191 | void KOTodoView::addQuickTodo() |
1187 | { | 1192 | { |
1188 | Todo *todo = new Todo(); | 1193 | Todo *todo = new Todo(); |
1189 | todo->setSummary(mQuickAdd->text()); | 1194 | todo->setSummary(mQuickAdd->text()); |
1190 | todo->setOrganizer(KOPrefs::instance()->email()); | 1195 | todo->setOrganizer(KOPrefs::instance()->email()); |
1191 | CalFilter * cf = mCalendar->filter(); | 1196 | CalFilter * cf = mCalendar->filter(); |
1192 | if ( cf ) { | 1197 | if ( cf ) { |
1193 | if ( cf->isEnabled()&& cf->showCategories()) { | 1198 | if ( cf->isEnabled()&& cf->showCategories()) { |
1194 | todo->setCategories(cf->categoryList()); | 1199 | todo->setCategories(cf->categoryList()); |
1195 | } | 1200 | } |
1196 | if ( cf->isEnabled() ) | 1201 | if ( cf->isEnabled() ) |
1197 | todo->setSecrecy( cf->getSecrecy()); | 1202 | todo->setSecrecy( cf->getSecrecy()); |
1198 | } | 1203 | } |
1199 | mCalendar->addTodo(todo); | 1204 | mCalendar->addTodo(todo); |
1200 | mQuickAdd->setText(""); | 1205 | mQuickAdd->setText(""); |
1201 | todoModified (todo, KOGlobals::EVENTADDED ); | 1206 | todoModified (todo, KOGlobals::EVENTADDED ); |
1202 | updateView(); | 1207 | updateView(); |
1203 | } | 1208 | } |
1204 | void KOTodoView::keyPressEvent ( QKeyEvent * e ) | 1209 | void KOTodoView::keyPressEvent ( QKeyEvent * e ) |
1205 | { | 1210 | { |
1206 | // e->ignore(); | 1211 | // e->ignore(); |
1207 | //return; | 1212 | //return; |
1208 | //qDebug("KOTodoView::keyPressEvent "); | 1213 | //qDebug("KOTodoView::keyPressEvent "); |
1209 | switch ( e->key() ) { | 1214 | switch ( e->key() ) { |
1210 | case Qt::Key_Down: | 1215 | case Qt::Key_Down: |
1211 | case Qt::Key_Up: | 1216 | case Qt::Key_Up: |
1212 | QWidget::keyPressEvent ( e ); | 1217 | QWidget::keyPressEvent ( e ); |
1213 | break; | 1218 | break; |
1214 | 1219 | ||
1215 | case Qt::Key_Q: | 1220 | case Qt::Key_Q: |
1216 | toggleQuickTodo(); | 1221 | toggleQuickTodo(); |
1217 | break; | 1222 | break; |
1218 | case Qt::Key_U: | 1223 | case Qt::Key_U: |
1219 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) { | 1224 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) { |
1220 | mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem(); | 1225 | mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem(); |
1221 | unparentTodo(); | 1226 | unparentTodo(); |
1222 | e->accept(); | 1227 | e->accept(); |
1223 | } else | 1228 | } else |
1224 | e->ignore(); | 1229 | e->ignore(); |
1225 | break; | 1230 | break; |
1226 | case Qt::Key_S: | 1231 | case Qt::Key_S: |
1227 | if ( e->state() == Qt::ControlButton ) { | 1232 | if ( e->state() == Qt::ControlButton ) { |
1228 | e->ignore(); | 1233 | e->ignore(); |
1229 | break; | 1234 | break; |
1230 | } | 1235 | } |
1231 | if ( e->state() == Qt::ShiftButton ) { | 1236 | if ( e->state() == Qt::ShiftButton ) { |
1232 | mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem(); | 1237 | mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem(); |
1233 | reparentTodo(); | 1238 | reparentTodo(); |
1234 | e->accept(); | 1239 | e->accept(); |
1235 | } else | 1240 | } else |
1236 | e->ignore(); | 1241 | e->ignore(); |
1237 | break; | 1242 | break; |
1238 | case Qt::Key_P: | 1243 | case Qt::Key_P: |
1239 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) { | 1244 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) { |
1240 | mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem(); | 1245 | mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem(); |
1241 | if ( pendingSubtodo ) | 1246 | if ( pendingSubtodo ) |
1242 | itemClicked(mActiveItem); | 1247 | itemClicked(mActiveItem); |
1243 | e->accept(); | 1248 | e->accept(); |
1244 | } else | 1249 | } else |
1245 | e->ignore(); | 1250 | e->ignore(); |
1246 | break; | 1251 | break; |
1247 | case Qt::Key_Escape: | 1252 | case Qt::Key_Escape: |
diff --git a/korganizer/kotodoview.h b/korganizer/kotodoview.h index 1642132..462f0a6 100644 --- a/korganizer/kotodoview.h +++ b/korganizer/kotodoview.h | |||
@@ -77,178 +77,179 @@ class KOTodoListView : public KListView | |||
77 | void contentsMouseReleaseEvent(QMouseEvent *); | 77 | void contentsMouseReleaseEvent(QMouseEvent *); |
78 | void contentsMouseDoubleClickEvent(QMouseEvent *); | 78 | void contentsMouseDoubleClickEvent(QMouseEvent *); |
79 | 79 | ||
80 | private: | 80 | private: |
81 | void paintEvent(QPaintEvent * pevent); | 81 | void paintEvent(QPaintEvent * pevent); |
82 | bool internalDrop; | 82 | bool internalDrop; |
83 | QString mName; | 83 | QString mName; |
84 | Calendar *mCalendar; | 84 | Calendar *mCalendar; |
85 | QPoint mPressPos; | 85 | QPoint mPressPos; |
86 | bool mMousePressed; | 86 | bool mMousePressed; |
87 | QListViewItem *mOldCurrent; | 87 | QListViewItem *mOldCurrent; |
88 | void keyPressEvent ( QKeyEvent * ) ; | 88 | void keyPressEvent ( QKeyEvent * ) ; |
89 | }; | 89 | }; |
90 | 90 | ||
91 | 91 | ||
92 | /** | 92 | /** |
93 | This is the line-edit on top of the todoview for fast addition of new todos | 93 | This is the line-edit on top of the todoview for fast addition of new todos |
94 | */ | 94 | */ |
95 | class KOQuickTodo : public QLineEdit | 95 | class KOQuickTodo : public QLineEdit |
96 | { | 96 | { |
97 | public: | 97 | public: |
98 | KOQuickTodo(QWidget *parent=0); | 98 | KOQuickTodo(QWidget *parent=0); |
99 | protected: | 99 | protected: |
100 | void focusInEvent(QFocusEvent *ev); | 100 | void focusInEvent(QFocusEvent *ev); |
101 | void focusOutEvent(QFocusEvent *ev); | 101 | void focusOutEvent(QFocusEvent *ev); |
102 | }; | 102 | }; |
103 | 103 | ||
104 | 104 | ||
105 | /** | 105 | /** |
106 | This class provides a multi-column list view of todo events. | 106 | This class provides a multi-column list view of todo events. |
107 | 107 | ||
108 | @short multi-column list view of todo events. | 108 | @short multi-column list view of todo events. |
109 | @author Cornelius Schumacher <schumacher@kde.org> | 109 | @author Cornelius Schumacher <schumacher@kde.org> |
110 | */ | 110 | */ |
111 | class KOTodoView : public KOrg::BaseView | 111 | class KOTodoView : public KOrg::BaseView |
112 | { | 112 | { |
113 | Q_OBJECT | 113 | Q_OBJECT |
114 | public: | 114 | public: |
115 | KOTodoView(Calendar *, QWidget* parent=0, const char* name=0 ); | 115 | KOTodoView(Calendar *, QWidget* parent=0, const char* name=0 ); |
116 | ~KOTodoView(); | 116 | ~KOTodoView(); |
117 | 117 | ||
118 | QPtrList<Incidence> selectedIncidences(); | 118 | QPtrList<Incidence> selectedIncidences(); |
119 | QPtrList<Todo> selectedTodos(); | 119 | QPtrList<Todo> selectedTodos(); |
120 | 120 | ||
121 | DateList selectedDates() | 121 | DateList selectedDates() |
122 | {DateList q; | 122 | {DateList q; |
123 | return q;} | 123 | return q;} |
124 | 124 | ||
125 | /** Return number of shown dates. TodoView does not show dates, */ | 125 | /** Return number of shown dates. TodoView does not show dates, */ |
126 | int currentDateCount() { return 0; } | 126 | int currentDateCount() { return 0; } |
127 | 127 | ||
128 | void printPreview(CalPrinter *calPrinter, const QDate &fd, const QDate &td); | 128 | void printPreview(CalPrinter *calPrinter, const QDate &fd, const QDate &td); |
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 | QString getWhatsThisText(QPoint p); |
138 | 138 | ||
139 | public slots: | 139 | public slots: |
140 | void updateView(); | 140 | void updateView(); |
141 | void updateConfig(); | 141 | void updateConfig(); |
142 | 142 | ||
143 | void changeEventDisplay(Event *, int); | 143 | void changeEventDisplay(Event *, int); |
144 | 144 | ||
145 | void showDates(const QDate &start, const QDate &end); | 145 | void showDates(const QDate &start, const QDate &end); |
146 | void showEvents(QPtrList<Event> eventList); | 146 | void showEvents(QPtrList<Event> eventList); |
147 | 147 | ||
148 | void clearSelection(); | 148 | void clearSelection(); |
149 | void jumpToDate (); | 149 | void jumpToDate (); |
150 | 150 | ||
151 | void editItem(QListViewItem *item); | 151 | void editItem(QListViewItem *item); |
152 | void showItem(QListViewItem *item,const QPoint &,int); | 152 | void showItem(QListViewItem *item,const QPoint &,int); |
153 | void popupMenu(QListViewItem *item,const QPoint &,int); | 153 | void popupMenu(QListViewItem *item,const QPoint &,int); |
154 | void newTodo(); | 154 | void newTodo(); |
155 | void newSubTodo(); | 155 | void newSubTodo(); |
156 | void unparentTodo(); | 156 | void unparentTodo(); |
157 | void reparentTodo(); | 157 | void reparentTodo(); |
158 | void showTodo(); | 158 | void showTodo(); |
159 | void editTodo(); | 159 | void editTodo(); |
160 | void cloneTodo(); | 160 | void cloneTodo(); |
161 | void cancelTodo(); | 161 | void cancelTodo(); |
162 | void moveTodo(); | 162 | void moveTodo(); |
163 | void beamTodo(); | 163 | void beamTodo(); |
164 | void deleteTodo(); | 164 | void deleteTodo(); |
165 | 165 | ||
166 | void setNewPriority(int); | 166 | void setNewPriority(int); |
167 | void setNewPercentage(int); | 167 | void setNewPercentage(int); |
168 | void changedCategories(int); | 168 | void changedCategories(int); |
169 | 169 | ||
170 | void setAllOpen(); | 170 | void setAllOpen(); |
171 | void setAllClose(); | 171 | void setAllClose(); |
172 | void setAllFlat(); | 172 | void setAllFlat(); |
173 | void displayAllFlat(); | ||
173 | 174 | ||
174 | void purgeCompleted(); | 175 | void purgeCompleted(); |
175 | void toggleCompleted(); | 176 | void toggleCompleted(); |
176 | void toggleRunning(); | 177 | void toggleRunning(); |
177 | void toggleQuickTodo(); | 178 | void toggleQuickTodo(); |
178 | void updateTodo( Todo *, int ); | 179 | void updateTodo( Todo *, int ); |
179 | 180 | ||
180 | void itemClicked(QListViewItem *); | 181 | void itemClicked(QListViewItem *); |
181 | void itemStateChanged(QListViewItem *); | 182 | void itemStateChanged(QListViewItem *); |
182 | void modified(bool); | 183 | void modified(bool); |
183 | void itemDoubleClicked(QListViewItem *item); | 184 | void itemDoubleClicked(QListViewItem *item); |
184 | 185 | ||
185 | signals: | 186 | signals: |
186 | void newTodoSignal(); | 187 | void newTodoSignal(); |
187 | void newSubTodoSignal(Todo *); | 188 | void newSubTodoSignal(Todo *); |
188 | void unparentTodoSignal(Todo *); | 189 | void unparentTodoSignal(Todo *); |
189 | void reparentTodoSignal( Todo *,Todo * ); | 190 | void reparentTodoSignal( Todo *,Todo * ); |
190 | void showTodoSignal(Todo *); | 191 | void showTodoSignal(Todo *); |
191 | 192 | ||
192 | void editTodoSignal(Todo *); | 193 | void editTodoSignal(Todo *); |
193 | void deleteTodoSignal(Todo *); | 194 | void deleteTodoSignal(Todo *); |
194 | void todoModifiedSignal (Todo *, int); | 195 | void todoModifiedSignal (Todo *, int); |
195 | 196 | ||
196 | void isModified(bool); | 197 | void isModified(bool); |
197 | void cloneTodoSignal( Incidence * ); | 198 | void cloneTodoSignal( Incidence * ); |
198 | void cancelTodoSignal( Incidence * ); | 199 | void cancelTodoSignal( Incidence * ); |
199 | void moveTodoSignal( Incidence * ); | 200 | void moveTodoSignal( Incidence * ); |
200 | void beamTodoSignal( Incidence * ); | 201 | void beamTodoSignal( Incidence * ); |
201 | void purgeCompletedSignal(); | 202 | void purgeCompletedSignal(); |
202 | 203 | ||
203 | protected slots: | 204 | protected slots: |
204 | void paintNeeded(); | 205 | void paintNeeded(); |
205 | void processSelectionChange(); | 206 | void processSelectionChange(); |
206 | void addQuickTodo(); | 207 | void addQuickTodo(); |
207 | void setTodoModified( Todo* ); | 208 | void setTodoModified( Todo* ); |
208 | void todoModified(Todo *, int ); | 209 | void todoModified(Todo *, int ); |
209 | 210 | ||
210 | private: | 211 | private: |
211 | /* | 212 | /* |
212 | * the TodoEditor approach is rather unscaling in the long | 213 | * the TodoEditor approach is rather unscaling in the long |
213 | * run. | 214 | * run. |
214 | * Korganizer keeps it in memory and we need to update | 215 | * Korganizer keeps it in memory and we need to update |
215 | * 1. make KOTodoViewItem a QObject again? | 216 | * 1. make KOTodoViewItem a QObject again? |
216 | * 2. add a public method for setting one todo modified? | 217 | * 2. add a public method for setting one todo modified? |
217 | * 3. add a private method for setting a todo modified + friend here? | 218 | * 3. add a private method for setting a todo modified + friend here? |
218 | * -- zecke 2002-07-08 | 219 | * -- zecke 2002-07-08 |
219 | */ | 220 | */ |
220 | friend class KOTodoListView; | 221 | friend class KOTodoListView; |
221 | void paintEvent(QPaintEvent * pevent); | 222 | void paintEvent(QPaintEvent * pevent); |
222 | bool mPendingUpdateBeforeRepaint; | 223 | bool mPendingUpdateBeforeRepaint; |
223 | friend class KOTodoViewItem; | 224 | friend class KOTodoViewItem; |
224 | QMap<Todo *,KOTodoViewItem *>::ConstIterator insertTodoItem(Todo *todo); | 225 | QMap<Todo *,KOTodoViewItem *>::ConstIterator insertTodoItem(Todo *todo); |
225 | void restoreItemState( QListViewItem * ); | 226 | void restoreItemState( QListViewItem * ); |
226 | 227 | ||
227 | bool checkTodo( Todo * ); | 228 | bool checkTodo( Todo * ); |
228 | bool isFlatDisplay; | 229 | bool isFlatDisplay; |
229 | void setOpen( QListViewItem*, bool setOpen); | 230 | void setOpen( QListViewItem*, bool setOpen); |
230 | KOTodoListView *mTodoListView; | 231 | KOTodoListView *mTodoListView; |
231 | QPopupMenu *mItemPopupMenu; | 232 | QPopupMenu *mItemPopupMenu; |
232 | QPopupMenu *mPopupMenu; | 233 | QPopupMenu *mPopupMenu; |
233 | QPopupMenu *mPriorityPopupMenu; | 234 | QPopupMenu *mPriorityPopupMenu; |
234 | QPopupMenu *mPercentageCompletedPopupMenu; | 235 | QPopupMenu *mPercentageCompletedPopupMenu; |
235 | QPopupMenu *mCategoryPopupMenu; | 236 | QPopupMenu *mCategoryPopupMenu; |
236 | 237 | ||
237 | QMap<int, int> mPercentage; | 238 | QMap<int, int> mPercentage; |
238 | QMap<int, int> mPriority; | 239 | QMap<int, int> mPriority; |
239 | QMap<int, QString> mCategory; | 240 | QMap<int, QString> mCategory; |
240 | KOTodoViewItem *mActiveItem; | 241 | KOTodoViewItem *mActiveItem; |
241 | 242 | ||
242 | QMap<Todo *,KOTodoViewItem *> mTodoMap; | 243 | QMap<Todo *,KOTodoViewItem *> mTodoMap; |
243 | QString mName; | 244 | QString mName; |
244 | 245 | ||
245 | DocPrefs *mDocPrefs; | 246 | DocPrefs *mDocPrefs; |
246 | QString mCurrentDoc; | 247 | QString mCurrentDoc; |
247 | KOQuickTodo *mQuickAdd; | 248 | KOQuickTodo *mQuickAdd; |
248 | bool mBlockUpdate; | 249 | bool mBlockUpdate; |
249 | void keyPressEvent ( QKeyEvent * ) ; | 250 | void keyPressEvent ( QKeyEvent * ) ; |
250 | KOTodoViewItem * pendingSubtodo; | 251 | KOTodoViewItem * pendingSubtodo; |
251 | DateNavigator* mNavigator; | 252 | DateNavigator* mNavigator; |
252 | }; | 253 | }; |
253 | 254 | ||
254 | #endif | 255 | #endif |