summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-03-21 18:04:19 (UTC)
committer zautrix <zautrix>2005-03-21 18:04:19 (UTC)
commit8888389a4511e0bda23774b993dcfdeb7f837c31 (patch) (unidiff)
treecb45be3b62f2255f69cee92e358380cc76d3ad30
parent3c5d7b484e6ab263ab4091f22815770ea8da6c9c (diff)
downloadkdepimpi-8888389a4511e0bda23774b993dcfdeb7f837c31.zip
kdepimpi-8888389a4511e0bda23774b993dcfdeb7f837c31.tar.gz
kdepimpi-8888389a4511e0bda23774b993dcfdeb7f837c31.tar.bz2
nf
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/WhatsNew.txt10
-rw-r--r--korganizer/kodaymatrix.cpp2
2 files changed, 10 insertions, 2 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt
index 8800ada..df2d9d6 100644
--- a/bin/kdepim/WhatsNew.txt
+++ b/bin/kdepim/WhatsNew.txt
@@ -1,199 +1,207 @@
1Info about the changes in new versions of KDE-Pim/Pi 1Info about the changes in new versions of KDE-Pim/Pi
2 2
3********** VERSION 2.0.18 ************ 3********** VERSION 2.0.18 ************
4 4KO/Pi:
5Fixed some minor problems. 5Fixed some minor problems.
6Cleaned up the KO/Pi config dialog. 6Cleaned up the KO/Pi config dialog.
7Fixed problem moving events in aganda view.
8Made datepicker scaleable, i.e. if the datepicker shows now a
9datepicker matrix depending on its size.
10Birthdays are now displayed green in the datepicker.
11What'sThis Help in datepicker shows all events of the day.
7 12
13OM/Pi:
14Updated the backend mail library to the latest version.
15Please backup your mail before using this version.
8 16
9********** VERSION 2.0.17 ************ 17********** VERSION 2.0.17 ************
10 18
11KO/Pi: 19KO/Pi:
12Tooltips in month view were not sorted. Fixed. 20Tooltips in month view were not sorted. Fixed.
13Daylabel in agenda view ( for display of one day ) was too short. Fixed. 21Daylabel in agenda view ( for display of one day ) was too short. Fixed.
14Conflict display dialog for syncing was not on top of other windows. Fixed. 22Conflict display dialog for syncing was not on top of other windows. Fixed.
15Fixed some minor problems. 23Fixed some minor problems.
16 24
17Fixed an endless loop when importing vcs file with RESOURCES entry. 25Fixed an endless loop when importing vcs file with RESOURCES entry.
18 26
19********** VERSION 2.0.16 ************ 27********** VERSION 2.0.16 ************
20OM/Pi: 28OM/Pi:
21Fixed the SMTP account setting the option. 29Fixed the SMTP account setting the option.
22Fixed something in mail sending. 30Fixed something in mail sending.
23 31
24KO/Pi: 32KO/Pi:
25Added possibility to export selected events/todos as vcal file. 33Added possibility to export selected events/todos as vcal file.
26 34
27********** VERSION 2.0.15 ************ 35********** VERSION 2.0.15 ************
28 36
29PwM/Pi: 37PwM/Pi:
30Added keyboard shorcuts for 38Added keyboard shorcuts for
31- toggling summary view (space bar) 39- toggling summary view (space bar)
32- delete item (delete + backspace key) 40- delete item (delete + backspace key)
33- add new item ( i + n key) 41- add new item ( i + n key)
34Fixed length of info in the title. 42Fixed length of info in the title.
35 43
36KO/Pi-KA/Pi: 44KO/Pi-KA/Pi:
37Changed "ME" menu bar entry to an icon. 45Changed "ME" menu bar entry to an icon.
38 46
39KO/Pi: 47KO/Pi:
40Fixed two minor bugs in displaying todos. 48Fixed two minor bugs in displaying todos.
41If in month view a cell is selected, the key shortcut "d" shows now that date. 49If in month view a cell is selected, the key shortcut "d" shows now that date.
42Added complete info for a todo in month view as an icon left of the text. 50Added complete info for a todo in month view as an icon left of the text.
43Fixed problems of displaying data when "<" or ">" are used in summary/location/description. 51Fixed problems of displaying data when "<" or ">" are used in summary/location/description.
44Fixed problem of search dialog size when switching displays. 52Fixed problem of search dialog size when switching displays.
45Cancel key now closes date picker. 53Cancel key now closes date picker.
46Rearranged KO/Pi file menu structure. 54Rearranged KO/Pi file menu structure.
47 55
48OM/Pi: 56OM/Pi:
49Added to the SMTP account setting the option 57Added to the SMTP account setting the option
50"No secure connection". 58"No secure connection".
51You have to configure your SMTP accounts again, sorry. 59You have to configure your SMTP accounts again, sorry.
52 60
53KA/Pi: 61KA/Pi:
54Added support for importing quoted-printable. 62Added support for importing quoted-printable.
55Support was added by Peter P.. Thanks, Peter! 63Support was added by Peter P.. Thanks, Peter!
56 64
57 65
58********** VERSION 2.0.14 ************ 66********** VERSION 2.0.14 ************
59 67
60Made Passwordmanager PwM/Pi more userfriendly: 68Made Passwordmanager PwM/Pi more userfriendly:
61Rearranged some toolbar icons, optimized setting of focus, fixed layout problems and more. 69Rearranged some toolbar icons, optimized setting of focus, fixed layout problems and more.
62Fixed bug in KO/Pi todo printing. 70Fixed bug in KO/Pi todo printing.
63Made Qtopia calendar import possible on desktop . 71Made Qtopia calendar import possible on desktop .
64 72
65********** VERSION 2.0.13 ************ 73********** VERSION 2.0.13 ************
66 74
67Fixed a problem in the addressee select dialog and made it more user friendly by adding a minimize splitter. 75Fixed a problem in the addressee select dialog and made it more user friendly by adding a minimize splitter.
68 76
69In the search dialog you can switch now the focus from search line edit to the list view by pressing key "arrow down". 77In the search dialog you can switch now the focus from search line edit to the list view by pressing key "arrow down".
70 78
71OM/Pi: 79OM/Pi:
72Fixed a refresh problem of outgoing/sent/sendfailed folders after sending mails. 80Fixed a refresh problem of outgoing/sent/sendfailed folders after sending mails.
73Added missing German translation. 81Added missing German translation.
74Added warning if path is specified in local folder settings of account config. 82Added warning if path is specified in local folder settings of account config.
75 83
76********** VERSION 2.0.12 ************ 84********** VERSION 2.0.12 ************
77 85
78KO/Pi: 86KO/Pi:
79Fixed a bug in todo start/due date handling for non recurring todos with a start and due date. 87Fixed a bug in todo start/due date handling for non recurring todos with a start and due date.
80Fixed some layout problems in the KO/Pi agenda view when there were many conflicting itmes. 88Fixed some layout problems in the KO/Pi agenda view when there were many conflicting itmes.
81Fixed several problems of the keyboard focus in the desktop versions when opening the search dialog/event viewer. 89Fixed several problems of the keyboard focus in the desktop versions when opening the search dialog/event viewer.
82 90
83Fixed problem in pi-sync mode when wrong password was sent. 91Fixed problem in pi-sync mode when wrong password was sent.
84 92
85OM/Pi: 93OM/Pi:
86Fixed a crash when displaying mails with "Show mail as html" was checked in the config. 94Fixed a crash when displaying mails with "Show mail as html" was checked in the config.
87Added a check before displaying the mail if the mail is in html format, if "Show mail as html" is enabled. 95Added a check before displaying the mail if the mail is in html format, if "Show mail as html" is enabled.
88 96
89********** VERSION 2.0.11 ************ 97********** VERSION 2.0.11 ************
90 98
91Fixed some problems in pi-sync mode 99Fixed some problems in pi-sync mode
92(e.g. details of events were not synced properly) 100(e.g. details of events were not synced properly)
93 101
94********** VERSION 2.0.10 ************ 102********** VERSION 2.0.10 ************
95 103
96KO/Pi: 104KO/Pi:
97In the desktop versions the context menu in the search dialog was broken after introducing the What'sThis info for the list view. 105In the desktop versions the context menu in the search dialog was broken after introducing the What'sThis info for the list view.
98This is fixed. 106This is fixed.
99Changed the search dialog a bit to make it more user friendly. 107Changed the search dialog a bit to make it more user friendly.
100(E.g.: Removed message box about "no items found" and set key focus to search line edit after search). 108(E.g.: Removed message box about "no items found" and set key focus to search line edit after search).
101 109
102Added config option to hide the week number in KO/Pi toolbar. 110Added config option to hide the week number in KO/Pi toolbar.
103 111
104********** VERSION 2.0.9 ************ 112********** VERSION 2.0.9 ************
105 113
106Made month view icons for multiday events a bit nicer. 114Made month view icons for multiday events a bit nicer.
107Some minor fixes in KO/Pi 115Some minor fixes in KO/Pi
108(e.g. go to today did not work for new week view properly). 116(e.g. go to today did not work for new week view properly).
109 117
110 118
111********** VERSION 2.0.8 ************ 119********** VERSION 2.0.8 ************
112 120
113Fixed a problem in dependency info in the ipk files for the Zaurus. 121Fixed a problem in dependency info in the ipk files for the Zaurus.
114 122
115Added icon for the stealth new week view and made navigation more user friendly in monthview by adding a prev/next week button to the navigator bar. 123Added icon for the stealth new week view and made navigation more user friendly in monthview by adding a prev/next week button to the navigator bar.
116 124
117Added a "go today" button to the datepicker. 125Added a "go today" button to the datepicker.
118 126
119Added "created" and "last modified" to event/todo viewer (and What'sThis viewer) 127Added "created" and "last modified" to event/todo viewer (and What'sThis viewer)
120and made it configureable to show these values. 128and made it configureable to show these values.
121 129
122Fixed a problem for events (from external iCal files) that do have a duration but no end date. 130Fixed a problem for events (from external iCal files) that do have a duration but no end date.
123 131
124 132
125********** VERSION 2.0.7 ************ 133********** VERSION 2.0.7 ************
126 134
127Added global application font settings 135Added global application font settings
128(for all KDE-Pim/Pi apps) to the general settings. 136(for all KDE-Pim/Pi apps) to the general settings.
129 137
130Fixed a problem in OM/Pi when trying to login to some IMAP servers 138Fixed a problem in OM/Pi when trying to login to some IMAP servers
131(like the IMAP server of Apple: mail.mac.com ) 139(like the IMAP server of Apple: mail.mac.com )
132 140
133Added recurring todos to KO/Pi. 141Added recurring todos to KO/Pi.
134 142
135 143
136********** VERSION 2.0.6 ************ 144********** VERSION 2.0.6 ************
137 145
138Some bugfixes in the pi-sync mode. 146Some bugfixes in the pi-sync mode.
139Added German translation for pi-sync mode. 147Added German translation for pi-sync mode.
140 148
141KO/Pi: 149KO/Pi:
142Made the todolist using alternate background. 150Made the todolist using alternate background.
143 151
144Other minor fixes in KO/Pi. 152Other minor fixes in KO/Pi.
145 153
146 154
147********** VERSION 2.0.5 ************ 155********** VERSION 2.0.5 ************
148 156
149Bugfixes in KO/Pi. 157Bugfixes in KO/Pi.
150 158
151********** VERSION 2.0.4 ************ 159********** VERSION 2.0.4 ************
152 160
153KO/Pi: 161KO/Pi:
154Fixed problem loading translations for summary/location edit boxes in event/todo editor. 162Fixed problem loading translations for summary/location edit boxes in event/todo editor.
155 163
156Added a general "select week number" to the toolbar. 164Added a general "select week number" to the toolbar.
157 165
158Fixed some small problem of the new features introduced in version 2.0.3. 166Fixed some small problem of the new features introduced in version 2.0.3.
159 167
160Made it possible to specify one specific category as category color, 168Made it possible to specify one specific category as category color,
161if more than one categories are selected. 169if more than one categories are selected.
162 170
163Fixed a bug in saving colors for categories with non-ascii characters. 171Fixed a bug in saving colors for categories with non-ascii characters.
164(Like, e.g. German Umlauts). 172(Like, e.g. German Umlauts).
165Propably you have to set your colors again for those categories. 173Propably you have to set your colors again for those categories.
166 174
167 175
168********** VERSION 2.0.3 ************ 176********** VERSION 2.0.3 ************
169 177
170KO/Pi: 178KO/Pi:
171Added feature for changing alarm settings for many items at once: 179Added feature for changing alarm settings for many items at once:
172Open list view (or search dialog), select the desired items and choose in 180Open list view (or search dialog), select the desired items and choose in
173the popup menu: Set alarm for selected... 181the popup menu: Set alarm for selected...
174 182
175Added to the event/todo viewer the option to send an email to 183Added to the event/todo viewer the option to send an email to
176all attendees or all selected (with RSVP) attendees. 184all attendees or all selected (with RSVP) attendees.
177 185
178Made the week-month mode changing in month view faster. 186Made the week-month mode changing in month view faster.
179 187
180Made month view better useable with keyboard. 188Made month view better useable with keyboard.
181Now TAB key jumps to next cell with an event/todo. 189Now TAB key jumps to next cell with an event/todo.
182Scroll in cell with coursor keys, scroll in time (next week) with 190Scroll in cell with coursor keys, scroll in time (next week) with
183Shift/Control + coursorkeys. 191Shift/Control + coursorkeys.
184 192
185Fixed bug that the todo view flat mode was reset after first view update. 193Fixed bug that the todo view flat mode was reset after first view update.
186 194
187If a todo is displayed closed in the todo view, 195If a todo is displayed closed in the todo view,
188it is now displayed in overdue/due today color depending on the subtodos overdue/due today properties. 196it is now displayed in overdue/due today color depending on the subtodos overdue/due today properties.
189 197
190Added info about the numbers of years to the caption (title) information about a birthday event. 198Added info about the numbers of years to the caption (title) information about a birthday event.
191 199
192Made completion date in todo editor editable. 200Made completion date in todo editor editable.
193 201
194Added possibility to save/load templates for journals. 202Added possibility to save/load templates for journals.
195(Which is just a simple "save text to file" or "insert text from file". 203(Which is just a simple "save text to file" or "insert text from file".
196 204
197********** VERSION 2.0.2 ************ 205********** VERSION 2.0.2 ************
198 206
199KO/Pi: 207KO/Pi:
diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp
index 36cd990..120bc89 100644
--- a/korganizer/kodaymatrix.cpp
+++ b/korganizer/kodaymatrix.cpp
@@ -505,385 +505,385 @@ void KODayMatrix::mouseReleaseEvent (QMouseEvent* e)
505 int tmp = getDayIndexFrom(e->x(), e->y()); 505 int tmp = getDayIndexFrom(e->x(), e->y());
506 if (tmp > NUMDAYS-1) tmp=NUMDAYS-1; 506 if (tmp > NUMDAYS-1) tmp=NUMDAYS-1;
507 507
508 if (mSelInit > tmp) { 508 if (mSelInit > tmp) {
509 mSelEnd = mSelInit; 509 mSelEnd = mSelInit;
510 if (tmp != mSelStart) { 510 if (tmp != mSelStart) {
511 mSelStart = tmp; 511 mSelStart = tmp;
512 repaint(false); 512 repaint(false);
513 } 513 }
514 } else { 514 } else {
515 mSelStart = mSelInit; 515 mSelStart = mSelInit;
516 516
517 //repaint only if selection has changed 517 //repaint only if selection has changed
518 if (tmp != mSelEnd) { 518 if (tmp != mSelEnd) {
519 mSelEnd = tmp; 519 mSelEnd = tmp;
520 repaint(false); 520 repaint(false);
521 } 521 }
522 } 522 }
523 523
524 DateList daylist; 524 DateList daylist;
525 if ( mSelStart < 0 ) 525 if ( mSelStart < 0 )
526 mSelStart = 0; 526 mSelStart = 0;
527 for (int i = mSelStart; i <= mSelEnd; i++) { 527 for (int i = mSelStart; i <= mSelEnd; i++) {
528 daylist.append(days[i]); 528 daylist.append(days[i]);
529 } 529 }
530 emit selected((const DateList)daylist); 530 emit selected((const DateList)daylist);
531 531
532} 532}
533 533
534void KODayMatrix::mouseMoveEvent (QMouseEvent* e) 534void KODayMatrix::mouseMoveEvent (QMouseEvent* e)
535{ 535{
536 if ( ! mouseDown ) { 536 if ( ! mouseDown ) {
537 return; 537 return;
538 } 538 }
539 int tmp = getDayIndexFrom(e->x(), e->y()); 539 int tmp = getDayIndexFrom(e->x(), e->y());
540 if (tmp > NUMDAYS-1) tmp=NUMDAYS-1; 540 if (tmp > NUMDAYS-1) tmp=NUMDAYS-1;
541 541
542 if (mSelInit > tmp) { 542 if (mSelInit > tmp) {
543 mSelEnd = mSelInit; 543 mSelEnd = mSelInit;
544 if (tmp != mSelStart) { 544 if (tmp != mSelStart) {
545 mSelStart = tmp; 545 mSelStart = tmp;
546 repaint(false); 546 repaint(false);
547 } 547 }
548 } else { 548 } else {
549 mSelStart = mSelInit; 549 mSelStart = mSelInit;
550 550
551 //repaint only if selection has changed 551 //repaint only if selection has changed
552 if (tmp != mSelEnd) { 552 if (tmp != mSelEnd) {
553 mSelEnd = tmp; 553 mSelEnd = tmp;
554 repaint(false); 554 repaint(false);
555 } 555 }
556 } 556 }
557} 557}
558 558
559// ---------------------------------------------------------------------------- 559// ----------------------------------------------------------------------------
560// D R A G ' N D R O P H A N D L I N G 560// D R A G ' N D R O P H A N D L I N G
561// ---------------------------------------------------------------------------- 561// ----------------------------------------------------------------------------
562 562
563void KODayMatrix::dragEnterEvent(QDragEnterEvent *e) 563void KODayMatrix::dragEnterEvent(QDragEnterEvent *e)
564{ 564{
565#ifndef KORG_NODND 565#ifndef KORG_NODND
566 if ( !ICalDrag::canDecode( e ) && !VCalDrag::canDecode( e ) ) { 566 if ( !ICalDrag::canDecode( e ) && !VCalDrag::canDecode( e ) ) {
567 e->ignore(); 567 e->ignore();
568 return; 568 return;
569 } 569 }
570 570
571 // some visual feedback 571 // some visual feedback
572// oldPalette = palette(); 572// oldPalette = palette();
573// setPalette(my_HilitePalette); 573// setPalette(my_HilitePalette);
574// update(); 574// update();
575#endif 575#endif
576} 576}
577 577
578void KODayMatrix::dragMoveEvent(QDragMoveEvent *e) 578void KODayMatrix::dragMoveEvent(QDragMoveEvent *e)
579{ 579{
580#ifndef KORG_NODND 580#ifndef KORG_NODND
581 if ( !ICalDrag::canDecode( e ) && !VCalDrag::canDecode( e ) ) { 581 if ( !ICalDrag::canDecode( e ) && !VCalDrag::canDecode( e ) ) {
582 e->ignore(); 582 e->ignore();
583 return; 583 return;
584 } 584 }
585 585
586 e->accept(); 586 e->accept();
587#endif 587#endif
588} 588}
589 589
590void KODayMatrix::dragLeaveEvent(QDragLeaveEvent */*dl*/) 590void KODayMatrix::dragLeaveEvent(QDragLeaveEvent */*dl*/)
591{ 591{
592#ifndef KORG_NODND 592#ifndef KORG_NODND
593// setPalette(oldPalette); 593// setPalette(oldPalette);
594// update(); 594// update();
595#endif 595#endif
596} 596}
597 597
598void KODayMatrix::dropEvent(QDropEvent *e) 598void KODayMatrix::dropEvent(QDropEvent *e)
599{ 599{
600#ifndef KORG_NODND 600#ifndef KORG_NODND
601// kdDebug() << "KODayMatrix::dropEvent(e) begin" << endl; 601// kdDebug() << "KODayMatrix::dropEvent(e) begin" << endl;
602 602
603 if (!mCalendar || !ICalDrag::canDecode( e ) && !VCalDrag::canDecode( e ) ) { 603 if (!mCalendar || !ICalDrag::canDecode( e ) && !VCalDrag::canDecode( e ) ) {
604 e->ignore(); 604 e->ignore();
605 return; 605 return;
606 } 606 }
607 607
608 DndFactory factory( mCalendar ); 608 DndFactory factory( mCalendar );
609 Event *event = factory.createDrop(e); 609 Event *event = factory.createDrop(e);
610 610
611 if (event) { 611 if (event) {
612 e->acceptAction(); 612 e->acceptAction();
613 613
614 Event *existingEvent = mCalendar->event(event->uid()); 614 Event *existingEvent = mCalendar->event(event->uid());
615 615
616 if(existingEvent) { 616 if(existingEvent) {
617 // uniquify event 617 // uniquify event
618 event->recreate(); 618 event->recreate();
619/* 619/*
620 KMessageBox::sorry(this, 620 KMessageBox::sorry(this,
621 i18n("Event already exists in this calendar."), 621 i18n("Event already exists in this calendar."),
622 i18n("Drop Event")); 622 i18n("Drop Event"));
623 delete event; 623 delete event;
624 return; 624 return;
625*/ 625*/
626 } 626 }
627// kdDebug() << "Drop new Event" << endl; 627// kdDebug() << "Drop new Event" << endl;
628 // Adjust date 628 // Adjust date
629 QDateTime start = event->dtStart(); 629 QDateTime start = event->dtStart();
630 QDateTime end = event->dtEnd(); 630 QDateTime end = event->dtEnd();
631 int duration = start.daysTo(end); 631 int duration = start.daysTo(end);
632 int idx = getDayIndexFrom(e->pos().x(), e->pos().y()); 632 int idx = getDayIndexFrom(e->pos().x(), e->pos().y());
633 633
634 start.setDate(days[idx]); 634 start.setDate(days[idx]);
635 end.setDate(days[idx].addDays(duration)); 635 end.setDate(days[idx].addDays(duration));
636 636
637 event->setDtStart(start); 637 event->setDtStart(start);
638 event->setDtEnd(end); 638 event->setDtEnd(end);
639 mCalendar->addEvent(event); 639 mCalendar->addEvent(event);
640 640
641 emit eventDropped(event); 641 emit eventDropped(event);
642 } else { 642 } else {
643// kdDebug() << "KODayMatrix::dropEvent(): Event from drop not decodable" << endl; 643// kdDebug() << "KODayMatrix::dropEvent(): Event from drop not decodable" << endl;
644 e->ignore(); 644 e->ignore();
645 } 645 }
646#endif 646#endif
647} 647}
648 648
649// ---------------------------------------------------------------------------- 649// ----------------------------------------------------------------------------
650// P A I N T E V E N T H A N D L I N G 650// P A I N T E V E N T H A N D L I N G
651// ---------------------------------------------------------------------------- 651// ----------------------------------------------------------------------------
652 652
653void KODayMatrix::paintEvent(QPaintEvent * pevent) 653void KODayMatrix::paintEvent(QPaintEvent * pevent)
654{ 654{
655 QRect sz = frameRect(); 655 QRect sz = frameRect();
656 if ( sz.width() <= 0 || sz.height() <= 0 ) 656 if ( sz.width() <= 0 || sz.height() <= 0 )
657 return; 657 return;
658 if ( mPendingUpdateBeforeRepaint ) { 658 if ( mPendingUpdateBeforeRepaint ) {
659 updateViewTimed(); 659 updateViewTimed();
660 mPendingUpdateBeforeRepaint = false; 660 mPendingUpdateBeforeRepaint = false;
661 } 661 }
662 if ( myPix.width() != sz.width() || myPix.height()!=sz.height() ) { 662 if ( myPix.width() != sz.width() || myPix.height()!=sz.height() ) {
663 myPix.resize(sz.size() ); 663 myPix.resize(sz.size() );
664 } 664 }
665 QPainter p(&myPix); 665 QPainter p(&myPix);
666 p.setFont(font()); 666 p.setFont(font());
667 667
668 668
669 int dheight = daysize.height(); 669 int dheight = daysize.height();
670 int dwidth = daysize.width(); 670 int dwidth = daysize.width();
671 int row,col; 671 int row,col;
672 int selw, selh; 672 int selw, selh;
673 int xyOff = frameWidth(); 673 int xyOff = frameWidth();
674 int colModulo = sz.width() % 7; 674 int colModulo = sz.width() % 7;
675 int rowModulo = sz.height() % 6; 675 int rowModulo = sz.height() % 6;
676 //qDebug("col %d row %d ",colModulo,rowModulo ); 676 //qDebug("col %d row %d ",colModulo,rowModulo );
677 677
678 bool isRTL = KOGlobals::self()->reverseLayout(); 678 bool isRTL = KOGlobals::self()->reverseLayout();
679 679
680 // draw background and topleft frame 680 // draw background and topleft frame
681 p.fillRect(pevent->rect(), mDefaultBackColor); 681 p.fillRect(pevent->rect(), mDefaultBackColor);
682 p.setPen(mDefaultTextColor); 682 p.setPen(mDefaultTextColor);
683 p.drawRect(0, 0, sz.width()+1, sz.height()+1); 683 p.drawRect(0, 0, sz.width()+1, sz.height()+1);
684 int mSelStartT = mSelStart; 684 int mSelStartT = mSelStart;
685 int mSelEndT = mSelEnd; 685 int mSelEndT = mSelEnd;
686 if ( mSelEndT >= NUMDAYS ) 686 if ( mSelEndT >= NUMDAYS )
687 mSelEndT = NUMDAYS-1; 687 mSelEndT = NUMDAYS-1;
688 // draw selected days with highlighted background color 688 // draw selected days with highlighted background color
689 if (mSelStart != NOSELECTION) { 689 if (mSelStart != NOSELECTION) {
690 bool skip = false; 690 bool skip = false;
691 if ( ! mouseDown ) { 691 if ( ! mouseDown ) {
692 int mo = days[20].month(); 692 int mo = days[20].month();
693 //qDebug("-- %d %d ", mSelStartT, mSelEndT); 693 //qDebug("-- %d %d ", mSelStartT, mSelEndT);
694 //qDebug("%d %d %d - d %d", mo, days[mSelStartT].month() , days[mSelEndT].month(), days[mSelEndT].day() ); 694 //qDebug("%d %d %d - d %d", mo, days[mSelStartT].month() , days[mSelEndT].month(), days[mSelEndT].day() );
695 int startMo = days[mSelStartT].month(); 695 int startMo = days[mSelStartT].month();
696 int endMo = days[mSelEndT].month(); 696 int endMo = days[mSelEndT].month();
697 if ( startMo == 12 && mo == 1 && endMo == 1 ) 697 if ( startMo == 12 && mo == 1 && endMo <= 2 )
698 startMo = 1; 698 startMo = 1;
699 if ( endMo == 1 && mo == 12 ) 699 if ( endMo == 1 && mo == 12 )
700 endMo = 12; 700 endMo = 12;
701 if ( (startMo > mo || endMo < mo) ) { 701 if ( (startMo > mo || endMo < mo) ) {
702 skip = true; 702 skip = true;
703 } else { 703 } else {
704 if ( days[mSelStartT].month() != mo ) { 704 if ( days[mSelStartT].month() != mo ) {
705 int add = days[mSelStartT].daysInMonth ()-days[mSelStartT].day(); 705 int add = days[mSelStartT].daysInMonth ()-days[mSelStartT].day();
706 mSelStartT += add +1; 706 mSelStartT += add +1;
707 } 707 }
708 if ( days[mSelEndT].month() != mo ) { 708 if ( days[mSelEndT].month() != mo ) {
709 int sub = days[mSelEndT].day(); 709 int sub = days[mSelEndT].day();
710 mSelEndT -= sub ; 710 mSelEndT -= sub ;
711 } 711 }
712 } 712 }
713 } 713 }
714 if ( ! skip ) { 714 if ( ! skip ) {
715 row = mSelStartT/7; 715 row = mSelStartT/7;
716 col = mSelStartT -row*7; 716 col = mSelStartT -row*7;
717 QColor selcol = KOPrefs::instance()->mHighlightColor; 717 QColor selcol = KOPrefs::instance()->mHighlightColor;
718 int addCol = 0; 718 int addCol = 0;
719 int addRow = 0; 719 int addRow = 0;
720 int addRow2 = 0; 720 int addRow2 = 0;
721 int addCol2 = 0; 721 int addCol2 = 0;
722 if (row == mSelEndT/7) { 722 if (row == mSelEndT/7) {
723 if ( rowModulo ) { 723 if ( rowModulo ) {
724 if ( row >= 6 - rowModulo ) 724 if ( row >= 6 - rowModulo )
725 addRow = row - 5 + rowModulo; 725 addRow = row - 5 + rowModulo;
726 } 726 }
727 if ( colModulo ) { 727 if ( colModulo ) {
728 int colt1 = mSelEndT%7; 728 int colt1 = mSelEndT%7;
729 //qDebug("colt1 %d ", colt1 ); 729 //qDebug("colt1 %d ", colt1 );
730 if ( colt1 >= 7 - colModulo ) 730 if ( colt1 >= 7 - colModulo )
731 addCol = colt1 - 7 + colModulo+1; 731 addCol = colt1 - 7 + colModulo+1;
732 int colt = mSelStartT%7; 732 int colt = mSelStartT%7;
733 if ( colt >= 7 - colModulo ) 733 if ( colt >= 7 - colModulo )
734 addCol2 = colt - 7 + colModulo; 734 addCol2 = colt - 7 + colModulo;
735 addCol -= addCol2; 735 addCol -= addCol2;
736 //qDebug("COL %d %d %d %d ",col , colt1 ,addCol ,addCol2 ); 736 //qDebug("COL %d %d %d %d ",col , colt1 ,addCol ,addCol2 );
737 } 737 }
738 // Single row selection 738 // Single row selection
739 if ( row == 0) 739 if ( row == 0)
740 addRow = 1; 740 addRow = 1;
741 p.fillRect(isRTL ? (7 - (mSelEndT-mSelStartT+1) - col)*dwidth : col*dwidth+1+addCol2, 741 p.fillRect(isRTL ? (7 - (mSelEndT-mSelStartT+1) - col)*dwidth : col*dwidth+1+addCol2,
742 row*dheight+addRow, (mSelEndT-mSelStartT+1)*dwidth+addCol, dheight+1, selcol); 742 row*dheight+addRow, (mSelEndT-mSelStartT+1)*dwidth+addCol, dheight+1, selcol);
743 } else { 743 } else {
744 // draw first row to the right 744 // draw first row to the right
745 if ( colModulo ) { 745 if ( colModulo ) {
746 if ( col >= 7 - colModulo ) 746 if ( col >= 7 - colModulo )
747 addCol2 = col - 7 + colModulo; 747 addCol2 = col - 7 + colModulo;
748 } 748 }
749 if ( rowModulo ) { 749 if ( rowModulo ) {
750 if ( row >= 6 - rowModulo ) 750 if ( row >= 6 - rowModulo )
751 addRow = row - 5 + rowModulo; 751 addRow = row - 5 + rowModulo;
752 } 752 }
753 if ( row == 0) 753 if ( row == 0)
754 addRow = 1; 754 addRow = 1;
755 p.fillRect(isRTL ? 0 : col*dwidth+1+addCol2, row*dheight+addRow, (7-col)*dwidth+colModulo, 755 p.fillRect(isRTL ? 0 : col*dwidth+1+addCol2, row*dheight+addRow, (7-col)*dwidth+colModulo,
756 dheight+1, selcol); 756 dheight+1, selcol);
757 // draw full block till last line 757 // draw full block till last line
758 selh = mSelEndT/7-row; 758 selh = mSelEndT/7-row;
759 addRow = 0; 759 addRow = 0;
760 if ( rowModulo ) { 760 if ( rowModulo ) {
761 if ( mSelEndT/7 >= 6 - rowModulo ) 761 if ( mSelEndT/7 >= 6 - rowModulo )
762 addRow = mSelEndT/7 - 5 + rowModulo; 762 addRow = mSelEndT/7 - 5 + rowModulo;
763 } 763 }
764 if (selh > 1) { 764 if (selh > 1) {
765 p.fillRect(1, (row+1)*dheight, 7*dwidth+colModulo, (selh-1)*dheight+addRow,selcol); 765 p.fillRect(1, (row+1)*dheight, 7*dwidth+colModulo, (selh-1)*dheight+addRow,selcol);
766 } 766 }
767 // draw last block from left to mSelEndT 767 // draw last block from left to mSelEndT
768 selw = mSelEndT-7*(mSelEndT/7)+1; 768 selw = mSelEndT-7*(mSelEndT/7)+1;
769 //qDebug("esl %d ",selw ); 769 //qDebug("esl %d ",selw );
770 int add = 0; 770 int add = 0;
771 if ( colModulo ) { 771 if ( colModulo ) {
772 add = 7 - colModulo; 772 add = 7 - colModulo;
773 if ( selw > add ) 773 if ( selw > add )
774 add = selw - add; 774 add = selw - add;
775 else 775 else
776 add = 0; 776 add = 0;
777 } 777 }
778 //qDebug("add %d ", add); 778 //qDebug("add %d ", add);
779 p.fillRect(isRTL ? (7-selw)*dwidth : 1, (row+selh)*dheight+addRow, 779 p.fillRect(isRTL ? (7-selw)*dwidth : 1, (row+selh)*dheight+addRow,
780 selw*dwidth+add, dheight+1, selcol); 780 selw*dwidth+add, dheight+1, selcol);
781 } 781 }
782 } 782 }
783 } 783 }
784 784
785 // iterate over all days in the matrix and draw the day label in appropriate colors 785 // iterate over all days in the matrix and draw the day label in appropriate colors
786 QColor actcol = mDefaultTextColorShaded; 786 QColor actcol = mDefaultTextColorShaded;
787 p.setPen(actcol); 787 p.setPen(actcol);
788 QPen tmppen; 788 QPen tmppen;
789 for(int i = 0; i < NUMDAYS; i++) { 789 for(int i = 0; i < NUMDAYS; i++) {
790 row = i/7; 790 row = i/7;
791 col = isRTL ? 6-(i-row*7) : i-row*7; 791 col = isRTL ? 6-(i-row*7) : i-row*7;
792 792
793 // if it is the first day of a month switch color from normal to shaded and vice versa 793 // if it is the first day of a month switch color from normal to shaded and vice versa
794 if ( KOGlobals::self()->calendarSystem()->day( days[i] ) == 1) { 794 if ( KOGlobals::self()->calendarSystem()->day( days[i] ) == 1) {
795 if (actcol == mDefaultTextColorShaded) { 795 if (actcol == mDefaultTextColorShaded) {
796 actcol = mDefaultTextColor; 796 actcol = mDefaultTextColor;
797 } else { 797 } else {
798 actcol = mDefaultTextColorShaded; 798 actcol = mDefaultTextColorShaded;
799 } 799 }
800 p.setPen(actcol); 800 p.setPen(actcol);
801 } 801 }
802 if (actcol == mDefaultTextColorShaded) { 802 if (actcol == mDefaultTextColorShaded) {
803 if ( ! mouseDown ) { 803 if ( ! mouseDown ) {
804 continue; 804 continue;
805 } 805 }
806 } 806 }
807 //Reset pen color after selected days block 807 //Reset pen color after selected days block
808 if (i == mSelEndT+1) { 808 if (i == mSelEndT+1) {
809 p.setPen(actcol); 809 p.setPen(actcol);
810 } 810 }
811 811
812 // if today then draw rectangle around day 812 // if today then draw rectangle around day
813 if (today == i) { 813 if (today == i) {
814 tmppen = p.pen(); 814 tmppen = p.pen();
815 QPen mTodayPen(p.pen()); 815 QPen mTodayPen(p.pen());
816 if ( daysize.width() < 20 ) 816 if ( daysize.width() < 20 )
817 mTodayPen.setWidth(1); 817 mTodayPen.setWidth(1);
818 else 818 else
819 mTodayPen.setWidth(mTodayMarginWidth); 819 mTodayPen.setWidth(mTodayMarginWidth);
820 //draw red rectangle for holidays 820 //draw red rectangle for holidays
821 if (!mHolidays[i].isNull()) { 821 if (!mHolidays[i].isNull()) {
822 if (actcol == mDefaultTextColor) { 822 if (actcol == mDefaultTextColor) {
823 mTodayPen.setColor(KOPrefs::instance()->mHolidayColor); 823 mTodayPen.setColor(KOPrefs::instance()->mHolidayColor);
824 } else { 824 } else {
825 mTodayPen.setColor(mHolidayColorShaded); 825 mTodayPen.setColor(mHolidayColorShaded);
826 } 826 }
827 } 827 }
828 //draw gray rectangle for today if in selection 828 //draw gray rectangle for today if in selection
829 if (i >= mSelStartT && i <= mSelEndT) { 829 if (i >= mSelStartT && i <= mSelEndT) {
830 QColor grey("grey"); 830 QColor grey("grey");
831 mTodayPen.setColor(grey); 831 mTodayPen.setColor(grey);
832 } 832 }
833 p.setPen(mTodayPen); 833 p.setPen(mTodayPen);
834 834
835 835
836 int addCol = 0; 836 int addCol = 0;
837 int addRow = 0; 837 int addRow = 0;
838 if (rowModulo) { 838 if (rowModulo) {
839 if ( row >= 6 - rowModulo ) 839 if ( row >= 6 - rowModulo )
840 addRow = row - 5 + rowModulo; 840 addRow = row - 5 + rowModulo;
841 } 841 }
842 if ( colModulo ) { 842 if ( colModulo ) {
843 if ( col >= 7 - colModulo ) 843 if ( col >= 7 - colModulo )
844 addCol = col - 6 + colModulo-1; 844 addCol = col - 6 + colModulo-1;
845 } 845 }
846 if ( col == 0 ) 846 if ( col == 0 )
847 addCol = 1; 847 addCol = 1;
848 p.drawRect(col*dwidth+addCol, row*dheight+addRow, dwidth, dheight+1); 848 p.drawRect(col*dwidth+addCol, row*dheight+addRow, dwidth, dheight+1);
849 p.setPen(tmppen); 849 p.setPen(tmppen);
850 } 850 }
851 851
852 // if any events are on that day then draw it using a bold font 852 // if any events are on that day then draw it using a bold font
853 if (events[i] > 0) { 853 if (events[i] > 0) {
854 QFont myFont = font(); 854 QFont myFont = font();
855 myFont.setBold(true); 855 myFont.setBold(true);
856 p.setFont(myFont); 856 p.setFont(myFont);
857 } 857 }
858 858
859 // if it is a holiday then use the default holiday color 859 // if it is a holiday then use the default holiday color
860 if (!mHolidays[i].isNull()) { 860 if (!mHolidays[i].isNull()) {
861 if ( bDays.testBit(i) ) { 861 if ( bDays.testBit(i) ) {
862 p.setPen(Qt::green); 862 p.setPen(Qt::green);
863 } else { 863 } else {
864 if (actcol == mDefaultTextColor) { 864 if (actcol == mDefaultTextColor) {
865 p.setPen(KOPrefs::instance()->mHolidayColor); 865 p.setPen(KOPrefs::instance()->mHolidayColor);
866 } else { 866 } else {
867 p.setPen(mHolidayColorShaded); 867 p.setPen(mHolidayColorShaded);
868 } 868 }
869 } 869 }
870 } 870 }
871 871
872 // draw selected days with special color 872 // draw selected days with special color
873 // DO NOT specially highlight holidays in selection ! 873 // DO NOT specially highlight holidays in selection !
874 if (i >= mSelStartT && i <= mSelEndT) { 874 if (i >= mSelStartT && i <= mSelEndT) {
875 ;//p.setPen(mSelectedDaysColor); 875 ;//p.setPen(mSelectedDaysColor);
876 } 876 }
877 877
878 int addCol = 0; 878 int addCol = 0;
879 int addRow = 0; 879 int addRow = 0;
880 if ( colModulo ) { 880 if ( colModulo ) {
881 if ( col >= 7 - colModulo ) 881 if ( col >= 7 - colModulo )
882 addCol = col - 7 + colModulo; 882 addCol = col - 7 + colModulo;
883 } 883 }
884 if ( rowModulo ) { 884 if ( rowModulo ) {
885 if ( row >= 6 - rowModulo ) 885 if ( row >= 6 - rowModulo )
886 addRow = row - 5 + rowModulo; 886 addRow = row - 5 + rowModulo;
887 } 887 }
888 //qDebug("add %d %d -- %d %d ", col, addCol, row, addRow); 888 //qDebug("add %d %d -- %d %d ", col, addCol, row, addRow);
889 ++addCol;//++addCol; 889 ++addCol;//++addCol;