summaryrefslogtreecommitdiffabout
path: root/korganizer
Unidiff
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp80
-rw-r--r--korganizer/calendarview.h4
-rw-r--r--korganizer/mainwindow.cpp71
3 files changed, 126 insertions, 29 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index bc1c0c7..9a114d0 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -645,24 +645,90 @@ void CalendarView::init()
645 645
646CalendarView::~CalendarView() 646CalendarView::~CalendarView()
647{ 647{
648 // kdDebug() << "~CalendarView()" << endl; 648 // kdDebug() << "~CalendarView()" << endl;
649 //qDebug("CalendarView::~CalendarView() "); 649 //qDebug("CalendarView::~CalendarView() ");
650 delete mDialogManager; 650 delete mDialogManager;
651 delete mViewManager; 651 delete mViewManager;
652 delete mStorage; 652 delete mStorage;
653 delete mDateFrame ; 653 delete mDateFrame ;
654 delete mEventViewerDialog; 654 delete mEventViewerDialog;
655 //kdDebug() << "~CalendarView() done" << endl; 655 //kdDebug() << "~CalendarView() done" << endl;
656} 656}
657void CalendarView::nextConflict( bool all, bool allday )
658{
659 QDate start = mNavigator->selectedDates().first().addDays(1);
660 QDate end = start.addDays( 365*2);
661 while ( start < end ) {
662 QPtrList<Event> eventList = calendar()->events( start );
663 Event * ev = eventList.first();
664 QPtrList<Event> test = eventList;
665 while ( ev ) {
666 //qDebug("found %d on %s ", eventList.count(), start.toString().latin1());
667 Event * t_ev = test.first();
668 QDateTime es = ev->dtStart();
669 QDateTime ee = ev->dtEnd();
670 if ( ev->doesFloat() )
671 ee = ee.addDays( 1 );
672 if ( ! all ) {
673 if ( ev->doesFloat() != allday )
674 t_ev = 0;
675 }
676 while ( t_ev ) {
677 bool skip = false;
678 if ( ! all ) {
679 if ( t_ev->doesFloat() != allday )
680 skip = true;
681 }
682 if ( !skip && ev != t_ev ) {
683 QDateTime ets = t_ev->dtStart();
684 QDateTime ete = t_ev->dtEnd();
685 if ( t_ev->doesFloat() )
686 ete = ete.addDays( 1 );
687 //qDebug("test %s -- %s -------- %s -- %s ", es.toString().latin1() , ee.toString().latin1(), ets.toString().latin1() , ete.toString().latin1() );
688 if ( es < ete && ets < ee ) {
689 if ( mViewManager->currentView() != mViewManager->agendaView() || mNavigator->selectedDates().count() > 1 )
690 mViewManager->showDayView();
691 mNavigator->slotDaySelect( start );
692 int hour = es.time().hour();
693 if ( ets > es )
694 hour = ets.time().hour();
695 mViewManager->agendaView()->setStartHour( hour );
696 topLevelWidget()->setCaption( i18n("Conflict %1 <-> %2"). arg( ev->summary().left( 20 ) ).arg( t_ev->summary().left( 20 ) ) );
697 return;
698 }
699 }
700 t_ev = test.next();
701 }
702 ev = eventList.next();
703 }
704 start = start.addDays( 1 );
705 }
706 topLevelWidget()->setCaption( i18n("No conflict found within the next two years") );
707 qDebug("No conflict found ");
708}
709
710void CalendarView::conflictAll()
711{
712 nextConflict ( true, true );
713}
714void CalendarView::conflictAllday()
715{
716 nextConflict ( false, true );
717}
718void CalendarView::conflictNotAll()
719{
720 nextConflict ( false, false );
721}
722
657void CalendarView::setCalReadOnly( int id, bool readO ) 723void CalendarView::setCalReadOnly( int id, bool readO )
658{ 724{
659 if ( readO ) { 725 if ( readO ) {
660 emit save(); 726 emit save();
661 } 727 }
662 mCalendar->setReadOnly( id, readO ); 728 mCalendar->setReadOnly( id, readO );
663} 729}
664void CalendarView::setScrollBarStep(int val ) 730void CalendarView::setScrollBarStep(int val )
665{ 731{
666#ifdef DESKTOP_VERSION 732#ifdef DESKTOP_VERSION
667 mDateScrollBar->setLineStep ( val ); 733 mDateScrollBar->setLineStep ( val );
668#endif 734#endif
@@ -3153,25 +3219,25 @@ void CalendarView::cancelIncidence(Incidence * inc )
3153 updateView(); 3219 updateView();
3154} 3220}
3155void CalendarView::cloneIncidence(Incidence * orgInc ) 3221void CalendarView::cloneIncidence(Incidence * orgInc )
3156{ 3222{
3157 Incidence * newInc = orgInc->clone(); 3223 Incidence * newInc = orgInc->clone();
3158 newInc->recreate(); 3224 newInc->recreate();
3159 3225
3160 if ( newInc->typeID() == todoID ) { 3226 if ( newInc->typeID() == todoID ) {
3161 Todo* t = (Todo*) newInc; 3227 Todo* t = (Todo*) newInc;
3162 bool cloneSub = false; 3228 bool cloneSub = false;
3163 if ( orgInc->relations().count() ) { 3229 if ( orgInc->relations().count() ) {
3164 int result = KMessageBox::warningYesNoCancel(this, 3230 int result = KMessageBox::warningYesNoCancel(this,
3165 i18n("The todo\n%1\nwill be cloned!\nIt has subtodos!\nDo you want to clone\nall subtodos as well?").arg( newInc->summary().left ( 25 ) ), 3231 i18n("The todo\n%1\nwill be cloned!\nIt has subtodos!\nDo you want to clone\nall subtodos as well?").arg( KGlobal::formatMessage ( newInc->summary(),0 ) ),
3166 i18n("Todo has subtodos"), 3232 i18n("Todo has subtodos"),
3167 i18n("Yes"), 3233 i18n("Yes"),
3168 i18n("No")); 3234 i18n("No"));
3169 3235
3170 if ( result == KMessageBox::Cancel ) { 3236 if ( result == KMessageBox::Cancel ) {
3171 delete t; 3237 delete t;
3172 return; 3238 return;
3173 } 3239 }
3174 if (result == KMessageBox::Yes) cloneSub = true; 3240 if (result == KMessageBox::Yes) cloneSub = true;
3175 } 3241 }
3176 showTodoEditor(); 3242 showTodoEditor();
3177 mTodoEditor->editTodo( t ); 3243 mTodoEditor->editTodo( t );
@@ -3491,25 +3557,25 @@ void CalendarView::todo_resub( Todo * parent, Todo * sub )
3491void CalendarView::todo_unsub(Todo *anTodo ) 3557void CalendarView::todo_unsub(Todo *anTodo )
3492{ 3558{
3493 todo_resub( 0, anTodo ); 3559 todo_resub( 0, anTodo );
3494} 3560}
3495 3561
3496void CalendarView::deleteTodo(Todo *todo) 3562void CalendarView::deleteTodo(Todo *todo)
3497{ 3563{
3498 if (!todo) { 3564 if (!todo) {
3499 KNotifyClient::beep(); 3565 KNotifyClient::beep();
3500 return; 3566 return;
3501 } 3567 }
3502 if (KOPrefs::instance()->mConfirm) { 3568 if (KOPrefs::instance()->mConfirm) {
3503 QString text = todo->summary().left(20); 3569 QString text = KGlobal::formatMessage ( todo->summary(),0 );
3504 if (!todo->relations().isEmpty()) { 3570 if (!todo->relations().isEmpty()) {
3505 text += i18n("\nhas sub-todos.\nAll completed sub-todos\nwill be deleted as well!"); 3571 text += i18n("\nhas sub-todos.\nAll completed sub-todos\nwill be deleted as well!");
3506 3572
3507 } 3573 }
3508 switch (msgItemDelete(i18n("Todo:") +"\n"+text)) { 3574 switch (msgItemDelete(i18n("Todo:") +"\n"+text)) {
3509 case KMessageBox::Continue: // OK 3575 case KMessageBox::Continue: // OK
3510 bool deleteT = false; 3576 bool deleteT = false;
3511 if (!todo->relations().isEmpty()) { 3577 if (!todo->relations().isEmpty()) {
3512 deleteT = removeCompletedSubTodos( todo ); 3578 deleteT = removeCompletedSubTodos( todo );
3513 } 3579 }
3514 // deleteT == true: todo already deleted in removeCompletedSubTodos 3580 // deleteT == true: todo already deleted in removeCompletedSubTodos
3515 if ( !deleteT ) { 3581 if ( !deleteT ) {
@@ -3537,25 +3603,25 @@ void CalendarView::deleteJournal(Journal *jour)
3537 } 3603 }
3538 if (KOPrefs::instance()->mConfirm) { 3604 if (KOPrefs::instance()->mConfirm) {
3539 3605
3540 QString des; 3606 QString des;
3541 if ( !jour->summary().isEmpty() ) { 3607 if ( !jour->summary().isEmpty() ) {
3542 des = jour->summary(); 3608 des = jour->summary();
3543 } else { 3609 } else {
3544 des = jour->description().left(30); 3610 des = jour->description().left(30);
3545 des = des.simplifyWhiteSpace (); 3611 des = des.simplifyWhiteSpace ();
3546 des.replace (QRegExp ("\\n"),"" ); 3612 des.replace (QRegExp ("\\n"),"" );
3547 des.replace (QRegExp ("\\r"),"" ); 3613 des.replace (QRegExp ("\\r"),"" );
3548 } 3614 }
3549 switch (msgItemDelete( i18n("Journal:") +"\n"+des.left(20))) { 3615 switch (msgItemDelete( i18n("Journal:") +"\n"+KGlobal::formatMessage ( des,0 ))) {
3550 case KMessageBox::Continue: // OK 3616 case KMessageBox::Continue: // OK
3551 calendar()->deleteJournal(jour); 3617 calendar()->deleteJournal(jour);
3552 updateView(); 3618 updateView();
3553 break; 3619 break;
3554 } // switch 3620 } // switch
3555 } else { 3621 } else {
3556 calendar()->deleteJournal(jour);; 3622 calendar()->deleteJournal(jour);;
3557 updateView(); 3623 updateView();
3558 } 3624 }
3559 emit updateSearchDialog(); 3625 emit updateSearchDialog();
3560} 3626}
3561 3627
@@ -3563,33 +3629,33 @@ void CalendarView::deleteEvent(Event *anEvent)
3563{ 3629{
3564 if (!anEvent) { 3630 if (!anEvent) {
3565 KNotifyClient::beep(); 3631 KNotifyClient::beep();
3566 return; 3632 return;
3567 } 3633 }
3568 3634
3569 if (anEvent->recurrence()->doesRecur()) { 3635 if (anEvent->recurrence()->doesRecur()) {
3570 QDate itemDate = mViewManager->currentSelectionDate(); 3636 QDate itemDate = mViewManager->currentSelectionDate();
3571 int km; 3637 int km;
3572 if (!itemDate.isValid()) { 3638 if (!itemDate.isValid()) {
3573 //kdDebug() << "Date Not Valid" << endl; 3639 //kdDebug() << "Date Not Valid" << endl;
3574 if (KOPrefs::instance()->mConfirm) { 3640 if (KOPrefs::instance()->mConfirm) {
3575 km = KMessageBox::warningContinueCancel(this,anEvent->summary().left(25) + 3641 km = KMessageBox::warningContinueCancel(this,KGlobal::formatMessage ( anEvent->summary(),0 ) +
3576 i18n("\nThis event recurs\nover multiple dates.\nAre you sure you want\nto delete this event\nand all its recurrences?"), 3642 i18n("\nThis event recurs\nover multiple dates.\nAre you sure you want\nto delete this event\nand all its recurrences?"),
3577 i18n("KO/Pi Confirmation"),i18n("Delete All")); 3643 i18n("KO/Pi Confirmation"),i18n("Delete All"));
3578 if ( km == KMessageBox::Continue ) 3644 if ( km == KMessageBox::Continue )
3579 km = KMessageBox::No; // No = all below 3645 km = KMessageBox::No; // No = all below
3580 } else 3646 } else
3581 km = KMessageBox::No; 3647 km = KMessageBox::No;
3582 } else { 3648 } else {
3583 km = KMessageBox::warningYesNoCancel(this,anEvent->summary().left(25) + 3649 km = KMessageBox::warningYesNoCancel(this,KGlobal::formatMessage ( anEvent->summary(),0 ) +
3584 i18n("\nThis event recurs\nover multiple dates.\nDo you want to delete\nall it's recurrences,\nor only the current one on:\n")+ 3650 i18n("\nThis event recurs\nover multiple dates.\nDo you want to delete\nall it's recurrences,\nor only the current one on:\n")+
3585 KGlobal::locale()->formatDate(itemDate)+i18n(" ?\n\nDelete:\n"), 3651 KGlobal::locale()->formatDate(itemDate)+i18n(" ?\n\nDelete:\n"),
3586 i18n("KO/Pi Confirmation"),i18n("Current"), 3652 i18n("KO/Pi Confirmation"),i18n("Current"),
3587 i18n("All")); 3653 i18n("All"));
3588 } 3654 }
3589 switch(km) { 3655 switch(km) {
3590 3656
3591 case KMessageBox::No: // Continue // all 3657 case KMessageBox::No: // Continue // all
3592 //qDebug("KMessageBox::No "); 3658 //qDebug("KMessageBox::No ");
3593 if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0) 3659 if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0)
3594 schedule(Scheduler::Cancel,anEvent); 3660 schedule(Scheduler::Cancel,anEvent);
3595 3661
@@ -3612,25 +3678,25 @@ void CalendarView::deleteEvent(Event *anEvent)
3612 anEvent->addExDate(itemDate); 3678 anEvent->addExDate(itemDate);
3613 int duration = anEvent->recurrence()->duration(); 3679 int duration = anEvent->recurrence()->duration();
3614 if ( duration > 0 ) { 3680 if ( duration > 0 ) {
3615 anEvent->recurrence()->setDuration( duration - 1 ); 3681 anEvent->recurrence()->setDuration( duration - 1 );
3616 } 3682 }
3617 changeEventDisplay(anEvent, KOGlobals::EVENTEDITED); 3683 changeEventDisplay(anEvent, KOGlobals::EVENTEDITED);
3618 } 3684 }
3619 break; 3685 break;
3620 //#endif 3686 //#endif
3621 } // switch 3687 } // switch
3622 } else { 3688 } else {
3623 if (KOPrefs::instance()->mConfirm) { 3689 if (KOPrefs::instance()->mConfirm) {
3624 switch (KMessageBox::warningContinueCancel(this,anEvent->summary().left(25) + 3690 switch (KMessageBox::warningContinueCancel(this,KGlobal::formatMessage ( anEvent->summary(),0 ) +
3625 i18n("\nAre you sure you want\nto delete this event?"), 3691 i18n("\nAre you sure you want\nto delete this event?"),
3626 i18n("KO/Pi Confirmation"),i18n("Delete"))) { 3692 i18n("KO/Pi Confirmation"),i18n("Delete"))) {
3627 case KMessageBox::Continue: // OK 3693 case KMessageBox::Continue: // OK
3628 if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0) 3694 if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0)
3629 schedule(Scheduler::Cancel,anEvent); 3695 schedule(Scheduler::Cancel,anEvent);
3630 checkExternalId( anEvent); 3696 checkExternalId( anEvent);
3631 mCalendar->deleteEvent(anEvent); 3697 mCalendar->deleteEvent(anEvent);
3632 changeEventDisplay(anEvent, KOGlobals::EVENTDELETED); 3698 changeEventDisplay(anEvent, KOGlobals::EVENTDELETED);
3633 break; 3699 break;
3634 } // switch 3700 } // switch
3635 } else { 3701 } else {
3636 if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0) 3702 if (anEvent->organizer()==KOPrefs::instance()->email() && anEvent->attendeeCount()>0)
@@ -4571,25 +4637,25 @@ void CalendarView::removeSyncInfo( QString syncProfile)
4571 4637
4572} 4638}
4573 4639
4574void CalendarView::undo_delete() 4640void CalendarView::undo_delete()
4575{ 4641{
4576 //qDebug("undo_delete() "); 4642 //qDebug("undo_delete() ");
4577 Incidence* undo = mCalendar->undoIncidence(); 4643 Incidence* undo = mCalendar->undoIncidence();
4578 if ( !undo ) { 4644 if ( !undo ) {
4579 KMessageBox::sorry(this,i18n("There is nothing to undo!"), 4645 KMessageBox::sorry(this,i18n("There is nothing to undo!"),
4580 i18n("KO/Pi")); 4646 i18n("KO/Pi"));
4581 return; 4647 return;
4582 } 4648 }
4583 if ( KMessageBox::Continue ==KMessageBox::warningContinueCancel(this,undo->summary().left(25) + 4649 if ( KMessageBox::Continue ==KMessageBox::warningContinueCancel(this,KGlobal::formatMessage ( undo->summary(),0 ) +
4584 i18n("\nAre you sure you want\nto restore this?"), 4650 i18n("\nAre you sure you want\nto restore this?"),
4585 i18n("KO/Pi Confirmation"),i18n("Restore"))) { 4651 i18n("KO/Pi Confirmation"),i18n("Restore"))) {
4586 mCalendar->undoDeleteIncidence(); 4652 mCalendar->undoDeleteIncidence();
4587 updateView(); 4653 updateView();
4588 } 4654 }
4589} 4655}
4590 4656
4591void CalendarView::slotViewerClosed() 4657void CalendarView::slotViewerClosed()
4592{ 4658{
4593 QTimer::singleShot( 50, this, SLOT ( resetFocus() ) ); 4659 QTimer::singleShot( 50, this, SLOT ( resetFocus() ) );
4594} 4660}
4595 4661
diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h
index a5f230a..51eb1d4 100644
--- a/korganizer/calendarview.h
+++ b/korganizer/calendarview.h
@@ -191,24 +191,28 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser
191 /** Emitted, when the number of outgoing messages has changed. */ 191 /** Emitted, when the number of outgoing messages has changed. */
192 void numOutgoingChanged(int); 192 void numOutgoingChanged(int);
193 193
194 /** Send status message, which can e.g. be displayed in the status bar. */ 194 /** Send status message, which can e.g. be displayed in the status bar. */
195 void statusMessage(const QString &); 195 void statusMessage(const QString &);
196 196
197 void calendarViewExpanded( bool ); 197 void calendarViewExpanded( bool );
198 void updateSearchDialog(); 198 void updateSearchDialog();
199 void filtersUpdated(); 199 void filtersUpdated();
200 200
201 201
202 public slots: 202 public slots:
203 void nextConflict( bool all, bool allday );
204 void conflictAll();
205 void conflictAllday();
206 void conflictNotAll();
203 void setCalReadOnly( int id, bool readO ); 207 void setCalReadOnly( int id, bool readO );
204 void checkAlarms(); 208 void checkAlarms();
205 void checkFiles(); 209 void checkFiles();
206 void slotprintSelInc(); 210 void slotprintSelInc();
207 void showNextAlarms(); 211 void showNextAlarms();
208 void showOpenError(); 212 void showOpenError();
209 void watchSavedFile(); 213 void watchSavedFile();
210 void recheckTimerAlarm(); 214 void recheckTimerAlarm();
211 void checkNextTimerAlarm(); 215 void checkNextTimerAlarm();
212 void addAlarm(const QDateTime &qdt, const QString &noti ); 216 void addAlarm(const QDateTime &qdt, const QString &noti );
213 void addSuspendAlarm(const QDateTime &qdt, const QString &noti ); 217 void addSuspendAlarm(const QDateTime &qdt, const QString &noti );
214 void removeAlarm(const QDateTime &qdt, const QString &noti ); 218 void removeAlarm(const QDateTime &qdt, const QString &noti );
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index 9c2ac82..bfae1b5 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -650,24 +650,25 @@ void MainWindow::setUsesBigPixmaps ( bool b )
650 qDebug("KO: BigPixmaps are not supported "); 650 qDebug("KO: BigPixmaps are not supported ");
651} 651}
652void MainWindow::initActions() 652void MainWindow::initActions()
653{ 653{
654 //KOPrefs::instance()->mShowFullMenu 654 //KOPrefs::instance()->mShowFullMenu
655 iconToolBar->clear(); 655 iconToolBar->clear();
656 KOPrefs *p = KOPrefs::instance(); 656 KOPrefs *p = KOPrefs::instance();
657 //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar ); 657 //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar );
658 658
659 QPopupMenu *viewMenu = new QPopupMenu( this ); 659 QPopupMenu *viewMenu = new QPopupMenu( this );
660 QPopupMenu *actionMenu = new QPopupMenu( this ); 660 QPopupMenu *actionMenu = new QPopupMenu( this );
661 mCurrentItemMenu = new QPopupMenu ( this ); 661 mCurrentItemMenu = new QPopupMenu ( this );
662 QPopupMenu *nextConflictMenu = new QPopupMenu ( this );
662 QPopupMenu *importMenu = new QPopupMenu( this ); 663 QPopupMenu *importMenu = new QPopupMenu( this );
663 QPopupMenu *importMenu_X = new QPopupMenu( this ); 664 QPopupMenu *importMenu_X = new QPopupMenu( this );
664 QPopupMenu *exportMenu_X = new QPopupMenu( this ); 665 QPopupMenu *exportMenu_X = new QPopupMenu( this );
665 QPopupMenu *beamMenu_X = new QPopupMenu( this ); 666 QPopupMenu *beamMenu_X = new QPopupMenu( this );
666 selectFilterMenu = new QPopupMenu( this ); 667 selectFilterMenu = new QPopupMenu( this );
667 selectFilterMenu->setCheckable( true ); 668 selectFilterMenu->setCheckable( true );
668 syncMenu = new QPopupMenu( this ); 669 syncMenu = new QPopupMenu( this );
669 configureAgendaMenu = new QPopupMenu( this ); 670 configureAgendaMenu = new QPopupMenu( this );
670 configureToolBarMenu = new QPopupMenu( this ); 671 configureToolBarMenu = new QPopupMenu( this );
671 QPopupMenu *helpMenu = new QPopupMenu( this ); 672 QPopupMenu *helpMenu = new QPopupMenu( this );
672 QIconSet icon; 673 QIconSet icon;
673 int pixWid = 22, pixHei = 22; 674 int pixWid = 22, pixHei = 22;
@@ -780,33 +781,60 @@ void MainWindow::initActions()
780 781
781 icon = loadPixmap( pathString + "picker" ); 782 icon = loadPixmap( pathString + "picker" );
782 QAction* dPickerAction = new QAction( i18n("Select Date..."), icon, i18n("Select Date..."), 0, this ); 783 QAction* dPickerAction = new QAction( i18n("Select Date..."), icon, i18n("Select Date..."), 0, this );
783 dPickerAction->addTo( actionMenu ); 784 dPickerAction->addTo( actionMenu );
784 connect( dPickerAction, SIGNAL( activated() ), 785 connect( dPickerAction, SIGNAL( activated() ),
785 mView, SLOT( showDatePicker() ) ); 786 mView, SLOT( showDatePicker() ) );
786 787
787 icon = loadPixmap( pathString + "search" ); 788 icon = loadPixmap( pathString + "search" );
788 QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this ); 789 QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this );
789 search_action->addTo( actionMenu ); 790 search_action->addTo( actionMenu );
790 connect( search_action, SIGNAL( activated() ), 791 connect( search_action, SIGNAL( activated() ),
791 mView->dialogManager(), SLOT( showSearchDialog() ) ); 792 mView->dialogManager(), SLOT( showSearchDialog() ) );
793 actionMenu->insertItem( i18n("Show next conflict for"), nextConflictMenu );
792 794
795 action = new QAction( "Undo Delete", i18n("All events"), 0, this );
796 action->addTo( nextConflictMenu );
797 connect( action, SIGNAL( activated() ),
798 mView, SLOT( conflictAll() ) );
799
800 action = new QAction( "Undo Delete", i18n("Allday events"), 0, this );
801 action->addTo( nextConflictMenu );
802 connect( action, SIGNAL( activated() ),
803 mView, SLOT( conflictAllday() ) );
804
805 action = new QAction( "Undo Delete", i18n("Events with time"), 0, this );
806 action->addTo( nextConflictMenu );
807 connect( action, SIGNAL( activated() ),
808 mView, SLOT( conflictNotAll() ) );
809
793 actionMenu->insertSeparator(); 810 actionMenu->insertSeparator();
794 811
812 icon = loadPixmap( pathString + "newevent" );
813 QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this );
814 ne_action->addTo( mCurrentItemMenu );
815 connect( ne_action, SIGNAL( activated() ),
816 mView, SLOT( newEvent() ) );
817 icon = loadPixmap( pathString + "newtodo" );
818 configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 );
819 QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this );
820 nt_action->addTo( mCurrentItemMenu );
821 connect( nt_action, SIGNAL( activated() ),
822 mView, SLOT( newTodo() ) );
823 mNewSubTodoAction = new QAction( "new_subtodo", i18n("New Sub-Todo..."), 0,
824 this );
825 mNewSubTodoAction->addTo( mCurrentItemMenu );
826 connect( mNewSubTodoAction, SIGNAL( activated() ),
827 mView, SLOT( newSubTodo() ) );
795 828
796
797 action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this );
798 action->addTo( mCurrentItemMenu );
799 connect( action, SIGNAL( activated() ),
800 mView, SLOT( undo_delete() ) );
801 mCurrentItemMenu->insertSeparator(); 829 mCurrentItemMenu->insertSeparator();
802 icon = loadPixmap( pathString + "newevent" ); 830 icon = loadPixmap( pathString + "newevent" );
803 configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 ); 831 configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 );
804 configureToolBarMenu->insertItem(i18n("Only one toolbar"), 6 ); 832 configureToolBarMenu->insertItem(i18n("Only one toolbar"), 6 );
805 configureToolBarMenu->insertSeparator(); 833 configureToolBarMenu->insertSeparator();
806 configureToolBarMenu->insertItem(i18n("Filtermenu"), 7 ); 834 configureToolBarMenu->insertItem(i18n("Filtermenu"), 7 );
807 configureToolBarMenu->insertSeparator(); 835 configureToolBarMenu->insertSeparator();
808 configureToolBarMenu->insertItem(i18n("Week Number"), 400); 836 configureToolBarMenu->insertItem(i18n("Week Number"), 400);
809 configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 ); 837 configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 );
810 838
811 //actionMenu->insertItem ( i18n("Selected Item"), mCurrentItemMenu); 839 //actionMenu->insertItem ( i18n("Selected Item"), mCurrentItemMenu);
812 mShowAction = new QAction( "show_incidence", i18n("Show"), 0, this ); 840 mShowAction = new QAction( "show_incidence", i18n("Show"), 0, this );
@@ -835,36 +863,30 @@ void MainWindow::initActions()
835 mView, SLOT( moveIncidence() ) ); 863 mView, SLOT( moveIncidence() ) );
836#ifndef DESKTOP_VERSION 864#ifndef DESKTOP_VERSION
837 mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this ); 865 mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this );
838 mBeamAction->addTo(mCurrentItemMenu ); 866 mBeamAction->addTo(mCurrentItemMenu );
839 connect( mBeamAction, SIGNAL( activated() ), 867 connect( mBeamAction, SIGNAL( activated() ),
840 mView, SLOT( beamIncidence() ) ); 868 mView, SLOT( beamIncidence() ) );
841#endif 869#endif
842 mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this ); 870 mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this );
843 mCancelAction->addTo( mCurrentItemMenu ); 871 mCancelAction->addTo( mCurrentItemMenu );
844 connect( mCancelAction, SIGNAL( activated() ), 872 connect( mCancelAction, SIGNAL( activated() ),
845 mView, SLOT( toggleCancelIncidence() ) ); 873 mView, SLOT( toggleCancelIncidence() ) );
846 874
847 QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this ); 875
848 ne_action->addTo( actionMenu ); 876 mCurrentItemMenu->insertSeparator();
849 connect( ne_action, SIGNAL( activated() ), 877 action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this );
850 mView, SLOT( newEvent() ) ); 878 action->addTo( mCurrentItemMenu );
851 icon = loadPixmap( pathString + "newtodo" ); 879 connect( action, SIGNAL( activated() ),
852 configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 ); 880 mView, SLOT( undo_delete() ) );
853 QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this );
854 nt_action->addTo( actionMenu );
855 connect( nt_action, SIGNAL( activated() ),
856 mView, SLOT( newTodo() ) );
857
858
859 881
860 // *********************** 882 // ***********************
861 if ( KOPrefs::instance()->mVerticalScreen ) { 883 if ( KOPrefs::instance()->mVerticalScreen ) {
862 icon = SmallIcon( "1updownarrow" ); 884 icon = SmallIcon( "1updownarrow" );
863 } else { 885 } else {
864 icon = SmallIcon("1leftrightarrow" ); 886 icon = SmallIcon("1leftrightarrow" );
865 } 887 }
866 configureToolBarMenu->insertItem(icon, i18n("Toggle Fullscreen"), 28 ); 888 configureToolBarMenu->insertItem(icon, i18n("Toggle Fullscreen"), 28 );
867 QAction* FSaction = new QAction( i18n("Toggle Fullscreen"), icon, i18n("Toggle Fullscreen"), 0, this ); 889 QAction* FSaction = new QAction( i18n("Toggle Fullscreen"), icon, i18n("Toggle Fullscreen"), 0, this );
868 FSaction->addTo( viewMenu ); 890 FSaction->addTo( viewMenu );
869 connect( FSaction, SIGNAL( activated() ), mView, SLOT( toggleExpand() )); 891 connect( FSaction, SIGNAL( activated() ), mView, SLOT( toggleExpand() ));
870 892
@@ -987,29 +1009,25 @@ void MainWindow::initActions()
987 connect( todoview_action, SIGNAL( activated() ), 1009 connect( todoview_action, SIGNAL( activated() ),
988 mView->viewManager(), SLOT( showTodoView() ) ); 1010 mView->viewManager(), SLOT( showTodoView() ) );
989 1011
990 1012
991 1013
992#if 0 1014#if 0
993 action = new QAction( "view_timespan", "Time Span", 0, this ); 1015 action = new QAction( "view_timespan", "Time Span", 0, this );
994 action->addTo( viewMenu ); 1016 action->addTo( viewMenu );
995 connect( action, SIGNAL( activated() ), 1017 connect( action, SIGNAL( activated() ),
996 mView->viewManager(), SLOT( showTimeSpanView() ) ); 1018 mView->viewManager(), SLOT( showTimeSpanView() ) );
997#endif 1019#endif
998 1020
999 mNewSubTodoAction = new QAction( "new_subtodo", i18n("New Sub-Todo..."), 0, 1021
1000 this );
1001 mNewSubTodoAction->addTo( actionMenu );
1002 connect( mNewSubTodoAction, SIGNAL( activated() ),
1003 mView, SLOT( newSubTodo() ) );
1004 1022
1005 action = new QAction( "purge_completed", i18n("Purge Completed..."), 0, 1023 action = new QAction( "purge_completed", i18n("Purge Completed..."), 0,
1006 this ); 1024 this );
1007 action->addTo( actionMenu ); 1025 action->addTo( actionMenu );
1008 connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) ); 1026 connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) );
1009 1027
1010 1028
1011 configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 5); 1029 configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 5);
1012 1030
1013 1031
1014 1032
1015 actionMenu->insertSeparator(); 1033 actionMenu->insertSeparator();
@@ -1556,24 +1574,25 @@ void MainWindow::keyBindings()
1556{ 1574{
1557 QString cap = i18n("KO/Pi Keys + Colors"); 1575 QString cap = i18n("KO/Pi Keys + Colors");
1558 QString text = i18n("<p><h2>KO/Pi key shortcuts:</h2></p>\n") + 1576 QString text = i18n("<p><h2>KO/Pi key shortcuts:</h2></p>\n") +
1559 i18n("<p><b>H</b>: This help dialog | <b>S</b>: Search dialog</p>\n")+ 1577 i18n("<p><b>H</b>: This help dialog | <b>S</b>: Search dialog</p>\n")+
1560 i18n("<p><b>N</b>: Switch to next view which has a toolbar icon</p>\n") + 1578 i18n("<p><b>N</b>: Switch to next view which has a toolbar icon</p>\n") +
1561 i18n("<p><b>A+(shift or ctrl)</b>: Show occurence of next alarm</p>\n") + 1579 i18n("<p><b>A+(shift or ctrl)</b>: Show occurence of next alarm</p>\n") +
1562 i18n("<p><b>I</b>: Show info for selected event/todo</p>\n") + 1580 i18n("<p><b>I</b>: Show info for selected event/todo</p>\n") +
1563 i18n("<p><b>Space</b>: Toggle fullscreen | <b>P</b>: Date picker</p>\n")+ 1581 i18n("<p><b>Space</b>: Toggle fullscreen | <b>P</b>: Date picker</p>\n")+
1564 i18n("<p><b>R</b>: Toggle Resource View |<b>F</b>: Edit filter </p>\n")+ 1582 i18n("<p><b>R</b>: Toggle Resource View |<b>F</b>: Edit filter </p>\n")+
1565 i18n("<p><b>O</b>: Filter On/Off | <b>J</b>: Journal view</p>\n")+ 1583 i18n("<p><b>O</b>: Filter On/Off | <b>J</b>: Journal view</p>\n")+
1566 i18n("<p><b>1-0</b> (+<b>ctrl</b>): Select filter 1-10 (11-20)</p>\n")+ 1584 i18n("<p><b>1-0</b> (+<b>ctrl</b>): Select filter 1-10 (11-20)</p>\n")+
1567 i18n("<p><b>X</b>: Next X days view| <b>W</b>: What's next view\n ")+ 1585 i18n("<p><b>X</b>: Next X days view| <b>W</b>: What's next view\n ")+
1586 i18n("<p><b>Q</b>: Show next date with conflicting events\n ")+
1568 i18n("<p><b>V</b>: Todo view | <b>L</b>: Event list view</p>\n")+ 1587 i18n("<p><b>V</b>: Todo view | <b>L</b>: Event list view</p>\n")+
1569 i18n("<p><b>Z,Y</b>: Work week view | <b>U</b>: Week view</p>\n")+ 1588 i18n("<p><b>Z,Y</b>: Work week view | <b>U</b>: Week view</p>\n")+
1570 i18n("<p><b>D</b>: One day view | <b>M</b>: Month view</p>\n")+ 1589 i18n("<p><b>D</b>: One day view | <b>M</b>: Month view</p>\n")+
1571 i18n("<p><b>K</b>: Week view in Month view syle</p>\n")+ 1590 i18n("<p><b>K</b>: Week view in Month view syle</p>\n")+
1572 i18n("<p><b>E</b>: Edit selected item |<b> E+ctrl</b>: New Event</p>\n")+ 1591 i18n("<p><b>E</b>: Edit selected item |<b> E+ctrl</b>: New Event</p>\n")+
1573 i18n("<p><b>T</b>: Goto today | <b>T+ctrl</b>: New Todo</p>\n")+ 1592 i18n("<p><b>T</b>: Goto today | <b>T+ctrl</b>: New Todo</p>\n")+
1574 i18n("<p><b>S+ctrl</b>: Add sub-todo | <b>X+ctrl</b>: Toggle datenavigator</p>\n")+ 1593 i18n("<p><b>S+ctrl</b>: Add sub-todo | <b>X+ctrl</b>: Toggle datenavigator</p>\n")+
1575 i18n("<p><b>+,-</b> : Zoom in/out agenda | <b>A</b>: Toggle allday agenda height</p>\n")+ 1594 i18n("<p><b>+,-</b> : Zoom in/out agenda | <b>A</b>: Toggle allday agenda height</p>\n")+
1576 i18n("<p><b>C</b>: Show current time in agenda view</p>\n")+ 1595 i18n("<p><b>C</b>: Show current time in agenda view</p>\n")+
1577 i18n("<p><b>B</b>: Edit description (details) of selected item</p>\n")+ 1596 i18n("<p><b>B</b>: Edit description (details) of selected item</p>\n")+
1578 i18n("<p><b>right</b>: Next week | <b>right+ctrl</b>: Next month</p>\n")+ 1597 i18n("<p><b>right</b>: Next week | <b>right+ctrl</b>: Next month</p>\n")+
1579 i18n("<p><b>left</b>: Prev. week | <b>left+ctrl</b>: Prev. month</p>\n")+ 1598 i18n("<p><b>left</b>: Prev. week | <b>left+ctrl</b>: Prev. month</p>\n")+
@@ -2090,24 +2109,32 @@ void MainWindow::keyPressEvent ( QKeyEvent * e )
2090 mView->showNextAlarms(); 2109 mView->showNextAlarms();
2091 else 2110 else
2092 mView->toggleAllDaySize(); 2111 mView->toggleAllDaySize();
2093 break; 2112 break;
2094 case Qt::Key_T: 2113 case Qt::Key_T:
2095 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) 2114 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton )
2096 mView->newTodo(); 2115 mView->newTodo();
2097 else { 2116 else {
2098 mView->goToday(); 2117 mView->goToday();
2099 showSelectedDates = true; 2118 showSelectedDates = true;
2100 } 2119 }
2101 break; 2120 break;
2121 case Qt::Key_Q:
2122 if ( e->state() == Qt::ControlButton )
2123 mView->conflictNotAll();
2124 else if ( e->state() == Qt::ShiftButton )
2125 mView->conflictAllday();
2126 else
2127 mView->conflictAll();
2128 break;
2102 case Qt::Key_J: 2129 case Qt::Key_J:
2103 mView->viewManager()->showJournalView(); 2130 mView->viewManager()->showJournalView();
2104 break; 2131 break;
2105 case Qt::Key_B: 2132 case Qt::Key_B:
2106 mView->editIncidenceDescription();; 2133 mView->editIncidenceDescription();;
2107 break; 2134 break;
2108 // case Qt::Key_Return: 2135 // case Qt::Key_Return:
2109 case Qt::Key_E: 2136 case Qt::Key_E:
2110 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) 2137 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton )
2111 mView->newEvent(); 2138 mView->newEvent();
2112 else 2139 else
2113 mView->editIncidence(); 2140 mView->editIncidence();