-rw-r--r-- | bin/kdepim/WhatsNew.txt | 5 | ||||
-rw-r--r-- | desktop/rpm/kdepim_rpm | 2 | ||||
-rw-r--r-- | korganizer/journalentry.cpp | 4 | ||||
-rw-r--r-- | korganizer/koagenda.cpp | 6 | ||||
-rw-r--r-- | korganizer/koagenda.h | 2 | ||||
-rw-r--r-- | korganizer/kotodoview.cpp | 4 | ||||
-rw-r--r-- | version | 2 |
7 files changed, 18 insertions, 7 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt index d0b2880..f4b3ddb 100644 --- a/bin/kdepim/WhatsNew.txt +++ b/bin/kdepim/WhatsNew.txt | |||
@@ -1,66 +1,71 @@ | |||
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.19 ************ | ||
4 | |||
5 | Fixed a crash in journal view and a crash in setting a todo to stopped when KO/Pi saved the file when "stop todo" dialog was shown. | ||
6 | Fixed a minor problem with the marcus bains line (whatever that is). | ||
7 | |||
3 | ********** VERSION 2.1.18 ************ | 8 | ********** VERSION 2.1.18 ************ |
4 | 9 | ||
5 | Pi-Sync mode: | 10 | Pi-Sync mode: |
6 | The "Write back file" status dialog was updated too often such that writing back the file on the Z was very slow. Fixed. | 11 | The "Write back file" status dialog was updated too often such that writing back the file on the Z was very slow. Fixed. |
7 | 12 | ||
8 | KO/Pi: | 13 | KO/Pi: |
9 | Fixed a layout problem on the Z 5500 with the calender box right of the location box in the event/todo editor. Thanks to Andrew, who found, reported and fixed this problem ( I did not get that problem - it was working on my 5500 ). | 14 | Fixed a layout problem on the Z 5500 with the calender box right of the location box in the event/todo editor. Thanks to Andrew, who found, reported and fixed this problem ( I did not get that problem - it was working on my 5500 ). |
10 | 15 | ||
11 | Fixed a problem when (imported or added from other applications) events or todos did have attachments. | 16 | Fixed a problem when (imported or added from other applications) events or todos did have attachments. |
12 | Fixed a really ugly and hidden problem in the management of the parent/child relationchip of todos. | 17 | Fixed a really ugly and hidden problem in the management of the parent/child relationchip of todos. |
13 | 18 | ||
14 | 19 | ||
15 | ********** VERSION 2.1.17 ************ | 20 | ********** VERSION 2.1.17 ************ |
16 | 21 | ||
17 | KO/Pi: | 22 | KO/Pi: |
18 | Added option to display times in What's Next View on two lines. | 23 | Added option to display times in What's Next View on two lines. |
19 | (Useful for display on the Zaurus with 240x320 screen) | 24 | (Useful for display on the Zaurus with 240x320 screen) |
20 | Removed "Allday" for allday events of one day duration in What's Next View. | 25 | Removed "Allday" for allday events of one day duration in What's Next View. |
21 | Added date range for allday events of more than one day duration in What's Next View. | 26 | Added date range for allday events of more than one day duration in What's Next View. |
22 | Fixed two problems in the data importing from Outlook: | 27 | Fixed two problems in the data importing from Outlook: |
23 | Fixed the duplicated import if the summary, location or description had whitespaces at the end. | 28 | Fixed the duplicated import if the summary, location or description had whitespaces at the end. |
24 | Fixed a problem importing certain recurrence rules. | 29 | Fixed a problem importing certain recurrence rules. |
25 | 30 | ||
26 | A journal in an ics file may have no dtStart value (as files from KNotes, which stores its notes in an ics journal file). | 31 | A journal in an ics file may have no dtStart value (as files from KNotes, which stores its notes in an ics journal file). |
27 | If now a journal has no dtStart value the dtStart value is set to the created value of the journal when loading the file. That makes it possible to view and edit "notes" from KNotes. Simply add another Resource in KO/Pi which is a copy of the ics file from KNotes. You will find the "notes" in KO/Pi as a journal entry on the date you created it. | 32 | If now a journal has no dtStart value the dtStart value is set to the created value of the journal when loading the file. That makes it possible to view and edit "notes" from KNotes. Simply add another Resource in KO/Pi which is a copy of the ics file from KNotes. You will find the "notes" in KO/Pi as a journal entry on the date you created it. |
28 | 33 | ||
29 | And some minor fixes in KO/Pi. | 34 | And some minor fixes in KO/Pi. |
30 | 35 | ||
31 | Fixed a crash on the desktop when closing KO/Pi after accessing adressbook data (Linux + Windows ). | 36 | Fixed a crash on the desktop when closing KO/Pi after accessing adressbook data (Linux + Windows ). |
32 | 37 | ||
33 | 38 | ||
34 | ********** VERSION 2.1.16 ************ | 39 | ********** VERSION 2.1.16 ************ |
35 | 40 | ||
36 | Fixed a problem with the menu bar in KO/Pi and using the "Menu" hardware key on the Zaurus. | 41 | Fixed a problem with the menu bar in KO/Pi and using the "Menu" hardware key on the Zaurus. |
37 | Added columns for datetime in todo view: Last modified, created and last modified subtodo | 42 | Added columns for datetime in todo view: Last modified, created and last modified subtodo |
38 | Fixed a bug in agenda view displaying recurring multiday events which are longer than two days. | 43 | Fixed a bug in agenda view displaying recurring multiday events which are longer than two days. |
39 | Made conflict detection up to 4 times faster. | 44 | Made conflict detection up to 4 times faster. |
40 | 45 | ||
41 | ********** VERSION 2.1.15 ************ | 46 | ********** VERSION 2.1.15 ************ |
42 | 47 | ||
43 | Fixed two layout problems on the Z: | 48 | Fixed two layout problems on the Z: |
44 | Made the with of the newly added buttons on the Quick-Todo smaller. | 49 | Made the with of the newly added buttons on the Quick-Todo smaller. |
45 | Made listweek layout in 2 columns on the Z760 in portait screen and full menubar visible. | 50 | Made listweek layout in 2 columns on the Z760 in portait screen and full menubar visible. |
46 | 51 | ||
47 | 52 | ||
48 | ********** VERSION 2.1.14 ************ | 53 | ********** VERSION 2.1.14 ************ |
49 | 54 | ||
50 | 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. | 55 | 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. |
51 | Added a button to add a subtodo quickly. | 56 | Added a button to add a subtodo quickly. |
52 | 57 | ||
53 | Added a possibility to search for conflicting events. (In the Action menu. Keyboard shortcut "q", shift+q or ctrl +q ). | 58 | Added a possibility to search for conflicting events. (In the Action menu. Keyboard shortcut "q", shift+q or ctrl +q ). |
54 | Added an option to change the layout of the list week to column mode. | 59 | Added an option to change the layout of the list week to column mode. |
55 | 60 | ||
56 | Fixed some usability problems in pi-sync mode by adding some progress information about file transfer. | 61 | Fixed some usability problems in pi-sync mode by adding some progress information about file transfer. |
57 | 62 | ||
58 | Fixed pi-sync problems with the new multi calendar feature. | 63 | Fixed pi-sync problems with the new multi calendar feature. |
59 | Now pi-sync behaviour should be: | 64 | Now pi-sync behaviour should be: |
60 | 1) Local sends file request ( as usual ) | 65 | 1) Local sends file request ( as usual ) |
61 | 2) Remote sends file which contains data of all enabled ( the calendar where the "eye" column is checked ) calendars. | 66 | 2) Remote sends file which contains data of all enabled ( the calendar where the "eye" column is checked ) calendars. |
62 | 3) Local syncs with data, adds new entries to default calendar and sends file back ( as usual ). | 67 | 3) Local syncs with data, adds new entries to default calendar and sends file back ( as usual ). |
63 | If the data which local receives contains entries which are on disabled calendars on local this entries are updated and not added as duplicates to the default calendar. | 68 | If the data which local receives contains entries which are on disabled calendars on local this entries are updated and not added as duplicates to the default calendar. |
64 | 4) Remote updates the data and adds new entries to default calendar. Readonly entries are not changed on remote. | 69 | 4) Remote updates the data and adds new entries to default calendar. Readonly entries are not changed on remote. |
65 | If the data which remote receives contains entries which are on disabled calendars on remote this entries are updated and not added as duplicates to the default calendar. | 70 | If the data which remote receives contains entries which are on disabled calendars on remote this entries are updated and not added as duplicates to the default calendar. |
66 | 71 | ||
diff --git a/desktop/rpm/kdepim_rpm b/desktop/rpm/kdepim_rpm index 133d0d1..a29e4ea 100644 --- a/desktop/rpm/kdepim_rpm +++ b/desktop/rpm/kdepim_rpm | |||
@@ -1,67 +1,67 @@ | |||
1 | Summary: A collection of PIM programs | 1 | Summary: A collection of PIM programs |
2 | Name: KDE-Pim-Pi | 2 | Name: KDE-Pim-Pi |
3 | Version: 2.1.18 | 3 | Version: 2.1.19 |
4 | Release: SuSE_9.2 | 4 | Release: SuSE_9.2 |
5 | Copyright:GPL | 5 | Copyright:GPL |
6 | Group: Productivity/Pim | 6 | Group: Productivity/Pim |
7 | Source:http://sourceforge.net/projects/kdepimpi/ | 7 | Source:http://sourceforge.net/projects/kdepimpi/ |
8 | URL:http://sourceforge.net/projects/kdepimpi/ | 8 | URL:http://sourceforge.net/projects/kdepimpi/ |
9 | Packager: zautrix | 9 | Packager: zautrix |
10 | 10 | ||
11 | %description | 11 | %description |
12 | This package contains the platform-independent PIM programs from | 12 | This package contains the platform-independent PIM programs from |
13 | www.pi-sync.info, compiled for SuSE 9.2: | 13 | www.pi-sync.info, compiled for SuSE 9.2: |
14 | KTimeTacker/Pi | 14 | KTimeTacker/Pi |
15 | KPhone/Pi | 15 | KPhone/Pi |
16 | KAddressbook/Pi | 16 | KAddressbook/Pi |
17 | KOrganizer/Pi | 17 | KOrganizer/Pi |
18 | PasswordManager/Pi | 18 | PasswordManager/Pi |
19 | KOPieMail/Pi | 19 | KOPieMail/Pi |
20 | 20 | ||
21 | These applications do not need anything from the KDE-desktop | 21 | These applications do not need anything from the KDE-desktop |
22 | at all to run on Linux. However, there is a dependency from | 22 | at all to run on Linux. However, there is a dependency from |
23 | two KDE libs, because a small command line program is included | 23 | two KDE libs, because a small command line program is included |
24 | to make it possible to sync with the KDE-desktop applications. | 24 | to make it possible to sync with the KDE-desktop applications. |
25 | 25 | ||
26 | These applications are independent from the KDE-desktop | 26 | These applications are independent from the KDE-desktop |
27 | environment. That means, nothing of your existing | 27 | environment. That means, nothing of your existing |
28 | KDE-desktop setup will be changed, or any data | 28 | KDE-desktop setup will be changed, or any data |
29 | (calendar-addressbook) used by the KDE-desktop | 29 | (calendar-addressbook) used by the KDE-desktop |
30 | applications will be changed or accessed. | 30 | applications will be changed or accessed. |
31 | These applications stores their data and config in | 31 | These applications stores their data and config in |
32 | $HOME/kdepim/ | 32 | $HOME/kdepim/ |
33 | However, because the same file format is used, | 33 | However, because the same file format is used, |
34 | an easy exchange of data with the KDE-desktop | 34 | an easy exchange of data with the KDE-desktop |
35 | is possible. | 35 | is possible. |
36 | A small command line program is included | 36 | A small command line program is included |
37 | to make it possible to sync with the KDE-desktop applications. | 37 | to make it possible to sync with the KDE-desktop applications. |
38 | You do not need to call this program from the commandline, | 38 | You do not need to call this program from the commandline, |
39 | it is called from the KDE-Pim/Pi apps when you choose there: | 39 | it is called from the KDE-Pim/Pi apps when you choose there: |
40 | Sync with KDE_Desktop. | 40 | Sync with KDE_Desktop. |
41 | If something is going wrong, please start the | 41 | If something is going wrong, please start the |
42 | KDE-Pim/Pi program itself from the console to get detailed output. | 42 | KDE-Pim/Pi program itself from the console to get detailed output. |
43 | 43 | ||
44 | After installation, you should have a | 44 | After installation, you should have a |
45 | PIM-pi | 45 | PIM-pi |
46 | folder in your KDE start menu, where you can | 46 | folder in your KDE start menu, where you can |
47 | start the applications from. | 47 | start the applications from. |
48 | 48 | ||
49 | These programs makes it possible to sync your Zaurus easily | 49 | These programs makes it possible to sync your Zaurus easily |
50 | (with the KDE-Pim/Pi programs running on the Zaurus) | 50 | (with the KDE-Pim/Pi programs running on the Zaurus) |
51 | with the KDE-desktop calendar/addressbook data. | 51 | with the KDE-desktop calendar/addressbook data. |
52 | If you want to use that, you have to update your | 52 | If you want to use that, you have to update your |
53 | KDE-desktop to version 3.3.0 or higher. | 53 | KDE-desktop to version 3.3.0 or higher. |
54 | SuSE 9.2 contains KDE 3.3.0 such that no update is needed. | 54 | SuSE 9.2 contains KDE 3.3.0 such that no update is needed. |
55 | Actually - after the (non difficult) configuration is set up - | 55 | Actually - after the (non difficult) configuration is set up - |
56 | with two mouseklicks on the Zaurus, | 56 | with two mouseklicks on the Zaurus, |
57 | the Zaurus syncs with the corresponding KDE-Pim/Pi | 57 | the Zaurus syncs with the corresponding KDE-Pim/Pi |
58 | program on the Linux Desktop which syncs automatically | 58 | program on the Linux Desktop which syncs automatically |
59 | with the KDE-desktop data. | 59 | with the KDE-desktop data. |
60 | 60 | ||
61 | If you want to use the KDE-desktop calendar/addressbook applications, | 61 | If you want to use the KDE-desktop calendar/addressbook applications, |
62 | just install these apps in this package and use them as a syncing tool for the | 62 | just install these apps in this package and use them as a syncing tool for the |
63 | Zaurus <-> KDE-desktop sync. | 63 | Zaurus <-> KDE-desktop sync. |
64 | The sync requires a network connection from your Zaurus to | 64 | The sync requires a network connection from your Zaurus to |
65 | the PC. A detailed Sync HowTo is available in the | 65 | the PC. A detailed Sync HowTo is available in the |
66 | Help menu of the applications. | 66 | Help menu of the applications. |
67 | 67 | ||
diff --git a/korganizer/journalentry.cpp b/korganizer/journalentry.cpp index 5fc3f2f..7f6f221 100644 --- a/korganizer/journalentry.cpp +++ b/korganizer/journalentry.cpp | |||
@@ -189,129 +189,131 @@ void JournalEntry::slotSaveTemplate() | |||
189 | } | 189 | } |
190 | // QString text; | 190 | // QString text; |
191 | QTextStream tsIn( &fileIn ); | 191 | QTextStream tsIn( &fileIn ); |
192 | tsIn.setCodec( QTextCodec::codecForName("utf8") ); | 192 | tsIn.setCodec( QTextCodec::codecForName("utf8") ); |
193 | tsIn << mEditor->text(); | 193 | tsIn << mEditor->text(); |
194 | fileIn.close(); | 194 | fileIn.close(); |
195 | } | 195 | } |
196 | void JournalEntry::slotLoadTemplate() | 196 | void JournalEntry::slotLoadTemplate() |
197 | { | 197 | { |
198 | QString fileName =locateLocal( "templates", "journals" ); | 198 | QString fileName =locateLocal( "templates", "journals" ); |
199 | QDir t_dir; | 199 | QDir t_dir; |
200 | if ( !t_dir.exists(fileName) ) | 200 | if ( !t_dir.exists(fileName) ) |
201 | t_dir.mkdir ( fileName ); | 201 | t_dir.mkdir ( fileName ); |
202 | fileName += "/journal"; | 202 | fileName += "/journal"; |
203 | fileName = KFileDialog::getOpenFileName( fileName , i18n("Insert Journal template"), this ); | 203 | fileName = KFileDialog::getOpenFileName( fileName , i18n("Insert Journal template"), this ); |
204 | if ( fileName.length() == 0 ) | 204 | if ( fileName.length() == 0 ) |
205 | return; | 205 | return; |
206 | QFile fileIn( fileName ); | 206 | QFile fileIn( fileName ); |
207 | if (!fileIn.open( IO_ReadOnly ) ) { | 207 | if (!fileIn.open( IO_ReadOnly ) ) { |
208 | KMessageBox::error( this, i18n("Error loading template file\n '%1'.") | 208 | KMessageBox::error( this, i18n("Error loading template file\n '%1'.") |
209 | .arg( fileName ) ); | 209 | .arg( fileName ) ); |
210 | return; | 210 | return; |
211 | } | 211 | } |
212 | QTextStream tsIn( &fileIn ); | 212 | QTextStream tsIn( &fileIn ); |
213 | tsIn.setCodec( QTextCodec::codecForName("utf8") ); | 213 | tsIn.setCodec( QTextCodec::codecForName("utf8") ); |
214 | QString text = tsIn.read(); | 214 | QString text = tsIn.read(); |
215 | fileIn.close(); | 215 | fileIn.close(); |
216 | int line, col; | 216 | int line, col; |
217 | mEditor->getCursorPosition (& line, & col ); | 217 | mEditor->getCursorPosition (& line, & col ); |
218 | mEditor-> insertAt ( text, line, col, true ); | 218 | mEditor-> insertAt ( text, line, col, true ); |
219 | //mEditor->setIgnoreMark( true ); | 219 | //mEditor->setIgnoreMark( true ); |
220 | } | 220 | } |
221 | void JournalEntry::setDate(const QDate &date) | 221 | void JournalEntry::setDate(const QDate &date) |
222 | { | 222 | { |
223 | showOnlyMode = false; | 223 | showOnlyMode = false; |
224 | writeJournal(); | 224 | writeJournal(); |
225 | mDate = date; | 225 | mDate = date; |
226 | fillCalendar( mCalendar->defaultCalendar() ); | 226 | fillCalendar( mCalendar->defaultCalendar() ); |
227 | } | 227 | } |
228 | void JournalEntry::fillCalendar( int setToID ) | 228 | void JournalEntry::fillCalendar( int setToID ) |
229 | { | 229 | { |
230 | mCalendarBox->clear(); | 230 | mCalendarBox->clear(); |
231 | KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first(); | 231 | KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first(); |
232 | int std = 0; | 232 | int std = 0; |
233 | int count = 0; | 233 | int count = 0; |
234 | while ( kkf ) { | 234 | while ( kkf ) { |
235 | if ( (!kkf->mErrorOnLoad &&! kkf->isReadOnly) || setToID == kkf->mCalNumber ) { | 235 | if ( (!kkf->mErrorOnLoad &&! kkf->isReadOnly) || setToID == kkf->mCalNumber ) { |
236 | if ( setToID ) { | 236 | if ( setToID ) { |
237 | if ( kkf->mCalNumber == setToID ) | 237 | if ( kkf->mCalNumber == setToID ) |
238 | std = count; | 238 | std = count; |
239 | } else { | 239 | } else { |
240 | if ( kkf->isStandard ) { | 240 | if ( kkf->isStandard ) { |
241 | std = count; | 241 | std = count; |
242 | } | 242 | } |
243 | } | 243 | } |
244 | ++count; | 244 | ++count; |
245 | mCalendarBox->insertItem( kkf->mName ); | 245 | mCalendarBox->insertItem( kkf->mName ); |
246 | } | 246 | } |
247 | kkf = KOPrefs::instance()->mCalendars.next(); | 247 | kkf = KOPrefs::instance()->mCalendars.next(); |
248 | } | 248 | } |
249 | mCalendarBox->setCurrentItem( std ); | 249 | mCalendarBox->setCurrentItem( std ); |
250 | } | 250 | } |
251 | 251 | ||
252 | void JournalEntry::toggleShowJournal() | 252 | void JournalEntry::toggleShowJournal() |
253 | { | 253 | { |
254 | if ( mEditor->text().isEmpty() && mTitle->currentText ().isEmpty() ) | ||
255 | return; | ||
254 | if (!mEditor->text().isEmpty() || !mTitle->currentText ().isEmpty()) | 256 | if (!mEditor->text().isEmpty() || !mTitle->currentText ().isEmpty()) |
255 | flushEntry(); | 257 | flushEntry(); |
256 | if ( showOnlyMode ) | 258 | if ( showOnlyMode ) |
257 | emit showJournalOnly( 0 ); | 259 | emit showJournalOnly( 0 ); |
258 | else { | 260 | else { |
259 | // we have to protect mJournal from deleting if mJournal has empty text | 261 | // we have to protect mJournal from deleting if mJournal has empty text |
260 | visibleMode = false; // set to true via :setShowOnly() | 262 | visibleMode = false; // set to true via :setShowOnly() |
261 | emit showJournalOnly( mJournal ); | 263 | emit showJournalOnly( mJournal ); |
262 | //QTimer::singleShot( 0, this, SLOT( setVisibleOn() ) ); | 264 | //QTimer::singleShot( 0, this, SLOT( setVisibleOn() ) ); |
263 | } | 265 | } |
264 | } | 266 | } |
265 | void JournalEntry::setVisibleOn() | 267 | void JournalEntry::setVisibleOn() |
266 | { | 268 | { |
267 | visibleMode = true; | 269 | visibleMode = true; |
268 | } | 270 | } |
269 | void JournalEntry::setShowOnly() | 271 | void JournalEntry::setShowOnly() |
270 | { | 272 | { |
271 | showOnlyMode = true; | 273 | showOnlyMode = true; |
272 | if ( mTitle->currentText().isEmpty() ) | 274 | if ( mTitle->currentText().isEmpty() ) |
273 | mTitle->setFocus(); | 275 | mTitle->setFocus(); |
274 | else | 276 | else |
275 | mEditor->setFocus(); | 277 | mEditor->setFocus(); |
276 | } | 278 | } |
277 | void JournalEntry::setJournal(Journal *journal, bool saveJournal ) | 279 | void JournalEntry::setJournal(Journal *journal, bool saveJournal ) |
278 | { | 280 | { |
279 | if ( saveJournal ) | 281 | if ( saveJournal ) |
280 | writeJournal(); | 282 | writeJournal(); |
281 | mTitle->load( KOLocationBox::SUMMARYJOURNAL ); | 283 | mTitle->load( KOLocationBox::SUMMARYJOURNAL ); |
282 | 284 | ||
283 | mJournal = journal; | 285 | mJournal = journal; |
284 | if ( journal->isReadOnly() ) | 286 | if ( journal->isReadOnly() ) |
285 | mTitle->lineEdit ()->setText(mJournal->summary()+" ("+i18n("readonly")+")"); | 287 | mTitle->lineEdit ()->setText(mJournal->summary()+" ("+i18n("readonly")+")"); |
286 | else | 288 | else |
287 | mTitle->lineEdit ()->setText(mJournal->summary()); | 289 | mTitle->lineEdit ()->setText(mJournal->summary()); |
288 | mEditor->setText(mJournal->description()); | 290 | mEditor->setText(mJournal->description()); |
289 | mTitle->setEnabled (!journal->isReadOnly() ); | 291 | mTitle->setEnabled (!journal->isReadOnly() ); |
290 | mEditor->setReadOnly ( journal->isReadOnly() ); | 292 | mEditor->setReadOnly ( journal->isReadOnly() ); |
291 | mCalendarBox->setEnabled (!journal->isReadOnly() ); | 293 | mCalendarBox->setEnabled (!journal->isReadOnly() ); |
292 | fillCalendar( mJournal->calID() ); | 294 | fillCalendar( mJournal->calID() ); |
293 | } | 295 | } |
294 | 296 | ||
295 | Journal *JournalEntry::journal() const | 297 | Journal *JournalEntry::journal() const |
296 | { | 298 | { |
297 | return mJournal; | 299 | return mJournal; |
298 | } | 300 | } |
299 | 301 | ||
300 | 302 | ||
301 | void JournalEntry::clear() | 303 | void JournalEntry::clear() |
302 | { | 304 | { |
303 | mJournal = 0; | 305 | mJournal = 0; |
304 | mEditor->setText(""); | 306 | mEditor->setText(""); |
305 | mTitle->load( KOLocationBox::SUMMARYJOURNAL ); | 307 | mTitle->load( KOLocationBox::SUMMARYJOURNAL ); |
306 | mTitle->lineEdit ()->setText(""); | 308 | mTitle->lineEdit ()->setText(""); |
307 | } | 309 | } |
308 | 310 | ||
309 | bool JournalEntry::eventFilter( QObject *o, QEvent *e ) | 311 | bool JournalEntry::eventFilter( QObject *o, QEvent *e ) |
310 | { | 312 | { |
311 | // kdDebug() << "JournalEntry::event received " << e->type() << endl; | 313 | // kdDebug() << "JournalEntry::event received " << e->type() << endl; |
312 | 314 | ||
313 | if ( e->type() == QEvent::FocusOut ) { | 315 | if ( e->type() == QEvent::FocusOut ) { |
314 | writeJournal(); | 316 | writeJournal(); |
315 | } | 317 | } |
316 | if ( e->type() == QEvent::KeyPress ) { | 318 | if ( e->type() == QEvent::KeyPress ) { |
317 | QKeyEvent * k = (QKeyEvent *) e; | 319 | QKeyEvent * k = (QKeyEvent *) e; |
diff --git a/korganizer/koagenda.cpp b/korganizer/koagenda.cpp index c738f7e..7e9fa71 100644 --- a/korganizer/koagenda.cpp +++ b/korganizer/koagenda.cpp | |||
@@ -26,129 +26,132 @@ | |||
26 | 26 | ||
27 | #ifndef _WIN32_ | 27 | #ifndef _WIN32_ |
28 | #define protected public | 28 | #define protected public |
29 | #include <qwidget.h> | 29 | #include <qwidget.h> |
30 | #undef protected | 30 | #undef protected |
31 | #endif | 31 | #endif |
32 | #include <qintdict.h> | 32 | #include <qintdict.h> |
33 | #include <qdatetime.h> | 33 | #include <qdatetime.h> |
34 | #include <qapplication.h> | 34 | #include <qapplication.h> |
35 | #include <qpopupmenu.h> | 35 | #include <qpopupmenu.h> |
36 | #include <qcursor.h> | 36 | #include <qcursor.h> |
37 | #include <qpainter.h> | 37 | #include <qpainter.h> |
38 | 38 | ||
39 | #include <kdebug.h> | 39 | #include <kdebug.h> |
40 | #include <klocale.h> | 40 | #include <klocale.h> |
41 | #include <kiconloader.h> | 41 | #include <kiconloader.h> |
42 | #include <kglobal.h> | 42 | #include <kglobal.h> |
43 | 43 | ||
44 | #include "koagendaitem.h" | 44 | #include "koagendaitem.h" |
45 | #include "koprefs.h" | 45 | #include "koprefs.h" |
46 | #include "koglobals.h" | 46 | #include "koglobals.h" |
47 | 47 | ||
48 | #include "koagenda.h" | 48 | #include "koagenda.h" |
49 | 49 | ||
50 | #include <libkcal/event.h> | 50 | #include <libkcal/event.h> |
51 | #include <libkcal/todo.h> | 51 | #include <libkcal/todo.h> |
52 | 52 | ||
53 | #ifndef DESKTOP_VERSION | 53 | #ifndef DESKTOP_VERSION |
54 | #include <qpe/qpeapplication.h> | 54 | #include <qpe/qpeapplication.h> |
55 | #endif | 55 | #endif |
56 | 56 | ||
57 | //extern bool globalFlagBlockPainting; | 57 | //extern bool globalFlagBlockPainting; |
58 | extern int globalFlagBlockAgenda; | 58 | extern int globalFlagBlockAgenda; |
59 | extern int globalFlagBlockAgendaItemPaint; | 59 | extern int globalFlagBlockAgendaItemPaint; |
60 | extern int globalFlagBlockAgendaItemUpdate; | 60 | extern int globalFlagBlockAgendaItemUpdate; |
61 | extern int globalFlagBlockStartup; | 61 | extern int globalFlagBlockStartup; |
62 | 62 | ||
63 | 63 | ||
64 | //////////////////////////////////////////////////////////////////////////// | 64 | //////////////////////////////////////////////////////////////////////////// |
65 | MarcusBains::MarcusBains(KOAgenda *_agenda,const char *name) | 65 | MarcusBains::MarcusBains(KOAgenda *_agenda,const char *name) |
66 | : QFrame(_agenda->viewport(),name), agenda(_agenda) | 66 | : QFrame(_agenda->viewport(),name), agenda(_agenda) |
67 | { | 67 | { |
68 | setLineWidth(0); | 68 | setLineWidth(0); |
69 | setMargin(0); | 69 | setMargin(0); |
70 | setBackgroundColor(Qt::red); | 70 | setBackgroundColor(Qt::red); |
71 | minutes = new QTimer(this); | 71 | minutes = new QTimer(this); |
72 | connect(minutes, SIGNAL(timeout()), this, SLOT(updateLoc())); | 72 | connect(minutes, SIGNAL(timeout()), this, SLOT(updateLoc())); |
73 | minutes->start(0, true); | 73 | minutes->start(0, true); |
74 | mTimeBox = new QLabel(this); | 74 | mTimeBox = new QLabel(this); |
75 | mTimeBox->setAlignment(Qt::AlignRight | Qt::AlignBottom); | 75 | mTimeBox->setAlignment(Qt::AlignRight | Qt::AlignBottom); |
76 | QPalette pal = mTimeBox->palette(); | 76 | QPalette pal = mTimeBox->palette(); |
77 | pal.setColor(QColorGroup::Foreground, Qt::red); | 77 | pal.setColor(QColorGroup::Foreground, Qt::red); |
78 | mTimeBox->setPalette(pal); | 78 | mTimeBox->setPalette(pal); |
79 | //mTimeBox->setAutoMask(true); | 79 | //mTimeBox->setAutoMask(true); |
80 | 80 | ||
81 | agenda->addChild(mTimeBox); | 81 | agenda->addChild(mTimeBox); |
82 | 82 | ||
83 | oldToday = -1; | 83 | oldToday = -1; |
84 | } | 84 | } |
85 | 85 | ||
86 | MarcusBains::~MarcusBains() | 86 | MarcusBains::~MarcusBains() |
87 | { | 87 | { |
88 | //delete minutes; | 88 | //delete minutes; |
89 | } | 89 | } |
90 | 90 | void MarcusBains::hideMe() | |
91 | { | ||
92 | hide(); mTimeBox->hide(); | ||
93 | } | ||
91 | int MarcusBains::todayColumn() | 94 | int MarcusBains::todayColumn() |
92 | { | 95 | { |
93 | QDate currentDate = QDate::currentDate(); | 96 | QDate currentDate = QDate::currentDate(); |
94 | 97 | ||
95 | DateList dateList = agenda->dateList(); | 98 | DateList dateList = agenda->dateList(); |
96 | DateList::ConstIterator it; | 99 | DateList::ConstIterator it; |
97 | int col = 0; | 100 | int col = 0; |
98 | for(it = dateList.begin(); it != dateList.end(); ++it) { | 101 | for(it = dateList.begin(); it != dateList.end(); ++it) { |
99 | if((*it) == currentDate) | 102 | if((*it) == currentDate) |
100 | return KOGlobals::self()->reverseLayout() ? | 103 | return KOGlobals::self()->reverseLayout() ? |
101 | agenda->columns() - 1 - col : col; | 104 | agenda->columns() - 1 - col : col; |
102 | ++col; | 105 | ++col; |
103 | } | 106 | } |
104 | 107 | ||
105 | return -1; | 108 | return -1; |
106 | } | 109 | } |
107 | void MarcusBains::updateLoc() | 110 | void MarcusBains::updateLoc() |
108 | { | 111 | { |
109 | updateLocation(); | 112 | updateLocation(); |
110 | } | 113 | } |
111 | void MarcusBains::updateLocation(bool recalculate) | 114 | void MarcusBains::updateLocation(bool recalculate) |
112 | { | 115 | { |
113 | 116 | ||
114 | QTime tim = QTime::currentTime(); | 117 | QTime tim = QTime::currentTime(); |
115 | //qDebug(" MarcusBains::updateLocation %s ", tim.toString().latin1()); | 118 | //qDebug(" MarcusBains::updateLocation %s ", tim.toString().latin1()); |
116 | if((tim.hour() == 0) && (oldTime.hour()==23)) | 119 | if((tim.hour() == 0) && (oldTime.hour()==23)) |
117 | recalculate = true; | 120 | recalculate = true; |
118 | 121 | ||
119 | int mins = tim.hour()*60 + tim.minute(); | 122 | int mins = tim.hour()*60 + tim.minute(); |
120 | int minutesPerCell = 24 * 60 / agenda->rows(); | 123 | int minutesPerCell = 24 * 60 / agenda->rows(); |
121 | int y = mins*agenda->gridSpacingY()/minutesPerCell; | 124 | int y = mins*agenda->gridSpacingY()/minutesPerCell; |
122 | int today = recalculate ? todayColumn() : oldToday; | 125 | int today = recalculate ? todayColumn() : oldToday; |
123 | int x = agenda->gridSpacingX()*today; | 126 | int x = agenda->gridSpacingX()*today; |
124 | bool disabled = !(KOPrefs::instance()->mMarcusBainsEnabled); | 127 | bool disabled = !(KOPrefs::instance()->mMarcusBainsEnabled); |
125 | 128 | ||
126 | oldTime = tim; | 129 | oldTime = tim; |
127 | oldToday = today; | 130 | oldToday = today; |
128 | 131 | ||
129 | if(disabled || (today<0)) { | 132 | if(disabled || (today<0)) { |
130 | hide(); mTimeBox->hide(); | 133 | hide(); mTimeBox->hide(); |
131 | return; | 134 | return; |
132 | } else { | 135 | } else { |
133 | show(); mTimeBox->show(); | 136 | show(); mTimeBox->show(); |
134 | } | 137 | } |
135 | 138 | ||
136 | if(recalculate) | 139 | if(recalculate) |
137 | setFixedSize(agenda->gridSpacingX(),1); | 140 | setFixedSize(agenda->gridSpacingX(),1); |
138 | agenda->moveChild(this, x, y); | 141 | agenda->moveChild(this, x, y); |
139 | raise(); | 142 | raise(); |
140 | 143 | ||
141 | if(recalculate) | 144 | if(recalculate) |
142 | //mTimeBox->setFont(QFont("helvetica",10)); | 145 | //mTimeBox->setFont(QFont("helvetica",10)); |
143 | mTimeBox->setFont(KOPrefs::instance()->mMarcusBainsFont); | 146 | mTimeBox->setFont(KOPrefs::instance()->mMarcusBainsFont); |
144 | 147 | ||
145 | mTimeBox->setText(KGlobal::locale()->formatTime(tim, KOPrefs::instance()->mMarcusBainsShowSeconds)); | 148 | mTimeBox->setText(KGlobal::locale()->formatTime(tim, KOPrefs::instance()->mMarcusBainsShowSeconds)); |
146 | mTimeBox->adjustSize(); | 149 | mTimeBox->adjustSize(); |
147 | // the -2 below is there because there is a bug in this program | 150 | // the -2 below is there because there is a bug in this program |
148 | // somewhere, where the last column of this widget is a few pixels | 151 | // somewhere, where the last column of this widget is a few pixels |
149 | // narrower than the other columns. | 152 | // narrower than the other columns. |
150 | int offs = (today==agenda->columns()-1) ? -4 : 0; | 153 | int offs = (today==agenda->columns()-1) ? -4 : 0; |
151 | agenda->moveChild(mTimeBox, | 154 | agenda->moveChild(mTimeBox, |
152 | x+agenda->gridSpacingX()-mTimeBox->width()+offs-1, | 155 | x+agenda->gridSpacingX()-mTimeBox->width()+offs-1, |
153 | y-mTimeBox->height()); | 156 | y-mTimeBox->height()); |
154 | mTimeBox->raise(); | 157 | mTimeBox->raise(); |
@@ -311,128 +314,129 @@ void KOAgenda::init() | |||
311 | SLOT(checkScrollBoundaries(int))); | 314 | SLOT(checkScrollBoundaries(int))); |
312 | 315 | ||
313 | // Create the Marcus Bains line. | 316 | // Create the Marcus Bains line. |
314 | if(mAllDayMode) | 317 | if(mAllDayMode) |
315 | mMarcusBains = 0; | 318 | mMarcusBains = 0; |
316 | else { | 319 | else { |
317 | mMarcusBains = new MarcusBains(this); | 320 | mMarcusBains = new MarcusBains(this); |
318 | addChild(mMarcusBains); | 321 | addChild(mMarcusBains); |
319 | } | 322 | } |
320 | mPopupKind = 0; | 323 | mPopupKind = 0; |
321 | mPopupItem = 0; | 324 | mPopupItem = 0; |
322 | mInvalidPixmap = false; | 325 | mInvalidPixmap = false; |
323 | 326 | ||
324 | } | 327 | } |
325 | 328 | ||
326 | void KOAgenda::shrinkPixmap() | 329 | void KOAgenda::shrinkPixmap() |
327 | { | 330 | { |
328 | mPaintPixmap.resize( 20,20); | 331 | mPaintPixmap.resize( 20,20); |
329 | mInvalidPixmap = true; | 332 | mInvalidPixmap = true; |
330 | } | 333 | } |
331 | void KOAgenda::slotContentMove(int,int) | 334 | void KOAgenda::slotContentMove(int,int) |
332 | { | 335 | { |
333 | emit sendPing(); | 336 | emit sendPing(); |
334 | if ( mActionType == NOP ) | 337 | if ( mActionType == NOP ) |
335 | slotClearSelection(); | 338 | slotClearSelection(); |
336 | if ( mSelectedItem && !mActionItem ) { | 339 | if ( mSelectedItem && !mActionItem ) { |
337 | deselectItem(); | 340 | deselectItem(); |
338 | emit incidenceSelected( 0 ); | 341 | emit incidenceSelected( 0 ); |
339 | } | 342 | } |
340 | } | 343 | } |
341 | void KOAgenda::clear() | 344 | void KOAgenda::clear() |
342 | { | 345 | { |
343 | KOAgendaItem *item; | 346 | KOAgendaItem *item; |
344 | for ( item=mItems.first(); item != 0; item=mItems.next() ) { | 347 | for ( item=mItems.first(); item != 0; item=mItems.next() ) { |
345 | mUnusedItems.append( item ); | 348 | mUnusedItems.append( item ); |
346 | //item->hide(); | 349 | //item->hide(); |
347 | } | 350 | } |
348 | mItems.clear(); | 351 | mItems.clear(); |
349 | mSelectedItem = 0; | 352 | mSelectedItem = 0; |
350 | clearSelection(); | 353 | clearSelection(); |
351 | } | 354 | } |
352 | 355 | ||
353 | void KOAgenda::clearSelection() | 356 | void KOAgenda::clearSelection() |
354 | { | 357 | { |
355 | mSelectionCellX = 0; | 358 | mSelectionCellX = 0; |
356 | mSelectionYTop = 0; | 359 | mSelectionYTop = 0; |
357 | mSelectionHeight = 0; | 360 | mSelectionHeight = 0; |
358 | } | 361 | } |
359 | 362 | ||
360 | void KOAgenda::marcus_bains() | 363 | void KOAgenda::marcus_bains() |
361 | { | 364 | { |
362 | if(mMarcusBains) mMarcusBains->updateLocation(true); | 365 | if(mMarcusBains) mMarcusBains->updateLocation(true); |
363 | } | 366 | } |
364 | 367 | ||
365 | 368 | ||
366 | void KOAgenda::changeColumns(int columns) | 369 | void KOAgenda::changeColumns(int columns) |
367 | { | 370 | { |
368 | if (columns == 0) { | 371 | if (columns == 0) { |
369 | qDebug("KOAgenda::changeColumns() called with argument 0 "); | 372 | qDebug("KOAgenda::changeColumns() called with argument 0 "); |
370 | return; | 373 | return; |
371 | } | 374 | } |
372 | clear(); | 375 | clear(); |
373 | mColumns = columns; | 376 | mColumns = columns; |
374 | computeSizes(); | 377 | computeSizes(); |
378 | if(mMarcusBains) mMarcusBains->hideMe(); | ||
375 | } | 379 | } |
376 | 380 | ||
377 | /* | 381 | /* |
378 | This is the eventFilter function, which gets all events from the KOAgendaItems | 382 | This is the eventFilter function, which gets all events from the KOAgendaItems |
379 | contained in the agenda. It has to handle moving and resizing for all items. | 383 | contained in the agenda. It has to handle moving and resizing for all items. |
380 | */ | 384 | */ |
381 | bool KOAgenda::eventFilter ( QObject *object, QEvent *event ) | 385 | bool KOAgenda::eventFilter ( QObject *object, QEvent *event ) |
382 | { | 386 | { |
383 | // kdDebug() << "KOAgenda::eventFilter" << endl; | 387 | // kdDebug() << "KOAgenda::eventFilter" << endl; |
384 | switch(event->type()) { | 388 | switch(event->type()) { |
385 | case QEvent::MouseButtonPress: | 389 | case QEvent::MouseButtonPress: |
386 | case QEvent::MouseButtonDblClick: | 390 | case QEvent::MouseButtonDblClick: |
387 | case QEvent::MouseButtonRelease: | 391 | case QEvent::MouseButtonRelease: |
388 | case QEvent::MouseMove: | 392 | case QEvent::MouseMove: |
389 | return eventFilter_mouse(object, static_cast<QMouseEvent *>(event)); | 393 | return eventFilter_mouse(object, static_cast<QMouseEvent *>(event)); |
390 | 394 | ||
391 | case (QEvent::Leave): | 395 | case (QEvent::Leave): |
392 | if (!mActionItem) | 396 | if (!mActionItem) |
393 | setCursor(arrowCursor); | 397 | setCursor(arrowCursor); |
394 | return true; | 398 | return true; |
395 | 399 | ||
396 | default: | 400 | default: |
397 | return QScrollView::eventFilter(object,event); | 401 | return QScrollView::eventFilter(object,event); |
398 | } | 402 | } |
399 | } | 403 | } |
400 | void KOAgenda::popupMenu() | 404 | void KOAgenda::popupMenu() |
401 | { | 405 | { |
402 | mPopupTimer->stop(); | 406 | mPopupTimer->stop(); |
403 | if ( mPopupKind == 1 || mPopupKind == 3 ) { | 407 | if ( mPopupKind == 1 || mPopupKind == 3 ) { |
404 | if (mActionItem ) { | 408 | if (mActionItem ) { |
405 | endItemAction(); | 409 | endItemAction(); |
406 | } | 410 | } |
407 | mLeftMouseDown = false; // no more leftMouse computation | 411 | mLeftMouseDown = false; // no more leftMouse computation |
408 | if (mPopupItem) { | 412 | if (mPopupItem) { |
409 | //mClickedItem = mPopupItem; | 413 | //mClickedItem = mPopupItem; |
410 | selectItem(mPopupItem); | 414 | selectItem(mPopupItem); |
411 | if ( mAllAgendaPopup && KOPrefs::instance()->mBlockPopupMenu && mPopupKind == 1 ) | 415 | if ( mAllAgendaPopup && KOPrefs::instance()->mBlockPopupMenu && mPopupKind == 1 ) |
412 | mAllAgendaPopup->installEventFilter( this ); | 416 | mAllAgendaPopup->installEventFilter( this ); |
413 | emit showIncidencePopupSignal(mPopupItem->incidence()); | 417 | emit showIncidencePopupSignal(mPopupItem->incidence()); |
414 | 418 | ||
415 | } | 419 | } |
416 | } else if ( mPopupKind == 2 || mPopupKind == 4 ) { | 420 | } else if ( mPopupKind == 2 || mPopupKind == 4 ) { |
417 | if ( mLeftMouseDown ) { // we have a simulated right click - clear left mouse action | 421 | if ( mLeftMouseDown ) { // we have a simulated right click - clear left mouse action |
418 | endSelectAction( false ); // do not emit new event signal | 422 | endSelectAction( false ); // do not emit new event signal |
419 | mLeftMouseDown = false; // no more leftMouse computation | 423 | mLeftMouseDown = false; // no more leftMouse computation |
420 | } | 424 | } |
421 | if ( KOPrefs::instance()->mBlockPopupMenu && mPopupKind == 2 ) | 425 | if ( KOPrefs::instance()->mBlockPopupMenu && mPopupKind == 2 ) |
422 | mNewItemPopup->installEventFilter( this ); | 426 | mNewItemPopup->installEventFilter( this ); |
423 | mNewItemPopup->popup( mPopupPos); | 427 | mNewItemPopup->popup( mPopupPos); |
424 | 428 | ||
425 | } | 429 | } |
426 | mLeftMouseDown = false; | 430 | mLeftMouseDown = false; |
427 | mPopupItem = 0; | 431 | mPopupItem = 0; |
428 | mPopupKind = 0; | 432 | mPopupKind = 0; |
429 | } | 433 | } |
430 | void KOAgenda::categoryChanged(Incidence * inc) | 434 | void KOAgenda::categoryChanged(Incidence * inc) |
431 | { | 435 | { |
432 | KOAgendaItem *item; | 436 | KOAgendaItem *item; |
433 | for ( item=mItems.first(); item != 0; item=mItems.next() ) { | 437 | for ( item=mItems.first(); item != 0; item=mItems.next() ) { |
434 | if ( item->incidence() == inc ) { | 438 | if ( item->incidence() == inc ) { |
435 | item->initColor (); | 439 | item->initColor (); |
436 | item->updateItem(); | 440 | item->updateItem(); |
437 | } | 441 | } |
438 | } | 442 | } |
diff --git a/korganizer/koagenda.h b/korganizer/koagenda.h index 86cf2f4..59e7472 100644 --- a/korganizer/koagenda.h +++ b/korganizer/koagenda.h | |||
@@ -1,115 +1,115 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of KOrganizer. | 2 | This file is part of KOrganizer. |
3 | Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> | 3 | Copyright (c) 2001 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 KOAGENDA_H | 23 | #ifndef KOAGENDA_H |
24 | #define KOAGENDA_H | 24 | #define KOAGENDA_H |
25 | 25 | ||
26 | #include <qscrollview.h> | 26 | #include <qscrollview.h> |
27 | #include <qtimer.h> | 27 | #include <qtimer.h> |
28 | #include <qmemarray.h> | 28 | #include <qmemarray.h> |
29 | #include <qpainter.h> | 29 | #include <qpainter.h> |
30 | #include <qpixmap.h> | 30 | #include <qpixmap.h> |
31 | #include <qguardedptr.h> | 31 | #include <qguardedptr.h> |
32 | 32 | ||
33 | #include "koagendaitem.h" | 33 | #include "koagendaitem.h" |
34 | #include "koeventview.h" | 34 | #include "koeventview.h" |
35 | 35 | ||
36 | class QPopupMenu; | 36 | class QPopupMenu; |
37 | class QTime; | 37 | class QTime; |
38 | class KConfig; | 38 | class KConfig; |
39 | class QFrame; | 39 | class QFrame; |
40 | class KOAgenda; | 40 | class KOAgenda; |
41 | class KCal::Event; | 41 | class KCal::Event; |
42 | class KCal::Todo; | 42 | class KCal::Todo; |
43 | 43 | ||
44 | using namespace KCal; | 44 | using namespace KCal; |
45 | 45 | ||
46 | class MarcusBains : public QFrame { | 46 | class MarcusBains : public QFrame { |
47 | Q_OBJECT | 47 | Q_OBJECT |
48 | public: | 48 | public: |
49 | MarcusBains(KOAgenda *agenda=0,const char *name=0); | 49 | MarcusBains(KOAgenda *agenda=0,const char *name=0); |
50 | virtual ~MarcusBains(); | 50 | virtual ~MarcusBains(); |
51 | 51 | void hideMe(); | |
52 | public slots: | 52 | public slots: |
53 | void updateLocation(bool recalculate=false); | 53 | void updateLocation(bool recalculate=false); |
54 | void updateLoc(); | 54 | void updateLoc(); |
55 | 55 | ||
56 | private: | 56 | private: |
57 | int todayColumn(); | 57 | int todayColumn(); |
58 | QTimer *minutes; | 58 | QTimer *minutes; |
59 | QLabel *mTimeBox; | 59 | QLabel *mTimeBox; |
60 | KOAgenda *agenda; | 60 | KOAgenda *agenda; |
61 | QTime oldTime; | 61 | QTime oldTime; |
62 | int oldToday; | 62 | int oldToday; |
63 | }; | 63 | }; |
64 | 64 | ||
65 | 65 | ||
66 | class KOAgenda : public QScrollView | 66 | class KOAgenda : public QScrollView |
67 | { | 67 | { |
68 | Q_OBJECT | 68 | Q_OBJECT |
69 | public: | 69 | public: |
70 | enum MouseActionType { NOP, MOVE, SELECT, | 70 | enum MouseActionType { NOP, MOVE, SELECT, |
71 | RESIZETOP, RESIZEBOTTOM, RESIZELEFT, RESIZERIGHT }; | 71 | RESIZETOP, RESIZEBOTTOM, RESIZELEFT, RESIZERIGHT }; |
72 | 72 | ||
73 | KOAgenda ( int columns, int rows, int columnSize, QWidget * parent=0, | 73 | KOAgenda ( int columns, int rows, int columnSize, QWidget * parent=0, |
74 | const char * name=0, WFlags f=0 ); | 74 | const char * name=0, WFlags f=0 ); |
75 | KOAgenda ( int columns, QWidget * parent=0, | 75 | KOAgenda ( int columns, QWidget * parent=0, |
76 | const char * name=0, WFlags f=0 ); | 76 | const char * name=0, WFlags f=0 ); |
77 | virtual ~KOAgenda(); | 77 | virtual ~KOAgenda(); |
78 | bool mInvalidPixmap; | 78 | bool mInvalidPixmap; |
79 | 79 | ||
80 | Incidence *selectedIncidence() const; | 80 | Incidence *selectedIncidence() const; |
81 | QDate selectedIncidenceDate() const; | 81 | QDate selectedIncidenceDate() const; |
82 | 82 | ||
83 | virtual bool eventFilter ( QObject *, QEvent * ); | 83 | virtual bool eventFilter ( QObject *, QEvent * ); |
84 | 84 | ||
85 | void contentsToGrid (int x, int y, int& gx, int& gy); | 85 | void contentsToGrid (int x, int y, int& gx, int& gy); |
86 | void gridToContents (int gx, int gy, int& x, int& y); | 86 | void gridToContents (int gx, int gy, int& x, int& y); |
87 | 87 | ||
88 | int timeToY (const QTime &time); | 88 | int timeToY (const QTime &time); |
89 | QTime gyToTime (int y); | 89 | QTime gyToTime (int y); |
90 | 90 | ||
91 | void setStartHour(int startHour); | 91 | void setStartHour(int startHour); |
92 | 92 | ||
93 | KOAgendaItem *insertItem (Incidence *event,QDate qd,int X,int YTop,int YBottom); | 93 | KOAgendaItem *insertItem (Incidence *event,QDate qd,int X,int YTop,int YBottom); |
94 | KOAgendaItem *insertAllDayItem (Incidence *event,QDate qd,int XBegin,int XEnd); | 94 | KOAgendaItem *insertAllDayItem (Incidence *event,QDate qd,int XBegin,int XEnd); |
95 | void insertMultiItem (Event *event,QDate qd,int XBegin,int XEnd, | 95 | void insertMultiItem (Event *event,QDate qd,int XBegin,int XEnd, |
96 | int YTop,int YBottom); | 96 | int YTop,int YBottom); |
97 | 97 | ||
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 */ |
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp index f46a103..82c0f4c 100644 --- a/korganizer/kotodoview.cpp +++ b/korganizer/kotodoview.cpp | |||
@@ -1296,146 +1296,146 @@ void KOTodoView::changedCategories(int index) | |||
1296 | mActiveItem->todo()->setRevision( mActiveItem->todo()->revision()+1 ); | 1296 | mActiveItem->todo()->setRevision( mActiveItem->todo()->revision()+1 ); |
1297 | todoModified (mActiveItem->todo (), KOGlobals::CATEGORY_MODIFIED); | 1297 | todoModified (mActiveItem->todo (), KOGlobals::CATEGORY_MODIFIED); |
1298 | } | 1298 | } |
1299 | } | 1299 | } |
1300 | void KOTodoView::itemDoubleClicked(QListViewItem *item) | 1300 | void KOTodoView::itemDoubleClicked(QListViewItem *item) |
1301 | { | 1301 | { |
1302 | if ( pendingSubtodo != 0 ) { | 1302 | if ( pendingSubtodo != 0 ) { |
1303 | topLevelWidget()->setCaption(i18n("Reparenting aborted!")); | 1303 | topLevelWidget()->setCaption(i18n("Reparenting aborted!")); |
1304 | } | 1304 | } |
1305 | pendingSubtodo = 0; | 1305 | pendingSubtodo = 0; |
1306 | //int row = mTodoListView->header()->sectionAt ( mTodoListView->header()->mapFromGlobal( QCursor::pos()).x() ); | 1306 | //int row = mTodoListView->header()->sectionAt ( mTodoListView->header()->mapFromGlobal( QCursor::pos()).x() ); |
1307 | int row = mTodoListView->header()->sectionAt ( mTodoListView->viewportToContents(mTodoListView->viewport()->mapFromGlobal( QCursor::pos())) .x() ); | 1307 | int row = mTodoListView->header()->sectionAt ( mTodoListView->viewportToContents(mTodoListView->viewport()->mapFromGlobal( QCursor::pos())) .x() ); |
1308 | //qDebug("ROW %d ", row); | 1308 | //qDebug("ROW %d ", row); |
1309 | if (!item) { | 1309 | if (!item) { |
1310 | newTodo(); | 1310 | newTodo(); |
1311 | return; | 1311 | return; |
1312 | } else { | 1312 | } else { |
1313 | if ( row == 1 ) { | 1313 | if ( row == 1 ) { |
1314 | mActiveItem = (KOTodoViewItem *) item; | 1314 | mActiveItem = (KOTodoViewItem *) item; |
1315 | newSubTodo(); | 1315 | newSubTodo(); |
1316 | return; | 1316 | return; |
1317 | } | 1317 | } |
1318 | if ( row == 5 || row == 6 || row == 2) { | 1318 | if ( row == 5 || row == 6 || row == 2) { |
1319 | mActiveItem = (KOTodoViewItem *) item; | 1319 | mActiveItem = (KOTodoViewItem *) item; |
1320 | Todo * t = mActiveItem->todo(); | 1320 | Todo * t = mActiveItem->todo(); |
1321 | if ( t->isRunning() ) { | 1321 | if ( t->isRunning() ) { |
1322 | if ( t->runTime() < 15) { | 1322 | if ( t->runTime() < 15) { |
1323 | t->stopRunning(); | 1323 | t->stopRunning(); |
1324 | mActiveItem->construct(); | 1324 | mActiveItem->construct(); |
1325 | topLevelWidget()->setCaption(i18n("Todo stopped - no data saved because runtime was < 15 sec!")); | 1325 | topLevelWidget()->setCaption(i18n("Todo stopped - no data saved because runtime was < 15 sec!")); |
1326 | return; | 1326 | return; |
1327 | } | 1327 | } |
1328 | else | 1328 | else |
1329 | toggleRunningItem(); | 1329 | toggleRunningItem(); |
1330 | return; | 1330 | return; |
1331 | } else { | 1331 | } else { |
1332 | t->setRunning( true ); | 1332 | t->setRunning( true ); |
1333 | mActiveItem->construct(); | 1333 | mActiveItem->construct(); |
1334 | topLevelWidget()->setCaption(i18n("Todo started! Double click again to stop!")); | 1334 | topLevelWidget()->setCaption(i18n("Todo started! Double click again to stop!")); |
1335 | return; | 1335 | return; |
1336 | } | 1336 | } |
1337 | } | 1337 | } |
1338 | } | 1338 | } |
1339 | if ( KOPrefs::instance()->mEditOnDoubleClick ) | 1339 | if ( KOPrefs::instance()->mEditOnDoubleClick ) |
1340 | editItem( item ); | 1340 | editItem( item ); |
1341 | else | 1341 | else |
1342 | showItem( item , QPoint(), 0 ); | 1342 | showItem( item , QPoint(), 0 ); |
1343 | } | 1343 | } |
1344 | void KOTodoView::toggleRunningItem() | 1344 | void KOTodoView::toggleRunningItem() |
1345 | { | 1345 | { |
1346 | // qDebug("KOTodoView::toggleRunning() "); | 1346 | // qDebug("KOTodoView::toggleRunning() "); |
1347 | if ( ! mActiveItem ) | 1347 | if ( ! mActiveItem ) |
1348 | return; | 1348 | return; |
1349 | Todo * t = mActiveItem->todo(); | 1349 | Todo * t = mActiveItem->todo(); |
1350 | if ( t->isRunning() ) { | 1350 | if ( t->isRunning() ) { |
1351 | KOStopTodoPrefs tp ( t, this ); | 1351 | KOStopTodoPrefs tp ( t, this ); |
1352 | if (QApplication::desktop()->width() <= 800 ){ | 1352 | if (QApplication::desktop()->width() <= 800 ){ |
1353 | int wid = tp.width(); | 1353 | int wid = tp.width(); |
1354 | int hei = tp.height(); | 1354 | int hei = tp.height(); |
1355 | int xx = (QApplication::desktop()->width()-wid)/2; | 1355 | int xx = (QApplication::desktop()->width()-wid)/2; |
1356 | int yy = (QApplication::desktop()->height()-hei)/2; | 1356 | int yy = (QApplication::desktop()->height()-hei)/2; |
1357 | tp.setGeometry( xx,yy,wid,hei ); | 1357 | tp.setGeometry( xx,yy,wid,hei ); |
1358 | } | 1358 | } |
1359 | tp.exec(); | 1359 | tp.exec(); |
1360 | mActiveItem->construct(); | 1360 | updateTodo ( t, 0 ); |
1361 | } else { | 1361 | } else { |
1362 | KOStartTodoPrefs tp ( t->summary(), this ); | 1362 | KOStartTodoPrefs tp ( t->summary(), this ); |
1363 | if (QApplication::desktop()->width() <= 800 ){ | 1363 | if (QApplication::desktop()->width() <= 800 ){ |
1364 | int wid = tp.width(); | 1364 | int wid = tp.width(); |
1365 | int hei = tp.height(); | 1365 | int hei = tp.height(); |
1366 | int xx = (QApplication::desktop()->width()-wid)/2; | 1366 | int xx = (QApplication::desktop()->width()-wid)/2; |
1367 | int yy = (QApplication::desktop()->height()-hei)/2; | 1367 | int yy = (QApplication::desktop()->height()-hei)/2; |
1368 | tp.setGeometry( xx,yy,wid,hei ); | 1368 | tp.setGeometry( xx,yy,wid,hei ); |
1369 | } | 1369 | } |
1370 | if ( !tp.exec() ) return; | 1370 | if ( !tp.exec() ) return; |
1371 | if ( tp.stopAll() ) { | 1371 | if ( tp.stopAll() ) { |
1372 | mCalendar->stopAllTodos(); | 1372 | mCalendar->stopAllTodos(); |
1373 | t->setRunning( true ); | 1373 | t->setRunning( true ); |
1374 | updateView(); | 1374 | updateView(); |
1375 | } else { | 1375 | } else { |
1376 | t->setRunning( true ); | 1376 | t->setRunning( true ); |
1377 | mActiveItem->construct(); | 1377 | updateTodo ( t, 0 ); |
1378 | } | 1378 | } |
1379 | } | 1379 | } |
1380 | } | 1380 | } |
1381 | 1381 | ||
1382 | void KOTodoView::itemClicked(QListViewItem *item) | 1382 | void KOTodoView::itemClicked(QListViewItem *item) |
1383 | { | 1383 | { |
1384 | //qDebug("KOTodoView::itemClicked %d", item); | 1384 | //qDebug("KOTodoView::itemClicked %d", item); |
1385 | if (!item) { | 1385 | if (!item) { |
1386 | if ( pendingSubtodo != 0 ) { | 1386 | if ( pendingSubtodo != 0 ) { |
1387 | topLevelWidget()->setCaption(i18n("Reparenting aborted!")); | 1387 | topLevelWidget()->setCaption(i18n("Reparenting aborted!")); |
1388 | } | 1388 | } |
1389 | pendingSubtodo = 0; | 1389 | pendingSubtodo = 0; |
1390 | return; | 1390 | return; |
1391 | } | 1391 | } |
1392 | KOTodoViewItem *todoItem = (KOTodoViewItem *)item; | 1392 | KOTodoViewItem *todoItem = (KOTodoViewItem *)item; |
1393 | if ( pendingSubtodo != 0 ) { | 1393 | if ( pendingSubtodo != 0 ) { |
1394 | bool allowReparent = true; | 1394 | bool allowReparent = true; |
1395 | QListViewItem *par = item; | 1395 | QListViewItem *par = item; |
1396 | while ( par ) { | 1396 | while ( par ) { |
1397 | if ( par == pendingSubtodo ) { | 1397 | if ( par == pendingSubtodo ) { |
1398 | allowReparent = false; | 1398 | allowReparent = false; |
1399 | break; | 1399 | break; |
1400 | } | 1400 | } |
1401 | par = par->parent(); | 1401 | par = par->parent(); |
1402 | } | 1402 | } |
1403 | if ( !allowReparent ) { | 1403 | if ( !allowReparent ) { |
1404 | topLevelWidget()->setCaption(i18n("Recursive reparenting not possible!")); | 1404 | topLevelWidget()->setCaption(i18n("Recursive reparenting not possible!")); |
1405 | pendingSubtodo = 0; | 1405 | pendingSubtodo = 0; |
1406 | } else { | 1406 | } else { |
1407 | Todo* newParent = todoItem->todo(); | 1407 | Todo* newParent = todoItem->todo(); |
1408 | Todo* newSub = pendingSubtodo->todo(); | 1408 | Todo* newSub = pendingSubtodo->todo(); |
1409 | pendingSubtodo = 0; | 1409 | pendingSubtodo = 0; |
1410 | emit reparentTodoSignal( newParent,newSub ); | 1410 | emit reparentTodoSignal( newParent,newSub ); |
1411 | return; | 1411 | return; |
1412 | } | 1412 | } |
1413 | } | 1413 | } |
1414 | 1414 | ||
1415 | } | 1415 | } |
1416 | 1416 | ||
1417 | void KOTodoView::setDocumentId( const QString &id ) | 1417 | void KOTodoView::setDocumentId( const QString &id ) |
1418 | { | 1418 | { |
1419 | 1419 | ||
1420 | mDocPrefs->setDoc( id ); | 1420 | mDocPrefs->setDoc( id ); |
1421 | } | 1421 | } |
1422 | 1422 | ||
1423 | void KOTodoView::itemStateChanged( QListViewItem *item ) | 1423 | void KOTodoView::itemStateChanged( QListViewItem *item ) |
1424 | { | 1424 | { |
1425 | if (!item) return; | 1425 | if (!item) return; |
1426 | 1426 | ||
1427 | KOTodoViewItem *todoItem = (KOTodoViewItem *)item; | 1427 | KOTodoViewItem *todoItem = (KOTodoViewItem *)item; |
1428 | 1428 | ||
1429 | // kdDebug() << "KOTodoView::itemStateChanged(): " << todoItem->todo()->summary() << endl; | 1429 | // kdDebug() << "KOTodoView::itemStateChanged(): " << todoItem->todo()->summary() << endl; |
1430 | 1430 | ||
1431 | if( mDocPrefs ) mDocPrefs->writeEntry( todoItem->todo()->uid(), todoItem->isOpen() ); | 1431 | if( mDocPrefs ) mDocPrefs->writeEntry( todoItem->todo()->uid(), todoItem->isOpen() ); |
1432 | } | 1432 | } |
1433 | 1433 | ||
1434 | void KOTodoView::saveLayout(KConfig *config, const QString &group) const | 1434 | void KOTodoView::saveLayout(KConfig *config, const QString &group) const |
1435 | { | 1435 | { |
1436 | mTodoListView->saveLayout(config,group); | 1436 | mTodoListView->saveLayout(config,group); |
1437 | } | 1437 | } |
1438 | 1438 | ||
1439 | void KOTodoView::restoreLayout(KConfig *config, const QString &group) | 1439 | void KOTodoView::restoreLayout(KConfig *config, const QString &group) |
1440 | { | 1440 | { |
1441 | mTodoListView->restoreLayout(config,group); | 1441 | mTodoListView->restoreLayout(config,group); |
@@ -1 +1 @@ | |||
version = "2.1.18"; | version = "2.1.19"; | ||