summaryrefslogtreecommitdiffabout
path: root/korganizer
Unidiff
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp29
-rw-r--r--korganizer/koprefs.cpp6
-rw-r--r--korganizer/mainwindow.cpp13
3 files changed, 35 insertions, 13 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 1024b4e..b3686aa 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -3738,403 +3738,424 @@ void CalendarView::exportICalendar()
3738 3738
3739 // Force correct extension 3739 // Force correct extension
3740 if (filename.right(4) != ".ics") filename += ".ics"; 3740 if (filename.right(4) != ".ics") filename += ".ics";
3741 3741
3742 FileStorage storage( mCalendar, filename, new ICalFormat() ); 3742 FileStorage storage( mCalendar, filename, new ICalFormat() );
3743 storage.save(); 3743 storage.save();
3744} 3744}
3745 3745
3746bool CalendarView::exportVCalendar( QString filename ) 3746bool CalendarView::exportVCalendar( QString filename )
3747{ 3747{
3748 if (mCalendar->journals().count() > 0) { 3748 if (mCalendar->journals().count() > 0) {
3749 int result = KMessageBox::warningContinueCancel(this, 3749 int result = KMessageBox::warningContinueCancel(this,
3750 i18n("The journal entries can not be\nexported to a vCalendar file."), 3750 i18n("The journal entries can not be\nexported to a vCalendar file."),
3751 i18n("Data Loss Warning"),i18n("Proceed"),i18n("Cancel"), 3751 i18n("Data Loss Warning"),i18n("Proceed"),i18n("Cancel"),
3752 true); 3752 true);
3753 if (result != KMessageBox::Continue) return false; 3753 if (result != KMessageBox::Continue) return false;
3754 } 3754 }
3755 3755
3756 //QString filename = KFileDialog::getSaveFileName("vcalout.vcs",i18n("*.vcs|VCalendars"),this); 3756 //QString filename = KFileDialog::getSaveFileName("vcalout.vcs",i18n("*.vcs|VCalendars"),this);
3757 3757
3758 // Force correct extension 3758 // Force correct extension
3759 if (filename.right(4) != ".vcs") filename += ".vcs"; 3759 if (filename.right(4) != ".vcs") filename += ".vcs";
3760 3760
3761 FileStorage storage( mCalendar, filename, new VCalFormat ); 3761 FileStorage storage( mCalendar, filename, new VCalFormat );
3762 return storage.save(); 3762 return storage.save();
3763 3763
3764} 3764}
3765 3765
3766void CalendarView::eventUpdated(Incidence *) 3766void CalendarView::eventUpdated(Incidence *)
3767{ 3767{
3768 setModified(); 3768 setModified();
3769 // Don't call updateView here. The code, which has caused the update of the 3769 // Don't call updateView here. The code, which has caused the update of the
3770 // event is responsible for updating the view. 3770 // event is responsible for updating the view.
3771 // updateView(); 3771 // updateView();
3772} 3772}
3773 3773
3774void CalendarView::adaptNavigationUnits() 3774void CalendarView::adaptNavigationUnits()
3775{ 3775{
3776 if (mViewManager->currentView()->isEventView()) { 3776 if (mViewManager->currentView()->isEventView()) {
3777 int days = mViewManager->currentView()->currentDateCount(); 3777 int days = mViewManager->currentView()->currentDateCount();
3778 if (days == 1) { 3778 if (days == 1) {
3779 emit changeNavStringPrev(i18n("&Previous Day")); 3779 emit changeNavStringPrev(i18n("&Previous Day"));
3780 emit changeNavStringNext(i18n("&Next Day")); 3780 emit changeNavStringNext(i18n("&Next Day"));
3781 } else { 3781 } else {
3782 emit changeNavStringPrev(i18n("&Previous Week")); 3782 emit changeNavStringPrev(i18n("&Previous Week"));
3783 emit changeNavStringNext(i18n("&Next Week")); 3783 emit changeNavStringNext(i18n("&Next Week"));
3784 } 3784 }
3785 } 3785 }
3786} 3786}
3787 3787
3788void CalendarView::processMainViewSelection( Incidence *incidence ) 3788void CalendarView::processMainViewSelection( Incidence *incidence )
3789{ 3789{
3790 if ( incidence ) mTodoList->clearSelection(); 3790 if ( incidence ) mTodoList->clearSelection();
3791 processIncidenceSelection( incidence ); 3791 processIncidenceSelection( incidence );
3792} 3792}
3793 3793
3794void CalendarView::processTodoListSelection( Incidence *incidence ) 3794void CalendarView::processTodoListSelection( Incidence *incidence )
3795{ 3795{
3796 if ( incidence && mViewManager->currentView() ) { 3796 if ( incidence && mViewManager->currentView() ) {
3797 mViewManager->currentView()->clearSelection(); 3797 mViewManager->currentView()->clearSelection();
3798 } 3798 }
3799 processIncidenceSelection( incidence ); 3799 processIncidenceSelection( incidence );
3800} 3800}
3801 3801
3802void CalendarView::processIncidenceSelection( Incidence *incidence ) 3802void CalendarView::processIncidenceSelection( Incidence *incidence )
3803{ 3803{
3804 if ( incidence == mSelectedIncidence ) return; 3804 if ( incidence == mSelectedIncidence ) return;
3805 3805
3806 mSelectedIncidence = incidence; 3806 mSelectedIncidence = incidence;
3807 3807
3808 emit incidenceSelected( mSelectedIncidence ); 3808 emit incidenceSelected( mSelectedIncidence );
3809 3809
3810 if ( incidence && incidence->typeID() == eventID ) { 3810 if ( incidence && incidence->typeID() == eventID ) {
3811 Event *event = static_cast<Event *>( incidence ); 3811 Event *event = static_cast<Event *>( incidence );
3812 if ( event->organizer() == KOPrefs::instance()->email() ) { 3812 if ( event->organizer() == KOPrefs::instance()->email() ) {
3813 emit organizerEventsSelected( true ); 3813 emit organizerEventsSelected( true );
3814 } else { 3814 } else {
3815 emit organizerEventsSelected(false); 3815 emit organizerEventsSelected(false);
3816 } 3816 }
3817 if (event->attendeeByMails( KOPrefs::instance()->mAdditionalMails, 3817 if (event->attendeeByMails( KOPrefs::instance()->mAdditionalMails,
3818 KOPrefs::instance()->email() ) ) { 3818 KOPrefs::instance()->email() ) ) {
3819 emit groupEventsSelected( true ); 3819 emit groupEventsSelected( true );
3820 } else { 3820 } else {
3821 emit groupEventsSelected(false); 3821 emit groupEventsSelected(false);
3822 } 3822 }
3823 return; 3823 return;
3824 } else { 3824 } else {
3825 if ( incidence && incidence->typeID() == todoID ) { 3825 if ( incidence && incidence->typeID() == todoID ) {
3826 emit todoSelected( true ); 3826 emit todoSelected( true );
3827 Todo *event = static_cast<Todo *>( incidence ); 3827 Todo *event = static_cast<Todo *>( incidence );
3828 if ( event->organizer() == KOPrefs::instance()->email() ) { 3828 if ( event->organizer() == KOPrefs::instance()->email() ) {
3829 emit organizerEventsSelected( true ); 3829 emit organizerEventsSelected( true );
3830 } else { 3830 } else {
3831 emit organizerEventsSelected(false); 3831 emit organizerEventsSelected(false);
3832 } 3832 }
3833 if (event->attendeeByMails( KOPrefs::instance()->mAdditionalMails, 3833 if (event->attendeeByMails( KOPrefs::instance()->mAdditionalMails,
3834 KOPrefs::instance()->email() ) ) { 3834 KOPrefs::instance()->email() ) ) {
3835 emit groupEventsSelected( true ); 3835 emit groupEventsSelected( true );
3836 } else { 3836 } else {
3837 emit groupEventsSelected(false); 3837 emit groupEventsSelected(false);
3838 } 3838 }
3839 return; 3839 return;
3840 } else { 3840 } else {
3841 emit todoSelected( false ); 3841 emit todoSelected( false );
3842 emit organizerEventsSelected(false); 3842 emit organizerEventsSelected(false);
3843 emit groupEventsSelected(false); 3843 emit groupEventsSelected(false);
3844 } 3844 }
3845 return; 3845 return;
3846 } 3846 }
3847 3847
3848 /* if ( incidence && incidence->typeID() == todoID ) { 3848 /* if ( incidence && incidence->typeID() == todoID ) {
3849 emit todoSelected( true ); 3849 emit todoSelected( true );
3850 } else { 3850 } else {
3851 emit todoSelected( false ); 3851 emit todoSelected( false );
3852 }*/ 3852 }*/
3853} 3853}
3854 3854
3855 3855
3856void CalendarView::checkClipboard() 3856void CalendarView::checkClipboard()
3857{ 3857{
3858#ifndef KORG_NODND 3858#ifndef KORG_NODND
3859 if (ICalDrag::canDecode(QApplication::clipboard()->data())) { 3859 if (ICalDrag::canDecode(QApplication::clipboard()->data())) {
3860 emit pasteEnabled(true); 3860 emit pasteEnabled(true);
3861 } else { 3861 } else {
3862 emit pasteEnabled(false); 3862 emit pasteEnabled(false);
3863 } 3863 }
3864#endif 3864#endif
3865} 3865}
3866 3866
3867void CalendarView::showDates(const DateList &selectedDates) 3867void CalendarView::showDates(const DateList &selectedDates)
3868{ 3868{
3869 // kdDebug() << "CalendarView::selectDates()" << endl; 3869 // kdDebug() << "CalendarView::selectDates()" << endl;
3870 3870
3871 3871
3872 if ( !mBlockShowDates ) { 3872 if ( !mBlockShowDates ) {
3873 if ( mViewManager->currentView() ) { 3873 if ( mViewManager->currentView() ) {
3874 updateView( selectedDates.first(), selectedDates.last() ); 3874 updateView( selectedDates.first(), selectedDates.last() );
3875 } else { 3875 } else {
3876 mViewManager->showAgendaView(); 3876 mViewManager->showAgendaView();
3877 } 3877 }
3878 } 3878 }
3879 3879
3880 QDate date = selectedDates.first(); 3880 QDate date = selectedDates.first();
3881 if ( ! date.isValid() ) { 3881 if ( ! date.isValid() ) {
3882 topLevelWidget()->setCaption(""); 3882 topLevelWidget()->setCaption("");
3883 return; 3883 return;
3884 } 3884 }
3885 3885
3886 QString selDates; 3886 QString selDates;
3887 selDates = KGlobal::locale()->formatDate( date, true); 3887 selDates = KGlobal::locale()->formatDate( date, true);
3888 if (selectedDates.first() < selectedDates.last() ) 3888 if (selectedDates.first() < selectedDates.last() )
3889 selDates += " - " + KGlobal::locale()->formatDate( selectedDates.last(),true); 3889 selDates += " - " + KGlobal::locale()->formatDate( selectedDates.last(),true);
3890 else { 3890 else {
3891 QString addString; 3891 QString addString;
3892 if ( date == QDateTime::currentDateTime().date() ) 3892 if ( date == QDateTime::currentDateTime().date() )
3893 addString = i18n("Today"); 3893 addString = i18n("Today");
3894 else if ( date == QDateTime::currentDateTime().date().addDays(1) ) 3894 else if ( date == QDateTime::currentDateTime().date().addDays(1) )
3895 addString = i18n("Tomorrow"); 3895 addString = i18n("Tomorrow");
3896 else if ( date == QDateTime::currentDateTime().date().addDays(-1) ) 3896 else if ( date == QDateTime::currentDateTime().date().addDays(-1) )
3897 addString = i18n("Yesterday"); 3897 addString = i18n("Yesterday");
3898 else if ( date == QDateTime::currentDateTime().date().addDays(-2) ) 3898 else if ( date == QDateTime::currentDateTime().date().addDays(-2) )
3899 addString = i18n("Day before yesterday"); 3899 addString = i18n("Day before yesterday");
3900 else if ( date == QDateTime::currentDateTime().date().addDays(2) ) 3900 else if ( date == QDateTime::currentDateTime().date().addDays(2) )
3901 addString = i18n("Day after tomorrow"); 3901 addString = i18n("Day after tomorrow");
3902 if ( !addString.isEmpty() ) { 3902 if ( !addString.isEmpty() ) {
3903 topLevelWidget()->setCaption( addString+", " + selDates ); 3903 topLevelWidget()->setCaption( addString+", " + selDates );
3904 return; 3904 return;
3905 } 3905 }
3906 } 3906 }
3907 topLevelWidget()->setCaption( i18n("Dates: ") + selDates ); 3907 topLevelWidget()->setCaption( i18n("Dates: ") + selDates );
3908 3908
3909} 3909}
3910 3910
3911QPtrList<CalFilter> CalendarView::filters() 3911QPtrList<CalFilter> CalendarView::filters()
3912{ 3912{
3913 return mFilters; 3913 return mFilters;
3914 3914
3915} 3915}
3916void CalendarView::editFilters() 3916void CalendarView::editFilters()
3917{ 3917{
3918 // kdDebug() << "CalendarView::editFilters()" << endl; 3918 // kdDebug() << "CalendarView::editFilters()" << endl;
3919 3919
3920 CalFilter *filter = mFilters.first(); 3920 CalFilter *filter = mFilters.first();
3921 while(filter) { 3921 while(filter) {
3922 kdDebug() << " Filter: " << filter->name() << endl; 3922 kdDebug() << " Filter: " << filter->name() << endl;
3923 filter = mFilters.next(); 3923 filter = mFilters.next();
3924 } 3924 }
3925 3925
3926 mDialogManager->showFilterEditDialog(&mFilters); 3926 mDialogManager->showFilterEditDialog(&mFilters);
3927} 3927}
3928void CalendarView::toggleFilter() 3928void CalendarView::toggleFilter()
3929{ 3929{
3930 showFilter(! mFilterView->isVisible()); 3930 showFilter(! mCalEditView->isVisible());
3931} 3931}
3932 3932
3933KOFilterView *CalendarView::filterView() 3933KOFilterView *CalendarView::filterView()
3934{ 3934{
3935 return mFilterView; 3935 return mFilterView;
3936} 3936}
3937void CalendarView::selectFilter( int fil ) 3937void CalendarView::selectFilter( int fil )
3938{ 3938{
3939 mFilterView->setSelectedFilter( fil ); 3939 mFilterView->setSelectedFilter( fil );
3940} 3940}
3941void CalendarView::showFilter(bool visible) 3941void CalendarView::showFilter(bool visible)
3942{ 3942{
3943#if 1 3943#if 1
3944 if (visible) { 3944 if (visible) {
3945 mCalEditView->readConfig(); 3945 mCalEditView->readConfig();
3946 mCalEditView->show(); 3946 mCalEditView->show();
3947 QValueList<int> sizes;
3948 sizes = mLeftFrame->sizes();
3949 if ( sizes.count() == 4 && sizes[3] < 20 ) {
3950 sizes.clear();
3951 sizes << 100;
3952 sizes << 0;
3953 sizes << 0;
3954 sizes << 100;
3955 mLeftFrame->setSizes(sizes);
3956 }
3957#if 0
3958 sizes = mLeftFrame->sizes();
3959 int ccc = 0;
3960 while ( ccc < sizes.count()) {
3961 qDebug("size %d %d ", ccc, sizes[ccc]);
3962 ++ccc;
3963 }
3964#endif
3965
3966 }
3967 else {
3968 mCalEditView->hide();
3947 } 3969 }
3948 else mCalEditView->hide();
3949#else 3970#else
3950 if (visible) mFilterView->show(); 3971 if (visible) mFilterView->show();
3951 else mFilterView->hide(); 3972 else mFilterView->hide();
3952#endif 3973#endif
3953} 3974}
3954void CalendarView::toggleFilerEnabled( ) 3975void CalendarView::toggleFilerEnabled( )
3955{ 3976{
3956 mFilterView->setFiltersEnabled ( !mFilterView->filtersEnabled() ); 3977 mFilterView->setFiltersEnabled ( !mFilterView->filtersEnabled() );
3957 if ( !mFilterView->filtersEnabled() ) 3978 if ( !mFilterView->filtersEnabled() )
3958 topLevelWidget()->setCaption( i18n("Filter disabled ") ); 3979 topLevelWidget()->setCaption( i18n("Filter disabled ") );
3959 3980
3960} 3981}
3961void CalendarView::updateFilter() 3982void CalendarView::updateFilter()
3962{ 3983{
3963 CalFilter *filter = mFilterView->selectedFilter(); 3984 CalFilter *filter = mFilterView->selectedFilter();
3964 if (filter) { 3985 if (filter) {
3965 QString mess; 3986 QString mess;
3966 if (mFilterView->filtersEnabled()) { 3987 if (mFilterView->filtersEnabled()) {
3967 mess = i18n("Filter selected: ")+filter->name(); 3988 mess = i18n("Filter selected: ")+filter->name();
3968 filter->setEnabled(true); 3989 filter->setEnabled(true);
3969 } 3990 }
3970 else filter->setEnabled(false); 3991 else filter->setEnabled(false);
3971 mCalendar->setFilter(filter); 3992 mCalendar->setFilter(filter);
3972 updateView(); 3993 updateView();
3973 if ( !mess.isEmpty() ) 3994 if ( !mess.isEmpty() )
3974 topLevelWidget()->setCaption( mess ); 3995 topLevelWidget()->setCaption( mess );
3975 3996
3976 } 3997 }
3977} 3998}
3978 3999
3979void CalendarView::filterEdited() 4000void CalendarView::filterEdited()
3980{ 4001{
3981 mFilterView->updateFilters(); 4002 mFilterView->updateFilters();
3982 updateFilter(); 4003 updateFilter();
3983 writeSettings(); 4004 writeSettings();
3984} 4005}
3985 4006
3986 4007
3987void CalendarView::takeOverEvent() 4008void CalendarView::takeOverEvent()
3988{ 4009{
3989 Incidence *incidence = currentSelection(); 4010 Incidence *incidence = currentSelection();
3990 4011
3991 if (!incidence) return; 4012 if (!incidence) return;
3992 4013
3993 incidence->setOrganizer(KOPrefs::instance()->email()); 4014 incidence->setOrganizer(KOPrefs::instance()->email());
3994 incidence->recreate(); 4015 incidence->recreate();
3995 incidence->setReadOnly(false); 4016 incidence->setReadOnly(false);
3996 4017
3997 updateView(); 4018 updateView();
3998} 4019}
3999 4020
4000void CalendarView::takeOverCalendar() 4021void CalendarView::takeOverCalendar()
4001{ 4022{
4002 // TODO: Create Calendar::allIncidences() function and use it here 4023 // TODO: Create Calendar::allIncidences() function and use it here
4003 4024
4004 clearAllViews(); 4025 clearAllViews();
4005 QPtrList<Event> events = mCalendar->events(); 4026 QPtrList<Event> events = mCalendar->events();
4006 for(uint i=0; i<events.count(); ++i) { 4027 for(uint i=0; i<events.count(); ++i) {
4007 events.at(i)->setOrganizer(KOPrefs::instance()->email()); 4028 events.at(i)->setOrganizer(KOPrefs::instance()->email());
4008 events.at(i)->recreate(); 4029 events.at(i)->recreate();
4009 events.at(i)->setReadOnly(false); 4030 events.at(i)->setReadOnly(false);
4010 } 4031 }
4011 4032
4012 QPtrList<Todo> todos = mCalendar->todos(); 4033 QPtrList<Todo> todos = mCalendar->todos();
4013 for(uint i=0; i<todos.count(); ++i) { 4034 for(uint i=0; i<todos.count(); ++i) {
4014 todos.at(i)->setOrganizer(KOPrefs::instance()->email()); 4035 todos.at(i)->setOrganizer(KOPrefs::instance()->email());
4015 todos.at(i)->recreate(); 4036 todos.at(i)->recreate();
4016 todos.at(i)->setReadOnly(false); 4037 todos.at(i)->setReadOnly(false);
4017 } 4038 }
4018 4039
4019 QPtrList<Journal> journals = mCalendar->journals(); 4040 QPtrList<Journal> journals = mCalendar->journals();
4020 for(uint i=0; i<journals.count(); ++i) { 4041 for(uint i=0; i<journals.count(); ++i) {
4021 journals.at(i)->setOrganizer(KOPrefs::instance()->email()); 4042 journals.at(i)->setOrganizer(KOPrefs::instance()->email());
4022 journals.at(i)->recreate(); 4043 journals.at(i)->recreate();
4023 journals.at(i)->setReadOnly(false); 4044 journals.at(i)->setReadOnly(false);
4024 } 4045 }
4025 4046
4026 updateView(); 4047 updateView();
4027} 4048}
4028 4049
4029void CalendarView::showIntro() 4050void CalendarView::showIntro()
4030{ 4051{
4031 kdDebug() << "To be implemented." << endl; 4052 kdDebug() << "To be implemented." << endl;
4032} 4053}
4033 4054
4034QWidgetStack *CalendarView::viewStack() 4055QWidgetStack *CalendarView::viewStack()
4035{ 4056{
4036 return mRightFrame; 4057 return mRightFrame;
4037} 4058}
4038 4059
4039QWidget *CalendarView::leftFrame() 4060QWidget *CalendarView::leftFrame()
4040{ 4061{
4041 return ( QWidget *)mLeftFrame; 4062 return ( QWidget *)mLeftFrame;
4042} 4063}
4043 4064
4044DateNavigator *CalendarView::dateNavigator() 4065DateNavigator *CalendarView::dateNavigator()
4045{ 4066{
4046 return mNavigator; 4067 return mNavigator;
4047} 4068}
4048 4069
4049KDateNavigator* CalendarView::dateNavigatorWidget() 4070KDateNavigator* CalendarView::dateNavigatorWidget()
4050{ 4071{
4051 return mDateNavigator->navigatorView(); 4072 return mDateNavigator->navigatorView();
4052} 4073}
4053void CalendarView::toggleDateNavigatorWidget() 4074void CalendarView::toggleDateNavigatorWidget()
4054{ 4075{
4055 KOPrefs::instance()->mShowDateNavigator = !KOPrefs::instance()->mShowDateNavigator ; 4076 KOPrefs::instance()->mShowDateNavigator = !KOPrefs::instance()->mShowDateNavigator ;
4056 4077
4057 if (!KOPrefs::instance()->mShowDateNavigator ) 4078 if (!KOPrefs::instance()->mShowDateNavigator )
4058 mDateNavigator->hide(); 4079 mDateNavigator->hide();
4059 else 4080 else
4060 mDateNavigator->show(); 4081 mDateNavigator->show();
4061} 4082}
4062void CalendarView::addView(KOrg::BaseView *view) 4083void CalendarView::addView(KOrg::BaseView *view)
4063{ 4084{
4064 mViewManager->addView(view); 4085 mViewManager->addView(view);
4065} 4086}
4066 4087
4067void CalendarView::showView(KOrg::BaseView *view) 4088void CalendarView::showView(KOrg::BaseView *view)
4068{ 4089{
4069 mViewManager->showView(view, mLeftFrame->isVisible()); 4090 mViewManager->showView(view, mLeftFrame->isVisible());
4070} 4091}
4071 4092
4072Incidence *CalendarView::currentSelection() 4093Incidence *CalendarView::currentSelection()
4073{ 4094{
4074 return mViewManager->currentSelection(); 4095 return mViewManager->currentSelection();
4075} 4096}
4076void CalendarView::toggleAllDaySize() 4097void CalendarView::toggleAllDaySize()
4077{ 4098{
4078 /* 4099 /*
4079 if ( KOPrefs::instance()->mAllDaySize > 47 ) 4100 if ( KOPrefs::instance()->mAllDaySize > 47 )
4080 KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize /2; 4101 KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize /2;
4081 else 4102 else
4082 KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize *2; 4103 KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize *2;
4083 */ 4104 */
4084 viewManager()->agendaView()->toggleAllDay(); 4105 viewManager()->agendaView()->toggleAllDay();
4085} 4106}
4086void CalendarView::toggleExpand() 4107void CalendarView::toggleExpand()
4087{ 4108{
4088 // if ( mLeftFrame->isHidden() ) { 4109 // if ( mLeftFrame->isHidden() ) {
4089 // mLeftFrame->show(); 4110 // mLeftFrame->show();
4090 // emit calendarViewExpanded( false ); 4111 // emit calendarViewExpanded( false );
4091 // } else { 4112 // } else {
4092 // mLeftFrame->hide(); 4113 // mLeftFrame->hide();
4093 // emit calendarViewExpanded( true ); 4114 // emit calendarViewExpanded( true );
4094 // } 4115 // }
4095 //qDebug(" CalendarView::toggleExpand()"); 4116 //qDebug(" CalendarView::toggleExpand()");
4096 globalFlagBlockAgenda = 1; 4117 globalFlagBlockAgenda = 1;
4097 emit calendarViewExpanded( !mLeftFrame->isHidden() ); 4118 emit calendarViewExpanded( !mLeftFrame->isHidden() );
4098 globalFlagBlockAgenda = 5; 4119 globalFlagBlockAgenda = 5;
4099 mViewManager->raiseCurrentView( !mLeftFrame->isHidden() ); 4120 mViewManager->raiseCurrentView( !mLeftFrame->isHidden() );
4100 //mViewManager->showView( 0, true ); 4121 //mViewManager->showView( 0, true );
4101} 4122}
4102 4123
4103void CalendarView::calendarModified( bool modified, Calendar * ) 4124void CalendarView::calendarModified( bool modified, Calendar * )
4104{ 4125{
4105 setModified( modified ); 4126 setModified( modified );
4106} 4127}
4107 4128
4108Todo *CalendarView::selectedTodo() 4129Todo *CalendarView::selectedTodo()
4109{ 4130{
4110 Incidence *incidence = currentSelection(); 4131 Incidence *incidence = currentSelection();
4111 if ( incidence && incidence->typeID() == todoID ) { 4132 if ( incidence && incidence->typeID() == todoID ) {
4112 return static_cast<Todo *>( incidence ); 4133 return static_cast<Todo *>( incidence );
4113 } 4134 }
4114 4135
4115 incidence = mTodoList->selectedIncidences().first(); 4136 incidence = mTodoList->selectedIncidences().first();
4116 if ( incidence && incidence->typeID() == todoID ) { 4137 if ( incidence && incidence->typeID() == todoID ) {
4117 return static_cast<Todo *>( incidence ); 4138 return static_cast<Todo *>( incidence );
4118 } 4139 }
4119 4140
4120 return 0; 4141 return 0;
4121} 4142}
4122 4143
4123void CalendarView::dialogClosing(Incidence *in) 4144void CalendarView::dialogClosing(Incidence *in)
4124{ 4145{
4125 // mDialogList.remove(in); 4146 // mDialogList.remove(in);
4126} 4147}
4127 4148
4128void CalendarView::showIncidence() 4149void CalendarView::showIncidence()
4129{ 4150{
4130 mViewerCallerIsSearchDialog = false; 4151 mViewerCallerIsSearchDialog = false;
4131 Incidence *incidence = currentSelection(); 4152 Incidence *incidence = currentSelection();
4132 if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); 4153 if ( !incidence ) incidence = mTodoList->selectedIncidences().first();
4133 if ( incidence ) { 4154 if ( incidence ) {
4134 ShowIncidenceVisitor v; 4155 ShowIncidenceVisitor v;
4135 v.act( incidence, this ); 4156 v.act( incidence, this );
4136 } 4157 }
4137} 4158}
4138void CalendarView::editIncidenceDescription() 4159void CalendarView::editIncidenceDescription()
4139{ 4160{
4140 mFlagEditDescription = true; 4161 mFlagEditDescription = true;
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp
index bc6aae4..9fe285c 100644
--- a/korganizer/koprefs.cpp
+++ b/korganizer/koprefs.cpp
@@ -257,335 +257,335 @@ KOPrefs::KOPrefs() :
257 addItemBool("WNViewShowsPast",&mWNViewShowsPast,true); 257 addItemBool("WNViewShowsPast",&mWNViewShowsPast,true);
258 addItemBool("WNViewShowLocation",&mWNViewShowLocation,false); 258 addItemBool("WNViewShowLocation",&mWNViewShowLocation,false);
259 addItemBool("UseHighlightLightColor",&mUseHighlightLightColor,false); 259 addItemBool("UseHighlightLightColor",&mUseHighlightLightColor,false);
260 addItemBool("ListViewMonthTimespan",&mListViewMonthTimespan,true); 260 addItemBool("ListViewMonthTimespan",&mListViewMonthTimespan,true);
261 addItemBool("TodoViewUsesCatColors",&mTodoViewUsesCatColors,false); 261 addItemBool("TodoViewUsesCatColors",&mTodoViewUsesCatColors,false);
262 addItemBool("TodoViewShowsPercentage",&mTodoViewShowsPercentage,false); 262 addItemBool("TodoViewShowsPercentage",&mTodoViewShowsPercentage,false);
263 addItemBool("TodoViewUsesSmallFont",&mTodoViewUsesSmallFont,true); 263 addItemBool("TodoViewUsesSmallFont",&mTodoViewUsesSmallFont,true);
264 addItemBool("MonthViewUsesBigFont",&mMonthViewUsesBigFont,true); 264 addItemBool("MonthViewUsesBigFont",&mMonthViewUsesBigFont,true);
265 addItemBool("TodoViewUsesForegroundColor",&mTodoViewUsesForegroundColor,false); 265 addItemBool("TodoViewUsesForegroundColor",&mTodoViewUsesForegroundColor,false);
266 addItemBool("MonthViewUsesForegroundColor",&mMonthViewUsesForegroundColor,false); 266 addItemBool("MonthViewUsesForegroundColor",&mMonthViewUsesForegroundColor,false);
267#ifdef DESKTOP_VERSION 267#ifdef DESKTOP_VERSION
268 addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,true); 268 addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,true);
269#else 269#else
270 addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,false); 270 addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,false);
271#endif 271#endif
272 addItemInt("Day Begins",&mDayBegins,7); 272 addItemInt("Day Begins",&mDayBegins,7);
273 addItemInt("Working Hours Start",&mWorkingHoursStart,8); 273 addItemInt("Working Hours Start",&mWorkingHoursStart,8);
274 addItemInt("Working Hours End",&mWorkingHoursEnd,17); 274 addItemInt("Working Hours End",&mWorkingHoursEnd,17);
275 addItemBool("Exclude Holidays",&mExcludeHolidays,true); 275 addItemBool("Exclude Holidays",&mExcludeHolidays,true);
276 addItemBool("Exclude Saturdays",&mExcludeSaturdays,true); 276 addItemBool("Exclude Saturdays",&mExcludeSaturdays,true);
277 277
278 addItemBool("Month View Uses Category Color",&mMonthViewUsesCategoryColor,false); 278 addItemBool("Month View Uses Category Color",&mMonthViewUsesCategoryColor,false);
279 addItemBool("Full View Month",&mFullViewMonth,true); 279 addItemBool("Full View Month",&mFullViewMonth,true);
280 addItemBool("Full View Todo",&mFullViewTodo,true); 280 addItemBool("Full View Todo",&mFullViewTodo,true);
281 addItemBool("Quick Todo",&mEnableQuickTodo,false); 281 addItemBool("Quick Todo",&mEnableQuickTodo,false);
282 282
283 addItemInt("Next X Days",&mNextXDays,3); 283 addItemInt("Next X Days",&mNextXDays,3);
284 284
285 KPrefs::setCurrentGroup("Printer"); 285 KPrefs::setCurrentGroup("Printer");
286 286
287 KPrefs::setCurrentGroup("Layout"); 287 KPrefs::setCurrentGroup("Layout");
288 288
289 addItemBool("CompactDialogs",&mCompactDialogs,false); 289 addItemBool("CompactDialogs",&mCompactDialogs,false);
290 addItemBool("VerticalScreen",&mVerticalScreen,true); 290 addItemBool("VerticalScreen",&mVerticalScreen,true);
291 291
292 KPrefs::setCurrentGroup("KOrganizer Plugins"); 292 KPrefs::setCurrentGroup("KOrganizer Plugins");
293 293
294 addItemStringList("SelectedPlugins",&mSelectedPlugins,"holidays"); 294 addItemStringList("SelectedPlugins",&mSelectedPlugins,"holidays");
295 295
296 KPrefs::setCurrentGroup("Group Scheduling"); 296 KPrefs::setCurrentGroup("Group Scheduling");
297 297
298 addItemInt("IMIPScheduler",&mIMIPScheduler,IMIPKMail); 298 addItemInt("IMIPScheduler",&mIMIPScheduler,IMIPKMail);
299 addItemInt("IMIPSend",&mIMIPSend,IMIPdirectsend); 299 addItemInt("IMIPSend",&mIMIPSend,IMIPdirectsend);
300 addItemStringList("AdditionalMails",&mAdditionalMails,""); 300 addItemStringList("AdditionalMails",&mAdditionalMails,"");
301 addItemInt("IMIP auto refresh",&mIMIPAutoRefresh,neverAuto); 301 addItemInt("IMIP auto refresh",&mIMIPAutoRefresh,neverAuto);
302 addItemInt("IMIP auto insert request",&mIMIPAutoInsertRequest,neverAuto); 302 addItemInt("IMIP auto insert request",&mIMIPAutoInsertRequest,neverAuto);
303 addItemInt("IMIP auto insert reply",&mIMIPAutoInsertReply,neverAuto); 303 addItemInt("IMIP auto insert reply",&mIMIPAutoInsertReply,neverAuto);
304 addItemInt("IMIP auto FreeBusy",&mIMIPAutoFreeBusy,neverAuto); 304 addItemInt("IMIP auto FreeBusy",&mIMIPAutoFreeBusy,neverAuto);
305 addItemInt("IMIP auto save FreeBusy",&mIMIPAutoFreeBusyReply,neverAuto); 305 addItemInt("IMIP auto save FreeBusy",&mIMIPAutoFreeBusyReply,neverAuto);
306 306
307 KPrefs::setCurrentGroup( "Editors" ); 307 KPrefs::setCurrentGroup( "Editors" );
308 308
309 addItemStringList( "EventTemplates", &mEventTemplates ); 309 addItemStringList( "EventTemplates", &mEventTemplates );
310 addItemStringList( "TodoTemplates", &mTodoTemplates ); 310 addItemStringList( "TodoTemplates", &mTodoTemplates );
311 311
312 addItemInt("DestinationPolicy",&mDestination,standardDestination); 312 addItemInt("DestinationPolicy",&mDestination,standardDestination);
313 313
314 KPrefs::setCurrentGroup( "ViewOptions" ); 314 KPrefs::setCurrentGroup( "ViewOptions" );
315 addItemBool("EVshowDetails",&mEVshowDetails,true); 315 addItemBool("EVshowDetails",&mEVshowDetails,true);
316 addItemBool("EVshowCreated",&mEVshowCreated,true); 316 addItemBool("EVshowCreated",&mEVshowCreated,true);
317 addItemBool("EVshowChanged",&mEVshowChanged,true); 317 addItemBool("EVshowChanged",&mEVshowChanged,true);
318 addItemBool("WTshowDetails",&mWTshowDetails,false); 318 addItemBool("WTshowDetails",&mWTshowDetails,false);
319 addItemBool("WTshowCreated",&mWTshowCreated,false); 319 addItemBool("WTshowCreated",&mWTshowCreated,false);
320 addItemBool("WTshowChanged",&mWTshowChanged,false); 320 addItemBool("WTshowChanged",&mWTshowChanged,false);
321 mCalendars.setAutoDelete( true ); 321 mCalendars.setAutoDelete( true );
322} 322}
323 323
324 324
325KOPrefs::~KOPrefs() 325KOPrefs::~KOPrefs()
326{ 326{
327 if (mInstance == this) 327 if (mInstance == this)
328 mInstance = insd.setObject(0); 328 mInstance = insd.setObject(0);
329 mCalendars.setAutoDelete( true ); 329 mCalendars.setAutoDelete( true );
330 mCalendars.clear(); 330 mCalendars.clear();
331 //qDebug("KOPrefs::~KOPrefs() "); 331 //qDebug("KOPrefs::~KOPrefs() ");
332} 332}
333 333
334 334
335KOPrefs *KOPrefs::instance() 335KOPrefs *KOPrefs::instance()
336{ 336{
337 if (!mInstance) { 337 if (!mInstance) {
338 mInstance = insd.setObject(new KOPrefs()); 338 mInstance = insd.setObject(new KOPrefs());
339 mInstance->readConfig(); 339 mInstance->readConfig();
340 } 340 }
341 341
342 return mInstance; 342 return mInstance;
343} 343}
344 344
345void KOPrefs::usrSetDefaults() 345void KOPrefs::usrSetDefaults()
346{ 346{
347 347
348} 348}
349 349
350void KOPrefs::fillMailDefaults() 350void KOPrefs::fillMailDefaults()
351{ 351{
352 if (mName.isEmpty()) mName = i18n("Anonymous"); 352 if (mName.isEmpty()) mName = i18n("Anonymous");
353 if (mEmail.isEmpty()) mEmail = i18n("nobody@nowhere"); 353 if (mEmail.isEmpty()) mEmail = i18n("nobody@nowhere");
354} 354}
355 355
356void KOPrefs::setTimeZoneIdDefault() 356void KOPrefs::setTimeZoneIdDefault()
357{ 357{
358 ; 358 ;
359} 359}
360 360
361void KOPrefs::setAllDefaults() 361void KOPrefs::setAllDefaults()
362{ 362{
363 setCategoryDefaults(); 363 setCategoryDefaults();
364 mEventSummaryUser = getDefaultList() ; 364 mEventSummaryUser = getDefaultList() ;
365 mTodoSummaryUser = getDefaultList() ; 365 mTodoSummaryUser = getDefaultList() ;
366 mLocationDefaults = getLocationDefaultList(); 366 mLocationDefaults = getLocationDefaultList();
367} 367}
368 368
369void KOPrefs::setCategoryDefaults() 369void KOPrefs::setCategoryDefaults()
370{ 370{
371 mCustomCategories.clear(); 371 mCustomCategories.clear();
372 mCustomCategories = getDefaultList(); 372 mCustomCategories = getDefaultList();
373 373
374 QStringList::Iterator it; 374 QStringList::Iterator it;
375 for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) { 375 for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) {
376 setCategoryColor(*it,mDefaultCategoryColor); 376 setCategoryColor(*it,mDefaultCategoryColor);
377 } 377 }
378} 378}
379QStringList KOPrefs::getLocationDefaultList() 379QStringList KOPrefs::getLocationDefaultList()
380{ 380{
381 QStringList retval ; 381 QStringList retval ;
382 retval << i18n("Home") << i18n("Office") << i18n("Library") << i18n("School") << i18n("Doctor") << i18n("Beach") 382 retval << i18n("Home") << i18n("Office") << i18n("Library") << i18n("School") << i18n("Doctor") << i18n("Beach")
383 << i18n("University") << i18n("Restaurant") << i18n("Bar") << i18n("Conference room") 383 << i18n("University") << i18n("Restaurant") << i18n("Bar") << i18n("Conference room")
384 << i18n("Cinema") << i18n("Lake") << i18n("Kindergarten") 384 << i18n("Cinema") << i18n("Lake") << i18n("Kindergarten")
385 << i18n("Germany") << i18n("Sweden") << i18n("Forest") << i18n("Desert") << i18n("Kitchen") ; 385 << i18n("Germany") << i18n("Sweden") << i18n("Forest") << i18n("Desert") << i18n("Kitchen") ;
386 // << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") 386 // << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("")
387 387
388 retval.sort(); 388 retval.sort();
389 return retval; 389 return retval;
390} 390}
391QStringList KOPrefs::getDefaultList() 391QStringList KOPrefs::getDefaultList()
392{ 392{
393 QStringList retval ; 393 QStringList retval ;
394 retval << i18n("Anniversary") << i18n("Appointment") << i18n("Birthday") << i18n("Business") << i18n("Business Travel") << i18n("Cinema") << i18n("Customer") 394 retval << i18n("Anniversary") << i18n("Appointment") << i18n("Birthday") << i18n("Business") << i18n("Business Travel") << i18n("Cinema") << i18n("Customer")
395 << i18n("Break")<< i18n("Breakfast")<< i18n("Competition")<< i18n("Dinner") 395 << i18n("Break")<< i18n("Breakfast")<< i18n("Competition")<< i18n("Dinner")
396 << i18n("Education")<< i18n("Family") << i18n("Favorites") << i18n("Festival")<< i18n("Fishing")<< i18n("Flight") << i18n("Gifts") 396 << i18n("Education")<< i18n("Family") << i18n("Favorites") << i18n("Festival")<< i18n("Fishing")<< i18n("Flight") << i18n("Gifts")
397 << i18n("Holiday") << i18n("Holiday Cards")<< i18n("Hot Contacts") << i18n("Hiking") << i18n("Hunting") << i18n("Key Customer") << i18n("Kids") 397 << i18n("Holiday") << i18n("Holiday Cards")<< i18n("Hot Contacts") << i18n("Hiking") << i18n("Hunting") << i18n("Key Customer") << i18n("Kids")
398 << i18n("Lunch") << i18n("Meeting") << i18n("Miscellaneous") << i18n("Partner")<< i18n("Party") << i18n("Personal") << i18n("Personal Travel") 398 << i18n("Lunch") << i18n("Meeting") << i18n("Miscellaneous") << i18n("Partner")<< i18n("Party") << i18n("Personal") << i18n("Personal Travel")
399 << i18n("PHB") << i18n("Phone Calls") << i18n("Projects") << i18n("Recurring") << i18n("School") << i18n("Shopping") 399 << i18n("PHB") << i18n("Phone Calls") << i18n("Projects") << i18n("Recurring") << i18n("School") << i18n("Shopping")
400 << i18n("Speach") << i18n("Special Occasion") << i18n("Sports") << i18n("Talk") << i18n("Travel") << i18n("TV")<< i18n("University") 400 << i18n("Speach") << i18n("Special Occasion") << i18n("Sports") << i18n("Talk") << i18n("Travel") << i18n("TV")<< i18n("University")
401 << i18n("Vacation") << i18n("VIP") << i18n("SyncEvent") ; 401 << i18n("Vacation") << i18n("VIP") << i18n("SyncEvent") ;
402 retval.sort(); 402 retval.sort();
403 //qDebug("cat %s ", retval.join("-").latin1()); 403 //qDebug("cat %s ", retval.join("-").latin1());
404 return retval; 404 return retval;
405} 405}
406 406
407void KOPrefs::usrReadConfig() 407void KOPrefs::usrReadConfig()
408{ 408{
409 config()->setGroup("General"); 409 config()->setGroup("General");
410 410
411 //qDebug("KOPrefs::usrReadConfig() "); 411 //qDebug("KOPrefs::usrReadConfig() ");
412 mCustomCategories = config()->readListEntry("Custom Categories"); 412 mCustomCategories = config()->readListEntry("Custom Categories");
413 mOldLoadedLanguage = mOldLanguage ; 413 mOldLoadedLanguage = mOldLanguage ;
414 mOldLanguage = KPimGlobalPrefs::instance()->mPreferredLanguage; 414 mOldLanguage = KPimGlobalPrefs::instance()->mPreferredLanguage;
415 if (mLocationDefaults.isEmpty()) { 415 if (mLocationDefaults.isEmpty()) {
416 mLocationDefaults = getLocationDefaultList(); 416 mLocationDefaults = getLocationDefaultList();
417 } 417 }
418 418
419 if (mEventSummaryUser.isEmpty()) { 419 if (mEventSummaryUser.isEmpty()) {
420 mEventSummaryUser = getDefaultList() ; 420 mEventSummaryUser = getDefaultList() ;
421 } 421 }
422 if (mTodoSummaryUser.isEmpty()) { 422 if (mTodoSummaryUser.isEmpty()) {
423 mTodoSummaryUser = getDefaultList() ; 423 mTodoSummaryUser = getDefaultList() ;
424 } 424 }
425 425
426 if (mCustomCategories.isEmpty()) setCategoryDefaults(); 426 if (mCustomCategories.isEmpty()) setCategoryDefaults();
427 427
428 config()->setGroup("Personal Settings"); 428 config()->setGroup("Personal Settings");
429 mName = config()->readEntry("user_name",""); 429 mName = config()->readEntry("user_name","");
430 mEmail = config()->readEntry("user_email",""); 430 mEmail = config()->readEntry("user_email","");
431 fillMailDefaults(); 431 fillMailDefaults();
432 432
433 config()->setGroup("Category Colors"); 433 config()->setGroup("Category Colors");
434 QStringList::Iterator it; 434 QStringList::Iterator it;
435 for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) { 435 for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) {
436 setCategoryColor(*it,config()->readColorEntry(*it,&mDefaultCategoryColor)); 436 setCategoryColor(*it,config()->readColorEntry(*it,&mDefaultCategoryColor));
437 437
438 } 438 }
439 config()->setGroup("CCal"); 439 config()->setGroup("CCal");
440 int numCals = config()->readNumEntry("NumberCalendars",0 ); 440 int numCals = config()->readNumEntry("NumberCalendars",0 );
441 mNextAvailableCalendar = 1; 441 mNextAvailableCalendar = 1;
442 if ( numCals == 0 ) { 442 if ( numCals == 0 ) {
443 KopiCalendarFile *kkf = getNewCalendar(); 443 KopiCalendarFile *kkf = getNewCalendar();
444 kkf->isStandard = true; 444 kkf->isStandard = true;
445 kkf->mName = i18n("Standard"); 445 kkf->mName = i18n("Standard");
446 kkf->mFileName = locateLocal( "data", "korganizer/mycalendar.ics" ); 446 kkf->mFileName = locateLocal( "data", "korganizer/mycalendar.ics" );
447 } 447 }
448 while ( mNextAvailableCalendar <= numCals ) { 448 while ( mNextAvailableCalendar <= numCals ) {
449 qDebug("Read cal #%d ", mNextAvailableCalendar ); 449 //qDebug("Read cal #%d ", mNextAvailableCalendar );
450 QString prefix = "Cal_" +QString::number( mNextAvailableCalendar ); 450 QString prefix = "Cal_" +QString::number( mNextAvailableCalendar );
451 KopiCalendarFile *kkf = getNewCalendar(); 451 KopiCalendarFile *kkf = getNewCalendar();
452 kkf->isStandard = config()->readBoolEntry( prefix+"_isStandard", false ); 452 kkf->isStandard = config()->readBoolEntry( prefix+"_isStandard", false );
453 kkf->isEnabled = config()->readBoolEntry( prefix+"_isEnabled", true); 453 kkf->isEnabled = config()->readBoolEntry( prefix+"_isEnabled", true);
454 kkf->isAlarmEnabled = config()->readBoolEntry( prefix+"_isAlarmEnabled", true); 454 kkf->isAlarmEnabled = config()->readBoolEntry( prefix+"_isAlarmEnabled", true);
455 kkf->isReadOnly = config()->readBoolEntry( prefix+"_isReadOnly", false); 455 kkf->isReadOnly = config()->readBoolEntry( prefix+"_isReadOnly", false);
456 kkf->mName = config()->readEntry( prefix+"_Name", "Calendar"); 456 kkf->mName = config()->readEntry( prefix+"_Name", "Calendar");
457 kkf->mFileName = config()->readEntry( prefix+"_FileName", kkf->mFileName); 457 kkf->mFileName = config()->readEntry( prefix+"_FileName", kkf->mFileName);
458 kkf->mDefaultColor = config()->readColorEntry( prefix+"_Color",&mEventColor); 458 kkf->mDefaultColor = config()->readColorEntry( prefix+"_Color",&mEventColor);
459 if ( kkf->mCalNumber == 1 ) { 459 if ( kkf->mCalNumber == 1 ) {
460 kkf->mFileName = locateLocal( "data", "korganizer/mycalendar.ics" ); 460 kkf->mFileName = locateLocal( "data", "korganizer/mycalendar.ics" );
461 } 461 }
462 } 462 }
463 463
464 KPimPrefs::usrReadConfig(); 464 KPimPrefs::usrReadConfig();
465} 465}
466 466
467KopiCalendarFile * KOPrefs::getCalendar( int num ) 467KopiCalendarFile * KOPrefs::getCalendar( int num )
468{ 468{
469 return mDefCalColors[num-1]; 469 return mDefCalColors[num-1];
470} 470}
471 471
472KopiCalendarFile * KOPrefs::getNewCalendar() 472KopiCalendarFile * KOPrefs::getNewCalendar()
473{ 473{
474 KopiCalendarFile * kkf = new KopiCalendarFile(); 474 KopiCalendarFile * kkf = new KopiCalendarFile();
475 kkf->mCalNumber = mNextAvailableCalendar; 475 kkf->mCalNumber = mNextAvailableCalendar;
476 mDefCalColors.resize( mNextAvailableCalendar ); 476 mDefCalColors.resize( mNextAvailableCalendar );
477 mDefCalColors[mNextAvailableCalendar-1] = kkf; 477 mDefCalColors[mNextAvailableCalendar-1] = kkf;
478 ++mNextAvailableCalendar; 478 ++mNextAvailableCalendar;
479 kkf->mDefaultColor = mEventColor; 479 kkf->mDefaultColor = mEventColor;
480 kkf->mName = i18n("New Calendar"); 480 kkf->mName = i18n("New Calendar");
481 mCalendars.append( kkf ); 481 mCalendars.append( kkf );
482 return kkf; 482 return kkf;
483} 483}
484void KOPrefs::deleteCalendar( int num ) 484void KOPrefs::deleteCalendar( int num )
485{ 485{
486 KopiCalendarFile * kkf = mCalendars.first(); 486 KopiCalendarFile * kkf = mCalendars.first();
487 while ( kkf ) { 487 while ( kkf ) {
488 if ( kkf->mCalNumber == num ) { 488 if ( kkf->mCalNumber == num ) {
489 qDebug("KOPrefs::deleteCalendar %d ", num ); 489 qDebug("KOPrefs::deleteCalendar %d ", num );
490 mCalendars.remove( kkf ); 490 mCalendars.remove( kkf );
491 delete kkf; 491 delete kkf;
492 return; 492 return;
493 } 493 }
494 kkf = mCalendars.next(); 494 kkf = mCalendars.next();
495 } 495 }
496} 496}
497QColor KOPrefs::defaultColor( int calNum ) const 497QColor KOPrefs::defaultColor( int calNum ) const
498{ 498{
499 return (mDefCalColors[calNum-1])->mDefaultColor; 499 return (mDefCalColors[calNum-1])->mDefaultColor;
500} 500}
501void KOPrefs::usrWriteConfig() 501void KOPrefs::usrWriteConfig()
502{ 502{
503 config()->setGroup("General"); 503 config()->setGroup("General");
504 config()->writeEntry("Custom Categories",mCustomCategories); 504 config()->writeEntry("Custom Categories",mCustomCategories);
505 505
506 config()->setGroup("Personal Settings"); 506 config()->setGroup("Personal Settings");
507 config()->writeEntry("user_name",mName); 507 config()->writeEntry("user_name",mName);
508 config()->writeEntry("user_email",mEmail); 508 config()->writeEntry("user_email",mEmail);
509 509
510 config()->setGroup("Category Colors"); 510 config()->setGroup("Category Colors");
511 QDictIterator<QColor> it(mCategoryColors); 511 QDictIterator<QColor> it(mCategoryColors);
512 while (it.current()) { 512 while (it.current()) {
513 config()->writeEntry(it.currentKey(),*(it.current())); 513 config()->writeEntry(it.currentKey(),*(it.current()));
514 ++it; 514 ++it;
515 } 515 }
516 config()->setGroup("CCal"); 516 config()->setGroup("CCal");
517 config()->writeEntry("NumberCalendars",mCalendars.count()); 517 config()->writeEntry("NumberCalendars",mCalendars.count());
518 int numCal = 1; 518 int numCal = 1;
519 int writeCal = 0; 519 int writeCal = 0;
520 while ( numCal < mNextAvailableCalendar ) { 520 while ( numCal < mNextAvailableCalendar ) {
521 KopiCalendarFile * kkf = mCalendars.first(); 521 KopiCalendarFile * kkf = mCalendars.first();
522 while ( kkf ) { 522 while ( kkf ) {
523 qDebug("cal num %d %d ", kkf->mCalNumber, numCal); 523 //qDebug("cal num %d %d ", kkf->mCalNumber, numCal);
524 if ( kkf->mCalNumber == numCal ) { 524 if ( kkf->mCalNumber == numCal ) {
525 ++writeCal; 525 ++writeCal;
526 qDebug("Write calendar %d %d ", numCal , writeCal); 526 //qDebug("Write calendar %d %d ", numCal , writeCal);
527 QString prefix = "Cal_" + QString::number( writeCal ); 527 QString prefix = "Cal_" + QString::number( writeCal );
528 config()->writeEntry( prefix+"_isStandard", kkf->isStandard ); 528 config()->writeEntry( prefix+"_isStandard", kkf->isStandard );
529 config()->writeEntry( prefix+"_isEnabled", kkf->isEnabled ); 529 config()->writeEntry( prefix+"_isEnabled", kkf->isEnabled );
530 config()->writeEntry( prefix+"_isAlarmEnabled", kkf->isAlarmEnabled ); 530 config()->writeEntry( prefix+"_isAlarmEnabled", kkf->isAlarmEnabled );
531 config()->writeEntry( prefix+"_isReadOnly", kkf->isReadOnly ); 531 config()->writeEntry( prefix+"_isReadOnly", kkf->isReadOnly );
532 config()->writeEntry( prefix+"_Name", kkf->mName); 532 config()->writeEntry( prefix+"_Name", kkf->mName);
533 config()->writeEntry( prefix+"_FileName", kkf->mFileName); 533 config()->writeEntry( prefix+"_FileName", kkf->mFileName);
534 config()->writeEntry( prefix+"_Color",kkf->mDefaultColor); 534 config()->writeEntry( prefix+"_Color",kkf->mDefaultColor);
535 } 535 }
536 kkf = mCalendars.next(); 536 kkf = mCalendars.next();
537 } 537 }
538 ++numCal; 538 ++numCal;
539 } 539 }
540 KPimPrefs::usrWriteConfig(); 540 KPimPrefs::usrWriteConfig();
541} 541}
542 542
543void KOPrefs::setCategoryColor(QString cat,const QColor & color) 543void KOPrefs::setCategoryColor(QString cat,const QColor & color)
544{ 544{
545 mCategoryColors.replace(cat,new QColor(color)); 545 mCategoryColors.replace(cat,new QColor(color));
546} 546}
547 547
548QColor *KOPrefs::categoryColor(QString cat) 548QColor *KOPrefs::categoryColor(QString cat)
549{ 549{
550 QColor *color = 0; 550 QColor *color = 0;
551 551
552 if (!cat.isEmpty()) color = mCategoryColors[cat]; 552 if (!cat.isEmpty()) color = mCategoryColors[cat];
553 553
554 if (color) return color; 554 if (color) return color;
555 else return &mDefaultCategoryColor; 555 else return &mDefaultCategoryColor;
556} 556}
557 557
558void KOPrefs::setFullName(const QString &name) 558void KOPrefs::setFullName(const QString &name)
559{ 559{
560 mName = name; 560 mName = name;
561} 561}
562 562
563void KOPrefs::setEmail(const QString &email) 563void KOPrefs::setEmail(const QString &email)
564{ 564{
565 //qDebug(" KOPrefs::setEmai*********** %s",email.latin1() ); 565 //qDebug(" KOPrefs::setEmai*********** %s",email.latin1() );
566 mEmail = email; 566 mEmail = email;
567} 567}
568 568
569QString KOPrefs::fullName() 569QString KOPrefs::fullName()
570{ 570{
571 if (mEmailControlCenter) { 571 if (mEmailControlCenter) {
572 KEMailSettings settings; 572 KEMailSettings settings;
573 return settings.getSetting(KEMailSettings::RealName); 573 return settings.getSetting(KEMailSettings::RealName);
574 } else { 574 } else {
575 return mName; 575 return mName;
576 } 576 }
577} 577}
578 578
579QString KOPrefs::email() 579QString KOPrefs::email()
580{ 580{
581 if (mEmailControlCenter) { 581 if (mEmailControlCenter) {
582 KEMailSettings settings; 582 KEMailSettings settings;
583 return settings.getSetting(KEMailSettings::EmailAddress); 583 return settings.getSetting(KEMailSettings::EmailAddress);
584 } else { 584 } else {
585 return mEmail; 585 return mEmail;
586 } 586 }
587} 587}
588KConfig* KOPrefs::getConfig() 588KConfig* KOPrefs::getConfig()
589{ 589{
590 return config(); 590 return config();
591} 591}
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index 0cb0bce..95e1607 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -598,385 +598,386 @@ QPixmap MainWindow::loadPixmap( QString name )
598} 598}
599void MainWindow::setUsesBigPixmaps ( bool b ) 599void MainWindow::setUsesBigPixmaps ( bool b )
600{ 600{
601 qDebug("KO: MainWindow::setUsesBigPixmaps %d called", b); 601 qDebug("KO: MainWindow::setUsesBigPixmaps %d called", b);
602 if ( b ) 602 if ( b )
603 qDebug("KO: BigPixmaps are not supported "); 603 qDebug("KO: BigPixmaps are not supported ");
604} 604}
605void MainWindow::initActions() 605void MainWindow::initActions()
606{ 606{
607 //KOPrefs::instance()->mShowFullMenu 607 //KOPrefs::instance()->mShowFullMenu
608 iconToolBar->clear(); 608 iconToolBar->clear();
609 KOPrefs *p = KOPrefs::instance(); 609 KOPrefs *p = KOPrefs::instance();
610 //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar ); 610 //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar );
611 611
612 QPopupMenu *viewMenu = new QPopupMenu( this ); 612 QPopupMenu *viewMenu = new QPopupMenu( this );
613 QPopupMenu *actionMenu = new QPopupMenu( this ); 613 QPopupMenu *actionMenu = new QPopupMenu( this );
614 QPopupMenu *importMenu = new QPopupMenu( this ); 614 QPopupMenu *importMenu = new QPopupMenu( this );
615 QPopupMenu *importMenu_X = new QPopupMenu( this ); 615 QPopupMenu *importMenu_X = new QPopupMenu( this );
616 QPopupMenu *exportMenu_X = new QPopupMenu( this ); 616 QPopupMenu *exportMenu_X = new QPopupMenu( this );
617 QPopupMenu *beamMenu_X = new QPopupMenu( this ); 617 QPopupMenu *beamMenu_X = new QPopupMenu( this );
618 selectFilterMenu = new QPopupMenu( this ); 618 selectFilterMenu = new QPopupMenu( this );
619 selectFilterMenu->setCheckable( true ); 619 selectFilterMenu->setCheckable( true );
620 syncMenu = new QPopupMenu( this ); 620 syncMenu = new QPopupMenu( this );
621 configureAgendaMenu = new QPopupMenu( this ); 621 configureAgendaMenu = new QPopupMenu( this );
622 configureToolBarMenu = new QPopupMenu( this ); 622 configureToolBarMenu = new QPopupMenu( this );
623 QPopupMenu *helpMenu = new QPopupMenu( this ); 623 QPopupMenu *helpMenu = new QPopupMenu( this );
624 QIconSet icon; 624 QIconSet icon;
625 int pixWid = 22, pixHei = 22; 625 int pixWid = 22, pixHei = 22;
626 QString pathString = ""; 626 QString pathString = "";
627 if ( !p->mToolBarMiniIcons ) { 627 if ( !p->mToolBarMiniIcons ) {
628 if ( QApplication::desktop()->width() < 480 /*|| QApplication::desktop()->height() < 320*/) { 628 if ( QApplication::desktop()->width() < 480 /*|| QApplication::desktop()->height() < 320*/) {
629 pathString += "icons16/"; 629 pathString += "icons16/";
630 pixWid = 18; pixHei = 16; 630 pixWid = 18; pixHei = 16;
631 } 631 }
632 } else { 632 } else {
633 pathString += "iconsmini/"; 633 pathString += "iconsmini/";
634 pixWid = 18; pixHei = 16; 634 pixWid = 18; pixHei = 16;
635 } 635 }
636 if ( KOPrefs::instance()->mShowFullMenu ) { 636 if ( KOPrefs::instance()->mShowFullMenu ) {
637 QMenuBar *menuBar1; 637 QMenuBar *menuBar1;
638 menuBar1 = menuBar(); 638 menuBar1 = menuBar();
639 menuBar1->insertItem( i18n("File"), importMenu ); 639 menuBar1->insertItem( i18n("File"), importMenu );
640 menuBar1->insertItem( i18n("View"), viewMenu ); 640 menuBar1->insertItem( i18n("View"), viewMenu );
641 menuBar1->insertItem( i18n("Actions"), actionMenu ); 641 menuBar1->insertItem( i18n("Actions"), actionMenu );
642#ifdef DESKTOP_VERSION 642#ifdef DESKTOP_VERSION
643 menuBar1->insertItem( i18n("Synchronize"), syncMenu ); 643 menuBar1->insertItem( i18n("Synchronize"), syncMenu );
644 menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu ); 644 menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu );
645#else 645#else
646 menuBar1->insertItem( i18n("Sync"), syncMenu ); 646 menuBar1->insertItem( i18n("Sync"), syncMenu );
647 menuBar1->insertItem( i18n("Agenda"),configureAgendaMenu ); 647 menuBar1->insertItem( i18n("Agenda"),configureAgendaMenu );
648#endif 648#endif
649 //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu ); 649 //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu );
650 menuBar1->insertItem( i18n("Filter"),selectFilterMenu ); 650 menuBar1->insertItem( i18n("Filter"),selectFilterMenu );
651 menuBar1->insertItem( i18n("Help"), helpMenu ); 651 menuBar1->insertItem( i18n("Help"), helpMenu );
652 } else { 652 } else {
653 QPEMenuBar *menuBar1; 653 QPEMenuBar *menuBar1;
654 menuBar1 = new QPEMenuBar( iconToolBar ); 654 menuBar1 = new QPEMenuBar( iconToolBar );
655 QPopupMenu *menuBar = new QPopupMenu( this ); 655 QPopupMenu *menuBar = new QPopupMenu( this );
656 icon = loadPixmap( pathString + "z_menu" ); 656 icon = loadPixmap( pathString + "z_menu" );
657 menuBar1->insertItem( icon.pixmap(), menuBar); 657 menuBar1->insertItem( icon.pixmap(), menuBar);
658 //menuBar1->insertItem( i18n("ME"), menuBar); 658 //menuBar1->insertItem( i18n("ME"), menuBar);
659 menuBar->insertItem( i18n("File"), importMenu ); 659 menuBar->insertItem( i18n("File"), importMenu );
660 menuBar->insertItem( i18n("View"), viewMenu ); 660 menuBar->insertItem( i18n("View"), viewMenu );
661 menuBar->insertItem( i18n("Actions"), actionMenu ); 661 menuBar->insertItem( i18n("Actions"), actionMenu );
662 menuBar->insertItem( i18n("Synchronize"), syncMenu ); 662 menuBar->insertItem( i18n("Synchronize"), syncMenu );
663 menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu ); 663 menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu );
664 menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu ); 664 menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu );
665 menuBar->insertItem( i18n("Filter"),selectFilterMenu ); 665 menuBar->insertItem( i18n("Filter"),selectFilterMenu );
666 menuBar->insertItem( i18n("Help"), helpMenu ); 666 menuBar->insertItem( i18n("Help"), helpMenu );
667 //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() ); 667 //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() );
668 menuBar1->setMaximumSize( menuBar1->sizeHint( )); 668 menuBar1->setMaximumSize( menuBar1->sizeHint( ));
669 } 669 }
670 connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); 670 connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) );
671 connect ( selectFilterMenu, SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenu() ) ); 671 connect ( selectFilterMenu, SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenu() ) );
672 672
673 673
674 mWeekBgColor = iconToolBar->backgroundColor(); 674 mWeekBgColor = iconToolBar->backgroundColor();
675 mWeekPixmap.resize( pixWid , pixHei ); 675 mWeekPixmap.resize( pixWid , pixHei );
676 mWeekPixmap.fill( mWeekBgColor ); 676 mWeekPixmap.fill( mWeekBgColor );
677 icon = mWeekPixmap; 677 icon = mWeekPixmap;
678 mWeekAction = new QAction( i18n("Select week number"),icon, i18n("Select week number"), 0, this ); 678 mWeekAction = new QAction( i18n("Select week number"),icon, i18n("Select week number"), 0, this );
679 if ( p-> mShowIconWeekNum ) 679 if ( p-> mShowIconWeekNum )
680 mWeekAction->addTo( iconToolBar ); 680 mWeekAction->addTo( iconToolBar );
681 mWeekFont = font(); 681 mWeekFont = font();
682 682
683 int fontPoint = mWeekFont.pointSize(); 683 int fontPoint = mWeekFont.pointSize();
684 QFontMetrics f( mWeekFont ); 684 QFontMetrics f( mWeekFont );
685 int fontWid = f.width( "30" ); 685 int fontWid = f.width( "30" );
686 while ( fontWid > pixWid ) { 686 while ( fontWid > pixWid ) {
687 --fontPoint; 687 --fontPoint;
688 mWeekFont.setPointSize( fontPoint ); 688 mWeekFont.setPointSize( fontPoint );
689 QFontMetrics f( mWeekFont ); 689 QFontMetrics f( mWeekFont );
690 fontWid = f.width( "30" ); 690 fontWid = f.width( "30" );
691 //qDebug("dec-- "); 691 //qDebug("dec-- ");
692 } 692 }
693 693
694 connect( mWeekAction, SIGNAL( activated() ), 694 connect( mWeekAction, SIGNAL( activated() ),
695 this, SLOT( weekAction() ) ); 695 this, SLOT( weekAction() ) );
696 696
697 connect( this, SIGNAL( selectWeek ( int ) ), mView->dateNavigator(), SLOT( selectWeek ( int ) ) ); 697 connect( this, SIGNAL( selectWeek ( int ) ), mView->dateNavigator(), SLOT( selectWeek ( int ) ) );
698 if ( p->mShowIconFilterview ) { 698 if ( p->mShowIconFilterview ) {
699 icon = loadPixmap( pathString + "filter" ); 699 icon = loadPixmap( pathString + "filter" );
700 actionFilterMenuTB = new QAction( i18n("Filter selector"), icon, i18n("Filter selector"), 0, this ); 700 actionFilterMenuTB = new QAction( i18n("Filter selector"), icon, i18n("Filter selector"), 0, this );
701 connect( actionFilterMenuTB, SIGNAL( activated() ), 701 connect( actionFilterMenuTB, SIGNAL( activated() ),
702 this, SLOT( fillFilterMenuTB() ) ); 702 this, SLOT( fillFilterMenuTB() ) );
703 actionFilterMenuTB->addTo( iconToolBar ); 703 actionFilterMenuTB->addTo( iconToolBar );
704 selectFilterMenuTB = new QPopupMenu( this ); 704 selectFilterMenuTB = new QPopupMenu( this );
705 selectFilterMenuTB->setCheckable( true ); 705 selectFilterMenuTB->setCheckable( true );
706 connect ( selectFilterMenuTB, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); 706 connect ( selectFilterMenuTB, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) );
707 } 707 }
708 708
709 //#endif 709 //#endif
710 // ****************** 710 // ******************
711 QAction *action; 711 QAction *action;
712 // QPopupMenu *configureMenu= new QPopupMenu( menuBar ); 712 // QPopupMenu *configureMenu= new QPopupMenu( menuBar );
713 configureToolBarMenu->setCheckable( true ); 713 configureToolBarMenu->setCheckable( true );
714 714
715 715
716 configureAgendaMenu->setCheckable( true ); 716 configureAgendaMenu->setCheckable( true );
717 int iii ; 717 int iii ;
718 for ( iii = 1;iii<= 10 ;++iii ){ 718 for ( iii = 1;iii<= 10 ;++iii ){
719 configureAgendaMenu->insertItem(i18n("Size %1").arg(iii), (iii+1)*2 ); 719 configureAgendaMenu->insertItem(i18n("Size %1").arg(iii), (iii+1)*2 );
720 } 720 }
721 //configureMenu->insertItem( "AgendaSize",configureAgendaMenu ); 721 //configureMenu->insertItem( "AgendaSize",configureAgendaMenu );
722 722
723 connect( configureAgendaMenu, SIGNAL( aboutToShow()), 723 connect( configureAgendaMenu, SIGNAL( aboutToShow()),
724 this, SLOT( showConfigureAgenda( ) ) ); 724 this, SLOT( showConfigureAgenda( ) ) );
725 725
726 icon = loadPixmap( pathString + "configure" ); 726 icon = loadPixmap( pathString + "configure" );
727 action = new QAction( i18n("Configure"),icon, i18n("Configure KO/Pi..."), 0, this ); 727 action = new QAction( i18n("Configure"),icon, i18n("Configure KO/Pi..."), 0, this );
728 action->addTo( actionMenu ); 728 action->addTo( actionMenu );
729 connect( action, SIGNAL( activated() ), 729 connect( action, SIGNAL( activated() ),
730 mView, SLOT( edit_options() ) ); 730 mView, SLOT( edit_options() ) );
731 icon = loadPixmap( pathString + "configure" ); 731 icon = loadPixmap( pathString + "configure" );
732 action = new QAction( i18n("Configure"),icon, i18n("Global Settings..."), 0, this ); 732 action = new QAction( i18n("Configure"),icon, i18n("Global Settings..."), 0, this );
733 action->addTo( actionMenu ); 733 action->addTo( actionMenu );
734 connect( action, SIGNAL( activated() ), 734 connect( action, SIGNAL( activated() ),
735 mView, SLOT( edit_global_options() ) ); 735 mView, SLOT( edit_global_options() ) );
736 actionMenu->insertSeparator(); 736 actionMenu->insertSeparator();
737 737
738 action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this ); 738 action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this );
739 action->addTo( actionMenu ); 739 action->addTo( actionMenu );
740 connect( action, SIGNAL( activated() ), 740 connect( action, SIGNAL( activated() ),
741 mView, SLOT( undo_delete() ) ); 741 mView, SLOT( undo_delete() ) );
742 actionMenu->insertSeparator(); 742 actionMenu->insertSeparator();
743 743
744 icon = loadPixmap( pathString + "newevent" ); 744 icon = loadPixmap( pathString + "newevent" );
745 configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 ); 745 configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 );
746 configureToolBarMenu->insertItem(i18n("Only one toolbar"), 6 ); 746 configureToolBarMenu->insertItem(i18n("Only one toolbar"), 6 );
747 configureToolBarMenu->insertSeparator(); 747 configureToolBarMenu->insertSeparator();
748 configureToolBarMenu->insertItem(i18n("Filtermenu"), 7 ); 748 configureToolBarMenu->insertItem(i18n("Filtermenu"), 7 );
749 configureToolBarMenu->insertSeparator(); 749 configureToolBarMenu->insertSeparator();
750 configureToolBarMenu->insertItem(i18n("Week Number"), 400); 750 configureToolBarMenu->insertItem(i18n("Week Number"), 400);
751 configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 ); 751 configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 );
752 QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this ); 752 QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this );
753 ne_action->addTo( actionMenu ); 753 ne_action->addTo( actionMenu );
754 connect( ne_action, SIGNAL( activated() ), 754 connect( ne_action, SIGNAL( activated() ),
755 mView, SLOT( newEvent() ) ); 755 mView, SLOT( newEvent() ) );
756 icon = loadPixmap( pathString + "newtodo" ); 756 icon = loadPixmap( pathString + "newtodo" );
757 configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 ); 757 configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 );
758 QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this ); 758 QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this );
759 nt_action->addTo( actionMenu ); 759 nt_action->addTo( actionMenu );
760 connect( nt_action, SIGNAL( activated() ), 760 connect( nt_action, SIGNAL( activated() ),
761 mView, SLOT( newTodo() ) ); 761 mView, SLOT( newTodo() ) );
762 762
763 icon = loadPixmap( pathString + "today" ); 763 icon = loadPixmap( pathString + "today" );
764 QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this ); 764 QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this );
765 today_action->addTo( viewMenu ); 765 today_action->addTo( viewMenu );
766 connect( today_action, SIGNAL( activated() ), 766 connect( today_action, SIGNAL( activated() ),
767 mView, SLOT( goToday() ) ); 767 mView, SLOT( goToday() ) );
768 viewMenu->insertSeparator(); 768 viewMenu->insertSeparator();
769 769
770 // *********************** 770 // ***********************
771 if ( KOPrefs::instance()->mVerticalScreen ) { 771 if ( KOPrefs::instance()->mVerticalScreen ) {
772 icon = SmallIcon( "1updownarrow" ); 772 icon = SmallIcon( "1updownarrow" );
773 } else { 773 } else {
774 icon = SmallIcon("1leftrightarrow" ); 774 icon = SmallIcon("1leftrightarrow" );
775 } 775 }
776 configureToolBarMenu->insertItem(icon, i18n("Toggle Fullscreen"), 28 ); 776 configureToolBarMenu->insertItem(icon, i18n("Toggle Fullscreen"), 28 );
777 QAction* FSaction = new QAction( i18n("Toggle Fullscreen"), icon, i18n("Toggle Fullscreen"), 0, this ); 777 QAction* FSaction = new QAction( i18n("Toggle Fullscreen"), icon, i18n("Toggle Fullscreen"), 0, this );
778 FSaction->addTo( viewMenu ); 778 FSaction->addTo( viewMenu );
779 connect( FSaction, SIGNAL( activated() ), mView, SLOT( toggleExpand() )); 779 connect( FSaction, SIGNAL( activated() ), mView, SLOT( toggleExpand() ));
780 780
781 icon = loadPixmap( pathString + "navi" ); 781 icon = loadPixmap( pathString + "navi" );
782 configureToolBarMenu->insertItem(icon, i18n("Toggle DateNavigator"), 22 ); 782 configureToolBarMenu->insertItem(icon, i18n("Toggle DateNavigator"), 22 );
783 action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this ); 783 action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this );
784 action->addTo( viewMenu ); 784 action->addTo( viewMenu );
785 connect( action, SIGNAL( activated() ), 785 connect( action, SIGNAL( activated() ),
786 mView, SLOT( toggleDateNavigatorWidget() ) ); 786 mView, SLOT( toggleDateNavigatorWidget() ) );
787 mToggleNav = action ; 787 mToggleNav = action ;
788 icon = loadPixmap( pathString + "filter" ); 788 icon = loadPixmap( pathString + "filter" );
789 configureToolBarMenu->insertItem(icon, i18n("Filter menu icon"), 26 ); 789 configureToolBarMenu->insertItem(icon, i18n("Filter menu icon"), 26 );
790 action = new QAction( i18n("Toggle FilterView"), icon, i18n("Toggle FilterView"), 0, this ); 790 icon = loadPixmap( pathString + "configure" );
791 action = new QAction( i18n("Toggle Resource View"), icon, i18n("Toggle Resource View"), 0, this );
791 action->addTo( viewMenu ); 792 action->addTo( viewMenu );
792 connect( action, SIGNAL( activated() ), 793 connect( action, SIGNAL( activated() ),
793 mView, SLOT( toggleFilter() ) ); 794 mView, SLOT( toggleFilter() ) );
794 mToggleFilter = action; 795 mToggleFilter = action;
795 icon = loadPixmap( pathString + "allday" ); 796 icon = loadPixmap( pathString + "allday" );
796 configureToolBarMenu->insertItem(icon, i18n("Toggle Allday"), 24 ); 797 configureToolBarMenu->insertItem(icon, i18n("Toggle Allday"), 24 );
797 action = new QAction( i18n("Toggle Allday"), icon,i18n("Toggle Allday"), 0, this ); 798 action = new QAction( i18n("Toggle Allday"), icon,i18n("Toggle Allday"), 0, this );
798 action->addTo( viewMenu ); 799 action->addTo( viewMenu );
799 connect( action, SIGNAL( activated() ), 800 connect( action, SIGNAL( activated() ),
800 mView, SLOT( toggleAllDaySize() ) ); 801 mView, SLOT( toggleAllDaySize() ) );
801 mToggleAllday = action; 802 mToggleAllday = action;
802 803
803 804
804 connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), 805 connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ),
805 mToggleNav, SLOT( setEnabled ( bool ) ) ); 806 mToggleNav, SLOT( setEnabled ( bool ) ) );
806 connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), 807 connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ),
807 mToggleFilter, SLOT( setEnabled ( bool ) ) ); 808 mToggleFilter, SLOT( setEnabled ( bool ) ) );
808 connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ), 809 connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ),
809 mToggleAllday, SLOT( setEnabled ( bool ) ) ); 810 mToggleAllday, SLOT( setEnabled ( bool ) ) );
810 // connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ), 811 // connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ),
811 // configureAgendaMenu, SLOT( setEnabled ( bool ) ) ); 812 // configureAgendaMenu, SLOT( setEnabled ( bool ) ) );
812 813
813 viewMenu->insertSeparator(); 814 viewMenu->insertSeparator();
814 icon = loadPixmap( pathString + "picker" ); 815 icon = loadPixmap( pathString + "picker" );
815 action = new QAction( i18n("Date Picker"), icon, i18n("Date Picker"), 0, this ); 816 action = new QAction( i18n("Date Picker"), icon, i18n("Date Picker"), 0, this );
816 action->addTo( viewMenu ); 817 action->addTo( viewMenu );
817 connect( action, SIGNAL( activated() ), 818 connect( action, SIGNAL( activated() ),
818 mView, SLOT( showDatePicker() ) ); 819 mView, SLOT( showDatePicker() ) );
819 action->addTo( iconToolBar ); 820 action->addTo( iconToolBar );
820 viewMenu->insertSeparator(); 821 viewMenu->insertSeparator();
821 822
822 if ( p-> mShowIconToggleFull ) 823 if ( p-> mShowIconToggleFull )
823 FSaction->addTo( iconToolBar ); 824 FSaction->addTo( iconToolBar );
824 if ( p->mShowIconNavigator ) mToggleNav ->addTo( iconToolBar ); 825 if ( p->mShowIconNavigator ) mToggleNav ->addTo( iconToolBar );
825 826
826 //******************** 827 //********************
827 if ( p->mShowIconAllday ) mToggleAllday->addTo( iconToolBar ); 828 if ( p->mShowIconAllday ) mToggleAllday->addTo( iconToolBar );
828 829
829 830
830 icon = loadPixmap( pathString + "whatsnext" ); 831 icon = loadPixmap( pathString + "whatsnext" );
831 configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110 ); 832 configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110 );
832 QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this ); 833 QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this );
833 whatsnext_action->addTo( viewMenu ); 834 whatsnext_action->addTo( viewMenu );
834 connect( whatsnext_action, SIGNAL( activated() ), 835 connect( whatsnext_action, SIGNAL( activated() ),
835 mView->viewManager(), SLOT( showWhatsNextView() ) ); 836 mView->viewManager(), SLOT( showWhatsNextView() ) );
836 837
837 icon = loadPixmap( pathString + "xdays" ); 838 icon = loadPixmap( pathString + "xdays" );
838 configureToolBarMenu->insertItem(icon, i18n("Next days"), 100 ); 839 configureToolBarMenu->insertItem(icon, i18n("Next days"), 100 );
839 QAction* xdays_action = new QAction( i18n("Next days"), icon, i18n("Next days"), 0, this ); 840 QAction* xdays_action = new QAction( i18n("Next days"), icon, i18n("Next days"), 0, this );
840 xdays_action->addTo( viewMenu ); 841 xdays_action->addTo( viewMenu );
841 connect( xdays_action, SIGNAL( activated() ), 842 connect( xdays_action, SIGNAL( activated() ),
842 mView->viewManager(), SLOT( showNextXView() ) ); 843 mView->viewManager(), SLOT( showNextXView() ) );
843 844
844 845
845 icon = loadPixmap( pathString + "journal" ); 846 icon = loadPixmap( pathString + "journal" );
846 configureToolBarMenu->insertItem(icon, i18n("Journal"), 90 ); 847 configureToolBarMenu->insertItem(icon, i18n("Journal"), 90 );
847 QAction* viewjournal_action = new QAction( i18n("Journal"), icon, i18n("Journal"), 0, this ); 848 QAction* viewjournal_action = new QAction( i18n("Journal"), icon, i18n("Journal"), 0, this );
848 viewjournal_action->addTo( viewMenu ); 849 viewjournal_action->addTo( viewMenu );
849 connect( viewjournal_action, SIGNAL( activated() ), 850 connect( viewjournal_action, SIGNAL( activated() ),
850 mView->viewManager(), SLOT( showJournalView() ) ); 851 mView->viewManager(), SLOT( showJournalView() ) );
851 852
852 853
853 icon = loadPixmap( pathString + "day" ); 854 icon = loadPixmap( pathString + "day" );
854 configureToolBarMenu->insertItem(icon, i18n("Day View"), 40 ); 855 configureToolBarMenu->insertItem(icon, i18n("Day View"), 40 );
855 QAction* day1_action = new QAction( i18n("Day View"), icon, i18n("Day View"), 0, this ); 856 QAction* day1_action = new QAction( i18n("Day View"), icon, i18n("Day View"), 0, this );
856 day1_action->addTo( viewMenu ); 857 day1_action->addTo( viewMenu );
857 // action->addTo( toolBar ); 858 // action->addTo( toolBar );
858 connect( day1_action, SIGNAL( activated() ), 859 connect( day1_action, SIGNAL( activated() ),
859 mView->viewManager(), SLOT( showDayView() ) ); 860 mView->viewManager(), SLOT( showDayView() ) );
860 861
861 icon = loadPixmap( pathString + "workweek" ); 862 icon = loadPixmap( pathString + "workweek" );
862 configureToolBarMenu->insertItem(icon, i18n("Work Week"), 50 ); 863 configureToolBarMenu->insertItem(icon, i18n("Work Week"), 50 );
863 QAction* day5_action = new QAction( i18n("Work Week"), icon, i18n("Work Week"), 0, this ); 864 QAction* day5_action = new QAction( i18n("Work Week"), icon, i18n("Work Week"), 0, this );
864 day5_action->addTo( viewMenu ); 865 day5_action->addTo( viewMenu );
865 connect( day5_action, SIGNAL( activated() ), 866 connect( day5_action, SIGNAL( activated() ),
866 mView->viewManager(), SLOT( showWorkWeekView() ) ); 867 mView->viewManager(), SLOT( showWorkWeekView() ) );
867 868
868 icon = loadPixmap( pathString + "week" ); 869 icon = loadPixmap( pathString + "week" );
869 configureToolBarMenu->insertItem(icon, i18n("Week"), 60 ); 870 configureToolBarMenu->insertItem(icon, i18n("Week"), 60 );
870 QAction* day7_action = new QAction( i18n("Week"), icon, i18n("Week"), 0, this ); 871 QAction* day7_action = new QAction( i18n("Week"), icon, i18n("Week"), 0, this );
871 day7_action->addTo( viewMenu ); 872 day7_action->addTo( viewMenu );
872 connect( day7_action, SIGNAL( activated() ), 873 connect( day7_action, SIGNAL( activated() ),
873 mView->viewManager(), SLOT( showWeekView() ) ); 874 mView->viewManager(), SLOT( showWeekView() ) );
874 875
875 icon = loadPixmap( pathString + "workweek2" ); 876 icon = loadPixmap( pathString + "workweek2" );
876 configureToolBarMenu->insertItem(icon, i18n("List week view"), 75 ); 877 configureToolBarMenu->insertItem(icon, i18n("List week view"), 75 );
877 QAction* day6_action = new QAction( i18n("List week"), icon, i18n("List week"), 0, this ); 878 QAction* day6_action = new QAction( i18n("List week"), icon, i18n("List week"), 0, this );
878 day6_action->addTo( viewMenu ); 879 day6_action->addTo( viewMenu );
879 connect( day6_action, SIGNAL( activated() ), 880 connect( day6_action, SIGNAL( activated() ),
880 mView->viewManager(), SLOT( showMonthViewWeek() ) ); 881 mView->viewManager(), SLOT( showMonthViewWeek() ) );
881 882
882 icon = loadPixmap( pathString + "month" ); 883 icon = loadPixmap( pathString + "month" );
883 configureToolBarMenu->insertItem(icon, i18n("Month"), 70 ); 884 configureToolBarMenu->insertItem(icon, i18n("Month"), 70 );
884 QAction* month_action = new QAction( i18n("Month"), icon, i18n("Month"), 0, this ); 885 QAction* month_action = new QAction( i18n("Month"), icon, i18n("Month"), 0, this );
885 month_action->addTo( viewMenu ); 886 month_action->addTo( viewMenu );
886 connect( month_action, SIGNAL( activated() ), 887 connect( month_action, SIGNAL( activated() ),
887 mView->viewManager(), SLOT( showMonthView() ) ); 888 mView->viewManager(), SLOT( showMonthView() ) );
888 889
889 icon = loadPixmap( pathString + "list" ); 890 icon = loadPixmap( pathString + "list" );
890 configureToolBarMenu->insertItem(icon, i18n("List View"), 30 ); 891 configureToolBarMenu->insertItem(icon, i18n("List View"), 30 );
891 QAction* showlist_action = new QAction( i18n("List View"), icon, i18n("List View"), 0, this ); 892 QAction* showlist_action = new QAction( i18n("List View"), icon, i18n("List View"), 0, this );
892 showlist_action->addTo( viewMenu ); 893 showlist_action->addTo( viewMenu );
893 connect( showlist_action, SIGNAL( activated() ), 894 connect( showlist_action, SIGNAL( activated() ),
894 mView->viewManager(), SLOT( showListView() ) ); 895 mView->viewManager(), SLOT( showListView() ) );
895 896
896 icon = loadPixmap( pathString + "todo" ); 897 icon = loadPixmap( pathString + "todo" );
897 configureToolBarMenu->insertItem(icon, i18n("Todo View"), 80 ); 898 configureToolBarMenu->insertItem(icon, i18n("Todo View"), 80 );
898 QAction* todoview_action = new QAction( i18n("Todo View"), icon, i18n("Todo View"), 0, this ); 899 QAction* todoview_action = new QAction( i18n("Todo View"), icon, i18n("Todo View"), 0, this );
899 todoview_action->addTo( viewMenu ); 900 todoview_action->addTo( viewMenu );
900 connect( todoview_action, SIGNAL( activated() ), 901 connect( todoview_action, SIGNAL( activated() ),
901 mView->viewManager(), SLOT( showTodoView() ) ); 902 mView->viewManager(), SLOT( showTodoView() ) );
902 903
903 904
904 905
905#if 0 906#if 0
906 action = new QAction( "view_timespan", "Time Span", 0, this ); 907 action = new QAction( "view_timespan", "Time Span", 0, this );
907 action->addTo( viewMenu ); 908 action->addTo( viewMenu );
908 connect( action, SIGNAL( activated() ), 909 connect( action, SIGNAL( activated() ),
909 mView->viewManager(), SLOT( showTimeSpanView() ) ); 910 mView->viewManager(), SLOT( showTimeSpanView() ) );
910#endif 911#endif
911 912
912 mNewSubTodoAction = new QAction( "new_subtodo", i18n("New Sub-Todo..."), 0, 913 mNewSubTodoAction = new QAction( "new_subtodo", i18n("New Sub-Todo..."), 0,
913 this ); 914 this );
914 mNewSubTodoAction->addTo( actionMenu ); 915 mNewSubTodoAction->addTo( actionMenu );
915 connect( mNewSubTodoAction, SIGNAL( activated() ), 916 connect( mNewSubTodoAction, SIGNAL( activated() ),
916 mView, SLOT( newSubTodo() ) ); 917 mView, SLOT( newSubTodo() ) );
917 918
918 actionMenu->insertSeparator(); 919 actionMenu->insertSeparator();
919 920
920 mShowAction = new QAction( "show_incidence", i18n("Show..."), 0, this ); 921 mShowAction = new QAction( "show_incidence", i18n("Show..."), 0, this );
921 mShowAction->addTo( actionMenu ); 922 mShowAction->addTo( actionMenu );
922 connect( mShowAction, SIGNAL( activated() ), 923 connect( mShowAction, SIGNAL( activated() ),
923 mView, SLOT( showIncidence() ) ); 924 mView, SLOT( showIncidence() ) );
924 925
925 mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this ); 926 mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this );
926 mEditAction->addTo( actionMenu ); 927 mEditAction->addTo( actionMenu );
927 connect( mEditAction, SIGNAL( activated() ), 928 connect( mEditAction, SIGNAL( activated() ),
928 mView, SLOT( editIncidence() ) ); 929 mView, SLOT( editIncidence() ) );
929 930
930 mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this ); 931 mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this );
931 mDeleteAction->addTo( actionMenu ); 932 mDeleteAction->addTo( actionMenu );
932 connect( mDeleteAction, SIGNAL( activated() ), 933 connect( mDeleteAction, SIGNAL( activated() ),
933 mView, SLOT( deleteIncidence() ) ); 934 mView, SLOT( deleteIncidence() ) );
934 935
935 936
936 mCloneAction = new QAction( "clone_incidence", i18n("Clone..."), 0, this ); 937 mCloneAction = new QAction( "clone_incidence", i18n("Clone..."), 0, this );
937 mCloneAction->addTo( actionMenu ); 938 mCloneAction->addTo( actionMenu );
938 connect( mCloneAction, SIGNAL( activated() ), 939 connect( mCloneAction, SIGNAL( activated() ),
939 mView, SLOT( cloneIncidence() ) ); 940 mView, SLOT( cloneIncidence() ) );
940 mMoveAction = new QAction( "Move_incidence", i18n("Move..."), 0, this ); 941 mMoveAction = new QAction( "Move_incidence", i18n("Move..."), 0, this );
941 mMoveAction->addTo( actionMenu ); 942 mMoveAction->addTo( actionMenu );
942 connect( mMoveAction, SIGNAL( activated() ), 943 connect( mMoveAction, SIGNAL( activated() ),
943 mView, SLOT( moveIncidence() ) ); 944 mView, SLOT( moveIncidence() ) );
944 mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this ); 945 mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this );
945 mBeamAction->addTo( actionMenu ); 946 mBeamAction->addTo( actionMenu );
946 connect( mBeamAction, SIGNAL( activated() ), 947 connect( mBeamAction, SIGNAL( activated() ),
947 mView, SLOT( beamIncidence() ) ); 948 mView, SLOT( beamIncidence() ) );
948 mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this ); 949 mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this );
949 mCancelAction->addTo( actionMenu ); 950 mCancelAction->addTo( actionMenu );
950 connect( mCancelAction, SIGNAL( activated() ), 951 connect( mCancelAction, SIGNAL( activated() ),
951 mView, SLOT( toggleCancelIncidence() ) ); 952 mView, SLOT( toggleCancelIncidence() ) );
952 953
953 actionMenu->insertSeparator(); 954 actionMenu->insertSeparator();
954 955
955 action = new QAction( "purge_completed", i18n("Purge Completed"), 0, 956 action = new QAction( "purge_completed", i18n("Purge Completed"), 0,
956 this ); 957 this );
957 action->addTo( actionMenu ); 958 action->addTo( actionMenu );
958 connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) ); 959 connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) );
959 960
960 icon = loadPixmap( pathString + "search" ); 961 icon = loadPixmap( pathString + "search" );
961 QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this ); 962 QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this );
962 configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 5); 963 configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 5);
963 search_action->addTo( actionMenu ); 964 search_action->addTo( actionMenu );
964 connect( search_action, SIGNAL( activated() ), 965 connect( search_action, SIGNAL( activated() ),
965 mView->dialogManager(), SLOT( showSearchDialog() ) ); 966 mView->dialogManager(), SLOT( showSearchDialog() ) );
966 967
967 968
968 969
969 if ( KOPrefs::instance()->mShowFullMenu ) { 970 if ( KOPrefs::instance()->mShowFullMenu ) {
970 actionMenu->insertSeparator(); 971 actionMenu->insertSeparator();
971 actionMenu->insertItem( i18n("Configure Toolbar"),configureToolBarMenu ); 972 actionMenu->insertItem( i18n("Configure Toolbar"),configureToolBarMenu );
972 973
973 } 974 }
974 // actionMenu->insertSeparator(); 975 // actionMenu->insertSeparator();
975 action = new QAction( "import_qtopia", i18n("Import (*.ics/*.vcs) file"), 0, 976 action = new QAction( "import_qtopia", i18n("Import (*.ics/*.vcs) file"), 0,
976 this ); 977 this );
977 action->addTo( importMenu_X ); 978 action->addTo( importMenu_X );
978 connect( action, SIGNAL( activated() ), SLOT( importIcal() ) ); 979 connect( action, SIGNAL( activated() ), SLOT( importIcal() ) );
979 action = new QAction( "import_quick", i18n("Import last file"), 0, 980 action = new QAction( "import_quick", i18n("Import last file"), 0,
980 this ); 981 this );
981 action->addTo( importMenu_X ); 982 action->addTo( importMenu_X );
982 connect( action, SIGNAL( activated() ), SLOT( quickImportIcal() ) ); 983 connect( action, SIGNAL( activated() ), SLOT( quickImportIcal() ) );
@@ -1299,385 +1300,385 @@ void MainWindow::initActions()
1299 1300
1300 1301
1301 if ( filterMenubar ) { 1302 if ( filterMenubar ) {
1302 filterMenubar->reparent(filterToolBar,0,QPoint(0,0) ); 1303 filterMenubar->reparent(filterToolBar,0,QPoint(0,0) );
1303 connect( mView->filterView(), SIGNAL( filterChanged() ), SLOT( updateFilterToolbar() ) ); 1304 connect( mView->filterView(), SIGNAL( filterChanged() ), SLOT( updateFilterToolbar() ) );
1304 } 1305 }
1305 connect( configureToolBarMenu, SIGNAL( activated( int ) ),this, SLOT(configureToolBar( int ) ) ); 1306 connect( configureToolBarMenu, SIGNAL( activated( int ) ),this, SLOT(configureToolBar( int ) ) );
1306 configureAgenda( p->mHourSize ); 1307 configureAgenda( p->mHourSize );
1307 connect( configureAgendaMenu, SIGNAL( activated( int ) ),this, SLOT(configureAgenda( int ) ) ); 1308 connect( configureAgendaMenu, SIGNAL( activated( int ) ),this, SLOT(configureAgenda( int ) ) );
1308} 1309}
1309 1310
1310void MainWindow::exportToPhone( int mode ) 1311void MainWindow::exportToPhone( int mode )
1311{ 1312{
1312 1313
1313 //ex2phone->insertItem(i18n("Complete calendar..."), 1 ); 1314 //ex2phone->insertItem(i18n("Complete calendar..."), 1 );
1314 //ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); 1315 //ex2phone->insertItem(i18n("Filtered calendar..."), 2 );
1315 KOex2phonePrefs ex2phone; 1316 KOex2phonePrefs ex2phone;
1316 1317
1317 ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection ); 1318 ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection );
1318 ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice ); 1319 ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice );
1319 ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel ); 1320 ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel );
1320 if ( mode == 1 ) 1321 if ( mode == 1 )
1321 ex2phone.setCaption(i18n("Export complete calendar")); 1322 ex2phone.setCaption(i18n("Export complete calendar"));
1322 if ( mode == 2 ) 1323 if ( mode == 2 )
1323 ex2phone.setCaption(i18n("Export filtered calendar")); 1324 ex2phone.setCaption(i18n("Export filtered calendar"));
1324 1325
1325 if ( !ex2phone.exec() ) { 1326 if ( !ex2phone.exec() ) {
1326 return; 1327 return;
1327 } 1328 }
1328 KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text(); 1329 KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text();
1329 KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text(); 1330 KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text();
1330 KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text(); 1331 KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text();
1331 1332
1332 int inFuture = 0; 1333 int inFuture = 0;
1333 if ( ex2phone.mWriteBackFuture->isChecked() ) 1334 if ( ex2phone.mWriteBackFuture->isChecked() )
1334 inFuture = ex2phone.mWriteBackFutureWeeks->value(); 1335 inFuture = ex2phone.mWriteBackFutureWeeks->value();
1335 QPtrList<Incidence> delSel; 1336 QPtrList<Incidence> delSel;
1336 if ( mode == 1 ) 1337 if ( mode == 1 )
1337 delSel = mCalendar->rawIncidences(); 1338 delSel = mCalendar->rawIncidences();
1338 if ( mode == 2 ) 1339 if ( mode == 2 )
1339 delSel = mCalendar->incidences(); 1340 delSel = mCalendar->incidences();
1340 CalendarLocal* cal = new CalendarLocal(); 1341 CalendarLocal* cal = new CalendarLocal();
1341 cal->setLocalTime(); 1342 cal->setLocalTime();
1342 Incidence *incidence = delSel.first(); 1343 Incidence *incidence = delSel.first();
1343 QDateTime cur = QDateTime::currentDateTime().addDays( -7 ); 1344 QDateTime cur = QDateTime::currentDateTime().addDays( -7 );
1344 QDateTime end = cur.addDays( ( inFuture +1 ) *7 ); 1345 QDateTime end = cur.addDays( ( inFuture +1 ) *7 );
1345 while ( incidence ) { 1346 while ( incidence ) {
1346 if ( incidence->typeID() != journalID ) { 1347 if ( incidence->typeID() != journalID ) {
1347 bool add = true; 1348 bool add = true;
1348 if ( inFuture ) { 1349 if ( inFuture ) {
1349 QDateTime dt; 1350 QDateTime dt;
1350 if ( incidence->typeID() == todoID ) { 1351 if ( incidence->typeID() == todoID ) {
1351 Todo * t = (Todo*)incidence; 1352 Todo * t = (Todo*)incidence;
1352 if ( t->hasDueDate() ) 1353 if ( t->hasDueDate() )
1353 dt = t->dtDue(); 1354 dt = t->dtDue();
1354 else 1355 else
1355 dt = cur.addSecs( 62 ); 1356 dt = cur.addSecs( 62 );
1356 } 1357 }
1357 else { 1358 else {
1358 bool ok; 1359 bool ok;
1359 dt = incidence->getNextOccurence( cur, &ok ); 1360 dt = incidence->getNextOccurence( cur, &ok );
1360 if ( !ok ) 1361 if ( !ok )
1361 dt = cur.addSecs( -62 ); 1362 dt = cur.addSecs( -62 );
1362 } 1363 }
1363 if ( dt < cur || dt > end ) { 1364 if ( dt < cur || dt > end ) {
1364 add = false; 1365 add = false;
1365 } 1366 }
1366 } 1367 }
1367 if ( add ) { 1368 if ( add ) {
1368 Incidence *in = incidence->clone(); 1369 Incidence *in = incidence->clone();
1369 cal->addIncidence( in ); 1370 cal->addIncidence( in );
1370 } 1371 }
1371 } 1372 }
1372 incidence = delSel.next(); 1373 incidence = delSel.next();
1373 } 1374 }
1374 PhoneAccess::writeConfig( KPimGlobalPrefs::instance()->mEx2PhoneDevice, 1375 PhoneAccess::writeConfig( KPimGlobalPrefs::instance()->mEx2PhoneDevice,
1375 KPimGlobalPrefs::instance()->mEx2PhoneConnection, 1376 KPimGlobalPrefs::instance()->mEx2PhoneConnection,
1376 KPimGlobalPrefs::instance()->mEx2PhoneModel ); 1377 KPimGlobalPrefs::instance()->mEx2PhoneModel );
1377 1378
1378 setCaption( i18n("Writing to phone...")); 1379 setCaption( i18n("Writing to phone..."));
1379 if ( PhoneFormat::writeToPhone( cal ) ) 1380 if ( PhoneFormat::writeToPhone( cal ) )
1380 setCaption( i18n("Export to phone successful!")); 1381 setCaption( i18n("Export to phone successful!"));
1381 else 1382 else
1382 setCaption( i18n("Error exporting to phone!")); 1383 setCaption( i18n("Error exporting to phone!"));
1383 delete cal; 1384 delete cal;
1384} 1385}
1385 1386
1386 1387
1387void MainWindow::setDefaultPreferences() 1388void MainWindow::setDefaultPreferences()
1388{ 1389{
1389 KOPrefs *p = KOPrefs::instance(); 1390 KOPrefs *p = KOPrefs::instance();
1390 1391
1391 p->mCompactDialogs = true; 1392 p->mCompactDialogs = true;
1392 p->mConfirm = true; 1393 p->mConfirm = true;
1393 // p->mEnableQuickTodo = false; 1394 // p->mEnableQuickTodo = false;
1394 1395
1395} 1396}
1396 1397
1397QString MainWindow::resourcePath() 1398QString MainWindow::resourcePath()
1398{ 1399{
1399 return KGlobal::iconLoader()->iconPath(); 1400 return KGlobal::iconLoader()->iconPath();
1400} 1401}
1401 1402
1402void MainWindow::displayText( QString text ,QString cap ) 1403void MainWindow::displayText( QString text ,QString cap )
1403{ 1404{
1404 QDialog dia( this, "name", true ); ; 1405 QDialog dia( this, "name", true ); ;
1405 dia.setCaption( cap ); 1406 dia.setCaption( cap );
1406 QVBoxLayout* lay = new QVBoxLayout( &dia ); 1407 QVBoxLayout* lay = new QVBoxLayout( &dia );
1407 lay->setSpacing( 3 ); 1408 lay->setSpacing( 3 );
1408 lay->setMargin( 3 ); 1409 lay->setMargin( 3 );
1409 QTextBrowser tb ( &dia ); 1410 QTextBrowser tb ( &dia );
1410 lay->addWidget( &tb ); 1411 lay->addWidget( &tb );
1411 tb.setText( text ); 1412 tb.setText( text );
1412#ifdef DESKTOP_VERSION 1413#ifdef DESKTOP_VERSION
1413 dia.resize( 640, 480); 1414 dia.resize( 640, 480);
1414#else 1415#else
1415 dia.showMaximized(); 1416 dia.showMaximized();
1416#endif 1417#endif
1417 dia.exec(); 1418 dia.exec();
1418} 1419}
1419 1420
1420void MainWindow::features() 1421void MainWindow::features()
1421{ 1422{
1422 1423
1423 KApplication::showFile( i18n("KO/Pi Features and hints"), "kdepim/korganizer/featuresKOPI.txt" ); 1424 KApplication::showFile( i18n("KO/Pi Features and hints"), "kdepim/korganizer/featuresKOPI.txt" );
1424} 1425}
1425 1426
1426void MainWindow::usertrans() 1427void MainWindow::usertrans()
1427{ 1428{
1428 1429
1429 KApplication::showFile( i18n("KO/Pi User translation HowTo"), "kdepim/korganizer/usertranslationHOWTO.txt" ); 1430 KApplication::showFile( i18n("KO/Pi User translation HowTo"), "kdepim/korganizer/usertranslationHOWTO.txt" );
1430} 1431}
1431 1432
1432void MainWindow::storagehowto() 1433void MainWindow::storagehowto()
1433{ 1434{
1434 KApplication::showFile( "KDE-Pim/Pi Storage HowTo", "kdepim/storagehowto.txt" ); 1435 KApplication::showFile( "KDE-Pim/Pi Storage HowTo", "kdepim/storagehowto.txt" );
1435} 1436}
1436void MainWindow::timetrackinghowto() 1437void MainWindow::timetrackinghowto()
1437{ 1438{
1438 KApplication::showFile( "KO/Pi Timetracking HowTo", "kdepim/timetrackerhowto.txt" ); 1439 KApplication::showFile( "KO/Pi Timetracking HowTo", "kdepim/timetrackerhowto.txt" );
1439} 1440}
1440void MainWindow::kdesynchowto() 1441void MainWindow::kdesynchowto()
1441{ 1442{
1442 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/Zaurus-KDE_syncHowTo.txt" ); 1443 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/Zaurus-KDE_syncHowTo.txt" );
1443} 1444}
1444void MainWindow::multisynchowto() 1445void MainWindow::multisynchowto()
1445{ 1446{
1446 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/MultiSyncHowTo.txt" ); 1447 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/MultiSyncHowTo.txt" );
1447} 1448}
1448void MainWindow::synchowto() 1449void MainWindow::synchowto()
1449{ 1450{
1450 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" ); 1451 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" );
1451} 1452}
1452void MainWindow::faq() 1453void MainWindow::faq()
1453{ 1454{
1454 KApplication::showFile( i18n("KO/Pi FAQ"), "kdepim/korganizer/kopiFAQ.txt" ); 1455 KApplication::showFile( i18n("KO/Pi FAQ"), "kdepim/korganizer/kopiFAQ.txt" );
1455 1456
1456} 1457}
1457void MainWindow::whatsNew() 1458void MainWindow::whatsNew()
1458{ 1459{
1459 KApplication::showFile( "KDE-Pim/Pi Version Info", "kdepim/WhatsNew.txt" ); 1460 KApplication::showFile( "KDE-Pim/Pi Version Info", "kdepim/WhatsNew.txt" );
1460 1461
1461} 1462}
1462void MainWindow::licence() 1463void MainWindow::licence()
1463{ 1464{
1464 KApplication::showLicence(); 1465 KApplication::showLicence();
1465 1466
1466} 1467}
1467void MainWindow::about() 1468void MainWindow::about()
1468{ 1469{
1469 QString version; 1470 QString version;
1470#include <../version> 1471#include <../version>
1471 QMessageBox::about( this, i18n("About KOrganizer/Pi"), 1472 QMessageBox::about( this, i18n("About KOrganizer/Pi"),
1472 i18n("KOrganizer/Platform-independent\n") + 1473 i18n("KOrganizer/Platform-independent\n") +
1473 "(KO/Pi) " + version + " - " + 1474 "(KO/Pi) " + version + " - " +
1474 1475
1475#ifdef DESKTOP_VERSION 1476#ifdef DESKTOP_VERSION
1476 i18n("Desktop Edition\n") + 1477 i18n("Desktop Edition\n") +
1477#else 1478#else
1478 i18n("PDA-Edition\nfor: Zaurus 5x00/7x0/860/3000/6000\n") + 1479 i18n("PDA-Edition\nfor: Zaurus 5x00/7x0/860/3000/6000\n") +
1479#endif 1480#endif
1480 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!") ); 1481 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!") );
1481} 1482}
1482void MainWindow::keyBindings() 1483void MainWindow::keyBindings()
1483{ 1484{
1484 QString cap = i18n("KO/Pi Keys + Colors"); 1485 QString cap = i18n("KO/Pi Keys + Colors");
1485 QString text = i18n("<p><h2>KO/Pi key shortcuts:</h2></p>\n") + 1486 QString text = i18n("<p><h2>KO/Pi key shortcuts:</h2></p>\n") +
1486 i18n("<p><b>H</b>: This help dialog | <b>S</b>: Search dialog</p>\n")+ 1487 i18n("<p><b>H</b>: This help dialog | <b>S</b>: Search dialog</p>\n")+
1487 i18n("<p><b>N</b>: Switch to next view which has a toolbar icon</p>\n") + 1488 i18n("<p><b>N</b>: Switch to next view which has a toolbar icon</p>\n") +
1488 i18n("<p><b>A+(shift or ctrl)</b>: Show occurence of next alarm</p>\n") + 1489 i18n("<p><b>A+(shift or ctrl)</b>: Show occurence of next alarm</p>\n") +
1489 i18n("<p><b>I</b>: Show info for selected event/todo</p>\n") + 1490 i18n("<p><b>I</b>: Show info for selected event/todo</p>\n") +
1490 i18n("<p><b>Space</b>: Toggle fullscreen | <b>P</b>: Date picker</p>\n")+ 1491 i18n("<p><b>Space</b>: Toggle fullscreen | <b>P</b>: Date picker</p>\n")+
1491 i18n("<p><b>F</b>: Toggle filterview |<b>F+ctrl</b>: Edit filter </p>\n")+ 1492 i18n("<p><b>R</b>: Toggle Resource View |<b>F</b>: Edit filter </p>\n")+
1492 i18n("<p><b>O</b>: Filter On/Off | <b>J</b>: Journal view</p>\n")+ 1493 i18n("<p><b>O</b>: Filter On/Off | <b>J</b>: Journal view</p>\n")+
1493 i18n("<p><b>1-0</b> (+<b>ctrl</b>): Select filter 1-10 (11-20)</p>\n")+ 1494 i18n("<p><b>1-0</b> (+<b>ctrl</b>): Select filter 1-10 (11-20)</p>\n")+
1494 i18n("<p><b>X</b>: Next X days view| <b>W</b>: What's next view\n ")+ 1495 i18n("<p><b>X</b>: Next X days view| <b>W</b>: What's next view\n ")+
1495 i18n("<p><b>V</b>: Todo view | <b>L</b>: Event list view</p>\n")+ 1496 i18n("<p><b>V</b>: Todo view | <b>L</b>: Event list view</p>\n")+
1496 i18n("<p><b>Z,Y</b>: Work week view | <b>U</b>: Week view</p>\n")+ 1497 i18n("<p><b>Z,Y</b>: Work week view | <b>U</b>: Week view</p>\n")+
1497 i18n("<p><b>D</b>: One day view | <b>M</b>: Month view</p>\n")+ 1498 i18n("<p><b>D</b>: One day view | <b>M</b>: Month view</p>\n")+
1498 i18n("<p><b>K</b>: Week view in Month view syle</p>\n")+ 1499 i18n("<p><b>K</b>: Week view in Month view syle</p>\n")+
1499 i18n("<p><b>E</b>: Edit selected item |<b> E+ctrl</b>: New Event</p>\n")+ 1500 i18n("<p><b>E</b>: Edit selected item |<b> E+ctrl</b>: New Event</p>\n")+
1500 i18n("<p><b>T</b>: Goto today | <b>T+ctrl</b>: New Todo</p>\n")+ 1501 i18n("<p><b>T</b>: Goto today | <b>T+ctrl</b>: New Todo</p>\n")+
1501 i18n("<p><b>S+ctrl</b>: Add sub-todo | <b>X+ctrl</b>: Toggle datenavigator</p>\n")+ 1502 i18n("<p><b>S+ctrl</b>: Add sub-todo | <b>X+ctrl</b>: Toggle datenavigator</p>\n")+
1502 i18n("<p><b>+,-</b> : Zoom in/out agenda | <b>A</b>: Toggle allday agenda height</p>\n")+ 1503 i18n("<p><b>+,-</b> : Zoom in/out agenda | <b>A</b>: Toggle allday agenda height</p>\n")+
1503 i18n("<p><b>C</b>: Show current time in agenda view</p>\n")+ 1504 i18n("<p><b>C</b>: Show current time in agenda view</p>\n")+
1504 i18n("<p><b>B</b>: Edit description (details) of selected item</p>\n")+ 1505 i18n("<p><b>B</b>: Edit description (details) of selected item</p>\n")+
1505 i18n("<p><b>right</b>: Next week | <b>right+ctrl</b>: Next month</p>\n")+ 1506 i18n("<p><b>right</b>: Next week | <b>right+ctrl</b>: Next month</p>\n")+
1506 i18n("<p><b>left</b>: Prev. week | <b>left+ctrl</b>: Prev. month</p>\n")+ 1507 i18n("<p><b>left</b>: Prev. week | <b>left+ctrl</b>: Prev. month</p>\n")+
1507 i18n("<p><b>del,backspace</b>: Delete selected item</p>\n")+ 1508 i18n("<p><b>del,backspace</b>: Delete selected item</p>\n")+
1508 i18n("<p><h3>In agenda view:</h3></p>\n") + 1509 i18n("<p><h3>In agenda view:</h3></p>\n") +
1509 i18n("<p><b>up/down</b>: Scroll agenda view</p>\n")+ 1510 i18n("<p><b>up/down</b>: Scroll agenda view</p>\n")+
1510 i18n("<p><b>ctrl+up/down</b>: Scroll small todo view</p>\n")+ 1511 i18n("<p><b>ctrl+up/down</b>: Scroll small todo view</p>\n")+
1511 i18n("<p><h3>In todo view:</h3></p>\n") + 1512 i18n("<p><h3>In todo view:</h3></p>\n") +
1512 i18n("<p><b>shift+U</b>: <b>U</b>nparent todo (make root todo)</p>\n")+ 1513 i18n("<p><b>shift+U</b>: <b>U</b>nparent todo (make root todo)</p>\n")+
1513 i18n("<p><b>shift+S</b>: Make <b>S</b>ubtodo (reparent todo)</p>\n")+ 1514 i18n("<p><b>shift+S</b>: Make <b>S</b>ubtodo (reparent todo)</p>\n")+
1514 i18n("<p><b>shift+P</b>: Make new <b>P</b>arent for todo selected with shift+S</p>\n")+ 1515 i18n("<p><b>shift+P</b>: Make new <b>P</b>arent for todo selected with shift+S</p>\n")+
1515 i18n("<p><b>Q</b>: Toggle quick todo line edit.</p>\n")+ 1516 i18n("<p><b>Q</b>: Toggle quick todo line edit.</p>\n")+
1516 i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ 1517 i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+
1517 i18n("<p><b>return</b>: Mark item as completed+one step down.</p>\n")+ 1518 i18n("<p><b>return</b>: Mark item as completed+one step down.</p>\n")+
1518 i18n("<p><b>return+shift</b>: Mark item as not completed+one step down</p>\n")+ 1519 i18n("<p><b>return+shift</b>: Mark item as not completed+one step down</p>\n")+
1519 i18n("<p><h3>In list view:</h3></p>\n") + 1520 i18n("<p><h3>In list view:</h3></p>\n") +
1520 i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ 1521 i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+
1521 i18n("<p><b>return</b>: Select item+one step down</p>\n")+ 1522 i18n("<p><b>return</b>: Select item+one step down</p>\n")+
1522 i18n("<p><b>return+shift</b>: Deselect item+one step down</p>\n")+ 1523 i18n("<p><b>return+shift</b>: Deselect item+one step down</p>\n")+
1523 i18n("<p><b>up/down</b>: Next/prev item</p>\n")+ 1524 i18n("<p><b>up/down</b>: Next/prev item</p>\n")+
1524 i18n("<p><b>ctrl+up/down</b>: Goto up/down by 20% of items</p>\n")+ 1525 i18n("<p><b>ctrl+up/down</b>: Goto up/down by 20% of items</p>\n")+
1525 i18n("<p><b>shift+up/down</b>: Goto first/last item</p>\n")+ 1526 i18n("<p><b>shift+up/down</b>: Goto first/last item</p>\n")+
1526 i18n("<p><h3>In event/todo viewer:</h3></p>\n") + 1527 i18n("<p><h3>In event/todo viewer:</h3></p>\n") +
1527 i18n("<p><b>I,C</b>: Close dialog.</p>\n")+ 1528 i18n("<p><b>I,C</b>: Close dialog.</p>\n")+
1528 i18n("<p><b>A</b>: Show agenda view.</p>\n")+ 1529 i18n("<p><b>A</b>: Show agenda view.</p>\n")+
1529 i18n("<p><b>E</b>: Edit item</p>\n") + 1530 i18n("<p><b>E</b>: Edit item</p>\n") +
1530 i18n("<p><h2>KO/Pi icon colors:</h2></p>\n") + 1531 i18n("<p><h2>KO/Pi icon colors:</h2></p>\n") +
1531 i18n("<p><b>(for square icons in agenda and month view)</b></p>\n") + 1532 i18n("<p><b>(for square icons in agenda and month view)</b></p>\n") +
1532 i18n("<p><b>Cross</b>: Item cancelled.([c] in Whats'Next view)</p>\n")+ 1533 i18n("<p><b>Cross</b>: Item cancelled.([c] in Whats'Next view)</p>\n")+
1533 i18n("<p><b>Red</b>: Alarm set.([a] in Whats'Next view)</p>\n")+ 1534 i18n("<p><b>Red</b>: Alarm set.([a] in Whats'Next view)</p>\n")+
1534 i18n("<p><b>Blue</b>: Recurrent event.([r] in Whats'Next view)</p>\n")+ 1535 i18n("<p><b>Blue</b>: Recurrent event.([r] in Whats'Next view)</p>\n")+
1535 i18n("<p><b>Dark green</b>: Information(description) available.([i] in WN view)</p>\n")+ 1536 i18n("<p><b>Dark green</b>: Information(description) available.([i] in WN view)</p>\n")+
1536 i18n("<p><b>Black</b>: Event/todo with attendees. You are the organizer!</p>\n")+ 1537 i18n("<p><b>Black</b>: Event/todo with attendees. You are the organizer!</p>\n")+
1537 i18n("<p><b>Dark yellow</b>: Event/todo with attendees.</p>\n") + 1538 i18n("<p><b>Dark yellow</b>: Event/todo with attendees.</p>\n") +
1538 i18n("<p><b>White</b>: Item readonly</p>\n"); 1539 i18n("<p><b>White</b>: Item readonly</p>\n");
1539 displayText( text, cap); 1540 displayText( text, cap);
1540} 1541}
1541void MainWindow::aboutAutoSaving() 1542void MainWindow::aboutAutoSaving()
1542{ 1543{
1543 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"); 1544 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");
1544 1545
1545 KApplication::showText( i18n("Auto Saving in KOrganizer/Pi"), text); 1546 KApplication::showText( i18n("Auto Saving in KOrganizer/Pi"), text);
1546 1547
1547} 1548}
1548void MainWindow::aboutKnownBugs() 1549void MainWindow::aboutKnownBugs()
1549{ 1550{
1550 QMessageBox* msg; 1551 QMessageBox* msg;
1551 msg = new QMessageBox( i18n("Known Problems in KOrganizer/Pi"), 1552 msg = new QMessageBox( i18n("Known Problems in KOrganizer/Pi"),
1552 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")+ 1553 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")+
1553 i18n("2) Audio alarm daemon\nfor Zaurus is available!\nas an additional small application\n")+ 1554 i18n("2) Audio alarm daemon\nfor Zaurus is available!\nas an additional small application\n")+
1554 i18n("\nPlease report unexpected behaviour to\nlutz@pi-sync.info\n") + 1555 i18n("\nPlease report unexpected behaviour to\nlutz@pi-sync.info\n") +
1555 i18n("\nor report them in the bugtracker on\n") + 1556 i18n("\nor report them in the bugtracker on\n") +
1556 i18n("\nhttp://sourceforge.net/projects/kdepimpi\n"), 1557 i18n("\nhttp://sourceforge.net/projects/kdepimpi\n"),
1557 QMessageBox::NoIcon, 1558 QMessageBox::NoIcon,
1558 QMessageBox::Ok, 1559 QMessageBox::Ok,
1559 QMessageBox::NoButton, 1560 QMessageBox::NoButton,
1560 QMessageBox::NoButton); 1561 QMessageBox::NoButton);
1561 msg->exec(); 1562 msg->exec();
1562 delete msg; 1563 delete msg;
1563 1564
1564} 1565}
1565 1566
1566QString MainWindow::defaultFileName() 1567QString MainWindow::defaultFileName()
1567{ 1568{
1568 return locateLocal( "data", "korganizer/mycalendar.ics" ); 1569 return locateLocal( "data", "korganizer/mycalendar.ics" );
1569} 1570}
1570QString MainWindow::syncFileName() 1571QString MainWindow::syncFileName()
1571{ 1572{
1572#ifdef DESKTOP_VERSION 1573#ifdef DESKTOP_VERSION
1573 return locateLocal( "tmp", "synccalendar.ics" ); 1574 return locateLocal( "tmp", "synccalendar.ics" );
1574#else 1575#else
1575 return QString( "/tmp/synccalendar.ics" ); 1576 return QString( "/tmp/synccalendar.ics" );
1576#endif 1577#endif
1577} 1578}
1578#include "koglobals.h" 1579#include "koglobals.h"
1579#include <kcalendarsystem.h> 1580#include <kcalendarsystem.h>
1580void MainWindow::updateWeek(QDate seda) 1581void MainWindow::updateWeek(QDate seda)
1581{ 1582{
1582 int weekNum = KGlobal::locale()->weekNum ( seda ); 1583 int weekNum = KGlobal::locale()->weekNum ( seda );
1583 mWeekPixmap.fill( mWeekBgColor ); 1584 mWeekPixmap.fill( mWeekBgColor );
1584 QPainter p ( &mWeekPixmap ); 1585 QPainter p ( &mWeekPixmap );
1585 p.setFont( mWeekFont ); 1586 p.setFont( mWeekFont );
1586 p.drawText( 0,0,mWeekPixmap.width(), mWeekPixmap.height(),AlignCenter, QString::number( weekNum) ); 1587 p.drawText( 0,0,mWeekPixmap.width(), mWeekPixmap.height(),AlignCenter, QString::number( weekNum) );
1587 p.end(); 1588 p.end();
1588 QIconSet icon3 ( mWeekPixmap ); 1589 QIconSet icon3 ( mWeekPixmap );
1589 mWeekAction->setIconSet ( icon3 ); 1590 mWeekAction->setIconSet ( icon3 );
1590 1591
1591} 1592}
1592void MainWindow::updateWeekNum(const DateList &selectedDates) 1593void MainWindow::updateWeekNum(const DateList &selectedDates)
1593{ 1594{
1594 updateWeek( selectedDates.first() ); 1595 updateWeek( selectedDates.first() );
1595} 1596}
1596void MainWindow::processIncidenceSelection( Incidence *incidence ) 1597void MainWindow::processIncidenceSelection( Incidence *incidence )
1597{ 1598{
1598 1599
1599 if ( !incidence ) { 1600 if ( !incidence ) {
1600 enableIncidenceActions( false ); 1601 enableIncidenceActions( false );
1601 1602
1602 mNewSubTodoAction->setEnabled( false ); 1603 mNewSubTodoAction->setEnabled( false );
1603 setCaptionToDates(); 1604 setCaptionToDates();
1604 return; 1605 return;
1605 1606
1606 } 1607 }
1607 1608
1608 //KGlobal::locale()->formatDateTime(nextA, true); 1609 //KGlobal::locale()->formatDateTime(nextA, true);
1609 QString startString = ""; 1610 QString startString = "";
1610 if ( incidence->typeID() != todoID ) { 1611 if ( incidence->typeID() != todoID ) {
1611 if ( incidence->dtStart().date() < incidence->dtEnd().date() ) { 1612 if ( incidence->dtStart().date() < incidence->dtEnd().date() ) {
1612 if ( incidence->doesFloat() ) { 1613 if ( incidence->doesFloat() ) {
1613 startString += ": "+incidence->dtStartDateStr( true ); 1614 startString += ": "+incidence->dtStartDateStr( true );
1614 startString += " --- "+((Event*)incidence)->dtEndDateStr( true ); 1615 startString += " --- "+((Event*)incidence)->dtEndDateStr( true );
1615 1616
1616 } else { 1617 } else {
1617 startString = ": "+incidence->dtStartStr(true); 1618 startString = ": "+incidence->dtStartStr(true);
1618 startString += " --- "+((Event*)incidence)->dtEndStr(true); 1619 startString += " --- "+((Event*)incidence)->dtEndStr(true);
1619 1620
1620 } 1621 }
1621 1622
1622 } else { 1623 } else {
1623 if ( incidence->dtStart().time() != incidence->dtEnd().time() ) 1624 if ( incidence->dtStart().time() != incidence->dtEnd().time() )
1624 startString = ": "+KGlobal::locale()->formatTime(incidence->dtStart().time())+ 1625 startString = ": "+KGlobal::locale()->formatTime(incidence->dtStart().time())+
1625 "-"+KGlobal::locale()->formatTime(incidence->dtEnd().time()); 1626 "-"+KGlobal::locale()->formatTime(incidence->dtEnd().time());
1626 1627
1627 if ( incidence->isBirthday() || incidence->isAnniversary() ) { 1628 if ( incidence->isBirthday() || incidence->isAnniversary() ) {
1628 bool ok; 1629 bool ok;
1629 QDateTime noc = incidence->getNextOccurence( mView->startDate().addDays(-1), &ok ); 1630 QDateTime noc = incidence->getNextOccurence( mView->startDate().addDays(-1), &ok );
1630 if ( ok ) { 1631 if ( ok ) {
1631 int years = noc.date().year() - incidence->dtStart().date().year(); 1632 int years = noc.date().year() - incidence->dtStart().date().year();
1632 startString += i18n(" (%1 y.)"). arg( years ); 1633 startString += i18n(" (%1 y.)"). arg( years );
1633 } 1634 }
1634 } 1635 }
1635 else 1636 else
1636 startString +=" "+KGlobal::locale()->formatDate( incidence->dtStart().date(), true); 1637 startString +=" "+KGlobal::locale()->formatDate( incidence->dtStart().date(), true);
1637 } 1638 }
1638 1639
1639 } 1640 }
1640 else 1641 else
1641 startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+QString::number( (( KCal::Todo*)incidence)->percentComplete() ) +i18n("\% completed"); 1642 startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+QString::number( (( KCal::Todo*)incidence)->percentComplete() ) +i18n("\% completed");
1642 if ( !incidence->location().isEmpty() ) 1643 if ( !incidence->location().isEmpty() )
1643 startString += " (" +incidence->location()+")"; 1644 startString += " (" +incidence->location()+")";
1644 setCaption( incidence->summary()+startString); 1645 setCaption( incidence->summary()+startString);
1645 1646
1646 enableIncidenceActions( true ); 1647 enableIncidenceActions( true );
1647 1648
1648 if ( incidence->typeID() == eventID ) { 1649 if ( incidence->typeID() == eventID ) {
1649 mShowAction->setText( i18n("Show Event...") ); 1650 mShowAction->setText( i18n("Show Event...") );
1650 mEditAction->setText( i18n("Edit Event...") ); 1651 mEditAction->setText( i18n("Edit Event...") );
1651 mDeleteAction->setText( i18n("Delete Event...") ); 1652 mDeleteAction->setText( i18n("Delete Event...") );
1652 1653
1653 mNewSubTodoAction->setEnabled( false ); 1654 mNewSubTodoAction->setEnabled( false );
1654 } else if ( incidence->typeID() == todoID ) { 1655 } else if ( incidence->typeID() == todoID ) {
1655 mShowAction->setText( i18n("Show Todo...") ); 1656 mShowAction->setText( i18n("Show Todo...") );
1656 mEditAction->setText( i18n("Edit Todo...") ); 1657 mEditAction->setText( i18n("Edit Todo...") );
1657 mDeleteAction->setText( i18n("Delete Todo...") ); 1658 mDeleteAction->setText( i18n("Delete Todo...") );
1658 1659
1659 mNewSubTodoAction->setEnabled( true ); 1660 mNewSubTodoAction->setEnabled( true );
1660 } else { 1661 } else {
1661 mShowAction->setText( i18n("Show...") ); 1662 mShowAction->setText( i18n("Show...") );
1662 mShowAction->setText( i18n("Edit...") ); 1663 mShowAction->setText( i18n("Edit...") );
1663 mShowAction->setText( i18n("Delete...") ); 1664 mShowAction->setText( i18n("Delete...") );
1664 1665
1665 mNewSubTodoAction->setEnabled( false ); 1666 mNewSubTodoAction->setEnabled( false );
1666 } 1667 }
1667} 1668}
1668 1669
1669void MainWindow::enableIncidenceActions( bool enabled ) 1670void MainWindow::enableIncidenceActions( bool enabled )
1670{ 1671{
1671 mShowAction->setEnabled( enabled ); 1672 mShowAction->setEnabled( enabled );
1672 mEditAction->setEnabled( enabled ); 1673 mEditAction->setEnabled( enabled );
1673 mDeleteAction->setEnabled( enabled ); 1674 mDeleteAction->setEnabled( enabled );
1674 1675
1675 mCloneAction->setEnabled( enabled ); 1676 mCloneAction->setEnabled( enabled );
1676 mMoveAction->setEnabled( enabled ); 1677 mMoveAction->setEnabled( enabled );
1677 mBeamAction->setEnabled( enabled ); 1678 mBeamAction->setEnabled( enabled );
1678 mCancelAction->setEnabled( enabled ); 1679 mCancelAction->setEnabled( enabled );
1679} 1680}
1680 1681
1681void MainWindow::importOL() 1682void MainWindow::importOL()
1682{ 1683{
1683#ifdef _OL_IMPORT_ 1684#ifdef _OL_IMPORT_
@@ -1798,388 +1799,388 @@ void MainWindow::slotModifiedChanged( bool changed )
1798{ 1799{
1799 if ( mBlockAtStartup ) 1800 if ( mBlockAtStartup )
1800 return; 1801 return;
1801 1802
1802 int msec; 1803 int msec;
1803 // we store the changes after 1 minute, 1804 // we store the changes after 1 minute,
1804 // and for safety reasons after 10 minutes again 1805 // and for safety reasons after 10 minutes again
1805 if ( !mSyncManager->blockSave() ) 1806 if ( !mSyncManager->blockSave() )
1806 msec = (1000 * 60*KOPrefs::instance()->mAutoSaveInterval) +1000; 1807 msec = (1000 * 60*KOPrefs::instance()->mAutoSaveInterval) +1000;
1807 else 1808 else
1808 msec = 1000 * 600; 1809 msec = 1000 * 600;
1809 mSaveTimer.start( msec, true ); // 1 minute 1810 mSaveTimer.start( msec, true ); // 1 minute
1810 qDebug("KO: Saving File in %d secs!", msec/1000); 1811 qDebug("KO: Saving File in %d secs!", msec/1000);
1811 mCalendarModifiedFlag = true; 1812 mCalendarModifiedFlag = true;
1812} 1813}
1813void MainWindow::saveStopTimer() 1814void MainWindow::saveStopTimer()
1814{ 1815{
1815 mSaveTimer.stop(); 1816 mSaveTimer.stop();
1816} 1817}
1817void MainWindow::save() 1818void MainWindow::save()
1818{ 1819{
1819 if ( !mCalendarModifiedFlag ) { 1820 if ( !mCalendarModifiedFlag ) {
1820 qDebug("KO: Calendar not modified. Nothing saved."); 1821 qDebug("KO: Calendar not modified. Nothing saved.");
1821 return; 1822 return;
1822 } 1823 }
1823 if ( mSyncManager->blockSave() ) 1824 if ( mSyncManager->blockSave() )
1824 return; 1825 return;
1825 mSyncManager->setBlockSave(true); 1826 mSyncManager->setBlockSave(true);
1826 if ( mView->checkFileVersion( defaultFileName()) ) { 1827 if ( mView->checkFileVersion( defaultFileName()) ) {
1827 if ( KPimGlobalPrefs::instance()->mBackupEnabled ){ 1828 if ( KPimGlobalPrefs::instance()->mBackupEnabled ){
1828 QDate reference ( 2000,1,1); 1829 QDate reference ( 2000,1,1);
1829 int daysTo = reference.daysTo ( QDate::currentDate() ); 1830 int daysTo = reference.daysTo ( QDate::currentDate() );
1830 if ( daysTo - KPimGlobalPrefs::instance()->mBackupDayCount >= KOPrefs::instance()->mLastBackupDate ) { 1831 if ( daysTo - KPimGlobalPrefs::instance()->mBackupDayCount >= KOPrefs::instance()->mLastBackupDate ) {
1831 setCaption(i18n("Creating backup ... please wait ..." )); 1832 setCaption(i18n("Creating backup ... please wait ..." ));
1832 qDebug("KO: Last backup was %d days ago ", daysTo - KOPrefs::instance()->mLastBackupDate); 1833 qDebug("KO: Last backup was %d days ago ", daysTo - KOPrefs::instance()->mLastBackupDate);
1833 // we need the file path, the backup dir and the number of bups as param 1834 // we need the file path, the backup dir and the number of bups as param
1834 QString bupDir = KPimGlobalPrefs::instance()->mBackupDatadir; 1835 QString bupDir = KPimGlobalPrefs::instance()->mBackupDatadir;
1835 if ( KPimGlobalPrefs::instance()->mBackupUseDefaultDir) 1836 if ( KPimGlobalPrefs::instance()->mBackupUseDefaultDir)
1836 bupDir = KGlobalSettings::backupDataDir(); 1837 bupDir = KGlobalSettings::backupDataDir();
1837 int retval = KApplication::createBackup( defaultFileName(), bupDir, KPimGlobalPrefs::instance()->mBackupNumbers ); 1838 int retval = KApplication::createBackup( defaultFileName(), bupDir, KPimGlobalPrefs::instance()->mBackupNumbers );
1838 if ( retval == 0 ) { 1839 if ( retval == 0 ) {
1839 qDebug("KO: Backup cancelled. Will try again tomorrow "); 1840 qDebug("KO: Backup cancelled. Will try again tomorrow ");
1840 // retval == 0 : backup skipped for today, try again tomorrow 1841 // retval == 0 : backup skipped for today, try again tomorrow
1841 KOPrefs::instance()->mLastBackupDate = daysTo- KPimGlobalPrefs::instance()->mBackupDayCount+1; 1842 KOPrefs::instance()->mLastBackupDate = daysTo- KPimGlobalPrefs::instance()->mBackupDayCount+1;
1842 } else if ( retval == 1 ){ 1843 } else if ( retval == 1 ){
1843 qDebug("KO: Backup created."); 1844 qDebug("KO: Backup created.");
1844 // backup ok 1845 // backup ok
1845 KOPrefs::instance()->mLastBackupDate = daysTo; 1846 KOPrefs::instance()->mLastBackupDate = daysTo;
1846 1847
1847 } else if ( retval == 2 ){ 1848 } else if ( retval == 2 ){
1848 qDebug("KO: Backup globally cancelled."); 1849 qDebug("KO: Backup globally cancelled.");
1849 // backup globally cancelled 1850 // backup globally cancelled
1850 KPimGlobalPrefs::instance()->mBackupEnabled = false; 1851 KPimGlobalPrefs::instance()->mBackupEnabled = false;
1851 } 1852 }
1852 // retval == 3: do nothing, try again later 1853 // retval == 3: do nothing, try again later
1853 } 1854 }
1854 ; // KPimGlobalPrefs::instance()->mLastBackupDate 1855 ; // KPimGlobalPrefs::instance()->mLastBackupDate
1855 } 1856 }
1856 QTime neededSaveTime = QDateTime::currentDateTime().time(); 1857 QTime neededSaveTime = QDateTime::currentDateTime().time();
1857 setCaption(i18n("KO/Pi:Saving Data to File ..." )); 1858 setCaption(i18n("KO/Pi:Saving Data to File ..." ));
1858 qDebug("KO: Start saving data to file!"); 1859 qDebug("KO: Start saving data to file!");
1859 mView->saveCalendar( defaultFileName() ); 1860 mView->saveCalendar( defaultFileName() );
1860 mCalendarModifiedFlag = false; 1861 mCalendarModifiedFlag = false;
1861 int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() ); 1862 int msNeeded = neededSaveTime.msecsTo( QDateTime::currentDateTime().time() );
1862 qDebug("KO: Needed %d ms for saving.",msNeeded ); 1863 qDebug("KO: Needed %d ms for saving.",msNeeded );
1863 QString savemes; 1864 QString savemes;
1864 savemes.sprintf(i18n("KO/Pi:File Saved. Needed %d sec, %d ms"),(msNeeded/1000)%100,msNeeded%1000 ); 1865 savemes.sprintf(i18n("KO/Pi:File Saved. Needed %d sec, %d ms"),(msNeeded/1000)%100,msNeeded%1000 );
1865 setCaption(savemes); 1866 setCaption(savemes);
1866 } else 1867 } else
1867 setCaption(i18n("Saving cancelled!")); 1868 setCaption(i18n("Saving cancelled!"));
1868 mSyncManager->setBlockSave( false ); 1869 mSyncManager->setBlockSave( false );
1869} 1870}
1870 1871
1871void MainWindow::keyReleaseEvent ( QKeyEvent * e) 1872void MainWindow::keyReleaseEvent ( QKeyEvent * e)
1872{ 1873{
1873 if ( !e->isAutoRepeat() ) { 1874 if ( !e->isAutoRepeat() ) {
1874 mFlagKeyPressed = false; 1875 mFlagKeyPressed = false;
1875 } 1876 }
1876} 1877}
1877void MainWindow::keyPressEvent ( QKeyEvent * e ) 1878void MainWindow::keyPressEvent ( QKeyEvent * e )
1878{ 1879{
1879 qApp->processEvents(); 1880 qApp->processEvents();
1880 if ( e->isAutoRepeat() && !mFlagKeyPressed ) { 1881 if ( e->isAutoRepeat() && !mFlagKeyPressed ) {
1881 e->ignore(); 1882 e->ignore();
1882 // qDebug(" ignore %d",e->isAutoRepeat() ); 1883 // qDebug(" ignore %d",e->isAutoRepeat() );
1883 return; 1884 return;
1884 } 1885 }
1885 if (! e->isAutoRepeat() ) 1886 if (! e->isAutoRepeat() )
1886 mFlagKeyPressed = true; 1887 mFlagKeyPressed = true;
1887 KOPrefs *p = KOPrefs::instance(); 1888 KOPrefs *p = KOPrefs::instance();
1888 bool showSelectedDates = false; 1889 bool showSelectedDates = false;
1889 int size; 1890 int size;
1890 int pro = 0; 1891 int pro = 0;
1891 //qDebug("MainWindow::keyPressEvent "); 1892 //qDebug("MainWindow::keyPressEvent ");
1892 switch ( e->key() ) { 1893 switch ( e->key() ) {
1893 case Qt::Key_Right: 1894 case Qt::Key_Right:
1894 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton) 1895 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton)
1895 mView->goNextMonth(); 1896 mView->goNextMonth();
1896 else 1897 else
1897 mView->goNext(); 1898 mView->goNext();
1898 showSelectedDates = true; 1899 showSelectedDates = true;
1899 break; 1900 break;
1900 case Qt::Key_Left: 1901 case Qt::Key_Left:
1901 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) 1902 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton )
1902 mView->goPreviousMonth(); 1903 mView->goPreviousMonth();
1903 else 1904 else
1904 mView->goPrevious(); 1905 mView->goPrevious();
1905 showSelectedDates = true; 1906 showSelectedDates = true;
1906 break; 1907 break;
1907 case Qt::Key_Down: 1908 case Qt::Key_Down:
1908 mView->viewManager()->agendaView()->scrollOneHourDown(); 1909 mView->viewManager()->agendaView()->scrollOneHourDown();
1909 break; 1910 break;
1910 case Qt::Key_Up: 1911 case Qt::Key_Up:
1911 mView->viewManager()->agendaView()->scrollOneHourUp(); 1912 mView->viewManager()->agendaView()->scrollOneHourUp();
1912 break; 1913 break;
1913 case Qt::Key_K: 1914 case Qt::Key_K:
1914 mView->viewManager()->showMonthViewWeek(); 1915 mView->viewManager()->showMonthViewWeek();
1915 break; 1916 break;
1916 case Qt::Key_I: 1917 case Qt::Key_I:
1917 mView->showIncidence(); 1918 mView->showIncidence();
1918 break; 1919 break;
1919 case Qt::Key_Delete: 1920 case Qt::Key_Delete:
1920 case Qt::Key_Backspace: 1921 case Qt::Key_Backspace:
1921 mView->deleteIncidence(); 1922 mView->deleteIncidence();
1922 break; 1923 break;
1923 case Qt::Key_D: 1924 case Qt::Key_D:
1924 mView->viewManager()->showDayView(); 1925 mView->viewManager()->showDayView();
1925 showSelectedDates = true; 1926 showSelectedDates = true;
1926 break; 1927 break;
1927 case Qt::Key_O: 1928 case Qt::Key_O:
1928 mView->toggleFilerEnabled( ); 1929 mView->toggleFilerEnabled( );
1929 break; 1930 break;
1930 case Qt::Key_0: 1931 case Qt::Key_0:
1931 case Qt::Key_1: 1932 case Qt::Key_1:
1932 case Qt::Key_2: 1933 case Qt::Key_2:
1933 case Qt::Key_3: 1934 case Qt::Key_3:
1934 case Qt::Key_4: 1935 case Qt::Key_4:
1935 case Qt::Key_5: 1936 case Qt::Key_5:
1936 case Qt::Key_6: 1937 case Qt::Key_6:
1937 case Qt::Key_7: 1938 case Qt::Key_7:
1938 case Qt::Key_8: 1939 case Qt::Key_8:
1939 case Qt::Key_9: 1940 case Qt::Key_9:
1940 pro = e->key()-48; 1941 pro = e->key()-48;
1941 if ( pro == 0 ) 1942 if ( pro == 0 )
1942 pro = 10; 1943 pro = 10;
1943 if ( e->state() == Qt::ControlButton) 1944 if ( e->state() == Qt::ControlButton)
1944 pro += 10; 1945 pro += 10;
1945 break; 1946 break;
1946 case Qt::Key_M: 1947 case Qt::Key_M:
1947 mView->viewManager()->showMonthView(); 1948 mView->viewManager()->showMonthView();
1948 showSelectedDates = true; 1949 showSelectedDates = true;
1949 break; 1950 break;
1950 case Qt::Key_Insert: 1951 case Qt::Key_Insert:
1951 mView->newEvent(); 1952 mView->newEvent();
1952 break; 1953 break;
1953 case Qt::Key_S : 1954 case Qt::Key_S :
1954 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton) 1955 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton)
1955 mView->newSubTodo(); 1956 mView->newSubTodo();
1956 else 1957 else
1957 mView->dialogManager()->showSearchDialog(); 1958 mView->dialogManager()->showSearchDialog();
1958 break; 1959 break;
1959 case Qt::Key_Y : 1960 case Qt::Key_Y :
1960 case Qt::Key_Z : 1961 case Qt::Key_Z :
1961 mView->viewManager()->showWorkWeekView(); 1962 mView->viewManager()->showWorkWeekView();
1962 showSelectedDates = true; 1963 showSelectedDates = true;
1963 break; 1964 break;
1964 case Qt::Key_U : 1965 case Qt::Key_U :
1965 mView->viewManager()->showWeekView(); 1966 mView->viewManager()->showWeekView();
1966 showSelectedDates = true; 1967 showSelectedDates = true;
1967 break; 1968 break;
1968 case Qt::Key_H : 1969 case Qt::Key_H :
1969 keyBindings(); 1970 keyBindings();
1970 break; 1971 break;
1971 case Qt::Key_W: 1972 case Qt::Key_W:
1972 mView->viewManager()->showWhatsNextView(); 1973 mView->viewManager()->showWhatsNextView();
1973 break; 1974 break;
1974 case Qt::Key_L: 1975 case Qt::Key_L:
1975 mView->viewManager()->showListView(); 1976 mView->viewManager()->showListView();
1976 break; 1977 break;
1977 case Qt::Key_N: 1978 case Qt::Key_N:
1978 mView->viewManager()->showNextView(); 1979 mView->viewManager()->showNextView();
1979 break; 1980 break;
1980 case Qt::Key_V: 1981 case Qt::Key_V:
1981 mView->viewManager()->showTodoView(); 1982 mView->viewManager()->showTodoView();
1982 break; 1983 break;
1983 case Qt::Key_C: 1984 case Qt::Key_C:
1984 mView->viewManager()->agendaView()->setStartHour( QTime::currentTime ().hour() ); 1985 mView->viewManager()->agendaView()->setStartHour( QTime::currentTime ().hour() );
1985 break; 1986 break;
1986 case Qt::Key_P: 1987 case Qt::Key_P:
1987 mView->showDatePicker( ); 1988 mView->showDatePicker( );
1988 break; 1989 break;
1989 case Qt::Key_F: 1990 case Qt::Key_F:
1990 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) 1991 mView->editFilters();
1991 mView->editFilters(); 1992 break;
1992 else 1993 case Qt::Key_R:
1993 mView->toggleFilter(); 1994 mView->toggleFilter();
1994 break; 1995 break;
1995 case Qt::Key_X: 1996 case Qt::Key_X:
1996 if ( e->state() == Qt::ControlButton ) 1997 if ( e->state() == Qt::ControlButton )
1997 mView->toggleDateNavigatorWidget(); 1998 mView->toggleDateNavigatorWidget();
1998 else { 1999 else {
1999 mView->viewManager()->showNextXView(); 2000 mView->viewManager()->showNextXView();
2000 showSelectedDates = true; 2001 showSelectedDates = true;
2001 } 2002 }
2002 break; 2003 break;
2003 case Qt::Key_Space: 2004 case Qt::Key_Space:
2004 mView->toggleExpand(); 2005 mView->toggleExpand();
2005 break; 2006 break;
2006 case Qt::Key_A: 2007 case Qt::Key_A:
2007 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton ) 2008 if ( e->state() == Qt::ControlButton || e->state() == Qt::ShiftButton )
2008 mView->showNextAlarms(); 2009 mView->showNextAlarms();
2009 else 2010 else
2010 mView->toggleAllDaySize(); 2011 mView->toggleAllDaySize();
2011 break; 2012 break;
2012 case Qt::Key_T: 2013 case Qt::Key_T:
2013 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) 2014 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton )
2014 mView->newTodo(); 2015 mView->newTodo();
2015 else { 2016 else {
2016 mView->goToday(); 2017 mView->goToday();
2017 showSelectedDates = true; 2018 showSelectedDates = true;
2018 } 2019 }
2019 break; 2020 break;
2020 case Qt::Key_J: 2021 case Qt::Key_J:
2021 mView->viewManager()->showJournalView(); 2022 mView->viewManager()->showJournalView();
2022 break; 2023 break;
2023 case Qt::Key_B: 2024 case Qt::Key_B:
2024 mView->editIncidenceDescription();; 2025 mView->editIncidenceDescription();;
2025 break; 2026 break;
2026 // case Qt::Key_Return: 2027 // case Qt::Key_Return:
2027 case Qt::Key_E: 2028 case Qt::Key_E:
2028 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) 2029 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton )
2029 mView->newEvent(); 2030 mView->newEvent();
2030 else 2031 else
2031 mView->editIncidence(); 2032 mView->editIncidence();
2032 break; 2033 break;
2033 case Qt::Key_Plus: 2034 case Qt::Key_Plus:
2034 size = p->mHourSize +2; 2035 size = p->mHourSize +2;
2035 if ( size <= 22 ) 2036 if ( size <= 22 )
2036 configureAgenda( size ); 2037 configureAgenda( size );
2037 break; 2038 break;
2038 case Qt::Key_Minus: 2039 case Qt::Key_Minus:
2039 size = p->mHourSize - 2; 2040 size = p->mHourSize - 2;
2040 if ( size >= 4 ) 2041 if ( size >= 4 )
2041 configureAgenda( size ); 2042 configureAgenda( size );
2042 break; 2043 break;
2043 2044
2044 2045
2045 default: 2046 default:
2046 e->ignore(); 2047 e->ignore();
2047 } 2048 }
2048 if ( pro > 0 ) { 2049 if ( pro > 0 ) {
2049 mView->selectFilter( pro-1 ); 2050 mView->selectFilter( pro-1 );
2050 } 2051 }
2051 if ( showSelectedDates ) { 2052 if ( showSelectedDates ) {
2052 ;// setCaptionToDates(); 2053 ;// setCaptionToDates();
2053 } 2054 }
2054 2055
2055} 2056}
2056void MainWindow::fillFilterMenuTB() 2057void MainWindow::fillFilterMenuTB()
2057{ 2058{
2058 selectFilterMenuTB->clear(); 2059 selectFilterMenuTB->clear();
2059 selectFilterMenuTB->insertItem(i18n ( "Edit Filters" ), 0 ); 2060 selectFilterMenuTB->insertItem(i18n ( "Edit Filters" ), 0 );
2060 selectFilterMenuTB->insertSeparator(); 2061 selectFilterMenuTB->insertSeparator();
2061 selectFilterMenuTB->insertItem(i18n ( "No Filter" ), 1 ); 2062 selectFilterMenuTB->insertItem(i18n ( "No Filter" ), 1 );
2062 2063
2063 selectFilterMenuTB->insertSeparator(); 2064 selectFilterMenuTB->insertSeparator();
2064 QPtrList<CalFilter> fili = mView->filters(); 2065 QPtrList<CalFilter> fili = mView->filters();
2065 CalFilter *curfilter = mView->filterView()->selectedFilter(); 2066 CalFilter *curfilter = mView->filterView()->selectedFilter();
2066 CalFilter *filter = fili.first(); 2067 CalFilter *filter = fili.first();
2067 int iii = 2; 2068 int iii = 2;
2068 bool checkitem = mView->filterView()->filtersEnabled(); 2069 bool checkitem = mView->filterView()->filtersEnabled();
2069 while(filter) { 2070 while(filter) {
2070 selectFilterMenuTB->insertItem( filter->name(), iii ); 2071 selectFilterMenuTB->insertItem( filter->name(), iii );
2071 if ( filter == curfilter) 2072 if ( filter == curfilter)
2072 selectFilterMenuTB->setItemChecked( iii, checkitem ); 2073 selectFilterMenuTB->setItemChecked( iii, checkitem );
2073 filter = fili.next(); 2074 filter = fili.next();
2074 ++iii; 2075 ++iii;
2075 } 2076 }
2076 if ( !checkitem ) 2077 if ( !checkitem )
2077 selectFilterMenuTB->setItemChecked( 1, true ); 2078 selectFilterMenuTB->setItemChecked( 1, true );
2078 2079
2079 int x = 0; 2080 int x = 0;
2080 int y = iconToolBar->height(); 2081 int y = iconToolBar->height();
2081 int dX = 0; 2082 int dX = 0;
2082 int dY = 0; 2083 int dY = 0;
2083 if ( iconToolBar->orientation () == Qt:: Horizontal ) { 2084 if ( iconToolBar->orientation () == Qt:: Horizontal ) {
2084 if ( iconToolBar->y() > height()/2 ) { 2085 if ( iconToolBar->y() > height()/2 ) {
2085 dY = selectFilterMenuTB->sizeHint().height()+8; 2086 dY = selectFilterMenuTB->sizeHint().height()+8;
2086 y = 0; 2087 y = 0;
2087 } 2088 }
2088 } else { 2089 } else {
2089 if ( iconToolBar->x() > width()/2 ) { // right side 2090 if ( iconToolBar->x() > width()/2 ) { // right side
2090 x=0; 2091 x=0;
2091 dX= selectFilterMenuTB->sizeHint().width()+8; 2092 dX= selectFilterMenuTB->sizeHint().width()+8;
2092 y = 0; 2093 y = 0;
2093 } else { 2094 } else {
2094 x= iconToolBar->width(); 2095 x= iconToolBar->width();
2095 y = 0; 2096 y = 0;
2096 } 2097 }
2097 } 2098 }
2098 //qDebug("dax %d dy %d %d %d ", dX, dY, iconToolBar->x(), iconToolBar->y() ); 2099 //qDebug("dax %d dy %d %d %d ", dX, dY, iconToolBar->x(), iconToolBar->y() );
2099 selectFilterMenuTB->popup(iconToolBar->mapToGlobal(QPoint(x,y)-QPoint( dX,dY))); 2100 selectFilterMenuTB->popup(iconToolBar->mapToGlobal(QPoint(x,y)-QPoint( dX,dY)));
2100} 2101}
2101void MainWindow::fillFilterMenu() 2102void MainWindow::fillFilterMenu()
2102{ 2103{
2103 selectFilterMenu->clear(); 2104 selectFilterMenu->clear();
2104 selectFilterMenu->insertItem(i18n ( "Edit Filters" ), 0 ); 2105 selectFilterMenu->insertItem(i18n ( "Edit Filters" ), 0 );
2105 selectFilterMenu->insertSeparator(); 2106 selectFilterMenu->insertSeparator();
2106 selectFilterMenu->insertItem(i18n ( "No Filter" ), 1 ); 2107 selectFilterMenu->insertItem(i18n ( "No Filter" ), 1 );
2107 2108
2108 selectFilterMenu->insertSeparator(); 2109 selectFilterMenu->insertSeparator();
2109 QPtrList<CalFilter> fili = mView->filters(); 2110 QPtrList<CalFilter> fili = mView->filters();
2110 CalFilter *curfilter = mView->filterView()->selectedFilter(); 2111 CalFilter *curfilter = mView->filterView()->selectedFilter();
2111 CalFilter *filter = fili.first(); 2112 CalFilter *filter = fili.first();
2112 int iii = 2; 2113 int iii = 2;
2113 bool checkitem = mView->filterView()->filtersEnabled(); 2114 bool checkitem = mView->filterView()->filtersEnabled();
2114 while(filter) { 2115 while(filter) {
2115 selectFilterMenu->insertItem( filter->name(), iii ); 2116 selectFilterMenu->insertItem( filter->name(), iii );
2116 if ( filter == curfilter) 2117 if ( filter == curfilter)
2117 selectFilterMenu->setItemChecked( iii, checkitem ); 2118 selectFilterMenu->setItemChecked( iii, checkitem );
2118 filter = fili.next(); 2119 filter = fili.next();
2119 ++iii; 2120 ++iii;
2120 } 2121 }
2121 if ( !checkitem ) 2122 if ( !checkitem )
2122 selectFilterMenu->setItemChecked( 1, true ); 2123 selectFilterMenu->setItemChecked( 1, true );
2123} 2124}
2124void MainWindow::fillFilterMenuPopup() 2125void MainWindow::fillFilterMenuPopup()
2125{ 2126{
2126 filterPopupMenu->clear(); 2127 filterPopupMenu->clear();
2127 filterPopupMenu->insertItem(i18n ( "No Filter" ), 0 ); 2128 filterPopupMenu->insertItem(i18n ( "No Filter" ), 0 );
2128 2129
2129 filterPopupMenu->insertSeparator(); 2130 filterPopupMenu->insertSeparator();
2130 QPtrList<CalFilter> fili = mView->filters(); 2131 QPtrList<CalFilter> fili = mView->filters();
2131 CalFilter *curfilter = mView->filterView()->selectedFilter(); 2132 CalFilter *curfilter = mView->filterView()->selectedFilter();
2132 CalFilter *filter = fili.first(); 2133 CalFilter *filter = fili.first();
2133 int iii = 1; 2134 int iii = 1;
2134 bool checkitem = mView->filterView()->filtersEnabled(); 2135 bool checkitem = mView->filterView()->filtersEnabled();
2135 while(filter) { 2136 while(filter) {
2136 filterPopupMenu->insertItem( filter->name(), iii ); 2137 filterPopupMenu->insertItem( filter->name(), iii );
2137 if ( filter == curfilter) 2138 if ( filter == curfilter)
2138 filterPopupMenu->setItemChecked( iii, checkitem ); 2139 filterPopupMenu->setItemChecked( iii, checkitem );
2139 filter = fili.next(); 2140 filter = fili.next();
2140 ++iii; 2141 ++iii;
2141 } 2142 }
2142 if ( !checkitem ) 2143 if ( !checkitem )
2143 filterPopupMenu->setItemChecked( 0, true ); 2144 filterPopupMenu->setItemChecked( 0, true );
2144} 2145}
2145void MainWindow::selectFilter( int fil ) 2146void MainWindow::selectFilter( int fil )
2146{ 2147{
2147 2148
2148 if ( fil == 0 ) { 2149 if ( fil == 0 ) {
2149 mView->editFilters( ); 2150 mView->editFilters( );
2150 } else if ( fil == 1 ){ 2151 } else if ( fil == 1 ){
2151 if ( mView->filterView()->filtersEnabled() ) 2152 if ( mView->filterView()->filtersEnabled() )
2152 mView->toggleFilerEnabled( ); 2153 mView->toggleFilerEnabled( );
2153 } else { 2154 } else {
2154 if ( !mView->filterView()->filtersEnabled() ) { 2155 if ( !mView->filterView()->filtersEnabled() ) {
2155 mView->filterView()->blockSignals( true ); 2156 mView->filterView()->blockSignals( true );
2156 mView->toggleFilerEnabled( ); 2157 mView->toggleFilerEnabled( );
2157 mView->filterView()->blockSignals( false ); 2158 mView->filterView()->blockSignals( false );
2158 } 2159 }
2159 mView->selectFilter( fil-2 ); 2160 mView->selectFilter( fil-2 );
2160 } 2161 }
2161} 2162}
2162void MainWindow::updateFilterToolbar() 2163void MainWindow::updateFilterToolbar()
2163{ 2164{
2164 if ( filterMenubar ) { 2165 if ( filterMenubar ) {
2165 if ( !mView->filterView()->filtersEnabled() ) { 2166 if ( !mView->filterView()->filtersEnabled() ) {
2166 filterMenubar->changeItem( 0, i18n("No Filter") ); 2167 filterMenubar->changeItem( 0, i18n("No Filter") );
2167 } else { 2168 } else {
2168 CalFilter *curfilter = mView->filterView()->selectedFilter(); 2169 CalFilter *curfilter = mView->filterView()->selectedFilter();
2169 if ( curfilter ) { 2170 if ( curfilter ) {
2170 filterMenubar->changeItem( 0, curfilter->name() ); 2171 filterMenubar->changeItem( 0, curfilter->name() );
2171 } 2172 }
2172 } 2173 }
2173 } 2174 }
2174} 2175}
2175void MainWindow::selectFilterPopup( int fil ) 2176void MainWindow::selectFilterPopup( int fil )
2176{ 2177{
2177 selectFilter( fil + 1 ); 2178 selectFilter( fil + 1 );
2178 2179
2179} 2180}
2180void MainWindow::configureToolBar( int item ) 2181void MainWindow::configureToolBar( int item )
2181{ 2182{
2182 2183
2183 configureToolBarMenu->setItemChecked( item, !configureToolBarMenu-> isItemChecked ( item ) ); 2184 configureToolBarMenu->setItemChecked( item, !configureToolBarMenu-> isItemChecked ( item ) );
2184 KOPrefs *p = KOPrefs::instance(); 2185 KOPrefs *p = KOPrefs::instance();
2185 p-> mShowIconStretch= configureToolBarMenu->isItemChecked( 5 ); 2186 p-> mShowIconStretch= configureToolBarMenu->isItemChecked( 5 );