summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-02-04 22:22:10 (UTC)
committer zautrix <zautrix>2005-02-04 22:22:10 (UTC)
commit936b4b2aa37e699052a2517dc2d928d717398cf6 (patch) (side-by-side diff)
tree964ac33783c2126ecbaea0a2ee72b83ae6475b52
parent4659ee80518c7d5108c21ba04a12a25eab783113 (diff)
downloadkdepimpi-936b4b2aa37e699052a2517dc2d928d717398cf6.zip
kdepimpi-936b4b2aa37e699052a2517dc2d928d717398cf6.tar.gz
kdepimpi-936b4b2aa37e699052a2517dc2d928d717398cf6.tar.bz2
fifi
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/WhatsNew.txt5
-rw-r--r--korganizer/kdatenavigator.cpp2
-rw-r--r--korganizer/komonthview.cpp52
-rw-r--r--korganizer/komonthview.h4
4 files changed, 51 insertions, 12 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt
index 3ba0841..7214035 100644
--- a/bin/kdepim/WhatsNew.txt
+++ b/bin/kdepim/WhatsNew.txt
@@ -9,12 +9,17 @@ the popup menu: Set alarm for selected...
Added to the event/todo viewer the option to send an email to
all attendees or all selected (with RSVP) attendees.
Made the week-month mode changing in month view faster.
+Made month view better useable with keyboard.
+Now TAB key jumps to next cell with an event/todo.
+Scroll in cell with coursor keys, scroll in time (next week) with
+Shift/Control + coursorkeys.
+
********** VERSION 2.0.2 ************
KO/Pi:
Fixed the layout problem of the day label buttons
of the agenda view introduced in version 2.0.1.
diff --git a/korganizer/kdatenavigator.cpp b/korganizer/kdatenavigator.cpp
index f31e50a..c08f44f 100644
--- a/korganizer/kdatenavigator.cpp
+++ b/korganizer/kdatenavigator.cpp
@@ -55,13 +55,13 @@ KDateNavigator::KDateNavigator( QWidget *parent, Calendar *calendar,
setFrameStyle(QFrame::NoFrame);
QGridLayout *topLayout = new QGridLayout(this,8,8);
if (! startDate.isValid()) {
- kdDebug() << "KDateNavigator::KDateNavigator(): an invalid date was passed as a parameter!" << endl;
+ qDebug("KDateNavigator::invalid startdate ");
startDate = QDate::currentDate();
}
mSelectedDates.append(startDate);
m_MthYr = startDate;
m_bShowWeekNums = show_week_nums;
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp
index dfa89e2..df5e060 100644
--- a/korganizer/komonthview.cpp
+++ b/korganizer/komonthview.cpp
@@ -97,29 +97,29 @@ QString KNoScrollListBox::getWhatsThisText(QPoint p)
}
void KNoScrollListBox::keyPressEvent(QKeyEvent *e)
{
switch(e->key()) {
case Key_Right:
- // if ( e->state() == Qt::ControlButton )
+ if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton )
{
e->ignore();
return;
}
- scrollBy(4,0);
+ scrollBy(10,0);
break;
case Key_Left:
- // if ( e->state() == Qt::ControlButton )
+ if (e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton )
{
e->ignore();
return;
}
- scrollBy(-4,0);
+ scrollBy(-10,0);
break;
case Key_Up:
- if(count() < 2) {
+ if( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton) {
e->ignore();
break;
}
setCurrentItem((currentItem()+count()-1)%count());
if(!itemVisible(currentItem())) {
if((unsigned int) currentItem() == (count()-1)) {
@@ -127,34 +127,49 @@ void KNoScrollListBox::keyPressEvent(QKeyEvent *e)
} else {
setTopItem(topItem()-1);
}
}
break;
case Key_Down:
- if(count() < 2) {
+ if(e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton) {
e->ignore();
break;
}
setCurrentItem((currentItem()+1)%count());
if(!itemVisible(currentItem())) {
if(currentItem() == 0) {
setTopItem(0);
} else {
setTopItem(topItem()+1);
}
}
break;
+ case Key_I:
+ QTimer::singleShot( 11, this, SLOT ( oneDown() ) );
+ e->ignore();
+ break;
case Key_Shift:
emit shiftDown();
break;
default:
e->ignore();
break;
}
}
+void KNoScrollListBox::oneDown()
+{
+ setCurrentItem((currentItem()+1)%count());
+ if(!itemVisible(currentItem())) {
+ if(currentItem() == 0) {
+ setTopItem(0);
+ } else {
+ setTopItem(topItem()+1);
+ }
+ }
+}
void KNoScrollListBox::keyReleaseEvent(QKeyEvent *e)
{
switch(e->key()) {
case Key_Shift:
emit shiftUp();
break;
@@ -279,12 +294,13 @@ MonthViewCell::MonthViewCell( KOMonthView *parent,QWidget* par )
// mLabel = new QLabel( this );QPushButton
mLabel = new QPushButton( this );
//mLabel->setFrameStyle( QFrame::Panel | QFrame::Plain );
//mLabel->setLineWidth( 1 );
//mLabel->setAlignment( AlignCenter );
mLabel->setFlat( true );
+ mLabel->setFocusPolicy(NoFocus);
mItemList = new KNoScrollListBox( this );
mItemList->setMinimumSize( 10, 10 );
mItemList->setFrameStyle( QFrame::Panel | QFrame::Plain );
mItemList->setLineWidth( 1 );
topLayout->addWidget( mItemList );
mLabel->raise();
@@ -398,14 +414,16 @@ void MonthViewCell::clear()
QApplication::removePostedEvents ( this );
}
void MonthViewCell::startUpdateCell()
{
+ mItemList->setFocusPolicy(NoFocus);
if ( !mMonthView->isUpdatePossible() )
return;
+
/*
if ( !isVisible() ){
return;
}
*/
// qDebug("MonthViewCell::updateCell() ");
@@ -430,12 +448,14 @@ void MonthViewCell::startUpdateCell()
mToolTip += mHolidayString+"\n";
}
}
void MonthViewCell::insertEvent(Event *event)
{
+
+ mItemList->setFocusPolicy(WheelFocus);
if ( !(event->doesRecur() == Recurrence::rNone) ) {
if ( !KOPrefs::instance()->mMonthDailyRecur && event->doesRecur() == Recurrence::rDaily )
return;
else
if ( !KOPrefs::instance()->mMonthWeeklyRecur && event->doesRecur() == Recurrence::rWeekly )
return;
@@ -535,13 +555,13 @@ void MonthViewCell::insertTodo(Todo *todo)
if (todo->hasDueDate()) {
if (!todo->doesFloat()) {
text += KGlobal::locale()->formatTime(todo->dtDue().time());
text += " ";
}
}
- text += i18n("To-Do: %1").arg(todo->summary());
+ text += i18n("Td: %1").arg(todo->summary());
MonthViewItem *item = new MonthViewItem( todo, mDate, text );
//item->setPalette( mStandardPalette );
QPalette pal;
if (KOPrefs::instance()->mMonthViewUsesCategoryColor) {
QStringList categories = todo->categories();
@@ -823,12 +843,13 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name)
bfont.setBold( false );
mWeekLabels.resize( mNumWeeks+1 );
mWeekLabelsW.resize( 2 );
for( i = 0; i < mNumWeeks+1; i++ ) {
KOWeekButton *label = new KOWeekButton( mMonthView );
+ label->setFocusPolicy(NoFocus);
label->setFont(bfont);
connect( label, SIGNAL( selectWeekNum ( int )),this, SLOT( selectInternalWeekNum ( int )) );
label->setFlat(true);
QWhatsThis::add(label,i18n("Click on the week number to\nshow week zoomed"));
//label->setFrameStyle(QFrame::Panel|QFrame::Raised);
//label->setLineWidth(1);
@@ -837,12 +858,13 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name)
}
mWeekLabels[mNumWeeks]->setText( i18n("W"));
QWhatsThis::add(mWeekLabels[mNumWeeks],i18n("Click on this to\nselect week number"));
for( i = 0; i < 1+1; i++ ) {
KOWeekButton *label = new KOWeekButton( mWeekView );
+ label->setFocusPolicy(NoFocus);
label->setFont(bfont);
connect( label, SIGNAL( selectWeekNum ( int )),this, SLOT( selectInternalWeekNum ( int )) );
label->setFlat(true);
QWhatsThis::add(label,i18n("Click on the week number to\nshow week zoomed"));
//label->setFrameStyle(QFrame::Panel|QFrame::Raised);
//label->setLineWidth(1);
@@ -900,22 +922,25 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name)
}
KOMonthView::~KOMonthView()
{
delete mContextMenu;
}
-void KOMonthView::selectDateWeekNum ( int )
-{
-}
void KOMonthView::selectInternalWeekNum ( int n )
{
switchView();
emit selectWeekNum ( n );
}
+int KOMonthView::currentWeek()
+{
+ if ( mShowWeekView )
+ return mWeekLabelsW[0]->getWeekNum();
+ return mWeekLabels[0]->getWeekNum();
+}
void KOMonthView::switchView()
{
if ( selectedCell( ) )
selectedCell()->deselect();
mShowWeekView = !mShowWeekView;
@@ -1536,11 +1561,18 @@ void KOMonthView::keyPressEvent ( QKeyEvent * e )
emit nextMonth();
mCells[0]->setFocus();
}
e->accept();
break;
+ case Key_Return:
+ case Key_Enter:
+ {
+ selectInternalWeekNum ( currentWeek() );
+ }
+ e->accept();
+ break;
default:
e->ignore();
break;
}
}
diff --git a/korganizer/komonthview.h b/korganizer/komonthview.h
index 700f098..51eb9e6 100644
--- a/korganizer/komonthview.h
+++ b/korganizer/komonthview.h
@@ -51,12 +51,13 @@ class KOWeekButton : public QPushButton
{
connect( this, SIGNAL( clicked() ),
SLOT( bottonClicked() ));
mNumber = -1;
}
void setWeekNum ( int num ) {mNumber = num; setText( QString::number ( num ));}
+ int getWeekNum() { return mNumber;}
signals:
void selectWeekNum ( int );
private:
int mNumber;
private slots :
void bottonClicked() { if ( mNumber > 0 ) emit selectWeekNum ( mNumber ); }
@@ -73,12 +74,13 @@ class KNoScrollListBox: public QListBox
signals:
void shiftDown();
void shiftUp();
void rightClick();
protected slots:
+ void oneDown();
void keyPressEvent(QKeyEvent *);
void keyReleaseEvent(QKeyEvent *);
void mousePressEvent(QMouseEvent *);
private:
KNOWhatsThis * mWT;
@@ -238,13 +240,12 @@ class KOMonthView: public KOEventView
void showContextMenu( Incidence * );
void setSelectedCell( MonthViewCell * );
protected slots:
- void selectDateWeekNum ( int );
void selectInternalWeekNum ( int );
void switchView();
void processSelectionChange();
signals:
void nextMonth();
void prevMonth();
@@ -254,12 +255,13 @@ class KOMonthView: public KOEventView
protected:
void resizeEvent(QResizeEvent *);
void viewChanged();
void updateDayLabels();
private:
+ int currentWeek();
bool clPending;
QWidgetStack * mWidStack;
QWidget* mMonthView;
QWidget* mWeekView;
bool mShowWeekView;
bool updatePossible;