summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-01-05 14:17:14 (UTC)
committer zautrix <zautrix>2005-01-05 14:17:14 (UTC)
commitdf0200487afbfa59b80a79e548d70b5203019003 (patch) (unidiff)
tree2240de4162736461316c8cb3cd00f87a8a9bf2bd
parentb8410daa179dbff2ebb833071ba50b9da36e6330 (diff)
downloadkdepimpi-df0200487afbfa59b80a79e548d70b5203019003.zip
kdepimpi-df0200487afbfa59b80a79e548d70b5203019003.tar.gz
kdepimpi-df0200487afbfa59b80a79e548d70b5203019003.tar.bz2
todo enhancements/fixes
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/WhatsNew.txt8
-rw-r--r--korganizer/calendarview.cpp4
-rw-r--r--korganizer/koagendaitem.cpp2
-rw-r--r--korganizer/kodialogmanager.cpp2
-rw-r--r--korganizer/koprefs.cpp2
-rw-r--r--korganizer/koprefs.h2
-rw-r--r--korganizer/koprefsdialog.cpp13
-rw-r--r--korganizer/kotodoview.cpp78
-rw-r--r--korganizer/kotodoview.h7
-rw-r--r--korganizer/kotodoviewitem.cpp33
-rw-r--r--korganizer/koviewmanager.cpp1
-rw-r--r--version2
12 files changed, 124 insertions, 30 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt
index ec75fad..bfe87f0 100644
--- a/bin/kdepim/WhatsNew.txt
+++ b/bin/kdepim/WhatsNew.txt
@@ -1,98 +1,106 @@
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.16 ************
4
5KO/Pi:
6Fixed search dialog size on Z 6000 (480x640 display).
7Added setting to hide/show time in agenda items.
8Added setting to hide not running todos in todo view.
9Added columns for start date/time in todo view.
10
3********** VERSION 1.9.15 ************ 11********** VERSION 1.9.15 ************
4 12
5Usebilty enhancements in KO/Pi: 13Usebilty enhancements in KO/Pi:
6When clicking on the date in a month view cell, the day view is shown. 14When clicking on the date in a month view cell, the day view is shown.
7Old behaviour was, that the "new event" dialog popped up. 15Old behaviour was, that the "new event" dialog popped up.
8 16
9Added a one step "undo delete" in KO/Pi (Accessable in the "Action" menu). 17Added a one step "undo delete" in KO/Pi (Accessable in the "Action" menu).
10That means, you can restore the latest 18That means, you can restore the latest
11event/todo/journal you have deleted. 19event/todo/journal you have deleted.
12A journal is deleted, if you clear all the text of the journal. 20A journal is deleted, if you clear all the text of the journal.
13 21
14Fixed the bug of the editor dialogs in KO/Pi of version 1.9.14. 22Fixed the bug of the editor dialogs in KO/Pi of version 1.9.14.
15 23
16KA/Pi starting in 480x640 resolution: 24KA/Pi starting in 480x640 resolution:
17Hide the filter action in toolbar 25Hide the filter action in toolbar
18and added icons for undo/delete/redo in toolbar. 26and added icons for undo/delete/redo in toolbar.
19 27
20Change in OM/Pi ViewMail dialog: 28Change in OM/Pi ViewMail dialog:
21When clicking on the "delete" icon the mail is deleted after confirmation as usual. But the edit dialog is not closed as before, now the next mail in the folder is shown automatically (if there is any). 29When clicking on the "delete" icon the mail is deleted after confirmation as usual. But the edit dialog is not closed as before, now the next mail in the folder is shown automatically (if there is any).
22 30
23Fixed a crash when deleting mail-accounts in OM/Pi. 31Fixed a crash when deleting mail-accounts in OM/Pi.
24 32
25 33
26********** VERSION 1.9.14 ************ 34********** VERSION 1.9.14 ************
27 35
28Fixed some problems with the dialog sizes when switching 36Fixed some problems with the dialog sizes when switching
29portrait/landscape mode on 640x480 PDA display. 37portrait/landscape mode on 640x480 PDA display.
30 38
31Fixed some other small bugs in KA/Pi KO/Pi and OM/Pi and PwM/Pi. 39Fixed some other small bugs in KA/Pi KO/Pi and OM/Pi and PwM/Pi.
32 40
33Fixed an ugly bug in KOpieMail: 41Fixed an ugly bug in KOpieMail:
34KOpieMail was not able to write files (mails) to MSDOS file system, 42KOpieMail was not able to write files (mails) to MSDOS file system,
35like on an usual preformatted SD card. That should work now. 43like on an usual preformatted SD card. That should work now.
36To save your mail data on the Sd card do the following: 44To save your mail data on the Sd card do the following:
37Create a dir on the SD card: 45Create a dir on the SD card:
38mkdir /mnt/card/localmail 46mkdir /mnt/card/localmail
39Go to your home dir: 47Go to your home dir:
40cd 48cd
41Go to kopiemail data storage dir: 49Go to kopiemail data storage dir:
42cd kdepim/apps/kopiemail 50cd kdepim/apps/kopiemail
43Create a symlink to the SD card: 51Create a symlink to the SD card:
44ls -s /mnt/card/localmail 52ls -s /mnt/card/localmail
45Now KOpieMail will store all mails on the SD card. 53Now KOpieMail will store all mails on the SD card.
46 54
47KO/Pi Monthview: 55KO/Pi Monthview:
48Now "Go to Today" selects the current month from day 1-end, 56Now "Go to Today" selects the current month from day 1-end,
49not the current date + some days. 57not the current date + some days.
50I.e. "Go to Today" shows now always 58I.e. "Go to Today" shows now always
51the current month with first day of month in the first row. 59the current month with first day of month in the first row.
52 60
53Added missing German translation. 61Added missing German translation.
54 62
55Fixed icons of executeable on Wintendo. 63Fixed icons of executeable on Wintendo.
56 64
57Added a "Show next Mail" button to the OM/Pi 65Added a "Show next Mail" button to the OM/Pi
58mail viewer such that the mail below the current mail 66mail viewer such that the mail below the current mail
59in the mail list view of the current folder 67in the mail list view of the current folder
60can be read with a single click. 68can be read with a single click.
61 69
62 70
63********** VERSION 1.9.13 ************ 71********** VERSION 1.9.13 ************
64 72
65Fixed nasty PwM/Pi file reading bug, when 73Fixed nasty PwM/Pi file reading bug, when
66the used hash algo of file is different then the global 74the used hash algo of file is different then the global
67hash algo. 75hash algo.
68 76
69Added KA/Pi support for opie mailit mailapplication. 77Added KA/Pi support for opie mailit mailapplication.
70 78
71Fixed some bugs in OM/Pi. 79Fixed some bugs in OM/Pi.
72Now character conversion tables are available for the Zaurus 80Now character conversion tables are available for the Zaurus
73to make OM/Pi working properly. 81to make OM/Pi working properly.
74To get the character conversion in OM/Pi working, please download 82To get the character conversion in OM/Pi working, please download
75at the sourceforge project site the package 83at the sourceforge project site the package
76sr-character-conversion_SharpROM_arm.ipk.zip 84sr-character-conversion_SharpROM_arm.ipk.zip
77(or oz-character-conversion_OZ-gcc3xx_arm.ipk.zip for OZ roms) 85(or oz-character-conversion_OZ-gcc3xx_arm.ipk.zip for OZ roms)
78from the section "general files for KDE/Pim" 86from the section "general files for KDE/Pim"
79Instructions how to install this package are in a ReadMe in this file. 87Instructions how to install this package are in a ReadMe in this file.
80 88
81 89
82Fixed the orientation change problem in KA/Pi when switching 90Fixed the orientation change problem in KA/Pi when switching
83portrait/landscape mode. 91portrait/landscape mode.
84 92
85French translation available for KA/Pi and OM/Pi. 93French translation available for KA/Pi and OM/Pi.
86 94
87Fixed some problems with categories in KO/Pi in DTM sync. 95Fixed some problems with categories in KO/Pi in DTM sync.
88 96
89Added selection dialog for export to phone in KA/Pi. 97Added selection dialog for export to phone in KA/Pi.
90 98
91If in KO/Pi is an attendee selected to add to a meeting and this 99If in KO/Pi is an attendee selected to add to a meeting and this
92attendee is already in the list of attendees, this person is not added 100attendee is already in the list of attendees, this person is not added
93again. 101again.
94 102
95Some menu cleanup in KA/Pi. 103Some menu cleanup in KA/Pi.
96 104
97********** VERSION 1.9.12 ************ 105********** VERSION 1.9.12 ************
98 106
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index a46cd87..7ddbe23 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -173,237 +173,239 @@ class KOBeamPrefs : public QDialog
173private: 173private:
174 QRadioButton* vcal, *ical, *local, *tz; 174 QRadioButton* vcal, *ical, *local, *tz;
175}; 175};
176class KOCatPrefs : public QDialog 176class KOCatPrefs : public QDialog
177{ 177{
178 public: 178 public:
179 KOCatPrefs( QWidget *parent=0, const char *name=0 ) : 179 KOCatPrefs( QWidget *parent=0, const char *name=0 ) :
180 QDialog( parent, name, true ) 180 QDialog( parent, name, true )
181 { 181 {
182 setCaption( i18n("Manage new Categories") ); 182 setCaption( i18n("Manage new Categories") );
183 QVBoxLayout* lay = new QVBoxLayout( this ); 183 QVBoxLayout* lay = new QVBoxLayout( this );
184 lay->setSpacing( 3 ); 184 lay->setSpacing( 3 );
185 lay->setMargin( 3 ); 185 lay->setMargin( 3 );
186 QLabel * lab = new QLabel( i18n("After importing/loading/syncing\nthere may be new categories in\nevents or todos\nwhich are not in the category list.\nPlease choose what to do:\n "), this ); 186 QLabel * lab = new QLabel( i18n("After importing/loading/syncing\nthere may be new categories in\nevents or todos\nwhich are not in the category list.\nPlease choose what to do:\n "), this );
187 lay->addWidget( lab ); 187 lay->addWidget( lab );
188 QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("New categories not in list:"), this ); 188 QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("New categories not in list:"), this );
189 lay->addWidget( format ); 189 lay->addWidget( format );
190 format->setExclusive ( true ) ; 190 format->setExclusive ( true ) ;
191 addCatBut = new QRadioButton(i18n("Add to category list"), format ); 191 addCatBut = new QRadioButton(i18n("Add to category list"), format );
192 new QRadioButton(i18n("Remove from Events/Todos"), format ); 192 new QRadioButton(i18n("Remove from Events/Todos"), format );
193 addCatBut->setChecked( true ); 193 addCatBut->setChecked( true );
194 QPushButton * ok = new QPushButton( i18n("OK"), this ); 194 QPushButton * ok = new QPushButton( i18n("OK"), this );
195 lay->addWidget( ok ); 195 lay->addWidget( ok );
196 QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); 196 QPushButton * cancel = new QPushButton( i18n("Cancel"), this );
197 lay->addWidget( cancel ); 197 lay->addWidget( cancel );
198 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); 198 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) );
199 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); 199 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) );
200 resize( 200, 200 ); 200 resize( 200, 200 );
201 } 201 }
202 202
203 bool addCat() { return addCatBut->isChecked(); } 203 bool addCat() { return addCatBut->isChecked(); }
204private: 204private:
205 QRadioButton* addCatBut; 205 QRadioButton* addCatBut;
206}; 206};
207 207
208 208
209 209
210CalendarView::CalendarView( CalendarResources *calendar, 210CalendarView::CalendarView( CalendarResources *calendar,
211 QWidget *parent, const char *name ) 211 QWidget *parent, const char *name )
212 : CalendarViewBase( parent, name ), 212 : CalendarViewBase( parent, name ),
213 mCalendar( calendar ), 213 mCalendar( calendar ),
214 mResourceManager( calendar->resourceManager() ) 214 mResourceManager( calendar->resourceManager() )
215{ 215{
216 216
217 mEventEditor = 0; 217 mEventEditor = 0;
218 mTodoEditor = 0; 218 mTodoEditor = 0;
219 219
220 init(); 220 init();
221} 221}
222 222
223CalendarView::CalendarView( Calendar *calendar, 223CalendarView::CalendarView( Calendar *calendar,
224 QWidget *parent, const char *name ) 224 QWidget *parent, const char *name )
225 : CalendarViewBase( parent, name ), 225 : CalendarViewBase( parent, name ),
226 mCalendar( calendar ), 226 mCalendar( calendar ),
227 mResourceManager( 0 ) 227 mResourceManager( 0 )
228{ 228{
229 229
230 mEventEditor = 0; 230 mEventEditor = 0;
231 mTodoEditor = 0; 231 mTodoEditor = 0;
232 init();} 232 init();}
233 233
234void CalendarView::init() 234void CalendarView::init()
235{ 235{
236 beamDialog = new KOBeamPrefs(); 236 beamDialog = new KOBeamPrefs();
237 mDatePickerMode = 0; 237 mDatePickerMode = 0;
238 mCurrentSyncDevice = ""; 238 mCurrentSyncDevice = "";
239 writeLocale(); 239 writeLocale();
240 mViewManager = new KOViewManager( this ); 240 mViewManager = new KOViewManager( this );
241 mDialogManager = new KODialogManager( this ); 241 mDialogManager = new KODialogManager( this );
242 mEventViewerDialog = 0; 242 mEventViewerDialog = 0;
243 mModified = false; 243 mModified = false;
244 mReadOnly = false; 244 mReadOnly = false;
245 mSelectedIncidence = 0; 245 mSelectedIncidence = 0;
246 mCalPrinter = 0; 246 mCalPrinter = 0;
247 mFilters.setAutoDelete(true); 247 mFilters.setAutoDelete(true);
248 248
249 mCalendar->registerObserver( this ); 249 mCalendar->registerObserver( this );
250 // TODO: Make sure that view is updated, when calendar is changed. 250 // TODO: Make sure that view is updated, when calendar is changed.
251 251
252 mStorage = new FileStorage( mCalendar ); 252 mStorage = new FileStorage( mCalendar );
253 mNavigator = new DateNavigator( this, "datevav", mViewManager ); 253 mNavigator = new DateNavigator( this, "datevav", mViewManager );
254 254
255 QBoxLayout *topLayout = (QBoxLayout*)layout(); 255 QBoxLayout *topLayout = (QBoxLayout*)layout();
256#ifndef KORG_NOSPLITTER 256#ifndef KORG_NOSPLITTER
257 // create the main layout frames. 257 // create the main layout frames.
258 mPanner = new QSplitter(QSplitter::Horizontal,this,"CalendarView::Panner"); 258 mPanner = new QSplitter(QSplitter::Horizontal,this,"CalendarView::Panner");
259 topLayout->addWidget(mPanner); 259 topLayout->addWidget(mPanner);
260 260
261 mLeftSplitter = new QSplitter(QSplitter::Vertical,mPanner, 261 mLeftSplitter = new QSplitter(QSplitter::Vertical,mPanner,
262 "CalendarView::LeftFrame"); 262 "CalendarView::LeftFrame");
263 mPanner->setResizeMode(mLeftSplitter,QSplitter::KeepSize); 263 mPanner->setResizeMode(mLeftSplitter,QSplitter::KeepSize);
264 264
265 mDateNavigator = new KDateNavigator(mLeftSplitter, mCalendar, TRUE, 265 mDateNavigator = new KDateNavigator(mLeftSplitter, mCalendar, TRUE,
266 "CalendarView::DateNavigator", QDate::currentDate() ); 266 "CalendarView::DateNavigator", QDate::currentDate() );
267 mLeftSplitter->setResizeMode(mDateNavigator,QSplitter::KeepSize); 267 mLeftSplitter->setResizeMode(mDateNavigator,QSplitter::KeepSize);
268 mTodoList = new KOTodoView(mCalendar, mLeftSplitter, "todolist_small2"); 268 mTodoList = new KOTodoView(mCalendar, mLeftSplitter, "todolist_small2");
269 mTodoList->setNavigator( mNavigator );
269 mFilterView = new KOFilterView(&mFilters,mLeftSplitter,"CalendarView::FilterView"); 270 mFilterView = new KOFilterView(&mFilters,mLeftSplitter,"CalendarView::FilterView");
270 271
271#ifdef KORG_NORESOURCEVIEW 272#ifdef KORG_NORESOURCEVIEW
272 mResourceView = 0; 273 mResourceView = 0;
273#else 274#else
274 if ( mResourceManager ) { 275 if ( mResourceManager ) {
275 mResourceView = new ResourceView( mResourceManager, mLeftSplitter ); 276 mResourceView = new ResourceView( mResourceManager, mLeftSplitter );
276 mResourceView->updateView(); 277 mResourceView->updateView();
277 connect( mResourceView, SIGNAL( resourcesChanged() ), 278 connect( mResourceView, SIGNAL( resourcesChanged() ),
278 SLOT( updateView() ) ); 279 SLOT( updateView() ) );
279 } else { 280 } else {
280 mResourceView = 0; 281 mResourceView = 0;
281 } 282 }
282#endif 283#endif
283 QWidget *rightBox = new QWidget( mPanner ); 284 QWidget *rightBox = new QWidget( mPanner );
284 QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); 285 QBoxLayout *rightLayout = new QVBoxLayout( rightBox );
285 286
286 mNavigatorBar = new NavigatorBar( QDate::currentDate(), rightBox, "useBigPixmaps" ); 287 mNavigatorBar = new NavigatorBar( QDate::currentDate(), rightBox, "useBigPixmaps" );
287 rightLayout->addWidget( mNavigatorBar ); 288 rightLayout->addWidget( mNavigatorBar );
288 289
289 mRightFrame = new QWidgetStack( rightBox ); 290 mRightFrame = new QWidgetStack( rightBox );
290 rightLayout->addWidget( mRightFrame, 1 ); 291 rightLayout->addWidget( mRightFrame, 1 );
291 292
292 mLeftFrame = mLeftSplitter; 293 mLeftFrame = mLeftSplitter;
293#else 294#else
294 QWidget *mainBox = new QWidget( this ); 295 QWidget *mainBox = new QWidget( this );
295 QWidget *leftFrame = new QWidget( mainBox ); 296 QWidget *leftFrame = new QWidget( mainBox );
296 297
297 QBoxLayout * mainBoxLayout; 298 QBoxLayout * mainBoxLayout;
298 QBoxLayout * leftFrameLayout; 299 QBoxLayout * leftFrameLayout;
299 if ( KOPrefs::instance()->mVerticalScreen ) { 300 if ( KOPrefs::instance()->mVerticalScreen ) {
300 mainBoxLayout = new QVBoxLayout(mainBox); 301 mainBoxLayout = new QVBoxLayout(mainBox);
301 leftFrameLayout = new QHBoxLayout(leftFrame ); 302 leftFrameLayout = new QHBoxLayout(leftFrame );
302 } else { 303 } else {
303 mainBoxLayout = new QHBoxLayout(mainBox); 304 mainBoxLayout = new QHBoxLayout(mainBox);
304 leftFrameLayout = new QVBoxLayout(leftFrame ); 305 leftFrameLayout = new QVBoxLayout(leftFrame );
305 } 306 }
306 topLayout->addWidget( mainBox ); 307 topLayout->addWidget( mainBox );
307 mainBoxLayout->addWidget (leftFrame); 308 mainBoxLayout->addWidget (leftFrame);
308 mDateNavigator = new KDateNavigator(leftFrame, mCalendar, TRUE, 309 mDateNavigator = new KDateNavigator(leftFrame, mCalendar, TRUE,
309 "CalendarView::DateNavigator", QDate::currentDate()); 310 "CalendarView::DateNavigator", QDate::currentDate());
310 // mDateNavigator->blockSignals( true ); 311 // mDateNavigator->blockSignals( true );
311 leftFrameLayout->addWidget( mDateNavigator ); 312 leftFrameLayout->addWidget( mDateNavigator );
312 mFilterView = new KOFilterView(&mFilters,leftFrame,"CalendarView::FilterView"); 313 mFilterView = new KOFilterView(&mFilters,leftFrame,"CalendarView::FilterView");
313 mTodoList = new KOTodoView(mCalendar, leftFrame, "todolistsmall"); 314 mTodoList = new KOTodoView(mCalendar, leftFrame, "todolistsmall");
315 mTodoList->setNavigator( mNavigator );
314 316
315 if ( QApplication::desktop()->width() < 480 ) { 317 if ( QApplication::desktop()->width() < 480 ) {
316 leftFrameLayout->addWidget(mFilterView); 318 leftFrameLayout->addWidget(mFilterView);
317 leftFrameLayout->addWidget(mTodoList, 2 ); 319 leftFrameLayout->addWidget(mTodoList, 2 );
318 320
319 } else { 321 } else {
320 leftFrameLayout->addWidget(mTodoList,2 ); 322 leftFrameLayout->addWidget(mTodoList,2 );
321 leftFrameLayout->addWidget(mFilterView ); 323 leftFrameLayout->addWidget(mFilterView );
322 } 324 }
323 mFilterView->hide(); 325 mFilterView->hide();
324 QWidget *rightBox = new QWidget( mainBox ); 326 QWidget *rightBox = new QWidget( mainBox );
325 mainBoxLayout->addWidget ( rightBox, 10 ); 327 mainBoxLayout->addWidget ( rightBox, 10 );
326 QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); 328 QBoxLayout *rightLayout = new QVBoxLayout( rightBox );
327 mNavigatorBar = new NavigatorBar( QDate::currentDate(), rightBox, "useBigPixmaps" ); 329 mNavigatorBar = new NavigatorBar( QDate::currentDate(), rightBox, "useBigPixmaps" );
328 mRightFrame = new QWidgetStack( rightBox ); 330 mRightFrame = new QWidgetStack( rightBox );
329 rightLayout->addWidget( mNavigatorBar ); 331 rightLayout->addWidget( mNavigatorBar );
330 rightLayout->addWidget( mRightFrame, 10 ); 332 rightLayout->addWidget( mRightFrame, 10 );
331 333
332 mLeftFrame = leftFrame; 334 mLeftFrame = leftFrame;
333 if ( KOPrefs::instance()->mVerticalScreen ) { 335 if ( KOPrefs::instance()->mVerticalScreen ) {
334 mTodoList->setFixedHeight( mDateNavigator->sizeHint().height() ); 336 mTodoList->setFixedHeight( mDateNavigator->sizeHint().height() );
335 leftFrame->setFixedHeight( mDateNavigator->sizeHint().height() ); 337 leftFrame->setFixedHeight( mDateNavigator->sizeHint().height() );
336 } else { 338 } else {
337 mTodoList->setFixedWidth( mDateNavigator->sizeHint().width() ); 339 mTodoList->setFixedWidth( mDateNavigator->sizeHint().width() );
338 leftFrame->setFixedWidth( mDateNavigator->sizeHint().width() ); 340 leftFrame->setFixedWidth( mDateNavigator->sizeHint().width() );
339 } 341 }
340 342
341 //qDebug("Calendarview Size %d %d ", width(), height()); 343 //qDebug("Calendarview Size %d %d ", width(), height());
342#endif 344#endif
343 345
344 connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), 346 connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ),
345 SLOT( showDates( const KCal::DateList & ) ) ); 347 SLOT( showDates( const KCal::DateList & ) ) );
346 connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), 348 connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ),
347 mDateNavigator, SLOT( selectDates( const KCal::DateList & ) ) ); 349 mDateNavigator, SLOT( selectDates( const KCal::DateList & ) ) );
348 350
349 connect( mNavigatorBar, SIGNAL( goPrevYear() ), 351 connect( mNavigatorBar, SIGNAL( goPrevYear() ),
350 mNavigator, SLOT( selectPreviousYear() ) ); 352 mNavigator, SLOT( selectPreviousYear() ) );
351 connect( mNavigatorBar, SIGNAL( goNextYear() ), 353 connect( mNavigatorBar, SIGNAL( goNextYear() ),
352 mNavigator, SLOT( selectNextYear() ) ); 354 mNavigator, SLOT( selectNextYear() ) );
353 connect( mNavigatorBar, SIGNAL( goPrevMonth() ), 355 connect( mNavigatorBar, SIGNAL( goPrevMonth() ),
354 mNavigator, SLOT( selectPreviousMonth() ) ); 356 mNavigator, SLOT( selectPreviousMonth() ) );
355 connect( mNavigatorBar, SIGNAL( goNextMonth() ), 357 connect( mNavigatorBar, SIGNAL( goNextMonth() ),
356 mNavigator, SLOT( selectNextMonth() ) ); 358 mNavigator, SLOT( selectNextMonth() ) );
357 359
358 connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), 360 connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ),
359 mNavigatorBar, SLOT( selectDates( const KCal::DateList & ) ) ); 361 mNavigatorBar, SLOT( selectDates( const KCal::DateList & ) ) );
360 362
361 connect( mDateNavigator, SIGNAL( weekClicked( const QDate & ) ), 363 connect( mDateNavigator, SIGNAL( weekClicked( const QDate & ) ),
362 mNavigator, SLOT( selectWeek( const QDate & ) ) ); 364 mNavigator, SLOT( selectWeek( const QDate & ) ) );
363 365
364 connect( mDateNavigator, SIGNAL( goPrevYear() ), 366 connect( mDateNavigator, SIGNAL( goPrevYear() ),
365 mNavigator, SLOT( selectPreviousYear() ) ); 367 mNavigator, SLOT( selectPreviousYear() ) );
366 connect( mDateNavigator, SIGNAL( goNextYear() ), 368 connect( mDateNavigator, SIGNAL( goNextYear() ),
367 mNavigator, SLOT( selectNextYear() ) ); 369 mNavigator, SLOT( selectNextYear() ) );
368 connect( mDateNavigator, SIGNAL( goPrevMonth() ), 370 connect( mDateNavigator, SIGNAL( goPrevMonth() ),
369 mNavigator, SLOT( selectPreviousMonth() ) ); 371 mNavigator, SLOT( selectPreviousMonth() ) );
370 connect( mDateNavigator, SIGNAL( goNextMonth() ), 372 connect( mDateNavigator, SIGNAL( goNextMonth() ),
371 mNavigator, SLOT( selectNextMonth() ) ); 373 mNavigator, SLOT( selectNextMonth() ) );
372 374
373 connect( mDateNavigator, SIGNAL( goPrevious() ), 375 connect( mDateNavigator, SIGNAL( goPrevious() ),
374 mNavigator, SLOT( selectPrevious() ) ); 376 mNavigator, SLOT( selectPrevious() ) );
375 connect( mDateNavigator, SIGNAL( goNext() ), 377 connect( mDateNavigator, SIGNAL( goNext() ),
376 mNavigator, SLOT( selectNext() ) ); 378 mNavigator, SLOT( selectNext() ) );
377 connect( mDateNavigator, SIGNAL( monthSelected ( int ) ), 379 connect( mDateNavigator, SIGNAL( monthSelected ( int ) ),
378 mNavigator, SLOT( slotMonthSelect( int ) ) ); 380 mNavigator, SLOT( slotMonthSelect( int ) ) );
379 connect( mNavigatorBar, SIGNAL( monthSelected ( int ) ), 381 connect( mNavigatorBar, SIGNAL( monthSelected ( int ) ),
380 mNavigator, SLOT( slotMonthSelect( int ) ) ); 382 mNavigator, SLOT( slotMonthSelect( int ) ) );
381 383
382 connect( mDateNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), 384 connect( mDateNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ),
383 mNavigator, SLOT( selectDates( const KCal::DateList & ) ) ); 385 mNavigator, SLOT( selectDates( const KCal::DateList & ) ) );
384 386
385 connect( mDateNavigator, SIGNAL( eventDropped( Event * ) ), 387 connect( mDateNavigator, SIGNAL( eventDropped( Event * ) ),
386 SLOT( eventAdded( Event *) ) ); 388 SLOT( eventAdded( Event *) ) );
387 389
388 connect(mDateNavigator,SIGNAL(dayPassed(QDate)),SLOT(updateView())); 390 connect(mDateNavigator,SIGNAL(dayPassed(QDate)),SLOT(updateView()));
389 391
390 connect( this, SIGNAL( configChanged() ), 392 connect( this, SIGNAL( configChanged() ),
391 mDateNavigator, SLOT( updateConfig() ) ); 393 mDateNavigator, SLOT( updateConfig() ) );
392 394
393 connect( mTodoList, SIGNAL( newTodoSignal() ), 395 connect( mTodoList, SIGNAL( newTodoSignal() ),
394 SLOT( newTodo() ) ); 396 SLOT( newTodo() ) );
395 connect( mTodoList, SIGNAL( newSubTodoSignal( Todo *) ), 397 connect( mTodoList, SIGNAL( newSubTodoSignal( Todo *) ),
396 SLOT( newSubTodo( Todo * ) ) ); 398 SLOT( newSubTodo( Todo * ) ) );
397 connect( mTodoList, SIGNAL( editTodoSignal( Todo * ) ), 399 connect( mTodoList, SIGNAL( editTodoSignal( Todo * ) ),
398 SLOT( editTodo( Todo * ) ) ); 400 SLOT( editTodo( Todo * ) ) );
399 connect( mTodoList, SIGNAL( showTodoSignal( Todo * ) ), 401 connect( mTodoList, SIGNAL( showTodoSignal( Todo * ) ),
400 SLOT( showTodo( Todo *) ) ); 402 SLOT( showTodo( Todo *) ) );
401 connect( mTodoList, SIGNAL( deleteTodoSignal( Todo *) ), 403 connect( mTodoList, SIGNAL( deleteTodoSignal( Todo *) ),
402 SLOT( deleteTodo( Todo *) ) ); 404 SLOT( deleteTodo( Todo *) ) );
403 connect( this, SIGNAL( configChanged()), mTodoList, SLOT( updateConfig() ) ); 405 connect( this, SIGNAL( configChanged()), mTodoList, SLOT( updateConfig() ) );
404 connect( mTodoList, SIGNAL( purgeCompletedSignal() ), 406 connect( mTodoList, SIGNAL( purgeCompletedSignal() ),
405 SLOT( purgeCompleted() ) ); 407 SLOT( purgeCompleted() ) );
406 connect( mTodoList, SIGNAL( todoModifiedSignal( Todo *, int ) ), 408 connect( mTodoList, SIGNAL( todoModifiedSignal( Todo *, int ) ),
407 SIGNAL( todoModified( Todo *, int ) ) ); 409 SIGNAL( todoModified( Todo *, int ) ) );
408 410
409 connect( mTodoList, SIGNAL( cloneTodoSignal( Incidence * ) ), 411 connect( mTodoList, SIGNAL( cloneTodoSignal( Incidence * ) ),
@@ -2051,192 +2053,194 @@ void CalendarView::updateConfig()
2051 mCalendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); 2053 mCalendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId);
2052 // To make the "fill window" configurations work 2054 // To make the "fill window" configurations work
2053 //mViewManager->raiseCurrentView(); 2055 //mViewManager->raiseCurrentView();
2054} 2056}
2055 2057
2056 2058
2057void CalendarView::eventChanged(Event *event) 2059void CalendarView::eventChanged(Event *event)
2058{ 2060{
2059 changeEventDisplay(event,KOGlobals::EVENTEDITED); 2061 changeEventDisplay(event,KOGlobals::EVENTEDITED);
2060 //updateUnmanagedViews(); 2062 //updateUnmanagedViews();
2061} 2063}
2062 2064
2063void CalendarView::eventAdded(Event *event) 2065void CalendarView::eventAdded(Event *event)
2064{ 2066{
2065 changeEventDisplay(event,KOGlobals::EVENTADDED); 2067 changeEventDisplay(event,KOGlobals::EVENTADDED);
2066} 2068}
2067 2069
2068void CalendarView::eventToBeDeleted(Event *) 2070void CalendarView::eventToBeDeleted(Event *)
2069{ 2071{
2070 kdDebug() << "CalendarView::eventToBeDeleted(): to be implemented" << endl; 2072 kdDebug() << "CalendarView::eventToBeDeleted(): to be implemented" << endl;
2071} 2073}
2072 2074
2073void CalendarView::eventDeleted() 2075void CalendarView::eventDeleted()
2074{ 2076{
2075 changeEventDisplay(0,KOGlobals::EVENTDELETED); 2077 changeEventDisplay(0,KOGlobals::EVENTDELETED);
2076} 2078}
2077void CalendarView::changeTodoDisplay(Todo *which, int action) 2079void CalendarView::changeTodoDisplay(Todo *which, int action)
2078{ 2080{
2079 changeIncidenceDisplay((Incidence *)which, action); 2081 changeIncidenceDisplay((Incidence *)which, action);
2080 mDateNavigator->updateView(); //LR 2082 mDateNavigator->updateView(); //LR
2081 //mDialogManager->updateSearchDialog(); 2083 //mDialogManager->updateSearchDialog();
2082 2084
2083 if (which) { 2085 if (which) {
2084 mViewManager->updateWNview(); 2086 mViewManager->updateWNview();
2085 //mTodoList->updateView(); 2087 //mTodoList->updateView();
2086 } 2088 }
2087 2089
2088} 2090}
2089 2091
2090void CalendarView::changeIncidenceDisplay(Incidence *which, int action) 2092void CalendarView::changeIncidenceDisplay(Incidence *which, int action)
2091{ 2093{
2092 updateUnmanagedViews(); 2094 updateUnmanagedViews();
2093 //qDebug(" CalendarView::changeIncidenceDisplay++++++++++++++++++++++++++ %d %d ",which, action ); 2095 //qDebug(" CalendarView::changeIncidenceDisplay++++++++++++++++++++++++++ %d %d ",which, action );
2094 if ( action == KOGlobals::EVENTDELETED ) { //delete 2096 if ( action == KOGlobals::EVENTDELETED ) { //delete
2095 mCalendar->checkAlarmForIncidence( 0, true ); 2097 mCalendar->checkAlarmForIncidence( 0, true );
2096 if ( mEventViewerDialog ) 2098 if ( mEventViewerDialog )
2097 mEventViewerDialog->hide(); 2099 mEventViewerDialog->hide();
2098 } 2100 }
2099 else 2101 else
2100 mCalendar->checkAlarmForIncidence( which , false ); 2102 mCalendar->checkAlarmForIncidence( which , false );
2101} 2103}
2102 2104
2103// most of the changeEventDisplays() right now just call the view's 2105// most of the changeEventDisplays() right now just call the view's
2104// total update mode, but they SHOULD be recoded to be more refresh-efficient. 2106// total update mode, but they SHOULD be recoded to be more refresh-efficient.
2105void CalendarView::changeEventDisplay(Event *which, int action) 2107void CalendarView::changeEventDisplay(Event *which, int action)
2106{ 2108{
2107 // kdDebug() << "CalendarView::changeEventDisplay" << endl; 2109 // kdDebug() << "CalendarView::changeEventDisplay" << endl;
2108 changeIncidenceDisplay((Incidence *)which, action); 2110 changeIncidenceDisplay((Incidence *)which, action);
2109 mDateNavigator->updateView(); 2111 mDateNavigator->updateView();
2110 //mDialogManager->updateSearchDialog(); 2112 //mDialogManager->updateSearchDialog();
2111 2113
2112 if (which) { 2114 if (which) {
2113 // If there is an event view visible update the display 2115 // If there is an event view visible update the display
2114 mViewManager->currentView()->changeEventDisplay(which,action); 2116 mViewManager->currentView()->changeEventDisplay(which,action);
2115 // TODO: check, if update needed 2117 // TODO: check, if update needed
2116 // if (which->getTodoStatus()) { 2118 // if (which->getTodoStatus()) {
2117 mTodoList->updateView(); 2119 mTodoList->updateView();
2118 // } 2120 // }
2119 } else { 2121 } else {
2120 mViewManager->currentView()->updateView(); 2122 mViewManager->currentView()->updateView();
2121 } 2123 }
2122} 2124}
2123 2125
2124 2126
2125void CalendarView::updateTodoViews() 2127void CalendarView::updateTodoViews()
2126{ 2128{
2127 2129
2128 mTodoList->updateView(); 2130 mTodoList->updateView();
2129 mViewManager->currentView()->updateView(); 2131 mViewManager->currentView()->updateView();
2130 2132
2131} 2133}
2132 2134
2133 2135
2134void CalendarView::updateView(const QDate &start, const QDate &end) 2136void CalendarView::updateView(const QDate &start, const QDate &end)
2135{ 2137{
2136 mTodoList->updateView(); 2138 mTodoList->updateView();
2137 mViewManager->updateView(start, end); 2139 mViewManager->updateView(start, end);
2138 //mDateNavigator->updateView(); 2140 //mDateNavigator->updateView();
2139} 2141}
2140 2142
2141void CalendarView::updateView() 2143void CalendarView::updateView()
2142{ 2144{
2143 DateList tmpList = mNavigator->selectedDates(); 2145 DateList tmpList = mNavigator->selectedDates();
2144 2146
2145 // We assume that the navigator only selects consecutive days. 2147 // We assume that the navigator only selects consecutive days.
2146 updateView( tmpList.first(), tmpList.last() ); 2148 updateView( tmpList.first(), tmpList.last() );
2149 if ( KOPrefs::instance()->mHideNonStartedTodos )
2150 mTodoList->updateView();
2147} 2151}
2148 2152
2149void CalendarView::updateUnmanagedViews() 2153void CalendarView::updateUnmanagedViews()
2150{ 2154{
2151 mDateNavigator->updateDayMatrix(); 2155 mDateNavigator->updateDayMatrix();
2152} 2156}
2153 2157
2154int CalendarView::msgItemDelete() 2158int CalendarView::msgItemDelete()
2155{ 2159{
2156 return KMessageBox::warningContinueCancel(this, 2160 return KMessageBox::warningContinueCancel(this,
2157 i18n("This item will be\npermanently deleted."), 2161 i18n("This item will be\npermanently deleted."),
2158 i18n("KO/Pi Confirmation"),i18n("Delete")); 2162 i18n("KO/Pi Confirmation"),i18n("Delete"));
2159} 2163}
2160 2164
2161 2165
2162void CalendarView::edit_cut() 2166void CalendarView::edit_cut()
2163{ 2167{
2164 Event *anEvent=0; 2168 Event *anEvent=0;
2165 2169
2166 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); 2170 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first();
2167 2171
2168 if (mViewManager->currentView()->isEventView()) { 2172 if (mViewManager->currentView()->isEventView()) {
2169 if ( incidence && incidence->type() == "Event" ) { 2173 if ( incidence && incidence->type() == "Event" ) {
2170 anEvent = static_cast<Event *>(incidence); 2174 anEvent = static_cast<Event *>(incidence);
2171 } 2175 }
2172 } 2176 }
2173 2177
2174 if (!anEvent) { 2178 if (!anEvent) {
2175 KNotifyClient::beep(); 2179 KNotifyClient::beep();
2176 return; 2180 return;
2177 } 2181 }
2178 DndFactory factory( mCalendar ); 2182 DndFactory factory( mCalendar );
2179 factory.cutEvent(anEvent); 2183 factory.cutEvent(anEvent);
2180 changeEventDisplay(anEvent, KOGlobals::EVENTDELETED); 2184 changeEventDisplay(anEvent, KOGlobals::EVENTDELETED);
2181} 2185}
2182 2186
2183void CalendarView::edit_copy() 2187void CalendarView::edit_copy()
2184{ 2188{
2185 Event *anEvent=0; 2189 Event *anEvent=0;
2186 2190
2187 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); 2191 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first();
2188 2192
2189 if (mViewManager->currentView()->isEventView()) { 2193 if (mViewManager->currentView()->isEventView()) {
2190 if ( incidence && incidence->type() == "Event" ) { 2194 if ( incidence && incidence->type() == "Event" ) {
2191 anEvent = static_cast<Event *>(incidence); 2195 anEvent = static_cast<Event *>(incidence);
2192 } 2196 }
2193 } 2197 }
2194 2198
2195 if (!anEvent) { 2199 if (!anEvent) {
2196 KNotifyClient::beep(); 2200 KNotifyClient::beep();
2197 return; 2201 return;
2198 } 2202 }
2199 DndFactory factory( mCalendar ); 2203 DndFactory factory( mCalendar );
2200 factory.copyEvent(anEvent); 2204 factory.copyEvent(anEvent);
2201} 2205}
2202 2206
2203void CalendarView::edit_paste() 2207void CalendarView::edit_paste()
2204{ 2208{
2205 QDate date = mNavigator->selectedDates().first(); 2209 QDate date = mNavigator->selectedDates().first();
2206 2210
2207 DndFactory factory( mCalendar ); 2211 DndFactory factory( mCalendar );
2208 Event *pastedEvent = factory.pasteEvent( date ); 2212 Event *pastedEvent = factory.pasteEvent( date );
2209 2213
2210 changeEventDisplay( pastedEvent, KOGlobals::EVENTADDED ); 2214 changeEventDisplay( pastedEvent, KOGlobals::EVENTADDED );
2211} 2215}
2212 2216
2213void CalendarView::edit_options() 2217void CalendarView::edit_options()
2214{ 2218{
2215 mDialogManager->showOptionsDialog(); 2219 mDialogManager->showOptionsDialog();
2216 //writeSettings(); 2220 //writeSettings();
2217} 2221}
2218 2222
2219 2223
2220void CalendarView::slotSelectPickerDate( QDate d) 2224void CalendarView::slotSelectPickerDate( QDate d)
2221{ 2225{
2222 mDateFrame->hide(); 2226 mDateFrame->hide();
2223 if ( mDatePickerMode == 1 ) { 2227 if ( mDatePickerMode == 1 ) {
2224 mNavigator->slotDaySelect( d ); 2228 mNavigator->slotDaySelect( d );
2225 } else if ( mDatePickerMode == 2 ) { 2229 } else if ( mDatePickerMode == 2 ) {
2226 if ( mMoveIncidence->type() == "Todo" ) { 2230 if ( mMoveIncidence->type() == "Todo" ) {
2227 Todo * to = (Todo *) mMoveIncidence; 2231 Todo * to = (Todo *) mMoveIncidence;
2228 QTime tim; 2232 QTime tim;
2229 if ( to->hasDueDate() ) 2233 if ( to->hasDueDate() )
2230 tim = to->dtDue().time(); 2234 tim = to->dtDue().time();
2231 else { 2235 else {
2232 tim = QTime ( 0,0,0 ); 2236 tim = QTime ( 0,0,0 );
2233 to->setFloats( true ); 2237 to->setFloats( true );
2234 to->setHasDueDate( true ); 2238 to->setHasDueDate( true );
2235 } 2239 }
2236 QDateTime dt ( d,tim ); 2240 QDateTime dt ( d,tim );
2237 to->setDtDue( dt ); 2241 to->setDtDue( dt );
2238 todoChanged( to ); 2242 todoChanged( to );
2239 } else { 2243 } else {
2240 if ( mMoveIncidence->doesRecur() ) { 2244 if ( mMoveIncidence->doesRecur() ) {
2241#if 0 2245#if 0
2242 // PENDING implement this 2246 // PENDING implement this
diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp
index 46184ac..6965ba7 100644
--- a/korganizer/koagendaitem.cpp
+++ b/korganizer/koagendaitem.cpp
@@ -405,193 +405,193 @@ void KOAgendaItem::paintMe( bool selected, QPainter* paint )
405 405
406 } 406 }
407 } 407 }
408 QRect dr; 408 QRect dr;
409 paint->drawText ( x, yy, w, h, align, mDisplayedText, -1, &dr ); 409 paint->drawText ( x, yy, w, h, align, mDisplayedText, -1, &dr );
410 if ( mIncidence->cancelled() ){ 410 if ( mIncidence->cancelled() ){
411 if ( ! small ) { 411 if ( ! small ) {
412 QFontMetrics fm ( paint->font() ); 412 QFontMetrics fm ( paint->font() );
413 paint->drawLine(dr.left(), yy+fm.height()/2, dr.right()-2, yy+fm.height()/2); 413 paint->drawLine(dr.left(), yy+fm.height()/2, dr.right()-2, yy+fm.height()/2);
414 } 414 }
415 415
416 } 416 }
417 pa.end(); 417 pa.end();
418 418
419} 419}
420void KOAgendaItem::resizePixmap( int w , int h ) 420void KOAgendaItem::resizePixmap( int w , int h )
421{ 421{
422 paintPix()->resize( w, h ); 422 paintPix()->resize( w, h );
423 paintPixSel()->resize( w, h ); 423 paintPixSel()->resize( w, h );
424 424
425} 425}
426QPixmap * KOAgendaItem::paintPix() 426QPixmap * KOAgendaItem::paintPix()
427{ 427{
428 static QPixmap* mPaintPix = 0; 428 static QPixmap* mPaintPix = 0;
429 if ( ! mPaintPix ) 429 if ( ! mPaintPix )
430 mPaintPix = new QPixmap(); 430 mPaintPix = new QPixmap();
431 return mPaintPix ; 431 return mPaintPix ;
432} 432}
433QPixmap * KOAgendaItem::paintPixAllday() 433QPixmap * KOAgendaItem::paintPixAllday()
434{ 434{
435 static QPixmap* mPaintPixA = 0; 435 static QPixmap* mPaintPixA = 0;
436 if ( ! mPaintPixA ) 436 if ( ! mPaintPixA )
437 mPaintPixA = new QPixmap(); 437 mPaintPixA = new QPixmap();
438 return mPaintPixA ; 438 return mPaintPixA ;
439} 439}
440QPixmap * KOAgendaItem::paintPixSel() 440QPixmap * KOAgendaItem::paintPixSel()
441{ 441{
442 static QPixmap* mPaintPixSel = 0; 442 static QPixmap* mPaintPixSel = 0;
443 if ( ! mPaintPixSel ) 443 if ( ! mPaintPixSel )
444 mPaintPixSel = new QPixmap(); 444 mPaintPixSel = new QPixmap();
445 return mPaintPixSel ; 445 return mPaintPixSel ;
446} 446}
447void KOAgendaItem::paintEvent ( QPaintEvent *e ) 447void KOAgendaItem::paintEvent ( QPaintEvent *e )
448{ 448{
449 449
450 if ( globalFlagBlockAgendaItemPaint ) 450 if ( globalFlagBlockAgendaItemPaint )
451 return; 451 return;
452 if ( globalFlagBlockAgenda > 0 && globalFlagBlockAgenda < 5 ) 452 if ( globalFlagBlockAgenda > 0 && globalFlagBlockAgenda < 5 )
453 return; 453 return;
454 int yy; 454 int yy;
455 if ( mAllDay ) 455 if ( mAllDay )
456 yy = y(); 456 yy = y();
457 else 457 else
458 yy = mCellYTop * ( height() / cellHeight() ); 458 yy = mCellYTop * ( height() / cellHeight() );
459 int xx = x(); 459 int xx = x();
460 if ( xPaintCoord != xx || yPaintCoord != yy || 460 if ( xPaintCoord != xx || yPaintCoord != yy ||
461 wPaintCoord != width() || hPaintCoord != height()) { 461 wPaintCoord != width() || hPaintCoord != height()) {
462 xPaintCoord= xx; 462 xPaintCoord= xx;
463 yPaintCoord = yy; 463 yPaintCoord = yy;
464 wPaintCoord = width(); 464 wPaintCoord = width();
465 hPaintCoord = height(); 465 hPaintCoord = height();
466 globalFlagBlockAgendaItemUpdate = 0; 466 globalFlagBlockAgendaItemUpdate = 0;
467 paintMe( mSelected ); 467 paintMe( mSelected );
468 //qDebug("calling paintMe "); 468 //qDebug("calling paintMe ");
469 globalFlagBlockAgendaItemUpdate = 1; 469 globalFlagBlockAgendaItemUpdate = 1;
470 } 470 }
471 int rx, ry, rw, rh; 471 int rx, ry, rw, rh;
472 rx = e->rect().x(); 472 rx = e->rect().x();
473 ry = e->rect().y(); 473 ry = e->rect().y();
474 rw = e->rect().width(); 474 rw = e->rect().width();
475 rh = e->rect().height(); 475 rh = e->rect().height();
476 //qDebug(" paintevent %s %d %d %d %d", mIncidence->summary().latin1(), x(), yy, width(), height()); 476 //qDebug(" paintevent %s %d %d %d %d", mIncidence->summary().latin1(), x(), yy, width(), height());
477 477
478 QPixmap* paintFrom ; 478 QPixmap* paintFrom ;
479 if ( mSelected ) { 479 if ( mSelected ) {
480 paintFrom = paintPixSel(); 480 paintFrom = paintPixSel();
481 } else { 481 } else {
482 if ( mAllDay ) 482 if ( mAllDay )
483 paintFrom = paintPixAllday(); 483 paintFrom = paintPixAllday();
484 else 484 else
485 paintFrom = paintPix(); 485 paintFrom = paintPix();
486 } 486 }
487 bitBlt (this, rx, ry, paintFrom, x()+rx ,yPaintCoord+ry, rw, rh ,CopyROP); 487 bitBlt (this, rx, ry, paintFrom, x()+rx ,yPaintCoord+ry, rw, rh ,CopyROP);
488} 488}
489void KOAgendaItem::computeText() 489void KOAgendaItem::computeText()
490{ 490{
491 mDisplayedText = mIncidence->summary(); 491 mDisplayedText = mIncidence->summary();
492 if ( (mIncidence->type() == "Todo") ) { 492 if ( (mIncidence->type() == "Todo") ) {
493 if ( static_cast<Todo*>(mIncidence)->dtDue().date() < QDate::currentDate() ) 493 if ( static_cast<Todo*>(mIncidence)->dtDue().date() < QDate::currentDate() )
494 mDisplayedText += i18n(" (") +KGlobal::locale()->formatDate((static_cast<Todo*>(mIncidence))->dtDue().date(), true)+")"; 494 mDisplayedText += i18n(" (") +KGlobal::locale()->formatDate((static_cast<Todo*>(mIncidence))->dtDue().date(), true)+")";
495 else if ( !(mIncidence->doesFloat())) 495 else if ( !(mIncidence->doesFloat()))
496 mDisplayedText += i18n(" (") +KGlobal::locale()->formatTime((static_cast<Todo*>(mIncidence))->dtDue().time())+")"; 496 mDisplayedText += i18n(" (") +KGlobal::locale()->formatTime((static_cast<Todo*>(mIncidence))->dtDue().time())+")";
497 497
498 498
499 499
500 } else { 500 } else {
501 if ( !(mIncidence->doesFloat())) 501 if ( !(mIncidence->doesFloat()) && KOPrefs::instance()->mShowTimeInAgenda)
502 mDisplayedText += ": " +KGlobal::locale()->formatTime((static_cast<Event*>(mIncidence))->dtStart().time()) + "-" + KGlobal::locale()->formatTime((static_cast<Event*>(mIncidence))->dtEnd().time()) ; 502 mDisplayedText += ": " +KGlobal::locale()->formatTime((static_cast<Event*>(mIncidence))->dtStart().time()) + "-" + KGlobal::locale()->formatTime((static_cast<Event*>(mIncidence))->dtEnd().time()) ;
503 503
504 if ( mAllDay ) { 504 if ( mAllDay ) {
505 if ( mIncidence->dtStart().date().addDays(3) < mIncidence->dtEnd().date() ) { 505 if ( mIncidence->dtStart().date().addDays(3) < mIncidence->dtEnd().date() ) {
506 mDisplayedText += ": " +KGlobal::locale()->formatDate((static_cast<Event*>(mIncidence))->dtStart().date(), true) + " - " + KGlobal::locale()->formatDate((static_cast<Event*>(mIncidence))->dtEnd().date(), true) ; 506 mDisplayedText += ": " +KGlobal::locale()->formatDate((static_cast<Event*>(mIncidence))->dtStart().date(), true) + " - " + KGlobal::locale()->formatDate((static_cast<Event*>(mIncidence))->dtEnd().date(), true) ;
507 } 507 }
508 } 508 }
509 509
510 } 510 }
511 511
512 if ( !mIncidence->location().isEmpty() ) { 512 if ( !mIncidence->location().isEmpty() ) {
513 if ( mAllDay ) 513 if ( mAllDay )
514 mDisplayedText += " ("; 514 mDisplayedText += " (";
515 else 515 else
516 mDisplayedText += "\n("; 516 mDisplayedText += "\n(";
517 mDisplayedText += mIncidence->location() +")"; 517 mDisplayedText += mIncidence->location() +")";
518 } 518 }
519} 519}
520void KOAgendaItem::updateItem() 520void KOAgendaItem::updateItem()
521{ 521{
522 computeText(); 522 computeText();
523 523
524 //qDebug("KOAgendaItem:: updateItem() %s %d %d ",incidence()->summary().latin1(), x(), y()); 524 //qDebug("KOAgendaItem:: updateItem() %s %d %d ",incidence()->summary().latin1(), x(), y());
525 paintMe( mSelected ); 525 paintMe( mSelected );
526 repaint( false); 526 repaint( false);
527} 527}
528 528
529void KOAgendaItem::resizeEvent ( QResizeEvent *ev ) 529void KOAgendaItem::resizeEvent ( QResizeEvent *ev )
530{ 530{
531 //qDebug("KOAgendaItem::resizeEvent %s ", mIncidence->summary().latin1()); 531 //qDebug("KOAgendaItem::resizeEvent %s ", mIncidence->summary().latin1());
532 paintMe( mSelected ); 532 paintMe( mSelected );
533 repaint( false ); 533 repaint( false );
534} 534}
535 535
536/* 536/*
537 Return height of item in units of agenda cells 537 Return height of item in units of agenda cells
538*/ 538*/
539int KOAgendaItem::cellHeight() 539int KOAgendaItem::cellHeight()
540{ 540{
541 int ret = mCellYBottom - mCellYTop + 1; 541 int ret = mCellYBottom - mCellYTop + 1;
542 if ( ret <= 0 ) { 542 if ( ret <= 0 ) {
543 ret = 1; 543 ret = 1;
544 mCellYBottom = 0; 544 mCellYBottom = 0;
545 mCellYTop = 0; 545 mCellYTop = 0;
546 } 546 }
547 return ret; 547 return ret;
548} 548}
549 549
550/* 550/*
551 Return height of item in units of agenda cells 551 Return height of item in units of agenda cells
552*/ 552*/
553int KOAgendaItem::cellWidth() 553int KOAgendaItem::cellWidth()
554{ 554{
555 return mCellXWidth - mCellX + 1; 555 return mCellXWidth - mCellX + 1;
556} 556}
557 557
558void KOAgendaItem::setItemDate(QDate qd) 558void KOAgendaItem::setItemDate(QDate qd)
559{ 559{
560 mDate = qd; 560 mDate = qd;
561} 561}
562 562
563void KOAgendaItem::setCellXY(int X, int YTop, int YBottom) 563void KOAgendaItem::setCellXY(int X, int YTop, int YBottom)
564{ 564{
565 mCellX = X; 565 mCellX = X;
566 mCellYTop = YTop; 566 mCellYTop = YTop;
567 mCellYBottom = YBottom; 567 mCellYBottom = YBottom;
568} 568}
569 569
570void KOAgendaItem::setCellXWidth(int xwidth) 570void KOAgendaItem::setCellXWidth(int xwidth)
571{ 571{
572 mCellXWidth = xwidth; 572 mCellXWidth = xwidth;
573} 573}
574 574
575void KOAgendaItem::setCellX(int XLeft, int XRight) 575void KOAgendaItem::setCellX(int XLeft, int XRight)
576{ 576{
577 mCellX = XLeft; 577 mCellX = XLeft;
578 mCellXWidth = XRight; 578 mCellXWidth = XRight;
579} 579}
580 580
581void KOAgendaItem::setCellY(int YTop, int YBottom) 581void KOAgendaItem::setCellY(int YTop, int YBottom)
582{ 582{
583 mCellYTop = YTop; 583 mCellYTop = YTop;
584 mCellYBottom = YBottom; 584 mCellYBottom = YBottom;
585} 585}
586 586
587void KOAgendaItem::setSubCell(int subCell) 587void KOAgendaItem::setSubCell(int subCell)
588{ 588{
589 mSubCell = subCell; 589 mSubCell = subCell;
590} 590}
591 591
592void KOAgendaItem::setSubCells(int subCells) 592void KOAgendaItem::setSubCells(int subCells)
593{ 593{
594 mSubCells = subCells; 594 mSubCells = subCells;
595} 595}
596 596
597void KOAgendaItem::setMultiItem(KOAgendaItem *first,KOAgendaItem *next, 597void KOAgendaItem::setMultiItem(KOAgendaItem *first,KOAgendaItem *next,
diff --git a/korganizer/kodialogmanager.cpp b/korganizer/kodialogmanager.cpp
index db7c3f2..c99c0cb 100644
--- a/korganizer/kodialogmanager.cpp
+++ b/korganizer/kodialogmanager.cpp
@@ -98,193 +98,193 @@ void KODialogManager::showOptionsDialog( bool showSync )
98 //connect(mCategoryEditDialog,SIGNAL(categoryConfigChanged()), 98 //connect(mCategoryEditDialog,SIGNAL(categoryConfigChanged()),
99 // mOptionsDialog,SLOT(updateCategories())); 99 // mOptionsDialog,SLOT(updateCategories()));
100 100
101 } 101 }
102 mOptionsDialog->readConfig(); 102 mOptionsDialog->readConfig();
103#ifndef DESKTOP_VERSION 103#ifndef DESKTOP_VERSION
104 mOptionsDialog->showMaximized(); 104 mOptionsDialog->showMaximized();
105#else 105#else
106 mOptionsDialog->show(); 106 mOptionsDialog->show();
107#endif 107#endif
108 if ( showSync ) 108 if ( showSync )
109 mOptionsDialog->showSyncPage(); 109 mOptionsDialog->showSyncPage();
110 mOptionsDialog->exec(); 110 mOptionsDialog->exec();
111 111
112} 112}
113void KODialogManager::showSyncOptions() 113void KODialogManager::showSyncOptions()
114{ 114{
115 showOptionsDialog( true ); 115 showOptionsDialog( true );
116 116
117} 117}
118void KODialogManager::showOutgoingDialog() 118void KODialogManager::showOutgoingDialog()
119{ 119{
120 createOutgoingDialog(); 120 createOutgoingDialog();
121 mOutgoingDialog->show(); 121 mOutgoingDialog->show();
122 mOutgoingDialog->raise(); 122 mOutgoingDialog->raise();
123} 123}
124 124
125IncomingDialog *KODialogManager::incomingDialog() 125IncomingDialog *KODialogManager::incomingDialog()
126{ 126{
127 createOutgoingDialog(); 127 createOutgoingDialog();
128 if (!mIncomingDialog) { 128 if (!mIncomingDialog) {
129 mIncomingDialog = new IncomingDialog(mMainView->calendar(),mOutgoingDialog,mMainView); 129 mIncomingDialog = new IncomingDialog(mMainView->calendar(),mOutgoingDialog,mMainView);
130 connect(mIncomingDialog,SIGNAL(numMessagesChanged(int)), 130 connect(mIncomingDialog,SIGNAL(numMessagesChanged(int)),
131 mMainView,SIGNAL(numIncomingChanged(int))); 131 mMainView,SIGNAL(numIncomingChanged(int)));
132 connect(mIncomingDialog,SIGNAL(calendarUpdated()), 132 connect(mIncomingDialog,SIGNAL(calendarUpdated()),
133 mMainView,SLOT(updateView())); 133 mMainView,SLOT(updateView()));
134 } 134 }
135 return mIncomingDialog; 135 return mIncomingDialog;
136} 136}
137 137
138void KODialogManager::createIncomingDialog() 138void KODialogManager::createIncomingDialog()
139{ 139{
140 createOutgoingDialog(); 140 createOutgoingDialog();
141 if (!mIncomingDialog) { 141 if (!mIncomingDialog) {
142 mIncomingDialog = new IncomingDialog(mMainView->calendar(),mOutgoingDialog,mMainView); 142 mIncomingDialog = new IncomingDialog(mMainView->calendar(),mOutgoingDialog,mMainView);
143 connect(mIncomingDialog,SIGNAL(numMessagesChanged(int)), 143 connect(mIncomingDialog,SIGNAL(numMessagesChanged(int)),
144 mMainView,SIGNAL(numIncomingChanged(int))); 144 mMainView,SIGNAL(numIncomingChanged(int)));
145 connect(mIncomingDialog,SIGNAL(calendarUpdated()), 145 connect(mIncomingDialog,SIGNAL(calendarUpdated()),
146 mMainView,SLOT(updateView())); 146 mMainView,SLOT(updateView()));
147 } 147 }
148} 148}
149 149
150void KODialogManager::showIncomingDialog() 150void KODialogManager::showIncomingDialog()
151{ 151{
152 createIncomingDialog(); 152 createIncomingDialog();
153 mIncomingDialog->show(); 153 mIncomingDialog->show();
154 mIncomingDialog->raise(); 154 mIncomingDialog->raise();
155} 155}
156/* 156/*
157void KODialogManager::showCategoryEditDialog() 157void KODialogManager::showCategoryEditDialog()
158{ 158{
159 mCategoryEditDialog->show(); 159 mCategoryEditDialog->show();
160} 160}
161*/ 161*/
162void KODialogManager::hideSearchDialog() 162void KODialogManager::hideSearchDialog()
163{ 163{
164 if (mSearchDialog) 164 if (mSearchDialog)
165 mSearchDialog->hide(); 165 mSearchDialog->hide();
166} 166}
167 167
168void KODialogManager::showSearchDialog() 168void KODialogManager::showSearchDialog()
169{ 169{
170 if (!mSearchDialog) { 170 if (!mSearchDialog) {
171 mSearchDialog = new SearchDialog(mMainView->calendar(),mMainView); 171 mSearchDialog = new SearchDialog(mMainView->calendar(),mMainView);
172 KOListView * lview = mSearchDialog->listview(); 172 KOListView * lview = mSearchDialog->listview();
173 173
174 connect(lview, SIGNAL(showIncidenceSignal(Incidence *)), 174 connect(lview, SIGNAL(showIncidenceSignal(Incidence *)),
175 mMainView, SLOT(showIncidence(Incidence *))); 175 mMainView, SLOT(showIncidence(Incidence *)));
176 connect(lview, SIGNAL(editIncidenceSignal(Incidence *)), 176 connect(lview, SIGNAL(editIncidenceSignal(Incidence *)),
177 mMainView, SLOT(editIncidence(Incidence *))); 177 mMainView, SLOT(editIncidence(Incidence *)));
178 connect(lview, SIGNAL(deleteIncidenceSignal(Incidence *)), 178 connect(lview, SIGNAL(deleteIncidenceSignal(Incidence *)),
179 mMainView, SLOT(deleteIncidence(Incidence *))); 179 mMainView, SLOT(deleteIncidence(Incidence *)));
180 connect(lview, SIGNAL(cloneIncidenceSignal(Incidence *)), 180 connect(lview, SIGNAL(cloneIncidenceSignal(Incidence *)),
181 mMainView, SLOT(cloneIncidence(Incidence *))); 181 mMainView, SLOT(cloneIncidence(Incidence *)));
182 connect(lview, SIGNAL(beamIncidenceSignal(Incidence *)), 182 connect(lview, SIGNAL(beamIncidenceSignal(Incidence *)),
183 mMainView, SLOT(beamIncidence(Incidence *))); 183 mMainView, SLOT(beamIncidence(Incidence *)));
184 connect(lview, SIGNAL(moveIncidenceSignal(Incidence *)), 184 connect(lview, SIGNAL(moveIncidenceSignal(Incidence *)),
185 mMainView, SLOT(moveIncidence(Incidence *))); 185 mMainView, SLOT(moveIncidence(Incidence *)));
186 connect(lview, SIGNAL(beamIncidenceList(QPtrList<Incidence> )), 186 connect(lview, SIGNAL(beamIncidenceList(QPtrList<Incidence> )),
187 mMainView, SLOT(beamIncidenceList(QPtrList<Incidence> ))); 187 mMainView, SLOT(beamIncidenceList(QPtrList<Incidence> )));
188 188
189 connect(mMainView, SIGNAL(configChanged()), mSearchDialog, SLOT(updateConfig())); 189 connect(mMainView, SIGNAL(configChanged()), mSearchDialog, SLOT(updateConfig()));
190 connect(mMainView, SIGNAL(updateSearchDialog()), mSearchDialog, SLOT(updateList())); 190 connect(mMainView, SIGNAL(updateSearchDialog()), mSearchDialog, SLOT(updateList()));
191 // connect( lview, SIGNAL( incidenceSelected( Incidence * ) ), 191 // connect( lview, SIGNAL( incidenceSelected( Incidence * ) ),
192 // mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); 192 // mMainView, SLOT( processMainViewSelection( Incidence * ) ) );
193#ifndef DESKTOP_VERSION 193#ifndef DESKTOP_VERSION
194 mSearchDialog->setMaximumSize( 640, 480 ); 194 mSearchDialog->setMaximumSize( QApplication::desktop()->size());
195 //mSearchDialog->setGeometry( 40,40, 400, 300); 195 //mSearchDialog->setGeometry( 40,40, 400, 300);
196 mSearchDialog->showMaximized(); 196 mSearchDialog->showMaximized();
197#else 197#else
198 KConfig *config = KOGlobals::config(); 198 KConfig *config = KOGlobals::config();
199 config->setGroup("WidgetLayout"); 199 config->setGroup("WidgetLayout");
200 QStringList list; 200 QStringList list;
201 list = config->readListEntry("SearchLayout"); 201 list = config->readListEntry("SearchLayout");
202 int x,y,w,h; 202 int x,y,w,h;
203 if ( ! list.isEmpty() ) { 203 if ( ! list.isEmpty() ) {
204 x = list[0].toInt(); 204 x = list[0].toInt();
205 y = list[1].toInt(); 205 y = list[1].toInt();
206 w = list[2].toInt(); 206 w = list[2].toInt();
207 h = list[3].toInt(); 207 h = list[3].toInt();
208 mSearchDialog->setGeometry(x,y,w,h); 208 mSearchDialog->setGeometry(x,y,w,h);
209 209
210 } 210 }
211 211
212#endif 212#endif
213 } 213 }
214 // make sure the widget is on top again 214 // make sure the widget is on top again
215 mSearchDialog->show(); 215 mSearchDialog->show();
216 mSearchDialog->raise(); 216 mSearchDialog->raise();
217} 217}
218 218
219SearchDialog * KODialogManager::getSearchDialog() 219SearchDialog * KODialogManager::getSearchDialog()
220{ 220{
221 return mSearchDialog; 221 return mSearchDialog;
222} 222}
223void KODialogManager::showArchiveDialog() 223void KODialogManager::showArchiveDialog()
224{ 224{
225#ifndef KORG_NOARCHIVE 225#ifndef KORG_NOARCHIVE
226 if (!mArchiveDialog) { 226 if (!mArchiveDialog) {
227 mArchiveDialog = new ArchiveDialog(mMainView->calendar(),mMainView); 227 mArchiveDialog = new ArchiveDialog(mMainView->calendar(),mMainView);
228 connect(mArchiveDialog,SIGNAL(eventsDeleted()), 228 connect(mArchiveDialog,SIGNAL(eventsDeleted()),
229 mMainView,SLOT(updateView())); 229 mMainView,SLOT(updateView()));
230 } 230 }
231 mArchiveDialog->show(); 231 mArchiveDialog->show();
232 mArchiveDialog->raise(); 232 mArchiveDialog->raise();
233 233
234 // Workaround. 234 // Workaround.
235 QApplication::restoreOverrideCursor(); 235 QApplication::restoreOverrideCursor();
236#endif 236#endif
237} 237}
238 238
239void KODialogManager::showFilterEditDialog(QPtrList<CalFilter> *filters) 239void KODialogManager::showFilterEditDialog(QPtrList<CalFilter> *filters)
240{ 240{
241 if (!mFilterEditDialog) { 241 if (!mFilterEditDialog) {
242 mFilterEditDialog = new FilterEditDialog(filters,mMainView); 242 mFilterEditDialog = new FilterEditDialog(filters,mMainView);
243 connect(mFilterEditDialog,SIGNAL(filterChanged()), 243 connect(mFilterEditDialog,SIGNAL(filterChanged()),
244 mMainView,SLOT(filterEdited())); 244 mMainView,SLOT(filterEdited()));
245 245
246 } 246 }
247 247
248#ifndef DESKTOP_VERSION 248#ifndef DESKTOP_VERSION
249 mFilterEditDialog->showMaximized(); 249 mFilterEditDialog->showMaximized();
250#else 250#else
251 mFilterEditDialog->show(); 251 mFilterEditDialog->show();
252#endif 252#endif
253 mFilterEditDialog->raise(); 253 mFilterEditDialog->raise();
254} 254}
255 255
256void KODialogManager::showPluginDialog() 256void KODialogManager::showPluginDialog()
257{ 257{
258#ifndef KORG_NOPLUGINS 258#ifndef KORG_NOPLUGINS
259 if (!mPluginDialog) { 259 if (!mPluginDialog) {
260 mPluginDialog = new PluginDialog(mMainView); 260 mPluginDialog = new PluginDialog(mMainView);
261 connect(mPluginDialog,SIGNAL(configChanged()), 261 connect(mPluginDialog,SIGNAL(configChanged()),
262 mMainView,SLOT(updateConfig())); 262 mMainView,SLOT(updateConfig()));
263 } 263 }
264 mPluginDialog->show(); 264 mPluginDialog->show();
265 mPluginDialog->raise(); 265 mPluginDialog->raise();
266#endif 266#endif
267} 267}
268 268
269KOEventEditor *KODialogManager::getEventEditor() 269KOEventEditor *KODialogManager::getEventEditor()
270{ 270{
271 KOEventEditor *eventEditor = new KOEventEditor( mMainView->calendar(), 271 KOEventEditor *eventEditor = new KOEventEditor( mMainView->calendar(),
272 mMainView ); 272 mMainView );
273 273
274 connect(eventEditor,SIGNAL(eventAdded(Event *)), 274 connect(eventEditor,SIGNAL(eventAdded(Event *)),
275 mMainView,SLOT(eventAdded(Event *))); 275 mMainView,SLOT(eventAdded(Event *)));
276 connect(eventEditor,SIGNAL(eventChanged(Event *)), 276 connect(eventEditor,SIGNAL(eventChanged(Event *)),
277 mMainView,SLOT(eventChanged(Event *))); 277 mMainView,SLOT(eventChanged(Event *)));
278 connect(eventEditor,SIGNAL(eventDeleted()), 278 connect(eventEditor,SIGNAL(eventDeleted()),
279 mMainView,SLOT(eventDeleted())); 279 mMainView,SLOT(eventDeleted()));
280 connect(eventEditor,SIGNAL(deleteAttendee(Incidence *)), 280 connect(eventEditor,SIGNAL(deleteAttendee(Incidence *)),
281 mMainView,SLOT(schedule_cancel(Incidence *))); 281 mMainView,SLOT(schedule_cancel(Incidence *)));
282 connect( eventEditor, SIGNAL(jumpToTime( const QDate &)), 282 connect( eventEditor, SIGNAL(jumpToTime( const QDate &)),
283 mMainView->dateNavigator(), SLOT( selectWeek( const QDate & ) ) ); 283 mMainView->dateNavigator(), SLOT( selectWeek( const QDate & ) ) );
284 connect( eventEditor, SIGNAL( showAgendaView( bool)), 284 connect( eventEditor, SIGNAL( showAgendaView( bool)),
285 mMainView->viewManager(), SLOT( showAgendaView( bool) ) ); 285 mMainView->viewManager(), SLOT( showAgendaView( bool) ) );
286 286
287 // connect(mCategoryEditDialog,SIGNAL(categoryConfigChanged()), 287 // connect(mCategoryEditDialog,SIGNAL(categoryConfigChanged()),
288 // eventEditor,SLOT(updateCategoryConfig())); 288 // eventEditor,SLOT(updateCategoryConfig()));
289 // connect(eventEditor,SIGNAL(editCategories()), 289 // connect(eventEditor,SIGNAL(editCategories()),
290 // mCategoryEditDialog,SLOT(show())); 290 // mCategoryEditDialog,SLOT(show()));
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp
index 1cdb2fb..aae4692 100644
--- a/korganizer/koprefs.cpp
+++ b/korganizer/koprefs.cpp
@@ -17,192 +17,194 @@
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 23
24#include <time.h> 24#include <time.h>
25#ifndef _WIN32_ 25#ifndef _WIN32_
26#include <unistd.h> 26#include <unistd.h>
27#endif 27#endif
28#include <qdir.h> 28#include <qdir.h>
29#include <qtextstream.h> 29#include <qtextstream.h>
30#include <qtextcodec.h> 30#include <qtextcodec.h>
31#include <qstring.h> 31#include <qstring.h>
32#include <qregexp.h> 32#include <qregexp.h>
33#include <qfont.h> 33#include <qfont.h>
34#include <qcolor.h> 34#include <qcolor.h>
35#include <qstringlist.h> 35#include <qstringlist.h>
36#include <stdlib.h> 36#include <stdlib.h>
37 37
38#include <kglobal.h> 38#include <kglobal.h>
39#include <kconfig.h> 39#include <kconfig.h>
40#include <klocale.h> 40#include <klocale.h>
41#include <kdebug.h> 41#include <kdebug.h>
42#include <kemailsettings.h> 42#include <kemailsettings.h>
43#include <kstaticdeleter.h> 43#include <kstaticdeleter.h>
44#include <libkdepim/kpimglobalprefs.h> 44#include <libkdepim/kpimglobalprefs.h>
45 45
46#include "koprefs.h" 46#include "koprefs.h"
47#include "mainwindow.h" 47#include "mainwindow.h"
48 48
49KOPrefs *KOPrefs::mInstance = 0; 49KOPrefs *KOPrefs::mInstance = 0;
50static KStaticDeleter<KOPrefs> insd; 50static KStaticDeleter<KOPrefs> insd;
51 51
52KOPrefs::KOPrefs() : 52KOPrefs::KOPrefs() :
53 KPimPrefs("korganizerrc") 53 KPimPrefs("korganizerrc")
54{ 54{
55 mCategoryColors.setAutoDelete(true); 55 mCategoryColors.setAutoDelete(true);
56 fillMailDefaults(); 56 fillMailDefaults();
57 mDefaultCategoryColor = QColor(175,210,255);//196,196,196); 57 mDefaultCategoryColor = QColor(175,210,255);//196,196,196);
58 QColor defaultHolidayColor = QColor(255,0,0); 58 QColor defaultHolidayColor = QColor(255,0,0);
59 QColor defaultHighlightColor = QColor(129,112,255);//64,64,255); 59 QColor defaultHighlightColor = QColor(129,112,255);//64,64,255);
60 QColor defaultAgendaBgColor = QColor(239,241,169);//128,128,128); 60 QColor defaultAgendaBgColor = QColor(239,241,169);//128,128,128);
61 QColor defaultWorkingHoursColor = QColor(170,223,150);//160,160,160); 61 QColor defaultWorkingHoursColor = QColor(170,223,150);//160,160,160);
62 QColor defaultTodoDueTodayColor = QColor(255,220,100); 62 QColor defaultTodoDueTodayColor = QColor(255,220,100);
63 QColor defaultTodoOverdueColor = QColor(255,153,125); 63 QColor defaultTodoOverdueColor = QColor(255,153,125);
64 64
65 mTimeBarFont = QFont("helvetica",10);//,QFont::Bold); 65 mTimeBarFont = QFont("helvetica",10);//,QFont::Bold);
66 mDefaultViewFont = QFont("helvetica",10); 66 mDefaultViewFont = QFont("helvetica",10);
67 mDefaultMonthViewFont = QFont("helvetica",8); 67 mDefaultMonthViewFont = QFont("helvetica",8);
68 mMarcusBainsFont= QFont("helvetica",10); 68 mMarcusBainsFont= QFont("helvetica",10);
69 mDateNavigatorFont= QFont("helvetica",10, QFont::Bold); 69 mDateNavigatorFont= QFont("helvetica",10, QFont::Bold);
70 mEditBoxFont = QFont("helvetica",12); 70 mEditBoxFont = QFont("helvetica",12);
71 mJornalViewFont = QFont("helvetica",12); 71 mJornalViewFont = QFont("helvetica",12);
72 72
73 KPrefs::setCurrentGroup("General"); 73 KPrefs::setCurrentGroup("General");
74 74
75 75
76 addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false); 76 addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false);
77 77
78 addItemBool("ShowIconNewTodo",&mShowIconNewTodo,true); 78 addItemBool("ShowIconNewTodo",&mShowIconNewTodo,true);
79 addItemBool("ShowIconNewEvent",&mShowIconNewEvent,true); 79 addItemBool("ShowIconNewEvent",&mShowIconNewEvent,true);
80 addItemBool("ShowIconSearch",&mShowIconSearch,true); 80 addItemBool("ShowIconSearch",&mShowIconSearch,true);
81 addItemBool("ShowIconList",&mShowIconList,true); 81 addItemBool("ShowIconList",&mShowIconList,true);
82 addItemBool("ShowIconDay1",&mShowIconDay1,true); 82 addItemBool("ShowIconDay1",&mShowIconDay1,true);
83 addItemBool("ShowIconDay5",&mShowIconDay5,true); 83 addItemBool("ShowIconDay5",&mShowIconDay5,true);
84 addItemBool("ShowIconDay7",&mShowIconDay7,true); 84 addItemBool("ShowIconDay7",&mShowIconDay7,true);
85 addItemBool("ShowIconMonth",&mShowIconMonth,true); 85 addItemBool("ShowIconMonth",&mShowIconMonth,true);
86 addItemBool("ShowIconTodoview",&mShowIconTodoview,true); 86 addItemBool("ShowIconTodoview",&mShowIconTodoview,true);
87 addItemBool("ShowIconBackFast",&mShowIconBackFast,true); 87 addItemBool("ShowIconBackFast",&mShowIconBackFast,true);
88 addItemBool("ShowIconBack",&mShowIconBack,true); 88 addItemBool("ShowIconBack",&mShowIconBack,true);
89 addItemBool("ShowIconToday",&mShowIconToday,true); 89 addItemBool("ShowIconToday",&mShowIconToday,true);
90 addItemBool("ShowIconForward",&mShowIconForward,true); 90 addItemBool("ShowIconForward",&mShowIconForward,true);
91 addItemBool("ShowIconForwardFast",&mShowIconForwardFast,true); 91 addItemBool("ShowIconForwardFast",&mShowIconForwardFast,true);
92 addItemBool("ShowIconWhatsThis",&mShowIconWhatsThis,false); 92 addItemBool("ShowIconWhatsThis",&mShowIconWhatsThis,false);
93 addItemBool("ShowIconNextDays",&mShowIconNextDays,true); 93 addItemBool("ShowIconNextDays",&mShowIconNextDays,true);
94 addItemBool("ShowIconNext",&mShowIconNext,true); 94 addItemBool("ShowIconNext",&mShowIconNext,true);
95 addItemBool("ShowIconJournal",&mShowIconJournal,true); 95 addItemBool("ShowIconJournal",&mShowIconJournal,true);
96 addItemBool("ShowIconStretch",&mShowIconStretch,true); 96 addItemBool("ShowIconStretch",&mShowIconStretch,true);
97 addItemInt("LastLoadedLanguage",&mOldLanguage,0); 97 addItemInt("LastLoadedLanguage",&mOldLanguage,0);
98 98
99 addItemBool("AskForQuit",&mAskForQuit,false); 99 addItemBool("AskForQuit",&mAskForQuit,false);
100 100
101#ifndef DESKTOP_VERSION 101#ifndef DESKTOP_VERSION
102 addItemBool("ShowFullMenu",&mShowFullMenu,false); 102 addItemBool("ShowFullMenu",&mShowFullMenu,false);
103#else 103#else
104 addItemBool("ShowFullMenu",&mShowFullMenu,true); 104 addItemBool("ShowFullMenu",&mShowFullMenu,true);
105#endif 105#endif
106 addItemBool("ToolBarHor",&mToolBarHor, true ); 106 addItemBool("ToolBarHor",&mToolBarHor, true );
107 addItemBool("ToolBarUp",&mToolBarUp, false ); 107 addItemBool("ToolBarUp",&mToolBarUp, false );
108 addItemBool("ToolBarMiniIcons",&mToolBarMiniIcons, false ); 108 addItemBool("ToolBarMiniIcons",&mToolBarMiniIcons, false );
109 addItemInt("Whats Next Days",&mWhatsNextDays,3); 109 addItemInt("Whats Next Days",&mWhatsNextDays,3);
110 addItemInt("Whats Next Prios",&mWhatsNextPrios,1); 110 addItemInt("Whats Next Prios",&mWhatsNextPrios,1);
111 111
112 addItemBool("ShowTodoInAgenda",&mShowTodoInAgenda,true); 112 addItemBool("ShowTodoInAgenda",&mShowTodoInAgenda,true);
113 addItemBool("ShowTimeInAgenda",&mShowTimeInAgenda,true);
114 addItemBool("HideNonStartedTodos",&mHideNonStartedTodos,false);
113 addItemBool("ShowCompletedTodo",&mShowCompletedTodo,true); 115 addItemBool("ShowCompletedTodo",&mShowCompletedTodo,true);
114 addItemInt("AllDay Size",&mAllDaySize,28); 116 addItemInt("AllDay Size",&mAllDaySize,28);
115 QString defAlarm = KGlobal::iconLoader()->iconPath()+"koalarm.wav"; 117 QString defAlarm = KGlobal::iconLoader()->iconPath()+"koalarm.wav";
116 addItemString("DefaultAlarmFile",&mDefaultAlarmFile,defAlarm ); 118 addItemString("DefaultAlarmFile",&mDefaultAlarmFile,defAlarm );
117 119
118 addItemStringList("LocationDefaults",&mLocationDefaults ); 120 addItemStringList("LocationDefaults",&mLocationDefaults );
119 addItemStringList("EventSummary User",&mEventSummaryUser); 121 addItemStringList("EventSummary User",&mEventSummaryUser);
120 addItemStringList("TodoSummary User",&mTodoSummaryUser); 122 addItemStringList("TodoSummary User",&mTodoSummaryUser);
121 123
122 addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false); 124 addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false);
123 addItemBool("Enable Project View",&mEnableProjectView,false); 125 addItemBool("Enable Project View",&mEnableProjectView,false);
124 addItemBool("Auto Save",&mAutoSave,false); 126 addItemBool("Auto Save",&mAutoSave,false);
125 addItemInt("Auto Save Interval",&mAutoSaveInterval,3); 127 addItemInt("Auto Save Interval",&mAutoSaveInterval,3);
126 addItemBool("Confirm Deletes",&mConfirm,true); 128 addItemBool("Confirm Deletes",&mConfirm,true);
127 addItemString("Archive File",&mArchiveFile); 129 addItemString("Archive File",&mArchiveFile);
128 addItemString("Html Export File",&mHtmlExportFile, 130 addItemString("Html Export File",&mHtmlExportFile,
129 QDir::homeDirPath() + "/" + i18n("Default export file", "calendar.html")); 131 QDir::homeDirPath() + "/" + i18n("Default export file", "calendar.html"));
130 addItemBool("Html With Save",&mHtmlWithSave,false); 132 addItemBool("Html With Save",&mHtmlWithSave,false);
131 133
132 KPrefs::setCurrentGroup("Personal Settings"); 134 KPrefs::setCurrentGroup("Personal Settings");
133 135
134 addItemInt("Mail Client",&mMailClient,MailClientKMail); 136 addItemInt("Mail Client",&mMailClient,MailClientKMail);
135 addItemBool("Use Control Center Email",&mEmailControlCenter,false); 137 addItemBool("Use Control Center Email",&mEmailControlCenter,false);
136 addItemBool("Bcc",&mBcc,false); 138 addItemBool("Bcc",&mBcc,false);
137 139
138 KPrefs::setCurrentGroup("Time & Date"); 140 KPrefs::setCurrentGroup("Time & Date");
139 141
140 142
141 addItemInt("Default Start Time",&mStartTime,10); 143 addItemInt("Default Start Time",&mStartTime,10);
142 addItemInt("Default Duration",&mDefaultDuration,2); 144 addItemInt("Default Duration",&mDefaultDuration,2);
143 addItemInt("Default Alarm Time",&mAlarmTime,3); 145 addItemInt("Default Alarm Time",&mAlarmTime,3);
144 KPrefs::setCurrentGroup("AlarmSettings"); 146 KPrefs::setCurrentGroup("AlarmSettings");
145 addItemInt("AlarmPlayBeeps",&mAlarmPlayBeeps,20); 147 addItemInt("AlarmPlayBeeps",&mAlarmPlayBeeps,20);
146 addItemInt("AlarmSuspendTime",&mAlarmSuspendTime,7); 148 addItemInt("AlarmSuspendTime",&mAlarmSuspendTime,7);
147 addItemInt("AlarmSuspendCount",&mAlarmSuspendCount,5); 149 addItemInt("AlarmSuspendCount",&mAlarmSuspendCount,5);
148 addItemInt("AlarmBeepInterval",&mAlarmBeepInterval,3); 150 addItemInt("AlarmBeepInterval",&mAlarmBeepInterval,3);
149 151
150 152
151 KPrefs::setCurrentGroup("Calendar"); 153 KPrefs::setCurrentGroup("Calendar");
152 154
153 addItemInt("Default Calendar Format",&mDefaultFormat,FormatICalendar); 155 addItemInt("Default Calendar Format",&mDefaultFormat,FormatICalendar);
154 156
155 KPrefs::setCurrentGroup("Fonts"); 157 KPrefs::setCurrentGroup("Fonts");
156 // qDebug(" KPrefs::setCurrentGroup(Fonts); "); 158 // qDebug(" KPrefs::setCurrentGroup(Fonts); ");
157 addItemFont("TimeBar Font",&mTimeBarFont); 159 addItemFont("TimeBar Font",&mTimeBarFont);
158 addItemFont("MonthView Font",&mMonthViewFont); 160 addItemFont("MonthView Font",&mMonthViewFont);
159 addItemFont("AgendaView Font",&mAgendaViewFont); 161 addItemFont("AgendaView Font",&mAgendaViewFont);
160 addItemFont("MarcusBains Font",&mMarcusBainsFont); 162 addItemFont("MarcusBains Font",&mMarcusBainsFont);
161 addItemFont("TimeLabels Font",&mTimeLabelsFont); 163 addItemFont("TimeLabels Font",&mTimeLabelsFont);
162 addItemFont("TodoView Font",&mTodoViewFont); 164 addItemFont("TodoView Font",&mTodoViewFont);
163 addItemFont("ListView Font",&mListViewFont); 165 addItemFont("ListView Font",&mListViewFont);
164 addItemFont("DateNavigator Font",&mDateNavigatorFont); 166 addItemFont("DateNavigator Font",&mDateNavigatorFont);
165 addItemFont("EditBox Font",&mEditBoxFont); 167 addItemFont("EditBox Font",&mEditBoxFont);
166 addItemFont("JournalView Font",&mJornalViewFont); 168 addItemFont("JournalView Font",&mJornalViewFont);
167 addItemFont("WhatsNextView Font",&mWhatsNextFont); 169 addItemFont("WhatsNextView Font",&mWhatsNextFont);
168 addItemFont("EventView Font",&mEventViewFont); 170 addItemFont("EventView Font",&mEventViewFont);
169 171
170 KPrefs::setCurrentGroup("RemoteSyncing"); 172 KPrefs::setCurrentGroup("RemoteSyncing");
171 addItemString("ActiveSyncPort",&mActiveSyncPort,"9197" ); 173 addItemString("ActiveSyncPort",&mActiveSyncPort,"9197" );
172 addItemString("ActiveSyncIP",&mActiveSyncIP,"192.168.0.40" ); 174 addItemString("ActiveSyncIP",&mActiveSyncIP,"192.168.0.40" );
173 addItemBool("ShowSyncEvents",&mShowSyncEvents,false); 175 addItemBool("ShowSyncEvents",&mShowSyncEvents,false);
174 addItemInt("LastSyncTime",&mLastSyncTime,0); 176 addItemInt("LastSyncTime",&mLastSyncTime,0);
175 177
176#ifdef _WIN32_ 178#ifdef _WIN32_
177 QString hdp= locateLocal("data","korganizer")+"\\\\"; 179 QString hdp= locateLocal("data","korganizer")+"\\\\";
178#else 180#else
179 QString hdp= locateLocal("data","korganizer")+"/"; 181 QString hdp= locateLocal("data","korganizer")+"/";
180#endif 182#endif
181 183
182 KPrefs::setCurrentGroup("LoadSaveFileNames"); 184 KPrefs::setCurrentGroup("LoadSaveFileNames");
183 185
184 addItemString("LastImportFile", &mLastImportFile ,hdp +"import.ics" ); 186 addItemString("LastImportFile", &mLastImportFile ,hdp +"import.ics" );
185 addItemString("LastVcalFile", &mLastVcalFile ,hdp +"export.vcs" ); 187 addItemString("LastVcalFile", &mLastVcalFile ,hdp +"export.vcs" );
186 addItemString("LastSaveFile", &mLastSaveFile ,hdp +"mybackup.ics" ); 188 addItemString("LastSaveFile", &mLastSaveFile ,hdp +"mybackup.ics" );
187 addItemString("LastLoadFile", &mLastLoadFile ,hdp +"mybackup.ics" ); 189 addItemString("LastLoadFile", &mLastLoadFile ,hdp +"mybackup.ics" );
188 190
189 191
190 KPrefs::setCurrentGroup("Locale"); 192 KPrefs::setCurrentGroup("Locale");
191 addItemBool("ShortDateInViewer",&mShortDateInViewer,false); 193 addItemBool("ShortDateInViewer",&mShortDateInViewer,false);
192 194
193 195
194 KPrefs::setCurrentGroup("Colors"); 196 KPrefs::setCurrentGroup("Colors");
195 addItemColor("Holiday Color",&mHolidayColor,defaultHolidayColor); 197 addItemColor("Holiday Color",&mHolidayColor,defaultHolidayColor);
196 addItemColor("Highlight Color",&mHighlightColor,defaultHighlightColor); 198 addItemColor("Highlight Color",&mHighlightColor,defaultHighlightColor);
197 addItemColor("Event Color",&mEventColor,mDefaultCategoryColor); 199 addItemColor("Event Color",&mEventColor,mDefaultCategoryColor);
198 addItemColor("Agenda Background Color",&mAgendaBgColor,defaultAgendaBgColor); 200 addItemColor("Agenda Background Color",&mAgendaBgColor,defaultAgendaBgColor);
199 addItemColor("WorkingHours Color",&mWorkingHoursColor,defaultWorkingHoursColor); 201 addItemColor("WorkingHours Color",&mWorkingHoursColor,defaultWorkingHoursColor);
200 addItemColor("Todo due today Color",&mTodoDueTodayColor,defaultTodoDueTodayColor); 202 addItemColor("Todo due today Color",&mTodoDueTodayColor,defaultTodoDueTodayColor);
201 addItemColor("Todo overdue Color",&mTodoOverdueColor,defaultTodoOverdueColor); 203 addItemColor("Todo overdue Color",&mTodoOverdueColor,defaultTodoOverdueColor);
202 addItemColor("MonthViewEvenColor",&mMonthViewEvenColor,QColor( 160,160,255 )); 204 addItemColor("MonthViewEvenColor",&mMonthViewEvenColor,QColor( 160,160,255 ));
203 addItemColor("MonthViewOddColor",&mMonthViewOddColor,QColor( 160,255,160 )); 205 addItemColor("MonthViewOddColor",&mMonthViewOddColor,QColor( 160,255,160 ));
204 addItemColor("MonthViewHolidayColor",&mMonthViewHolidayColor,QColor( 255,160,160 )); 206 addItemColor("MonthViewHolidayColor",&mMonthViewHolidayColor,QColor( 255,160,160 ));
205 addItemBool("MonthViewUsesDayColors",&mMonthViewUsesDayColors,true); 207 addItemBool("MonthViewUsesDayColors",&mMonthViewUsesDayColors,true);
206 addItemBool("MonthViewSatSunTog",&mMonthViewSatSunTog,true); 208 addItemBool("MonthViewSatSunTog",&mMonthViewSatSunTog,true);
207 addItemBool("HightlightDateTimeEdit",&mHightlightDateTimeEdit,false); 209 addItemBool("HightlightDateTimeEdit",&mHightlightDateTimeEdit,false);
208 addItemColor("AppColor1",&mAppColor1,QColor( 130,170,255 )); 210 addItemColor("AppColor1",&mAppColor1,QColor( 130,170,255 ));
diff --git a/korganizer/koprefs.h b/korganizer/koprefs.h
index f2fe77a..69722a1 100644
--- a/korganizer/koprefs.h
+++ b/korganizer/koprefs.h
@@ -97,178 +97,180 @@ class KOPrefs : public KPimPrefs
97 int mStartTime; 97 int mStartTime;
98 int mDefaultDuration; 98 int mDefaultDuration;
99 int mAlarmTime; 99 int mAlarmTime;
100 100
101 int mWorkingHoursStart; 101 int mWorkingHoursStart;
102 int mWorkingHoursEnd; 102 int mWorkingHoursEnd;
103 bool mExcludeHolidays; 103 bool mExcludeHolidays;
104 bool mExcludeSaturdays; 104 bool mExcludeSaturdays;
105 bool mMarcusBainsShowSeconds; 105 bool mMarcusBainsShowSeconds;
106 106
107 QFont mTimeBarFont; 107 QFont mTimeBarFont;
108 QFont mMonthViewFont; 108 QFont mMonthViewFont;
109 QFont mAgendaViewFont; 109 QFont mAgendaViewFont;
110 QFont mMarcusBainsFont; 110 QFont mMarcusBainsFont;
111 QFont mTimeLabelsFont; 111 QFont mTimeLabelsFont;
112 QFont mTodoViewFont; 112 QFont mTodoViewFont;
113 QFont mListViewFont; 113 QFont mListViewFont;
114 QFont mDateNavigatorFont; 114 QFont mDateNavigatorFont;
115 QFont mEditBoxFont; 115 QFont mEditBoxFont;
116 QFont mJornalViewFont; 116 QFont mJornalViewFont;
117 QFont mWhatsNextFont; 117 QFont mWhatsNextFont;
118 QFont mEventViewFont; 118 QFont mEventViewFont;
119 119
120 120
121 121
122 122
123 QColor mHolidayColor; 123 QColor mHolidayColor;
124 QColor mHighlightColor; 124 QColor mHighlightColor;
125 QColor mEventColor; 125 QColor mEventColor;
126 QColor mAgendaBgColor; 126 QColor mAgendaBgColor;
127 QColor mWorkingHoursColor; 127 QColor mWorkingHoursColor;
128 QColor mTodoDueTodayColor; 128 QColor mTodoDueTodayColor;
129 QColor mTodoOverdueColor; 129 QColor mTodoOverdueColor;
130 QColor mMonthViewEvenColor; 130 QColor mMonthViewEvenColor;
131 QColor mMonthViewOddColor; 131 QColor mMonthViewOddColor;
132 QColor mMonthViewHolidayColor; 132 QColor mMonthViewHolidayColor;
133 bool mMonthViewUsesDayColors; 133 bool mMonthViewUsesDayColors;
134 bool mMonthViewSatSunTog; 134 bool mMonthViewSatSunTog;
135 QColor mAppColor1; 135 QColor mAppColor1;
136 QColor mAppColor2; 136 QColor mAppColor2;
137 bool mUseAppColors; 137 bool mUseAppColors;
138 138
139 int mDayBegins; 139 int mDayBegins;
140 int mHourSize; 140 int mHourSize;
141 int mAllDaySize; 141 int mAllDaySize;
142 bool mShowFullMenu; 142 bool mShowFullMenu;
143 bool mDailyRecur; 143 bool mDailyRecur;
144 bool mWeeklyRecur; 144 bool mWeeklyRecur;
145 bool mMonthDailyRecur; 145 bool mMonthDailyRecur;
146 bool mMonthWeeklyRecur; 146 bool mMonthWeeklyRecur;
147 bool mMonthShowIcons; 147 bool mMonthShowIcons;
148 bool mMonthShowShort; 148 bool mMonthShowShort;
149 bool mEnableToolTips; 149 bool mEnableToolTips;
150 bool mEnableMonthScroll; 150 bool mEnableMonthScroll;
151 bool mFullViewMonth; 151 bool mFullViewMonth;
152 bool mMonthViewUsesCategoryColor; 152 bool mMonthViewUsesCategoryColor;
153 bool mFullViewTodo; 153 bool mFullViewTodo;
154 bool mShowCompletedTodo; 154 bool mShowCompletedTodo;
155 bool mMarcusBainsEnabled; 155 bool mMarcusBainsEnabled;
156 int mNextXDays; 156 int mNextXDays;
157 int mWhatsNextDays; 157 int mWhatsNextDays;
158 int mWhatsNextPrios; 158 int mWhatsNextPrios;
159 bool mEnableQuickTodo; 159 bool mEnableQuickTodo;
160 160
161 bool mCompactDialogs; 161 bool mCompactDialogs;
162 bool mVerticalScreen; 162 bool mVerticalScreen;
163 163
164 bool mShowIconNewTodo; 164 bool mShowIconNewTodo;
165 bool mShowIconNewEvent; 165 bool mShowIconNewEvent;
166 bool mShowIconSearch; 166 bool mShowIconSearch;
167 bool mShowIconList; 167 bool mShowIconList;
168 bool mShowIconDay1; 168 bool mShowIconDay1;
169 bool mShowIconDay5; 169 bool mShowIconDay5;
170 bool mShowIconDay7; 170 bool mShowIconDay7;
171 bool mShowIconMonth; 171 bool mShowIconMonth;
172 bool mShowIconTodoview; 172 bool mShowIconTodoview;
173 bool mShowIconBackFast; 173 bool mShowIconBackFast;
174 bool mShowIconBack; 174 bool mShowIconBack;
175 bool mShowIconToday; 175 bool mShowIconToday;
176 bool mShowIconForward; 176 bool mShowIconForward;
177 bool mShowIconForwardFast; 177 bool mShowIconForwardFast;
178 bool mShowIconWhatsThis; 178 bool mShowIconWhatsThis;
179 bool mShowIconNextDays; 179 bool mShowIconNextDays;
180 bool mShowIconNext; 180 bool mShowIconNext;
181 bool mShowIconJournal; 181 bool mShowIconJournal;
182 182
183 bool mShowIconStretch; 183 bool mShowIconStretch;
184 184
185 bool mToolBarHor; 185 bool mToolBarHor;
186 bool mToolBarUp; 186 bool mToolBarUp;
187 bool mToolBarMiniIcons; 187 bool mToolBarMiniIcons;
188 188
189 bool mAskForQuit; 189 bool mAskForQuit;
190 bool mUsePassWd; 190 bool mUsePassWd;
191 bool mShowSyncEvents; 191 bool mShowSyncEvents;
192 bool mShowTodoInAgenda; 192 bool mShowTodoInAgenda;
193 bool mShowTimeInAgenda;
194 bool mHideNonStartedTodos;
193 195
194 int mLastSyncTime; 196 int mLastSyncTime;
195 void setCategoryColor(QString cat,const QColor & color); 197 void setCategoryColor(QString cat,const QColor & color);
196 QColor *categoryColor(QString cat); 198 QColor *categoryColor(QString cat);
197 199
198 QString mArchiveFile; 200 QString mArchiveFile;
199 QString mHtmlExportFile; 201 QString mHtmlExportFile;
200 bool mHtmlWithSave; 202 bool mHtmlWithSave;
201 203
202 QStringList mSelectedPlugins; 204 QStringList mSelectedPlugins;
203 205
204 QString mLastImportFile; 206 QString mLastImportFile;
205 QString mLastVcalFile; 207 QString mLastVcalFile;
206 QString mLastSaveFile; 208 QString mLastSaveFile;
207 QString mLastLoadFile; 209 QString mLastLoadFile;
208 210
209 211
210 QString mDefaultAlarmFile; 212 QString mDefaultAlarmFile;
211 int mIMIPScheduler; 213 int mIMIPScheduler;
212 int mIMIPSend; 214 int mIMIPSend;
213 QStringList mAdditionalMails; 215 QStringList mAdditionalMails;
214 int mIMIPAutoRefresh; 216 int mIMIPAutoRefresh;
215 int mIMIPAutoInsertReply; 217 int mIMIPAutoInsertReply;
216 int mIMIPAutoInsertRequest; 218 int mIMIPAutoInsertRequest;
217 int mIMIPAutoFreeBusy; 219 int mIMIPAutoFreeBusy;
218 int mIMIPAutoFreeBusyReply; 220 int mIMIPAutoFreeBusyReply;
219 221
220 QStringList mTodoTemplates; 222 QStringList mTodoTemplates;
221 QStringList mEventTemplates; 223 QStringList mEventTemplates;
222 224
223 int mDestination; 225 int mDestination;
224 226
225 227
226 bool mEditOnDoubleClick; 228 bool mEditOnDoubleClick;
227 bool mViewChangeHoldFullscreen; 229 bool mViewChangeHoldFullscreen;
228 bool mViewChangeHoldNonFullscreen; 230 bool mViewChangeHoldNonFullscreen;
229 bool mCenterOnCurrentTime; 231 bool mCenterOnCurrentTime;
230 bool mSetTimeToDayStartAt; 232 bool mSetTimeToDayStartAt;
231 bool mHighlightCurrentDay; 233 bool mHighlightCurrentDay;
232 bool mUseHighlightLightColor; 234 bool mUseHighlightLightColor;
233 bool mListViewMonthTimespan; 235 bool mListViewMonthTimespan;
234 bool mWNViewShowsParents; 236 bool mWNViewShowsParents;
235 bool mWNViewShowsPast; 237 bool mWNViewShowsPast;
236 bool mWNViewShowLocation; 238 bool mWNViewShowLocation;
237 bool mTodoViewShowsPercentage; 239 bool mTodoViewShowsPercentage;
238 bool mTodoViewUsesCatColors; 240 bool mTodoViewUsesCatColors;
239 bool mTodoViewUsesSmallFont; 241 bool mTodoViewUsesSmallFont;
240 bool mTodoViewUsesForegroundColor; 242 bool mTodoViewUsesForegroundColor;
241 bool mMonthViewUsesForegroundColor; 243 bool mMonthViewUsesForegroundColor;
242 244
243 bool mHightlightDateTimeEdit; 245 bool mHightlightDateTimeEdit;
244 bool mShortDateInViewer; 246 bool mShortDateInViewer;
245 247
246 QStringList mLocationDefaults; 248 QStringList mLocationDefaults;
247 QStringList mEventSummaryUser; 249 QStringList mEventSummaryUser;
248 QStringList mTodoSummaryUser; 250 QStringList mTodoSummaryUser;
249 251
250 bool mUseInternalAlarmNotification; 252 bool mUseInternalAlarmNotification;
251 int mAlarmPlayBeeps; 253 int mAlarmPlayBeeps;
252 int mAlarmSuspendTime; 254 int mAlarmSuspendTime;
253 int mAlarmSuspendCount; 255 int mAlarmSuspendCount;
254 int mAlarmBeepInterval; 256 int mAlarmBeepInterval;
255 int mOldLanguage; 257 int mOldLanguage;
256 int mOldLoadedLanguage; 258 int mOldLoadedLanguage;
257 259
258 260
259 QString mActiveSyncPort; 261 QString mActiveSyncPort;
260 QString mActiveSyncIP; 262 QString mActiveSyncIP;
261 263
262 private: 264 private:
263 QDict<QColor> mCategoryColors; 265 QDict<QColor> mCategoryColors;
264 QColor mDefaultCategoryColor; 266 QColor mDefaultCategoryColor;
265 267
266 QFont mDefaultTimeBarFont; 268 QFont mDefaultTimeBarFont;
267 QFont mDefaultViewFont; 269 QFont mDefaultViewFont;
268 QFont mDefaultMonthViewFont; 270 QFont mDefaultMonthViewFont;
269 271
270 QString mName; 272 QString mName;
271 QString mEmail; 273 QString mEmail;
272}; 274};
273 275
274#endif 276#endif
diff --git a/korganizer/koprefsdialog.cpp b/korganizer/koprefsdialog.cpp
index 578c0e9..8aa24ee 100644
--- a/korganizer/koprefsdialog.cpp
+++ b/korganizer/koprefsdialog.cpp
@@ -1,191 +1,194 @@
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 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 23
24#include <qlayout.h> 24#include <qlayout.h>
25#include <qlabel.h> 25#include <qlabel.h>
26#include <qgroupbox.h> 26#include <qgroupbox.h>
27#include <qbuttongroup.h> 27#include <qbuttongroup.h>
28#include <qlineedit.h> 28#include <qlineedit.h>
29#include <qfont.h> 29#include <qfont.h>
30#include <qslider.h> 30#include <qslider.h>
31#include <qfile.h> 31#include <qfile.h>
32#include <qtextstream.h> 32#include <qtextstream.h>
33#include <qcombobox.h> 33#include <qcombobox.h>
34#include <qvbox.h> 34#include <qvbox.h>
35#include <qhbox.h> 35#include <qhbox.h>
36#include <qregexp.h> 36#include <qregexp.h>
37#include <qspinbox.h> 37#include <qspinbox.h>
38#include <qdatetime.h> 38#include <qdatetime.h>
39#include <qcheckbox.h> 39#include <qcheckbox.h>
40#include <qradiobutton.h> 40#include <qradiobutton.h>
41#include <qpushbutton.h> 41#include <qpushbutton.h>
42#include <qstrlist.h> 42#include <qstrlist.h>
43#include <qapplication.h> 43#include <qapplication.h>
44 44
45#include <kcolorbutton.h> 45#include <kcolorbutton.h>
46#include <kdebug.h> 46#include <kdebug.h>
47#include <klocale.h> 47#include <klocale.h>
48#include <kglobal.h> 48#include <kglobal.h>
49#include <kfontdialog.h> 49#include <kfontdialog.h>
50#include <kfiledialog.h> 50#include <kfiledialog.h>
51#include <kmessagebox.h> 51#include <kmessagebox.h>
52#include <kcolordialog.h> 52#include <kcolordialog.h>
53#include <kiconloader.h> 53#include <kiconloader.h>
54#include <kemailsettings.h> 54#include <kemailsettings.h>
55#include <kstandarddirs.h> 55#include <kstandarddirs.h>
56 56
57#include <kurlrequester.h> 57#include <kurlrequester.h>
58#include <klineedit.h> 58#include <klineedit.h>
59 59
60#if defined(USE_SOLARIS) 60#if defined(USE_SOLARIS)
61#include <sys/param.h> 61#include <sys/param.h>
62 62
63#define ZONEINFODIR "/usr/share/lib/zoneinfo" 63#define ZONEINFODIR "/usr/share/lib/zoneinfo"
64#define INITFILE "/etc/default/init" 64#define INITFILE "/etc/default/init"
65#endif 65#endif
66 66
67#include "koprefs.h" 67#include "koprefs.h"
68 68
69#include "koprefsdialog.h" 69#include "koprefsdialog.h"
70#include "kpimglobalprefs.h" 70#include "kpimglobalprefs.h"
71 71
72 72
73KOPrefsDialog::KOPrefsDialog(QWidget *parent, char *name, bool modal) : 73KOPrefsDialog::KOPrefsDialog(QWidget *parent, char *name, bool modal) :
74 KPrefsDialog(KOPrefs::instance(),parent,name,true) 74 KPrefsDialog(KOPrefs::instance(),parent,name,true)
75{ 75{
76 76
77 setCaption( i18n("Preferences - some settings need a restart (nr)")); 77 setCaption( i18n("Preferences - some settings need a restart (nr)"));
78 mCategoryDict.setAutoDelete(true); 78 mCategoryDict.setAutoDelete(true);
79 79
80 KGlobal::locale()->insertCatalogue("timezones"); 80 KGlobal::locale()->insertCatalogue("timezones");
81 81
82 setupGlobalTab(); 82 setupGlobalTab();
83 setupMainTab(); 83 setupMainTab();
84 // setupLocaleTab(); 84 // setupLocaleTab();
85 //setupTimeZoneTab(); 85 //setupTimeZoneTab();
86 setupTimeTab(); 86 setupTimeTab();
87 //setupLocaleDateTab(); 87 //setupLocaleDateTab();
88 setupFontsTab(); 88 setupFontsTab();
89 setupColorsTab(); 89 setupColorsTab();
90 setupViewsTab(); 90 setupViewsTab();
91 //setupSyncTab(); 91 //setupSyncTab();
92 //setupSyncAlgTab(); 92 //setupSyncAlgTab();
93 //setupPrinterTab(); 93 //setupPrinterTab();
94 //setupGroupSchedulingTab(); 94 //setupGroupSchedulingTab();
95 //setupGroupAutomationTab(); 95 //setupGroupAutomationTab();
96
97 if ( QApplication::desktop()->height() == 480 )
98 hideButtons();
96} 99}
97 100
98 101
99KOPrefsDialog::~KOPrefsDialog() 102KOPrefsDialog::~KOPrefsDialog()
100{ 103{
101} 104}
102void KOPrefsDialog::setupGlobalTab() 105void KOPrefsDialog::setupGlobalTab()
103{ 106{
104 QFrame *topFrame = addPage(i18n("Global"),0,0); 107 QFrame *topFrame = addPage(i18n("Global"),0,0);
105 kdelibcfg = new KDEPIMConfigWidget( KPimGlobalPrefs::instance(), topFrame, "KCMKdeLibConfig" ); 108 kdelibcfg = new KDEPIMConfigWidget( KPimGlobalPrefs::instance(), topFrame, "KCMKdeLibConfig" );
106 QVBoxLayout *topLayout = new QVBoxLayout(topFrame); 109 QVBoxLayout *topLayout = new QVBoxLayout(topFrame);
107 topLayout->addWidget( kdelibcfg ); 110 topLayout->addWidget( kdelibcfg );
108 111
109 112
110} 113}
111void KOPrefsDialog::setupLocaleDateTab() 114void KOPrefsDialog::setupLocaleDateTab()
112{ 115{
113#if 0 116#if 0
114QFrame *topFrame = addPage(i18n("Date Format"),0,0); 117QFrame *topFrame = addPage(i18n("Date Format"),0,0);
115 QGridLayout *topLayout = new QGridLayout(topFrame,3,2); 118 QGridLayout *topLayout = new QGridLayout(topFrame,3,2);
116 topLayout->setSpacing(spacingHint()); 119 topLayout->setSpacing(spacingHint());
117 topLayout->setMargin(marginHint()); 120 topLayout->setMargin(marginHint());
118 int iii = 0; 121 int iii = 0;
119 122
120 123
121 KPrefsDialogWidRadios *syncPrefsGroup = 124 KPrefsDialogWidRadios *syncPrefsGroup =
122 addWidRadios(i18n("Date Format:"),&(KOPrefs::instance()->mPreferredDate),topFrame); 125 addWidRadios(i18n("Date Format:"),&(KOPrefs::instance()->mPreferredDate),topFrame);
123 QString format; 126 QString format;
124 if ( QApplication::desktop()->width() < 480 ) 127 if ( QApplication::desktop()->width() < 480 )
125 format = "(%d.%m.%Y)"; 128 format = "(%d.%m.%Y)";
126 else 129 else
127 format = "(%d.%m.%Y|%A %d %B %Y)"; 130 format = "(%d.%m.%Y|%A %d %B %Y)";
128 syncPrefsGroup->addRadio(i18n("24.03.2004 "+format)); 131 syncPrefsGroup->addRadio(i18n("24.03.2004 "+format));
129 if ( QApplication::desktop()->width() < 480 ) 132 if ( QApplication::desktop()->width() < 480 )
130 format = "(%m.%d.%Y)"; 133 format = "(%m.%d.%Y)";
131 else 134 else
132 format = "(%m.%d.%Y|%A %B %d %Y)"; 135 format = "(%m.%d.%Y|%A %B %d %Y)";
133 syncPrefsGroup->addRadio(i18n("03.24.2004 "+format)); 136 syncPrefsGroup->addRadio(i18n("03.24.2004 "+format));
134 if ( QApplication::desktop()->width() < 480 ) 137 if ( QApplication::desktop()->width() < 480 )
135 format = "(%Y-%m-%d)"; 138 format = "(%Y-%m-%d)";
136 else 139 else
137 format = "(%Y-%m-%d|%A %Y %B %d)"; 140 format = "(%Y-%m-%d|%A %Y %B %d)";
138 syncPrefsGroup->addRadio(i18n("2004-03-24 "+format)); 141 syncPrefsGroup->addRadio(i18n("2004-03-24 "+format));
139 syncPrefsGroup->addRadio(i18n("User defined")); 142 syncPrefsGroup->addRadio(i18n("User defined"));
140 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); 143 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1);
141 ++iii; 144 ++iii;
142 ++iii; 145 ++iii;
143 QLabel * lab; 146 QLabel * lab;
144 mUserDateFormatLong = new QLineEdit(topFrame); 147 mUserDateFormatLong = new QLineEdit(topFrame);
145 lab = new QLabel(mUserDateFormatLong, i18n("User long date:"), topFrame); 148 lab = new QLabel(mUserDateFormatLong, i18n("User long date:"), topFrame);
146 topLayout->addWidget(lab ,iii,0); 149 topLayout->addWidget(lab ,iii,0);
147 topLayout->addWidget(mUserDateFormatLong,iii,1); 150 topLayout->addWidget(mUserDateFormatLong,iii,1);
148 ++iii; 151 ++iii;
149 mUserDateFormatShort = new QLineEdit(topFrame); 152 mUserDateFormatShort = new QLineEdit(topFrame);
150 lab = new QLabel(mUserDateFormatShort, i18n("User short date:"), topFrame); 153 lab = new QLabel(mUserDateFormatShort, i18n("User short date:"), topFrame);
151 topLayout->addWidget(lab ,iii,0); 154 topLayout->addWidget(lab ,iii,0);
152 topLayout->addWidget(mUserDateFormatShort,iii,1); 155 topLayout->addWidget(mUserDateFormatShort,iii,1);
153 ++iii; 156 ++iii;
154 lab = new QLabel( i18n("Monday 19 April 2004: %A %d %B %Y"), topFrame); 157 lab = new QLabel( i18n("Monday 19 April 2004: %A %d %B %Y"), topFrame);
155 topLayout->addMultiCellWidget(lab ,iii,iii,0,1); 158 topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
156 ++iii; 159 ++iii;
157 lab = new QLabel( i18n("Mon 19.04.04: %a %d.%m.%y"), topFrame); 160 lab = new QLabel( i18n("Mon 19.04.04: %a %d.%m.%y"), topFrame);
158 topLayout->addMultiCellWidget(lab ,iii,iii,0,1); 161 topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
159 ++iii; 162 ++iii;
160 lab = new QLabel( i18n("Mon, 19.Apr.04: %a, %d.%b.%y"), topFrame); 163 lab = new QLabel( i18n("Mon, 19.Apr.04: %a, %d.%b.%y"), topFrame);
161 topLayout->addMultiCellWidget(lab ,iii,iii,0,1); 164 topLayout->addMultiCellWidget(lab ,iii,iii,0,1);
162 ++iii; 165 ++iii;
163#endif 166#endif
164 167
165} 168}
166 169
167void KOPrefsDialog::setupLocaleTab() 170void KOPrefsDialog::setupLocaleTab()
168{ 171{
169#if 0 172#if 0
170 QFrame *topFrame = addPage(i18n("Locale"),0,0); 173 QFrame *topFrame = addPage(i18n("Locale"),0,0);
171 QGridLayout *topLayout = new QGridLayout(topFrame,4,2); 174 QGridLayout *topLayout = new QGridLayout(topFrame,4,2);
172 topLayout->setSpacing(spacingHint()); 175 topLayout->setSpacing(spacingHint());
173 topLayout->setMargin(marginHint()); 176 topLayout->setMargin(marginHint());
174 int iii = 0; 177 int iii = 0;
175 KPrefsDialogWidRadios *syncPrefsGroup = 178 KPrefsDialogWidRadios *syncPrefsGroup =
176 addWidRadios(i18n("Language:(needs restart)"),&(KOPrefs::instance()->mPreferredLanguage),topFrame); 179 addWidRadios(i18n("Language:(needs restart)"),&(KOPrefs::instance()->mPreferredLanguage),topFrame);
177 syncPrefsGroup->addRadio(i18n("English")); 180 syncPrefsGroup->addRadio(i18n("English"));
178 syncPrefsGroup->addRadio(i18n("German")); 181 syncPrefsGroup->addRadio(i18n("German"));
179 syncPrefsGroup->addRadio(i18n("French")); 182 syncPrefsGroup->addRadio(i18n("French"));
180 syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)")); 183 syncPrefsGroup->addRadio(i18n("User defined (usertranslation.txt)"));
181 if ( QApplication::desktop()->width() < 300 ) 184 if ( QApplication::desktop()->width() < 300 )
182 ;// syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); 185 ;// syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical);
183 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1); 186 topLayout->addMultiCellWidget( syncPrefsGroup->groupBox(),iii,iii,0,1);
184 ++iii; 187 ++iii;
185 188
186 syncPrefsGroup = 189 syncPrefsGroup =
187 addWidRadios(i18n("Time Format(nr):"),&(KOPrefs::instance()->mPreferredTime),topFrame); 190 addWidRadios(i18n("Time Format(nr):"),&(KOPrefs::instance()->mPreferredTime),topFrame);
188 if ( QApplication::desktop()->width() > 300 ) 191 if ( QApplication::desktop()->width() > 300 )
189 syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical); 192 syncPrefsGroup->groupBox()-> setOrientation (Qt::Vertical);
190 syncPrefsGroup->addRadio(i18n("24:00")); 193 syncPrefsGroup->addRadio(i18n("24:00"));
191 syncPrefsGroup->addRadio(i18n("12:00am")); 194 syncPrefsGroup->addRadio(i18n("12:00am"));
@@ -507,192 +510,197 @@ void KOPrefsDialog::setupTimeTab()
507 QHBox *dummy = new QHBox(topFrame); 510 QHBox *dummy = new QHBox(topFrame);
508 KPrefsDialogWidTime *dayBegins = 511 KPrefsDialogWidTime *dayBegins =
509 addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins), 512 addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins),
510 dummy); 513 dummy);
511 //topLayout->addWidget(dayBegins->label(),2,0); 514 //topLayout->addWidget(dayBegins->label(),2,0);
512 515
513 //topLayout->addWidget(dayBegins->spinBox(),2,1); 516 //topLayout->addWidget(dayBegins->spinBox(),2,1);
514 topLayout->addMultiCellWidget(dummy,0,0,0,1); 517 topLayout->addMultiCellWidget(dummy,0,0,0,1);
515 518
516 topLayout->addWidget(new QLabel(i18n("Default appointment time:"), 519 topLayout->addWidget(new QLabel(i18n("Default appointment time:"),
517 topFrame),1,0); 520 topFrame),1,0);
518 mStartTimeSpin = new QSpinBox(0,23,1,topFrame); 521 mStartTimeSpin = new QSpinBox(0,23,1,topFrame);
519 mStartTimeSpin->setSuffix(":00"); 522 mStartTimeSpin->setSuffix(":00");
520 topLayout->addWidget(mStartTimeSpin,1,1); 523 topLayout->addWidget(mStartTimeSpin,1,1);
521 524
522 topLayout->addWidget(new QLabel(i18n("Def. duration of new app.:"), 525 topLayout->addWidget(new QLabel(i18n("Def. duration of new app.:"),
523 topFrame),2,0); 526 topFrame),2,0);
524 mDefaultDurationSpin = new QSpinBox(0,23,1,topFrame); 527 mDefaultDurationSpin = new QSpinBox(0,23,1,topFrame);
525 mDefaultDurationSpin->setSuffix(":00"); 528 mDefaultDurationSpin->setSuffix(":00");
526 topLayout->addWidget(mDefaultDurationSpin,2,1); 529 topLayout->addWidget(mDefaultDurationSpin,2,1);
527 530
528 QStringList alarmList; 531 QStringList alarmList;
529 alarmList << i18n("1 minute") << i18n("5 minutes") << i18n("10 minutes") 532 alarmList << i18n("1 minute") << i18n("5 minutes") << i18n("10 minutes")
530 << i18n("15 minutes") << i18n("30 minutes")<< i18n("1 hour")<< i18n("3 hours") << i18n("24 hours") ; 533 << i18n("15 minutes") << i18n("30 minutes")<< i18n("1 hour")<< i18n("3 hours") << i18n("24 hours") ;
531 topLayout->addWidget(new QLabel(i18n("Default alarm time:"),topFrame), 534 topLayout->addWidget(new QLabel(i18n("Default alarm time:"),topFrame),
532 3,0); 535 3,0);
533 mAlarmTimeCombo = new QComboBox(topFrame); 536 mAlarmTimeCombo = new QComboBox(topFrame);
534 mAlarmTimeCombo->insertStringList(alarmList); 537 mAlarmTimeCombo->insertStringList(alarmList);
535 topLayout->addWidget(mAlarmTimeCombo,3,1); 538 topLayout->addWidget(mAlarmTimeCombo,3,1);
536 539
537 540
538 QGroupBox *workingHoursGroup = new QGroupBox(1,Horizontal, 541 QGroupBox *workingHoursGroup = new QGroupBox(1,Horizontal,
539 i18n("Working Hours"), 542 i18n("Working Hours"),
540 topFrame); 543 topFrame);
541 topLayout->addMultiCellWidget(workingHoursGroup,4,4,0,1); 544 topLayout->addMultiCellWidget(workingHoursGroup,4,4,0,1);
542 workingHoursGroup->layout()->setSpacing( 0 ); 545 workingHoursGroup->layout()->setSpacing( 0 );
543 workingHoursGroup->layout()->setMargin( 4 ); 546 workingHoursGroup->layout()->setMargin( 4 );
544 QHBox *workStartBox = new QHBox(workingHoursGroup); 547 QHBox *workStartBox = new QHBox(workingHoursGroup);
545 // workStartBox->setMargin( 0 ); 548 // workStartBox->setMargin( 0 );
546 addWidTime(i18n("Daily starting hour:"), 549 addWidTime(i18n("Daily starting hour:"),
547 &(KOPrefs::instance()->mWorkingHoursStart),workStartBox); 550 &(KOPrefs::instance()->mWorkingHoursStart),workStartBox);
548 551
549 QHBox *workEndBox = new QHBox(workingHoursGroup); 552 QHBox *workEndBox = new QHBox(workingHoursGroup);
550 //workEndBox->setMargin( 0 ); 553 //workEndBox->setMargin( 0 );
551 addWidTime(i18n("Daily ending hour:"), 554 addWidTime(i18n("Daily ending hour:"),
552 &(KOPrefs::instance()->mWorkingHoursEnd),workEndBox); 555 &(KOPrefs::instance()->mWorkingHoursEnd),workEndBox);
553 QVBox *excludeBox = new QVBox(workingHoursGroup); 556 QVBox *excludeBox = new QVBox(workingHoursGroup);
554 //excludeBox->setMargin( 0 ); 557 //excludeBox->setMargin( 0 );
555 addWidBool(i18n("Exclude holidays"), 558 addWidBool(i18n("Exclude holidays"),
556 &(KOPrefs::instance()->mExcludeHolidays),excludeBox); 559 &(KOPrefs::instance()->mExcludeHolidays),excludeBox);
557 560
558 addWidBool(i18n("Exclude Saturdays"), 561 addWidBool(i18n("Exclude Saturdays"),
559 &(KOPrefs::instance()->mExcludeSaturdays),excludeBox); 562 &(KOPrefs::instance()->mExcludeSaturdays),excludeBox);
560 563
561// KPrefsDialogWidBool *marcusBainsShowSeconds = addWidBool(i18n("Show seconds on Marcus Bains line"), 564// KPrefsDialogWidBool *marcusBainsShowSeconds = addWidBool(i18n("Show seconds on Marcus Bains line"),
562 // &(KOPrefs::instance()->mMarcusBainsShowSeconds), 565 // &(KOPrefs::instance()->mMarcusBainsShowSeconds),
563 // topFrame); 566 // topFrame);
564// topLayout->addWidget(marcusBainsShowSeconds->checkBox(),5,0); 567// topLayout->addWidget(marcusBainsShowSeconds->checkBox(),5,0);
565 568
566 // topLayout->setRowStretch(6,1); 569 // topLayout->setRowStretch(6,1);
567} 570}
568 571
569 572
570void KOPrefsDialog::setupViewsTab() 573void KOPrefsDialog::setupViewsTab()
571{ 574{
572 575
573 QFrame *topFrame = addPage(i18n("Views"),0,0); 576 QFrame *topFrame = addPage(i18n("Views"),0,0);
574 // DesktopIcon("viewmag",KIcon::SizeMedium)); 577 // DesktopIcon("viewmag",KIcon::SizeMedium));
575 578
576 QGridLayout *topLayout = new QGridLayout(topFrame,6,1); 579 QGridLayout *topLayout = new QGridLayout(topFrame,6,1);
577 topLayout->setSpacing(spacingHint()); 580 topLayout->setSpacing(spacingHint());
578 topLayout->setMargin(marginHint()); 581 topLayout->setMargin(marginHint());
579 582
580// QBoxLayout *dayBeginsLayout = new QHBoxLayout; 583// QBoxLayout *dayBeginsLayout = new QHBoxLayout;
581// topLayout->addLayout(dayBeginsLayout,0,0); 584// topLayout->addLayout(dayBeginsLayout,0,0);
582 585
583// KPrefsDialogWidTime *dayBegins = 586// KPrefsDialogWidTime *dayBegins =
584// addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins), 587// addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins),
585// topFrame); 588// topFrame);
586// dayBeginsLayout->addWidget(dayBegins->label()); 589// dayBeginsLayout->addWidget(dayBegins->label());
587// dayBeginsLayout->addStretch(1); 590// dayBeginsLayout->addStretch(1);
588// dayBeginsLayout->addWidget(dayBegins->spinBox()); 591// dayBeginsLayout->addWidget(dayBegins->spinBox());
589 592
590// QBoxLayout *nextDaysLayout = new QHBoxLayout; 593// QBoxLayout *nextDaysLayout = new QHBoxLayout;
591// topLayout->addLayout(nextDaysLayout,1,0); 594// topLayout->addLayout(nextDaysLayout,1,0);
592// nextDaysLayout->addWidget(new QLabel(i18n("Days to show in Next-X-Days view:"),topFrame)); 595// nextDaysLayout->addWidget(new QLabel(i18n("Days to show in Next-X-Days view:"),topFrame));
593// mNextXDaysSpin = new QSpinBox(2,14,1,topFrame); 596// mNextXDaysSpin = new QSpinBox(2,14,1,topFrame);
594// nextDaysLayout->addStretch(1); 597// nextDaysLayout->addStretch(1);
595// nextDaysLayout->addWidget(mNextXDaysSpin); 598// nextDaysLayout->addWidget(mNextXDaysSpin);
596 599
597 600
598 int ii = 0; 601 int ii = 0;
599 KPrefsDialogWidBool *dummy = 602 KPrefsDialogWidBool *dummy =
600 addWidBool(i18n("Edit item on doubleclick (if not, show)"), 603 addWidBool(i18n("Edit item on doubleclick (if not, show)"),
601 &(KOPrefs::instance()->mEditOnDoubleClick),topFrame); 604 &(KOPrefs::instance()->mEditOnDoubleClick),topFrame);
602 topLayout->addWidget(dummy->checkBox(),ii++,0); 605 topLayout->addWidget(dummy->checkBox(),ii++,0);
606
607 dummy =
608 addWidBool(i18n("Show time in agenda items"),
609 &(KOPrefs::instance()->mShowTimeInAgenda),topFrame);
610 topLayout->addWidget(dummy->checkBox(),ii++,0);
603 611
604 dummy = 612 dummy =
605 addWidBool(i18n("Highlight current day in agenda"), 613 addWidBool(i18n("Highlight current day in agenda"),
606 &(KOPrefs::instance()->mHighlightCurrentDay),topFrame); 614 &(KOPrefs::instance()->mHighlightCurrentDay),topFrame);
607 topLayout->addWidget(dummy->checkBox(),ii++,0); 615 topLayout->addWidget(dummy->checkBox(),ii++,0);
608 616
609 dummy = 617 dummy =
610 addWidBool(i18n("Use light color for highlight current day"), 618 addWidBool(i18n("Use light color for highlight current day"),
611 &(KOPrefs::instance()->mUseHighlightLightColor),topFrame); 619 &(KOPrefs::instance()->mUseHighlightLightColor),topFrame);
612 topLayout->addWidget(dummy->checkBox(),ii++,0); 620 topLayout->addWidget(dummy->checkBox(),ii++,0);
613 621
614 KPrefsDialogWidBool *dailyRecur = 622 KPrefsDialogWidBool *dailyRecur =
615 addWidBool(i18n("Show events that recur daily in date nav."), 623 addWidBool(i18n("Show events that recur daily in date nav."),
616 &(KOPrefs::instance()->mDailyRecur),topFrame); 624 &(KOPrefs::instance()->mDailyRecur),topFrame);
617 topLayout->addWidget(dailyRecur->checkBox(),ii++,0); 625 topLayout->addWidget(dailyRecur->checkBox(),ii++,0);
618 626
619 KPrefsDialogWidBool *weeklyRecur = 627 KPrefsDialogWidBool *weeklyRecur =
620 addWidBool(i18n("Show ev. that recur weekly in date nav."), 628 addWidBool(i18n("Show ev. that recur weekly in date nav."),
621 &(KOPrefs::instance()->mWeeklyRecur),topFrame); 629 &(KOPrefs::instance()->mWeeklyRecur),topFrame);
622 topLayout->addWidget(weeklyRecur->checkBox(),ii++,0); 630 topLayout->addWidget(weeklyRecur->checkBox(),ii++,0);
623 if ( QApplication::desktop()->width() > 640 ) { 631 if ( QApplication::desktop()->width() > 640 ) {
624 632
625 KPrefsDialogWidBool *enableToolTips = 633 KPrefsDialogWidBool *enableToolTips =
626 addWidBool(i18n("Enable tooltips displaying summary of ev."), 634 addWidBool(i18n("Enable tooltips displaying summary of ev."),
627 &(KOPrefs::instance()->mEnableToolTips),topFrame); 635 &(KOPrefs::instance()->mEnableToolTips),topFrame);
628 topLayout->addWidget(enableToolTips->checkBox(),ii++,0); 636 topLayout->addWidget(enableToolTips->checkBox(),ii++,0);
629 637
630 } 638 }
631 639
632 KPrefsDialogWidBool *marcusBainsEnabled = 640 KPrefsDialogWidBool *marcusBainsEnabled =
633 addWidBool(i18n("Show Marcus Bains line"), 641 addWidBool(i18n("Show Marcus Bains line"),
634 &(KOPrefs::instance()->mMarcusBainsEnabled),topFrame); 642 &(KOPrefs::instance()->mMarcusBainsEnabled),topFrame);
635 topLayout->addWidget(marcusBainsEnabled->checkBox(),ii++,0); 643 topLayout->addWidget(marcusBainsEnabled->checkBox(),ii++,0);
636 644
637 645
638 // topLayout->addWidget(hourSizeGroup,ii++,0); 646 // topLayout->addWidget(hourSizeGroup,ii++,0);
639 // topLayout->addMultiCellWidget(hourSizeGroup,ii,ii,0,0); 647 // topLayout->addMultiCellWidget(hourSizeGroup,ii,ii,0,0);
640 //topLayout->setRowStretch(11,1); 648 //topLayout->setRowStretch(11,1);
641 649
642 650
643 651
644 652
645 653
646 654
647 topFrame = addPage(i18n("ViewChange"),0,0); 655 topFrame = addPage(i18n("ViewChange"),0,0);
648 // DesktopIcon("viewmag",KIcon::SizeMedium)); 656 // DesktopIcon("viewmag",KIcon::SizeMedium));
649 657
650 topLayout = new QGridLayout(topFrame,6,1); 658 topLayout = new QGridLayout(topFrame,6,1);
651 topLayout->setSpacing(spacingHint()); 659 topLayout->setSpacing(spacingHint());
652 topLayout->setMargin(marginHint()); 660 topLayout->setMargin(marginHint());
653 ii = 0; 661 ii = 0;
654 662
655 663
656 dummy = 664 dummy =
657 addWidBool(i18n("Hold fullscreen on view change"), 665 addWidBool(i18n("Hold fullscreen on view change"),
658 &(KOPrefs::instance()->mViewChangeHoldFullscreen),topFrame); 666 &(KOPrefs::instance()->mViewChangeHoldFullscreen),topFrame);
659 topLayout->addWidget(dummy->checkBox(),ii++,0); 667 topLayout->addWidget(dummy->checkBox(),ii++,0);
660 668
661 dummy = 669 dummy =
662 addWidBool(i18n("Hold non-fullscreen on view change"), 670 addWidBool(i18n("Hold non-fullscreen on view change"),
663 &(KOPrefs::instance()->mViewChangeHoldNonFullscreen),topFrame); 671 &(KOPrefs::instance()->mViewChangeHoldNonFullscreen),topFrame);
664 topLayout->addWidget(dummy->checkBox(),ii++,0); 672 topLayout->addWidget(dummy->checkBox(),ii++,0);
665 673
666 674
667 KPrefsDialogWidBool *fullViewTodo = 675 KPrefsDialogWidBool *fullViewTodo =
668 addWidBool(i18n("Event list view uses full window"), 676 addWidBool(i18n("Event list view uses full window"),
669 &(KOPrefs::instance()->mFullViewTodo),topFrame); 677 &(KOPrefs::instance()->mFullViewTodo),topFrame);
670 topLayout->addWidget(fullViewTodo->checkBox(),ii++,0); 678 topLayout->addWidget(fullViewTodo->checkBox(),ii++,0);
671 679
672 KPrefsDialogWidBool *fullViewMonth = 680 KPrefsDialogWidBool *fullViewMonth =
673 addWidBool(i18n("Next days view uses full window"), 681 addWidBool(i18n("Next days view uses full window"),
674 &(KOPrefs::instance()->mFullViewMonth),topFrame); 682 &(KOPrefs::instance()->mFullViewMonth),topFrame);
675 topLayout->addWidget(fullViewMonth->checkBox(),ii++,0); 683 topLayout->addWidget(fullViewMonth->checkBox(),ii++,0);
676 684
677 dummy = 685 dummy =
678 addWidBool(i18n("Set agenda to DayBeginsAt on change"), 686 addWidBool(i18n("Set agenda to DayBeginsAt on change"),
679 &(KOPrefs::instance()->mSetTimeToDayStartAt),topFrame); 687 &(KOPrefs::instance()->mSetTimeToDayStartAt),topFrame);
680 topLayout->addWidget(dummy->checkBox(),ii++,0); 688 topLayout->addWidget(dummy->checkBox(),ii++,0);
681 689
682 dummy = 690 dummy =
683 addWidBool(i18n("Set agenda to current time on change"), 691 addWidBool(i18n("Set agenda to current time on change"),
684 &(KOPrefs::instance()->mCenterOnCurrentTime),topFrame); 692 &(KOPrefs::instance()->mCenterOnCurrentTime),topFrame);
685 topLayout->addWidget(dummy->checkBox(),ii++,0); 693 topLayout->addWidget(dummy->checkBox(),ii++,0);
686 694
687 dummy = 695 dummy =
688 addWidBool(i18n("Listview uses monthly timespan"), 696 addWidBool(i18n("Listview uses monthly timespan"),
689 &(KOPrefs::instance()->mListViewMonthTimespan),topFrame); 697 &(KOPrefs::instance()->mListViewMonthTimespan),topFrame);
690 topLayout->addWidget(dummy->checkBox(),ii++,0); 698 topLayout->addWidget(dummy->checkBox(),ii++,0);
691 dummy = 699 dummy =
692 addWidBool(i18n("Highlight selection in Time Edit"), 700 addWidBool(i18n("Highlight selection in Time Edit"),
693 &(KOPrefs::instance()->mHightlightDateTimeEdit),topFrame); 701 &(KOPrefs::instance()->mHightlightDateTimeEdit),topFrame);
694 topLayout->addWidget( dummy->checkBox(), ii++,0); 702 topLayout->addWidget( dummy->checkBox(), ii++,0);
695 703
696 704
697 705
698 706
@@ -740,192 +748,197 @@ void KOPrefsDialog::setupViewsTab()
740 addWidBool(i18n("short month"), 748 addWidBool(i18n("short month"),
741 &(KOPrefs::instance()->mMonthShowShort),habo); 749 &(KOPrefs::instance()->mMonthShowShort),habo);
742 weeklyRecur = 750 weeklyRecur =
743 addWidBool(i18n("icons"), 751 addWidBool(i18n("icons"),
744 &(KOPrefs::instance()->mMonthShowIcons),habo); 752 &(KOPrefs::instance()->mMonthShowIcons),habo);
745 753
746 topLayout->addMultiCellWidget(habo,ii, ii,0,1); 754 topLayout->addMultiCellWidget(habo,ii, ii,0,1);
747 ii++; 755 ii++;
748#ifdef DESKTOP_VERSION 756#ifdef DESKTOP_VERSION
749 KPrefsDialogWidBool *enableMonthScroll = 757 KPrefsDialogWidBool *enableMonthScroll =
750 addWidBool(i18n("Enable scrollbars in month view cells"), 758 addWidBool(i18n("Enable scrollbars in month view cells"),
751 &(KOPrefs::instance()->mEnableMonthScroll),topFrame); 759 &(KOPrefs::instance()->mEnableMonthScroll),topFrame);
752 topLayout->addWidget(enableMonthScroll->checkBox(),ii++,0); 760 topLayout->addWidget(enableMonthScroll->checkBox(),ii++,0);
753#endif 761#endif
754 762
755 dummy = 763 dummy =
756 addWidBool(i18n("Show Sat/Sun together"), 764 addWidBool(i18n("Show Sat/Sun together"),
757 &(KOPrefs::instance()->mMonthViewSatSunTog),topFrame); 765 &(KOPrefs::instance()->mMonthViewSatSunTog),topFrame);
758 topLayout->addWidget(dummy->checkBox(),ii++,0); 766 topLayout->addWidget(dummy->checkBox(),ii++,0);
759 767
760 KPrefsDialogWidBool *coloredCategoriesInMonthView = 768 KPrefsDialogWidBool *coloredCategoriesInMonthView =
761 addWidBool(i18n("Month view uses category colors"), 769 addWidBool(i18n("Month view uses category colors"),
762 &(KOPrefs::instance()->mMonthViewUsesCategoryColor),topFrame); 770 &(KOPrefs::instance()->mMonthViewUsesCategoryColor),topFrame);
763 topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0); 771 topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0);
764 772
765 dummy = 773 dummy =
766 addWidBool(i18n("Categorie colors are applied to text"), 774 addWidBool(i18n("Categorie colors are applied to text"),
767 &(KOPrefs::instance()->mMonthViewUsesForegroundColor),topFrame); 775 &(KOPrefs::instance()->mMonthViewUsesForegroundColor),topFrame);
768 topLayout->addWidget(dummy->checkBox(),ii++,0); 776 topLayout->addWidget(dummy->checkBox(),ii++,0);
769 coloredCategoriesInMonthView = 777 coloredCategoriesInMonthView =
770 addWidBool(i18n("Month view uses day colors"), 778 addWidBool(i18n("Month view uses day colors"),
771 &(KOPrefs::instance()->mMonthViewUsesDayColors),topFrame); 779 &(KOPrefs::instance()->mMonthViewUsesDayColors),topFrame);
772 topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0); 780 topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0);
773 781
774 KPrefsDialogWidColor *holidayColor = 782 KPrefsDialogWidColor *holidayColor =
775 addWidColor(i18n("Day color odd months"), 783 addWidColor(i18n("Day color odd months"),
776 &(KOPrefs::instance()->mMonthViewOddColor),topFrame); 784 &(KOPrefs::instance()->mMonthViewOddColor),topFrame);
777 topLayout->addWidget(holidayColor->label(),ii,0); 785 topLayout->addWidget(holidayColor->label(),ii,0);
778 topLayout->addWidget(holidayColor->button(),ii++,1); 786 topLayout->addWidget(holidayColor->button(),ii++,1);
779 787
780 holidayColor = 788 holidayColor =
781 addWidColor(i18n("Day color even months"), 789 addWidColor(i18n("Day color even months"),
782 &(KOPrefs::instance()->mMonthViewEvenColor),topFrame); 790 &(KOPrefs::instance()->mMonthViewEvenColor),topFrame);
783 topLayout->addWidget(holidayColor->label(),ii,0); 791 topLayout->addWidget(holidayColor->label(),ii,0);
784 topLayout->addWidget(holidayColor->button(),ii++,1); 792 topLayout->addWidget(holidayColor->button(),ii++,1);
785 793
786 794
787 holidayColor = 795 holidayColor =
788 addWidColor(i18n("Color for Sundays + category \"Holiday\""), 796 addWidColor(i18n("Color for Sundays + category \"Holiday\""),
789 &(KOPrefs::instance()->mMonthViewHolidayColor),topFrame); 797 &(KOPrefs::instance()->mMonthViewHolidayColor),topFrame);
790 topLayout->addWidget(holidayColor->label(),ii,0); 798 topLayout->addWidget(holidayColor->label(),ii,0);
791 topLayout->addWidget(holidayColor->button(),ii++,1); 799 topLayout->addWidget(holidayColor->button(),ii++,1);
792 // *********************** What'sNext View 800 // *********************** What'sNext View
793 topFrame = addPage(i18n("What's Next View"),0,0); 801 topFrame = addPage(i18n("What's Next View"),0,0);
794 // DesktopIcon("viewmag",KIcon::SizeMedium)); 802 // DesktopIcon("viewmag",KIcon::SizeMedium));
795 803
796 topLayout = new QGridLayout(topFrame,4,1); 804 topLayout = new QGridLayout(topFrame,4,1);
797 topLayout->setSpacing(spacingHint()); 805 topLayout->setSpacing(spacingHint());
798 topLayout->setMargin(marginHint()); 806 topLayout->setMargin(marginHint());
799 ii = 0; 807 ii = 0;
800 KPrefsDialogWidBool *passwdk = 808 KPrefsDialogWidBool *passwdk =
801 809
802 addWidBool(i18n("Show events, that are done in \nWhat's Next view"), 810 addWidBool(i18n("Show events, that are done in \nWhat's Next view"),
803 &(KOPrefs::instance()->mWNViewShowsPast),topFrame); 811 &(KOPrefs::instance()->mWNViewShowsPast),topFrame);
804 topLayout->addWidget(passwdk->checkBox(), ii++,0); 812 topLayout->addWidget(passwdk->checkBox(), ii++,0);
805 passwdk = 813 passwdk =
806 addWidBool(i18n("Show parent To-Do's in What's Next view"), 814 addWidBool(i18n("Show parent To-Do's in What's Next view"),
807 &(KOPrefs::instance()->mWNViewShowsParents),topFrame); 815 &(KOPrefs::instance()->mWNViewShowsParents),topFrame);
808 topLayout->addWidget(passwdk->checkBox(), ii++,0); 816 topLayout->addWidget(passwdk->checkBox(), ii++,0);
809 817
810 passwdk = 818 passwdk =
811 addWidBool(i18n("Show location in What's Next view"), 819 addWidBool(i18n("Show location in What's Next view"),
812 &(KOPrefs::instance()->mWNViewShowLocation),topFrame); 820 &(KOPrefs::instance()->mWNViewShowLocation),topFrame);
813 topLayout->addWidget(passwdk->checkBox(), ii++,0); 821 topLayout->addWidget(passwdk->checkBox(), ii++,0);
814 822
815 passwdk = 823 passwdk =
816 addWidBool(i18n("Show Sync Events in \nWhat's Next/Agenda view"), 824 addWidBool(i18n("Show Sync Events in \nWhat's Next/Agenda view"),
817 &(KOPrefs::instance()->mShowSyncEvents),topFrame); 825 &(KOPrefs::instance()->mShowSyncEvents),topFrame);
818 topLayout->addWidget(passwdk->checkBox(), ii++,0); 826 topLayout->addWidget(passwdk->checkBox(), ii++,0);
819 passwdk = 827 passwdk =
820 addWidBool(i18n("Use short date in \nWhat's Next/Event view"), 828 addWidBool(i18n("Use short date in \nWhat's Next/Event view"),
821 &(KOPrefs::instance()->mShortDateInViewer),topFrame); 829 &(KOPrefs::instance()->mShortDateInViewer),topFrame);
822 topLayout->addWidget(passwdk->checkBox(), ii++,0); 830 topLayout->addWidget(passwdk->checkBox(), ii++,0);
823 831
824 832
825 833
826 834
827 // *********************** Todo View 835 // *********************** Todo View
828 836
829 topFrame = addPage(i18n("Todo View"),0,0); 837 topFrame = addPage(i18n("Todo View"),0,0);
830 // DesktopIcon("viewmag",KIcon::SizeMedium)); 838 // DesktopIcon("viewmag",KIcon::SizeMedium));
831 839
832 topLayout = new QGridLayout(topFrame,4,1); 840 topLayout = new QGridLayout(topFrame,4,1);
833 topLayout->setSpacing(spacingHint()); 841 topLayout->setSpacing(spacingHint());
834 topLayout->setMargin(marginHint()); 842 topLayout->setMargin(marginHint());
835 ii = 0; 843 ii = 0;
844dummy =
845 addWidBool(i18n("Hide not running Todos in To-do view"),
846 &(KOPrefs::instance()->mHideNonStartedTodos),topFrame);
847 topLayout->addWidget(dummy->checkBox(),ii++,0);
848
836 849
837 KPrefsDialogWidBool *showCompletedTodo = 850 KPrefsDialogWidBool *showCompletedTodo =
838 addWidBool(i18n("To-do view shows completed Todos"), 851 addWidBool(i18n("To-do view shows completed Todos"),
839 &(KOPrefs::instance()->mShowCompletedTodo),topFrame); 852 &(KOPrefs::instance()->mShowCompletedTodo),topFrame);
840 topLayout->addWidget(showCompletedTodo->checkBox(),ii++,0); 853 topLayout->addWidget(showCompletedTodo->checkBox(),ii++,0);
841 dummy = 854 dummy =
842 addWidBool(i18n("To-do view shows complete as 'xx %'"), 855 addWidBool(i18n("To-do view shows complete as 'xx %'"),
843 &(KOPrefs::instance()->mTodoViewShowsPercentage),topFrame); 856 &(KOPrefs::instance()->mTodoViewShowsPercentage),topFrame);
844 topLayout->addWidget(dummy->checkBox(),ii++,0); 857 topLayout->addWidget(dummy->checkBox(),ii++,0);
845 858
846 dummy = 859 dummy =
847 addWidBool(i18n("Small To-do view uses smaller font"), 860 addWidBool(i18n("Small To-do view uses smaller font"),
848 &(KOPrefs::instance()->mTodoViewUsesSmallFont),topFrame); 861 &(KOPrefs::instance()->mTodoViewUsesSmallFont),topFrame);
849 topLayout->addWidget(dummy->checkBox(),ii++,0); 862 topLayout->addWidget(dummy->checkBox(),ii++,0);
850 863
851 864
852 865
853 dummy = 866 dummy =
854 addWidBool(i18n("Todo view uses category colors"), 867 addWidBool(i18n("Todo view uses category colors"),
855 &(KOPrefs::instance()->mTodoViewUsesCatColors),topFrame); 868 &(KOPrefs::instance()->mTodoViewUsesCatColors),topFrame);
856 topLayout->addWidget(dummy->checkBox(),ii++,0); 869 topLayout->addWidget(dummy->checkBox(),ii++,0);
857 870
858 871
859 QWidget* wid = new QWidget( topFrame ); 872 QWidget* wid = new QWidget( topFrame );
860 // Todo due today color 873 // Todo due today color
861 KPrefsDialogWidColor *todoDueTodayColor = 874 KPrefsDialogWidColor *todoDueTodayColor =
862 addWidColor(i18n("Todo due today color:"), 875 addWidColor(i18n("Todo due today color:"),
863 &(KOPrefs::instance()->mTodoDueTodayColor),wid); 876 &(KOPrefs::instance()->mTodoDueTodayColor),wid);
864 QHBoxLayout *widLayout = new QHBoxLayout(wid); 877 QHBoxLayout *widLayout = new QHBoxLayout(wid);
865 widLayout->addWidget( todoDueTodayColor->label() ); 878 widLayout->addWidget( todoDueTodayColor->label() );
866 widLayout->addWidget( todoDueTodayColor->button() ); 879 widLayout->addWidget( todoDueTodayColor->button() );
867 topLayout->addWidget(wid,ii++,0); 880 topLayout->addWidget(wid,ii++,0);
868 //topLayout->addWidget(todoDueTodayColor->button(),ii++,1); 881 //topLayout->addWidget(todoDueTodayColor->button(),ii++,1);
869 882
870 // Todo overdue color 883 // Todo overdue color
871 wid = new QWidget( topFrame ); 884 wid = new QWidget( topFrame );
872 widLayout = new QHBoxLayout(wid); 885 widLayout = new QHBoxLayout(wid);
873 KPrefsDialogWidColor *todoOverdueColor = 886 KPrefsDialogWidColor *todoOverdueColor =
874 addWidColor(i18n("Todo overdue color:"), 887 addWidColor(i18n("Todo overdue color:"),
875 &(KOPrefs::instance()->mTodoOverdueColor),wid); 888 &(KOPrefs::instance()->mTodoOverdueColor),wid);
876 widLayout->addWidget(todoOverdueColor->label()); 889 widLayout->addWidget(todoOverdueColor->label());
877 widLayout->addWidget(todoOverdueColor->button()); 890 widLayout->addWidget(todoOverdueColor->button());
878 topLayout->addWidget(wid,ii++,0); 891 topLayout->addWidget(wid,ii++,0);
879 892
880 dummy = 893 dummy =
881 addWidBool(i18n("Colors are applied to text"), 894 addWidBool(i18n("Colors are applied to text"),
882 &(KOPrefs::instance()->mTodoViewUsesForegroundColor),topFrame); 895 &(KOPrefs::instance()->mTodoViewUsesForegroundColor),topFrame);
883 topLayout->addWidget(dummy->checkBox(),ii++,0); 896 topLayout->addWidget(dummy->checkBox(),ii++,0);
884 897
885 dummy = 898 dummy =
886 addWidBool(i18n("Allday Agenda view shows todos"), 899 addWidBool(i18n("Allday Agenda view shows todos"),
887 &(KOPrefs::instance()->mShowTodoInAgenda),topFrame); 900 &(KOPrefs::instance()->mShowTodoInAgenda),topFrame);
888 topLayout->addWidget(dummy->checkBox(),ii++,0); 901 topLayout->addWidget(dummy->checkBox(),ii++,0);
889 902
890 903
891 904
892 905
893 topFrame = addPage(i18n("Alarm"),0,0); 906 topFrame = addPage(i18n("Alarm"),0,0);
894 // DesktopIcon("viewmag",KIcon::SizeMedium)); 907 // DesktopIcon("viewmag",KIcon::SizeMedium));
895 908
896 topLayout = new QGridLayout(topFrame,2,1); 909 topLayout = new QGridLayout(topFrame,2,1);
897 topLayout->setSpacing(spacingHint()); 910 topLayout->setSpacing(spacingHint());
898 topLayout->setMargin(marginHint()); 911 topLayout->setMargin(marginHint());
899 int iii = 0; 912 int iii = 0;
900 913
901 dummy = 914 dummy =
902 addWidBool(i18n("Use internal alarm notification"), 915 addWidBool(i18n("Use internal alarm notification"),
903 &(KOPrefs::instance()->mUseInternalAlarmNotification),topFrame); 916 &(KOPrefs::instance()->mUseInternalAlarmNotification),topFrame);
904 topLayout->addWidget(dummy->checkBox(),iii++,0); 917 topLayout->addWidget(dummy->checkBox(),iii++,0);
905 lab = new QLabel( i18n("Note: KO/Pi must be running to notify you about an alarm. Recommended for use on Zaurus: Disable this option and install KO/Pi alarm applet.\n"), topFrame); 918 lab = new QLabel( i18n("Note: KO/Pi must be running to notify you about an alarm. Recommended for use on Zaurus: Disable this option and install KO/Pi alarm applet.\n"), topFrame);
906 919
907 topLayout->addWidget(lab ,iii++,0); 920 topLayout->addWidget(lab ,iii++,0);
908#ifndef DESKTOP_VERSION 921#ifndef DESKTOP_VERSION
909 lab->setAlignment( AlignLeft|WordBreak|AlignTop); 922 lab->setAlignment( AlignLeft|WordBreak|AlignTop);
910#else 923#else
911 lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop); 924 lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop);
912 lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) ); 925 lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) );
913#endif 926#endif
914 927
915 QHBox* dummyBox = new QHBox(topFrame); 928 QHBox* dummyBox = new QHBox(topFrame);
916 new QLabel(i18n("Play beeps count:"),dummyBox); 929 new QLabel(i18n("Play beeps count:"),dummyBox);
917 mAlarmPlayBeeps = new QSpinBox(0,500,1,dummyBox); 930 mAlarmPlayBeeps = new QSpinBox(0,500,1,dummyBox);
918 topLayout->addWidget(dummyBox,iii++,0); 931 topLayout->addWidget(dummyBox,iii++,0);
919 932
920 dummyBox = new QHBox(topFrame); 933 dummyBox = new QHBox(topFrame);
921 new QLabel(i18n("Beeps interval in sec:"),dummyBox); 934 new QLabel(i18n("Beeps interval in sec:"),dummyBox);
922 mAlarmBeepInterval = new QSpinBox(1,600,1,dummyBox); 935 mAlarmBeepInterval = new QSpinBox(1,600,1,dummyBox);
923 topLayout->addWidget(dummyBox,iii++,0); 936 topLayout->addWidget(dummyBox,iii++,0);
924 937
925 dummyBox = new QHBox(topFrame); 938 dummyBox = new QHBox(topFrame);
926 new QLabel(i18n("Default suspend time in min:"),dummyBox); 939 new QLabel(i18n("Default suspend time in min:"),dummyBox);
927 mAlarmSuspendTime = new QSpinBox(1,600,1,dummyBox); 940 mAlarmSuspendTime = new QSpinBox(1,600,1,dummyBox);
928 topLayout->addWidget(dummyBox,iii++,0); 941 topLayout->addWidget(dummyBox,iii++,0);
929 942
930 dummyBox = new QHBox(topFrame); 943 dummyBox = new QHBox(topFrame);
931 new QLabel(i18n("Auto suspend count:"),dummyBox); 944 new QLabel(i18n("Auto suspend count:"),dummyBox);
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp
index 9cafc60..5d7b066 100644
--- a/korganizer/kotodoview.cpp
+++ b/korganizer/kotodoview.cpp
@@ -239,579 +239,604 @@ void KOTodoListView::contentsMouseMoveEvent(QMouseEvent* e)
239 } 239 }
240 } 240 }
241#endif 241#endif
242} 242}
243void KOTodoListView::keyPressEvent ( QKeyEvent * e ) 243void KOTodoListView::keyPressEvent ( QKeyEvent * e )
244{ 244{
245 245
246 QListViewItem* cn; 246 QListViewItem* cn;
247 if ( e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter ) { 247 if ( e->key() == Qt::Key_Return || e->key() == Qt::Key_Enter ) {
248 cn = currentItem(); 248 cn = currentItem();
249 if ( cn ) { 249 if ( cn ) {
250 KOTodoViewItem* ci = (KOTodoViewItem*)( cn ); 250 KOTodoViewItem* ci = (KOTodoViewItem*)( cn );
251 if ( ci ){ 251 if ( ci ){
252 if ( e->state() == ShiftButton ) 252 if ( e->state() == ShiftButton )
253 ci->setOn( false ); 253 ci->setOn( false );
254 else 254 else
255 ci->setOn( true ); 255 ci->setOn( true );
256 cn = cn->nextSibling(); 256 cn = cn->nextSibling();
257 if ( cn ) { 257 if ( cn ) {
258 setCurrentItem ( cn ); 258 setCurrentItem ( cn );
259 ensureItemVisible ( cn ); 259 ensureItemVisible ( cn );
260 } 260 }
261 261
262 } 262 }
263 } 263 }
264 264
265 return; 265 return;
266 } 266 }
267 267
268 // qDebug("KOTodoListView::keyPressEvent "); 268 // qDebug("KOTodoListView::keyPressEvent ");
269 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton || mName != "todolistsmall" ) { 269 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton || mName != "todolistsmall" ) {
270 switch ( e->key() ) { 270 switch ( e->key() ) {
271 case Qt::Key_Down: 271 case Qt::Key_Down:
272 case Qt::Key_Up: 272 case Qt::Key_Up:
273 QListView::keyPressEvent ( e ); 273 QListView::keyPressEvent ( e );
274 break; 274 break;
275 case Qt::Key_Left: 275 case Qt::Key_Left:
276 case Qt::Key_Right: 276 case Qt::Key_Right:
277 QListView::keyPressEvent ( e ); 277 QListView::keyPressEvent ( e );
278 e->accept(); 278 e->accept();
279 return; 279 return;
280 break; 280 break;
281 default: 281 default:
282 e->ignore(); 282 e->ignore();
283 break; 283 break;
284 } 284 }
285 return; 285 return;
286 } 286 }
287 e->ignore(); 287 e->ignore();
288} 288}
289void KOTodoListView::contentsMouseReleaseEvent(QMouseEvent *e) 289void KOTodoListView::contentsMouseReleaseEvent(QMouseEvent *e)
290{ 290{
291 QListView::contentsMouseReleaseEvent(e); 291 QListView::contentsMouseReleaseEvent(e);
292 mMousePressed = false; 292 mMousePressed = false;
293} 293}
294 294
295void KOTodoListView::contentsMouseDoubleClickEvent(QMouseEvent *e) 295void KOTodoListView::contentsMouseDoubleClickEvent(QMouseEvent *e)
296{ 296{
297 if (!e) return; 297 if (!e) return;
298 298
299 QPoint vp = contentsToViewport(e->pos()); 299 QPoint vp = contentsToViewport(e->pos());
300 300
301 QListViewItem *item = itemAt(vp); 301 QListViewItem *item = itemAt(vp);
302 302
303 emit double_Clicked(item); 303 emit double_Clicked(item);
304 if (!item) return; 304 if (!item) return;
305 305
306 emit doubleClicked(item,vp,0); 306 emit doubleClicked(item,vp,0);
307} 307}
308 308
309///////////////////////////////////////////////////////////////////////////// 309/////////////////////////////////////////////////////////////////////////////
310 310
311KOQuickTodo::KOQuickTodo(QWidget *parent) : 311KOQuickTodo::KOQuickTodo(QWidget *parent) :
312 QLineEdit(parent) 312 QLineEdit(parent)
313{ 313{
314 setText(i18n("Click to add a new Todo")); 314 setText(i18n("Click to add a new Todo"));
315} 315}
316 316
317void KOQuickTodo::focusInEvent(QFocusEvent *ev) 317void KOQuickTodo::focusInEvent(QFocusEvent *ev)
318{ 318{
319 if ( text()==i18n("Click to add a new Todo") ) 319 if ( text()==i18n("Click to add a new Todo") )
320 setText(""); 320 setText("");
321 QLineEdit::focusInEvent(ev); 321 QLineEdit::focusInEvent(ev);
322} 322}
323 323
324void KOQuickTodo::focusOutEvent(QFocusEvent *ev) 324void KOQuickTodo::focusOutEvent(QFocusEvent *ev)
325{ 325{
326 setText(i18n("Click to add a new Todo")); 326 setText(i18n("Click to add a new Todo"));
327 QLineEdit::focusOutEvent(ev); 327 QLineEdit::focusOutEvent(ev);
328} 328}
329 329
330///////////////////////////////////////////////////////////////////////////// 330/////////////////////////////////////////////////////////////////////////////
331 331
332KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) : 332KOTodoView::KOTodoView(Calendar *calendar,QWidget* parent,const char* name) :
333 KOrg::BaseView(calendar,parent,name) 333 KOrg::BaseView(calendar,parent,name)
334{ 334{
335 mNavigator = 0;
335 QBoxLayout *topLayout = new QVBoxLayout(this); 336 QBoxLayout *topLayout = new QVBoxLayout(this);
336 mName = QString ( name ); 337 mName = QString ( name );
337 mBlockUpdate = false; 338 mBlockUpdate = false;
338 mQuickAdd = new KOQuickTodo(this); 339 mQuickAdd = new KOQuickTodo(this);
339 topLayout->addWidget(mQuickAdd); 340 topLayout->addWidget(mQuickAdd);
340 341
341 if ( !KOPrefs::instance()->mEnableQuickTodo ) mQuickAdd->hide(); 342 if ( !KOPrefs::instance()->mEnableQuickTodo ) mQuickAdd->hide();
342 343
343 mTodoListView = new KOTodoListView(calendar,this, name ); 344 mTodoListView = new KOTodoListView(calendar,this, name );
344 topLayout->addWidget(mTodoListView); 345 topLayout->addWidget(mTodoListView);
345 //mTodoListView->header()->setMaximumHeight(30); 346 //mTodoListView->header()->setMaximumHeight(30);
346 mTodoListView->setRootIsDecorated(true); 347 mTodoListView->setRootIsDecorated(true);
347 mTodoListView->setAllColumnsShowFocus(true); 348 mTodoListView->setAllColumnsShowFocus(true);
348 349
349 mTodoListView->setShowSortIndicator(true); 350 mTodoListView->setShowSortIndicator(true);
350 351
351 mTodoListView->addColumn(i18n("Todo")); 352 mTodoListView->addColumn(i18n("Todo"));
352 mTodoListView->addColumn(i18n("Prio")); 353 mTodoListView->addColumn(i18n("Prio"));
353 mTodoListView->setColumnAlignment(1,AlignHCenter); 354 mTodoListView->setColumnAlignment(1,AlignHCenter);
354 mTodoListView->addColumn(i18n("Complete")); 355 mTodoListView->addColumn(i18n("Complete"));
355 mTodoListView->setColumnAlignment(2,AlignHCenter); 356 mTodoListView->setColumnAlignment(2,AlignCenter);
357
356 mTodoListView->addColumn(i18n("Due Date")); 358 mTodoListView->addColumn(i18n("Due Date"));
357 mTodoListView->setColumnAlignment(3,AlignLeft); 359 mTodoListView->setColumnAlignment(3,AlignLeft);
358 mTodoListView->addColumn(i18n("Due Time")); 360 mTodoListView->addColumn(i18n("Due Time"));
359 mTodoListView->setColumnAlignment(4,AlignHCenter); 361 mTodoListView->setColumnAlignment(4,AlignHCenter);
362
363 mTodoListView->addColumn(i18n("Start Date"));
364 mTodoListView->setColumnAlignment(5,AlignLeft);
365 mTodoListView->addColumn(i18n("Start Time"));
366 mTodoListView->setColumnAlignment(6,AlignHCenter);
367
360 mTodoListView->addColumn(i18n("Cancelled")); 368 mTodoListView->addColumn(i18n("Cancelled"));
361 mTodoListView->addColumn(i18n("Categories")); 369 mTodoListView->addColumn(i18n("Categories"));
362#if 0 370#if 0
363 mTodoListView->addColumn(i18n("Sort Id")); 371 mTodoListView->addColumn(i18n("Sort Id"));
364 mTodoListView->setColumnAlignment(4,AlignHCenter); 372 mTodoListView->setColumnAlignment(4,AlignHCenter);
365#endif 373#endif
366 374
367 mTodoListView->setMinimumHeight( 60 ); 375 mTodoListView->setMinimumHeight( 60 );
368 mTodoListView->setItemsRenameable( true ); 376 mTodoListView->setItemsRenameable( true );
369 mTodoListView->setRenameable( 0 ); 377 mTodoListView->setRenameable( 0 );
370 mTodoListView->setColumnWidth( 0, 120 ); 378 mTodoListView->setColumnWidth( 0, 120 );
371 mTodoListView->setColumnWidthMode(0, QListView::Manual); 379 mTodoListView->setColumnWidthMode(0, QListView::Manual);
372 mTodoListView->setColumnWidthMode(1, QListView::Manual); 380 mTodoListView->setColumnWidthMode(1, QListView::Manual);
373 mTodoListView->setColumnWidthMode(2, QListView::Manual); 381 mTodoListView->setColumnWidthMode(2, QListView::Manual);
374 mTodoListView->setColumnWidthMode(3, QListView::Manual); 382 mTodoListView->setColumnWidthMode(3, QListView::Manual);
375 mTodoListView->setColumnWidthMode(4, QListView::Manual); 383 mTodoListView->setColumnWidthMode(4, QListView::Manual);
376 mTodoListView->setColumnWidthMode(5, QListView::Manual); 384 mTodoListView->setColumnWidthMode(5, QListView::Manual);
377 mTodoListView->setColumnWidthMode(6, QListView::Manual); 385 mTodoListView->setColumnWidthMode(6, QListView::Manual);
378 mTodoListView->setColumnAlignment( 2, AlignCenter ); 386 mTodoListView->setColumnWidthMode(7, QListView::Manual);
379#if 0 387 mTodoListView->setColumnWidthMode(8, QListView::Manual);
380 mTodoListView->setColumnWidthMode(6, QListView::Manual); 388
381#endif
382 389
383 mPriorityPopupMenu = new QPopupMenu(this); 390 mPriorityPopupMenu = new QPopupMenu(this);
384 for (int i = 1; i <= 5; i++) { 391 for (int i = 1; i <= 5; i++) {
385 QString label = QString ("%1").arg (i); 392 QString label = QString ("%1").arg (i);
386 mPriority[mPriorityPopupMenu->insertItem (label)] = i; 393 mPriority[mPriorityPopupMenu->insertItem (label)] = i;
387 } 394 }
388 connect (mPriorityPopupMenu, SIGNAL(activated (int)), SLOT (setNewPriority(int))); 395 connect (mPriorityPopupMenu, SIGNAL(activated (int)), SLOT (setNewPriority(int)));
389 396
390 mPercentageCompletedPopupMenu = new QPopupMenu(this); 397 mPercentageCompletedPopupMenu = new QPopupMenu(this);
391 for (int i = 0; i <= 100; i+=20) { 398 for (int i = 0; i <= 100; i+=20) {
392 QString label = QString ("%1 %").arg (i); 399 QString label = QString ("%1 %").arg (i);
393 mPercentage[mPercentageCompletedPopupMenu->insertItem (label)] = i; 400 mPercentage[mPercentageCompletedPopupMenu->insertItem (label)] = i;
394 } 401 }
395 connect (mPercentageCompletedPopupMenu, SIGNAL (activated (int)), SLOT (setNewPercentage (int))); 402 connect (mPercentageCompletedPopupMenu, SIGNAL (activated (int)), SLOT (setNewPercentage (int)));
396 403
397 404
398 405
399 mItemPopupMenu = new QPopupMenu(this); 406 mItemPopupMenu = new QPopupMenu(this);
400 mItemPopupMenu->insertItem(i18n("Show..."), this, 407 mItemPopupMenu->insertItem(i18n("Show..."), this,
401 SLOT (showTodo())); 408 SLOT (showTodo()));
402 mItemPopupMenu->insertItem(i18n("Edit..."), this, 409 mItemPopupMenu->insertItem(i18n("Edit..."), this,
403 SLOT (editTodo())); 410 SLOT (editTodo()));
404 mItemPopupMenu->insertItem( i18n("Delete"), this, 411 mItemPopupMenu->insertItem( i18n("Delete"), this,
405 SLOT (deleteTodo())); 412 SLOT (deleteTodo()));
406 mItemPopupMenu->insertItem( i18n("Clone..."), this, 413 mItemPopupMenu->insertItem( i18n("Clone..."), this,
407 SLOT (cloneTodo())); 414 SLOT (cloneTodo()));
408 mItemPopupMenu->insertItem( i18n("Move..."), this, 415 mItemPopupMenu->insertItem( i18n("Move..."), this,
409 SLOT (moveTodo())); 416 SLOT (moveTodo()));
410 mItemPopupMenu->insertItem( i18n("Beam..."), this, 417 mItemPopupMenu->insertItem( i18n("Beam..."), this,
411 SLOT (beamTodo())); 418 SLOT (beamTodo()));
412 mItemPopupMenu->insertItem( i18n("Toggle Cancel"), this, 419 mItemPopupMenu->insertItem( i18n("Toggle Cancel"), this,
413 SLOT (cancelTodo())); 420 SLOT (cancelTodo()));
414 mItemPopupMenu->insertSeparator(); 421 mItemPopupMenu->insertSeparator();
415 422
416 mItemPopupMenu->insertItem( i18n("New Todo..."), this, 423 mItemPopupMenu->insertItem( i18n("New Todo..."), this,
417 SLOT (newTodo())); 424 SLOT (newTodo()));
418 mItemPopupMenu->insertItem(i18n("New Sub-Todo..."), this, 425 mItemPopupMenu->insertItem(i18n("New Sub-Todo..."), this,
419 SLOT (newSubTodo())); 426 SLOT (newSubTodo()));
420 mItemPopupMenu->insertItem(i18n("Unparent Todo"), this, 427 mItemPopupMenu->insertItem(i18n("Unparent Todo"), this,
421 SLOT (unparentTodo()),0,21); 428 SLOT (unparentTodo()),0,21);
422 mItemPopupMenu->insertItem(i18n("Reparent Todo"), this, 429 mItemPopupMenu->insertItem(i18n("Reparent Todo"), this,
423 SLOT (reparentTodo()),0,22); 430 SLOT (reparentTodo()),0,22);
424 mItemPopupMenu->insertSeparator(); 431 mItemPopupMenu->insertSeparator();
425 mItemPopupMenu->insertItem(i18n("Delete completed To-Dos","Purge Completed"), 432 mItemPopupMenu->insertItem(i18n("Delete completed To-Dos","Purge Completed"),
426 this, SLOT( purgeCompleted() ) ); 433 this, SLOT( purgeCompleted() ) );
427 mItemPopupMenu->insertItem(i18n("toggle completed To-Dos","Show Completed"), 434 mItemPopupMenu->insertItem(i18n("toggle completed To-Dos","Show Completed"),
428 this, SLOT( toggleCompleted() ),0, 33 ); 435 this, SLOT( toggleCompleted() ),0, 33 );
429 mItemPopupMenu->insertItem(i18n("toggle quick todo","Show Quick Todo"), 436 mItemPopupMenu->insertItem(i18n("toggle quick todo","Show Quick Todo"),
430 this, SLOT( toggleQuickTodo() ),0, 34 ); 437 this, SLOT( toggleQuickTodo() ),0, 34 );
438 mItemPopupMenu->insertItem(i18n("toggle running todo","Hide not Running"),
439 this, SLOT( toggleRunning() ),0, 35 );
431 440
432 mPopupMenu = new QPopupMenu(this); 441 mPopupMenu = new QPopupMenu(this);
433 mPopupMenu->insertItem(SmallIconSet("todo"), i18n("New Todo..."), this, 442 mPopupMenu->insertItem(SmallIconSet("todo"), i18n("New Todo..."), this,
434 SLOT (newTodo()),0,1); 443 SLOT (newTodo()),0,1);
435 mPopupMenu->insertItem(i18n("delete completed To-Dos","Purge Completed"), 444 mPopupMenu->insertItem(i18n("delete completed To-Dos","Purge Completed"),
436 this, SLOT(purgeCompleted()),0,2); 445 this, SLOT(purgeCompleted()),0,2);
437 mPopupMenu->insertItem(i18n("Show Completed"), 446 mPopupMenu->insertItem(i18n("Show Completed"),
438 this, SLOT( toggleCompleted() ),0,3 ); 447 this, SLOT( toggleCompleted() ),0,3 );
439 mPopupMenu->insertItem(i18n("toggle quick todo","Show Quick Todo"), 448 mPopupMenu->insertItem(i18n("toggle quick todo","Show Quick Todo"),
440 this, SLOT( toggleQuickTodo() ),0,4 ); 449 this, SLOT( toggleQuickTodo() ),0,4 );
450 mPopupMenu->insertItem(i18n("toggle running todo","Hide not Running"),
451 this, SLOT( toggleRunning() ),0,5 );
441 mDocPrefs = new DocPrefs( name ); 452 mDocPrefs = new DocPrefs( name );
442 453
443 mPopupMenu->setCheckable( true ); 454 mPopupMenu->setCheckable( true );
444 mItemPopupMenu->setCheckable( true ); 455 mItemPopupMenu->setCheckable( true );
456
457
458 mPopupMenu->setItemChecked( 3,KOPrefs::instance()->mShowCompletedTodo );
459 mItemPopupMenu->setItemChecked( 33 , KOPrefs::instance()->mShowCompletedTodo );
460
461 mPopupMenu->setItemChecked(4,KOPrefs::instance()->mEnableQuickTodo);
462 mItemPopupMenu->setItemChecked( 34 , KOPrefs::instance()->mEnableQuickTodo );
463
464 mPopupMenu->setItemChecked(5,KOPrefs::instance()->mHideNonStartedTodos);
465 mItemPopupMenu->setItemChecked( 35 , KOPrefs::instance()->mHideNonStartedTodos );
466
467
445 // Double clicking conflicts with opening/closing the subtree 468 // Double clicking conflicts with opening/closing the subtree
446 connect( mTodoListView, SIGNAL( doubleClicked( QListViewItem *) ), 469 connect( mTodoListView, SIGNAL( doubleClicked( QListViewItem *) ),
447 SLOT( editItem( QListViewItem *) ) ); 470 SLOT( editItem( QListViewItem *) ) );
448 /* 471 /*
449 connect( mTodoListView, SIGNAL( rightButtonClicked ( QListViewItem *, 472 connect( mTodoListView, SIGNAL( rightButtonClicked ( QListViewItem *,
450 const QPoint &,int ) ), 473 const QPoint &,int ) ),
451 SLOT( popupMenu( QListViewItem *, const QPoint & ,int) ) ); 474 SLOT( popupMenu( QListViewItem *, const QPoint & ,int) ) );
452 */ 475 */
453 connect( mTodoListView, SIGNAL( contextRequest ( QListViewItem *, 476 connect( mTodoListView, SIGNAL( contextRequest ( QListViewItem *,
454 const QPoint &,int ) ), 477 const QPoint &,int ) ),
455 SLOT( popupMenu( QListViewItem *, const QPoint & ,int) ) ); 478 SLOT( popupMenu( QListViewItem *, const QPoint & ,int) ) );
456 connect( mTodoListView, SIGNAL( clicked( QListViewItem * ) ), 479 connect( mTodoListView, SIGNAL( clicked( QListViewItem * ) ),
457 SLOT( itemClicked( QListViewItem * ) ) ); 480 SLOT( itemClicked( QListViewItem * ) ) );
458 connect( mTodoListView, SIGNAL( double_Clicked( QListViewItem * ) ), 481 connect( mTodoListView, SIGNAL( double_Clicked( QListViewItem * ) ),
459 SLOT( itemDoubleClicked( QListViewItem * ) ) ); 482 SLOT( itemDoubleClicked( QListViewItem * ) ) );
460 connect( mTodoListView, SIGNAL( todoDropped( Todo * ) ), 483 connect( mTodoListView, SIGNAL( todoDropped( Todo * ) ),
461 SLOT( updateView() ) ); 484 SLOT( updateView() ) );
462 connect( mTodoListView, SIGNAL( expanded( QListViewItem * ) ), 485 connect( mTodoListView, SIGNAL( expanded( QListViewItem * ) ),
463 SLOT( itemStateChanged( QListViewItem * ) ) ); 486 SLOT( itemStateChanged( QListViewItem * ) ) );
464 connect( mTodoListView, SIGNAL( collapsed( QListViewItem * ) ), 487 connect( mTodoListView, SIGNAL( collapsed( QListViewItem * ) ),
465 SLOT( itemStateChanged( QListViewItem * ) ) ); 488 SLOT( itemStateChanged( QListViewItem * ) ) );
466 489
467#if 0 490#if 0
468 connect(mTodoListView,SIGNAL(selectionChanged(QListViewItem *)), 491 connect(mTodoListView,SIGNAL(selectionChanged(QListViewItem *)),
469 SLOT(selectionChanged(QListViewItem *))); 492 SLOT(selectionChanged(QListViewItem *)));
470 connect(mTodoListView,SIGNAL(clicked(QListViewItem *)), 493 connect(mTodoListView,SIGNAL(clicked(QListViewItem *)),
471 SLOT(selectionChanged(QListViewItem *))); 494 SLOT(selectionChanged(QListViewItem *)));
472 connect(mTodoListView,SIGNAL(pressed(QListViewItem *)), 495 connect(mTodoListView,SIGNAL(pressed(QListViewItem *)),
473 SLOT(selectionChanged(QListViewItem *))); 496 SLOT(selectionChanged(QListViewItem *)));
474#endif 497#endif
475 connect( mTodoListView, SIGNAL(selectionChanged() ), 498 connect( mTodoListView, SIGNAL(selectionChanged() ),
476 SLOT( processSelectionChange() ) ); 499 SLOT( processSelectionChange() ) );
477 connect( mQuickAdd, SIGNAL( returnPressed () ), 500 connect( mQuickAdd, SIGNAL( returnPressed () ),
478 SLOT( addQuickTodo() ) ); 501 SLOT( addQuickTodo() ) );
479// if ( QApplication::desktop()->width() < 480 ) {
480// setNarrow();
481 // mTodoListView->setColumnWidth( 0, 100 );
482
483 // }
484 502
485} 503}
486 504
487KOTodoView::~KOTodoView() 505KOTodoView::~KOTodoView()
488{ 506{
489 delete mDocPrefs; 507 delete mDocPrefs;
490} 508}
491 509
492void KOTodoView::jumpToDate () 510void KOTodoView::jumpToDate ()
493{ 511{
494 // if (mActiveItem) { 512 // if (mActiveItem) {
495// mActiveItem->todo()); 513// mActiveItem->todo());
496// if ( mActiveItem->todo()->hasDueDate() ) 514// if ( mActiveItem->todo()->hasDueDate() )
497// emit mActiveItem->todo()jumpToTime( mTodo->dtDue().date() ); 515// emit mActiveItem->todo()jumpToTime( mTodo->dtDue().date() );
498} 516}
499 517
500void KOTodoView::setNarrow()
501{
502 //mTodoListView->setColumnWidth( 0, 120 );
503 mTodoListView->setColumnWidth( 1, 35 );
504 mTodoListView->setColumnWidth( 2, 40 );
505 mTodoListView->setColumnWidth( 3, 80 );
506 mTodoListView->setColumnWidth( 4, 40 );
507 mTodoListView->setColumnWidth( 5, 90 );
508
509}
510void KOTodoView::updateView() 518void KOTodoView::updateView()
511{ 519{
512 pendingSubtodo = 0; 520 pendingSubtodo = 0;
513 if ( mBlockUpdate ) { 521 if ( mBlockUpdate ) {
514 //qDebug("blocked "); 522 //qDebug("blocked ");
515 return; 523 return;
516 } 524 }
517 //qDebug("update "); 525 //qDebug("update ");
518// kdDebug() << "KOTodoView::updateView()" << endl; 526// kdDebug() << "KOTodoView::updateView()" << endl;
519 QFont fo = KOPrefs::instance()->mTodoViewFont; 527 QFont fo = KOPrefs::instance()->mTodoViewFont;
520 mTodoListView->clear(); 528 mTodoListView->clear();
521 if ( mName == "todolistsmall" ) { 529 if ( mName == "todolistsmall" ) {
522 if ( KOPrefs::instance()->mTodoViewUsesSmallFont ) { 530 if ( KOPrefs::instance()->mTodoViewUsesSmallFont ) {
523 int ps = fo.pointSize() -2; 531 int ps = fo.pointSize() -2;
524 if ( ps > 12 ) 532 if ( ps > 12 )
525 ps -= 2; 533 ps -= 2;
526 fo.setPointSize( ps ); 534 fo.setPointSize( ps );
527 } 535 }
528 } 536 }
529 537
530 mTodoListView->setFont( fo ); 538 mTodoListView->setFont( fo );
531 // QFontMetrics fm ( KOPrefs::instance()->mTodoViewFont ); 539 // QFontMetrics fm ( KOPrefs::instance()->mTodoViewFont );
532 //mTodoListView->header()->setMaximumHeight(fm.height()); 540 //mTodoListView->header()->setMaximumHeight(fm.height());
533 QPtrList<Todo> todoList = calendar()->todos(); 541 QPtrList<Todo> todoList = calendar()->todos();
534 542
535/* 543/*
536 kdDebug() << "KOTodoView::updateView(): Todo List:" << endl; 544 kdDebug() << "KOTodoView::updateView(): Todo List:" << endl;
537 Event *t; 545 Event *t;
538 for(t = todoList.first(); t; t = todoList.next()) { 546 for(t = todoList.first(); t; t = todoList.next()) {
539 kdDebug() << " " << t->getSummary() << endl; 547 kdDebug() << " " << t->getSummary() << endl;
540 548
541 if (t->getRelatedTo()) { 549 if (t->getRelatedTo()) {
542 kdDebug() << " (related to " << t->getRelatedTo()->getSummary() << ")" << endl; 550 kdDebug() << " (related to " << t->getRelatedTo()->getSummary() << ")" << endl;
543 } 551 }
544 552
545 QPtrList<Event> l = t->getRelations(); 553 QPtrList<Event> l = t->getRelations();
546 Event *c; 554 Event *c;
547 for(c=l.first();c;c=l.next()) { 555 for(c=l.first();c;c=l.next()) {
548 kdDebug() << " - relation: " << c->getSummary() << endl; 556 kdDebug() << " - relation: " << c->getSummary() << endl;
549 } 557 }
550 } 558 }
551*/ 559*/
552 560
553 // Put for each Event a KOTodoViewItem in the list view. Don't rely on a 561 // Put for each Event a KOTodoViewItem in the list view. Don't rely on a
554 // specific order of events. That means that we have to generate parent items 562 // specific order of events. That means that we have to generate parent items
555 // recursively for proper hierarchical display of Todos. 563 // recursively for proper hierarchical display of Todos.
556 mTodoMap.clear(); 564 mTodoMap.clear();
557 Todo *todo; 565 Todo *todo;
558 todo = todoList.first();// todo; todo = todoList.next()) { 566 todo = todoList.first();// todo; todo = todoList.next()) {
559 while ( todo ) { 567 while ( todo ) {
560 bool next = true; 568 bool next = true;
561 // qDebug("todo %s ", todo->summary().latin1()); 569 // qDebug("todo %s ", todo->summary().latin1());
562 Incidence *incidence = todo->relatedTo(); 570 Incidence *incidence = todo->relatedTo();
563 while ( incidence ) { 571 while ( incidence ) {
564 if ( incidence->type() == "Todo") { 572 if ( incidence->type() == "Todo") {
565 //qDebug("related %s ",incidence->summary().latin1() ); 573 //qDebug("related %s ",incidence->summary().latin1() );
566 if ( !(todoList.contains ( ((Todo* )incidence ) ) )) { 574 if ( !(todoList.contains ( ((Todo* )incidence ) ) )) {
567 //qDebug("related not found "); 575 //qDebug("related not found ");
568 todoList.remove( ); 576 todoList.remove( );
569 todo = todoList.current(); 577 todo = todoList.current();
570 next = false; 578 next = false;
571 incidence = 0; 579 incidence = 0;
572 580
573 } else { 581 } else {
574 //qDebug("related found "); 582 //qDebug("related found ");
575 incidence = incidence->relatedTo(); 583 incidence = incidence->relatedTo();
576 } 584 }
577 } else 585 } else
578 incidence = 0; 586 incidence = 0;
579 } 587 }
580 if ( next ) 588 if ( next )
581 todo = todoList.next(); 589 todo = todoList.next();
582 } 590 }
583// qDebug("again .... "); 591// qDebug("again .... ");
584// for(todo = todoList.first(); todo; todo = todoList.next()) { 592// for(todo = todoList.first(); todo; todo = todoList.next()) {
585 593
586// qDebug("yytodo %s ", todo->summary().latin1()); 594// qDebug("yytodo %s ", todo->summary().latin1());
587// } 595// }
588 //qDebug("for "); 596 //qDebug("for ");
589 for(todo = todoList.first(); todo; todo = todoList.next()) { 597 for(todo = todoList.first(); todo; todo = todoList.next()) {
590 if (!mTodoMap.contains(todo) && ( KOPrefs::instance()->mShowCompletedTodo || !todo->isCompleted() ) ) 598 if (!mTodoMap.contains(todo) && checkTodo( todo ) )
591 { 599 {
592 insertTodoItem(todo); 600 insertTodoItem(todo);
593 } 601 }
594 } 602 }
595 //qDebug("for end "); 603 //qDebug("for end ");
596 // Restore opened/closed state 604 // Restore opened/closed state
597 mTodoListView->blockSignals( true ); 605 mTodoListView->blockSignals( true );
598 if( mDocPrefs ) restoreItemState( mTodoListView->firstChild() ); 606 if( mDocPrefs ) restoreItemState( mTodoListView->firstChild() );
599 mTodoListView->blockSignals( false ); 607 mTodoListView->blockSignals( false );
600 mTodoListView->setFocus(); 608 mTodoListView->setFocus();
601 processSelectionChange(); 609 processSelectionChange();
602} 610}
603 611
612bool KOTodoView::checkTodo( Todo * todo )
613{
614
615 if ( !KOPrefs::instance()->mShowCompletedTodo && todo->isCompleted() )
616 return false;
617 if ( KOPrefs::instance()->mHideNonStartedTodos && mNavigator ) {
618 if ( todo->hasStartDate() )
619 if ( mNavigator->selectedDates().last() < todo->dtStart().date() )
620 return false;
621 if ( todo->hasDueDate() )
622 if ( mNavigator->selectedDates().first() > todo->dtDue().date() )
623 return false;
624 }
625 return true;
626}
627
604void KOTodoView::restoreItemState( QListViewItem *item ) 628void KOTodoView::restoreItemState( QListViewItem *item )
605{ 629{
606 pendingSubtodo = 0; 630 pendingSubtodo = 0;
607 while( item ) { 631 while( item ) {
608 KOTodoViewItem *todoItem = (KOTodoViewItem *)item; 632 KOTodoViewItem *todoItem = (KOTodoViewItem *)item;
609 todoItem->setOpen( mDocPrefs->readBoolEntry( todoItem->todo()->uid() ) ); 633 todoItem->setOpen( mDocPrefs->readBoolEntry( todoItem->todo()->uid() ) );
610 if( item->childCount() > 0 ) restoreItemState( item->firstChild() ); 634 if( item->childCount() > 0 ) restoreItemState( item->firstChild() );
611 item = item->nextSibling(); 635 item = item->nextSibling();
612 } 636 }
613} 637}
614 638
615 639
616QMap<Todo *,KOTodoViewItem *>::ConstIterator 640QMap<Todo *,KOTodoViewItem *>::ConstIterator
617 KOTodoView::insertTodoItem(Todo *todo) 641 KOTodoView::insertTodoItem(Todo *todo)
618{ 642{
643
619// kdDebug() << "KOTodoView::insertTodoItem(): " << todo->getSummary() << endl; 644// kdDebug() << "KOTodoView::insertTodoItem(): " << todo->getSummary() << endl;
620 // TODO: Check, if dynmaic cast is necessary 645 // TODO: Check, if dynmaic cast is necessary
621 646
622 pendingSubtodo = 0; 647 pendingSubtodo = 0;
623 Incidence *incidence = todo->relatedTo(); 648 Incidence *incidence = todo->relatedTo();
624 if (incidence && incidence->type() == "Todo") { 649 if (incidence && incidence->type() == "Todo") {
625 Todo *relatedTodo = static_cast<Todo *>(incidence); 650 Todo *relatedTodo = static_cast<Todo *>(incidence);
626 651
627// kdDebug() << " has Related" << endl; 652// kdDebug() << " has Related" << endl;
628 QMap<Todo *,KOTodoViewItem *>::ConstIterator itemIterator; 653 QMap<Todo *,KOTodoViewItem *>::ConstIterator itemIterator;
629 itemIterator = mTodoMap.find(relatedTodo); 654 itemIterator = mTodoMap.find(relatedTodo);
630 if (itemIterator == mTodoMap.end()) { 655 if (itemIterator == mTodoMap.end()) {
631// kdDebug() << " related not yet in list" << endl; 656// kdDebug() << " related not yet in list" << endl;
632 itemIterator = insertTodoItem (relatedTodo); 657 itemIterator = insertTodoItem (relatedTodo);
633 } 658 }
634 // isn't this pretty stupid? We give one Todo to the KOTodoViewItem 659 // isn't this pretty stupid? We give one Todo to the KOTodoViewItem
635 // and one into the map. Sure finding is more easy but why? -zecke 660 // and one into the map. Sure finding is more easy but why? -zecke
636 KOTodoViewItem *todoItem = new KOTodoViewItem(*itemIterator,todo,this); 661 KOTodoViewItem *todoItem = new KOTodoViewItem(*itemIterator,todo,this);
637 return mTodoMap.insert(todo,todoItem); 662 return mTodoMap.insert(todo,todoItem);
638 } else { 663 } else {
639// kdDebug() << " no Related" << endl; 664// kdDebug() << " no Related" << endl;
640 // see above -zecke 665 // see above -zecke
641 KOTodoViewItem *todoItem = new KOTodoViewItem(mTodoListView,todo,this); 666 KOTodoViewItem *todoItem = new KOTodoViewItem(mTodoListView,todo,this);
642 return mTodoMap.insert(todo,todoItem); 667 return mTodoMap.insert(todo,todoItem);
643 } 668 }
644} 669}
645 670
646 671
647void KOTodoView::updateConfig() 672void KOTodoView::updateConfig()
648{ 673{
649 updateView(); 674 updateView();
650 mTodoListView->repaintContents(); 675 mTodoListView->repaintContents();
651} 676}
652 677
653QPtrList<Incidence> KOTodoView::selectedIncidences() 678QPtrList<Incidence> KOTodoView::selectedIncidences()
654{ 679{
655 QPtrList<Incidence> selected; 680 QPtrList<Incidence> selected;
656 681
657 KOTodoViewItem *item = (KOTodoViewItem *)(mTodoListView->selectedItem()); 682 KOTodoViewItem *item = (KOTodoViewItem *)(mTodoListView->selectedItem());
658// if (!item) item = mActiveItem; 683// if (!item) item = mActiveItem;
659 if (item) selected.append(item->todo()); 684 if (item) selected.append(item->todo());
660 685
661 return selected; 686 return selected;
662} 687}
663 688
664QPtrList<Todo> KOTodoView::selectedTodos() 689QPtrList<Todo> KOTodoView::selectedTodos()
665{ 690{
666 QPtrList<Todo> selected; 691 QPtrList<Todo> selected;
667 692
668 KOTodoViewItem *item = (KOTodoViewItem *)(mTodoListView->selectedItem()); 693 KOTodoViewItem *item = (KOTodoViewItem *)(mTodoListView->selectedItem());
669// if (!item) item = mActiveItem; 694// if (!item) item = mActiveItem;
670 if (item) selected.append(item->todo()); 695 if (item) selected.append(item->todo());
671 696
672 return selected; 697 return selected;
673} 698}
674 699
675void KOTodoView::changeEventDisplay(Event *, int) 700void KOTodoView::changeEventDisplay(Event *, int)
676{ 701{
677 updateView(); 702 updateView();
678} 703}
679 704
680void KOTodoView::showDates(const QDate &, const QDate &) 705void KOTodoView::showDates(const QDate &, const QDate &)
681{ 706{
682} 707}
683 708
684void KOTodoView::showEvents(QPtrList<Event>) 709void KOTodoView::showEvents(QPtrList<Event>)
685{ 710{
686 kdDebug() << "KOTodoView::selectEvents(): not yet implemented" << endl; 711 kdDebug() << "KOTodoView::selectEvents(): not yet implemented" << endl;
687} 712}
688 713
689void KOTodoView::printPreview(CalPrinter *calPrinter, const QDate &fd, 714void KOTodoView::printPreview(CalPrinter *calPrinter, const QDate &fd,
690 const QDate &td) 715 const QDate &td)
691{ 716{
692#ifndef KORG_NOPRINTER 717#ifndef KORG_NOPRINTER
693 calPrinter->preview(CalPrinter::Todolist, fd, td); 718 calPrinter->preview(CalPrinter::Todolist, fd, td);
694#endif 719#endif
695} 720}
696 721
697void KOTodoView::editItem(QListViewItem *item ) 722void KOTodoView::editItem(QListViewItem *item )
698{ 723{
699 // qDebug("editItem(QListViewItem *item ) "); 724 // qDebug("editItem(QListViewItem *item ) ");
700 emit editTodoSignal(((KOTodoViewItem *)item)->todo()); 725 emit editTodoSignal(((KOTodoViewItem *)item)->todo());
701} 726}
702 727
703void KOTodoView::showItem(QListViewItem *item,const QPoint &,int) 728void KOTodoView::showItem(QListViewItem *item,const QPoint &,int)
704{ 729{
705 emit showTodoSignal(((KOTodoViewItem *)item)->todo()); 730 emit showTodoSignal(((KOTodoViewItem *)item)->todo());
706} 731}
707 732
708void KOTodoView::popupMenu(QListViewItem *item,const QPoint &,int column) 733void KOTodoView::popupMenu(QListViewItem *item,const QPoint &,int column)
709{ 734{
710 pendingSubtodo = 0; 735 pendingSubtodo = 0;
711 mActiveItem = (KOTodoViewItem *)item; 736 mActiveItem = (KOTodoViewItem *)item;
712 if (item) { 737 if (item) {
713 switch (column){ 738 switch (column){
714 case 1: 739 case 1:
715 mPriorityPopupMenu->popup(QCursor::pos ()); break; 740 mPriorityPopupMenu->popup(QCursor::pos ()); break;
716 case 2: 741 case 2:
717 mPercentageCompletedPopupMenu->popup(QCursor::pos ()); break; 742 mPercentageCompletedPopupMenu->popup(QCursor::pos ()); break;
718 case 3: 743 case 3:
719 moveTodo(); 744 moveTodo();
720 break; 745 break;
721 case 6: 746 case 8:
722 getCategoryPopupMenu((KOTodoViewItem *)item)->popup(QCursor::pos ()); break; 747 getCategoryPopupMenu((KOTodoViewItem *)item)->popup(QCursor::pos ()); break;
723 default: 748 default:
724 mItemPopupMenu->popup(QCursor::pos()); 749 mItemPopupMenu->popup(QCursor::pos());
725 } 750 }
726 } else mPopupMenu->popup(QCursor::pos()); 751 } else mPopupMenu->popup(QCursor::pos());
727} 752}
728void KOTodoView::newTodo() 753void KOTodoView::newTodo()
729{ 754{
730 emit newTodoSignal(); 755 emit newTodoSignal();
731} 756}
732 757
733void KOTodoView::newSubTodo() 758void KOTodoView::newSubTodo()
734{ 759{
735 if (mActiveItem) { 760 if (mActiveItem) {
736 emit newSubTodoSignal(mActiveItem->todo()); 761 emit newSubTodoSignal(mActiveItem->todo());
737 } 762 }
738} 763}
739void KOTodoView::unparentTodo() 764void KOTodoView::unparentTodo()
740{ 765{
741 if (mActiveItem) { 766 if (mActiveItem) {
742 emit unparentTodoSignal(mActiveItem->todo()); 767 emit unparentTodoSignal(mActiveItem->todo());
743 } 768 }
744} 769}
745 770
746void KOTodoView::reparentTodo() 771void KOTodoView::reparentTodo()
747{ 772{
748 if (mActiveItem) { 773 if (mActiveItem) {
749 qDebug("KOTodoView::reparentTodo() "); 774 qDebug("KOTodoView::reparentTodo() ");
750 topLevelWidget()->setCaption(i18n("Click on new parent item")); 775 topLevelWidget()->setCaption(i18n("Click on new parent item"));
751 pendingSubtodo = mActiveItem; 776 pendingSubtodo = mActiveItem;
752 } 777 }
753} 778}
754void KOTodoView::editTodo() 779void KOTodoView::editTodo()
755{ 780{
756 if (mActiveItem) { 781 if (mActiveItem) {
757 emit editTodoSignal(mActiveItem->todo()); 782 emit editTodoSignal(mActiveItem->todo());
758 } 783 }
759} 784}
760void KOTodoView::cloneTodo() 785void KOTodoView::cloneTodo()
761{ 786{
762 if (mActiveItem) { 787 if (mActiveItem) {
763 emit cloneTodoSignal((Incidence*)mActiveItem->todo()); 788 emit cloneTodoSignal((Incidence*)mActiveItem->todo());
764 } 789 }
765} 790}
766void KOTodoView::cancelTodo() 791void KOTodoView::cancelTodo()
767{ 792{
768 if (mActiveItem) { 793 if (mActiveItem) {
769 emit cancelTodoSignal((Incidence*)mActiveItem->todo()); 794 emit cancelTodoSignal((Incidence*)mActiveItem->todo());
770 } 795 }
771} 796}
772void KOTodoView::moveTodo() 797void KOTodoView::moveTodo()
773{ 798{
774 if (mActiveItem) { 799 if (mActiveItem) {
775 emit moveTodoSignal((Incidence*)mActiveItem->todo()); 800 emit moveTodoSignal((Incidence*)mActiveItem->todo());
776 } 801 }
777} 802}
778void KOTodoView::beamTodo() 803void KOTodoView::beamTodo()
779{ 804{
780 if (mActiveItem) { 805 if (mActiveItem) {
781 emit beamTodoSignal((Incidence*)mActiveItem->todo()); 806 emit beamTodoSignal((Incidence*)mActiveItem->todo());
782 } 807 }
783} 808}
784 809
785 810
786void KOTodoView::showTodo() 811void KOTodoView::showTodo()
787{ 812{
788 if (mActiveItem) { 813 if (mActiveItem) {
789 emit showTodoSignal(mActiveItem->todo()); 814 emit showTodoSignal(mActiveItem->todo());
790 } 815 }
791} 816}
792 817
793void KOTodoView::deleteTodo() 818void KOTodoView::deleteTodo()
794{ 819{
795 if (mActiveItem) { 820 if (mActiveItem) {
796 if (mActiveItem->childCount()) { 821 if (mActiveItem->childCount()) {
797 KMessageBox::sorry(this,i18n("Cannot delete To-Do which has children."), 822 KMessageBox::sorry(this,i18n("Cannot delete To-Do which has children."),
798 i18n("Delete To-Do")); 823 i18n("Delete To-Do"));
799 } else { 824 } else {
800 emit deleteTodoSignal(mActiveItem->todo()); 825 emit deleteTodoSignal(mActiveItem->todo());
801 } 826 }
802 } 827 }
803} 828}
804 829
805void KOTodoView::setNewPriority(int index) 830void KOTodoView::setNewPriority(int index)
806{ 831{
807 if (mActiveItem && !mActiveItem->todo()->isReadOnly ()) { 832 if (mActiveItem && !mActiveItem->todo()->isReadOnly ()) {
808 mActiveItem->todo()->setPriority(mPriority[index]); 833 mActiveItem->todo()->setPriority(mPriority[index]);
809 mActiveItem->construct(); 834 mActiveItem->construct();
810 todoModified (mActiveItem->todo(), KOGlobals::PRIORITY_MODIFIED); 835 todoModified (mActiveItem->todo(), KOGlobals::PRIORITY_MODIFIED);
811 mActiveItem->todo()->setRevision( mActiveItem->todo()->revision()+1 ); 836 mActiveItem->todo()->setRevision( mActiveItem->todo()->revision()+1 );
812 } 837 }
813} 838}
814 839
815void KOTodoView::setNewPercentage(int index) 840void KOTodoView::setNewPercentage(int index)
816{ 841{
817 if (mActiveItem && !mActiveItem->todo()->isReadOnly ()) { 842 if (mActiveItem && !mActiveItem->todo()->isReadOnly ()) {
@@ -902,192 +927,201 @@ void KOTodoView::itemClicked(QListViewItem *item)
902 topLevelWidget()->setCaption(i18n("Recursive reparenting not possible!")); 927 topLevelWidget()->setCaption(i18n("Recursive reparenting not possible!"));
903 qDebug("Recursive reparenting not possible "); 928 qDebug("Recursive reparenting not possible ");
904 pendingSubtodo = 0; 929 pendingSubtodo = 0;
905 } else { 930 } else {
906 Todo* newParent = todoItem->todo(); 931 Todo* newParent = todoItem->todo();
907 Todo* newSub = pendingSubtodo->todo(); 932 Todo* newSub = pendingSubtodo->todo();
908 pendingSubtodo = 0; 933 pendingSubtodo = 0;
909 emit reparentTodoSignal( newParent,newSub ); 934 emit reparentTodoSignal( newParent,newSub );
910 return; 935 return;
911 } 936 }
912 } 937 }
913 int completed = todoItem->todo()->isCompleted(); // Completed or not? 938 int completed = todoItem->todo()->isCompleted(); // Completed or not?
914 939
915 if (todoItem->isOn()) { 940 if (todoItem->isOn()) {
916 if (!completed) { 941 if (!completed) {
917 todoItem->todo()->setCompleted(QDateTime::currentDateTime()); 942 todoItem->todo()->setCompleted(QDateTime::currentDateTime());
918 } 943 }
919 } else { 944 } else {
920 if (completed) { 945 if (completed) {
921 todoItem->todo()->setCompleted(false); 946 todoItem->todo()->setCompleted(false);
922 } 947 }
923 } 948 }
924} 949}
925 950
926void KOTodoView::setDocumentId( const QString &id ) 951void KOTodoView::setDocumentId( const QString &id )
927{ 952{
928 kdDebug() << "KOTodoView::setDocumentId()" << endl; 953 kdDebug() << "KOTodoView::setDocumentId()" << endl;
929 954
930 mDocPrefs->setDoc( id ); 955 mDocPrefs->setDoc( id );
931} 956}
932 957
933void KOTodoView::itemStateChanged( QListViewItem *item ) 958void KOTodoView::itemStateChanged( QListViewItem *item )
934{ 959{
935 if (!item) return; 960 if (!item) return;
936 961
937 KOTodoViewItem *todoItem = (KOTodoViewItem *)item; 962 KOTodoViewItem *todoItem = (KOTodoViewItem *)item;
938 963
939// kdDebug() << "KOTodoView::itemStateChanged(): " << todoItem->todo()->summary() << endl; 964// kdDebug() << "KOTodoView::itemStateChanged(): " << todoItem->todo()->summary() << endl;
940 965
941 if( mDocPrefs ) mDocPrefs->writeEntry( todoItem->todo()->uid(), todoItem->isOpen() ); 966 if( mDocPrefs ) mDocPrefs->writeEntry( todoItem->todo()->uid(), todoItem->isOpen() );
942} 967}
943 968
944void KOTodoView::saveLayout(KConfig *config, const QString &group) const 969void KOTodoView::saveLayout(KConfig *config, const QString &group) const
945{ 970{
946 mTodoListView->saveLayout(config,group); 971 mTodoListView->saveLayout(config,group);
947} 972}
948 973
949void KOTodoView::restoreLayout(KConfig *config, const QString &group) 974void KOTodoView::restoreLayout(KConfig *config, const QString &group)
950{ 975{
951 mTodoListView->restoreLayout(config,group); 976 mTodoListView->restoreLayout(config,group);
952} 977}
953 978
954void KOTodoView::processSelectionChange() 979void KOTodoView::processSelectionChange()
955{ 980{
956// kdDebug() << "KOTodoView::processSelectionChange()" << endl; 981// kdDebug() << "KOTodoView::processSelectionChange()" << endl;
957 982
958 KOTodoViewItem *item = 983 KOTodoViewItem *item =
959 static_cast<KOTodoViewItem *>( mTodoListView->selectedItem() ); 984 static_cast<KOTodoViewItem *>( mTodoListView->selectedItem() );
960 985
961 if ( !item ) { 986 if ( !item ) {
962 emit incidenceSelected( 0 ); 987 emit incidenceSelected( 0 );
963 } else { 988 } else {
964 emit incidenceSelected( item->todo() ); 989 emit incidenceSelected( item->todo() );
965 } 990 }
966} 991}
967 992
968void KOTodoView::modified(bool b) 993void KOTodoView::modified(bool b)
969{ 994{
970 emit isModified(b); 995 emit isModified(b);
971} 996}
972void KOTodoView::setTodoModified( Todo* todo ) 997void KOTodoView::setTodoModified( Todo* todo )
973{ 998{
974 todoModified( todo, KOGlobals::UNKNOWN_MODIFIED ); 999 todoModified( todo, KOGlobals::UNKNOWN_MODIFIED );
975} 1000}
976void KOTodoView::clearSelection() 1001void KOTodoView::clearSelection()
977{ 1002{
978 mTodoListView->selectAll( false ); 1003 mTodoListView->selectAll( false );
979} 1004}
980 1005
981void KOTodoView::purgeCompleted() 1006void KOTodoView::purgeCompleted()
982{ 1007{
983 emit purgeCompletedSignal(); 1008 emit purgeCompletedSignal();
984} 1009}
985void KOTodoView::toggleQuickTodo() 1010void KOTodoView::toggleQuickTodo()
986{ 1011{
987 if ( mQuickAdd->isVisible() ) { 1012 if ( mQuickAdd->isVisible() ) {
988 mQuickAdd->hide(); 1013 mQuickAdd->hide();
989 KOPrefs::instance()->mEnableQuickTodo = false; 1014 KOPrefs::instance()->mEnableQuickTodo = false;
990 } 1015 }
991 else { 1016 else {
992 mQuickAdd->show(); 1017 mQuickAdd->show();
993 KOPrefs::instance()->mEnableQuickTodo = true; 1018 KOPrefs::instance()->mEnableQuickTodo = true;
994 } 1019 }
995 mPopupMenu->setItemChecked(4,KOPrefs::instance()->mEnableQuickTodo); 1020 mPopupMenu->setItemChecked(4,KOPrefs::instance()->mEnableQuickTodo);
996 mItemPopupMenu->setItemChecked( 34 , KOPrefs::instance()->mEnableQuickTodo ); 1021 mItemPopupMenu->setItemChecked( 34 , KOPrefs::instance()->mEnableQuickTodo );
997} 1022}
1023
1024void KOTodoView::toggleRunning()
1025{
1026 KOPrefs::instance()->mHideNonStartedTodos = !KOPrefs::instance()->mHideNonStartedTodos;
1027 mPopupMenu->setItemChecked(5,KOPrefs::instance()->mHideNonStartedTodos);
1028 mItemPopupMenu->setItemChecked( 35 , KOPrefs::instance()->mHideNonStartedTodos );
1029 updateView();
1030}
1031
998void KOTodoView::toggleCompleted() 1032void KOTodoView::toggleCompleted()
999{ 1033{
1000 KOPrefs::instance()->mShowCompletedTodo = !KOPrefs::instance()->mShowCompletedTodo; 1034 KOPrefs::instance()->mShowCompletedTodo = !KOPrefs::instance()->mShowCompletedTodo;
1001 mPopupMenu->setItemChecked( 3,KOPrefs::instance()->mShowCompletedTodo ); 1035 mPopupMenu->setItemChecked( 3,KOPrefs::instance()->mShowCompletedTodo );
1002 mItemPopupMenu->setItemChecked( 33 , KOPrefs::instance()->mShowCompletedTodo ); 1036 mItemPopupMenu->setItemChecked( 33 , KOPrefs::instance()->mShowCompletedTodo );
1003 updateView(); 1037 updateView();
1004} 1038}
1005 1039
1006void KOTodoView::addQuickTodo() 1040void KOTodoView::addQuickTodo()
1007{ 1041{
1008 Todo *todo = new Todo(); 1042 Todo *todo = new Todo();
1009 todo->setSummary(mQuickAdd->text()); 1043 todo->setSummary(mQuickAdd->text());
1010 todo->setOrganizer(KOPrefs::instance()->email()); 1044 todo->setOrganizer(KOPrefs::instance()->email());
1011 CalFilter * cf = mCalendar->filter(); 1045 CalFilter * cf = mCalendar->filter();
1012 if ( cf ) { 1046 if ( cf ) {
1013 if ( cf->isEnabled()&& cf->showCategories()) { 1047 if ( cf->isEnabled()&& cf->showCategories()) {
1014 todo->setCategories(cf->categoryList()); 1048 todo->setCategories(cf->categoryList());
1015 } 1049 }
1016 if ( cf->isEnabled() ) 1050 if ( cf->isEnabled() )
1017 todo->setSecrecy( cf->getSecrecy()); 1051 todo->setSecrecy( cf->getSecrecy());
1018 } 1052 }
1019 mCalendar->addTodo(todo); 1053 mCalendar->addTodo(todo);
1020 mQuickAdd->setText(""); 1054 mQuickAdd->setText("");
1021 todoModified (todo, KOGlobals::EVENTADDED ); 1055 todoModified (todo, KOGlobals::EVENTADDED );
1022 updateView(); 1056 updateView();
1023} 1057}
1024void KOTodoView::keyPressEvent ( QKeyEvent * e ) 1058void KOTodoView::keyPressEvent ( QKeyEvent * e )
1025{ 1059{
1026 // e->ignore(); 1060 // e->ignore();
1027 //return; 1061 //return;
1028 //qDebug("KOTodoView::keyPressEvent "); 1062 //qDebug("KOTodoView::keyPressEvent ");
1029 switch ( e->key() ) { 1063 switch ( e->key() ) {
1030 case Qt::Key_Down: 1064 case Qt::Key_Down:
1031 case Qt::Key_Up: 1065 case Qt::Key_Up:
1032 QWidget::keyPressEvent ( e ); 1066 QWidget::keyPressEvent ( e );
1033 break; 1067 break;
1034 1068
1035 case Qt::Key_Q: 1069 case Qt::Key_Q:
1036 toggleQuickTodo(); 1070 toggleQuickTodo();
1037 break; 1071 break;
1038 case Qt::Key_U: 1072 case Qt::Key_U:
1039 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) { 1073 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) {
1040 mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem(); 1074 mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem();
1041 unparentTodo(); 1075 unparentTodo();
1042 e->accept(); 1076 e->accept();
1043 } else 1077 } else
1044 e->ignore(); 1078 e->ignore();
1045 break; 1079 break;
1046 case Qt::Key_S: 1080 case Qt::Key_S:
1047 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) { 1081 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) {
1048 mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem(); 1082 mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem();
1049 reparentTodo(); 1083 reparentTodo();
1050 e->accept(); 1084 e->accept();
1051 } else 1085 } else
1052 e->ignore(); 1086 e->ignore();
1053 break; 1087 break;
1054 case Qt::Key_P: 1088 case Qt::Key_P:
1055 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) { 1089 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) {
1056 mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem(); 1090 mActiveItem = (KOTodoViewItem*)mTodoListView->currentItem();
1057 if ( pendingSubtodo ) 1091 if ( pendingSubtodo )
1058 itemClicked(mActiveItem); 1092 itemClicked(mActiveItem);
1059 e->accept(); 1093 e->accept();
1060 } else 1094 } else
1061 e->ignore(); 1095 e->ignore();
1062 break; 1096 break;
1063 case Qt::Key_Escape: 1097 case Qt::Key_Escape:
1064 if ( pendingSubtodo ) { 1098 if ( pendingSubtodo ) {
1065 itemClicked(0); 1099 itemClicked(0);
1066 e->accept(); 1100 e->accept();
1067 } else 1101 } else
1068 e->ignore(); 1102 e->ignore();
1069 break; 1103 break;
1070 default: 1104 default:
1071 e->ignore(); 1105 e->ignore();
1072 } 1106 }
1073 1107
1074 if ( true ) { 1108 if ( true ) {
1075 if ( e->key() == Qt::Key_I ) { 1109 if ( e->key() == Qt::Key_I ) {
1076 KOTodoViewItem*cn = (KOTodoViewItem*)mTodoListView->currentItem(); 1110 KOTodoViewItem*cn = (KOTodoViewItem*)mTodoListView->currentItem();
1077 if ( cn ) { 1111 if ( cn ) {
1078 mActiveItem = cn; 1112 mActiveItem = cn;
1079 KOTodoViewItem* ci = (KOTodoViewItem*)( cn ); 1113 KOTodoViewItem* ci = (KOTodoViewItem*)( cn );
1080 if ( ci ){ 1114 if ( ci ){
1081 showTodo(); 1115 showTodo();
1082 cn = (KOTodoViewItem*)cn->itemBelow(); 1116 cn = (KOTodoViewItem*)cn->itemBelow();
1083 if ( cn ) { 1117 if ( cn ) {
1084 mTodoListView->setCurrentItem ( cn ); 1118 mTodoListView->setCurrentItem ( cn );
1085 mTodoListView->ensureItemVisible ( cn ); 1119 mTodoListView->ensureItemVisible ( cn );
1086 } 1120 }
1087 1121
1088 } 1122 }
1089 } 1123 }
1090 e->accept(); 1124 e->accept();
1091 1125
1092 } 1126 }
1093 1127
diff --git a/korganizer/kotodoview.h b/korganizer/kotodoview.h
index 0c08677..5ca0362 100644
--- a/korganizer/kotodoview.h
+++ b/korganizer/kotodoview.h
@@ -1,234 +1,239 @@
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 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 KOTODOVIEW_H 23#ifndef KOTODOVIEW_H
24#define KOTODOVIEW_H 24#define KOTODOVIEW_H
25 25
26#include <qfont.h> 26#include <qfont.h>
27#include <qfontmetrics.h> 27#include <qfontmetrics.h>
28#include <qlineedit.h> 28#include <qlineedit.h>
29#include <qptrlist.h> 29#include <qptrlist.h>
30#include <qstrlist.h> 30#include <qstrlist.h>
31#include <qlistbox.h> 31#include <qlistbox.h>
32#include <qpopupmenu.h> 32#include <qpopupmenu.h>
33#include <qlabel.h> 33#include <qlabel.h>
34#include <qmap.h> 34#include <qmap.h>
35#include <qlistview.h> 35#include <qlistview.h>
36#include <klistview.h> 36#include <klistview.h>
37 37
38#include <libkcal/calendar.h> 38#include <libkcal/calendar.h>
39#include <libkcal/todo.h> 39#include <libkcal/todo.h>
40 40
41#include <korganizer/baseview.h> 41#include <korganizer/baseview.h>
42 42
43#include "kotodoviewitem.h" 43#include "kotodoviewitem.h"
44#include "koprefs.h" 44#include "koprefs.h"
45#include "koglobals.h" 45#include "koglobals.h"
46#include "datenavigator.h"
46 47
47class QDragEnterEvent; 48class QDragEnterEvent;
48class QDragMoveEvent; 49class QDragMoveEvent;
49class QDragLeaveEvent; 50class QDragLeaveEvent;
50class QDropEvent; 51class QDropEvent;
51 52
52class DocPrefs; 53class DocPrefs;
53 54
54class KOTodoListView : public KListView 55class KOTodoListView : public KListView
55{ 56{
56 Q_OBJECT 57 Q_OBJECT
57 public: 58 public:
58 KOTodoListView(Calendar *,QWidget *parent=0,const char *name=0); 59 KOTodoListView(Calendar *,QWidget *parent=0,const char *name=0);
59 virtual ~KOTodoListView() {} 60 virtual ~KOTodoListView() {}
60 61
61 signals: 62 signals:
62 void todoDropped(Todo *); 63 void todoDropped(Todo *);
63 void double_Clicked(QListViewItem *item); 64 void double_Clicked(QListViewItem *item);
64 65
65 protected: 66 protected:
66 void contentsDragEnterEvent(QDragEnterEvent *); 67 void contentsDragEnterEvent(QDragEnterEvent *);
67 void contentsDragMoveEvent(QDragMoveEvent *); 68 void contentsDragMoveEvent(QDragMoveEvent *);
68 void contentsDragLeaveEvent(QDragLeaveEvent *); 69 void contentsDragLeaveEvent(QDragLeaveEvent *);
69 void contentsDropEvent(QDropEvent *); 70 void contentsDropEvent(QDropEvent *);
70 71
71 void contentsMousePressEvent(QMouseEvent *); 72 void contentsMousePressEvent(QMouseEvent *);
72 void contentsMouseMoveEvent(QMouseEvent *); 73 void contentsMouseMoveEvent(QMouseEvent *);
73 void contentsMouseReleaseEvent(QMouseEvent *); 74 void contentsMouseReleaseEvent(QMouseEvent *);
74 void contentsMouseDoubleClickEvent(QMouseEvent *); 75 void contentsMouseDoubleClickEvent(QMouseEvent *);
75 76
76 private: 77 private:
77 QString mName; 78 QString mName;
78 Calendar *mCalendar; 79 Calendar *mCalendar;
79 QPoint mPressPos; 80 QPoint mPressPos;
80 bool mMousePressed; 81 bool mMousePressed;
81 QListViewItem *mOldCurrent; 82 QListViewItem *mOldCurrent;
82 void keyPressEvent ( QKeyEvent * ) ; 83 void keyPressEvent ( QKeyEvent * ) ;
83}; 84};
84 85
85 86
86/** 87/**
87 This is the line-edit on top of the todoview for fast addition of new todos 88 This is the line-edit on top of the todoview for fast addition of new todos
88*/ 89*/
89class KOQuickTodo : public QLineEdit 90class KOQuickTodo : public QLineEdit
90{ 91{
91 public: 92 public:
92 KOQuickTodo(QWidget *parent=0); 93 KOQuickTodo(QWidget *parent=0);
93 protected: 94 protected:
94 void focusInEvent(QFocusEvent *ev); 95 void focusInEvent(QFocusEvent *ev);
95 void focusOutEvent(QFocusEvent *ev); 96 void focusOutEvent(QFocusEvent *ev);
96}; 97};
97 98
98 99
99/** 100/**
100 This class provides a multi-column list view of todo events. 101 This class provides a multi-column list view of todo events.
101 102
102 @short multi-column list view of todo events. 103 @short multi-column list view of todo events.
103 @author Cornelius Schumacher <schumacher@kde.org> 104 @author Cornelius Schumacher <schumacher@kde.org>
104*/ 105*/
105class KOTodoView : public KOrg::BaseView 106class KOTodoView : public KOrg::BaseView
106{ 107{
107 Q_OBJECT 108 Q_OBJECT
108 public: 109 public:
109 KOTodoView(Calendar *, QWidget* parent=0, const char* name=0 ); 110 KOTodoView(Calendar *, QWidget* parent=0, const char* name=0 );
110 ~KOTodoView(); 111 ~KOTodoView();
111 112
112 QPtrList<Incidence> selectedIncidences(); 113 QPtrList<Incidence> selectedIncidences();
113 QPtrList<Todo> selectedTodos(); 114 QPtrList<Todo> selectedTodos();
114 115
115 DateList selectedDates() 116 DateList selectedDates()
116 {DateList q; 117 {DateList q;
117 return q;} 118 return q;}
118 119
119 /** Return number of shown dates. TodoView does not show dates, */ 120 /** Return number of shown dates. TodoView does not show dates, */
120 int currentDateCount() { return 0; } 121 int currentDateCount() { return 0; }
121 void setNarrow();
122 122
123 void printPreview(CalPrinter *calPrinter, const QDate &fd, const QDate &td); 123 void printPreview(CalPrinter *calPrinter, const QDate &fd, const QDate &td);
124 124
125 void setDocumentId( const QString & ); 125 void setDocumentId( const QString & );
126 126
127 void saveLayout(KConfig *config, const QString &group) const; 127 void saveLayout(KConfig *config, const QString &group) const;
128 void restoreLayout(KConfig *config, const QString &group); 128 void restoreLayout(KConfig *config, const QString &group);
129 /** Create a popup menu to set categories */ 129 /** Create a popup menu to set categories */
130 QPopupMenu *getCategoryPopupMenu (KOTodoViewItem *todoItem); 130 QPopupMenu *getCategoryPopupMenu (KOTodoViewItem *todoItem);
131 void setNavigator( DateNavigator* nav ) {mNavigator = nav;}
131 132
132 public slots: 133 public slots:
133 void updateView(); 134 void updateView();
134 void updateConfig(); 135 void updateConfig();
135 136
136 void changeEventDisplay(Event *, int); 137 void changeEventDisplay(Event *, int);
137 138
138 void showDates(const QDate &start, const QDate &end); 139 void showDates(const QDate &start, const QDate &end);
139 void showEvents(QPtrList<Event> eventList); 140 void showEvents(QPtrList<Event> eventList);
140 141
141 void clearSelection(); 142 void clearSelection();
142 void jumpToDate (); 143 void jumpToDate ();
143 144
144 void editItem(QListViewItem *item); 145 void editItem(QListViewItem *item);
145 void showItem(QListViewItem *item,const QPoint &,int); 146 void showItem(QListViewItem *item,const QPoint &,int);
146 void popupMenu(QListViewItem *item,const QPoint &,int); 147 void popupMenu(QListViewItem *item,const QPoint &,int);
147 void newTodo(); 148 void newTodo();
148 void newSubTodo(); 149 void newSubTodo();
149 void unparentTodo(); 150 void unparentTodo();
150 void reparentTodo(); 151 void reparentTodo();
151 void showTodo(); 152 void showTodo();
152 void editTodo(); 153 void editTodo();
153 void cloneTodo(); 154 void cloneTodo();
154 void cancelTodo(); 155 void cancelTodo();
155 void moveTodo(); 156 void moveTodo();
156 void beamTodo(); 157 void beamTodo();
157 void deleteTodo(); 158 void deleteTodo();
158 159
159 void setNewPriority(int); 160 void setNewPriority(int);
160 void setNewPercentage(int); 161 void setNewPercentage(int);
161 void changedCategories(int); 162 void changedCategories(int);
162 163
163 void purgeCompleted(); 164 void purgeCompleted();
164 void toggleCompleted(); 165 void toggleCompleted();
166 void toggleRunning();
165 void toggleQuickTodo(); 167 void toggleQuickTodo();
166 void updateTodo( Todo *, int ); 168 void updateTodo( Todo *, int );
167 169
168 void itemClicked(QListViewItem *); 170 void itemClicked(QListViewItem *);
169 void itemStateChanged(QListViewItem *); 171 void itemStateChanged(QListViewItem *);
170 void modified(bool); 172 void modified(bool);
171 void itemDoubleClicked(QListViewItem *item); 173 void itemDoubleClicked(QListViewItem *item);
172 174
173 signals: 175 signals:
174 void newTodoSignal(); 176 void newTodoSignal();
175 void newSubTodoSignal(Todo *); 177 void newSubTodoSignal(Todo *);
176 void unparentTodoSignal(Todo *); 178 void unparentTodoSignal(Todo *);
177 void reparentTodoSignal( Todo *,Todo * ); 179 void reparentTodoSignal( Todo *,Todo * );
178 void showTodoSignal(Todo *); 180 void showTodoSignal(Todo *);
179 181
180 void editTodoSignal(Todo *); 182 void editTodoSignal(Todo *);
181 void deleteTodoSignal(Todo *); 183 void deleteTodoSignal(Todo *);
182 void todoModifiedSignal (Todo *, int); 184 void todoModifiedSignal (Todo *, int);
183 185
184 void isModified(bool); 186 void isModified(bool);
185 void cloneTodoSignal( Incidence * ); 187 void cloneTodoSignal( Incidence * );
186 void cancelTodoSignal( Incidence * ); 188 void cancelTodoSignal( Incidence * );
187 void moveTodoSignal( Incidence * ); 189 void moveTodoSignal( Incidence * );
188 void beamTodoSignal( Incidence * ); 190 void beamTodoSignal( Incidence * );
189 void purgeCompletedSignal(); 191 void purgeCompletedSignal();
190 192
191 protected slots: 193 protected slots:
192 void processSelectionChange(); 194 void processSelectionChange();
193 void addQuickTodo(); 195 void addQuickTodo();
194 196
195 private: 197 private:
196 /* 198 /*
197 * the TodoEditor approach is rather unscaling in the long 199 * the TodoEditor approach is rather unscaling in the long
198 * run. 200 * run.
199 * Korganizer keeps it in memory and we need to update 201 * Korganizer keeps it in memory and we need to update
200 * 1. make KOTodoViewItem a QObject again? 202 * 1. make KOTodoViewItem a QObject again?
201 * 2. add a public method for setting one todo modified? 203 * 2. add a public method for setting one todo modified?
202 * 3. add a private method for setting a todo modified + friend here? 204 * 3. add a private method for setting a todo modified + friend here?
203 * -- zecke 2002-07-08 205 * -- zecke 2002-07-08
204 */ 206 */
205 friend class KOTodoViewItem; 207 friend class KOTodoViewItem;
206 void setTodoModified( Todo* ); 208 void setTodoModified( Todo* );
207 QMap<Todo *,KOTodoViewItem *>::ConstIterator insertTodoItem(Todo *todo); 209 QMap<Todo *,KOTodoViewItem *>::ConstIterator insertTodoItem(Todo *todo);
208 void restoreItemState( QListViewItem * ); 210 void restoreItemState( QListViewItem * );
209 211
212 bool checkTodo( Todo * );
213
210 KOTodoListView *mTodoListView; 214 KOTodoListView *mTodoListView;
211 QPopupMenu *mItemPopupMenu; 215 QPopupMenu *mItemPopupMenu;
212 QPopupMenu *mPopupMenu; 216 QPopupMenu *mPopupMenu;
213 QPopupMenu *mPriorityPopupMenu; 217 QPopupMenu *mPriorityPopupMenu;
214 QPopupMenu *mPercentageCompletedPopupMenu; 218 QPopupMenu *mPercentageCompletedPopupMenu;
215 QPopupMenu *mCategoryPopupMenu; 219 QPopupMenu *mCategoryPopupMenu;
216 220
217 QMap<int, int> mPercentage; 221 QMap<int, int> mPercentage;
218 QMap<int, int> mPriority; 222 QMap<int, int> mPriority;
219 QMap<int, QString> mCategory; 223 QMap<int, QString> mCategory;
220 KOTodoViewItem *mActiveItem; 224 KOTodoViewItem *mActiveItem;
221 225
222 QMap<Todo *,KOTodoViewItem *> mTodoMap; 226 QMap<Todo *,KOTodoViewItem *> mTodoMap;
223 QString mName; 227 QString mName;
224 228
225 DocPrefs *mDocPrefs; 229 DocPrefs *mDocPrefs;
226 QString mCurrentDoc; 230 QString mCurrentDoc;
227 KOQuickTodo *mQuickAdd; 231 KOQuickTodo *mQuickAdd;
228 bool mBlockUpdate; 232 bool mBlockUpdate;
229 void todoModified(Todo *, int ); 233 void todoModified(Todo *, int );
230 void keyPressEvent ( QKeyEvent * ) ; 234 void keyPressEvent ( QKeyEvent * ) ;
231 KOTodoViewItem * pendingSubtodo; 235 KOTodoViewItem * pendingSubtodo;
236 DateNavigator* mNavigator;
232}; 237};
233 238
234#endif 239#endif
diff --git a/korganizer/kotodoviewitem.cpp b/korganizer/kotodoviewitem.cpp
index ae0b334..347d982 100644
--- a/korganizer/kotodoviewitem.cpp
+++ b/korganizer/kotodoviewitem.cpp
@@ -1,216 +1,241 @@
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#include <kdebug.h> 21#include <kdebug.h>
22#include <qapp.h> 22#include <qapp.h>
23 23
24#include <kiconloader.h> 24#include <kiconloader.h>
25#include "kotodoviewitem.h" 25#include "kotodoviewitem.h"
26#include "kotodoview.h" 26#include "kotodoview.h"
27#include "koprefs.h" 27#include "koprefs.h"
28 28
29KOTodoViewItem::KOTodoViewItem( QListView *parent, Todo *todo, KOTodoView *kotodo) 29KOTodoViewItem::KOTodoViewItem( QListView *parent, Todo *todo, KOTodoView *kotodo)
30 : QCheckListItem( parent , "", CheckBox ), mTodo( todo ), mTodoView( kotodo ) 30 : QCheckListItem( parent , "", CheckBox ), mTodo( todo ), mTodoView( kotodo )
31{ 31{
32 construct(); 32 construct();
33} 33}
34 34
35KOTodoViewItem::KOTodoViewItem( KOTodoViewItem *parent, Todo *todo, KOTodoView *kotodo ) 35KOTodoViewItem::KOTodoViewItem( KOTodoViewItem *parent, Todo *todo, KOTodoView *kotodo )
36 : QCheckListItem( parent, "", CheckBox ), mTodo( todo ), mTodoView( kotodo ) 36 : QCheckListItem( parent, "", CheckBox ), mTodo( todo ), mTodoView( kotodo )
37{ 37{
38 construct(); 38 construct();
39} 39}
40 40
41QString KOTodoViewItem::key(int column,bool) const 41QString KOTodoViewItem::key(int column,bool) const
42{ 42{
43 QMap<int,QString>::ConstIterator it = mKeyMap.find(column); 43 QMap<int,QString>::ConstIterator it = mKeyMap.find(column);
44 if (it == mKeyMap.end()) { 44 if (it == mKeyMap.end()) {
45 return text(column).lower(); 45 return text(column).lower();
46 } else { 46 } else {
47 return *it; 47 return *it;
48 } 48 }
49} 49}
50 50
51void KOTodoViewItem:: setup() 51void KOTodoViewItem:: setup()
52{ 52{
53 53
54 int h = 20; 54 int h = 20;
55 if ( listView () ) { 55 if ( listView () ) {
56 QFontMetrics fm ( listView ()->font () ); 56 QFontMetrics fm ( listView ()->font () );
57 h = fm.height(); 57 h = fm.height();
58 } 58 }
59 setHeight( h ); 59 setHeight( h );
60 60
61} 61}
62void KOTodoViewItem::setSortKey(int column,const QString &key) 62void KOTodoViewItem::setSortKey(int column,const QString &key)
63{ 63{
64 mKeyMap.insert(column,key); 64 mKeyMap.insert(column,key);
65} 65}
66 66
67#if QT_VERSION >= 300 67#if QT_VERSION >= 300
68void KOTodoViewItem::paintBranches(QPainter *p,const QColorGroup & cg,int w, 68void KOTodoViewItem::paintBranches(QPainter *p,const QColorGroup & cg,int w,
69 int y,int h) 69 int y,int h)
70{ 70{
71 QListViewItem::paintBranches(p,cg,w,y,h); 71 QListViewItem::paintBranches(p,cg,w,y,h);
72} 72}
73#else 73#else
74#endif 74#endif
75 75
76void KOTodoViewItem::construct() 76void KOTodoViewItem::construct()
77{ 77{
78 // qDebug("KOTodoViewItem::construct() "); 78 // qDebug("KOTodoViewItem::construct() ");
79 m_init = true; 79 m_init = true;
80 QString keyd = "=="; 80 QString keyd = "==";
81 QString keyt = "=="; 81 QString keyt = "==";
82 QString skeyd = "==";
83 QString skeyt = "==";
82 84
83 setOn(mTodo->isCompleted()); 85 setOn(mTodo->isCompleted());
84 setText(0,mTodo->summary()); 86 setText(0,mTodo->summary());
85 setText(1,QString::number(mTodo->priority())); 87 setText(1,QString::number(mTodo->priority()));
86 setText(2,i18n("%1 %").arg(QString::number(mTodo->percentComplete()))); 88 setText(2,i18n("%1 %").arg(QString::number(mTodo->percentComplete())));
87 if (mTodo->percentComplete()<100) { 89 if (mTodo->percentComplete()<100) {
88 if (mTodo->isCompleted()) setSortKey(2,QString::number(999)); 90 if (mTodo->isCompleted()) setSortKey(2,QString::number(999));
89 else setSortKey(2,QString::number(mTodo->percentComplete())); 91 else setSortKey(2,QString::number(mTodo->percentComplete()));
90 } 92 }
91 else { 93 else {
92 if (mTodo->isCompleted()) setSortKey(2,QString::number(999)); 94 if (mTodo->isCompleted()) setSortKey(2,QString::number(999));
93 else setSortKey(2,QString::number(99)); 95 else setSortKey(2,QString::number(99));
94 } 96 }
95 if (mTodo->hasDueDate()) { 97 if (mTodo->hasDueDate()) {
96 setText(3, mTodo->dtDueDateStr()); 98 setText(3, mTodo->dtDueDateStr());
97 QDate d = mTodo->dtDue().date(); 99 QDate d = mTodo->dtDue().date();
98 keyd.sprintf("%04d%02d%02d",d.year(),d.month(),d.day()); 100 keyd.sprintf("%04d%02d%02d",d.year(),d.month(),d.day());
99 setSortKey(3,keyd); 101 // setSortKey(3,keyd);
100 if (mTodo->doesFloat()) { 102 if (mTodo->doesFloat()) {
101 setText(4,""); 103 setText(4,"");
102 } 104 }
103 else { 105 else {
104 setText(4,mTodo->dtDueTimeStr()); 106 setText(4,mTodo->dtDueTimeStr());
105 QTime t = mTodo->dtDue().time(); 107 QTime t = mTodo->dtDue().time();
106 keyt.sprintf("%02d%02d",t.hour(),t.minute()); 108 keyt.sprintf("%02d%02d",t.hour(),t.minute());
107 setSortKey(4,keyt); 109 //setSortKey(4,keyt);
108 } 110 }
109 } else { 111 } else {
110 setText(3,""); 112 setText(3,"");
111 setText(4,""); 113 setText(4,"");
112 } 114 }
113 setSortKey(3,keyd); 115 setSortKey(3,keyd);
114 setSortKey(4,keyt); 116 setSortKey(4,keyt);
115 117
116 if (mTodo->isCompleted()) setSortKey(1,"6" + QString::number(mTodo->priority())+keyd+keyt); 118 if (mTodo->isCompleted()) setSortKey(1,"6" + QString::number(mTodo->priority())+keyd+keyt);
117 else setSortKey(1,QString::number(mTodo->priority())+keyd+keyt); 119 else setSortKey(1,QString::number(mTodo->priority())+keyd+keyt);
118 120
119 setText(5,mTodo->cancelled() ? i18n("Yes") : i18n("No")); 121
120 setText(6,mTodo->categoriesStr()); 122
123 if (mTodo->hasStartDate()) {
124 setText(5, mTodo->dtStartDateStr());
125 QDate d = mTodo->dtStart().date();
126 skeyd.sprintf("%04d%02d%02d",d.year(),d.month(),d.day());
127
128 if (mTodo->doesFloat()) {
129 setText(6,"");
130 }
131 else {
132 setText(6,mTodo->dtStartTimeStr());
133 QTime t = mTodo->dtStart().time();
134 skeyt.sprintf("%02d%02d",t.hour(),t.minute());
135
136 }
137 } else {
138 setText(5,"");
139 setText(6,"");
140 }
141 setSortKey(5,skeyd);
142 setSortKey(6,skeyt);
143
144 setText(7,mTodo->cancelled() ? i18n("Yes") : i18n("No"));
145 setText(8,mTodo->categoriesStr());
121 146
122#if 0 147#if 0
123 // Find sort id in description. It's the text behind the last '#' character 148 // Find sort id in description. It's the text behind the last '#' character
124 // found in the description. White spaces are removed from beginning and end 149 // found in the description. White spaces are removed from beginning and end
125 // of sort id. 150 // of sort id.
126 int pos = mTodo->description().findRev('#'); 151 int pos = mTodo->description().findRev('#');
127 if (pos < 0) { 152 if (pos < 0) {
128 setText(6,""); 153 setText(6,"");
129 } else { 154 } else {
130 QString str = mTodo->description().mid(pos+1); 155 QString str = mTodo->description().mid(pos+1);
131 str.stripWhiteSpace(); 156 str.stripWhiteSpace();
132 setText(6,str); 157 setText(6,str);
133 } 158 }
134#endif 159#endif
135 160
136 m_known = false; 161 m_known = false;
137 m_init = false; 162 m_init = false;
138 163
139 setMyPixmap(); 164 setMyPixmap();
140 165
141} 166}
142void KOTodoViewItem::setMyPixmap() 167void KOTodoViewItem::setMyPixmap()
143{ 168{
144 int size = 5; 169 int size = 5;
145 QPixmap pixi = QPixmap( 1, 1 ); 170 QPixmap pixi = QPixmap( 1, 1 );
146 // if ( !mTodo->isCompleted() && mTodo->hasDueDate() && mTodo->dtDue() < QDateTime::currentDateTime() ) { 171 // if ( !mTodo->isCompleted() && mTodo->hasDueDate() && mTodo->dtDue() < QDateTime::currentDateTime() ) {
147// pixi = SmallIcon("redcross16"); 172// pixi = SmallIcon("redcross16");
148// } else { 173// } else {
149 QPainter p; 174 QPainter p;
150 175
151 int pixSize = 0; 176 int pixSize = 0;
152 QPixmap pPix = QPixmap( size, size ); 177 QPixmap pPix = QPixmap( size, size );
153 if ( mTodo->description().length() > 0 ) { 178 if ( mTodo->description().length() > 0 ) {
154 pixi.resize(size, pixSize+size); 179 pixi.resize(size, pixSize+size);
155 pPix.fill( Qt::darkGreen ); 180 pPix.fill( Qt::darkGreen );
156 p.begin( &pixi ); 181 p.begin( &pixi );
157 p. drawPixmap ( 0, pixSize, pPix); 182 p. drawPixmap ( 0, pixSize, pPix);
158 p.end(); 183 p.end();
159 pixSize += size; 184 pixSize += size;
160 } 185 }
161 if ( mTodo->isAlarmEnabled() ) { 186 if ( mTodo->isAlarmEnabled() ) {
162 pixi.resize(size, pixSize+size); 187 pixi.resize(size, pixSize+size);
163 pPix.fill( Qt::red ); 188 pPix.fill( Qt::red );
164 p.begin( &pixi ); 189 p.begin( &pixi );
165 p. drawPixmap ( 0, pixSize, pPix); 190 p. drawPixmap ( 0, pixSize, pPix);
166 p.end(); 191 p.end();
167 pixSize += size; 192 pixSize += size;
168 } 193 }
169 // } 194 // }
170 if ( pixi.width() > 1 ) { 195 if ( pixi.width() > 1 ) {
171 setPixmap ( 0,pixi ) ; 196 setPixmap ( 0,pixi ) ;
172 } 197 }
173 198
174 199
175} 200}
176void KOTodoViewItem::stateChange(bool state) 201void KOTodoViewItem::stateChange(bool state)
177{ 202{
178 // qDebug("KOTodoViewItem::stateChange "); 203 // qDebug("KOTodoViewItem::stateChange ");
179 // do not change setting on startup 204 // do not change setting on startup
180 if ( m_init ) return; 205 if ( m_init ) return;
181 206
182 kdDebug() << "State changed, modified " << state << endl; 207 kdDebug() << "State changed, modified " << state << endl;
183 QString keyd = "=="; 208 QString keyd = "==";
184 QString keyt = "=="; 209 QString keyt = "==";
185 210
186 if (state) mTodo->setCompleted(state); 211 if (state) mTodo->setCompleted(state);
187 else mTodo->setPercentComplete(0); 212 else mTodo->setPercentComplete(0);
188 if (isOn()!=state) { 213 if (isOn()!=state) {
189 setOn(state); 214 setOn(state);
190 } 215 }
191 216
192 if (mTodo->hasDueDate()) { 217 if (mTodo->hasDueDate()) {
193 setText(3, mTodo->dtDueDateStr()); 218 setText(3, mTodo->dtDueDateStr());
194 QDate d = mTodo->dtDue().date(); 219 QDate d = mTodo->dtDue().date();
195 keyd.sprintf("%04d%02d%02d",d.year(),d.month(),d.day()); 220 keyd.sprintf("%04d%02d%02d",d.year(),d.month(),d.day());
196 setSortKey(3,keyd); 221 setSortKey(3,keyd);
197 if (mTodo->doesFloat()) { 222 if (mTodo->doesFloat()) {
198 setText(4,""); 223 setText(4,"");
199 } 224 }
200 else { 225 else {
201 setText(4,mTodo->dtDueTimeStr()); 226 setText(4,mTodo->dtDueTimeStr());
202 QTime t = mTodo->dtDue().time(); 227 QTime t = mTodo->dtDue().time();
203 keyt.sprintf("%02d%02d",t.hour(),t.minute()); 228 keyt.sprintf("%02d%02d",t.hour(),t.minute());
204 setSortKey(4,keyt); 229 setSortKey(4,keyt);
205 } 230 }
206 } 231 }
207 if (mTodo->isCompleted()) setSortKey(1,QString::number(9)+keyd+keyt); 232 if (mTodo->isCompleted()) setSortKey(1,QString::number(9)+keyd+keyt);
208 else setSortKey(1,QString::number(mTodo->priority())+keyd+keyt); 233 else setSortKey(1,QString::number(mTodo->priority())+keyd+keyt);
209 234
210 setText(2,i18n("%1 %").arg(QString::number(mTodo->percentComplete()))); 235 setText(2,i18n("%1 %").arg(QString::number(mTodo->percentComplete())));
211 if (mTodo->percentComplete()<100) { 236 if (mTodo->percentComplete()<100) {
212 if (mTodo->isCompleted()) setSortKey(2,QString::number(999)); 237 if (mTodo->isCompleted()) setSortKey(2,QString::number(999));
213 else setSortKey(2,QString::number(mTodo->percentComplete())); 238 else setSortKey(2,QString::number(mTodo->percentComplete()));
214 } 239 }
215 else { 240 else {
216 if (mTodo->isCompleted()) setSortKey(2,QString::number(999)); 241 if (mTodo->isCompleted()) setSortKey(2,QString::number(999));
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp
index 6e151f9..b2dd266 100644
--- a/korganizer/koviewmanager.cpp
+++ b/korganizer/koviewmanager.cpp
@@ -416,165 +416,166 @@ bool KOViewManager::showsNextDays()
416} 416}
417void KOViewManager::showMonthView() 417void KOViewManager::showMonthView()
418{ 418{
419 if (!mMonthView) { 419 if (!mMonthView) {
420 mMonthView = new KOMonthView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::MonthView"); 420 mMonthView = new KOMonthView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::MonthView");
421 421
422 addView(mMonthView); 422 addView(mMonthView);
423 // mMonthView->show(); 423 // mMonthView->show();
424 // SIGNALS/SLOTS FOR MONTH VIEW 424 // SIGNALS/SLOTS FOR MONTH VIEW
425 connect(mMonthView, SIGNAL(newEventSignal(QDateTime)), 425 connect(mMonthView, SIGNAL(newEventSignal(QDateTime)),
426 mMainView, SLOT(newEvent(QDateTime))); 426 mMainView, SLOT(newEvent(QDateTime)));
427 427
428 connect(mMonthView, SIGNAL(showIncidenceSignal(Incidence *)), 428 connect(mMonthView, SIGNAL(showIncidenceSignal(Incidence *)),
429 mMainView, SLOT(showIncidence(Incidence *))); 429 mMainView, SLOT(showIncidence(Incidence *)));
430 connect(mMonthView, SIGNAL(editIncidenceSignal(Incidence *)), 430 connect(mMonthView, SIGNAL(editIncidenceSignal(Incidence *)),
431 mMainView, SLOT(editIncidence(Incidence *))); 431 mMainView, SLOT(editIncidence(Incidence *)));
432 connect(mMonthView, SIGNAL(deleteIncidenceSignal(Incidence *)), 432 connect(mMonthView, SIGNAL(deleteIncidenceSignal(Incidence *)),
433 mMainView, SLOT(deleteIncidence(Incidence *))); 433 mMainView, SLOT(deleteIncidence(Incidence *)));
434 434
435 connect( mMonthView, SIGNAL( incidenceSelected( Incidence * ) ), 435 connect( mMonthView, SIGNAL( incidenceSelected( Incidence * ) ),
436 mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); 436 mMainView, SLOT( processMainViewSelection( Incidence * ) ) );
437 connect( mMonthView, SIGNAL( cloneIncidenceSignal( Incidence * ) ), 437 connect( mMonthView, SIGNAL( cloneIncidenceSignal( Incidence * ) ),
438 mMainView, SLOT ( cloneIncidence( Incidence * ) ) ); 438 mMainView, SLOT ( cloneIncidence( Incidence * ) ) );
439 connect( mMonthView, SIGNAL( cancelIncidenceSignal( Incidence * ) ), 439 connect( mMonthView, SIGNAL( cancelIncidenceSignal( Incidence * ) ),
440 mMainView, SLOT ( cancelIncidence( Incidence * ) ) ); 440 mMainView, SLOT ( cancelIncidence( Incidence * ) ) );
441 441
442 connect( mMonthView, SIGNAL( moveIncidenceSignal( Incidence * ) ), 442 connect( mMonthView, SIGNAL( moveIncidenceSignal( Incidence * ) ),
443 mMainView, SLOT ( moveIncidence( Incidence * ) ) ); 443 mMainView, SLOT ( moveIncidence( Incidence * ) ) );
444 connect( mMonthView, SIGNAL( beamIncidenceSignal( Incidence * ) ), 444 connect( mMonthView, SIGNAL( beamIncidenceSignal( Incidence * ) ),
445 mMainView, SLOT ( beamIncidence( Incidence * ) ) ); 445 mMainView, SLOT ( beamIncidence( Incidence * ) ) );
446 connect( mMonthView, SIGNAL( selectWeekNum( int ) ), 446 connect( mMonthView, SIGNAL( selectWeekNum( int ) ),
447 mMainView, SLOT ( selectWeekNum( int ) ) ); 447 mMainView, SLOT ( selectWeekNum( int ) ) );
448 connect( mMonthView, SIGNAL( showDaySignal( QDate ) ), 448 connect( mMonthView, SIGNAL( showDaySignal( QDate ) ),
449 mMainView, SLOT ( showDay( QDate ) ) ); 449 mMainView, SLOT ( showDay( QDate ) ) );
450 connect(mMainView, SIGNAL(configChanged()), mMonthView, SLOT(updateConfig())); 450 connect(mMainView, SIGNAL(configChanged()), mMonthView, SLOT(updateConfig()));
451 mMonthView->updateConfig(); 451 mMonthView->updateConfig();
452 } 452 }
453 453
454 globalFlagBlockAgenda = 1; 454 globalFlagBlockAgenda = 1;
455 //mFlagShowNextxDays = false; 455 //mFlagShowNextxDays = false;
456 // if(mMonthView == mCurrentView) return; 456 // if(mMonthView == mCurrentView) return;
457 mMainView->dateNavigator()->selectMonth(); 457 mMainView->dateNavigator()->selectMonth();
458 // DateList tmpList = mMainView->dateNavigator()->selectedDates( ); 458 // DateList tmpList = mMainView->dateNavigator()->selectedDates( );
459 //mMonthView->showDates(tmpList.first(), tmpList.last()); 459 //mMonthView->showDates(tmpList.first(), tmpList.last());
460 460
461 showView(mMonthView, true ); 461 showView(mMonthView, true );
462 462
463} 463}
464 464
465void KOViewManager::showTodoView() 465void KOViewManager::showTodoView()
466{ 466{
467 //mFlagShowNextxDays = false; 467 //mFlagShowNextxDays = false;
468 if ( !mTodoView ) { 468 if ( !mTodoView ) {
469 mTodoView = new KOTodoView( mMainView->calendar(), mMainView->viewStack(), 469 mTodoView = new KOTodoView( mMainView->calendar(), mMainView->viewStack(),
470 "KOViewManager::TodoView" ); 470 "KOViewManager::TodoView" );
471 471
472 addView( mTodoView ); 472 addView( mTodoView );
473 // QPEApplication::setStylusOperation( mTodoView, QPEApplication::RightOnHold ); 473 // QPEApplication::setStylusOperation( mTodoView, QPEApplication::RightOnHold );
474 474
475 // SIGNALS/SLOTS FOR TODO VIEW 475 // SIGNALS/SLOTS FOR TODO VIEW
476 connect( mTodoView, SIGNAL( newTodoSignal() ), 476 connect( mTodoView, SIGNAL( newTodoSignal() ),
477 mMainView, SLOT( newTodo() ) ); 477 mMainView, SLOT( newTodo() ) );
478 connect( mTodoView, SIGNAL( newSubTodoSignal( Todo * ) ), 478 connect( mTodoView, SIGNAL( newSubTodoSignal( Todo * ) ),
479 mMainView, SLOT( newSubTodo( Todo *) ) ); 479 mMainView, SLOT( newSubTodo( Todo *) ) );
480 connect( mTodoView, SIGNAL( showTodoSignal( Todo *) ), 480 connect( mTodoView, SIGNAL( showTodoSignal( Todo *) ),
481 mMainView, SLOT( showTodo( Todo * ) ) ); 481 mMainView, SLOT( showTodo( Todo * ) ) );
482 connect( mTodoView, SIGNAL( editTodoSignal( Todo * ) ), 482 connect( mTodoView, SIGNAL( editTodoSignal( Todo * ) ),
483 mMainView, SLOT( editTodo( Todo * ) ) ); 483 mMainView, SLOT( editTodo( Todo * ) ) );
484 connect( mTodoView, SIGNAL( deleteTodoSignal( Todo * ) ), 484 connect( mTodoView, SIGNAL( deleteTodoSignal( Todo * ) ),
485 mMainView, SLOT( deleteTodo( Todo * ) ) ); 485 mMainView, SLOT( deleteTodo( Todo * ) ) );
486 connect( mTodoView, SIGNAL( purgeCompletedSignal() ), 486 connect( mTodoView, SIGNAL( purgeCompletedSignal() ),
487 mMainView, SLOT( purgeCompleted() ) ); 487 mMainView, SLOT( purgeCompleted() ) );
488 488
489 connect( mTodoView, SIGNAL( incidenceSelected( Incidence * ) ), 489 connect( mTodoView, SIGNAL( incidenceSelected( Incidence * ) ),
490 mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); 490 mMainView, SLOT( processMainViewSelection( Incidence * ) ) );
491 491
492 connect( mMainView, SIGNAL( configChanged() ), mTodoView, 492 connect( mMainView, SIGNAL( configChanged() ), mTodoView,
493 SLOT( updateConfig() ) ); 493 SLOT( updateConfig() ) );
494 connect( mMainView, SIGNAL( todoModified( Todo *, int )), mTodoView, 494 connect( mMainView, SIGNAL( todoModified( Todo *, int )), mTodoView,
495 SLOT( updateTodo( Todo *, int ) ) ); 495 SLOT( updateTodo( Todo *, int ) ) );
496 connect( mTodoView, SIGNAL( todoModifiedSignal( Todo *, int ) ), 496 connect( mTodoView, SIGNAL( todoModifiedSignal( Todo *, int ) ),
497 mMainView, SIGNAL ( todoModified( Todo *, int ) ) ); 497 mMainView, SIGNAL ( todoModified( Todo *, int ) ) );
498 connect( mTodoView, SIGNAL( cloneTodoSignal( Incidence * ) ), 498 connect( mTodoView, SIGNAL( cloneTodoSignal( Incidence * ) ),
499 mMainView, SLOT ( cloneIncidence( Incidence * ) ) ); 499 mMainView, SLOT ( cloneIncidence( Incidence * ) ) );
500 connect( mTodoView, SIGNAL( cancelTodoSignal( Incidence * ) ), 500 connect( mTodoView, SIGNAL( cancelTodoSignal( Incidence * ) ),
501 mMainView, SLOT ( cancelIncidence( Incidence * ) ) ); 501 mMainView, SLOT ( cancelIncidence( Incidence * ) ) );
502 connect( mTodoView, SIGNAL( unparentTodoSignal( Todo * ) ), 502 connect( mTodoView, SIGNAL( unparentTodoSignal( Todo * ) ),
503 mMainView, SLOT ( todo_unsub( Todo * ) ) ); 503 mMainView, SLOT ( todo_unsub( Todo * ) ) );
504 connect( mTodoView, SIGNAL( reparentTodoSignal( Todo *,Todo * ) ), 504 connect( mTodoView, SIGNAL( reparentTodoSignal( Todo *,Todo * ) ),
505 mMainView, SLOT ( todo_resub( Todo *, Todo *) ) ); 505 mMainView, SLOT ( todo_resub( Todo *, Todo *) ) );
506 connect( mTodoView, SIGNAL( moveTodoSignal( Incidence * ) ), 506 connect( mTodoView, SIGNAL( moveTodoSignal( Incidence * ) ),
507 mMainView, SLOT ( moveIncidence( Incidence * ) ) ); 507 mMainView, SLOT ( moveIncidence( Incidence * ) ) );
508 connect( mTodoView, SIGNAL( beamTodoSignal( Incidence * ) ), 508 connect( mTodoView, SIGNAL( beamTodoSignal( Incidence * ) ),
509 mMainView, SLOT ( beamIncidence( Incidence * ) ) ); 509 mMainView, SLOT ( beamIncidence( Incidence * ) ) );
510 KConfig *config = KOGlobals::config(); 510 KConfig *config = KOGlobals::config();
511 mTodoView->restoreLayout(config,"Todo View"); 511 mTodoView->restoreLayout(config,"Todo View");
512 mTodoView->setNavigator( mMainView->dateNavigator() );
512 } 513 }
513 514
514 globalFlagBlockAgenda = 1; 515 globalFlagBlockAgenda = 1;
515 showView( mTodoView, true ); 516 showView( mTodoView, true );
516 517
517} 518}
518 519
519void KOViewManager::showJournalView() 520void KOViewManager::showJournalView()
520{ 521{
521 //mFlagShowNextxDays = false; 522 //mFlagShowNextxDays = false;
522 if (!mJournalView) { 523 if (!mJournalView) {
523 mJournalView = new KOJournalView(mMainView->calendar(),mMainView->viewStack(), 524 mJournalView = new KOJournalView(mMainView->calendar(),mMainView->viewStack(),
524 "KOViewManager::JournalView"); 525 "KOViewManager::JournalView");
525 connect( mMainView, SIGNAL( configChanged() ), mJournalView, 526 connect( mMainView, SIGNAL( configChanged() ), mJournalView,
526 SLOT( updateConfig() ) ); 527 SLOT( updateConfig() ) );
527 connect(mJournalView, SIGNAL(deleteJournal(Journal *) ), mMainView,SLOT(deleteJournal(Journal *)) ); 528 connect(mJournalView, SIGNAL(deleteJournal(Journal *) ), mMainView,SLOT(deleteJournal(Journal *)) );
528 addView(mJournalView); 529 addView(mJournalView);
529 } 530 }
530 531
531 showView(mJournalView); 532 showView(mJournalView);
532} 533}
533 534
534void KOViewManager::showTimeSpanView() 535void KOViewManager::showTimeSpanView()
535{ 536{
536 //mFlagShowNextxDays = false; 537 //mFlagShowNextxDays = false;
537 if (!mTimeSpanView) { 538 if (!mTimeSpanView) {
538 mTimeSpanView = new KOTimeSpanView(mMainView->calendar(),mMainView->viewStack(), 539 mTimeSpanView = new KOTimeSpanView(mMainView->calendar(),mMainView->viewStack(),
539 "KOViewManager::TimeSpanView"); 540 "KOViewManager::TimeSpanView");
540 addView(mTimeSpanView); 541 addView(mTimeSpanView);
541 542
542 mTimeSpanView->readSettings(); 543 mTimeSpanView->readSettings();
543 } 544 }
544 545
545 showView(mTimeSpanView); 546 showView(mTimeSpanView);
546} 547}
547 548
548Incidence *KOViewManager::currentSelection() 549Incidence *KOViewManager::currentSelection()
549{ 550{
550 if (!mCurrentView) return 0; 551 if (!mCurrentView) return 0;
551 if ( mCurrentView == mListView ) { 552 if ( mCurrentView == mListView ) {
552 if ( mListView->currentItem() ) 553 if ( mListView->currentItem() )
553 return mListView->currentItem(); 554 return mListView->currentItem();
554 } 555 }
555 return mCurrentView->selectedIncidences().first(); 556 return mCurrentView->selectedIncidences().first();
556} 557}
557 558
558QDate KOViewManager::currentSelectionDate() 559QDate KOViewManager::currentSelectionDate()
559{ 560{
560 QDate qd; 561 QDate qd;
561 if (mCurrentView) { 562 if (mCurrentView) {
562 DateList qvl = mCurrentView->selectedDates(); 563 DateList qvl = mCurrentView->selectedDates();
563 if (!qvl.isEmpty()) qd = qvl.first(); 564 if (!qvl.isEmpty()) qd = qvl.first();
564 } 565 }
565 return qd; 566 return qd;
566} 567}
567 568
568void KOViewManager::addView(KOrg::BaseView *view) 569void KOViewManager::addView(KOrg::BaseView *view)
569{ 570{
570#if QT_VERSION >= 300 571#if QT_VERSION >= 300
571 mMainView->viewStack()->addWidget( view ); 572 mMainView->viewStack()->addWidget( view );
572#else 573#else
573 mMainView->viewStack()->addWidget( view, 1 ); 574 mMainView->viewStack()->addWidget( view, 1 );
574#endif 575#endif
575} 576}
576 577
577void KOViewManager::setDocumentId( const QString &id ) 578void KOViewManager::setDocumentId( const QString &id )
578{ 579{
579 if (mTodoView) mTodoView->setDocumentId( id ); 580 if (mTodoView) mTodoView->setDocumentId( id );
580} 581}
diff --git a/version b/version
index ef03779..65eb8d1 100644
--- a/version
+++ b/version
@@ -1 +1 @@
version = "1.9.15"; version = "1.9.16";