summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-01-15 00:20:28 (UTC)
committer zautrix <zautrix>2005-01-15 00:20:28 (UTC)
commit80da9080c1c33c4704806c442179522edce06bd2 (patch) (unidiff)
treef17bfb786b7c85d4d3bf93545494dafdf9ec5184
parentd937154e5ae3691dda55fac9114142f92e29e37b (diff)
downloadkdepimpi-80da9080c1c33c4704806c442179522edce06bd2.zip
kdepimpi-80da9080c1c33c4704806c442179522edce06bd2.tar.gz
kdepimpi-80da9080c1c33c4704806c442179522edce06bd2.tar.bz2
completed todo
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/WhatsNew.txt3
-rw-r--r--korganizer/calendarview.cpp2
-rw-r--r--korganizer/koeventviewerdialog.cpp20
-rw-r--r--korganizer/koeventviewerdialog.h1
-rw-r--r--korganizer/koviewmanager.h2
5 files changed, 25 insertions, 3 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt
index 5be1d28..da33d12 100644
--- a/bin/kdepim/WhatsNew.txt
+++ b/bin/kdepim/WhatsNew.txt
@@ -1,199 +1,202 @@
1Info about the changes in new versions of KDE-Pim/Pi 1Info about the changes in new versions of KDE-Pim/Pi
2 2
3********** VERSION 1.9.17 ************ 3********** VERSION 1.9.17 ************
4 4
5KO/Pi: 5KO/Pi:
6Fixed that tooltips were not updated after moving an item in agenda view. 6Fixed that tooltips were not updated after moving an item in agenda view.
7Fixed a bug in sorting start date for recurring events in list view. 7Fixed a bug in sorting start date for recurring events in list view.
8Changed the left button in todo viewer from "Agenda" to "Set completed".
9This makes it possible to change a todo in the What's Next View quickly to the completed state without leaving the What's Next View.
10
8 11
9KA/Pi: 12KA/Pi:
10All fields search does now actually search all the (possible) fields, 13All fields search does now actually search all the (possible) fields,
11not only those listed in the contact list. 14not only those listed in the contact list.
12Made is possible to inline a picture in a vcard on the Z. 15Made is possible to inline a picture in a vcard on the Z.
13This was only possible on the desktop, now is it possible on the Z as well. 16This was only possible on the desktop, now is it possible on the Z as well.
14Fixed of missing save settings after filter configuration. 17Fixed of missing save settings after filter configuration.
15Made saving of addressbook much faster. 18Made saving of addressbook much faster.
16Fixed extension widget layout problem. 19Fixed extension widget layout problem.
17Fixed saving of default formatted name settings. 20Fixed saving of default formatted name settings.
18Fixed formatted name handling in edit dialog. 21Fixed formatted name handling in edit dialog.
19Added an option for changing formatted names of many contacts 22Added an option for changing formatted names of many contacts
20(menu: File - Change - Set formatted name). 23(menu: File - Change - Set formatted name).
21 24
22QWhatsThis was not working on the Z ( only black rectangle was shown). 25QWhatsThis was not working on the Z ( only black rectangle was shown).
23This is Fixed. 26This is Fixed.
24 27
25KDE-Sync: 28KDE-Sync:
26Now readonly KDE resources are synced as well. 29Now readonly KDE resources are synced as well.
27(They are not changed in KDE itself, of course). 30(They are not changed in KDE itself, of course).
28 31
29 32
30 33
31********** VERSION 1.9.16 ************ 34********** VERSION 1.9.16 ************
32 35
33KO/Pi: 36KO/Pi:
34Fixed search dialog size on Z 6000 (480x640 display). 37Fixed search dialog size on Z 6000 (480x640 display).
35Added setting to hide/show time in agenda items. 38Added setting to hide/show time in agenda items.
36Added setting to hide not running todos in todo view. 39Added setting to hide not running todos in todo view.
37Added columns for start date/time in todo view. 40Added columns for start date/time in todo view.
38Replaced the solid half-hour lines in agenda view by dot lines. 41Replaced the solid half-hour lines in agenda view by dot lines.
39Added possibility of printing the What's Next View on the desktop 42Added possibility of printing the What's Next View on the desktop
40(i.e. Windows and Linux). 43(i.e. Windows and Linux).
41Fixed a crash in KO/Pi when starting KO/Pi with What's Next view. 44Fixed a crash in KO/Pi when starting KO/Pi with What's Next view.
42Added tooltips in month view.(Tooltips only available on desktop) 45Added tooltips in month view.(Tooltips only available on desktop)
43 46
44Fixed a strange problem in KO/Pi alarm applet. 47Fixed a strange problem in KO/Pi alarm applet.
45Did not find the actual problem, 48Did not find the actual problem,
46such that now Qtopia reboots again if deinstalling the alarm applet. 49such that now Qtopia reboots again if deinstalling the alarm applet.
47But the alarm applet should work again. 50But the alarm applet should work again.
48 51
49KA/Pi: 52KA/Pi:
50Fixed the problem, that internal pictures were not saved. 53Fixed the problem, that internal pictures were not saved.
51 54
52Fixed a problem in the pi-sync mode by increasing the timeout for data transfer from 20 seconds to 5 minutes. 55Fixed a problem in the pi-sync mode by increasing the timeout for data transfer from 20 seconds to 5 minutes.
53 56
54Fixed some minor problems. (Like word wrap in help text windows). 57Fixed some minor problems. (Like word wrap in help text windows).
55 58
56Fixed a compiling problem in microkde/kresources. 59Fixed a compiling problem in microkde/kresources.
57 60
58KO/Pi is using zdbat (renamed to db2file) for syncing with Sharp DTM. 61KO/Pi is using zdbat (renamed to db2file) for syncing with Sharp DTM.
59This version now includes zdbat 1.0.0 (old version was zdbat 0.2.9) 62This version now includes zdbat 1.0.0 (old version was zdbat 0.2.9)
60such that now syncing KO/Pi with Sharp DTM should work on the 63such that now syncing KO/Pi with Sharp DTM should work on the
61Zaurus C 3000 model. 64Zaurus C 3000 model.
62 65
63********** VERSION 1.9.15 ************ 66********** VERSION 1.9.15 ************
64 67
65Usebilty enhancements in KO/Pi: 68Usebilty enhancements in KO/Pi:
66When clicking on the date in a month view cell, the day view is shown. 69When clicking on the date in a month view cell, the day view is shown.
67Old behaviour was, that the "new event" dialog popped up. 70Old behaviour was, that the "new event" dialog popped up.
68 71
69Added a one step "undo delete" in KO/Pi (Accessable in the "Action" menu). 72Added a one step "undo delete" in KO/Pi (Accessable in the "Action" menu).
70That means, you can restore the latest 73That means, you can restore the latest
71event/todo/journal you have deleted. 74event/todo/journal you have deleted.
72A journal is deleted, if you clear all the text of the journal. 75A journal is deleted, if you clear all the text of the journal.
73 76
74Fixed the bug of the editor dialogs in KO/Pi of version 1.9.14. 77Fixed the bug of the editor dialogs in KO/Pi of version 1.9.14.
75 78
76KA/Pi starting in 480x640 resolution: 79KA/Pi starting in 480x640 resolution:
77Hide the filter action in toolbar 80Hide the filter action in toolbar
78and added icons for undo/delete/redo in toolbar. 81and added icons for undo/delete/redo in toolbar.
79 82
80Change in OM/Pi ViewMail dialog: 83Change in OM/Pi ViewMail dialog:
81When clicking on the "delete" icon the mail is deleted after confirmation as usual. 84When clicking on the "delete" icon the mail is deleted after confirmation as usual.
82But the edit dialog is not closed as before, now the next mail in the folder is shown automatically (if there is any). 85But the edit dialog is not closed as before, now the next mail in the folder is shown automatically (if there is any).
83 86
84Fixed a crash when deleting mail-accounts in OM/Pi. 87Fixed a crash when deleting mail-accounts in OM/Pi.
85 88
86 89
87********** VERSION 1.9.14 ************ 90********** VERSION 1.9.14 ************
88 91
89Fixed some problems with the dialog sizes when switching 92Fixed some problems with the dialog sizes when switching
90portrait/landscape mode on 640x480 PDA display. 93portrait/landscape mode on 640x480 PDA display.
91 94
92Fixed some other small bugs in KA/Pi KO/Pi and OM/Pi and PwM/Pi. 95Fixed some other small bugs in KA/Pi KO/Pi and OM/Pi and PwM/Pi.
93 96
94Fixed an ugly bug in KOpieMail: 97Fixed an ugly bug in KOpieMail:
95KOpieMail was not able to write files (mails) to MSDOS file system, 98KOpieMail was not able to write files (mails) to MSDOS file system,
96like on an usual preformatted SD card. That should work now. 99like on an usual preformatted SD card. That should work now.
97To save your mail data on the Sd card do the following: 100To save your mail data on the Sd card do the following:
98Create a dir on the SD card: 101Create a dir on the SD card:
99mkdir /mnt/card/localmail 102mkdir /mnt/card/localmail
100Go to your home dir: 103Go to your home dir:
101cd 104cd
102Go to kopiemail data storage dir: 105Go to kopiemail data storage dir:
103cd kdepim/apps/kopiemail 106cd kdepim/apps/kopiemail
104Create a symlink to the SD card: 107Create a symlink to the SD card:
105ls -s /mnt/card/localmail 108ls -s /mnt/card/localmail
106Now KOpieMail will store all mails on the SD card. 109Now KOpieMail will store all mails on the SD card.
107 110
108KO/Pi Monthview: 111KO/Pi Monthview:
109Now "Go to Today" selects the current month from day 1-end, 112Now "Go to Today" selects the current month from day 1-end,
110not the current date + some days. 113not the current date + some days.
111I.e. "Go to Today" shows now always 114I.e. "Go to Today" shows now always
112the current month with first day of month in the first row. 115the current month with first day of month in the first row.
113 116
114Added missing German translation. 117Added missing German translation.
115 118
116Fixed icons of executeable on Wintendo. 119Fixed icons of executeable on Wintendo.
117 120
118Added a "Show next Mail" button to the OM/Pi 121Added a "Show next Mail" button to the OM/Pi
119mail viewer such that the mail below the current mail 122mail viewer such that the mail below the current mail
120in the mail list view of the current folder 123in the mail list view of the current folder
121can be read with a single click. 124can be read with a single click.
122 125
123 126
124********** VERSION 1.9.13 ************ 127********** VERSION 1.9.13 ************
125 128
126Fixed nasty PwM/Pi file reading bug, when 129Fixed nasty PwM/Pi file reading bug, when
127the used hash algo of file is different then the global 130the used hash algo of file is different then the global
128hash algo. 131hash algo.
129 132
130Added KA/Pi support for opie mailit mailapplication. 133Added KA/Pi support for opie mailit mailapplication.
131 134
132Fixed some bugs in OM/Pi. 135Fixed some bugs in OM/Pi.
133Now character conversion tables are available for the Zaurus 136Now character conversion tables are available for the Zaurus
134to make OM/Pi working properly. 137to make OM/Pi working properly.
135To get the character conversion in OM/Pi working, please download 138To get the character conversion in OM/Pi working, please download
136at the sourceforge project site the package 139at the sourceforge project site the package
137sr-character-conversion_SharpROM_arm.ipk.zip 140sr-character-conversion_SharpROM_arm.ipk.zip
138(or oz-character-conversion_OZ-gcc3xx_arm.ipk.zip for OZ roms) 141(or oz-character-conversion_OZ-gcc3xx_arm.ipk.zip for OZ roms)
139from the section "general files for KDE/Pim" 142from the section "general files for KDE/Pim"
140Instructions how to install this package are in a ReadMe in this file. 143Instructions how to install this package are in a ReadMe in this file.
141 144
142 145
143Fixed the orientation change problem in KA/Pi when switching 146Fixed the orientation change problem in KA/Pi when switching
144portrait/landscape mode. 147portrait/landscape mode.
145 148
146French translation available for KA/Pi and OM/Pi. 149French translation available for KA/Pi and OM/Pi.
147 150
148Fixed some problems with categories in KO/Pi in DTM sync. 151Fixed some problems with categories in KO/Pi in DTM sync.
149 152
150Added selection dialog for export to phone in KA/Pi. 153Added selection dialog for export to phone in KA/Pi.
151 154
152If in KO/Pi is an attendee selected to add to a meeting and this 155If in KO/Pi is an attendee selected to add to a meeting and this
153attendee is already in the list of attendees, this person is not added 156attendee is already in the list of attendees, this person is not added
154again. 157again.
155 158
156Some menu cleanup in KA/Pi. 159Some menu cleanup in KA/Pi.
157 160
158********** VERSION 1.9.12 ************ 161********** VERSION 1.9.12 ************
159 162
160Fix for the bug in KO/Pi What's Next view of version 1.9.11. 163Fix for the bug in KO/Pi What's Next view of version 1.9.11.
161 164
162Bugfix: Licence file is now shown again. 165Bugfix: Licence file is now shown again.
163 166
164OM/Pi now supports Unicode (utf8 charset). 167OM/Pi now supports Unicode (utf8 charset).
165Fixed some bugs in OM/Pi. 168Fixed some bugs in OM/Pi.
166 169
167KA/Pi has more German translation. 170KA/Pi has more German translation.
168 171
169 172
170********** VERSION 1.9.11 ************ 173********** VERSION 1.9.11 ************
171 174
172Fixed several problems in PWM/Pi, like 175Fixed several problems in PWM/Pi, like
173asking the user, if unsaved changed are pending 176asking the user, if unsaved changed are pending
174when closing the app. 177when closing the app.
175And PwM/Pi handles now different texts for the 178And PwM/Pi handles now different texts for the
176fields Description, Username, Password, configurable per category. 179fields Description, Username, Password, configurable per category.
177 180
178Fixed a crash in KO/Pi , when importing/loading vcs files 181Fixed a crash in KO/Pi , when importing/loading vcs files
179which have an entry with an attendee with state: 182which have an entry with an attendee with state:
180NEEDS ACTION 183NEEDS ACTION
181 184
182Fixed some problems in the German translation of OM/Pi, 185Fixed some problems in the German translation of OM/Pi,
183which makes some dialogs not fitting on the screen 186which makes some dialogs not fitting on the screen
184of the Z 5500. 187of the Z 5500.
185 188
186Fixed Qtopia crash, when disabling/deinstalling 189Fixed Qtopia crash, when disabling/deinstalling
187KO/Pi alarm applet. 190KO/Pi alarm applet.
188 191
189Implemented direct KDE<->KA/Pi sync for KA/Pi running 192Implemented direct KDE<->KA/Pi sync for KA/Pi running
190on Linux desktop. 193on Linux desktop.
191 194
192Added feature "remove sync info" to sync menu. 195Added feature "remove sync info" to sync menu.
193 196
194Tweaked the KO/Pi What's next view a bit, added 197Tweaked the KO/Pi What's next view a bit, added
195setting to hide events that are done. 198setting to hide events that are done.
196 199
197Disabled "beam receive enabled" on startup to 200Disabled "beam receive enabled" on startup to
198avoid problems if Fastload is enabled. 201avoid problems if Fastload is enabled.
199Please set "beam receive enabled", 202Please set "beam receive enabled",
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 363dc32..378c7d4 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -2537,384 +2537,386 @@ void CalendarView::toggleCancelIncidence()
2537 2537
2538void CalendarView::cancelIncidence(Incidence * inc ) 2538void CalendarView::cancelIncidence(Incidence * inc )
2539{ 2539{
2540 inc->setCancelled( ! inc->cancelled() ); 2540 inc->setCancelled( ! inc->cancelled() );
2541 changeIncidenceDisplay( inc,KOGlobals::EVENTEDITED ); 2541 changeIncidenceDisplay( inc,KOGlobals::EVENTEDITED );
2542 updateView(); 2542 updateView();
2543} 2543}
2544void CalendarView::cloneIncidence(Incidence * orgInc ) 2544void CalendarView::cloneIncidence(Incidence * orgInc )
2545{ 2545{
2546 Incidence * newInc = orgInc->clone(); 2546 Incidence * newInc = orgInc->clone();
2547 newInc->recreate(); 2547 newInc->recreate();
2548 2548
2549 if ( newInc->type() == "Todo" ) { 2549 if ( newInc->type() == "Todo" ) {
2550 Todo* t = (Todo*) newInc; 2550 Todo* t = (Todo*) newInc;
2551 showTodoEditor(); 2551 showTodoEditor();
2552 mTodoEditor->editTodo( t ); 2552 mTodoEditor->editTodo( t );
2553 if ( mTodoEditor->exec() ) { 2553 if ( mTodoEditor->exec() ) {
2554 mCalendar->addTodo( t ); 2554 mCalendar->addTodo( t );
2555 updateView(); 2555 updateView();
2556 } else { 2556 } else {
2557 delete t; 2557 delete t;
2558 } 2558 }
2559 } 2559 }
2560 else { 2560 else {
2561 Event* e = (Event*) newInc; 2561 Event* e = (Event*) newInc;
2562 showEventEditor(); 2562 showEventEditor();
2563 mEventEditor->editEvent( e ); 2563 mEventEditor->editEvent( e );
2564 if ( mEventEditor->exec() ) { 2564 if ( mEventEditor->exec() ) {
2565 mCalendar->addEvent( e ); 2565 mCalendar->addEvent( e );
2566 updateView(); 2566 updateView();
2567 } else { 2567 } else {
2568 delete e; 2568 delete e;
2569 } 2569 }
2570 } 2570 }
2571} 2571}
2572 2572
2573void CalendarView::newEvent() 2573void CalendarView::newEvent()
2574{ 2574{
2575 // TODO: Replace this code by a common eventDurationHint of KOBaseView. 2575 // TODO: Replace this code by a common eventDurationHint of KOBaseView.
2576 KOAgendaView *aView = mViewManager->agendaView(); 2576 KOAgendaView *aView = mViewManager->agendaView();
2577 if (aView) { 2577 if (aView) {
2578 if (aView->selectionStart().isValid()) { 2578 if (aView->selectionStart().isValid()) {
2579 if (aView->selectedIsAllDay()) { 2579 if (aView->selectedIsAllDay()) {
2580 newEvent(aView->selectionStart(),aView->selectionEnd(),true); 2580 newEvent(aView->selectionStart(),aView->selectionEnd(),true);
2581 } else { 2581 } else {
2582 newEvent(aView->selectionStart(),aView->selectionEnd()); 2582 newEvent(aView->selectionStart(),aView->selectionEnd());
2583 } 2583 }
2584 return; 2584 return;
2585 } 2585 }
2586 } 2586 }
2587 2587
2588 QDate date = mNavigator->selectedDates().first(); 2588 QDate date = mNavigator->selectedDates().first();
2589 QDateTime current = QDateTime::currentDateTime(); 2589 QDateTime current = QDateTime::currentDateTime();
2590 if ( date <= current.date() ) { 2590 if ( date <= current.date() ) {
2591 int hour = current.time().hour() +1; 2591 int hour = current.time().hour() +1;
2592 newEvent( QDateTime( current.date(), QTime( hour, 0, 0 ) ), 2592 newEvent( QDateTime( current.date(), QTime( hour, 0, 0 ) ),
2593 QDateTime( current.date(), QTime( hour+ KOPrefs::instance()->mDefaultDuration, 0, 0 ) ) ); 2593 QDateTime( current.date(), QTime( hour+ KOPrefs::instance()->mDefaultDuration, 0, 0 ) ) );
2594 } else 2594 } else
2595 newEvent( QDateTime( date, QTime( KOPrefs::instance()->mStartTime, 0, 0 ) ), 2595 newEvent( QDateTime( date, QTime( KOPrefs::instance()->mStartTime, 0, 0 ) ),
2596 QDateTime( date, QTime( KOPrefs::instance()->mStartTime + 2596 QDateTime( date, QTime( KOPrefs::instance()->mStartTime +
2597 KOPrefs::instance()->mDefaultDuration, 0, 0 ) ) ); 2597 KOPrefs::instance()->mDefaultDuration, 0, 0 ) ) );
2598} 2598}
2599 2599
2600void CalendarView::newEvent(QDateTime fh) 2600void CalendarView::newEvent(QDateTime fh)
2601{ 2601{
2602 newEvent(fh, 2602 newEvent(fh,
2603 QDateTime(fh.addSecs(3600*KOPrefs::instance()->mDefaultDuration))); 2603 QDateTime(fh.addSecs(3600*KOPrefs::instance()->mDefaultDuration)));
2604} 2604}
2605 2605
2606void CalendarView::newEvent(QDate dt) 2606void CalendarView::newEvent(QDate dt)
2607{ 2607{
2608 newEvent(QDateTime(dt, QTime(0,0,0)), 2608 newEvent(QDateTime(dt, QTime(0,0,0)),
2609 QDateTime(dt, QTime(0,0,0)), true); 2609 QDateTime(dt, QTime(0,0,0)), true);
2610} 2610}
2611 2611
2612void CalendarView::newEvent(QDateTime fromHint, QDateTime toHint, bool allDay) 2612void CalendarView::newEvent(QDateTime fromHint, QDateTime toHint, bool allDay)
2613{ 2613{
2614 2614
2615 showEventEditor(); 2615 showEventEditor();
2616 mEventEditor->newEvent(fromHint,toHint,allDay); 2616 mEventEditor->newEvent(fromHint,toHint,allDay);
2617 if ( mFilterView->filtersEnabled() ) { 2617 if ( mFilterView->filtersEnabled() ) {
2618 CalFilter *filter = mFilterView->selectedFilter(); 2618 CalFilter *filter = mFilterView->selectedFilter();
2619 if (filter && filter->showCategories()) { 2619 if (filter && filter->showCategories()) {
2620 mEventEditor->setCategories(filter->categoryList().join(",") ); 2620 mEventEditor->setCategories(filter->categoryList().join(",") );
2621 } 2621 }
2622 if ( filter ) 2622 if ( filter )
2623 mEventEditor->setSecrecy( filter->getSecrecy() ); 2623 mEventEditor->setSecrecy( filter->getSecrecy() );
2624 } 2624 }
2625} 2625}
2626void CalendarView::todoAdded(Todo * t) 2626void CalendarView::todoAdded(Todo * t)
2627{ 2627{
2628 2628
2629 changeTodoDisplay ( t ,KOGlobals::EVENTADDED); 2629 changeTodoDisplay ( t ,KOGlobals::EVENTADDED);
2630 updateTodoViews(); 2630 updateTodoViews();
2631} 2631}
2632void CalendarView::todoChanged(Todo * t) 2632void CalendarView::todoChanged(Todo * t)
2633{ 2633{
2634 emit todoModified( t, 4 ); 2634 emit todoModified( t, 4 );
2635 // updateTodoViews(); 2635 // updateTodoViews();
2636} 2636}
2637void CalendarView::todoToBeDeleted(Todo *) 2637void CalendarView::todoToBeDeleted(Todo *)
2638{ 2638{
2639 //qDebug("todoToBeDeleted(Todo *) "); 2639 //qDebug("todoToBeDeleted(Todo *) ");
2640 updateTodoViews(); 2640 updateTodoViews();
2641} 2641}
2642void CalendarView::todoDeleted() 2642void CalendarView::todoDeleted()
2643{ 2643{
2644 //qDebug(" todoDeleted()"); 2644 //qDebug(" todoDeleted()");
2645 updateTodoViews(); 2645 updateTodoViews();
2646} 2646}
2647 2647
2648 2648
2649 2649
2650void CalendarView::newTodo() 2650void CalendarView::newTodo()
2651{ 2651{
2652 2652
2653 showTodoEditor(); 2653 showTodoEditor();
2654 mTodoEditor->newTodo(QDateTime::currentDateTime().addDays(7),0,true); 2654 mTodoEditor->newTodo(QDateTime::currentDateTime().addDays(7),0,true);
2655 if ( mFilterView->filtersEnabled() ) { 2655 if ( mFilterView->filtersEnabled() ) {
2656 CalFilter *filter = mFilterView->selectedFilter(); 2656 CalFilter *filter = mFilterView->selectedFilter();
2657 if (filter && filter->showCategories()) { 2657 if (filter && filter->showCategories()) {
2658 mTodoEditor->setCategories(filter->categoryList().join(",") ); 2658 mTodoEditor->setCategories(filter->categoryList().join(",") );
2659 } 2659 }
2660 if ( filter ) 2660 if ( filter )
2661 mTodoEditor->setSecrecy( filter->getSecrecy() ); 2661 mTodoEditor->setSecrecy( filter->getSecrecy() );
2662 } 2662 }
2663} 2663}
2664 2664
2665void CalendarView::newSubTodo() 2665void CalendarView::newSubTodo()
2666{ 2666{
2667 Todo *todo = selectedTodo(); 2667 Todo *todo = selectedTodo();
2668 if ( todo ) newSubTodo( todo ); 2668 if ( todo ) newSubTodo( todo );
2669} 2669}
2670 2670
2671void CalendarView::newSubTodo(Todo *parentEvent) 2671void CalendarView::newSubTodo(Todo *parentEvent)
2672{ 2672{
2673 2673
2674 showTodoEditor(); 2674 showTodoEditor();
2675 mTodoEditor->newTodo(QDateTime::currentDateTime().addDays(7),parentEvent,true); 2675 mTodoEditor->newTodo(QDateTime::currentDateTime().addDays(7),parentEvent,true);
2676} 2676}
2677 2677
2678void CalendarView::newFloatingEvent() 2678void CalendarView::newFloatingEvent()
2679{ 2679{
2680 DateList tmpList = mNavigator->selectedDates(); 2680 DateList tmpList = mNavigator->selectedDates();
2681 QDate date = tmpList.first(); 2681 QDate date = tmpList.first();
2682 2682
2683 newEvent( QDateTime( date, QTime( 12, 0, 0 ) ), 2683 newEvent( QDateTime( date, QTime( 12, 0, 0 ) ),
2684 QDateTime( date, QTime( 12, 0, 0 ) ), true ); 2684 QDateTime( date, QTime( 12, 0, 0 ) ), true );
2685} 2685}
2686 2686
2687 2687
2688void CalendarView::editEvent( Event *event ) 2688void CalendarView::editEvent( Event *event )
2689{ 2689{
2690 2690
2691 if ( !event ) return; 2691 if ( !event ) return;
2692 if ( event->isReadOnly() ) { 2692 if ( event->isReadOnly() ) {
2693 showEvent( event ); 2693 showEvent( event );
2694 return; 2694 return;
2695 } 2695 }
2696 showEventEditor(); 2696 showEventEditor();
2697 mEventEditor->editEvent( event , mFlagEditDescription); 2697 mEventEditor->editEvent( event , mFlagEditDescription);
2698} 2698}
2699void CalendarView::editJournal( Journal *jour ) 2699void CalendarView::editJournal( Journal *jour )
2700{ 2700{
2701 if ( !jour ) return; 2701 if ( !jour ) return;
2702 mDialogManager->hideSearchDialog(); 2702 mDialogManager->hideSearchDialog();
2703 mViewManager->showJournalView(); 2703 mViewManager->showJournalView();
2704 mNavigator->slotDaySelect( jour->dtStart().date() ); 2704 mNavigator->slotDaySelect( jour->dtStart().date() );
2705} 2705}
2706void CalendarView::editTodo( Todo *todo ) 2706void CalendarView::editTodo( Todo *todo )
2707{ 2707{
2708 if ( !todo ) return; 2708 if ( !todo ) return;
2709 2709
2710 if ( todo->isReadOnly() ) { 2710 if ( todo->isReadOnly() ) {
2711 showTodo( todo ); 2711 showTodo( todo );
2712 return; 2712 return;
2713 } 2713 }
2714 showTodoEditor(); 2714 showTodoEditor();
2715 mTodoEditor->editTodo( todo ,mFlagEditDescription); 2715 mTodoEditor->editTodo( todo ,mFlagEditDescription);
2716 2716
2717} 2717}
2718 2718
2719KOEventViewerDialog* CalendarView::getEventViewerDialog() 2719KOEventViewerDialog* CalendarView::getEventViewerDialog()
2720{ 2720{
2721 if ( !mEventViewerDialog ) { 2721 if ( !mEventViewerDialog ) {
2722 mEventViewerDialog = new KOEventViewerDialog(this); 2722 mEventViewerDialog = new KOEventViewerDialog(this);
2723 connect( mEventViewerDialog, SIGNAL( editIncidence( Incidence* )), this, SLOT(editIncidence( Incidence* ) ) ); 2723 connect( mEventViewerDialog, SIGNAL( editIncidence( Incidence* )), this, SLOT(editIncidence( Incidence* ) ) );
2724 connect( this, SIGNAL(configChanged()), mEventViewerDialog, SLOT(updateConfig())); 2724 connect( this, SIGNAL(configChanged()), mEventViewerDialog, SLOT(updateConfig()));
2725 connect( mEventViewerDialog, SIGNAL(jumpToTime( const QDate &)), 2725 connect( mEventViewerDialog, SIGNAL(jumpToTime( const QDate &)),
2726 dateNavigator(), SLOT( selectWeek( const QDate & ) ) ); 2726 dateNavigator(), SLOT( selectWeek( const QDate & ) ) );
2727 connect( mEventViewerDialog, SIGNAL(showAgendaView( bool ) ), 2727 connect( mEventViewerDialog, SIGNAL(showAgendaView( bool ) ),
2728 viewManager(), SLOT( showAgendaView( bool ) ) ); 2728 viewManager(), SLOT( showAgendaView( bool ) ) );
2729 connect( mEventViewerDialog, SIGNAL( todoCompleted(Todo *) ),
2730 this, SLOT( todoChanged(Todo *) ) );
2729 mEventViewerDialog->resize( 640, 480 ); 2731 mEventViewerDialog->resize( 640, 480 );
2730 2732
2731 } 2733 }
2732 return mEventViewerDialog; 2734 return mEventViewerDialog;
2733} 2735}
2734void CalendarView::showEvent(Event *event) 2736void CalendarView::showEvent(Event *event)
2735{ 2737{
2736 getEventViewerDialog()->setEvent(event); 2738 getEventViewerDialog()->setEvent(event);
2737 getEventViewerDialog()->showMe(); 2739 getEventViewerDialog()->showMe();
2738} 2740}
2739 2741
2740void CalendarView::showTodo(Todo *event) 2742void CalendarView::showTodo(Todo *event)
2741{ 2743{
2742 getEventViewerDialog()->setTodo(event); 2744 getEventViewerDialog()->setTodo(event);
2743 getEventViewerDialog()->showMe(); 2745 getEventViewerDialog()->showMe();
2744} 2746}
2745void CalendarView::showJournal( Journal *jour ) 2747void CalendarView::showJournal( Journal *jour )
2746{ 2748{
2747 getEventViewerDialog()->setJournal(jour); 2749 getEventViewerDialog()->setJournal(jour);
2748 getEventViewerDialog()->showMe(); 2750 getEventViewerDialog()->showMe();
2749 2751
2750} 2752}
2751// void CalendarView::todoModified (Todo *event, int changed) 2753// void CalendarView::todoModified (Todo *event, int changed)
2752// { 2754// {
2753// // if (mDialogList.find (event) != mDialogList.end ()) { 2755// // if (mDialogList.find (event) != mDialogList.end ()) {
2754// // kdDebug() << "Todo modified and open" << endl; 2756// // kdDebug() << "Todo modified and open" << endl;
2755// // KOTodoEditor* temp = (KOTodoEditor *) mDialogList[event]; 2757// // KOTodoEditor* temp = (KOTodoEditor *) mDialogList[event];
2756// // temp->modified (changed); 2758// // temp->modified (changed);
2757 2759
2758// // } 2760// // }
2759 2761
2760// mViewManager->updateView(); 2762// mViewManager->updateView();
2761// } 2763// }
2762 2764
2763void CalendarView::appointment_show() 2765void CalendarView::appointment_show()
2764{ 2766{
2765 Event *anEvent = 0; 2767 Event *anEvent = 0;
2766 2768
2767 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); 2769 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first();
2768 2770
2769 if (mViewManager->currentView()->isEventView()) { 2771 if (mViewManager->currentView()->isEventView()) {
2770 if ( incidence && incidence->type() == "Event" ) { 2772 if ( incidence && incidence->type() == "Event" ) {
2771 anEvent = static_cast<Event *>(incidence); 2773 anEvent = static_cast<Event *>(incidence);
2772 } 2774 }
2773 } 2775 }
2774 2776
2775 if (!anEvent) { 2777 if (!anEvent) {
2776 KNotifyClient::beep(); 2778 KNotifyClient::beep();
2777 return; 2779 return;
2778 } 2780 }
2779 2781
2780 showEvent(anEvent); 2782 showEvent(anEvent);
2781} 2783}
2782 2784
2783void CalendarView::appointment_edit() 2785void CalendarView::appointment_edit()
2784{ 2786{
2785 Event *anEvent = 0; 2787 Event *anEvent = 0;
2786 2788
2787 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); 2789 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first();
2788 2790
2789 if (mViewManager->currentView()->isEventView()) { 2791 if (mViewManager->currentView()->isEventView()) {
2790 if ( incidence && incidence->type() == "Event" ) { 2792 if ( incidence && incidence->type() == "Event" ) {
2791 anEvent = static_cast<Event *>(incidence); 2793 anEvent = static_cast<Event *>(incidence);
2792 } 2794 }
2793 } 2795 }
2794 2796
2795 if (!anEvent) { 2797 if (!anEvent) {
2796 KNotifyClient::beep(); 2798 KNotifyClient::beep();
2797 return; 2799 return;
2798 } 2800 }
2799 2801
2800 editEvent(anEvent); 2802 editEvent(anEvent);
2801} 2803}
2802 2804
2803void CalendarView::appointment_delete() 2805void CalendarView::appointment_delete()
2804{ 2806{
2805 Event *anEvent = 0; 2807 Event *anEvent = 0;
2806 2808
2807 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); 2809 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first();
2808 2810
2809 if (mViewManager->currentView()->isEventView()) { 2811 if (mViewManager->currentView()->isEventView()) {
2810 if ( incidence && incidence->type() == "Event" ) { 2812 if ( incidence && incidence->type() == "Event" ) {
2811 anEvent = static_cast<Event *>(incidence); 2813 anEvent = static_cast<Event *>(incidence);
2812 } 2814 }
2813 } 2815 }
2814 2816
2815 if (!anEvent) { 2817 if (!anEvent) {
2816 KNotifyClient::beep(); 2818 KNotifyClient::beep();
2817 return; 2819 return;
2818 } 2820 }
2819 2821
2820 deleteEvent(anEvent); 2822 deleteEvent(anEvent);
2821} 2823}
2822 2824
2823void CalendarView::todo_resub( Todo * parent, Todo * sub ) 2825void CalendarView::todo_resub( Todo * parent, Todo * sub )
2824{ 2826{
2825 if (!sub) return; 2827 if (!sub) return;
2826 if (!parent) return; 2828 if (!parent) return;
2827 if ( sub->relatedTo() ) 2829 if ( sub->relatedTo() )
2828 sub->relatedTo()->removeRelation(sub); 2830 sub->relatedTo()->removeRelation(sub);
2829 sub->setRelatedTo(parent); 2831 sub->setRelatedTo(parent);
2830 sub->setRelatedToUid(parent->uid()); 2832 sub->setRelatedToUid(parent->uid());
2831 parent->addRelation(sub); 2833 parent->addRelation(sub);
2832 sub->updated(); 2834 sub->updated();
2833 parent->updated(); 2835 parent->updated();
2834 setModified(true); 2836 setModified(true);
2835 updateView(); 2837 updateView();
2836} 2838}
2837void CalendarView::todo_unsub(Todo *anTodo ) 2839void CalendarView::todo_unsub(Todo *anTodo )
2838{ 2840{
2839 // Todo *anTodo = selectedTodo(); 2841 // Todo *anTodo = selectedTodo();
2840 if (!anTodo) return; 2842 if (!anTodo) return;
2841 if (!anTodo->relatedTo()) return; 2843 if (!anTodo->relatedTo()) return;
2842 anTodo->relatedTo()->removeRelation(anTodo); 2844 anTodo->relatedTo()->removeRelation(anTodo);
2843 anTodo->setRelatedTo(0); 2845 anTodo->setRelatedTo(0);
2844 anTodo->updated(); 2846 anTodo->updated();
2845 anTodo->setRelatedToUid(""); 2847 anTodo->setRelatedToUid("");
2846 setModified(true); 2848 setModified(true);
2847 updateView(); 2849 updateView();
2848} 2850}
2849 2851
2850void CalendarView::deleteTodo(Todo *todo) 2852void CalendarView::deleteTodo(Todo *todo)
2851{ 2853{
2852 if (!todo) { 2854 if (!todo) {
2853 KNotifyClient::beep(); 2855 KNotifyClient::beep();
2854 return; 2856 return;
2855 } 2857 }
2856 if (KOPrefs::instance()->mConfirm) { 2858 if (KOPrefs::instance()->mConfirm) {
2857 switch (msgItemDelete()) { 2859 switch (msgItemDelete()) {
2858 case KMessageBox::Continue: // OK 2860 case KMessageBox::Continue: // OK
2859 if (!todo->relations().isEmpty()) { 2861 if (!todo->relations().isEmpty()) {
2860 KMessageBox::sorry(this,i18n("Cannot delete To-Do\nwhich has children."), 2862 KMessageBox::sorry(this,i18n("Cannot delete To-Do\nwhich has children."),
2861 i18n("Delete To-Do")); 2863 i18n("Delete To-Do"));
2862 } else { 2864 } else {
2863 checkExternalId( todo ); 2865 checkExternalId( todo );
2864 calendar()->deleteTodo(todo); 2866 calendar()->deleteTodo(todo);
2865 changeTodoDisplay( todo,KOGlobals::EVENTDELETED ); 2867 changeTodoDisplay( todo,KOGlobals::EVENTDELETED );
2866 updateView(); 2868 updateView();
2867 } 2869 }
2868 break; 2870 break;
2869 } // switch 2871 } // switch
2870 } else { 2872 } else {
2871 if (!todo->relations().isEmpty()) { 2873 if (!todo->relations().isEmpty()) {
2872 KMessageBox::sorry(this,i18n("Cannot delete To-Do\nwhich has children."), 2874 KMessageBox::sorry(this,i18n("Cannot delete To-Do\nwhich has children."),
2873 i18n("Delete To-Do")); 2875 i18n("Delete To-Do"));
2874 } else { 2876 } else {
2875 checkExternalId( todo ); 2877 checkExternalId( todo );
2876 mCalendar->deleteTodo(todo); 2878 mCalendar->deleteTodo(todo);
2877 changeTodoDisplay( todo,KOGlobals::EVENTDELETED ); 2879 changeTodoDisplay( todo,KOGlobals::EVENTDELETED );
2878 updateView(); 2880 updateView();
2879 } 2881 }
2880 } 2882 }
2881 emit updateSearchDialog(); 2883 emit updateSearchDialog();
2882} 2884}
2883void CalendarView::deleteJournal(Journal *jour) 2885void CalendarView::deleteJournal(Journal *jour)
2884{ 2886{
2885 if (!jour) { 2887 if (!jour) {
2886 KNotifyClient::beep(); 2888 KNotifyClient::beep();
2887 return; 2889 return;
2888 } 2890 }
2889 if (KOPrefs::instance()->mConfirm) { 2891 if (KOPrefs::instance()->mConfirm) {
2890 switch (msgItemDelete()) { 2892 switch (msgItemDelete()) {
2891 case KMessageBox::Continue: // OK 2893 case KMessageBox::Continue: // OK
2892 calendar()->deleteJournal(jour); 2894 calendar()->deleteJournal(jour);
2893 updateView(); 2895 updateView();
2894 break; 2896 break;
2895 } // switch 2897 } // switch
2896 } else { 2898 } else {
2897 calendar()->deleteJournal(jour);; 2899 calendar()->deleteJournal(jour);;
2898 updateView(); 2900 updateView();
2899 } 2901 }
2900 emit updateSearchDialog(); 2902 emit updateSearchDialog();
2901} 2903}
2902 2904
2903void CalendarView::deleteEvent(Event *anEvent) 2905void CalendarView::deleteEvent(Event *anEvent)
2904{ 2906{
2905 if (!anEvent) { 2907 if (!anEvent) {
2906 KNotifyClient::beep(); 2908 KNotifyClient::beep();
2907 return; 2909 return;
2908 } 2910 }
2909 2911
2910 if (anEvent->recurrence()->doesRecur()) { 2912 if (anEvent->recurrence()->doesRecur()) {
2911 QDate itemDate = mViewManager->currentSelectionDate(); 2913 QDate itemDate = mViewManager->currentSelectionDate();
2912 int km; 2914 int km;
2913 if (!itemDate.isValid()) { 2915 if (!itemDate.isValid()) {
2914 //kdDebug() << "Date Not Valid" << endl; 2916 //kdDebug() << "Date Not Valid" << endl;
2915 if (KOPrefs::instance()->mConfirm) { 2917 if (KOPrefs::instance()->mConfirm) {
2916 km = KMessageBox::warningContinueCancel(this,anEvent->summary().left(25) + 2918 km = KMessageBox::warningContinueCancel(this,anEvent->summary().left(25) +
2917 i18n("\nThis event recurs\nover multiple dates.\nAre you sure you want\nto delete this event\nand all its recurrences?"), 2919 i18n("\nThis event recurs\nover multiple dates.\nAre you sure you want\nto delete this event\nand all its recurrences?"),
2918 i18n("KO/Pi Confirmation"),i18n("Delete All")); 2920 i18n("KO/Pi Confirmation"),i18n("Delete All"));
2919 if ( km == KMessageBox::Continue ) 2921 if ( km == KMessageBox::Continue )
2920 km = KMessageBox::No; // No = all below 2922 km = KMessageBox::No; // No = all below
diff --git a/korganizer/koeventviewerdialog.cpp b/korganizer/koeventviewerdialog.cpp
index 68c0e1a..772fd95 100644
--- a/korganizer/koeventviewerdialog.cpp
+++ b/korganizer/koeventviewerdialog.cpp
@@ -1,240 +1,256 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2000,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 19
20#include <klocale.h> 20#include <klocale.h>
21 21
22#include <libkcal/event.h> 22#include <libkcal/event.h>
23#include <qpushbutton.h> 23#include <qpushbutton.h>
24 24
25#include "koeventviewer.h" 25#include "koeventviewer.h"
26#include "koprefs.h" 26#include "koprefs.h"
27#include <libkcal/todo.h> 27#include <libkcal/todo.h>
28#include "qapp.h" 28#include "qapp.h"
29 29
30#include "koeventviewerdialog.h" 30#include "koeventviewerdialog.h"
31extern int globalFlagBlockAgenda; 31extern int globalFlagBlockAgenda;
32 32
33KOEventViewerDialog::KOEventViewerDialog(QWidget *parent,const char *name) 33KOEventViewerDialog::KOEventViewerDialog(QWidget *parent,const char *name)
34 : KDialogBase(parent,name, 34 : KDialogBase(parent,name,
35#ifndef DESKTOP_VERSION 35#ifndef DESKTOP_VERSION
36 true , 36 true ,
37#else 37#else
38 false, 38 false,
39#endif 39#endif
40 i18n("Event Viewer"),Ok|User1|Close,Close, false, i18n("Agenda")) 40 i18n("Event Viewer"),Ok|User1|Close,Close, false, i18n("Agenda"))
41{ 41{
42 42
43 mEventViewer = new KOEventViewer(this); 43 mEventViewer = new KOEventViewer(this);
44 mEventViewer->setFont( KOPrefs::instance()->mEventViewFont ); 44 mEventViewer->setFont( KOPrefs::instance()->mEventViewFont );
45 setMainWidget(mEventViewer); 45 setMainWidget(mEventViewer);
46 setButtonText(Ok, i18n("Edit") ); 46 setButtonText(Ok, i18n("Edit") );
47 47
48 QObject::connect(findButton( Ok ),SIGNAL(clicked()), 48 QObject::connect(findButton( Ok ),SIGNAL(clicked()),
49 SLOT(editIncidence())); 49 SLOT(editIncidence()));
50 QObject::connect(this,SIGNAL(user1Clicked()), 50 QObject::connect(this,SIGNAL(user1Clicked()),
51 SLOT(showIncidence())); 51 SLOT(showIncidence()));
52 mIncidence = 0; 52 mIncidence = 0;
53 // TODO: Set a sensible size (based on the content?). 53 // TODO: Set a sensible size (based on the content?).
54 //showMaximized(); 54 //showMaximized();
55 //qDebug("++++++++++++KOEventViewerDialog() "); 55 //qDebug("++++++++++++KOEventViewerDialog() ");
56 // if ( KOPrefs::instance()->mCompactDialogs ) { 56 // if ( KOPrefs::instance()->mCompactDialogs ) {
57// setFixedSize( 240,284 ); 57// setFixedSize( 240,284 );
58// move( 0, 15 ); 58// move( 0, 15 );
59// } else { 59// } else {
60// setMinimumSize(300,200); 60// setMinimumSize(300,200);
61// resize(320,300); 61// resize(320,300);
62// } 62// }
63 mSyncMode = false; 63 mSyncMode = false;
64 mSyncResult = 0; 64 mSyncResult = 0;
65 65
66} 66}
67 67
68KOEventViewerDialog::~KOEventViewerDialog() 68KOEventViewerDialog::~KOEventViewerDialog()
69{ 69{
70 //qDebug("-------~KOEventViewerDialog() "); 70 //qDebug("-------~KOEventViewerDialog() ");
71} 71}
72void KOEventViewerDialog::showMe() 72void KOEventViewerDialog::showMe()
73{ 73{
74 74
75#ifdef DESKTOP_VERSION 75#ifdef DESKTOP_VERSION
76 show(); 76 show();
77#else 77#else
78 showMaximized(); 78 showMaximized();
79#endif 79#endif
80 setFocus(); 80 setFocus();
81 setActiveWindow(); 81 setActiveWindow();
82 82
83} 83}
84void KOEventViewerDialog::setSyncMode( bool b ) 84void KOEventViewerDialog::setSyncMode( bool b )
85{ 85{
86 mSyncMode = b; 86 mSyncMode = b;
87 //qDebug("KOEventViewerDialog::setSyncMode %d ",mSyncMode ); 87 //qDebug("KOEventViewerDialog::setSyncMode %d ",mSyncMode );
88 if ( mSyncMode ) { 88 if ( mSyncMode ) {
89 findButton( Close )->setText( i18n("Cancel Sync")); 89 findButton( Close )->setText( i18n("Cancel Sync"));
90 findButton( Ok )->setText( i18n("Remote")); 90 findButton( Ok )->setText( i18n("Remote"));
91 findButton( User1 )->setText( i18n("Local")); 91 findButton( User1 )->setText( i18n("Local"));
92 } else { 92 } else {
93 findButton( Close )->setText( i18n("Close")); 93 findButton( Close )->setText( i18n("Close"));
94 findButton( Ok )->setText( i18n("Edit")); 94 findButton( Ok )->setText( i18n("Edit"));
95 findButton( User1 )->setText( i18n("Agenda")); 95 findButton( User1 )->setText( i18n("Agenda"));
96 } 96 }
97 mEventViewer->setSyncMode( b ); 97 mEventViewer->setSyncMode( b );
98} 98}
99void KOEventViewerDialog::setColorMode( int m ) 99void KOEventViewerDialog::setColorMode( int m )
100{ 100{
101 mEventViewer->setColorMode( m ); 101 mEventViewer->setColorMode( m );
102} 102}
103int KOEventViewerDialog::executeS( bool local ) 103int KOEventViewerDialog::executeS( bool local )
104{ 104{
105 mSyncResult = 3; 105 mSyncResult = 3;
106 if ( local ) 106 if ( local )
107 findButton( User1 )->setFocus(); 107 findButton( User1 )->setFocus();
108 else 108 else
109 findButton( Ok )->setFocus(); 109 findButton( Ok )->setFocus();
110 exec(); 110 exec();
111 return mSyncResult; 111 return mSyncResult;
112} 112}
113 113
114void KOEventViewerDialog::updateConfig() 114void KOEventViewerDialog::updateConfig()
115{ 115{
116 mEventViewer->setFont( KOPrefs::instance()->mEventViewFont ); 116 mEventViewer->setFont( KOPrefs::instance()->mEventViewFont );
117 117
118} 118}
119void KOEventViewerDialog::setEvent(Event *event) 119void KOEventViewerDialog::setEvent(Event *event)
120{ 120{
121 mEventViewer->setEvent(event); 121 mEventViewer->setEvent(event);
122 mIncidence = event; 122 mIncidence = event;
123 findButton( Close )->setFocus(); 123 findButton( Close )->setFocus();
124} 124}
125void KOEventViewerDialog::setIncidence(Incidence *in ) 125void KOEventViewerDialog::setIncidence(Incidence *in )
126{ 126{
127 if ( in->type() == "Event" ) 127 if ( in->type() == "Event" )
128 setEvent( (Event*) in ); 128 setEvent( (Event*) in );
129 else if ( in->type() =="Todo" ) 129 else if ( in->type() =="Todo" )
130 setTodo( (Todo*) in ); 130 setTodo( (Todo*) in );
131 else if ( in->type() =="Journal" ) 131 else if ( in->type() =="Journal" )
132 setJournal( (Journal*) in ); 132 setJournal( (Journal*) in );
133} 133}
134void KOEventViewerDialog::addIncidence(Incidence *in) 134void KOEventViewerDialog::addIncidence(Incidence *in)
135{ 135{
136 if ( in->type() == "Event" ) 136 if ( in->type() == "Event" )
137 addEvent( (Event*) in ); 137 addEvent( (Event*) in );
138 else if ( in->type() =="Todo" ) 138 else if ( in->type() =="Todo" )
139 mEventViewer->setTodo( (Todo*) in, false ); 139 mEventViewer->setTodo( (Todo*) in, false );
140 else if ( in->type() =="Journal" ) 140 else if ( in->type() =="Journal" )
141 mEventViewer->setJournal( (Journal*) in, false ); 141 mEventViewer->setJournal( (Journal*) in, false );
142 if ( mSyncMode ) { 142 if ( mSyncMode ) {
143 findButton( User1 )->setFocus(); 143 findButton( User1 )->setFocus();
144 setCaption(i18n("Conflict! Please choose entry")); 144 setCaption(i18n("Conflict! Please choose entry"));
145 } 145 }
146} 146}
147 147
148void KOEventViewerDialog::addEvent(Event *event) 148void KOEventViewerDialog::addEvent(Event *event)
149{ 149{
150 mEventViewer->addEvent(event); 150 mEventViewer->addEvent(event);
151 mIncidence = event; 151 mIncidence = event;
152 findButton( Close )->setFocus(); 152 findButton( Close )->setFocus();
153 if ( !mSyncMode ) {
154 findButton( User1 )->setText( i18n("Agenda"));
155 }
153} 156}
154 157
155void KOEventViewerDialog::setTodo(Todo *event) 158void KOEventViewerDialog::setTodo(Todo *event)
156{ 159{
157 mEventViewer->setTodo(event); 160 mEventViewer->setTodo(event);
158 mIncidence = (Incidence*)event; 161 mIncidence = (Incidence*)event;
159 findButton( Close )->setFocus(); 162 findButton( Close )->setFocus();
163 if ( !mSyncMode ) {
164 findButton( User1 )->setText( i18n("Set complete"));
165 }
160} 166}
161void KOEventViewerDialog::setJournal(Journal *j) 167void KOEventViewerDialog::setJournal(Journal *j)
162{ 168{
163 mEventViewer->setJournal(j); 169 mEventViewer->setJournal(j);
164 mIncidence = (Incidence*)j; 170 mIncidence = (Incidence*)j;
165 findButton( Close )->setFocus(); 171 findButton( Close )->setFocus();
172 if ( !mSyncMode ) {
173 findButton( User1 )->setText( i18n("Agenda"));
174 }
166} 175}
167 176
168void KOEventViewerDialog::addText(QString text) 177void KOEventViewerDialog::addText(QString text)
169{ 178{
170 mEventViewer->addText(text); 179 mEventViewer->addText(text);
171 findButton( Close )->setFocus(); 180 findButton( Close )->setFocus();
172} 181}
173void KOEventViewerDialog::editIncidence() 182void KOEventViewerDialog::editIncidence()
174{ 183{
175 if ( mSyncMode ) { 184 if ( mSyncMode ) {
176 mSyncResult = 2; 185 mSyncResult = 2;
177 accept(); 186 accept();
178 return; 187 return;
179 } 188 }
180 if ( mIncidence ){ 189 if ( mIncidence ){
181#ifndef DESKTOP_VERSION 190#ifndef DESKTOP_VERSION
182 hide(); 191 hide();
183#endif 192#endif
184 emit editIncidence( mIncidence ); 193 emit editIncidence( mIncidence );
185 } 194 }
186} 195}
187void KOEventViewerDialog::showIncidence() 196void KOEventViewerDialog::showIncidence()
188{ 197{
189 198
190 if ( mSyncMode ) { 199 if ( mSyncMode ) {
191 mSyncResult = 1; 200 mSyncResult = 1;
192 accept(); 201 accept();
193 return; 202 return;
194 } 203 }
195 204
196 if ( mIncidence ){ 205 if ( mIncidence ){
197#ifndef DESKTOP_VERSION 206#ifndef DESKTOP_VERSION
198 hide(); 207 hide();
199#endif 208#endif
200 QDate date; 209 QDate date;
201 if ( mIncidence->type() == "Todo" ) { 210 if ( mIncidence->type() == "Todo" ) {
211 /*
202 if ( ((Todo*)mIncidence)->hasDueDate() ) 212 if ( ((Todo*)mIncidence)->hasDueDate() )
203 date = ((Todo*)mIncidence)->dtDue().date(); 213 date = ((Todo*)mIncidence)->dtDue().date();
204 else { 214 else {
205 globalFlagBlockAgenda = 2; 215 globalFlagBlockAgenda = 2;
206 emit showAgendaView( false ); 216 emit showAgendaView( false );
207 return; 217 return;
208 } 218 }
219 */
220 ((Todo*)mIncidence)->setCompleted( true );
221 hide();
222 emit todoCompleted(((Todo*)mIncidence));
223 return;
224
209 } else 225 } else
210 date = mIncidence->dtStart().date(); 226 date = mIncidence->dtStart().date();
211 globalFlagBlockAgenda = 1; 227 globalFlagBlockAgenda = 1;
212 emit showAgendaView( false ); 228 emit showAgendaView( false );
213 globalFlagBlockAgenda = 2; 229 globalFlagBlockAgenda = 2;
214 emit jumpToTime( date ); 230 emit jumpToTime( date );
215 } 231 }
216} 232}
217void KOEventViewerDialog::keyPressEvent ( QKeyEvent * e ) 233void KOEventViewerDialog::keyPressEvent ( QKeyEvent * e )
218{ 234{
219 switch ( e->key() ) { 235 switch ( e->key() ) {
220 236
221 case Qt::Key_A : 237 case Qt::Key_A :
222 case Qt::Key_L : 238 case Qt::Key_L :
223 showIncidence(); 239 showIncidence();
224 break; 240 break;
225 case Qt::Key_E : 241 case Qt::Key_E :
226 case Qt::Key_R : 242 case Qt::Key_R :
227 editIncidence(); 243 editIncidence();
228 break; 244 break;
229 case Qt::Key_C: 245 case Qt::Key_C:
230 case Qt::Key_Escape: 246 case Qt::Key_Escape:
231 close(); 247 close();
232 break; 248 break;
233 case Qt::Key_I: 249 case Qt::Key_I:
234 accept(); 250 accept();
235 break; 251 break;
236 default: 252 default:
237 break; 253 break;
238 } 254 }
239 255
240} 256}
diff --git a/korganizer/koeventviewerdialog.h b/korganizer/koeventviewerdialog.h
index 21cb3ee..b6b4103 100644
--- a/korganizer/koeventviewerdialog.h
+++ b/korganizer/koeventviewerdialog.h
@@ -1,70 +1,71 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 2000, 2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2000, 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#ifndef KOEVENTVIEWERDIALOG_H 19#ifndef KOEVENTVIEWERDIALOG_H
20#define KOEVENTVIEWERDIALOG_H 20#define KOEVENTVIEWERDIALOG_H
21// 21//
22// Viewer dialog for events. 22// Viewer dialog for events.
23// 23//
24 24
25#include <qtextview.h> 25#include <qtextview.h>
26 26
27#include <kdialogbase.h> 27#include <kdialogbase.h>
28 28
29#include <libkcal/event.h> 29#include <libkcal/event.h>
30 30
31using namespace KCal; 31using namespace KCal;
32 32
33class KOEventViewer; 33class KOEventViewer;
34 34
35class KOEventViewerDialog : public KDialogBase { 35class KOEventViewerDialog : public KDialogBase {
36 Q_OBJECT 36 Q_OBJECT
37 public: 37 public:
38 KOEventViewerDialog(QWidget *parent=0,const char *name=0); 38 KOEventViewerDialog(QWidget *parent=0,const char *name=0);
39 virtual ~KOEventViewerDialog(); 39 virtual ~KOEventViewerDialog();
40 40
41 void setEvent(Event *event); 41 void setEvent(Event *event);
42 void addEvent(Event *event); 42 void addEvent(Event *event);
43 void setTodo(Todo *event); 43 void setTodo(Todo *event);
44 void setJournal(Journal *journal); 44 void setJournal(Journal *journal);
45 void setIncidence(Incidence *inc); 45 void setIncidence(Incidence *inc);
46 void addIncidence(Incidence *inc); 46 void addIncidence(Incidence *inc);
47 void addText(QString text); 47 void addText(QString text);
48 void showMe(); 48 void showMe();
49 void setSyncMode( bool ); 49 void setSyncMode( bool );
50 void setColorMode( int m ); 50 void setColorMode( int m );
51 int executeS( bool ); 51 int executeS( bool );
52 public slots: 52 public slots:
53 void updateConfig(); 53 void updateConfig();
54 signals: 54 signals:
55 void editIncidence( Incidence* ); 55 void editIncidence( Incidence* );
56 void jumpToTime( const QDate &); 56 void jumpToTime( const QDate &);
57 void showAgendaView( bool ); 57 void showAgendaView( bool );
58 void todoCompleted(Todo*);
58private slots: 59private slots:
59 void editIncidence(); 60 void editIncidence();
60 void showIncidence(); 61 void showIncidence();
61 62
62 private: 63 private:
63 bool mSyncMode; 64 bool mSyncMode;
64 int mSyncResult; 65 int mSyncResult;
65 KOEventViewer *mEventViewer; 66 KOEventViewer *mEventViewer;
66 Incidence* mIncidence; 67 Incidence* mIncidence;
67 void keyPressEvent ( QKeyEvent * e ); 68 void keyPressEvent ( QKeyEvent * e );
68}; 69};
69 70
70#endif 71#endif
diff --git a/korganizer/koviewmanager.h b/korganizer/koviewmanager.h
index 6f76e2c..3c251fb 100644
--- a/korganizer/koviewmanager.h
+++ b/korganizer/koviewmanager.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 3 Copyright (c) 2001
4 Cornelius Schumacher <schumacher@kde.org> 4 Cornelius Schumacher <schumacher@kde.org>
5 5
6 This program is free software; you can redistribute it and/or modify 6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by 7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or 8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version. 9 (at your option) any later version.
10 10
11 This program is distributed in the hope that it will be useful, 11 This program 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 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
14 GNU General Public License for more details. 14 GNU General Public License for more details.
15 15
16 You should have received a copy of the GNU General Public License 16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software 17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 19
20 As a special exception, permission is given to link this program 20 As a special exception, permission is given to link this program
21 with any edition of Qt, and distribute the resulting executable, 21 with any edition of Qt, and distribute the resulting executable,
22 without including the source code for Qt in the source distribution. 22 without including the source code for Qt in the source distribution.
23*/ 23*/
24#ifndef KOVIEWMANAGER_H 24#ifndef KOVIEWMANAGER_H
25#define KOVIEWMANAGER_H 25#define KOVIEWMANAGER_H
26 26
27#include <qobject.h> 27#include <qobject.h>
28 28
29#include <korganizer/baseview.h> 29#include <korganizer/baseview.h>
30 30
31class CalendarView; 31class CalendarView;
32 32
33class KOListView; 33class KOListView;
34class KOAgendaView; 34class KOAgendaView;
35class KOMonthView; 35class KOMonthView;
36class KOTimeSpanView; 36class KOTimeSpanView;
37class KOTodoView; 37class KOTodoView;
38class KOWhatsNextView; 38class KOWhatsNextView;
39class KOJournalView; 39class KOJournalView;
40 40
41using namespace KCal; 41using namespace KCal;
42 42
43/** 43/**
44 This class manages the views of the calendar. It owns the objects and handles 44 This class manages the views of the calendar. It owns the objects and handles
45 creation and selection. 45 creation and selection.
46*/ 46*/
47class KOViewManager : public QObject 47class KOViewManager : public QObject
48{ 48{
49 Q_OBJECT 49 Q_OBJECT
50 public: 50 public:
51 KOViewManager( CalendarView * ); 51 KOViewManager( CalendarView * );
52 virtual ~KOViewManager(); 52 virtual ~KOViewManager();
53 53
54 /** changes the view to be the currently selected view */ 54 /** changes the view to be the currently selected view */
55 void showView(KOrg::BaseView *, bool fullScreen = false ); 55 void showView(KOrg::BaseView *, bool fullScreen = false );
56 void updateWNview(); 56 void updateWNview();
57 void readSettings(KConfig *config); 57 void readSettings(KConfig *config);
58 void writeSettings(KConfig *config); 58 void writeSettings(KConfig *config);
59 bool showsNextDays(); 59 bool showsNextDays();
60 /** Read which view was shown last from config file */ 60 /** Read which view was shown last from config file */
61 void readCurrentView(KConfig *); 61 void readCurrentView(KConfig *);
62 /** Write which view is currently shown to config file */ 62 /** Write which view is currently shown to config file */
63 void writeCurrentView(KConfig *); 63 void writeCurrentView(KConfig *);
64 64
65 KOrg::BaseView *currentView(); 65 KOrg::BaseView *currentView();
66 66
67 void setDocumentId( const QString & ); 67 void setDocumentId( const QString & );
68 68
69 void updateView();
70 void updateView( const QDate &start, const QDate &end ); 69 void updateView( const QDate &start, const QDate &end );
71 70
72 void raiseCurrentView( bool fullScreen = false ); 71 void raiseCurrentView( bool fullScreen = false );
73 72
74 void addView(KOrg::BaseView *); 73 void addView(KOrg::BaseView *);
75 74
76 Incidence *currentSelection(); 75 Incidence *currentSelection();
77 QDate currentSelectionDate(); 76 QDate currentSelectionDate();
78 77
79 KOAgendaView *agendaView() const { return mAgendaView; } 78 KOAgendaView *agendaView() const { return mAgendaView; }
80 79
81 signals: 80 signals:
82 void printWNV(); 81 void printWNV();
83 public slots: 82 public slots:
83 void updateView();
84 void showWhatsNextView(); 84 void showWhatsNextView();
85 void showListView(); 85 void showListView();
86 void showAgendaView( bool fullScreen = false ); 86 void showAgendaView( bool fullScreen = false );
87 void showDayView(); 87 void showDayView();
88 void showWorkWeekView(); 88 void showWorkWeekView();
89 void showWeekView(); 89 void showWeekView();
90 void showNextXView(); 90 void showNextXView();
91 void showMonthView(); 91 void showMonthView();
92 void showTodoView(); 92 void showTodoView();
93 void showJournalView(); 93 void showJournalView();
94 void showTimeSpanView(); 94 void showTimeSpanView();
95 95
96 private: 96 private:
97 CalendarView *mMainView; 97 CalendarView *mMainView;
98 98
99 int mCurrentAgendaView; 99 int mCurrentAgendaView;
100 KOAgendaView *mAgendaView; 100 KOAgendaView *mAgendaView;
101 KOListView *mListView; 101 KOListView *mListView;
102 KOMonthView *mMonthView; 102 KOMonthView *mMonthView;
103 KOTodoView *mTodoView; 103 KOTodoView *mTodoView;
104 KOWhatsNextView *mWhatsNextView; 104 KOWhatsNextView *mWhatsNextView;
105 KOJournalView *mJournalView; 105 KOJournalView *mJournalView;
106 KOTimeSpanView *mTimeSpanView; 106 KOTimeSpanView *mTimeSpanView;
107 107
108 KOrg::BaseView *mCurrentView; // currently active event view 108 KOrg::BaseView *mCurrentView; // currently active event view
109 109
110 int mAgendaViewMode; 110 int mAgendaViewMode;
111 bool mFlagShowNextxDays; 111 bool mFlagShowNextxDays;
112 112
113}; 113};
114 114
115#endif 115#endif