summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--bin/kdepim/WhatsNew.txt2
-rw-r--r--bin/kdepim/korganizer/germantranslation.txt14
-rw-r--r--korganizer/calendarview.cpp80
-rw-r--r--korganizer/calendarview.h4
-rw-r--r--korganizer/mainwindow.cpp69
5 files changed, 141 insertions, 28 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt
index 79de197..814c541 100644
--- a/bin/kdepim/WhatsNew.txt
+++ b/bin/kdepim/WhatsNew.txt
@@ -7,2 +7,4 @@ Added a button to add a subtodo quickly.
7 7
8Added a possibility to search for conflicting events. (In the Action menu. Keyboard shortcut "q" ).
9
8 10
diff --git a/bin/kdepim/korganizer/germantranslation.txt b/bin/kdepim/korganizer/germantranslation.txt
index bcc23dc..b225594 100644
--- a/bin/kdepim/korganizer/germantranslation.txt
+++ b/bin/kdepim/korganizer/germantranslation.txt
@@ -1496,2 +1496,16 @@
1496{ "Click to add new Todo","Klick für neues Todo!" }, 1496{ "Click to add new Todo","Klick für neues Todo!" },
1497{ "Show next conflict for","Zeige nächsten Konflikt für" },
1498{ "All events","Alle Termine" },
1499{ "Allday events","Ganztagestermine" },
1500{ "Events with time","Termine mit Zeit" },
1501{ "No conflict found within the next two years","Kein Konflikt innerhalb der nächsten zwei Jahre gefunden" },
1502{ "Conflict %1 <-> %2","Konflikt %1 <-> %2" },
1503{ "<p><b>Q</b>: Show next date with conflicting events\n ","<p><b>Q</b>: Zeige nächstes Datum mit Terminen im Konflikt\n " },
1504{ "","" },
1505{ "","" },
1506{ "","" },
1507{ "","" },
1508{ "","" },
1509{ "","" },
1510{ "","" },
1497{ "","" }, 1511{ "","" },
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index bc1c0c7..9a114d0 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -656,2 +656,68 @@ CalendarView::~CalendarView()
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 )
@@ -3164,3 +3230,3 @@ void CalendarView::cloneIncidence(Incidence * orgInc )
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"),
@@ -3502,3 +3568,3 @@ void CalendarView::deleteTodo(Todo *todo)
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()) {
@@ -3548,3 +3614,3 @@ void CalendarView::deleteJournal(Journal *jour)
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
@@ -3574,3 +3640,3 @@ void CalendarView::deleteEvent(Event *anEvent)
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?"),
@@ -3582,3 +3648,3 @@ void CalendarView::deleteEvent(Event *anEvent)
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")+
@@ -3623,3 +3689,3 @@ void CalendarView::deleteEvent(Event *anEvent)
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?"),
@@ -4582,3 +4648,3 @@ void CalendarView::undo_delete()
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?"),
diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h
index a5f230a..51eb1d4 100644
--- a/korganizer/calendarview.h
+++ b/korganizer/calendarview.h
@@ -202,2 +202,6 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser
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 );
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index 9c2ac82..bfae1b5 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -661,2 +661,3 @@ void MainWindow::initActions()
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 );
@@ -791,11 +792,38 @@ void MainWindow::initActions()
791 mView->dialogManager(), SLOT( showSearchDialog() ) ); 792 mView->dialogManager(), SLOT( showSearchDialog() ) );
793 actionMenu->insertItem( i18n("Show next conflict for"), nextConflictMenu );
792 794
793 actionMenu->insertSeparator(); 795 action = new QAction( "Undo Delete", i18n("All events"), 0, this );
794 796 action->addTo( nextConflictMenu );
797 connect( action, SIGNAL( activated() ),
798 mView, SLOT( conflictAll() ) );
795 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() ) );
796 804
797 action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this ); 805 action = new QAction( "Undo Delete", i18n("Events with time"), 0, this );
798 action->addTo( mCurrentItemMenu ); 806 action->addTo( nextConflictMenu );
799 connect( action, SIGNAL( activated() ), 807 connect( action, SIGNAL( activated() ),
800 mView, SLOT( undo_delete() ) ); 808 mView, SLOT( conflictNotAll() ) );
809
810 actionMenu->insertSeparator();
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() ) );
828
801 mCurrentItemMenu->insertSeparator(); 829 mCurrentItemMenu->insertSeparator();
@@ -846,14 +874,8 @@ void MainWindow::initActions()
846 874
847 QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this );
848 ne_action->addTo( actionMenu );
849 connect( ne_action, SIGNAL( activated() ),
850 mView, SLOT( newEvent() ) );
851 icon = loadPixmap( pathString + "newtodo" );
852 configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 );
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 875
876 mCurrentItemMenu->insertSeparator();
877 action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this );
878 action->addTo( mCurrentItemMenu );
879 connect( action, SIGNAL( activated() ),
880 mView, SLOT( undo_delete() ) );
859 881
@@ -998,7 +1020,3 @@ void MainWindow::initActions()
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
@@ -1567,2 +1585,3 @@ void MainWindow::keyBindings()
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")+
@@ -2101,2 +2120,10 @@ void MainWindow::keyPressEvent ( QKeyEvent * e )
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: