summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-02-02 11:10:03 (UTC)
committer zautrix <zautrix>2005-02-02 11:10:03 (UTC)
commit2a184b0d9095c6175e7bdf2f5d5561470b8d6307 (patch) (unidiff)
treeb988c963639547be3afc193eb8a223f9ca7f0254
parentd2f6c50fb3b236e37aaa46ade819ab163f19868a (diff)
downloadkdepimpi-2a184b0d9095c6175e7bdf2f5d5561470b8d6307.zip
kdepimpi-2a184b0d9095c6175e7bdf2f5d5561470b8d6307.tar.gz
kdepimpi-2a184b0d9095c6175e7bdf2f5d5561470b8d6307.tar.bz2
change
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/WhatsNew.txt2
-rw-r--r--korganizer/komonthview.cpp1
2 files changed, 3 insertions, 0 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt
index 9f34d38..4f8fcc7 100644
--- a/bin/kdepim/WhatsNew.txt
+++ b/bin/kdepim/WhatsNew.txt
@@ -1,200 +1,202 @@
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.2 ************ 3********** VERSION 2.0.2 ************
4 4
5KO/Pi: 5KO/Pi:
6Fixed the layout problem of the day label buttons 6Fixed the layout problem of the day label buttons
7of the agenda view introduced in version 2.0.1. 7of the agenda view introduced in version 2.0.1.
8 8
9Added WhatsThis support for the todo view and the list view.
10
9Added a quite useful and quite hidden feature (to KO/Pi). 11Added a quite useful and quite hidden feature (to KO/Pi).
10Who does find it first? 12Who does find it first?
11Hint: You have to click somewhere in the views ... 13Hint: You have to click somewhere in the views ...
12 14
13 15
14********** VERSION 2.0.1 ************ 16********** VERSION 2.0.1 ************
15 17
16Oooops ... I forgot to test on the Zaurus 5500 ... 18Oooops ... I forgot to test on the Zaurus 5500 ...
17 19
18Fixed many problems of new (english) strings (and german translations) 20Fixed many problems of new (english) strings (and german translations)
19introduced in the latest versions, where the text was not fitting on the 21introduced in the latest versions, where the text was not fitting on the
20240x320 display of the Zaurus 5500. 22240x320 display of the Zaurus 5500.
21 23
22KO/Pi: 24KO/Pi:
23Added a popup menu ( press pen and hold to get popup ) to the agenda view 25Added a popup menu ( press pen and hold to get popup ) to the agenda view
24with many useful items (add event/todo, show next week, two weeks, month, journal). 26with many useful items (add event/todo, show next week, two weeks, month, journal).
25 27
26Added items to the todolist popup menu for: 28Added items to the todolist popup menu for:
27Display all opened, all closed or all todos flat. 29Display all opened, all closed or all todos flat.
28The "flat" view makes is possible to sort all todos after ,e.g., prio or date. 30The "flat" view makes is possible to sort all todos after ,e.g., prio or date.
29Made the reparenting of todos on the desktop possible via Drag&Drop. 31Made the reparenting of todos on the desktop possible via Drag&Drop.
30Fixed several bugs in setting the completed datetime for todos. 32Fixed several bugs in setting the completed datetime for todos.
31Added info about completed datetime of todos to the todo viewer. 33Added info about completed datetime of todos to the todo viewer.
32Now displaying a completed todo (with completed datetime set) in the agenda view 34Now displaying a completed todo (with completed datetime set) in the agenda view
33at the time of the completion. Such that now it is possible to see in the agenda view 35at the time of the completion. Such that now it is possible to see in the agenda view
34when what todo was completed. 36when what todo was completed.
35Fixed behaviour of automatic setting completion of todos with sub-todos/parent todos. 37Fixed behaviour of automatic setting completion of todos with sub-todos/parent todos.
36Now the behaviour is: 38Now the behaviour is:
37Setting a parent to complete sets all (sub)childs to complete. 39Setting a parent to complete sets all (sub)childs to complete.
38Setting a parent to uncomplete does not change the childs. 40Setting a parent to uncomplete does not change the childs.
39Setting a child to uncomplete sets all parent to uncomplete. 41Setting a child to uncomplete sets all parent to uncomplete.
40Setting a child to complete does not change the parents. 42Setting a child to complete does not change the parents.
41 43
42Smart updating and double buffering of the daymatrix. 44Smart updating and double buffering of the daymatrix.
43Showing holidays in the day matrix. 45Showing holidays in the day matrix.
44Many other small performance updates. 46Many other small performance updates.
45 47
46Made day labels in agenda clickable. By clicking a label, the day is displayed in single day mode. 48Made day labels in agenda clickable. By clicking a label, the day is displayed in single day mode.
47 49
48Now the translation file usertranslation.txt is supposed to be in utf8 format. 50Now the translation file usertranslation.txt is supposed to be in utf8 format.
49If 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. 51If 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.
50 52
51 53
52********** VERSION 2.0.0 ************ 54********** VERSION 2.0.0 ************
53 55
54Stable release 2.0.0! 56Stable release 2.0.0!
55 57
56KO/Pi: 58KO/Pi:
57Fixed problem in edit dialog recreation at startup. 59Fixed problem in edit dialog recreation at startup.
58Made "toggle view*" menu items enabled context sensitive. 60Made "toggle view*" menu items enabled context sensitive.
59Changed agenda size menu to items 1-10. 61Changed agenda size menu to items 1-10.
60Made it possible to change agenda size quickly by pressing mouse on timelabels in agenda view and move mouse up/down. 62Made it possible to change agenda size quickly by pressing mouse on timelabels in agenda view and move mouse up/down.
61Usebility enhancements in the KO/Pi menus. 63Usebility enhancements in the KO/Pi menus.
62Birthday import now adds year to summary. 64Birthday import now adds year to summary.
63What's Next view shows age in years for birthday. 65What's Next view shows age in years for birthday.
64 66
65OM/Pi: 67OM/Pi:
66Added three info lines to display subject, from and to of selected mails. 68Added three info lines to display subject, from and to of selected mails.
67 69
68KA/Pi: 70KA/Pi:
69Fixed jump bar behaviour on Zaurus. 71Fixed jump bar behaviour on Zaurus.
70Now KA/Pi search field supports searching for a range of starting characters. 72Now KA/Pi search field supports searching for a range of starting characters.
71E.g. to search for all contact beginning with b to n, type 73E.g. to search for all contact beginning with b to n, type
72b-n 74b-n
73in the search field. 75in the search field.
74 76
75********** VERSION 1.9.20 ************ 77********** VERSION 1.9.20 ************
76 78
77KO/Pi: 79KO/Pi:
78Added for the "dislplay one day" agenda mode 80Added for the "dislplay one day" agenda mode
79info in the caption and in the day lables: 81info in the caption and in the day lables:
80Now it is displayed, if the selected day is from "day before yesterday" 82Now it is displayed, if the selected day is from "day before yesterday"
81to "day after tomorrow". 83to "day after tomorrow".
82Made it possible to delete a Todo, which has sub-todos. 84Made it possible to delete a Todo, which has sub-todos.
83Fixed two small problems in the todo view. 85Fixed two small problems in the todo view.
84Added missing German translation for filter edit and print dialog. 86Added missing German translation for filter edit and print dialog.
85Made search dialog closeable by cancel key. 87Made search dialog closeable by cancel key.
86 88
87Made it possible to select in the date picker the (ligt grey ) 89Made it possible to select in the date picker the (ligt grey )
88dates of the prev./next month with the mouse. 90dates of the prev./next month with the mouse.
89 91
90OM/Pi: 92OM/Pi:
91"Delete mail" icon in main window now deletes all selected mails. 93"Delete mail" icon in main window now deletes all selected mails.
92Fixed the problem, that the state flag of imap mails was ignored. 94Fixed the problem, that the state flag of imap mails was ignored.
93Now mails with "FLAG_SEEN" on the imap server get no icon in the list view 95Now mails with "FLAG_SEEN" on the imap server get no icon in the list view
94to indecate that they are already seen. 96to indecate that they are already seen.
95Fixed the problem that the body of some mails was not displayed in the 97Fixed the problem that the body of some mails was not displayed in the
96mail viewer when fetching them from the imap server directly to read them. 98mail viewer when fetching them from the imap server directly to read them.
97Made it (configurable) possible to show the "To:" field in the list view. 99Made it (configurable) possible to show the "To:" field in the list view.
98Added to the mail viewer the option "View Source" to make it possible to see the raw mail data. 100Added to the mail viewer the option "View Source" to make it possible to see the raw mail data.
99Added a "Download Mail" button to the mail viewer to quickly download the viewed mail to the 101Added a "Download Mail" button to the mail viewer to quickly download the viewed mail to the
100local storage folder (specified in account settings) of the account of the mail. 102local storage folder (specified in account settings) of the account of the mail.
101Removed some memory leaks in OM/Pi. 103Removed some memory leaks in OM/Pi.
102 104
103 105
104********** VERSION 1.9.19 ************ 106********** VERSION 1.9.19 ************
105 107
106Added a lot of missing translations to KA/Pi, 108Added a lot of missing translations to KA/Pi,
107Added some missing translations to KO/Pi and OM/Pi. 109Added some missing translations to KO/Pi and OM/Pi.
108 110
109Fixed some minor problems in KA/Pi + KO/Pi. 111Fixed some minor problems in KA/Pi + KO/Pi.
110 112
111Fixed a crash when closing PwM/Pi. 113Fixed a crash when closing PwM/Pi.
112Added German translation for PwM/Pi. 114Added German translation for PwM/Pi.
113 115
114Made view change and Month View update faster in KO/Pi. 116Made view change and Month View update faster in KO/Pi.
115 117
116 118
117********** VERSION 1.9.18 ************ 119********** VERSION 1.9.18 ************
118 120
119FYI: The VERSION 1.9.17 was a testing release only. 121FYI: The VERSION 1.9.17 was a testing release only.
120Please read the changelog of VERSION 1.9.17 as well. 122Please read the changelog of VERSION 1.9.17 as well.
121 123
122Cleaned up the syncing config dialog. 124Cleaned up the syncing config dialog.
123Added sync config options for date range for events. 125Added sync config options for date range for events.
124Added sync config options for filters on incoming data. 126Added sync config options for filters on incoming data.
125Added sync config options for filters on outgoing data. 127Added sync config options for filters on outgoing data.
126Please read the updated SyncHowTo about the new filter settings. 128Please read the updated SyncHowTo about the new filter settings.
127These filter settings make it now possible to sync with shared 129These filter settings make it now possible to sync with shared
128calendars without writing back private or confidential data 130calendars without writing back private or confidential data
129(via the outgoing filters). 131(via the outgoing filters).
130To sync only with particular parts of a shared calendar, 132To sync only with particular parts of a shared calendar,
131the incoming filter settings can be used. 133the incoming filter settings can be used.
132An example can be found in the SyncHowTo. 134An example can be found in the SyncHowTo.
133Same for shared addressbooks. 135Same for shared addressbooks.
134 136
135Added a setting for the global kdepim data storage. 137Added a setting for the global kdepim data storage.
136Usually the data is stored in (yourhomedir/kdepim). 138Usually the data is stored in (yourhomedir/kdepim).
137Now you can set in the Global config dialog TAB, subTAB "Data storage path" 139Now you can set in the Global config dialog TAB, subTAB "Data storage path"
138a directory where all the kdepim data is stored. 140a directory where all the kdepim data is stored.
139That makes it easy to save all kdepim data on a SD card on the Z, for example. 141That makes it easy to save all kdepim data on a SD card on the Z, for example.
140 142
141KO/Pi: 143KO/Pi:
142The timeedit input has a pulldown list for times. 144The timeedit input has a pulldown list for times.
143If opened, this pulldown list should now has the right time highlighted. 145If opened, this pulldown list should now has the right time highlighted.
144Added the possibility to exclude events/todos/journals in a filter. 146Added the possibility to exclude events/todos/journals in a filter.
145You should exclude journals, if you do not want them to sync with a public calendar. 147You should exclude journals, if you do not want them to sync with a public calendar.
146 148
147KA/Pi: 149KA/Pi:
148Added the possibility to in/exclude public/private/confidential contacts to a filter. 150Added the possibility to in/exclude public/private/confidential contacts to a filter.
149If you have already defined filterrules in KA/Pi you have to adjust them all by setting the "include public/private/confidential" property manually. Sorry for that ... 151If you have already defined filterrules in KA/Pi you have to adjust them all by setting the "include public/private/confidential" property manually. Sorry for that ...
150Added printing of card view and details view on desktop. 152Added printing of card view and details view on desktop.
151Printing of list view is not working... 153Printing of list view is not working...
152Added button for removing pictures in contact editor. 154Added button for removing pictures in contact editor.
153Parsing data fix of KA/Pi version 1.9.17. 155Parsing data fix of KA/Pi version 1.9.17.
154Fixed the "parse name automatically" problem of KA/Pi version 1.9.17. 156Fixed the "parse name automatically" problem of KA/Pi version 1.9.17.
155Fixed some syncing merging problems. 157Fixed some syncing merging problems.
156 158
157 159
158********** VERSION 1.9.17 ************ 160********** VERSION 1.9.17 ************
159 161
160KO/Pi: 162KO/Pi:
161Fixed that tooltips were not updated after moving an item in agenda view. 163Fixed that tooltips were not updated after moving an item in agenda view.
162Fixed a bug in sorting start date for recurring events in list view. 164Fixed a bug in sorting start date for recurring events in list view.
163Changed the left button in todo viewer from "Agenda" to "Set completed". 165Changed the left button in todo viewer from "Agenda" to "Set completed".
164This makes it possible to change a todo in the What's Next View quickly to the completed state without leaving the What's Next View. 166This makes it possible to change a todo in the What's Next View quickly to the completed state without leaving the What's Next View.
165Added more info in the todo viewer: Startdate, parent/sub todos. 167Added more info in the todo viewer: Startdate, parent/sub todos.
166 168
167 169
168KA/Pi: 170KA/Pi:
169All fields search does now actually search all the (possible) fields, 171All fields search does now actually search all the (possible) fields,
170not only those listed in the contact list. 172not only those listed in the contact list.
171Made is possible to inline a picture in a vcard on the Z. 173Made is possible to inline a picture in a vcard on the Z.
172This was only possible on the desktop, now is it possible on the Z as well. 174This was only possible on the desktop, now is it possible on the Z as well.
173Fixed of missing save settings after filter configuration. 175Fixed of missing save settings after filter configuration.
174Made saving of addressbook much faster. 176Made saving of addressbook much faster.
175Fixed extension widget layout problem. 177Fixed extension widget layout problem.
176Fixed saving of default formatted name settings. 178Fixed saving of default formatted name settings.
177Fixed formatted name handling in edit dialog. 179Fixed formatted name handling in edit dialog.
178Added an option for changing formatted names of many contacts 180Added an option for changing formatted names of many contacts
179(menu: File - Change - Set formatted name). 181(menu: File - Change - Set formatted name).
180 182
181QWhatsThis was not working on the Z ( only black rectangle was shown). 183QWhatsThis was not working on the Z ( only black rectangle was shown).
182This is Fixed. 184This is Fixed.
183 185
184KDE-Sync: 186KDE-Sync:
185Now readonly KDE resources are synced as well. 187Now readonly KDE resources are synced as well.
186(They are not changed in KDE itself, of course). 188(They are not changed in KDE itself, of course).
187 189
188 190
189 191
190********** VERSION 1.9.16 ************ 192********** VERSION 1.9.16 ************
191 193
192KO/Pi: 194KO/Pi:
193Fixed search dialog size on Z 6000 (480x640 display). 195Fixed search dialog size on Z 6000 (480x640 display).
194Added setting to hide/show time in agenda items. 196Added setting to hide/show time in agenda items.
195Added setting to hide not running todos in todo view. 197Added setting to hide not running todos in todo view.
196Added columns for start date/time in todo view. 198Added columns for start date/time in todo view.
197Replaced the solid half-hour lines in agenda view by dot lines. 199Replaced the solid half-hour lines in agenda view by dot lines.
198Added possibility of printing the What's Next View on the desktop 200Added possibility of printing the What's Next View on the desktop
199(i.e. Windows and Linux). 201(i.e. Windows and Linux).
200Fixed a crash in KO/Pi when starting KO/Pi with What's Next view. 202Fixed a crash in KO/Pi when starting KO/Pi with What's Next view.
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp
index 0ef5ae4..00b1e92 100644
--- a/korganizer/komonthview.cpp
+++ b/korganizer/komonthview.cpp
@@ -618,384 +618,385 @@ void MonthViewCell::updateConfig()
618 setFont( KOPrefs::instance()->mMonthViewFont ); 618 setFont( KOPrefs::instance()->mMonthViewFont );
619 619
620 QFontMetrics fm( font() ); 620 QFontMetrics fm( font() );
621 mLabelSize = fm.size( 0, "30" ) + QSize( 4, 2 ); 621 mLabelSize = fm.size( 0, "30" ) + QSize( 4, 2 );
622 mLabelBigSize = fm.size( 0, "Mag 30" ) + QSize( 2, 2 ); 622 mLabelBigSize = fm.size( 0, "Mag 30" ) + QSize( 2, 2 );
623 mHolidayPalette = mStandardPalette; 623 mHolidayPalette = mStandardPalette;
624 mPrimaryPalette = mStandardPalette; 624 mPrimaryPalette = mStandardPalette;
625 mNonPrimaryPalette = mStandardPalette; 625 mNonPrimaryPalette = mStandardPalette;
626 if ( KOPrefs::instance()->mMonthViewUsesDayColors ) { 626 if ( KOPrefs::instance()->mMonthViewUsesDayColors ) {
627 mHolidayPalette.setColor(QColorGroup::Base, KOPrefs::instance()->mMonthViewHolidayColor ); 627 mHolidayPalette.setColor(QColorGroup::Base, KOPrefs::instance()->mMonthViewHolidayColor );
628 mHolidayPalette.setColor(QColorGroup::Background, KOPrefs::instance()->mMonthViewHolidayColor ); 628 mHolidayPalette.setColor(QColorGroup::Background, KOPrefs::instance()->mMonthViewHolidayColor );
629 mHolidayPalette.setColor(QColorGroup::Foreground, KOPrefs::instance()->mMonthViewHolidayColor.dark()); 629 mHolidayPalette.setColor(QColorGroup::Foreground, KOPrefs::instance()->mMonthViewHolidayColor.dark());
630 mPrimaryPalette.setColor(QColorGroup::Foreground,KOPrefs::instance()->mMonthViewOddColor.dark()); 630 mPrimaryPalette.setColor(QColorGroup::Foreground,KOPrefs::instance()->mMonthViewOddColor.dark());
631 mPrimaryPalette.setColor(QColorGroup::Base,KOPrefs::instance()->mMonthViewOddColor); 631 mPrimaryPalette.setColor(QColorGroup::Base,KOPrefs::instance()->mMonthViewOddColor);
632 mPrimaryPalette.setColor(QColorGroup::Background,KOPrefs::instance()->mMonthViewOddColor); 632 mPrimaryPalette.setColor(QColorGroup::Background,KOPrefs::instance()->mMonthViewOddColor);
633 mNonPrimaryPalette.setColor(QColorGroup::Foreground,KOPrefs::instance()->mMonthViewEvenColor.dark()); 633 mNonPrimaryPalette.setColor(QColorGroup::Foreground,KOPrefs::instance()->mMonthViewEvenColor.dark());
634 mNonPrimaryPalette.setColor(QColorGroup::Base,KOPrefs::instance()->mMonthViewEvenColor); 634 mNonPrimaryPalette.setColor(QColorGroup::Base,KOPrefs::instance()->mMonthViewEvenColor);
635 mNonPrimaryPalette.setColor(QColorGroup::Background,KOPrefs::instance()->mMonthViewEvenColor); 635 mNonPrimaryPalette.setColor(QColorGroup::Background,KOPrefs::instance()->mMonthViewEvenColor);
636 } 636 }
637 //updateCell(); 637 //updateCell();
638} 638}
639 639
640void MonthViewCell::enableScrollBars( bool enabled ) 640void MonthViewCell::enableScrollBars( bool enabled )
641{ 641{
642 if ( enabled ) { 642 if ( enabled ) {
643 mItemList->setVScrollBarMode(QScrollView::Auto); 643 mItemList->setVScrollBarMode(QScrollView::Auto);
644 mItemList->setHScrollBarMode(QScrollView::Auto); 644 mItemList->setHScrollBarMode(QScrollView::Auto);
645 } else { 645 } else {
646 mItemList->setVScrollBarMode(QScrollView::AlwaysOff); 646 mItemList->setVScrollBarMode(QScrollView::AlwaysOff);
647 mItemList->setHScrollBarMode(QScrollView::AlwaysOff); 647 mItemList->setHScrollBarMode(QScrollView::AlwaysOff);
648 } 648 }
649} 649}
650 650
651Incidence *MonthViewCell::selectedIncidence() 651Incidence *MonthViewCell::selectedIncidence()
652{ 652{
653 int index = mItemList->currentItem(); 653 int index = mItemList->currentItem();
654 if ( index < 0 ) return 0; 654 if ( index < 0 ) return 0;
655 655
656 MonthViewItem *item = 656 MonthViewItem *item =
657 static_cast<MonthViewItem *>( mItemList->item( index ) ); 657 static_cast<MonthViewItem *>( mItemList->item( index ) );
658 658
659 if ( !item ) return 0; 659 if ( !item ) return 0;
660 660
661 return item->incidence(); 661 return item->incidence();
662} 662}
663 663
664QDate MonthViewCell::selectedIncidenceDate() 664QDate MonthViewCell::selectedIncidenceDate()
665{ 665{
666 QDate qd; 666 QDate qd;
667 int index = mItemList->currentItem(); 667 int index = mItemList->currentItem();
668 if ( index < 0 ) return qd; 668 if ( index < 0 ) return qd;
669 669
670 MonthViewItem *item = 670 MonthViewItem *item =
671 static_cast<MonthViewItem *>( mItemList->item( index ) ); 671 static_cast<MonthViewItem *>( mItemList->item( index ) );
672 672
673 if ( !item ) return qd; 673 if ( !item ) return qd;
674 674
675 return item->incidenceDate(); 675 return item->incidenceDate();
676} 676}
677 677
678void MonthViewCell::deselect() 678void MonthViewCell::deselect()
679{ 679{
680 mItemList->clearSelection(); 680 mItemList->clearSelection();
681 enableScrollBars( false ); 681 enableScrollBars( false );
682 // updateCell(); 682 // updateCell();
683} 683}
684void MonthViewCell::select() 684void MonthViewCell::select()
685{ 685{
686 ;// updateCell(); 686 ;// updateCell();
687} 687}
688 688
689void MonthViewCell::resizeEvent ( QResizeEvent * ) 689void MonthViewCell::resizeEvent ( QResizeEvent * )
690{ 690{
691 if ( !mMonthView->isUpdatePossible() ) 691 if ( !mMonthView->isUpdatePossible() )
692 return; 692 return;
693 693
694 int size = height() - mLabel->height() - 2; 694 int size = height() - mLabel->height() - 2;
695 if ( size > 0 ) 695 if ( size > 0 )
696 mItemList->verticalScrollBar()->setMaximumHeight( size ); 696 mItemList->verticalScrollBar()->setMaximumHeight( size );
697 size = width() - mLabel->width() -2; 697 size = width() - mLabel->width() -2;
698 if ( size > 0 ) 698 if ( size > 0 )
699 mItemList->horizontalScrollBar()->setMaximumWidth( size ); 699 mItemList->horizontalScrollBar()->setMaximumWidth( size );
700 mLabel->move( width()-mItemList->lineWidth() - mLabel->width(), height()-mItemList->lineWidth() - mLabel->height() ); 700 mLabel->move( width()-mItemList->lineWidth() - mLabel->width(), height()-mItemList->lineWidth() - mLabel->height() );
701 //mLabel->setMaximumWidth( width() - mItemList->lineWidth()*2); 701 //mLabel->setMaximumWidth( width() - mItemList->lineWidth()*2);
702} 702}
703 703
704void MonthViewCell::defaultAction( QListBoxItem *item ) 704void MonthViewCell::defaultAction( QListBoxItem *item )
705{ 705{
706 if ( !item ) return; 706 if ( !item ) return;
707 707
708 MonthViewItem *eventItem = static_cast<MonthViewItem *>( item ); 708 MonthViewItem *eventItem = static_cast<MonthViewItem *>( item );
709 Incidence *incidence = eventItem->incidence(); 709 Incidence *incidence = eventItem->incidence();
710 if ( incidence ) mMonthView->defaultAction( incidence ); 710 if ( incidence ) mMonthView->defaultAction( incidence );
711} 711}
712void MonthViewCell::showDay() 712void MonthViewCell::showDay()
713{ 713{
714 emit showDaySignal( date() ); 714 emit showDaySignal( date() );
715} 715}
716void MonthViewCell::newEvent() 716void MonthViewCell::newEvent()
717{ 717{
718 QDateTime dt( date(), QTime( KOPrefs::instance()->mStartTime, 0 ) ); 718 QDateTime dt( date(), QTime( KOPrefs::instance()->mStartTime, 0 ) );
719 emit newEventSignal( dt ); 719 emit newEventSignal( dt );
720} 720}
721void MonthViewCell::cellClicked( QListBoxItem *item ) 721void MonthViewCell::cellClicked( QListBoxItem *item )
722{ 722{
723 static QListBoxItem * lastClicked = 0; 723 static QListBoxItem * lastClicked = 0;
724 if ( item == 0 ) { 724 if ( item == 0 ) {
725 QDateTime dt( date(), QTime( KOPrefs::instance()->mStartTime, 0 ) ); 725 QDateTime dt( date(), QTime( KOPrefs::instance()->mStartTime, 0 ) );
726 emit newEventSignal( dt ); 726 emit newEventSignal( dt );
727 return; 727 return;
728 } 728 }
729 /* 729 /*
730 if ( lastClicked ) 730 if ( lastClicked )
731 if ( ! item ) { 731 if ( ! item ) {
732 if ( lastClicked->listBox() != item->listBox() ) 732 if ( lastClicked->listBox() != item->listBox() )
733 lastClicked->listBox()->clearSelection(); 733 lastClicked->listBox()->clearSelection();
734 } 734 }
735 */ 735 */
736 736
737 mMonthView->setSelectedCell( this ); 737 mMonthView->setSelectedCell( this );
738 if( KOPrefs::instance()->mEnableMonthScroll || KOPrefs::instance()->mMonthViewWeek ) enableScrollBars( true ); 738 if( KOPrefs::instance()->mEnableMonthScroll || KOPrefs::instance()->mMonthViewWeek ) enableScrollBars( true );
739 select(); 739 select();
740} 740}
741 741
742void MonthViewCell::contextMenu( QListBoxItem *item ) 742void MonthViewCell::contextMenu( QListBoxItem *item )
743{ 743{
744 if ( !item ) return; 744 if ( !item ) return;
745 745
746 MonthViewItem *eventItem = static_cast<MonthViewItem *>( item ); 746 MonthViewItem *eventItem = static_cast<MonthViewItem *>( item );
747 Incidence *incidence = eventItem->incidence(); 747 Incidence *incidence = eventItem->incidence();
748 if ( incidence ) mMonthView->showContextMenu( incidence ); 748 if ( incidence ) mMonthView->showContextMenu( incidence );
749} 749}
750 750
751void MonthViewCell::selection( QListBoxItem *item ) 751void MonthViewCell::selection( QListBoxItem *item )
752{ 752{
753 if ( !item ) return; 753 if ( !item ) return;
754 754
755 mMonthView->setSelectedCell( this ); 755 mMonthView->setSelectedCell( this );
756} 756}
757 757
758 758
759// ******************************************************************************* 759// *******************************************************************************
760// ******************************************************************************* 760// *******************************************************************************
761// ******************************************************************************* 761// *******************************************************************************
762 762
763 763
764KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) 764KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name)
765 : KOEventView( calendar, parent, name ), 765 : KOEventView( calendar, parent, name ),
766 mDaysPerWeek( 7 ), mNumWeeks( 6 ), mNumCells( mDaysPerWeek * mNumWeeks ), 766 mDaysPerWeek( 7 ), mNumWeeks( 6 ), mNumCells( mDaysPerWeek * mNumWeeks ),
767 mShortDayLabels( false ), mWidthLongDayLabel( 0 ), mSelectedCell( 0 ) 767 mShortDayLabels( false ), mWidthLongDayLabel( 0 ), mSelectedCell( 0 )
768{ 768{
769 mWeekStartsMonday = KGlobal::locale()->weekStartsMonday(); 769 mWeekStartsMonday = KGlobal::locale()->weekStartsMonday();
770 mShowWeekView = KOPrefs::instance()->mMonthViewWeek; 770 mShowWeekView = KOPrefs::instance()->mMonthViewWeek;
771 if ( mShowWeekView ) 771 if ( mShowWeekView )
772 mWeekStartsMonday = true; 772 mWeekStartsMonday = true;
773 updatePossible = false; 773 updatePossible = false;
774 mCells.setAutoDelete( true ); 774 mCells.setAutoDelete( true );
775 mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ; 775 mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ;
776 // mDayLayout = new QGridLayout( this ); 776 // mDayLayout = new QGridLayout( this );
777 // create the day of the week labels (Sun, Mon, etc) and add them to 777 // create the day of the week labels (Sun, Mon, etc) and add them to
778 // the layout. 778 // the layout.
779 mDayLabels.resize( mDaysPerWeek ); 779 mDayLabels.resize( mDaysPerWeek );
780 QFont bfont = font(); 780 QFont bfont = font();
781 if ( QApplication::desktop()->width() < 650 ) { 781 if ( QApplication::desktop()->width() < 650 ) {
782 bfont.setPointSize( bfont.pointSize() - 2 ); 782 bfont.setPointSize( bfont.pointSize() - 2 );
783 } 783 }
784 bfont.setBold( true ); 784 bfont.setBold( true );
785 int i; 785 int i;
786 786
787 for( i = 0; i < mDaysPerWeek; i++ ) { 787 for( i = 0; i < mDaysPerWeek; i++ ) {
788 QLabel *label = new QLabel( this ); 788 QLabel *label = new QLabel( this );
789 label->setFont(bfont); 789 label->setFont(bfont);
790 label->setFrameStyle(QFrame::Panel|QFrame::Raised); 790 label->setFrameStyle(QFrame::Panel|QFrame::Raised);
791 label->setLineWidth(1); 791 label->setLineWidth(1);
792 label->setAlignment(AlignCenter); 792 label->setAlignment(AlignCenter);
793 mDayLabels.insert( i, label ); 793 mDayLabels.insert( i, label );
794 } 794 }
795 795
796 bfont.setBold( false ); 796 bfont.setBold( false );
797 mWeekLabels.resize( mNumWeeks+1 ); 797 mWeekLabels.resize( mNumWeeks+1 );
798 for( i = 0; i < mNumWeeks+1; i++ ) { 798 for( i = 0; i < mNumWeeks+1; i++ ) {
799 KOWeekButton *label = new KOWeekButton( this ); 799 KOWeekButton *label = new KOWeekButton( this );
800 label->setFont(bfont); 800 label->setFont(bfont);
801 connect( label, SIGNAL( selectWeekNum ( int )),this, SIGNAL( selectWeekNum ( int )) ); 801 connect( label, SIGNAL( selectWeekNum ( int )),this, SIGNAL( selectWeekNum ( int )) );
802 label->setFlat(true); 802 label->setFlat(true);
803 QWhatsThis::add(label,i18n("Click on the week number to\nshow week in agenda view")); 803 QWhatsThis::add(label,i18n("Click on the week number to\nshow week in agenda view"));
804 //label->setFrameStyle(QFrame::Panel|QFrame::Raised); 804 //label->setFrameStyle(QFrame::Panel|QFrame::Raised);
805 //label->setLineWidth(1); 805 //label->setLineWidth(1);
806 //label->setAlignment(AlignCenter); 806 //label->setAlignment(AlignCenter);
807 mWeekLabels.insert( i, label ); 807 mWeekLabels.insert( i, label );
808 } 808 }
809 mWeekLabels[mNumWeeks]->setText( i18n("W")); 809 mWeekLabels[mNumWeeks]->setText( i18n("W"));
810 QWhatsThis::add(mWeekLabels[mNumWeeks],i18n("Click on this to\nswitch to week mode view"));
810 int row, col; 811 int row, col;
811 mCells.resize( mNumCells ); 812 mCells.resize( mNumCells );
812 for( row = 0; row < mNumWeeks; ++row ) { 813 for( row = 0; row < mNumWeeks; ++row ) {
813 for( col = 0; col < mDaysPerWeek; ++col ) { 814 for( col = 0; col < mDaysPerWeek; ++col ) {
814 MonthViewCell *cell = new MonthViewCell( this ); 815 MonthViewCell *cell = new MonthViewCell( this );
815 mCells.insert( row * mDaysPerWeek + col, cell ); 816 mCells.insert( row * mDaysPerWeek + col, cell );
816 817
817 connect( cell, SIGNAL( defaultAction( Incidence * ) ), 818 connect( cell, SIGNAL( defaultAction( Incidence * ) ),
818 SLOT( defaultAction( Incidence * ) ) ); 819 SLOT( defaultAction( Incidence * ) ) );
819 connect( cell, SIGNAL( newEventSignal( QDateTime ) ), 820 connect( cell, SIGNAL( newEventSignal( QDateTime ) ),
820 SIGNAL( newEventSignal( QDateTime ) ) ); 821 SIGNAL( newEventSignal( QDateTime ) ) );
821 connect( cell, SIGNAL( showDaySignal( QDate ) ), 822 connect( cell, SIGNAL( showDaySignal( QDate ) ),
822 SIGNAL( showDaySignal( QDate ) ) ); 823 SIGNAL( showDaySignal( QDate ) ) );
823 } 824 }
824 } 825 }
825 826
826 connect( mWeekLabels[mNumWeeks], SIGNAL( clicked() ), 827 connect( mWeekLabels[mNumWeeks], SIGNAL( clicked() ),
827 SLOT( switchView() ) ); 828 SLOT( switchView() ) );
828 mContextMenu = eventPopup(); 829 mContextMenu = eventPopup();
829 // updateConfig(); //useless here 830 // updateConfig(); //useless here
830 831
831 emit incidenceSelected( 0 ); 832 emit incidenceSelected( 0 );
832} 833}
833 834
834KOMonthView::~KOMonthView() 835KOMonthView::~KOMonthView()
835{ 836{
836 delete mContextMenu; 837 delete mContextMenu;
837} 838}
838void KOMonthView::switchView() 839void KOMonthView::switchView()
839{ 840{
840 if ( selectedCell( ) ) 841 if ( selectedCell( ) )
841 selectedCell()->deselect(); 842 selectedCell()->deselect();
842 mShowWeekView = !mShowWeekView; 843 mShowWeekView = !mShowWeekView;
843 KOPrefs::instance()->mMonthViewWeek = mShowWeekView; 844 KOPrefs::instance()->mMonthViewWeek = mShowWeekView;
844 emit showNavigator( !mShowWeekView ); 845 emit showNavigator( !mShowWeekView );
845 computeLayout(); 846 computeLayout();
846 updateConfig(); 847 updateConfig();
847} 848}
848 849
849int KOMonthView::maxDatesHint() 850int KOMonthView::maxDatesHint()
850{ 851{
851 return mNumCells; 852 return mNumCells;
852} 853}
853 854
854int KOMonthView::currentDateCount() 855int KOMonthView::currentDateCount()
855{ 856{
856 return mNumCells; 857 return mNumCells;
857} 858}
858 859
859QPtrList<Incidence> KOMonthView::selectedIncidences() 860QPtrList<Incidence> KOMonthView::selectedIncidences()
860{ 861{
861 QPtrList<Incidence> selected; 862 QPtrList<Incidence> selected;
862 863
863 if ( mSelectedCell ) { 864 if ( mSelectedCell ) {
864 Incidence *incidence = mSelectedCell->selectedIncidence(); 865 Incidence *incidence = mSelectedCell->selectedIncidence();
865 if ( incidence ) selected.append( incidence ); 866 if ( incidence ) selected.append( incidence );
866 } 867 }
867 868
868 return selected; 869 return selected;
869} 870}
870 871
871DateList KOMonthView::selectedDates() 872DateList KOMonthView::selectedDates()
872{ 873{
873 DateList selected; 874 DateList selected;
874 875
875 if ( mSelectedCell ) { 876 if ( mSelectedCell ) {
876 QDate qd = mSelectedCell->selectedIncidenceDate(); 877 QDate qd = mSelectedCell->selectedIncidenceDate();
877 if ( qd.isValid() ) selected.append( qd ); 878 if ( qd.isValid() ) selected.append( qd );
878 } 879 }
879 880
880 return selected; 881 return selected;
881} 882}
882 883
883void KOMonthView::printPreview(CalPrinter *calPrinter, const QDate &fd, 884void KOMonthView::printPreview(CalPrinter *calPrinter, const QDate &fd,
884 const QDate &td) 885 const QDate &td)
885{ 886{
886#ifndef KORG_NOPRINTER 887#ifndef KORG_NOPRINTER
887 calPrinter->preview(CalPrinter::Month, fd, td); 888 calPrinter->preview(CalPrinter::Month, fd, td);
888#endif 889#endif
889} 890}
890 891
891void KOMonthView::updateConfig() 892void KOMonthView::updateConfig()
892{ 893{
893 894
894 mWeekStartsMonday = KGlobal::locale()->weekStartsMonday(); 895 mWeekStartsMonday = KGlobal::locale()->weekStartsMonday();
895 896
896 if ( mShowWeekView ) 897 if ( mShowWeekView )
897 mWeekStartsMonday = true; 898 mWeekStartsMonday = true;
898 QFontMetrics fontmetric(mDayLabels[0]->font()); 899 QFontMetrics fontmetric(mDayLabels[0]->font());
899 mWidthLongDayLabel = 0; 900 mWidthLongDayLabel = 0;
900 901
901 for (int i = 0; i < 7; i++) { 902 for (int i = 0; i < 7; i++) {
902 int width = fontmetric.width(KOGlobals::self()->calendarSystem()->weekDayName(i+1)); 903 int width = fontmetric.width(KOGlobals::self()->calendarSystem()->weekDayName(i+1));
903 if ( width > mWidthLongDayLabel ) mWidthLongDayLabel = width; 904 if ( width > mWidthLongDayLabel ) mWidthLongDayLabel = width;
904 } 905 }
905 bool temp = mShowSatSunComp ; 906 bool temp = mShowSatSunComp ;
906 mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ; 907 mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ;
907 if ( temp != KOPrefs::instance()->mMonthViewSatSunTog ) 908 if ( temp != KOPrefs::instance()->mMonthViewSatSunTog )
908 computeLayout(); 909 computeLayout();
909 updateDayLabels(); 910 updateDayLabels();
910 //qDebug("KOMonthView::updateConfig() %d %d %d ",height(), mDayLabels[0]->sizeHint().height() ,mNumWeeks); 911 //qDebug("KOMonthView::updateConfig() %d %d %d ",height(), mDayLabels[0]->sizeHint().height() ,mNumWeeks);
911 int cellHeight = (height() - mDayLabels[0]->sizeHint().height()) /mNumWeeks; 912 int cellHeight = (height() - mDayLabels[0]->sizeHint().height()) /mNumWeeks;
912 //resizeEvent( 0 ); 913 //resizeEvent( 0 );
913 for (uint i = 0; i < mCells.count(); ++i) { 914 for (uint i = 0; i < mCells.count(); ++i) {
914 mCells[i]->updateConfig(); 915 mCells[i]->updateConfig();
915 } 916 }
916#ifdef DESKTOP_VERSION 917#ifdef DESKTOP_VERSION
917 MonthViewCell::toolTipGroup()->setEnabled(KOPrefs::instance()->mEnableToolTips); 918 MonthViewCell::toolTipGroup()->setEnabled(KOPrefs::instance()->mEnableToolTips);
918#endif 919#endif
919 updateView(); 920 updateView();
920} 921}
921 922
922void KOMonthView::updateDayLabels() 923void KOMonthView::updateDayLabels()
923{ 924{
924 925
925 for (int i = 0; i < 7; i++) { 926 for (int i = 0; i < 7; i++) {
926 if (mWeekStartsMonday) { 927 if (mWeekStartsMonday) {
927 bool show = mShortDayLabels; 928 bool show = mShortDayLabels;
928 if ( i > 4 && mShowSatSunComp && mWidthLongDayLabel > mDayLabels[i]->width() ) 929 if ( i > 4 && mShowSatSunComp && mWidthLongDayLabel > mDayLabels[i]->width() )
929 show = true; 930 show = true;
930 mDayLabels[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(i+1,show)); 931 mDayLabels[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(i+1,show));
931 } else { 932 } else {
932 if (i==0) mDayLabels[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(7,mShortDayLabels)); 933 if (i==0) mDayLabels[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(7,mShortDayLabels));
933 else mDayLabels[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(i,mShortDayLabels)); 934 else mDayLabels[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(i,mShortDayLabels));
934 935
935 } 936 }
936 } 937 }
937} 938}
938 939
939void KOMonthView::showDates(const QDate &start, const QDate &) 940void KOMonthView::showDates(const QDate &start, const QDate &)
940{ 941{
941 // kdDebug() << "KOMonthView::showDates(): " << start.toString() << endl; 942 // kdDebug() << "KOMonthView::showDates(): " << start.toString() << endl;
942 943
943 944
944 mStartDate = start; 945 mStartDate = start;
945 946
946 int startWeekDay = mWeekStartsMonday ? 1 : 7; 947 int startWeekDay = mWeekStartsMonday ? 1 : 7;
947 948
948 while( KOGlobals::self()->calendarSystem()->dayOfWeek(mStartDate) != startWeekDay ) { 949 while( KOGlobals::self()->calendarSystem()->dayOfWeek(mStartDate) != startWeekDay ) {
949 mStartDate = mStartDate.addDays( -1 ); 950 mStartDate = mStartDate.addDays( -1 );
950 } 951 }
951 952
952 bool primary = false; 953 bool primary = false;
953 uint i; 954 uint i;
954 for( i = 0; i < mCells.size(); ++i ) { 955 for( i = 0; i < mCells.size(); ++i ) {
955 QDate date = mStartDate.addDays( i ); 956 QDate date = mStartDate.addDays( i );
956 mCells[i]->setDate( date ); 957 mCells[i]->setDate( date );
957 958
958#ifndef KORG_NOPLUGINS 959#ifndef KORG_NOPLUGINS
959 // add holiday, if present 960 // add holiday, if present
960 QString hstring(KOCore::self()->holiday(date)); 961 QString hstring(KOCore::self()->holiday(date));
961 mCells[i]->setHoliday( hstring ); 962 mCells[i]->setHoliday( hstring );
962#endif 963#endif
963 964
964 } 965 }
965 QDate date = mStartDate.addDays( mWeekStartsMonday ? 3 : 4 ); 966 QDate date = mStartDate.addDays( mWeekStartsMonday ? 3 : 4 );
966 for( i = 0; i < 6; ++i ) { 967 for( i = 0; i < 6; ++i ) {
967 int wno; 968 int wno;
968 // remember, according to ISO 8601, the first week of the year is the 969 // remember, according to ISO 8601, the first week of the year is the
969 // first week that contains a thursday. Thus we must subtract off 4, 970 // first week that contains a thursday. Thus we must subtract off 4,
970 // not just 1. 971 // not just 1.
971 int dayOfYear = date.dayOfYear(); 972 int dayOfYear = date.dayOfYear();
972 if (dayOfYear % 7 != 0) 973 if (dayOfYear % 7 != 0)
973 wno = dayOfYear / 7 + 1; 974 wno = dayOfYear / 7 + 1;
974 else 975 else
975 wno =dayOfYear / 7; 976 wno =dayOfYear / 7;
976 mWeekLabels[i]->setWeekNum( wno ); 977 mWeekLabels[i]->setWeekNum( wno );
977 date = date.addDays( 7 ); 978 date = date.addDays( 7 );
978 } 979 }
979 updateView(); 980 updateView();
980} 981}
981 982
982void KOMonthView::showEvents(QPtrList<Event>) 983void KOMonthView::showEvents(QPtrList<Event>)
983{ 984{
984 qDebug("KOMonthView::selectEvents is not implemented yet. "); 985 qDebug("KOMonthView::selectEvents is not implemented yet. ");
985} 986}
986 987
987void KOMonthView::changeEventDisplay(Event *, int) 988void KOMonthView::changeEventDisplay(Event *, int)
988{ 989{
989 // this should be re-written to be much more efficient, but this 990 // this should be re-written to be much more efficient, but this
990 // quick-and-dirty-hack gets the job done for right now. 991 // quick-and-dirty-hack gets the job done for right now.
991 updateView(); 992 updateView();
992} 993}
993 994
994void KOMonthView::updateView() 995void KOMonthView::updateView()
995{ 996{
996 997
997 if ( !updatePossible ) 998 if ( !updatePossible )
998 return; 999 return;
999 //QTime ti; 1000 //QTime ti;
1000 //ti.start(); 1001 //ti.start();
1001#if 1 1002#if 1