author | zautrix <zautrix> | 2005-07-07 22:22:20 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-07-07 22:22:20 (UTC) |
commit | 876816e6582299d527610e847d259d2be6de403c (patch) (unidiff) | |
tree | 6683baf2835672d0d9b28b3cbbf90e84c398b835 | |
parent | 3fe323e4e63f3b7c1cf8c96093fa14fd63fb4efc (diff) | |
download | kdepimpi-876816e6582299d527610e847d259d2be6de403c.zip kdepimpi-876816e6582299d527610e847d259d2be6de403c.tar.gz kdepimpi-876816e6582299d527610e847d259d2be6de403c.tar.bz2 |
fixxx
-rw-r--r-- | bin/kdepim/WhatsNew.txt | 4 | ||||
-rw-r--r-- | korganizer/calendarview.cpp | 64 | ||||
-rw-r--r-- | korganizer/koagenda.cpp | 4 | ||||
-rw-r--r-- | korganizer/koagenda.h | 1 | ||||
-rw-r--r-- | korganizer/komonthview.cpp | 5 |
5 files changed, 17 insertions, 61 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt index 814c541..aa4a89a 100644 --- a/bin/kdepim/WhatsNew.txt +++ b/bin/kdepim/WhatsNew.txt | |||
@@ -1,41 +1,41 @@ | |||
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.1.14 ************ | 3 | ********** VERSION 2.1.14 ************ |
4 | 4 | ||
5 | Added some buttons to the KO/Pi Quick-todo line to make it possible to quickly access some todo view layout settings like display all flat/open/close and hide/show running/done. | 5 | Added some buttons to the KO/Pi Quick-todo line to make it possible to quickly access some todo view layout settings like display all flat/open/close and hide/show running/done. |
6 | Added a button to add a subtodo quickly. | 6 | Added a button to add a subtodo quickly. |
7 | 7 | ||
8 | Added a possibility to search for conflicting events. (In the Action menu. Keyboard shortcut "q" ). | 8 | Added a possibility to search for conflicting events. (In the Action menu. Keyboard shortcut "q", shift+q or ctrl +q ). |
9 | 9 | Added an option to change the layout of the list week to column mode. | |
10 | 10 | ||
11 | ********** VERSION 2.1.13 ************ | 11 | ********** VERSION 2.1.13 ************ |
12 | 12 | ||
13 | Fixed a problem in KA/Pi search. | 13 | Fixed a problem in KA/Pi search. |
14 | Fixed some minor problems in KO/Pi. | 14 | Fixed some minor problems in KO/Pi. |
15 | Added calendar selection possibility to the todo view popup and to the event/todo/journal editor. | 15 | Added calendar selection possibility to the todo view popup and to the event/todo/journal editor. |
16 | 16 | ||
17 | Fixed memory usage problems in KA/Pi: | 17 | Fixed memory usage problems in KA/Pi: |
18 | When loading data KA/Pi did load the file data twice. | 18 | When loading data KA/Pi did load the file data twice. |
19 | Example: | 19 | Example: |
20 | A 600k file did consume 1200k memory during loading process. | 20 | A 600k file did consume 1200k memory during loading process. |
21 | This is fixed, it does now consume only 600k during loading process. | 21 | This is fixed, it does now consume only 600k during loading process. |
22 | When saving data KA/Pi did consume a lot of memory for the data parsing during the save process. | 22 | When saving data KA/Pi did consume a lot of memory for the data parsing during the save process. |
23 | This is fixed. | 23 | This is fixed. |
24 | Example: | 24 | Example: |
25 | Before saving a 600k file KA/Pi did consume 21.7 Meg of Ram. | 25 | Before saving a 600k file KA/Pi did consume 21.7 Meg of Ram. |
26 | When saving KA/Pi did consume 28.6 Meg of Ram. That causes a crash on the Zaurus because there was no memeory left in the system. | 26 | When saving KA/Pi did consume 28.6 Meg of Ram. That causes a crash on the Zaurus because there was no memeory left in the system. |
27 | Now KA/Pi is consuming on saving the same data 22.0 Meg of Ram during the save process. | 27 | Now KA/Pi is consuming on saving the same data 22.0 Meg of Ram during the save process. |
28 | Note: The memory usage of KA/Pi after the data is loaded/saved has not changed. | 28 | Note: The memory usage of KA/Pi after the data is loaded/saved has not changed. |
29 | The saving of data may be a bit slower now. | 29 | The saving of data may be a bit slower now. |
30 | 30 | ||
31 | Fixed memory usage problems in KO/Pi: | 31 | Fixed memory usage problems in KO/Pi: |
32 | When KO/Pi did save the data to file, it did not release the used buffers after saving. | 32 | When KO/Pi did save the data to file, it did not release the used buffers after saving. |
33 | The used buffer was released after saving the next time, but there was new buffer space allocated again on that save operation. | 33 | The used buffer was released after saving the next time, but there was new buffer space allocated again on that save operation. |
34 | This is fixed. | 34 | This is fixed. |
35 | Example: | 35 | Example: |
36 | When saving a 400k file KO/Pi do now use 400k less memory now. | 36 | When saving a 400k file KO/Pi do now use 400k less memory now. |
37 | 37 | ||
38 | Optimized memory usage in KO/Pi Agenda view: | 38 | Optimized memory usage in KO/Pi Agenda view: |
39 | KO/Pi is storing some paint information in extra buffers for faster repainting of the agenda view. | 39 | KO/Pi is storing some paint information in extra buffers for faster repainting of the agenda view. |
40 | These buffers were not made smaller (i.e. downsized) because of performance reasons. | 40 | These buffers were not made smaller (i.e. downsized) because of performance reasons. |
41 | The handling of these buffers are now much smarter: | 41 | The handling of these buffers are now much smarter: |
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 426e8f9..2582931 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -75,64 +75,65 @@ | |||
75 | #include <libkcal/calfilter.h> | 75 | #include <libkcal/calfilter.h> |
76 | #include <libkcal/attendee.h> | 76 | #include <libkcal/attendee.h> |
77 | #include <libkcal/dndfactory.h> | 77 | #include <libkcal/dndfactory.h> |
78 | #include <libkcal/freebusy.h> | 78 | #include <libkcal/freebusy.h> |
79 | #include <libkcal/filestorage.h> | 79 | #include <libkcal/filestorage.h> |
80 | #include <libkcal/calendarresources.h> | 80 | #include <libkcal/calendarresources.h> |
81 | #include <libkcal/qtopiaformat.h> | 81 | #include <libkcal/qtopiaformat.h> |
82 | #include "../kalarmd/alarmdialog.h" | 82 | #include "../kalarmd/alarmdialog.h" |
83 | 83 | ||
84 | #ifndef DESKTOP_VERSION | 84 | #ifndef DESKTOP_VERSION |
85 | #include <libkcal/sharpformat.h> | 85 | #include <libkcal/sharpformat.h> |
86 | #include <externalapphandler.h> | 86 | #include <externalapphandler.h> |
87 | #endif | 87 | #endif |
88 | #include <libkcal/phoneformat.h> | 88 | #include <libkcal/phoneformat.h> |
89 | #ifndef KORG_NOMAIL | 89 | #ifndef KORG_NOMAIL |
90 | #include "komailclient.h" | 90 | #include "komailclient.h" |
91 | #endif | 91 | #endif |
92 | #ifndef KORG_NOPRINTER | 92 | #ifndef KORG_NOPRINTER |
93 | #include "calprinter.h" | 93 | #include "calprinter.h" |
94 | #endif | 94 | #endif |
95 | #ifndef KORG_NOPLUGINS | 95 | #ifndef KORG_NOPLUGINS |
96 | #include "kocore.h" | 96 | #include "kocore.h" |
97 | #endif | 97 | #endif |
98 | #include "koeventeditor.h" | 98 | #include "koeventeditor.h" |
99 | #include "kotodoeditor.h" | 99 | #include "kotodoeditor.h" |
100 | #include "koprefs.h" | 100 | #include "koprefs.h" |
101 | #include "koeventviewerdialog.h" | 101 | #include "koeventviewerdialog.h" |
102 | #include "publishdialog.h" | 102 | #include "publishdialog.h" |
103 | #include "kofilterview.h" | 103 | #include "kofilterview.h" |
104 | #include "koglobals.h" | 104 | #include "koglobals.h" |
105 | #include "koviewmanager.h" | 105 | #include "koviewmanager.h" |
106 | #include "koagendaview.h" | 106 | #include "koagendaview.h" |
107 | #include "koagenda.h" | ||
107 | #include "kodialogmanager.h" | 108 | #include "kodialogmanager.h" |
108 | #include "outgoingdialog.h" | 109 | #include "outgoingdialog.h" |
109 | #include "incomingdialog.h" | 110 | #include "incomingdialog.h" |
110 | #include "datenavigatorcontainer.h" | 111 | #include "datenavigatorcontainer.h" |
111 | #include "statusdialog.h" | 112 | #include "statusdialog.h" |
112 | #include "kdatenavigator.h" | 113 | #include "kdatenavigator.h" |
113 | #include "kotodoview.h" | 114 | #include "kotodoview.h" |
114 | #include "datenavigator.h" | 115 | #include "datenavigator.h" |
115 | #include "resourceview.h" | 116 | #include "resourceview.h" |
116 | #include "navigatorbar.h" | 117 | #include "navigatorbar.h" |
117 | #include "searchdialog.h" | 118 | #include "searchdialog.h" |
118 | #include "mainwindow.h" | 119 | #include "mainwindow.h" |
119 | #include "categoryeditdialog.h" | 120 | #include "categoryeditdialog.h" |
120 | 121 | ||
121 | #include "calendarview.h" | 122 | #include "calendarview.h" |
122 | #ifndef DESKTOP_VERSION | 123 | #ifndef DESKTOP_VERSION |
123 | #include <qtopia/alarmserver.h> | 124 | #include <qtopia/alarmserver.h> |
124 | #endif | 125 | #endif |
125 | #ifndef _WIN32_ | 126 | #ifndef _WIN32_ |
126 | #include <stdlib.h> | 127 | #include <stdlib.h> |
127 | #include <stdio.h> | 128 | #include <stdio.h> |
128 | #include <unistd.h> | 129 | #include <unistd.h> |
129 | #else | 130 | #else |
130 | #include <qprocess.h> | 131 | #include <qprocess.h> |
131 | #endif | 132 | #endif |
132 | 133 | ||
133 | #ifdef DESKTOP_VERSION | 134 | #ifdef DESKTOP_VERSION |
134 | #include <kabc/stdaddressbook.h> | 135 | #include <kabc/stdaddressbook.h> |
135 | #endif | 136 | #endif |
136 | using namespace KOrg; | 137 | using namespace KOrg; |
137 | using namespace KCal; | 138 | using namespace KCal; |
138 | extern int globalFlagBlockAgenda; | 139 | extern int globalFlagBlockAgenda; |
@@ -634,178 +635,125 @@ void CalendarView::init() | |||
634 | mAlarmDialog->setSuspendTime( KOPrefs::instance()->mAlarmSuspendTime ); | 635 | mAlarmDialog->setSuspendTime( KOPrefs::instance()->mAlarmSuspendTime ); |
635 | 636 | ||
636 | 637 | ||
637 | #ifndef DESKTOP_VERSION | 638 | #ifndef DESKTOP_VERSION |
638 | //US listen for arriving address resultsets | 639 | //US listen for arriving address resultsets |
639 | connect(ExternalAppHandler::instance(), SIGNAL(receivedBirthdayListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)), | 640 | connect(ExternalAppHandler::instance(), SIGNAL(receivedBirthdayListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)), |
640 | this, SLOT(insertBirthdays(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&))); | 641 | this, SLOT(insertBirthdays(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&))); |
641 | #endif | 642 | #endif |
642 | mDateNavigator->setCalendar( mCalendar ); | 643 | mDateNavigator->setCalendar( mCalendar ); |
643 | } | 644 | } |
644 | 645 | ||
645 | 646 | ||
646 | CalendarView::~CalendarView() | 647 | CalendarView::~CalendarView() |
647 | { | 648 | { |
648 | // kdDebug() << "~CalendarView()" << endl; | 649 | // kdDebug() << "~CalendarView()" << endl; |
649 | //qDebug("CalendarView::~CalendarView() "); | 650 | //qDebug("CalendarView::~CalendarView() "); |
650 | delete mDialogManager; | 651 | delete mDialogManager; |
651 | delete mViewManager; | 652 | delete mViewManager; |
652 | delete mStorage; | 653 | delete mStorage; |
653 | delete mDateFrame ; | 654 | delete mDateFrame ; |
654 | delete mEventViewerDialog; | 655 | delete mEventViewerDialog; |
655 | //kdDebug() << "~CalendarView() done" << endl; | 656 | //kdDebug() << "~CalendarView() done" << endl; |
656 | } | 657 | } |
657 | void CalendarView::nextConflict( bool all, bool allday ) | 658 | void CalendarView::nextConflict( bool all, bool allday ) |
658 | { | 659 | { |
659 | 660 | ||
660 | QPtrList<Event> testlist = mCalendar->events(); | 661 | QPtrList<Event> testlist = mCalendar->events(); |
661 | Event * test = testlist.first(); | 662 | Event * test = testlist.first(); |
662 | while ( test ) { | 663 | while ( test ) { |
663 | test->setTagged( false ); | 664 | test->setTagged( false ); |
664 | test = testlist.next(); | 665 | test = testlist.next(); |
665 | } | 666 | } |
666 | QDateTime startDT = QDateTime (mNavigator->selectedDates().first().addDays(1), QTime ( 0,0,0)); | 667 | QTime st ( 0,0,0); |
668 | if ( mViewManager->currentView() == mViewManager->agendaView() ) | ||
669 | st = mViewManager->agendaView()->agenda()->getEndTime(); | ||
670 | //qDebug("time %s ", st.toString().latin1()); | ||
671 | QDateTime startDT = QDateTime (mNavigator->selectedDates().first(),st); | ||
667 | QDateTime conflict; | 672 | QDateTime conflict; |
668 | QDateTime retVal; | 673 | QDateTime retVal; |
669 | bool found = false; | 674 | bool found = false; |
670 | Event * cE = 0; | 675 | Event * cE = 0; |
671 | Event * cE2 = 0; | 676 | Event * cE2 = 0; |
672 | QPtrList<Event> testlist2 = testlist; | 677 | QPtrList<Event> testlist2 = testlist; |
673 | test = testlist.first(); | 678 | test = testlist.first(); |
674 | bool skip = false; | 679 | bool skip = false; |
675 | while ( test ) { | 680 | while ( test ) { |
676 | skip = false; | 681 | skip = false; |
677 | if ( !all ) skip = ( allday != test->doesFloat() ); | 682 | if ( !all ) skip = ( allday != test->doesFloat() ); |
678 | if ( !skip ) { | 683 | if ( !skip ) { |
679 | Event * test2 = testlist2.first(); | 684 | Event * test2 = testlist2.first(); |
680 | while ( test2 ) { | 685 | while ( test2 ) { |
681 | skip = false; | 686 | skip = false; |
682 | if ( !all ) skip = ( allday != test2->doesFloat() ); | 687 | if ( !all ) skip = ( allday != test2->doesFloat() ); |
683 | if ( !skip ) { | 688 | if ( !skip ) { |
684 | if ( !test2->isTagged() ) { | 689 | if ( !test2->isTagged() ) { |
685 | if ( test->isOverlapping ( test2, &retVal, &startDT ) ) { | 690 | if ( test->isOverlapping ( test2, &retVal, &startDT ) ) { |
686 | //qDebug("overlap "); | 691 | //qDebug("overlap "); |
687 | if ( ! found ) { | 692 | if ( ! found ) { |
688 | if ( retVal >= startDT ) { | 693 | if ( retVal >= startDT ) { |
689 | conflict = retVal; | 694 | conflict = retVal; |
690 | cE = test; | 695 | cE = test; |
691 | cE2 = test2; | 696 | cE2 = test2; |
692 | found = true; | 697 | found = true; |
693 | } | 698 | } |
694 | } else { | 699 | } else { |
695 | if ( retVal >= startDT && retVal < conflict ) { | 700 | if ( retVal >= startDT && retVal < conflict ) { |
696 | conflict = retVal; | 701 | conflict = retVal; |
697 | cE = test; | 702 | cE = test; |
698 | cE2 = test2; | 703 | cE2 = test2; |
699 | } | 704 | } |
700 | } | 705 | } |
701 | } | 706 | } |
702 | } | 707 | } |
703 | } | 708 | } |
704 | test2 = testlist2.next(); | 709 | test2 = testlist2.next(); |
705 | } | 710 | } |
706 | } | 711 | } |
707 | test->setTagged( true ); | 712 | test->setTagged( true ); |
708 | test = testlist.next(); | 713 | test = testlist.next(); |
709 | } | 714 | } |
710 | if ( found ) { | 715 | if ( found ) { |
711 | if ( mViewManager->currentView() != mViewManager->agendaView() || mNavigator->selectedDates().count() > 1 ) | 716 | if ( mViewManager->currentView() != mViewManager->agendaView() || mNavigator->selectedDates().count() > 1 ) |
712 | mViewManager->showDayView(); | 717 | mViewManager->showDayView(); |
713 | mNavigator->slotDaySelect( conflict.date() ); | 718 | mNavigator->slotDaySelect( conflict.date() ); |
714 | int hour = conflict.time().hour(); | 719 | int hour = conflict.time().hour(); |
715 | mViewManager->agendaView()->setStartHour( hour ); | 720 | mViewManager->agendaView()->setStartHour( hour ); |
716 | topLevelWidget()->setCaption( i18n("Conflict %1 <-> %2"). arg( cE->summary().left( 20 ) ).arg( cE2->summary().left( 20 ) ) ); | 721 | topLevelWidget()->setCaption( i18n("Conflict %1 <-> %2"). arg( cE->summary().left( 20 ) ).arg( cE2->summary().left( 20 ) ) ); |
717 | return; | 722 | return; |
718 | } | 723 | } |
719 | 724 | ||
720 | topLevelWidget()->setCaption( i18n("No conflict found") ); | 725 | topLevelWidget()->setCaption( i18n("No conflict found") ); |
721 | qDebug("No conflict found "); | 726 | qDebug("No conflict found "); |
722 | return; | 727 | return; |
723 | |||
724 | |||
725 | |||
726 | |||
727 | |||
728 | #if 0 | ||
729 | |||
730 | |||
731 | QDate end = start.addDays( 365*2); | ||
732 | while ( start < end ) { | ||
733 | QPtrList<Event> eventList = calendar()->events( start ); | ||
734 | Event * ev = eventList.first(); | ||
735 | QPtrList<Event> test = eventList; | ||
736 | while ( ev ) { | ||
737 | //qDebug("found %d on %s ", eventList.count(), start.toString().latin1()); | ||
738 | Event * t_ev = test.first(); | ||
739 | QDateTime es = ev->dtStart(); | ||
740 | QDateTime ee = ev->dtEnd(); | ||
741 | if ( ev->doesFloat() ) | ||
742 | ee = ee.addDays( 1 ); | ||
743 | if ( ! all ) { | ||
744 | if ( ev->doesFloat() != allday ) | ||
745 | t_ev = 0; | ||
746 | } | ||
747 | while ( t_ev ) { | ||
748 | bool skip = false; | ||
749 | if ( ! all ) { | ||
750 | if ( t_ev->doesFloat() != allday ) | ||
751 | skip = true; | ||
752 | } | ||
753 | if ( !skip && ev != t_ev ) { | ||
754 | QDateTime ets = t_ev->dtStart(); | ||
755 | QDateTime ete = t_ev->dtEnd(); | ||
756 | if ( t_ev->doesFloat() ) | ||
757 | ete = ete.addDays( 1 ); | ||
758 | //qDebug("test %s -- %s -------- %s -- %s ", es.toString().latin1() , ee.toString().latin1(), ets.toString().latin1() , ete.toString().latin1() ); | ||
759 | if ( es < ete && ets < ee ) { | ||
760 | if ( mViewManager->currentView() != mViewManager->agendaView() || mNavigator->selectedDates().count() > 1 ) | ||
761 | mViewManager->showDayView(); | ||
762 | mNavigator->slotDaySelect( start ); | ||
763 | int hour = es.time().hour(); | ||
764 | if ( ets > es ) | ||
765 | hour = ets.time().hour(); | ||
766 | mViewManager->agendaView()->setStartHour( hour ); | ||
767 | topLevelWidget()->setCaption( i18n("Conflict %1 <-> %2"). arg( ev->summary().left( 20 ) ).arg( t_ev->summary().left( 20 ) ) ); | ||
768 | return; | ||
769 | } | ||
770 | } | ||
771 | t_ev = test.next(); | ||
772 | } | ||
773 | ev = eventList.next(); | ||
774 | } | ||
775 | start = start.addDays( 1 ); | ||
776 | } | ||
777 | topLevelWidget()->setCaption( i18n("No conflict found within the next two years") ); | ||
778 | qDebug("No conflict found "); | ||
779 | #endif | ||
780 | } | 728 | } |
781 | 729 | ||
782 | void CalendarView::conflictAll() | 730 | void CalendarView::conflictAll() |
783 | { | 731 | { |
784 | nextConflict ( true, true ); | 732 | nextConflict ( true, true ); |
785 | } | 733 | } |
786 | void CalendarView::conflictAllday() | 734 | void CalendarView::conflictAllday() |
787 | { | 735 | { |
788 | nextConflict ( false, true ); | 736 | nextConflict ( false, true ); |
789 | } | 737 | } |
790 | void CalendarView::conflictNotAll() | 738 | void CalendarView::conflictNotAll() |
791 | { | 739 | { |
792 | nextConflict ( false, false ); | 740 | nextConflict ( false, false ); |
793 | } | 741 | } |
794 | 742 | ||
795 | void CalendarView::setCalReadOnly( int id, bool readO ) | 743 | void CalendarView::setCalReadOnly( int id, bool readO ) |
796 | { | 744 | { |
797 | if ( readO ) { | 745 | if ( readO ) { |
798 | emit save(); | 746 | emit save(); |
799 | } | 747 | } |
800 | mCalendar->setReadOnly( id, readO ); | 748 | mCalendar->setReadOnly( id, readO ); |
801 | } | 749 | } |
802 | void CalendarView::setScrollBarStep(int val ) | 750 | void CalendarView::setScrollBarStep(int val ) |
803 | { | 751 | { |
804 | #ifdef DESKTOP_VERSION | 752 | #ifdef DESKTOP_VERSION |
805 | mDateScrollBar->setLineStep ( val ); | 753 | mDateScrollBar->setLineStep ( val ); |
806 | #endif | 754 | #endif |
807 | } | 755 | } |
808 | void CalendarView::scrollBarValue(int val ) | 756 | void CalendarView::scrollBarValue(int val ) |
809 | { | 757 | { |
810 | #ifdef DESKTOP_VERSION | 758 | #ifdef DESKTOP_VERSION |
811 | if ( QApplication::desktop()->width() < 800 ) return; | 759 | if ( QApplication::desktop()->width() < 800 ) return; |
diff --git a/korganizer/koagenda.cpp b/korganizer/koagenda.cpp index b290020..779f12e 100644 --- a/korganizer/koagenda.cpp +++ b/korganizer/koagenda.cpp | |||
@@ -1604,64 +1604,68 @@ int KOAgenda::timeToY(const QTime &time) | |||
1604 | int timeMinutes = time.hour() * 60 + time.minute(); | 1604 | int timeMinutes = time.hour() * 60 + time.minute(); |
1605 | int Y = (timeMinutes + (minutesPerCell / 2)) / minutesPerCell; | 1605 | int Y = (timeMinutes + (minutesPerCell / 2)) / minutesPerCell; |
1606 | return Y; | 1606 | return Y; |
1607 | } | 1607 | } |
1608 | 1608 | ||
1609 | 1609 | ||
1610 | /* | 1610 | /* |
1611 | Return time corresponding to cell y coordinate. Coordinates are rounded to | 1611 | Return time corresponding to cell y coordinate. Coordinates are rounded to |
1612 | fit into the grid. | 1612 | fit into the grid. |
1613 | */ | 1613 | */ |
1614 | QTime KOAgenda::gyToTime(int gy) | 1614 | QTime KOAgenda::gyToTime(int gy) |
1615 | { | 1615 | { |
1616 | 1616 | ||
1617 | int secondsPerCell = 24 * 60 * 60/ mRows; | 1617 | int secondsPerCell = 24 * 60 * 60/ mRows; |
1618 | 1618 | ||
1619 | int timeSeconds = secondsPerCell * gy; | 1619 | int timeSeconds = secondsPerCell * gy; |
1620 | 1620 | ||
1621 | QTime time( 0, 0, 0 ); | 1621 | QTime time( 0, 0, 0 ); |
1622 | if ( timeSeconds < 24 * 60 * 60 ) { | 1622 | if ( timeSeconds < 24 * 60 * 60 ) { |
1623 | time = time.addSecs(timeSeconds); | 1623 | time = time.addSecs(timeSeconds); |
1624 | } else { | 1624 | } else { |
1625 | time.setHMS( 23, 59, 59 ); | 1625 | time.setHMS( 23, 59, 59 ); |
1626 | } | 1626 | } |
1627 | 1627 | ||
1628 | return time; | 1628 | return time; |
1629 | } | 1629 | } |
1630 | 1630 | ||
1631 | void KOAgenda::setStartHour(int startHour) | 1631 | void KOAgenda::setStartHour(int startHour) |
1632 | { | 1632 | { |
1633 | int startCell = startHour * mRows / 24; | 1633 | int startCell = startHour * mRows / 24; |
1634 | setContentsPos(0,startCell * gridSpacingY()); | 1634 | setContentsPos(0,startCell * gridSpacingY()); |
1635 | } | 1635 | } |
1636 | QTime KOAgenda::getEndTime() | ||
1637 | { | ||
1638 | return QTime ( (contentsY ()+viewport()->height())*24/contentsHeight ()+1,0,0); | ||
1639 | } | ||
1636 | void KOAgenda::hideUnused() | 1640 | void KOAgenda::hideUnused() |
1637 | { | 1641 | { |
1638 | // experimental only | 1642 | // experimental only |
1639 | // return; | 1643 | // return; |
1640 | KOAgendaItem *item; | 1644 | KOAgendaItem *item; |
1641 | for ( item=mUnusedItems.first(); item != 0; item=mUnusedItems.next() ) { | 1645 | for ( item=mUnusedItems.first(); item != 0; item=mUnusedItems.next() ) { |
1642 | item->hide(); | 1646 | item->hide(); |
1643 | } | 1647 | } |
1644 | } | 1648 | } |
1645 | 1649 | ||
1646 | 1650 | ||
1647 | KOAgendaItem *KOAgenda::getNewItem(Incidence * event,QDate qd, QWidget* view) | 1651 | KOAgendaItem *KOAgenda::getNewItem(Incidence * event,QDate qd, QWidget* view) |
1648 | { | 1652 | { |
1649 | 1653 | ||
1650 | KOAgendaItem *fi; | 1654 | KOAgendaItem *fi; |
1651 | for ( fi=mUnusedItems.first(); fi != 0; fi=mUnusedItems.next() ) { | 1655 | for ( fi=mUnusedItems.first(); fi != 0; fi=mUnusedItems.next() ) { |
1652 | if ( fi->incidence() == event ) { | 1656 | if ( fi->incidence() == event ) { |
1653 | mUnusedItems.remove(); | 1657 | mUnusedItems.remove(); |
1654 | fi->init( event, qd ); | 1658 | fi->init( event, qd ); |
1655 | return fi; | 1659 | return fi; |
1656 | } | 1660 | } |
1657 | } | 1661 | } |
1658 | fi=mUnusedItems.first(); | 1662 | fi=mUnusedItems.first(); |
1659 | if ( fi ) { | 1663 | if ( fi ) { |
1660 | mUnusedItems.remove(); | 1664 | mUnusedItems.remove(); |
1661 | fi->init( event, qd ); | 1665 | fi->init( event, qd ); |
1662 | return fi; | 1666 | return fi; |
1663 | } | 1667 | } |
1664 | // qDebug("new KOAgendaItem "); | 1668 | // qDebug("new KOAgendaItem "); |
1665 | 1669 | ||
1666 | KOAgendaItem* agendaItem = new KOAgendaItem( event, qd, view, mAllDayMode ); | 1670 | KOAgendaItem* agendaItem = new KOAgendaItem( event, qd, view, mAllDayMode ); |
1667 | agendaItem->installEventFilter(this); | 1671 | agendaItem->installEventFilter(this); |
diff --git a/korganizer/koagenda.h b/korganizer/koagenda.h index 0e3aed8..86cf2f4 100644 --- a/korganizer/koagenda.h +++ b/korganizer/koagenda.h | |||
@@ -98,64 +98,65 @@ class KOAgenda : public QScrollView | |||
98 | void changeColumns(int columns); | 98 | void changeColumns(int columns); |
99 | 99 | ||
100 | int columns() { return mColumns; } | 100 | int columns() { return mColumns; } |
101 | int rows() { return mRows; } | 101 | int rows() { return mRows; } |
102 | 102 | ||
103 | int gridSpacingX() const { return mGridSpacingX; } | 103 | int gridSpacingX() const { return mGridSpacingX; } |
104 | int gridSpacingY() const { return mGridSpacingY; } | 104 | int gridSpacingY() const { return mGridSpacingY; } |
105 | 105 | ||
106 | // virtual QSizePolicy sizePolicy() const; | 106 | // virtual QSizePolicy sizePolicy() const; |
107 | 107 | ||
108 | void clear(); | 108 | void clear(); |
109 | 109 | ||
110 | void clearSelection(); | 110 | void clearSelection(); |
111 | void hideUnused(); | 111 | void hideUnused(); |
112 | 112 | ||
113 | /** Calculates the minimum width */ | 113 | /** Calculates the minimum width */ |
114 | virtual int minimumWidth() const; | 114 | virtual int minimumWidth() const; |
115 | /** Update configuration from preference settings */ | 115 | /** Update configuration from preference settings */ |
116 | void updateConfig(); | 116 | void updateConfig(); |
117 | 117 | ||
118 | void checkScrollBoundaries(); | 118 | void checkScrollBoundaries(); |
119 | 119 | ||
120 | void setHolidayMask(QMemArray<bool> *); | 120 | void setHolidayMask(QMemArray<bool> *); |
121 | void setDateList(const DateList &selectedDates); | 121 | void setDateList(const DateList &selectedDates); |
122 | DateList dateList() const; | 122 | DateList dateList() const; |
123 | void drawContentsToPainter( QPainter* paint = 0, bool backgroundOnly = false); | 123 | void drawContentsToPainter( QPainter* paint = 0, bool backgroundOnly = false); |
124 | void finishUpdate(); | 124 | void finishUpdate(); |
125 | void printSelection(); | 125 | void printSelection(); |
126 | void storePosition(); | 126 | void storePosition(); |
127 | void restorePosition(); | 127 | void restorePosition(); |
128 | void setPopup( KOEventPopupMenu * p ) { mAllAgendaPopup = p; } | 128 | void setPopup( KOEventPopupMenu * p ) { mAllAgendaPopup = p; } |
129 | void shrinkPixmap(); | 129 | void shrinkPixmap(); |
130 | QTime getEndTime(); | ||
130 | 131 | ||
131 | public slots: | 132 | public slots: |
132 | void slotContentMove(int,int); | 133 | void slotContentMove(int,int); |
133 | void categoryChanged(Incidence * inc); | 134 | void categoryChanged(Incidence * inc); |
134 | void slotClearSelection(); | 135 | void slotClearSelection(); |
135 | void popupMenu(); | 136 | void popupMenu(); |
136 | void newItem( int ); | 137 | void newItem( int ); |
137 | void moveChild( QWidget *, int, int ); | 138 | void moveChild( QWidget *, int, int ); |
138 | void scrollUp(); | 139 | void scrollUp(); |
139 | void scrollDown(); | 140 | void scrollDown(); |
140 | void updateTodo( Todo * t, int , bool ); | 141 | void updateTodo( Todo * t, int , bool ); |
141 | void popupAlarm(); | 142 | void popupAlarm(); |
142 | 143 | ||
143 | void checkScrollBoundaries(int); | 144 | void checkScrollBoundaries(int); |
144 | 145 | ||
145 | /** Deselect selected items. This function does not emit any signals. */ | 146 | /** Deselect selected items. This function does not emit any signals. */ |
146 | void deselectItem(); | 147 | void deselectItem(); |
147 | /** Select item. If the argument is 0, the currently selected item gets | 148 | /** Select item. If the argument is 0, the currently selected item gets |
148 | deselected. This function emits the itemSelected(bool) signal to inform | 149 | deselected. This function emits the itemSelected(bool) signal to inform |
149 | about selection/deseelction of events. */ | 150 | about selection/deseelction of events. */ |
150 | void selectItem(KOAgendaItem *); | 151 | void selectItem(KOAgendaItem *); |
151 | void finishResize(); | 152 | void finishResize(); |
152 | 153 | ||
153 | signals: | 154 | signals: |
154 | void signalClearSelection(); | 155 | void signalClearSelection(); |
155 | void showDateView( int, int); | 156 | void showDateView( int, int); |
156 | void newEventSignal(); | 157 | void newEventSignal(); |
157 | void newEventSignal(int gx,int gy); | 158 | void newEventSignal(int gx,int gy); |
158 | void newTodoSignal(int gx,int gy); | 159 | void newTodoSignal(int gx,int gy); |
159 | void newEventSignal(int gxStart, int gyStart, int gxEnd, int gyEnd); | 160 | void newEventSignal(int gxStart, int gyStart, int gxEnd, int gyEnd); |
160 | void newTimeSpanSignal(int gxStart, int gyStart, int gxEnd, int gyEnd); | 161 | void newTimeSpanSignal(int gxStart, int gyStart, int gxEnd, int gyEnd); |
161 | void newStartSelectSignal(); | 162 | void newStartSelectSignal(); |
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index 53bbe28..b5a59af 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp | |||
@@ -1811,67 +1811,70 @@ void KOMonthView::setKeyBFocus() | |||
1811 | void KOMonthView::resizeEvent(QResizeEvent * e) | 1811 | void KOMonthView::resizeEvent(QResizeEvent * e) |
1812 | { | 1812 | { |
1813 | //qDebug("KOMonthView::resizeEvent %d %d -- %d %d ", e->size().width(), e->size().height(), e->oldSize().width(), e->oldSize().height()); | 1813 | //qDebug("KOMonthView::resizeEvent %d %d -- %d %d ", e->size().width(), e->size().height(), e->oldSize().width(), e->oldSize().height()); |
1814 | if ( isVisible() ) { | 1814 | if ( isVisible() ) { |
1815 | //qDebug("KOMonthView::isVisible "); | 1815 | //qDebug("KOMonthView::isVisible "); |
1816 | slotComputeLayout(); | 1816 | slotComputeLayout(); |
1817 | } else | 1817 | } else |
1818 | mComputeLayoutTimer->start( 100 ); | 1818 | mComputeLayoutTimer->start( 100 ); |
1819 | if ( e ) | 1819 | if ( e ) |
1820 | KOEventView::resizeEvent( e ); | 1820 | KOEventView::resizeEvent( e ); |
1821 | } | 1821 | } |
1822 | 1822 | ||
1823 | void KOMonthView::slotComputeLayout() | 1823 | void KOMonthView::slotComputeLayout() |
1824 | { | 1824 | { |
1825 | mComputeLayoutTimer->stop(); | 1825 | mComputeLayoutTimer->stop(); |
1826 | //qDebug("KOMonthView::Post - resizeEvent %d %d ", width(), height() ); | 1826 | //qDebug("KOMonthView::Post - resizeEvent %d %d ", width(), height() ); |
1827 | computeLayout(); | 1827 | computeLayout(); |
1828 | clPending = true; | 1828 | clPending = true; |
1829 | setKeyBFocus(); | 1829 | setKeyBFocus(); |
1830 | } | 1830 | } |
1831 | 1831 | ||
1832 | void KOMonthView::doComputeLayoutWeek() | 1832 | void KOMonthView::doComputeLayoutWeek() |
1833 | { | 1833 | { |
1834 | 1834 | ||
1835 | int daysToShow; | 1835 | int daysToShow; |
1836 | bool combinedSatSun = false; | 1836 | bool combinedSatSun = false; |
1837 | if (mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ) { | 1837 | if (mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ) { |
1838 | daysToShow = 6; | 1838 | daysToShow = 6; |
1839 | combinedSatSun = true; | 1839 | combinedSatSun = true; |
1840 | } | 1840 | } |
1841 | int wid = width();//e | 1841 | int wid = width();//e |
1842 | int hei = height()-1-mNavigatorBar->height(); | 1842 | int hei = height()-1-mNavigatorBar->height(); |
1843 | #ifdef DESKTOP_VERSION | ||
1843 | if ( !KOPrefs::instance()->mMonthViewWeekRowlayout ) { | 1844 | if ( !KOPrefs::instance()->mMonthViewWeekRowlayout ) { |
1844 | daysToShow = 2; | 1845 | daysToShow = 2; |
1845 | } else { | 1846 | } else |
1847 | #endif | ||
1848 | { | ||
1846 | if ( wid < hei ) | 1849 | if ( wid < hei ) |
1847 | daysToShow = 2; | 1850 | daysToShow = 2; |
1848 | else | 1851 | else |
1849 | daysToShow = 3; | 1852 | daysToShow = 3; |
1850 | } | 1853 | } |
1851 | bool landscape = (daysToShow == 3); | 1854 | bool landscape = (daysToShow == 3); |
1852 | mShowSatSunComp = true; | 1855 | mShowSatSunComp = true; |
1853 | combinedSatSun = true; | 1856 | combinedSatSun = true; |
1854 | 1857 | ||
1855 | //qDebug("KOMonthView::computeLayout() WWW ------------------------------------ "); | 1858 | //qDebug("KOMonthView::computeLayout() WWW ------------------------------------ "); |
1856 | QFontMetrics fm ( mWeekLabels[0]->font() ); | 1859 | QFontMetrics fm ( mWeekLabels[0]->font() ); |
1857 | int weeklabelwid = fm.width( "888" ); | 1860 | int weeklabelwid = fm.width( "888" ); |
1858 | wid -= weeklabelwid; | 1861 | wid -= weeklabelwid; |
1859 | 1862 | ||
1860 | int colWid = wid / daysToShow; | 1863 | int colWid = wid / daysToShow; |
1861 | int dayLabelHei = mDayLabelsW[0]->sizeHint().height(); | 1864 | int dayLabelHei = mDayLabelsW[0]->sizeHint().height(); |
1862 | int cellHei = (hei - (5- daysToShow )*dayLabelHei) /(5- daysToShow ); | 1865 | int cellHei = (hei - (5- daysToShow )*dayLabelHei) /(5- daysToShow ); |
1863 | int colModulo = wid % daysToShow; | 1866 | int colModulo = wid % daysToShow; |
1864 | int rowModulo = (hei- (5- daysToShow )*dayLabelHei) % daysToShow-1; | 1867 | int rowModulo = (hei- (5- daysToShow )*dayLabelHei) % daysToShow-1; |
1865 | //qDebug("rowmod %d ", rowModulo); | 1868 | //qDebug("rowmod %d ", rowModulo); |
1866 | int i; | 1869 | int i; |
1867 | int x,y,w,h; | 1870 | int x,y,w,h; |
1868 | x= 0; | 1871 | x= 0; |
1869 | y= 0; | 1872 | y= 0; |
1870 | w = colWid; | 1873 | w = colWid; |
1871 | h = dayLabelHei ; | 1874 | h = dayLabelHei ; |
1872 | for ( i = 0; i < 7; i++) { | 1875 | for ( i = 0; i < 7; i++) { |
1873 | if ( i && !( i % daysToShow) && i < 6) { | 1876 | if ( i && !( i % daysToShow) && i < 6) { |
1874 | y += hei/(5-daysToShow); | 1877 | y += hei/(5-daysToShow); |
1875 | x = 0; | 1878 | x = 0; |
1876 | w = colWid; | 1879 | w = colWid; |
1877 | } | 1880 | } |