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,50 +1,58 @@
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
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index a46cd87..7ddbe23 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -221,141 +221,143 @@ CalendarView::CalendarView( CalendarResources *calendar,
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 & ) ),
@@ -2099,96 +2101,98 @@ void CalendarView::changeIncidenceDisplay(Incidence *which, int action)
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
diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp
index 46184ac..6965ba7 100644
--- a/korganizer/koagendaitem.cpp
+++ b/korganizer/koagendaitem.cpp
@@ -453,97 +453,97 @@ void KOAgendaItem::paintEvent ( QPaintEvent *e )
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
diff --git a/korganizer/kodialogmanager.cpp b/korganizer/kodialogmanager.cpp
index db7c3f2..c99c0cb 100644
--- a/korganizer/kodialogmanager.cpp
+++ b/korganizer/kodialogmanager.cpp
@@ -146,97 +146,97 @@ void KODialogManager::createIncomingDialog()
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);
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp
index 1cdb2fb..aae4692 100644
--- a/korganizer/koprefs.cpp
+++ b/korganizer/koprefs.cpp
@@ -65,96 +65,98 @@ KOPrefs::KOPrefs() :
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);
diff --git a/korganizer/koprefs.h b/korganizer/koprefs.h
index f2fe77a..69722a1 100644
--- a/korganizer/koprefs.h
+++ b/korganizer/koprefs.h
@@ -145,96 +145,98 @@ class KOPrefs : public KPimPrefs
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;
diff --git a/korganizer/koprefsdialog.cpp b/korganizer/koprefsdialog.cpp
index 578c0e9..8aa24ee 100644
--- a/korganizer/koprefsdialog.cpp
+++ b/korganizer/koprefsdialog.cpp
@@ -48,96 +48,99 @@
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;
@@ -555,96 +558,101 @@ void KOPrefsDialog::setupTimeTab()
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);
@@ -788,96 +796,101 @@ void KOPrefsDialog::setupViewsTab()
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);
diff --git a/korganizer/kotodoview.cpp b/korganizer/kotodoview.cpp
index 9cafc60..5d7b066 100644
--- a/korganizer/kotodoview.cpp
+++ b/korganizer/kotodoview.cpp
@@ -287,380 +287,405 @@ void KOTodoListView::keyPressEvent ( QKeyEvent * e )
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;
@@ -673,97 +698,97 @@ QPtrList<Todo> KOTodoView::selectedTodos()
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());
@@ -950,96 +975,105 @@ void 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;
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
@@ -34,135 +34,160 @@ KOTodoViewItem::KOTodoViewItem( QListView *parent, Todo *todo, KOTodoView *kotod
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 }
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp
index 6e151f9..b2dd266 100644
--- a/korganizer/koviewmanager.cpp
+++ b/korganizer/koviewmanager.cpp
@@ -464,96 +464,97 @@ void KOViewManager::showMonthView()
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{
diff --git a/version b/version
index ef03779..65eb8d1 100644
--- a/version
+++ b/version
@@ -1 +1 @@
version = "1.9.15"; version = "1.9.16";