-rw-r--r-- | bin/kdepim/WhatsNew.txt | 6 | ||||
-rw-r--r-- | korganizer/calendarview.cpp | 5 | ||||
-rw-r--r-- | korganizer/datenavigator.cpp | 6 | ||||
-rw-r--r-- | korganizer/datenavigator.h | 1 | ||||
-rw-r--r-- | korganizer/interfaces/korganizer/baseview.h | 1 | ||||
-rw-r--r-- | korganizer/komonthview.h | 1 |
6 files changed, 19 insertions, 1 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt index eb7cf13..4fff7e1 100644 --- a/bin/kdepim/WhatsNew.txt +++ b/bin/kdepim/WhatsNew.txt | |||
@@ -1,151 +1,157 @@ | |||
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 1.9.14 ************ | 3 | ********** VERSION 1.9.14 ************ |
4 | 4 | ||
5 | Fixed some problems with the dialog sizes when switching | 5 | Fixed some problems with the dialog sizes when switching |
6 | portrait/landscape mode on 640x480 PDA display. | 6 | portrait/landscape mode on 640x480 PDA display. |
7 | 7 | ||
8 | Fixed some other small bugs. | 8 | Fixed some other small bugs. |
9 | 9 | ||
10 | Fixed an ugly bug in KOpieMail: | 10 | Fixed an ugly bug in KOpieMail: |
11 | KOpieMail was not able to write files (mails) to MSDOS file system, | 11 | KOpieMail was not able to write files (mails) to MSDOS file system, |
12 | like on an usual preformatted SD card. That should work now. | 12 | like on an usual preformatted SD card. That should work now. |
13 | To save your mail data on the Sd card do the following: | 13 | To save your mail data on the Sd card do the following: |
14 | Create a dir on the SD card: | 14 | Create a dir on the SD card: |
15 | mkdir /mnt/card/localmail | 15 | mkdir /mnt/card/localmail |
16 | Go to your home dir: | 16 | Go to your home dir: |
17 | cd | 17 | cd |
18 | Go to kopiemail data storage dir: | 18 | Go to kopiemail data storage dir: |
19 | cd kdepim/apps/kopiemail | 19 | cd kdepim/apps/kopiemail |
20 | Create a symlink to the SD card: | 20 | Create a symlink to the SD card: |
21 | ls -s /mnt/card/localmail | 21 | ls -s /mnt/card/localmail |
22 | Now KOpieMail will store all mails on the SD card. | 22 | Now KOpieMail will store all mails on the SD card. |
23 | 23 | ||
24 | KO/Pi Monthview: | ||
25 | Now "Go to Today" selects the current month from day 1-end, | ||
26 | not the current date + some days. | ||
27 | I.e. "Go to Today" shows now always | ||
28 | the current month with first day of month in the first row. | ||
29 | |||
24 | 30 | ||
25 | ********** VERSION 1.9.13 ************ | 31 | ********** VERSION 1.9.13 ************ |
26 | 32 | ||
27 | Fixed nasty PwM/Pi file reading bug, when | 33 | Fixed nasty PwM/Pi file reading bug, when |
28 | the used hash algo of file is different then the global | 34 | the used hash algo of file is different then the global |
29 | hash algo. | 35 | hash algo. |
30 | 36 | ||
31 | Added KA/Pi support for opie mailit mailapplication. | 37 | Added KA/Pi support for opie mailit mailapplication. |
32 | 38 | ||
33 | Fixed some bugs in OM/Pi. | 39 | Fixed some bugs in OM/Pi. |
34 | Now character conversion tables are available for the Zaurus | 40 | Now character conversion tables are available for the Zaurus |
35 | to make OM/Pi working properly. | 41 | to make OM/Pi working properly. |
36 | To get the character conversion in OM/Pi working, please download | 42 | To get the character conversion in OM/Pi working, please download |
37 | at the sourceforge project site the package | 43 | at the sourceforge project site the package |
38 | sr-character-conversion_SharpROM_arm.ipk.zip | 44 | sr-character-conversion_SharpROM_arm.ipk.zip |
39 | (or oz-character-conversion_OZ-gcc3xx_arm.ipk.zip for OZ roms) | 45 | (or oz-character-conversion_OZ-gcc3xx_arm.ipk.zip for OZ roms) |
40 | from the section "general files for KDE/Pim" | 46 | from the section "general files for KDE/Pim" |
41 | Instructions how to install this package are in a ReadMe in this file. | 47 | Instructions how to install this package are in a ReadMe in this file. |
42 | 48 | ||
43 | 49 | ||
44 | Fixed the orientation change problem in KA/Pi when switching | 50 | Fixed the orientation change problem in KA/Pi when switching |
45 | portrait/landscape mode. | 51 | portrait/landscape mode. |
46 | 52 | ||
47 | French translation available for KA/Pi and OM/Pi. | 53 | French translation available for KA/Pi and OM/Pi. |
48 | 54 | ||
49 | Fixed some problems with categories in KO/Pi in DTM sync. | 55 | Fixed some problems with categories in KO/Pi in DTM sync. |
50 | 56 | ||
51 | Added selection dialog for export to phone in KA/Pi. | 57 | Added selection dialog for export to phone in KA/Pi. |
52 | 58 | ||
53 | If in KO/Pi is an attendee selected to add to a meeting and this | 59 | If in KO/Pi is an attendee selected to add to a meeting and this |
54 | attendee is already in the list of attendees, this person is not added | 60 | attendee is already in the list of attendees, this person is not added |
55 | again. | 61 | again. |
56 | 62 | ||
57 | Some menu cleanup in KA/Pi. | 63 | Some menu cleanup in KA/Pi. |
58 | 64 | ||
59 | ********** VERSION 1.9.12 ************ | 65 | ********** VERSION 1.9.12 ************ |
60 | 66 | ||
61 | Fix for the bug in KO/Pi What's Next view of version 1.9.11. | 67 | Fix for the bug in KO/Pi What's Next view of version 1.9.11. |
62 | 68 | ||
63 | Bugfix: Licence file is now shown again. | 69 | Bugfix: Licence file is now shown again. |
64 | 70 | ||
65 | OM/Pi now supports Unicode (utf8 charset). | 71 | OM/Pi now supports Unicode (utf8 charset). |
66 | Fixed some bugs in OM/Pi. | 72 | Fixed some bugs in OM/Pi. |
67 | 73 | ||
68 | KA/Pi has more German translation. | 74 | KA/Pi has more German translation. |
69 | 75 | ||
70 | 76 | ||
71 | ********** VERSION 1.9.11 ************ | 77 | ********** VERSION 1.9.11 ************ |
72 | 78 | ||
73 | Fixed several problems in PWM/Pi, like | 79 | Fixed several problems in PWM/Pi, like |
74 | asking the user, if unsaved changed are pending | 80 | asking the user, if unsaved changed are pending |
75 | when closing the app. | 81 | when closing the app. |
76 | And PwM/Pi handles now different texts for the | 82 | And PwM/Pi handles now different texts for the |
77 | fields Description, Username, Password, configurable per category. | 83 | fields Description, Username, Password, configurable per category. |
78 | 84 | ||
79 | Fixed a crash in KO/Pi , when importing/loading vcs files | 85 | Fixed a crash in KO/Pi , when importing/loading vcs files |
80 | which have an entry with an attendee with state: | 86 | which have an entry with an attendee with state: |
81 | NEEDS ACTION | 87 | NEEDS ACTION |
82 | 88 | ||
83 | Fixed some problems in the German translation of OM/Pi, | 89 | Fixed some problems in the German translation of OM/Pi, |
84 | which makes some dialogs not fitting on the screen | 90 | which makes some dialogs not fitting on the screen |
85 | of the Z 5500. | 91 | of the Z 5500. |
86 | 92 | ||
87 | Fixed Qtopia crash, when disabling/deinstalling | 93 | Fixed Qtopia crash, when disabling/deinstalling |
88 | KO/Pi alarm applet. | 94 | KO/Pi alarm applet. |
89 | 95 | ||
90 | Implemented direct KDE<->KA/Pi sync for KA/Pi running | 96 | Implemented direct KDE<->KA/Pi sync for KA/Pi running |
91 | on Linux desktop. | 97 | on Linux desktop. |
92 | 98 | ||
93 | Added feature "remove sync info" to sync menu. | 99 | Added feature "remove sync info" to sync menu. |
94 | 100 | ||
95 | Tweaked the KO/Pi What's next view a bit, added | 101 | Tweaked the KO/Pi What's next view a bit, added |
96 | setting to hide events that are done. | 102 | setting to hide events that are done. |
97 | 103 | ||
98 | Disabled "beam receive enabled" on startup to | 104 | Disabled "beam receive enabled" on startup to |
99 | avoid problems if Fastload is enabled. | 105 | avoid problems if Fastload is enabled. |
100 | Please set "beam receive enabled", | 106 | Please set "beam receive enabled", |
101 | if you want to receive data via IR. | 107 | if you want to receive data via IR. |
102 | 108 | ||
103 | Fixed bug in direct KDE<->KO/Pi sync for KO/Pi running | 109 | Fixed bug in direct KDE<->KO/Pi sync for KO/Pi running |
104 | on Linux desktop. | 110 | on Linux desktop. |
105 | 111 | ||
106 | Made in KA/Pi scrolling possible, if details view is selected. | 112 | Made in KA/Pi scrolling possible, if details view is selected. |
107 | (The keyboard focus is set automatically to the search line) | 113 | (The keyboard focus is set automatically to the search line) |
108 | 114 | ||
109 | Fixed a bug in DMT sync, that a new entry in DTM was added | 115 | Fixed a bug in DMT sync, that a new entry in DTM was added |
110 | on every sync to Kx/Pi. | 116 | on every sync to Kx/Pi. |
111 | 117 | ||
112 | Fixed missing writing of KA/Pi categories to DMT entries when syncing. | 118 | Fixed missing writing of KA/Pi categories to DMT entries when syncing. |
113 | 119 | ||
114 | Fixed a bug in DMT sync with todos created in KO/Pi containing | 120 | Fixed a bug in DMT sync with todos created in KO/Pi containing |
115 | non-latin1 characters. | 121 | non-latin1 characters. |
116 | 122 | ||
117 | Rearranged package contents of Sharp-ipks and made all | 123 | Rearranged package contents of Sharp-ipks and made all |
118 | packages installable on SD again. | 124 | packages installable on SD again. |
119 | 125 | ||
120 | Fixed the writing of addressbook data in DTM sync. | 126 | Fixed the writing of addressbook data in DTM sync. |
121 | Empty fields in KA/Pi were not removed. | 127 | Empty fields in KA/Pi were not removed. |
122 | 128 | ||
123 | Added better category handling in KA/Pi: | 129 | Added better category handling in KA/Pi: |
124 | Added item | 130 | Added item |
125 | Edit Categories and | 131 | Edit Categories and |
126 | Manage new categories | 132 | Manage new categories |
127 | to the settings menu. | 133 | to the settings menu. |
128 | Possible to configure a view to display categories. | 134 | Possible to configure a view to display categories. |
129 | 135 | ||
130 | Added detailed "KDE Sync Howto" and "Multi Sync Howto" to Help menu. | 136 | Added detailed "KDE Sync Howto" and "Multi Sync Howto" to Help menu. |
131 | 137 | ||
132 | Fixed displaying of "free" days and time in KO Monthview and Agendaview. | 138 | Fixed displaying of "free" days and time in KO Monthview and Agendaview. |
133 | 139 | ||
134 | ... and many other bugfixes. | 140 | ... and many other bugfixes. |
135 | 141 | ||
136 | ********** VERSION 1.9.10 ************ | 142 | ********** VERSION 1.9.10 ************ |
137 | 143 | ||
138 | Many internal small bugfixes. | 144 | Many internal small bugfixes. |
139 | And fix of the "big" bug in KO/Pi, | 145 | And fix of the "big" bug in KO/Pi, |
140 | that after Syncing the appointments had an offset by several hours. | 146 | that after Syncing the appointments had an offset by several hours. |
141 | That was a problem with the internal timezone setting, | 147 | That was a problem with the internal timezone setting, |
142 | introduced by the changed timezone configuration settings. | 148 | introduced by the changed timezone configuration settings. |
143 | 149 | ||
144 | German translation for OM/Pi is now available. | 150 | German translation for OM/Pi is now available. |
145 | 151 | ||
146 | 152 | ||
147 | ********** VERSION 1.9.9 ************ | 153 | ********** VERSION 1.9.9 ************ |
148 | 154 | ||
149 | KDE-Pim/Pi has a new Member! | 155 | KDE-Pim/Pi has a new Member! |
150 | It is called PWM/Pi (Passwordmanager/platform-independent) | 156 | It is called PWM/Pi (Passwordmanager/platform-independent) |
151 | and it is available for the Zaurus. | 157 | and it is available for the Zaurus. |
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 3908dbb..47cd488 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -1866,257 +1866,260 @@ void CalendarView::writeSettings() | |||
1866 | w = wid->width(); | 1866 | w = wid->width(); |
1867 | h = wid->height(); | 1867 | h = wid->height(); |
1868 | list.clear(); | 1868 | list.clear(); |
1869 | list << QString::number( x ); | 1869 | list << QString::number( x ); |
1870 | list << QString::number( y ); | 1870 | list << QString::number( y ); |
1871 | list << QString::number( w ); | 1871 | list << QString::number( w ); |
1872 | list << QString::number( h ); | 1872 | list << QString::number( h ); |
1873 | config->writeEntry("MainLayout",list ); | 1873 | config->writeEntry("MainLayout",list ); |
1874 | 1874 | ||
1875 | wid = mEventEditor; | 1875 | wid = mEventEditor; |
1876 | x = wid->geometry().x(); | 1876 | x = wid->geometry().x(); |
1877 | y = wid->geometry().y(); | 1877 | y = wid->geometry().y(); |
1878 | w = wid->width(); | 1878 | w = wid->width(); |
1879 | h = wid->height(); | 1879 | h = wid->height(); |
1880 | list.clear(); | 1880 | list.clear(); |
1881 | list << QString::number( x ); | 1881 | list << QString::number( x ); |
1882 | list << QString::number( y ); | 1882 | list << QString::number( y ); |
1883 | list << QString::number( w ); | 1883 | list << QString::number( w ); |
1884 | list << QString::number( h ); | 1884 | list << QString::number( h ); |
1885 | config->writeEntry("EditEventLayout",list ); | 1885 | config->writeEntry("EditEventLayout",list ); |
1886 | 1886 | ||
1887 | wid = mTodoEditor; | 1887 | wid = mTodoEditor; |
1888 | x = wid->geometry().x(); | 1888 | x = wid->geometry().x(); |
1889 | y = wid->geometry().y(); | 1889 | y = wid->geometry().y(); |
1890 | w = wid->width(); | 1890 | w = wid->width(); |
1891 | h = wid->height(); | 1891 | h = wid->height(); |
1892 | list.clear(); | 1892 | list.clear(); |
1893 | list << QString::number( x ); | 1893 | list << QString::number( x ); |
1894 | list << QString::number( y ); | 1894 | list << QString::number( y ); |
1895 | list << QString::number( w ); | 1895 | list << QString::number( w ); |
1896 | list << QString::number( h ); | 1896 | list << QString::number( h ); |
1897 | config->writeEntry("EditTodoLayout",list ); | 1897 | config->writeEntry("EditTodoLayout",list ); |
1898 | wid = getEventViewerDialog(); | 1898 | wid = getEventViewerDialog(); |
1899 | x = wid->geometry().x(); | 1899 | x = wid->geometry().x(); |
1900 | y = wid->geometry().y(); | 1900 | y = wid->geometry().y(); |
1901 | w = wid->width(); | 1901 | w = wid->width(); |
1902 | h = wid->height(); | 1902 | h = wid->height(); |
1903 | list.clear(); | 1903 | list.clear(); |
1904 | list << QString::number( x ); | 1904 | list << QString::number( x ); |
1905 | list << QString::number( y ); | 1905 | list << QString::number( y ); |
1906 | list << QString::number( w ); | 1906 | list << QString::number( w ); |
1907 | list << QString::number( h ); | 1907 | list << QString::number( h ); |
1908 | config->writeEntry("ViewerLayout",list ); | 1908 | config->writeEntry("ViewerLayout",list ); |
1909 | wid = mDialogManager->getSearchDialog(); | 1909 | wid = mDialogManager->getSearchDialog(); |
1910 | if ( wid ) { | 1910 | if ( wid ) { |
1911 | x = wid->geometry().x(); | 1911 | x = wid->geometry().x(); |
1912 | y = wid->geometry().y(); | 1912 | y = wid->geometry().y(); |
1913 | w = wid->width(); | 1913 | w = wid->width(); |
1914 | h = wid->height(); | 1914 | h = wid->height(); |
1915 | list.clear(); | 1915 | list.clear(); |
1916 | list << QString::number( x ); | 1916 | list << QString::number( x ); |
1917 | list << QString::number( y ); | 1917 | list << QString::number( y ); |
1918 | list << QString::number( w ); | 1918 | list << QString::number( w ); |
1919 | list << QString::number( h ); | 1919 | list << QString::number( h ); |
1920 | config->writeEntry("SearchLayout",list ); | 1920 | config->writeEntry("SearchLayout",list ); |
1921 | } | 1921 | } |
1922 | #endif | 1922 | #endif |
1923 | 1923 | ||
1924 | 1924 | ||
1925 | config->sync(); | 1925 | config->sync(); |
1926 | } | 1926 | } |
1927 | 1927 | ||
1928 | void CalendarView::readFilterSettings(KConfig *config) | 1928 | void CalendarView::readFilterSettings(KConfig *config) |
1929 | { | 1929 | { |
1930 | // kdDebug() << "CalendarView::readFilterSettings()" << endl; | 1930 | // kdDebug() << "CalendarView::readFilterSettings()" << endl; |
1931 | 1931 | ||
1932 | mFilters.clear(); | 1932 | mFilters.clear(); |
1933 | 1933 | ||
1934 | config->setGroup("General"); | 1934 | config->setGroup("General"); |
1935 | QStringList filterList = config->readListEntry("CalendarFilters"); | 1935 | QStringList filterList = config->readListEntry("CalendarFilters"); |
1936 | 1936 | ||
1937 | QStringList::ConstIterator it = filterList.begin(); | 1937 | QStringList::ConstIterator it = filterList.begin(); |
1938 | QStringList::ConstIterator end = filterList.end(); | 1938 | QStringList::ConstIterator end = filterList.end(); |
1939 | while(it != end) { | 1939 | while(it != end) { |
1940 | // kdDebug() << " filter: " << (*it) << endl; | 1940 | // kdDebug() << " filter: " << (*it) << endl; |
1941 | 1941 | ||
1942 | CalFilter *filter; | 1942 | CalFilter *filter; |
1943 | filter = new CalFilter(*it); | 1943 | filter = new CalFilter(*it); |
1944 | config->setGroup("Filter_" + (*it)); | 1944 | config->setGroup("Filter_" + (*it)); |
1945 | //qDebug("readFilterSettings %d ",config->readNumEntry("Criteria",0) ); | 1945 | //qDebug("readFilterSettings %d ",config->readNumEntry("Criteria",0) ); |
1946 | filter->setCriteria(config->readNumEntry("Criteria",0)); | 1946 | filter->setCriteria(config->readNumEntry("Criteria",0)); |
1947 | filter->setCategoryList(config->readListEntry("CategoryList")); | 1947 | filter->setCategoryList(config->readListEntry("CategoryList")); |
1948 | mFilters.append(filter); | 1948 | mFilters.append(filter); |
1949 | 1949 | ||
1950 | ++it; | 1950 | ++it; |
1951 | } | 1951 | } |
1952 | 1952 | ||
1953 | if (mFilters.count() == 0) { | 1953 | if (mFilters.count() == 0) { |
1954 | CalFilter *filter = new CalFilter(i18n("Default")); | 1954 | CalFilter *filter = new CalFilter(i18n("Default")); |
1955 | mFilters.append(filter); | 1955 | mFilters.append(filter); |
1956 | } | 1956 | } |
1957 | mFilterView->updateFilters(); | 1957 | mFilterView->updateFilters(); |
1958 | config->setGroup("FilterView"); | 1958 | config->setGroup("FilterView"); |
1959 | 1959 | ||
1960 | mFilterView->blockSignals(true); | 1960 | mFilterView->blockSignals(true); |
1961 | mFilterView->setFiltersEnabled(config->readBoolEntry("FilterEnabled")); | 1961 | mFilterView->setFiltersEnabled(config->readBoolEntry("FilterEnabled")); |
1962 | mFilterView->setSelectedFilter(config->readEntry("Current Filter")); | 1962 | mFilterView->setSelectedFilter(config->readEntry("Current Filter")); |
1963 | mFilterView->blockSignals(false); | 1963 | mFilterView->blockSignals(false); |
1964 | // We do it manually to avoid it being done twice by the above calls | 1964 | // We do it manually to avoid it being done twice by the above calls |
1965 | updateFilter(); | 1965 | updateFilter(); |
1966 | } | 1966 | } |
1967 | 1967 | ||
1968 | void CalendarView::writeFilterSettings(KConfig *config) | 1968 | void CalendarView::writeFilterSettings(KConfig *config) |
1969 | { | 1969 | { |
1970 | // kdDebug() << "CalendarView::writeFilterSettings()" << endl; | 1970 | // kdDebug() << "CalendarView::writeFilterSettings()" << endl; |
1971 | 1971 | ||
1972 | QStringList filterList; | 1972 | QStringList filterList; |
1973 | 1973 | ||
1974 | CalFilter *filter = mFilters.first(); | 1974 | CalFilter *filter = mFilters.first(); |
1975 | while(filter) { | 1975 | while(filter) { |
1976 | // kdDebug() << " fn: " << filter->name() << endl; | 1976 | // kdDebug() << " fn: " << filter->name() << endl; |
1977 | filterList << filter->name(); | 1977 | filterList << filter->name(); |
1978 | config->setGroup("Filter_" + filter->name()); | 1978 | config->setGroup("Filter_" + filter->name()); |
1979 | config->writeEntry("Criteria",filter->criteria()); | 1979 | config->writeEntry("Criteria",filter->criteria()); |
1980 | config->writeEntry("CategoryList",filter->categoryList()); | 1980 | config->writeEntry("CategoryList",filter->categoryList()); |
1981 | filter = mFilters.next(); | 1981 | filter = mFilters.next(); |
1982 | } | 1982 | } |
1983 | config->setGroup("General"); | 1983 | config->setGroup("General"); |
1984 | config->writeEntry("CalendarFilters",filterList); | 1984 | config->writeEntry("CalendarFilters",filterList); |
1985 | 1985 | ||
1986 | config->setGroup("FilterView"); | 1986 | config->setGroup("FilterView"); |
1987 | config->writeEntry("FilterEnabled",mFilterView->filtersEnabled()); | 1987 | config->writeEntry("FilterEnabled",mFilterView->filtersEnabled()); |
1988 | config->writeEntry("Current Filter",mFilterView->selectedFilter()->name()); | 1988 | config->writeEntry("Current Filter",mFilterView->selectedFilter()->name()); |
1989 | } | 1989 | } |
1990 | 1990 | ||
1991 | 1991 | ||
1992 | void CalendarView::goToday() | 1992 | void CalendarView::goToday() |
1993 | { | 1993 | { |
1994 | mNavigator->selectToday(); | 1994 | if ( mViewManager->currentView()->isMonthView() ) |
1995 | mNavigator->selectTodayMonth(); | ||
1996 | else | ||
1997 | mNavigator->selectToday(); | ||
1995 | } | 1998 | } |
1996 | 1999 | ||
1997 | void CalendarView::goNext() | 2000 | void CalendarView::goNext() |
1998 | { | 2001 | { |
1999 | mNavigator->selectNext(); | 2002 | mNavigator->selectNext(); |
2000 | } | 2003 | } |
2001 | 2004 | ||
2002 | void CalendarView::goPrevious() | 2005 | void CalendarView::goPrevious() |
2003 | { | 2006 | { |
2004 | mNavigator->selectPrevious(); | 2007 | mNavigator->selectPrevious(); |
2005 | } | 2008 | } |
2006 | void CalendarView::goNextMonth() | 2009 | void CalendarView::goNextMonth() |
2007 | { | 2010 | { |
2008 | mNavigator->selectNextMonth(); | 2011 | mNavigator->selectNextMonth(); |
2009 | } | 2012 | } |
2010 | 2013 | ||
2011 | void CalendarView::goPreviousMonth() | 2014 | void CalendarView::goPreviousMonth() |
2012 | { | 2015 | { |
2013 | mNavigator->selectPreviousMonth(); | 2016 | mNavigator->selectPreviousMonth(); |
2014 | } | 2017 | } |
2015 | void CalendarView::writeLocale() | 2018 | void CalendarView::writeLocale() |
2016 | { | 2019 | { |
2017 | //KPimGlobalPrefs::instance()->setGlobalConfig(); | 2020 | //KPimGlobalPrefs::instance()->setGlobalConfig(); |
2018 | #if 0 | 2021 | #if 0 |
2019 | KGlobal::locale()->setHore24Format( !KOPrefs::instance()->mPreferredTime ); | 2022 | KGlobal::locale()->setHore24Format( !KOPrefs::instance()->mPreferredTime ); |
2020 | KGlobal::locale()->setWeekStartMonday( !KOPrefs::instance()->mWeekStartsOnSunday ); | 2023 | KGlobal::locale()->setWeekStartMonday( !KOPrefs::instance()->mWeekStartsOnSunday ); |
2021 | KGlobal::locale()->setIntDateFormat( (KLocale::IntDateFormat)KOPrefs::instance()->mPreferredDate ); | 2024 | KGlobal::locale()->setIntDateFormat( (KLocale::IntDateFormat)KOPrefs::instance()->mPreferredDate ); |
2022 | KGlobal::locale()->setLanguage( KOPrefs::instance()->mPreferredLanguage ); | 2025 | KGlobal::locale()->setLanguage( KOPrefs::instance()->mPreferredLanguage ); |
2023 | QString dummy = KOPrefs::instance()->mUserDateFormatLong; | 2026 | QString dummy = KOPrefs::instance()->mUserDateFormatLong; |
2024 | KGlobal::locale()->setDateFormat(dummy.replace( QRegExp("K"), QString(",") )); | 2027 | KGlobal::locale()->setDateFormat(dummy.replace( QRegExp("K"), QString(",") )); |
2025 | dummy = KOPrefs::instance()->mUserDateFormatShort; | 2028 | dummy = KOPrefs::instance()->mUserDateFormatShort; |
2026 | KGlobal::locale()->setDateFormatShort(dummy.replace( QRegExp("K"), QString(",") )); | 2029 | KGlobal::locale()->setDateFormatShort(dummy.replace( QRegExp("K"), QString(",") )); |
2027 | KGlobal::locale()->setDaylightSaving( KOPrefs::instance()->mUseDaylightsaving, | 2030 | KGlobal::locale()->setDaylightSaving( KOPrefs::instance()->mUseDaylightsaving, |
2028 | KOPrefs::instance()->mDaylightsavingStart, | 2031 | KOPrefs::instance()->mDaylightsavingStart, |
2029 | KOPrefs::instance()->mDaylightsavingEnd ); | 2032 | KOPrefs::instance()->mDaylightsavingEnd ); |
2030 | KGlobal::locale()->setTimezone( KPimGlobalPrefs::instance()->mTimeZoneId ); | 2033 | KGlobal::locale()->setTimezone( KPimGlobalPrefs::instance()->mTimeZoneId ); |
2031 | #endif | 2034 | #endif |
2032 | } | 2035 | } |
2033 | void CalendarView::updateConfig() | 2036 | void CalendarView::updateConfig() |
2034 | { | 2037 | { |
2035 | writeLocale(); | 2038 | writeLocale(); |
2036 | if ( KOPrefs::instance()->mUseAppColors ) | 2039 | if ( KOPrefs::instance()->mUseAppColors ) |
2037 | QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); | 2040 | QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); |
2038 | emit configChanged(); | 2041 | emit configChanged(); |
2039 | mTodoList->updateConfig(); | 2042 | mTodoList->updateConfig(); |
2040 | // mDateNavigator->setFont ( KOPrefs::instance()->mDateNavigatorFont); | 2043 | // mDateNavigator->setFont ( KOPrefs::instance()->mDateNavigatorFont); |
2041 | mCalendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); | 2044 | mCalendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); |
2042 | // To make the "fill window" configurations work | 2045 | // To make the "fill window" configurations work |
2043 | //mViewManager->raiseCurrentView(); | 2046 | //mViewManager->raiseCurrentView(); |
2044 | } | 2047 | } |
2045 | 2048 | ||
2046 | 2049 | ||
2047 | void CalendarView::eventChanged(Event *event) | 2050 | void CalendarView::eventChanged(Event *event) |
2048 | { | 2051 | { |
2049 | changeEventDisplay(event,KOGlobals::EVENTEDITED); | 2052 | changeEventDisplay(event,KOGlobals::EVENTEDITED); |
2050 | //updateUnmanagedViews(); | 2053 | //updateUnmanagedViews(); |
2051 | } | 2054 | } |
2052 | 2055 | ||
2053 | void CalendarView::eventAdded(Event *event) | 2056 | void CalendarView::eventAdded(Event *event) |
2054 | { | 2057 | { |
2055 | changeEventDisplay(event,KOGlobals::EVENTADDED); | 2058 | changeEventDisplay(event,KOGlobals::EVENTADDED); |
2056 | } | 2059 | } |
2057 | 2060 | ||
2058 | void CalendarView::eventToBeDeleted(Event *) | 2061 | void CalendarView::eventToBeDeleted(Event *) |
2059 | { | 2062 | { |
2060 | kdDebug() << "CalendarView::eventToBeDeleted(): to be implemented" << endl; | 2063 | kdDebug() << "CalendarView::eventToBeDeleted(): to be implemented" << endl; |
2061 | } | 2064 | } |
2062 | 2065 | ||
2063 | void CalendarView::eventDeleted() | 2066 | void CalendarView::eventDeleted() |
2064 | { | 2067 | { |
2065 | changeEventDisplay(0,KOGlobals::EVENTDELETED); | 2068 | changeEventDisplay(0,KOGlobals::EVENTDELETED); |
2066 | } | 2069 | } |
2067 | void CalendarView::changeTodoDisplay(Todo *which, int action) | 2070 | void CalendarView::changeTodoDisplay(Todo *which, int action) |
2068 | { | 2071 | { |
2069 | changeIncidenceDisplay((Incidence *)which, action); | 2072 | changeIncidenceDisplay((Incidence *)which, action); |
2070 | mDateNavigator->updateView(); //LR | 2073 | mDateNavigator->updateView(); //LR |
2071 | //mDialogManager->updateSearchDialog(); | 2074 | //mDialogManager->updateSearchDialog(); |
2072 | 2075 | ||
2073 | if (which) { | 2076 | if (which) { |
2074 | mViewManager->updateWNview(); | 2077 | mViewManager->updateWNview(); |
2075 | //mTodoList->updateView(); | 2078 | //mTodoList->updateView(); |
2076 | } | 2079 | } |
2077 | 2080 | ||
2078 | } | 2081 | } |
2079 | 2082 | ||
2080 | void CalendarView::changeIncidenceDisplay(Incidence *which, int action) | 2083 | void CalendarView::changeIncidenceDisplay(Incidence *which, int action) |
2081 | { | 2084 | { |
2082 | updateUnmanagedViews(); | 2085 | updateUnmanagedViews(); |
2083 | //qDebug(" CalendarView::changeIncidenceDisplay++++++++++++++++++++++++++ %d %d ",which, action ); | 2086 | //qDebug(" CalendarView::changeIncidenceDisplay++++++++++++++++++++++++++ %d %d ",which, action ); |
2084 | if ( action == KOGlobals::EVENTDELETED ) { //delete | 2087 | if ( action == KOGlobals::EVENTDELETED ) { //delete |
2085 | mCalendar->checkAlarmForIncidence( 0, true ); | 2088 | mCalendar->checkAlarmForIncidence( 0, true ); |
2086 | if ( mEventViewerDialog ) | 2089 | if ( mEventViewerDialog ) |
2087 | mEventViewerDialog->hide(); | 2090 | mEventViewerDialog->hide(); |
2088 | } | 2091 | } |
2089 | else | 2092 | else |
2090 | mCalendar->checkAlarmForIncidence( which , false ); | 2093 | mCalendar->checkAlarmForIncidence( which , false ); |
2091 | } | 2094 | } |
2092 | 2095 | ||
2093 | // most of the changeEventDisplays() right now just call the view's | 2096 | // most of the changeEventDisplays() right now just call the view's |
2094 | // total update mode, but they SHOULD be recoded to be more refresh-efficient. | 2097 | // total update mode, but they SHOULD be recoded to be more refresh-efficient. |
2095 | void CalendarView::changeEventDisplay(Event *which, int action) | 2098 | void CalendarView::changeEventDisplay(Event *which, int action) |
2096 | { | 2099 | { |
2097 | // kdDebug() << "CalendarView::changeEventDisplay" << endl; | 2100 | // kdDebug() << "CalendarView::changeEventDisplay" << endl; |
2098 | changeIncidenceDisplay((Incidence *)which, action); | 2101 | changeIncidenceDisplay((Incidence *)which, action); |
2099 | mDateNavigator->updateView(); | 2102 | mDateNavigator->updateView(); |
2100 | //mDialogManager->updateSearchDialog(); | 2103 | //mDialogManager->updateSearchDialog(); |
2101 | 2104 | ||
2102 | if (which) { | 2105 | if (which) { |
2103 | // If there is an event view visible update the display | 2106 | // If there is an event view visible update the display |
2104 | mViewManager->currentView()->changeEventDisplay(which,action); | 2107 | mViewManager->currentView()->changeEventDisplay(which,action); |
2105 | // TODO: check, if update needed | 2108 | // TODO: check, if update needed |
2106 | // if (which->getTodoStatus()) { | 2109 | // if (which->getTodoStatus()) { |
2107 | mTodoList->updateView(); | 2110 | mTodoList->updateView(); |
2108 | // } | 2111 | // } |
2109 | } else { | 2112 | } else { |
2110 | mViewManager->currentView()->updateView(); | 2113 | mViewManager->currentView()->updateView(); |
2111 | } | 2114 | } |
2112 | } | 2115 | } |
2113 | 2116 | ||
2114 | 2117 | ||
2115 | void CalendarView::updateTodoViews() | 2118 | void CalendarView::updateTodoViews() |
2116 | { | 2119 | { |
2117 | 2120 | ||
2118 | mTodoList->updateView(); | 2121 | mTodoList->updateView(); |
2119 | mViewManager->currentView()->updateView(); | 2122 | mViewManager->currentView()->updateView(); |
2120 | 2123 | ||
2121 | } | 2124 | } |
2122 | 2125 | ||
diff --git a/korganizer/datenavigator.cpp b/korganizer/datenavigator.cpp index e26e20b..3156b2b 100644 --- a/korganizer/datenavigator.cpp +++ b/korganizer/datenavigator.cpp | |||
@@ -74,214 +74,220 @@ void DateNavigator::selectMonthByDate( const QDate & firstSelected ) | |||
74 | 74 | ||
75 | int monthDay = firstSelected.day(); | 75 | int monthDay = firstSelected.day(); |
76 | QDate date = firstSelected.addDays( 1-monthDay ); | 76 | QDate date = firstSelected.addDays( 1-monthDay ); |
77 | selectDates( date , date.daysInMonth ()); | 77 | selectDates( date , date.daysInMonth ()); |
78 | 78 | ||
79 | } | 79 | } |
80 | void DateNavigator::selectMonth() | 80 | void DateNavigator::selectMonth() |
81 | { | 81 | { |
82 | 82 | ||
83 | QDate date =mSelectedDates.first(); | 83 | QDate date =mSelectedDates.first(); |
84 | selectMonthByDate( date ); | 84 | selectMonthByDate( date ); |
85 | } | 85 | } |
86 | 86 | ||
87 | DateList DateNavigator::selectedDates() | 87 | DateList DateNavigator::selectedDates() |
88 | { | 88 | { |
89 | return mSelectedDates; | 89 | return mSelectedDates; |
90 | } | 90 | } |
91 | 91 | ||
92 | int DateNavigator::datesCount() const | 92 | int DateNavigator::datesCount() const |
93 | { | 93 | { |
94 | return mSelectedDates.count(); | 94 | return mSelectedDates.count(); |
95 | } | 95 | } |
96 | 96 | ||
97 | void DateNavigator::selectDates( const DateList& dateList ) | 97 | void DateNavigator::selectDates( const DateList& dateList ) |
98 | { | 98 | { |
99 | if (dateList.count() > 0) { | 99 | if (dateList.count() > 0) { |
100 | mSelectedDates = dateList; | 100 | mSelectedDates = dateList; |
101 | emitSelected(); | 101 | emitSelected(); |
102 | } | 102 | } |
103 | } | 103 | } |
104 | 104 | ||
105 | void DateNavigator::selectDate( const QDate &date ) | 105 | void DateNavigator::selectDate( const QDate &date ) |
106 | { | 106 | { |
107 | QDate d = date; | 107 | QDate d = date; |
108 | 108 | ||
109 | if ( !d.isValid() ) { | 109 | if ( !d.isValid() ) { |
110 | d = QDate::currentDate(); | 110 | d = QDate::currentDate(); |
111 | } | 111 | } |
112 | 112 | ||
113 | mSelectedDates.clear(); | 113 | mSelectedDates.clear(); |
114 | mSelectedDates.append( d ); | 114 | mSelectedDates.append( d ); |
115 | 115 | ||
116 | emitSelected(); | 116 | emitSelected(); |
117 | } | 117 | } |
118 | 118 | ||
119 | void DateNavigator::selectDates( int count ) | 119 | void DateNavigator::selectDates( int count ) |
120 | { | 120 | { |
121 | 121 | ||
122 | QDate d = mSelectedDates.first(); | 122 | QDate d = mSelectedDates.first(); |
123 | selectDates( d, count ); | 123 | selectDates( d, count ); |
124 | } | 124 | } |
125 | 125 | ||
126 | void DateNavigator::selectDates( const QDate &d, int count ) | 126 | void DateNavigator::selectDates( const QDate &d, int count ) |
127 | { | 127 | { |
128 | DateList dates; | 128 | DateList dates; |
129 | 129 | ||
130 | int i; | 130 | int i; |
131 | for( i = 0; i < count; ++i ) { | 131 | for( i = 0; i < count; ++i ) { |
132 | dates.append( d.addDays( i ) ); | 132 | dates.append( d.addDays( i ) ); |
133 | } | 133 | } |
134 | 134 | ||
135 | mSelectedDates = dates; | 135 | mSelectedDates = dates; |
136 | 136 | ||
137 | emitSelected(); | 137 | emitSelected(); |
138 | } | 138 | } |
139 | 139 | ||
140 | void DateNavigator::selectWeekByDay( int weekDay, const QDate &d ) | 140 | void DateNavigator::selectWeekByDay( int weekDay, const QDate &d ) |
141 | { | 141 | { |
142 | // qDebug("selectWeekByDay( %d %s ", weekDay, d.toString().latin1()); | 142 | // qDebug("selectWeekByDay( %d %s ", weekDay, d.toString().latin1()); |
143 | int dateCount = mSelectedDates.count(); | 143 | int dateCount = mSelectedDates.count(); |
144 | bool weekStart = ( weekDay == KGlobal::locale()->weekStartDay() ); | 144 | bool weekStart = ( weekDay == KGlobal::locale()->weekStartDay() ); |
145 | if ( weekDay == 1 && dateCount == 5 ) selectWorkWeek( d ); | 145 | if ( weekDay == 1 && dateCount == 5 ) selectWorkWeek( d ); |
146 | else if ( weekStart && dateCount == 7 ) selectWeek( d ); | 146 | else if ( weekStart && dateCount == 7 ) selectWeek( d ); |
147 | else selectDates( d, dateCount ); | 147 | else selectDates( d, dateCount ); |
148 | } | 148 | } |
149 | 149 | ||
150 | void DateNavigator::selectWeek() | 150 | void DateNavigator::selectWeek() |
151 | { | 151 | { |
152 | QDate d = mSelectedDates.first(); | 152 | QDate d = mSelectedDates.first(); |
153 | selectWeek( d ); | 153 | selectWeek( d ); |
154 | } | 154 | } |
155 | void DateNavigator::selectWeek( int num ) | 155 | void DateNavigator::selectWeek( int num ) |
156 | { | 156 | { |
157 | int year = mSelectedDates.first().year(); | 157 | int year = mSelectedDates.first().year(); |
158 | if ( mSelectedDates.first().dayOfYear() > 300 && num < 10 ) | 158 | if ( mSelectedDates.first().dayOfYear() > 300 && num < 10 ) |
159 | ++year; | 159 | ++year; |
160 | if ( mSelectedDates.first().dayOfYear() < 70 && num > 40 ) | 160 | if ( mSelectedDates.first().dayOfYear() < 70 && num > 40 ) |
161 | --year; | 161 | --year; |
162 | QDate d = QDate ( year, 1,1); | 162 | QDate d = QDate ( year, 1,1); |
163 | while ( d.dayOfWeek() != 4 ) | 163 | while ( d.dayOfWeek() != 4 ) |
164 | d = d.addDays( 1 ); | 164 | d = d.addDays( 1 ); |
165 | selectWeek( d.addDays ( (num-1) *7 ) ); | 165 | selectWeek( d.addDays ( (num-1) *7 ) ); |
166 | } | 166 | } |
167 | void DateNavigator::selectWeek( const QDate &d ) | 167 | void DateNavigator::selectWeek( const QDate &d ) |
168 | { | 168 | { |
169 | int dayOfWeek = KOGlobals::self()->calendarSystem()->dayOfWeek( d ); | 169 | int dayOfWeek = KOGlobals::self()->calendarSystem()->dayOfWeek( d ); |
170 | 170 | ||
171 | int weekStart = KGlobal::locale()->weekStartDay(); | 171 | int weekStart = KGlobal::locale()->weekStartDay(); |
172 | QDate firstDate = d.addDays( weekStart - dayOfWeek ); | 172 | QDate firstDate = d.addDays( weekStart - dayOfWeek ); |
173 | 173 | ||
174 | if ( weekStart != 1 && dayOfWeek < weekStart ) { | 174 | if ( weekStart != 1 && dayOfWeek < weekStart ) { |
175 | firstDate = firstDate.addDays(-7 ); | 175 | firstDate = firstDate.addDays(-7 ); |
176 | } | 176 | } |
177 | 177 | ||
178 | 178 | ||
179 | selectDates( firstDate, 7 ); | 179 | selectDates( firstDate, 7 ); |
180 | } | 180 | } |
181 | 181 | ||
182 | void DateNavigator::selectWorkWeek() | 182 | void DateNavigator::selectWorkWeek() |
183 | { | 183 | { |
184 | QDate d = mSelectedDates.first(); | 184 | QDate d = mSelectedDates.first(); |
185 | selectWorkWeek( d ); | 185 | selectWorkWeek( d ); |
186 | } | 186 | } |
187 | 187 | ||
188 | void DateNavigator::selectWorkWeek( const QDate &d ) | 188 | void DateNavigator::selectWorkWeek( const QDate &d ) |
189 | { | 189 | { |
190 | int dayOfWeek = KOGlobals::self()->calendarSystem()->dayOfWeek( d ); | 190 | int dayOfWeek = KOGlobals::self()->calendarSystem()->dayOfWeek( d ); |
191 | 191 | ||
192 | QDate firstDate = d.addDays( 1 - dayOfWeek ); | 192 | QDate firstDate = d.addDays( 1 - dayOfWeek ); |
193 | 193 | ||
194 | int weekStart = KGlobal::locale()->weekStartDay(); | 194 | int weekStart = KGlobal::locale()->weekStartDay(); |
195 | if ( weekStart != 1 && dayOfWeek >= weekStart ) { | 195 | if ( weekStart != 1 && dayOfWeek >= weekStart ) { |
196 | firstDate = firstDate.addDays( 7 ); | 196 | firstDate = firstDate.addDays( 7 ); |
197 | } | 197 | } |
198 | 198 | ||
199 | selectDates( firstDate, 5 ); | 199 | selectDates( firstDate, 5 ); |
200 | } | 200 | } |
201 | 201 | ||
202 | void DateNavigator::selectTodayMonth() | ||
203 | { | ||
204 | QDate date = QDate::currentDate().addDays( 1-QDate::currentDate().day() ); | ||
205 | selectDates( date , date.daysInMonth ()); | ||
206 | |||
207 | } | ||
202 | void DateNavigator::selectToday() | 208 | void DateNavigator::selectToday() |
203 | { | 209 | { |
204 | QDate d = QDate::currentDate(); | 210 | QDate d = QDate::currentDate(); |
205 | 211 | ||
206 | int dateCount = mSelectedDates.count(); | 212 | int dateCount = mSelectedDates.count(); |
207 | 213 | ||
208 | if ( dateCount == 5 ) selectWorkWeek( d ); | 214 | if ( dateCount == 5 ) selectWorkWeek( d ); |
209 | else if ( dateCount == 7 ) selectWeek( d ); | 215 | else if ( dateCount == 7 ) selectWeek( d ); |
210 | else selectDates( d, dateCount ); | 216 | else selectDates( d, dateCount ); |
211 | } | 217 | } |
212 | 218 | ||
213 | void DateNavigator::selectPreviousYear() | 219 | void DateNavigator::selectPreviousYear() |
214 | { | 220 | { |
215 | QDate firstSelected = mSelectedDates.first(); | 221 | QDate firstSelected = mSelectedDates.first(); |
216 | int weekDay = firstSelected.dayOfWeek(); | 222 | int weekDay = firstSelected.dayOfWeek(); |
217 | firstSelected = KOGlobals::self()->calendarSystem()->addYears( firstSelected, -1 ); | 223 | firstSelected = KOGlobals::self()->calendarSystem()->addYears( firstSelected, -1 ); |
218 | 224 | ||
219 | selectWeekByDay( weekDay, firstSelected ); | 225 | selectWeekByDay( weekDay, firstSelected ); |
220 | } | 226 | } |
221 | 227 | ||
222 | void DateNavigator::selectPreviousMonth() | 228 | void DateNavigator::selectPreviousMonth() |
223 | { | 229 | { |
224 | QDate firstSelected = mSelectedDates.first(); | 230 | QDate firstSelected = mSelectedDates.first(); |
225 | int weekDay = firstSelected.dayOfWeek(); | 231 | int weekDay = firstSelected.dayOfWeek(); |
226 | firstSelected = KOGlobals::self()->calendarSystem()->addMonths( firstSelected, -1 ); | 232 | firstSelected = KOGlobals::self()->calendarSystem()->addMonths( firstSelected, -1 ); |
227 | 233 | ||
228 | 234 | ||
229 | if ( mSelectedDates.first().day() == 1 && mSelectedDates.count() > 27 ) | 235 | if ( mSelectedDates.first().day() == 1 && mSelectedDates.count() > 27 ) |
230 | selectMonthByDate( firstSelected ); | 236 | selectMonthByDate( firstSelected ); |
231 | else | 237 | else |
232 | selectWeekByDay( weekDay, firstSelected ); | 238 | selectWeekByDay( weekDay, firstSelected ); |
233 | } | 239 | } |
234 | 240 | ||
235 | void DateNavigator::selectNextMonth() | 241 | void DateNavigator::selectNextMonth() |
236 | { | 242 | { |
237 | QDate firstSelected = mSelectedDates.first(); | 243 | QDate firstSelected = mSelectedDates.first(); |
238 | int weekDay = firstSelected.dayOfWeek(); | 244 | int weekDay = firstSelected.dayOfWeek(); |
239 | 245 | ||
240 | firstSelected = KOGlobals::self()->calendarSystem()->addMonths( firstSelected, 1 ); | 246 | firstSelected = KOGlobals::self()->calendarSystem()->addMonths( firstSelected, 1 ); |
241 | 247 | ||
242 | if ( mSelectedDates.first().day() == 1 && mSelectedDates.count() > 27 ) | 248 | if ( mSelectedDates.first().day() == 1 && mSelectedDates.count() > 27 ) |
243 | selectMonthByDate( firstSelected ); | 249 | selectMonthByDate( firstSelected ); |
244 | else | 250 | else |
245 | selectWeekByDay( weekDay, firstSelected ); | 251 | selectWeekByDay( weekDay, firstSelected ); |
246 | 252 | ||
247 | } | 253 | } |
248 | 254 | ||
249 | void DateNavigator::selectNextYear() | 255 | void DateNavigator::selectNextYear() |
250 | { | 256 | { |
251 | QDate firstSelected = mSelectedDates.first(); | 257 | QDate firstSelected = mSelectedDates.first(); |
252 | int weekDay = firstSelected.dayOfWeek(); | 258 | int weekDay = firstSelected.dayOfWeek(); |
253 | firstSelected = KOGlobals::self()->calendarSystem()->addYears( firstSelected, 1 ); | 259 | firstSelected = KOGlobals::self()->calendarSystem()->addYears( firstSelected, 1 ); |
254 | 260 | ||
255 | selectWeekByDay( weekDay, firstSelected ); | 261 | selectWeekByDay( weekDay, firstSelected ); |
256 | } | 262 | } |
257 | 263 | ||
258 | void DateNavigator::selectPrevious() | 264 | void DateNavigator::selectPrevious() |
259 | { | 265 | { |
260 | int offset = -7; | 266 | int offset = -7; |
261 | if ( datesCount() == 1 ) { | 267 | if ( datesCount() == 1 ) { |
262 | offset = -1; | 268 | offset = -1; |
263 | } | 269 | } |
264 | if ( mViewManager ) | 270 | if ( mViewManager ) |
265 | if ( mViewManager->showsNextDays() ) | 271 | if ( mViewManager->showsNextDays() ) |
266 | offset = -datesCount(); | 272 | offset = -datesCount(); |
267 | selectDates( mSelectedDates.first().addDays( offset ), datesCount() ); | 273 | selectDates( mSelectedDates.first().addDays( offset ), datesCount() ); |
268 | } | 274 | } |
269 | 275 | ||
270 | void DateNavigator::selectNext() | 276 | void DateNavigator::selectNext() |
271 | { | 277 | { |
272 | int offset = 7; | 278 | int offset = 7; |
273 | if ( datesCount() == 1 ) { | 279 | if ( datesCount() == 1 ) { |
274 | offset = 1; | 280 | offset = 1; |
275 | } | 281 | } |
276 | if ( mViewManager ) | 282 | if ( mViewManager ) |
277 | if ( mViewManager->showsNextDays() ) | 283 | if ( mViewManager->showsNextDays() ) |
278 | offset = datesCount(); | 284 | offset = datesCount(); |
279 | selectDates( mSelectedDates.first().addDays( offset ), datesCount() ); | 285 | selectDates( mSelectedDates.first().addDays( offset ), datesCount() ); |
280 | } | 286 | } |
281 | 287 | ||
282 | void DateNavigator::emitSelected() | 288 | void DateNavigator::emitSelected() |
283 | { | 289 | { |
284 | emit datesSelected( mSelectedDates ); | 290 | emit datesSelected( mSelectedDates ); |
285 | } | 291 | } |
286 | 292 | ||
287 | //#include "datenavigator.moc" | 293 | //#include "datenavigator.moc" |
diff --git a/korganizer/datenavigator.h b/korganizer/datenavigator.h index 747e3d3..4a19e17 100644 --- a/korganizer/datenavigator.h +++ b/korganizer/datenavigator.h | |||
@@ -1,89 +1,90 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KOrganizer. | 2 | This file is part of KOrganizer. |
3 | Copyright (c) 2002 Cornelius Schumacher <schumacher@kde.org> | 3 | Copyright (c) 2002 Cornelius Schumacher <schumacher@kde.org> |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify | 5 | This program is free software; you can redistribute it and/or modify |
6 | it under the terms of the GNU General Public License as published by | 6 | it under the terms of the GNU General Public License as published by |
7 | the Free Software Foundation; either version 2 of the License, or | 7 | the Free Software Foundation; either version 2 of the License, or |
8 | (at your option) any later version. | 8 | (at your option) any later version. |
9 | 9 | ||
10 | This program is distributed in the hope that it will be useful, | 10 | This program is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | GNU General Public License for more details. | 13 | GNU General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | 18 | ||
19 | As a special exception, permission is given to link this program | 19 | As a special exception, permission is given to link this program |
20 | with any edition of Qt, and distribute the resulting executable, | 20 | with any edition of Qt, and distribute the resulting executable, |
21 | without including the source code for Qt in the source distribution. | 21 | without including the source code for Qt in the source distribution. |
22 | */ | 22 | */ |
23 | #ifndef DATENAVIGATOR_H | 23 | #ifndef DATENAVIGATOR_H |
24 | #define DATENAVIGATOR_H | 24 | #define DATENAVIGATOR_H |
25 | 25 | ||
26 | #include <libkcal/incidencebase.h> | 26 | #include <libkcal/incidencebase.h> |
27 | 27 | ||
28 | #include <qobject.h> | 28 | #include <qobject.h> |
29 | #include "koviewmanager.h" | 29 | #include "koviewmanager.h" |
30 | 30 | ||
31 | /** | 31 | /** |
32 | This class controls date navigation. All requests to move the views to another | 32 | This class controls date navigation. All requests to move the views to another |
33 | date are sent to the DateNavigator. The DateNavigator processes the new | 33 | date are sent to the DateNavigator. The DateNavigator processes the new |
34 | selection of dates and emits the required signals for the views. | 34 | selection of dates and emits the required signals for the views. |
35 | */ | 35 | */ |
36 | class DateNavigator : public QObject | 36 | class DateNavigator : public QObject |
37 | { | 37 | { |
38 | Q_OBJECT | 38 | Q_OBJECT |
39 | public: | 39 | public: |
40 | DateNavigator( QObject *parent = 0, const char *name = 0 , KOViewManager * v = 0); | 40 | DateNavigator( QObject *parent = 0, const char *name = 0 , KOViewManager * v = 0); |
41 | ~DateNavigator(); | 41 | ~DateNavigator(); |
42 | 42 | ||
43 | KCal::DateList selectedDates(); | 43 | KCal::DateList selectedDates(); |
44 | 44 | ||
45 | int datesCount() const; | 45 | int datesCount() const; |
46 | 46 | ||
47 | public slots: | 47 | public slots: |
48 | void selectDates( const KCal::DateList & ); | 48 | void selectDates( const KCal::DateList & ); |
49 | void selectDate( const QDate & ); | 49 | void selectDate( const QDate & ); |
50 | 50 | ||
51 | void selectDates( int count ); | 51 | void selectDates( int count ); |
52 | void selectDates( const QDate &, int count ); | 52 | void selectDates( const QDate &, int count ); |
53 | 53 | ||
54 | void selectWeek(); | 54 | void selectWeek(); |
55 | void selectWeek( int weeknum ); | 55 | void selectWeek( int weeknum ); |
56 | void selectWeek( const QDate & ); | 56 | void selectWeek( const QDate & ); |
57 | 57 | ||
58 | void selectWorkWeek(); | 58 | void selectWorkWeek(); |
59 | void selectWorkWeek( const QDate & ); | 59 | void selectWorkWeek( const QDate & ); |
60 | 60 | ||
61 | void selectWeekByDay( int weekDay, const QDate & ); | 61 | void selectWeekByDay( int weekDay, const QDate & ); |
62 | 62 | ||
63 | void selectToday(); | 63 | void selectToday(); |
64 | void selectTodayMonth(); | ||
64 | 65 | ||
65 | void selectPreviousYear(); | 66 | void selectPreviousYear(); |
66 | void selectPreviousMonth(); | 67 | void selectPreviousMonth(); |
67 | void selectNextMonth(); | 68 | void selectNextMonth(); |
68 | void selectNextYear(); | 69 | void selectNextYear(); |
69 | 70 | ||
70 | void selectMonth(); | 71 | void selectMonth(); |
71 | void selectMonthByDate( const QDate & ); | 72 | void selectMonthByDate( const QDate & ); |
72 | 73 | ||
73 | void selectPrevious(); | 74 | void selectPrevious(); |
74 | void selectNext(); | 75 | void selectNext(); |
75 | void slotMonthSelect( int ); | 76 | void slotMonthSelect( int ); |
76 | void slotDaySelect( QDate d ); | 77 | void slotDaySelect( QDate d ); |
77 | 78 | ||
78 | signals: | 79 | signals: |
79 | void datesSelected( const KCal::DateList & ); | 80 | void datesSelected( const KCal::DateList & ); |
80 | 81 | ||
81 | protected: | 82 | protected: |
82 | void emitSelected(); | 83 | void emitSelected(); |
83 | 84 | ||
84 | private: | 85 | private: |
85 | KOViewManager * mViewManager; | 86 | KOViewManager * mViewManager; |
86 | KCal::DateList mSelectedDates; | 87 | KCal::DateList mSelectedDates; |
87 | }; | 88 | }; |
88 | 89 | ||
89 | #endif | 90 | #endif |
diff --git a/korganizer/interfaces/korganizer/baseview.h b/korganizer/interfaces/korganizer/baseview.h index 09f8ba3..2ac9de1 100644 --- a/korganizer/interfaces/korganizer/baseview.h +++ b/korganizer/interfaces/korganizer/baseview.h | |||
@@ -9,184 +9,185 @@ | |||
9 | version 2 of the License, or (at your option) any later version. | 9 | version 2 of the License, or (at your option) any later version. |
10 | 10 | ||
11 | This library is distributed in the hope that it will be useful, | 11 | This library is distributed in the hope that it will be useful, |
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
14 | Library General Public License for more details. | 14 | Library General Public License for more details. |
15 | 15 | ||
16 | You should have received a copy of the GNU Library General Public License | 16 | You should have received a copy of the GNU Library General Public License |
17 | along with this library; see the file COPYING.LIB. If not, write to | 17 | along with this library; see the file COPYING.LIB. If not, write to |
18 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 18 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
19 | Boston, MA 02111-1307, USA. | 19 | Boston, MA 02111-1307, USA. |
20 | */ | 20 | */ |
21 | #ifndef KORG_BASEVIEW_H | 21 | #ifndef KORG_BASEVIEW_H |
22 | #define KORG_BASEVIEW_H | 22 | #define KORG_BASEVIEW_H |
23 | // $Id$ | 23 | // $Id$ |
24 | // KOBaseView is the abstract base class of all calendar views. | 24 | // KOBaseView is the abstract base class of all calendar views. |
25 | 25 | ||
26 | #include <qwidget.h> | 26 | #include <qwidget.h> |
27 | #include <qptrlist.h> | 27 | #include <qptrlist.h> |
28 | #include <qvaluelist.h> | 28 | #include <qvaluelist.h> |
29 | 29 | ||
30 | #include <klocale.h> | 30 | #include <klocale.h> |
31 | #include <kdebug.h> | 31 | #include <kdebug.h> |
32 | #include <kmessagebox.h> | 32 | #include <kmessagebox.h> |
33 | 33 | ||
34 | #include <libkcal/event.h> | 34 | #include <libkcal/event.h> |
35 | #include <libkcal/calendar.h> | 35 | #include <libkcal/calendar.h> |
36 | 36 | ||
37 | using namespace KCal; | 37 | using namespace KCal; |
38 | 38 | ||
39 | class CalPrinter; | 39 | class CalPrinter; |
40 | 40 | ||
41 | namespace KOrg { | 41 | namespace KOrg { |
42 | 42 | ||
43 | class CalPrinterBase | 43 | class CalPrinterBase |
44 | { | 44 | { |
45 | public: | 45 | public: |
46 | enum PrintType { Day, Week, Month, Todolist }; | 46 | enum PrintType { Day, Week, Month, Todolist }; |
47 | }; | 47 | }; |
48 | 48 | ||
49 | 49 | ||
50 | /** | 50 | /** |
51 | This class provides an interface for all views being displayed within the main | 51 | This class provides an interface for all views being displayed within the main |
52 | calendar view. It has functions to update the view, to specify date range and | 52 | calendar view. It has functions to update the view, to specify date range and |
53 | other display parameter and to return selected objects. An important class, | 53 | other display parameter and to return selected objects. An important class, |
54 | which inherits KOBaseView is KOEventView, which provides the interface for all | 54 | which inherits KOBaseView is KOEventView, which provides the interface for all |
55 | views of event data like the agenda or the month view. | 55 | views of event data like the agenda or the month view. |
56 | 56 | ||
57 | @short Base class for calendar views | 57 | @short Base class for calendar views |
58 | @author Preston Brown, Cornelius Schumacher | 58 | @author Preston Brown, Cornelius Schumacher |
59 | @see KOTodoView, KOEventView, KOListView, KOAgendaView, KOMonthView | 59 | @see KOTodoView, KOEventView, KOListView, KOAgendaView, KOMonthView |
60 | */ | 60 | */ |
61 | class BaseView : public QWidget | 61 | class BaseView : public QWidget |
62 | { | 62 | { |
63 | Q_OBJECT | 63 | Q_OBJECT |
64 | public: | 64 | public: |
65 | /** | 65 | /** |
66 | Constructs a view. | 66 | Constructs a view. |
67 | 67 | ||
68 | @param cal Pointer to the calendar object from which events | 68 | @param cal Pointer to the calendar object from which events |
69 | will be retrieved for display. | 69 | will be retrieved for display. |
70 | @param parent parent widget. | 70 | @param parent parent widget. |
71 | @param name name of this widget. | 71 | @param name name of this widget. |
72 | */ | 72 | */ |
73 | BaseView(Calendar *cal, QWidget *parent = 0, const char *name = 0) : | 73 | BaseView(Calendar *cal, QWidget *parent = 0, const char *name = 0) : |
74 | QWidget(parent, name), mCalendar(cal) {} | 74 | QWidget(parent, name), mCalendar(cal) {} |
75 | 75 | ||
76 | /** | 76 | /** |
77 | Destructor. Views will do view-specific cleanups here. | 77 | Destructor. Views will do view-specific cleanups here. |
78 | */ | 78 | */ |
79 | virtual ~BaseView() {} | 79 | virtual ~BaseView() {} |
80 | 80 | ||
81 | /** | 81 | /** |
82 | Return calendar object of this view. | 82 | Return calendar object of this view. |
83 | */ | 83 | */ |
84 | Calendar *calendar() { return mCalendar; } | 84 | Calendar *calendar() { return mCalendar; } |
85 | 85 | ||
86 | /** | 86 | /** |
87 | @return a list of selected events. Most views can probably only | 87 | @return a list of selected events. Most views can probably only |
88 | select a single event at a time, but some may be able to select | 88 | select a single event at a time, but some may be able to select |
89 | more than one. | 89 | more than one. |
90 | */ | 90 | */ |
91 | virtual QPtrList<Incidence> selectedIncidences() = 0; | 91 | virtual QPtrList<Incidence> selectedIncidences() = 0; |
92 | 92 | ||
93 | /** | 93 | /** |
94 | @return a list of the dates of selected events. Most views can probably only | 94 | @return a list of the dates of selected events. Most views can probably only |
95 | select a single event at a time, but some may be able to select | 95 | select a single event at a time, but some may be able to select |
96 | more than one. | 96 | more than one. |
97 | */ | 97 | */ |
98 | virtual DateList selectedDates() = 0; | 98 | virtual DateList selectedDates() = 0; |
99 | 99 | ||
100 | /** | 100 | /** |
101 | Generate a print preview of this event view. | 101 | Generate a print preview of this event view. |
102 | 102 | ||
103 | @param calPrinter Calendar printer object used for printing | 103 | @param calPrinter Calendar printer object used for printing |
104 | @param fd from date | 104 | @param fd from date |
105 | @param td to date | 105 | @param td to date |
106 | */ | 106 | */ |
107 | /* | 107 | /* |
108 | The date parameters should be determined by the view itself and not given as | 108 | The date parameters should be determined by the view itself and not given as |
109 | parameters. At the moment I just move the code from the topwidget to the | 109 | parameters. At the moment I just move the code from the topwidget to the |
110 | individual views. | 110 | individual views. |
111 | */ | 111 | */ |
112 | virtual void printPreview(CalPrinter *, | 112 | virtual void printPreview(CalPrinter *, |
113 | const QDate &, const QDate &) | 113 | const QDate &, const QDate &) |
114 | { | 114 | { |
115 | KMessageBox::sorry(this, i18n("Unfortunately, we don't handle printing for\n" | 115 | KMessageBox::sorry(this, i18n("Unfortunately, we don't handle printing for\n" |
116 | "that view yet.\n")); | 116 | "that view yet.\n")); |
117 | } | 117 | } |
118 | 118 | ||
119 | /** | 119 | /** |
120 | Print this view. | 120 | Print this view. |
121 | 121 | ||
122 | @param calPrinter Calendar printer object used for printing | 122 | @param calPrinter Calendar printer object used for printing |
123 | */ | 123 | */ |
124 | virtual void print(CalPrinter *) | 124 | virtual void print(CalPrinter *) |
125 | { | 125 | { |
126 | KMessageBox::sorry(this, i18n("Unfortunately, we don't handle printing for\n" | 126 | KMessageBox::sorry(this, i18n("Unfortunately, we don't handle printing for\n" |
127 | "that view yet.\n")); | 127 | "that view yet.\n")); |
128 | } | 128 | } |
129 | 129 | ||
130 | /** | 130 | /** |
131 | Return number of currently shown dates. A return value of 0 means no idea. | 131 | Return number of currently shown dates. A return value of 0 means no idea. |
132 | */ | 132 | */ |
133 | virtual int currentDateCount() = 0; | 133 | virtual int currentDateCount() = 0; |
134 | 134 | ||
135 | /** Return if this view is a view for displaying events. */ | 135 | /** Return if this view is a view for displaying events. */ |
136 | virtual bool isEventView() { return false; } | 136 | virtual bool isEventView() { return false; } |
137 | virtual bool isMonthView() { return false; } | ||
137 | 138 | ||
138 | public slots: | 139 | public slots: |
139 | /** | 140 | /** |
140 | Show incidences for the given date range. The date range actually shown may be | 141 | Show incidences for the given date range. The date range actually shown may be |
141 | different from the requested range, depending on the particular requirements | 142 | different from the requested range, depending on the particular requirements |
142 | of the view. | 143 | of the view. |
143 | 144 | ||
144 | @param start Start of date range. | 145 | @param start Start of date range. |
145 | @param end End of date range. | 146 | @param end End of date range. |
146 | */ | 147 | */ |
147 | virtual void showDates( const QDate &start, const QDate &end ) = 0; | 148 | virtual void showDates( const QDate &start, const QDate &end ) = 0; |
148 | 149 | ||
149 | /** | 150 | /** |
150 | Show given events. Depending on the actual view it might not be possible to | 151 | Show given events. Depending on the actual view it might not be possible to |
151 | show all given events. | 152 | show all given events. |
152 | 153 | ||
153 | @param eventList a list of events to show. | 154 | @param eventList a list of events to show. |
154 | */ | 155 | */ |
155 | virtual void showEvents(QPtrList<Event> eventList) = 0; | 156 | virtual void showEvents(QPtrList<Event> eventList) = 0; |
156 | 157 | ||
157 | /** | 158 | /** |
158 | Updates the current display to reflect changes that may have happened | 159 | Updates the current display to reflect changes that may have happened |
159 | in the calendar since the last display refresh. | 160 | in the calendar since the last display refresh. |
160 | */ | 161 | */ |
161 | virtual void updateView() = 0; | 162 | virtual void updateView() = 0; |
162 | 163 | ||
163 | /** | 164 | /** |
164 | Write all unsaved data back to calendar store. | 165 | Write all unsaved data back to calendar store. |
165 | */ | 166 | */ |
166 | virtual void flushView() {} | 167 | virtual void flushView() {} |
167 | 168 | ||
168 | /** | 169 | /** |
169 | Updates the current display to reflect the changes to one particular event. | 170 | Updates the current display to reflect the changes to one particular event. |
170 | */ | 171 | */ |
171 | virtual void changeEventDisplay(Event *, int) = 0; | 172 | virtual void changeEventDisplay(Event *, int) = 0; |
172 | 173 | ||
173 | /** | 174 | /** |
174 | Re-reads the KOrganizer configuration and picks up relevant | 175 | Re-reads the KOrganizer configuration and picks up relevant |
175 | changes which are applicable to the view. | 176 | changes which are applicable to the view. |
176 | */ | 177 | */ |
177 | virtual void updateConfig() {} | 178 | virtual void updateConfig() {} |
178 | 179 | ||
179 | /** | 180 | /** |
180 | Clear selection. The incidenceSelected signal is not emitted. | 181 | Clear selection. The incidenceSelected signal is not emitted. |
181 | */ | 182 | */ |
182 | virtual void clearSelection() {} | 183 | virtual void clearSelection() {} |
183 | 184 | ||
184 | signals: | 185 | signals: |
185 | void incidenceSelected( Incidence * ); | 186 | void incidenceSelected( Incidence * ); |
186 | 187 | ||
187 | protected: | 188 | protected: |
188 | Calendar *mCalendar; | 189 | Calendar *mCalendar; |
189 | }; | 190 | }; |
190 | 191 | ||
191 | } | 192 | } |
192 | #endif | 193 | #endif |
diff --git a/korganizer/komonthview.h b/korganizer/komonthview.h index d976246..e94952f 100644 --- a/korganizer/komonthview.h +++ b/korganizer/komonthview.h | |||
@@ -75,178 +75,179 @@ class KNoScrollListBox: public QListBox | |||
75 | void mousePressEvent(QMouseEvent *); | 75 | void mousePressEvent(QMouseEvent *); |
76 | }; | 76 | }; |
77 | 77 | ||
78 | 78 | ||
79 | class MonthViewItem: public QListBoxItem | 79 | class MonthViewItem: public QListBoxItem |
80 | { | 80 | { |
81 | public: | 81 | public: |
82 | MonthViewItem( Incidence *, QDate qd, const QString & title ); | 82 | MonthViewItem( Incidence *, QDate qd, const QString & title ); |
83 | 83 | ||
84 | void setRecur(bool on) { mRecur = on; } | 84 | void setRecur(bool on) { mRecur = on; } |
85 | void setAlarm(bool on) { mAlarm = on; } | 85 | void setAlarm(bool on) { mAlarm = on; } |
86 | void setReply(bool on) { mReply = on; } | 86 | void setReply(bool on) { mReply = on; } |
87 | void setMoreInfo(bool on) { mInfo = on; } | 87 | void setMoreInfo(bool on) { mInfo = on; } |
88 | 88 | ||
89 | 89 | ||
90 | void setPalette(const QPalette &p) { mPalette = p; } | 90 | void setPalette(const QPalette &p) { mPalette = p; } |
91 | QPalette palette() const { return mPalette; } | 91 | QPalette palette() const { return mPalette; } |
92 | 92 | ||
93 | Incidence *incidence() const { return mIncidence; } | 93 | Incidence *incidence() const { return mIncidence; } |
94 | QDate incidenceDate() { return mDate; } | 94 | QDate incidenceDate() { return mDate; } |
95 | 95 | ||
96 | protected: | 96 | protected: |
97 | virtual void paint(QPainter *); | 97 | virtual void paint(QPainter *); |
98 | virtual int height(const QListBox *) const; | 98 | virtual int height(const QListBox *) const; |
99 | virtual int width(const QListBox *) const; | 99 | virtual int width(const QListBox *) const; |
100 | 100 | ||
101 | private: | 101 | private: |
102 | bool mRecur; | 102 | bool mRecur; |
103 | bool mAlarm; | 103 | bool mAlarm; |
104 | bool mReply; | 104 | bool mReply; |
105 | bool mInfo; | 105 | bool mInfo; |
106 | 106 | ||
107 | QPalette mPalette; | 107 | QPalette mPalette; |
108 | QDate mDate; | 108 | QDate mDate; |
109 | 109 | ||
110 | Incidence *mIncidence; | 110 | Incidence *mIncidence; |
111 | }; | 111 | }; |
112 | 112 | ||
113 | 113 | ||
114 | class KOMonthView; | 114 | class KOMonthView; |
115 | 115 | ||
116 | class MonthViewCell : public QWidget | 116 | class MonthViewCell : public QWidget |
117 | { | 117 | { |
118 | Q_OBJECT | 118 | Q_OBJECT |
119 | public: | 119 | public: |
120 | MonthViewCell( KOMonthView * ); | 120 | MonthViewCell( KOMonthView * ); |
121 | 121 | ||
122 | void setDate( const QDate & ); | 122 | void setDate( const QDate & ); |
123 | QDate date() const; | 123 | QDate date() const; |
124 | 124 | ||
125 | void setPrimary( bool ); | 125 | void setPrimary( bool ); |
126 | bool isPrimary() const; | 126 | bool isPrimary() const; |
127 | 127 | ||
128 | void setHoliday( bool ); | 128 | void setHoliday( bool ); |
129 | void setHoliday( const QString & ); | 129 | void setHoliday( const QString & ); |
130 | 130 | ||
131 | void updateCell(); | 131 | void updateCell(); |
132 | 132 | ||
133 | void updateConfig(); | 133 | void updateConfig(); |
134 | 134 | ||
135 | void enableScrollBars( bool ); | 135 | void enableScrollBars( bool ); |
136 | 136 | ||
137 | Incidence *selectedIncidence(); | 137 | Incidence *selectedIncidence(); |
138 | QDate selectedIncidenceDate(); | 138 | QDate selectedIncidenceDate(); |
139 | 139 | ||
140 | void deselect(); | 140 | void deselect(); |
141 | void select(); | 141 | void select(); |
142 | 142 | ||
143 | signals: | 143 | signals: |
144 | void defaultAction( Incidence * ); | 144 | void defaultAction( Incidence * ); |
145 | void newEventSignal( QDateTime ); | 145 | void newEventSignal( QDateTime ); |
146 | 146 | ||
147 | protected: | 147 | protected: |
148 | void resizeEvent( QResizeEvent * ); | 148 | void resizeEvent( QResizeEvent * ); |
149 | 149 | ||
150 | protected slots: | 150 | protected slots: |
151 | void defaultAction( QListBoxItem * ); | 151 | void defaultAction( QListBoxItem * ); |
152 | void contextMenu( QListBoxItem * ); | 152 | void contextMenu( QListBoxItem * ); |
153 | void selection( QListBoxItem * ); | 153 | void selection( QListBoxItem * ); |
154 | void cellClicked( QListBoxItem * ); | 154 | void cellClicked( QListBoxItem * ); |
155 | void newEvent(); | 155 | void newEvent(); |
156 | 156 | ||
157 | private: | 157 | private: |
158 | KOMonthView *mMonthView; | 158 | KOMonthView *mMonthView; |
159 | 159 | ||
160 | QDate mDate; | 160 | QDate mDate; |
161 | bool mPrimary; | 161 | bool mPrimary; |
162 | bool mHoliday; | 162 | bool mHoliday; |
163 | QString mHolidayString; | 163 | QString mHolidayString; |
164 | 164 | ||
165 | //QLabel *mLabel; | 165 | //QLabel *mLabel; |
166 | QPushButton *mLabel; | 166 | QPushButton *mLabel; |
167 | QListBox *mItemList; | 167 | QListBox *mItemList; |
168 | 168 | ||
169 | QSize mLabelSize; | 169 | QSize mLabelSize; |
170 | QSize mLabelBigSize; | 170 | QSize mLabelBigSize; |
171 | QPalette mHolidayPalette; | 171 | QPalette mHolidayPalette; |
172 | QPalette mStandardPalette; | 172 | QPalette mStandardPalette; |
173 | QPalette mPrimaryPalette; | 173 | QPalette mPrimaryPalette; |
174 | QPalette mNonPrimaryPalette; | 174 | QPalette mNonPrimaryPalette; |
175 | void setMyPalette(); | 175 | void setMyPalette(); |
176 | QPalette getPalette (); | 176 | QPalette getPalette (); |
177 | void keyPressEvent ( QKeyEvent * ) ; | 177 | void keyPressEvent ( QKeyEvent * ) ; |
178 | 178 | ||
179 | }; | 179 | }; |
180 | 180 | ||
181 | 181 | ||
182 | class KOMonthView: public KOEventView | 182 | class KOMonthView: public KOEventView |
183 | { | 183 | { |
184 | Q_OBJECT | 184 | Q_OBJECT |
185 | public: | 185 | public: |
186 | KOMonthView(Calendar *cal, QWidget *parent = 0, const char *name = 0 ); | 186 | KOMonthView(Calendar *cal, QWidget *parent = 0, const char *name = 0 ); |
187 | ~KOMonthView(); | 187 | ~KOMonthView(); |
188 | 188 | ||
189 | /** Returns maximum number of days supported by the komonthview */ | 189 | /** Returns maximum number of days supported by the komonthview */ |
190 | virtual int maxDatesHint(); | 190 | virtual int maxDatesHint(); |
191 | 191 | ||
192 | /** Returns number of currently shown dates. */ | 192 | /** Returns number of currently shown dates. */ |
193 | virtual int currentDateCount(); | 193 | virtual int currentDateCount(); |
194 | 194 | ||
195 | /** returns the currently selected events */ | 195 | /** returns the currently selected events */ |
196 | virtual QPtrList<Incidence> selectedIncidences(); | 196 | virtual QPtrList<Incidence> selectedIncidences(); |
197 | 197 | ||
198 | /** returns dates of the currently selected events */ | 198 | /** returns dates of the currently selected events */ |
199 | virtual DateList selectedDates(); | 199 | virtual DateList selectedDates(); |
200 | 200 | ||
201 | virtual void printPreview(CalPrinter *calPrinter, | 201 | virtual void printPreview(CalPrinter *calPrinter, |
202 | const QDate &, const QDate &); | 202 | const QDate &, const QDate &); |
203 | bool isMonthView() { return true; } | ||
203 | 204 | ||
204 | MonthViewCell * selectedCell(); | 205 | MonthViewCell * selectedCell(); |
205 | public slots: | 206 | public slots: |
206 | virtual void updateView(); | 207 | virtual void updateView(); |
207 | virtual void updateConfig(); | 208 | virtual void updateConfig(); |
208 | virtual void showDates(const QDate &start, const QDate &end); | 209 | virtual void showDates(const QDate &start, const QDate &end); |
209 | virtual void showEvents(QPtrList<Event> eventList); | 210 | virtual void showEvents(QPtrList<Event> eventList); |
210 | 211 | ||
211 | void changeEventDisplay(Event *, int); | 212 | void changeEventDisplay(Event *, int); |
212 | 213 | ||
213 | void clearSelection(); | 214 | void clearSelection(); |
214 | 215 | ||
215 | void showContextMenu( Incidence * ); | 216 | void showContextMenu( Incidence * ); |
216 | 217 | ||
217 | void setSelectedCell( MonthViewCell * ); | 218 | void setSelectedCell( MonthViewCell * ); |
218 | 219 | ||
219 | protected slots: | 220 | protected slots: |
220 | void processSelectionChange(); | 221 | void processSelectionChange(); |
221 | signals: | 222 | signals: |
222 | void selectWeekNum ( int ); | 223 | void selectWeekNum ( int ); |
223 | protected: | 224 | protected: |
224 | void resizeEvent(QResizeEvent *); | 225 | void resizeEvent(QResizeEvent *); |
225 | void viewChanged(); | 226 | void viewChanged(); |
226 | void updateDayLabels(); | 227 | void updateDayLabels(); |
227 | 228 | ||
228 | private: | 229 | private: |
229 | int mDaysPerWeek; | 230 | int mDaysPerWeek; |
230 | int mNumWeeks; | 231 | int mNumWeeks; |
231 | int mNumCells; | 232 | int mNumCells; |
232 | bool mWeekStartsMonday; | 233 | bool mWeekStartsMonday; |
233 | bool mShowSatSunComp; | 234 | bool mShowSatSunComp; |
234 | void computeLayout(); | 235 | void computeLayout(); |
235 | 236 | ||
236 | QPtrVector<MonthViewCell> mCells; | 237 | QPtrVector<MonthViewCell> mCells; |
237 | QPtrVector<QLabel> mDayLabels; | 238 | QPtrVector<QLabel> mDayLabels; |
238 | QPtrVector<KOWeekButton> mWeekLabels; | 239 | QPtrVector<KOWeekButton> mWeekLabels; |
239 | 240 | ||
240 | bool mShortDayLabels; | 241 | bool mShortDayLabels; |
241 | int mWidthLongDayLabel; | 242 | int mWidthLongDayLabel; |
242 | 243 | ||
243 | QDate mStartDate; | 244 | QDate mStartDate; |
244 | 245 | ||
245 | MonthViewCell *mSelectedCell; | 246 | MonthViewCell *mSelectedCell; |
246 | 247 | ||
247 | KOEventPopupMenu *mContextMenu; | 248 | KOEventPopupMenu *mContextMenu; |
248 | void keyPressEvent ( QKeyEvent * ) ; | 249 | void keyPressEvent ( QKeyEvent * ) ; |
249 | 250 | ||
250 | }; | 251 | }; |
251 | 252 | ||
252 | #endif | 253 | #endif |