author | zautrix <zautrix> | 2005-07-07 04:18:11 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-07-07 04:18:11 (UTC) |
commit | b4d85da57e2d558ec088af6f3b2a34b1854462c0 (patch) (unidiff) | |
tree | 0860bfaae1d15aae6cd24861eaa87d0331fb364a /korganizer | |
parent | cb350dbe9151db2ded62942d29d11d6c8b88eabd (diff) | |
download | kdepimpi-b4d85da57e2d558ec088af6f3b2a34b1854462c0.zip kdepimpi-b4d85da57e2d558ec088af6f3b2a34b1854462c0.tar.gz kdepimpi-b4d85da57e2d558ec088af6f3b2a34b1854462c0.tar.bz2 |
conflict
-rw-r--r-- | korganizer/calendarview.cpp | 80 | ||||
-rw-r--r-- | korganizer/calendarview.h | 4 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 71 |
3 files changed, 126 insertions, 29 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index bc1c0c7..9a114d0 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -593,128 +593,194 @@ void CalendarView::init() | |||
593 | connect( mFilterView, SIGNAL( filterChanged() ), SLOT( updateFilter() ) ); | 593 | connect( mFilterView, SIGNAL( filterChanged() ), SLOT( updateFilter() ) ); |
594 | connect( mFilterView, SIGNAL( editFilters() ), SLOT( editFilters() ) ); | 594 | connect( mFilterView, SIGNAL( editFilters() ), SLOT( editFilters() ) ); |
595 | connect( mCalendar, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addAlarm(const QDateTime &, const QString & ) ) ); | 595 | connect( mCalendar, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addAlarm(const QDateTime &, const QString & ) ) ); |
596 | connect( mCalendar, SIGNAL( removeAlarm(const QDateTime &, const QString & ) ), SLOT( removeAlarm(const QDateTime &, const QString & ) ) ); | 596 | connect( mCalendar, SIGNAL( removeAlarm(const QDateTime &, const QString & ) ), SLOT( removeAlarm(const QDateTime &, const QString & ) ) ); |
597 | 597 | ||
598 | 598 | ||
599 | 599 | ||
600 | 600 | ||
601 | 601 | ||
602 | connect(QApplication::clipboard(),SIGNAL(dataChanged()), | 602 | connect(QApplication::clipboard(),SIGNAL(dataChanged()), |
603 | SLOT(checkClipboard())); | 603 | SLOT(checkClipboard())); |
604 | connect( mTodoList,SIGNAL( incidenceSelected( Incidence * ) ), | 604 | connect( mTodoList,SIGNAL( incidenceSelected( Incidence * ) ), |
605 | SLOT( processTodoListSelection( Incidence * ) ) ); | 605 | SLOT( processTodoListSelection( Incidence * ) ) ); |
606 | connect(mTodoList,SIGNAL(isModified(bool)),SLOT(setModified(bool))); | 606 | connect(mTodoList,SIGNAL(isModified(bool)),SLOT(setModified(bool))); |
607 | 607 | ||
608 | // kdDebug() << "CalendarView::CalendarView() done" << endl; | 608 | // kdDebug() << "CalendarView::CalendarView() done" << endl; |
609 | 609 | ||
610 | mDateFrame = new QVBox(0,0,WType_Popup); | 610 | mDateFrame = new QVBox(0,0,WType_Popup); |
611 | //mDateFrame->setFrameStyle(QFrame::PopupPanel | QFrame::Raised); | 611 | //mDateFrame->setFrameStyle(QFrame::PopupPanel | QFrame::Raised); |
612 | mDateFrame->setFrameStyle( QFrame::WinPanel |QFrame::Raised ); | 612 | mDateFrame->setFrameStyle( QFrame::WinPanel |QFrame::Raised ); |
613 | mDateFrame->setLineWidth(3); | 613 | mDateFrame->setLineWidth(3); |
614 | mDateFrame->hide(); | 614 | mDateFrame->hide(); |
615 | mDateFrame->setCaption( i18n( "Pick a date to display")); | 615 | mDateFrame->setCaption( i18n( "Pick a date to display")); |
616 | mDatePicker = new KDatePicker ( mDateFrame , QDate::currentDate() ); | 616 | mDatePicker = new KDatePicker ( mDateFrame , QDate::currentDate() ); |
617 | 617 | ||
618 | connect(mDatePicker,SIGNAL(dateSelected(QDate)),SLOT(slotSelectPickerDate(QDate))); | 618 | connect(mDatePicker,SIGNAL(dateSelected(QDate)),SLOT(slotSelectPickerDate(QDate))); |
619 | 619 | ||
620 | mEventEditor = mDialogManager->getEventEditor(); | 620 | mEventEditor = mDialogManager->getEventEditor(); |
621 | mTodoEditor = mDialogManager->getTodoEditor(); | 621 | mTodoEditor = mDialogManager->getTodoEditor(); |
622 | 622 | ||
623 | mFlagEditDescription = false; | 623 | mFlagEditDescription = false; |
624 | 624 | ||
625 | mSuspendTimer = new QTimer( this ); | 625 | mSuspendTimer = new QTimer( this ); |
626 | mAlarmTimer = new QTimer( this ); | 626 | mAlarmTimer = new QTimer( this ); |
627 | mRecheckAlarmTimer = new QTimer( this ); | 627 | mRecheckAlarmTimer = new QTimer( this ); |
628 | connect( mRecheckAlarmTimer, SIGNAL( timeout () ), SLOT( recheckTimerAlarm() ) ); | 628 | connect( mRecheckAlarmTimer, SIGNAL( timeout () ), SLOT( recheckTimerAlarm() ) ); |
629 | connect( mSuspendTimer, SIGNAL( timeout () ), SLOT( suspendAlarm() ) ); | 629 | connect( mSuspendTimer, SIGNAL( timeout () ), SLOT( suspendAlarm() ) ); |
630 | connect( mAlarmTimer, SIGNAL( timeout () ), SLOT( timerAlarm() ) ); | 630 | connect( mAlarmTimer, SIGNAL( timeout () ), SLOT( timerAlarm() ) ); |
631 | mAlarmDialog = new AlarmDialog( this ); | 631 | mAlarmDialog = new AlarmDialog( this ); |
632 | connect( mAlarmDialog, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addSuspendAlarm(const QDateTime &, const QString & ) ) ); | 632 | connect( mAlarmDialog, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addSuspendAlarm(const QDateTime &, const QString & ) ) ); |
633 | mAlarmDialog->setServerNotification( false ); | 633 | mAlarmDialog->setServerNotification( false ); |
634 | mAlarmDialog->setSuspendTime( KOPrefs::instance()->mAlarmSuspendTime ); | 634 | mAlarmDialog->setSuspendTime( KOPrefs::instance()->mAlarmSuspendTime ); |
635 | 635 | ||
636 | 636 | ||
637 | #ifndef DESKTOP_VERSION | 637 | #ifndef DESKTOP_VERSION |
638 | //US listen for arriving address resultsets | 638 | //US listen for arriving address resultsets |
639 | connect(ExternalAppHandler::instance(), SIGNAL(receivedBirthdayListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)), | 639 | connect(ExternalAppHandler::instance(), SIGNAL(receivedBirthdayListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)), |
640 | this, SLOT(insertBirthdays(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&))); | 640 | this, SLOT(insertBirthdays(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&))); |
641 | #endif | 641 | #endif |
642 | mDateNavigator->setCalendar( mCalendar ); | 642 | mDateNavigator->setCalendar( mCalendar ); |
643 | } | 643 | } |
644 | 644 | ||
645 | 645 | ||
646 | CalendarView::~CalendarView() | 646 | CalendarView::~CalendarView() |
647 | { | 647 | { |
648 | // kdDebug() << "~CalendarView()" << endl; | 648 | // kdDebug() << "~CalendarView()" << endl; |
649 | //qDebug("CalendarView::~CalendarView() "); | 649 | //qDebug("CalendarView::~CalendarView() "); |
650 | delete mDialogManager; | 650 | delete mDialogManager; |
651 | delete mViewManager; | 651 | delete mViewManager; |
652 | delete mStorage; | 652 | delete mStorage; |
653 | delete mDateFrame ; | 653 | delete mDateFrame ; |
654 | delete mEventViewerDialog; | 654 | delete mEventViewerDialog; |
655 | //kdDebug() << "~CalendarView() done" << endl; | 655 | //kdDebug() << "~CalendarView() done" << endl; |
656 | } | 656 | } |
657 | void CalendarView::nextConflict( bool all, bool allday ) | ||
658 | { | ||
659 | QDate start = mNavigator->selectedDates().first().addDays(1); | ||
660 | QDate end = start.addDays( 365*2); | ||
661 | while ( start < end ) { | ||
662 | QPtrList<Event> eventList = calendar()->events( start ); | ||
663 | Event * ev = eventList.first(); | ||
664 | QPtrList<Event> test = eventList; | ||
665 | while ( ev ) { | ||
666 | //qDebug("found %d on %s ", eventList.count(), start.toString().latin1()); | ||
667 | Event * t_ev = test.first(); | ||
668 | QDateTime es = ev->dtStart(); | ||
669 | QDateTime ee = ev->dtEnd(); | ||
670 | if ( ev->doesFloat() ) | ||
671 | ee = ee.addDays( 1 ); | ||
672 | if ( ! all ) { | ||
673 | if ( ev->doesFloat() != allday ) | ||
674 | t_ev = 0; | ||
675 | } | ||
676 | while ( t_ev ) { | ||
677 | bool skip = false; | ||
678 | if ( ! all ) { | ||
679 | if ( t_ev->doesFloat() != allday ) | ||
680 | skip = true; | ||
681 | } | ||
682 | if ( !skip && ev != t_ev ) { | ||
683 | QDateTime ets = t_ev->dtStart(); | ||
684 | QDateTime ete = t_ev->dtEnd(); | ||
685 | if ( t_ev->doesFloat() ) | ||
686 | ete = ete.addDays( 1 ); | ||
687 | //qDebug("test %s -- %s -------- %s -- %s ", es.toString().latin1() , ee.toString().latin1(), ets.toString().latin1() , ete.toString().latin1() ); | ||
688 | if ( es < ete && ets < ee ) { | ||
689 | if ( mViewManager->currentView() != mViewManager->agendaView() || mNavigator->selectedDates().count() > 1 ) | ||
690 | mViewManager->showDayView(); | ||
691 | mNavigator->slotDaySelect( start ); | ||
692 | int hour = es.time().hour(); | ||
693 | if ( ets > es ) | ||
694 | hour = ets.time().hour(); | ||
695 | mViewManager->agendaView()->setStartHour( hour ); | ||
696 | topLevelWidget()->setCaption( i18n("Conflict %1 <-> %2"). arg( ev->summary().left( 20 ) ).arg( t_ev->summary().left( 20 ) ) ); | ||
697 | return; | ||
698 | } | ||
699 | } | ||
700 | t_ev = test.next(); | ||
701 | } | ||
702 | ev = eventList.next(); | ||
703 | } | ||
704 | start = start.addDays( 1 ); | ||
705 | } | ||
706 | topLevelWidget()->setCaption( i18n("No conflict found within the next two years") ); | ||
707 | qDebug("No conflict found "); | ||
708 | } | ||
709 | |||
710 | void CalendarView::conflictAll() | ||
711 | { | ||
712 | nextConflict ( true, true ); | ||
713 | } | ||
714 | void CalendarView::conflictAllday() | ||
715 | { | ||
716 | nextConflict ( false, true ); | ||
717 | } | ||
718 | void CalendarView::conflictNotAll() | ||
719 | { | ||
720 | nextConflict ( false, false ); | ||
721 | } | ||
722 | |||
657 | void CalendarView::setCalReadOnly( int id, bool readO ) | 723 | void CalendarView::setCalReadOnly( int id, bool readO ) |
658 | { | 724 | { |
659 | if ( readO ) { | 725 | if ( readO ) { |
660 | emit save(); | 726 | emit save(); |
661 | } | 727 | } |
662 | mCalendar->setReadOnly( id, readO ); | 728 | mCalendar->setReadOnly( id, readO ); |
663 | } | 729 | } |
664 | void CalendarView::setScrollBarStep(int val ) | 730 | void CalendarView::setScrollBarStep(int val ) |
665 | { | 731 | { |
666 | #ifdef DESKTOP_VERSION | 732 | #ifdef DESKTOP_VERSION |
667 | mDateScrollBar->setLineStep ( val ); | 733 | mDateScrollBar->setLineStep ( val ); |
668 | #endif | 734 | #endif |
669 | } | 735 | } |
670 | void CalendarView::scrollBarValue(int val ) | 736 | void CalendarView::scrollBarValue(int val ) |
671 | { | 737 | { |
672 | #ifdef DESKTOP_VERSION | 738 | #ifdef DESKTOP_VERSION |
673 | if ( QApplication::desktop()->width() < 800 ) return; | 739 | if ( QApplication::desktop()->width() < 800 ) return; |
674 | static bool block = false; | 740 | static bool block = false; |
675 | if ( block ) return; | 741 | if ( block ) return; |
676 | block = true; | 742 | block = true; |
677 | int count = mNavigator->selectedDates().count(); | 743 | int count = mNavigator->selectedDates().count(); |
678 | int day = mNavigator->selectedDates().first().dayOfYear(); | 744 | int day = mNavigator->selectedDates().first().dayOfYear(); |
679 | int stepdays = val; | 745 | int stepdays = val; |
680 | if ( mDateScrollBar->lineStep () <= count ) { | 746 | if ( mDateScrollBar->lineStep () <= count ) { |
681 | //val = val/mDateScrollBar->lineStep ()*mDateScrollBar->lineStep(); | 747 | //val = val/mDateScrollBar->lineStep ()*mDateScrollBar->lineStep(); |
682 | //qDebug("VAL %d ",val ); | 748 | //qDebug("VAL %d ",val ); |
683 | stepdays = (val-day)/mDateScrollBar->lineStep ()*mDateScrollBar->lineStep(); | 749 | stepdays = (val-day)/mDateScrollBar->lineStep ()*mDateScrollBar->lineStep(); |
684 | stepdays = day+stepdays; | 750 | stepdays = day+stepdays; |
685 | if ( stepdays < 0 ) stepdays = 0; | 751 | if ( stepdays < 0 ) stepdays = 0; |
686 | } | 752 | } |
687 | if ( stepdays == day ) { | 753 | if ( stepdays == day ) { |
688 | block = false; | 754 | block = false; |
689 | return; | 755 | return; |
690 | } | 756 | } |
691 | int year = mNavigator->selectedDates().first().year(); | 757 | int year = mNavigator->selectedDates().first().year(); |
692 | QDate d ( year,1,1 ); | 758 | QDate d ( year,1,1 ); |
693 | mNavigator->selectDates( d.addDays( stepdays-1) , count ); | 759 | mNavigator->selectDates( d.addDays( stepdays-1) , count ); |
694 | block = false; | 760 | block = false; |
695 | #endif | 761 | #endif |
696 | 762 | ||
697 | } | 763 | } |
698 | void CalendarView::updateView(const QDate &start, const QDate &end) | 764 | void CalendarView::updateView(const QDate &start, const QDate &end) |
699 | { | 765 | { |
700 | #ifdef DESKTOP_VERSION | 766 | #ifdef DESKTOP_VERSION |
701 | if ( ! mDateScrollBar->draggingSlider () ) { | 767 | if ( ! mDateScrollBar->draggingSlider () ) { |
702 | int dof = start.dayOfYear(); | 768 | int dof = start.dayOfYear(); |
703 | //qDebug("dof %d day %d val %d ", dof, start.dayOfYear(),mDateScrollBar->value() ); | 769 | //qDebug("dof %d day %d val %d ", dof, start.dayOfYear(),mDateScrollBar->value() ); |
704 | if ( dof != mDateScrollBar->value() ) { | 770 | if ( dof != mDateScrollBar->value() ) { |
705 | mDateScrollBar->blockSignals( true ); | 771 | mDateScrollBar->blockSignals( true ); |
706 | mDateScrollBar->setValue( start.dayOfYear()); | 772 | mDateScrollBar->setValue( start.dayOfYear()); |
707 | mDateScrollBar->blockSignals( false ); | 773 | mDateScrollBar->blockSignals( false ); |
708 | } | 774 | } |
709 | } | 775 | } |
710 | #endif | 776 | #endif |
711 | mTodoList->updateView(); | 777 | mTodoList->updateView(); |
712 | mViewManager->updateView(start, end); | 778 | mViewManager->updateView(start, end); |
713 | //mDateNavigator->updateView(); | 779 | //mDateNavigator->updateView(); |
714 | } | 780 | } |
715 | 781 | ||
716 | 782 | ||
717 | 783 | ||
718 | void CalendarView::checkFiles() | 784 | void CalendarView::checkFiles() |
719 | { | 785 | { |
720 | QString message; | 786 | QString message; |
@@ -3101,129 +3167,129 @@ void CalendarView::showTodoEditor() | |||
3101 | mTodoEditor->setGeometry(x,y,w,h); | 3167 | mTodoEditor->setGeometry(x,y,w,h); |
3102 | #else | 3168 | #else |
3103 | if ( mTodoEditor->width() < QApplication::desktop()->width() -60|| mTodoEditor->width() > QApplication::desktop()->width() ) { | 3169 | if ( mTodoEditor->width() < QApplication::desktop()->width() -60|| mTodoEditor->width() > QApplication::desktop()->width() ) { |
3104 | topLevelWidget()->setCaption( i18n("Recreating edit dialog. Please wait...") ); | 3170 | topLevelWidget()->setCaption( i18n("Recreating edit dialog. Please wait...") ); |
3105 | qDebug("KO: CalendarView: recreate mTodoEditor %d %d ", mTodoEditor->width() ,QApplication::desktop()->width() ); | 3171 | qDebug("KO: CalendarView: recreate mTodoEditor %d %d ", mTodoEditor->width() ,QApplication::desktop()->width() ); |
3106 | qApp->processEvents(); | 3172 | qApp->processEvents(); |
3107 | delete mTodoEditor; | 3173 | delete mTodoEditor; |
3108 | mTodoEditor = mDialogManager->getTodoEditor(); | 3174 | mTodoEditor = mDialogManager->getTodoEditor(); |
3109 | topLevelWidget()->setCaption( i18n("") ); | 3175 | topLevelWidget()->setCaption( i18n("") ); |
3110 | } | 3176 | } |
3111 | mTodoEditor->showMaximized(); | 3177 | mTodoEditor->showMaximized(); |
3112 | #endif | 3178 | #endif |
3113 | } | 3179 | } |
3114 | 3180 | ||
3115 | void CalendarView::cloneIncidence() | 3181 | void CalendarView::cloneIncidence() |
3116 | { | 3182 | { |
3117 | Incidence *incidence = currentSelection(); | 3183 | Incidence *incidence = currentSelection(); |
3118 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); | 3184 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); |
3119 | if ( incidence ) { | 3185 | if ( incidence ) { |
3120 | cloneIncidence(incidence); | 3186 | cloneIncidence(incidence); |
3121 | } | 3187 | } |
3122 | } | 3188 | } |
3123 | void CalendarView::moveIncidence() | 3189 | void CalendarView::moveIncidence() |
3124 | { | 3190 | { |
3125 | Incidence *incidence = currentSelection(); | 3191 | Incidence *incidence = currentSelection(); |
3126 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); | 3192 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); |
3127 | if ( incidence ) { | 3193 | if ( incidence ) { |
3128 | moveIncidence(incidence); | 3194 | moveIncidence(incidence); |
3129 | } | 3195 | } |
3130 | } | 3196 | } |
3131 | void CalendarView::beamIncidence() | 3197 | void CalendarView::beamIncidence() |
3132 | { | 3198 | { |
3133 | Incidence *incidence = currentSelection(); | 3199 | Incidence *incidence = currentSelection(); |
3134 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); | 3200 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); |
3135 | if ( incidence ) { | 3201 | if ( incidence ) { |
3136 | beamIncidence(incidence); | 3202 | beamIncidence(incidence); |
3137 | } | 3203 | } |
3138 | } | 3204 | } |
3139 | void CalendarView::toggleCancelIncidence() | 3205 | void CalendarView::toggleCancelIncidence() |
3140 | { | 3206 | { |
3141 | Incidence *incidence = currentSelection(); | 3207 | Incidence *incidence = currentSelection(); |
3142 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); | 3208 | if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); |
3143 | if ( incidence ) { | 3209 | if ( incidence ) { |
3144 | cancelIncidence(incidence); | 3210 | cancelIncidence(incidence); |
3145 | } | 3211 | } |
3146 | } | 3212 | } |
3147 | 3213 | ||
3148 | 3214 | ||
3149 | void CalendarView::cancelIncidence(Incidence * inc ) | 3215 | void CalendarView::cancelIncidence(Incidence * inc ) |
3150 | { | 3216 | { |
3151 | inc->setCancelled( ! inc->cancelled() ); | 3217 | inc->setCancelled( ! inc->cancelled() ); |
3152 | changeIncidenceDisplay( inc,KOGlobals::EVENTEDITED ); | 3218 | changeIncidenceDisplay( inc,KOGlobals::EVENTEDITED ); |
3153 | updateView(); | 3219 | updateView(); |
3154 | } | 3220 | } |
3155 | void CalendarView::cloneIncidence(Incidence * orgInc ) | 3221 | void CalendarView::cloneIncidence(Incidence * orgInc ) |
3156 | { | 3222 | { |
3157 | Incidence * newInc = orgInc->clone(); | 3223 | Incidence * newInc = orgInc->clone(); |
3158 | newInc->recreate(); | 3224 | newInc->recreate(); |
3159 | 3225 | ||
3160 | if ( newInc->typeID() == todoID ) { | 3226 | if ( newInc->typeID() == todoID ) { |
3161 | Todo* t = (Todo*) newInc; | 3227 | Todo* t = (Todo*) newInc; |
3162 | bool cloneSub = false; | 3228 | bool cloneSub = false; |
3163 | if ( orgInc->relations().count() ) { | 3229 | if ( orgInc->relations().count() ) { |
3164 | int result = KMessageBox::warningYesNoCancel(this, | 3230 | int result = KMessageBox::warningYesNoCancel(this, |
3165 | i18n("The todo\n%1\nwill be cloned!\nIt has subtodos!\nDo you want to clone\nall subtodos as well?").arg( newInc->summary().left ( 25 ) ), | 3231 | i18n("The todo\n%1\nwill be cloned!\nIt has subtodos!\nDo you want to clone\nall subtodos as well?").arg( KGlobal::formatMessage ( newInc->summary(),0 ) ), |
3166 | i18n("Todo has subtodos"), | 3232 | i18n("Todo has subtodos"), |
3167 | i18n("Yes"), | 3233 | i18n("Yes"), |
3168 | i18n("No")); | 3234 | i18n("No")); |
3169 | 3235 | ||
3170 | if ( result == KMessageBox::Cancel ) { | 3236 | if ( result == KMessageBox::Cancel ) { |
3171 | delete t; | 3237 | delete t; |
3172 | return; | 3238 | return; |
3173 | } | 3239 | } |
3174 | if (result == KMessageBox::Yes) cloneSub = true; | 3240 | if (result == KMessageBox::Yes) cloneSub = true; |
3175 | } | 3241 | } |
3176 | showTodoEditor(); | 3242 | showTodoEditor(); |
3177 | mTodoEditor->editTodo( t ); | 3243 | mTodoEditor->editTodo( t ); |
3178 | if ( mTodoEditor->exec() ) { | 3244 | if ( mTodoEditor->exec() ) { |
3179 | if ( cloneSub ) { | 3245 | if ( cloneSub ) { |
3180 | orgInc->cloneRelations( t ); | 3246 | orgInc->cloneRelations( t ); |
3181 | mCalendar->addIncidenceBranch( t ); | 3247 | mCalendar->addIncidenceBranch( t ); |
3182 | updateView(); | 3248 | updateView(); |
3183 | 3249 | ||
3184 | } else { | 3250 | } else { |
3185 | mCalendar->addTodo( t ); | 3251 | mCalendar->addTodo( t ); |
3186 | updateView(); | 3252 | updateView(); |
3187 | } | 3253 | } |
3188 | } else { | 3254 | } else { |
3189 | delete t; | 3255 | delete t; |
3190 | } | 3256 | } |
3191 | } | 3257 | } |
3192 | else if ( newInc->typeID() == eventID ) { | 3258 | else if ( newInc->typeID() == eventID ) { |
3193 | Event* e = (Event*) newInc; | 3259 | Event* e = (Event*) newInc; |
3194 | showEventEditor(); | 3260 | showEventEditor(); |
3195 | mEventEditor->editEvent( e ); | 3261 | mEventEditor->editEvent( e ); |
3196 | if ( mEventEditor->exec() ) { | 3262 | if ( mEventEditor->exec() ) { |
3197 | mCalendar->addEvent( e ); | 3263 | mCalendar->addEvent( e ); |
3198 | updateView(); | 3264 | updateView(); |
3199 | } else { | 3265 | } else { |
3200 | delete e; | 3266 | delete e; |
3201 | } | 3267 | } |
3202 | } if ( newInc->typeID() == journalID ) { | 3268 | } if ( newInc->typeID() == journalID ) { |
3203 | mCalendar->addJournal( (Journal*) newInc ); | 3269 | mCalendar->addJournal( (Journal*) newInc ); |
3204 | editJournal( (Journal*) newInc ); | 3270 | editJournal( (Journal*) newInc ); |
3205 | } | 3271 | } |
3206 | setActiveWindow(); | 3272 | setActiveWindow(); |
3207 | } | 3273 | } |
3208 | 3274 | ||
3209 | void CalendarView::newEvent() | 3275 | void CalendarView::newEvent() |
3210 | { | 3276 | { |
3211 | // TODO: Replace this code by a common eventDurationHint of KOBaseView. | 3277 | // TODO: Replace this code by a common eventDurationHint of KOBaseView. |
3212 | KOAgendaView *aView = mViewManager->agendaView(); | 3278 | KOAgendaView *aView = mViewManager->agendaView(); |
3213 | if (aView) { | 3279 | if (aView) { |
3214 | if (aView->selectionStart().isValid()) { | 3280 | if (aView->selectionStart().isValid()) { |
3215 | if (aView->selectedIsAllDay()) { | 3281 | if (aView->selectedIsAllDay()) { |
3216 | newEvent(aView->selectionStart(),aView->selectionEnd(),true); | 3282 | newEvent(aView->selectionStart(),aView->selectionEnd(),true); |
3217 | } else { | 3283 | } else { |
3218 | newEvent(aView->selectionStart(),aView->selectionEnd()); | 3284 | newEvent(aView->selectionStart(),aView->selectionEnd()); |
3219 | } | 3285 | } |
3220 | return; | 3286 | return; |
3221 | } | 3287 | } |
3222 | } | 3288 | } |
3223 | 3289 | ||
3224 | QDate date = mNavigator->selectedDates().first(); | 3290 | QDate date = mNavigator->selectedDates().first(); |
3225 | QDateTime current = QDateTime::currentDateTime(); | 3291 | QDateTime current = QDateTime::currentDateTime(); |
3226 | if ( date <= current.date() ) { | 3292 | if ( date <= current.date() ) { |
3227 | int hour = current.time().hour() +1; | 3293 | int hour = current.time().hour() +1; |
3228 | newEvent( QDateTime( current.date(), QTime( hour, 0, 0 ) ), | 3294 | newEvent( QDateTime( current.date(), QTime( hour, 0, 0 ) ), |
3229 | QDateTime( current.date(), QTime( hour+ KOPrefs::instance()->mDefaultDuration, 0, 0 ) ) ); | 3295 | QDateTime( current.date(), QTime( hour+ KOPrefs::instance()->mDefaultDuration, 0, 0 ) ) ); |
@@ -3439,250 +3505,250 @@ void CalendarView::appointment_show() | |||
3439 | } | 3505 | } |
3440 | 3506 | ||
3441 | void CalendarView::appointment_edit() | 3507 | void CalendarView::appointment_edit() |
3442 | { | 3508 | { |
3443 | Event *anEvent = 0; | 3509 | Event *anEvent = 0; |
3444 | 3510 | ||
3445 | Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); | 3511 | Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); |
3446 | 3512 | ||
3447 | if (mViewManager->currentView()->isEventView()) { | 3513 | if (mViewManager->currentView()->isEventView()) { |
3448 | if ( incidence && incidence->typeID() == eventID ) { | 3514 | if ( incidence && incidence->typeID() == eventID ) { |
3449 | anEvent = static_cast<Event *>(incidence); | 3515 | anEvent = static_cast<Event *>(incidence); |
3450 | } | 3516 | } |
3451 | } | 3517 | } |
3452 | 3518 | ||
3453 | if (!anEvent) { | 3519 | if (!anEvent) { |
3454 | KNotifyClient::beep(); | 3520 | KNotifyClient::beep(); |
3455 | return; | 3521 | return; |
3456 | } | 3522 | } |
3457 | 3523 | ||
3458 | editEvent(anEvent); | 3524 | editEvent(anEvent); |
3459 | } | 3525 | } |
3460 | 3526 | ||
3461 | void CalendarView::appointment_delete() | 3527 | void CalendarView::appointment_delete() |
3462 | { | 3528 | { |
3463 | Event *anEvent = 0; | 3529 | Event *anEvent = 0; |
3464 | 3530 | ||
3465 | Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); | 3531 | Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); |
3466 | 3532 | ||
3467 | if (mViewManager->currentView()->isEventView()) { | 3533 | if (mViewManager->currentView()->isEventView()) { |
3468 | if ( incidence && incidence->typeID() == eventID ) { | 3534 | if ( incidence && incidence->typeID() == eventID ) { |
3469 | anEvent = static_cast<Event *>(incidence); | 3535 | anEvent = static_cast<Event *>(incidence); |
3470 | } | 3536 | } |
3471 | } | 3537 | } |
3472 | 3538 | ||
3473 | if (!anEvent) { | 3539 | if (!anEvent) { |
3474 | KNotifyClient::beep(); | 3540 | KNotifyClient::beep(); |
3475 | return; | 3541 | return; |
3476 | } | 3542 | } |
3477 | 3543 | ||
3478 | deleteEvent(anEvent); | 3544 | deleteEvent(anEvent); |
3479 | } | 3545 | } |
3480 | 3546 | ||
3481 | void CalendarView::todo_resub( Todo * parent, Todo * sub ) | 3547 | void CalendarView::todo_resub( Todo * parent, Todo * sub ) |
3482 | { | 3548 | { |
3483 | if (!sub) return; | 3549 | if (!sub) return; |
3484 | if ( sub->relatedTo() == parent ) | 3550 | if ( sub->relatedTo() == parent ) |
3485 | return; | 3551 | return; |
3486 | sub->setRelatedTo(parent); | 3552 | sub->setRelatedTo(parent); |
3487 | sub->updated(); | 3553 | sub->updated(); |
3488 | setModified(true); | 3554 | setModified(true); |
3489 | updateView(); | 3555 | updateView(); |
3490 | } | 3556 | } |
3491 | void CalendarView::todo_unsub(Todo *anTodo ) | 3557 | void CalendarView::todo_unsub(Todo *anTodo ) |
3492 | { | 3558 | { |
3493 | todo_resub( 0, anTodo ); | 3559 | todo_resub( 0, anTodo ); |
3494 | } | 3560 | } |
3495 | 3561 | ||
3496 | void CalendarView::deleteTodo(Todo *todo) | 3562 | void CalendarView::deleteTodo(Todo *todo) |
3497 | { | 3563 | { |
3498 | if (!todo) { | 3564 | if (!todo) { |
3499 | KNotifyClient::beep(); | 3565 | KNotifyClient::beep(); |
3500 | return; | 3566 | return; |
3501 | } | 3567 | } |
3502 | if (KOPrefs::instance()->mConfirm) { | 3568 | if (KOPrefs::instance()->mConfirm) { |
3503 | QString text = todo->summary().left(20); | 3569 | QString text = KGlobal::formatMessage ( todo->summary(),0 ); |
3504 | if (!todo->relations().isEmpty()) { | 3570 | if (!todo->relations().isEmpty()) { |
3505 | text += i18n("\nhas sub-todos.\nAll completed sub-todos\nwill be deleted as well!"); | 3571 | text += i18n("\nhas sub-todos.\nAll completed sub-todos\nwill be deleted as well!"); |
3506 | 3572 | ||
3507 | } | 3573 | } |
3508 | switch (msgItemDelete(i18n("Todo:") +"\n"+text)) { | 3574 | switch (msgItemDelete(i18n("Todo:") +"\n"+text)) { |
3509 | case KMessageBox::Continue: // OK | 3575 | case KMessageBox::Continue: // OK |
3510 | bool deleteT = false; | 3576 | bool deleteT = false; |
3511 | if (!todo->relations().isEmpty()) { | 3577 | if (!todo->relations().isEmpty()) { |
3512 | deleteT = removeCompletedSubTodos( todo ); | 3578 | deleteT = removeCompletedSubTodos( todo ); |
3513 | } | 3579 | } |
3514 | // deleteT == true: todo already deleted in removeCompletedSubTodos | 3580 | // deleteT == true: todo already deleted in removeCompletedSubTodos |
3515 | if ( !deleteT ) { | 3581 | if ( !deleteT ) { |
3516 | checkExternalId( todo ); | 3582 | checkExternalId( todo ); |
3517 | calendar()->deleteTodo(todo); | 3583 | calendar()->deleteTodo(todo); |
3518 | changeTodoDisplay( todo,KOGlobals::EVENTDELETED ); | 3584 | changeTodoDisplay( todo,KOGlobals::EVENTDELETED ); |
3519 | updateView(); | 3585 | updateView(); |
3520 | } | 3586 | } |
3521 | break; | 3587 | break; |
3522 | } // switch | 3588 | } // switch |
3523 | } else { | 3589 | } else { |
3524 | checkExternalId( todo ); | 3590 | checkExternalId( todo ); |
3525 | mCalendar->deleteTodo(todo); | 3591 | mCalendar->deleteTodo(todo); |
3526 | changeTodoDisplay( todo,KOGlobals::EVENTDELETED ); | 3592 | changeTodoDisplay( todo,KOGlobals::EVENTDELETED ); |
3527 | updateView(); | 3593 | updateView(); |
3528 | } | 3594 | } |
3529 | 3595 | ||
3530 | emit updateSearchDialog(); | 3596 | emit updateSearchDialog(); |
3531 | } | 3597 | } |
3532 | void CalendarView::deleteJournal(Journal *jour) | 3598 | void CalendarView::deleteJournal(Journal *jour) |
3533 | { | 3599 | { |
3534 | if (!jour) { | 3600 | if (!jour) { |
3535 | KNotifyClient::beep(); | 3601 | KNotifyClient::beep(); |
3536 | return; | 3602 | return; |
3537 | } | 3603 | } |
3538 | if (KOPrefs::instance()->mConfirm) { | 3604 | if (KOPrefs::instance()->mConfirm) { |
3539 | 3605 | ||
3540 | QString des; | 3606 | QString des; |
3541 | if ( !jour->summary().isEmpty() ) { | 3607 | if ( !jour->summary().isEmpty() ) { |
3542 | des = jour->summary(); | 3608 | des = jour->summary(); |
3543 | } else { | 3609 | } else { |
3544 | des = jour->description().left(30); | 3610 | des = jour->description().left(30); |
3545 | des = des.simplifyWhiteSpace (); | 3611 | des = des.simplifyWhiteSpace (); |
3546 | des.replace (QRegExp ("\\n"),"" ); | 3612 | des.replace (QRegExp ("\\n"),"" ); |
3547 | des.replace (QRegExp ("\\r"),"" ); | 3613 | des.replace (QRegExp ("\\r"),"" ); |
3548 | } | 3614 | } |
3549 | switch (msgItemDelete( i18n("Journal:") +"\n"+des.left(20))) { | 3615 | switch (msgItemDelete( i18n("Journal:") +"\n"+KGlobal::formatMessage ( des,0 ))) { |
3550 | case KMessageBox::Continue: // OK | 3616 | case KMessageBox::Continue: // OK |
3551 | calendar()->deleteJournal(jour); | 3617 | calendar()->deleteJournal(jour); |
3552 | updateView(); | 3618 | updateView(); |
3553 | break; | 3619 | break; |
3554 | } // switch | 3620 | } // switch |
3555 | } else { | 3621 | } else { |
3556 | calendar()->deleteJournal(jour);; | 3622 | calendar()->deleteJournal(jour);; |
3557 | updateView(); | 3623 | updateView(); |
3558 | } | 3624 | } |
3559 | emit updateSearchDialog(); | 3625 | emit updateSearchDialog(); |
3560 | } | 3626 | } |
3561 | 3627 | ||
3562 | void CalendarView::deleteEvent(Event *anEvent) | 3628 | void CalendarView::deleteEvent(Event *anEvent) |
3563 | { | 3629 | { |
3564 | if (!anEvent) { | 3630 | if (!anEvent) { |
3565 | KNotifyClient::beep(); | 3631 | KNotifyClient::beep(); |
3566 | return; | 3632 | return; |
3567 | } | 3633 | } |
3568 | 3634 | ||
3569 | if (anEvent->recurrence()->doesRecur()) { | 3635 | if (anEvent->recurrence()->doesRecur()) { |
3570 | QDate itemDate = mViewManager->currentSelectionDate(); | 3636 | QDate itemDate = mViewManager->currentSelectionDate(); |
3571 | int km; | 3637 | int km; |
3572 | if (!itemDate.isValid()) { | 3638 | if (!itemDate.isValid()) { |
3573 | //kdDebug() << "Date Not Valid" << endl; | 3639 | //kdDebug() << "Date Not Valid" << endl; |
3574 | if (KOPrefs::instance()->mConfirm) { | 3640 | if (KOPrefs::instance()->mConfirm) { |
3575 | km = KMessageBox::warningContinueCancel(this,anEvent->summary().left(25) + | 3641 | km = KMessageBox::warningContinueCancel(this,KGlobal::formatMessage ( anEvent->summary(),0 ) + |
3576 | i18n("\nThis event recurs\nover multiple dates.\nAre you sure you want\nto delete this event\nand all its recurrences?"), | 3642 | i18n("\nThis event recurs\nover multiple dates.\nAre you sure you want\nto delete this event\nand all its recurrences?"), |
3577 | i18n("KO/Pi Confirmation"),i18n("Delete All")); | 3643 | i18n("KO/Pi Confirmation"),i18n("Delete All")); |
3578 | if ( km == KMessageBox::Continue ) | 3644 | if ( km == KMessageBox::Continue ) |
3579 | km = KMessageBox::No; // No = all below | 3645 | km = KMessageBox::No; // No = all below |
3580 | } else | 3646 | } else |
3581 | km = KMessageBox::No; | 3647 | km = KMessageBox::No; |
3582 | } else { | 3648 | } else { |
3583 | km = KMessageBox::warningYesNoCancel(this,anEvent->summary().left(25) + | 3649 | km = KMessageBox::warningYesNoCancel(this,KGlobal::formatMessage ( anEvent->summary(),0 ) + |
3584 | i18n("\nThis event recurs\nover multiple dates.\nDo you want to delete\nall it's recurrences,\nor only the current one on:\n")+ | 3650 | i18n("\nThis event recurs\nover multiple dates.\nDo you want to delete\nall it's recurrences,\nor only the current one on:\n")+ |
3585 | KGlobal::locale()->formatDate(itemDate)+i18n(" ?\n\nDelete:\n"), | 3651 | KGlobal::locale()->formatDate(itemDate)+i18n(" ?\n\nDelete:\n"), |
3586 | i18n("KO/Pi Confirmation"),i18n("Current"), | 3652 | i18n("KO/Pi Confirmation"),i18n("Current"), |
3587 | i18n("All")); | 3653 | i18n("All")); |
3588 | } | 3654 | } |
3589 | switch(km) { | 3655 | switch(km) { |
3590 | 3656 | ||
3591 | case KMessageBox::No: // Continue // all | 3657 | case KMessageBox::No: // Continue // all |
3592 | //qDebug("KMessageBox::No "); | 3658 | //qDebug("KMessageBox::No "); |
3593 | if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0) | 3659 | if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0) |
3594 | schedule(Scheduler::Cancel,anEvent); | 3660 | schedule(Scheduler::Cancel,anEvent); |
3595 | 3661 | ||
3596 | checkExternalId( anEvent); | 3662 | checkExternalId( anEvent); |
3597 | mCalendar->deleteEvent(anEvent); | 3663 | mCalendar->deleteEvent(anEvent); |
3598 | changeEventDisplay(anEvent,KOGlobals::EVENTDELETED); | 3664 | changeEventDisplay(anEvent,KOGlobals::EVENTDELETED); |
3599 | break; | 3665 | break; |
3600 | 3666 | ||
3601 | // Disabled because it does not work | 3667 | // Disabled because it does not work |
3602 | //#if 0 | 3668 | //#if 0 |
3603 | case KMessageBox::Yes: // just this one | 3669 | case KMessageBox::Yes: // just this one |
3604 | //QDate qd = mNavigator->selectedDates().first(); | 3670 | //QDate qd = mNavigator->selectedDates().first(); |
3605 | //if (!qd.isValid()) { | 3671 | //if (!qd.isValid()) { |
3606 | // kdDebug() << "no date selected, or invalid date" << endl; | 3672 | // kdDebug() << "no date selected, or invalid date" << endl; |
3607 | // KNotifyClient::beep(); | 3673 | // KNotifyClient::beep(); |
3608 | // return; | 3674 | // return; |
3609 | //} | 3675 | //} |
3610 | //while (!anEvent->recursOn(qd)) qd = qd.addDays(1); | 3676 | //while (!anEvent->recursOn(qd)) qd = qd.addDays(1); |
3611 | if (itemDate!=QDate(1,1,1) || itemDate.isValid()) { | 3677 | if (itemDate!=QDate(1,1,1) || itemDate.isValid()) { |
3612 | anEvent->addExDate(itemDate); | 3678 | anEvent->addExDate(itemDate); |
3613 | int duration = anEvent->recurrence()->duration(); | 3679 | int duration = anEvent->recurrence()->duration(); |
3614 | if ( duration > 0 ) { | 3680 | if ( duration > 0 ) { |
3615 | anEvent->recurrence()->setDuration( duration - 1 ); | 3681 | anEvent->recurrence()->setDuration( duration - 1 ); |
3616 | } | 3682 | } |
3617 | changeEventDisplay(anEvent, KOGlobals::EVENTEDITED); | 3683 | changeEventDisplay(anEvent, KOGlobals::EVENTEDITED); |
3618 | } | 3684 | } |
3619 | break; | 3685 | break; |
3620 | //#endif | 3686 | //#endif |
3621 | } // switch | 3687 | } // switch |
3622 | } else { | 3688 | } else { |
3623 | if (KOPrefs::instance()->mConfirm) { | 3689 | if (KOPrefs::instance()->mConfirm) { |
3624 | switch (KMessageBox::warningContinueCancel(this,anEvent->summary().left(25) + | 3690 | switch (KMessageBox::warningContinueCancel(this,KGlobal::formatMessage ( anEvent->summary(),0 ) + |
3625 | i18n("\nAre you sure you want\nto delete this event?"), | 3691 | i18n("\nAre you sure you want\nto delete this event?"), |
3626 | i18n("KO/Pi Confirmation"),i18n("Delete"))) { | 3692 | i18n("KO/Pi Confirmation"),i18n("Delete"))) { |
3627 | case KMessageBox::Continue: // OK | 3693 | case KMessageBox::Continue: // OK |
3628 | if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0) | 3694 | if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0) |
3629 | schedule(Scheduler::Cancel,anEvent); | 3695 | schedule(Scheduler::Cancel,anEvent); |
3630 | checkExternalId( anEvent); | 3696 | checkExternalId( anEvent); |
3631 | mCalendar->deleteEvent(anEvent); | 3697 | mCalendar->deleteEvent(anEvent); |
3632 | changeEventDisplay(anEvent, KOGlobals::EVENTDELETED); | 3698 | changeEventDisplay(anEvent, KOGlobals::EVENTDELETED); |
3633 | break; | 3699 | break; |
3634 | } // switch | 3700 | } // switch |
3635 | } else { | 3701 | } else { |
3636 | if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0) | 3702 | if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0) |
3637 | schedule(Scheduler::Cancel,anEvent); | 3703 | schedule(Scheduler::Cancel,anEvent); |
3638 | checkExternalId( anEvent); | 3704 | checkExternalId( anEvent); |
3639 | mCalendar->deleteEvent(anEvent); | 3705 | mCalendar->deleteEvent(anEvent); |
3640 | changeEventDisplay(anEvent, KOGlobals::EVENTDELETED); | 3706 | changeEventDisplay(anEvent, KOGlobals::EVENTDELETED); |
3641 | } | 3707 | } |
3642 | } // if-else | 3708 | } // if-else |
3643 | emit updateSearchDialog(); | 3709 | emit updateSearchDialog(); |
3644 | } | 3710 | } |
3645 | 3711 | ||
3646 | bool CalendarView::deleteEvent(const QString &uid) | 3712 | bool CalendarView::deleteEvent(const QString &uid) |
3647 | { | 3713 | { |
3648 | Event *ev = mCalendar->event(uid); | 3714 | Event *ev = mCalendar->event(uid); |
3649 | if (ev) { | 3715 | if (ev) { |
3650 | deleteEvent(ev); | 3716 | deleteEvent(ev); |
3651 | return true; | 3717 | return true; |
3652 | } else { | 3718 | } else { |
3653 | return false; | 3719 | return false; |
3654 | } | 3720 | } |
3655 | } | 3721 | } |
3656 | 3722 | ||
3657 | /*****************************************************************************/ | 3723 | /*****************************************************************************/ |
3658 | 3724 | ||
3659 | void CalendarView::action_mail() | 3725 | void CalendarView::action_mail() |
3660 | { | 3726 | { |
3661 | #ifndef KORG_NOMAIL | 3727 | #ifndef KORG_NOMAIL |
3662 | KOMailClient mailClient; | 3728 | KOMailClient mailClient; |
3663 | 3729 | ||
3664 | Incidence *incidence = currentSelection(); | 3730 | Incidence *incidence = currentSelection(); |
3665 | 3731 | ||
3666 | if (!incidence) { | 3732 | if (!incidence) { |
3667 | KMessageBox::sorry(this,i18n("Can't generate mail:\nNo event selected.")); | 3733 | KMessageBox::sorry(this,i18n("Can't generate mail:\nNo event selected.")); |
3668 | return; | 3734 | return; |
3669 | } | 3735 | } |
3670 | if(incidence->attendeeCount() == 0 ) { | 3736 | if(incidence->attendeeCount() == 0 ) { |
3671 | KMessageBox::sorry(this, | 3737 | KMessageBox::sorry(this, |
3672 | i18n("Can't generate mail:\nNo attendees defined.\n")); | 3738 | i18n("Can't generate mail:\nNo attendees defined.\n")); |
3673 | return; | 3739 | return; |
3674 | } | 3740 | } |
3675 | 3741 | ||
3676 | CalendarLocal cal_tmp; | 3742 | CalendarLocal cal_tmp; |
3677 | Event *event = 0; | 3743 | Event *event = 0; |
3678 | Event *ev = 0; | 3744 | Event *ev = 0; |
3679 | if ( incidence && incidence->typeID() == eventID ) { | 3745 | if ( incidence && incidence->typeID() == eventID ) { |
3680 | event = static_cast<Event *>(incidence); | 3746 | event = static_cast<Event *>(incidence); |
3681 | ev = new Event(*event); | 3747 | ev = new Event(*event); |
3682 | cal_tmp.addEvent(ev); | 3748 | cal_tmp.addEvent(ev); |
3683 | } | 3749 | } |
3684 | ICalFormat mForm(); | 3750 | ICalFormat mForm(); |
3685 | QString attachment = mForm.toString( &cal_tmp ); | 3751 | QString attachment = mForm.toString( &cal_tmp ); |
3686 | if (ev) delete(ev); | 3752 | if (ev) delete(ev); |
3687 | 3753 | ||
3688 | mailClient.mailAttendees(currentSelection(), attachment); | 3754 | mailClient.mailAttendees(currentSelection(), attachment); |
@@ -4519,129 +4585,129 @@ void CalendarView::purgeCompleted() | |||
4519 | 4585 | ||
4520 | updateView(); | 4586 | updateView(); |
4521 | } | 4587 | } |
4522 | } | 4588 | } |
4523 | 4589 | ||
4524 | void CalendarView::slotCalendarChanged() | 4590 | void CalendarView::slotCalendarChanged() |
4525 | { | 4591 | { |
4526 | ; | 4592 | ; |
4527 | } | 4593 | } |
4528 | 4594 | ||
4529 | void CalendarView::keyPressEvent ( QKeyEvent *e) | 4595 | void CalendarView::keyPressEvent ( QKeyEvent *e) |
4530 | { | 4596 | { |
4531 | //qDebug(" alendarView::keyPressEvent "); | 4597 | //qDebug(" alendarView::keyPressEvent "); |
4532 | e->ignore(); | 4598 | e->ignore(); |
4533 | } | 4599 | } |
4534 | 4600 | ||
4535 | 4601 | ||
4536 | bool CalendarView::sync(KSyncManager* manager, QString filename, int mode) | 4602 | bool CalendarView::sync(KSyncManager* manager, QString filename, int mode) |
4537 | { | 4603 | { |
4538 | 4604 | ||
4539 | if ( manager != mSyncManager) | 4605 | if ( manager != mSyncManager) |
4540 | qDebug("KO: Internal error-1. SyncManager mismatch "); | 4606 | qDebug("KO: Internal error-1. SyncManager mismatch "); |
4541 | if ( filename == QDir::homeDirPath ()+"/.kdecalendardump.ics" ) { | 4607 | if ( filename == QDir::homeDirPath ()+"/.kdecalendardump.ics" ) { |
4542 | qDebug("KO: SyncKDE request detected!"); | 4608 | qDebug("KO: SyncKDE request detected!"); |
4543 | } | 4609 | } |
4544 | mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice(); | 4610 | mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice(); |
4545 | mCurrentSyncName = mSyncManager->getCurrentSyncName(); | 4611 | mCurrentSyncName = mSyncManager->getCurrentSyncName(); |
4546 | return syncCalendar( filename, mode ); | 4612 | return syncCalendar( filename, mode ); |
4547 | } | 4613 | } |
4548 | bool CalendarView::syncExternal(KSyncManager* manager, QString resource) | 4614 | bool CalendarView::syncExternal(KSyncManager* manager, QString resource) |
4549 | { | 4615 | { |
4550 | //mSyncManager = manager; | 4616 | //mSyncManager = manager; |
4551 | if ( manager != mSyncManager) | 4617 | if ( manager != mSyncManager) |
4552 | qDebug("KO: Internal error-2. SyncManager mismatch "); | 4618 | qDebug("KO: Internal error-2. SyncManager mismatch "); |
4553 | mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice(); | 4619 | mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice(); |
4554 | mCurrentSyncName = mSyncManager->getCurrentSyncName(); | 4620 | mCurrentSyncName = mSyncManager->getCurrentSyncName(); |
4555 | if ( resource == "sharp" ) | 4621 | if ( resource == "sharp" ) |
4556 | syncExternal( 0 ); | 4622 | syncExternal( 0 ); |
4557 | if ( resource == "phone" ) | 4623 | if ( resource == "phone" ) |
4558 | syncExternal( 1 ); | 4624 | syncExternal( 1 ); |
4559 | // pending setmodified | 4625 | // pending setmodified |
4560 | return true; | 4626 | return true; |
4561 | } | 4627 | } |
4562 | void CalendarView::setSyncManager(KSyncManager* manager) | 4628 | void CalendarView::setSyncManager(KSyncManager* manager) |
4563 | { | 4629 | { |
4564 | mSyncManager = manager; | 4630 | mSyncManager = manager; |
4565 | } | 4631 | } |
4566 | 4632 | ||
4567 | void CalendarView::removeSyncInfo( QString syncProfile) | 4633 | void CalendarView::removeSyncInfo( QString syncProfile) |
4568 | { | 4634 | { |
4569 | qDebug("KO: removeSyncInfo for profile %s ", syncProfile.latin1()); | 4635 | qDebug("KO: removeSyncInfo for profile %s ", syncProfile.latin1()); |
4570 | mCalendar->removeSyncInfo( syncProfile ); | 4636 | mCalendar->removeSyncInfo( syncProfile ); |
4571 | 4637 | ||
4572 | } | 4638 | } |
4573 | 4639 | ||
4574 | void CalendarView::undo_delete() | 4640 | void CalendarView::undo_delete() |
4575 | { | 4641 | { |
4576 | //qDebug("undo_delete() "); | 4642 | //qDebug("undo_delete() "); |
4577 | Incidence* undo = mCalendar->undoIncidence(); | 4643 | Incidence* undo = mCalendar->undoIncidence(); |
4578 | if ( !undo ) { | 4644 | if ( !undo ) { |
4579 | KMessageBox::sorry(this,i18n("There is nothing to undo!"), | 4645 | KMessageBox::sorry(this,i18n("There is nothing to undo!"), |
4580 | i18n("KO/Pi")); | 4646 | i18n("KO/Pi")); |
4581 | return; | 4647 | return; |
4582 | } | 4648 | } |
4583 | if ( KMessageBox::Continue ==KMessageBox::warningContinueCancel(this,undo->summary().left(25) + | 4649 | if ( KMessageBox::Continue ==KMessageBox::warningContinueCancel(this,KGlobal::formatMessage ( undo->summary(),0 ) + |
4584 | i18n("\nAre you sure you want\nto restore this?"), | 4650 | i18n("\nAre you sure you want\nto restore this?"), |
4585 | i18n("KO/Pi Confirmation"),i18n("Restore"))) { | 4651 | i18n("KO/Pi Confirmation"),i18n("Restore"))) { |
4586 | mCalendar->undoDeleteIncidence(); | 4652 | mCalendar->undoDeleteIncidence(); |
4587 | updateView(); | 4653 | updateView(); |
4588 | } | 4654 | } |
4589 | } | 4655 | } |
4590 | 4656 | ||
4591 | void CalendarView::slotViewerClosed() | 4657 | void CalendarView::slotViewerClosed() |
4592 | { | 4658 | { |
4593 | QTimer::singleShot( 50, this, SLOT ( resetFocus() ) ); | 4659 | QTimer::singleShot( 50, this, SLOT ( resetFocus() ) ); |
4594 | } | 4660 | } |
4595 | 4661 | ||
4596 | void CalendarView::resetFocus() | 4662 | void CalendarView::resetFocus() |
4597 | { | 4663 | { |
4598 | if ( mViewerCallerIsSearchDialog ) { | 4664 | if ( mViewerCallerIsSearchDialog ) { |
4599 | if ( mDialogManager->getSearchDialog()->isVisible() ){ | 4665 | if ( mDialogManager->getSearchDialog()->isVisible() ){ |
4600 | mDialogManager->getSearchDialog()->raise(); | 4666 | mDialogManager->getSearchDialog()->raise(); |
4601 | mDialogManager->getSearchDialog()->setActiveWindow(); | 4667 | mDialogManager->getSearchDialog()->setActiveWindow(); |
4602 | mDialogManager->getSearchDialog()->listview()->resetFocus(); | 4668 | mDialogManager->getSearchDialog()->listview()->resetFocus(); |
4603 | } else | 4669 | } else |
4604 | mViewerCallerIsSearchDialog = false; | 4670 | mViewerCallerIsSearchDialog = false; |
4605 | } | 4671 | } |
4606 | if ( !mViewerCallerIsSearchDialog ) { | 4672 | if ( !mViewerCallerIsSearchDialog ) { |
4607 | //mViewManager->currentView()->setFocus(); | 4673 | //mViewManager->currentView()->setFocus(); |
4608 | //qDebug("sssssssssssssssset focus "); | 4674 | //qDebug("sssssssssssssssset focus "); |
4609 | topLevelWidget()->raise(); | 4675 | topLevelWidget()->raise(); |
4610 | setActiveWindow(); | 4676 | setActiveWindow(); |
4611 | //setFocus(); | 4677 | //setFocus(); |
4612 | } | 4678 | } |
4613 | mViewerCallerIsSearchDialog = false; | 4679 | mViewerCallerIsSearchDialog = false; |
4614 | } | 4680 | } |
4615 | 4681 | ||
4616 | void CalendarView::showNextAlarms() | 4682 | void CalendarView::showNextAlarms() |
4617 | { | 4683 | { |
4618 | QString message; | 4684 | QString message; |
4619 | QDateTime nextAl = mCalendar->nextAlarmEventDateTime(); | 4685 | QDateTime nextAl = mCalendar->nextAlarmEventDateTime(); |
4620 | if ( nextAl.isValid() && mNextAlarmDateTime > QDateTime::currentDateTime() ) { | 4686 | if ( nextAl.isValid() && mNextAlarmDateTime > QDateTime::currentDateTime() ) { |
4621 | QString sum = mCalendar->nextSummary(); | 4687 | QString sum = mCalendar->nextSummary(); |
4622 | QDateTime nextA = mNextAlarmDateTime; | 4688 | QDateTime nextA = mNextAlarmDateTime; |
4623 | QDateTime cur = QDateTime::currentDateTime(); | 4689 | QDateTime cur = QDateTime::currentDateTime(); |
4624 | int secs = cur.secsTo( nextA ); | 4690 | int secs = cur.secsTo( nextA ); |
4625 | int min = secs /60; | 4691 | int min = secs /60; |
4626 | int hours = min /60; | 4692 | int hours = min /60; |
4627 | min = min % 60; | 4693 | min = min % 60; |
4628 | int days = hours /24; | 4694 | int days = hours /24; |
4629 | hours = hours % 24; | 4695 | hours = hours % 24; |
4630 | 4696 | ||
4631 | //message = i18n("The next alarm is in:\n"); | 4697 | //message = i18n("The next alarm is in:\n"); |
4632 | if ( days > 1 ) | 4698 | if ( days > 1 ) |
4633 | message += i18n("%1 days\n").arg( days ); | 4699 | message += i18n("%1 days\n").arg( days ); |
4634 | else if ( days == 1 ) | 4700 | else if ( days == 1 ) |
4635 | message += i18n("1 day\n"); | 4701 | message += i18n("1 day\n"); |
4636 | if ( hours > 1 ) | 4702 | if ( hours > 1 ) |
4637 | message += i18n("%1 hours\n").arg( hours ); | 4703 | message += i18n("%1 hours\n").arg( hours ); |
4638 | else if ( hours == 1 ) | 4704 | else if ( hours == 1 ) |
4639 | message += i18n("1 hour\n"); | 4705 | message += i18n("1 hour\n"); |
4640 | if ( min > 1 ) | 4706 | if ( min > 1 ) |
4641 | message += i18n("%1 minutes\n").arg( min ); | 4707 | message += i18n("%1 minutes\n").arg( min ); |
4642 | else if ( min == 1 ) | 4708 | else if ( min == 1 ) |
4643 | message += i18n("1 minute\n"); | 4709 | message += i18n("1 minute\n"); |
4644 | if ( message.isEmpty() ) | 4710 | if ( message.isEmpty() ) |
4645 | message = i18n("The next alarm is in\nless than one minute!"); | 4711 | message = i18n("The next alarm is in\nless than one minute!"); |
4646 | else | 4712 | else |
4647 | message = i18n("The next alarm is in:\n") + message; | 4713 | message = i18n("The next alarm is in:\n") + message; |
diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h index a5f230a..51eb1d4 100644 --- a/korganizer/calendarview.h +++ b/korganizer/calendarview.h | |||
@@ -139,128 +139,132 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser | |||
139 | Incidence *currentSelection(); | 139 | Incidence *currentSelection(); |
140 | void checkSuspendAlarm(); | 140 | void checkSuspendAlarm(); |
141 | 141 | ||
142 | signals: | 142 | signals: |
143 | void save (); | 143 | void save (); |
144 | void saveStopTimer (); | 144 | void saveStopTimer (); |
145 | void tempDisableBR(bool); | 145 | void tempDisableBR(bool); |
146 | /** This todo has been modified */ | 146 | /** This todo has been modified */ |
147 | void todoModified(Todo *, int); | 147 | void todoModified(Todo *, int); |
148 | 148 | ||
149 | /** when change is made to options dialog, the topwidget will catch this | 149 | /** when change is made to options dialog, the topwidget will catch this |
150 | * and emit this signal which notifies all widgets which have registered | 150 | * and emit this signal which notifies all widgets which have registered |
151 | * for notification to update their settings. */ | 151 | * for notification to update their settings. */ |
152 | void configChanged(); | 152 | void configChanged(); |
153 | /** emitted when the topwidget is closing down, so that any attached | 153 | /** emitted when the topwidget is closing down, so that any attached |
154 | child windows can also close. */ | 154 | child windows can also close. */ |
155 | void closingDown(); | 155 | void closingDown(); |
156 | /** emitted right before we die */ | 156 | /** emitted right before we die */ |
157 | void closed(QWidget *); | 157 | void closed(QWidget *); |
158 | 158 | ||
159 | /** Emitted when state of modified flag changes */ | 159 | /** Emitted when state of modified flag changes */ |
160 | void modifiedChanged(bool); | 160 | void modifiedChanged(bool); |
161 | void signalmodified(); | 161 | void signalmodified(); |
162 | 162 | ||
163 | /** Emitted when state of read-only flag changes */ | 163 | /** Emitted when state of read-only flag changes */ |
164 | void readOnlyChanged(bool); | 164 | void readOnlyChanged(bool); |
165 | 165 | ||
166 | /** Emitted when the unit of navigation changes */ | 166 | /** Emitted when the unit of navigation changes */ |
167 | void changeNavStringPrev(const QString &); | 167 | void changeNavStringPrev(const QString &); |
168 | void changeNavStringNext(const QString &); | 168 | void changeNavStringNext(const QString &); |
169 | 169 | ||
170 | /** Emitted when state of events selection has changed and user is organizer*/ | 170 | /** Emitted when state of events selection has changed and user is organizer*/ |
171 | void organizerEventsSelected(bool); | 171 | void organizerEventsSelected(bool); |
172 | /** Emitted when state of events selection has changed and user is attendee*/ | 172 | /** Emitted when state of events selection has changed and user is attendee*/ |
173 | void groupEventsSelected(bool); | 173 | void groupEventsSelected(bool); |
174 | /** | 174 | /** |
175 | Emitted when an incidence gets selected. If the selection is cleared the | 175 | Emitted when an incidence gets selected. If the selection is cleared the |
176 | signal is emitted with 0 as argument. | 176 | signal is emitted with 0 as argument. |
177 | */ | 177 | */ |
178 | void incidenceSelected( Incidence * ); | 178 | void incidenceSelected( Incidence * ); |
179 | /** Emitted, when a todoitem is selected or deselected. */ | 179 | /** Emitted, when a todoitem is selected or deselected. */ |
180 | void todoSelected( bool ); | 180 | void todoSelected( bool ); |
181 | 181 | ||
182 | /** | 182 | /** |
183 | Emitted, when clipboard content changes. Parameter indicates if paste | 183 | Emitted, when clipboard content changes. Parameter indicates if paste |
184 | is possible or not. | 184 | is possible or not. |
185 | */ | 185 | */ |
186 | void pasteEnabled(bool); | 186 | void pasteEnabled(bool); |
187 | 187 | ||
188 | /** Emitted, when the number of incoming messages has changed. */ | 188 | /** Emitted, when the number of incoming messages has changed. */ |
189 | void numIncomingChanged(int); | 189 | void numIncomingChanged(int); |
190 | 190 | ||
191 | /** Emitted, when the number of outgoing messages has changed. */ | 191 | /** Emitted, when the number of outgoing messages has changed. */ |
192 | void numOutgoingChanged(int); | 192 | void numOutgoingChanged(int); |
193 | 193 | ||
194 | /** Send status message, which can e.g. be displayed in the status bar. */ | 194 | /** Send status message, which can e.g. be displayed in the status bar. */ |
195 | void statusMessage(const QString &); | 195 | void statusMessage(const QString &); |
196 | 196 | ||
197 | void calendarViewExpanded( bool ); | 197 | void calendarViewExpanded( bool ); |
198 | void updateSearchDialog(); | 198 | void updateSearchDialog(); |
199 | void filtersUpdated(); | 199 | void filtersUpdated(); |
200 | 200 | ||
201 | 201 | ||
202 | public slots: | 202 | public slots: |
203 | void nextConflict( bool all, bool allday ); | ||
204 | void conflictAll(); | ||
205 | void conflictAllday(); | ||
206 | void conflictNotAll(); | ||
203 | void setCalReadOnly( int id, bool readO ); | 207 | void setCalReadOnly( int id, bool readO ); |
204 | void checkAlarms(); | 208 | void checkAlarms(); |
205 | void checkFiles(); | 209 | void checkFiles(); |
206 | void slotprintSelInc(); | 210 | void slotprintSelInc(); |
207 | void showNextAlarms(); | 211 | void showNextAlarms(); |
208 | void showOpenError(); | 212 | void showOpenError(); |
209 | void watchSavedFile(); | 213 | void watchSavedFile(); |
210 | void recheckTimerAlarm(); | 214 | void recheckTimerAlarm(); |
211 | void checkNextTimerAlarm(); | 215 | void checkNextTimerAlarm(); |
212 | void addAlarm(const QDateTime &qdt, const QString ¬i ); | 216 | void addAlarm(const QDateTime &qdt, const QString ¬i ); |
213 | void addSuspendAlarm(const QDateTime &qdt, const QString ¬i ); | 217 | void addSuspendAlarm(const QDateTime &qdt, const QString ¬i ); |
214 | void removeAlarm(const QDateTime &qdt, const QString ¬i ); | 218 | void removeAlarm(const QDateTime &qdt, const QString ¬i ); |
215 | 219 | ||
216 | /** options dialog made a changed to the configuration. we catch this | 220 | /** options dialog made a changed to the configuration. we catch this |
217 | * and notify all widgets which need to update their configuration. */ | 221 | * and notify all widgets which need to update their configuration. */ |
218 | void updateConfig(); | 222 | void updateConfig(); |
219 | 223 | ||
220 | void insertBirthdays(const QString& uid, const QStringList& birthdayList, | 224 | void insertBirthdays(const QString& uid, const QStringList& birthdayList, |
221 | const QStringList& anniversaryList, const QStringList& realNameList, | 225 | const QStringList& anniversaryList, const QStringList& realNameList, |
222 | const QStringList& emailList, const QStringList& assembledNameList, | 226 | const QStringList& emailList, const QStringList& assembledNameList, |
223 | const QStringList& uidList); | 227 | const QStringList& uidList); |
224 | 228 | ||
225 | /** | 229 | /** |
226 | Load calendar from file \a filename. If \a merge is true, load | 230 | Load calendar from file \a filename. If \a merge is true, load |
227 | calendar into existing one, if it is false, clear calendar, before | 231 | calendar into existing one, if it is false, clear calendar, before |
228 | loading. Return true, if calendar could be successfully loaded. | 232 | loading. Return true, if calendar could be successfully loaded. |
229 | */ | 233 | */ |
230 | bool openCalendar(QString filename, bool merge=false); | 234 | bool openCalendar(QString filename, bool merge=false); |
231 | bool loadCalendars(); | 235 | bool loadCalendars(); |
232 | bool saveCalendars(); | 236 | bool saveCalendars(); |
233 | bool restoreCalendarSettings(); | 237 | bool restoreCalendarSettings(); |
234 | bool addCalendar( KopiCalendarFile * ); | 238 | bool addCalendar( KopiCalendarFile * ); |
235 | void addCalendarId( int id ); | 239 | void addCalendarId( int id ); |
236 | bool syncCalendar(QString filename,int mode = 0 ); | 240 | bool syncCalendar(QString filename,int mode = 0 ); |
237 | 241 | ||
238 | /** | 242 | /** |
239 | Save calendar data to file. Return true if calendar could be | 243 | Save calendar data to file. Return true if calendar could be |
240 | successfully saved. | 244 | successfully saved. |
241 | */ | 245 | */ |
242 | bool saveCalendar(QString filename); | 246 | bool saveCalendar(QString filename); |
243 | 247 | ||
244 | /** | 248 | /** |
245 | Close calendar. Clear calendar data and reset views to display an empty | 249 | Close calendar. Clear calendar data and reset views to display an empty |
246 | calendar. | 250 | calendar. |
247 | */ | 251 | */ |
248 | void closeCalendar(); | 252 | void closeCalendar(); |
249 | 253 | ||
250 | /** Archive old events of calendar */ | 254 | /** Archive old events of calendar */ |
251 | void archiveCalendar(); | 255 | void archiveCalendar(); |
252 | 256 | ||
253 | void showIncidence(); | 257 | void showIncidence(); |
254 | void editIncidence(); | 258 | void editIncidence(); |
255 | void editIncidenceDescription(); | 259 | void editIncidenceDescription(); |
256 | void deleteIncidence(); | 260 | void deleteIncidence(); |
257 | void cloneIncidence(); | 261 | void cloneIncidence(); |
258 | void moveIncidence(); | 262 | void moveIncidence(); |
259 | void beamIncidence(); | 263 | void beamIncidence(); |
260 | void toggleCancelIncidence(); | 264 | void toggleCancelIncidence(); |
261 | 265 | ||
262 | /** create an editeventwin with supplied date/time, and if bool is true, | 266 | /** create an editeventwin with supplied date/time, and if bool is true, |
263 | * make the event take all day. */ | 267 | * make the event take all day. */ |
264 | void newEvent(QDateTime, QDateTime, bool allDay ); | 268 | void newEvent(QDateTime, QDateTime, bool allDay ); |
265 | void newEvent(QDateTime, QDateTime); | 269 | void newEvent(QDateTime, QDateTime); |
266 | void newEvent(QDateTime fh); | 270 | void newEvent(QDateTime fh); |
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 9c2ac82..bfae1b5 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -598,128 +598,129 @@ void MainWindow::recieve( const QCString& cmsg, const QByteArray& data ) | |||
598 | } | 598 | } |
599 | else if ( msg == "-showTodo" ) { | 599 | else if ( msg == "-showTodo" ) { |
600 | mView->viewManager()->showTodoView(); | 600 | mView->viewManager()->showTodoView(); |
601 | } | 601 | } |
602 | else if ( msg == "-showJournal" ) { | 602 | else if ( msg == "-showJournal" ) { |
603 | mView->dateNavigator()->selectDates( 1 ); | 603 | mView->dateNavigator()->selectDates( 1 ); |
604 | mView->dateNavigator()->selectToday(); | 604 | mView->dateNavigator()->selectToday(); |
605 | mView->viewManager()->showJournalView(); | 605 | mView->viewManager()->showJournalView(); |
606 | } | 606 | } |
607 | else if ( msg == "-showKO" ) { | 607 | else if ( msg == "-showKO" ) { |
608 | mView->viewManager()->showNextXView(); | 608 | mView->viewManager()->showNextXView(); |
609 | } | 609 | } |
610 | else if ( msg == "-showWNext" ) { | 610 | else if ( msg == "-showWNext" ) { |
611 | mView->viewManager()->showWhatsNextView(); | 611 | mView->viewManager()->showWhatsNextView(); |
612 | } | 612 | } |
613 | else if ( msg == "nextView()" ) { | 613 | else if ( msg == "nextView()" ) { |
614 | mView->viewManager()->showNextView(); | 614 | mView->viewManager()->showNextView(); |
615 | } | 615 | } |
616 | else if ( msg == "-showNextXView" ) { | 616 | else if ( msg == "-showNextXView" ) { |
617 | mView->viewManager()->showNextXView(); | 617 | mView->viewManager()->showNextXView(); |
618 | } | 618 | } |
619 | 619 | ||
620 | 620 | ||
621 | } | 621 | } |
622 | 622 | ||
623 | showMaximized(); | 623 | showMaximized(); |
624 | raise(); | 624 | raise(); |
625 | } | 625 | } |
626 | void MainWindow::startMultiSync() | 626 | void MainWindow::startMultiSync() |
627 | { | 627 | { |
628 | QString question = i18n("Do you really want\nto multiple sync\nwith all checked profiles?\nSyncing takes some\ntime - all profiles\nare synced twice!"); | 628 | 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"), | 629 | if ( QMessageBox::information( this, i18n("KDE-Pim Sync"), |
630 | question, | 630 | question, |
631 | i18n("Yes"), i18n("No"), | 631 | i18n("Yes"), i18n("No"), |
632 | 0, 0 ) != 0 ) { | 632 | 0, 0 ) != 0 ) { |
633 | setCaption(i18n("Aborted! Nothing synced!")); | 633 | setCaption(i18n("Aborted! Nothing synced!")); |
634 | return; | 634 | return; |
635 | } | 635 | } |
636 | mSyncManager->multiSync( false ); | 636 | mSyncManager->multiSync( false ); |
637 | #ifndef DESKTOP_VERSION | 637 | #ifndef DESKTOP_VERSION |
638 | QCopEnvelope e("QPE/Application/kapi", "doRingSync"); | 638 | QCopEnvelope e("QPE/Application/kapi", "doRingSync"); |
639 | #endif | 639 | #endif |
640 | } | 640 | } |
641 | QPixmap MainWindow::loadPixmap( QString name ) | 641 | QPixmap MainWindow::loadPixmap( QString name ) |
642 | { | 642 | { |
643 | return SmallIcon( name ); | 643 | return SmallIcon( name ); |
644 | 644 | ||
645 | } | 645 | } |
646 | void MainWindow::setUsesBigPixmaps ( bool b ) | 646 | void MainWindow::setUsesBigPixmaps ( bool b ) |
647 | { | 647 | { |
648 | qDebug("KO: MainWindow::setUsesBigPixmaps %d called", b); | 648 | qDebug("KO: MainWindow::setUsesBigPixmaps %d called", b); |
649 | if ( b ) | 649 | if ( b ) |
650 | qDebug("KO: BigPixmaps are not supported "); | 650 | qDebug("KO: BigPixmaps are not supported "); |
651 | } | 651 | } |
652 | void MainWindow::initActions() | 652 | void MainWindow::initActions() |
653 | { | 653 | { |
654 | //KOPrefs::instance()->mShowFullMenu | 654 | //KOPrefs::instance()->mShowFullMenu |
655 | iconToolBar->clear(); | 655 | iconToolBar->clear(); |
656 | KOPrefs *p = KOPrefs::instance(); | 656 | KOPrefs *p = KOPrefs::instance(); |
657 | //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar ); | 657 | //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar ); |
658 | 658 | ||
659 | QPopupMenu *viewMenu = new QPopupMenu( this ); | 659 | QPopupMenu *viewMenu = new QPopupMenu( this ); |
660 | QPopupMenu *actionMenu = new QPopupMenu( this ); | 660 | QPopupMenu *actionMenu = new QPopupMenu( this ); |
661 | mCurrentItemMenu = new QPopupMenu ( this ); | 661 | mCurrentItemMenu = new QPopupMenu ( this ); |
662 | QPopupMenu *nextConflictMenu = new QPopupMenu ( this ); | ||
662 | QPopupMenu *importMenu = new QPopupMenu( this ); | 663 | QPopupMenu *importMenu = new QPopupMenu( this ); |
663 | QPopupMenu *importMenu_X = new QPopupMenu( this ); | 664 | QPopupMenu *importMenu_X = new QPopupMenu( this ); |
664 | QPopupMenu *exportMenu_X = new QPopupMenu( this ); | 665 | QPopupMenu *exportMenu_X = new QPopupMenu( this ); |
665 | QPopupMenu *beamMenu_X = new QPopupMenu( this ); | 666 | QPopupMenu *beamMenu_X = new QPopupMenu( this ); |
666 | selectFilterMenu = new QPopupMenu( this ); | 667 | selectFilterMenu = new QPopupMenu( this ); |
667 | selectFilterMenu->setCheckable( true ); | 668 | selectFilterMenu->setCheckable( true ); |
668 | syncMenu = new QPopupMenu( this ); | 669 | syncMenu = new QPopupMenu( this ); |
669 | configureAgendaMenu = new QPopupMenu( this ); | 670 | configureAgendaMenu = new QPopupMenu( this ); |
670 | configureToolBarMenu = new QPopupMenu( this ); | 671 | configureToolBarMenu = new QPopupMenu( this ); |
671 | QPopupMenu *helpMenu = new QPopupMenu( this ); | 672 | QPopupMenu *helpMenu = new QPopupMenu( this ); |
672 | QIconSet icon; | 673 | QIconSet icon; |
673 | int pixWid = 22, pixHei = 22; | 674 | int pixWid = 22, pixHei = 22; |
674 | QString pathString = ""; | 675 | QString pathString = ""; |
675 | if ( !p->mToolBarMiniIcons ) { | 676 | if ( !p->mToolBarMiniIcons ) { |
676 | if ( QApplication::desktop()->width() < 480 /*|| QApplication::desktop()->height() < 320*/) { | 677 | if ( QApplication::desktop()->width() < 480 /*|| QApplication::desktop()->height() < 320*/) { |
677 | pathString += "icons16/"; | 678 | pathString += "icons16/"; |
678 | pixWid = 18; pixHei = 16; | 679 | pixWid = 18; pixHei = 16; |
679 | } | 680 | } |
680 | } else { | 681 | } else { |
681 | pathString += "iconsmini/"; | 682 | pathString += "iconsmini/"; |
682 | pixWid = 18; pixHei = 16; | 683 | pixWid = 18; pixHei = 16; |
683 | } | 684 | } |
684 | if ( KOPrefs::instance()->mShowFullMenu ) { | 685 | if ( KOPrefs::instance()->mShowFullMenu ) { |
685 | QMenuBar *menuBar1; | 686 | QMenuBar *menuBar1; |
686 | menuBar1 = menuBar(); | 687 | menuBar1 = menuBar(); |
687 | menuBar1->insertItem( i18n("File"), importMenu ); | 688 | menuBar1->insertItem( i18n("File"), importMenu ); |
688 | menuBar1->insertItem( i18n("View"), viewMenu ); | 689 | menuBar1->insertItem( i18n("View"), viewMenu ); |
689 | menuBar1->insertItem( i18n("Edit"), mCurrentItemMenu ); | 690 | menuBar1->insertItem( i18n("Edit"), mCurrentItemMenu ); |
690 | menuBar1->insertItem( i18n("Action"), actionMenu ); | 691 | menuBar1->insertItem( i18n("Action"), actionMenu ); |
691 | #ifdef DESKTOP_VERSION | 692 | #ifdef DESKTOP_VERSION |
692 | menuBar1->insertItem( i18n("Synchronize"), syncMenu ); | 693 | menuBar1->insertItem( i18n("Synchronize"), syncMenu ); |
693 | menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu ); | 694 | menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu ); |
694 | #else | 695 | #else |
695 | menuBar1->insertItem( i18n("Sync"), syncMenu ); | 696 | menuBar1->insertItem( i18n("Sync"), syncMenu ); |
696 | menuBar1->insertItem( i18n("Agenda"),configureAgendaMenu ); | 697 | menuBar1->insertItem( i18n("Agenda"),configureAgendaMenu ); |
697 | #endif | 698 | #endif |
698 | //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu ); | 699 | //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu ); |
699 | menuBar1->insertItem( i18n("Filter"),selectFilterMenu ); | 700 | menuBar1->insertItem( i18n("Filter"),selectFilterMenu ); |
700 | menuBar1->insertItem( i18n("Help"), helpMenu ); | 701 | menuBar1->insertItem( i18n("Help"), helpMenu ); |
701 | } else { | 702 | } else { |
702 | QPEMenuBar *menuBar1; | 703 | QPEMenuBar *menuBar1; |
703 | menuBar1 = new QPEMenuBar( iconToolBar ); | 704 | menuBar1 = new QPEMenuBar( iconToolBar ); |
704 | QPopupMenu *menuBar = new QPopupMenu( this ); | 705 | QPopupMenu *menuBar = new QPopupMenu( this ); |
705 | icon = loadPixmap( pathString + "z_menu" ); | 706 | icon = loadPixmap( pathString + "z_menu" ); |
706 | menuBar1->insertItem( icon.pixmap(), menuBar); | 707 | menuBar1->insertItem( icon.pixmap(), menuBar); |
707 | //menuBar1->insertItem( i18n("ME"), menuBar); | 708 | //menuBar1->insertItem( i18n("ME"), menuBar); |
708 | menuBar->insertItem( i18n("File"), importMenu ); | 709 | menuBar->insertItem( i18n("File"), importMenu ); |
709 | menuBar->insertItem( i18n("View"), viewMenu ); | 710 | menuBar->insertItem( i18n("View"), viewMenu ); |
710 | menuBar->insertItem( i18n("Edit"), mCurrentItemMenu ); | 711 | menuBar->insertItem( i18n("Edit"), mCurrentItemMenu ); |
711 | menuBar->insertItem( i18n("Action"), actionMenu ); | 712 | menuBar->insertItem( i18n("Action"), actionMenu ); |
712 | menuBar->insertItem( i18n("Synchronize"), syncMenu ); | 713 | menuBar->insertItem( i18n("Synchronize"), syncMenu ); |
713 | menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu ); | 714 | menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu ); |
714 | menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu ); | 715 | menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu ); |
715 | menuBar->insertItem( i18n("Filter"),selectFilterMenu ); | 716 | menuBar->insertItem( i18n("Filter"),selectFilterMenu ); |
716 | menuBar->insertItem( i18n("Help"), helpMenu ); | 717 | menuBar->insertItem( i18n("Help"), helpMenu ); |
717 | //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() ); | 718 | //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() ); |
718 | menuBar1->setMaximumSize( menuBar1->sizeHint( )); | 719 | menuBar1->setMaximumSize( menuBar1->sizeHint( )); |
719 | } | 720 | } |
720 | connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); | 721 | connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); |
721 | connect ( selectFilterMenu, SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenu() ) ); | 722 | connect ( selectFilterMenu, SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenu() ) ); |
722 | 723 | ||
723 | 724 | ||
724 | mWeekBgColor = iconToolBar->backgroundColor(); | 725 | mWeekBgColor = iconToolBar->backgroundColor(); |
725 | mWeekPixmap.resize( pixWid , pixHei ); | 726 | mWeekPixmap.resize( pixWid , pixHei ); |
@@ -728,195 +729,216 @@ void MainWindow::initActions() | |||
728 | mWeekAction = new QAction( i18n("Select week number"),icon, i18n("Select week number"), 0, this ); | 729 | mWeekAction = new QAction( i18n("Select week number"),icon, i18n("Select week number"), 0, this ); |
729 | if ( p-> mShowIconWeekNum ) | 730 | if ( p-> mShowIconWeekNum ) |
730 | mWeekAction->addTo( iconToolBar ); | 731 | mWeekAction->addTo( iconToolBar ); |
731 | mWeekFont = font(); | 732 | mWeekFont = font(); |
732 | 733 | ||
733 | int fontPoint = mWeekFont.pointSize(); | 734 | int fontPoint = mWeekFont.pointSize(); |
734 | QFontMetrics f( mWeekFont ); | 735 | QFontMetrics f( mWeekFont ); |
735 | int fontWid = f.width( "30" ); | 736 | int fontWid = f.width( "30" ); |
736 | while ( fontWid > pixWid ) { | 737 | while ( fontWid > pixWid ) { |
737 | --fontPoint; | 738 | --fontPoint; |
738 | mWeekFont.setPointSize( fontPoint ); | 739 | mWeekFont.setPointSize( fontPoint ); |
739 | QFontMetrics f( mWeekFont ); | 740 | QFontMetrics f( mWeekFont ); |
740 | fontWid = f.width( "30" ); | 741 | fontWid = f.width( "30" ); |
741 | //qDebug("dec-- "); | 742 | //qDebug("dec-- "); |
742 | } | 743 | } |
743 | 744 | ||
744 | connect( mWeekAction, SIGNAL( activated() ), | 745 | connect( mWeekAction, SIGNAL( activated() ), |
745 | this, SLOT( weekAction() ) ); | 746 | this, SLOT( weekAction() ) ); |
746 | 747 | ||
747 | connect( this, SIGNAL( selectWeek ( int ) ), mView->dateNavigator(), SLOT( selectWeek ( int ) ) ); | 748 | connect( this, SIGNAL( selectWeek ( int ) ), mView->dateNavigator(), SLOT( selectWeek ( int ) ) ); |
748 | if ( p->mShowIconFilterview ) { | 749 | if ( p->mShowIconFilterview ) { |
749 | icon = loadPixmap( pathString + "filter" ); | 750 | icon = loadPixmap( pathString + "filter" ); |
750 | actionFilterMenuTB = new QAction( i18n("Filter selector"), icon, i18n("Filter selector"), 0, this ); | 751 | actionFilterMenuTB = new QAction( i18n("Filter selector"), icon, i18n("Filter selector"), 0, this ); |
751 | connect( actionFilterMenuTB, SIGNAL( activated() ), | 752 | connect( actionFilterMenuTB, SIGNAL( activated() ), |
752 | this, SLOT( fillFilterMenuTB() ) ); | 753 | this, SLOT( fillFilterMenuTB() ) ); |
753 | actionFilterMenuTB->addTo( iconToolBar ); | 754 | actionFilterMenuTB->addTo( iconToolBar ); |
754 | selectFilterMenuTB = new QPopupMenu( this ); | 755 | selectFilterMenuTB = new QPopupMenu( this ); |
755 | selectFilterMenuTB->setCheckable( true ); | 756 | selectFilterMenuTB->setCheckable( true ); |
756 | connect ( selectFilterMenuTB, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); | 757 | connect ( selectFilterMenuTB, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); |
757 | } | 758 | } |
758 | 759 | ||
759 | //#endif | 760 | //#endif |
760 | // ****************** | 761 | // ****************** |
761 | QAction *action; | 762 | QAction *action; |
762 | // QPopupMenu *configureMenu= new QPopupMenu( menuBar ); | 763 | // QPopupMenu *configureMenu= new QPopupMenu( menuBar ); |
763 | configureToolBarMenu->setCheckable( true ); | 764 | configureToolBarMenu->setCheckable( true ); |
764 | 765 | ||
765 | 766 | ||
766 | configureAgendaMenu->setCheckable( true ); | 767 | configureAgendaMenu->setCheckable( true ); |
767 | int iii ; | 768 | int iii ; |
768 | for ( iii = 1;iii<= 10 ;++iii ){ | 769 | for ( iii = 1;iii<= 10 ;++iii ){ |
769 | configureAgendaMenu->insertItem(i18n("Size %1").arg(iii), (iii+1)*2 ); | 770 | configureAgendaMenu->insertItem(i18n("Size %1").arg(iii), (iii+1)*2 ); |
770 | } | 771 | } |
771 | //configureMenu->insertItem( "AgendaSize",configureAgendaMenu ); | 772 | //configureMenu->insertItem( "AgendaSize",configureAgendaMenu ); |
772 | 773 | ||
773 | connect( configureAgendaMenu, SIGNAL( aboutToShow()), | 774 | connect( configureAgendaMenu, SIGNAL( aboutToShow()), |
774 | this, SLOT( showConfigureAgenda( ) ) ); | 775 | this, SLOT( showConfigureAgenda( ) ) ); |
775 | icon = loadPixmap( pathString + "today" ); | 776 | icon = loadPixmap( pathString + "today" ); |
776 | QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this ); | 777 | QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this ); |
777 | today_action->addTo( actionMenu ); | 778 | today_action->addTo( actionMenu ); |
778 | connect( today_action, SIGNAL( activated() ), | 779 | connect( today_action, SIGNAL( activated() ), |
779 | mView, SLOT( goToday() ) ); | 780 | mView, SLOT( goToday() ) ); |
780 | 781 | ||
781 | icon = loadPixmap( pathString + "picker" ); | 782 | icon = loadPixmap( pathString + "picker" ); |
782 | QAction* dPickerAction = new QAction( i18n("Select Date..."), icon, i18n("Select Date..."), 0, this ); | 783 | QAction* dPickerAction = new QAction( i18n("Select Date..."), icon, i18n("Select Date..."), 0, this ); |
783 | dPickerAction->addTo( actionMenu ); | 784 | dPickerAction->addTo( actionMenu ); |
784 | connect( dPickerAction, SIGNAL( activated() ), | 785 | connect( dPickerAction, SIGNAL( activated() ), |
785 | mView, SLOT( showDatePicker() ) ); | 786 | mView, SLOT( showDatePicker() ) ); |
786 | 787 | ||
787 | icon = loadPixmap( pathString + "search" ); | 788 | icon = loadPixmap( pathString + "search" ); |
788 | QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this ); | 789 | QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this ); |
789 | search_action->addTo( actionMenu ); | 790 | search_action->addTo( actionMenu ); |
790 | connect( search_action, SIGNAL( activated() ), | 791 | connect( search_action, SIGNAL( activated() ), |
791 | mView->dialogManager(), SLOT( showSearchDialog() ) ); | 792 | mView->dialogManager(), SLOT( showSearchDialog() ) ); |
793 | actionMenu->insertItem( i18n("Show next conflict for"), nextConflictMenu ); | ||
792 | 794 | ||
795 | action = new QAction( "Undo Delete", i18n("All events"), 0, this ); | ||
796 | action->addTo( nextConflictMenu ); | ||
797 | connect( action, SIGNAL( activated() ), | ||
798 | mView, SLOT( conflictAll() ) ); | ||
799 | |||
800 | action = new QAction( "Undo Delete", i18n("Allday events"), 0, this ); | ||
801 | action->addTo( nextConflictMenu ); | ||
802 | connect( action, SIGNAL( activated() ), | ||
803 | mView, SLOT( conflictAllday() ) ); | ||
804 | |||
805 | action = new QAction( "Undo Delete", i18n("Events with time"), 0, this ); | ||
806 | action->addTo( nextConflictMenu ); | ||
807 | connect( action, SIGNAL( activated() ), | ||
808 | mView, SLOT( conflictNotAll() ) ); | ||
809 | |||
793 | actionMenu->insertSeparator(); | 810 | actionMenu->insertSeparator(); |
794 | 811 | ||
812 | icon = loadPixmap( pathString + "newevent" ); | ||
813 | QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this ); | ||
814 | ne_action->addTo( mCurrentItemMenu ); | ||
815 | connect( ne_action, SIGNAL( activated() ), | ||
816 | mView, SLOT( newEvent() ) ); | ||
817 | icon = loadPixmap( pathString + "newtodo" ); | ||
818 | configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 ); | ||
819 | QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this ); | ||
820 | nt_action->addTo( mCurrentItemMenu ); | ||
821 | connect( nt_action, SIGNAL( activated() ), | ||
822 | mView, SLOT( newTodo() ) ); | ||
823 | mNewSubTodoAction = new QAction( "new_subtodo", i18n("New Sub-Todo..."), 0, | ||
824 | this ); | ||
825 | mNewSubTodoAction->addTo( mCurrentItemMenu ); | ||
826 | connect( mNewSubTodoAction, SIGNAL( activated() ), | ||
827 | mView, SLOT( newSubTodo() ) ); | ||
795 | 828 | ||
796 | |||
797 | action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this ); | ||
798 | action->addTo( mCurrentItemMenu ); | ||
799 | connect( action, SIGNAL( activated() ), | ||
800 | mView, SLOT( undo_delete() ) ); | ||
801 | mCurrentItemMenu->insertSeparator(); | 829 | mCurrentItemMenu->insertSeparator(); |
802 | icon = loadPixmap( pathString + "newevent" ); | 830 | icon = loadPixmap( pathString + "newevent" ); |
803 | configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 ); | 831 | configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 ); |
804 | configureToolBarMenu->insertItem(i18n("Only one toolbar"), 6 ); | 832 | configureToolBarMenu->insertItem(i18n("Only one toolbar"), 6 ); |
805 | configureToolBarMenu->insertSeparator(); | 833 | configureToolBarMenu->insertSeparator(); |
806 | configureToolBarMenu->insertItem(i18n("Filtermenu"), 7 ); | 834 | configureToolBarMenu->insertItem(i18n("Filtermenu"), 7 ); |
807 | configureToolBarMenu->insertSeparator(); | 835 | configureToolBarMenu->insertSeparator(); |
808 | configureToolBarMenu->insertItem(i18n("Week Number"), 400); | 836 | configureToolBarMenu->insertItem(i18n("Week Number"), 400); |
809 | configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 ); | 837 | configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 ); |
810 | 838 | ||
811 | //actionMenu->insertItem ( i18n("Selected Item"), mCurrentItemMenu); | 839 | //actionMenu->insertItem ( i18n("Selected Item"), mCurrentItemMenu); |
812 | mShowAction = new QAction( "show_incidence", i18n("Show"), 0, this ); | 840 | mShowAction = new QAction( "show_incidence", i18n("Show"), 0, this ); |
813 | mShowAction->addTo( mCurrentItemMenu ); | 841 | mShowAction->addTo( mCurrentItemMenu ); |
814 | connect( mShowAction, SIGNAL( activated() ), | 842 | connect( mShowAction, SIGNAL( activated() ), |
815 | mView, SLOT( showIncidence() ) ); | 843 | mView, SLOT( showIncidence() ) ); |
816 | 844 | ||
817 | mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this ); | 845 | mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this ); |
818 | mEditAction->addTo( mCurrentItemMenu ); | 846 | mEditAction->addTo( mCurrentItemMenu ); |
819 | connect( mEditAction, SIGNAL( activated() ), | 847 | connect( mEditAction, SIGNAL( activated() ), |
820 | mView, SLOT( editIncidence() ) ); | 848 | mView, SLOT( editIncidence() ) ); |
821 | 849 | ||
822 | mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this ); | 850 | mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this ); |
823 | mDeleteAction->addTo( mCurrentItemMenu ); | 851 | mDeleteAction->addTo( mCurrentItemMenu ); |
824 | connect( mDeleteAction, SIGNAL( activated() ), | 852 | connect( mDeleteAction, SIGNAL( activated() ), |
825 | mView, SLOT( deleteIncidence() ) ); | 853 | mView, SLOT( deleteIncidence() ) ); |
826 | 854 | ||
827 | 855 | ||
828 | mCloneAction = new QAction( "clone_incidence", i18n("Clone..."), 0, this ); | 856 | mCloneAction = new QAction( "clone_incidence", i18n("Clone..."), 0, this ); |
829 | mCloneAction->addTo( mCurrentItemMenu ); | 857 | mCloneAction->addTo( mCurrentItemMenu ); |
830 | connect( mCloneAction, SIGNAL( activated() ), | 858 | connect( mCloneAction, SIGNAL( activated() ), |
831 | mView, SLOT( cloneIncidence() ) ); | 859 | mView, SLOT( cloneIncidence() ) ); |
832 | mMoveAction = new QAction( "Move_incidence", i18n("Move..."), 0, this ); | 860 | mMoveAction = new QAction( "Move_incidence", i18n("Move..."), 0, this ); |
833 | mMoveAction->addTo( mCurrentItemMenu ); | 861 | mMoveAction->addTo( mCurrentItemMenu ); |
834 | connect( mMoveAction, SIGNAL( activated() ), | 862 | connect( mMoveAction, SIGNAL( activated() ), |
835 | mView, SLOT( moveIncidence() ) ); | 863 | mView, SLOT( moveIncidence() ) ); |
836 | #ifndef DESKTOP_VERSION | 864 | #ifndef DESKTOP_VERSION |
837 | mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this ); | 865 | mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this ); |
838 | mBeamAction->addTo(mCurrentItemMenu ); | 866 | mBeamAction->addTo(mCurrentItemMenu ); |
839 | connect( mBeamAction, SIGNAL( activated() ), | 867 | connect( mBeamAction, SIGNAL( activated() ), |
840 | mView, SLOT( beamIncidence() ) ); | 868 | mView, SLOT( beamIncidence() ) ); |
841 | #endif | 869 | #endif |
842 | mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this ); | 870 | mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this ); |
843 | mCancelAction->addTo( mCurrentItemMenu ); | 871 | mCancelAction->addTo( mCurrentItemMenu ); |
844 | connect( mCancelAction, SIGNAL( activated() ), | 872 | connect( mCancelAction, SIGNAL( activated() ), |
845 | mView, SLOT( toggleCancelIncidence() ) ); | 873 | mView, SLOT( toggleCancelIncidence() ) ); |
846 | 874 | ||
847 | QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this ); | 875 | |
848 | ne_action->addTo( actionMenu ); | 876 | mCurrentItemMenu->insertSeparator(); |
849 | connect( ne_action, SIGNAL( activated() ), | 877 | action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this ); |
850 | mView, SLOT( newEvent() ) ); | 878 | action->addTo( mCurrentItemMenu ); |
851 | icon = loadPixmap( pathString + "newtodo" ); | 879 | connect( action, SIGNAL( activated() ), |
852 | configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 ); | 880 | mView, SLOT( undo_delete() ) ); |
853 | QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this ); | ||
854 | nt_action->addTo( actionMenu ); | ||
855 | connect( nt_action, SIGNAL( activated() ), | ||
856 | mView, SLOT( newTodo() ) ); | ||
857 | |||
858 | |||
859 | 881 | ||
860 | // *********************** | 882 | // *********************** |
861 | if ( KOPrefs::instance()->mVerticalScreen ) { | 883 | if ( KOPrefs::instance()->mVerticalScreen ) { |
862 | icon = SmallIcon( "1updownarrow" ); | 884 | icon = SmallIcon( "1updownarrow" ); |
863 | } else { | 885 | } else { |
864 | icon = SmallIcon("1leftrightarrow" ); | 886 | icon = SmallIcon("1leftrightarrow" ); |
865 | } | 887 | } |
866 | configureToolBarMenu->insertItem(icon, i18n("Toggle Fullscreen"), 28 ); | 888 | configureToolBarMenu->insertItem(icon, i18n("Toggle Fullscreen"), 28 ); |
867 | QAction* FSaction = new QAction( i18n("Toggle Fullscreen"), icon, i18n("Toggle Fullscreen"), 0, this ); | 889 | QAction* FSaction = new QAction( i18n("Toggle Fullscreen"), icon, i18n("Toggle Fullscreen"), 0, this ); |
868 | FSaction->addTo( viewMenu ); | 890 | FSaction->addTo( viewMenu ); |
869 | connect( FSaction, SIGNAL( activated() ), mView, SLOT( toggleExpand() )); | 891 | connect( FSaction, SIGNAL( activated() ), mView, SLOT( toggleExpand() )); |
870 | 892 | ||
871 | 893 | ||
872 | icon = loadPixmap( pathString + "filter" ); | 894 | icon = loadPixmap( pathString + "filter" ); |
873 | configureToolBarMenu->insertItem(icon, i18n("Filter menu icon"), 26 ); | 895 | configureToolBarMenu->insertItem(icon, i18n("Filter menu icon"), 26 ); |
874 | icon = loadPixmap( pathString + "configure" ); | 896 | icon = loadPixmap( pathString + "configure" ); |
875 | action = new QAction( i18n("Toggle Resource View"), icon, i18n("Toggle Resource View"), 0, this ); | 897 | action = new QAction( i18n("Toggle Resource View"), icon, i18n("Toggle Resource View"), 0, this ); |
876 | action->addTo( viewMenu ); | 898 | action->addTo( viewMenu ); |
877 | connect( action, SIGNAL( activated() ), | 899 | connect( action, SIGNAL( activated() ), |
878 | mView, SLOT( toggleFilter() ) ); | 900 | mView, SLOT( toggleFilter() ) ); |
879 | mToggleFilter = action; | 901 | mToggleFilter = action; |
880 | icon = loadPixmap( pathString + "navi" ); | 902 | icon = loadPixmap( pathString + "navi" ); |
881 | configureToolBarMenu->insertItem(icon, i18n("Toggle DateNavigator"), 22 ); | 903 | configureToolBarMenu->insertItem(icon, i18n("Toggle DateNavigator"), 22 ); |
882 | action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this ); | 904 | action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this ); |
883 | action->addTo( viewMenu ); | 905 | action->addTo( viewMenu ); |
884 | connect( action, SIGNAL( activated() ), | 906 | connect( action, SIGNAL( activated() ), |
885 | mView, SLOT( toggleDateNavigatorWidget() ) ); | 907 | mView, SLOT( toggleDateNavigatorWidget() ) ); |
886 | mToggleNav = action ; | 908 | mToggleNav = action ; |
887 | icon = loadPixmap( pathString + "allday" ); | 909 | icon = loadPixmap( pathString + "allday" ); |
888 | configureToolBarMenu->insertItem(icon, i18n("Toggle Allday"), 24 ); | 910 | configureToolBarMenu->insertItem(icon, i18n("Toggle Allday"), 24 ); |
889 | action = new QAction( i18n("Toggle Allday"), icon,i18n("Toggle Allday"), 0, this ); | 911 | action = new QAction( i18n("Toggle Allday"), icon,i18n("Toggle Allday"), 0, this ); |
890 | action->addTo( viewMenu ); | 912 | action->addTo( viewMenu ); |
891 | connect( action, SIGNAL( activated() ), | 913 | connect( action, SIGNAL( activated() ), |
892 | mView, SLOT( toggleAllDaySize() ) ); | 914 | mView, SLOT( toggleAllDaySize() ) ); |
893 | mToggleAllday = action; | 915 | mToggleAllday = action; |
894 | 916 | ||
895 | 917 | ||
896 | connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), | 918 | connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), |
897 | mToggleNav, SLOT( setEnabled ( bool ) ) ); | 919 | mToggleNav, SLOT( setEnabled ( bool ) ) ); |
898 | //connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), | 920 | //connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), |
899 | // mToggleFilter, SLOT( setEnabled ( bool ) ) ); | 921 | // mToggleFilter, SLOT( setEnabled ( bool ) ) ); |
900 | connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ), | 922 | connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ), |
901 | mToggleAllday, SLOT( setEnabled ( bool ) ) ); | 923 | mToggleAllday, SLOT( setEnabled ( bool ) ) ); |
902 | // connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ), | 924 | // connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ), |
903 | // configureAgendaMenu, SLOT( setEnabled ( bool ) ) ); | 925 | // configureAgendaMenu, SLOT( setEnabled ( bool ) ) ); |
904 | 926 | ||
905 | 927 | ||
906 | dPickerAction->addTo( iconToolBar ); | 928 | dPickerAction->addTo( iconToolBar ); |
907 | viewMenu->insertSeparator(); | 929 | viewMenu->insertSeparator(); |
908 | 930 | ||
909 | if ( p-> mShowIconToggleFull ) | 931 | if ( p-> mShowIconToggleFull ) |
910 | FSaction->addTo( iconToolBar ); | 932 | FSaction->addTo( iconToolBar ); |
911 | if ( p->mShowIconNavigator ) mToggleNav ->addTo( iconToolBar ); | 933 | if ( p->mShowIconNavigator ) mToggleNav ->addTo( iconToolBar ); |
912 | 934 | ||
913 | //******************** | 935 | //******************** |
914 | if ( p->mShowIconAllday ) mToggleAllday->addTo( iconToolBar ); | 936 | if ( p->mShowIconAllday ) mToggleAllday->addTo( iconToolBar ); |
915 | 937 | ||
916 | 938 | ||
917 | icon = loadPixmap( pathString + "whatsnext" ); | 939 | icon = loadPixmap( pathString + "whatsnext" ); |
918 | configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110 ); | 940 | configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110 ); |
919 | QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this ); | 941 | QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this ); |
920 | whatsnext_action->addTo( viewMenu ); | 942 | whatsnext_action->addTo( viewMenu ); |
921 | connect( whatsnext_action, SIGNAL( activated() ), | 943 | connect( whatsnext_action, SIGNAL( activated() ), |
922 | mView->viewManager(), SLOT( showWhatsNextView() ) ); | 944 | mView->viewManager(), SLOT( showWhatsNextView() ) ); |
@@ -935,133 +957,129 @@ void MainWindow::initActions() | |||
935 | viewjournal_action->addTo( viewMenu ); | 957 | viewjournal_action->addTo( viewMenu ); |
936 | connect( viewjournal_action, SIGNAL( activated() ), | 958 | connect( viewjournal_action, SIGNAL( activated() ), |
937 | mView->viewManager(), SLOT( showJournalView() ) ); | 959 | mView->viewManager(), SLOT( showJournalView() ) ); |
938 | 960 | ||
939 | 961 | ||
940 | icon = loadPixmap( pathString + "day" ); | 962 | icon = loadPixmap( pathString + "day" ); |
941 | configureToolBarMenu->insertItem(icon, i18n("Day View"), 40 ); | 963 | configureToolBarMenu->insertItem(icon, i18n("Day View"), 40 ); |
942 | QAction* day1_action = new QAction( i18n("Day View"), icon, i18n("Day View"), 0, this ); | 964 | QAction* day1_action = new QAction( i18n("Day View"), icon, i18n("Day View"), 0, this ); |
943 | day1_action->addTo( viewMenu ); | 965 | day1_action->addTo( viewMenu ); |
944 | // action->addTo( toolBar ); | 966 | // action->addTo( toolBar ); |
945 | connect( day1_action, SIGNAL( activated() ), | 967 | connect( day1_action, SIGNAL( activated() ), |
946 | mView->viewManager(), SLOT( showDayView() ) ); | 968 | mView->viewManager(), SLOT( showDayView() ) ); |
947 | 969 | ||
948 | icon = loadPixmap( pathString + "workweek" ); | 970 | icon = loadPixmap( pathString + "workweek" ); |
949 | configureToolBarMenu->insertItem(icon, i18n("Work Week"), 50 ); | 971 | configureToolBarMenu->insertItem(icon, i18n("Work Week"), 50 ); |
950 | QAction* day5_action = new QAction( i18n("Work Week"), icon, i18n("Work Week"), 0, this ); | 972 | QAction* day5_action = new QAction( i18n("Work Week"), icon, i18n("Work Week"), 0, this ); |
951 | day5_action->addTo( viewMenu ); | 973 | day5_action->addTo( viewMenu ); |
952 | connect( day5_action, SIGNAL( activated() ), | 974 | connect( day5_action, SIGNAL( activated() ), |
953 | mView->viewManager(), SLOT( showWorkWeekView() ) ); | 975 | mView->viewManager(), SLOT( showWorkWeekView() ) ); |
954 | 976 | ||
955 | icon = loadPixmap( pathString + "week" ); | 977 | icon = loadPixmap( pathString + "week" ); |
956 | configureToolBarMenu->insertItem(icon, i18n("Week"), 60 ); | 978 | configureToolBarMenu->insertItem(icon, i18n("Week"), 60 ); |
957 | QAction* day7_action = new QAction( i18n("Week"), icon, i18n("Week"), 0, this ); | 979 | QAction* day7_action = new QAction( i18n("Week"), icon, i18n("Week"), 0, this ); |
958 | day7_action->addTo( viewMenu ); | 980 | day7_action->addTo( viewMenu ); |
959 | connect( day7_action, SIGNAL( activated() ), | 981 | connect( day7_action, SIGNAL( activated() ), |
960 | mView->viewManager(), SLOT( showWeekView() ) ); | 982 | mView->viewManager(), SLOT( showWeekView() ) ); |
961 | 983 | ||
962 | icon = loadPixmap( pathString + "workweek2" ); | 984 | icon = loadPixmap( pathString + "workweek2" ); |
963 | configureToolBarMenu->insertItem(icon, i18n("List week view"), 75 ); | 985 | configureToolBarMenu->insertItem(icon, i18n("List week view"), 75 ); |
964 | QAction* day6_action = new QAction( i18n("List week"), icon, i18n("List week"), 0, this ); | 986 | QAction* day6_action = new QAction( i18n("List week"), icon, i18n("List week"), 0, this ); |
965 | day6_action->addTo( viewMenu ); | 987 | day6_action->addTo( viewMenu ); |
966 | connect( day6_action, SIGNAL( activated() ), | 988 | connect( day6_action, SIGNAL( activated() ), |
967 | mView->viewManager(), SLOT( showMonthViewWeek() ) ); | 989 | mView->viewManager(), SLOT( showMonthViewWeek() ) ); |
968 | 990 | ||
969 | icon = loadPixmap( pathString + "month" ); | 991 | icon = loadPixmap( pathString + "month" ); |
970 | configureToolBarMenu->insertItem(icon, i18n("Month"), 70 ); | 992 | configureToolBarMenu->insertItem(icon, i18n("Month"), 70 ); |
971 | QAction* month_action = new QAction( i18n("Month"), icon, i18n("Month"), 0, this ); | 993 | QAction* month_action = new QAction( i18n("Month"), icon, i18n("Month"), 0, this ); |
972 | month_action->addTo( viewMenu ); | 994 | month_action->addTo( viewMenu ); |
973 | connect( month_action, SIGNAL( activated() ), | 995 | connect( month_action, SIGNAL( activated() ), |
974 | mView->viewManager(), SLOT( showMonthView() ) ); | 996 | mView->viewManager(), SLOT( showMonthView() ) ); |
975 | 997 | ||
976 | icon = loadPixmap( pathString + "list" ); | 998 | icon = loadPixmap( pathString + "list" ); |
977 | configureToolBarMenu->insertItem(icon, i18n("List View"), 30 ); | 999 | configureToolBarMenu->insertItem(icon, i18n("List View"), 30 ); |
978 | QAction* showlist_action = new QAction( i18n("List View"), icon, i18n("List View"), 0, this ); | 1000 | QAction* showlist_action = new QAction( i18n("List View"), icon, i18n("List View"), 0, this ); |
979 | showlist_action->addTo( viewMenu ); | 1001 | showlist_action->addTo( viewMenu ); |
980 | connect( showlist_action, SIGNAL( activated() ), | 1002 | connect( showlist_action, SIGNAL( activated() ), |
981 | mView->viewManager(), SLOT( showListView() ) ); | 1003 | mView->viewManager(), SLOT( showListView() ) ); |
982 | 1004 | ||
983 | icon = loadPixmap( pathString + "todo" ); | 1005 | icon = loadPixmap( pathString + "todo" ); |
984 | configureToolBarMenu->insertItem(icon, i18n("Todo View"), 80 ); | 1006 | configureToolBarMenu->insertItem(icon, i18n("Todo View"), 80 ); |
985 | QAction* todoview_action = new QAction( i18n("Todo View"), icon, i18n("Todo View"), 0, this ); | 1007 | QAction* todoview_action = new QAction( i18n("Todo View"), icon, i18n("Todo View"), 0, this ); |
986 | todoview_action->addTo( viewMenu ); | 1008 | todoview_action->addTo( viewMenu ); |
987 | connect( todoview_action, SIGNAL( activated() ), | 1009 | connect( todoview_action, SIGNAL( activated() ), |
988 | mView->viewManager(), SLOT( showTodoView() ) ); | 1010 | mView->viewManager(), SLOT( showTodoView() ) ); |
989 | 1011 | ||
990 | 1012 | ||
991 | 1013 | ||
992 | #if 0 | 1014 | #if 0 |
993 | action = new QAction( "view_timespan", "Time Span", 0, this ); | 1015 | action = new QAction( "view_timespan", "Time Span", 0, this ); |
994 | action->addTo( viewMenu ); | 1016 | action->addTo( viewMenu ); |
995 | connect( action, SIGNAL( activated() ), | 1017 | connect( action, SIGNAL( activated() ), |
996 | mView->viewManager(), SLOT( showTimeSpanView() ) ); | 1018 | mView->viewManager(), SLOT( showTimeSpanView() ) ); |
997 | #endif | 1019 | #endif |
998 | 1020 | ||
999 | mNewSubTodoAction = new QAction( "new_subtodo", i18n("New Sub-Todo..."), 0, | 1021 | |
1000 | this ); | ||
1001 | mNewSubTodoAction->addTo( actionMenu ); | ||
1002 | connect( mNewSubTodoAction, SIGNAL( activated() ), | ||
1003 | mView, SLOT( newSubTodo() ) ); | ||
1004 | 1022 | ||
1005 | action = new QAction( "purge_completed", i18n("Purge Completed..."), 0, | 1023 | action = new QAction( "purge_completed", i18n("Purge Completed..."), 0, |
1006 | this ); | 1024 | this ); |
1007 | action->addTo( actionMenu ); | 1025 | action->addTo( actionMenu ); |
1008 | connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) ); | 1026 | connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) ); |
1009 | 1027 | ||
1010 | 1028 | ||
1011 | configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 5); | 1029 | configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 5); |
1012 | 1030 | ||
1013 | 1031 | ||
1014 | 1032 | ||
1015 | actionMenu->insertSeparator(); | 1033 | actionMenu->insertSeparator(); |
1016 | action = new QAction( "manage cat", i18n("Edit category list..."), 0, | 1034 | action = new QAction( "manage cat", i18n("Edit category list..."), 0, |
1017 | this ); | 1035 | this ); |
1018 | action->addTo( actionMenu ); | 1036 | action->addTo( actionMenu ); |
1019 | connect( action, SIGNAL( activated() ), mView, SLOT( editCategories() ) ); | 1037 | connect( action, SIGNAL( activated() ), mView, SLOT( editCategories() ) ); |
1020 | 1038 | ||
1021 | action = new QAction( "manage cat", i18n("Manage new categories..."), 0, | 1039 | action = new QAction( "manage cat", i18n("Manage new categories..."), 0, |
1022 | this ); | 1040 | this ); |
1023 | action->addTo( actionMenu ); | 1041 | action->addTo( actionMenu ); |
1024 | connect( action, SIGNAL( activated() ), mView, SLOT( manageCategories() ) ); | 1042 | connect( action, SIGNAL( activated() ), mView, SLOT( manageCategories() ) ); |
1025 | 1043 | ||
1026 | 1044 | ||
1027 | actionMenu->insertSeparator(); | 1045 | actionMenu->insertSeparator(); |
1028 | icon = loadPixmap( pathString + "configure" ); | 1046 | icon = loadPixmap( pathString + "configure" ); |
1029 | action = new QAction( i18n("Configure"),icon, i18n("Configure KO/Pi..."), 0, this ); | 1047 | action = new QAction( i18n("Configure"),icon, i18n("Configure KO/Pi..."), 0, this ); |
1030 | action->addTo( actionMenu ); | 1048 | action->addTo( actionMenu ); |
1031 | connect( action, SIGNAL( activated() ), | 1049 | connect( action, SIGNAL( activated() ), |
1032 | mView, SLOT( edit_options() ) ); | 1050 | mView, SLOT( edit_options() ) ); |
1033 | action = new QAction( i18n("Configure"),icon, i18n("Configure Calendar Files..."), 0, this ); | 1051 | action = new QAction( i18n("Configure"),icon, i18n("Configure Calendar Files..."), 0, this ); |
1034 | action->addTo( actionMenu ); | 1052 | action->addTo( actionMenu ); |
1035 | connect( action, SIGNAL( activated() ), | 1053 | connect( action, SIGNAL( activated() ), |
1036 | this, SLOT( calHint() ) ); | 1054 | this, SLOT( calHint() ) ); |
1037 | action = new QAction( i18n("Configure"),icon, i18n("Global Settings..."), 0, this ); | 1055 | action = new QAction( i18n("Configure"),icon, i18n("Global Settings..."), 0, this ); |
1038 | action->addTo( actionMenu ); | 1056 | action->addTo( actionMenu ); |
1039 | connect( action, SIGNAL( activated() ), | 1057 | connect( action, SIGNAL( activated() ), |
1040 | mView, SLOT( edit_global_options() ) ); | 1058 | mView, SLOT( edit_global_options() ) ); |
1041 | if ( KOPrefs::instance()->mShowFullMenu ) { | 1059 | if ( KOPrefs::instance()->mShowFullMenu ) { |
1042 | actionMenu->insertItem( i18n("Configure Toolbar"),configureToolBarMenu ); | 1060 | actionMenu->insertItem( i18n("Configure Toolbar"),configureToolBarMenu ); |
1043 | 1061 | ||
1044 | } | 1062 | } |
1045 | // actionMenu->insertSeparator(); | 1063 | // actionMenu->insertSeparator(); |
1046 | action = new QAction( "import_qtopia", i18n("Import (*.ics/*.vcs) file"), 0, | 1064 | action = new QAction( "import_qtopia", i18n("Import (*.ics/*.vcs) file"), 0, |
1047 | this ); | 1065 | this ); |
1048 | action->addTo( importMenu_X ); | 1066 | action->addTo( importMenu_X ); |
1049 | connect( action, SIGNAL( activated() ), SLOT( importIcal() ) ); | 1067 | connect( action, SIGNAL( activated() ), SLOT( importIcal() ) ); |
1050 | action = new QAction( "import_quick", i18n("Import last file"), 0, | 1068 | action = new QAction( "import_quick", i18n("Import last file"), 0, |
1051 | this ); | 1069 | this ); |
1052 | action->addTo( importMenu_X ); | 1070 | action->addTo( importMenu_X ); |
1053 | connect( action, SIGNAL( activated() ), SLOT( quickImportIcal() ) ); | 1071 | connect( action, SIGNAL( activated() ), SLOT( quickImportIcal() ) ); |
1054 | importMenu_X->insertSeparator(); | 1072 | importMenu_X->insertSeparator(); |
1055 | action = new QAction( "import_bday", i18n("Import Birthdays (KA/Pi)"), 0, | 1073 | action = new QAction( "import_bday", i18n("Import Birthdays (KA/Pi)"), 0, |
1056 | this ); | 1074 | this ); |
1057 | action->addTo( importMenu_X ); | 1075 | action->addTo( importMenu_X ); |
1058 | connect( action, SIGNAL( activated() ), SLOT( importBday() ) ); | 1076 | connect( action, SIGNAL( activated() ), SLOT( importBday() ) ); |
1059 | //#ifndef DESKTOP_VERSION | 1077 | //#ifndef DESKTOP_VERSION |
1060 | importMenu_X->insertSeparator(); | 1078 | importMenu_X->insertSeparator(); |
1061 | action = new QAction( "import_qtopia", i18n("Import Opie/Qtopia Cal."), 0, | 1079 | action = new QAction( "import_qtopia", i18n("Import Opie/Qtopia Cal."), 0, |
1062 | this ); | 1080 | this ); |
1063 | action->addTo( importMenu_X ); | 1081 | action->addTo( importMenu_X ); |
1064 | connect( action, SIGNAL( activated() ), SLOT( importQtopia() ) ); | 1082 | connect( action, SIGNAL( activated() ), SLOT( importQtopia() ) ); |
1065 | //#else | 1083 | //#else |
1066 | #ifdef _OL_IMPORT_ | 1084 | #ifdef _OL_IMPORT_ |
1067 | importMenu_X->insertSeparator(); | 1085 | importMenu_X->insertSeparator(); |
@@ -1504,128 +1522,129 @@ void MainWindow::usertrans() | |||
1504 | 1522 | ||
1505 | void MainWindow::storagehowto() | 1523 | void MainWindow::storagehowto() |
1506 | { | 1524 | { |
1507 | KApplication::showFile( "KDE-Pim/Pi Storage HowTo", "kdepim/storagehowto.txt" ); | 1525 | KApplication::showFile( "KDE-Pim/Pi Storage HowTo", "kdepim/storagehowto.txt" ); |
1508 | } | 1526 | } |
1509 | void MainWindow::timetrackinghowto() | 1527 | void MainWindow::timetrackinghowto() |
1510 | { | 1528 | { |
1511 | KApplication::showFile( "KO/Pi Timetracking HowTo", "kdepim/timetrackerhowto.txt" ); | 1529 | KApplication::showFile( "KO/Pi Timetracking HowTo", "kdepim/timetrackerhowto.txt" ); |
1512 | } | 1530 | } |
1513 | void MainWindow::kdesynchowto() | 1531 | void MainWindow::kdesynchowto() |
1514 | { | 1532 | { |
1515 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/Zaurus-KDE_syncHowTo.txt" ); | 1533 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/Zaurus-KDE_syncHowTo.txt" ); |
1516 | } | 1534 | } |
1517 | void MainWindow::multisynchowto() | 1535 | void MainWindow::multisynchowto() |
1518 | { | 1536 | { |
1519 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/MultiSyncHowTo.txt" ); | 1537 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/MultiSyncHowTo.txt" ); |
1520 | } | 1538 | } |
1521 | void MainWindow::synchowto() | 1539 | void MainWindow::synchowto() |
1522 | { | 1540 | { |
1523 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" ); | 1541 | KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" ); |
1524 | } | 1542 | } |
1525 | void MainWindow::faq() | 1543 | void MainWindow::faq() |
1526 | { | 1544 | { |
1527 | KApplication::showFile( i18n("KO/Pi FAQ"), "kdepim/korganizer/kopiFAQ.txt" ); | 1545 | KApplication::showFile( i18n("KO/Pi FAQ"), "kdepim/korganizer/kopiFAQ.txt" ); |
1528 | 1546 | ||
1529 | } | 1547 | } |
1530 | void MainWindow::whatsNew() | 1548 | void MainWindow::whatsNew() |
1531 | { | 1549 | { |
1532 | KApplication::showFile( "KDE-Pim/Pi Version Info", "kdepim/WhatsNew.txt" ); | 1550 | KApplication::showFile( "KDE-Pim/Pi Version Info", "kdepim/WhatsNew.txt" ); |
1533 | 1551 | ||
1534 | } | 1552 | } |
1535 | void MainWindow::licence() | 1553 | void MainWindow::licence() |
1536 | { | 1554 | { |
1537 | KApplication::showLicence(); | 1555 | KApplication::showLicence(); |
1538 | 1556 | ||
1539 | } | 1557 | } |
1540 | void MainWindow::about() | 1558 | void MainWindow::about() |
1541 | { | 1559 | { |
1542 | QString version; | 1560 | QString version; |
1543 | #include <../version> | 1561 | #include <../version> |
1544 | QMessageBox::about( this, i18n("About KOrganizer/Pi"), | 1562 | QMessageBox::about( this, i18n("About KOrganizer/Pi"), |
1545 | i18n("KOrganizer/Platform-independent\n") + | 1563 | i18n("KOrganizer/Platform-independent\n") + |
1546 | "(KO/Pi) " + version + " - " + | 1564 | "(KO/Pi) " + version + " - " + |
1547 | 1565 | ||
1548 | #ifdef DESKTOP_VERSION | 1566 | #ifdef DESKTOP_VERSION |
1549 | i18n("Desktop Edition\n") + | 1567 | i18n("Desktop Edition\n") + |
1550 | #else | 1568 | #else |
1551 | i18n("PDA-Edition\nfor: Zaurus 5x00/7x0/860/3000/6000\n") + | 1569 | i18n("PDA-Edition\nfor: Zaurus 5x00/7x0/860/3000/6000\n") + |
1552 | #endif | 1570 | #endif |
1553 | i18n("(c)2004 Lutz Rogowski (rogowski@kde.org)\nKO/Pi is based on KOrganizer\n(c)2002,2003 Cornelius Schumacher\n(schumacher@kde.org) and the KDE team.\nKOrganizer/Pi is licensed under the GPL.\nKO/Pi can be compiled for\nLinux, Zaurus-PDA and Windows\nwww.pi-sync.info --- www.korganizer.org\nSpecial thanks to Michael and Ben\nfor intensive testing!") ); | 1571 | i18n("(c)2004 Lutz Rogowski (rogowski@kde.org)\nKO/Pi is based on KOrganizer\n(c)2002,2003 Cornelius Schumacher\n(schumacher@kde.org) and the KDE team.\nKOrganizer/Pi is licensed under the GPL.\nKO/Pi can be compiled for\nLinux, Zaurus-PDA and Windows\nwww.pi-sync.info --- www.korganizer.org\nSpecial thanks to Michael and Ben\nfor intensive testing!") ); |
1554 | } | 1572 | } |
1555 | void MainWindow::keyBindings() | 1573 | void MainWindow::keyBindings() |
1556 | { | 1574 | { |
1557 | QString cap = i18n("KO/Pi Keys + Colors"); | 1575 | QString cap = i18n("KO/Pi Keys + Colors"); |
1558 | QString text = i18n("<p><h2>KO/Pi key shortcuts:</h2></p>\n") + | 1576 | QString text = i18n("<p><h2>KO/Pi key shortcuts:</h2></p>\n") + |
1559 | i18n("<p><b>H</b>: This help dialog | <b>S</b>: Search dialog</p>\n")+ | 1577 | i18n("<p><b>H</b>: This help dialog | <b>S</b>: Search dialog</p>\n")+ |
1560 | i18n("<p><b>N</b>: Switch to next view which has a toolbar icon</p>\n") + | 1578 | i18n("<p><b>N</b>: Switch to next view which has a toolbar icon</p>\n") + |
1561 | i18n("<p><b>A+(shift or ctrl)</b>: Show occurence of next alarm</p>\n") + | 1579 | i18n("<p><b>A+(shift or ctrl)</b>: Show occurence of next alarm</p>\n") + |
1562 | i18n("<p><b>I</b>: Show info for selected event/todo</p>\n") + | 1580 | i18n("<p><b>I</b>: Show info for selected event/todo</p>\n") + |
1563 | i18n("<p><b>Space</b>: Toggle fullscreen | <b>P</b>: Date picker</p>\n")+ | 1581 | i18n("<p><b>Space</b>: Toggle fullscreen | <b>P</b>: Date picker</p>\n")+ |
1564 | i18n("<p><b>R</b>: Toggle Resource View |<b>F</b>: Edit filter </p>\n")+ | 1582 | i18n("<p><b>R</b>: Toggle Resource View |<b>F</b>: Edit filter </p>\n")+ |
1565 | i18n("<p><b>O</b>: Filter On/Off | <b>J</b>: Journal view</p>\n")+ | 1583 | i18n("<p><b>O</b>: Filter On/Off | <b>J</b>: Journal view</p>\n")+ |
1566 | i18n("<p><b>1-0</b> (+<b>ctrl</b>): Select filter 1-10 (11-20)</p>\n")+ | 1584 | i18n("<p><b>1-0</b> (+<b>ctrl</b>): Select filter 1-10 (11-20)</p>\n")+ |
1567 | i18n("<p><b>X</b>: Next X days view| <b>W</b>: What's next view\n ")+ | 1585 | i18n("<p><b>X</b>: Next X days view| <b>W</b>: What's next view\n ")+ |
1586 | i18n("<p><b>Q</b>: Show next date with conflicting events\n ")+ | ||
1568 | i18n("<p><b>V</b>: Todo view | <b>L</b>: Event list view</p>\n")+ | 1587 | i18n("<p><b>V</b>: Todo view | <b>L</b>: Event list view</p>\n")+ |
1569 | i18n("<p><b>Z,Y</b>: Work week view | <b>U</b>: Week view</p>\n")+ | 1588 | i18n("<p><b>Z,Y</b>: Work week view | <b>U</b>: Week view</p>\n")+ |
1570 | i18n("<p><b>D</b>: One day view | <b>M</b>: Month view</p>\n")+ | 1589 | i18n("<p><b>D</b>: One day view | <b>M</b>: Month view</p>\n")+ |
1571 | i18n("<p><b>K</b>: Week view in Month view syle</p>\n")+ | 1590 | i18n("<p><b>K</b>: Week view in Month view syle</p>\n")+ |
1572 | i18n("<p><b>E</b>: Edit selected item |<b> E+ctrl</b>: New Event</p>\n")+ | 1591 | i18n("<p><b>E</b>: Edit selected item |<b> E+ctrl</b>: New Event</p>\n")+ |
1573 | i18n("<p><b>T</b>: Goto today | <b>T+ctrl</b>: New Todo</p>\n")+ | 1592 | i18n("<p><b>T</b>: Goto today | <b>T+ctrl</b>: New Todo</p>\n")+ |
1574 | i18n("<p><b>S+ctrl</b>: Add sub-todo | <b>X+ctrl</b>: Toggle datenavigator</p>\n")+ | 1593 | i18n("<p><b>S+ctrl</b>: Add sub-todo | <b>X+ctrl</b>: Toggle datenavigator</p>\n")+ |
1575 | i18n("<p><b>+,-</b> : Zoom in/out agenda | <b>A</b>: Toggle allday agenda height</p>\n")+ | 1594 | i18n("<p><b>+,-</b> : Zoom in/out agenda | <b>A</b>: Toggle allday agenda height</p>\n")+ |
1576 | i18n("<p><b>C</b>: Show current time in agenda view</p>\n")+ | 1595 | i18n("<p><b>C</b>: Show current time in agenda view</p>\n")+ |
1577 | i18n("<p><b>B</b>: Edit description (details) of selected item</p>\n")+ | 1596 | i18n("<p><b>B</b>: Edit description (details) of selected item</p>\n")+ |
1578 | i18n("<p><b>right</b>: Next week | <b>right+ctrl</b>: Next month</p>\n")+ | 1597 | i18n("<p><b>right</b>: Next week | <b>right+ctrl</b>: Next month</p>\n")+ |
1579 | i18n("<p><b>left</b>: Prev. week | <b>left+ctrl</b>: Prev. month</p>\n")+ | 1598 | i18n("<p><b>left</b>: Prev. week | <b>left+ctrl</b>: Prev. month</p>\n")+ |
1580 | i18n("<p><b>del,backspace</b>: Delete selected item</p>\n")+ | 1599 | i18n("<p><b>del,backspace</b>: Delete selected item</p>\n")+ |
1581 | i18n("<p><h3>In agenda view:</h3></p>\n") + | 1600 | i18n("<p><h3>In agenda view:</h3></p>\n") + |
1582 | i18n("<p><b>up/down</b>: Scroll agenda view</p>\n")+ | 1601 | i18n("<p><b>up/down</b>: Scroll agenda view</p>\n")+ |
1583 | i18n("<p><b>ctrl+up/down</b>: Scroll small todo view</p>\n")+ | 1602 | i18n("<p><b>ctrl+up/down</b>: Scroll small todo view</p>\n")+ |
1584 | i18n("<p><h3>In todo view:</h3></p>\n") + | 1603 | i18n("<p><h3>In todo view:</h3></p>\n") + |
1585 | i18n("<p><b>shift+U</b>: <b>U</b>nparent todo (make root todo)</p>\n")+ | 1604 | i18n("<p><b>shift+U</b>: <b>U</b>nparent todo (make root todo)</p>\n")+ |
1586 | i18n("<p><b>shift+S</b>: Make <b>S</b>ubtodo (reparent todo)</p>\n")+ | 1605 | i18n("<p><b>shift+S</b>: Make <b>S</b>ubtodo (reparent todo)</p>\n")+ |
1587 | i18n("<p><b>shift+P</b>: Make new <b>P</b>arent for todo selected with shift+S</p>\n")+ | 1606 | i18n("<p><b>shift+P</b>: Make new <b>P</b>arent for todo selected with shift+S</p>\n")+ |
1588 | i18n("<p><b>Q</b>: Toggle quick todo line edit.</p>\n")+ | 1607 | i18n("<p><b>Q</b>: Toggle quick todo line edit.</p>\n")+ |
1589 | i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ | 1608 | i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ |
1590 | i18n("<p><b>return</b>: Mark item as completed+one step down.</p>\n")+ | 1609 | i18n("<p><b>return</b>: Mark item as completed+one step down.</p>\n")+ |
1591 | i18n("<p><b>return+shift</b>: Mark item as not completed+one step down</p>\n")+ | 1610 | i18n("<p><b>return+shift</b>: Mark item as not completed+one step down</p>\n")+ |
1592 | i18n("<p><h3>In list view:</h3></p>\n") + | 1611 | i18n("<p><h3>In list view:</h3></p>\n") + |
1593 | i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ | 1612 | i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ |
1594 | i18n("<p><b>return</b>: Select item+one step down</p>\n")+ | 1613 | i18n("<p><b>return</b>: Select item+one step down</p>\n")+ |
1595 | i18n("<p><b>return+shift</b>: Deselect item+one step down</p>\n")+ | 1614 | i18n("<p><b>return+shift</b>: Deselect item+one step down</p>\n")+ |
1596 | i18n("<p><b>up/down</b>: Next/prev item</p>\n")+ | 1615 | i18n("<p><b>up/down</b>: Next/prev item</p>\n")+ |
1597 | i18n("<p><b>ctrl+up/down</b>: Goto up/down by 20% of items</p>\n")+ | 1616 | i18n("<p><b>ctrl+up/down</b>: Goto up/down by 20% of items</p>\n")+ |
1598 | i18n("<p><b>shift+up/down</b>: Goto first/last item</p>\n")+ | 1617 | i18n("<p><b>shift+up/down</b>: Goto first/last item</p>\n")+ |
1599 | i18n("<p><h3>In event/todo viewer:</h3></p>\n") + | 1618 | i18n("<p><h3>In event/todo viewer:</h3></p>\n") + |
1600 | i18n("<p><b>I,C</b>: Close dialog.</p>\n")+ | 1619 | i18n("<p><b>I,C</b>: Close dialog.</p>\n")+ |
1601 | i18n("<p><b>A</b>: Show agenda view.</p>\n")+ | 1620 | i18n("<p><b>A</b>: Show agenda view.</p>\n")+ |
1602 | i18n("<p><b>E</b>: Edit item</p>\n") + | 1621 | i18n("<p><b>E</b>: Edit item</p>\n") + |
1603 | i18n("<p><h2>KO/Pi icon colors:</h2></p>\n") + | 1622 | i18n("<p><h2>KO/Pi icon colors:</h2></p>\n") + |
1604 | i18n("<p><b>(for square icons in agenda and month view)</b></p>\n") + | 1623 | i18n("<p><b>(for square icons in agenda and month view)</b></p>\n") + |
1605 | i18n("<p><b>Cross</b>: Item cancelled.([c] in Whats'Next view)</p>\n")+ | 1624 | i18n("<p><b>Cross</b>: Item cancelled.([c] in Whats'Next view)</p>\n")+ |
1606 | i18n("<p><b>Red</b>: Alarm set.([a] in Whats'Next view)</p>\n")+ | 1625 | i18n("<p><b>Red</b>: Alarm set.([a] in Whats'Next view)</p>\n")+ |
1607 | i18n("<p><b>Blue</b>: Recurrent event.([r] in Whats'Next view)</p>\n")+ | 1626 | i18n("<p><b>Blue</b>: Recurrent event.([r] in Whats'Next view)</p>\n")+ |
1608 | i18n("<p><b>Dark green</b>: Information(description) available.([i] in WN view)</p>\n")+ | 1627 | i18n("<p><b>Dark green</b>: Information(description) available.([i] in WN view)</p>\n")+ |
1609 | i18n("<p><b>Black</b>: Event/todo with attendees. You are the organizer!</p>\n")+ | 1628 | i18n("<p><b>Black</b>: Event/todo with attendees. You are the organizer!</p>\n")+ |
1610 | i18n("<p><b>Dark yellow</b>: Event/todo with attendees.</p>\n") + | 1629 | i18n("<p><b>Dark yellow</b>: Event/todo with attendees.</p>\n") + |
1611 | i18n("<p><b>White</b>: Item readonly</p>\n"); | 1630 | i18n("<p><b>White</b>: Item readonly</p>\n"); |
1612 | displayText( text, cap); | 1631 | displayText( text, cap); |
1613 | } | 1632 | } |
1614 | void MainWindow::aboutAutoSaving() | 1633 | void MainWindow::aboutAutoSaving() |
1615 | { | 1634 | { |
1616 | QString text = i18n("After changing something, the data is\nautomatically saved to the file\n~/kdepim/apps/korganizer/mycalendar.ics\nafter (configurable) three minutes.\nFor safety reasons there is one autosaving\nafter 10 minutes (of idle time) again. The \ndata is saved automatically when closing KO/Pi\nYou can create a backup file \nwith: File - Save Calendar Backup\n"); | 1635 | QString text = i18n("After changing something, the data is\nautomatically saved to the file\n~/kdepim/apps/korganizer/mycalendar.ics\nafter (configurable) three minutes.\nFor safety reasons there is one autosaving\nafter 10 minutes (of idle time) again. The \ndata is saved automatically when closing KO/Pi\nYou can create a backup file \nwith: File - Save Calendar Backup\n"); |
1617 | 1636 | ||
1618 | KApplication::showText( i18n("Auto Saving in KOrganizer/Pi"), text); | 1637 | KApplication::showText( i18n("Auto Saving in KOrganizer/Pi"), text); |
1619 | 1638 | ||
1620 | } | 1639 | } |
1621 | void MainWindow::aboutKnownBugs() | 1640 | void MainWindow::aboutKnownBugs() |
1622 | { | 1641 | { |
1623 | QMessageBox* msg; | 1642 | QMessageBox* msg; |
1624 | msg = new QMessageBox( i18n("Known Problems in KOrganizer/Pi"), | 1643 | msg = new QMessageBox( i18n("Known Problems in KOrganizer/Pi"), |
1625 | i18n("1) Importing *.vcs or *.ics files from\nother applications may not work properly,\nif there are events with properties\nKO/Pi does not support.\n")+ | 1644 | i18n("1) Importing *.vcs or *.ics files from\nother applications may not work properly,\nif there are events with properties\nKO/Pi does not support.\n")+ |
1626 | i18n("2) Audio alarm daemon\nfor Zaurus is available!\nas an additional small application\n")+ | 1645 | i18n("2) Audio alarm daemon\nfor Zaurus is available!\nas an additional small application\n")+ |
1627 | i18n("\nPlease report unexpected behaviour to\nlutz@pi-sync.info\n") + | 1646 | i18n("\nPlease report unexpected behaviour to\nlutz@pi-sync.info\n") + |
1628 | i18n("\nor report them in the bugtracker on\n") + | 1647 | i18n("\nor report them in the bugtracker on\n") + |
1629 | i18n("\nhttp://sourceforge.net/projects/kdepimpi\n"), | 1648 | i18n("\nhttp://sourceforge.net/projects/kdepimpi\n"), |
1630 | QMessageBox::NoIcon, | 1649 | QMessageBox::NoIcon, |
1631 | QMessageBox::Ok, | 1650 | QMessageBox::Ok, |
@@ -2038,128 +2057,136 @@ void MainWindow::keyPressEvent ( QKeyEvent * e ) | |||
2038 | else | 2057 | else |
2039 | mView->dialogManager()->showSearchDialog(); | 2058 | mView->dialogManager()->showSearchDialog(); |
2040 | break; | 2059 | break; |
2041 | case Qt::Key_Y : | 2060 | case Qt::Key_Y : |
2042 | case Qt::Key_Z : | 2061 | case Qt::Key_Z : |
2043 | mView->viewManager()->showWorkWeekView(); | 2062 | mView->viewManager()->showWorkWeekView(); |
2044 | showSelectedDates = true; | 2063 | showSelectedDates = true; |
2045 | break; | 2064 | break; |
2046 | case Qt::Key_U : | 2065 | case Qt::Key_U : |
2047 | mView->viewManager()->showWeekView(); | 2066 | mView->viewManager()->showWeekView(); |
2048 | showSelectedDates = true; | 2067 | showSelectedDates = true; |
2049 | break; | 2068 | break; |
2050 | case Qt::Key_H : | 2069 | case Qt::Key_H : |
2051 | keyBindings(); | 2070 | keyBindings(); |
2052 | break; | 2071 | break; |
2053 | case Qt::Key_W: | 2072 | case Qt::Key_W: |
2054 | mView->viewManager()->showWhatsNextView(); | 2073 | mView->viewManager()->showWhatsNextView(); |
2055 | break; | 2074 | break; |
2056 | case Qt::Key_L: | 2075 | case Qt::Key_L: |
2057 | mView->viewManager()->showListView(); | 2076 | mView->viewManager()->showListView(); |
2058 | break; | 2077 | break; |
2059 | case Qt::Key_N: | 2078 | case Qt::Key_N: |
2060 | mView->viewManager()->showNextView(); | 2079 | mView->viewManager()->showNextView(); |
2061 | break; | 2080 | break; |
2062 | case Qt::Key_V: | 2081 | case Qt::Key_V: |
2063 | mView->viewManager()->showTodoView(); | 2082 | mView->viewManager()->showTodoView(); |
2064 | break; | 2083 | break; |
2065 | case Qt::Key_C: | 2084 | case Qt::Key_C: |
2066 | mView->viewManager()->agendaView()->setStartHour( QTime::currentTime ().hour() ); | 2085 | mView->viewManager()->agendaView()->setStartHour( QTime::currentTime ().hour() ); |
2067 | break; | 2086 | break; |
2068 | case Qt::Key_P: | 2087 | case Qt::Key_P: |
2069 | mView->showDatePicker( ); | 2088 | mView->showDatePicker( ); |
2070 | break; | 2089 | break; |
2071 | case Qt::Key_F: | 2090 | case Qt::Key_F: |
2072 | mView->editFilters(); | 2091 | mView->editFilters(); |
2073 | break; | 2092 | break; |
2074 | case Qt::Key_R: | 2093 | case Qt::Key_R: |
2075 | mView->toggleFilter(); | 2094 | mView->toggleFilter(); |
2076 | break; | 2095 | break; |
2077 | case Qt::Key_X: | 2096 | case Qt::Key_X: |
2078 | if ( e->state() == Qt::ControlButton ) | 2097 | if ( e->state() == Qt::ControlButton ) |
2079 | mView->toggleDateNavigatorWidget(); | 2098 | mView->toggleDateNavigatorWidget(); |
2080 | else { | 2099 | else { |
2081 | mView->viewManager()->showNextXView(); | 2100 | mView->viewManager()->showNextXView(); |
2082 | showSelectedDates = true; | 2101 | showSelectedDates = true; |
2083 | } | 2102 | } |
2084 | break; | 2103 | break; |
2085 | case Qt::Key_Space: | 2104 | case Qt::Key_Space: |
2086 | mView->toggleExpand(); | 2105 | mView->toggleExpand(); |
2087 | break; | 2106 | break; |
2088 | case Qt::Key_A: | 2107 | case Qt::Key_A: |
2089 | if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton ) | 2108 | if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton ) |
2090 | mView->showNextAlarms(); | 2109 | mView->showNextAlarms(); |
2091 | else | 2110 | else |
2092 | mView->toggleAllDaySize(); | 2111 | mView->toggleAllDaySize(); |
2093 | break; | 2112 | break; |
2094 | case Qt::Key_T: | 2113 | case Qt::Key_T: |
2095 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) | 2114 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) |
2096 | mView->newTodo(); | 2115 | mView->newTodo(); |
2097 | else { | 2116 | else { |
2098 | mView->goToday(); | 2117 | mView->goToday(); |
2099 | showSelectedDates = true; | 2118 | showSelectedDates = true; |
2100 | } | 2119 | } |
2101 | break; | 2120 | break; |
2121 | case Qt::Key_Q: | ||
2122 | if ( e->state() == Qt::ControlButton ) | ||
2123 | mView->conflictNotAll(); | ||
2124 | else if ( e->state() == Qt::ShiftButton ) | ||
2125 | mView->conflictAllday(); | ||
2126 | else | ||
2127 | mView->conflictAll(); | ||
2128 | break; | ||
2102 | case Qt::Key_J: | 2129 | case Qt::Key_J: |
2103 | mView->viewManager()->showJournalView(); | 2130 | mView->viewManager()->showJournalView(); |
2104 | break; | 2131 | break; |
2105 | case Qt::Key_B: | 2132 | case Qt::Key_B: |
2106 | mView->editIncidenceDescription();; | 2133 | mView->editIncidenceDescription();; |
2107 | break; | 2134 | break; |
2108 | // case Qt::Key_Return: | 2135 | // case Qt::Key_Return: |
2109 | case Qt::Key_E: | 2136 | case Qt::Key_E: |
2110 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) | 2137 | if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) |
2111 | mView->newEvent(); | 2138 | mView->newEvent(); |
2112 | else | 2139 | else |
2113 | mView->editIncidence(); | 2140 | mView->editIncidence(); |
2114 | break; | 2141 | break; |
2115 | case Qt::Key_Plus: | 2142 | case Qt::Key_Plus: |
2116 | size = p->mHourSize +2; | 2143 | size = p->mHourSize +2; |
2117 | if ( size <= 22 ) | 2144 | if ( size <= 22 ) |
2118 | configureAgenda( size ); | 2145 | configureAgenda( size ); |
2119 | break; | 2146 | break; |
2120 | case Qt::Key_Minus: | 2147 | case Qt::Key_Minus: |
2121 | size = p->mHourSize - 2; | 2148 | size = p->mHourSize - 2; |
2122 | if ( size >= 4 ) | 2149 | if ( size >= 4 ) |
2123 | configureAgenda( size ); | 2150 | configureAgenda( size ); |
2124 | break; | 2151 | break; |
2125 | 2152 | ||
2126 | 2153 | ||
2127 | default: | 2154 | default: |
2128 | e->ignore(); | 2155 | e->ignore(); |
2129 | } | 2156 | } |
2130 | if ( pro > 0 ) { | 2157 | if ( pro > 0 ) { |
2131 | selectFilter( pro+1 ); | 2158 | selectFilter( pro+1 ); |
2132 | } | 2159 | } |
2133 | if ( showSelectedDates ) { | 2160 | if ( showSelectedDates ) { |
2134 | ;// setCaptionToDates(); | 2161 | ;// setCaptionToDates(); |
2135 | } | 2162 | } |
2136 | 2163 | ||
2137 | } | 2164 | } |
2138 | void MainWindow::fillFilterMenuTB() | 2165 | void MainWindow::fillFilterMenuTB() |
2139 | { | 2166 | { |
2140 | selectFilterMenuTB->clear(); | 2167 | selectFilterMenuTB->clear(); |
2141 | selectFilterMenuTB->insertItem(i18n ( "Edit Filters" ), 0 ); | 2168 | selectFilterMenuTB->insertItem(i18n ( "Edit Filters" ), 0 ); |
2142 | selectFilterMenuTB->insertSeparator(); | 2169 | selectFilterMenuTB->insertSeparator(); |
2143 | selectFilterMenuTB->insertItem(i18n ( "No Filter" ), 1 ); | 2170 | selectFilterMenuTB->insertItem(i18n ( "No Filter" ), 1 ); |
2144 | 2171 | ||
2145 | selectFilterMenuTB->insertSeparator(); | 2172 | selectFilterMenuTB->insertSeparator(); |
2146 | QPtrList<CalFilter> fili = mView->filters(); | 2173 | QPtrList<CalFilter> fili = mView->filters(); |
2147 | CalFilter *curfilter = mView->filterView()->selectedFilter(); | 2174 | CalFilter *curfilter = mView->filterView()->selectedFilter(); |
2148 | CalFilter *filter = fili.first(); | 2175 | CalFilter *filter = fili.first(); |
2149 | int iii = 2; | 2176 | int iii = 2; |
2150 | bool checkitem = mView->filterView()->filtersEnabled(); | 2177 | bool checkitem = mView->filterView()->filtersEnabled(); |
2151 | while(filter) { | 2178 | while(filter) { |
2152 | selectFilterMenuTB->insertItem( filter->name(), iii ); | 2179 | selectFilterMenuTB->insertItem( filter->name(), iii ); |
2153 | if ( filter == curfilter) | 2180 | if ( filter == curfilter) |
2154 | selectFilterMenuTB->setItemChecked( iii, checkitem ); | 2181 | selectFilterMenuTB->setItemChecked( iii, checkitem ); |
2155 | filter = fili.next(); | 2182 | filter = fili.next(); |
2156 | ++iii; | 2183 | ++iii; |
2157 | } | 2184 | } |
2158 | if ( !checkitem ) | 2185 | if ( !checkitem ) |
2159 | selectFilterMenuTB->setItemChecked( 1, true ); | 2186 | selectFilterMenuTB->setItemChecked( 1, true ); |
2160 | 2187 | ||
2161 | int x = 0; | 2188 | int x = 0; |
2162 | int y = iconToolBar->height(); | 2189 | int y = iconToolBar->height(); |
2163 | int dX = 0; | 2190 | int dX = 0; |
2164 | int dY = 0; | 2191 | int dY = 0; |
2165 | if ( iconToolBar->orientation () == Qt:: Horizontal ) { | 2192 | if ( iconToolBar->orientation () == Qt:: Horizontal ) { |