summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-03-08 11:48:20 (UTC)
committer zautrix <zautrix>2005-03-08 11:48:20 (UTC)
commitf20f8ca063abd322387a72f3f5a65c480f6a4233 (patch) (side-by-side diff)
tree6136c01f0ac27b0ee869d5fb1169ebe95229faef
parent90f53697a44fdcccec00ef8c53fe5c9c15aca713 (diff)
downloadkdepimpi-f20f8ca063abd322387a72f3f5a65c480f6a4233.zip
kdepimpi-f20f8ca063abd322387a72f3f5a65c480f6a4233.tar.gz
kdepimpi-f20f8ca063abd322387a72f3f5a65c480f6a4233.tar.bz2
list weekview fix
Diffstat (more/less context) (show 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
@@ -1586,79 +1586,85 @@ void KOMonthView::showContextMenu( Incidence *incidence )
kdDebug() << "MonthView::showContextMenu(): cast failed." << endl;
}
*/
}
MonthViewCell * KOMonthView::selectedCell( )
{
return mSelectedCell;
}
void KOMonthView::setSelectedCell( MonthViewCell *cell )
{
// qDebug("KOMonthView::setSelectedCell ");
if ( mSelectedCell && mSelectedCell != cell ) {
MonthViewCell * mvc = mSelectedCell;
mSelectedCell = cell;
mvc->deselect();
} else
mSelectedCell = cell;
// if ( mSelectedCell )
// mSelectedCell->select();
if ( !mSelectedCell )
emit incidenceSelected( 0 );
else
emit incidenceSelected( mSelectedCell->selectedIncidence() );
}
void KOMonthView::processSelectionChange()
{
QPtrList<Incidence> incidences = selectedIncidences();
if (incidences.count() > 0) {
emit incidenceSelected( incidences.first() );
} else {
emit incidenceSelected( 0 );
}
}
void KOMonthView::clearSelection()
{
if ( mSelectedCell ) {
mSelectedCell->deselect();
mSelectedCell = 0;
}
}
void KOMonthView::keyPressEvent ( QKeyEvent * e )
{
//qDebug("KOMonthView::keyPressEvent ");
switch(e->key()) {
case Key_Up:
{
- emit prevMonth();
- if ( mShowWeekView )
+ if ( mShowWeekView ) {
mCellsW[0]->setFocus();
- else
+ emit selectWeekNum ( currentWeek() - 1 );
+ }
+ else {
mCells[0]->setFocus();
+ emit prevMonth();
+ }
}
e->accept();
break;
case Key_Down:
{
- emit nextMonth();
- if ( mShowWeekView )
+ if ( mShowWeekView ) {
mCellsW[0]->setFocus();
- else
+ emit selectWeekNum ( currentWeek() +1);
+ }
+ else {
mCells[0]->setFocus();
+ emit nextMonth();
+ }
}
e->accept();
break;
case Key_Return:
case Key_Enter:
{
selectInternalWeekNum ( currentWeek() );
}
e->accept();
break;
default:
e->ignore();
break;
}
}