summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/komonthview.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp
index c125ce9..f983ff9 100644
--- a/korganizer/komonthview.cpp
+++ b/korganizer/komonthview.cpp
@@ -1610,55 +1610,61 @@ void KOMonthView::setSelectedCell( MonthViewCell *cell )
1610 1610
1611void KOMonthView::processSelectionChange() 1611void KOMonthView::processSelectionChange()
1612{ 1612{
1613 QPtrList<Incidence> incidences = selectedIncidences(); 1613 QPtrList<Incidence> incidences = selectedIncidences();
1614 if (incidences.count() > 0) { 1614 if (incidences.count() > 0) {
1615 emit incidenceSelected( incidences.first() ); 1615 emit incidenceSelected( incidences.first() );
1616 } else { 1616 } else {
1617 emit incidenceSelected( 0 ); 1617 emit incidenceSelected( 0 );
1618 } 1618 }
1619} 1619}
1620 1620
1621void KOMonthView::clearSelection() 1621void KOMonthView::clearSelection()
1622{ 1622{
1623 if ( mSelectedCell ) { 1623 if ( mSelectedCell ) {
1624 mSelectedCell->deselect(); 1624 mSelectedCell->deselect();
1625 mSelectedCell = 0; 1625 mSelectedCell = 0;
1626 } 1626 }
1627} 1627}
1628void KOMonthView::keyPressEvent ( QKeyEvent * e ) 1628void KOMonthView::keyPressEvent ( QKeyEvent * e )
1629{ 1629{
1630 //qDebug("KOMonthView::keyPressEvent "); 1630 //qDebug("KOMonthView::keyPressEvent ");
1631 switch(e->key()) { 1631 switch(e->key()) {
1632 case Key_Up: 1632 case Key_Up:
1633 { 1633 {
1634 emit prevMonth(); 1634 if ( mShowWeekView ) {
1635 if ( mShowWeekView )
1636 mCellsW[0]->setFocus(); 1635 mCellsW[0]->setFocus();
1637 else 1636 emit selectWeekNum ( currentWeek() - 1 );
1637 }
1638 else {
1638 mCells[0]->setFocus(); 1639 mCells[0]->setFocus();
1640 emit prevMonth();
1641 }
1639 } 1642 }
1640 e->accept(); 1643 e->accept();
1641 break; 1644 break;
1642 case Key_Down: 1645 case Key_Down:
1643 { 1646 {
1644 emit nextMonth(); 1647 if ( mShowWeekView ) {
1645 if ( mShowWeekView )
1646 mCellsW[0]->setFocus(); 1648 mCellsW[0]->setFocus();
1647 else 1649 emit selectWeekNum ( currentWeek() +1);
1650 }
1651 else {
1648 mCells[0]->setFocus(); 1652 mCells[0]->setFocus();
1653 emit nextMonth();
1654 }
1649 1655
1650 } 1656 }
1651 e->accept(); 1657 e->accept();
1652 break; 1658 break;
1653 case Key_Return: 1659 case Key_Return:
1654 case Key_Enter: 1660 case Key_Enter:
1655 { 1661 {
1656 selectInternalWeekNum ( currentWeek() ); 1662 selectInternalWeekNum ( currentWeek() );
1657 } 1663 }
1658 e->accept(); 1664 e->accept();
1659 break; 1665 break;
1660 default: 1666 default:
1661 e->ignore(); 1667 e->ignore();
1662 break; 1668 break;
1663 } 1669 }
1664} 1670}