-rw-r--r-- | korganizer/calendarview.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index a62145a..697093e 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -370,192 +370,193 @@ void CalendarView::init() | |||
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 | mCalEditView = new KOCalEditView(mLeftFrame,"CalendarView::CaleditView"); |
462 | connect( mCalEditView, SIGNAL( calendarEnabled (int,bool) ),mCalendar, SLOT( setCalendarEnabled(int,bool)) ); | 462 | connect( mCalEditView, SIGNAL( calendarEnabled (int,bool) ),mCalendar, SLOT( setCalendarEnabled(int,bool)) ); |
463 | connect( mCalEditView, SIGNAL( alarmEnabled(int,bool) ),mCalendar, SLOT( setAlarmEnabled(int,bool)) ); | 463 | connect( mCalEditView, SIGNAL( alarmEnabled(int,bool) ),mCalendar, SLOT( setAlarmEnabled(int,bool)) ); |
464 | connect( mCalEditView, SIGNAL( calendarReadonly(int,bool) ),mCalendar, SLOT( setReadOnly(int,bool)) ); | 464 | connect( mCalEditView, SIGNAL( calendarReadonly(int,bool) ),mCalendar, SLOT( setReadOnly(int,bool)) ); |
465 | connect( mCalEditView, SIGNAL( setCalendarDefault(int) ),mCalendar, SLOT( setDefaultCalendar(int)) ); | 465 | connect( mCalEditView, SIGNAL( setCalendarDefault(int) ),mCalendar, SLOT( setDefaultCalendar(int)) ); |
466 | connect( mCalEditView, SIGNAL( setCalendarDefault(int) ),mViewManager, SLOT( setDefaultCalendar(int)) ); | ||
466 | connect( mCalEditView, SIGNAL( removeCalendar(int) ),mCalendar, SLOT( setCalendarRemove(int)) ); | 467 | connect( mCalEditView, SIGNAL( removeCalendar(int) ),mCalendar, SLOT( setCalendarRemove(int)) ); |
467 | connect( mCalEditView, SIGNAL( calendarAdded(int) ),this, SLOT( addCalendarId(int)) ); | 468 | connect( mCalEditView, SIGNAL( calendarAdded(int) ),this, SLOT( addCalendarId(int)) ); |
468 | connect( mCalEditView, SIGNAL( needsUpdate() ),this, SLOT( updateView()) ); | 469 | connect( mCalEditView, SIGNAL( needsUpdate() ),this, SLOT( updateView()) ); |
469 | connect( mCalEditView, SIGNAL( needsUpdate() ),this, SLOT( updateUnmanagedViews()) ); | 470 | connect( mCalEditView, SIGNAL( needsUpdate() ),this, SLOT( updateUnmanagedViews()) ); |
470 | mTodoList->setNavigator( mNavigator ); | 471 | mTodoList->setNavigator( mNavigator ); |
471 | #if 0 | 472 | #if 0 |
472 | if ( QApplication::desktop()->width() < 480 ) { | 473 | if ( QApplication::desktop()->width() < 480 ) { |
473 | leftFrameLayout->addWidget(mFilterView); | 474 | leftFrameLayout->addWidget(mFilterView); |
474 | leftFrameLayout->addWidget(mTodoList, 2 ); | 475 | leftFrameLayout->addWidget(mTodoList, 2 ); |
475 | 476 | ||
476 | } else { | 477 | } else { |
477 | leftFrameLayout->addWidget(mTodoList,2 ); | 478 | leftFrameLayout->addWidget(mTodoList,2 ); |
478 | leftFrameLayout->addWidget(mFilterView ); | 479 | leftFrameLayout->addWidget(mFilterView ); |
479 | } | 480 | } |
480 | #endif | 481 | #endif |
481 | mFilterView->hide(); | 482 | mFilterView->hide(); |
482 | mCalEditView->hide(); | 483 | mCalEditView->hide(); |
483 | QWidget *rightBox = new QWidget( mMainFrame ); | 484 | QWidget *rightBox = new QWidget( mMainFrame ); |
484 | //mainBoxLayout->addWidget ( rightBox, 10 ); | 485 | //mainBoxLayout->addWidget ( rightBox, 10 ); |
485 | QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); | 486 | QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); |
486 | mRightFrame = new QWidgetStack( rightBox ); | 487 | mRightFrame = new QWidgetStack( rightBox ); |
487 | rightLayout->addWidget( mRightFrame, 10 ); | 488 | rightLayout->addWidget( mRightFrame, 10 ); |
488 | 489 | ||
489 | //mLeftFrame = (QWidget *)leftFrame; | 490 | //mLeftFrame = (QWidget *)leftFrame; |
490 | if ( KOPrefs::instance()->mVerticalScreen ) { | 491 | if ( KOPrefs::instance()->mVerticalScreen ) { |
491 | //mDateNavigator->setFixedHeight( mDateNavigator->sizeHint().height() ); | 492 | //mDateNavigator->setFixedHeight( mDateNavigator->sizeHint().height() ); |
492 | //mDateNavigator->setMinimumWidth( mDateNavigator->sizeHint().width() ); | 493 | //mDateNavigator->setMinimumWidth( mDateNavigator->sizeHint().width() ); |
493 | //mTodoList->setFixedHeight( mDateNavigator->sizeHint().height() ); | 494 | //mTodoList->setFixedHeight( mDateNavigator->sizeHint().height() ); |
494 | //leftFrame->setFixedHeight( mDateNavigator->sizeHint().height() ); | 495 | //leftFrame->setFixedHeight( mDateNavigator->sizeHint().height() ); |
495 | } else { | 496 | } else { |
496 | //mDateNavigator->setFixedWidth( mDateNavigator->sizeHint().width() ); | 497 | //mDateNavigator->setFixedWidth( mDateNavigator->sizeHint().width() ); |
497 | //mTodoList->setFixedWidth( mDateNavigator->sizeHint().width() ); | 498 | //mTodoList->setFixedWidth( mDateNavigator->sizeHint().width() ); |
498 | //leftFrame->setFixedWidth( mDateNavigator->sizeHint().width() ); | 499 | //leftFrame->setFixedWidth( mDateNavigator->sizeHint().width() ); |
499 | } | 500 | } |
500 | if ( !KOPrefs::instance()->mShowDateNavigator) | 501 | if ( !KOPrefs::instance()->mShowDateNavigator) |
501 | mDateNavigator->hide(); | 502 | mDateNavigator->hide(); |
502 | //qDebug("Calendarview Size %d %d ", width(), height()); | 503 | //qDebug("Calendarview Size %d %d ", width(), height()); |
503 | #endif | 504 | #endif |
504 | 505 | ||
505 | connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), | 506 | connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), |
506 | SLOT( showDates( const KCal::DateList & ) ) ); | 507 | SLOT( showDates( const KCal::DateList & ) ) ); |
507 | 508 | ||
508 | connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), | 509 | connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), |
509 | mDateNavigator, SLOT( selectDates( const KCal::DateList & ) ) ); | 510 | mDateNavigator, SLOT( selectDates( const KCal::DateList & ) ) ); |
510 | 511 | ||
511 | 512 | ||
512 | 513 | ||
513 | connect( mDateNavigator, SIGNAL( showMonth( const QDate & ) ), | 514 | connect( mDateNavigator, SIGNAL( showMonth( const QDate & ) ), |
514 | mViewManager, SLOT( showMonth( const QDate & ) ) ); | 515 | mViewManager, SLOT( showMonth( const QDate & ) ) ); |
515 | 516 | ||
516 | connect( mDateNavigator, SIGNAL( weekClicked( const QDate & ) ), | 517 | connect( mDateNavigator, SIGNAL( weekClicked( const QDate & ) ), |
517 | mNavigator, SLOT( selectWeek( const QDate & ) ) ); | 518 | mNavigator, SLOT( selectWeek( const QDate & ) ) ); |
518 | 519 | ||
519 | connect( mDateNavigator, SIGNAL( goPrevYear() ), | 520 | connect( mDateNavigator, SIGNAL( goPrevYear() ), |
520 | mNavigator, SLOT( selectPreviousYear() ) ); | 521 | mNavigator, SLOT( selectPreviousYear() ) ); |
521 | connect( mDateNavigator, SIGNAL( goNextYear() ), | 522 | connect( mDateNavigator, SIGNAL( goNextYear() ), |
522 | mNavigator, SLOT( selectNextYear() ) ); | 523 | mNavigator, SLOT( selectNextYear() ) ); |
523 | connect( mDateNavigator, SIGNAL( goPrevMonth() ), | 524 | connect( mDateNavigator, SIGNAL( goPrevMonth() ), |
524 | mNavigator, SLOT( selectPreviousMonth() ) ); | 525 | mNavigator, SLOT( selectPreviousMonth() ) ); |
525 | connect( mDateNavigator, SIGNAL( goNextMonth() ), | 526 | connect( mDateNavigator, SIGNAL( goNextMonth() ), |
526 | mNavigator, SLOT( selectNextMonth() ) ); | 527 | mNavigator, SLOT( selectNextMonth() ) ); |
527 | 528 | ||
528 | connect( mDateNavigator, SIGNAL( goPrevious() ), | 529 | connect( mDateNavigator, SIGNAL( goPrevious() ), |
529 | mNavigator, SLOT( selectPrevious() ) ); | 530 | mNavigator, SLOT( selectPrevious() ) ); |
530 | connect( mDateNavigator, SIGNAL( goNext() ), | 531 | connect( mDateNavigator, SIGNAL( goNext() ), |
531 | mNavigator, SLOT( selectNext() ) ); | 532 | mNavigator, SLOT( selectNext() ) ); |
532 | connect( mDateNavigator, SIGNAL( monthSelected ( int ) ), | 533 | connect( mDateNavigator, SIGNAL( monthSelected ( int ) ), |
533 | mNavigator, SLOT( slotMonthSelect( int ) ) ); | 534 | mNavigator, SLOT( slotMonthSelect( int ) ) ); |
534 | 535 | ||
535 | connect( mDateNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), | 536 | connect( mDateNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), |
536 | mNavigator, SLOT( selectDates( const KCal::DateList & ) ) ); | 537 | mNavigator, SLOT( selectDates( const KCal::DateList & ) ) ); |
537 | #if 0 | 538 | #if 0 |
538 | connect( mDateNavigator, SIGNAL( incidenceDropped( Incidence * ) ), | 539 | connect( mDateNavigator, SIGNAL( incidenceDropped( Incidence * ) ), |
539 | SLOT( incidenceAdded( Incidence *) ) ); | 540 | SLOT( incidenceAdded( Incidence *) ) ); |
540 | #endif | 541 | #endif |
541 | // connect(mDateNavigator,SIGNAL(dayPassed(QDate)),SLOT(updateView())); | 542 | // connect(mDateNavigator,SIGNAL(dayPassed(QDate)),SLOT(updateView())); |
542 | 543 | ||
543 | connect( this, SIGNAL( configChanged() ), | 544 | connect( this, SIGNAL( configChanged() ), |
544 | mDateNavigator, SLOT( updateConfig() ) ); | 545 | mDateNavigator, SLOT( updateConfig() ) ); |
545 | 546 | ||
546 | connect( mTodoList, SIGNAL( newTodoSignal() ), | 547 | connect( mTodoList, SIGNAL( newTodoSignal() ), |
547 | SLOT( newTodo() ) ); | 548 | SLOT( newTodo() ) ); |
548 | connect( mTodoList, SIGNAL( newSubTodoSignal( Todo *) ), | 549 | connect( mTodoList, SIGNAL( newSubTodoSignal( Todo *) ), |
549 | SLOT( newSubTodo( Todo * ) ) ); | 550 | SLOT( newSubTodo( Todo * ) ) ); |
550 | connect( mTodoList, SIGNAL( editTodoSignal( Todo * ) ), | 551 | connect( mTodoList, SIGNAL( editTodoSignal( Todo * ) ), |
551 | SLOT( editTodo( Todo * ) ) ); | 552 | SLOT( editTodo( Todo * ) ) ); |
552 | connect( mTodoList, SIGNAL( showTodoSignal( Todo * ) ), | 553 | connect( mTodoList, SIGNAL( showTodoSignal( Todo * ) ), |
553 | SLOT( showTodo( Todo *) ) ); | 554 | SLOT( showTodo( Todo *) ) ); |
554 | connect( mTodoList, SIGNAL( deleteTodoSignal( Todo *) ), | 555 | connect( mTodoList, SIGNAL( deleteTodoSignal( Todo *) ), |
555 | SLOT( deleteTodo( Todo *) ) ); | 556 | SLOT( deleteTodo( Todo *) ) ); |
556 | connect( this, SIGNAL( configChanged()), mTodoList, SLOT( updateConfig() ) ); | 557 | connect( this, SIGNAL( configChanged()), mTodoList, SLOT( updateConfig() ) ); |
557 | connect( mTodoList, SIGNAL( purgeCompletedSignal() ), | 558 | connect( mTodoList, SIGNAL( purgeCompletedSignal() ), |
558 | SLOT( purgeCompleted() ) ); | 559 | SLOT( purgeCompleted() ) ); |
559 | connect( mTodoList, SIGNAL( todoModifiedSignal( Todo *, int ) ), | 560 | connect( mTodoList, SIGNAL( todoModifiedSignal( Todo *, int ) ), |
560 | SIGNAL( todoModified( Todo *, int ) ) ); | 561 | SIGNAL( todoModified( Todo *, int ) ) ); |
561 | 562 | ||