summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-06-11 06:57:58 (UTC)
committer zautrix <zautrix>2005-06-11 06:57:58 (UTC)
commit53c616e1fe8855211377aab41b3359df5fea456c (patch) (unidiff)
tree1125bd437738f0bb414486857e14dad6b7bcfa48
parente7ff7858eb79a452b65b77f8bf5ee108503f432a (diff)
downloadkdepimpi-53c616e1fe8855211377aab41b3359df5fea456c.zip
kdepimpi-53c616e1fe8855211377aab41b3359df5fea456c.tar.gz
kdepimpi-53c616e1fe8855211377aab41b3359df5fea456c.tar.bz2
fixx
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/korganizer/bell.pngbin234 -> 639 bytes
-rw-r--r--bin/kdepim/korganizer/icons16/trash.pngbin0 -> 626 bytes
-rw-r--r--bin/kdepim/korganizer/trash.pngbin0 -> 626 bytes
-rw-r--r--korganizer/calendarview.cpp7
-rw-r--r--korganizer/calendarview.h2
-rw-r--r--korganizer/kofilterview.cpp64
-rw-r--r--korganizer/kofilterview.h11
7 files changed, 78 insertions, 6 deletions
diff --git a/bin/kdepim/korganizer/bell.png b/bin/kdepim/korganizer/bell.png
index 8d2415b..46ab9e3 100644
--- a/bin/kdepim/korganizer/bell.png
+++ b/bin/kdepim/korganizer/bell.png
Binary files differ
diff --git a/bin/kdepim/korganizer/icons16/trash.png b/bin/kdepim/korganizer/icons16/trash.png
new file mode 100644
index 0000000..ee5304a
--- a/dev/null
+++ b/bin/kdepim/korganizer/icons16/trash.png
Binary files differ
diff --git a/bin/kdepim/korganizer/trash.png b/bin/kdepim/korganizer/trash.png
new file mode 100644
index 0000000..ee5304a
--- a/dev/null
+++ b/bin/kdepim/korganizer/trash.png
Binary files differ
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 2a55127..ea100d1 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -268,385 +268,386 @@ void MissedAlarmTextBrowser::setSource(const QString & n)
268} 268}
269 269
270 270
271class KOBeamPrefs : public QDialog 271class KOBeamPrefs : public QDialog
272{ 272{
273 public: 273 public:
274 KOBeamPrefs( QWidget *parent=0, const char *name=0 ) : 274 KOBeamPrefs( QWidget *parent=0, const char *name=0 ) :
275 QDialog( parent, name, true ) 275 QDialog( parent, name, true )
276 { 276 {
277 setCaption( i18n("Beam Options") ); 277 setCaption( i18n("Beam Options") );
278 QVBoxLayout* lay = new QVBoxLayout( this ); 278 QVBoxLayout* lay = new QVBoxLayout( this );
279 lay->setSpacing( 3 ); 279 lay->setSpacing( 3 );
280 lay->setMargin( 3 ); 280 lay->setMargin( 3 );
281 QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("File format"), this ); 281 QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("File format"), this );
282 lay->addWidget( format ); 282 lay->addWidget( format );
283 format->setExclusive ( true ) ; 283 format->setExclusive ( true ) ;
284 QButtonGroup* time = new QButtonGroup(1, Horizontal, i18n("Time format"), this ); 284 QButtonGroup* time = new QButtonGroup(1, Horizontal, i18n("Time format"), this );
285 lay->addWidget( time ); time->setExclusive ( true ) ; 285 lay->addWidget( time ); time->setExclusive ( true ) ;
286 vcal = new QRadioButton(" vCalendar ", format ); 286 vcal = new QRadioButton(" vCalendar ", format );
287 ical = new QRadioButton(" iCalendar ", format ); 287 ical = new QRadioButton(" iCalendar ", format );
288 vcal->setChecked( true ); 288 vcal->setChecked( true );
289 tz = new QRadioButton(i18n(" With timezone "), time ); 289 tz = new QRadioButton(i18n(" With timezone "), time );
290 local = new QRadioButton(i18n(" Local time "), time ); 290 local = new QRadioButton(i18n(" Local time "), time );
291 tz->setChecked( true ); 291 tz->setChecked( true );
292 QPushButton * ok = new QPushButton( i18n("Beam via IR!"), this ); 292 QPushButton * ok = new QPushButton( i18n("Beam via IR!"), this );
293 lay->addWidget( ok ); 293 lay->addWidget( ok );
294 QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); 294 QPushButton * cancel = new QPushButton( i18n("Cancel"), this );
295 lay->addWidget( cancel ); 295 lay->addWidget( cancel );
296 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); 296 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) );
297 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); 297 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) );
298 resize( 200, 200 ); 298 resize( 200, 200 );
299 } 299 }
300 300
301 bool beamVcal() { return vcal->isChecked(); } 301 bool beamVcal() { return vcal->isChecked(); }
302 bool beamLocal() { return local->isChecked(); } 302 bool beamLocal() { return local->isChecked(); }
303private: 303private:
304 QRadioButton* vcal, *ical, *local, *tz; 304 QRadioButton* vcal, *ical, *local, *tz;
305}; 305};
306class KOCatPrefs : public QDialog 306class KOCatPrefs : public QDialog
307{ 307{
308 public: 308 public:
309 KOCatPrefs( QWidget *parent=0, const char *name=0 ) : 309 KOCatPrefs( QWidget *parent=0, const char *name=0 ) :
310 QDialog( parent, name, true ) 310 QDialog( parent, name, true )
311 { 311 {
312 setCaption( i18n("Manage new Categories") ); 312 setCaption( i18n("Manage new Categories") );
313 QVBoxLayout* lay = new QVBoxLayout( this ); 313 QVBoxLayout* lay = new QVBoxLayout( this );
314 lay->setSpacing( 3 ); 314 lay->setSpacing( 3 );
315 lay->setMargin( 3 ); 315 lay->setMargin( 3 );
316 QLabel * lab = new QLabel( i18n("After importing/loading/syncing\nthere may be new categories in\nevents or todos\nwhich are not in the category list.\nPlease choose what to do:\n "), this ); 316 QLabel * lab = new QLabel( i18n("After importing/loading/syncing\nthere may be new categories in\nevents or todos\nwhich are not in the category list.\nPlease choose what to do:\n "), this );
317 lay->addWidget( lab ); 317 lay->addWidget( lab );
318 QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("New categories not in list:"), this ); 318 QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("New categories not in list:"), this );
319 lay->addWidget( format ); 319 lay->addWidget( format );
320 format->setExclusive ( true ) ; 320 format->setExclusive ( true ) ;
321 addCatBut = new QRadioButton(i18n("Add to category list"), format ); 321 addCatBut = new QRadioButton(i18n("Add to category list"), format );
322 new QRadioButton(i18n("Remove from Events/Todos"), format ); 322 new QRadioButton(i18n("Remove from Events/Todos"), format );
323 addCatBut->setChecked( true ); 323 addCatBut->setChecked( true );
324 QPushButton * ok = new QPushButton( i18n("OK"), this ); 324 QPushButton * ok = new QPushButton( i18n("OK"), this );
325 lay->addWidget( ok ); 325 lay->addWidget( ok );
326 QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); 326 QPushButton * cancel = new QPushButton( i18n("Cancel"), this );
327 lay->addWidget( cancel ); 327 lay->addWidget( cancel );
328 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); 328 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) );
329 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); 329 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) );
330 resize( 200, 200 ); 330 resize( 200, 200 );
331 } 331 }
332 332
333 bool addCat() { return addCatBut->isChecked(); } 333 bool addCat() { return addCatBut->isChecked(); }
334private: 334private:
335 QRadioButton* addCatBut; 335 QRadioButton* addCatBut;
336}; 336};
337 337
338 338
339 339
340CalendarView::CalendarView( CalendarResources *calendar, 340CalendarView::CalendarView( CalendarResources *calendar,
341 QWidget *parent, const char *name ) 341 QWidget *parent, const char *name )
342 : CalendarViewBase( parent, name ), 342 : CalendarViewBase( parent, name ),
343 mCalendar( calendar ), 343 mCalendar( calendar ),
344 mResourceManager( calendar->resourceManager() ) 344 mResourceManager( calendar->resourceManager() )
345{ 345{
346 346
347 mEventEditor = 0; 347 mEventEditor = 0;
348 mTodoEditor = 0; 348 mTodoEditor = 0;
349 349
350 init(); 350 init();
351} 351}
352 352
353CalendarView::CalendarView( Calendar *calendar, 353CalendarView::CalendarView( Calendar *calendar,
354 QWidget *parent, const char *name ) 354 QWidget *parent, const char *name )
355 : CalendarViewBase( parent, name ), 355 : CalendarViewBase( parent, name ),
356 mCalendar( calendar ), 356 mCalendar( calendar ),
357 mResourceManager( 0 ) 357 mResourceManager( 0 )
358{ 358{
359 359
360 mEventEditor = 0; 360 mEventEditor = 0;
361 mTodoEditor = 0; 361 mTodoEditor = 0;
362 init(); 362 init();
363} 363}
364 364
365void CalendarView::init() 365void CalendarView::init()
366{ 366{
367 mNextAlarmDateTime = QDateTime::currentDateTime(); 367 mNextAlarmDateTime = QDateTime::currentDateTime();
368 setFocusPolicy ( NoFocus ); 368 setFocusPolicy ( NoFocus );
369 mViewerCallerIsSearchDialog = false; 369 mViewerCallerIsSearchDialog = false;
370 mBlockShowDates = false; 370 mBlockShowDates = false;
371 beamDialog = new KOBeamPrefs(); 371 beamDialog = new KOBeamPrefs();
372 mDatePickerMode = 0; 372 mDatePickerMode = 0;
373 mCurrentSyncDevice = ""; 373 mCurrentSyncDevice = "";
374 writeLocale(); 374 writeLocale();
375 mViewManager = new KOViewManager( this ); 375 mViewManager = new KOViewManager( this );
376 mDialogManager = new KODialogManager( this ); 376 mDialogManager = new KODialogManager( this );
377 mEventViewerDialog = 0; 377 mEventViewerDialog = 0;
378 mModified = false; 378 mModified = false;
379 mReadOnly = false; 379 mReadOnly = false;
380 mSelectedIncidence = 0; 380 mSelectedIncidence = 0;
381 mCalPrinter = 0; 381 mCalPrinter = 0;
382 mFilters.setAutoDelete(true); 382 mFilters.setAutoDelete(true);
383 383
384 mCalendar->registerObserver( this ); 384 mCalendar->registerObserver( this );
385 // TODO: Make sure that view is updated, when calendar is changed. 385 // TODO: Make sure that view is updated, when calendar is changed.
386 386
387 mStorage = new FileStorage( mCalendar ); 387 mStorage = new FileStorage( mCalendar );
388 mNavigator = new DateNavigator( this, "datevav", mViewManager ); 388 mNavigator = new DateNavigator( this, "datevav", mViewManager );
389 389
390 QBoxLayout *topLayout = (QBoxLayout*)layout(); 390 QBoxLayout *topLayout = (QBoxLayout*)layout();
391#ifndef KORG_NOSPLITTER 391#ifndef KORG_NOSPLITTER
392 // create the main layout frames. 392 // create the main layout frames.
393 mPanner = new QSplitter(QSplitter::Horizontal,this,"CalendarView::Panner"); 393 mPanner = new QSplitter(QSplitter::Horizontal,this,"CalendarView::Panner");
394 topLayout->addWidget(mPanner); 394 topLayout->addWidget(mPanner);
395 395
396 mLeftSplitter = new QSplitter(QSplitter::Vertical,mPanner, 396 mLeftSplitter = new QSplitter(QSplitter::Vertical,mPanner,
397 "CalendarView::LeftFrame"); 397 "CalendarView::LeftFrame");
398 mPanner->setResizeMode(mLeftSplitter,QSplitter::KeepSize); 398 mPanner->setResizeMode(mLeftSplitter,QSplitter::KeepSize);
399 399
400 mDateNavigator = new DateNavigatorContainer( mLeftSplitter, 400 mDateNavigator = new DateNavigatorContainer( mLeftSplitter,
401 "CalendarView::DateNavigator" ); 401 "CalendarView::DateNavigator" );
402 402
403 mLeftSplitter->setResizeMode(mDateNavigator,QSplitter::KeepSize); 403 mLeftSplitter->setResizeMode(mDateNavigator,QSplitter::KeepSize);
404 mTodoList = new KOTodoView(mCalendar, mLeftSplitter, "todolist_small2"); 404 mTodoList = new KOTodoView(mCalendar, mLeftSplitter, "todolist_small2");
405 mTodoList->setNavigator( mNavigator ); 405 mTodoList->setNavigator( mNavigator );
406 mFilterView = new KOFilterView(&mFilters,mLeftSplitter,"CalendarView::FilterView"); 406 mFilterView = new KOFilterView(&mFilters,mLeftSplitter,"CalendarView::FilterView");
407 407
408#ifdef KORG_NORESOURCEVIEW 408#ifdef KORG_NORESOURCEVIEW
409 mResourceView = 0; 409 mResourceView = 0;
410#else 410#else
411 if ( mResourceManager ) { 411 if ( mResourceManager ) {
412 mResourceView = new ResourceView( mResourceManager, mLeftSplitter ); 412 mResourceView = new ResourceView( mResourceManager, mLeftSplitter );
413 mResourceView->updateView(); 413 mResourceView->updateView();
414 connect( mResourceView, SIGNAL( resourcesChanged() ), 414 connect( mResourceView, SIGNAL( resourcesChanged() ),
415 SLOT( updateView() ) ); 415 SLOT( updateView() ) );
416 } else { 416 } else {
417 mResourceView = 0; 417 mResourceView = 0;
418 } 418 }
419#endif 419#endif
420 QWidget *rightBox = new QWidget( mPanner ); 420 QWidget *rightBox = new QWidget( mPanner );
421 QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); 421 QBoxLayout *rightLayout = new QVBoxLayout( rightBox );
422 422
423 mRightFrame = new QWidgetStack( rightBox ); 423 mRightFrame = new QWidgetStack( rightBox );
424 rightLayout->addWidget( mRightFrame, 1 ); 424 rightLayout->addWidget( mRightFrame, 1 );
425 425
426 mLeftFrame = mLeftSplitter; 426 mLeftFrame = mLeftSplitter;
427#else 427#else
428 //QWidget *mainBox = new QWidget( this ); 428 //QWidget *mainBox = new QWidget( this );
429 //QWidget *leftFrame = new QWidget( mainBox ); 429 //QWidget *leftFrame = new QWidget( mainBox );
430 //QBoxLayout * mainBoxLayout; 430 //QBoxLayout * mainBoxLayout;
431 if ( KOPrefs::instance()->mVerticalScreen ) { 431 if ( KOPrefs::instance()->mVerticalScreen ) {
432 //mainBoxLayout = new QVBoxLayout(mainBox); 432 //mainBoxLayout = new QVBoxLayout(mainBox);
433 //leftFrameLayout = new QHBoxLayout(leftFrame ); 433 //leftFrameLayout = new QHBoxLayout(leftFrame );
434 mMainFrame = new KDGanttMinimizeSplitter( Qt::Vertical, this ); 434 mMainFrame = new KDGanttMinimizeSplitter( Qt::Vertical, this );
435 mMainFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Up ); 435 mMainFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Up );
436 mLeftFrame = new KDGanttMinimizeSplitter( Qt::Horizontal, mMainFrame);; 436 mLeftFrame = new KDGanttMinimizeSplitter( Qt::Horizontal, mMainFrame);;
437 mLeftFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); 437 mLeftFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Right );
438 } else { 438 } else {
439 //mainBoxLayout = new QHBoxLayout(mainBox); 439 //mainBoxLayout = new QHBoxLayout(mainBox);
440 //leftFrameLayout = new QVBoxLayout(leftFrame ); 440 //leftFrameLayout = new QVBoxLayout(leftFrame );
441 mMainFrame = new KDGanttMinimizeSplitter( Qt::Horizontal, this); 441 mMainFrame = new KDGanttMinimizeSplitter( Qt::Horizontal, this);
442 mMainFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Left); 442 mMainFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Left);
443 mLeftFrame = new KDGanttMinimizeSplitter( Qt::Vertical, mMainFrame); 443 mLeftFrame = new KDGanttMinimizeSplitter( Qt::Vertical, mMainFrame);
444 mLeftFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Up ); 444 mLeftFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Up );
445 } 445 }
446 mMainFrame->setSizePolicy( QSizePolicy (QSizePolicy::Expanding,QSizePolicy::Expanding) ); 446 mMainFrame->setSizePolicy( QSizePolicy (QSizePolicy::Expanding,QSizePolicy::Expanding) );
447 //QBoxLayout * leftFrameLayout; 447 //QBoxLayout * leftFrameLayout;
448 topLayout->addWidget( mMainFrame ); 448 topLayout->addWidget( mMainFrame );
449 //mainBoxLayout->addWidget (mLeftFrame); 449 //mainBoxLayout->addWidget (mLeftFrame);
450 mDateNavigator = new DateNavigatorContainer( mLeftFrame, 450 mDateNavigator = new DateNavigatorContainer( mLeftFrame,
451 "CalendarView::DateNavigator" ); 451 "CalendarView::DateNavigator" );
452#if 0 452#if 0
453 // FIXME 453 // FIXME
454 mDateNavigator = new KDateNavigator(mLeftFrame, mCalendar, TRUE, 454 mDateNavigator = new KDateNavigator(mLeftFrame, mCalendar, TRUE,
455 "CalendarView::DateNavigator", QDate::currentDate()); 455 "CalendarView::DateNavigator", QDate::currentDate());
456#endif 456#endif
457 // mDateNavigator->blockSignals( true ); 457 // mDateNavigator->blockSignals( true );
458 //leftFrameLayout->addWidget( mDateNavigator ); 458 //leftFrameLayout->addWidget( mDateNavigator );
459 mTodoList = new KOTodoView(mCalendar, mLeftFrame, "todolistsmall"); 459 mTodoList = new KOTodoView(mCalendar, mLeftFrame, "todolistsmall");
460 mFilterView = new KOFilterView(&mFilters,mLeftFrame,"CalendarView::FilterView"); 460 mFilterView = new KOFilterView(&mFilters,mLeftFrame,"CalendarView::FilterView");
461 mCalEditView = new KOCalEditView(mLeftFrame,"CalendarView::CaleditView");
461 mTodoList->setNavigator( mNavigator ); 462 mTodoList->setNavigator( mNavigator );
462#if 0 463#if 0
463 if ( QApplication::desktop()->width() < 480 ) { 464 if ( QApplication::desktop()->width() < 480 ) {
464 leftFrameLayout->addWidget(mFilterView); 465 leftFrameLayout->addWidget(mFilterView);
465 leftFrameLayout->addWidget(mTodoList, 2 ); 466 leftFrameLayout->addWidget(mTodoList, 2 );
466 467
467 } else { 468 } else {
468 leftFrameLayout->addWidget(mTodoList,2 ); 469 leftFrameLayout->addWidget(mTodoList,2 );
469 leftFrameLayout->addWidget(mFilterView ); 470 leftFrameLayout->addWidget(mFilterView );
470 } 471 }
471#endif 472#endif
472 mFilterView->hide(); 473 mFilterView->hide();
473 QWidget *rightBox = new QWidget( mMainFrame ); 474 QWidget *rightBox = new QWidget( mMainFrame );
474 //mainBoxLayout->addWidget ( rightBox, 10 ); 475 //mainBoxLayout->addWidget ( rightBox, 10 );
475 QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); 476 QBoxLayout *rightLayout = new QVBoxLayout( rightBox );
476 mRightFrame = new QWidgetStack( rightBox ); 477 mRightFrame = new QWidgetStack( rightBox );
477 rightLayout->addWidget( mRightFrame, 10 ); 478 rightLayout->addWidget( mRightFrame, 10 );
478 479
479 //mLeftFrame = (QWidget *)leftFrame; 480 //mLeftFrame = (QWidget *)leftFrame;
480 if ( KOPrefs::instance()->mVerticalScreen ) { 481 if ( KOPrefs::instance()->mVerticalScreen ) {
481 //mDateNavigator->setFixedHeight( mDateNavigator->sizeHint().height() ); 482 //mDateNavigator->setFixedHeight( mDateNavigator->sizeHint().height() );
482 //mDateNavigator->setMinimumWidth( mDateNavigator->sizeHint().width() ); 483 //mDateNavigator->setMinimumWidth( mDateNavigator->sizeHint().width() );
483 //mTodoList->setFixedHeight( mDateNavigator->sizeHint().height() ); 484 //mTodoList->setFixedHeight( mDateNavigator->sizeHint().height() );
484 //leftFrame->setFixedHeight( mDateNavigator->sizeHint().height() ); 485 //leftFrame->setFixedHeight( mDateNavigator->sizeHint().height() );
485 } else { 486 } else {
486 //mDateNavigator->setFixedWidth( mDateNavigator->sizeHint().width() ); 487 //mDateNavigator->setFixedWidth( mDateNavigator->sizeHint().width() );
487 //mTodoList->setFixedWidth( mDateNavigator->sizeHint().width() ); 488 //mTodoList->setFixedWidth( mDateNavigator->sizeHint().width() );
488 //leftFrame->setFixedWidth( mDateNavigator->sizeHint().width() ); 489 //leftFrame->setFixedWidth( mDateNavigator->sizeHint().width() );
489 } 490 }
490 if ( !KOPrefs::instance()->mShowDateNavigator) 491 if ( !KOPrefs::instance()->mShowDateNavigator)
491 mDateNavigator->hide(); 492 mDateNavigator->hide();
492 //qDebug("Calendarview Size %d %d ", width(), height()); 493 //qDebug("Calendarview Size %d %d ", width(), height());
493#endif 494#endif
494 495
495 connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), 496 connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ),
496 SLOT( showDates( const KCal::DateList & ) ) ); 497 SLOT( showDates( const KCal::DateList & ) ) );
497 498
498 connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), 499 connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ),
499 mDateNavigator, SLOT( selectDates( const KCal::DateList & ) ) ); 500 mDateNavigator, SLOT( selectDates( const KCal::DateList & ) ) );
500 501
501 502
502 503
503 connect( mDateNavigator, SIGNAL( showMonth( const QDate & ) ), 504 connect( mDateNavigator, SIGNAL( showMonth( const QDate & ) ),
504 mViewManager, SLOT( showMonth( const QDate & ) ) ); 505 mViewManager, SLOT( showMonth( const QDate & ) ) );
505 506
506 connect( mDateNavigator, SIGNAL( weekClicked( const QDate & ) ), 507 connect( mDateNavigator, SIGNAL( weekClicked( const QDate & ) ),
507 mNavigator, SLOT( selectWeek( const QDate & ) ) ); 508 mNavigator, SLOT( selectWeek( const QDate & ) ) );
508 509
509 connect( mDateNavigator, SIGNAL( goPrevYear() ), 510 connect( mDateNavigator, SIGNAL( goPrevYear() ),
510 mNavigator, SLOT( selectPreviousYear() ) ); 511 mNavigator, SLOT( selectPreviousYear() ) );
511 connect( mDateNavigator, SIGNAL( goNextYear() ), 512 connect( mDateNavigator, SIGNAL( goNextYear() ),
512 mNavigator, SLOT( selectNextYear() ) ); 513 mNavigator, SLOT( selectNextYear() ) );
513 connect( mDateNavigator, SIGNAL( goPrevMonth() ), 514 connect( mDateNavigator, SIGNAL( goPrevMonth() ),
514 mNavigator, SLOT( selectPreviousMonth() ) ); 515 mNavigator, SLOT( selectPreviousMonth() ) );
515 connect( mDateNavigator, SIGNAL( goNextMonth() ), 516 connect( mDateNavigator, SIGNAL( goNextMonth() ),
516 mNavigator, SLOT( selectNextMonth() ) ); 517 mNavigator, SLOT( selectNextMonth() ) );
517 518
518 connect( mDateNavigator, SIGNAL( goPrevious() ), 519 connect( mDateNavigator, SIGNAL( goPrevious() ),
519 mNavigator, SLOT( selectPrevious() ) ); 520 mNavigator, SLOT( selectPrevious() ) );
520 connect( mDateNavigator, SIGNAL( goNext() ), 521 connect( mDateNavigator, SIGNAL( goNext() ),
521 mNavigator, SLOT( selectNext() ) ); 522 mNavigator, SLOT( selectNext() ) );
522 connect( mDateNavigator, SIGNAL( monthSelected ( int ) ), 523 connect( mDateNavigator, SIGNAL( monthSelected ( int ) ),
523 mNavigator, SLOT( slotMonthSelect( int ) ) ); 524 mNavigator, SLOT( slotMonthSelect( int ) ) );
524 525
525 connect( mDateNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), 526 connect( mDateNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ),
526 mNavigator, SLOT( selectDates( const KCal::DateList & ) ) ); 527 mNavigator, SLOT( selectDates( const KCal::DateList & ) ) );
527#if 0 528#if 0
528 connect( mDateNavigator, SIGNAL( incidenceDropped( Incidence * ) ), 529 connect( mDateNavigator, SIGNAL( incidenceDropped( Incidence * ) ),
529 SLOT( incidenceAdded( Incidence *) ) ); 530 SLOT( incidenceAdded( Incidence *) ) );
530#endif 531#endif
531 // connect(mDateNavigator,SIGNAL(dayPassed(QDate)),SLOT(updateView())); 532 // connect(mDateNavigator,SIGNAL(dayPassed(QDate)),SLOT(updateView()));
532 533
533 connect( this, SIGNAL( configChanged() ), 534 connect( this, SIGNAL( configChanged() ),
534 mDateNavigator, SLOT( updateConfig() ) ); 535 mDateNavigator, SLOT( updateConfig() ) );
535 536
536 connect( mTodoList, SIGNAL( newTodoSignal() ), 537 connect( mTodoList, SIGNAL( newTodoSignal() ),
537 SLOT( newTodo() ) ); 538 SLOT( newTodo() ) );
538 connect( mTodoList, SIGNAL( newSubTodoSignal( Todo *) ), 539 connect( mTodoList, SIGNAL( newSubTodoSignal( Todo *) ),
539 SLOT( newSubTodo( Todo * ) ) ); 540 SLOT( newSubTodo( Todo * ) ) );
540 connect( mTodoList, SIGNAL( editTodoSignal( Todo * ) ), 541 connect( mTodoList, SIGNAL( editTodoSignal( Todo * ) ),
541 SLOT( editTodo( Todo * ) ) ); 542 SLOT( editTodo( Todo * ) ) );
542 connect( mTodoList, SIGNAL( showTodoSignal( Todo * ) ), 543 connect( mTodoList, SIGNAL( showTodoSignal( Todo * ) ),
543 SLOT( showTodo( Todo *) ) ); 544 SLOT( showTodo( Todo *) ) );
544 connect( mTodoList, SIGNAL( deleteTodoSignal( Todo *) ), 545 connect( mTodoList, SIGNAL( deleteTodoSignal( Todo *) ),
545 SLOT( deleteTodo( Todo *) ) ); 546 SLOT( deleteTodo( Todo *) ) );
546 connect( this, SIGNAL( configChanged()), mTodoList, SLOT( updateConfig() ) ); 547 connect( this, SIGNAL( configChanged()), mTodoList, SLOT( updateConfig() ) );
547 connect( mTodoList, SIGNAL( purgeCompletedSignal() ), 548 connect( mTodoList, SIGNAL( purgeCompletedSignal() ),
548 SLOT( purgeCompleted() ) ); 549 SLOT( purgeCompleted() ) );
549 connect( mTodoList, SIGNAL( todoModifiedSignal( Todo *, int ) ), 550 connect( mTodoList, SIGNAL( todoModifiedSignal( Todo *, int ) ),
550 SIGNAL( todoModified( Todo *, int ) ) ); 551 SIGNAL( todoModified( Todo *, int ) ) );
551 552
552 connect( mTodoList, SIGNAL( cloneTodoSignal( Incidence * ) ), 553 connect( mTodoList, SIGNAL( cloneTodoSignal( Incidence * ) ),
553 this, SLOT ( cloneIncidence( Incidence * ) ) ); 554 this, SLOT ( cloneIncidence( Incidence * ) ) );
554 connect( mTodoList, SIGNAL( cancelTodoSignal( Incidence * ) ), 555 connect( mTodoList, SIGNAL( cancelTodoSignal( Incidence * ) ),
555 this, SLOT (cancelIncidence( Incidence * ) ) ); 556 this, SLOT (cancelIncidence( Incidence * ) ) );
556 557
557 connect( mTodoList, SIGNAL( moveTodoSignal( Incidence * ) ), 558 connect( mTodoList, SIGNAL( moveTodoSignal( Incidence * ) ),
558 this, SLOT ( moveIncidence( Incidence * ) ) ); 559 this, SLOT ( moveIncidence( Incidence * ) ) );
559 connect( mTodoList, SIGNAL( beamTodoSignal( Incidence * ) ), 560 connect( mTodoList, SIGNAL( beamTodoSignal( Incidence * ) ),
560 this, SLOT ( beamIncidence( Incidence * ) ) ); 561 this, SLOT ( beamIncidence( Incidence * ) ) );
561 562
562 connect( mTodoList, SIGNAL( unparentTodoSignal( Todo * ) ), 563 connect( mTodoList, SIGNAL( unparentTodoSignal( Todo * ) ),
563 this, SLOT ( todo_unsub( Todo * ) ) ); 564 this, SLOT ( todo_unsub( Todo * ) ) );
564 565
565 connect( mTodoList, SIGNAL( reparentTodoSignal( Todo *,Todo * ) ), 566 connect( mTodoList, SIGNAL( reparentTodoSignal( Todo *,Todo * ) ),
566 this, SLOT ( todo_resub( Todo *,Todo * ) ) ); 567 this, SLOT ( todo_resub( Todo *,Todo * ) ) );
567 connect( this, SIGNAL( todoModified( Todo *, int )), mTodoList, 568 connect( this, SIGNAL( todoModified( Todo *, int )), mTodoList,
568 SLOT( updateTodo( Todo *, int ) ) ); 569 SLOT( updateTodo( Todo *, int ) ) );
569 connect( this, SIGNAL( todoModified( Todo *, int )), this, 570 connect( this, SIGNAL( todoModified( Todo *, int )), this,
570 SLOT( changeTodoDisplay( Todo *, int ) ) ); 571 SLOT( changeTodoDisplay( Todo *, int ) ) );
571 572
572 573
573 connect( mFilterView, SIGNAL( filterChanged() ), SLOT( updateFilter() ) ); 574 connect( mFilterView, SIGNAL( filterChanged() ), SLOT( updateFilter() ) );
574 connect( mFilterView, SIGNAL( editFilters() ), SLOT( editFilters() ) ); 575 connect( mFilterView, SIGNAL( editFilters() ), SLOT( editFilters() ) );
575 connect( mCalendar, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addAlarm(const QDateTime &, const QString & ) ) ); 576 connect( mCalendar, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addAlarm(const QDateTime &, const QString & ) ) );
576 connect( mCalendar, SIGNAL( removeAlarm(const QDateTime &, const QString & ) ), SLOT( removeAlarm(const QDateTime &, const QString & ) ) ); 577 connect( mCalendar, SIGNAL( removeAlarm(const QDateTime &, const QString & ) ), SLOT( removeAlarm(const QDateTime &, const QString & ) ) );
577 578
578 579
579 580
580 581
581 582
582 connect(QApplication::clipboard(),SIGNAL(dataChanged()), 583 connect(QApplication::clipboard(),SIGNAL(dataChanged()),
583 SLOT(checkClipboard())); 584 SLOT(checkClipboard()));
584 connect( mTodoList,SIGNAL( incidenceSelected( Incidence * ) ), 585 connect( mTodoList,SIGNAL( incidenceSelected( Incidence * ) ),
585 SLOT( processTodoListSelection( Incidence * ) ) ); 586 SLOT( processTodoListSelection( Incidence * ) ) );
586 connect(mTodoList,SIGNAL(isModified(bool)),SLOT(setModified(bool))); 587 connect(mTodoList,SIGNAL(isModified(bool)),SLOT(setModified(bool)));
587 588
588 // kdDebug() << "CalendarView::CalendarView() done" << endl; 589 // kdDebug() << "CalendarView::CalendarView() done" << endl;
589 590
590 mDateFrame = new QVBox(0,0,WType_Popup); 591 mDateFrame = new QVBox(0,0,WType_Popup);
591 //mDateFrame->setFrameStyle(QFrame::PopupPanel | QFrame::Raised); 592 //mDateFrame->setFrameStyle(QFrame::PopupPanel | QFrame::Raised);
592 mDateFrame->setFrameStyle( QFrame::WinPanel |QFrame::Raised ); 593 mDateFrame->setFrameStyle( QFrame::WinPanel |QFrame::Raised );
593 mDateFrame->setLineWidth(3); 594 mDateFrame->setLineWidth(3);
594 mDateFrame->hide(); 595 mDateFrame->hide();
595 mDateFrame->setCaption( i18n( "Pick a date to display")); 596 mDateFrame->setCaption( i18n( "Pick a date to display"));
596 mDatePicker = new KDatePicker ( mDateFrame , QDate::currentDate() ); 597 mDatePicker = new KDatePicker ( mDateFrame , QDate::currentDate() );
597 598
598 connect(mDatePicker,SIGNAL(dateSelected(QDate)),SLOT(slotSelectPickerDate(QDate))); 599 connect(mDatePicker,SIGNAL(dateSelected(QDate)),SLOT(slotSelectPickerDate(QDate)));
599 600
600 mEventEditor = mDialogManager->getEventEditor(); 601 mEventEditor = mDialogManager->getEventEditor();
601 mTodoEditor = mDialogManager->getTodoEditor(); 602 mTodoEditor = mDialogManager->getTodoEditor();
602 603
603 mFlagEditDescription = false; 604 mFlagEditDescription = false;
604 605
605 mSuspendTimer = new QTimer( this ); 606 mSuspendTimer = new QTimer( this );
606 mAlarmTimer = new QTimer( this ); 607 mAlarmTimer = new QTimer( this );
607 mRecheckAlarmTimer = new QTimer( this ); 608 mRecheckAlarmTimer = new QTimer( this );
608 connect( mRecheckAlarmTimer, SIGNAL( timeout () ), SLOT( recheckTimerAlarm() ) ); 609 connect( mRecheckAlarmTimer, SIGNAL( timeout () ), SLOT( recheckTimerAlarm() ) );
609 connect( mSuspendTimer, SIGNAL( timeout () ), SLOT( suspendAlarm() ) ); 610 connect( mSuspendTimer, SIGNAL( timeout () ), SLOT( suspendAlarm() ) );
610 connect( mAlarmTimer, SIGNAL( timeout () ), SLOT( timerAlarm() ) ); 611 connect( mAlarmTimer, SIGNAL( timeout () ), SLOT( timerAlarm() ) );
611 mAlarmDialog = new AlarmDialog( this ); 612 mAlarmDialog = new AlarmDialog( this );
612 connect( mAlarmDialog, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addSuspendAlarm(const QDateTime &, const QString & ) ) ); 613 connect( mAlarmDialog, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addSuspendAlarm(const QDateTime &, const QString & ) ) );
613 mAlarmDialog->setServerNotification( false ); 614 mAlarmDialog->setServerNotification( false );
614 mAlarmDialog->setSuspendTime( KOPrefs::instance()->mAlarmSuspendTime ); 615 mAlarmDialog->setSuspendTime( KOPrefs::instance()->mAlarmSuspendTime );
615 616
616 617
617#ifndef DESKTOP_VERSION 618#ifndef DESKTOP_VERSION
618//US listen for arriving address resultsets 619//US listen for arriving address resultsets
619 connect(ExternalAppHandler::instance(), SIGNAL(receivedBirthdayListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)), 620 connect(ExternalAppHandler::instance(), SIGNAL(receivedBirthdayListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)),
620 this, SLOT(insertBirthdays(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&))); 621 this, SLOT(insertBirthdays(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)));
621#endif 622#endif
622 mDateNavigator->setCalendar( mCalendar ); 623 mDateNavigator->setCalendar( mCalendar );
623} 624}
624 625
625 626
626CalendarView::~CalendarView() 627CalendarView::~CalendarView()
627{ 628{
628 // kdDebug() << "~CalendarView()" << endl; 629 // kdDebug() << "~CalendarView()" << endl;
629 //qDebug("CalendarView::~CalendarView() "); 630 //qDebug("CalendarView::~CalendarView() ");
630 delete mDialogManager; 631 delete mDialogManager;
631 delete mViewManager; 632 delete mViewManager;
632 delete mStorage; 633 delete mStorage;
633 delete mDateFrame ; 634 delete mDateFrame ;
634 delete beamDialog; 635 delete beamDialog;
635 delete mEventViewerDialog; 636 delete mEventViewerDialog;
636 //kdDebug() << "~CalendarView() done" << endl; 637 //kdDebug() << "~CalendarView() done" << endl;
637} 638}
638void CalendarView::checkAlarms() 639void CalendarView::checkAlarms()
639{ 640{
640 KConfig *config = KOGlobals::config(); 641 KConfig *config = KOGlobals::config();
641 config->setGroup( "AppRun" ); 642 config->setGroup( "AppRun" );
642 QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) ); 643 QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) );
643 int secto = dt.secsTo( QDateTime::currentDateTime() ); 644 int secto = dt.secsTo( QDateTime::currentDateTime() );
644 int secs = config->readNumEntry( "LatestProgramStop" , secto) - 30; 645 int secs = config->readNumEntry( "LatestProgramStop" , secto) - 30;
645 //secs -= ( 3600 * 24*3 ); // debug only 646 //secs -= ( 3600 * 24*3 ); // debug only
646 QDateTime latest = dt.addSecs ( secs ); 647 QDateTime latest = dt.addSecs ( secs );
647 qDebug("KO: Last termination on %s ", latest.toString().latin1()); 648 qDebug("KO: Last termination on %s ", latest.toString().latin1());
648 QPtrList<Incidence> el = mCalendar->rawIncidences(); 649 QPtrList<Incidence> el = mCalendar->rawIncidences();
649 QPtrList<Incidence> al; 650 QPtrList<Incidence> al;
650 Incidence* inL = el.first(); 651 Incidence* inL = el.first();
651 while ( inL ) { 652 while ( inL ) {
652 bool ok = false; 653 bool ok = false;
@@ -3719,386 +3720,390 @@ bool CalendarView::exportVCalendar( QString filename )
3719 i18n("Data Loss Warning"),i18n("Proceed"),i18n("Cancel"), 3720 i18n("Data Loss Warning"),i18n("Proceed"),i18n("Cancel"),
3720 true); 3721 true);
3721 if (result != KMessageBox::Continue) return false; 3722 if (result != KMessageBox::Continue) return false;
3722 } 3723 }
3723 3724
3724 //QString filename = KFileDialog::getSaveFileName("vcalout.vcs",i18n("*.vcs|VCalendars"),this); 3725 //QString filename = KFileDialog::getSaveFileName("vcalout.vcs",i18n("*.vcs|VCalendars"),this);
3725 3726
3726 // Force correct extension 3727 // Force correct extension
3727 if (filename.right(4) != ".vcs") filename += ".vcs"; 3728 if (filename.right(4) != ".vcs") filename += ".vcs";
3728 3729
3729 FileStorage storage( mCalendar, filename, new VCalFormat ); 3730 FileStorage storage( mCalendar, filename, new VCalFormat );
3730 return storage.save(); 3731 return storage.save();
3731 3732
3732} 3733}
3733 3734
3734void CalendarView::eventUpdated(Incidence *) 3735void CalendarView::eventUpdated(Incidence *)
3735{ 3736{
3736 setModified(); 3737 setModified();
3737 // Don't call updateView here. The code, which has caused the update of the 3738 // Don't call updateView here. The code, which has caused the update of the
3738 // event is responsible for updating the view. 3739 // event is responsible for updating the view.
3739 // updateView(); 3740 // updateView();
3740} 3741}
3741 3742
3742void CalendarView::adaptNavigationUnits() 3743void CalendarView::adaptNavigationUnits()
3743{ 3744{
3744 if (mViewManager->currentView()->isEventView()) { 3745 if (mViewManager->currentView()->isEventView()) {
3745 int days = mViewManager->currentView()->currentDateCount(); 3746 int days = mViewManager->currentView()->currentDateCount();
3746 if (days == 1) { 3747 if (days == 1) {
3747 emit changeNavStringPrev(i18n("&Previous Day")); 3748 emit changeNavStringPrev(i18n("&Previous Day"));
3748 emit changeNavStringNext(i18n("&Next Day")); 3749 emit changeNavStringNext(i18n("&Next Day"));
3749 } else { 3750 } else {
3750 emit changeNavStringPrev(i18n("&Previous Week")); 3751 emit changeNavStringPrev(i18n("&Previous Week"));
3751 emit changeNavStringNext(i18n("&Next Week")); 3752 emit changeNavStringNext(i18n("&Next Week"));
3752 } 3753 }
3753 } 3754 }
3754} 3755}
3755 3756
3756void CalendarView::processMainViewSelection( Incidence *incidence ) 3757void CalendarView::processMainViewSelection( Incidence *incidence )
3757{ 3758{
3758 if ( incidence ) mTodoList->clearSelection(); 3759 if ( incidence ) mTodoList->clearSelection();
3759 processIncidenceSelection( incidence ); 3760 processIncidenceSelection( incidence );
3760} 3761}
3761 3762
3762void CalendarView::processTodoListSelection( Incidence *incidence ) 3763void CalendarView::processTodoListSelection( Incidence *incidence )
3763{ 3764{
3764 if ( incidence && mViewManager->currentView() ) { 3765 if ( incidence && mViewManager->currentView() ) {
3765 mViewManager->currentView()->clearSelection(); 3766 mViewManager->currentView()->clearSelection();
3766 } 3767 }
3767 processIncidenceSelection( incidence ); 3768 processIncidenceSelection( incidence );
3768} 3769}
3769 3770
3770void CalendarView::processIncidenceSelection( Incidence *incidence ) 3771void CalendarView::processIncidenceSelection( Incidence *incidence )
3771{ 3772{
3772 if ( incidence == mSelectedIncidence ) return; 3773 if ( incidence == mSelectedIncidence ) return;
3773 3774
3774 mSelectedIncidence = incidence; 3775 mSelectedIncidence = incidence;
3775 3776
3776 emit incidenceSelected( mSelectedIncidence ); 3777 emit incidenceSelected( mSelectedIncidence );
3777 3778
3778 if ( incidence && incidence->typeID() == eventID ) { 3779 if ( incidence && incidence->typeID() == eventID ) {
3779 Event *event = static_cast<Event *>( incidence ); 3780 Event *event = static_cast<Event *>( incidence );
3780 if ( event->organizer() == KOPrefs::instance()->email() ) { 3781 if ( event->organizer() == KOPrefs::instance()->email() ) {
3781 emit organizerEventsSelected( true ); 3782 emit organizerEventsSelected( true );
3782 } else { 3783 } else {
3783 emit organizerEventsSelected(false); 3784 emit organizerEventsSelected(false);
3784 } 3785 }
3785 if (event->attendeeByMails( KOPrefs::instance()->mAdditionalMails, 3786 if (event->attendeeByMails( KOPrefs::instance()->mAdditionalMails,
3786 KOPrefs::instance()->email() ) ) { 3787 KOPrefs::instance()->email() ) ) {
3787 emit groupEventsSelected( true ); 3788 emit groupEventsSelected( true );
3788 } else { 3789 } else {
3789 emit groupEventsSelected(false); 3790 emit groupEventsSelected(false);
3790 } 3791 }
3791 return; 3792 return;
3792 } else { 3793 } else {
3793 if ( incidence && incidence->typeID() == todoID ) { 3794 if ( incidence && incidence->typeID() == todoID ) {
3794 emit todoSelected( true ); 3795 emit todoSelected( true );
3795 Todo *event = static_cast<Todo *>( incidence ); 3796 Todo *event = static_cast<Todo *>( incidence );
3796 if ( event->organizer() == KOPrefs::instance()->email() ) { 3797 if ( event->organizer() == KOPrefs::instance()->email() ) {
3797 emit organizerEventsSelected( true ); 3798 emit organizerEventsSelected( true );
3798 } else { 3799 } else {
3799 emit organizerEventsSelected(false); 3800 emit organizerEventsSelected(false);
3800 } 3801 }
3801 if (event->attendeeByMails( KOPrefs::instance()->mAdditionalMails, 3802 if (event->attendeeByMails( KOPrefs::instance()->mAdditionalMails,
3802 KOPrefs::instance()->email() ) ) { 3803 KOPrefs::instance()->email() ) ) {
3803 emit groupEventsSelected( true ); 3804 emit groupEventsSelected( true );
3804 } else { 3805 } else {
3805 emit groupEventsSelected(false); 3806 emit groupEventsSelected(false);
3806 } 3807 }
3807 return; 3808 return;
3808 } else { 3809 } else {
3809 emit todoSelected( false ); 3810 emit todoSelected( false );
3810 emit organizerEventsSelected(false); 3811 emit organizerEventsSelected(false);
3811 emit groupEventsSelected(false); 3812 emit groupEventsSelected(false);
3812 } 3813 }
3813 return; 3814 return;
3814 } 3815 }
3815 3816
3816 /* if ( incidence && incidence->typeID() == todoID ) { 3817 /* if ( incidence && incidence->typeID() == todoID ) {
3817 emit todoSelected( true ); 3818 emit todoSelected( true );
3818 } else { 3819 } else {
3819 emit todoSelected( false ); 3820 emit todoSelected( false );
3820 }*/ 3821 }*/
3821} 3822}
3822 3823
3823 3824
3824void CalendarView::checkClipboard() 3825void CalendarView::checkClipboard()
3825{ 3826{
3826#ifndef KORG_NODND 3827#ifndef KORG_NODND
3827 if (ICalDrag::canDecode(QApplication::clipboard()->data())) { 3828 if (ICalDrag::canDecode(QApplication::clipboard()->data())) {
3828 emit pasteEnabled(true); 3829 emit pasteEnabled(true);
3829 } else { 3830 } else {
3830 emit pasteEnabled(false); 3831 emit pasteEnabled(false);
3831 } 3832 }
3832#endif 3833#endif
3833} 3834}
3834 3835
3835void CalendarView::showDates(const DateList &selectedDates) 3836void CalendarView::showDates(const DateList &selectedDates)
3836{ 3837{
3837 // kdDebug() << "CalendarView::selectDates()" << endl; 3838 // kdDebug() << "CalendarView::selectDates()" << endl;
3838 3839
3839 3840
3840 if ( !mBlockShowDates ) { 3841 if ( !mBlockShowDates ) {
3841 if ( mViewManager->currentView() ) { 3842 if ( mViewManager->currentView() ) {
3842 updateView( selectedDates.first(), selectedDates.last() ); 3843 updateView( selectedDates.first(), selectedDates.last() );
3843 } else { 3844 } else {
3844 mViewManager->showAgendaView(); 3845 mViewManager->showAgendaView();
3845 } 3846 }
3846 } 3847 }
3847 3848
3848 QDate date = selectedDates.first(); 3849 QDate date = selectedDates.first();
3849 if ( ! date.isValid() ) { 3850 if ( ! date.isValid() ) {
3850 topLevelWidget()->setCaption(""); 3851 topLevelWidget()->setCaption("");
3851 return; 3852 return;
3852 } 3853 }
3853 3854
3854 QString selDates; 3855 QString selDates;
3855 selDates = KGlobal::locale()->formatDate( date, true); 3856 selDates = KGlobal::locale()->formatDate( date, true);
3856 if (selectedDates.first() < selectedDates.last() ) 3857 if (selectedDates.first() < selectedDates.last() )
3857 selDates += " - " + KGlobal::locale()->formatDate( selectedDates.last(),true); 3858 selDates += " - " + KGlobal::locale()->formatDate( selectedDates.last(),true);
3858 else { 3859 else {
3859 QString addString; 3860 QString addString;
3860 if ( date == QDateTime::currentDateTime().date() ) 3861 if ( date == QDateTime::currentDateTime().date() )
3861 addString = i18n("Today"); 3862 addString = i18n("Today");
3862 else if ( date == QDateTime::currentDateTime().date().addDays(1) ) 3863 else if ( date == QDateTime::currentDateTime().date().addDays(1) )
3863 addString = i18n("Tomorrow"); 3864 addString = i18n("Tomorrow");
3864 else if ( date == QDateTime::currentDateTime().date().addDays(-1) ) 3865 else if ( date == QDateTime::currentDateTime().date().addDays(-1) )
3865 addString = i18n("Yesterday"); 3866 addString = i18n("Yesterday");
3866 else if ( date == QDateTime::currentDateTime().date().addDays(-2) ) 3867 else if ( date == QDateTime::currentDateTime().date().addDays(-2) )
3867 addString = i18n("Day before yesterday"); 3868 addString = i18n("Day before yesterday");
3868 else if ( date == QDateTime::currentDateTime().date().addDays(2) ) 3869 else if ( date == QDateTime::currentDateTime().date().addDays(2) )
3869 addString = i18n("Day after tomorrow"); 3870 addString = i18n("Day after tomorrow");
3870 if ( !addString.isEmpty() ) { 3871 if ( !addString.isEmpty() ) {
3871 topLevelWidget()->setCaption( addString+", " + selDates ); 3872 topLevelWidget()->setCaption( addString+", " + selDates );
3872 return; 3873 return;
3873 } 3874 }
3874 } 3875 }
3875 topLevelWidget()->setCaption( i18n("Dates: ") + selDates ); 3876 topLevelWidget()->setCaption( i18n("Dates: ") + selDates );
3876 3877
3877} 3878}
3878 3879
3879QPtrList<CalFilter> CalendarView::filters() 3880QPtrList<CalFilter> CalendarView::filters()
3880{ 3881{
3881 return mFilters; 3882 return mFilters;
3882 3883
3883} 3884}
3884void CalendarView::editFilters() 3885void CalendarView::editFilters()
3885{ 3886{
3886 // kdDebug() << "CalendarView::editFilters()" << endl; 3887 // kdDebug() << "CalendarView::editFilters()" << endl;
3887 3888
3888 CalFilter *filter = mFilters.first(); 3889 CalFilter *filter = mFilters.first();
3889 while(filter) { 3890 while(filter) {
3890 kdDebug() << " Filter: " << filter->name() << endl; 3891 kdDebug() << " Filter: " << filter->name() << endl;
3891 filter = mFilters.next(); 3892 filter = mFilters.next();
3892 } 3893 }
3893 3894
3894 mDialogManager->showFilterEditDialog(&mFilters); 3895 mDialogManager->showFilterEditDialog(&mFilters);
3895} 3896}
3896void CalendarView::toggleFilter() 3897void CalendarView::toggleFilter()
3897{ 3898{
3898 showFilter(! mFilterView->isVisible()); 3899 showFilter(! mFilterView->isVisible());
3899} 3900}
3900 3901
3901KOFilterView *CalendarView::filterView() 3902KOFilterView *CalendarView::filterView()
3902{ 3903{
3903 return mFilterView; 3904 return mFilterView;
3904} 3905}
3905void CalendarView::selectFilter( int fil ) 3906void CalendarView::selectFilter( int fil )
3906{ 3907{
3907 mFilterView->setSelectedFilter( fil ); 3908 mFilterView->setSelectedFilter( fil );
3908} 3909}
3909void CalendarView::showFilter(bool visible) 3910void CalendarView::showFilter(bool visible)
3910{ 3911{
3912 if (visible) mCalEditView->show();
3913 else mCalEditView->hide();
3914#if 0
3911 if (visible) mFilterView->show(); 3915 if (visible) mFilterView->show();
3912 else mFilterView->hide(); 3916 else mFilterView->hide();
3917#endif
3913} 3918}
3914void CalendarView::toggleFilerEnabled( ) 3919void CalendarView::toggleFilerEnabled( )
3915{ 3920{
3916 mFilterView->setFiltersEnabled ( !mFilterView->filtersEnabled() ); 3921 mFilterView->setFiltersEnabled ( !mFilterView->filtersEnabled() );
3917 if ( !mFilterView->filtersEnabled() ) 3922 if ( !mFilterView->filtersEnabled() )
3918 topLevelWidget()->setCaption( i18n("Filter disabled ") ); 3923 topLevelWidget()->setCaption( i18n("Filter disabled ") );
3919 3924
3920} 3925}
3921void CalendarView::updateFilter() 3926void CalendarView::updateFilter()
3922{ 3927{
3923 CalFilter *filter = mFilterView->selectedFilter(); 3928 CalFilter *filter = mFilterView->selectedFilter();
3924 if (filter) { 3929 if (filter) {
3925 QString mess; 3930 QString mess;
3926 if (mFilterView->filtersEnabled()) { 3931 if (mFilterView->filtersEnabled()) {
3927 mess = i18n("Filter selected: ")+filter->name(); 3932 mess = i18n("Filter selected: ")+filter->name();
3928 filter->setEnabled(true); 3933 filter->setEnabled(true);
3929 } 3934 }
3930 else filter->setEnabled(false); 3935 else filter->setEnabled(false);
3931 mCalendar->setFilter(filter); 3936 mCalendar->setFilter(filter);
3932 updateView(); 3937 updateView();
3933 if ( !mess.isEmpty() ) 3938 if ( !mess.isEmpty() )
3934 topLevelWidget()->setCaption( mess ); 3939 topLevelWidget()->setCaption( mess );
3935 3940
3936 } 3941 }
3937} 3942}
3938 3943
3939void CalendarView::filterEdited() 3944void CalendarView::filterEdited()
3940{ 3945{
3941 mFilterView->updateFilters(); 3946 mFilterView->updateFilters();
3942 updateFilter(); 3947 updateFilter();
3943 writeSettings(); 3948 writeSettings();
3944} 3949}
3945 3950
3946 3951
3947void CalendarView::takeOverEvent() 3952void CalendarView::takeOverEvent()
3948{ 3953{
3949 Incidence *incidence = currentSelection(); 3954 Incidence *incidence = currentSelection();
3950 3955
3951 if (!incidence) return; 3956 if (!incidence) return;
3952 3957
3953 incidence->setOrganizer(KOPrefs::instance()->email()); 3958 incidence->setOrganizer(KOPrefs::instance()->email());
3954 incidence->recreate(); 3959 incidence->recreate();
3955 incidence->setReadOnly(false); 3960 incidence->setReadOnly(false);
3956 3961
3957 updateView(); 3962 updateView();
3958} 3963}
3959 3964
3960void CalendarView::takeOverCalendar() 3965void CalendarView::takeOverCalendar()
3961{ 3966{
3962 // TODO: Create Calendar::allIncidences() function and use it here 3967 // TODO: Create Calendar::allIncidences() function and use it here
3963 3968
3964 clearAllViews(); 3969 clearAllViews();
3965 QPtrList<Event> events = mCalendar->events(); 3970 QPtrList<Event> events = mCalendar->events();
3966 for(uint i=0; i<events.count(); ++i) { 3971 for(uint i=0; i<events.count(); ++i) {
3967 events.at(i)->setOrganizer(KOPrefs::instance()->email()); 3972 events.at(i)->setOrganizer(KOPrefs::instance()->email());
3968 events.at(i)->recreate(); 3973 events.at(i)->recreate();
3969 events.at(i)->setReadOnly(false); 3974 events.at(i)->setReadOnly(false);
3970 } 3975 }
3971 3976
3972 QPtrList<Todo> todos = mCalendar->todos(); 3977 QPtrList<Todo> todos = mCalendar->todos();
3973 for(uint i=0; i<todos.count(); ++i) { 3978 for(uint i=0; i<todos.count(); ++i) {
3974 todos.at(i)->setOrganizer(KOPrefs::instance()->email()); 3979 todos.at(i)->setOrganizer(KOPrefs::instance()->email());
3975 todos.at(i)->recreate(); 3980 todos.at(i)->recreate();
3976 todos.at(i)->setReadOnly(false); 3981 todos.at(i)->setReadOnly(false);
3977 } 3982 }
3978 3983
3979 QPtrList<Journal> journals = mCalendar->journals(); 3984 QPtrList<Journal> journals = mCalendar->journals();
3980 for(uint i=0; i<journals.count(); ++i) { 3985 for(uint i=0; i<journals.count(); ++i) {
3981 journals.at(i)->setOrganizer(KOPrefs::instance()->email()); 3986 journals.at(i)->setOrganizer(KOPrefs::instance()->email());
3982 journals.at(i)->recreate(); 3987 journals.at(i)->recreate();
3983 journals.at(i)->setReadOnly(false); 3988 journals.at(i)->setReadOnly(false);
3984 } 3989 }
3985 3990
3986 updateView(); 3991 updateView();
3987} 3992}
3988 3993
3989void CalendarView::showIntro() 3994void CalendarView::showIntro()
3990{ 3995{
3991 kdDebug() << "To be implemented." << endl; 3996 kdDebug() << "To be implemented." << endl;
3992} 3997}
3993 3998
3994QWidgetStack *CalendarView::viewStack() 3999QWidgetStack *CalendarView::viewStack()
3995{ 4000{
3996 return mRightFrame; 4001 return mRightFrame;
3997} 4002}
3998 4003
3999QWidget *CalendarView::leftFrame() 4004QWidget *CalendarView::leftFrame()
4000{ 4005{
4001 return ( QWidget *)mLeftFrame; 4006 return ( QWidget *)mLeftFrame;
4002} 4007}
4003 4008
4004DateNavigator *CalendarView::dateNavigator() 4009DateNavigator *CalendarView::dateNavigator()
4005{ 4010{
4006 return mNavigator; 4011 return mNavigator;
4007} 4012}
4008 4013
4009KDateNavigator* CalendarView::dateNavigatorWidget() 4014KDateNavigator* CalendarView::dateNavigatorWidget()
4010{ 4015{
4011 return mDateNavigator->navigatorView(); 4016 return mDateNavigator->navigatorView();
4012} 4017}
4013void CalendarView::toggleDateNavigatorWidget() 4018void CalendarView::toggleDateNavigatorWidget()
4014{ 4019{
4015 KOPrefs::instance()->mShowDateNavigator = !KOPrefs::instance()->mShowDateNavigator ; 4020 KOPrefs::instance()->mShowDateNavigator = !KOPrefs::instance()->mShowDateNavigator ;
4016 4021
4017 if (!KOPrefs::instance()->mShowDateNavigator ) 4022 if (!KOPrefs::instance()->mShowDateNavigator )
4018 mDateNavigator->hide(); 4023 mDateNavigator->hide();
4019 else 4024 else
4020 mDateNavigator->show(); 4025 mDateNavigator->show();
4021} 4026}
4022void CalendarView::addView(KOrg::BaseView *view) 4027void CalendarView::addView(KOrg::BaseView *view)
4023{ 4028{
4024 mViewManager->addView(view); 4029 mViewManager->addView(view);
4025} 4030}
4026 4031
4027void CalendarView::showView(KOrg::BaseView *view) 4032void CalendarView::showView(KOrg::BaseView *view)
4028{ 4033{
4029 mViewManager->showView(view, mLeftFrame->isVisible()); 4034 mViewManager->showView(view, mLeftFrame->isVisible());
4030} 4035}
4031 4036
4032Incidence *CalendarView::currentSelection() 4037Incidence *CalendarView::currentSelection()
4033{ 4038{
4034 return mViewManager->currentSelection(); 4039 return mViewManager->currentSelection();
4035} 4040}
4036void CalendarView::toggleAllDaySize() 4041void CalendarView::toggleAllDaySize()
4037{ 4042{
4038 /* 4043 /*
4039 if ( KOPrefs::instance()->mAllDaySize > 47 ) 4044 if ( KOPrefs::instance()->mAllDaySize > 47 )
4040 KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize /2; 4045 KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize /2;
4041 else 4046 else
4042 KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize *2; 4047 KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize *2;
4043 */ 4048 */
4044 viewManager()->agendaView()->toggleAllDay(); 4049 viewManager()->agendaView()->toggleAllDay();
4045} 4050}
4046void CalendarView::toggleExpand() 4051void CalendarView::toggleExpand()
4047{ 4052{
4048 // if ( mLeftFrame->isHidden() ) { 4053 // if ( mLeftFrame->isHidden() ) {
4049 // mLeftFrame->show(); 4054 // mLeftFrame->show();
4050 // emit calendarViewExpanded( false ); 4055 // emit calendarViewExpanded( false );
4051 // } else { 4056 // } else {
4052 // mLeftFrame->hide(); 4057 // mLeftFrame->hide();
4053 // emit calendarViewExpanded( true ); 4058 // emit calendarViewExpanded( true );
4054 // } 4059 // }
4055 //qDebug(" CalendarView::toggleExpand()"); 4060 //qDebug(" CalendarView::toggleExpand()");
4056 globalFlagBlockAgenda = 1; 4061 globalFlagBlockAgenda = 1;
4057 emit calendarViewExpanded( !mLeftFrame->isHidden() ); 4062 emit calendarViewExpanded( !mLeftFrame->isHidden() );
4058 globalFlagBlockAgenda = 5; 4063 globalFlagBlockAgenda = 5;
4059 mViewManager->raiseCurrentView( !mLeftFrame->isHidden() ); 4064 mViewManager->raiseCurrentView( !mLeftFrame->isHidden() );
4060 //mViewManager->showView( 0, true ); 4065 //mViewManager->showView( 0, true );
4061} 4066}
4062 4067
4063void CalendarView::calendarModified( bool modified, Calendar * ) 4068void CalendarView::calendarModified( bool modified, Calendar * )
4064{ 4069{
4065 setModified( modified ); 4070 setModified( modified );
4066} 4071}
4067 4072
4068Todo *CalendarView::selectedTodo() 4073Todo *CalendarView::selectedTodo()
4069{ 4074{
4070 Incidence *incidence = currentSelection(); 4075 Incidence *incidence = currentSelection();
4071 if ( incidence && incidence->typeID() == todoID ) { 4076 if ( incidence && incidence->typeID() == todoID ) {
4072 return static_cast<Todo *>( incidence ); 4077 return static_cast<Todo *>( incidence );
4073 } 4078 }
4074 4079
4075 incidence = mTodoList->selectedIncidences().first(); 4080 incidence = mTodoList->selectedIncidences().first();
4076 if ( incidence && incidence->typeID() == todoID ) { 4081 if ( incidence && incidence->typeID() == todoID ) {
4077 return static_cast<Todo *>( incidence ); 4082 return static_cast<Todo *>( incidence );
4078 } 4083 }
4079 4084
4080 return 0; 4085 return 0;
4081} 4086}
4082 4087
4083void CalendarView::dialogClosing(Incidence *in) 4088void CalendarView::dialogClosing(Incidence *in)
4084{ 4089{
4085 // mDialogList.remove(in); 4090 // mDialogList.remove(in);
4086} 4091}
4087 4092
4088void CalendarView::showIncidence() 4093void CalendarView::showIncidence()
4089{ 4094{
4090 mViewerCallerIsSearchDialog = false; 4095 mViewerCallerIsSearchDialog = false;
4091 Incidence *incidence = currentSelection(); 4096 Incidence *incidence = currentSelection();
4092 if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); 4097 if ( !incidence ) incidence = mTodoList->selectedIncidences().first();
4093 if ( incidence ) { 4098 if ( incidence ) {
4094 ShowIncidenceVisitor v; 4099 ShowIncidenceVisitor v;
4095 v.act( incidence, this ); 4100 v.act( incidence, this );
4096 } 4101 }
4097} 4102}
4098void CalendarView::editIncidenceDescription() 4103void CalendarView::editIncidenceDescription()
4099{ 4104{
4100 mFlagEditDescription = true; 4105 mFlagEditDescription = true;
4101 editIncidence(); 4106 editIncidence();
4102 mFlagEditDescription = false; 4107 mFlagEditDescription = false;
4103} 4108}
4104void CalendarView::editIncidence() 4109void CalendarView::editIncidence()
diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h
index 1215a99..cdce072 100644
--- a/korganizer/calendarview.h
+++ b/korganizer/calendarview.h
@@ -1,244 +1,245 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 2000, 2001 3 Copyright (c) 2000, 2001
4 Cornelius Schumacher <schumacher@kde.org> 4 Cornelius Schumacher <schumacher@kde.org>
5 5
6 This program is free software; you can redistribute it and/or modify 6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by 7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or 8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version. 9 (at your option) any later version.
10 10
11 This program is distributed in the hope that it will be useful, 11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details. 14 GNU General Public License for more details.
15 15
16 You should have received a copy of the GNU General Public License 16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software 17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 19
20 As a special exception, permission is given to link this program 20 As a special exception, permission is given to link this program
21 with any edition of Qt, and distribute the resulting executable, 21 with any edition of Qt, and distribute the resulting executable,
22 without including the source code for Qt in the source distribution. 22 without including the source code for Qt in the source distribution.
23*/ 23*/
24#ifndef CALENDARVIEW_H 24#ifndef CALENDARVIEW_H
25#define CALENDARVIEW_H 25#define CALENDARVIEW_H
26 26
27#include <qframe.h> 27#include <qframe.h>
28#include <qlayout.h> 28#include <qlayout.h>
29#include <qwidget.h> 29#include <qwidget.h>
30#include <qptrlist.h> 30#include <qptrlist.h>
31#include <qvbox.h> 31#include <qvbox.h>
32#include <qmap.h> 32#include <qmap.h>
33#ifndef DESKTOP_VERSION 33#ifndef DESKTOP_VERSION
34#include <qtopia/ir.h> 34#include <qtopia/ir.h>
35#else 35#else
36#define Ir char 36#define Ir char
37#endif 37#endif
38#include <libkcal/calendar.h> 38#include <libkcal/calendar.h>
39#include <libkcal/scheduler.h> 39#include <libkcal/scheduler.h>
40#include <libkcal/calendarresources.h> 40#include <libkcal/calendarresources.h>
41#include <libkcal/resourcecalendar.h> 41#include <libkcal/resourcecalendar.h>
42#include <KDGanttMinimizeSplitter.h> 42#include <KDGanttMinimizeSplitter.h>
43 43
44#include <korganizer/calendarviewbase.h> 44#include <korganizer/calendarviewbase.h>
45 45
46#include <ksyncmanager.h> 46#include <ksyncmanager.h>
47 47
48class QWidgetStack; 48class QWidgetStack;
49class QSplitter; 49class QSplitter;
50 50
51class CalPrinter; 51class CalPrinter;
52class KOFilterView; 52class KOFilterView;
53class KOCalEditView;
53class KOViewManager; 54class KOViewManager;
54class KODialogManager; 55class KODialogManager;
55class KOTodoView; 56class KOTodoView;
56class KDateNavigator; 57class KDateNavigator;
57class DateNavigatorContainer; 58class DateNavigatorContainer;
58class DateNavigator; 59class DateNavigator;
59class KOIncidenceEditor; 60class KOIncidenceEditor;
60class KDatePicker; 61class KDatePicker;
61class ResourceView; 62class ResourceView;
62class KOEventEditor; 63class KOEventEditor;
63class KOTodoEditor ; 64class KOTodoEditor ;
64class KOEventViewerDialog; 65class KOEventViewerDialog;
65class KOBeamPrefs; 66class KOBeamPrefs;
66class KSyncProfile; 67class KSyncProfile;
67class AlarmDialog; 68class AlarmDialog;
68class KCal::Attendee; 69class KCal::Attendee;
69 70
70namespace KCal { class FileStorage; } 71namespace KCal { class FileStorage; }
71 72
72using namespace KCal; 73using namespace KCal;
73 74
74/** 75/**
75 This is the main calendar widget. It provides the different vies on t he 76 This is the main calendar widget. It provides the different vies on t he
76 calendar data as well as the date navigator. It also handles synchronisation 77 calendar data as well as the date navigator. It also handles synchronisation
77 of the different views and controls the different dialogs like preferences, 78 of the different views and controls the different dialogs like preferences,
78 event editor, search dialog etc. 79 event editor, search dialog etc.
79 80
80 @short main calendar view widget 81 @short main calendar view widget
81 @author Cornelius Schumacher 82 @author Cornelius Schumacher
82*/ 83*/
83 84
84#include <qtextbrowser.h> 85#include <qtextbrowser.h>
85#include <qtextcodec.h> 86#include <qtextcodec.h>
86 87
87class MissedAlarmTextBrowser : public QTextBrowser { 88class MissedAlarmTextBrowser : public QTextBrowser {
88 Q_OBJECT 89 Q_OBJECT
89 public: 90 public:
90 MissedAlarmTextBrowser(QWidget *parent, QPtrList<Incidence> alarms ,QDateTime start); 91 MissedAlarmTextBrowser(QWidget *parent, QPtrList<Incidence> alarms ,QDateTime start);
91 ~MissedAlarmTextBrowser(); 92 ~MissedAlarmTextBrowser();
92 void setSource(const QString & n); 93 void setSource(const QString & n);
93 94
94 private: 95 private:
95 Incidence * getNextInc(QDateTime start ); 96 Incidence * getNextInc(QDateTime start );
96 QPtrList<Incidence> mAlarms; 97 QPtrList<Incidence> mAlarms;
97 signals: 98 signals:
98 void showIncidence( QString uid); 99 void showIncidence( QString uid);
99}; 100};
100 101
101 102
102class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Observer, public KSyncInterface 103class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Observer, public KSyncInterface
103{ 104{
104 Q_OBJECT 105 Q_OBJECT
105 public: 106 public:
106 /** 107 /**
107 Constructs a new calendar view widget. 108 Constructs a new calendar view widget.
108 109
109 @param calendar calendar document 110 @param calendar calendar document
110 @param parent parent window 111 @param parent parent window
111 @param name Qt internal widget object name 112 @param name Qt internal widget object name
112 */ 113 */
113 CalendarView( CalendarResources *calendar, QWidget *parent = 0, 114 CalendarView( CalendarResources *calendar, QWidget *parent = 0,
114 const char *name = 0 ); 115 const char *name = 0 );
115 CalendarView( Calendar *calendar, QWidget *parent = 0, 116 CalendarView( Calendar *calendar, QWidget *parent = 0,
116 const char *name = 0 ); 117 const char *name = 0 );
117 virtual ~CalendarView(); 118 virtual ~CalendarView();
118 119
119 Calendar *calendar() { return mCalendar; } 120 Calendar *calendar() { return mCalendar; }
120 121
121 KOViewManager *viewManager(); 122 KOViewManager *viewManager();
122 KODialogManager *dialogManager(); 123 KODialogManager *dialogManager();
123 124
124 QDate startDate(); 125 QDate startDate();
125 QDate endDate(); 126 QDate endDate();
126 127
127 QWidgetStack *viewStack(); 128 QWidgetStack *viewStack();
128 QWidget *leftFrame(); 129 QWidget *leftFrame();
129 130
130 DateNavigator *dateNavigator(); 131 DateNavigator *dateNavigator();
131 KDateNavigator *dateNavigatorWidget(); 132 KDateNavigator *dateNavigatorWidget();
132 133
133 void addView(KOrg::BaseView *); 134 void addView(KOrg::BaseView *);
134 void showView(KOrg::BaseView *); 135 void showView(KOrg::BaseView *);
135 KOEventViewerDialog* getEventViewerDialog(); 136 KOEventViewerDialog* getEventViewerDialog();
136 Incidence *currentSelection(); 137 Incidence *currentSelection();
137 138
138 signals: 139 signals:
139 void save (); 140 void save ();
140 void saveStopTimer (); 141 void saveStopTimer ();
141 void tempDisableBR(bool); 142 void tempDisableBR(bool);
142 /** This todo has been modified */ 143 /** This todo has been modified */
143 void todoModified(Todo *, int); 144 void todoModified(Todo *, int);
144 145
145 /** when change is made to options dialog, the topwidget will catch this 146 /** when change is made to options dialog, the topwidget will catch this
146 * and emit this signal which notifies all widgets which have registered 147 * and emit this signal which notifies all widgets which have registered
147 * for notification to update their settings. */ 148 * for notification to update their settings. */
148 void configChanged(); 149 void configChanged();
149 /** emitted when the topwidget is closing down, so that any attached 150 /** emitted when the topwidget is closing down, so that any attached
150 child windows can also close. */ 151 child windows can also close. */
151 void closingDown(); 152 void closingDown();
152 /** emitted right before we die */ 153 /** emitted right before we die */
153 void closed(QWidget *); 154 void closed(QWidget *);
154 155
155 /** Emitted when state of modified flag changes */ 156 /** Emitted when state of modified flag changes */
156 void modifiedChanged(bool); 157 void modifiedChanged(bool);
157 void signalmodified(); 158 void signalmodified();
158 159
159 /** Emitted when state of read-only flag changes */ 160 /** Emitted when state of read-only flag changes */
160 void readOnlyChanged(bool); 161 void readOnlyChanged(bool);
161 162
162 /** Emitted when the unit of navigation changes */ 163 /** Emitted when the unit of navigation changes */
163 void changeNavStringPrev(const QString &); 164 void changeNavStringPrev(const QString &);
164 void changeNavStringNext(const QString &); 165 void changeNavStringNext(const QString &);
165 166
166 /** Emitted when state of events selection has changed and user is organizer*/ 167 /** Emitted when state of events selection has changed and user is organizer*/
167 void organizerEventsSelected(bool); 168 void organizerEventsSelected(bool);
168 /** Emitted when state of events selection has changed and user is attendee*/ 169 /** Emitted when state of events selection has changed and user is attendee*/
169 void groupEventsSelected(bool); 170 void groupEventsSelected(bool);
170 /** 171 /**
171 Emitted when an incidence gets selected. If the selection is cleared the 172 Emitted when an incidence gets selected. If the selection is cleared the
172 signal is emitted with 0 as argument. 173 signal is emitted with 0 as argument.
173 */ 174 */
174 void incidenceSelected( Incidence * ); 175 void incidenceSelected( Incidence * );
175 /** Emitted, when a todoitem is selected or deselected. */ 176 /** Emitted, when a todoitem is selected or deselected. */
176 void todoSelected( bool ); 177 void todoSelected( bool );
177 178
178 /** 179 /**
179 Emitted, when clipboard content changes. Parameter indicates if paste 180 Emitted, when clipboard content changes. Parameter indicates if paste
180 is possible or not. 181 is possible or not.
181 */ 182 */
182 void pasteEnabled(bool); 183 void pasteEnabled(bool);
183 184
184 /** Emitted, when the number of incoming messages has changed. */ 185 /** Emitted, when the number of incoming messages has changed. */
185 void numIncomingChanged(int); 186 void numIncomingChanged(int);
186 187
187 /** Emitted, when the number of outgoing messages has changed. */ 188 /** Emitted, when the number of outgoing messages has changed. */
188 void numOutgoingChanged(int); 189 void numOutgoingChanged(int);
189 190
190 /** Send status message, which can e.g. be displayed in the status bar. */ 191 /** Send status message, which can e.g. be displayed in the status bar. */
191 void statusMessage(const QString &); 192 void statusMessage(const QString &);
192 193
193 void calendarViewExpanded( bool ); 194 void calendarViewExpanded( bool );
194 void updateSearchDialog(); 195 void updateSearchDialog();
195 196
196 197
197 public slots: 198 public slots:
198 void checkAlarms(); 199 void checkAlarms();
199 void slotprintSelInc(); 200 void slotprintSelInc();
200 void showNextAlarms(); 201 void showNextAlarms();
201 void showOpenError(); 202 void showOpenError();
202 void watchSavedFile(); 203 void watchSavedFile();
203 void recheckTimerAlarm(); 204 void recheckTimerAlarm();
204 void checkNextTimerAlarm(); 205 void checkNextTimerAlarm();
205 void addAlarm(const QDateTime &qdt, const QString &noti ); 206 void addAlarm(const QDateTime &qdt, const QString &noti );
206 void addSuspendAlarm(const QDateTime &qdt, const QString &noti ); 207 void addSuspendAlarm(const QDateTime &qdt, const QString &noti );
207 void removeAlarm(const QDateTime &qdt, const QString &noti ); 208 void removeAlarm(const QDateTime &qdt, const QString &noti );
208 209
209 /** options dialog made a changed to the configuration. we catch this 210 /** options dialog made a changed to the configuration. we catch this
210 * and notify all widgets which need to update their configuration. */ 211 * and notify all widgets which need to update their configuration. */
211 void updateConfig(); 212 void updateConfig();
212 213
213 void insertBirthdays(const QString& uid, const QStringList& birthdayList, 214 void insertBirthdays(const QString& uid, const QStringList& birthdayList,
214 const QStringList& anniversaryList, const QStringList& realNameList, 215 const QStringList& anniversaryList, const QStringList& realNameList,
215 const QStringList& emailList, const QStringList& assembledNameList, 216 const QStringList& emailList, const QStringList& assembledNameList,
216 const QStringList& uidList); 217 const QStringList& uidList);
217 218
218 /** 219 /**
219 Load calendar from file \a filename. If \a merge is true, load 220 Load calendar from file \a filename. If \a merge is true, load
220 calendar into existing one, if it is false, clear calendar, before 221 calendar into existing one, if it is false, clear calendar, before
221 loading. Return true, if calendar could be successfully loaded. 222 loading. Return true, if calendar could be successfully loaded.
222 */ 223 */
223 bool openCalendar(QString filename, bool merge=false); 224 bool openCalendar(QString filename, bool merge=false);
224 bool syncCalendar(QString filename,int mode = 0 ); 225 bool syncCalendar(QString filename,int mode = 0 );
225 226
226 /** 227 /**
227 Save calendar data to file. Return true if calendar could be 228 Save calendar data to file. Return true if calendar could be
228 successfully saved. 229 successfully saved.
229 */ 230 */
230 bool saveCalendar(QString filename); 231 bool saveCalendar(QString filename);
231 232
232 /** 233 /**
233 Close calendar. Clear calendar data and reset views to display an empty 234 Close calendar. Clear calendar data and reset views to display an empty
234 calendar. 235 calendar.
235 */ 236 */
236 void closeCalendar(); 237 void closeCalendar();
237 238
238 /** Archive old events of calendar */ 239 /** Archive old events of calendar */
239 void archiveCalendar(); 240 void archiveCalendar();
240 241
241 void showIncidence(); 242 void showIncidence();
242 void editIncidence(); 243 void editIncidence();
243 void editIncidenceDescription(); 244 void editIncidenceDescription();
244 void deleteIncidence(); 245 void deleteIncidence();
@@ -377,267 +378,268 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser
377 * View. 378 * View.
378 */ 379 */
379 void appointment_delete(); 380 void appointment_delete();
380 381
381 /** mails the currently selected event to a particular user as a vCalendar 382 /** mails the currently selected event to a particular user as a vCalendar
382 attachment. */ 383 attachment. */
383 void action_mail(); 384 void action_mail();
384 385
385 /* frees a subtodo from it's relation */ 386 /* frees a subtodo from it's relation */
386 void todo_unsub( Todo * ); 387 void todo_unsub( Todo * );
387 void todo_resub( Todo * parent, Todo * sub ); 388 void todo_resub( Todo * parent, Todo * sub );
388 389
389 /** Take ownership of selected event. */ 390 /** Take ownership of selected event. */
390 void takeOverEvent(); 391 void takeOverEvent();
391 392
392 /** Take ownership of all events in calendar. */ 393 /** Take ownership of all events in calendar. */
393 void takeOverCalendar(); 394 void takeOverCalendar();
394 395
395 /** query whether or not the calendar is "dirty". */ 396 /** query whether or not the calendar is "dirty". */
396 bool isModified(); 397 bool isModified();
397 /** set the state of calendar. Modified means "dirty", i.e. needing a save. */ 398 /** set the state of calendar. Modified means "dirty", i.e. needing a save. */
398 void setModified(bool modified=true); 399 void setModified(bool modified=true);
399 400
400 /** query if the calendar is read-only. */ 401 /** query if the calendar is read-only. */
401 bool isReadOnly(); 402 bool isReadOnly();
402 /** set state of calendar to read-only */ 403 /** set state of calendar to read-only */
403 void setReadOnly(bool readOnly=true); 404 void setReadOnly(bool readOnly=true);
404 405
405 void eventUpdated(Incidence *); 406 void eventUpdated(Incidence *);
406 407
407 /* iTIP scheduling actions */ 408 /* iTIP scheduling actions */
408 void schedule_publish(Incidence *incidence = 0); 409 void schedule_publish(Incidence *incidence = 0);
409 void schedule_request(Incidence *incidence = 0); 410 void schedule_request(Incidence *incidence = 0);
410 void schedule_refresh(Incidence *incidence = 0); 411 void schedule_refresh(Incidence *incidence = 0);
411 void schedule_cancel(Incidence *incidence = 0); 412 void schedule_cancel(Incidence *incidence = 0);
412 void schedule_add(Incidence *incidence = 0); 413 void schedule_add(Incidence *incidence = 0);
413 void schedule_reply(Incidence *incidence = 0); 414 void schedule_reply(Incidence *incidence = 0);
414 void schedule_counter(Incidence *incidence = 0); 415 void schedule_counter(Incidence *incidence = 0);
415 void schedule_declinecounter(Incidence *incidence = 0); 416 void schedule_declinecounter(Incidence *incidence = 0);
416 void schedule_publish_freebusy(int daysToPublish = 30); 417 void schedule_publish_freebusy(int daysToPublish = 30);
417 418
418 void openAddressbook(); 419 void openAddressbook();
419 420
420 void editFilters(); 421 void editFilters();
421 void toggleFilerEnabled(); 422 void toggleFilerEnabled();
422 QPtrList<CalFilter> filters(); 423 QPtrList<CalFilter> filters();
423 void toggleFilter(); 424 void toggleFilter();
424 void showFilter(bool visible); 425 void showFilter(bool visible);
425 void updateFilter(); 426 void updateFilter();
426 void filterEdited(); 427 void filterEdited();
427 void selectFilter( int ); 428 void selectFilter( int );
428 KOFilterView *filterView(); 429 KOFilterView *filterView();
429 430
430 void showIntro(); 431 void showIntro();
431 432
432 /** Move the curdatepient view date to today */ 433 /** Move the curdatepient view date to today */
433 void goToday(); 434 void goToday();
434 435
435 /** Move to the next date(s) in the current view */ 436 /** Move to the next date(s) in the current view */
436 void goNext(); 437 void goNext();
437 438
438 /** Move to the previous date(s) in the current view */ 439 /** Move to the previous date(s) in the current view */
439 void goPrevious(); 440 void goPrevious();
440 /** Move to the next date(s) in the current view */ 441 /** Move to the next date(s) in the current view */
441 void goNextMonth(); 442 void goNextMonth();
442 443
443 /** Move to the previous date(s) in the current view */ 444 /** Move to the previous date(s) in the current view */
444 void goPreviousMonth(); 445 void goPreviousMonth();
445 446
446 void toggleExpand(); 447 void toggleExpand();
447 void toggleDateNavigatorWidget(); 448 void toggleDateNavigatorWidget();
448 void toggleAllDaySize(); 449 void toggleAllDaySize();
449 void dialogClosing(Incidence *); 450 void dialogClosing(Incidence *);
450 451
451 /** Look for new messages in the inbox */ 452 /** Look for new messages in the inbox */
452 void lookForIncomingMessages(); 453 void lookForIncomingMessages();
453 /** Look for new messages in the outbox */ 454 /** Look for new messages in the outbox */
454 void lookForOutgoingMessages(); 455 void lookForOutgoingMessages();
455 456
456 void processMainViewSelection( Incidence * ); 457 void processMainViewSelection( Incidence * );
457 void processTodoListSelection( Incidence * ); 458 void processTodoListSelection( Incidence * );
458 459
459 void processIncidenceSelection( Incidence * ); 460 void processIncidenceSelection( Incidence * );
460 461
461 void purgeCompleted(); 462 void purgeCompleted();
462 bool removeCompletedSubTodos( Todo* ); 463 bool removeCompletedSubTodos( Todo* );
463 void slotCalendarChanged(); 464 void slotCalendarChanged();
464 bool importBday(); 465 bool importBday();
465 bool addAnniversary( QDate data, QString name, KCal::Attendee* a , bool birthday ); 466 bool addAnniversary( QDate data, QString name, KCal::Attendee* a , bool birthday );
466 bool importQtopia( const QString &categoriesFile, 467 bool importQtopia( const QString &categoriesFile,
467 const QString &datebookFile, 468 const QString &datebookFile,
468 const QString &tasklistFile ); 469 const QString &tasklistFile );
469 void syncExternal( int mode ); 470 void syncExternal( int mode );
470 void slotSelectPickerDate( QDate ) ; 471 void slotSelectPickerDate( QDate ) ;
471 void showDatePicker() ; 472 void showDatePicker() ;
472 void showDatePickerPopup() ; 473 void showDatePickerPopup() ;
473 void moveIncidence(Incidence *) ; 474 void moveIncidence(Incidence *) ;
474 void beamIncidence(Incidence *) ; 475 void beamIncidence(Incidence *) ;
475 void beamCalendar() ; 476 void beamCalendar() ;
476 void beamFilteredCalendar() ; 477 void beamFilteredCalendar() ;
477 void beamIncidenceList(QPtrList<Incidence>) ; 478 void beamIncidenceList(QPtrList<Incidence>) ;
478 void manageCategories(); 479 void manageCategories();
479 int addCategories(); 480 int addCategories();
480 void removeCategories(); 481 void removeCategories();
481 void setSyncDevice( QString ); 482 void setSyncDevice( QString );
482 void setSyncName( QString ); 483 void setSyncName( QString );
483 void showDay( QDate ); 484 void showDay( QDate );
484 void undo_delete(); 485 void undo_delete();
485 protected slots: 486 protected slots:
486 void resetFocus(); 487 void resetFocus();
487 void slotViewerClosed(); 488 void slotViewerClosed();
488 void timerAlarm(); 489 void timerAlarm();
489 void suspendAlarm(); 490 void suspendAlarm();
490 void beamDone( Ir *ir ); 491 void beamDone( Ir *ir );
491 /** Select a view or adapt the current view to display the specified dates. */ 492 /** Select a view or adapt the current view to display the specified dates. */
492 void showDates( const KCal::DateList & ); 493 void showDates( const KCal::DateList & );
493 void selectWeekNum ( int ); 494 void selectWeekNum ( int );
494 495
495 public: 496 public:
496 // show a standard warning 497 // show a standard warning
497 // returns KMsgBox::yesNoCancel() 498 // returns KMsgBox::yesNoCancel()
498 int msgCalModified(); 499 int msgCalModified();
499 virtual bool sync(KSyncManager* manager, QString filename, int mode); 500 virtual bool sync(KSyncManager* manager, QString filename, int mode);
500 501
501 virtual bool syncExternal(KSyncManager* manager, QString resource); 502 virtual bool syncExternal(KSyncManager* manager, QString resource);
502 virtual void removeSyncInfo( QString syncProfile); 503 virtual void removeSyncInfo( QString syncProfile);
503 void setSyncManager(KSyncManager* manager); 504 void setSyncManager(KSyncManager* manager);
504 void setLoadedFileVersion(QDateTime); 505 void setLoadedFileVersion(QDateTime);
505 bool checkFileVersion(QString fn); 506 bool checkFileVersion(QString fn);
506 bool checkFileChanged(QString fn); 507 bool checkFileChanged(QString fn);
507 Event* getLastSyncEvent(); 508 Event* getLastSyncEvent();
508 /** Adapt navigation units correpsonding to step size of navigation of the 509 /** Adapt navigation units correpsonding to step size of navigation of the
509 * current view. 510 * current view.
510 */ 511 */
511 void adaptNavigationUnits(); 512 void adaptNavigationUnits();
512 bool synchronizeCalendar( Calendar* local, Calendar* remote, int mode ); 513 bool synchronizeCalendar( Calendar* local, Calendar* remote, int mode );
513 int takeEvent( Incidence* local, Incidence* remote, int mode, bool full = false ); 514 int takeEvent( Incidence* local, Incidence* remote, int mode, bool full = false );
514 //Attendee* getYourAttendee(Event *event); 515 //Attendee* getYourAttendee(Event *event);
515 void setBlockShowDates( bool b ) { mBlockShowDates = b ;} 516 void setBlockShowDates( bool b ) { mBlockShowDates = b ;}
516 protected: 517 protected:
517 void schedule(Scheduler::Method, Incidence *incidence = 0); 518 void schedule(Scheduler::Method, Incidence *incidence = 0);
518 519
519 // returns KMsgBox::OKCandel() 520 // returns KMsgBox::OKCandel()
520 int msgItemDelete(const QString name); 521 int msgItemDelete(const QString name);
521 void showEventEditor(); 522 void showEventEditor();
522 void showTodoEditor(); 523 void showTodoEditor();
523 void writeLocale(); 524 void writeLocale();
524 Todo *selectedTodo(); 525 Todo *selectedTodo();
525 526
526 private: 527 private:
527 QDateTime mNextAlarmDateTime; 528 QDateTime mNextAlarmDateTime;
528 bool mViewerCallerIsSearchDialog; 529 bool mViewerCallerIsSearchDialog;
529 bool mBlockShowDates; 530 bool mBlockShowDates;
530 KSyncManager* mSyncManager; 531 KSyncManager* mSyncManager;
531 AlarmDialog * mAlarmDialog; 532 AlarmDialog * mAlarmDialog;
532 QString mAlarmNotification; 533 QString mAlarmNotification;
533 QString mSuspendAlarmNotification; 534 QString mSuspendAlarmNotification;
534 QTimer* mSuspendTimer; 535 QTimer* mSuspendTimer;
535 QTimer* mAlarmTimer; 536 QTimer* mAlarmTimer;
536 QTimer* mRecheckAlarmTimer; 537 QTimer* mRecheckAlarmTimer;
537 void computeAlarm( QString ); 538 void computeAlarm( QString );
538 void startAlarm( QString, QString ); 539 void startAlarm( QString, QString );
539 void setSyncEventsReadOnly(); 540 void setSyncEventsReadOnly();
540 541
541 QDateTime loadedFileVersion; 542 QDateTime loadedFileVersion;
542 void checkExternSyncEvent( QPtrList<Event> lastSync , Incidence* toDelete ); 543 void checkExternSyncEvent( QPtrList<Event> lastSync , Incidence* toDelete );
543 void checkExternalId( Incidence * inc ); 544 void checkExternalId( Incidence * inc );
544 int mGlobalSyncMode; 545 int mGlobalSyncMode;
545 QString mCurrentSyncDevice; 546 QString mCurrentSyncDevice;
546 QString mCurrentSyncName; 547 QString mCurrentSyncName;
547 KOBeamPrefs* beamDialog; 548 KOBeamPrefs* beamDialog;
548 void init(); 549 void init();
549 int mDatePickerMode; 550 int mDatePickerMode;
550 bool mFlagEditDescription; 551 bool mFlagEditDescription;
551 QDateTime mLastCalendarSync; 552 QDateTime mLastCalendarSync;
552 void createPrinter(); 553 void createPrinter();
553 554
554 void calendarModified( bool, Calendar * ); 555 void calendarModified( bool, Calendar * );
555 556
556 CalPrinter *mCalPrinter; 557 CalPrinter *mCalPrinter;
557 558
558 QSplitter *mPanner; 559 QSplitter *mPanner;
559 QSplitter *mLeftSplitter; 560 QSplitter *mLeftSplitter;
560 KDGanttMinimizeSplitter *mLeftFrame, *mMainFrame; 561 KDGanttMinimizeSplitter *mLeftFrame, *mMainFrame;
561 QWidgetStack *mRightFrame; 562 QWidgetStack *mRightFrame;
562 563
563 KDatePicker* mDatePicker; 564 KDatePicker* mDatePicker;
564 QVBox* mDateFrame; 565 QVBox* mDateFrame;
565 566
566 DateNavigatorContainer *mDateNavigator; // widget showing small month view. 567 DateNavigatorContainer *mDateNavigator; // widget showing small month view.
567 568
568 KOFilterView *mFilterView; 569 KOFilterView *mFilterView;
570 KOCalEditView *mCalEditView;
569 571
570 ResourceView *mResourceView; 572 ResourceView *mResourceView;
571 573
572 // calendar object for this viewing instance 574 // calendar object for this viewing instance
573 Calendar *mCalendar; 575 Calendar *mCalendar;
574 576
575 CalendarResourceManager *mResourceManager; 577 CalendarResourceManager *mResourceManager;
576 578
577 FileStorage *mStorage; 579 FileStorage *mStorage;
578 580
579 DateNavigator *mNavigator; 581 DateNavigator *mNavigator;
580 582
581 KOViewManager *mViewManager; 583 KOViewManager *mViewManager;
582 KODialogManager *mDialogManager; 584 KODialogManager *mDialogManager;
583 585
584 // Calendar filters 586 // Calendar filters
585 QPtrList<CalFilter> mFilters; 587 QPtrList<CalFilter> mFilters;
586 588
587 // various housekeeping variables. 589 // various housekeeping variables.
588 bool mModified; // flag indicating if calendar is modified 590 bool mModified; // flag indicating if calendar is modified
589 bool mReadOnly; // flag indicating if calendar is read-only 591 bool mReadOnly; // flag indicating if calendar is read-only
590 QDate mSaveSingleDate; 592 QDate mSaveSingleDate;
591 593
592 Incidence *mSelectedIncidence; 594 Incidence *mSelectedIncidence;
593 Incidence *mMoveIncidence; 595 Incidence *mMoveIncidence;
594 QDate mMoveIncidenceOldDate; 596 QDate mMoveIncidenceOldDate;
595 KOTodoView *mTodoList; 597 KOTodoView *mTodoList;
596 KOEventEditor * mEventEditor; 598 KOEventEditor * mEventEditor;
597 KOTodoEditor * mTodoEditor; 599 KOTodoEditor * mTodoEditor;
598 KOEventViewerDialog * mEventViewerDialog; 600 KOEventViewerDialog * mEventViewerDialog;
599 void keyPressEvent ( QKeyEvent *e) ; 601 void keyPressEvent ( QKeyEvent *e) ;
600 //QMap<Incidence*,KOIncidenceEditor*> mDialogList; 602 //QMap<Incidence*,KOIncidenceEditor*> mDialogList;
601}; 603};
602 604
603 605
604class CalendarViewVisitor : public Incidence::Visitor 606class CalendarViewVisitor : public Incidence::Visitor
605{ 607{
606 public: 608 public:
607 CalendarViewVisitor() : mView( 0 ) {} 609 CalendarViewVisitor() : mView( 0 ) {}
608 610
609 bool act( Incidence *incidence, CalendarView *view ) 611 bool act( Incidence *incidence, CalendarView *view )
610 { 612 {
611 mView = view; 613 mView = view;
612 return incidence->accept( *this ); 614 return incidence->accept( *this );
613 } 615 }
614 616
615 protected: 617 protected:
616 CalendarView *mView; 618 CalendarView *mView;
617}; 619};
618 620
619class ShowIncidenceVisitor : public CalendarViewVisitor 621class ShowIncidenceVisitor : public CalendarViewVisitor
620{ 622{
621 protected: 623 protected:
622 bool visit( Event *event ) { mView->showEvent( event ); return true; } 624 bool visit( Event *event ) { mView->showEvent( event ); return true; }
623 bool visit( Todo *todo ) { mView->showTodo( todo ); return true; } 625 bool visit( Todo *todo ) { mView->showTodo( todo ); return true; }
624 bool visit( Journal * j ) { mView->showJournal( j );return true; } 626 bool visit( Journal * j ) { mView->showJournal( j );return true; }
625}; 627};
626 628
627class EditIncidenceVisitor : public CalendarViewVisitor 629class EditIncidenceVisitor : public CalendarViewVisitor
628{ 630{
629 protected: 631 protected:
630 bool visit( Event *event ) { mView->editEvent( event ); return true; } 632 bool visit( Event *event ) { mView->editEvent( event ); return true; }
631 bool visit( Todo *todo ) { mView->editTodo( todo ); return true; } 633 bool visit( Todo *todo ) { mView->editTodo( todo ); return true; }
632 bool visit( Journal *j ) { mView->editJournal( j); return true; } 634 bool visit( Journal *j ) { mView->editJournal( j); return true; }
633}; 635};
634 636
635class DeleteIncidenceVisitor : public CalendarViewVisitor 637class DeleteIncidenceVisitor : public CalendarViewVisitor
636{ 638{
637 protected: 639 protected:
638 bool visit( Event *event ) { mView->deleteEvent( event ); return true; } 640 bool visit( Event *event ) { mView->deleteEvent( event ); return true; }
639 bool visit( Todo *todo ) { mView->deleteTodo( todo ); return true; } 641 bool visit( Todo *todo ) { mView->deleteTodo( todo ); return true; }
640 bool visit( Journal * j) {mView->deleteJournal( j ); return true; } 642 bool visit( Journal * j) {mView->deleteJournal( j ); return true; }
641}; 643};
642 644
643#endif 645#endif
diff --git a/korganizer/kofilterview.cpp b/korganizer/kofilterview.cpp
index f0d17b5..64675ad 100644
--- a/korganizer/kofilterview.cpp
+++ b/korganizer/kofilterview.cpp
@@ -1,116 +1,176 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qcheckbox.h> 24#include <qcheckbox.h>
25#include <qcombobox.h> 25#include <qcombobox.h>
26#include <qpushbutton.h> 26#include <qpushbutton.h>
27#include <qlayout.h>
28#include <qlabel.h>
27 29
28 30
29#include <libkcal/calfilter.h> 31#include <libkcal/calfilter.h>
30 32
31#include "kofilterview.h" 33#include "kofilterview.h"
34#include <kiconloader.h>
35#include <kglobal.h>
32 36
33KOFilterView::KOFilterView(QPtrList<CalFilter> *filterList,QWidget* parent, 37KOFilterView::KOFilterView(QPtrList<CalFilter> *filterList,QWidget* parent,
34 const char* name,WFlags fl ) 38 const char* name,WFlags fl )
35 : KOFilterView_base(parent,name,fl) 39 : KOFilterView_base(parent,name,fl)
36{ 40{
37 mFilters = filterList; 41 mFilters = filterList;
38 42
39 connect(mSelectionCombo,SIGNAL(activated(int)),SIGNAL(filterChanged())); 43 connect(mSelectionCombo,SIGNAL(activated(int)),SIGNAL(filterChanged()));
40 connect(mEnabledCheck,SIGNAL(clicked()),SIGNAL(filterChanged())); 44 connect(mEnabledCheck,SIGNAL(clicked()),SIGNAL(filterChanged()));
41 connect(mEditButton,SIGNAL(clicked()),SIGNAL(editFilters())); 45 connect(mEditButton,SIGNAL(clicked()),SIGNAL(editFilters()));
42} 46}
43 47
44KOFilterView::~KOFilterView() 48KOFilterView::~KOFilterView()
45{ 49{
46 // no need to delete child widgets, Qt does it all for us 50 // no need to delete child widgets, Qt does it all for us
47} 51}
48 52
49bool KOFilterView::filtersEnabled() 53bool KOFilterView::filtersEnabled()
50{ 54{
51 return mEnabledCheck->isChecked(); 55 return mEnabledCheck->isChecked();
52} 56}
53 57
54void KOFilterView::setFiltersEnabled(bool set) 58void KOFilterView::setFiltersEnabled(bool set)
55{ 59{
56 mEnabledCheck->setChecked(set); 60 mEnabledCheck->setChecked(set);
57 emit filterChanged(); 61 emit filterChanged();
58} 62}
59 63
60 64
61void KOFilterView::updateFilters() 65void KOFilterView::updateFilters()
62{ 66{
63 mSelectionCombo->clear(); 67 mSelectionCombo->clear();
64 68
65 CalFilter *filter = mFilters->first(); 69 CalFilter *filter = mFilters->first();
66 while(filter) { 70 while(filter) {
67 mSelectionCombo->insertItem(filter->name()); 71 mSelectionCombo->insertItem(filter->name());
68 filter = mFilters->next(); 72 filter = mFilters->next();
69 } 73 }
70} 74}
71 75
72CalFilter *KOFilterView::selectedFilter() 76CalFilter *KOFilterView::selectedFilter()
73{ 77{
74 CalFilter *f = mFilters->at(mSelectionCombo->currentItem()); 78 CalFilter *f = mFilters->at(mSelectionCombo->currentItem());
75 return f; 79 return f;
76} 80}
77 81
78void KOFilterView::setSelectedFilter(QString filterName) 82void KOFilterView::setSelectedFilter(QString filterName)
79{ 83{
80 int filter_num = mSelectionCombo->count(); 84 int filter_num = mSelectionCombo->count();
81 int i; 85 int i;
82 for (i=0;i<filter_num;i++) { 86 for (i=0;i<filter_num;i++) {
83 if (mSelectionCombo->text(i)==filterName) 87 if (mSelectionCombo->text(i)==filterName)
84 mSelectionCombo->setCurrentItem(i); 88 mSelectionCombo->setCurrentItem(i);
85 } 89 }
86 emit filterChanged(); 90 emit filterChanged();
87} 91}
88void KOFilterView::setSelectedFilter( int fil ) 92void KOFilterView::setSelectedFilter( int fil )
89{ 93{
90 if ( fil >= mSelectionCombo->count() ) 94 if ( fil >= mSelectionCombo->count() )
91 return; 95 return;
92 mSelectionCombo->setCurrentItem( fil ); 96 mSelectionCombo->setCurrentItem( fil );
93 emit filterChanged(); 97 emit filterChanged();
94} 98}
95 99
96 100
97 101
98KOCalEditView::KOCalEditView(QWidget* parent, 102KOCalEditView::KOCalEditView(QWidget* parent,
99 const char* name,WFlags fl ) 103 const char* name )
100 : QWidget(parent,name,fl) 104 : QWidget(parent,name)
101{ 105{
102 /* 106 /*
103 connect(mSelectionCombo,SIGNAL(activated(int)),SIGNAL(filterChanged())); 107 connect(mSelectionCombo,SIGNAL(activated(int)),SIGNAL(filterChanged()));
104 connect(mEnabledCheck,SIGNAL(clicked()),SIGNAL(filterChanged())); 108 connect(mEnabledCheck,SIGNAL(clicked()),SIGNAL(filterChanged()));
105 connect(mEditButton,SIGNAL(clicked()),SIGNAL(editCalEdits())); 109 connect(mEditButton,SIGNAL(clicked()),SIGNAL(editCalEdits()));
106 */ 110 */
111 QGridLayout* mainLayout = new QGridLayout ( this , 2, 6 );
112 QPushButton * addBut = new QPushButton ( this );
113 mainLayout->addWidget( addBut,0,0 );
114 addBut->setPixmap ( SmallIcon("redcross16"));
115 connect(addBut,SIGNAL(clicked()),SLOT(addCal()));
116 addBut->setMaximumWidth( addBut->sizeHint().height() );
117
118 addBut = new QPushButton ( this );
119 mainLayout->addWidget( addBut,0,1 );
120 addBut->setPixmap ( SmallIcon("redcross16"));
121 connect(addBut,SIGNAL(clicked()),SLOT(enableAll()));
122 addBut->setMaximumWidth( addBut->sizeHint().height() );
123
124 QLabel* lab = new QLabel ( " "+i18n("Calendar")+" ", this );
125 mainLayout->addWidget( lab,0,2 );
126
127 addBut = new QPushButton ( this );
128 mainLayout->addWidget( addBut,0,3 );
129 addBut->setPixmap ( SmallIcon("redcross16"));
130 connect(addBut,SIGNAL(clicked()),SLOT(enableAlarm()));
131 addBut->setMaximumWidth( addBut->sizeHint().height() );
132
133 addBut = new QPushButton ( this );
134 mainLayout->addWidget( addBut,0,4 );
135 addBut->setPixmap ( SmallIcon("redcross16"));
136 connect(addBut,SIGNAL(clicked()),SLOT(disableRO()));
137 addBut->setMaximumWidth( addBut->sizeHint().height() );
138
139 addBut = new QPushButton ( this );
140 mainLayout->addWidget( addBut,0,5 );
141 addBut->setPixmap ( SmallIcon("trash"));
142 connect(addBut,SIGNAL(clicked()),SLOT(deleteAll()));
143 addBut->setMaximumWidth( addBut->sizeHint().height() );
144
145
146
107} 147}
108 148
109KOCalEditView::~KOCalEditView() 149KOCalEditView::~KOCalEditView()
110{ 150{
111 // no need to delete child widgets, Qt does it all for us 151 // no need to delete child widgets, Qt does it all for us
112} 152}
113void KOCalEditView::readConfig( KConfig *) 153void KOCalEditView::readConfig( KConfig *)
114{ 154{
115 155
116} 156}
157void KOCalEditView::addCal()
158{
159 qDebug("addcal ");
160}
161void KOCalEditView::enableAll()
162{
163 qDebug("enableAll");
164}
165void KOCalEditView::enableAlarm()
166{
167 qDebug("enableAlarm");
168}
169void KOCalEditView::disableRO()
170{
171 qDebug("OCalEditView::disableRO() ");
172}
173void KOCalEditView::deleteAll()
174{
175 qDebug("delteAll");
176}
diff --git a/korganizer/kofilterview.h b/korganizer/kofilterview.h
index 2ac4da1..d434c52 100644
--- a/korganizer/kofilterview.h
+++ b/korganizer/kofilterview.h
@@ -1,78 +1,83 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23#ifndef KOFILTERVIEW_H 23#ifndef KOFILTERVIEW_H
24#define KOFILTERVIEW_H 24#define KOFILTERVIEW_H
25 25
26#include <qstring.h> 26#include <qstring.h>
27#include <kconfig.h> 27#include <kconfig.h>
28#include "kofilterview_base.h" 28#include "kofilterview_base.h"
29 29
30#include <libkcal/calfilter.h> 30#include <libkcal/calfilter.h>
31 31
32using namespace KCal; 32using namespace KCal;
33 33
34class KOFilterView : public KOFilterView_base 34class KOFilterView : public KOFilterView_base
35{ 35{
36 Q_OBJECT 36 Q_OBJECT
37 public: 37 public:
38 KOFilterView(QPtrList<CalFilter> *filterList,QWidget* parent=0,const char* name=0, WFlags fl=0); 38 KOFilterView(QPtrList<CalFilter> *filterList,QWidget* parent=0,const char* name=0, WFlags fl=0);
39 ~KOFilterView(); 39 ~KOFilterView();
40 40
41 void updateFilters(); 41 void updateFilters();
42 42
43 bool filtersEnabled(); 43 bool filtersEnabled();
44 void setFiltersEnabled(bool); 44 void setFiltersEnabled(bool);
45 CalFilter *selectedFilter(); 45 CalFilter *selectedFilter();
46 void setSelectedFilter(QString); 46 void setSelectedFilter(QString);
47 void setSelectedFilter( int ); 47 void setSelectedFilter( int );
48 48
49 signals: 49 signals:
50 void filterChanged(); 50 void filterChanged();
51 void editFilters(); 51 void editFilters();
52 52
53 private: 53 private:
54 QPtrList<CalFilter> *mFilters; 54 QPtrList<CalFilter> *mFilters;
55}; 55};
56 56
57class KOCalEditView : public QWidget 57class KOCalEditView : public QWidget
58{ 58{
59 Q_OBJECT 59 Q_OBJECT
60 public: 60 public:
61 KOCalEditView( QWidget* parent=0,const char* name=0, WFlags fl=0); 61 KOCalEditView( QWidget* parent=0,const char* name=0);
62 ~KOCalEditView(); 62 ~KOCalEditView();
63 63
64 void readConfig( KConfig *); 64 void readConfig( KConfig *);
65 65 public slots:
66 void addCal();
67 void enableAll();
68 void enableAlarm();
69 void disableRO();
70 void deleteAll();
66 signals: 71 signals:
67 void alarmEnabled ( int cal, bool enable ); 72 void alarmEnabled ( int cal, bool enable );
68 void calendarEnabled ( int cal, bool enable ); 73 void calendarEnabled ( int cal, bool enable );
69 void calendarReadonly ( int cal, bool readonly ); 74 void calendarReadonly ( int cal, bool readonly );
70 void setCalendarDefault ( int cal ); 75 void setCalendarDefault ( int cal );
71 void removeCalendar ( int cal ); 76 void removeCalendar ( int cal );
72 77
73 private: 78 private:
74}; 79};
75 80
76 81
77 82
78#endif // KOFILTERVIEW_H 83#endif // KOFILTERVIEW_H