summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/WhatsNew.txt2
-rw-r--r--korganizer/komonthview.cpp32
-rw-r--r--korganizer/komonthview.h5
3 files changed, 35 insertions, 4 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt
index d4b7971..95a1866 100644
--- a/bin/kdepim/WhatsNew.txt
+++ b/bin/kdepim/WhatsNew.txt
@@ -9,16 +9,18 @@ Added keyboard shorcuts for
- add new item ( i + n key)
Fixed length of info in the title.
KO/Pi-KA/Pi:
Changed "ME" menu bar entry to an icon.
KO/Pi:
Fixed two minor bugs in displaying todos.
+If in month view a cell is selected, the key shortcut "d" shows now that date.
+Added complete info for a todo in month view as an icon left of the text.
********** VERSION 2.0.14 ************
Made Passwordmanager PwM/Pi more userfriendly:
Rearranged some toolbar icons, optimized setting of focus, fixed layout problems and more.
Fixed bug in KO/Pi todo printing.
Made Qtopia calendar import possible on desktop .
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp
index f983ff9..4bf9dea 100644
--- a/korganizer/komonthview.cpp
+++ b/korganizer/komonthview.cpp
@@ -272,16 +272,32 @@ void MonthViewItem::paint(QPainter *p)
if ( mMultiday == 3 ) {
// p->fillRect ( x+sizeM, yyy-sizeM/2+1, sizeM/2, size, QBrush ( QBrush::SolidPattern ) );
p->drawLine ( x+sizeM +sizeM/2-1, yyy-sizeM/2, x+sizeM +sizeM/2-1, yyy+sizeM/2 );
}
x += sizeM/2 + 1;
x += sizeM + 1;
}
+
+ if ( mIncidence->type() == "Todo" ){
+ Todo* td = ( Todo* ) mIncidence;
+ if ( td->isCompleted() ) {
+ int half = size/2;
+ p->drawLine ( x, heihei/2, x +half , heihei/2 +half ) ;
+ p->drawLine ( x +half , heihei/2 +half , x +half+half +2 , heihei/2 -2 ) ;
+ x += half+half + 4;
+
+ } else {
+ int val = td->percentComplete()/20;
+ p->fillRect ( x+1, y-1, val ,size+2,Qt::black );
+ p->drawRect ( x, y-1,7,size+2);
+ x += size + 3;
+ }
+ }
QFontMetrics fm = p->fontMetrics();
int yPos;
int pmheight = size;
if( pmheight < fm.height() )
yPos = fm.ascent() + fm.leading()/2;
else
yPos = pmheight/2 - fm.height()/2 + fm.ascent();
p->setPen( palette().color( QPalette::Normal, sel ? \
@@ -597,17 +613,17 @@ void MonthViewCell::insertTodo(Todo *todo)
mItemList->setFocusPolicy(WheelFocus);
QString text;
if (todo->hasDueDate()) {
if (!todo->doesFloat()) {
text += KGlobal::locale()->formatTime(todo->dtDue().time());
text += " ";
}
}
- text += i18n("T: %1").arg(todo->summary());
+ text += todo->summary();
MonthViewItem *item = new MonthViewItem( todo, mDate, text );
//item->setPalette( mStandardPalette );
QPalette pal;
if (KOPrefs::instance()->mMonthViewUsesCategoryColor) {
QStringList categories = todo->categories();
QString cat = categories.first();
if ( KOPrefs::instance()->mMonthViewUsesForegroundColor ) {
@@ -656,17 +672,17 @@ void MonthViewCell::finishUpdateCell()
text += QString::number( KOGlobals::self()->calendarSystem()->day(mDate) );
}
mLabel->setText( text );
resizeEvent( 0 );
}
void MonthViewCell::updateCell()
{
- qDebug("MonthViewCell::updateCell() ");
+ //qDebug("MonthViewCell::updateCell() ");
if ( !mMonthView->isUpdatePossible() )
return;
startUpdateCell();
//mLabel->setMaximumWidth( width() - mItemList->lineWidth()*2);
QPtrList<Event> events = mMonthView->calendar()->events( mDate, true );
Event *event;
for( event = events.first(); event; event = events.next() ) { // for event
insertEvent(event);
@@ -1213,16 +1229,17 @@ void KOMonthView::changeEventDisplay(Event *, int)
void KOMonthView::updateView()
{
if ( !updatePossible )
return;
//QTime ti;
//ti.start();
+ clearSelection();
QPtrVector<MonthViewCell> *cells;
if ( mShowWeekView ) {
cells = &mCellsW;
} else {
cells = &mCells;
}
#if 1
int i;
@@ -1588,17 +1605,17 @@ void KOMonthView::showContextMenu( Incidence *incidence )
*/
}
MonthViewCell * KOMonthView::selectedCell( )
{
return mSelectedCell;
}
void KOMonthView::setSelectedCell( MonthViewCell *cell )
{
- // qDebug("KOMonthView::setSelectedCell ");
+ //qDebug("KOMonthView::setSelectedCell ");
if ( mSelectedCell && mSelectedCell != cell ) {
MonthViewCell * mvc = mSelectedCell;
mSelectedCell = cell;
mvc->deselect();
} else
mSelectedCell = cell;
// if ( mSelectedCell )
// mSelectedCell->select();
@@ -1610,16 +1627,17 @@ void KOMonthView::setSelectedCell( MonthViewCell *cell )
void KOMonthView::processSelectionChange()
{
QPtrList<Incidence> incidences = selectedIncidences();
if (incidences.count() > 0) {
emit incidenceSelected( incidences.first() );
} else {
emit incidenceSelected( 0 );
+ clearSelection();
}
}
void KOMonthView::clearSelection()
{
if ( mSelectedCell ) {
mSelectedCell->deselect();
mSelectedCell = 0;
@@ -1658,13 +1676,21 @@ void KOMonthView::keyPressEvent ( QKeyEvent * e )
break;
case Key_Return:
case Key_Enter:
{
selectInternalWeekNum ( currentWeek() );
}
e->accept();
break;
+ case Key_D:
+ if ( mSelectedCell ) {
+ mSelectedCell->showDay();
+ e->accept();
+ } else {
+ e->ignore();
+ }
+ break;
default:
e->ignore();
break;
}
}
diff --git a/korganizer/komonthview.h b/korganizer/komonthview.h
index f92a69a..fd8cbf2 100644
--- a/korganizer/komonthview.h
+++ b/korganizer/komonthview.h
@@ -165,23 +165,26 @@ class MonthViewCell : public QWidget
void defaultAction( Incidence * );
void newEventSignal( QDateTime );
void showDaySignal( QDate );
protected:
QString mToolTip;
void resizeEvent( QResizeEvent * );
+
+public slots:
+ void showDay();
+
protected slots:
void defaultAction( QListBoxItem * );
void contextMenu( QListBoxItem * );
void selection( QListBoxItem * );
void cellClicked( QListBoxItem * );
void newEvent();
- void showDay();
private:
KOMonthView *mMonthView;
QDate mDate;
bool mPrimary;
bool mHoliday;
QString mHolidayString;