author | zautrix <zautrix> | 2005-10-22 16:49:42 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-10-22 16:49:42 (UTC) |
commit | 3ec18dd19fdf4eb7e763b8022f90de83249facfd (patch) (unidiff) | |
tree | abc6c8568c33b70afd8abc46ae9495e5d862cba1 /korganizer | |
parent | c643664ae97e757afda1012dc998b49e6cc2d575 (diff) | |
download | kdepimpi-3ec18dd19fdf4eb7e763b8022f90de83249facfd.zip kdepimpi-3ec18dd19fdf4eb7e763b8022f90de83249facfd.tar.gz kdepimpi-3ec18dd19fdf4eb7e763b8022f90de83249facfd.tar.bz2 |
fixxx
-rw-r--r-- | korganizer/calendarview.cpp | 16 | ||||
-rw-r--r-- | korganizer/calendarview.h | 1 | ||||
-rw-r--r-- | korganizer/kofilterview.cpp | 6 | ||||
-rw-r--r-- | korganizer/kofilterview.h | 1 |
4 files changed, 22 insertions, 2 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index e31a6e1..28b17a5 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -384,193 +384,195 @@ void CalendarView::init() | |||
384 | 384 | ||
385 | mCalendar->registerObserver( this ); | 385 | mCalendar->registerObserver( this ); |
386 | // TODO: Make sure that view is updated, when calendar is changed. | 386 | // TODO: Make sure that view is updated, when calendar is changed. |
387 | 387 | ||
388 | mStorage = new FileStorage( mCalendar ); | 388 | mStorage = new FileStorage( mCalendar ); |
389 | mNavigator = new DateNavigator( this, "datevav", mViewManager ); | 389 | mNavigator = new DateNavigator( this, "datevav", mViewManager ); |
390 | 390 | ||
391 | QBoxLayout *topLayout = (QBoxLayout*)layout(); | 391 | QBoxLayout *topLayout = (QBoxLayout*)layout(); |
392 | #ifndef KORG_NOSPLITTER | 392 | #ifndef KORG_NOSPLITTER |
393 | // create the main layout frames. | 393 | // create the main layout frames. |
394 | mPanner = new QSplitter(QSplitter::Horizontal,this,"CalendarView::Panner"); | 394 | mPanner = new QSplitter(QSplitter::Horizontal,this,"CalendarView::Panner"); |
395 | topLayout->addWidget(mPanner); | 395 | topLayout->addWidget(mPanner); |
396 | 396 | ||
397 | mLeftSplitter = new QSplitter(QSplitter::Vertical,mPanner, | 397 | mLeftSplitter = new QSplitter(QSplitter::Vertical,mPanner, |
398 | "CalendarView::LeftFrame"); | 398 | "CalendarView::LeftFrame"); |
399 | mPanner->setResizeMode(mLeftSplitter,QSplitter::KeepSize); | 399 | mPanner->setResizeMode(mLeftSplitter,QSplitter::KeepSize); |
400 | 400 | ||
401 | mDateNavigator = new DateNavigatorContainer( mLeftSplitter, | 401 | mDateNavigator = new DateNavigatorContainer( mLeftSplitter, |
402 | "CalendarView::DateNavigator" ); | 402 | "CalendarView::DateNavigator" ); |
403 | 403 | ||
404 | mLeftSplitter->setResizeMode(mDateNavigator,QSplitter::KeepSize); | 404 | mLeftSplitter->setResizeMode(mDateNavigator,QSplitter::KeepSize); |
405 | mTodoList = new KOTodoView(mCalendar, mLeftSplitter, "todolist_small2"); | 405 | mTodoList = new KOTodoView(mCalendar, mLeftSplitter, "todolist_small2"); |
406 | mTodoList->setNavigator( mNavigator ); | 406 | mTodoList->setNavigator( mNavigator ); |
407 | mFilterView = new KOFilterView(&mFilters,mLeftSplitter,"CalendarView::FilterView"); | 407 | mFilterView = new KOFilterView(&mFilters,mLeftSplitter,"CalendarView::FilterView"); |
408 | 408 | ||
409 | #ifdef KORG_NORESOURCEVIEW | 409 | #ifdef KORG_NORESOURCEVIEW |
410 | mResourceView = 0; | 410 | mResourceView = 0; |
411 | #else | 411 | #else |
412 | if ( mResourceManager ) { | 412 | if ( mResourceManager ) { |
413 | mResourceView = new ResourceView( mResourceManager, mLeftSplitter ); | 413 | mResourceView = new ResourceView( mResourceManager, mLeftSplitter ); |
414 | mResourceView->updateView(); | 414 | mResourceView->updateView(); |
415 | connect( mResourceView, SIGNAL( resourcesChanged() ), | 415 | connect( mResourceView, SIGNAL( resourcesChanged() ), |
416 | SLOT( updateView() ) ); | 416 | SLOT( updateView() ) ); |
417 | } else { | 417 | } else { |
418 | mResourceView = 0; | 418 | mResourceView = 0; |
419 | } | 419 | } |
420 | #endif | 420 | #endif |
421 | QWidget *rightBox = new QWidget( mPanner ); | 421 | QWidget *rightBox = new QWidget( mPanner ); |
422 | QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); | 422 | QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); |
423 | 423 | ||
424 | mRightFrame = new QWidgetStack( rightBox ); | 424 | mRightFrame = new QWidgetStack( rightBox ); |
425 | rightLayout->addWidget( mRightFrame, 1 ); | 425 | rightLayout->addWidget( mRightFrame, 1 ); |
426 | 426 | ||
427 | mLeftFrame = mLeftSplitter; | 427 | mLeftFrame = mLeftSplitter; |
428 | #else | 428 | #else |
429 | //QWidget *mainBox = new QWidget( this ); | 429 | //QWidget *mainBox = new QWidget( this ); |
430 | //QWidget *leftFrame = new QWidget( mainBox ); | 430 | //QWidget *leftFrame = new QWidget( mainBox ); |
431 | //QBoxLayout * mainBoxLayout; | 431 | //QBoxLayout * mainBoxLayout; |
432 | if ( KOPrefs::instance()->mVerticalScreen ) { | 432 | if ( KOPrefs::instance()->mVerticalScreen ) { |
433 | //mainBoxLayout = new QVBoxLayout(mainBox); | 433 | //mainBoxLayout = new QVBoxLayout(mainBox); |
434 | //leftFrameLayout = new QHBoxLayout(leftFrame ); | 434 | //leftFrameLayout = new QHBoxLayout(leftFrame ); |
435 | mMainFrame = new KDGanttMinimizeSplitter( Qt::Vertical, this ); | 435 | mMainFrame = new KDGanttMinimizeSplitter( Qt::Vertical, this ); |
436 | mMainFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Up ); | 436 | mMainFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Up ); |
437 | mLeftFrame = new KDGanttMinimizeSplitter( Qt::Horizontal, mMainFrame);; | 437 | mLeftFrame = new KDGanttMinimizeSplitter( Qt::Horizontal, mMainFrame);; |
438 | mLeftFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); | 438 | mLeftFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); |
439 | } else { | 439 | } else { |
440 | //mainBoxLayout = new QHBoxLayout(mainBox); | 440 | //mainBoxLayout = new QHBoxLayout(mainBox); |
441 | //leftFrameLayout = new QVBoxLayout(leftFrame ); | 441 | //leftFrameLayout = new QVBoxLayout(leftFrame ); |
442 | mMainFrame = new KDGanttMinimizeSplitter( Qt::Horizontal, this); | 442 | mMainFrame = new KDGanttMinimizeSplitter( Qt::Horizontal, this); |
443 | mMainFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Left); | 443 | mMainFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Left); |
444 | mLeftFrame = new KDGanttMinimizeSplitter( Qt::Vertical, mMainFrame); | 444 | mLeftFrame = new KDGanttMinimizeSplitter( Qt::Vertical, mMainFrame); |
445 | mLeftFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Up ); | 445 | mLeftFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Up ); |
446 | } | 446 | } |
447 | mMainFrame->setSizePolicy( QSizePolicy (QSizePolicy::Expanding,QSizePolicy::Expanding) ); | 447 | mMainFrame->setSizePolicy( QSizePolicy (QSizePolicy::Expanding,QSizePolicy::Expanding) ); |
448 | //QBoxLayout * leftFrameLayout; | 448 | //QBoxLayout * leftFrameLayout; |
449 | topLayout->addWidget( mMainFrame ); | 449 | topLayout->addWidget( mMainFrame ); |
450 | #ifdef DESKTOP_VERSION | 450 | #ifdef DESKTOP_VERSION |
451 | mDateScrollBar = new QScrollBar ( 1, 365, 1,30, 200,QScrollBar::Horizontal, this ); | 451 | mDateScrollBar = new QScrollBar ( 1, 365, 1,30, 200,QScrollBar::Horizontal, this ); |
452 | topLayout->addWidget( mDateScrollBar ); | 452 | topLayout->addWidget( mDateScrollBar ); |
453 | connect( mDateScrollBar, SIGNAL( valueChanged ( int ) ),this, SLOT( scrollBarValue( int )) ); | 453 | connect( mDateScrollBar, SIGNAL( valueChanged ( int ) ),this, SLOT( scrollBarValue( int )) ); |
454 | if ( QApplication::desktop()->width() < 800 ) | 454 | if ( QApplication::desktop()->width() < 800 ) |
455 | mDateScrollBar->hide(); | 455 | mDateScrollBar->hide(); |
456 | #endif | 456 | #endif |
457 | //mainBoxLayout->addWidget (mLeftFrame); | 457 | //mainBoxLayout->addWidget (mLeftFrame); |
458 | mDateNavigator = new DateNavigatorContainer( mLeftFrame, | 458 | mDateNavigator = new DateNavigatorContainer( mLeftFrame, |
459 | "CalendarView::DateNavigator" ); | 459 | "CalendarView::DateNavigator" ); |
460 | #if 0 | 460 | #if 0 |
461 | // FIXME | 461 | // FIXME |
462 | mDateNavigator = new KDateNavigator(mLeftFrame, mCalendar, TRUE, | 462 | mDateNavigator = new KDateNavigator(mLeftFrame, mCalendar, TRUE, |
463 | "CalendarView::DateNavigator", QDate::currentDate()); | 463 | "CalendarView::DateNavigator", QDate::currentDate()); |
464 | #endif | 464 | #endif |
465 | // mDateNavigator->blockSignals( true ); | 465 | // mDateNavigator->blockSignals( true ); |
466 | //leftFrameLayout->addWidget( mDateNavigator ); | 466 | //leftFrameLayout->addWidget( mDateNavigator ); |
467 | mTodoList = new KOTodoView(mCalendar, mLeftFrame, "todolistsmall"); | 467 | mTodoList = new KOTodoView(mCalendar, mLeftFrame, "todolistsmall"); |
468 | mFilterView = new KOFilterView(&mFilters,mLeftFrame,"CalendarView::FilterView"); | 468 | mFilterView = new KOFilterView(&mFilters,mLeftFrame,"CalendarView::FilterView"); |
469 | mCalEditView = new KOCalEditView(mLeftFrame,"CalendarView::CaleditView"); | 469 | mCalEditView = new KOCalEditView(mLeftFrame,"CalendarView::CaleditView"); |
470 | connect( mCalEditView, SIGNAL( calendarEnabled (int,bool) ),mCalendar, SLOT( setCalendarEnabled(int,bool)) ); | 470 | connect( mCalEditView, SIGNAL( calendarEnabled (int,bool) ),mCalendar, SLOT( setCalendarEnabled(int,bool)) ); |
471 | connect( mCalEditView, SIGNAL( alarmEnabled(int,bool) ),mCalendar, SLOT( setAlarmEnabled(int,bool)) ); | 471 | connect( mCalEditView, SIGNAL( alarmEnabled(int,bool) ),mCalendar, SLOT( setAlarmEnabled(int,bool)) ); |
472 | connect( mCalEditView, SIGNAL( calendarReadonly(int,bool) ),this, SLOT( setCalReadOnly(int,bool)) ); | 472 | connect( mCalEditView, SIGNAL( calendarReadonly(int,bool) ),this, SLOT( setCalReadOnly(int,bool)) ); |
473 | connect( mCalEditView, SIGNAL( setCalendarDefault(int) ),mCalendar, SLOT( setDefaultCalendar(int)) ); | 473 | connect( mCalEditView, SIGNAL( setCalendarDefault(int) ),mCalendar, SLOT( setDefaultCalendar(int)) ); |
474 | connect( mCalEditView, SIGNAL( setCalendarDefault(int) ),mViewManager, SLOT( setDefaultCalendar(int)) ); | 474 | connect( mCalEditView, SIGNAL( setCalendarDefault(int) ),mViewManager, SLOT( setDefaultCalendar(int)) ); |
475 | connect( mCalEditView, SIGNAL( removeCalendar(int) ),mCalendar, SLOT( setCalendarRemove(int)) ); | 475 | connect( mCalEditView, SIGNAL( removeCalendar(int) ),mCalendar, SLOT( setCalendarRemove(int)) ); |
476 | connect( mCalEditView, SIGNAL( calendarAdded(int) ),this, SLOT( addCalendarId(int)) ); | 476 | connect( mCalEditView, SIGNAL( calendarAdded(int) ),this, SLOT( addCalendarId(int)) ); |
477 | connect( mCalEditView, SIGNAL( needsUpdate() ),this, SLOT( updateView()) ); | 477 | connect( mCalEditView, SIGNAL( needsUpdate() ),this, SLOT( updateView()) ); |
478 | connect( mCalEditView, SIGNAL( checkCalendar() ),this, SLOT( checkFiles() )); | 478 | connect( mCalEditView, SIGNAL( checkCalendar() ),this, SLOT( checkFiles() )); |
479 | connect( mCalEditView, SIGNAL( needsUpdate() ),this, SLOT( updateUnmanagedViews()) ); | 479 | connect( mCalEditView, SIGNAL( needsUpdate() ),this, SLOT( updateUnmanagedViews()) ); |
480 | connect( mCalEditView, SIGNAL( requestCalendarInfo( int ) ),this, SLOT( displayCalendarInfo( int ) ) ); | ||
480 | 481 | ||
482 | |||
481 | mTodoList->setNavigator( mNavigator ); | 483 | mTodoList->setNavigator( mNavigator ); |
482 | #if 0 | 484 | #if 0 |
483 | if ( QApplication::desktop()->width() < 480 ) { | 485 | if ( QApplication::desktop()->width() < 480 ) { |
484 | leftFrameLayout->addWidget(mFilterView); | 486 | leftFrameLayout->addWidget(mFilterView); |
485 | leftFrameLayout->addWidget(mTodoList, 2 ); | 487 | leftFrameLayout->addWidget(mTodoList, 2 ); |
486 | 488 | ||
487 | } else { | 489 | } else { |
488 | leftFrameLayout->addWidget(mTodoList,2 ); | 490 | leftFrameLayout->addWidget(mTodoList,2 ); |
489 | leftFrameLayout->addWidget(mFilterView ); | 491 | leftFrameLayout->addWidget(mFilterView ); |
490 | } | 492 | } |
491 | #endif | 493 | #endif |
492 | mFilterView->hide(); | 494 | mFilterView->hide(); |
493 | mCalEditView->hide(); | 495 | mCalEditView->hide(); |
494 | QWidget *rightBox = new QWidget( mMainFrame ); | 496 | QWidget *rightBox = new QWidget( mMainFrame ); |
495 | //mainBoxLayout->addWidget ( rightBox, 10 ); | 497 | //mainBoxLayout->addWidget ( rightBox, 10 ); |
496 | QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); | 498 | QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); |
497 | mRightFrame = new QWidgetStack( rightBox ); | 499 | mRightFrame = new QWidgetStack( rightBox ); |
498 | rightLayout->addWidget( mRightFrame, 10 ); | 500 | rightLayout->addWidget( mRightFrame, 10 ); |
499 | 501 | ||
500 | //mLeftFrame = (QWidget *)leftFrame; | 502 | //mLeftFrame = (QWidget *)leftFrame; |
501 | if ( KOPrefs::instance()->mVerticalScreen ) { | 503 | if ( KOPrefs::instance()->mVerticalScreen ) { |
502 | //mDateNavigator->setFixedHeight( mDateNavigator->sizeHint().height() ); | 504 | //mDateNavigator->setFixedHeight( mDateNavigator->sizeHint().height() ); |
503 | //mDateNavigator->setMinimumWidth( mDateNavigator->sizeHint().width() ); | 505 | //mDateNavigator->setMinimumWidth( mDateNavigator->sizeHint().width() ); |
504 | //mTodoList->setFixedHeight( mDateNavigator->sizeHint().height() ); | 506 | //mTodoList->setFixedHeight( mDateNavigator->sizeHint().height() ); |
505 | //leftFrame->setFixedHeight( mDateNavigator->sizeHint().height() ); | 507 | //leftFrame->setFixedHeight( mDateNavigator->sizeHint().height() ); |
506 | } else { | 508 | } else { |
507 | //mDateNavigator->setFixedWidth( mDateNavigator->sizeHint().width() ); | 509 | //mDateNavigator->setFixedWidth( mDateNavigator->sizeHint().width() ); |
508 | //mTodoList->setFixedWidth( mDateNavigator->sizeHint().width() ); | 510 | //mTodoList->setFixedWidth( mDateNavigator->sizeHint().width() ); |
509 | //leftFrame->setFixedWidth( mDateNavigator->sizeHint().width() ); | 511 | //leftFrame->setFixedWidth( mDateNavigator->sizeHint().width() ); |
510 | } | 512 | } |
511 | if ( !KOPrefs::instance()->mShowDateNavigator) | 513 | if ( !KOPrefs::instance()->mShowDateNavigator) |
512 | mDateNavigator->hide(); | 514 | mDateNavigator->hide(); |
513 | //qDebug("Calendarview Size %d %d ", width(), height()); | 515 | //qDebug("Calendarview Size %d %d ", width(), height()); |
514 | #endif | 516 | #endif |
515 | 517 | ||
516 | connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), | 518 | connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), |
517 | SLOT( showDates( const KCal::DateList & ) ) ); | 519 | SLOT( showDates( const KCal::DateList & ) ) ); |
518 | 520 | ||
519 | connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), | 521 | connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), |
520 | mDateNavigator, SLOT( selectDates( const KCal::DateList & ) ) ); | 522 | mDateNavigator, SLOT( selectDates( const KCal::DateList & ) ) ); |
521 | 523 | ||
522 | 524 | ||
523 | 525 | ||
524 | connect( mDateNavigator, SIGNAL( showMonth( const QDate & ) ), | 526 | connect( mDateNavigator, SIGNAL( showMonth( const QDate & ) ), |
525 | mViewManager, SLOT( showMonth( const QDate & ) ) ); | 527 | mViewManager, SLOT( showMonth( const QDate & ) ) ); |
526 | 528 | ||
527 | connect( mDateNavigator, SIGNAL( weekClicked( const QDate & ) ), | 529 | connect( mDateNavigator, SIGNAL( weekClicked( const QDate & ) ), |
528 | mNavigator, SLOT( selectWeek( const QDate & ) ) ); | 530 | mNavigator, SLOT( selectWeek( const QDate & ) ) ); |
529 | 531 | ||
530 | connect( mDateNavigator, SIGNAL( goPrevYear() ), | 532 | connect( mDateNavigator, SIGNAL( goPrevYear() ), |
531 | mNavigator, SLOT( selectPreviousYear() ) ); | 533 | mNavigator, SLOT( selectPreviousYear() ) ); |
532 | connect( mDateNavigator, SIGNAL( goNextYear() ), | 534 | connect( mDateNavigator, SIGNAL( goNextYear() ), |
533 | mNavigator, SLOT( selectNextYear() ) ); | 535 | mNavigator, SLOT( selectNextYear() ) ); |
534 | connect( mDateNavigator, SIGNAL( goPrevMonth() ), | 536 | connect( mDateNavigator, SIGNAL( goPrevMonth() ), |
535 | mNavigator, SLOT( selectPreviousMonth() ) ); | 537 | mNavigator, SLOT( selectPreviousMonth() ) ); |
536 | connect( mDateNavigator, SIGNAL( goNextMonth() ), | 538 | connect( mDateNavigator, SIGNAL( goNextMonth() ), |
537 | mNavigator, SLOT( selectNextMonth() ) ); | 539 | mNavigator, SLOT( selectNextMonth() ) ); |
538 | 540 | ||
539 | connect( mDateNavigator, SIGNAL( goPrevious() ), | 541 | connect( mDateNavigator, SIGNAL( goPrevious() ), |
540 | mNavigator, SLOT( selectPrevious() ) ); | 542 | mNavigator, SLOT( selectPrevious() ) ); |
541 | connect( mDateNavigator, SIGNAL( goNext() ), | 543 | connect( mDateNavigator, SIGNAL( goNext() ), |
542 | mNavigator, SLOT( selectNext() ) ); | 544 | mNavigator, SLOT( selectNext() ) ); |
543 | connect( mDateNavigator, SIGNAL( monthSelected ( int ) ), | 545 | connect( mDateNavigator, SIGNAL( monthSelected ( int ) ), |
544 | mNavigator, SLOT( slotMonthSelect( int ) ) ); | 546 | mNavigator, SLOT( slotMonthSelect( int ) ) ); |
545 | 547 | ||
546 | connect( mDateNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), | 548 | connect( mDateNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), |
547 | mNavigator, SLOT( selectDates( const KCal::DateList & ) ) ); | 549 | mNavigator, SLOT( selectDates( const KCal::DateList & ) ) ); |
548 | #if 0 | 550 | #if 0 |
549 | connect( mDateNavigator, SIGNAL( incidenceDropped( Incidence * ) ), | 551 | connect( mDateNavigator, SIGNAL( incidenceDropped( Incidence * ) ), |
550 | SLOT( incidenceAdded( Incidence *) ) ); | 552 | SLOT( incidenceAdded( Incidence *) ) ); |
551 | #endif | 553 | #endif |
552 | // connect(mDateNavigator,SIGNAL(dayPassed(QDate)),SLOT(updateView())); | 554 | // connect(mDateNavigator,SIGNAL(dayPassed(QDate)),SLOT(updateView())); |
553 | 555 | ||
554 | connect( this, SIGNAL( configChanged() ), | 556 | connect( this, SIGNAL( configChanged() ), |
555 | mDateNavigator, SLOT( updateConfig() ) ); | 557 | mDateNavigator, SLOT( updateConfig() ) ); |
556 | 558 | ||
557 | connect( mTodoList, SIGNAL( newTodoSignal() ), | 559 | connect( mTodoList, SIGNAL( newTodoSignal() ), |
558 | SLOT( newTodo() ) ); | 560 | SLOT( newTodo() ) ); |
559 | connect( mTodoList, SIGNAL( newSubTodoSignal( Todo *) ), | 561 | connect( mTodoList, SIGNAL( newSubTodoSignal( Todo *) ), |
560 | SLOT( newSubTodo( Todo * ) ) ); | 562 | SLOT( newSubTodo( Todo * ) ) ); |
561 | connect( mTodoList, SIGNAL( editTodoSignal( Todo * ) ), | 563 | connect( mTodoList, SIGNAL( editTodoSignal( Todo * ) ), |
562 | SLOT( editTodo( Todo * ) ) ); | 564 | SLOT( editTodo( Todo * ) ) ); |
563 | connect( mTodoList, SIGNAL( showTodoSignal( Todo * ) ), | 565 | connect( mTodoList, SIGNAL( showTodoSignal( Todo * ) ), |
564 | SLOT( showTodo( Todo *) ) ); | 566 | SLOT( showTodo( Todo *) ) ); |
565 | connect( mTodoList, SIGNAL( deleteTodoSignal( Todo *) ), | 567 | connect( mTodoList, SIGNAL( deleteTodoSignal( Todo *) ), |
566 | SLOT( deleteTodo( Todo *) ) ); | 568 | SLOT( deleteTodo( Todo *) ) ); |
567 | connect( this, SIGNAL( configChanged()), mTodoList, SLOT( updateConfig() ) ); | 569 | connect( this, SIGNAL( configChanged()), mTodoList, SLOT( updateConfig() ) ); |
568 | connect( mTodoList, SIGNAL( purgeCompletedSignal() ), | 570 | connect( mTodoList, SIGNAL( purgeCompletedSignal() ), |
569 | SLOT( purgeCompleted() ) ); | 571 | SLOT( purgeCompleted() ) ); |
570 | connect( mTodoList, SIGNAL( todoModifiedSignal( Todo *, int ) ), | 572 | connect( mTodoList, SIGNAL( todoModifiedSignal( Todo *, int ) ), |
571 | SIGNAL( todoModified( Todo *, int ) ) ); | 573 | SIGNAL( todoModified( Todo *, int ) ) ); |
572 | 574 | ||
573 | connect( mTodoList, SIGNAL( cloneTodoSignal( Incidence * ) ), | 575 | connect( mTodoList, SIGNAL( cloneTodoSignal( Incidence * ) ), |
574 | this, SLOT ( cloneIncidence( Incidence * ) ) ); | 576 | this, SLOT ( cloneIncidence( Incidence * ) ) ); |
575 | connect( mTodoList, SIGNAL( cancelTodoSignal( Incidence * ) ), | 577 | connect( mTodoList, SIGNAL( cancelTodoSignal( Incidence * ) ), |
576 | this, SLOT (cancelIncidence( Incidence * ) ) ); | 578 | this, SLOT (cancelIncidence( Incidence * ) ) ); |
@@ -5065,96 +5067,110 @@ void CalendarView::setSyncManager(KSyncManager* manager) | |||
5065 | 5067 | ||
5066 | void CalendarView::removeSyncInfo( QString syncProfile) | 5068 | void CalendarView::removeSyncInfo( QString syncProfile) |
5067 | { | 5069 | { |
5068 | qDebug("KO: removeSyncInfo for profile %s ", syncProfile.latin1()); | 5070 | qDebug("KO: removeSyncInfo for profile %s ", syncProfile.latin1()); |
5069 | mCalendar->removeSyncInfo( syncProfile ); | 5071 | mCalendar->removeSyncInfo( syncProfile ); |
5070 | 5072 | ||
5071 | } | 5073 | } |
5072 | 5074 | ||
5073 | void CalendarView::undo_delete() | 5075 | void CalendarView::undo_delete() |
5074 | { | 5076 | { |
5075 | //qDebug("undo_delete() "); | 5077 | //qDebug("undo_delete() "); |
5076 | Incidence* undo = mCalendar->undoIncidence(); | 5078 | Incidence* undo = mCalendar->undoIncidence(); |
5077 | if ( !undo ) { | 5079 | if ( !undo ) { |
5078 | KMessageBox::sorry(this,i18n("There is nothing to undo!"), | 5080 | KMessageBox::sorry(this,i18n("There is nothing to undo!"), |
5079 | i18n("KO/Pi")); | 5081 | i18n("KO/Pi")); |
5080 | return; | 5082 | return; |
5081 | } | 5083 | } |
5082 | if ( KMessageBox::Continue ==KMessageBox::warningContinueCancel(this,KGlobal::formatMessage ( undo->summary(),0 ) + | 5084 | if ( KMessageBox::Continue ==KMessageBox::warningContinueCancel(this,KGlobal::formatMessage ( undo->summary(),0 ) + |
5083 | i18n("\nAre you sure you want\nto restore this?"), | 5085 | i18n("\nAre you sure you want\nto restore this?"), |
5084 | i18n("KO/Pi Confirmation"),i18n("Restore"))) { | 5086 | i18n("KO/Pi Confirmation"),i18n("Restore"))) { |
5085 | mCalendar->undoDeleteIncidence(); | 5087 | mCalendar->undoDeleteIncidence(); |
5086 | updateView(); | 5088 | updateView(); |
5087 | } | 5089 | } |
5088 | } | 5090 | } |
5089 | 5091 | ||
5090 | void CalendarView::slotViewerClosed() | 5092 | void CalendarView::slotViewerClosed() |
5091 | { | 5093 | { |
5092 | QTimer::singleShot( 50, this, SLOT ( resetFocus() ) ); | 5094 | QTimer::singleShot( 50, this, SLOT ( resetFocus() ) ); |
5093 | } | 5095 | } |
5094 | 5096 | ||
5095 | void CalendarView::resetFocus() | 5097 | void CalendarView::resetFocus() |
5096 | { | 5098 | { |
5097 | if ( mViewerCallerIsSearchDialog ) { | 5099 | if ( mViewerCallerIsSearchDialog ) { |
5098 | if ( mDialogManager->getSearchDialog()->isVisible() ){ | 5100 | if ( mDialogManager->getSearchDialog()->isVisible() ){ |
5099 | mDialogManager->getSearchDialog()->raise(); | 5101 | mDialogManager->getSearchDialog()->raise(); |
5100 | mDialogManager->getSearchDialog()->setActiveWindow(); | 5102 | mDialogManager->getSearchDialog()->setActiveWindow(); |
5101 | mDialogManager->getSearchDialog()->listview()->resetFocus(); | 5103 | mDialogManager->getSearchDialog()->listview()->resetFocus(); |
5102 | } else | 5104 | } else |
5103 | mViewerCallerIsSearchDialog = false; | 5105 | mViewerCallerIsSearchDialog = false; |
5104 | } | 5106 | } |
5105 | if ( !mViewerCallerIsSearchDialog ) { | 5107 | if ( !mViewerCallerIsSearchDialog ) { |
5106 | //mViewManager->currentView()->setFocus(); | 5108 | //mViewManager->currentView()->setFocus(); |
5107 | //qDebug("sssssssssssssssset focus "); | 5109 | //qDebug("sssssssssssssssset focus "); |
5108 | topLevelWidget()->raise(); | 5110 | topLevelWidget()->raise(); |
5109 | setActiveWindow(); | 5111 | setActiveWindow(); |
5110 | //setFocus(); | 5112 | //setFocus(); |
5111 | } | 5113 | } |
5112 | mViewerCallerIsSearchDialog = false; | 5114 | mViewerCallerIsSearchDialog = false; |
5113 | } | 5115 | } |
5114 | 5116 | ||
5115 | void CalendarView::showNextAlarms() | 5117 | void CalendarView::showNextAlarms() |
5116 | { | 5118 | { |
5117 | QString message; | 5119 | QString message; |
5118 | QDateTime nextAl = mCalendar->nextAlarmEventDateTime(); | 5120 | QDateTime nextAl = mCalendar->nextAlarmEventDateTime(); |
5119 | if ( nextAl.isValid() && mNextAlarmDateTime > QDateTime::currentDateTime() ) { | 5121 | if ( nextAl.isValid() && mNextAlarmDateTime > QDateTime::currentDateTime() ) { |
5120 | QString sum = mCalendar->nextSummary(); | 5122 | QString sum = mCalendar->nextSummary(); |
5121 | QDateTime nextA = mNextAlarmDateTime; | 5123 | QDateTime nextA = mNextAlarmDateTime; |
5122 | QDateTime cur = QDateTime::currentDateTime(); | 5124 | QDateTime cur = QDateTime::currentDateTime(); |
5123 | int secs = cur.secsTo( nextA ); | 5125 | int secs = cur.secsTo( nextA ); |
5124 | int min = secs /60; | 5126 | int min = secs /60; |
5125 | int hours = min /60; | 5127 | int hours = min /60; |
5126 | min = min % 60; | 5128 | min = min % 60; |
5127 | int days = hours /24; | 5129 | int days = hours /24; |
5128 | hours = hours % 24; | 5130 | hours = hours % 24; |
5129 | 5131 | ||
5130 | //message = i18n("The next alarm is in:\n"); | 5132 | //message = i18n("The next alarm is in:\n"); |
5131 | if ( days > 1 ) | 5133 | if ( days > 1 ) |
5132 | message += i18n("%1 days\n").arg( days ); | 5134 | message += i18n("%1 days\n").arg( days ); |
5133 | else if ( days == 1 ) | 5135 | else if ( days == 1 ) |
5134 | message += i18n("1 day\n"); | 5136 | message += i18n("1 day\n"); |
5135 | if ( hours > 1 ) | 5137 | if ( hours > 1 ) |
5136 | message += i18n("%1 hours\n").arg( hours ); | 5138 | message += i18n("%1 hours\n").arg( hours ); |
5137 | else if ( hours == 1 ) | 5139 | else if ( hours == 1 ) |
5138 | message += i18n("1 hour\n"); | 5140 | message += i18n("1 hour\n"); |
5139 | if ( min > 1 ) | 5141 | if ( min > 1 ) |
5140 | message += i18n("%1 minutes\n").arg( min ); | 5142 | message += i18n("%1 minutes\n").arg( min ); |
5141 | else if ( min == 1 ) | 5143 | else if ( min == 1 ) |
5142 | message += i18n("1 minute\n"); | 5144 | message += i18n("1 minute\n"); |
5143 | if ( message.isEmpty() ) | 5145 | if ( message.isEmpty() ) |
5144 | message = i18n("The next alarm is in\nless than one minute!"); | 5146 | message = i18n("The next alarm is in\nless than one minute!"); |
5145 | else | 5147 | else |
5146 | message = i18n("The next alarm is in:\n") + message; | 5148 | message = i18n("The next alarm is in:\n") + message; |
5147 | message += i18n("\n(%1)\n\n%2\n(%3)\n").arg( KGlobal::locale()->formatDateTime(nextA , false)).arg(sum ).arg( KGlobal::locale()->formatDateTime(nextAl , false)) ; | 5149 | message += i18n("\n(%1)\n\n%2\n(%3)\n").arg( KGlobal::locale()->formatDateTime(nextA , false)).arg(sum ).arg( KGlobal::locale()->formatDateTime(nextAl , false)) ; |
5148 | } else { | 5150 | } else { |
5149 | message = i18n("There is no next alarm."); | 5151 | message = i18n("There is no next alarm."); |
5150 | 5152 | ||
5151 | } | 5153 | } |
5152 | #ifdef DESKTOP_VERSION | 5154 | #ifdef DESKTOP_VERSION |
5153 | if ( ! KOPrefs::instance()->mUseInternalAlarmNotification ) { | 5155 | if ( ! KOPrefs::instance()->mUseInternalAlarmNotification ) { |
5154 | message += i18n("\nThe internal alarm notification is disabled!\n"); | 5156 | message += i18n("\nThe internal alarm notification is disabled!\n"); |
5155 | message += i18n("Enable it in the settings menu, TAB alarm."); | 5157 | message += i18n("Enable it in the settings menu, TAB alarm."); |
5156 | } | 5158 | } |
5157 | 5159 | ||
5158 | #endif | 5160 | #endif |
5159 | KMessageBox::information( this, message); | 5161 | KMessageBox::information( this, message); |
5160 | } | 5162 | } |
5163 | |||
5164 | void CalendarView::displayCalendarInfo( int id ) | ||
5165 | { | ||
5166 | int e, t,j; | ||
5167 | KopiCalendarFile * kkf = KOPrefs::instance()->getCalendar( id ); | ||
5168 | QString name = kkf->mName; | ||
5169 | mCalendar->getIncidenceCount( id, e, t, j ); | ||
5170 | QString file = KGlobal::formatMessage ( kkf->mFileName ,0 ); | ||
5171 | QString mess = i18n("The calendar <b>%1</b> is displaying file <b>%2</b>").arg(name).arg(file); | ||
5172 | mess += i18n("<br>The calendar contains<br><b>%1 events<br>%2 todos<br>%3 journals</b>").arg( e ).arg( t ).arg( j ); | ||
5173 | KMessageBox::information( this, mess ); | ||
5174 | |||
5175 | |||
5176 | } | ||
diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h index 8670832..0924f07 100644 --- a/korganizer/calendarview.h +++ b/korganizer/calendarview.h | |||
@@ -108,192 +108,193 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser | |||
108 | public: | 108 | public: |
109 | /** | 109 | /** |
110 | Constructs a new calendar view widget. | 110 | Constructs a new calendar view widget. |
111 | 111 | ||
112 | @param calendar calendar document | 112 | @param calendar calendar document |
113 | @param parent parent window | 113 | @param parent parent window |
114 | @param name Qt internal widget object name | 114 | @param name Qt internal widget object name |
115 | */ | 115 | */ |
116 | CalendarView( CalendarResources *calendar, QWidget *parent = 0, | 116 | CalendarView( CalendarResources *calendar, QWidget *parent = 0, |
117 | const char *name = 0 ); | 117 | const char *name = 0 ); |
118 | CalendarView( Calendar *calendar, QWidget *parent = 0, | 118 | CalendarView( Calendar *calendar, QWidget *parent = 0, |
119 | const char *name = 0 ); | 119 | const char *name = 0 ); |
120 | virtual ~CalendarView(); | 120 | virtual ~CalendarView(); |
121 | 121 | ||
122 | Calendar *calendar() { return mCalendar; } | 122 | Calendar *calendar() { return mCalendar; } |
123 | 123 | ||
124 | KOViewManager *viewManager(); | 124 | KOViewManager *viewManager(); |
125 | KODialogManager *dialogManager(); | 125 | KODialogManager *dialogManager(); |
126 | 126 | ||
127 | QDate startDate(); | 127 | QDate startDate(); |
128 | QDate endDate(); | 128 | QDate endDate(); |
129 | 129 | ||
130 | QWidgetStack *viewStack(); | 130 | QWidgetStack *viewStack(); |
131 | QWidget *leftFrame(); | 131 | QWidget *leftFrame(); |
132 | 132 | ||
133 | DateNavigator *dateNavigator(); | 133 | DateNavigator *dateNavigator(); |
134 | KDateNavigator *dateNavigatorWidget(); | 134 | KDateNavigator *dateNavigatorWidget(); |
135 | 135 | ||
136 | void addView(KOrg::BaseView *); | 136 | void addView(KOrg::BaseView *); |
137 | void showView(KOrg::BaseView *); | 137 | void showView(KOrg::BaseView *); |
138 | KOEventViewerDialog* getEventViewerDialog(); | 138 | KOEventViewerDialog* getEventViewerDialog(); |
139 | Incidence *currentSelection(); | 139 | Incidence *currentSelection(); |
140 | void checkSuspendAlarm(); | 140 | void checkSuspendAlarm(); |
141 | void mergeFile( QString fn ); | 141 | void mergeFile( QString fn ); |
142 | 142 | ||
143 | signals: | 143 | signals: |
144 | void save (); | 144 | void save (); |
145 | void saveStopTimer (); | 145 | void saveStopTimer (); |
146 | void tempDisableBR(bool); | 146 | void tempDisableBR(bool); |
147 | /** This todo has been modified */ | 147 | /** This todo has been modified */ |
148 | void todoModified(Todo *, int); | 148 | void todoModified(Todo *, int); |
149 | 149 | ||
150 | /** when change is made to options dialog, the topwidget will catch this | 150 | /** when change is made to options dialog, the topwidget will catch this |
151 | * and emit this signal which notifies all widgets which have registered | 151 | * and emit this signal which notifies all widgets which have registered |
152 | * for notification to update their settings. */ | 152 | * for notification to update their settings. */ |
153 | void configChanged(); | 153 | void configChanged(); |
154 | /** emitted when the topwidget is closing down, so that any attached | 154 | /** emitted when the topwidget is closing down, so that any attached |
155 | child windows can also close. */ | 155 | child windows can also close. */ |
156 | void closingDown(); | 156 | void closingDown(); |
157 | /** emitted right before we die */ | 157 | /** emitted right before we die */ |
158 | void closed(QWidget *); | 158 | void closed(QWidget *); |
159 | 159 | ||
160 | /** Emitted when state of modified flag changes */ | 160 | /** Emitted when state of modified flag changes */ |
161 | void modifiedChanged(bool); | 161 | void modifiedChanged(bool); |
162 | void signalmodified(); | 162 | void signalmodified(); |
163 | 163 | ||
164 | /** Emitted when state of read-only flag changes */ | 164 | /** Emitted when state of read-only flag changes */ |
165 | void readOnlyChanged(bool); | 165 | void readOnlyChanged(bool); |
166 | 166 | ||
167 | /** Emitted when the unit of navigation changes */ | 167 | /** Emitted when the unit of navigation changes */ |
168 | void changeNavStringPrev(const QString &); | 168 | void changeNavStringPrev(const QString &); |
169 | void changeNavStringNext(const QString &); | 169 | void changeNavStringNext(const QString &); |
170 | 170 | ||
171 | /** Emitted when state of events selection has changed and user is organizer*/ | 171 | /** Emitted when state of events selection has changed and user is organizer*/ |
172 | void organizerEventsSelected(bool); | 172 | void organizerEventsSelected(bool); |
173 | /** Emitted when state of events selection has changed and user is attendee*/ | 173 | /** Emitted when state of events selection has changed and user is attendee*/ |
174 | void groupEventsSelected(bool); | 174 | void groupEventsSelected(bool); |
175 | /** | 175 | /** |
176 | Emitted when an incidence gets selected. If the selection is cleared the | 176 | Emitted when an incidence gets selected. If the selection is cleared the |
177 | signal is emitted with 0 as argument. | 177 | signal is emitted with 0 as argument. |
178 | */ | 178 | */ |
179 | void incidenceSelected( Incidence * ); | 179 | void incidenceSelected( Incidence * ); |
180 | /** Emitted, when a todoitem is selected or deselected. */ | 180 | /** Emitted, when a todoitem is selected or deselected. */ |
181 | void todoSelected( bool ); | 181 | void todoSelected( bool ); |
182 | 182 | ||
183 | /** | 183 | /** |
184 | Emitted, when clipboard content changes. Parameter indicates if paste | 184 | Emitted, when clipboard content changes. Parameter indicates if paste |
185 | is possible or not. | 185 | is possible or not. |
186 | */ | 186 | */ |
187 | void pasteEnabled(bool); | 187 | void pasteEnabled(bool); |
188 | 188 | ||
189 | /** Emitted, when the number of incoming messages has changed. */ | 189 | /** Emitted, when the number of incoming messages has changed. */ |
190 | void numIncomingChanged(int); | 190 | void numIncomingChanged(int); |
191 | 191 | ||
192 | /** Emitted, when the number of outgoing messages has changed. */ | 192 | /** Emitted, when the number of outgoing messages has changed. */ |
193 | void numOutgoingChanged(int); | 193 | void numOutgoingChanged(int); |
194 | 194 | ||
195 | /** Send status message, which can e.g. be displayed in the status bar. */ | 195 | /** Send status message, which can e.g. be displayed in the status bar. */ |
196 | void statusMessage(const QString &); | 196 | void statusMessage(const QString &); |
197 | 197 | ||
198 | void calendarViewExpanded( bool ); | 198 | void calendarViewExpanded( bool ); |
199 | void updateSearchDialog(); | 199 | void updateSearchDialog(); |
200 | void filtersUpdated(); | 200 | void filtersUpdated(); |
201 | 201 | ||
202 | 202 | ||
203 | public slots: | 203 | public slots: |
204 | void displayCalendarInfo( int id ); | ||
204 | void nextConflict( bool all, bool allday ); | 205 | void nextConflict( bool all, bool allday ); |
205 | void conflictAll(); | 206 | void conflictAll(); |
206 | void conflictAllday(); | 207 | void conflictAllday(); |
207 | void conflictNotAll(); | 208 | void conflictNotAll(); |
208 | void setCalReadOnly( int id, bool readO ); | 209 | void setCalReadOnly( int id, bool readO ); |
209 | void checkAlarms(); | 210 | void checkAlarms(); |
210 | void checkFiles(); | 211 | void checkFiles(); |
211 | void slotprintSelInc(); | 212 | void slotprintSelInc(); |
212 | void showNextAlarms(); | 213 | void showNextAlarms(); |
213 | void showOpenError(); | 214 | void showOpenError(); |
214 | void watchSavedFile(); | 215 | void watchSavedFile(); |
215 | void recheckTimerAlarm(); | 216 | void recheckTimerAlarm(); |
216 | void checkNextTimerAlarm(); | 217 | void checkNextTimerAlarm(); |
217 | void addAlarm(const QDateTime &qdt, const QString ¬i ); | 218 | void addAlarm(const QDateTime &qdt, const QString ¬i ); |
218 | void addSuspendAlarm(const QDateTime &qdt, const QString ¬i ); | 219 | void addSuspendAlarm(const QDateTime &qdt, const QString ¬i ); |
219 | void removeAlarm(const QDateTime &qdt, const QString ¬i ); | 220 | void removeAlarm(const QDateTime &qdt, const QString ¬i ); |
220 | 221 | ||
221 | /** options dialog made a changed to the configuration. we catch this | 222 | /** options dialog made a changed to the configuration. we catch this |
222 | * and notify all widgets which need to update their configuration. */ | 223 | * and notify all widgets which need to update their configuration. */ |
223 | void updateConfig(); | 224 | void updateConfig(); |
224 | 225 | ||
225 | void insertBirthdays(const QString& uid, const QStringList& birthdayList, | 226 | void insertBirthdays(const QString& uid, const QStringList& birthdayList, |
226 | const QStringList& anniversaryList, const QStringList& realNameList, | 227 | const QStringList& anniversaryList, const QStringList& realNameList, |
227 | const QStringList& emailList, const QStringList& assembledNameList, | 228 | const QStringList& emailList, const QStringList& assembledNameList, |
228 | const QStringList& uidList); | 229 | const QStringList& uidList); |
229 | 230 | ||
230 | /** | 231 | /** |
231 | Load calendar from file \a filename. If \a merge is true, load | 232 | Load calendar from file \a filename. If \a merge is true, load |
232 | calendar into existing one, if it is false, clear calendar, before | 233 | calendar into existing one, if it is false, clear calendar, before |
233 | loading. Return true, if calendar could be successfully loaded. | 234 | loading. Return true, if calendar could be successfully loaded. |
234 | */ | 235 | */ |
235 | bool openCalendar(QString filename, bool merge=false); | 236 | bool openCalendar(QString filename, bool merge=false); |
236 | bool loadCalendars(); | 237 | bool loadCalendars(); |
237 | bool saveCalendars(); | 238 | bool saveCalendars(); |
238 | bool restoreCalendarSettings(); | 239 | bool restoreCalendarSettings(); |
239 | bool addCalendar( KopiCalendarFile * ); | 240 | bool addCalendar( KopiCalendarFile * ); |
240 | void addCalendarId( int id ); | 241 | void addCalendarId( int id ); |
241 | bool syncCalendar(QString filename,int mode = 0 ); | 242 | bool syncCalendar(QString filename,int mode = 0 ); |
242 | 243 | ||
243 | /** | 244 | /** |
244 | Save calendar data to file. Return true if calendar could be | 245 | Save calendar data to file. Return true if calendar could be |
245 | successfully saved. | 246 | successfully saved. |
246 | */ | 247 | */ |
247 | bool saveCalendar(QString filename); | 248 | bool saveCalendar(QString filename); |
248 | 249 | ||
249 | /** | 250 | /** |
250 | Close calendar. Clear calendar data and reset views to display an empty | 251 | Close calendar. Clear calendar data and reset views to display an empty |
251 | calendar. | 252 | calendar. |
252 | */ | 253 | */ |
253 | void closeCalendar(); | 254 | void closeCalendar(); |
254 | 255 | ||
255 | /** Archive old events of calendar */ | 256 | /** Archive old events of calendar */ |
256 | void archiveCalendar(); | 257 | void archiveCalendar(); |
257 | 258 | ||
258 | void showIncidence(); | 259 | void showIncidence(); |
259 | void editIncidence(); | 260 | void editIncidence(); |
260 | void editIncidenceDescription(); | 261 | void editIncidenceDescription(); |
261 | void deleteIncidence(); | 262 | void deleteIncidence(); |
262 | void cloneIncidence(); | 263 | void cloneIncidence(); |
263 | void moveIncidence(); | 264 | void moveIncidence(); |
264 | void beamIncidence(); | 265 | void beamIncidence(); |
265 | void toggleCancelIncidence(); | 266 | void toggleCancelIncidence(); |
266 | 267 | ||
267 | /** create an editeventwin with supplied date/time, and if bool is true, | 268 | /** create an editeventwin with supplied date/time, and if bool is true, |
268 | * make the event take all day. */ | 269 | * make the event take all day. */ |
269 | void newEvent(QDateTime, QDateTime, bool allDay ); | 270 | void newEvent(QDateTime, QDateTime, bool allDay ); |
270 | void newEvent(QDateTime, QDateTime); | 271 | void newEvent(QDateTime, QDateTime); |
271 | void newEvent(QDateTime fh); | 272 | void newEvent(QDateTime fh); |
272 | void newEvent(QDate dt); | 273 | void newEvent(QDate dt); |
273 | /** create new event without having a date hint. Takes current date as | 274 | /** create new event without having a date hint. Takes current date as |
274 | default hint. */ | 275 | default hint. */ |
275 | void newEvent(); | 276 | void newEvent(); |
276 | void newFloatingEvent(); | 277 | void newFloatingEvent(); |
277 | 278 | ||
278 | /** Create a read-only viewer dialog for the supplied incidence. It calls the correct showXXX method*/ | 279 | /** Create a read-only viewer dialog for the supplied incidence. It calls the correct showXXX method*/ |
279 | void showIncidence(Incidence *); | 280 | void showIncidence(Incidence *); |
280 | void showIncidence(QString uid); | 281 | void showIncidence(QString uid); |
281 | /** Create an editor for the supplied incidence. It calls the correct editXXX method*/ | 282 | /** Create an editor for the supplied incidence. It calls the correct editXXX method*/ |
282 | void editIncidence(Incidence *); | 283 | void editIncidence(Incidence *); |
283 | /** Delete the supplied incidence. It calls the correct deleteXXX method*/ | 284 | /** Delete the supplied incidence. It calls the correct deleteXXX method*/ |
284 | void deleteIncidence(Incidence *); | 285 | void deleteIncidence(Incidence *); |
285 | void cloneIncidence(Incidence *); | 286 | void cloneIncidence(Incidence *); |
286 | void cancelIncidence(Incidence *); | 287 | void cancelIncidence(Incidence *); |
287 | /** Create an editor for the supplied event. */ | 288 | /** Create an editor for the supplied event. */ |
288 | void editEvent(Event *); | 289 | void editEvent(Event *); |
289 | /** Delete the supplied event. */ | 290 | /** Delete the supplied event. */ |
290 | void deleteEvent(Event *); | 291 | void deleteEvent(Event *); |
291 | /** Delete the event with the given unique ID. Returns false, if event wasn't | 292 | /** Delete the event with the given unique ID. Returns false, if event wasn't |
292 | found. */ | 293 | found. */ |
293 | bool deleteEvent(const QString &uid); | 294 | bool deleteEvent(const QString &uid); |
294 | /** Create a read-only viewer dialog for the supplied event. */ | 295 | /** Create a read-only viewer dialog for the supplied event. */ |
295 | void showEvent(Event *); | 296 | void showEvent(Event *); |
296 | 297 | ||
297 | void editJournal(Journal *); | 298 | void editJournal(Journal *); |
298 | void showJournal(Journal *); | 299 | void showJournal(Journal *); |
299 | void deleteJournal(Journal *); | 300 | void deleteJournal(Journal *); |
diff --git a/korganizer/kofilterview.cpp b/korganizer/kofilterview.cpp index ef25fd0..ee9c9f6 100644 --- a/korganizer/kofilterview.cpp +++ b/korganizer/kofilterview.cpp | |||
@@ -137,194 +137,196 @@ void KOCalEditView::selectCal(int id ,bool b) | |||
137 | } | 137 | } |
138 | void KOCalEditView::selectStdCal( int id ) | 138 | void KOCalEditView::selectStdCal( int id ) |
139 | { | 139 | { |
140 | KOCalRadioButton* it = mStdandardB.first(); | 140 | KOCalRadioButton* it = mStdandardB.first(); |
141 | while ( it ) { | 141 | while ( it ) { |
142 | it->blockSignals( true ); | 142 | it->blockSignals( true ); |
143 | it->setChecked( it->num() == id ); | 143 | it->setChecked( it->num() == id ); |
144 | it->blockSignals( false ); | 144 | it->blockSignals( false ); |
145 | it = mStdandardB.next(); | 145 | it = mStdandardB.next(); |
146 | } | 146 | } |
147 | KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first(); | 147 | KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first(); |
148 | while ( kkf ) { | 148 | while ( kkf ) { |
149 | kkf->isStandard = (kkf->mCalNumber == id ); | 149 | kkf->isStandard = (kkf->mCalNumber == id ); |
150 | kkf = KOPrefs::instance()->mCalendars.next(); | 150 | kkf = KOPrefs::instance()->mCalendars.next(); |
151 | } | 151 | } |
152 | emit setCalendarDefault ( id ); | 152 | emit setCalendarDefault ( id ); |
153 | } | 153 | } |
154 | 154 | ||
155 | void KOCalEditView::selectCalAlarm(int id ,bool b ) | 155 | void KOCalEditView::selectCalAlarm(int id ,bool b ) |
156 | { | 156 | { |
157 | KOPrefs::instance()->getCalendar( id )->isAlarmEnabled = b; | 157 | KOPrefs::instance()->getCalendar( id )->isAlarmEnabled = b; |
158 | emit alarmEnabled ( id , b ); | 158 | emit alarmEnabled ( id , b ); |
159 | emit needsUpdate(); | 159 | emit needsUpdate(); |
160 | } | 160 | } |
161 | void KOCalEditView::selectReadOnly(int id ,bool b ) | 161 | void KOCalEditView::selectReadOnly(int id ,bool b ) |
162 | { | 162 | { |
163 | 163 | ||
164 | emit calendarReadonly ( id , b ); | 164 | emit calendarReadonly ( id , b ); |
165 | KOPrefs::instance()->getCalendar( id )->isReadOnly = b; | 165 | KOPrefs::instance()->getCalendar( id )->isReadOnly = b; |
166 | if ( KOPrefs::instance()->getCalendar( id )->isStandard && b ) { | 166 | if ( KOPrefs::instance()->getCalendar( id )->isStandard && b ) { |
167 | findNewStandard(); | 167 | findNewStandard(); |
168 | } | 168 | } |
169 | if ( !b ){ | 169 | if ( !b ){ |
170 | KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first(); | 170 | KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first(); |
171 | while ( kkf ) { | 171 | while ( kkf ) { |
172 | if (kkf->isReadOnly && kkf->isStandard ) { | 172 | if (kkf->isReadOnly && kkf->isStandard ) { |
173 | selectStdCal( id ); | 173 | selectStdCal( id ); |
174 | break; | 174 | break; |
175 | } | 175 | } |
176 | kkf = KOPrefs::instance()->mCalendars.next(); | 176 | kkf = KOPrefs::instance()->mCalendars.next(); |
177 | } | 177 | } |
178 | } | 178 | } |
179 | 179 | ||
180 | mStdandardB.at(id-1)->setEnabled( !b ); | 180 | mStdandardB.at(id-1)->setEnabled( !b ); |
181 | emit needsUpdate(); | 181 | emit needsUpdate(); |
182 | 182 | ||
183 | } | 183 | } |
184 | void KOCalEditView::findNewStandard() | 184 | void KOCalEditView::findNewStandard() |
185 | { | 185 | { |
186 | bool found = false; | 186 | bool found = false; |
187 | KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first(); | 187 | KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first(); |
188 | while ( kkf ) { | 188 | while ( kkf ) { |
189 | if (!kkf->isReadOnly && !kkf->mErrorOnLoad ) { | 189 | if (!kkf->isReadOnly && !kkf->mErrorOnLoad ) { |
190 | found = true; | 190 | found = true; |
191 | selectStdCal( kkf->mCalNumber ); | 191 | selectStdCal( kkf->mCalNumber ); |
192 | break; | 192 | break; |
193 | } | 193 | } |
194 | kkf = KOPrefs::instance()->mCalendars.next(); | 194 | kkf = KOPrefs::instance()->mCalendars.next(); |
195 | } | 195 | } |
196 | if ( !found ) { | 196 | if ( !found ) { |
197 | KMessageBox::error( this,i18n("\nNO\n WRITEABLE\n CALENDAR\n FOUND!\n\nPlease fix your calendar settings!\n"), | 197 | KMessageBox::error( this,i18n("\nNO\n WRITEABLE\n CALENDAR\n FOUND!\n\nPlease fix your calendar settings!\n"), |
198 | i18n("Houston, we have a problem!") ); | 198 | i18n("Houston, we have a problem!") ); |
199 | 199 | ||
200 | } | 200 | } |
201 | } | 201 | } |
202 | 202 | ||
203 | void KOCalEditView::setColor( const QColor& c, int id ) | 203 | void KOCalEditView::setColor( const QColor& c, int id ) |
204 | { | 204 | { |
205 | KOPrefs::instance()->getCalendar( id )->mDefaultColor = c; | 205 | KOPrefs::instance()->getCalendar( id )->mDefaultColor = c; |
206 | emit needsUpdate(); | 206 | emit needsUpdate(); |
207 | } | 207 | } |
208 | void KOCalEditView::deleteCal( int id ) | 208 | void KOCalEditView::deleteCal( int id ) |
209 | { | 209 | { |
210 | KopiCalendarFile * kkf = KOPrefs::instance()->getCalendar( id ); | 210 | KopiCalendarFile * kkf = KOPrefs::instance()->getCalendar( id ); |
211 | QString name = kkf->mName; | 211 | QString name = kkf->mName; |
212 | QString file = KGlobal::formatMessage ( kkf->mFileName ,0 ); | 212 | QString file = KGlobal::formatMessage ( kkf->mFileName ,0 ); |
213 | if ( KMessageBox::warningContinueCancel( this, i18n("The calendar <b>%1</b> is displaying file <b>%2</b>. Do you want to remove this calendar from KO/Pi? (The file is not removed!)").arg(name).arg(file) ) != KMessageBox::Continue ) return; | 213 | if ( KMessageBox::warningContinueCancel( this, i18n("The calendar <b>%1</b> is displaying file <b>%2</b>. Do you want to remove this calendar from KO/Pi? (The file is not removed!)").arg(name).arg(file) ) != KMessageBox::Continue ) return; |
214 | bool findnewstd = kkf->isStandard; | 214 | bool findnewstd = kkf->isStandard; |
215 | emit removeCalendar ( id ); | 215 | emit removeCalendar ( id ); |
216 | KOPrefs::instance()->mCalendars.remove ( kkf ); | 216 | KOPrefs::instance()->mCalendars.remove ( kkf ); |
217 | if ( findnewstd ) findNewStandard(); | 217 | if ( findnewstd ) findNewStandard(); |
218 | emit needsUpdate(); | 218 | emit needsUpdate(); |
219 | QTimer::singleShot( 0, this, SLOT ( readConfig() ) ); | 219 | QTimer::singleShot( 0, this, SLOT ( readConfig() ) ); |
220 | } | 220 | } |
221 | void KOCalEditView::infoCal( int id ) | 221 | void KOCalEditView::infoCal( int id ) |
222 | { | 222 | { |
223 | QString name = KOPrefs::instance()->getCalendar( id )->mName; | 223 | QString name = KOPrefs::instance()->getCalendar( id )->mName; |
224 | QString file = KGlobal::formatMessage ( KOPrefs::instance()->getCalendar( id )->mFileName, 0 ); | 224 | QString file = KGlobal::formatMessage ( KOPrefs::instance()->getCalendar( id )->mFileName, 0 ); |
225 | if ( KOPrefs::instance()->getCalendar( id )->mErrorOnLoad ) { | 225 | if ( KOPrefs::instance()->getCalendar( id )->mErrorOnLoad ) { |
226 | if ( KMessageBox::Yes == KMessageBox::questionYesNo( this, i18n("The calendar <b>%1</b> is not loaded! Loading of file <b>%2</b> failed! <b>Try again to load the calendar?</b>").arg(name).arg(file) ) ) { | 226 | if ( KMessageBox::Yes == KMessageBox::questionYesNo( this, i18n("The calendar <b>%1</b> is not loaded! Loading of file <b>%2</b> failed! <b>Try again to load the calendar?</b>").arg(name).arg(file) ) ) { |
227 | emit calendarAdded( id ); | 227 | emit calendarAdded( id ); |
228 | emit needsUpdate(); | 228 | emit needsUpdate(); |
229 | QTimer::singleShot( 0, this, SLOT ( readConfig() ) ); | 229 | QTimer::singleShot( 0, this, SLOT ( readConfig() ) ); |
230 | QTimer::singleShot( 100, this, SIGNAL ( checkCalendar() ) ); | 230 | QTimer::singleShot( 100, this, SIGNAL ( checkCalendar() ) ); |
231 | } | 231 | } |
232 | } | 232 | } |
233 | else | 233 | else { |
234 | KMessageBox::information( this, i18n("The calendar <b>%1</b> is displaying file <b>%2</b>").arg(name).arg(file) ); | 234 | emit requestCalendarInfo( id ); |
235 | |||
236 | } | ||
235 | } | 237 | } |
236 | void KOCalEditView::readConfig() | 238 | void KOCalEditView::readConfig() |
237 | { | 239 | { |
238 | 240 | ||
239 | mStdandardB.clear(); | 241 | mStdandardB.clear(); |
240 | mEnabledB.clear(); | 242 | mEnabledB.clear(); |
241 | mAlarmB.clear(); | 243 | mAlarmB.clear(); |
242 | mROB.clear(); | 244 | mROB.clear(); |
243 | 245 | ||
244 | if ( mw ) delete mw; | 246 | if ( mw ) delete mw; |
245 | mw = new QWidget ( viewport() ); | 247 | mw = new QWidget ( viewport() ); |
246 | addChild(mw); | 248 | addChild(mw); |
247 | int ii = 0; | 249 | int ii = 0; |
248 | mainLayout = new QGridLayout ( mw , 2, 8 ); | 250 | mainLayout = new QGridLayout ( mw , 2, 8 ); |
249 | mainLayout->setMargin( 2 ); | 251 | mainLayout->setMargin( 2 ); |
250 | mainLayout->setSpacing( 2 ); | 252 | mainLayout->setSpacing( 2 ); |
251 | QPushButton * addButT = new QPushButton ( mw ); | 253 | QPushButton * addButT = new QPushButton ( mw ); |
252 | addButT->setFocusPolicy(NoFocus); | 254 | addButT->setFocusPolicy(NoFocus); |
253 | mainLayout->addWidget( addButT,0,0 ); | 255 | mainLayout->addWidget( addButT,0,0 ); |
254 | addButT->setText( "D"); | 256 | addButT->setText( "D"); |
255 | connect(addButT,SIGNAL(clicked()),SLOT(defaultInfo())); | 257 | connect(addButT,SIGNAL(clicked()),SLOT(defaultInfo())); |
256 | QWhatsThis::add( addButT, i18n("Please choose the <b>default calendar</b> in this column. Newly created or imported items are added to the default calendar.") ); | 258 | QWhatsThis::add( addButT, i18n("Please choose the <b>default calendar</b> in this column. Newly created or imported items are added to the default calendar.") ); |
257 | //addBut->setPixmap ( SmallIcon("greenhook16")); | 259 | //addBut->setPixmap ( SmallIcon("greenhook16")); |
258 | QPushButton *addBut = new QPushButton ( mw ); | 260 | QPushButton *addBut = new QPushButton ( mw ); |
259 | addBut->setFocusPolicy(NoFocus); | 261 | addBut->setFocusPolicy(NoFocus); |
260 | mainLayout->addWidget( addBut,0,++ii ); | 262 | mainLayout->addWidget( addBut,0,++ii ); |
261 | addBut->setPixmap ( SmallIcon("eye")); | 263 | addBut->setPixmap ( SmallIcon("eye")); |
262 | QWhatsThis::add( addBut, i18n("In this column you can <b>set a calendar to be visible</b>. If a calendar is not visible its entries are not displayed in the views. You can add items to it and it is loaded/saved as usual.") ); | 264 | QWhatsThis::add( addBut, i18n("In this column you can <b>set a calendar to be visible</b>. If a calendar is not visible its entries are not displayed in the views. You can add items to it and it is loaded/saved as usual.") ); |
263 | connect(addBut,SIGNAL(clicked()),SLOT(enableAll())); | 265 | connect(addBut,SIGNAL(clicked()),SLOT(enableAll())); |
264 | int max = addBut->sizeHint().height(); | 266 | int max = addBut->sizeHint().height(); |
265 | addBut->setMaximumWidth( max ); | 267 | addBut->setMaximumWidth( max ); |
266 | addButT->setFixedSize( QSize( max, max ) ); | 268 | addButT->setFixedSize( QSize( max, max ) ); |
267 | QLabel* lab = new QLabel (i18n(" Calendar \n Resource "), mw ); | 269 | QLabel* lab = new QLabel (i18n(" Calendar \n Resource "), mw ); |
268 | mainLayout->addWidget( lab,0,++ii ); | 270 | mainLayout->addWidget( lab,0,++ii ); |
269 | QWhatsThis::add( lab, i18n("In this column you can see the <b>name of the calendar</b>. If you click on the name button you will get an information box about the loaded calendar file. If the file was not loaded at startup you can try to load it here again.") ); | 271 | QWhatsThis::add( lab, i18n("In this column you can see the <b>name of the calendar</b>. If you click on the name button you will get an information box about the loaded calendar file. If the file was not loaded at startup you can try to load it here again.") ); |
270 | //lab = new QLabel ( i18n(" "), mw ); | 272 | //lab = new QLabel ( i18n(" "), mw ); |
271 | //mainLayout->addWidget( lab,0,++ii ); | 273 | //mainLayout->addWidget( lab,0,++ii ); |
272 | //lab->setFixedWidth( 1 ); | 274 | //lab->setFixedWidth( 1 ); |
273 | addBut = new QPushButton ( mw ); | 275 | addBut = new QPushButton ( mw ); |
274 | addBut->setFocusPolicy(NoFocus); | 276 | addBut->setFocusPolicy(NoFocus); |
275 | mainLayout->addWidget( addBut,0,++ii ); | 277 | mainLayout->addWidget( addBut,0,++ii ); |
276 | addBut->setPixmap ( SmallIcon("bell")); | 278 | addBut->setPixmap ( SmallIcon("bell")); |
277 | QWhatsThis::add( addBut, i18n("In this column you can <b>disable the alarms of a calendar all together</b>. The alarm data in the calendar itself is not changed, the alarms are marked internally as \"do not use\". Useful if you load a calendar of another person but do not want to get notified about alarms of that person.") ); | 279 | QWhatsThis::add( addBut, i18n("In this column you can <b>disable the alarms of a calendar all together</b>. The alarm data in the calendar itself is not changed, the alarms are marked internally as \"do not use\". Useful if you load a calendar of another person but do not want to get notified about alarms of that person.") ); |
278 | connect(addBut,SIGNAL(clicked()),SLOT(enableAlarm())); | 280 | connect(addBut,SIGNAL(clicked()),SLOT(enableAlarm())); |
279 | addBut->setMaximumWidth( addBut->sizeHint().height() ); | 281 | addBut->setMaximumWidth( addBut->sizeHint().height() ); |
280 | 282 | ||
281 | addBut = new QPushButton ( mw ); | 283 | addBut = new QPushButton ( mw ); |
282 | addBut->setFocusPolicy(NoFocus); | 284 | addBut->setFocusPolicy(NoFocus); |
283 | mainLayout->addWidget( addBut,0,++ii ); | 285 | mainLayout->addWidget( addBut,0,++ii ); |
284 | addBut->setPixmap ( SmallIcon("pencil")); | 286 | addBut->setPixmap ( SmallIcon("pencil")); |
285 | QWhatsThis::add( addBut, i18n("In this column you can <b>set a calendar and all entries of the calendar to read only</b>. If a calendar is readonly the entries cannot be edited and no items can be added to the calendar. If you change a setting of a calendar to readonly in this column all data will be saved because the data of a readonly calendar is not saved later.") ); | 287 | QWhatsThis::add( addBut, i18n("In this column you can <b>set a calendar and all entries of the calendar to read only</b>. If a calendar is readonly the entries cannot be edited and no items can be added to the calendar. If you change a setting of a calendar to readonly in this column all data will be saved because the data of a readonly calendar is not saved later.") ); |
286 | connect(addBut,SIGNAL(clicked()),SLOT(disableRO())); | 288 | connect(addBut,SIGNAL(clicked()),SLOT(disableRO())); |
287 | addBut->setMaximumWidth( addBut->sizeHint().height() ); | 289 | addBut->setMaximumWidth( addBut->sizeHint().height() ); |
288 | lab = new QLabel ( "", mw ); | 290 | lab = new QLabel ( "", mw ); |
289 | mainLayout->addWidget( lab,0,++ii ); | 291 | mainLayout->addWidget( lab,0,++ii ); |
290 | 292 | ||
291 | addBut = new QPushButton ( mw ); | 293 | addBut = new QPushButton ( mw ); |
292 | addBut->setFocusPolicy(NoFocus); | 294 | addBut->setFocusPolicy(NoFocus); |
293 | mainLayout->addWidget( addBut,0,++ii ); | 295 | mainLayout->addWidget( addBut,0,++ii ); |
294 | addBut->setPixmap ( SmallIcon("plus")); | 296 | addBut->setPixmap ( SmallIcon("plus")); |
295 | connect(addBut,SIGNAL(clicked()),SLOT(addCal())); | 297 | connect(addBut,SIGNAL(clicked()),SLOT(addCal())); |
296 | QWhatsThis::add( addBut, i18n("Click this button to <b>add a calendar</b>. You can add an existing calendar file or you can add a new calendar and KO/Pi creates a new empty calendar file for you.") ); | 298 | QWhatsThis::add( addBut, i18n("Click this button to <b>add a calendar</b>. You can add an existing calendar file or you can add a new calendar and KO/Pi creates a new empty calendar file for you.") ); |
297 | lab = new QLabel ( " ", mw ); | 299 | lab = new QLabel ( " ", mw ); |
298 | mainLayout->addWidget( lab,0,++ii ); | 300 | mainLayout->addWidget( lab,0,++ii ); |
299 | 301 | ||
300 | 302 | ||
301 | KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first(); | 303 | KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first(); |
302 | int row = 1; | 304 | int row = 1; |
303 | bool errorLoadStandard = false; | 305 | bool errorLoadStandard = false; |
304 | while ( kkf ) { | 306 | while ( kkf ) { |
305 | int iii = 0; | 307 | int iii = 0; |
306 | KOCalRadioButton* rb = new KOCalRadioButton( mw ); | 308 | KOCalRadioButton* rb = new KOCalRadioButton( mw ); |
307 | mainLayout->addWidget( rb,row,0 );mStdandardB.append( rb ); | 309 | mainLayout->addWidget( rb,row,0 );mStdandardB.append( rb ); |
308 | rb->setChecked( kkf->isStandard ); | 310 | rb->setChecked( kkf->isStandard ); |
309 | if ( kkf->isStandard && ( kkf->mErrorOnLoad || kkf->isReadOnly ) ) | 311 | if ( kkf->isStandard && ( kkf->mErrorOnLoad || kkf->isReadOnly ) ) |
310 | errorLoadStandard = true; | 312 | errorLoadStandard = true; |
311 | rb->setNum( kkf->mCalNumber ); | 313 | rb->setNum( kkf->mCalNumber ); |
312 | connect (rb, SIGNAL (selectNum(int)), SLOT ( selectStdCal(int) ) ); | 314 | connect (rb, SIGNAL (selectNum(int)), SLOT ( selectStdCal(int) ) ); |
313 | if ( kkf->mErrorOnLoad || kkf->isReadOnly ) | 315 | if ( kkf->mErrorOnLoad || kkf->isReadOnly ) |
314 | rb->setEnabled( false ); | 316 | rb->setEnabled( false ); |
315 | KOCalCheckButton* cb = new KOCalCheckButton( mw ); | 317 | KOCalCheckButton* cb = new KOCalCheckButton( mw ); |
316 | mainLayout->addWidget( cb,row,++iii );mEnabledB.append( cb ); | 318 | mainLayout->addWidget( cb,row,++iii );mEnabledB.append( cb ); |
317 | cb->setChecked( kkf->isEnabled && !kkf->mErrorOnLoad ); | 319 | cb->setChecked( kkf->isEnabled && !kkf->mErrorOnLoad ); |
318 | cb->setNum( kkf->mCalNumber ); | 320 | cb->setNum( kkf->mCalNumber ); |
319 | if ( kkf->mErrorOnLoad ) | 321 | if ( kkf->mErrorOnLoad ) |
320 | cb->setEnabled( false ); | 322 | cb->setEnabled( false ); |
321 | connect (cb, SIGNAL (selectNum(int,bool)), SLOT ( selectCal(int,bool) ) ); | 323 | connect (cb, SIGNAL (selectNum(int,bool)), SLOT ( selectCal(int,bool) ) ); |
322 | KOCalButton* name = new KOCalButton( mw ); | 324 | KOCalButton* name = new KOCalButton( mw ); |
323 | name->setNum( kkf->mCalNumber ); | 325 | name->setNum( kkf->mCalNumber ); |
324 | name->setText( kkf->mName ); | 326 | name->setText( kkf->mName ); |
325 | mainLayout->addWidget( name,row,++iii ); | 327 | mainLayout->addWidget( name,row,++iii ); |
326 | connect (name, SIGNAL (selectNum(int)), SLOT ( infoCal(int) ) ); | 328 | connect (name, SIGNAL (selectNum(int)), SLOT ( infoCal(int) ) ); |
327 | //lab = new QLabel (" ", mw ); | 329 | //lab = new QLabel (" ", mw ); |
328 | //mainLayout->addWidget( lab,row,++iii ); | 330 | //mainLayout->addWidget( lab,row,++iii ); |
329 | cb = new KOCalCheckButton( mw ); | 331 | cb = new KOCalCheckButton( mw ); |
330 | mainLayout->addWidget( cb,row,++iii );mAlarmB.append( cb ); | 332 | mainLayout->addWidget( cb,row,++iii );mAlarmB.append( cb ); |
diff --git a/korganizer/kofilterview.h b/korganizer/kofilterview.h index d534dbf..0dd423a 100644 --- a/korganizer/kofilterview.h +++ b/korganizer/kofilterview.h | |||
@@ -147,110 +147,111 @@ private: | |||
147 | void keyPressEvent ( QKeyEvent * e ) | 147 | void keyPressEvent ( QKeyEvent * e ) |
148 | { | 148 | { |
149 | e->ignore(); | 149 | e->ignore(); |
150 | } | 150 | } |
151 | 151 | ||
152 | private slots : | 152 | private slots : |
153 | void bottonClicked( bool b) { if ( mNumber > 0 ) emit selectNum ( mNumber , b); } | 153 | void bottonClicked( bool b) { if ( mNumber > 0 ) emit selectNum ( mNumber , b); } |
154 | }; | 154 | }; |
155 | 155 | ||
156 | class KOCalRadioButton : public QRadioButton | 156 | class KOCalRadioButton : public QRadioButton |
157 | { | 157 | { |
158 | Q_OBJECT | 158 | Q_OBJECT |
159 | public: | 159 | public: |
160 | KOCalRadioButton( QWidget *parent=0, const char *name=0 ) : | 160 | KOCalRadioButton( QWidget *parent=0, const char *name=0 ) : |
161 | QRadioButton( parent, name) | 161 | QRadioButton( parent, name) |
162 | { | 162 | { |
163 | connect( this, SIGNAL( toggled ( bool ) ), | 163 | connect( this, SIGNAL( toggled ( bool ) ), |
164 | SLOT( bottonClicked( bool ) )); | 164 | SLOT( bottonClicked( bool ) )); |
165 | mNumber = -1; | 165 | mNumber = -1; |
166 | setFocusPolicy(NoFocus); | 166 | setFocusPolicy(NoFocus); |
167 | //setMaximumWidth( 10 ); | 167 | //setMaximumWidth( 10 ); |
168 | 168 | ||
169 | } | 169 | } |
170 | int num() { return mNumber;} | 170 | int num() { return mNumber;} |
171 | void setNum ( int num ) {mNumber = num; } | 171 | void setNum ( int num ) {mNumber = num; } |
172 | signals: | 172 | signals: |
173 | void selectNum ( int ); | 173 | void selectNum ( int ); |
174 | private: | 174 | private: |
175 | int mNumber; | 175 | int mNumber; |
176 | void keyPressEvent ( QKeyEvent * e ) | 176 | void keyPressEvent ( QKeyEvent * e ) |
177 | { | 177 | { |
178 | e->ignore(); | 178 | e->ignore(); |
179 | } | 179 | } |
180 | 180 | ||
181 | private slots : | 181 | private slots : |
182 | void bottonClicked( bool b) { if ( mNumber > 0 ) emit selectNum ( mNumber); } | 182 | void bottonClicked( bool b) { if ( mNumber > 0 ) emit selectNum ( mNumber); } |
183 | }; | 183 | }; |
184 | 184 | ||
185 | 185 | ||
186 | 186 | ||
187 | class KOFilterView : public KOFilterView_base | 187 | class KOFilterView : public KOFilterView_base |
188 | { | 188 | { |
189 | Q_OBJECT | 189 | Q_OBJECT |
190 | public: | 190 | public: |
191 | KOFilterView(QPtrList<CalFilter> *filterList,QWidget* parent=0,const char* name=0, WFlags fl=0); | 191 | KOFilterView(QPtrList<CalFilter> *filterList,QWidget* parent=0,const char* name=0, WFlags fl=0); |
192 | ~KOFilterView(); | 192 | ~KOFilterView(); |
193 | 193 | ||
194 | void updateFilters(); | 194 | void updateFilters(); |
195 | 195 | ||
196 | bool filtersEnabled(); | 196 | bool filtersEnabled(); |
197 | void setFiltersEnabled(bool); | 197 | void setFiltersEnabled(bool); |
198 | CalFilter *selectedFilter(); | 198 | CalFilter *selectedFilter(); |
199 | void setSelectedFilter(QString); | 199 | void setSelectedFilter(QString); |
200 | void setSelectedFilter( int ); | 200 | void setSelectedFilter( int ); |
201 | 201 | ||
202 | signals: | 202 | signals: |
203 | void filterChanged(); | 203 | void filterChanged(); |
204 | void editFilters(); | 204 | void editFilters(); |
205 | 205 | ||
206 | private: | 206 | private: |
207 | QPtrList<CalFilter> *mFilters; | 207 | QPtrList<CalFilter> *mFilters; |
208 | }; | 208 | }; |
209 | 209 | ||
210 | class KOCalEditView : public QScrollView | 210 | class KOCalEditView : public QScrollView |
211 | { | 211 | { |
212 | Q_OBJECT | 212 | Q_OBJECT |
213 | public: | 213 | public: |
214 | KOCalEditView( QWidget* parent=0,const char* name=0); | 214 | KOCalEditView( QWidget* parent=0,const char* name=0); |
215 | ~KOCalEditView(); | 215 | ~KOCalEditView(); |
216 | int addCalendar( QString calName, QString fileName, bool ask = true ); | 216 | int addCalendar( QString calName, QString fileName, bool ask = true ); |
217 | int getBirtdayID(); | 217 | int getBirtdayID(); |
218 | public slots: | 218 | public slots: |
219 | void addCal(); | 219 | void addCal(); |
220 | void enableAll(); | 220 | void enableAll(); |
221 | void enableAlarm(); | 221 | void enableAlarm(); |
222 | void disableRO(); | 222 | void disableRO(); |
223 | void deleteAll(); | 223 | void deleteAll(); |
224 | void selectStdCal(int); | 224 | void selectStdCal(int); |
225 | void selectCal(int,bool ); | 225 | void selectCal(int,bool ); |
226 | void selectCalAlarm(int,bool ); | 226 | void selectCalAlarm(int,bool ); |
227 | void selectReadOnly(int,bool ); | 227 | void selectReadOnly(int,bool ); |
228 | void setColor(const QColor &,int) ; | 228 | void setColor(const QColor &,int) ; |
229 | void deleteCal(int) ; | 229 | void deleteCal(int) ; |
230 | void infoCal(int) ; | 230 | void infoCal(int) ; |
231 | void readConfig(); | 231 | void readConfig(); |
232 | void defaultInfo(); | 232 | void defaultInfo(); |
233 | void findNewStandard(); | 233 | void findNewStandard(); |
234 | signals: | 234 | signals: |
235 | void alarmEnabled ( int cal, bool enable ); | 235 | void alarmEnabled ( int cal, bool enable ); |
236 | void calendarEnabled ( int cal, bool enable ); | 236 | void calendarEnabled ( int cal, bool enable ); |
237 | void calendarReadonly ( int cal, bool readonly ); | 237 | void calendarReadonly ( int cal, bool readonly ); |
238 | void setCalendarDefault ( int cal ); | 238 | void setCalendarDefault ( int cal ); |
239 | void removeCalendar ( int cal ); | 239 | void removeCalendar ( int cal ); |
240 | void calendarAdded( int ); | 240 | void calendarAdded( int ); |
241 | void needsUpdate(); | 241 | void needsUpdate(); |
242 | void checkCalendar(); | 242 | void checkCalendar(); |
243 | void requestCalendarInfo( int id ); | ||
243 | 244 | ||
244 | private: | 245 | private: |
245 | QWidget *mw; | 246 | QWidget *mw; |
246 | void toggleList ( QPtrList<KOCalCheckButton> , bool b = true ); | 247 | void toggleList ( QPtrList<KOCalCheckButton> , bool b = true ); |
247 | QPtrList<KOCalRadioButton> mStdandardB; | 248 | QPtrList<KOCalRadioButton> mStdandardB; |
248 | QPtrList<KOCalCheckButton> mEnabledB; | 249 | QPtrList<KOCalCheckButton> mEnabledB; |
249 | QPtrList<KOCalCheckButton> mAlarmB; | 250 | QPtrList<KOCalCheckButton> mAlarmB; |
250 | QPtrList<KOCalCheckButton> mROB; | 251 | QPtrList<KOCalCheckButton> mROB; |
251 | QGridLayout* mainLayout; | 252 | QGridLayout* mainLayout; |
252 | }; | 253 | }; |
253 | 254 | ||
254 | 255 | ||
255 | 256 | ||
256 | #endif // KOFILTERVIEW_H | 257 | #endif // KOFILTERVIEW_H |