author | zautrix <zautrix> | 2005-07-10 10:17:55 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-07-10 10:17:55 (UTC) |
commit | 58b7818a74809dc9280a3249eeb7e0195a66f93d (patch) (unidiff) | |
tree | 04b04b867647a8c48d59e7a0fa89df6430039599 /korganizer | |
parent | e8b6635ef7c98996f0415e6a77394569493ab151 (diff) | |
download | kdepimpi-58b7818a74809dc9280a3249eeb7e0195a66f93d.zip kdepimpi-58b7818a74809dc9280a3249eeb7e0195a66f93d.tar.gz kdepimpi-58b7818a74809dc9280a3249eeb7e0195a66f93d.tar.bz2 |
fixx
-rw-r--r-- | korganizer/calendarview.cpp | 7 | ||||
-rw-r--r-- | korganizer/calendarview.h | 3 | ||||
-rw-r--r-- | korganizer/koagenda.cpp | 5 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 12 | ||||
-rw-r--r-- | korganizer/mainwindow.h | 5 |
5 files changed, 20 insertions, 12 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 5a2482e..17f1659 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -562,192 +562,199 @@ void CalendarView::init() | |||
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 | ||
647 | CalendarView::~CalendarView() | 647 | CalendarView::~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 | |||
659 | void CalendarView::slotResetFocus() | ||
660 | { | ||
661 | qDebug(" CalendarView::slotResetFocus() %x", qApp->focusWidget()); | ||
662 | |||
663 | } | ||
664 | |||
658 | void CalendarView::nextConflict( bool all, bool allday ) | 665 | void 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 | ||
732 | void CalendarView::conflictAll() | 739 | void CalendarView::conflictAll() |
733 | { | 740 | { |
734 | nextConflict ( true, true ); | 741 | nextConflict ( true, true ); |
735 | } | 742 | } |
736 | void CalendarView::conflictAllday() | 743 | void CalendarView::conflictAllday() |
737 | { | 744 | { |
738 | nextConflict ( false, true ); | 745 | nextConflict ( false, true ); |
739 | } | 746 | } |
740 | void CalendarView::conflictNotAll() | 747 | void CalendarView::conflictNotAll() |
741 | { | 748 | { |
742 | nextConflict ( false, false ); | 749 | nextConflict ( false, false ); |
743 | } | 750 | } |
744 | 751 | ||
745 | void CalendarView::setCalReadOnly( int id, bool readO ) | 752 | void 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 | } |
752 | void CalendarView::setScrollBarStep(int val ) | 759 | void CalendarView::setScrollBarStep(int val ) |
753 | { | 760 | { |
diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h index 799c297..456c2d7 100644 --- a/korganizer/calendarview.h +++ b/korganizer/calendarview.h | |||
@@ -107,193 +107,194 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser | |||
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 ¬i ); | 218 | void addAlarm(const QDateTime &qdt, const QString ¬i ); |
218 | void addSuspendAlarm(const QDateTime &qdt, const QString ¬i ); | 219 | void addSuspendAlarm(const QDateTime &qdt, const QString ¬i ); |
219 | void removeAlarm(const QDateTime &qdt, const QString ¬i ); | 220 | void removeAlarm(const QDateTime &qdt, const QString ¬i ); |
220 | 221 | ||
221 | /** options dialog made a changed to the configuration. we catch this | 222 | /** options dialog made a changed to the configuration. we catch this |
222 | * and notify all widgets which need to update their configuration. */ | 223 | * and notify all widgets which need to update their configuration. */ |
223 | void updateConfig(); | 224 | void updateConfig(); |
224 | 225 | ||
225 | void insertBirthdays(const QString& uid, const QStringList& birthdayList, | 226 | void insertBirthdays(const QString& uid, const QStringList& birthdayList, |
226 | const QStringList& anniversaryList, const QStringList& realNameList, | 227 | const QStringList& anniversaryList, const QStringList& realNameList, |
227 | const QStringList& emailList, const QStringList& assembledNameList, | 228 | const QStringList& emailList, const QStringList& assembledNameList, |
228 | const QStringList& uidList); | 229 | const QStringList& uidList); |
229 | 230 | ||
230 | /** | 231 | /** |
231 | Load calendar from file \a filename. If \a merge is true, load | 232 | Load calendar from file \a filename. If \a merge is true, load |
232 | calendar into existing one, if it is false, clear calendar, before | 233 | calendar into existing one, if it is false, clear calendar, before |
233 | loading. Return true, if calendar could be successfully loaded. | 234 | loading. Return true, if calendar could be successfully loaded. |
234 | */ | 235 | */ |
235 | bool openCalendar(QString filename, bool merge=false); | 236 | bool openCalendar(QString filename, bool merge=false); |
236 | bool loadCalendars(); | 237 | bool loadCalendars(); |
237 | bool saveCalendars(); | 238 | bool saveCalendars(); |
238 | bool restoreCalendarSettings(); | 239 | bool restoreCalendarSettings(); |
239 | bool addCalendar( KopiCalendarFile * ); | 240 | bool addCalendar( KopiCalendarFile * ); |
240 | void addCalendarId( int id ); | 241 | void addCalendarId( int id ); |
241 | bool syncCalendar(QString filename,int mode = 0 ); | 242 | bool syncCalendar(QString filename,int mode = 0 ); |
242 | 243 | ||
243 | /** | 244 | /** |
244 | Save calendar data to file. Return true if calendar could be | 245 | Save calendar data to file. Return true if calendar could be |
245 | successfully saved. | 246 | successfully saved. |
246 | */ | 247 | */ |
247 | bool saveCalendar(QString filename); | 248 | bool saveCalendar(QString filename); |
248 | 249 | ||
249 | /** | 250 | /** |
250 | Close calendar. Clear calendar data and reset views to display an empty | 251 | Close calendar. Clear calendar data and reset views to display an empty |
251 | calendar. | 252 | calendar. |
252 | */ | 253 | */ |
253 | void closeCalendar(); | 254 | void closeCalendar(); |
254 | 255 | ||
255 | /** Archive old events of calendar */ | 256 | /** Archive old events of calendar */ |
256 | void archiveCalendar(); | 257 | void archiveCalendar(); |
257 | 258 | ||
258 | void showIncidence(); | 259 | void showIncidence(); |
259 | void editIncidence(); | 260 | void editIncidence(); |
260 | void editIncidenceDescription(); | 261 | void editIncidenceDescription(); |
261 | void deleteIncidence(); | 262 | void deleteIncidence(); |
262 | void cloneIncidence(); | 263 | void cloneIncidence(); |
263 | void moveIncidence(); | 264 | void moveIncidence(); |
264 | void beamIncidence(); | 265 | void beamIncidence(); |
265 | void toggleCancelIncidence(); | 266 | void toggleCancelIncidence(); |
266 | 267 | ||
267 | /** create an editeventwin with supplied date/time, and if bool is true, | 268 | /** create an editeventwin with supplied date/time, and if bool is true, |
268 | * make the event take all day. */ | 269 | * make the event take all day. */ |
269 | void newEvent(QDateTime, QDateTime, bool allDay ); | 270 | void newEvent(QDateTime, QDateTime, bool allDay ); |
270 | void newEvent(QDateTime, QDateTime); | 271 | void newEvent(QDateTime, QDateTime); |
271 | void newEvent(QDateTime fh); | 272 | void newEvent(QDateTime fh); |
272 | void newEvent(QDate dt); | 273 | void newEvent(QDate dt); |
273 | /** create new event without having a date hint. Takes current date as | 274 | /** create new event without having a date hint. Takes current date as |
274 | default hint. */ | 275 | default hint. */ |
275 | void newEvent(); | 276 | void newEvent(); |
276 | void newFloatingEvent(); | 277 | void newFloatingEvent(); |
277 | 278 | ||
278 | /** Create a read-only viewer dialog for the supplied incidence. It calls the correct showXXX method*/ | 279 | /** Create a read-only viewer dialog for the supplied incidence. It calls the correct showXXX method*/ |
279 | void showIncidence(Incidence *); | 280 | void showIncidence(Incidence *); |
280 | void showIncidence(QString uid); | 281 | void showIncidence(QString uid); |
281 | /** Create an editor for the supplied incidence. It calls the correct editXXX method*/ | 282 | /** Create an editor for the supplied incidence. It calls the correct editXXX method*/ |
282 | void editIncidence(Incidence *); | 283 | void editIncidence(Incidence *); |
283 | /** Delete the supplied incidence. It calls the correct deleteXXX method*/ | 284 | /** Delete the supplied incidence. It calls the correct deleteXXX method*/ |
284 | void deleteIncidence(Incidence *); | 285 | void deleteIncidence(Incidence *); |
285 | void cloneIncidence(Incidence *); | 286 | void cloneIncidence(Incidence *); |
286 | void cancelIncidence(Incidence *); | 287 | void cancelIncidence(Incidence *); |
287 | /** Create an editor for the supplied event. */ | 288 | /** Create an editor for the supplied event. */ |
288 | void editEvent(Event *); | 289 | void editEvent(Event *); |
289 | /** Delete the supplied event. */ | 290 | /** Delete the supplied event. */ |
290 | void deleteEvent(Event *); | 291 | void deleteEvent(Event *); |
291 | /** Delete the event with the given unique ID. Returns false, if event wasn't | 292 | /** Delete the event with the given unique ID. Returns false, if event wasn't |
292 | found. */ | 293 | found. */ |
293 | bool deleteEvent(const QString &uid); | 294 | bool deleteEvent(const QString &uid); |
294 | /** Create a read-only viewer dialog for the supplied event. */ | 295 | /** Create a read-only viewer dialog for the supplied event. */ |
295 | void showEvent(Event *); | 296 | void showEvent(Event *); |
296 | 297 | ||
297 | void editJournal(Journal *); | 298 | void editJournal(Journal *); |
298 | void showJournal(Journal *); | 299 | void showJournal(Journal *); |
299 | void deleteJournal(Journal *); | 300 | void deleteJournal(Journal *); |
diff --git a/korganizer/koagenda.cpp b/korganizer/koagenda.cpp index 779f12e..0dd5ef5 100644 --- a/korganizer/koagenda.cpp +++ b/korganizer/koagenda.cpp | |||
@@ -1542,193 +1542,196 @@ void KOAgenda::drawContentsToPainter( QPainter* paint, bool backgroundOnly )// i | |||
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 | */ |
1579 | void KOAgenda::contentsToGrid (int x, int y, int& gx, int& gy) | 1579 | void 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 | */ |
1589 | void KOAgenda::gridToContents (int gx, int gy, int& x, int& y) | 1589 | void 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 | */ |
1601 | int KOAgenda::timeToY(const QTime &time) | 1601 | int 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 | */ |
1614 | QTime KOAgenda::gyToTime(int gy) | 1614 | QTime 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 | ||
1631 | void KOAgenda::setStartHour(int startHour) | 1631 | void 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 | } |
1636 | QTime KOAgenda::getEndTime() | 1636 | QTime 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 | } |
1640 | void KOAgenda::hideUnused() | 1643 | void 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 | ||
1651 | KOAgendaItem *KOAgenda::getNewItem(Incidence * event,QDate qd, QWidget* view) | 1654 | KOAgendaItem *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 | } |
1675 | KOAgendaItem * KOAgenda::getItemForTodo ( Todo * todo ) | 1678 | KOAgendaItem * 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 | ||
1688 | void KOAgenda::updateTodo( Todo * todo, int days, bool remove) | 1691 | void 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() ) |
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 4bedb61..21d5a35 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -1,128 +1,126 @@ | |||
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 | ||
67 | using namespace KCal; | 65 | using 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 | ||
78 | class KOex2phonePrefs : public QDialog | 76 | class 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 | ||
127 | public: | 125 | public: |
128 | QLineEdit* mPhoneConnection, *mPhoneDevice, *mPhoneModel; | 126 | QLineEdit* mPhoneConnection, *mPhoneDevice, *mPhoneModel; |
@@ -132,193 +130,193 @@ public: | |||
132 | 130 | ||
133 | QPixmap* sgListViewCompletedPix[6]; | 131 | QPixmap* sgListViewCompletedPix[6]; |
134 | QPixmap* sgListViewJournalPix; | 132 | QPixmap* sgListViewJournalPix; |
135 | 133 | ||
136 | 134 | ||
137 | int globalFlagBlockStartup; | 135 | int globalFlagBlockStartup; |
138 | MainWindow::MainWindow( QWidget *parent, const char *name ) : | 136 | MainWindow::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(); |
@@ -589,228 +587,228 @@ void MainWindow::recieve( const QCString& cmsg, const QByteArray& data ) | |||
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 | } |
626 | void MainWindow::startMultiSync() | 624 | void 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 | } |
641 | QPixmap MainWindow::loadPixmap( QString name ) | 639 | QPixmap MainWindow::loadPixmap( QString name ) |
642 | { | 640 | { |
643 | return SmallIcon( name ); | 641 | return SmallIcon( name ); |
644 | 642 | ||
645 | } | 643 | } |
646 | void MainWindow::setUsesBigPixmaps ( bool b ) | 644 | void 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 | } |
652 | void MainWindow::initActions() | 650 | void 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() ) ); |
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 |
17 | class QAction; | 18 | class QAction; |
18 | class CalendarView; | 19 | class CalendarView; |
19 | class KSyncProfile; | 20 | class 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 |
25 | class QPEToolBar; | 25 | class QPEToolBar; |
26 | class QPEMenuBar; | ||
27 | 26 | ||
28 | 27 | ||
29 | namespace KCal { | 28 | namespace KCal { |
30 | class CalendarLocal; | 29 | class CalendarLocal; |
31 | } | 30 | } |
32 | 31 | ||
33 | using namespace KCal; | 32 | using namespace KCal; |
34 | 33 | ||
35 | class MainWindow : public QMainWindow | 34 | class 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 |