summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-01-27 10:15:45 (UTC)
committer zautrix <zautrix>2005-01-27 10:15:45 (UTC)
commit1501a5d8a25e3474fb450d7e0b272feb14821d1c (patch) (side-by-side diff)
tree70a8fcafed89f6dc8225af9908e845c0feecd7d9
parente4beb835276376646307bea74430008c332bd387 (diff)
downloadkdepimpi-1501a5d8a25e3474fb450d7e0b272feb14821d1c.zip
kdepimpi-1501a5d8a25e3474fb450d7e0b272feb14821d1c.tar.gz
kdepimpi-1501a5d8a25e3474fb450d7e0b272feb14821d1c.tar.bz2
fix
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--korganizer/komonthview.cpp33
-rw-r--r--korganizer/komonthview.h2
-rw-r--r--korganizer/koviewmanager.cpp4
-rw-r--r--korganizer/mainwindow.cpp2
4 files changed, 36 insertions, 5 deletions
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp
index 437debe..10e4f1d 100644
--- a/korganizer/komonthview.cpp
+++ b/korganizer/komonthview.cpp
@@ -112,24 +112,30 @@ void KNoScrollListBox::keyPressEvent(QKeyEvent *e)
e->ignore();
return;
}
scrollBy(-4,0);
break;
case Key_Up:
- if(!count()) break;
+ if(count() < 2) {
+ e->ignore();
+ break;
+ }
setCurrentItem((currentItem()+count()-1)%count());
if(!itemVisible(currentItem())) {
if((unsigned int) currentItem() == (count()-1)) {
setTopItem(currentItem()-numItemsVisible()+1);
} else {
setTopItem(topItem()-1);
}
}
break;
case Key_Down:
- if(!count()) break;
+ if(count() < 2) {
+ e->ignore();
+ break;
+ }
setCurrentItem((currentItem()+1)%count());
if(!itemVisible(currentItem())) {
if(currentItem() == 0) {
setTopItem(0);
} else {
setTopItem(topItem()+1);
@@ -946,23 +952,25 @@ void KOMonthView::changeEventDisplay(Event *, int)
// quick-and-dirty-hack gets the job done for right now.
updateView();
}
void KOMonthView::updateView()
{
+
if ( !updatePossible )
return;
//qDebug("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ");
int i;
for( i = 0; i < mCells.count(); ++i ) {
mCells[i]->updateCell();
}
//qDebug("KOMonthView::updateView() ");
processSelectionChange();
// qDebug("---------------------------------------------------------------------+ ");
+ setFocus();
}
void KOMonthView::resizeEvent(QResizeEvent * e)
{
computeLayout();
}
@@ -1120,10 +1128,27 @@ void KOMonthView::clearSelection()
mSelectedCell->deselect();
mSelectedCell = 0;
}
}
void KOMonthView::keyPressEvent ( QKeyEvent * e )
{
-
+ switch(e->key()) {
+ break;
+ case Key_Up:
+ {
+ emit prevMonth();
+ setFocus();
+ }
+ e->accept();
+ break;
+ case Key_Down:
+ {
+ emit nextMonth();
+ setFocus();
+ }
+ e->accept();
+ break;
+ default:
e->ignore();
-
+ break;
+ }
}
diff --git a/korganizer/komonthview.h b/korganizer/komonthview.h
index a965bf3..50903b3 100644
--- a/korganizer/komonthview.h
+++ b/korganizer/komonthview.h
@@ -234,12 +234,14 @@ class KOMonthView: public KOEventView
void setSelectedCell( MonthViewCell * );
protected slots:
void processSelectionChange();
signals:
+ void nextMonth();
+ void prevMonth();
void selectWeekNum ( int );
void showDaySignal( QDate );
protected:
void resizeEvent(QResizeEvent *);
void viewChanged();
void updateDayLabels();
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp
index 94c459b..e8d5ab1 100644
--- a/korganizer/koviewmanager.cpp
+++ b/korganizer/koviewmanager.cpp
@@ -454,12 +454,16 @@ void KOViewManager::showMonthView()
mMainView, SLOT ( beamIncidence( Incidence * ) ) );
connect( mMonthView, SIGNAL( selectWeekNum( int ) ),
mMainView, SLOT ( selectWeekNum( int ) ) );
connect( mMonthView, SIGNAL( showDaySignal( QDate ) ),
mMainView, SLOT ( showDay( QDate ) ) );
connect(mMainView, SIGNAL(configChanged()), mMonthView, SLOT(updateConfig()));
+ connect( mMonthView, SIGNAL(nextMonth() ),
+ mMainView->navigatorBar(), SIGNAL(goNextMonth() ) );
+ connect( mMonthView, SIGNAL(prevMonth() ),
+ mMainView->navigatorBar(), SIGNAL(goPrevMonth() ) );
mMonthView->updateConfig();
}
globalFlagBlockAgenda = 1;
//mFlagShowNextxDays = false;
// if(mMonthView == mCurrentView) return;
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index 145b36c..950d2ec 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -1733,13 +1733,13 @@ void MainWindow::setCaptionToDates()
void MainWindow::showConfigureAgenda( )
{
int iii;
for ( iii = 1;iii<= 10 ;++iii ){
configureAgendaMenu->setItemChecked( (iii+1)*2, false );
}
- configureAgendaMenu->setItemChecked( KOPrefs::instance()->mHourSize, true );
+ configureAgendaMenu->setItemChecked( (KOPrefs::instance()->mHourSize/2)*2, true );
}
void MainWindow::configureAgenda( int item )
{
if ( KOPrefs::instance()->mHourSize == item )
return;
KOPrefs::instance()->mHourSize=item;