summaryrefslogtreecommitdiffabout
path: root/korganizer
authorzautrix <zautrix>2005-01-19 08:52:01 (UTC)
committer zautrix <zautrix>2005-01-19 08:52:01 (UTC)
commitaf56077eeeab7b46b98ad5159c6653114abf6602 (patch) (unidiff)
treeb621bc3c2c8d283d0aec81b2b8276074082c951a /korganizer
parentc626089f47244d0c0a9ba73bcd12f42927acb28f (diff)
downloadkdepimpi-af56077eeeab7b46b98ad5159c6653114abf6602.zip
kdepimpi-af56077eeeab7b46b98ad5159c6653114abf6602.tar.gz
kdepimpi-af56077eeeab7b46b98ad5159c6653114abf6602.tar.bz2
kopi fixes
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp10
-rw-r--r--korganizer/koprefs.cpp1
-rw-r--r--korganizer/koprefs.h2
-rw-r--r--korganizer/mainwindow.cpp12
4 files changed, 17 insertions, 8 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 9c10ba6..12af655 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -278,129 +278,130 @@ void CalendarView::init()
278 connect( mResourceView, SIGNAL( resourcesChanged() ), 278 connect( mResourceView, SIGNAL( resourcesChanged() ),
279 SLOT( updateView() ) ); 279 SLOT( updateView() ) );
280 } else { 280 } else {
281 mResourceView = 0; 281 mResourceView = 0;
282 } 282 }
283#endif 283#endif
284 QWidget *rightBox = new QWidget( mPanner ); 284 QWidget *rightBox = new QWidget( mPanner );
285 QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); 285 QBoxLayout *rightLayout = new QVBoxLayout( rightBox );
286 286
287 mNavigatorBar = new NavigatorBar( QDate::currentDate(), rightBox, "useBigPixmaps" ); 287 mNavigatorBar = new NavigatorBar( QDate::currentDate(), rightBox, "useBigPixmaps" );
288 rightLayout->addWidget( mNavigatorBar ); 288 rightLayout->addWidget( mNavigatorBar );
289 289
290 mRightFrame = new QWidgetStack( rightBox ); 290 mRightFrame = new QWidgetStack( rightBox );
291 rightLayout->addWidget( mRightFrame, 1 ); 291 rightLayout->addWidget( mRightFrame, 1 );
292 292
293 mLeftFrame = mLeftSplitter; 293 mLeftFrame = mLeftSplitter;
294#else 294#else
295 QWidget *mainBox = new QWidget( this ); 295 QWidget *mainBox = new QWidget( this );
296 QWidget *leftFrame = new QWidget( mainBox ); 296 QWidget *leftFrame = new QWidget( mainBox );
297 297
298 QBoxLayout * mainBoxLayout; 298 QBoxLayout * mainBoxLayout;
299 QBoxLayout * leftFrameLayout; 299 QBoxLayout * leftFrameLayout;
300 if ( KOPrefs::instance()->mVerticalScreen ) { 300 if ( KOPrefs::instance()->mVerticalScreen ) {
301 mainBoxLayout = new QVBoxLayout(mainBox); 301 mainBoxLayout = new QVBoxLayout(mainBox);
302 leftFrameLayout = new QHBoxLayout(leftFrame ); 302 leftFrameLayout = new QHBoxLayout(leftFrame );
303 } else { 303 } else {
304 mainBoxLayout = new QHBoxLayout(mainBox); 304 mainBoxLayout = new QHBoxLayout(mainBox);
305 leftFrameLayout = new QVBoxLayout(leftFrame ); 305 leftFrameLayout = new QVBoxLayout(leftFrame );
306 } 306 }
307 topLayout->addWidget( mainBox ); 307 topLayout->addWidget( mainBox );
308 mainBoxLayout->addWidget (leftFrame); 308 mainBoxLayout->addWidget (leftFrame);
309 mDateNavigator = new KDateNavigator(leftFrame, mCalendar, TRUE, 309 mDateNavigator = new KDateNavigator(leftFrame, mCalendar, TRUE,
310 "CalendarView::DateNavigator", QDate::currentDate()); 310 "CalendarView::DateNavigator", QDate::currentDate());
311 // mDateNavigator->blockSignals( true ); 311 // mDateNavigator->blockSignals( true );
312 leftFrameLayout->addWidget( mDateNavigator ); 312 leftFrameLayout->addWidget( mDateNavigator );
313 mFilterView = new KOFilterView(&mFilters,leftFrame,"CalendarView::FilterView"); 313 mFilterView = new KOFilterView(&mFilters,leftFrame,"CalendarView::FilterView");
314 mTodoList = new KOTodoView(mCalendar, leftFrame, "todolistsmall"); 314 mTodoList = new KOTodoView(mCalendar, leftFrame, "todolistsmall");
315 mTodoList->setNavigator( mNavigator ); 315 mTodoList->setNavigator( mNavigator );
316 316
317 if ( QApplication::desktop()->width() < 480 ) { 317 if ( QApplication::desktop()->width() < 480 ) {
318 leftFrameLayout->addWidget(mFilterView); 318 leftFrameLayout->addWidget(mFilterView);
319 leftFrameLayout->addWidget(mTodoList, 2 ); 319 leftFrameLayout->addWidget(mTodoList, 2 );
320 320
321 } else { 321 } else {
322 leftFrameLayout->addWidget(mTodoList,2 ); 322 leftFrameLayout->addWidget(mTodoList,2 );
323 leftFrameLayout->addWidget(mFilterView ); 323 leftFrameLayout->addWidget(mFilterView );
324 } 324 }
325 mFilterView->hide(); 325 mFilterView->hide();
326 QWidget *rightBox = new QWidget( mainBox ); 326 QWidget *rightBox = new QWidget( mainBox );
327 mainBoxLayout->addWidget ( rightBox, 10 ); 327 mainBoxLayout->addWidget ( rightBox, 10 );
328 QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); 328 QBoxLayout *rightLayout = new QVBoxLayout( rightBox );
329 mNavigatorBar = new NavigatorBar( QDate::currentDate(), rightBox, "useBigPixmaps" ); 329 mNavigatorBar = new NavigatorBar( QDate::currentDate(), rightBox, "useBigPixmaps" );
330 mRightFrame = new QWidgetStack( rightBox ); 330 mRightFrame = new QWidgetStack( rightBox );
331 rightLayout->addWidget( mNavigatorBar ); 331 rightLayout->addWidget( mNavigatorBar );
332 rightLayout->addWidget( mRightFrame, 10 ); 332 rightLayout->addWidget( mRightFrame, 10 );
333 333
334 mLeftFrame = leftFrame; 334 mLeftFrame = leftFrame;
335 if ( KOPrefs::instance()->mVerticalScreen ) { 335 if ( KOPrefs::instance()->mVerticalScreen ) {
336 mTodoList->setFixedHeight( mDateNavigator->sizeHint().height() ); 336 mTodoList->setFixedHeight( mDateNavigator->sizeHint().height() );
337 leftFrame->setFixedHeight( mDateNavigator->sizeHint().height() ); 337 leftFrame->setFixedHeight( mDateNavigator->sizeHint().height() );
338 } else { 338 } else {
339 mTodoList->setFixedWidth( mDateNavigator->sizeHint().width() ); 339 mTodoList->setFixedWidth( mDateNavigator->sizeHint().width() );
340 leftFrame->setFixedWidth( mDateNavigator->sizeHint().width() ); 340 leftFrame->setFixedWidth( mDateNavigator->sizeHint().width() );
341 } 341 }
342 342 if ( !KOPrefs::instance()->mShowDateNavigator)
343 mDateNavigator->hide();
343 //qDebug("Calendarview Size %d %d ", width(), height()); 344 //qDebug("Calendarview Size %d %d ", width(), height());
344#endif 345#endif
345 346
346 connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), 347 connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ),
347 SLOT( showDates( const KCal::DateList & ) ) ); 348 SLOT( showDates( const KCal::DateList & ) ) );
348 connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), 349 connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ),
349 mDateNavigator, SLOT( selectDates( const KCal::DateList & ) ) ); 350 mDateNavigator, SLOT( selectDates( const KCal::DateList & ) ) );
350 351
351 connect( mNavigatorBar, SIGNAL( goPrevYear() ), 352 connect( mNavigatorBar, SIGNAL( goPrevYear() ),
352 mNavigator, SLOT( selectPreviousYear() ) ); 353 mNavigator, SLOT( selectPreviousYear() ) );
353 connect( mNavigatorBar, SIGNAL( goNextYear() ), 354 connect( mNavigatorBar, SIGNAL( goNextYear() ),
354 mNavigator, SLOT( selectNextYear() ) ); 355 mNavigator, SLOT( selectNextYear() ) );
355 connect( mNavigatorBar, SIGNAL( goPrevMonth() ), 356 connect( mNavigatorBar, SIGNAL( goPrevMonth() ),
356 mNavigator, SLOT( selectPreviousMonth() ) ); 357 mNavigator, SLOT( selectPreviousMonth() ) );
357 connect( mNavigatorBar, SIGNAL( goNextMonth() ), 358 connect( mNavigatorBar, SIGNAL( goNextMonth() ),
358 mNavigator, SLOT( selectNextMonth() ) ); 359 mNavigator, SLOT( selectNextMonth() ) );
359 360
360 connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), 361 connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ),
361 mNavigatorBar, SLOT( selectDates( const KCal::DateList & ) ) ); 362 mNavigatorBar, SLOT( selectDates( const KCal::DateList & ) ) );
362 363
363 connect( mDateNavigator, SIGNAL( weekClicked( const QDate & ) ), 364 connect( mDateNavigator, SIGNAL( weekClicked( const QDate & ) ),
364 mNavigator, SLOT( selectWeek( const QDate & ) ) ); 365 mNavigator, SLOT( selectWeek( const QDate & ) ) );
365 366
366 connect( mDateNavigator, SIGNAL( goPrevYear() ), 367 connect( mDateNavigator, SIGNAL( goPrevYear() ),
367 mNavigator, SLOT( selectPreviousYear() ) ); 368 mNavigator, SLOT( selectPreviousYear() ) );
368 connect( mDateNavigator, SIGNAL( goNextYear() ), 369 connect( mDateNavigator, SIGNAL( goNextYear() ),
369 mNavigator, SLOT( selectNextYear() ) ); 370 mNavigator, SLOT( selectNextYear() ) );
370 connect( mDateNavigator, SIGNAL( goPrevMonth() ), 371 connect( mDateNavigator, SIGNAL( goPrevMonth() ),
371 mNavigator, SLOT( selectPreviousMonth() ) ); 372 mNavigator, SLOT( selectPreviousMonth() ) );
372 connect( mDateNavigator, SIGNAL( goNextMonth() ), 373 connect( mDateNavigator, SIGNAL( goNextMonth() ),
373 mNavigator, SLOT( selectNextMonth() ) ); 374 mNavigator, SLOT( selectNextMonth() ) );
374 375
375 connect( mDateNavigator, SIGNAL( goPrevious() ), 376 connect( mDateNavigator, SIGNAL( goPrevious() ),
376 mNavigator, SLOT( selectPrevious() ) ); 377 mNavigator, SLOT( selectPrevious() ) );
377 connect( mDateNavigator, SIGNAL( goNext() ), 378 connect( mDateNavigator, SIGNAL( goNext() ),
378 mNavigator, SLOT( selectNext() ) ); 379 mNavigator, SLOT( selectNext() ) );
379 connect( mDateNavigator, SIGNAL( monthSelected ( int ) ), 380 connect( mDateNavigator, SIGNAL( monthSelected ( int ) ),
380 mNavigator, SLOT( slotMonthSelect( int ) ) ); 381 mNavigator, SLOT( slotMonthSelect( int ) ) );
381 connect( mNavigatorBar, SIGNAL( monthSelected ( int ) ), 382 connect( mNavigatorBar, SIGNAL( monthSelected ( int ) ),
382 mNavigator, SLOT( slotMonthSelect( int ) ) ); 383 mNavigator, SLOT( slotMonthSelect( int ) ) );
383 384
384 connect( mDateNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), 385 connect( mDateNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ),
385 mNavigator, SLOT( selectDates( const KCal::DateList & ) ) ); 386 mNavigator, SLOT( selectDates( const KCal::DateList & ) ) );
386 387
387 connect( mDateNavigator, SIGNAL( eventDropped( Event * ) ), 388 connect( mDateNavigator, SIGNAL( eventDropped( Event * ) ),
388 SLOT( eventAdded( Event *) ) ); 389 SLOT( eventAdded( Event *) ) );
389 390
390 connect(mDateNavigator,SIGNAL(dayPassed(QDate)),SLOT(updateView())); 391 connect(mDateNavigator,SIGNAL(dayPassed(QDate)),SLOT(updateView()));
391 392
392 connect( this, SIGNAL( configChanged() ), 393 connect( this, SIGNAL( configChanged() ),
393 mDateNavigator, SLOT( updateConfig() ) ); 394 mDateNavigator, SLOT( updateConfig() ) );
394 395
395 connect( mTodoList, SIGNAL( newTodoSignal() ), 396 connect( mTodoList, SIGNAL( newTodoSignal() ),
396 SLOT( newTodo() ) ); 397 SLOT( newTodo() ) );
397 connect( mTodoList, SIGNAL( newSubTodoSignal( Todo *) ), 398 connect( mTodoList, SIGNAL( newSubTodoSignal( Todo *) ),
398 SLOT( newSubTodo( Todo * ) ) ); 399 SLOT( newSubTodo( Todo * ) ) );
399 connect( mTodoList, SIGNAL( editTodoSignal( Todo * ) ), 400 connect( mTodoList, SIGNAL( editTodoSignal( Todo * ) ),
400 SLOT( editTodo( Todo * ) ) ); 401 SLOT( editTodo( Todo * ) ) );
401 connect( mTodoList, SIGNAL( showTodoSignal( Todo * ) ), 402 connect( mTodoList, SIGNAL( showTodoSignal( Todo * ) ),
402 SLOT( showTodo( Todo *) ) ); 403 SLOT( showTodo( Todo *) ) );
403 connect( mTodoList, SIGNAL( deleteTodoSignal( Todo *) ), 404 connect( mTodoList, SIGNAL( deleteTodoSignal( Todo *) ),
404 SLOT( deleteTodo( Todo *) ) ); 405 SLOT( deleteTodo( Todo *) ) );
405 connect( this, SIGNAL( configChanged()), mTodoList, SLOT( updateConfig() ) ); 406 connect( this, SIGNAL( configChanged()), mTodoList, SLOT( updateConfig() ) );
406 connect( mTodoList, SIGNAL( purgeCompletedSignal() ), 407 connect( mTodoList, SIGNAL( purgeCompletedSignal() ),
@@ -2107,132 +2108,132 @@ void CalendarView::changeTodoDisplay(Todo *which, int action)
2107 //mDialogManager->updateSearchDialog(); 2108 //mDialogManager->updateSearchDialog();
2108 2109
2109 if (which) { 2110 if (which) {
2110 mViewManager->updateWNview(); 2111 mViewManager->updateWNview();
2111 //mTodoList->updateView(); 2112 //mTodoList->updateView();
2112 } 2113 }
2113 2114
2114} 2115}
2115 2116
2116void CalendarView::changeIncidenceDisplay(Incidence *which, int action) 2117void CalendarView::changeIncidenceDisplay(Incidence *which, int action)
2117{ 2118{
2118 updateUnmanagedViews(); 2119 updateUnmanagedViews();
2119 //qDebug(" CalendarView::changeIncidenceDisplay++++++++++++++++++++++++++ %d %d ",which, action ); 2120 //qDebug(" CalendarView::changeIncidenceDisplay++++++++++++++++++++++++++ %d %d ",which, action );
2120 if ( action == KOGlobals::EVENTDELETED ) { //delete 2121 if ( action == KOGlobals::EVENTDELETED ) { //delete
2121 mCalendar->checkAlarmForIncidence( 0, true ); 2122 mCalendar->checkAlarmForIncidence( 0, true );
2122 if ( mEventViewerDialog ) 2123 if ( mEventViewerDialog )
2123 mEventViewerDialog->hide(); 2124 mEventViewerDialog->hide();
2124 } 2125 }
2125 else 2126 else
2126 mCalendar->checkAlarmForIncidence( which , false ); 2127 mCalendar->checkAlarmForIncidence( which , false );
2127} 2128}
2128 2129
2129// most of the changeEventDisplays() right now just call the view's 2130// most of the changeEventDisplays() right now just call the view's
2130// total update mode, but they SHOULD be recoded to be more refresh-efficient. 2131// total update mode, but they SHOULD be recoded to be more refresh-efficient.
2131void CalendarView::changeEventDisplay(Event *which, int action) 2132void CalendarView::changeEventDisplay(Event *which, int action)
2132{ 2133{
2133 // kdDebug() << "CalendarView::changeEventDisplay" << endl; 2134 // kdDebug() << "CalendarView::changeEventDisplay" << endl;
2134 changeIncidenceDisplay((Incidence *)which, action); 2135 changeIncidenceDisplay((Incidence *)which, action);
2135 mDateNavigator->updateView(); 2136 mDateNavigator->updateView();
2136 //mDialogManager->updateSearchDialog(); 2137 //mDialogManager->updateSearchDialog();
2137 2138
2138 if (which) { 2139 if (which) {
2139 // If there is an event view visible update the display 2140 // If there is an event view visible update the display
2140 mViewManager->currentView()->changeEventDisplay(which,action); 2141 mViewManager->currentView()->changeEventDisplay(which,action);
2141 // TODO: check, if update needed 2142 // TODO: check, if update needed
2142 // if (which->getTodoStatus()) { 2143 // if (which->getTodoStatus()) {
2143 mTodoList->updateView(); 2144 mTodoList->updateView();
2144 // } 2145 // }
2145 } else { 2146 } else {
2146 mViewManager->currentView()->updateView(); 2147 mViewManager->currentView()->updateView();
2147 } 2148 }
2148} 2149}
2149 2150
2150 2151
2151void CalendarView::updateTodoViews() 2152void CalendarView::updateTodoViews()
2152{ 2153{
2153 2154
2154 mTodoList->updateView(); 2155 mTodoList->updateView();
2155 mViewManager->currentView()->updateView(); 2156 mViewManager->currentView()->updateView();
2156 2157
2157} 2158}
2158 2159
2159 2160
2160void CalendarView::updateView(const QDate &start, const QDate &end) 2161void CalendarView::updateView(const QDate &start, const QDate &end)
2161{ 2162{
2162 mTodoList->updateView(); 2163 mTodoList->updateView();
2163 mViewManager->updateView(start, end); 2164 mViewManager->updateView(start, end);
2164 //mDateNavigator->updateView(); 2165 //mDateNavigator->updateView();
2165} 2166}
2166 2167
2167void CalendarView::updateView() 2168void CalendarView::updateView()
2168{ 2169{
2169 DateList tmpList = mNavigator->selectedDates(); 2170 DateList tmpList = mNavigator->selectedDates();
2170 2171
2171 // We assume that the navigator only selects consecutive days.
2172 updateView( tmpList.first(), tmpList.last() );
2173 if ( KOPrefs::instance()->mHideNonStartedTodos ) 2172 if ( KOPrefs::instance()->mHideNonStartedTodos )
2174 mTodoList->updateView(); 2173 mTodoList->updateView();
2174 // We assume that the navigator only selects consecutive days.
2175 updateView( tmpList.first(), tmpList.last() );
2175} 2176}
2176 2177
2177void CalendarView::updateUnmanagedViews() 2178void CalendarView::updateUnmanagedViews()
2178{ 2179{
2179 mDateNavigator->updateDayMatrix(); 2180 mDateNavigator->updateDayMatrix();
2180} 2181}
2181 2182
2182int CalendarView::msgItemDelete() 2183int CalendarView::msgItemDelete()
2183{ 2184{
2184 return KMessageBox::warningContinueCancel(this, 2185 return KMessageBox::warningContinueCancel(this,
2185 i18n("This item will be\npermanently deleted."), 2186 i18n("This item will be\npermanently deleted."),
2186 i18n("KO/Pi Confirmation"),i18n("Delete")); 2187 i18n("KO/Pi Confirmation"),i18n("Delete"));
2187} 2188}
2188 2189
2189 2190
2190void CalendarView::edit_cut() 2191void CalendarView::edit_cut()
2191{ 2192{
2192 Event *anEvent=0; 2193 Event *anEvent=0;
2193 2194
2194 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); 2195 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first();
2195 2196
2196 if (mViewManager->currentView()->isEventView()) { 2197 if (mViewManager->currentView()->isEventView()) {
2197 if ( incidence && incidence->type() == "Event" ) { 2198 if ( incidence && incidence->type() == "Event" ) {
2198 anEvent = static_cast<Event *>(incidence); 2199 anEvent = static_cast<Event *>(incidence);
2199 } 2200 }
2200 } 2201 }
2201 2202
2202 if (!anEvent) { 2203 if (!anEvent) {
2203 KNotifyClient::beep(); 2204 KNotifyClient::beep();
2204 return; 2205 return;
2205 } 2206 }
2206 DndFactory factory( mCalendar ); 2207 DndFactory factory( mCalendar );
2207 factory.cutEvent(anEvent); 2208 factory.cutEvent(anEvent);
2208 changeEventDisplay(anEvent, KOGlobals::EVENTDELETED); 2209 changeEventDisplay(anEvent, KOGlobals::EVENTDELETED);
2209} 2210}
2210 2211
2211void CalendarView::edit_copy() 2212void CalendarView::edit_copy()
2212{ 2213{
2213 Event *anEvent=0; 2214 Event *anEvent=0;
2214 2215
2215 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); 2216 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first();
2216 2217
2217 if (mViewManager->currentView()->isEventView()) { 2218 if (mViewManager->currentView()->isEventView()) {
2218 if ( incidence && incidence->type() == "Event" ) { 2219 if ( incidence && incidence->type() == "Event" ) {
2219 anEvent = static_cast<Event *>(incidence); 2220 anEvent = static_cast<Event *>(incidence);
2220 } 2221 }
2221 } 2222 }
2222 2223
2223 if (!anEvent) { 2224 if (!anEvent) {
2224 KNotifyClient::beep(); 2225 KNotifyClient::beep();
2225 return; 2226 return;
2226 } 2227 }
2227 DndFactory factory( mCalendar ); 2228 DndFactory factory( mCalendar );
2228 factory.copyEvent(anEvent); 2229 factory.copyEvent(anEvent);
2229} 2230}
2230 2231
2231void CalendarView::edit_paste() 2232void CalendarView::edit_paste()
2232{ 2233{
2233 QDate date = mNavigator->selectedDates().first(); 2234 QDate date = mNavigator->selectedDates().first();
2234 2235
2235 DndFactory factory( mCalendar ); 2236 DndFactory factory( mCalendar );
2236 Event *pastedEvent = factory.pasteEvent( date ); 2237 Event *pastedEvent = factory.pasteEvent( date );
2237 2238
2238 changeEventDisplay( pastedEvent, KOGlobals::EVENTADDED ); 2239 changeEventDisplay( pastedEvent, KOGlobals::EVENTADDED );
@@ -3548,129 +3549,130 @@ void CalendarView::takeOverEvent()
3548 3549
3549 if (!incidence) return; 3550 if (!incidence) return;
3550 3551
3551 incidence->setOrganizer(KOPrefs::instance()->email()); 3552 incidence->setOrganizer(KOPrefs::instance()->email());
3552 incidence->recreate(); 3553 incidence->recreate();
3553 incidence->setReadOnly(false); 3554 incidence->setReadOnly(false);
3554 3555
3555 updateView(); 3556 updateView();
3556} 3557}
3557 3558
3558void CalendarView::takeOverCalendar() 3559void CalendarView::takeOverCalendar()
3559{ 3560{
3560 // TODO: Create Calendar::allIncidences() function and use it here 3561 // TODO: Create Calendar::allIncidences() function and use it here
3561 3562
3562 QPtrList<Event> events = mCalendar->events(); 3563 QPtrList<Event> events = mCalendar->events();
3563 for(uint i=0; i<events.count(); ++i) { 3564 for(uint i=0; i<events.count(); ++i) {
3564 events.at(i)->setOrganizer(KOPrefs::instance()->email()); 3565 events.at(i)->setOrganizer(KOPrefs::instance()->email());
3565 events.at(i)->recreate(); 3566 events.at(i)->recreate();
3566 events.at(i)->setReadOnly(false); 3567 events.at(i)->setReadOnly(false);
3567 } 3568 }
3568 3569
3569 QPtrList<Todo> todos = mCalendar->todos(); 3570 QPtrList<Todo> todos = mCalendar->todos();
3570 for(uint i=0; i<todos.count(); ++i) { 3571 for(uint i=0; i<todos.count(); ++i) {
3571 todos.at(i)->setOrganizer(KOPrefs::instance()->email()); 3572 todos.at(i)->setOrganizer(KOPrefs::instance()->email());
3572 todos.at(i)->recreate(); 3573 todos.at(i)->recreate();
3573 todos.at(i)->setReadOnly(false); 3574 todos.at(i)->setReadOnly(false);
3574 } 3575 }
3575 3576
3576 QPtrList<Journal> journals = mCalendar->journals(); 3577 QPtrList<Journal> journals = mCalendar->journals();
3577 for(uint i=0; i<journals.count(); ++i) { 3578 for(uint i=0; i<journals.count(); ++i) {
3578 journals.at(i)->setOrganizer(KOPrefs::instance()->email()); 3579 journals.at(i)->setOrganizer(KOPrefs::instance()->email());
3579 journals.at(i)->recreate(); 3580 journals.at(i)->recreate();
3580 journals.at(i)->setReadOnly(false); 3581 journals.at(i)->setReadOnly(false);
3581 } 3582 }
3582 3583
3583 updateView(); 3584 updateView();
3584} 3585}
3585 3586
3586void CalendarView::showIntro() 3587void CalendarView::showIntro()
3587{ 3588{
3588 kdDebug() << "To be implemented." << endl; 3589 kdDebug() << "To be implemented." << endl;
3589} 3590}
3590 3591
3591QWidgetStack *CalendarView::viewStack() 3592QWidgetStack *CalendarView::viewStack()
3592{ 3593{
3593 return mRightFrame; 3594 return mRightFrame;
3594} 3595}
3595 3596
3596QWidget *CalendarView::leftFrame() 3597QWidget *CalendarView::leftFrame()
3597{ 3598{
3598 return mLeftFrame; 3599 return mLeftFrame;
3599} 3600}
3600 3601
3601DateNavigator *CalendarView::dateNavigator() 3602DateNavigator *CalendarView::dateNavigator()
3602{ 3603{
3603 return mNavigator; 3604 return mNavigator;
3604} 3605}
3605 3606
3606KDateNavigator* CalendarView::dateNavigatorWidget() 3607KDateNavigator* CalendarView::dateNavigatorWidget()
3607{ 3608{
3608 return mDateNavigator; 3609 return mDateNavigator;
3609} 3610}
3610void CalendarView::toggleDateNavigatorWidget() 3611void CalendarView::toggleDateNavigatorWidget()
3611{ 3612{
3612 if (mDateNavigator->isVisible()) 3613 KOPrefs::instance()->mShowDateNavigator = !KOPrefs::instance()->mShowDateNavigator ;
3614 if (!KOPrefs::instance()->mShowDateNavigator )
3613 mDateNavigator->hide(); 3615 mDateNavigator->hide();
3614 else 3616 else
3615 mDateNavigator->show(); 3617 mDateNavigator->show();
3616} 3618}
3617void CalendarView::addView(KOrg::BaseView *view) 3619void CalendarView::addView(KOrg::BaseView *view)
3618{ 3620{
3619 mViewManager->addView(view); 3621 mViewManager->addView(view);
3620} 3622}
3621 3623
3622void CalendarView::showView(KOrg::BaseView *view) 3624void CalendarView::showView(KOrg::BaseView *view)
3623{ 3625{
3624 mViewManager->showView(view, mLeftFrame->isVisible()); 3626 mViewManager->showView(view, mLeftFrame->isVisible());
3625} 3627}
3626 3628
3627Incidence *CalendarView::currentSelection() 3629Incidence *CalendarView::currentSelection()
3628{ 3630{
3629 return mViewManager->currentSelection(); 3631 return mViewManager->currentSelection();
3630} 3632}
3631void CalendarView::toggleAllDaySize() 3633void CalendarView::toggleAllDaySize()
3632{ 3634{
3633 /* 3635 /*
3634 if ( KOPrefs::instance()->mAllDaySize > 47 ) 3636 if ( KOPrefs::instance()->mAllDaySize > 47 )
3635 KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize /2; 3637 KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize /2;
3636 else 3638 else
3637 KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize *2; 3639 KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize *2;
3638 */ 3640 */
3639 viewManager()->agendaView()->toggleAllDay(); 3641 viewManager()->agendaView()->toggleAllDay();
3640} 3642}
3641void CalendarView::toggleExpand() 3643void CalendarView::toggleExpand()
3642{ 3644{
3643 // if ( mLeftFrame->isHidden() ) { 3645 // if ( mLeftFrame->isHidden() ) {
3644 // mLeftFrame->show(); 3646 // mLeftFrame->show();
3645 // emit calendarViewExpanded( false ); 3647 // emit calendarViewExpanded( false );
3646 // } else { 3648 // } else {
3647 // mLeftFrame->hide(); 3649 // mLeftFrame->hide();
3648 // emit calendarViewExpanded( true ); 3650 // emit calendarViewExpanded( true );
3649 // } 3651 // }
3650 3652
3651 globalFlagBlockAgenda = 1; 3653 globalFlagBlockAgenda = 1;
3652 emit calendarViewExpanded( !mLeftFrame->isHidden() ); 3654 emit calendarViewExpanded( !mLeftFrame->isHidden() );
3653 globalFlagBlockAgenda = 5; 3655 globalFlagBlockAgenda = 5;
3654 mViewManager->raiseCurrentView( !mLeftFrame->isHidden() ); 3656 mViewManager->raiseCurrentView( !mLeftFrame->isHidden() );
3655 //mViewManager->showView( 0, true ); 3657 //mViewManager->showView( 0, true );
3656} 3658}
3657 3659
3658void CalendarView::calendarModified( bool modified, Calendar * ) 3660void CalendarView::calendarModified( bool modified, Calendar * )
3659{ 3661{
3660 setModified( modified ); 3662 setModified( modified );
3661} 3663}
3662 3664
3663Todo *CalendarView::selectedTodo() 3665Todo *CalendarView::selectedTodo()
3664{ 3666{
3665 Incidence *incidence = currentSelection(); 3667 Incidence *incidence = currentSelection();
3666 if ( incidence && incidence->type() == "Todo" ) { 3668 if ( incidence && incidence->type() == "Todo" ) {
3667 return static_cast<Todo *>( incidence ); 3669 return static_cast<Todo *>( incidence );
3668 } 3670 }
3669 3671
3670 incidence = mTodoList->selectedIncidences().first(); 3672 incidence = mTodoList->selectedIncidences().first();
3671 if ( incidence && incidence->type() == "Todo" ) { 3673 if ( incidence && incidence->type() == "Todo" ) {
3672 return static_cast<Todo *>( incidence ); 3674 return static_cast<Todo *>( incidence );
3673 } 3675 }
3674 3676
3675 return 0; 3677 return 0;
3676} 3678}
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp
index 0a767b6..4b26058 100644
--- a/korganizer/koprefs.cpp
+++ b/korganizer/koprefs.cpp
@@ -153,128 +153,129 @@ KOPrefs::KOPrefs() :
153 KPrefs::setCurrentGroup("Calendar"); 153 KPrefs::setCurrentGroup("Calendar");
154 154
155 addItemInt("Default Calendar Format",&mDefaultFormat,FormatICalendar); 155 addItemInt("Default Calendar Format",&mDefaultFormat,FormatICalendar);
156 156
157 KPrefs::setCurrentGroup("Fonts"); 157 KPrefs::setCurrentGroup("Fonts");
158 // qDebug(" KPrefs::setCurrentGroup(Fonts); "); 158 // qDebug(" KPrefs::setCurrentGroup(Fonts); ");
159 addItemFont("TimeBar Font",&mTimeBarFont); 159 addItemFont("TimeBar Font",&mTimeBarFont);
160 addItemFont("MonthView Font",&mMonthViewFont); 160 addItemFont("MonthView Font",&mMonthViewFont);
161 addItemFont("AgendaView Font",&mAgendaViewFont); 161 addItemFont("AgendaView Font",&mAgendaViewFont);
162 addItemFont("MarcusBains Font",&mMarcusBainsFont); 162 addItemFont("MarcusBains Font",&mMarcusBainsFont);
163 addItemFont("TimeLabels Font",&mTimeLabelsFont); 163 addItemFont("TimeLabels Font",&mTimeLabelsFont);
164 addItemFont("TodoView Font",&mTodoViewFont); 164 addItemFont("TodoView Font",&mTodoViewFont);
165 addItemFont("ListView Font",&mListViewFont); 165 addItemFont("ListView Font",&mListViewFont);
166 addItemFont("DateNavigator Font",&mDateNavigatorFont); 166 addItemFont("DateNavigator Font",&mDateNavigatorFont);
167 addItemFont("EditBox Font",&mEditBoxFont); 167 addItemFont("EditBox Font",&mEditBoxFont);
168 addItemFont("JournalView Font",&mJornalViewFont); 168 addItemFont("JournalView Font",&mJornalViewFont);
169 addItemFont("WhatsNextView Font",&mWhatsNextFont); 169 addItemFont("WhatsNextView Font",&mWhatsNextFont);
170 addItemFont("EventView Font",&mEventViewFont); 170 addItemFont("EventView Font",&mEventViewFont);
171 171
172 KPrefs::setCurrentGroup("RemoteSyncing"); 172 KPrefs::setCurrentGroup("RemoteSyncing");
173 addItemString("ActiveSyncPort",&mActiveSyncPort,"9197" ); 173 addItemString("ActiveSyncPort",&mActiveSyncPort,"9197" );
174 addItemString("ActiveSyncIP",&mActiveSyncIP,"192.168.0.40" ); 174 addItemString("ActiveSyncIP",&mActiveSyncIP,"192.168.0.40" );
175 addItemBool("ShowSyncEvents",&mShowSyncEvents,false); 175 addItemBool("ShowSyncEvents",&mShowSyncEvents,false);
176 addItemInt("LastSyncTime",&mLastSyncTime,0); 176 addItemInt("LastSyncTime",&mLastSyncTime,0);
177 177
178#ifdef _WIN32_ 178#ifdef _WIN32_
179 QString hdp= locateLocal("data","korganizer")+"\\\\"; 179 QString hdp= locateLocal("data","korganizer")+"\\\\";
180#else 180#else
181 QString hdp= locateLocal("data","korganizer")+"/"; 181 QString hdp= locateLocal("data","korganizer")+"/";
182#endif 182#endif
183 183
184 KPrefs::setCurrentGroup("LoadSaveFileNames"); 184 KPrefs::setCurrentGroup("LoadSaveFileNames");
185 185
186 addItemString("LastImportFile", &mLastImportFile ,hdp +"import.ics" ); 186 addItemString("LastImportFile", &mLastImportFile ,hdp +"import.ics" );
187 addItemString("LastVcalFile", &mLastVcalFile ,hdp +"export.vcs" ); 187 addItemString("LastVcalFile", &mLastVcalFile ,hdp +"export.vcs" );
188 addItemString("LastSaveFile", &mLastSaveFile ,hdp +"mybackup.ics" ); 188 addItemString("LastSaveFile", &mLastSaveFile ,hdp +"mybackup.ics" );
189 addItemString("LastLoadFile", &mLastLoadFile ,hdp +"mybackup.ics" ); 189 addItemString("LastLoadFile", &mLastLoadFile ,hdp +"mybackup.ics" );
190 190
191 191
192 KPrefs::setCurrentGroup("Locale"); 192 KPrefs::setCurrentGroup("Locale");
193 addItemBool("ShortDateInViewer",&mShortDateInViewer,false); 193 addItemBool("ShortDateInViewer",&mShortDateInViewer,false);
194 194
195 195
196 KPrefs::setCurrentGroup("Colors"); 196 KPrefs::setCurrentGroup("Colors");
197 addItemColor("Holiday Color",&mHolidayColor,defaultHolidayColor); 197 addItemColor("Holiday Color",&mHolidayColor,defaultHolidayColor);
198 addItemColor("Highlight Color",&mHighlightColor,defaultHighlightColor); 198 addItemColor("Highlight Color",&mHighlightColor,defaultHighlightColor);
199 addItemColor("Event Color",&mEventColor,mDefaultCategoryColor); 199 addItemColor("Event Color",&mEventColor,mDefaultCategoryColor);
200 addItemColor("Agenda Background Color",&mAgendaBgColor,defaultAgendaBgColor); 200 addItemColor("Agenda Background Color",&mAgendaBgColor,defaultAgendaBgColor);
201 addItemColor("WorkingHours Color",&mWorkingHoursColor,defaultWorkingHoursColor); 201 addItemColor("WorkingHours Color",&mWorkingHoursColor,defaultWorkingHoursColor);
202 addItemColor("Todo due today Color",&mTodoDueTodayColor,defaultTodoDueTodayColor); 202 addItemColor("Todo due today Color",&mTodoDueTodayColor,defaultTodoDueTodayColor);
203 addItemColor("Todo overdue Color",&mTodoOverdueColor,defaultTodoOverdueColor); 203 addItemColor("Todo overdue Color",&mTodoOverdueColor,defaultTodoOverdueColor);
204 addItemColor("MonthViewEvenColor",&mMonthViewEvenColor,QColor( 160,160,255 )); 204 addItemColor("MonthViewEvenColor",&mMonthViewEvenColor,QColor( 160,160,255 ));
205 addItemColor("MonthViewOddColor",&mMonthViewOddColor,QColor( 160,255,160 )); 205 addItemColor("MonthViewOddColor",&mMonthViewOddColor,QColor( 160,255,160 ));
206 addItemColor("MonthViewHolidayColor",&mMonthViewHolidayColor,QColor( 255,160,160 )); 206 addItemColor("MonthViewHolidayColor",&mMonthViewHolidayColor,QColor( 255,160,160 ));
207 addItemBool("MonthViewUsesDayColors",&mMonthViewUsesDayColors,true); 207 addItemBool("MonthViewUsesDayColors",&mMonthViewUsesDayColors,true);
208 addItemBool("MonthViewSatSunTog",&mMonthViewSatSunTog,true); 208 addItemBool("MonthViewSatSunTog",&mMonthViewSatSunTog,true);
209 addItemBool("HightlightDateTimeEdit",&mHightlightDateTimeEdit,false); 209 addItemBool("HightlightDateTimeEdit",&mHightlightDateTimeEdit,false);
210 addItemColor("AppColor1",&mAppColor1,QColor( 130,170,255 )); 210 addItemColor("AppColor1",&mAppColor1,QColor( 130,170,255 ));
211 addItemColor("AppColor2",&mAppColor2,QColor( 174,216,255 )); 211 addItemColor("AppColor2",&mAppColor2,QColor( 174,216,255 ));
212 addItemBool("UseAppColors",&mUseAppColors,false); 212 addItemBool("UseAppColors",&mUseAppColors,false);
213 213
214 214
215 215
216 KPrefs::setCurrentGroup("Views"); 216 KPrefs::setCurrentGroup("Views");
217 addItemBool("Show Date Navigator",&mShowDateNavigator,true);
217 addItemInt("Hour Size",&mHourSize,8); 218 addItemInt("Hour Size",&mHourSize,8);
218 addItemBool("Show Daily Recurrences",&mDailyRecur,true); 219 addItemBool("Show Daily Recurrences",&mDailyRecur,true);
219 addItemBool("Show Weekly Recurrences",&mWeeklyRecur,true); 220 addItemBool("Show Weekly Recurrences",&mWeeklyRecur,true);
220 addItemBool("Show Month Daily Recurrences",&mMonthDailyRecur,true); 221 addItemBool("Show Month Daily Recurrences",&mMonthDailyRecur,true);
221 addItemBool("Show Month Weekly Recurrences",&mMonthWeeklyRecur,true); 222 addItemBool("Show Month Weekly Recurrences",&mMonthWeeklyRecur,true);
222 addItemBool("ShowShortMonthName",&mMonthShowShort,false); 223 addItemBool("ShowShortMonthName",&mMonthShowShort,false);
223 addItemBool("ShowIconsInMonthCell",&mMonthShowIcons,true); 224 addItemBool("ShowIconsInMonthCell",&mMonthShowIcons,true);
224 addItemBool("Enable ToolTips",&mEnableToolTips,false); 225 addItemBool("Enable ToolTips",&mEnableToolTips,false);
225 addItemBool("Enable MonthView ScrollBars",&mEnableMonthScroll,false); 226 addItemBool("Enable MonthView ScrollBars",&mEnableMonthScroll,false);
226 addItemBool("Marcus Bains shows seconds",&mMarcusBainsShowSeconds,false); 227 addItemBool("Marcus Bains shows seconds",&mMarcusBainsShowSeconds,false);
227 addItemBool("Show Marcus Bains",&mMarcusBainsEnabled,true); 228 addItemBool("Show Marcus Bains",&mMarcusBainsEnabled,true);
228 addItemBool("EditOnDoubleClick",&mEditOnDoubleClick,true); 229 addItemBool("EditOnDoubleClick",&mEditOnDoubleClick,true);
229 addItemBool("ViewChangeHoldFullscreen",&mViewChangeHoldFullscreen,false); 230 addItemBool("ViewChangeHoldFullscreen",&mViewChangeHoldFullscreen,false);
230 addItemBool("ViewChangeHoldNonFullscreen",&mViewChangeHoldNonFullscreen,false); 231 addItemBool("ViewChangeHoldNonFullscreen",&mViewChangeHoldNonFullscreen,false);
231 addItemBool("CenterOnCurrentTime",&mCenterOnCurrentTime,false); 232 addItemBool("CenterOnCurrentTime",&mCenterOnCurrentTime,false);
232 addItemBool("SetTimeToDayStartAt",&mSetTimeToDayStartAt,true); 233 addItemBool("SetTimeToDayStartAt",&mSetTimeToDayStartAt,true);
233 addItemBool("HighlightCurrentDay",&mHighlightCurrentDay,true); 234 addItemBool("HighlightCurrentDay",&mHighlightCurrentDay,true);
234 addItemBool("WNViewShowsParents",&mWNViewShowsParents,true);; 235 addItemBool("WNViewShowsParents",&mWNViewShowsParents,true);;
235 addItemBool("WNViewShowsPast",&mWNViewShowsPast,true); 236 addItemBool("WNViewShowsPast",&mWNViewShowsPast,true);
236 addItemBool("WNViewShowLocation",&mWNViewShowLocation,false); 237 addItemBool("WNViewShowLocation",&mWNViewShowLocation,false);
237 addItemBool("UseHighlightLightColor",&mUseHighlightLightColor,false); 238 addItemBool("UseHighlightLightColor",&mUseHighlightLightColor,false);
238 addItemBool("ListViewMonthTimespan",&mListViewMonthTimespan,true); 239 addItemBool("ListViewMonthTimespan",&mListViewMonthTimespan,true);
239 addItemBool("TodoViewUsesCatColors",&mTodoViewUsesCatColors,false); 240 addItemBool("TodoViewUsesCatColors",&mTodoViewUsesCatColors,false);
240 addItemBool("TodoViewShowsPercentage",&mTodoViewShowsPercentage,false); 241 addItemBool("TodoViewShowsPercentage",&mTodoViewShowsPercentage,false);
241 addItemBool("TodoViewUsesSmallFont",&mTodoViewUsesSmallFont,false); 242 addItemBool("TodoViewUsesSmallFont",&mTodoViewUsesSmallFont,false);
242 addItemBool("TodoViewUsesForegroundColor",&mTodoViewUsesForegroundColor,false); 243 addItemBool("TodoViewUsesForegroundColor",&mTodoViewUsesForegroundColor,false);
243 addItemBool("MonthViewUsesForegroundColor",&mMonthViewUsesForegroundColor,false); 244 addItemBool("MonthViewUsesForegroundColor",&mMonthViewUsesForegroundColor,false);
244#ifdef DESKTOP_VERSION 245#ifdef DESKTOP_VERSION
245 addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,true); 246 addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,true);
246#else 247#else
247 addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,false); 248 addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,false);
248#endif 249#endif
249 addItemInt("Day Begins",&mDayBegins,7); 250 addItemInt("Day Begins",&mDayBegins,7);
250 addItemInt("Working Hours Start",&mWorkingHoursStart,8); 251 addItemInt("Working Hours Start",&mWorkingHoursStart,8);
251 addItemInt("Working Hours End",&mWorkingHoursEnd,17); 252 addItemInt("Working Hours End",&mWorkingHoursEnd,17);
252 addItemBool("Exclude Holidays",&mExcludeHolidays,true); 253 addItemBool("Exclude Holidays",&mExcludeHolidays,true);
253 addItemBool("Exclude Saturdays",&mExcludeSaturdays,true); 254 addItemBool("Exclude Saturdays",&mExcludeSaturdays,true);
254 255
255 addItemBool("Month View Uses Category Color",&mMonthViewUsesCategoryColor,false); 256 addItemBool("Month View Uses Category Color",&mMonthViewUsesCategoryColor,false);
256 addItemBool("Full View Month",&mFullViewMonth,true); 257 addItemBool("Full View Month",&mFullViewMonth,true);
257 addItemBool("Full View Todo",&mFullViewTodo,true); 258 addItemBool("Full View Todo",&mFullViewTodo,true);
258 addItemBool("Quick Todo",&mEnableQuickTodo,false); 259 addItemBool("Quick Todo",&mEnableQuickTodo,false);
259 260
260 addItemInt("Next X Days",&mNextXDays,3); 261 addItemInt("Next X Days",&mNextXDays,3);
261 262
262 KPrefs::setCurrentGroup("Printer"); 263 KPrefs::setCurrentGroup("Printer");
263 264
264 KPrefs::setCurrentGroup("Layout"); 265 KPrefs::setCurrentGroup("Layout");
265 266
266 addItemBool("CompactDialogs",&mCompactDialogs,false); 267 addItemBool("CompactDialogs",&mCompactDialogs,false);
267 addItemBool("VerticalScreen",&mVerticalScreen,true); 268 addItemBool("VerticalScreen",&mVerticalScreen,true);
268 269
269 KPrefs::setCurrentGroup("KOrganizer Plugins"); 270 KPrefs::setCurrentGroup("KOrganizer Plugins");
270 271
271 addItemStringList("SelectedPlugins",&mSelectedPlugins,"holidays"); 272 addItemStringList("SelectedPlugins",&mSelectedPlugins,"holidays");
272 273
273 KPrefs::setCurrentGroup("Group Scheduling"); 274 KPrefs::setCurrentGroup("Group Scheduling");
274 275
275 addItemInt("IMIPScheduler",&mIMIPScheduler,IMIPKMail); 276 addItemInt("IMIPScheduler",&mIMIPScheduler,IMIPKMail);
276 addItemInt("IMIPSend",&mIMIPSend,IMIPdirectsend); 277 addItemInt("IMIPSend",&mIMIPSend,IMIPdirectsend);
277 addItemStringList("AdditionalMails",&mAdditionalMails,""); 278 addItemStringList("AdditionalMails",&mAdditionalMails,"");
278 addItemInt("IMIP auto refresh",&mIMIPAutoRefresh,neverAuto); 279 addItemInt("IMIP auto refresh",&mIMIPAutoRefresh,neverAuto);
279 addItemInt("IMIP auto insert request",&mIMIPAutoInsertRequest,neverAuto); 280 addItemInt("IMIP auto insert request",&mIMIPAutoInsertRequest,neverAuto);
280 addItemInt("IMIP auto insert reply",&mIMIPAutoInsertReply,neverAuto); 281 addItemInt("IMIP auto insert reply",&mIMIPAutoInsertReply,neverAuto);
diff --git a/korganizer/koprefs.h b/korganizer/koprefs.h
index 69722a1..b3acda7 100644
--- a/korganizer/koprefs.h
+++ b/korganizer/koprefs.h
@@ -184,93 +184,95 @@ class KOPrefs : public KPimPrefs
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; 193 bool mShowTimeInAgenda;
194 bool mHideNonStartedTodos; 194 bool mHideNonStartedTodos;
195 195
196 int mLastSyncTime; 196 int mLastSyncTime;
197 void setCategoryColor(QString cat,const QColor & color); 197 void setCategoryColor(QString cat,const QColor & color);
198 QColor *categoryColor(QString cat); 198 QColor *categoryColor(QString cat);
199 199
200 QString mArchiveFile; 200 QString mArchiveFile;
201 QString mHtmlExportFile; 201 QString mHtmlExportFile;
202 bool mHtmlWithSave; 202 bool mHtmlWithSave;
203 203
204 QStringList mSelectedPlugins; 204 QStringList mSelectedPlugins;
205 205
206 QString mLastImportFile; 206 QString mLastImportFile;
207 QString mLastVcalFile; 207 QString mLastVcalFile;
208 QString mLastSaveFile; 208 QString mLastSaveFile;
209 QString mLastLoadFile; 209 QString mLastLoadFile;
210 210
211 211
212 QString mDefaultAlarmFile; 212 QString mDefaultAlarmFile;
213 int mIMIPScheduler; 213 int mIMIPScheduler;
214 int mIMIPSend; 214 int mIMIPSend;
215 QStringList mAdditionalMails; 215 QStringList mAdditionalMails;
216 int mIMIPAutoRefresh; 216 int mIMIPAutoRefresh;
217 int mIMIPAutoInsertReply; 217 int mIMIPAutoInsertReply;
218 int mIMIPAutoInsertRequest; 218 int mIMIPAutoInsertRequest;
219 int mIMIPAutoFreeBusy; 219 int mIMIPAutoFreeBusy;
220 int mIMIPAutoFreeBusyReply; 220 int mIMIPAutoFreeBusyReply;
221 221
222 QStringList mTodoTemplates; 222 QStringList mTodoTemplates;
223 QStringList mEventTemplates; 223 QStringList mEventTemplates;
224 224
225 int mDestination; 225 int mDestination;
226 226
227 227
228 bool mEditOnDoubleClick; 228 bool mEditOnDoubleClick;
229 bool mViewChangeHoldFullscreen; 229 bool mViewChangeHoldFullscreen;
230 bool mViewChangeHoldNonFullscreen; 230 bool mViewChangeHoldNonFullscreen;
231 bool mCenterOnCurrentTime; 231 bool mCenterOnCurrentTime;
232 bool mSetTimeToDayStartAt; 232 bool mSetTimeToDayStartAt;
233 bool mHighlightCurrentDay; 233 bool mHighlightCurrentDay;
234 bool mUseHighlightLightColor; 234 bool mUseHighlightLightColor;
235 bool mListViewMonthTimespan; 235 bool mListViewMonthTimespan;
236 bool mWNViewShowsParents; 236 bool mWNViewShowsParents;
237 bool mWNViewShowsPast; 237 bool mWNViewShowsPast;
238 bool mWNViewShowLocation; 238 bool mWNViewShowLocation;
239 bool mTodoViewShowsPercentage; 239 bool mTodoViewShowsPercentage;
240 bool mTodoViewUsesCatColors; 240 bool mTodoViewUsesCatColors;
241 bool mTodoViewUsesSmallFont; 241 bool mTodoViewUsesSmallFont;
242 bool mTodoViewUsesForegroundColor; 242 bool mTodoViewUsesForegroundColor;
243 bool mMonthViewUsesForegroundColor; 243 bool mMonthViewUsesForegroundColor;
244 244
245 bool mHightlightDateTimeEdit; 245 bool mHightlightDateTimeEdit;
246 bool mShortDateInViewer; 246 bool mShortDateInViewer;
247 247
248 bool mShowDateNavigator;
249
248 QStringList mLocationDefaults; 250 QStringList mLocationDefaults;
249 QStringList mEventSummaryUser; 251 QStringList mEventSummaryUser;
250 QStringList mTodoSummaryUser; 252 QStringList mTodoSummaryUser;
251 253
252 bool mUseInternalAlarmNotification; 254 bool mUseInternalAlarmNotification;
253 int mAlarmPlayBeeps; 255 int mAlarmPlayBeeps;
254 int mAlarmSuspendTime; 256 int mAlarmSuspendTime;
255 int mAlarmSuspendCount; 257 int mAlarmSuspendCount;
256 int mAlarmBeepInterval; 258 int mAlarmBeepInterval;
257 int mOldLanguage; 259 int mOldLanguage;
258 int mOldLoadedLanguage; 260 int mOldLoadedLanguage;
259 261
260 262
261 QString mActiveSyncPort; 263 QString mActiveSyncPort;
262 QString mActiveSyncIP; 264 QString mActiveSyncIP;
263 265
264 private: 266 private:
265 QDict<QColor> mCategoryColors; 267 QDict<QColor> mCategoryColors;
266 QColor mDefaultCategoryColor; 268 QColor mDefaultCategoryColor;
267 269
268 QFont mDefaultTimeBarFont; 270 QFont mDefaultTimeBarFont;
269 QFont mDefaultViewFont; 271 QFont mDefaultViewFont;
270 QFont mDefaultMonthViewFont; 272 QFont mDefaultMonthViewFont;
271 273
272 QString mName; 274 QString mName;
273 QString mEmail; 275 QString mEmail;
274}; 276};
275 277
276#endif 278#endif
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index 5ec7ddd..151b55b 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -1577,156 +1577,160 @@ void MainWindow::keyPressEvent ( QKeyEvent * e )
1577 case Qt::Key_F: 1577 case Qt::Key_F:
1578 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) 1578 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton )
1579 mView->editFilters(); 1579 mView->editFilters();
1580 else 1580 else
1581 mView->toggleFilter(); 1581 mView->toggleFilter();
1582 break; 1582 break;
1583 case Qt::Key_X: 1583 case Qt::Key_X:
1584 mView->toggleDateNavigatorWidget(); 1584 mView->toggleDateNavigatorWidget();
1585 break; 1585 break;
1586 case Qt::Key_Space: 1586 case Qt::Key_Space:
1587 mView->toggleExpand(); 1587 mView->toggleExpand();
1588 break; 1588 break;
1589 case Qt::Key_A: 1589 case Qt::Key_A:
1590 mView->toggleAllDaySize(); 1590 mView->toggleAllDaySize();
1591 break; 1591 break;
1592 case Qt::Key_T: 1592 case Qt::Key_T:
1593 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) 1593 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton )
1594 mView->newTodo(); 1594 mView->newTodo();
1595 else { 1595 else {
1596 mView->goToday(); 1596 mView->goToday();
1597 showSelectedDates = true; 1597 showSelectedDates = true;
1598 } 1598 }
1599 break; 1599 break;
1600 case Qt::Key_J: 1600 case Qt::Key_J:
1601 mView->viewManager()->showJournalView(); 1601 mView->viewManager()->showJournalView();
1602 break; 1602 break;
1603 case Qt::Key_B: 1603 case Qt::Key_B:
1604 mView->editIncidenceDescription();; 1604 mView->editIncidenceDescription();;
1605 break; 1605 break;
1606 // case Qt::Key_Return: 1606 // case Qt::Key_Return:
1607 case Qt::Key_E: 1607 case Qt::Key_E:
1608 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) 1608 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton )
1609 mView->newEvent(); 1609 mView->newEvent();
1610 else 1610 else
1611 mView->editIncidence(); 1611 mView->editIncidence();
1612 break; 1612 break;
1613 case Qt::Key_Plus: 1613 case Qt::Key_Plus:
1614 size = p->mHourSize +2; 1614 size = p->mHourSize +2;
1615 if ( size <= 18 ) 1615 if ( size <= 18 )
1616 configureAgenda( size ); 1616 configureAgenda( size );
1617 break; 1617 break;
1618 case Qt::Key_Minus: 1618 case Qt::Key_Minus:
1619 size = p->mHourSize - 2; 1619 size = p->mHourSize - 2;
1620 if ( size >= 4 ) 1620 if ( size >= 4 )
1621 configureAgenda( size ); 1621 configureAgenda( size );
1622 break; 1622 break;
1623 1623
1624 1624
1625 default: 1625 default:
1626 e->ignore(); 1626 e->ignore();
1627 } 1627 }
1628 if ( pro > 0 ) { 1628 if ( pro > 0 ) {
1629 mView->selectFilter( pro-1 ); 1629 mView->selectFilter( pro-1 );
1630 } 1630 }
1631 if ( showSelectedDates ) { 1631 if ( showSelectedDates ) {
1632 ;// setCaptionToDates(); 1632 ;// setCaptionToDates();
1633 } 1633 }
1634 1634
1635} 1635}
1636 1636
1637void MainWindow::fillFilterMenu() 1637void MainWindow::fillFilterMenu()
1638{ 1638{
1639 selectFilterMenu->clear(); 1639 selectFilterMenu->clear();
1640 bool disable = false; 1640 bool disable = false;
1641 selectFilterMenu->insertItem(i18n ( "Edit Filters" ), 0 );
1642 selectFilterMenu->insertSeparator();
1641 if ( mView->filterView()->filtersEnabled() ) { 1643 if ( mView->filterView()->filtersEnabled() ) {
1642 selectFilterMenu->insertItem(i18n ( "Turn filter off" ), 0 ); 1644 selectFilterMenu->insertItem(i18n ( "Turn filter off" ), 1 );
1643 } 1645 }
1644 else { 1646 else {
1645 selectFilterMenu->insertItem(i18n ( "Turn filter on" ), 0 ); 1647 selectFilterMenu->insertItem(i18n ( "Turn filter on" ), 1 );
1646 disable = true; 1648 disable = true;
1647 } 1649 }
1648 selectFilterMenu->insertSeparator(); 1650 selectFilterMenu->insertSeparator();
1649 QPtrList<CalFilter> fili = mView->filters(); 1651 QPtrList<CalFilter> fili = mView->filters();
1650 CalFilter *curfilter = mView->filterView()->selectedFilter(); 1652 CalFilter *curfilter = mView->filterView()->selectedFilter();
1651 CalFilter *filter = fili.first(); 1653 CalFilter *filter = fili.first();
1652 int iii = 1; 1654 int iii = 2;
1653 while(filter) { 1655 while(filter) {
1654 selectFilterMenu->insertItem( filter->name(), iii ); 1656 selectFilterMenu->insertItem( filter->name(), iii );
1655 if ( filter == curfilter) 1657 if ( filter == curfilter)
1656 selectFilterMenu->setItemChecked( iii, true ); 1658 selectFilterMenu->setItemChecked( iii, true );
1657 if ( disable ) 1659 if ( disable )
1658 selectFilterMenu->setItemEnabled( iii, false ); 1660 selectFilterMenu->setItemEnabled( iii, false );
1659 filter = fili.next(); 1661 filter = fili.next();
1660 ++iii; 1662 ++iii;
1661 } 1663 }
1662} 1664}
1663void MainWindow::selectFilter( int fil ) 1665void MainWindow::selectFilter( int fil )
1664{ 1666{
1665 if ( fil == 0 ) { 1667 if ( fil == 0 ) {
1668 mView->editFilters( );
1669 } else if ( fil == 1 ){
1666 mView->toggleFilerEnabled( ); 1670 mView->toggleFilerEnabled( );
1667 } else { 1671 } else {
1668 mView->selectFilter( fil-1 ); 1672 mView->selectFilter( fil-2 );
1669 } 1673 }
1670} 1674}
1671void MainWindow::configureToolBar( int item ) 1675void MainWindow::configureToolBar( int item )
1672{ 1676{
1673 1677
1674 configureToolBarMenu->setItemChecked( item, !configureToolBarMenu-> isItemChecked ( item ) ); 1678 configureToolBarMenu->setItemChecked( item, !configureToolBarMenu-> isItemChecked ( item ) );
1675 KOPrefs *p = KOPrefs::instance(); 1679 KOPrefs *p = KOPrefs::instance();
1676 p-> mShowIconStretch= configureToolBarMenu->isItemChecked( 5 ); 1680 p-> mShowIconStretch= configureToolBarMenu->isItemChecked( 5 );
1677 p-> mShowIconNewEvent= configureToolBarMenu->isItemChecked( 10 ); 1681 p-> mShowIconNewEvent= configureToolBarMenu->isItemChecked( 10 );
1678 p->mShowIconNewTodo = configureToolBarMenu->isItemChecked( 20 ); 1682 p->mShowIconNewTodo = configureToolBarMenu->isItemChecked( 20 );
1679 p-> mShowIconSearch= configureToolBarMenu->isItemChecked( 120 ); 1683 p-> mShowIconSearch= configureToolBarMenu->isItemChecked( 120 );
1680 p-> mShowIconList= configureToolBarMenu->isItemChecked( 30 ); 1684 p-> mShowIconList= configureToolBarMenu->isItemChecked( 30 );
1681 p-> mShowIconDay1= configureToolBarMenu->isItemChecked( 40 ); 1685 p-> mShowIconDay1= configureToolBarMenu->isItemChecked( 40 );
1682 p-> mShowIconDay5= configureToolBarMenu->isItemChecked( 50 ); 1686 p-> mShowIconDay5= configureToolBarMenu->isItemChecked( 50 );
1683 p-> mShowIconDay7= configureToolBarMenu->isItemChecked( 60 ); 1687 p-> mShowIconDay7= configureToolBarMenu->isItemChecked( 60 );
1684 p-> mShowIconMonth= configureToolBarMenu->isItemChecked( 70 ); 1688 p-> mShowIconMonth= configureToolBarMenu->isItemChecked( 70 );
1685 p-> mShowIconTodoview= configureToolBarMenu->isItemChecked( 80 ); 1689 p-> mShowIconTodoview= configureToolBarMenu->isItemChecked( 80 );
1686 p-> mShowIconBackFast= configureToolBarMenu->isItemChecked( 200 ); 1690 p-> mShowIconBackFast= configureToolBarMenu->isItemChecked( 200 );
1687 p-> mShowIconBack = configureToolBarMenu->isItemChecked( 210 ); 1691 p-> mShowIconBack = configureToolBarMenu->isItemChecked( 210 );
1688 p-> mShowIconToday= configureToolBarMenu->isItemChecked( 130 ); 1692 p-> mShowIconToday= configureToolBarMenu->isItemChecked( 130 );
1689 p-> mShowIconForward= configureToolBarMenu->isItemChecked( 220 ); 1693 p-> mShowIconForward= configureToolBarMenu->isItemChecked( 220 );
1690 p-> mShowIconForwardFast= configureToolBarMenu->isItemChecked( 230 ); 1694 p-> mShowIconForwardFast= configureToolBarMenu->isItemChecked( 230 );
1691 p-> mShowIconNextDays= configureToolBarMenu->isItemChecked( 100 ); 1695 p-> mShowIconNextDays= configureToolBarMenu->isItemChecked( 100 );
1692 p-> mShowIconNext= configureToolBarMenu->isItemChecked( 110 ); 1696 p-> mShowIconNext= configureToolBarMenu->isItemChecked( 110 );
1693 p-> mShowIconJournal= configureToolBarMenu->isItemChecked( 90 ); 1697 p-> mShowIconJournal= configureToolBarMenu->isItemChecked( 90 );
1694 p-> mShowIconWhatsThis= configureToolBarMenu->isItemChecked( 300 ); 1698 p-> mShowIconWhatsThis= configureToolBarMenu->isItemChecked( 300 );
1695 // initActions(); 1699 // initActions();
1696} 1700}
1697 1701
1698void MainWindow::setCaptionToDates() 1702void MainWindow::setCaptionToDates()
1699{ 1703{
1700 QString selDates; 1704 QString selDates;
1701 selDates = KGlobal::locale()->formatDate(mView->startDate(), true); 1705 selDates = KGlobal::locale()->formatDate(mView->startDate(), true);
1702 if (mView->startDate() < mView->endDate() ) 1706 if (mView->startDate() < mView->endDate() )
1703 selDates += " - " + KGlobal::locale()->formatDate(mView->endDate(), true); 1707 selDates += " - " + KGlobal::locale()->formatDate(mView->endDate(), true);
1704 setCaption( i18n("Dates: ") + selDates ); 1708 setCaption( i18n("Dates: ") + selDates );
1705 1709
1706} 1710}
1707// parameter item == 0: reinit 1711// parameter item == 0: reinit
1708void MainWindow::configureAgenda( int item ) 1712void MainWindow::configureAgenda( int item )
1709{ 1713{
1710 1714
1711 KOPrefs *p = KOPrefs::instance(); 1715 KOPrefs *p = KOPrefs::instance();
1712 1716
1713 int i; 1717 int i;
1714 // do not allow 4 for widgets higher than 480 1718 // do not allow 4 for widgets higher than 480
1715 // if ( QApplication::desktop()->height() > 480 ) { 1719 // if ( QApplication::desktop()->height() > 480 ) {
1716// if ( item == 4 ) 1720// if ( item == 4 )
1717// item = 6; 1721// item = 6;
1718// } 1722// }
1719 for ( i = 4; i <= 18; i= i+2 ) 1723 for ( i = 4; i <= 18; i= i+2 )
1720 configureAgendaMenu->setItemChecked( i, false ); 1724 configureAgendaMenu->setItemChecked( i, false );
1721 configureAgendaMenu->setItemChecked( item, true ); 1725 configureAgendaMenu->setItemChecked( item, true );
1722 if ( p->mHourSize == item ) 1726 if ( p->mHourSize == item )
1723 return; 1727 return;
1724 p->mHourSize=item; 1728 p->mHourSize=item;
1725 mView->viewManager()->agendaView()->updateConfig(); 1729 mView->viewManager()->agendaView()->updateConfig();
1726} 1730}
1727 1731
1728void MainWindow::saveCalendar() 1732void MainWindow::saveCalendar()
1729{ 1733{
1730 QString fn = KOPrefs::instance()->mLastSaveFile; 1734 QString fn = KOPrefs::instance()->mLastSaveFile;
1731 fn = KFileDialog::getSaveFileName( fn, i18n("Save backup filename"), this ); 1735 fn = KFileDialog::getSaveFileName( fn, i18n("Save backup filename"), this );
1732 1736