summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-07-10 10:17:55 (UTC)
committer zautrix <zautrix>2005-07-10 10:17:55 (UTC)
commit58b7818a74809dc9280a3249eeb7e0195a66f93d (patch) (unidiff)
tree04b04b867647a8c48d59e7a0fa89df6430039599
parente8b6635ef7c98996f0415e6a77394569493ab151 (diff)
downloadkdepimpi-58b7818a74809dc9280a3249eeb7e0195a66f93d.zip
kdepimpi-58b7818a74809dc9280a3249eeb7e0195a66f93d.tar.gz
kdepimpi-58b7818a74809dc9280a3249eeb7e0195a66f93d.tar.bz2
fixx
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp7
-rw-r--r--korganizer/calendarview.h3
-rw-r--r--korganizer/koagenda.cpp5
-rw-r--r--korganizer/mainwindow.cpp12
-rw-r--r--korganizer/mainwindow.h5
-rw-r--r--microkde/kdeui/kbuttonbox.cpp2
-rw-r--r--microkde/kdeui/kpopupmenu.cpp19
-rw-r--r--microkde/kdeui/kpopupmenu.h22
-rw-r--r--microkde/microkde.pro2
-rw-r--r--microkde/microkdeE.pro2
10 files changed, 64 insertions, 15 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 5a2482e..17f1659 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -466,384 +466,391 @@ void CalendarView::init()
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 480
481 mTodoList->setNavigator( mNavigator ); 481 mTodoList->setNavigator( mNavigator );
482#if 0 482#if 0
483 if ( QApplication::desktop()->width() < 480 ) { 483 if ( QApplication::desktop()->width() < 480 ) {
484 leftFrameLayout->addWidget(mFilterView); 484 leftFrameLayout->addWidget(mFilterView);
485 leftFrameLayout->addWidget(mTodoList, 2 ); 485 leftFrameLayout->addWidget(mTodoList, 2 );
486 486
487 } else { 487 } else {
488 leftFrameLayout->addWidget(mTodoList,2 ); 488 leftFrameLayout->addWidget(mTodoList,2 );
489 leftFrameLayout->addWidget(mFilterView ); 489 leftFrameLayout->addWidget(mFilterView );
490 } 490 }
491#endif 491#endif
492 mFilterView->hide(); 492 mFilterView->hide();
493 mCalEditView->hide(); 493 mCalEditView->hide();
494 QWidget *rightBox = new QWidget( mMainFrame ); 494 QWidget *rightBox = new QWidget( mMainFrame );
495 //mainBoxLayout->addWidget ( rightBox, 10 ); 495 //mainBoxLayout->addWidget ( rightBox, 10 );
496 QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); 496 QBoxLayout *rightLayout = new QVBoxLayout( rightBox );
497 mRightFrame = new QWidgetStack( rightBox ); 497 mRightFrame = new QWidgetStack( rightBox );
498 rightLayout->addWidget( mRightFrame, 10 ); 498 rightLayout->addWidget( mRightFrame, 10 );
499 499
500 //mLeftFrame = (QWidget *)leftFrame; 500 //mLeftFrame = (QWidget *)leftFrame;
501 if ( KOPrefs::instance()->mVerticalScreen ) { 501 if ( KOPrefs::instance()->mVerticalScreen ) {
502 //mDateNavigator->setFixedHeight( mDateNavigator->sizeHint().height() ); 502 //mDateNavigator->setFixedHeight( mDateNavigator->sizeHint().height() );
503 //mDateNavigator->setMinimumWidth( mDateNavigator->sizeHint().width() ); 503 //mDateNavigator->setMinimumWidth( mDateNavigator->sizeHint().width() );
504 //mTodoList->setFixedHeight( mDateNavigator->sizeHint().height() ); 504 //mTodoList->setFixedHeight( mDateNavigator->sizeHint().height() );
505 //leftFrame->setFixedHeight( mDateNavigator->sizeHint().height() ); 505 //leftFrame->setFixedHeight( mDateNavigator->sizeHint().height() );
506 } else { 506 } else {
507 //mDateNavigator->setFixedWidth( mDateNavigator->sizeHint().width() ); 507 //mDateNavigator->setFixedWidth( mDateNavigator->sizeHint().width() );
508 //mTodoList->setFixedWidth( mDateNavigator->sizeHint().width() ); 508 //mTodoList->setFixedWidth( mDateNavigator->sizeHint().width() );
509 //leftFrame->setFixedWidth( mDateNavigator->sizeHint().width() ); 509 //leftFrame->setFixedWidth( mDateNavigator->sizeHint().width() );
510 } 510 }
511 if ( !KOPrefs::instance()->mShowDateNavigator) 511 if ( !KOPrefs::instance()->mShowDateNavigator)
512 mDateNavigator->hide(); 512 mDateNavigator->hide();
513 //qDebug("Calendarview Size %d %d ", width(), height()); 513 //qDebug("Calendarview Size %d %d ", width(), height());
514#endif 514#endif
515 515
516 connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), 516 connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ),
517 SLOT( showDates( const KCal::DateList & ) ) ); 517 SLOT( showDates( const KCal::DateList & ) ) );
518 518
519 connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), 519 connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ),
520 mDateNavigator, SLOT( selectDates( const KCal::DateList & ) ) ); 520 mDateNavigator, SLOT( selectDates( const KCal::DateList & ) ) );
521 521
522 522
523 523
524 connect( mDateNavigator, SIGNAL( showMonth( const QDate & ) ), 524 connect( mDateNavigator, SIGNAL( showMonth( const QDate & ) ),
525 mViewManager, SLOT( showMonth( const QDate & ) ) ); 525 mViewManager, SLOT( showMonth( const QDate & ) ) );
526 526
527 connect( mDateNavigator, SIGNAL( weekClicked( const QDate & ) ), 527 connect( mDateNavigator, SIGNAL( weekClicked( const QDate & ) ),
528 mNavigator, SLOT( selectWeek( const QDate & ) ) ); 528 mNavigator, SLOT( selectWeek( const QDate & ) ) );
529 529
530 connect( mDateNavigator, SIGNAL( goPrevYear() ), 530 connect( mDateNavigator, SIGNAL( goPrevYear() ),
531 mNavigator, SLOT( selectPreviousYear() ) ); 531 mNavigator, SLOT( selectPreviousYear() ) );
532 connect( mDateNavigator, SIGNAL( goNextYear() ), 532 connect( mDateNavigator, SIGNAL( goNextYear() ),
533 mNavigator, SLOT( selectNextYear() ) ); 533 mNavigator, SLOT( selectNextYear() ) );
534 connect( mDateNavigator, SIGNAL( goPrevMonth() ), 534 connect( mDateNavigator, SIGNAL( goPrevMonth() ),
535 mNavigator, SLOT( selectPreviousMonth() ) ); 535 mNavigator, SLOT( selectPreviousMonth() ) );
536 connect( mDateNavigator, SIGNAL( goNextMonth() ), 536 connect( mDateNavigator, SIGNAL( goNextMonth() ),
537 mNavigator, SLOT( selectNextMonth() ) ); 537 mNavigator, SLOT( selectNextMonth() ) );
538 538
539 connect( mDateNavigator, SIGNAL( goPrevious() ), 539 connect( mDateNavigator, SIGNAL( goPrevious() ),
540 mNavigator, SLOT( selectPrevious() ) ); 540 mNavigator, SLOT( selectPrevious() ) );
541 connect( mDateNavigator, SIGNAL( goNext() ), 541 connect( mDateNavigator, SIGNAL( goNext() ),
542 mNavigator, SLOT( selectNext() ) ); 542 mNavigator, SLOT( selectNext() ) );
543 connect( mDateNavigator, SIGNAL( monthSelected ( int ) ), 543 connect( mDateNavigator, SIGNAL( monthSelected ( int ) ),
544 mNavigator, SLOT( slotMonthSelect( int ) ) ); 544 mNavigator, SLOT( slotMonthSelect( int ) ) );
545 545
546 connect( mDateNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), 546 connect( mDateNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ),
547 mNavigator, SLOT( selectDates( const KCal::DateList & ) ) ); 547 mNavigator, SLOT( selectDates( const KCal::DateList & ) ) );
548#if 0 548#if 0
549 connect( mDateNavigator, SIGNAL( incidenceDropped( Incidence * ) ), 549 connect( mDateNavigator, SIGNAL( incidenceDropped( Incidence * ) ),
550 SLOT( incidenceAdded( Incidence *) ) ); 550 SLOT( incidenceAdded( Incidence *) ) );
551#endif 551#endif
552 // connect(mDateNavigator,SIGNAL(dayPassed(QDate)),SLOT(updateView())); 552 // connect(mDateNavigator,SIGNAL(dayPassed(QDate)),SLOT(updateView()));
553 553
554 connect( this, SIGNAL( configChanged() ), 554 connect( this, SIGNAL( configChanged() ),
555 mDateNavigator, SLOT( updateConfig() ) ); 555 mDateNavigator, SLOT( updateConfig() ) );
556 556
557 connect( mTodoList, SIGNAL( newTodoSignal() ), 557 connect( mTodoList, SIGNAL( newTodoSignal() ),
558 SLOT( newTodo() ) ); 558 SLOT( newTodo() ) );
559 connect( mTodoList, SIGNAL( newSubTodoSignal( Todo *) ), 559 connect( mTodoList, SIGNAL( newSubTodoSignal( Todo *) ),
560 SLOT( newSubTodo( Todo * ) ) ); 560 SLOT( newSubTodo( Todo * ) ) );
561 connect( mTodoList, SIGNAL( editTodoSignal( Todo * ) ), 561 connect( mTodoList, SIGNAL( editTodoSignal( Todo * ) ),
562 SLOT( editTodo( Todo * ) ) ); 562 SLOT( editTodo( Todo * ) ) );
563 connect( mTodoList, SIGNAL( showTodoSignal( Todo * ) ), 563 connect( mTodoList, SIGNAL( showTodoSignal( Todo * ) ),
564 SLOT( showTodo( Todo *) ) ); 564 SLOT( showTodo( Todo *) ) );
565 connect( mTodoList, SIGNAL( deleteTodoSignal( Todo *) ), 565 connect( mTodoList, SIGNAL( deleteTodoSignal( Todo *) ),
566 SLOT( deleteTodo( Todo *) ) ); 566 SLOT( deleteTodo( Todo *) ) );
567 connect( this, SIGNAL( configChanged()), mTodoList, SLOT( updateConfig() ) ); 567 connect( this, SIGNAL( configChanged()), mTodoList, SLOT( updateConfig() ) );
568 connect( mTodoList, SIGNAL( purgeCompletedSignal() ), 568 connect( mTodoList, SIGNAL( purgeCompletedSignal() ),
569 SLOT( purgeCompleted() ) ); 569 SLOT( purgeCompleted() ) );
570 connect( mTodoList, SIGNAL( todoModifiedSignal( Todo *, int ) ), 570 connect( mTodoList, SIGNAL( todoModifiedSignal( Todo *, int ) ),
571 SIGNAL( todoModified( Todo *, int ) ) ); 571 SIGNAL( todoModified( Todo *, int ) ) );
572 572
573 connect( mTodoList, SIGNAL( cloneTodoSignal( Incidence * ) ), 573 connect( mTodoList, SIGNAL( cloneTodoSignal( Incidence * ) ),
574 this, SLOT ( cloneIncidence( Incidence * ) ) ); 574 this, SLOT ( cloneIncidence( Incidence * ) ) );
575 connect( mTodoList, SIGNAL( cancelTodoSignal( Incidence * ) ), 575 connect( mTodoList, SIGNAL( cancelTodoSignal( Incidence * ) ),
576 this, SLOT (cancelIncidence( Incidence * ) ) ); 576 this, SLOT (cancelIncidence( Incidence * ) ) );
577 577
578 connect( mTodoList, SIGNAL( moveTodoSignal( Incidence * ) ), 578 connect( mTodoList, SIGNAL( moveTodoSignal( Incidence * ) ),
579 this, SLOT ( moveIncidence( Incidence * ) ) ); 579 this, SLOT ( moveIncidence( Incidence * ) ) );
580 connect( mTodoList, SIGNAL( beamTodoSignal( Incidence * ) ), 580 connect( mTodoList, SIGNAL( beamTodoSignal( Incidence * ) ),
581 this, SLOT ( beamIncidence( Incidence * ) ) ); 581 this, SLOT ( beamIncidence( Incidence * ) ) );
582 582
583 connect( mTodoList, SIGNAL( unparentTodoSignal( Todo * ) ), 583 connect( mTodoList, SIGNAL( unparentTodoSignal( Todo * ) ),
584 this, SLOT ( todo_unsub( Todo * ) ) ); 584 this, SLOT ( todo_unsub( Todo * ) ) );
585 585
586 connect( mTodoList, SIGNAL( reparentTodoSignal( Todo *,Todo * ) ), 586 connect( mTodoList, SIGNAL( reparentTodoSignal( Todo *,Todo * ) ),
587 this, SLOT ( todo_resub( Todo *,Todo * ) ) ); 587 this, SLOT ( todo_resub( Todo *,Todo * ) ) );
588 connect( this, SIGNAL( todoModified( Todo *, int )), mTodoList, 588 connect( this, SIGNAL( todoModified( Todo *, int )), mTodoList,
589 SLOT( updateTodo( Todo *, int ) ) ); 589 SLOT( updateTodo( Todo *, int ) ) );
590 connect( this, SIGNAL( todoModified( Todo *, int )), this, 590 connect( this, SIGNAL( todoModified( Todo *, int )), this,
591 SLOT( changeTodoDisplay( Todo *, int ) ) ); 591 SLOT( changeTodoDisplay( Todo *, int ) ) );
592 592
593 593
594 connect( mFilterView, SIGNAL( filterChanged() ), SLOT( updateFilter() ) ); 594 connect( mFilterView, SIGNAL( filterChanged() ), SLOT( updateFilter() ) );
595 connect( mFilterView, SIGNAL( editFilters() ), SLOT( editFilters() ) ); 595 connect( mFilterView, SIGNAL( editFilters() ), SLOT( editFilters() ) );
596 connect( mCalendar, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addAlarm(const QDateTime &, const QString & ) ) ); 596 connect( mCalendar, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addAlarm(const QDateTime &, const QString & ) ) );
597 connect( mCalendar, SIGNAL( removeAlarm(const QDateTime &, const QString & ) ), SLOT( removeAlarm(const QDateTime &, const QString & ) ) ); 597 connect( mCalendar, SIGNAL( removeAlarm(const QDateTime &, const QString & ) ), SLOT( removeAlarm(const QDateTime &, const QString & ) ) );
598 598
599 599
600 600
601 601
602 602
603 connect(QApplication::clipboard(),SIGNAL(dataChanged()), 603 connect(QApplication::clipboard(),SIGNAL(dataChanged()),
604 SLOT(checkClipboard())); 604 SLOT(checkClipboard()));
605 connect( mTodoList,SIGNAL( incidenceSelected( Incidence * ) ), 605 connect( mTodoList,SIGNAL( incidenceSelected( Incidence * ) ),
606 SLOT( processTodoListSelection( Incidence * ) ) ); 606 SLOT( processTodoListSelection( Incidence * ) ) );
607 connect(mTodoList,SIGNAL(isModified(bool)),SLOT(setModified(bool))); 607 connect(mTodoList,SIGNAL(isModified(bool)),SLOT(setModified(bool)));
608 608
609 // kdDebug() << "CalendarView::CalendarView() done" << endl; 609 // kdDebug() << "CalendarView::CalendarView() done" << endl;
610 610
611 mDateFrame = new QVBox(0,0,WType_Popup); 611 mDateFrame = new QVBox(0,0,WType_Popup);
612 //mDateFrame->setFrameStyle(QFrame::PopupPanel | QFrame::Raised); 612 //mDateFrame->setFrameStyle(QFrame::PopupPanel | QFrame::Raised);
613 mDateFrame->setFrameStyle( QFrame::WinPanel |QFrame::Raised ); 613 mDateFrame->setFrameStyle( QFrame::WinPanel |QFrame::Raised );
614 mDateFrame->setLineWidth(3); 614 mDateFrame->setLineWidth(3);
615 mDateFrame->hide(); 615 mDateFrame->hide();
616 mDateFrame->setCaption( i18n( "Pick a date to display")); 616 mDateFrame->setCaption( i18n( "Pick a date to display"));
617 mDatePicker = new KDatePicker ( mDateFrame , QDate::currentDate() ); 617 mDatePicker = new KDatePicker ( mDateFrame , QDate::currentDate() );
618 618
619 connect(mDatePicker,SIGNAL(dateSelected(QDate)),SLOT(slotSelectPickerDate(QDate))); 619 connect(mDatePicker,SIGNAL(dateSelected(QDate)),SLOT(slotSelectPickerDate(QDate)));
620 620
621 mEventEditor = mDialogManager->getEventEditor(); 621 mEventEditor = mDialogManager->getEventEditor();
622 mTodoEditor = mDialogManager->getTodoEditor(); 622 mTodoEditor = mDialogManager->getTodoEditor();
623 623
624 mFlagEditDescription = false; 624 mFlagEditDescription = false;
625 625
626 mSuspendTimer = new QTimer( this ); 626 mSuspendTimer = new QTimer( this );
627 mAlarmTimer = new QTimer( this ); 627 mAlarmTimer = new QTimer( this );
628 mRecheckAlarmTimer = new QTimer( this ); 628 mRecheckAlarmTimer = new QTimer( this );
629 connect( mRecheckAlarmTimer, SIGNAL( timeout () ), SLOT( recheckTimerAlarm() ) ); 629 connect( mRecheckAlarmTimer, SIGNAL( timeout () ), SLOT( recheckTimerAlarm() ) );
630 connect( mSuspendTimer, SIGNAL( timeout () ), SLOT( suspendAlarm() ) ); 630 connect( mSuspendTimer, SIGNAL( timeout () ), SLOT( suspendAlarm() ) );
631 connect( mAlarmTimer, SIGNAL( timeout () ), SLOT( timerAlarm() ) ); 631 connect( mAlarmTimer, SIGNAL( timeout () ), SLOT( timerAlarm() ) );
632 mAlarmDialog = new AlarmDialog( this ); 632 mAlarmDialog = new AlarmDialog( this );
633 connect( mAlarmDialog, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addSuspendAlarm(const QDateTime &, const QString & ) ) ); 633 connect( mAlarmDialog, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addSuspendAlarm(const QDateTime &, const QString & ) ) );
634 mAlarmDialog->setServerNotification( false ); 634 mAlarmDialog->setServerNotification( false );
635 mAlarmDialog->setSuspendTime( KOPrefs::instance()->mAlarmSuspendTime ); 635 mAlarmDialog->setSuspendTime( KOPrefs::instance()->mAlarmSuspendTime );
636 636
637 637
638#ifndef DESKTOP_VERSION 638#ifndef DESKTOP_VERSION
639//US listen for arriving address resultsets 639//US listen for arriving address resultsets
640 connect(ExternalAppHandler::instance(), SIGNAL(receivedBirthdayListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)), 640 connect(ExternalAppHandler::instance(), SIGNAL(receivedBirthdayListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)),
641 this, SLOT(insertBirthdays(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&))); 641 this, SLOT(insertBirthdays(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)));
642#endif 642#endif
643 mDateNavigator->setCalendar( mCalendar ); 643 mDateNavigator->setCalendar( mCalendar );
644} 644}
645 645
646 646
647CalendarView::~CalendarView() 647CalendarView::~CalendarView()
648{ 648{
649 // kdDebug() << "~CalendarView()" << endl; 649 // kdDebug() << "~CalendarView()" << endl;
650 //qDebug("CalendarView::~CalendarView() "); 650 //qDebug("CalendarView::~CalendarView() ");
651 delete mDialogManager; 651 delete mDialogManager;
652 delete mViewManager; 652 delete mViewManager;
653 delete mStorage; 653 delete mStorage;
654 delete mDateFrame ; 654 delete mDateFrame ;
655 delete mEventViewerDialog; 655 delete mEventViewerDialog;
656 //kdDebug() << "~CalendarView() done" << endl; 656 //kdDebug() << "~CalendarView() done" << endl;
657} 657}
658
659void CalendarView::slotResetFocus()
660{
661 qDebug(" CalendarView::slotResetFocus() %x", qApp->focusWidget());
662
663}
664
658void CalendarView::nextConflict( bool all, bool allday ) 665void CalendarView::nextConflict( bool all, bool allday )
659{ 666{
660 667
661 QPtrList<Event> testlist = mCalendar->events(); 668 QPtrList<Event> testlist = mCalendar->events();
662 Event * test = testlist.first(); 669 Event * test = testlist.first();
663 while ( test ) { 670 while ( test ) {
664 test->setTagged( false ); 671 test->setTagged( false );
665 test = testlist.next(); 672 test = testlist.next();
666 } 673 }
667 QTime st ( 0,0,0); 674 QTime st ( 0,0,0);
668 if ( mViewManager->currentView() == mViewManager->agendaView() ) 675 if ( mViewManager->currentView() == mViewManager->agendaView() )
669 st = mViewManager->agendaView()->agenda()->getEndTime(); 676 st = mViewManager->agendaView()->agenda()->getEndTime();
670 //qDebug("time %s ", st.toString().latin1()); 677 //qDebug("time %s ", st.toString().latin1());
671 QDateTime startDT = QDateTime (mNavigator->selectedDates().first(),st); 678 QDateTime startDT = QDateTime (mNavigator->selectedDates().first(),st);
672 QDateTime conflict; 679 QDateTime conflict;
673 QDateTime retVal; 680 QDateTime retVal;
674 bool found = false; 681 bool found = false;
675 Event * cE = 0; 682 Event * cE = 0;
676 Event * cE2 = 0; 683 Event * cE2 = 0;
677 QPtrList<Event> testlist2 = testlist; 684 QPtrList<Event> testlist2 = testlist;
678 test = testlist.first(); 685 test = testlist.first();
679 bool skip = false; 686 bool skip = false;
680 topLevelWidget()->setCaption( i18n("Checking conflicts ... please wait") ); 687 topLevelWidget()->setCaption( i18n("Checking conflicts ... please wait") );
681 while ( test ) { 688 while ( test ) {
682 qApp->processEvents(); 689 qApp->processEvents();
683 skip = false; 690 skip = false;
684 if ( !all ) skip = ( allday != test->doesFloat() ); 691 if ( !all ) skip = ( allday != test->doesFloat() );
685 if ( !skip ) { 692 if ( !skip ) {
686 Event * test2 = testlist2.first(); 693 Event * test2 = testlist2.first();
687 while ( test2 ) { 694 while ( test2 ) {
688 skip = false; 695 skip = false;
689 if ( !all ) skip = ( allday != test2->doesFloat() ); 696 if ( !all ) skip = ( allday != test2->doesFloat() );
690 if ( !skip ) { 697 if ( !skip ) {
691 if ( !test2->isTagged() ) { 698 if ( !test2->isTagged() ) {
692 if ( test->isOverlapping ( test2, &retVal, &startDT ) ) { 699 if ( test->isOverlapping ( test2, &retVal, &startDT ) ) {
693 //qDebug("overlap "); 700 //qDebug("overlap ");
694 if ( ! found ) { 701 if ( ! found ) {
695 if ( retVal >= startDT ) { 702 if ( retVal >= startDT ) {
696 conflict = retVal; 703 conflict = retVal;
697 cE = test; 704 cE = test;
698 cE2 = test2; 705 cE2 = test2;
699 found = true; 706 found = true;
700 } 707 }
701 } else { 708 } else {
702 if ( retVal >= startDT && retVal < conflict ) { 709 if ( retVal >= startDT && retVal < conflict ) {
703 conflict = retVal; 710 conflict = retVal;
704 cE = test; 711 cE = test;
705 cE2 = test2; 712 cE2 = test2;
706 } 713 }
707 } 714 }
708 } 715 }
709 } 716 }
710 } 717 }
711 test2 = testlist2.next(); 718 test2 = testlist2.next();
712 } 719 }
713 } 720 }
714 test->setTagged( true ); 721 test->setTagged( true );
715 test = testlist.next(); 722 test = testlist.next();
716 } 723 }
717 if ( found ) { 724 if ( found ) {
718 if ( mViewManager->currentView() != mViewManager->agendaView() || mNavigator->selectedDates().count() > 1 ) 725 if ( mViewManager->currentView() != mViewManager->agendaView() || mNavigator->selectedDates().count() > 1 )
719 mViewManager->showDayView(); 726 mViewManager->showDayView();
720 mNavigator->slotDaySelect( conflict.date() ); 727 mNavigator->slotDaySelect( conflict.date() );
721 int hour = conflict.time().hour(); 728 int hour = conflict.time().hour();
722 mViewManager->agendaView()->setStartHour( hour ); 729 mViewManager->agendaView()->setStartHour( hour );
723 topLevelWidget()->setCaption( i18n("Conflict %1 <-> %2"). arg( cE->summary().left( 20 ) ).arg( cE2->summary().left( 20 ) ) ); 730 topLevelWidget()->setCaption( i18n("Conflict %1 <-> %2"). arg( cE->summary().left( 20 ) ).arg( cE2->summary().left( 20 ) ) );
724 return; 731 return;
725 } 732 }
726 733
727 topLevelWidget()->setCaption( i18n("No conflict found") ); 734 topLevelWidget()->setCaption( i18n("No conflict found") );
728 qDebug("No conflict found "); 735 qDebug("No conflict found ");
729 return; 736 return;
730} 737}
731 738
732void CalendarView::conflictAll() 739void CalendarView::conflictAll()
733{ 740{
734 nextConflict ( true, true ); 741 nextConflict ( true, true );
735} 742}
736void CalendarView::conflictAllday() 743void CalendarView::conflictAllday()
737{ 744{
738 nextConflict ( false, true ); 745 nextConflict ( false, true );
739} 746}
740void CalendarView::conflictNotAll() 747void CalendarView::conflictNotAll()
741{ 748{
742 nextConflict ( false, false ); 749 nextConflict ( false, false );
743} 750}
744 751
745void CalendarView::setCalReadOnly( int id, bool readO ) 752void CalendarView::setCalReadOnly( int id, bool readO )
746{ 753{
747 if ( readO ) { 754 if ( readO ) {
748 emit save(); 755 emit save();
749 } 756 }
750 mCalendar->setReadOnly( id, readO ); 757 mCalendar->setReadOnly( id, readO );
751} 758}
752void CalendarView::setScrollBarStep(int val ) 759void CalendarView::setScrollBarStep(int val )
753{ 760{
754#ifdef DESKTOP_VERSION 761#ifdef DESKTOP_VERSION
755 mDateScrollBar->setLineStep ( val ); 762 mDateScrollBar->setLineStep ( val );
756#endif 763#endif
757} 764}
758void CalendarView::scrollBarValue(int val ) 765void CalendarView::scrollBarValue(int val )
759{ 766{
760#ifdef DESKTOP_VERSION 767#ifdef DESKTOP_VERSION
761 if ( QApplication::desktop()->width() < 800 ) return; 768 if ( QApplication::desktop()->width() < 800 ) return;
762 static bool block = false; 769 static bool block = false;
763 if ( block ) return; 770 if ( block ) return;
764 block = true; 771 block = true;
765 int count = mNavigator->selectedDates().count(); 772 int count = mNavigator->selectedDates().count();
766 int day = mNavigator->selectedDates().first().dayOfYear(); 773 int day = mNavigator->selectedDates().first().dayOfYear();
767 int stepdays = val; 774 int stepdays = val;
768 if ( mDateScrollBar->lineStep () <= count ) { 775 if ( mDateScrollBar->lineStep () <= count ) {
769 //val = val/mDateScrollBar->lineStep ()*mDateScrollBar->lineStep(); 776 //val = val/mDateScrollBar->lineStep ()*mDateScrollBar->lineStep();
770 //qDebug("VAL %d ",val ); 777 //qDebug("VAL %d ",val );
771 stepdays = (val-day)/mDateScrollBar->lineStep ()*mDateScrollBar->lineStep(); 778 stepdays = (val-day)/mDateScrollBar->lineStep ()*mDateScrollBar->lineStep();
772 stepdays = day+stepdays; 779 stepdays = day+stepdays;
773 if ( stepdays < 0 ) stepdays = 0; 780 if ( stepdays < 0 ) stepdays = 0;
774 } 781 }
775 if ( stepdays == day ) { 782 if ( stepdays == day ) {
776 block = false; 783 block = false;
777 return; 784 return;
778 } 785 }
779 int year = mNavigator->selectedDates().first().year(); 786 int year = mNavigator->selectedDates().first().year();
780 QDate d ( year,1,1 ); 787 QDate d ( year,1,1 );
781 mNavigator->selectDates( d.addDays( stepdays-1) , count ); 788 mNavigator->selectDates( d.addDays( stepdays-1) , count );
782 block = false; 789 block = false;
783#endif 790#endif
784 791
785} 792}
786void CalendarView::updateView(const QDate &start, const QDate &end) 793void CalendarView::updateView(const QDate &start, const QDate &end)
787{ 794{
788#ifdef DESKTOP_VERSION 795#ifdef DESKTOP_VERSION
789 if ( ! mDateScrollBar->draggingSlider () ) { 796 if ( ! mDateScrollBar->draggingSlider () ) {
790 int dof = start.dayOfYear(); 797 int dof = start.dayOfYear();
791 //qDebug("dof %d day %d val %d ", dof, start.dayOfYear(),mDateScrollBar->value() ); 798 //qDebug("dof %d day %d val %d ", dof, start.dayOfYear(),mDateScrollBar->value() );
792 if ( dof != mDateScrollBar->value() ) { 799 if ( dof != mDateScrollBar->value() ) {
793 mDateScrollBar->blockSignals( true ); 800 mDateScrollBar->blockSignals( true );
794 mDateScrollBar->setValue( start.dayOfYear()); 801 mDateScrollBar->setValue( start.dayOfYear());
795 mDateScrollBar->blockSignals( false ); 802 mDateScrollBar->blockSignals( false );
796 } 803 }
797 } 804 }
798#endif 805#endif
799 mTodoList->updateView(); 806 mTodoList->updateView();
800 mViewManager->updateView(start, end); 807 mViewManager->updateView(start, end);
801 //mDateNavigator->updateView(); 808 //mDateNavigator->updateView();
802} 809}
803 810
804 811
805 812
806void CalendarView::checkFiles() 813void CalendarView::checkFiles()
807{ 814{
808 QString message; 815 QString message;
809 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; 816 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars;
810 KopiCalendarFile * cal = calendars.first(); 817 KopiCalendarFile * cal = calendars.first();
811 while ( cal ) { 818 while ( cal ) {
812 if ( cal->mErrorOnLoad ) { 819 if ( cal->mErrorOnLoad ) {
813 message += cal->mName +"\n"+KGlobal::formatMessage ( "(" +i18n( "Filepath: ")+ cal->mFileName+")" ,0 )+"\n"; 820 message += cal->mName +"\n"+KGlobal::formatMessage ( "(" +i18n( "Filepath: ")+ cal->mFileName+")" ,0 )+"\n";
814 } 821 }
815 cal = calendars.next(); 822 cal = calendars.next();
816 } 823 }
817 if ( !message.isEmpty() ) { 824 if ( !message.isEmpty() ) {
818 message = KGlobal::formatMessage( i18n("Calendar(s) not loaded:"),0 )+"\n" + message +KGlobal::formatMessage(i18n("You can try to reload the calendar in the Resource View!"),0); 825 message = KGlobal::formatMessage( i18n("Calendar(s) not loaded:"),0 )+"\n" + message +KGlobal::formatMessage(i18n("You can try to reload the calendar in the Resource View!"),0);
819 KMessageBox::error(this,message, i18n("Loding of calendar(s) failed")); 826 KMessageBox::error(this,message, i18n("Loding of calendar(s) failed"));
820 } 827 }
821 QTimer::singleShot( 2000, this, SLOT ( checkAlarms() )); 828 QTimer::singleShot( 2000, this, SLOT ( checkAlarms() ));
822} 829}
823void CalendarView::checkAlarms() 830void CalendarView::checkAlarms()
824{ 831{
825 832
826 833
827 KConfig *config = KOGlobals::config(); 834 KConfig *config = KOGlobals::config();
828 config->setGroup( "AppRun" ); 835 config->setGroup( "AppRun" );
829 QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) ); 836 QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) );
830 int daysto = dt.daysTo( QDate::currentDate() ); 837 int daysto = dt.daysTo( QDate::currentDate() );
831 int days = config->readNumEntry( "LatestProgramStopDays" , daysto); 838 int days = config->readNumEntry( "LatestProgramStopDays" , daysto);
832 dt = dt.addDays( days ); 839 dt = dt.addDays( days );
833 int secto = dt.secsTo( QDateTime::currentDateTime() ); 840 int secto = dt.secsTo( QDateTime::currentDateTime() );
834 int secs = config->readNumEntry( "LatestProgramStopSecs" , secto) - 30; 841 int secs = config->readNumEntry( "LatestProgramStopSecs" , secto) - 30;
835 //qDebug("KO: Reading program stop %d ", secs); 842 //qDebug("KO: Reading program stop %d ", secs);
836 //secs -= ( 3600 * 24*3 ); // debug only 843 //secs -= ( 3600 * 24*3 ); // debug only
837 QDateTime latest = dt.addSecs ( secs ); 844 QDateTime latest = dt.addSecs ( secs );
838 qDebug("KO: Last termination on %s ", latest.toString().latin1()); 845 qDebug("KO: Last termination on %s ", latest.toString().latin1());
839 //qDebug("KO: Current Time %s ",QDateTime::currentDateTime().toString().latin1() ); 846 //qDebug("KO: Current Time %s ",QDateTime::currentDateTime().toString().latin1() );
840 QPtrList<Incidence> el = mCalendar->rawIncidences(); 847 QPtrList<Incidence> el = mCalendar->rawIncidences();
841 QPtrList<Incidence> al; 848 QPtrList<Incidence> al;
842 Incidence* inL = el.first(); 849 Incidence* inL = el.first();
843 QDateTime cur = QDateTime::currentDateTime().addSecs(-59); 850 QDateTime cur = QDateTime::currentDateTime().addSecs(-59);
844 qDebug("KO: Checking alarm until %s ", cur.toString().latin1()); 851 qDebug("KO: Checking alarm until %s ", cur.toString().latin1());
845 while ( inL ) { 852 while ( inL ) {
846 bool ok = false; 853 bool ok = false;
847 int offset = 0; 854 int offset = 0;
848 QDateTime next = inL->getNextAlarmDateTime(& ok, &offset, latest ) ; 855 QDateTime next = inL->getNextAlarmDateTime(& ok, &offset, latest ) ;
849 if ( ok ) { 856 if ( ok ) {
diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h
index 799c297..456c2d7 100644
--- a/korganizer/calendarview.h
+++ b/korganizer/calendarview.h
@@ -11,385 +11,386 @@
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#include <qscrollbar.h> 33#include <qscrollbar.h>
34#ifndef DESKTOP_VERSION 34#ifndef DESKTOP_VERSION
35#include <qtopia/ir.h> 35#include <qtopia/ir.h>
36#else 36#else
37#define Ir char 37#define Ir char
38#endif 38#endif
39#include <libkcal/calendar.h> 39#include <libkcal/calendar.h>
40#include <libkcal/scheduler.h> 40#include <libkcal/scheduler.h>
41#include <libkcal/calendarresources.h> 41#include <libkcal/calendarresources.h>
42#include <libkcal/resourcecalendar.h> 42#include <libkcal/resourcecalendar.h>
43#include <KDGanttMinimizeSplitter.h> 43#include <KDGanttMinimizeSplitter.h>
44 44
45#include <korganizer/calendarviewbase.h> 45#include <korganizer/calendarviewbase.h>
46 46
47#include <ksyncmanager.h> 47#include <ksyncmanager.h>
48//#include <koprefs.h> 48//#include <koprefs.h>
49 49
50class QWidgetStack; 50class QWidgetStack;
51class QSplitter; 51class QSplitter;
52class KopiCalendarFile; 52class KopiCalendarFile;
53class CalPrinter; 53class CalPrinter;
54class KOFilterView; 54class KOFilterView;
55class KOCalEditView; 55class KOCalEditView;
56class KOViewManager; 56class KOViewManager;
57class KODialogManager; 57class KODialogManager;
58class KOTodoView; 58class KOTodoView;
59class KDateNavigator; 59class KDateNavigator;
60class DateNavigatorContainer; 60class DateNavigatorContainer;
61class DateNavigator; 61class DateNavigator;
62class KOIncidenceEditor; 62class KOIncidenceEditor;
63class KDatePicker; 63class KDatePicker;
64class ResourceView; 64class ResourceView;
65class KOEventEditor; 65class KOEventEditor;
66class KOTodoEditor ; 66class KOTodoEditor ;
67class KOEventViewerDialog; 67class KOEventViewerDialog;
68class KOBeamPrefs; 68class KOBeamPrefs;
69class KSyncProfile; 69class KSyncProfile;
70class AlarmDialog; 70class AlarmDialog;
71class KCal::Attendee; 71class KCal::Attendee;
72 72
73namespace KCal { class FileStorage; } 73namespace KCal { class FileStorage; }
74 74
75using namespace KCal; 75using namespace KCal;
76 76
77/** 77/**
78 This is the main calendar widget. It provides the different vies on t he 78 This is the main calendar widget. It provides the different vies on t he
79 calendar data as well as the date navigator. It also handles synchronisation 79 calendar data as well as the date navigator. It also handles synchronisation
80 of the different views and controls the different dialogs like preferences, 80 of the different views and controls the different dialogs like preferences,
81 event editor, search dialog etc. 81 event editor, search dialog etc.
82 82
83 @short main calendar view widget 83 @short main calendar view widget
84 @author Cornelius Schumacher 84 @author Cornelius Schumacher
85*/ 85*/
86 86
87#include <qtextbrowser.h> 87#include <qtextbrowser.h>
88#include <qtextcodec.h> 88#include <qtextcodec.h>
89 89
90class MissedAlarmTextBrowser : public QTextBrowser { 90class MissedAlarmTextBrowser : public QTextBrowser {
91 Q_OBJECT 91 Q_OBJECT
92 public: 92 public:
93 MissedAlarmTextBrowser(QWidget *parent, QPtrList<Incidence> alarms ,QDateTime start); 93 MissedAlarmTextBrowser(QWidget *parent, QPtrList<Incidence> alarms ,QDateTime start);
94 ~MissedAlarmTextBrowser(); 94 ~MissedAlarmTextBrowser();
95 void setSource(const QString & n); 95 void setSource(const QString & n);
96 96
97 private: 97 private:
98 Incidence * getNextInc(QDateTime start ); 98 Incidence * getNextInc(QDateTime start );
99 QPtrList<Incidence> mAlarms; 99 QPtrList<Incidence> mAlarms;
100 signals: 100 signals:
101 void showIncidence( QString uid); 101 void showIncidence( QString uid);
102}; 102};
103 103
104 104
105class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Observer, public KSyncInterface 105class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Observer, public KSyncInterface
106{ 106{
107 Q_OBJECT 107 Q_OBJECT
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 slotResetFocus();
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 &noti ); 218 void addAlarm(const QDateTime &qdt, const QString &noti );
218 void addSuspendAlarm(const QDateTime &qdt, const QString &noti ); 219 void addSuspendAlarm(const QDateTime &qdt, const QString &noti );
219 void removeAlarm(const QDateTime &qdt, const QString &noti ); 220 void removeAlarm(const QDateTime &qdt, const QString &noti );
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 *);
300 /** Create an editor dialog for a todo */ 301 /** Create an editor dialog for a todo */
301 void editTodo(Todo *); 302 void editTodo(Todo *);
302 /** Create a read-only viewer dialog for the supplied todo */ 303 /** Create a read-only viewer dialog for the supplied todo */
303 void showTodo(Todo *); 304 void showTodo(Todo *);
304 /** create new todo */ 305 /** create new todo */
305 void newTodo(); 306 void newTodo();
306 void newTodoDateTime(QDateTime, bool allday); 307 void newTodoDateTime(QDateTime, bool allday);
307 /** create new todo with a parent todo */ 308 /** create new todo with a parent todo */
308 void newSubTodo(); 309 void newSubTodo();
309 /** create new todo with a parent todo */ 310 /** create new todo with a parent todo */
310 void newSubTodo(Todo *); 311 void newSubTodo(Todo *);
311 /** Delete todo */ 312 /** Delete todo */
312 void deleteTodo(Todo *); 313 void deleteTodo(Todo *);
313 314
314 315
315 /** Check if clipboard contains vCalendar event. The signal pasteEnabled() is 316 /** Check if clipboard contains vCalendar event. The signal pasteEnabled() is
316 * emitted as result. */ 317 * emitted as result. */
317 void checkClipboard(); 318 void checkClipboard();
318 319
319 /** using the KConfig associated with the kapp variable, read in the 320 /** using the KConfig associated with the kapp variable, read in the
320 * settings from the config file. 321 * settings from the config file.
321 */ 322 */
322 void readSettings(); 323 void readSettings();
323 324
324 /** write current state to config file. */ 325 /** write current state to config file. */
325 void writeSettings(); 326 void writeSettings();
326 327
327 /** read settings for calendar filters */ 328 /** read settings for calendar filters */
328 void readFilterSettings(KConfig *config); 329 void readFilterSettings(KConfig *config);
329 330
330 /** write settings for calendar filters */ 331 /** write settings for calendar filters */
331 void writeFilterSettings(KConfig *config); 332 void writeFilterSettings(KConfig *config);
332 333
333 /** passes on the message that an event has changed to the currently 334 /** passes on the message that an event has changed to the currently
334 * activated view so that it can make appropriate display changes. */ 335 * activated view so that it can make appropriate display changes. */
335 void changeEventDisplay(Event *, int); 336 void changeEventDisplay(Event *, int);
336 void changeIncidenceDisplay(Incidence *, int); 337 void changeIncidenceDisplay(Incidence *, int);
337 void changeTodoDisplay(Todo *, int); 338 void changeTodoDisplay(Todo *, int);
338 339
339 void eventAdded(Event *); 340 void eventAdded(Event *);
340 void eventChanged(Event *); 341 void eventChanged(Event *);
341 void eventToBeDeleted(Event *); 342 void eventToBeDeleted(Event *);
342 void eventDeleted(); 343 void eventDeleted();
343 344
344 void todoAdded(Todo *); 345 void todoAdded(Todo *);
345 void todoChanged(Todo *); 346 void todoChanged(Todo *);
346 void todoToBeDeleted(Todo *); 347 void todoToBeDeleted(Todo *);
347 void todoDeleted(); 348 void todoDeleted();
348 349
349 void updateView(const QDate &start, const QDate &end); 350 void updateView(const QDate &start, const QDate &end);
350 void updateView(); 351 void updateView();
351 void clearAllViews(); 352 void clearAllViews();
352 353
353 /** Full update of visible todo views */ 354 /** Full update of visible todo views */
354 void updateTodoViews(); 355 void updateTodoViews();
355 356
356 void updateUnmanagedViews(); 357 void updateUnmanagedViews();
357 358
358 /** cut the current appointment to the clipboard */ 359 /** cut the current appointment to the clipboard */
359 void edit_cut(); 360 void edit_cut();
360 361
361 /** copy the current appointment(s) to the clipboard */ 362 /** copy the current appointment(s) to the clipboard */
362 void edit_copy(); 363 void edit_copy();
363 364
364 /** paste the current vobject(s) in the clipboard buffer into calendar */ 365 /** paste the current vobject(s) in the clipboard buffer into calendar */
365 void edit_paste(); 366 void edit_paste();
366 367
367 /** edit viewing and configuration options. */ 368 /** edit viewing and configuration options. */
368 void edit_options(); 369 void edit_options();
369 void edit_global_options(); 370 void edit_global_options();
370 /** 371 /**
371 Functions for printing, previewing a print, and setting up printing 372 Functions for printing, previewing a print, and setting up printing
372 parameters. 373 parameters.
373 */ 374 */
374 void print(); 375 void print();
375 void printSetup(); 376 void printSetup();
376 void printPreview(); 377 void printPreview();
377 378
378 /** Export as iCalendar file */ 379 /** Export as iCalendar file */
379 void exportICalendar(); 380 void exportICalendar();
380 381
381 /** Export as vCalendar file */ 382 /** Export as vCalendar file */
382 bool exportVCalendar( QString fn); 383 bool exportVCalendar( QString fn);
383 384
384 /** pop up a dialog to show an existing appointment. */ 385 /** pop up a dialog to show an existing appointment. */
385 void appointment_show(); 386 void appointment_show();
386 /** 387 /**
387 * pop up an Appointment Dialog to edit an existing appointment.Get 388 * pop up an Appointment Dialog to edit an existing appointment.Get
388 * information on the appointment from the list of unique IDs that is 389 * information on the appointment from the list of unique IDs that is
389 * currently in the View, called currIds. 390 * currently in the View, called currIds.
390 */ 391 */
391 void appointment_edit(); 392 void appointment_edit();
392 /** 393 /**
393 * pop up dialog confirming deletion of currently selected event in the 394 * pop up dialog confirming deletion of currently selected event in the
394 * View. 395 * View.
395 */ 396 */
diff --git a/korganizer/koagenda.cpp b/korganizer/koagenda.cpp
index 779f12e..0dd5ef5 100644
--- a/korganizer/koagenda.cpp
+++ b/korganizer/koagenda.cpp
@@ -1446,385 +1446,388 @@ void KOAgenda::drawContentsToPainter( QPainter* paint, bool backgroundOnly )// i
1446 } 1446 }
1447 mPixPainter.begin( &mPaintPixmap) ; 1447 mPixPainter.begin( &mPaintPixmap) ;
1448 //qDebug("wid %d hei %d ",mPaintPixmap.width(),mPaintPixmap.height() ); 1448 //qDebug("wid %d hei %d ",mPaintPixmap.width(),mPaintPixmap.height() );
1449 QPainter * p ; 1449 QPainter * p ;
1450 if (paint == 0) { 1450 if (paint == 0) {
1451 mPaintPixmap.fill(KOPrefs::instance()->mAgendaBgColor); 1451 mPaintPixmap.fill(KOPrefs::instance()->mAgendaBgColor);
1452 p = &mPixPainter; 1452 p = &mPixPainter;
1453 } 1453 }
1454 else 1454 else
1455 p = paint ; 1455 p = paint ;
1456 // qDebug("++++++KOAgenda::drawContentsTo Painter %d %d %d %d ", cx, cy, cw, ch); 1456 // qDebug("++++++KOAgenda::drawContentsTo Painter %d %d %d %d ", cx, cy, cw, ch);
1457 1457
1458 //--cx;++cw; 1458 //--cx;++cw;
1459 int lGridSpacingY = mGridSpacingY*2; 1459 int lGridSpacingY = mGridSpacingY*2;
1460 int selDay; 1460 int selDay;
1461 QDate curDate = QDate::currentDate(); 1461 QDate curDate = QDate::currentDate();
1462 if ( !backgroundOnly ) { 1462 if ( !backgroundOnly ) {
1463 for ( selDay = 0; selDay < mSelectedDates.count(); ++selDay) 1463 for ( selDay = 0; selDay < mSelectedDates.count(); ++selDay)
1464 { 1464 {
1465 if ( mSelectedDates[selDay] == curDate && KOPrefs::instance()->mHighlightCurrentDay) { 1465 if ( mSelectedDates[selDay] == curDate && KOPrefs::instance()->mHighlightCurrentDay) {
1466 int x1 = cx; 1466 int x1 = cx;
1467 int y1 = 0; 1467 int y1 = 0;
1468 if (y1 < cy) y1 = cy; 1468 if (y1 < cy) y1 = cy;
1469 int x2 = cx+cw-1; 1469 int x2 = cx+cw-1;
1470 int y2 = contentsHeight(); 1470 int y2 = contentsHeight();
1471 if (y2 > cy+ch-1) y2=cy+ch-1; 1471 if (y2 > cy+ch-1) y2=cy+ch-1;
1472 if (x2 >= x1 && y2 >= y1) { 1472 if (x2 >= x1 && y2 >= y1) {
1473 int gxStart = selDay; 1473 int gxStart = selDay;
1474 int gxEnd = gxStart ; 1474 int gxEnd = gxStart ;
1475 int xStart = KOGlobals::self()->reverseLayout() ? 1475 int xStart = KOGlobals::self()->reverseLayout() ?
1476 (mColumns - 1 - gxStart)*mGridSpacingX : 1476 (mColumns - 1 - gxStart)*mGridSpacingX :
1477 gxStart*mGridSpacingX; 1477 gxStart*mGridSpacingX;
1478 if (xStart < x1) xStart = x1; 1478 if (xStart < x1) xStart = x1;
1479 int xEnd = KOGlobals::self()->reverseLayout() ? 1479 int xEnd = KOGlobals::self()->reverseLayout() ?
1480 (mColumns - gxStart)*mGridSpacingX-1 : 1480 (mColumns - gxStart)*mGridSpacingX-1 :
1481 (gxStart+1)*mGridSpacingX-1; 1481 (gxStart+1)*mGridSpacingX-1;
1482 if (xEnd > x2) xEnd = x2; 1482 if (xEnd > x2) xEnd = x2;
1483 if ( KOPrefs::instance()->mUseHighlightLightColor ) 1483 if ( KOPrefs::instance()->mUseHighlightLightColor )
1484 p->fillRect(xStart,y1,xEnd-xStart+1,y2-y1+1, 1484 p->fillRect(xStart,y1,xEnd-xStart+1,y2-y1+1,
1485 KOPrefs::instance()->mAgendaBgColor.light()); 1485 KOPrefs::instance()->mAgendaBgColor.light());
1486 else 1486 else
1487 p->fillRect(xStart,y1,xEnd-xStart+1,y2-y1+1, 1487 p->fillRect(xStart,y1,xEnd-xStart+1,y2-y1+1,
1488 KOPrefs::instance()->mAgendaBgColor.dark()); 1488 KOPrefs::instance()->mAgendaBgColor.dark());
1489 1489
1490 } 1490 }
1491 } 1491 }
1492 } 1492 }
1493 } 1493 }
1494 // Highlight working hours 1494 // Highlight working hours
1495 1495
1496 if ( !backgroundOnly ) 1496 if ( !backgroundOnly )
1497 if (mWorkingHoursEnable) { 1497 if (mWorkingHoursEnable) {
1498 int x1 = cx; 1498 int x1 = cx;
1499 int y1 = mWorkingHoursYTop; 1499 int y1 = mWorkingHoursYTop;
1500 if (y1 < cy) y1 = cy; 1500 if (y1 < cy) y1 = cy;
1501 int x2 = cx+cw-1; 1501 int x2 = cx+cw-1;
1502 // int x2 = mGridSpacingX * 5 - 1; 1502 // int x2 = mGridSpacingX * 5 - 1;
1503 // if (x2 > cx+cw-1) x2 = cx + cw - 1; 1503 // if (x2 > cx+cw-1) x2 = cx + cw - 1;
1504 int y2 = mWorkingHoursYBottom; 1504 int y2 = mWorkingHoursYBottom;
1505 if (y2 > cy+ch-1) y2=cy+ch-1; 1505 if (y2 > cy+ch-1) y2=cy+ch-1;
1506 1506
1507 if (x2 >= x1 && y2 >= y1) { 1507 if (x2 >= x1 && y2 >= y1) {
1508 // qDebug("x1 %d mGridSpacingX %d ", x1, mGridSpacingX ); 1508 // qDebug("x1 %d mGridSpacingX %d ", x1, mGridSpacingX );
1509 int gxStart = x1/mGridSpacingX; 1509 int gxStart = x1/mGridSpacingX;
1510 int gxEnd = x2/mGridSpacingX; 1510 int gxEnd = x2/mGridSpacingX;
1511 while(gxStart <= gxEnd) { 1511 while(gxStart <= gxEnd) {
1512 if (gxStart < int(mHolidayMask->count()) && 1512 if (gxStart < int(mHolidayMask->count()) &&
1513 !mHolidayMask->at(gxStart)) { 1513 !mHolidayMask->at(gxStart)) {
1514 int xStart = KOGlobals::self()->reverseLayout() ? 1514 int xStart = KOGlobals::self()->reverseLayout() ?
1515 (mColumns - 1 - gxStart)*mGridSpacingX : 1515 (mColumns - 1 - gxStart)*mGridSpacingX :
1516 gxStart*mGridSpacingX; 1516 gxStart*mGridSpacingX;
1517 if (xStart < x1) xStart = x1; 1517 if (xStart < x1) xStart = x1;
1518 int xEnd = KOGlobals::self()->reverseLayout() ? 1518 int xEnd = KOGlobals::self()->reverseLayout() ?
1519 (mColumns - gxStart)*mGridSpacingX-1 : 1519 (mColumns - gxStart)*mGridSpacingX-1 :
1520 (gxStart+1)*mGridSpacingX-1; 1520 (gxStart+1)*mGridSpacingX-1;
1521 if (xEnd > x2) xEnd = x2; 1521 if (xEnd > x2) xEnd = x2;
1522 if ( mSelectedDates[gxStart] == curDate && KOPrefs::instance()->mHighlightCurrentDay ) { 1522 if ( mSelectedDates[gxStart] == curDate && KOPrefs::instance()->mHighlightCurrentDay ) {
1523 if ( KOPrefs::instance()->mUseHighlightLightColor ) 1523 if ( KOPrefs::instance()->mUseHighlightLightColor )
1524 p->fillRect(xStart,y1,xEnd-xStart+1,y2-y1+1, 1524 p->fillRect(xStart,y1,xEnd-xStart+1,y2-y1+1,
1525 KOPrefs::instance()->mWorkingHoursColor.light()); 1525 KOPrefs::instance()->mWorkingHoursColor.light());
1526 else 1526 else
1527 p->fillRect(xStart,y1,xEnd-xStart+1,y2-y1+1, 1527 p->fillRect(xStart,y1,xEnd-xStart+1,y2-y1+1,
1528 KOPrefs::instance()->mWorkingHoursColor.dark()); 1528 KOPrefs::instance()->mWorkingHoursColor.dark());
1529 } else { 1529 } else {
1530 p->fillRect(xStart,y1,xEnd-xStart+1,y2-y1+1, 1530 p->fillRect(xStart,y1,xEnd-xStart+1,y2-y1+1,
1531 KOPrefs::instance()->mWorkingHoursColor); 1531 KOPrefs::instance()->mWorkingHoursColor);
1532 } 1532 }
1533 } 1533 }
1534 ++gxStart; 1534 ++gxStart;
1535 } 1535 }
1536 } 1536 }
1537 } 1537 }
1538 /* 1538 /*
1539 int selectionX = KOGlobals::self()->reverseLayout() ? 1539 int selectionX = KOGlobals::self()->reverseLayout() ?
1540 (mColumns - 1 - mSelectionCellX) * mGridSpacingX : 1540 (mColumns - 1 - mSelectionCellX) * mGridSpacingX :
1541 mSelectionCellX * mGridSpacingX; 1541 mSelectionCellX * mGridSpacingX;
1542 1542
1543 // Draw selection 1543 // Draw selection
1544 if ( ( cx + cw ) >= selectionX && cx <= ( selectionX + mGridSpacingX ) && 1544 if ( ( cx + cw ) >= selectionX && cx <= ( selectionX + mGridSpacingX ) &&
1545 ( cy + ch ) >= mSelectionYTop && cy <= ( mSelectionYTop + mSelectionHeight ) ) { 1545 ( cy + ch ) >= mSelectionYTop && cy <= ( mSelectionYTop + mSelectionHeight ) ) {
1546 // TODO: paint only part within cx,cy,cw,ch 1546 // TODO: paint only part within cx,cy,cw,ch
1547 p->fillRect( selectionX, mSelectionYTop, mGridSpacingX, 1547 p->fillRect( selectionX, mSelectionYTop, mGridSpacingX,
1548 mSelectionHeight, KOPrefs::instance()->mHighlightColor ); 1548 mSelectionHeight, KOPrefs::instance()->mHighlightColor );
1549 } 1549 }
1550 */ 1550 */
1551 // Draw vertical lines of grid 1551 // Draw vertical lines of grid
1552 1552
1553 int x = ((int)(cx/mGridSpacingX))*mGridSpacingX; 1553 int x = ((int)(cx/mGridSpacingX))*mGridSpacingX;
1554 if ( mGridSpacingX > 0 ) { 1554 if ( mGridSpacingX > 0 ) {
1555 while (x < cx + cw) { 1555 while (x < cx + cw) {
1556 p->drawLine(x,cy,x,cy+ch); 1556 p->drawLine(x,cy,x,cy+ch);
1557 x+=mGridSpacingX; 1557 x+=mGridSpacingX;
1558 } 1558 }
1559 } 1559 }
1560 // Draw horizontal lines of grid 1560 // Draw horizontal lines of grid
1561 int y = ((int)(cy/lGridSpacingY))*lGridSpacingY; 1561 int y = ((int)(cy/lGridSpacingY))*lGridSpacingY;
1562 if ( lGridSpacingY > 0 ) { 1562 if ( lGridSpacingY > 0 ) {
1563 while (y < cy + ch) { 1563 while (y < cy + ch) {
1564 p->setPen( SolidLine ); 1564 p->setPen( SolidLine );
1565 p->drawLine(cx,y,cx+cw,y); 1565 p->drawLine(cx,y,cx+cw,y);
1566 y+=lGridSpacingY; 1566 y+=lGridSpacingY;
1567 p->setPen( DotLine ); 1567 p->setPen( DotLine );
1568 p->drawLine(cx,y,cx+cw,y); 1568 p->drawLine(cx,y,cx+cw,y);
1569 y+=lGridSpacingY; 1569 y+=lGridSpacingY;
1570 } 1570 }
1571 p->setPen( SolidLine ); 1571 p->setPen( SolidLine );
1572 } 1572 }
1573 mPixPainter.end() ; 1573 mPixPainter.end() ;
1574} 1574}
1575 1575
1576/* 1576/*
1577 Convert srcollview contents coordinates to agenda grid coordinates. 1577 Convert srcollview contents coordinates to agenda grid coordinates.
1578*/ 1578*/
1579void KOAgenda::contentsToGrid (int x, int y, int& gx, int& gy) 1579void KOAgenda::contentsToGrid (int x, int y, int& gx, int& gy)
1580{ 1580{
1581 gx = KOGlobals::self()->reverseLayout() ? mColumns - 1 - x/mGridSpacingX : 1581 gx = KOGlobals::self()->reverseLayout() ? mColumns - 1 - x/mGridSpacingX :
1582 x/mGridSpacingX; 1582 x/mGridSpacingX;
1583 gy = y/mGridSpacingY; 1583 gy = y/mGridSpacingY;
1584} 1584}
1585 1585
1586/* 1586/*
1587 Convert agenda grid coordinates to scrollview contents coordinates. 1587 Convert agenda grid coordinates to scrollview contents coordinates.
1588*/ 1588*/
1589void KOAgenda::gridToContents (int gx, int gy, int& x, int& y) 1589void KOAgenda::gridToContents (int gx, int gy, int& x, int& y)
1590{ 1590{
1591 x = KOGlobals::self()->reverseLayout() ? (mColumns - 1 - gx)*mGridSpacingX: 1591 x = KOGlobals::self()->reverseLayout() ? (mColumns - 1 - gx)*mGridSpacingX:
1592 gx*mGridSpacingX; 1592 gx*mGridSpacingX;
1593 y = gy*mGridSpacingY; 1593 y = gy*mGridSpacingY;
1594} 1594}
1595 1595
1596 1596
1597/* 1597/*
1598 Return Y coordinate corresponding to time. Coordinates are rounded to fit into 1598 Return Y coordinate corresponding to time. Coordinates are rounded to fit into
1599 the grid. 1599 the grid.
1600*/ 1600*/
1601int KOAgenda::timeToY(const QTime &time) 1601int KOAgenda::timeToY(const QTime &time)
1602{ 1602{
1603 int minutesPerCell = 24 * 60 / mRows; 1603 int minutesPerCell = 24 * 60 / mRows;
1604 int timeMinutes = time.hour() * 60 + time.minute(); 1604 int timeMinutes = time.hour() * 60 + time.minute();
1605 int Y = (timeMinutes + (minutesPerCell / 2)) / minutesPerCell; 1605 int Y = (timeMinutes + (minutesPerCell / 2)) / minutesPerCell;
1606 return Y; 1606 return Y;
1607} 1607}
1608 1608
1609 1609
1610/* 1610/*
1611 Return time corresponding to cell y coordinate. Coordinates are rounded to 1611 Return time corresponding to cell y coordinate. Coordinates are rounded to
1612 fit into the grid. 1612 fit into the grid.
1613*/ 1613*/
1614QTime KOAgenda::gyToTime(int gy) 1614QTime KOAgenda::gyToTime(int gy)
1615{ 1615{
1616 1616
1617 int secondsPerCell = 24 * 60 * 60/ mRows; 1617 int secondsPerCell = 24 * 60 * 60/ mRows;
1618 1618
1619 int timeSeconds = secondsPerCell * gy; 1619 int timeSeconds = secondsPerCell * gy;
1620 1620
1621 QTime time( 0, 0, 0 ); 1621 QTime time( 0, 0, 0 );
1622 if ( timeSeconds < 24 * 60 * 60 ) { 1622 if ( timeSeconds < 24 * 60 * 60 ) {
1623 time = time.addSecs(timeSeconds); 1623 time = time.addSecs(timeSeconds);
1624 } else { 1624 } else {
1625 time.setHMS( 23, 59, 59 ); 1625 time.setHMS( 23, 59, 59 );
1626 } 1626 }
1627 1627
1628 return time; 1628 return time;
1629} 1629}
1630 1630
1631void KOAgenda::setStartHour(int startHour) 1631void KOAgenda::setStartHour(int startHour)
1632{ 1632{
1633 int startCell = startHour * mRows / 24; 1633 int startCell = startHour * mRows / 24;
1634 setContentsPos(0,startCell * gridSpacingY()); 1634 setContentsPos(0,startCell * gridSpacingY());
1635} 1635}
1636QTime KOAgenda::getEndTime() 1636QTime KOAgenda::getEndTime()
1637{ 1637{
1638 return QTime ( (contentsY ()+viewport()->height())*24/contentsHeight ()+1,0,0); 1638 int tim = (contentsY ()+viewport()->height())*24/contentsHeight ();
1639 if ( tim > 23 )
1640 return QTime ( 23,59,59);
1641 return QTime ( tim,0,0);
1639} 1642}
1640void KOAgenda::hideUnused() 1643void KOAgenda::hideUnused()
1641{ 1644{
1642 // experimental only 1645 // experimental only
1643 // return; 1646 // return;
1644 KOAgendaItem *item; 1647 KOAgendaItem *item;
1645 for ( item=mUnusedItems.first(); item != 0; item=mUnusedItems.next() ) { 1648 for ( item=mUnusedItems.first(); item != 0; item=mUnusedItems.next() ) {
1646 item->hide(); 1649 item->hide();
1647 } 1650 }
1648} 1651}
1649 1652
1650 1653
1651KOAgendaItem *KOAgenda::getNewItem(Incidence * event,QDate qd, QWidget* view) 1654KOAgendaItem *KOAgenda::getNewItem(Incidence * event,QDate qd, QWidget* view)
1652{ 1655{
1653 1656
1654 KOAgendaItem *fi; 1657 KOAgendaItem *fi;
1655 for ( fi=mUnusedItems.first(); fi != 0; fi=mUnusedItems.next() ) { 1658 for ( fi=mUnusedItems.first(); fi != 0; fi=mUnusedItems.next() ) {
1656 if ( fi->incidence() == event ) { 1659 if ( fi->incidence() == event ) {
1657 mUnusedItems.remove(); 1660 mUnusedItems.remove();
1658 fi->init( event, qd ); 1661 fi->init( event, qd );
1659 return fi; 1662 return fi;
1660 } 1663 }
1661 } 1664 }
1662 fi=mUnusedItems.first(); 1665 fi=mUnusedItems.first();
1663 if ( fi ) { 1666 if ( fi ) {
1664 mUnusedItems.remove(); 1667 mUnusedItems.remove();
1665 fi->init( event, qd ); 1668 fi->init( event, qd );
1666 return fi; 1669 return fi;
1667 } 1670 }
1668 // qDebug("new KOAgendaItem "); 1671 // qDebug("new KOAgendaItem ");
1669 1672
1670 KOAgendaItem* agendaItem = new KOAgendaItem( event, qd, view, mAllDayMode ); 1673 KOAgendaItem* agendaItem = new KOAgendaItem( event, qd, view, mAllDayMode );
1671 agendaItem->installEventFilter(this); 1674 agendaItem->installEventFilter(this);
1672 addChild(agendaItem,0,0); 1675 addChild(agendaItem,0,0);
1673 return agendaItem; 1676 return agendaItem;
1674} 1677}
1675KOAgendaItem * KOAgenda::getItemForTodo ( Todo * todo ) 1678KOAgendaItem * KOAgenda::getItemForTodo ( Todo * todo )
1676{ 1679{
1677 KOAgendaItem *item; 1680 KOAgendaItem *item;
1678 for ( item=mItems.first(); item != 0; item=mItems.next() ) { 1681 for ( item=mItems.first(); item != 0; item=mItems.next() ) {
1679 if ( item->incidence() == todo ) { 1682 if ( item->incidence() == todo ) {
1680 mItems.remove(); 1683 mItems.remove();
1681 return item; 1684 return item;
1682 } 1685 }
1683 } 1686 }
1684 return 0; 1687 return 0;
1685} 1688}
1686 1689
1687 1690
1688void KOAgenda::updateTodo( Todo * todo, int days, bool remove) 1691void KOAgenda::updateTodo( Todo * todo, int days, bool remove)
1689{ 1692{
1690 // ( todo->hasCompletedDate() && todo->completed().date() == currentDate )|| 1693 // ( todo->hasCompletedDate() && todo->completed().date() == currentDate )||
1691 KOAgendaItem *item; 1694 KOAgendaItem *item;
1692 item = getItemForTodo ( todo ); 1695 item = getItemForTodo ( todo );
1693 //qDebug("KOAgenda::updateTodo %d %d %d %d", this, todo, days, remove); 1696 //qDebug("KOAgenda::updateTodo %d %d %d %d", this, todo, days, remove);
1694 if ( item ) { 1697 if ( item ) {
1695 blockSignals( true ); 1698 blockSignals( true );
1696 //qDebug("item found "); 1699 //qDebug("item found ");
1697 item->hide(); 1700 item->hide();
1698 item->setCellX(-2, -1 ); 1701 item->setCellX(-2, -1 );
1699 item->select(false); 1702 item->select(false);
1700 mUnusedItems.append( item ); 1703 mUnusedItems.append( item );
1701 mItems.remove( item ); 1704 mItems.remove( item );
1702 QPtrList<KOAgendaItem> oldconflictItems = item->conflictItems(); 1705 QPtrList<KOAgendaItem> oldconflictItems = item->conflictItems();
1703 KOAgendaItem *itemit; 1706 KOAgendaItem *itemit;
1704 //globalFlagBlockAgendaItemPaint = 1; 1707 //globalFlagBlockAgendaItemPaint = 1;
1705 for ( itemit=oldconflictItems.first(); itemit != 0; 1708 for ( itemit=oldconflictItems.first(); itemit != 0;
1706 itemit=oldconflictItems.next() ) { 1709 itemit=oldconflictItems.next() ) {
1707 if ( itemit != item ) 1710 if ( itemit != item )
1708 placeSubCells(itemit); 1711 placeSubCells(itemit);
1709 } 1712 }
1710 qApp->processEvents(); 1713 qApp->processEvents();
1711 //globalFlagBlockAgendaItemPaint = 0; 1714 //globalFlagBlockAgendaItemPaint = 0;
1712 for ( itemit=oldconflictItems.first(); itemit != 0; 1715 for ( itemit=oldconflictItems.first(); itemit != 0;
1713 itemit=oldconflictItems.next() ) { 1716 itemit=oldconflictItems.next() ) {
1714 globalFlagBlockAgendaItemUpdate = 0; 1717 globalFlagBlockAgendaItemUpdate = 0;
1715 if ( itemit != item ) 1718 if ( itemit != item )
1716 itemit->repaintMe(); 1719 itemit->repaintMe();
1717 globalFlagBlockAgendaItemUpdate = 1; 1720 globalFlagBlockAgendaItemUpdate = 1;
1718 //qDebug("sigleshot "); 1721 //qDebug("sigleshot ");
1719 QTimer::singleShot( 0, itemit, SLOT ( repaintItem() )); 1722 QTimer::singleShot( 0, itemit, SLOT ( repaintItem() ));
1720 //itemit->repaint( false ); repaintItem() 1723 //itemit->repaint( false ); repaintItem()
1721 } 1724 }
1722 blockSignals( false ); 1725 blockSignals( false );
1723 } 1726 }
1724 if ( remove ) { 1727 if ( remove ) {
1725 //qDebug("remove****************************************** "); 1728 //qDebug("remove****************************************** ");
1726 return; 1729 return;
1727 } 1730 }
1728 if ( todo->hasCompletedDate() && !KOPrefs::instance()->mShowCompletedTodoInAgenda ) 1731 if ( todo->hasCompletedDate() && !KOPrefs::instance()->mShowCompletedTodoInAgenda )
1729 return; 1732 return;
1730 //qDebug("updateTodo+++++++++++++++++++++++++++++++++++++ "); 1733 //qDebug("updateTodo+++++++++++++++++++++++++++++++++++++ ");
1731 QDate currentDate = QDate::currentDate(); 1734 QDate currentDate = QDate::currentDate();
1732 bool overdue = (!todo->isCompleted()) && (todo->dtDue() < currentDate)&& ( KOPrefs::instance()->mShowTodoInAgenda ); 1735 bool overdue = (!todo->isCompleted()) && (todo->dtDue() < currentDate)&& ( KOPrefs::instance()->mShowTodoInAgenda );
1733 QDateTime dt; 1736 QDateTime dt;
1734 if ( todo->hasCompletedDate() ) 1737 if ( todo->hasCompletedDate() )
1735 dt = todo->completed(); 1738 dt = todo->completed();
1736 else 1739 else
1737 dt = todo->dtDue(); 1740 dt = todo->dtDue();
1738 if ( overdue ) { 1741 if ( overdue ) {
1739 days += todo->dtDue().date().daysTo( currentDate ); 1742 days += todo->dtDue().date().daysTo( currentDate );
1740 } 1743 }
1741 else 1744 else
1742 currentDate = dt.date(); 1745 currentDate = dt.date();
1743 1746
1744 if (( todo->doesFloat() || overdue) && !todo->hasCompletedDate() ) { 1747 if (( todo->doesFloat() || overdue) && !todo->hasCompletedDate() ) {
1745 if ( ! mAllDayMode ) return; 1748 if ( ! mAllDayMode ) return;
1746 // aldayagenda 1749 // aldayagenda
1747 globalFlagBlockAgendaItemPaint = 1; 1750 globalFlagBlockAgendaItemPaint = 1;
1748 item = insertAllDayItem(todo, currentDate,days, days); 1751 item = insertAllDayItem(todo, currentDate,days, days);
1749 item->show(); 1752 item->show();
1750 1753
1751 } 1754 }
1752 else { 1755 else {
1753 if ( mAllDayMode ) return; 1756 if ( mAllDayMode ) return;
1754 // mAgenda 1757 // mAgenda
1755 globalFlagBlockAgendaItemPaint = 1; 1758 globalFlagBlockAgendaItemPaint = 1;
1756 int endY = timeToY(dt.time()) - 1; 1759 int endY = timeToY(dt.time()) - 1;
1757 int hi = 12/KOPrefs::instance()->mHourSize; 1760 int hi = 12/KOPrefs::instance()->mHourSize;
1758 int startY = endY - 1-hi; 1761 int startY = endY - 1-hi;
1759 item = insertItem(todo,currentDate,days,startY,endY); 1762 item = insertItem(todo,currentDate,days,startY,endY);
1760 item->show(); 1763 item->show();
1761 } 1764 }
1762 qApp->processEvents(); 1765 qApp->processEvents();
1763 globalFlagBlockAgendaItemPaint = 0; 1766 globalFlagBlockAgendaItemPaint = 0;
1764 QPtrList<KOAgendaItem> oldconflictItems = item->conflictItems(); 1767 QPtrList<KOAgendaItem> oldconflictItems = item->conflictItems();
1765 KOAgendaItem *itemit; 1768 KOAgendaItem *itemit;
1766 for ( itemit=oldconflictItems.first(); itemit != 0; 1769 for ( itemit=oldconflictItems.first(); itemit != 0;
1767 itemit=oldconflictItems.next() ) { 1770 itemit=oldconflictItems.next() ) {
1768 globalFlagBlockAgendaItemUpdate = 0; 1771 globalFlagBlockAgendaItemUpdate = 0;
1769 itemit->repaintMe(); 1772 itemit->repaintMe();
1770 globalFlagBlockAgendaItemUpdate = 1; 1773 globalFlagBlockAgendaItemUpdate = 1;
1771 itemit->repaint(); 1774 itemit->repaint();
1772 } 1775 }
1773 globalFlagBlockAgendaItemUpdate = 0; 1776 globalFlagBlockAgendaItemUpdate = 0;
1774 item->repaintMe(); 1777 item->repaintMe();
1775 globalFlagBlockAgendaItemUpdate = 1; 1778 globalFlagBlockAgendaItemUpdate = 1;
1776 item->repaint(); 1779 item->repaint();
1777} 1780}
1778/* 1781/*
1779 Insert KOAgendaItem into agenda. 1782 Insert KOAgendaItem into agenda.
1780*/ 1783*/
1781KOAgendaItem *KOAgenda::insertItem (Incidence *event,QDate qd,int X,int YTop,int YBottom) 1784KOAgendaItem *KOAgenda::insertItem (Incidence *event,QDate qd,int X,int YTop,int YBottom)
1782{ 1785{
1783 if (mAllDayMode) { 1786 if (mAllDayMode) {
1784 qDebug("KOAgenda: calling insertItem in all-day mode is illegal. "); 1787 qDebug("KOAgenda: calling insertItem in all-day mode is illegal. ");
1785 return 0; 1788 return 0;
1786 } 1789 }
1787 1790
1788 KOAgendaItem *agendaItem = getNewItem(event,qd,viewport()); 1791 KOAgendaItem *agendaItem = getNewItem(event,qd,viewport());
1789 //agendaItem->setFrameStyle(WinPanel|Raised); 1792 //agendaItem->setFrameStyle(WinPanel|Raised);
1790 1793
1791 int YSize = YBottom - YTop + 1; 1794 int YSize = YBottom - YTop + 1;
1792 if (YSize < 0) { 1795 if (YSize < 0) {
1793 YSize = 1; 1796 YSize = 1;
1794 } 1797 }
1795 int iheight = mGridSpacingY * YSize; 1798 int iheight = mGridSpacingY * YSize;
1796 1799
1797 agendaItem->resize(mGridSpacingX,iheight ); 1800 agendaItem->resize(mGridSpacingX,iheight );
1798 agendaItem->setCellXY(X,YTop,YBottom); 1801 agendaItem->setCellXY(X,YTop,YBottom);
1799 agendaItem->setCellXWidth(X); 1802 agendaItem->setCellXWidth(X);
1800 1803
1801 //addChild(agendaItem,X*mGridSpacingX,YTop*mGridSpacingY); 1804 //addChild(agendaItem,X*mGridSpacingX,YTop*mGridSpacingY);
1802 mItems.append(agendaItem); 1805 mItems.append(agendaItem);
1803 1806
1804 placeSubCells(agendaItem); 1807 placeSubCells(agendaItem);
1805 1808
1806 //agendaItem->show(); 1809 //agendaItem->show();
1807 1810
1808 1811
1809 return agendaItem; 1812 return agendaItem;
1810} 1813}
1811 1814
1812 1815
1813/* 1816/*
1814 Insert all-day KOAgendaItem into agenda. 1817 Insert all-day KOAgendaItem into agenda.
1815*/ 1818*/
1816KOAgendaItem *KOAgenda::insertAllDayItem (Incidence *event,QDate qd,int XBegin,int XEnd) 1819KOAgendaItem *KOAgenda::insertAllDayItem (Incidence *event,QDate qd,int XBegin,int XEnd)
1817{ 1820{
1818 if (!mAllDayMode) { 1821 if (!mAllDayMode) {
1819 return 0; 1822 return 0;
1820 } 1823 }
1821 1824
1822 KOAgendaItem *agendaItem = getNewItem(event,qd,viewport()); 1825 KOAgendaItem *agendaItem = getNewItem(event,qd,viewport());
1823 1826
1824 agendaItem->setCellXY(XBegin,0,0); 1827 agendaItem->setCellXY(XBegin,0,0);
1825 agendaItem->setCellXWidth(XEnd); 1828 agendaItem->setCellXWidth(XEnd);
1826 agendaItem->resize(mGridSpacingX * agendaItem->cellWidth(),mGridSpacingY); 1829 agendaItem->resize(mGridSpacingX * agendaItem->cellWidth(),mGridSpacingY);
1827 1830
1828 //addChild(agendaItem,XBegin*mGridSpacingX,0); 1831 //addChild(agendaItem,XBegin*mGridSpacingX,0);
1829 mItems.append(agendaItem); 1832 mItems.append(agendaItem);
1830 1833
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index 4bedb61..21d5a35 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -1,420 +1,418 @@
1#include <stdlib.h> 1#include <stdlib.h>
2 2
3#include <qaction.h> 3#include <qaction.h>
4#include <qpopupmenu.h> 4#include <qpopupmenu.h>
5#include <qpainter.h> 5#include <qpainter.h>
6#include <qwhatsthis.h> 6#include <qwhatsthis.h>
7#include <qpushbutton.h> 7#include <qpushbutton.h>
8#include <qmessagebox.h> 8#include <qmessagebox.h>
9#include <qlineedit.h> 9#include <qlineedit.h>
10#include <qtextcodec.h> 10#include <qtextcodec.h>
11#include <qfile.h> 11#include <qfile.h>
12#include <qdir.h> 12#include <qdir.h>
13#include <qapp.h> 13#include <qapp.h>
14#include <qfileinfo.h> 14#include <qfileinfo.h>
15#include <qlabel.h> 15#include <qlabel.h>
16#include <qspinbox.h> 16#include <qspinbox.h>
17#include <qcheckbox.h> 17#include <qcheckbox.h>
18#include <qmap.h> 18#include <qmap.h>
19#include <qwmatrix.h> 19#include <qwmatrix.h>
20#include <qtextbrowser.h> 20#include <qtextbrowser.h>
21#include <qtextstream.h> 21#include <qtextstream.h>
22#ifndef DESKTOP_VERSION 22#ifndef DESKTOP_VERSION
23#include <qpe/global.h> 23#include <qpe/global.h>
24#include <qpe/qpemenubar.h>
25#include <qpe/qpetoolbar.h> 24#include <qpe/qpetoolbar.h>
26#include <qpe/resource.h> 25#include <qpe/resource.h>
27#include <qpe/qpeapplication.h> 26#include <qpe/qpeapplication.h>
28#include <qtopia/alarmserver.h> 27#include <qtopia/alarmserver.h>
29#include <qtopia/qcopenvelope_qws.h> 28#include <qtopia/qcopenvelope_qws.h>
30#include <unistd.h> // for sleep 29#include <unistd.h> // for sleep
31#else 30#else
32#include <qmenubar.h>
33#include <qtoolbar.h> 31#include <qtoolbar.h>
34#include <qapplication.h> 32#include <qapplication.h>
35//#include <resource.h> 33//#include <resource.h>
36 34
37#endif 35#endif
38#include <libkcal/calendarlocal.h> 36#include <libkcal/calendarlocal.h>
39#include <libkcal/todo.h> 37#include <libkcal/todo.h>
40#include <libkcal/phoneformat.h> 38#include <libkcal/phoneformat.h>
41#include <libkdepim/ksyncprofile.h> 39#include <libkdepim/ksyncprofile.h>
42#include <libkdepim/phoneaccess.h> 40#include <libkdepim/phoneaccess.h>
43#include <libkcal/kincidenceformatter.h> 41#include <libkcal/kincidenceformatter.h>
44#include <libkdepim/kpimglobalprefs.h> 42#include <libkdepim/kpimglobalprefs.h>
45 43
46#include "calendarview.h" 44#include "calendarview.h"
47#include "koviewmanager.h" 45#include "koviewmanager.h"
48#include "datenavigator.h" 46#include "datenavigator.h"
49#include "koagendaview.h" 47#include "koagendaview.h"
50#include "kojournalview.h" 48#include "kojournalview.h"
51#include "koagenda.h" 49#include "koagenda.h"
52#include "kodialogmanager.h" 50#include "kodialogmanager.h"
53#include "kdialogbase.h" 51#include "kdialogbase.h"
54#include "kapplication.h" 52#include "kapplication.h"
55#include "kofilterview.h" 53#include "kofilterview.h"
56#include "kstandarddirs.h" 54#include "kstandarddirs.h"
57#include "koprefs.h" 55#include "koprefs.h"
58#include "kfiledialog.h" 56#include "kfiledialog.h"
59#include "koglobals.h" 57#include "koglobals.h"
60#include "kglobal.h" 58#include "kglobal.h"
61#include "ktoolbar.h" 59#include "ktoolbar.h"
62#include "klocale.h" 60#include "klocale.h"
63#include "kconfig.h" 61#include "kconfig.h"
64#include "externalapphandler.h" 62#include "externalapphandler.h"
65#include <kglobalsettings.h> 63#include <kglobalsettings.h>
66 64
67using namespace KCal; 65using namespace KCal;
68#ifndef _WIN32_ 66#ifndef _WIN32_
69#include <unistd.h> 67#include <unistd.h>
70#else 68#else
71#ifdef _OL_IMPORT_ 69#ifdef _OL_IMPORT_
72#include "koimportoldialog.h" 70#include "koimportoldialog.h"
73#endif 71#endif
74#endif 72#endif
75#include "mainwindow.h" 73#include "mainwindow.h"
76 74
77 75
78class KOex2phonePrefs : public QDialog 76class KOex2phonePrefs : public QDialog
79{ 77{
80 public: 78 public:
81 KOex2phonePrefs( QWidget *parent=0, const char *name=0 ) : 79 KOex2phonePrefs( QWidget *parent=0, const char *name=0 ) :
82 QDialog( parent, name, true ) 80 QDialog( parent, name, true )
83 { 81 {
84 setCaption( i18n("Export to phone options") ); 82 setCaption( i18n("Export to phone options") );
85 QVBoxLayout* lay = new QVBoxLayout( this ); 83 QVBoxLayout* lay = new QVBoxLayout( this );
86 lay->setSpacing( 3 ); 84 lay->setSpacing( 3 );
87 lay->setMargin( 3 ); 85 lay->setMargin( 3 );
88 QLabel *lab; 86 QLabel *lab;
89 lay->addWidget(lab = new QLabel( i18n("Please read Help-Sync Howto\nto know what settings to use."), this ) ); 87 lay->addWidget(lab = new QLabel( i18n("Please read Help-Sync Howto\nto know what settings to use."), this ) );
90 lab->setAlignment (AlignHCenter ); 88 lab->setAlignment (AlignHCenter );
91 QHBox* temphb; 89 QHBox* temphb;
92 temphb = new QHBox( this ); 90 temphb = new QHBox( this );
93 new QLabel( i18n("I/O device: "), temphb ); 91 new QLabel( i18n("I/O device: "), temphb );
94 mPhoneDevice = new QLineEdit( temphb); 92 mPhoneDevice = new QLineEdit( temphb);
95 lay->addWidget( temphb ); 93 lay->addWidget( temphb );
96 temphb = new QHBox( this ); 94 temphb = new QHBox( this );
97 new QLabel( i18n("Connection: "), temphb ); 95 new QLabel( i18n("Connection: "), temphb );
98 mPhoneConnection = new QLineEdit( temphb); 96 mPhoneConnection = new QLineEdit( temphb);
99 lay->addWidget( temphb ); 97 lay->addWidget( temphb );
100 temphb = new QHBox( this ); 98 temphb = new QHBox( this );
101 new QLabel( i18n("Model(opt.): "), temphb ); 99 new QLabel( i18n("Model(opt.): "), temphb );
102 mPhoneModel = new QLineEdit( temphb); 100 mPhoneModel = new QLineEdit( temphb);
103 lay->addWidget( temphb ); 101 lay->addWidget( temphb );
104 mWriteBackFuture= new QCheckBox( i18n("Write back events in future only"), this ); 102 mWriteBackFuture= new QCheckBox( i18n("Write back events in future only"), this );
105 mWriteBackFuture->setChecked( true ); 103 mWriteBackFuture->setChecked( true );
106 lay->addWidget( mWriteBackFuture ); 104 lay->addWidget( mWriteBackFuture );
107 temphb = new QHBox( this ); 105 temphb = new QHBox( this );
108 new QLabel( i18n("Max. weeks in future: ") , temphb ); 106 new QLabel( i18n("Max. weeks in future: ") , temphb );
109 mWriteBackFutureWeeks= new QSpinBox(1,104, 1, temphb); 107 mWriteBackFutureWeeks= new QSpinBox(1,104, 1, temphb);
110 mWriteBackFutureWeeks->setValue( 8 ); 108 mWriteBackFutureWeeks->setValue( 8 );
111 lay->addWidget( temphb ); 109 lay->addWidget( temphb );
112 lay->addWidget(lab = new QLabel( i18n("NOTE: This will remove all old\ntodo/calendar data on phone!"), this ) ); 110 lay->addWidget(lab = new QLabel( i18n("NOTE: This will remove all old\ntodo/calendar data on phone!"), this ) );
113 lab->setAlignment (AlignHCenter ); 111 lab->setAlignment (AlignHCenter );
114 QPushButton * ok = new QPushButton( i18n("Export to mobile phone!"), this ); 112 QPushButton * ok = new QPushButton( i18n("Export to mobile phone!"), this );
115 lay->addWidget( ok ); 113 lay->addWidget( ok );
116 QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); 114 QPushButton * cancel = new QPushButton( i18n("Cancel"), this );
117 lay->addWidget( cancel ); 115 lay->addWidget( cancel );
118 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); 116 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) );
119 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); 117 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) );
120 resize( 220, 240 ); 118 resize( 220, 240 );
121 qApp->processEvents(); 119 qApp->processEvents();
122 int dw = QApplication::desktop()->width(); 120 int dw = QApplication::desktop()->width();
123 int dh = QApplication::desktop()->height(); 121 int dh = QApplication::desktop()->height();
124 move( (dw-width())/2, (dh - height() )/2 ); 122 move( (dw-width())/2, (dh - height() )/2 );
125 } 123 }
126 124
127public: 125public:
128 QLineEdit* mPhoneConnection, *mPhoneDevice, *mPhoneModel; 126 QLineEdit* mPhoneConnection, *mPhoneDevice, *mPhoneModel;
129 QCheckBox* mWriteBackFuture; 127 QCheckBox* mWriteBackFuture;
130 QSpinBox* mWriteBackFutureWeeks; 128 QSpinBox* mWriteBackFutureWeeks;
131}; 129};
132 130
133QPixmap* sgListViewCompletedPix[6]; 131QPixmap* sgListViewCompletedPix[6];
134QPixmap* sgListViewJournalPix; 132QPixmap* sgListViewJournalPix;
135 133
136 134
137int globalFlagBlockStartup; 135int globalFlagBlockStartup;
138MainWindow::MainWindow( QWidget *parent, const char *name ) : 136MainWindow::MainWindow( QWidget *parent, const char *name ) :
139 QMainWindow( parent, name ) 137 QMainWindow( parent, name )
140{ 138{
141 sgListViewCompletedPix[5] = &listviewPix; 139 sgListViewCompletedPix[5] = &listviewPix;
142 sgListViewCompletedPix[0] = &listviewPix0; 140 sgListViewCompletedPix[0] = &listviewPix0;
143 sgListViewCompletedPix[1] = &listviewPix20; 141 sgListViewCompletedPix[1] = &listviewPix20;
144 sgListViewCompletedPix[2] = &listviewPix40; 142 sgListViewCompletedPix[2] = &listviewPix40;
145 sgListViewCompletedPix[3] = &listviewPix60; 143 sgListViewCompletedPix[3] = &listviewPix60;
146 sgListViewCompletedPix[4] = &listviewPix80; 144 sgListViewCompletedPix[4] = &listviewPix80;
147 //int size = 12; 145 //int size = 12;
148 { 146 {
149 sgListViewCompletedPix[5]->resize( 11, 11 ); 147 sgListViewCompletedPix[5]->resize( 11, 11 );
150 sgListViewCompletedPix[5]->fill( Qt::white ); 148 sgListViewCompletedPix[5]->fill( Qt::white );
151 QPainter p ( sgListViewCompletedPix[5] ); 149 QPainter p ( sgListViewCompletedPix[5] );
152 p.drawRect( 0,0,11,11); 150 p.drawRect( 0,0,11,11);
153 p.drawLine ( 2, 5, 4 , 7 ) ; 151 p.drawLine ( 2, 5, 4 , 7 ) ;
154 p.drawLine ( 4 , 7 , 8, 3) ; 152 p.drawLine ( 4 , 7 , 8, 3) ;
155 int iii = 0; 153 int iii = 0;
156 for ( iii = 0; iii < 5; ++iii ) { 154 for ( iii = 0; iii < 5; ++iii ) {
157 sgListViewCompletedPix[iii]->resize( 11, 11 ); 155 sgListViewCompletedPix[iii]->resize( 11, 11 );
158 sgListViewCompletedPix[iii]->fill( Qt::white ); 156 sgListViewCompletedPix[iii]->fill( Qt::white );
159 QPainter p ( sgListViewCompletedPix[iii] ); 157 QPainter p ( sgListViewCompletedPix[iii] );
160 p.drawRect( 0,0,11,11); 158 p.drawRect( 0,0,11,11);
161 if ( iii ) 159 if ( iii )
162 p.fillRect( 1,1,iii*2,9,Qt::gray ); 160 p.fillRect( 1,1,iii*2,9,Qt::gray );
163 } 161 }
164 sgListViewJournalPix = &journalPix; 162 sgListViewJournalPix = &journalPix;
165 sgListViewJournalPix->resize( 11, 11 ); 163 sgListViewJournalPix->resize( 11, 11 );
166 sgListViewJournalPix->fill( Qt::white ); 164 sgListViewJournalPix->fill( Qt::white );
167 { 165 {
168 QPainter p ( sgListViewJournalPix ); 166 QPainter p ( sgListViewJournalPix );
169 p.drawRect( 0,0,11,11); 167 p.drawRect( 0,0,11,11);
170 p.drawLine( 2,3,5,3); 168 p.drawLine( 2,3,5,3);
171 p.drawLine( 2,5,8,5); 169 p.drawLine( 2,5,8,5);
172 p.drawLine( 2,7,6,7); 170 p.drawLine( 2,7,6,7);
173 } 171 }
174 } 172 }
175 mClosed = false; 173 mClosed = false;
176 //QString confFile = KStandardDirs::appDir() + "config/korganizerrc"; 174 //QString confFile = KStandardDirs::appDir() + "config/korganizerrc";
177 QString confFile = locateLocal("config","korganizerrc"); 175 QString confFile = locateLocal("config","korganizerrc");
178 QFileInfo finf ( confFile ); 176 QFileInfo finf ( confFile );
179 bool showWarning = !finf.exists(); 177 bool showWarning = !finf.exists();
180 setIcon(SmallIcon( "ko24" ) ); 178 setIcon(SmallIcon( "ko24" ) );
181 mBlockAtStartup = true; 179 mBlockAtStartup = true;
182 mFlagKeyPressed = false; 180 mFlagKeyPressed = false;
183 setCaption("KO/Pi"); 181 setCaption("KO/Pi");
184 KOPrefs *p = KOPrefs::instance(); 182 KOPrefs *p = KOPrefs::instance();
185 //KPimGlobalPrefs::instance()->setGlobalConfig(); 183 //KPimGlobalPrefs::instance()->setGlobalConfig();
186 p->mCurrentDisplayedView = 0; 184 p->mCurrentDisplayedView = 0;
187 if ( p->mHourSize > 22 ) 185 if ( p->mHourSize > 22 )
188 p->mHourSize = 22; 186 p->mHourSize = 22;
189 QMainWindow::ToolBarDock tbd; 187 QMainWindow::ToolBarDock tbd;
190 if ( p->mToolBarHor ) { 188 if ( p->mToolBarHor ) {
191 if ( p->mToolBarUp ) 189 if ( p->mToolBarUp )
192 tbd = Bottom; 190 tbd = Bottom;
193 else 191 else
194 tbd = Top; 192 tbd = Top;
195 } 193 }
196 else { 194 else {
197 if ( p->mToolBarUp ) 195 if ( p->mToolBarUp )
198 tbd = Right; 196 tbd = Right;
199 else 197 else
200 tbd = Left; 198 tbd = Left;
201 } 199 }
202 if ( KOPrefs::instance()->mUseAppColors ) 200 if ( KOPrefs::instance()->mUseAppColors )
203 QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); 201 QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true );
204 globalFlagBlockStartup = 1; 202 globalFlagBlockStartup = 1;
205 iconToolBar = new QPEToolBar( this ); 203 iconToolBar = new QPEToolBar( this );
206 addToolBar (iconToolBar , tbd ); 204 addToolBar (iconToolBar , tbd );
207 205
208#ifdef DESKTOP_VERSION 206#ifdef DESKTOP_VERSION
209 if ( KOPrefs::instance()->mShowIconFilter ) 207 if ( KOPrefs::instance()->mShowIconFilter )
210#else 208#else
211 if ( KOPrefs::instance()->mShowIconFilter || !p->mShowIconOnetoolbar ) 209 if ( KOPrefs::instance()->mShowIconFilter || !p->mShowIconOnetoolbar )
212#endif 210#endif
213 211
214{ 212{
215 if ( p->mToolBarHorF ) { 213 if ( p->mToolBarHorF ) {
216 if ( p->mToolBarUpF ) 214 if ( p->mToolBarUpF )
217 tbd = Bottom; 215 tbd = Bottom;
218 else 216 else
219 tbd = Top; 217 tbd = Top;
220 } 218 }
221 else { 219 else {
222 if ( p->mToolBarUpF ) 220 if ( p->mToolBarUpF )
223 tbd = Right; 221 tbd = Right;
224 else 222 else
225 tbd = Left; 223 tbd = Left;
226 } 224 }
227 filterToolBar = new QPEToolBar ( this ); 225 filterToolBar = new QPEToolBar ( this );
228 filterMenubar = new QMenuBar( 0 ); 226 filterMenubar = new KMenuBar( 0 );
229 QFontMetrics fm ( filterMenubar->font() ); 227 QFontMetrics fm ( filterMenubar->font() );
230 228
231 filterPopupMenu = new QPopupMenu( this ); 229 filterPopupMenu = new QPopupMenu( this );
232 filterMenubar->insertItem( i18n("No Filter"), filterPopupMenu,0 ); 230 filterMenubar->insertItem( i18n("No Filter"), filterPopupMenu,0 );
233 QString addTest = "A"; 231 QString addTest = "A";
234 filterMenubar->setMinimumWidth( fm.width( i18n("No Filter")+addTest ) ); 232 filterMenubar->setMinimumWidth( fm.width( i18n("No Filter")+addTest ) );
235#ifdef DESKTOP_VERSION 233#ifdef DESKTOP_VERSION
236 addTest = "AAABBBCCCx"; 234 addTest = "AAABBBCCCx";
237#else 235#else
238 addTest = "AAx"; 236 addTest = "AAx";
239#endif 237#endif
240 filterMenubar->setMaximumWidth( fm.width( i18n("No Filter")+addTest ) ); 238 filterMenubar->setMaximumWidth( fm.width( i18n("No Filter")+addTest ) );
241 addToolBar (filterToolBar , tbd ); 239 addToolBar (filterToolBar , tbd );
242 connect ( filterPopupMenu , SIGNAL( activated ( int ) ), this, SLOT (selectFilterPopup( int ) ) ); 240 connect ( filterPopupMenu , SIGNAL( activated ( int ) ), this, SLOT (selectFilterPopup( int ) ) );
243 connect ( filterPopupMenu , SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenuPopup() ) ); 241 connect ( filterPopupMenu , SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenuPopup() ) );
244 if ( !KOPrefs::instance()->mShowIconFilter && !p->mShowIconOnetoolbar ) 242 if ( !KOPrefs::instance()->mShowIconFilter && !p->mShowIconOnetoolbar )
245 filterToolBar->hide(); 243 filterToolBar->hide();
246 } else { 244 } else {
247 filterToolBar = 0; 245 filterToolBar = 0;
248 filterMenubar = 0; 246 filterMenubar = 0;
249 filterPopupMenu = 0; 247 filterPopupMenu = 0;
250 } 248 }
251 if ( p->mShowIconOnetoolbar ) { 249 if ( p->mShowIconOnetoolbar ) {
252 viewToolBar = iconToolBar ; 250 viewToolBar = iconToolBar ;
253 navigatorToolBar = iconToolBar ; 251 navigatorToolBar = iconToolBar ;
254 } else { 252 } else {
255#ifndef DESKTOP_VERSION 253#ifndef DESKTOP_VERSION
256 setToolBarsMovable( false ); 254 setToolBarsMovable( false );
257#endif 255#endif
258 if ( p->mToolBarHorV ) { 256 if ( p->mToolBarHorV ) {
259 if ( p->mToolBarUpV ) 257 if ( p->mToolBarUpV )
260 tbd = Bottom; 258 tbd = Bottom;
261 else 259 else
262 tbd = Top; 260 tbd = Top;
263 } 261 }
264 else { 262 else {
265 if ( p->mToolBarUpV ) 263 if ( p->mToolBarUpV )
266 tbd = Right; 264 tbd = Right;
267 else 265 else
268 tbd = Left; 266 tbd = Left;
269 } 267 }
270 viewToolBar = new QPEToolBar( this ); 268 viewToolBar = new QPEToolBar( this );
271 addToolBar (viewToolBar , tbd ); 269 addToolBar (viewToolBar , tbd );
272 if ( p->mToolBarHorN ) { 270 if ( p->mToolBarHorN ) {
273 if ( p->mToolBarUpN ) 271 if ( p->mToolBarUpN )
274 tbd = Bottom; 272 tbd = Bottom;
275 else 273 else
276 tbd = Top; 274 tbd = Top;
277 } 275 }
278 else { 276 else {
279 if ( p->mToolBarUpN ) 277 if ( p->mToolBarUpN )
280 tbd = Right; 278 tbd = Right;
281 else 279 else
282 tbd = Left; 280 tbd = Left;
283 } 281 }
284 navigatorToolBar = new QPEToolBar( this ); 282 navigatorToolBar = new QPEToolBar( this );
285 addToolBar (navigatorToolBar , tbd ); 283 addToolBar (navigatorToolBar , tbd );
286 } 284 }
287 285
288 286
289 287
290 mCalendarModifiedFlag = false; 288 mCalendarModifiedFlag = false;
291 QLabel* splash = new QLabel(i18n("KO/Pi is starting ... "), this ); 289 QLabel* splash = new QLabel(i18n("KO/Pi is starting ... "), this );
292 splash->setAlignment ( AlignCenter ); 290 splash->setAlignment ( AlignCenter );
293 setCentralWidget( splash ); 291 setCentralWidget( splash );
294#ifndef DESKTOP_VERSION 292#ifndef DESKTOP_VERSION
295 showMaximized(); 293 showMaximized();
296#endif 294#endif
297 295
298 //qDebug("Mainwidget x %d y %d w %d h %d", x(), y(), width(), height ()); 296 //qDebug("Mainwidget x %d y %d w %d h %d", x(), y(), width(), height ());
299 setDefaultPreferences(); 297 setDefaultPreferences();
300 mCalendar = new CalendarLocal(); 298 mCalendar = new CalendarLocal();
301 mView = new CalendarView( mCalendar, this,"mCalendar " ); 299 mView = new CalendarView( mCalendar, this,"mCalendar " );
302 mView->hide(); 300 mView->hide();
303 //mView->resize(splash->size() ); 301 //mView->resize(splash->size() );
304 initActions(); 302 initActions();
305 mSyncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)mView, KSyncManager::KOPI, KOPrefs::instance(), syncMenu); 303 mSyncManager = new KSyncManager((QWidget*)this, (KSyncInterface*)mView, KSyncManager::KOPI, KOPrefs::instance(), syncMenu);
306 mSyncManager->setBlockSave(false); 304 mSyncManager->setBlockSave(false);
307 mView->setSyncManager(mSyncManager); 305 mView->setSyncManager(mSyncManager);
308#ifndef DESKTOP_VERSION 306#ifndef DESKTOP_VERSION
309 iconToolBar->show(); 307 iconToolBar->show();
310 qApp->processEvents(); 308 qApp->processEvents();
311#endif 309#endif
312 //qDebug("Splashwidget x %d y %d w %d h %d", splash-> x(), splash->y(), splash->width(),splash-> height ()); 310 //qDebug("Splashwidget x %d y %d w %d h %d", splash-> x(), splash->y(), splash->width(),splash-> height ());
313 int vh = height() ; 311 int vh = height() ;
314 int vw = width(); 312 int vw = width();
315 //qDebug("Toolbar hei %d ",iconToolBar->height() ); 313 //qDebug("Toolbar hei %d ",iconToolBar->height() );
316 if ( iconToolBar->orientation () == Qt:: Horizontal ) { 314 if ( iconToolBar->orientation () == Qt:: Horizontal ) {
317 vh -= iconToolBar->height(); 315 vh -= iconToolBar->height();
318 } else { 316 } else {
319 vw -= iconToolBar->height(); 317 vw -= iconToolBar->height();
320 } 318 }
321 //mView->setMaximumSize( splash->size() ); 319 //mView->setMaximumSize( splash->size() );
322 //mView->resize( splash->size() ); 320 //mView->resize( splash->size() );
323 //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); 321 //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ());
324 mView->readSettings(); 322 mView->readSettings();
325 bool newFile = false; 323 bool newFile = false;
326 if( !QFile::exists( defaultFileName() ) ) { 324 if( !QFile::exists( defaultFileName() ) ) {
327 QFileInfo finfo ( defaultFileName() ); 325 QFileInfo finfo ( defaultFileName() );
328 QString oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/Applications/korganizer/mycalendar.ics"); 326 QString oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/Applications/korganizer/mycalendar.ics");
329 QString message = "You are starting KO/Pi for the\nfirst time after updating to a\nversion >= 1.9.1. The location of the\ndefault calendar file has changed.\nA mycalendar.ics file was detected\nat the old location.\nThis file will be loaded now\nand stored at the new location!\n(Config file location has changed, too!)\nPlease read menu Help-What's New!\n"; 327 QString message = "You are starting KO/Pi for the\nfirst time after updating to a\nversion >= 1.9.1. The location of the\ndefault calendar file has changed.\nA mycalendar.ics file was detected\nat the old location.\nThis file will be loaded now\nand stored at the new location!\n(Config file location has changed, too!)\nPlease read menu Help-What's New!\n";
330 finfo.setFile( oldFile ); 328 finfo.setFile( oldFile );
331 if (finfo.exists() ) { 329 if (finfo.exists() ) {
332 KMessageBox::information( this, message); 330 KMessageBox::information( this, message);
333 mView->openCalendar( oldFile ); 331 mView->openCalendar( oldFile );
334 qApp->processEvents(); 332 qApp->processEvents();
335 } else { 333 } else {
336 oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/korganizer/mycalendar.ics"); 334 oldFile = QDir::convertSeparators( QDir::homeDirPath()+"/korganizer/mycalendar.ics");
337 finfo.setFile( oldFile ); 335 finfo.setFile( oldFile );
338 if (finfo.exists() ) { 336 if (finfo.exists() ) {
339 KMessageBox::information( this, message); 337 KMessageBox::information( this, message);
340 mView->openCalendar( oldFile ); 338 mView->openCalendar( oldFile );
341 qApp->processEvents(); 339 qApp->processEvents();
342 } 340 }
343 } 341 }
344 mView->saveCalendar( defaultFileName() ); 342 mView->saveCalendar( defaultFileName() );
345 newFile = true; 343 newFile = true;
346 } 344 }
347 345
348 QTime neededSaveTime = QDateTime::currentDateTime().time(); 346 QTime neededSaveTime = QDateTime::currentDateTime().time();
349 mView->loadCalendars(); 347 mView->loadCalendars();
350 int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); 348 int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() );
351 qDebug("KO: Calendar loading time: %d ms",msNeeded ); 349 qDebug("KO: Calendar loading time: %d ms",msNeeded );
352 350
353 if ( KPimGlobalPrefs::instance()->mPreferredLanguage != KOPrefs::instance()->mOldLoadedLanguage ) { 351 if ( KPimGlobalPrefs::instance()->mPreferredLanguage != KOPrefs::instance()->mOldLoadedLanguage ) {
354 KOPrefs::instance()->setAllDefaults(); 352 KOPrefs::instance()->setAllDefaults();
355 } 353 }
356 processIncidenceSelection( 0 ); 354 processIncidenceSelection( 0 );
357 connect( mView, SIGNAL( incidenceSelected( Incidence * ) ), 355 connect( mView, SIGNAL( incidenceSelected( Incidence * ) ),
358 SLOT( processIncidenceSelection( Incidence * ) ) ); 356 SLOT( processIncidenceSelection( Incidence * ) ) );
359 connect( mView, SIGNAL( modifiedChanged( bool ) ), 357 connect( mView, SIGNAL( modifiedChanged( bool ) ),
360 SLOT( slotModifiedChanged( bool ) ) ); 358 SLOT( slotModifiedChanged( bool ) ) );
361 359
362 360
363 connect( mView, SIGNAL( tempDisableBR(bool) ), 361 connect( mView, SIGNAL( tempDisableBR(bool) ),
364 SLOT( disableBR(bool) ) ); 362 SLOT( disableBR(bool) ) );
365 connect( &mSaveTimer, SIGNAL( timeout() ), SLOT( save() ) ); 363 connect( &mSaveTimer, SIGNAL( timeout() ), SLOT( save() ) );
366 mView->setModified( false ); 364 mView->setModified( false );
367 mBlockAtStartup = false; 365 mBlockAtStartup = false;
368 mView->setModified( false ); 366 mView->setModified( false );
369 setCentralWidget( mView ); 367 setCentralWidget( mView );
370 globalFlagBlockStartup = 0; 368 globalFlagBlockStartup = 0;
371 mView->show(); 369 mView->show();
372 delete splash; 370 delete splash;
373 if ( newFile ) 371 if ( newFile )
374 mView->updateConfig(); 372 mView->updateConfig();
375 // qApp->processEvents(); 373 // qApp->processEvents();
376 //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ()); 374 //qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ());
377 //fillSyncMenu(); 375 //fillSyncMenu();
378 376
379 377
380 connect(mSyncManager , SIGNAL( save() ), this, SLOT( save() ) ); 378 connect(mSyncManager , SIGNAL( save() ), this, SLOT( save() ) );
381 connect(mView , SIGNAL( save() ), this, SLOT( save() ) ); 379 connect(mView , SIGNAL( save() ), this, SLOT( save() ) );
382 connect(mView , SIGNAL( saveStopTimer() ), this, SLOT( saveStopTimer() ) ); 380 connect(mView , SIGNAL( saveStopTimer() ), this, SLOT( saveStopTimer() ) );
383 connect(mSyncManager , SIGNAL( request_file() ), this, SLOT( syncFileRequest() ) ); 381 connect(mSyncManager , SIGNAL( request_file() ), this, SLOT( syncFileRequest() ) );
384 connect(mSyncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) ); 382 connect(mSyncManager , SIGNAL( getFile( bool )), this, SLOT(getFile( bool ) ) );
385 mSyncManager->setDefaultFileName( sentSyncFile()); 383 mSyncManager->setDefaultFileName( sentSyncFile());
386 connect ( syncMenu, SIGNAL( activated ( int ) ), mSyncManager, SLOT (slotSyncMenu( int ) ) ); 384 connect ( syncMenu, SIGNAL( activated ( int ) ), mSyncManager, SLOT (slotSyncMenu( int ) ) );
387 mSyncManager->fillSyncMenu(); 385 mSyncManager->fillSyncMenu();
388 386
389 387
390 388
391 mView->viewManager()->agendaView()->setStartHour( KOPrefs::instance()->mDayBegins ); 389 mView->viewManager()->agendaView()->setStartHour( KOPrefs::instance()->mDayBegins );
392 if ( showWarning ) { 390 if ( showWarning ) {
393 KMessageBox::information( this, 391 KMessageBox::information( this,
394 "You are starting KO/Pi for the first time.\nPlease read menu: Help-What's New,\nif you did an update!\nPlease choose your timezone in the \nConfigure Dialog TAB Time Zone!\nPlease choose your language\nin the TAB Locale!\nYou get the Configure Dialog\nvia Menu: Actions - Configure....\nClick OK to show the Configure Dialog!\n", "KO/Pi information"); 392 "You are starting KO/Pi for the first time.\nPlease read menu: Help-What's New,\nif you did an update!\nPlease choose your timezone in the \nConfigure Dialog TAB Time Zone!\nPlease choose your language\nin the TAB Locale!\nYou get the Configure Dialog\nvia Menu: Actions - Configure....\nClick OK to show the Configure Dialog!\n", "KO/Pi information");
395 qApp->processEvents(); 393 qApp->processEvents();
396 mView->dialogManager()->showSyncOptions(); 394 mView->dialogManager()->showSyncOptions();
397 } 395 }
398 396
399 //US listen for result adressed from Ka/Pi 397 //US listen for result adressed from Ka/Pi
400#ifndef DESKTOP_VERSION 398#ifndef DESKTOP_VERSION
401 connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & ))); 399 connect(qApp, SIGNAL (appMessage ( const QCString &, const QByteArray & )), ExternalAppHandler::instance(), SLOT (appMessage ( const QCString &, const QByteArray & )));
402#endif 400#endif
403#ifndef DESKTOP_VERSION 401#ifndef DESKTOP_VERSION
404 infrared = 0; 402 infrared = 0;
405#endif 403#endif
406 updateFilterToolbar(); 404 updateFilterToolbar();
407 updateWeek( mView->startDate() ); 405 updateWeek( mView->startDate() );
408 connect( mView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ), 406 connect( mView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ),
409 SLOT( updateWeekNum( const KCal::DateList & ) ) ); 407 SLOT( updateWeekNum( const KCal::DateList & ) ) );
410 mBRdisabled = false; 408 mBRdisabled = false;
411 //toggleBeamReceive(); 409 //toggleBeamReceive();
412 410
413 QTimer::singleShot( 1000, mView, SLOT ( checkFiles() )); 411 QTimer::singleShot( 1000, mView, SLOT ( checkFiles() ));
414} 412}
415MainWindow::~MainWindow() 413MainWindow::~MainWindow()
416{ 414{
417 //qDebug("MainWindow::~MainWindow() "); 415 //qDebug("MainWindow::~MainWindow() ");
418 //save toolbar location 416 //save toolbar location
419 delete mCalendar; 417 delete mCalendar;
420 delete mSyncManager; 418 delete mSyncManager;
@@ -493,420 +491,420 @@ void MainWindow::closeEvent( QCloseEvent* ce )
493 return; 491 return;
494 492
495 } 493 }
496 494
497 switch( QMessageBox::information( this, "KO/Pi", 495 switch( QMessageBox::information( this, "KO/Pi",
498 i18n("Do you really want\nto close KO/Pi?"), 496 i18n("Do you really want\nto close KO/Pi?"),
499 i18n("Close"), i18n("No"), 497 i18n("Close"), i18n("No"),
500 0, 0 ) ) { 498 0, 0 ) ) {
501 case 0: 499 case 0:
502 saveOnClose(); 500 saveOnClose();
503 mClosed = true; 501 mClosed = true;
504 ce->accept(); 502 ce->accept();
505 break; 503 break;
506 case 1: 504 case 1:
507 ce->ignore(); 505 ce->ignore();
508 break; 506 break;
509 case 2: 507 case 2:
510 508
511 default: 509 default:
512 break; 510 break;
513 } 511 }
514 512
515 513
516} 514}
517 515
518void MainWindow::recieve( const QCString& cmsg, const QByteArray& data ) 516void MainWindow::recieve( const QCString& cmsg, const QByteArray& data )
519{ 517{
520 QDataStream stream( data, IO_ReadOnly ); 518 QDataStream stream( data, IO_ReadOnly );
521 // QMessageBox::about( this, "About KOrganizer/Pi", "*" +msg +"*" ); 519 // QMessageBox::about( this, "About KOrganizer/Pi", "*" +msg +"*" );
522 //QString datamess; 520 //QString datamess;
523 //qDebug("message "); 521 //qDebug("message ");
524 qDebug("KO: QCOP message received: %s ", cmsg.data() ); 522 qDebug("KO: QCOP message received: %s ", cmsg.data() );
525 523
526 if ( cmsg == "setDocument(QString)" ) { 524 if ( cmsg == "setDocument(QString)" ) {
527 QDataStream stream( data, IO_ReadOnly ); 525 QDataStream stream( data, IO_ReadOnly );
528 QString fileName; 526 QString fileName;
529 stream >> fileName; 527 stream >> fileName;
530 //qDebug("filename %s ", fileName.latin1()); 528 //qDebug("filename %s ", fileName.latin1());
531 showMaximized(); 529 showMaximized();
532 raise(); 530 raise();
533 KOPrefs::instance()->mLastSyncedLocalFile = fileName ; 531 KOPrefs::instance()->mLastSyncedLocalFile = fileName ;
534 mSyncManager->slotSyncMenu( 1002 ); 532 mSyncManager->slotSyncMenu( 1002 );
535 return; 533 return;
536 } 534 }
537 535
538 if ( cmsg == "-writeFile" ) { 536 if ( cmsg == "-writeFile" ) {
539 // I made from the "-writeFile" an "-writeAlarm" 537 // I made from the "-writeFile" an "-writeAlarm"
540 mView->viewManager()->showWhatsNextView(); 538 mView->viewManager()->showWhatsNextView();
541 mCalendar->checkAlarmForIncidence( 0, true); 539 mCalendar->checkAlarmForIncidence( 0, true);
542 showMaximized(); 540 showMaximized();
543 raise(); 541 raise();
544 return; 542 return;
545 543
546 } 544 }
547 if ( cmsg == "-writeFileSilent" ) { 545 if ( cmsg == "-writeFileSilent" ) {
548 // I made from the "-writeFile" an "-writeAlarm" 546 // I made from the "-writeFile" an "-writeAlarm"
549 // mView->viewManager()->showWhatsNextView(); 547 // mView->viewManager()->showWhatsNextView();
550 mCalendar->checkAlarmForIncidence( 0, true); 548 mCalendar->checkAlarmForIncidence( 0, true);
551 //showMaximized(); 549 //showMaximized();
552 //raise(); 550 //raise();
553 hide(); 551 hide();
554 return; 552 return;
555 } 553 }
556 if ( cmsg == "-newCountdown" ) { 554 if ( cmsg == "-newCountdown" ) {
557 qDebug("newCountdown "); 555 qDebug("newCountdown ");
558 556
559 } 557 }
560 QString msg ; 558 QString msg ;
561 QString allmsg = cmsg; 559 QString allmsg = cmsg;
562 while ( allmsg.length() > 0 ) { 560 while ( allmsg.length() > 0 ) {
563 int nextC = allmsg.find( "-", 1 ); 561 int nextC = allmsg.find( "-", 1 );
564 if ( nextC == -1 ) { 562 if ( nextC == -1 ) {
565 msg = allmsg; 563 msg = allmsg;
566 allmsg = ""; 564 allmsg = "";
567 } else{ 565 } else{
568 msg = allmsg.left( nextC ); 566 msg = allmsg.left( nextC );
569 allmsg = allmsg.mid( nextC, allmsg.length()-nextC ); 567 allmsg = allmsg.mid( nextC, allmsg.length()-nextC );
570 } 568 }
571 //qDebug("msg: %s all: %s ", msg.latin1(), allmsg.latin1() ); 569 //qDebug("msg: %s all: %s ", msg.latin1(), allmsg.latin1() );
572 if ( msg == "-newEvent" ) { 570 if ( msg == "-newEvent" ) {
573 QTimer::singleShot( 0, mView, SLOT ( newEvent())); 571 QTimer::singleShot( 0, mView, SLOT ( newEvent()));
574 } 572 }
575 if ( msg == "-newTodo" ) { 573 if ( msg == "-newTodo" ) {
576 QTimer::singleShot( 0, mView, SLOT ( newTodo())); 574 QTimer::singleShot( 0, mView, SLOT ( newTodo()));
577 } 575 }
578 if ( msg == "-showWN" ) { 576 if ( msg == "-showWN" ) {
579 mView->viewManager()->showWhatsNextView(); 577 mView->viewManager()->showWhatsNextView();
580 } 578 }
581 if ( msg == "-showTodo" ) { 579 if ( msg == "-showTodo" ) {
582 mView->viewManager()->showTodoView(); 580 mView->viewManager()->showTodoView();
583 } 581 }
584 if ( msg == "-showList" ) { 582 if ( msg == "-showList" ) {
585 mView->viewManager()->showListView(); 583 mView->viewManager()->showListView();
586 } 584 }
587 else if ( msg == "-showDay" ) { 585 else if ( msg == "-showDay" ) {
588 mView->viewManager()->showDayView(); 586 mView->viewManager()->showDayView();
589 } 587 }
590 else if ( msg == "-showWWeek" ) { 588 else if ( msg == "-showWWeek" ) {
591 mView->viewManager()->showWorkWeekView(); 589 mView->viewManager()->showWorkWeekView();
592 } 590 }
593 else if ( msg == "-ringSync" ) { 591 else if ( msg == "-ringSync" ) {
594 QTimer::singleShot( 0, this, SLOT (startMultiSync())); 592 QTimer::singleShot( 0, this, SLOT (startMultiSync()));
595 } 593 }
596 else if ( msg == "-showWeek" ) { 594 else if ( msg == "-showWeek" ) {
597 mView->viewManager()->showWeekView(); 595 mView->viewManager()->showWeekView();
598 } 596 }
599 else if ( msg == "-showTodo" ) { 597 else if ( msg == "-showTodo" ) {
600 mView->viewManager()->showTodoView(); 598 mView->viewManager()->showTodoView();
601 } 599 }
602 else if ( msg == "-showJournal" ) { 600 else if ( msg == "-showJournal" ) {
603 mView->dateNavigator()->selectDates( 1 ); 601 mView->dateNavigator()->selectDates( 1 );
604 mView->dateNavigator()->selectToday(); 602 mView->dateNavigator()->selectToday();
605 mView->viewManager()->showJournalView(); 603 mView->viewManager()->showJournalView();
606 } 604 }
607 else if ( msg == "-showKO" ) { 605 else if ( msg == "-showKO" ) {
608 mView->viewManager()->showNextXView(); 606 mView->viewManager()->showNextXView();
609 } 607 }
610 else if ( msg == "-showWNext" ) { 608 else if ( msg == "-showWNext" ) {
611 mView->viewManager()->showWhatsNextView(); 609 mView->viewManager()->showWhatsNextView();
612 } 610 }
613 else if ( msg == "nextView()" ) { 611 else if ( msg == "nextView()" ) {
614 mView->viewManager()->showNextView(); 612 mView->viewManager()->showNextView();
615 } 613 }
616 else if ( msg == "-showNextXView" ) { 614 else if ( msg == "-showNextXView" ) {
617 mView->viewManager()->showNextXView(); 615 mView->viewManager()->showNextXView();
618 } 616 }
619 617
620 618
621 } 619 }
622 620
623 showMaximized(); 621 showMaximized();
624 raise(); 622 raise();
625} 623}
626void MainWindow::startMultiSync() 624void MainWindow::startMultiSync()
627{ 625{
628 QString question = i18n("Do you really want\nto multiple sync\nwith all checked profiles?\nSyncing takes some\ntime - all profiles\nare synced twice!"); 626 QString question = i18n("Do you really want\nto multiple sync\nwith all checked profiles?\nSyncing takes some\ntime - all profiles\nare synced twice!");
629 if ( QMessageBox::information( this, i18n("KDE-Pim Sync"), 627 if ( QMessageBox::information( this, i18n("KDE-Pim Sync"),
630 question, 628 question,
631 i18n("Yes"), i18n("No"), 629 i18n("Yes"), i18n("No"),
632 0, 0 ) != 0 ) { 630 0, 0 ) != 0 ) {
633 setCaption(i18n("Aborted! Nothing synced!")); 631 setCaption(i18n("Aborted! Nothing synced!"));
634 return; 632 return;
635 } 633 }
636 mSyncManager->multiSync( false ); 634 mSyncManager->multiSync( false );
637#ifndef DESKTOP_VERSION 635#ifndef DESKTOP_VERSION
638 QCopEnvelope e("QPE/Application/kapi", "doRingSync"); 636 QCopEnvelope e("QPE/Application/kapi", "doRingSync");
639#endif 637#endif
640} 638}
641QPixmap MainWindow::loadPixmap( QString name ) 639QPixmap MainWindow::loadPixmap( QString name )
642{ 640{
643 return SmallIcon( name ); 641 return SmallIcon( name );
644 642
645} 643}
646void MainWindow::setUsesBigPixmaps ( bool b ) 644void MainWindow::setUsesBigPixmaps ( bool b )
647{ 645{
648 qDebug("KO: MainWindow::setUsesBigPixmaps %d called", b); 646 qDebug("KO: MainWindow::setUsesBigPixmaps %d called", b);
649 if ( b ) 647 if ( b )
650 qDebug("KO: BigPixmaps are not supported "); 648 qDebug("KO: BigPixmaps are not supported ");
651} 649}
652void MainWindow::initActions() 650void MainWindow::initActions()
653{ 651{
654 //KOPrefs::instance()->mShowFullMenu 652 //KOPrefs::instance()->mShowFullMenu
655 iconToolBar->clear(); 653 iconToolBar->clear();
656 KOPrefs *p = KOPrefs::instance(); 654 KOPrefs *p = KOPrefs::instance();
657 //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar ); 655 //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar );
658 656
659 QPopupMenu *viewMenu = new QPopupMenu( this ); 657 QPopupMenu *viewMenu = new QPopupMenu( this );
660 QPopupMenu *actionMenu = new QPopupMenu( this ); 658 QPopupMenu *actionMenu = new QPopupMenu( this );
661 mCurrentItemMenu = new QPopupMenu ( this ); 659 mCurrentItemMenu = new QPopupMenu ( this );
662 QPopupMenu *nextConflictMenu = new QPopupMenu ( this ); 660 QPopupMenu *nextConflictMenu = new QPopupMenu ( this );
663 QPopupMenu *importMenu = new QPopupMenu( this ); 661 QPopupMenu *importMenu = new QPopupMenu( this );
664 QPopupMenu *importMenu_X = new QPopupMenu( this ); 662 QPopupMenu *importMenu_X = new QPopupMenu( this );
665 QPopupMenu *exportMenu_X = new QPopupMenu( this ); 663 QPopupMenu *exportMenu_X = new QPopupMenu( this );
666 QPopupMenu *beamMenu_X = new QPopupMenu( this ); 664 QPopupMenu *beamMenu_X = new QPopupMenu( this );
667 selectFilterMenu = new QPopupMenu( this ); 665 selectFilterMenu = new QPopupMenu( this );
668 selectFilterMenu->setCheckable( true ); 666 selectFilterMenu->setCheckable( true );
669 syncMenu = new QPopupMenu( this ); 667 syncMenu = new QPopupMenu( this );
670 configureAgendaMenu = new QPopupMenu( this ); 668 configureAgendaMenu = new QPopupMenu( this );
671 configureToolBarMenu = new QPopupMenu( this ); 669 configureToolBarMenu = new QPopupMenu( this );
672 QPopupMenu *helpMenu = new QPopupMenu( this ); 670 QPopupMenu *helpMenu = new QPopupMenu( this );
673 QIconSet icon; 671 QIconSet icon;
674 int pixWid = 22, pixHei = 22; 672 int pixWid = 22, pixHei = 22;
675 QString pathString = ""; 673 QString pathString = "";
676 if ( !p->mToolBarMiniIcons ) { 674 if ( !p->mToolBarMiniIcons ) {
677 if ( QApplication::desktop()->width() < 480 /*|| QApplication::desktop()->height() < 320*/) { 675 if ( QApplication::desktop()->width() < 480 /*|| QApplication::desktop()->height() < 320*/) {
678 pathString += "icons16/"; 676 pathString += "icons16/";
679 pixWid = 18; pixHei = 16; 677 pixWid = 18; pixHei = 16;
680 } 678 }
681 } else { 679 } else {
682 pathString += "iconsmini/"; 680 pathString += "iconsmini/";
683 pixWid = 18; pixHei = 16; 681 pixWid = 18; pixHei = 16;
684 } 682 }
683 KMenuBar *menuBar1;
685 if ( KOPrefs::instance()->mShowFullMenu ) { 684 if ( KOPrefs::instance()->mShowFullMenu ) {
686 QMenuBar *menuBar1; 685 menuBar1 = new KMenuBar( this );//menuBar();
687 menuBar1 = menuBar();
688 menuBar1->insertItem( i18n("File"), importMenu ); 686 menuBar1->insertItem( i18n("File"), importMenu );
689 menuBar1->insertItem( i18n("View"), viewMenu ); 687 menuBar1->insertItem( i18n("View"), viewMenu );
690 menuBar1->insertItem( i18n("Edit"), mCurrentItemMenu ); 688 menuBar1->insertItem( i18n("Edit"), mCurrentItemMenu );
691 menuBar1->insertItem( i18n("Action"), actionMenu ); 689 menuBar1->insertItem( i18n("Action"), actionMenu );
692#ifdef DESKTOP_VERSION 690#ifdef DESKTOP_VERSION
693 menuBar1->insertItem( i18n("Synchronize"), syncMenu ); 691 menuBar1->insertItem( i18n("Synchronize"), syncMenu );
694 menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu ); 692 menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu );
695#else 693#else
696 menuBar1->insertItem( i18n("Sync"), syncMenu ); 694 menuBar1->insertItem( i18n("Sync"), syncMenu );
697 menuBar1->insertItem( i18n("Agenda"),configureAgendaMenu ); 695 menuBar1->insertItem( i18n("Agenda"),configureAgendaMenu );
698#endif 696#endif
699 //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu ); 697 //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu );
700 menuBar1->insertItem( i18n("Filter"),selectFilterMenu ); 698 menuBar1->insertItem( i18n("Filter"),selectFilterMenu );
701 menuBar1->insertItem( i18n("Help"), helpMenu ); 699 menuBar1->insertItem( i18n("Help"), helpMenu );
702 } else { 700 } else {
703 QPEMenuBar *menuBar1; 701 menuBar1 = new KMenuBar( iconToolBar );
704 menuBar1 = new QPEMenuBar( iconToolBar );
705 QPopupMenu *menuBar = new QPopupMenu( this ); 702 QPopupMenu *menuBar = new QPopupMenu( this );
706 icon = loadPixmap( pathString + "z_menu" ); 703 icon = loadPixmap( pathString + "z_menu" );
707 menuBar1->insertItem( icon.pixmap(), menuBar); 704 menuBar1->insertItem( icon.pixmap(), menuBar);
708 //menuBar1->insertItem( i18n("ME"), menuBar); 705 //menuBar1->insertItem( i18n("ME"), menuBar);
709 menuBar->insertItem( i18n("File"), importMenu ); 706 menuBar->insertItem( i18n("File"), importMenu );
710 menuBar->insertItem( i18n("View"), viewMenu ); 707 menuBar->insertItem( i18n("View"), viewMenu );
711 menuBar->insertItem( i18n("Edit"), mCurrentItemMenu ); 708 menuBar->insertItem( i18n("Edit"), mCurrentItemMenu );
712 menuBar->insertItem( i18n("Action"), actionMenu ); 709 menuBar->insertItem( i18n("Action"), actionMenu );
713 menuBar->insertItem( i18n("Synchronize"), syncMenu ); 710 menuBar->insertItem( i18n("Synchronize"), syncMenu );
714 menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu ); 711 menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu );
715 menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu ); 712 menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu );
716 menuBar->insertItem( i18n("Filter"),selectFilterMenu ); 713 menuBar->insertItem( i18n("Filter"),selectFilterMenu );
717 menuBar->insertItem( i18n("Help"), helpMenu ); 714 menuBar->insertItem( i18n("Help"), helpMenu );
718 //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() ); 715 //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() );
719 menuBar1->setMaximumSize( menuBar1->sizeHint( )); 716 menuBar1->setMaximumSize( menuBar1->sizeHint( ));
720 } 717 }
718 connect ( menuBar1, SIGNAL( lostFocus () ), mView, SLOT ( slotResetFocus() ) );
721 connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); 719 connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) );
722 connect ( selectFilterMenu, SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenu() ) ); 720 connect ( selectFilterMenu, SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenu() ) );
723 721
724 722
725 mWeekBgColor = iconToolBar->backgroundColor(); 723 mWeekBgColor = iconToolBar->backgroundColor();
726 mWeekPixmap.resize( pixWid , pixHei ); 724 mWeekPixmap.resize( pixWid , pixHei );
727 mWeekPixmap.fill( mWeekBgColor ); 725 mWeekPixmap.fill( mWeekBgColor );
728 icon = mWeekPixmap; 726 icon = mWeekPixmap;
729 mWeekAction = new QAction( i18n("Select week number"),icon, i18n("Select week number"), 0, this ); 727 mWeekAction = new QAction( i18n("Select week number"),icon, i18n("Select week number"), 0, this );
730 if ( p-> mShowIconWeekNum ) 728 if ( p-> mShowIconWeekNum )
731 mWeekAction->addTo( iconToolBar ); 729 mWeekAction->addTo( iconToolBar );
732 mWeekFont = font(); 730 mWeekFont = font();
733 731
734 int fontPoint = mWeekFont.pointSize(); 732 int fontPoint = mWeekFont.pointSize();
735 QFontMetrics f( mWeekFont ); 733 QFontMetrics f( mWeekFont );
736 int fontWid = f.width( "30" ); 734 int fontWid = f.width( "30" );
737 while ( fontWid > pixWid ) { 735 while ( fontWid > pixWid ) {
738 --fontPoint; 736 --fontPoint;
739 mWeekFont.setPointSize( fontPoint ); 737 mWeekFont.setPointSize( fontPoint );
740 QFontMetrics f( mWeekFont ); 738 QFontMetrics f( mWeekFont );
741 fontWid = f.width( "30" ); 739 fontWid = f.width( "30" );
742 //qDebug("dec-- "); 740 //qDebug("dec-- ");
743 } 741 }
744 742
745 connect( mWeekAction, SIGNAL( activated() ), 743 connect( mWeekAction, SIGNAL( activated() ),
746 this, SLOT( weekAction() ) ); 744 this, SLOT( weekAction() ) );
747 745
748 connect( this, SIGNAL( selectWeek ( int ) ), mView->dateNavigator(), SLOT( selectWeek ( int ) ) ); 746 connect( this, SIGNAL( selectWeek ( int ) ), mView->dateNavigator(), SLOT( selectWeek ( int ) ) );
749 if ( p->mShowIconFilterview ) { 747 if ( p->mShowIconFilterview ) {
750 icon = loadPixmap( pathString + "filter" ); 748 icon = loadPixmap( pathString + "filter" );
751 actionFilterMenuTB = new QAction( i18n("Filter selector"), icon, i18n("Filter selector"), 0, this ); 749 actionFilterMenuTB = new QAction( i18n("Filter selector"), icon, i18n("Filter selector"), 0, this );
752 connect( actionFilterMenuTB, SIGNAL( activated() ), 750 connect( actionFilterMenuTB, SIGNAL( activated() ),
753 this, SLOT( fillFilterMenuTB() ) ); 751 this, SLOT( fillFilterMenuTB() ) );
754 actionFilterMenuTB->addTo( iconToolBar ); 752 actionFilterMenuTB->addTo( iconToolBar );
755 selectFilterMenuTB = new QPopupMenu( this ); 753 selectFilterMenuTB = new QPopupMenu( this );
756 selectFilterMenuTB->setCheckable( true ); 754 selectFilterMenuTB->setCheckable( true );
757 connect ( selectFilterMenuTB, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); 755 connect ( selectFilterMenuTB, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) );
758 } 756 }
759 757
760 //#endif 758 //#endif
761 // ****************** 759 // ******************
762 QAction *action; 760 QAction *action;
763 // QPopupMenu *configureMenu= new QPopupMenu( menuBar ); 761 // QPopupMenu *configureMenu= new QPopupMenu( menuBar );
764 configureToolBarMenu->setCheckable( true ); 762 configureToolBarMenu->setCheckable( true );
765 763
766 764
767 configureAgendaMenu->setCheckable( true ); 765 configureAgendaMenu->setCheckable( true );
768 int iii ; 766 int iii ;
769 for ( iii = 1;iii<= 10 ;++iii ){ 767 for ( iii = 1;iii<= 10 ;++iii ){
770 configureAgendaMenu->insertItem(i18n("Size %1").arg(iii), (iii+1)*2 ); 768 configureAgendaMenu->insertItem(i18n("Size %1").arg(iii), (iii+1)*2 );
771 } 769 }
772 //configureMenu->insertItem( "AgendaSize",configureAgendaMenu ); 770 //configureMenu->insertItem( "AgendaSize",configureAgendaMenu );
773 771
774 connect( configureAgendaMenu, SIGNAL( aboutToShow()), 772 connect( configureAgendaMenu, SIGNAL( aboutToShow()),
775 this, SLOT( showConfigureAgenda( ) ) ); 773 this, SLOT( showConfigureAgenda( ) ) );
776 icon = loadPixmap( pathString + "today" ); 774 icon = loadPixmap( pathString + "today" );
777 QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this ); 775 QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this );
778 today_action->addTo( actionMenu ); 776 today_action->addTo( actionMenu );
779 connect( today_action, SIGNAL( activated() ), 777 connect( today_action, SIGNAL( activated() ),
780 mView, SLOT( goToday() ) ); 778 mView, SLOT( goToday() ) );
781 779
782 icon = loadPixmap( pathString + "picker" ); 780 icon = loadPixmap( pathString + "picker" );
783 QAction* dPickerAction = new QAction( i18n("Select Date..."), icon, i18n("Select Date..."), 0, this ); 781 QAction* dPickerAction = new QAction( i18n("Select Date..."), icon, i18n("Select Date..."), 0, this );
784 dPickerAction->addTo( actionMenu ); 782 dPickerAction->addTo( actionMenu );
785 connect( dPickerAction, SIGNAL( activated() ), 783 connect( dPickerAction, SIGNAL( activated() ),
786 mView, SLOT( showDatePicker() ) ); 784 mView, SLOT( showDatePicker() ) );
787 785
788 icon = loadPixmap( pathString + "search" ); 786 icon = loadPixmap( pathString + "search" );
789 QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this ); 787 QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this );
790 search_action->addTo( actionMenu ); 788 search_action->addTo( actionMenu );
791 connect( search_action, SIGNAL( activated() ), 789 connect( search_action, SIGNAL( activated() ),
792 mView->dialogManager(), SLOT( showSearchDialog() ) ); 790 mView->dialogManager(), SLOT( showSearchDialog() ) );
793 actionMenu->insertItem( i18n("Show next conflict for"), nextConflictMenu ); 791 actionMenu->insertItem( i18n("Show next conflict for"), nextConflictMenu );
794 792
795 action = new QAction( "Undo Delete", i18n("All events"), 0, this ); 793 action = new QAction( "Undo Delete", i18n("All events"), 0, this );
796 action->addTo( nextConflictMenu ); 794 action->addTo( nextConflictMenu );
797 connect( action, SIGNAL( activated() ), 795 connect( action, SIGNAL( activated() ),
798 mView, SLOT( conflictAll() ) ); 796 mView, SLOT( conflictAll() ) );
799 797
800 action = new QAction( "Undo Delete", i18n("Allday events"), 0, this ); 798 action = new QAction( "Undo Delete", i18n("Allday events"), 0, this );
801 action->addTo( nextConflictMenu ); 799 action->addTo( nextConflictMenu );
802 connect( action, SIGNAL( activated() ), 800 connect( action, SIGNAL( activated() ),
803 mView, SLOT( conflictAllday() ) ); 801 mView, SLOT( conflictAllday() ) );
804 802
805 action = new QAction( "Undo Delete", i18n("Events with time"), 0, this ); 803 action = new QAction( "Undo Delete", i18n("Events with time"), 0, this );
806 action->addTo( nextConflictMenu ); 804 action->addTo( nextConflictMenu );
807 connect( action, SIGNAL( activated() ), 805 connect( action, SIGNAL( activated() ),
808 mView, SLOT( conflictNotAll() ) ); 806 mView, SLOT( conflictNotAll() ) );
809 807
810 actionMenu->insertSeparator(); 808 actionMenu->insertSeparator();
811 809
812 icon = loadPixmap( pathString + "newevent" ); 810 icon = loadPixmap( pathString + "newevent" );
813 QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this ); 811 QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this );
814 ne_action->addTo( mCurrentItemMenu ); 812 ne_action->addTo( mCurrentItemMenu );
815 connect( ne_action, SIGNAL( activated() ), 813 connect( ne_action, SIGNAL( activated() ),
816 mView, SLOT( newEvent() ) ); 814 mView, SLOT( newEvent() ) );
817 icon = loadPixmap( pathString + "newtodo" ); 815 icon = loadPixmap( pathString + "newtodo" );
818 configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 ); 816 configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 );
819 QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this ); 817 QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this );
820 nt_action->addTo( mCurrentItemMenu ); 818 nt_action->addTo( mCurrentItemMenu );
821 connect( nt_action, SIGNAL( activated() ), 819 connect( nt_action, SIGNAL( activated() ),
822 mView, SLOT( newTodo() ) ); 820 mView, SLOT( newTodo() ) );
823 mNewSubTodoAction = new QAction( "new_subtodo", i18n("New Sub-Todo..."), 0, 821 mNewSubTodoAction = new QAction( "new_subtodo", i18n("New Sub-Todo..."), 0,
824 this ); 822 this );
825 mNewSubTodoAction->addTo( mCurrentItemMenu ); 823 mNewSubTodoAction->addTo( mCurrentItemMenu );
826 connect( mNewSubTodoAction, SIGNAL( activated() ), 824 connect( mNewSubTodoAction, SIGNAL( activated() ),
827 mView, SLOT( newSubTodo() ) ); 825 mView, SLOT( newSubTodo() ) );
828 826
829 mCurrentItemMenu->insertSeparator(); 827 mCurrentItemMenu->insertSeparator();
830 icon = loadPixmap( pathString + "newevent" ); 828 icon = loadPixmap( pathString + "newevent" );
831 configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 ); 829 configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 );
832 configureToolBarMenu->insertItem(i18n("Only one toolbar"), 6 ); 830 configureToolBarMenu->insertItem(i18n("Only one toolbar"), 6 );
833 configureToolBarMenu->insertSeparator(); 831 configureToolBarMenu->insertSeparator();
834 configureToolBarMenu->insertItem(i18n("Filtermenu"), 7 ); 832 configureToolBarMenu->insertItem(i18n("Filtermenu"), 7 );
835 configureToolBarMenu->insertSeparator(); 833 configureToolBarMenu->insertSeparator();
836 configureToolBarMenu->insertItem(i18n("Week Number"), 400); 834 configureToolBarMenu->insertItem(i18n("Week Number"), 400);
837 configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 ); 835 configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 );
838 836
839 //actionMenu->insertItem ( i18n("Selected Item"), mCurrentItemMenu); 837 //actionMenu->insertItem ( i18n("Selected Item"), mCurrentItemMenu);
840 mShowAction = new QAction( "show_incidence", i18n("Show"), 0, this ); 838 mShowAction = new QAction( "show_incidence", i18n("Show"), 0, this );
841 mShowAction->addTo( mCurrentItemMenu ); 839 mShowAction->addTo( mCurrentItemMenu );
842 connect( mShowAction, SIGNAL( activated() ), 840 connect( mShowAction, SIGNAL( activated() ),
843 mView, SLOT( showIncidence() ) ); 841 mView, SLOT( showIncidence() ) );
844 842
845 mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this ); 843 mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this );
846 mEditAction->addTo( mCurrentItemMenu ); 844 mEditAction->addTo( mCurrentItemMenu );
847 connect( mEditAction, SIGNAL( activated() ), 845 connect( mEditAction, SIGNAL( activated() ),
848 mView, SLOT( editIncidence() ) ); 846 mView, SLOT( editIncidence() ) );
849 847
850 mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this ); 848 mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this );
851 mDeleteAction->addTo( mCurrentItemMenu ); 849 mDeleteAction->addTo( mCurrentItemMenu );
852 connect( mDeleteAction, SIGNAL( activated() ), 850 connect( mDeleteAction, SIGNAL( activated() ),
853 mView, SLOT( deleteIncidence() ) ); 851 mView, SLOT( deleteIncidence() ) );
854 852
855 853
856 mCloneAction = new QAction( "clone_incidence", i18n("Clone..."), 0, this ); 854 mCloneAction = new QAction( "clone_incidence", i18n("Clone..."), 0, this );
857 mCloneAction->addTo( mCurrentItemMenu ); 855 mCloneAction->addTo( mCurrentItemMenu );
858 connect( mCloneAction, SIGNAL( activated() ), 856 connect( mCloneAction, SIGNAL( activated() ),
859 mView, SLOT( cloneIncidence() ) ); 857 mView, SLOT( cloneIncidence() ) );
860 mMoveAction = new QAction( "Move_incidence", i18n("Move..."), 0, this ); 858 mMoveAction = new QAction( "Move_incidence", i18n("Move..."), 0, this );
861 mMoveAction->addTo( mCurrentItemMenu ); 859 mMoveAction->addTo( mCurrentItemMenu );
862 connect( mMoveAction, SIGNAL( activated() ), 860 connect( mMoveAction, SIGNAL( activated() ),
863 mView, SLOT( moveIncidence() ) ); 861 mView, SLOT( moveIncidence() ) );
864#ifndef DESKTOP_VERSION 862#ifndef DESKTOP_VERSION
865 mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this ); 863 mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this );
866 mBeamAction->addTo(mCurrentItemMenu ); 864 mBeamAction->addTo(mCurrentItemMenu );
867 connect( mBeamAction, SIGNAL( activated() ), 865 connect( mBeamAction, SIGNAL( activated() ),
868 mView, SLOT( beamIncidence() ) ); 866 mView, SLOT( beamIncidence() ) );
869#endif 867#endif
870 mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this ); 868 mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this );
871 mCancelAction->addTo( mCurrentItemMenu ); 869 mCancelAction->addTo( mCurrentItemMenu );
872 connect( mCancelAction, SIGNAL( activated() ), 870 connect( mCancelAction, SIGNAL( activated() ),
873 mView, SLOT( toggleCancelIncidence() ) ); 871 mView, SLOT( toggleCancelIncidence() ) );
874 872
875 873
876 mCurrentItemMenu->insertSeparator(); 874 mCurrentItemMenu->insertSeparator();
877 action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this ); 875 action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this );
878 action->addTo( mCurrentItemMenu ); 876 action->addTo( mCurrentItemMenu );
879 connect( action, SIGNAL( activated() ), 877 connect( action, SIGNAL( activated() ),
880 mView, SLOT( undo_delete() ) ); 878 mView, SLOT( undo_delete() ) );
881 879
882 // *********************** 880 // ***********************
883 if ( KOPrefs::instance()->mVerticalScreen ) { 881 if ( KOPrefs::instance()->mVerticalScreen ) {
884 icon = SmallIcon( "1updownarrow" ); 882 icon = SmallIcon( "1updownarrow" );
885 } else { 883 } else {
886 icon = SmallIcon("1leftrightarrow" ); 884 icon = SmallIcon("1leftrightarrow" );
887 } 885 }
888 configureToolBarMenu->insertItem(icon, i18n("Toggle Fullscreen"), 28 ); 886 configureToolBarMenu->insertItem(icon, i18n("Toggle Fullscreen"), 28 );
889 QAction* FSaction = new QAction( i18n("Toggle Fullscreen"), icon, i18n("Toggle Fullscreen"), 0, this ); 887 QAction* FSaction = new QAction( i18n("Toggle Fullscreen"), icon, i18n("Toggle Fullscreen"), 0, this );
890 FSaction->addTo( viewMenu ); 888 FSaction->addTo( viewMenu );
891 connect( FSaction, SIGNAL( activated() ), mView, SLOT( toggleExpand() )); 889 connect( FSaction, SIGNAL( activated() ), mView, SLOT( toggleExpand() ));
892 890
893 891
894 icon = loadPixmap( pathString + "filter" ); 892 icon = loadPixmap( pathString + "filter" );
895 configureToolBarMenu->insertItem(icon, i18n("Filter menu icon"), 26 ); 893 configureToolBarMenu->insertItem(icon, i18n("Filter menu icon"), 26 );
896 icon = loadPixmap( pathString + "configure" ); 894 icon = loadPixmap( pathString + "configure" );
897 action = new QAction( i18n("Toggle Resource View"), icon, i18n("Toggle Resource View"), 0, this ); 895 action = new QAction( i18n("Toggle Resource View"), icon, i18n("Toggle Resource View"), 0, this );
898 action->addTo( viewMenu ); 896 action->addTo( viewMenu );
899 connect( action, SIGNAL( activated() ), 897 connect( action, SIGNAL( activated() ),
900 mView, SLOT( toggleFilter() ) ); 898 mView, SLOT( toggleFilter() ) );
901 mToggleFilter = action; 899 mToggleFilter = action;
902 icon = loadPixmap( pathString + "navi" ); 900 icon = loadPixmap( pathString + "navi" );
903 configureToolBarMenu->insertItem(icon, i18n("Toggle DateNavigator"), 22 ); 901 configureToolBarMenu->insertItem(icon, i18n("Toggle DateNavigator"), 22 );
904 action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this ); 902 action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this );
905 action->addTo( viewMenu ); 903 action->addTo( viewMenu );
906 connect( action, SIGNAL( activated() ), 904 connect( action, SIGNAL( activated() ),
907 mView, SLOT( toggleDateNavigatorWidget() ) ); 905 mView, SLOT( toggleDateNavigatorWidget() ) );
908 mToggleNav = action ; 906 mToggleNav = action ;
909 icon = loadPixmap( pathString + "allday" ); 907 icon = loadPixmap( pathString + "allday" );
910 configureToolBarMenu->insertItem(icon, i18n("Toggle Allday"), 24 ); 908 configureToolBarMenu->insertItem(icon, i18n("Toggle Allday"), 24 );
911 action = new QAction( i18n("Toggle Allday"), icon,i18n("Toggle Allday"), 0, this ); 909 action = new QAction( i18n("Toggle Allday"), icon,i18n("Toggle Allday"), 0, this );
912 action->addTo( viewMenu ); 910 action->addTo( viewMenu );
diff --git a/korganizer/mainwindow.h b/korganizer/mainwindow.h
index d648f14..e2de3ba 100644
--- a/korganizer/mainwindow.h
+++ b/korganizer/mainwindow.h
@@ -1,174 +1,173 @@
1#ifndef KORGE_MAINWINDOW_H 1#ifndef KORGE_MAINWINDOW_H
2#define KORGE_MAINWINDOW_H 2#define KORGE_MAINWINDOW_H
3 3
4#include <qmainwindow.h> 4#include <qmainwindow.h>
5#include <qtimer.h> 5#include <qtimer.h>
6#include <qdict.h> 6#include <qdict.h>
7#include <qfile.h> 7#include <qfile.h>
8#include <qmenubar.h> 8#include <qmenubar.h>
9#include <qtextstream.h> 9#include <qtextstream.h>
10#include <qregexp.h> 10#include <qregexp.h>
11 11
12#include <libkcal/incidence.h> 12#include <libkcal/incidence.h>
13#include <ksyncmanager.h> 13#include <ksyncmanager.h>
14#include <kpopupmenu.h>
14#ifndef DESKTOP_VERSION 15#ifndef DESKTOP_VERSION
15#include <qcopchannel_qws.h> 16#include <qcopchannel_qws.h>
16#endif 17#endif
17class QAction; 18class QAction;
18class CalendarView; 19class CalendarView;
19class KSyncProfile; 20class KSyncProfile;
20#ifdef DESKTOP_VERSION 21#ifdef DESKTOP_VERSION
21 22
22#define QPEToolBar QToolBar 23#define QPEToolBar QToolBar
23#define QPEMenuBar QMenuBar
24#endif 24#endif
25class QPEToolBar; 25class QPEToolBar;
26class QPEMenuBar;
27 26
28 27
29namespace KCal { 28namespace KCal {
30class CalendarLocal; 29class CalendarLocal;
31} 30}
32 31
33using namespace KCal; 32using namespace KCal;
34 33
35class MainWindow : public QMainWindow 34class MainWindow : public QMainWindow
36{ 35{
37 Q_OBJECT 36 Q_OBJECT
38 public: 37 public:
39 MainWindow( QWidget *parent = 0, const char *name = 0 ); 38 MainWindow( QWidget *parent = 0, const char *name = 0 );
40 ~MainWindow(); 39 ~MainWindow();
41 bool beamReceiveEnabled(); 40 bool beamReceiveEnabled();
42 static QString defaultFileName(); 41 static QString defaultFileName();
43 static QString syncFileName(); 42 static QString syncFileName();
44 static QString resourcePath(); 43 static QString resourcePath();
45 public slots: 44 public slots:
46 void setUsesBigPixmaps ( bool ); 45 void setUsesBigPixmaps ( bool );
47 void setCaption ( const QString & ); 46 void setCaption ( const QString & );
48 void updateWeekNum(const KCal::DateList &); 47 void updateWeekNum(const KCal::DateList &);
49 void updateWeek(QDate); 48 void updateWeek(QDate);
50 void updateFilterToolbar(); 49 void updateFilterToolbar();
51 virtual void showMaximized (); 50 virtual void showMaximized ();
52 void configureAgenda( int ); 51 void configureAgenda( int );
53 void recieve( const QCString& msg, const QByteArray& data ); 52 void recieve( const QCString& msg, const QByteArray& data );
54 protected slots: 53 protected slots:
55 void calHint(); 54 void calHint();
56 void startMultiSync(); 55 void startMultiSync();
57 void setCaptionToDates(); 56 void setCaptionToDates();
58 void weekAction(); 57 void weekAction();
59 void about(); 58 void about();
60 void licence(); 59 void licence();
61 void faq(); 60 void faq();
62 void usertrans(); 61 void usertrans();
63 void features(); 62 void features();
64 void synchowto(); 63 void synchowto();
65 void storagehowto(); 64 void storagehowto();
66 void timetrackinghowto(); 65 void timetrackinghowto();
67 void kdesynchowto(); 66 void kdesynchowto();
68 void multisynchowto(); 67 void multisynchowto();
69 void whatsNew(); 68 void whatsNew();
70 void keyBindings(); 69 void keyBindings();
71 void aboutAutoSaving();; 70 void aboutAutoSaving();;
72 void aboutKnownBugs(); 71 void aboutKnownBugs();
73 72
74 void processIncidenceSelection( Incidence * ); 73 void processIncidenceSelection( Incidence * );
75 74
76 void importQtopia(); 75 void importQtopia();
77 void importBday(); 76 void importBday();
78 void importOL(); 77 void importOL();
79 void importIcal(); 78 void importIcal();
80 void importFile( QString, bool ); 79 void importFile( QString, bool );
81 void quickImportIcal(); 80 void quickImportIcal();
82 81
83 void slotModifiedChanged( bool ); 82 void slotModifiedChanged( bool );
84 83
85 void save(); 84 void save();
86 void backupAllFiles(); 85 void backupAllFiles();
87 void saveStopTimer(); 86 void saveStopTimer();
88 void configureToolBar( int ); 87 void configureToolBar( int );
89 void printSel(); 88 void printSel();
90 void printCal(); 89 void printCal();
91 void printListView(); 90 void printListView();
92 void saveCalendar(); 91 void saveCalendar();
93 void loadCalendar(); 92 void loadCalendar();
94 void exportVCalendar(); 93 void exportVCalendar();
95 void fillFilterMenu(); 94 void fillFilterMenu();
96 void fillFilterMenuTB(); 95 void fillFilterMenuTB();
97 void selectFilter( int ); 96 void selectFilter( int );
98 void fillFilterMenuPopup(); 97 void fillFilterMenuPopup();
99 void selectFilterPopup( int ); 98 void selectFilterPopup( int );
100 void exportToPhone( int ); 99 void exportToPhone( int );
101 void toggleBeamReceive(); 100 void toggleBeamReceive();
102 void disableBR(bool); 101 void disableBR(bool);
103 signals: 102 signals:
104 void selectWeek ( int ); 103 void selectWeek ( int );
105 private slots: 104 private slots:
106 void showConfigureAgenda(); 105 void showConfigureAgenda();
107 void getFile( bool ); 106 void getFile( bool );
108 void syncFileRequest(); 107 void syncFileRequest();
109 108
110 protected: 109 protected:
111 void hideEvent ( QHideEvent * ); 110 void hideEvent ( QHideEvent * );
112 QString sentSyncFile(); 111 QString sentSyncFile();
113 void displayText( QString, QString); 112 void displayText( QString, QString);
114 void enableIncidenceActions( bool ); 113 void enableIncidenceActions( bool );
115 114
116 private: 115 private:
117 bool mBRdisabled; 116 bool mBRdisabled;
118#ifndef DESKTOP_VERSION 117#ifndef DESKTOP_VERSION
119 QCopChannel* infrared; 118 QCopChannel* infrared;
120#endif 119#endif
121 QAction* brAction; 120 QAction* brAction;
122 KSyncManager* mSyncManager; 121 KSyncManager* mSyncManager;
123 bool mClosed; 122 bool mClosed;
124 void saveOnClose(); 123 void saveOnClose();
125 bool mFlagKeyPressed; 124 bool mFlagKeyPressed;
126 bool mBlockAtStartup; 125 bool mBlockAtStartup;
127 QPEToolBar *iconToolBar; 126 QPEToolBar *iconToolBar;
128 QPEToolBar *viewToolBar; 127 QPEToolBar *viewToolBar;
129 QPEToolBar *navigatorToolBar; 128 QPEToolBar *navigatorToolBar;
130 QPEToolBar *filterToolBar; 129 QPEToolBar *filterToolBar;
131 QMenuBar *filterMenubar; 130 KMenuBar *filterMenubar;
132 QPopupMenu * filterPopupMenu; 131 QPopupMenu * filterPopupMenu;
133 QPopupMenu * mCurrentItemMenu; 132 QPopupMenu * mCurrentItemMenu;
134 void initActions(); 133 void initActions();
135 void setDefaultPreferences(); 134 void setDefaultPreferences();
136 void resizeEvent( QResizeEvent* e); 135 void resizeEvent( QResizeEvent* e);
137 void keyPressEvent ( QKeyEvent * ) ; 136 void keyPressEvent ( QKeyEvent * ) ;
138 void keyReleaseEvent ( QKeyEvent * ) ; 137 void keyReleaseEvent ( QKeyEvent * ) ;
139 QPopupMenu *configureToolBarMenu; 138 QPopupMenu *configureToolBarMenu;
140 QPopupMenu *selectFilterMenu; 139 QPopupMenu *selectFilterMenu;
141 QPopupMenu *selectFilterMenuTB; 140 QPopupMenu *selectFilterMenuTB;
142 QPopupMenu *configureAgendaMenu, *syncMenu; 141 QPopupMenu *configureAgendaMenu, *syncMenu;
143 CalendarLocal *mCalendar; 142 CalendarLocal *mCalendar;
144 CalendarView *mView; 143 CalendarView *mView;
145 QAction *mNewSubTodoAction; 144 QAction *mNewSubTodoAction;
146 QAction *mWeekAction; 145 QAction *mWeekAction;
147 QFont mWeekFont; 146 QFont mWeekFont;
148 QPixmap mWeekPixmap; 147 QPixmap mWeekPixmap;
149 QColor mWeekBgColor; 148 QColor mWeekBgColor;
150 149
151 QAction *mShowAction; 150 QAction *mShowAction;
152 QAction *mEditAction; 151 QAction *mEditAction;
153 QAction *mDeleteAction; 152 QAction *mDeleteAction;
154 QAction *mCloneAction; 153 QAction *mCloneAction;
155 QAction *mMoveAction; 154 QAction *mMoveAction;
156 QAction *mBeamAction; 155 QAction *mBeamAction;
157 QAction *mCancelAction; 156 QAction *mCancelAction;
158 QAction *mPrintSelAction; 157 QAction *mPrintSelAction;
159 158
160 QAction *mToggleNav; 159 QAction *mToggleNav;
161 QAction *mToggleFilter; 160 QAction *mToggleFilter;
162 QAction *mToggleAllday; 161 QAction *mToggleAllday;
163 QAction *actionFilterMenuTB; 162 QAction *actionFilterMenuTB;
164 163
165 void closeEvent( QCloseEvent* ce ); 164 void closeEvent( QCloseEvent* ce );
166 QTimer mSaveTimer; 165 QTimer mSaveTimer;
167 //bool mBlockSaveFlag; 166 //bool mBlockSaveFlag;
168 bool mCalendarModifiedFlag; 167 bool mCalendarModifiedFlag;
169 QPixmap loadPixmap( QString ); 168 QPixmap loadPixmap( QString );
170 QPixmap listviewPix, listviewPix0, listviewPix20, listviewPix40, listviewPix60, listviewPix80, journalPix; 169 QPixmap listviewPix, listviewPix0, listviewPix20, listviewPix40, listviewPix60, listviewPix80, journalPix;
171}; 170};
172 171
173 172
174#endif 173#endif
diff --git a/microkde/kdeui/kbuttonbox.cpp b/microkde/kdeui/kbuttonbox.cpp
index 16206e8..83d622a 100644
--- a/microkde/kdeui/kbuttonbox.cpp
+++ b/microkde/kdeui/kbuttonbox.cpp
@@ -1,241 +1,241 @@
1/* This file is part of the KDE libraries 1/* This file is part of the KDE libraries
2 Copyright (C) 1997 Mario Weilguni (mweilguni@sime.com) 2 Copyright (C) 1997 Mario Weilguni (mweilguni@sime.com)
3 3
4 This library is free software; you can redistribute it and/or 4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public 5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either 6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version. 7 version 2 of the License, or (at your option) any later version.
8 8
9 This library is distributed in the hope that it will be useful, 9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of 10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details. 12 Library General Public License for more details.
13 13
14 You should have received a copy of the GNU Library General Public License 14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to 15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 16 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 Boston, MA 02111-1307, USA. 17 Boston, MA 02111-1307, USA.
18*/ 18*/
19 19
20/* 20/*
21 * KButtonBox class 21 * KButtonBox class
22 * 22 *
23 * A container widget for buttons. Uses Qt layout control to place the 23 * A container widget for buttons. Uses Qt layout control to place the
24 * buttons, can handle both vertical and horizontal button placement. 24 * buttons, can handle both vertical and horizontal button placement.
25* 25*
26 * HISTORY 26 * HISTORY
27 * 27 *
28 * 03/08/2000 Mario Weilguni <mweilguni@kde.org> 28 * 03/08/2000 Mario Weilguni <mweilguni@kde.org>
29 * Removed all those long outdated Motif stuff 29 * Removed all those long outdated Motif stuff
30 * Improved and clarified some if conditions (easier to understand) 30 * Improved and clarified some if conditions (easier to understand)
31 * 31 *
32 * 11/13/98 Reginald Stadlbauer <reggie@kde.org> 32 * 11/13/98 Reginald Stadlbauer <reggie@kde.org>
33 * Now in Qt 1.4x motif default buttons have no extra width/height anymore. 33 * Now in Qt 1.4x motif default buttons have no extra width/height anymore.
34 * So the KButtonBox doesn't add this width/height to default buttons anymore 34 * So the KButtonBox doesn't add this width/height to default buttons anymore
35 * which makes the buttons look better. 35 * which makes the buttons look better.
36 * 36 *
37 * 01/17/98 Mario Weilguni <mweilguni@sime.com> 37 * 01/17/98 Mario Weilguni <mweilguni@sime.com>
38 * Fixed a bug in sizeHint() 38 * Fixed a bug in sizeHint()
39 * Improved the handling of Motif default buttons 39 * Improved the handling of Motif default buttons
40 * 40 *
41 * 01/09/98 Mario Weilguni <mweilguni@sime.com> 41 * 01/09/98 Mario Weilguni <mweilguni@sime.com>
42 * The last button was to far right away from the right/bottom border. 42 * The last button was to far right away from the right/bottom border.
43 * Fixed this. Removed old code. Buttons get now a minimum width. 43 * Fixed this. Removed old code. Buttons get now a minimum width.
44 * Programmer may now override minimum width and height of a button. 44 * Programmer may now override minimum width and height of a button.
45 * 45 *
46 */ 46 */
47 47
48//US #include "kbuttonbox.moc" 48//US #include "kbuttonbox.moc"
49 49
50#include <kbuttonbox.h> 50#include <kbuttonbox.h>
51#include <qpushbutton.h> 51#include <qpushbutton.h>
52#include <qptrlist.h> 52#include <qptrlist.h>
53#include <assert.h> 53#include <assert.h>
54 54
55#define minButtonWidth 50 55#define minButtonWidth 50
56 56
57class KButtonBox::Item { 57class KButtonBox::Item {
58public: 58public:
59 QPushButton *button; 59 QPushButton *button;
60 bool noexpand; 60 bool noexpand;
61 unsigned short stretch; 61 unsigned short stretch;
62 unsigned short actual_size; 62 unsigned short actual_size;
63}; 63};
64 64
65template class QPtrList<KButtonBox::Item>; 65template class QPtrList<KButtonBox::Item>;
66 66
67class KButtonBoxPrivate { 67class KButtonBoxPrivate {
68public: 68public:
69 unsigned short border; 69 unsigned short border;
70 unsigned short autoborder; 70 unsigned short autoborder;
71 unsigned short orientation; 71 unsigned short orientation;
72 bool activated; 72 bool activated;
73 QPtrList<KButtonBox::Item> buttons; 73 QPtrList<KButtonBox::Item> buttons;
74}; 74};
75 75
76KButtonBox::KButtonBox(QWidget *parent, Orientation _orientation, 76KButtonBox::KButtonBox(QWidget *parent, Orientation _orientation,
77 int border, int autoborder) 77 int border, int autoborder)
78 : QWidget(parent) 78 : QWidget(parent)
79{ 79{
80 data = new KButtonBoxPrivate; 80 data = new KButtonBoxPrivate;
81 assert(data != 0); 81 assert(data != 0);
82 82
83 data->orientation = _orientation; 83 data->orientation = _orientation;
84 data->border = border; 84 data->border = border;
85 data->autoborder = autoborder < 0 ? border : autoborder; 85 data->autoborder = autoborder < 0 ? border : autoborder;
86 data->buttons.setAutoDelete(TRUE); 86 data->buttons.setAutoDelete(TRUE);
87} 87}
88 88
89KButtonBox::~KButtonBox() { 89KButtonBox::~KButtonBox() {
90 delete data; 90 delete data;
91} 91}
92 92
93QPushButton *KButtonBox::addButton(const QString& text, bool noexpand) { 93QPushButton *KButtonBox::addButton(const QString& text, bool noexpand) {
94 Item *item = new Item; 94 Item *item = new Item;
95 95
96 item->button = new QPushButton(text, this); 96 item->button = new QPushButton(text, this);
97 item->noexpand = noexpand; 97 item->noexpand = noexpand;
98 data->buttons.append(item); 98 data->buttons.append(item);
99 item->button->adjustSize(); 99 item->button->adjustSize();
100 100
101 return item->button; 101 return item->button;
102} 102}
103 103
104 QPushButton * 104 QPushButton *
105KButtonBox::addButton( 105KButtonBox::addButton(
106 const QString & text, 106 const QString & text,
107 QObject * receiver, 107 QObject * receiver,
108 const char * slot, 108 const char * slot,
109 bool noexpand 109 bool noexpand
110) 110)
111{ 111{
112 QPushButton * pb = addButton(text, noexpand); 112 QPushButton * pb = addButton(text, noexpand);
113 113
114 if ((0 != receiver) && (0 != slot)) 114 if ((0 != receiver) && (0 != slot))
115 QObject::connect(pb, SIGNAL(clicked()), receiver, slot); 115 QObject::connect(pb, SIGNAL(clicked()), receiver, slot);
116 116
117 return pb; 117 return pb;
118} 118}
119 119
120 120
121void KButtonBox::addStretch(int scale) { 121void KButtonBox::addStretch(int scale) {
122 if(scale > 0) { 122 if(scale > 0) {
123 Item *item = new Item; 123 Item *item = new Item;
124 item->button = 0; 124 item->button = 0;
125 item->noexpand = FALSE; 125 item->noexpand = FALSE;
126 item->stretch = scale; 126 item->stretch = scale;
127 data->buttons.append(item); 127 data->buttons.append(item);
128 } 128 }
129} 129}
130 130
131void KButtonBox::layout() { 131void KButtonBox::layout() {
132 // resize all buttons 132 // resize all buttons
133 QSize bs = bestButtonSize(); 133 QSize bs = bestButtonSize();
134 134
135 for(unsigned int i = 0; i < data->buttons.count(); i++) { 135 for(unsigned int i = 0; i < data->buttons.count(); i++) {
136 Item *item = data->buttons.at(i); 136 Item *item = data->buttons.at(i);
137 QPushButton *b = item->button; 137 QPushButton *b = item->button;
138 if(b != 0) { 138 if(b != 0) {
139 if(item->noexpand) 139 if(item->noexpand)
140 b->setFixedSize(buttonSizeHint(b)); 140 b->setFixedSize(buttonSizeHint(b));
141 else 141 else
142 b->setFixedSize(bs); 142 b->setFixedSize(bs);
143 } 143 }
144 } 144 }
145 145
146 setMinimumSize(sizeHint()); 146 setMinimumSize(sizeHint());
147} 147}
148 148
149void KButtonBox::placeButtons() { 149void KButtonBox::placeButtons() {
150 unsigned int i; 150 unsigned int i;
151 151
152 if(data->orientation == Horizontal) { 152 if(data->orientation == Horizontal) {
153 // calculate free size and stretches 153 // calculate free size and stretches
154 int fs = width() - 2 * data->border; 154 int fs = width() - 2 * data->border;
155 int stretch = 0; 155 int stretch = 0;
156 for(i = 0; i < data->buttons.count(); i++) { 156 for(i = 0; i < data->buttons.count(); i++) {
157 Item *item = data->buttons.at(i); 157 Item *item = data->buttons.at(i);
158 if(item->button != 0) { 158 if(item->button != 0) {
159 fs -= item->button->width(); 159 fs -= item->button->width();
160 160
161 // Last button? 161 // Last button?
162 if(i != data->buttons.count() - 1) 162 if(i != data->buttons.count() - 1)
163 fs -= data->autoborder; 163 fs -= data->autoborder;
164 } else 164 } else
165 stretch +=item->stretch; 165 stretch +=item->stretch;
166 } 166 }
167 167
168 // distribute buttons 168 // distribute buttons
169 int x_pos = data->border; 169 int x_pos = data->border;
170 for(i = 0; i < data->buttons.count(); i++) { 170 for(i = 0; i < data->buttons.count(); i++) {
171 Item *item = data->buttons.at(i); 171 Item *item = data->buttons.at(i);
172 if(item->button != 0) { 172 if(item->button != 0) {
173 QPushButton *b = item->button; 173 QPushButton *b = item->button;
174 b->move(x_pos, (height() - b->height()) / 2); 174 b->move(x_pos, (height() - b->height()) / 2);
175 175
176 x_pos += b->width() + data->autoborder; 176 x_pos += b->width() + data->autoborder;
177 } else 177 } else
178 x_pos += (int)((((double)fs) * item->stretch) / stretch); 178 x_pos += (int)((((double)fs) * item->stretch) / stretch);
179 } 179 }
180 } else { // VERTICAL 180 } else { // VERTICAL
181 // calcualte free size and stretches 181 // calcualte free size and stretches
182 int fs = height() - 2 * data->border; 182 int fs = height() - 2 * data->border;
183 int stretch = 0; 183 int stretch = 0;
184 for(i = 0; i < data->buttons.count(); i++) { 184 for(i = 0; i < data->buttons.count(); i++) {
185 Item *item = data->buttons.at(i); 185 Item *item = data->buttons.at(i);
186 if(item->button != 0) 186 if(item->button != 0)
187 fs -= item->button->height() + data->autoborder; 187 fs -= item->button->height() + data->autoborder;
188 else 188 else
189 stretch +=item->stretch; 189 stretch +=item->stretch;
190 } 190 }
191 191
192 // distribute buttons 192 // distribute buttons
193 int y_pos = data->border; 193 int y_pos = data->border;
194 for(i = 0; i < data->buttons.count(); i++) { 194 for(i = 0; i < data->buttons.count(); i++) {
195 Item *item = data->buttons.at(i); 195 Item *item = data->buttons.at(i);
196 if(item->button != 0) { 196 if(item->button != 0) {
197 QPushButton *b = item->button; 197 QPushButton *b = item->button;
198 b->move((width() - b->width()) / 2, y_pos); 198 b->move((width() - b->width()) / 2, y_pos);
199 199
200 y_pos += b->height() + data->autoborder; 200 y_pos += b->height() + data->autoborder;
201 } else 201 } else
202 y_pos += (int)((((double)fs) * item->stretch) / stretch); 202 y_pos += (int)((((double)fs) * item->stretch) / stretch);
203 } 203 }
204 } 204 }
205} 205}
206 206
207void KButtonBox::resizeEvent(QResizeEvent *) { 207void KButtonBox::resizeEvent(QResizeEvent *) {
208 placeButtons(); 208 placeButtons();
209} 209}
210 210
211QSize KButtonBox::bestButtonSize() const { 211QSize KButtonBox::bestButtonSize() const {
212 QSize s(0, 0); 212 QSize s(0, 0);
213 unsigned int i; 213 unsigned int i;
214 214
215 // calculate optimal size 215 // calculate optimal size
216 for(i = 0; i < data->buttons.count(); i++) { 216 for(i = 0; i < data->buttons.count(); i++) {
217 KButtonBox *that = (KButtonBox*)this; // to remove the const ;( 217 KButtonBox *that = (KButtonBox*)this; // to remove the const ;(
218 Item *item = that->data->buttons.at(i); 218 Item *item = that->data->buttons.at(i);
219 QPushButton *b = item->button; 219 QPushButton *b = item->button;
220 220
221 if(b != 0 && !item->noexpand) { 221 if(b != 0 && !item->noexpand) {
222 QSize bs = buttonSizeHint(b); 222 QSize bs = buttonSizeHint(b);
223 223
224 if(bs.width() > s.width()) 224 if(bs.width() > s.width())
225 s.setWidth(bs.width()); 225 s.setWidth(bs.width());
226 if(bs.height() > s.height()) 226 if(bs.height() > s.height())
227 s.setHeight(bs.height()); 227 s.setHeight(bs.height());
228 } 228 }
229 } 229 }
230 230
231 return s; 231 return s;
232} 232}
233 233
234QSize KButtonBox::sizeHint() const { 234QSize KButtonBox::sizeHint() const {
235 unsigned int i, dw; 235 unsigned int i, dw;
236 236
237 if(data->buttons.count() == 0) 237 if(data->buttons.count() == 0)
238 return QSize(0, 0); 238 return QSize(0, 0);
239 else { 239 else {
240 dw = 2 * data->border; 240 dw = 2 * data->border;
241 241
diff --git a/microkde/kdeui/kpopupmenu.cpp b/microkde/kdeui/kpopupmenu.cpp
new file mode 100644
index 0000000..96d2a87
--- a/dev/null
+++ b/microkde/kdeui/kpopupmenu.cpp
@@ -0,0 +1,19 @@
1
2#include <kpopupmenu.h>
3#include <qtimer.h>
4
5
6KPopupMenu::KPopupMenu ( QWidget * parent, const char * name )
7 : QPopupMenu ( parent, name ) {;}
8
9
10
11KMenuBar::KMenuBar ( QWidget * parent, const char * name )
12 : QPEMenuBar ( parent, name ) {}
13
14void KMenuBar::focusOutEvent ( QFocusEvent * e)
15{
16 QPEMenuBar::focusOutEvent( e );
17 QTimer::singleShot( 100, this, SIGNAL ( lostFocus() ) );
18
19}
diff --git a/microkde/kdeui/kpopupmenu.h b/microkde/kdeui/kpopupmenu.h
index 1352429..f16ce77 100644
--- a/microkde/kdeui/kpopupmenu.h
+++ b/microkde/kdeui/kpopupmenu.h
@@ -1,14 +1,32 @@
1#ifndef KPOPUPMENU_H 1#ifndef KPOPUPMENU_H
2#define KPOPUPMENU_H 2#define KPOPUPMENU_H
3 3
4#include <qpopupmenu.h> 4#include <qpopupmenu.h>
5#ifdef DESKTOP_VERSION
6#include <qmenubar.h>
7#define QPEMenuBar QMenubar
8#else
9#include <qpe/qpemenubar.h>
10#endif
5 11
6class KPopupMenu : public QPopupMenu 12class KPopupMenu : public QPopupMenu
7{ 13{
14Q_OBJECT
8 public: 15 public:
9 KPopupMenu ( QWidget * parent=0, const char * name=0 ) 16 KPopupMenu ( QWidget * parent=0, const char * name=0 );
10 : QPopupMenu ( parent, name ) {} 17
18};
11 19
20
21class KMenuBar : public QPEMenuBar
22{
23Q_OBJECT
24 public:
25 KMenuBar ( QWidget * parent=0, const char * name=0 );
26 signals:
27 void lostFocus();
28 protected:
29 void focusOutEvent ( QFocusEvent * e);
12}; 30};
13 31
14#endif 32#endif
diff --git a/microkde/microkde.pro b/microkde/microkde.pro
index 44e5f9d..7120bdd 100644
--- a/microkde/microkde.pro
+++ b/microkde/microkde.pro
@@ -1,178 +1,180 @@
1 TEMPLATE= lib 1 TEMPLATE= lib
2 CONFIG += qt warn_on 2 CONFIG += qt warn_on
3include( ../variables.pri ) 3include( ../variables.pri )
4#INCLUDEPATH += $(QTDIR)/include . 4#INCLUDEPATH += $(QTDIR)/include .
5#DEPENDPATH += $(QTDIR)/include 5#DEPENDPATH += $(QTDIR)/include
6INCLUDEPATH += . ../ ../kabc ./kdecore ./kdeui ./kio/kfile ./kio/kio 6INCLUDEPATH += . ../ ../kabc ./kdecore ./kdeui ./kio/kfile ./kio/kio
7#LIBS += -lqtcompat 7#LIBS += -lqtcompat
8 8
9 TARGET = microkde 9 TARGET = microkde
10DESTDIR= ../bin 10DESTDIR= ../bin
11DEFINES += DESKTOP_VERSION KDE_QT_ONLY 11DEFINES += DESKTOP_VERSION KDE_QT_ONLY
12unix : { 12unix : {
13staticlib: { 13staticlib: {
14INCLUDEPATH += ../kabc/plugins 14INCLUDEPATH += ../kabc/plugins
15DEFINES += STATIC_RESOURCES 15DEFINES += STATIC_RESOURCES
16} 16}
17 17
18 18
19OBJECTS_DIR = obj/unix 19OBJECTS_DIR = obj/unix
20MOC_DIR = moc/unix 20MOC_DIR = moc/unix
21} 21}
22win32: { 22win32: {
23DEFINES += _WIN32_ 23DEFINES += _WIN32_
24OBJECTS_DIR = obj/win 24OBJECTS_DIR = obj/win
25MOC_DIR = moc/win 25MOC_DIR = moc/win
26} 26}
27 27
28 28
29 29
30HEADERS = \ 30HEADERS = \
31qlayoutengine_p.h \ 31qlayoutengine_p.h \
32KDGanttMinimizeSplitter.h \ 32KDGanttMinimizeSplitter.h \
33 kapplication.h \ 33 kapplication.h \
34 kaudioplayer.h \ 34 kaudioplayer.h \
35 kcalendarsystem.h \ 35 kcalendarsystem.h \
36 kcalendarsystemgregorian.h \ 36 kcalendarsystemgregorian.h \
37 kcolorbutton.h \ 37 kcolorbutton.h \
38 kcombobox.h \ 38 kcombobox.h \
39 kconfig.h \ 39 kconfig.h \
40 kdatetbl.h \ 40 kdatetbl.h \
41 kdebug.h \ 41 kdebug.h \
42 kdialog.h \ 42 kdialog.h \
43 kdialogbase.h \ 43 kdialogbase.h \
44 keditlistbox.h \ 44 keditlistbox.h \
45 kemailsettings.h \ 45 kemailsettings.h \
46 kfiledialog.h \ 46 kfiledialog.h \
47 kfontdialog.h \ 47 kfontdialog.h \
48 kglobal.h \ 48 kglobal.h \
49 kglobalsettings.h \ 49 kglobalsettings.h \
50 kiconloader.h \ 50 kiconloader.h \
51 klineedit.h \ 51 klineedit.h \
52 klineeditdlg.h \ 52 klineeditdlg.h \
53 kmessagebox.h \ 53 kmessagebox.h \
54 knotifyclient.h \ 54 knotifyclient.h \
55 kprinter.h \ 55 kprinter.h \
56 kprocess.h \ 56 kprocess.h \
57 krestrictedline.h \ 57 krestrictedline.h \
58 krun.h \ 58 krun.h \
59 ksimpleconfig.h \ 59 ksimpleconfig.h \
60 kstaticdeleter.h \ 60 kstaticdeleter.h \
61 ksystemtray.h \ 61 ksystemtray.h \
62 ktempfile.h \ 62 ktempfile.h \
63 ktextedit.h \ 63 ktextedit.h \
64 kunload.h \ 64 kunload.h \
65 kurl.h \ 65 kurl.h \
66 kdeui/kguiitem.h \ 66 kdeui/kguiitem.h \
67 kdeui/kcmodule.h \ 67 kdeui/kcmodule.h \
68 kdeui/kbuttonbox.h \ 68 kdeui/kbuttonbox.h \
69 kdeui/klistbox.h \ 69 kdeui/klistbox.h \
70 kdeui/klistview.h \ 70 kdeui/klistview.h \
71 kdeui/kjanuswidget.h \ 71 kdeui/kjanuswidget.h \
72 kdeui/kseparator.h \ 72 kdeui/kseparator.h \
73 kdeui/knuminput.h \ 73 kdeui/knuminput.h \
74 kdeui/knumvalidator.h \ 74 kdeui/knumvalidator.h \
75 kdeui/ksqueezedtextlabel.h \ 75 kdeui/ksqueezedtextlabel.h \
76 kio/job.h \ 76 kio/job.h \
77 kio/kio/kdirwatch.h \ 77 kio/kio/kdirwatch.h \
78 kio/kio/kdirwatch_p.h \ 78 kio/kio/kdirwatch_p.h \
79 kio/kfile/kurlrequester.h \ 79 kio/kfile/kurlrequester.h \
80 kresources/resource.h \ 80 kresources/resource.h \
81 kresources/factory.h \ 81 kresources/factory.h \
82 kresources/managerimpl.h \ 82 kresources/managerimpl.h \
83 kresources/manager.h \ 83 kresources/manager.h \
84 kresources/selectdialog.h \ 84 kresources/selectdialog.h \
85 kresources/configpage.h \ 85 kresources/configpage.h \
86 kresources/configwidget.h \ 86 kresources/configwidget.h \
87 kresources/configdialog.h \ 87 kresources/configdialog.h \
88 kresources/kcmkresources.h \ 88 kresources/kcmkresources.h \
89 kdecore/kmdcodec.h \ 89 kdecore/kmdcodec.h \
90 kdecore/kconfigbase.h \ 90 kdecore/kconfigbase.h \
91 kdecore/klocale.h \ 91 kdecore/klocale.h \
92 kdecore/kcatalogue.h \ 92 kdecore/kcatalogue.h \
93 kdecore/ksharedptr.h \ 93 kdecore/ksharedptr.h \
94 kdecore/kshell.h \ 94 kdecore/kshell.h \
95 kdecore/kstandarddirs.h \ 95 kdecore/kstandarddirs.h \
96 kdecore/kstringhandler.h \ 96 kdecore/kstringhandler.h \
97 kdecore/kshortcut.h \ 97 kdecore/kshortcut.h \
98 kutils/kcmultidialog.h \ 98 kutils/kcmultidialog.h \
99 kdeui/kxmlguiclient.h \ 99 kdeui/kxmlguiclient.h \
100 kdeui/kstdaction.h \ 100 kdeui/kstdaction.h \
101 kdeui/kmainwindow.h \ 101 kdeui/kmainwindow.h \
102 kdeui/ktoolbar.h \ 102 kdeui/ktoolbar.h \
103 kdeui/ktoolbarbutton.h \ 103 kdeui/ktoolbarbutton.h \
104 kdeui/ktoolbarhandler.h \ 104 kdeui/ktoolbarhandler.h \
105 kdeui/kaction.h \ 105 kdeui/kaction.h \
106 kdeui/kpopupmenu.h \
106 kdeui/kactionclasses.h \ 107 kdeui/kactionclasses.h \
107 kdeui/kactioncollection.h \ 108 kdeui/kactioncollection.h \
108 kdecore/kprefs.h \ 109 kdecore/kprefs.h \
109 kdecore/klibloader.h \ 110 kdecore/klibloader.h \
110 kidmanager.h 111 kidmanager.h
111 112
112 113
113# kdecore/klibloader.h \ 114# kdecore/klibloader.h \
114 115
115 116
116SOURCES = \ 117SOURCES = \
117KDGanttMinimizeSplitter.cpp \ 118KDGanttMinimizeSplitter.cpp \
118 kapplication.cpp \ 119 kapplication.cpp \
119 kcalendarsystem.cpp \ 120 kcalendarsystem.cpp \
120 kcalendarsystemgregorian.cpp \ 121 kcalendarsystemgregorian.cpp \
121 kcolorbutton.cpp \ 122 kcolorbutton.cpp \
122 kconfig.cpp \ 123 kconfig.cpp \
123 kdatetbl.cpp \ 124 kdatetbl.cpp \
124 kdialog.cpp \ 125 kdialog.cpp \
125 kdialogbase.cpp \ 126 kdialogbase.cpp \
126 keditlistbox.cpp \ 127 keditlistbox.cpp \
127 kemailsettings.cpp \ 128 kemailsettings.cpp \
128 kfontdialog.cpp \ 129 kfontdialog.cpp \
129 kfiledialog.cpp \ 130 kfiledialog.cpp \
130 kglobal.cpp \ 131 kglobal.cpp \
131 kglobalsettings.cpp \ 132 kglobalsettings.cpp \
132 kiconloader.cpp \ 133 kiconloader.cpp \
133 kmessagebox.cpp \ 134 kmessagebox.cpp \
134 ktextedit.cpp \ 135 ktextedit.cpp \
135 kprocess.cpp \ 136 kprocess.cpp \
136 krun.cpp \ 137 krun.cpp \
137 ksystemtray.cpp \ 138 ksystemtray.cpp \
138 ktempfile.cpp \ 139 ktempfile.cpp \
139 kurl.cpp \ 140 kurl.cpp \
140 kdecore/kcatalogue.cpp \ 141 kdecore/kcatalogue.cpp \
141 kdecore/klocale.cpp \ 142 kdecore/klocale.cpp \
142 kdecore/kmdcodec.cpp \ 143 kdecore/kmdcodec.cpp \
143 kdecore/kshell.cpp \ 144 kdecore/kshell.cpp \
144 kdecore/kstandarddirs.cpp \ 145 kdecore/kstandarddirs.cpp \
145 kdecore/kstringhandler.cpp \ 146 kdecore/kstringhandler.cpp \
146 kdeui/kbuttonbox.cpp \ 147 kdeui/kbuttonbox.cpp \
147 kdeui/kcmodule.cpp \ 148 kdeui/kcmodule.cpp \
148 kdeui/kguiitem.cpp \ 149 kdeui/kguiitem.cpp \
149 kdeui/kjanuswidget.cpp \ 150 kdeui/kjanuswidget.cpp \
150 kdeui/klistbox.cpp \ 151 kdeui/klistbox.cpp \
151 kdeui/klistview.cpp \ 152 kdeui/klistview.cpp \
152 kdeui/knuminput.cpp \ 153 kdeui/knuminput.cpp \
153 kdeui/knumvalidator.cpp \ 154 kdeui/knumvalidator.cpp \
154 kdeui/kseparator.cpp \ 155 kdeui/kseparator.cpp \
155 kdeui/ksqueezedtextlabel.cpp \ 156 kdeui/ksqueezedtextlabel.cpp \
156 kio/kio/kdirwatch.cpp \ 157 kio/kio/kdirwatch.cpp \
157 kio/kfile/kurlrequester.cpp \ 158 kio/kfile/kurlrequester.cpp \
158 kresources/configpage.cpp \ 159 kresources/configpage.cpp \
159 kresources/configdialog.cpp \ 160 kresources/configdialog.cpp \
160 kresources/configwidget.cpp \ 161 kresources/configwidget.cpp \
161 kresources/factory.cpp \ 162 kresources/factory.cpp \
162 kresources/kcmkresources.cpp \ 163 kresources/kcmkresources.cpp \
163 kresources/managerimpl.cpp \ 164 kresources/managerimpl.cpp \
164 kresources/resource.cpp \ 165 kresources/resource.cpp \
165 kresources/selectdialog.cpp \ 166 kresources/selectdialog.cpp \
166 kutils/kcmultidialog.cpp \ 167 kutils/kcmultidialog.cpp \
167 kdeui/kaction.cpp \ 168 kdeui/kaction.cpp \
169 kdeui/kpopupmenu.cpp \
168 kdeui/kactionclasses.cpp \ 170 kdeui/kactionclasses.cpp \
169 kdeui/kactioncollection.cpp \ 171 kdeui/kactioncollection.cpp \
170 kdeui/kmainwindow.cpp \ 172 kdeui/kmainwindow.cpp \
171 kdeui/ktoolbar.cpp \ 173 kdeui/ktoolbar.cpp \
172 kdeui/ktoolbarbutton.cpp \ 174 kdeui/ktoolbarbutton.cpp \
173 kdeui/ktoolbarhandler.cpp \ 175 kdeui/ktoolbarhandler.cpp \
174 kdeui/kstdaction.cpp \ 176 kdeui/kstdaction.cpp \
175 kdeui/kxmlguiclient.cpp \ 177 kdeui/kxmlguiclient.cpp \
176 kdecore/kprefs.cpp \ 178 kdecore/kprefs.cpp \
177 kdecore/klibloader.cpp \ 179 kdecore/klibloader.cpp \
178 kidmanager.cpp 180 kidmanager.cpp
diff --git a/microkde/microkdeE.pro b/microkde/microkdeE.pro
index 335fcd0..8fe2bd5 100644
--- a/microkde/microkdeE.pro
+++ b/microkde/microkdeE.pro
@@ -1,172 +1,174 @@
1 TEMPLATE= lib 1 TEMPLATE= lib
2CONFIG += qt warn_on 2CONFIG += qt warn_on
3INCLUDEPATH += . .. $(KDEPIMDIR)/qtcompat $(KDEPIMDIR)/kabc kdecore kdeui kio/kfile kio/kio $(QPEDIR)/include 3INCLUDEPATH += . .. $(KDEPIMDIR)/qtcompat $(KDEPIMDIR)/kabc kdecore kdeui kio/kfile kio/kio $(QPEDIR)/include
4 4
5DEPENDPATH += $(QPEDIR)/include 5DEPENDPATH += $(QPEDIR)/include
6LIBS += -lmicroqtcompat -L$(QPEDIR)/lib 6LIBS += -lmicroqtcompat -L$(QPEDIR)/lib
7 7
8DEFINES += KDE_QT_ONLY 8DEFINES += KDE_QT_ONLY
9 9
10 TARGET = microkde 10 TARGET = microkde
11OBJECTS_DIR = obj/$(PLATFORM) 11OBJECTS_DIR = obj/$(PLATFORM)
12MOC_DIR = moc/$(PLATFORM) 12MOC_DIR = moc/$(PLATFORM)
13DESTDIR=$(QPEDIR)/lib 13DESTDIR=$(QPEDIR)/lib
14 14
15 15
16INTERFACES = \ 16INTERFACES = \
17 17
18HEADERS = \ 18HEADERS = \
19qlayoutengine_p.h fncolordialog.h\ 19qlayoutengine_p.h fncolordialog.h\
20KDGanttMinimizeSplitter.h \ 20KDGanttMinimizeSplitter.h \
21 kapplication.h \ 21 kapplication.h \
22 kaudioplayer.h \ 22 kaudioplayer.h \
23 kcalendarsystem.h \ 23 kcalendarsystem.h \
24 kcalendarsystemgregorian.h \ 24 kcalendarsystemgregorian.h \
25 kcolorbutton.h \ 25 kcolorbutton.h \
26 kcolordialog.h \ 26 kcolordialog.h \
27 kcombobox.h \ 27 kcombobox.h \
28 kconfig.h \ 28 kconfig.h \
29 kdatetbl.h \ 29 kdatetbl.h \
30 kdebug.h \ 30 kdebug.h \
31 kdialog.h \ 31 kdialog.h \
32 kdialogbase.h \ 32 kdialogbase.h \
33 keditlistbox.h \ 33 keditlistbox.h \
34 kemailsettings.h \ 34 kemailsettings.h \
35 kfiledialog.h \ 35 kfiledialog.h \
36 kfontdialog.h \ 36 kfontdialog.h \
37 kglobal.h \ 37 kglobal.h \
38 kglobalsettings.h \ 38 kglobalsettings.h \
39 kiconloader.h \ 39 kiconloader.h \
40 klineedit.h \ 40 klineedit.h \
41 klineeditdlg.h \ 41 klineeditdlg.h \
42 kmessagebox.h \ 42 kmessagebox.h \
43 knotifyclient.h \ 43 knotifyclient.h \
44 kprinter.h \ 44 kprinter.h \
45 kprocess.h \ 45 kprocess.h \
46 krestrictedline.h \ 46 krestrictedline.h \
47 krun.h \ 47 krun.h \
48 ksimpleconfig.h \ 48 ksimpleconfig.h \
49 kstaticdeleter.h \ 49 kstaticdeleter.h \
50 ksystemtray.h \ 50 ksystemtray.h \
51 ktempfile.h \ 51 ktempfile.h \
52 ktextedit.h \ 52 ktextedit.h \
53 kunload.h \ 53 kunload.h \
54 kurl.h \ 54 kurl.h \
55 ofileselector_p.h \ 55 ofileselector_p.h \
56 ofontselector.h \ 56 ofontselector.h \
57 kdeui/kguiitem.h \ 57 kdeui/kguiitem.h \
58 kdeui/kaction.h \ 58 kdeui/kaction.h \
59 kdeui/kpopupmenu.h \
59 kdeui/kactionclasses.h \ 60 kdeui/kactionclasses.h \
60 kdeui/kactioncollection.h \ 61 kdeui/kactioncollection.h \
61 kdeui/kcmodule.h \ 62 kdeui/kcmodule.h \
62 kdeui/kstdaction.h \ 63 kdeui/kstdaction.h \
63 kdeui/kbuttonbox.h \ 64 kdeui/kbuttonbox.h \
64 kdeui/klistbox.h \ 65 kdeui/klistbox.h \
65 kdeui/klistview.h \ 66 kdeui/klistview.h \
66 kdeui/kjanuswidget.h \ 67 kdeui/kjanuswidget.h \
67 kdeui/kseparator.h \ 68 kdeui/kseparator.h \
68 kdeui/kmainwindow.h \ 69 kdeui/kmainwindow.h \
69 kdeui/knuminput.h \ 70 kdeui/knuminput.h \
70 kdeui/knumvalidator.h \ 71 kdeui/knumvalidator.h \
71 kdeui/ksqueezedtextlabel.h \ 72 kdeui/ksqueezedtextlabel.h \
72 kdeui/ktoolbar.h \ 73 kdeui/ktoolbar.h \
73 kdeui/ktoolbarbutton.h \ 74 kdeui/ktoolbarbutton.h \
74 kdeui/ktoolbarhandler.h \ 75 kdeui/ktoolbarhandler.h \
75 kdeui/kxmlguiclient.h \ 76 kdeui/kxmlguiclient.h \
76 kio/job.h \ 77 kio/job.h \
77 kio/kio/kdirwatch.h \ 78 kio/kio/kdirwatch.h \
78 kio/kio/kdirwatch_p.h \ 79 kio/kio/kdirwatch_p.h \
79 kio/kfile/kurlrequester.h \ 80 kio/kfile/kurlrequester.h \
80 kresources/resource.h \ 81 kresources/resource.h \
81 kresources/factory.h \ 82 kresources/factory.h \
82 kresources/managerimpl.h \ 83 kresources/managerimpl.h \
83 kresources/manager.h \ 84 kresources/manager.h \
84 kresources/selectdialog.h \ 85 kresources/selectdialog.h \
85 kresources/configpage.h \ 86 kresources/configpage.h \
86 kresources/configwidget.h \ 87 kresources/configwidget.h \
87 kresources/configdialog.h \ 88 kresources/configdialog.h \
88 kresources/kcmkresources.h \ 89 kresources/kcmkresources.h \
89 kdecore/kmdcodec.h \ 90 kdecore/kmdcodec.h \
90 kdecore/kconfigbase.h \ 91 kdecore/kconfigbase.h \
91 kdecore/klocale.h \ 92 kdecore/klocale.h \
92 kdecore/klibloader.h \ 93 kdecore/klibloader.h \
93 kdecore/kcatalogue.h \ 94 kdecore/kcatalogue.h \
94 kdecore/kprefs.h \ 95 kdecore/kprefs.h \
95 kdecore/ksharedptr.h \ 96 kdecore/ksharedptr.h \
96 kdecore/kshell.h \ 97 kdecore/kshell.h \
97 kdecore/kstandarddirs.h \ 98 kdecore/kstandarddirs.h \
98 kdecore/kstringhandler.h \ 99 kdecore/kstringhandler.h \
99 kdecore/kshortcut.h \ 100 kdecore/kshortcut.h \
100 kutils/kcmultidialog.h \ 101 kutils/kcmultidialog.h \
101 kidmanager.h 102 kidmanager.h
102 103
103 104
104 105
105 106
106SOURCES = \ 107SOURCES = \
107KDGanttMinimizeSplitter.cpp fncolordialog.cpp \ 108KDGanttMinimizeSplitter.cpp fncolordialog.cpp \
108 kapplication.cpp \ 109 kapplication.cpp \
109 kcalendarsystem.cpp \ 110 kcalendarsystem.cpp \
110 kcalendarsystemgregorian.cpp \ 111 kcalendarsystemgregorian.cpp \
111 kcolorbutton.cpp \ 112 kcolorbutton.cpp \
112 kcolordialog.cpp \ 113 kcolordialog.cpp \
113 kconfig.cpp \ 114 kconfig.cpp \
114 kdatetbl.cpp \ 115 kdatetbl.cpp \
115 kdialog.cpp \ 116 kdialog.cpp \
116 kdialogbase.cpp \ 117 kdialogbase.cpp \
117 keditlistbox.cpp \ 118 keditlistbox.cpp \
118 kemailsettings.cpp \ 119 kemailsettings.cpp \
119 kfontdialog.cpp \ 120 kfontdialog.cpp \
120 kfiledialog.cpp \ 121 kfiledialog.cpp \
121 kglobal.cpp \ 122 kglobal.cpp \
122 kglobalsettings.cpp \ 123 kglobalsettings.cpp \
123 kiconloader.cpp \ 124 kiconloader.cpp \
124 kmessagebox.cpp \ 125 kmessagebox.cpp \
125 kprocess.cpp \ 126 kprocess.cpp \
126 krun.cpp \ 127 krun.cpp \
127 ksystemtray.cpp \ 128 ksystemtray.cpp \
128 ktempfile.cpp \ 129 ktempfile.cpp \
129 kurl.cpp \ 130 kurl.cpp \
130 ktextedit.cpp \ 131 ktextedit.cpp \
131 ofileselector_p.cpp \ 132 ofileselector_p.cpp \
132 ofontselector.cpp \ 133 ofontselector.cpp \
133 kdecore/kcatalogue.cpp \ 134 kdecore/kcatalogue.cpp \
134 kdecore/klibloader.cpp \ 135 kdecore/klibloader.cpp \
135 kdecore/klocale.cpp \ 136 kdecore/klocale.cpp \
136 kdecore/kmdcodec.cpp \ 137 kdecore/kmdcodec.cpp \
137 kdecore/kprefs.cpp \ 138 kdecore/kprefs.cpp \
138 kdecore/kshell.cpp \ 139 kdecore/kshell.cpp \
139 kdecore/kstandarddirs.cpp \ 140 kdecore/kstandarddirs.cpp \
140 kdecore/kstringhandler.cpp \ 141 kdecore/kstringhandler.cpp \
141 kdeui/kaction.cpp \ 142 kdeui/kaction.cpp \
143 kdeui/kpopupmenu.cpp \
142 kdeui/kactionclasses.cpp \ 144 kdeui/kactionclasses.cpp \
143 kdeui/kactioncollection.cpp \ 145 kdeui/kactioncollection.cpp \
144 kdeui/kbuttonbox.cpp \ 146 kdeui/kbuttonbox.cpp \
145 kdeui/kcmodule.cpp \ 147 kdeui/kcmodule.cpp \
146 kdeui/kguiitem.cpp \ 148 kdeui/kguiitem.cpp \
147 kdeui/kjanuswidget.cpp \ 149 kdeui/kjanuswidget.cpp \
148 kdeui/klistbox.cpp \ 150 kdeui/klistbox.cpp \
149 kdeui/klistview.cpp \ 151 kdeui/klistview.cpp \
150 kdeui/kmainwindow.cpp \ 152 kdeui/kmainwindow.cpp \
151 kdeui/knuminput.cpp \ 153 kdeui/knuminput.cpp \
152 kdeui/knumvalidator.cpp \ 154 kdeui/knumvalidator.cpp \
153 kdeui/kseparator.cpp \ 155 kdeui/kseparator.cpp \
154 kdeui/kstdaction.cpp \ 156 kdeui/kstdaction.cpp \
155 kdeui/ksqueezedtextlabel.cpp \ 157 kdeui/ksqueezedtextlabel.cpp \
156 kdeui/ktoolbar.cpp \ 158 kdeui/ktoolbar.cpp \
157 kdeui/ktoolbarbutton.cpp \ 159 kdeui/ktoolbarbutton.cpp \
158 kdeui/ktoolbarhandler.cpp \ 160 kdeui/ktoolbarhandler.cpp \
159 kdeui/kxmlguiclient.cpp \ 161 kdeui/kxmlguiclient.cpp \
160 kio/kfile/kurlrequester.cpp \ 162 kio/kfile/kurlrequester.cpp \
161 kio/kio/kdirwatch.cpp \ 163 kio/kio/kdirwatch.cpp \
162 kresources/configpage.cpp \ 164 kresources/configpage.cpp \
163 kresources/configdialog.cpp \ 165 kresources/configdialog.cpp \
164 kresources/configwidget.cpp \ 166 kresources/configwidget.cpp \
165 kresources/factory.cpp \ 167 kresources/factory.cpp \
166 kresources/kcmkresources.cpp \ 168 kresources/kcmkresources.cpp \
167 kresources/managerimpl.cpp \ 169 kresources/managerimpl.cpp \
168 kresources/resource.cpp \ 170 kresources/resource.cpp \
169 kresources/selectdialog.cpp \ 171 kresources/selectdialog.cpp \
170 kutils/kcmultidialog.cpp \ 172 kutils/kcmultidialog.cpp \
171 kidmanager.cpp 173 kidmanager.cpp
172 174