author | zautrix <zautrix> | 2005-01-30 14:15:42 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-01-30 14:15:42 (UTC) |
commit | 8d543aa1d1d1ed20001c8b18352d1d29c2979e48 (patch) (side-by-side diff) | |
tree | 9ca05f4d3bc1de81bcf0446a2f7471d552089c87 | |
parent | 1bcef8b3f53419e7155e0862ad61e3e419763d70 (diff) | |
download | kdepimpi-8d543aa1d1d1ed20001c8b18352d1d29c2979e48.zip kdepimpi-8d543aa1d1d1ed20001c8b18352d1d29c2979e48.tar.gz kdepimpi-8d543aa1d1d1ed20001c8b18352d1d29c2979e48.tar.bz2 |
many fixes
-rw-r--r-- | bin/kdepim/WhatsNew.txt | 14 | ||||
-rw-r--r-- | korganizer/kdatenavigator.cpp | 4 | ||||
-rw-r--r-- | korganizer/koagendaitem.cpp | 13 | ||||
-rw-r--r-- | korganizer/kodaymatrix.cpp | 148 | ||||
-rw-r--r-- | korganizer/kodaymatrix.h | 5 |
5 files changed, 119 insertions, 65 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt index 6c9daad..05aa8fe 100644 --- a/bin/kdepim/WhatsNew.txt +++ b/bin/kdepim/WhatsNew.txt @@ -1,33 +1,45 @@ Info about the changes in new versions of KDE-Pim/Pi ********** VERSION 2.0.1 ************ Oooops ... I forgot to test on the Zaurus 5500 ... Fixed many problems of new (english) strings (and german translations) introduced in the latest versions, where the text was not fitting on the 240x320 display of the Zaurus 5500. Added a popup menu ( press pen and hold to get popup ) to the agenda view -with may useful items. +with many useful items (add event/todo, show next week, two weeks, month, journal). Added items to the todolist popup menu for: Display all opened, all closed or all todos flat. The "flat" view makes is possible to sort all todos after ,e.g., prio or date. +Made the reparenting of todos on the desktop possible via Drag&Drop. +Fixed several bugs in setting the completed datetime for todos. +Added info about completed datetime of todos to the todo viewer. +Now displaying a completed todo (with completed datetime set) in the agenda view +at the time of the completion. Such that now it is possible to see in the agenda view +when what todo was completed. +Fixed behaviour of automatic setting completion of todos with sub-todos/parent todos. +Now the behaviour is: +Setting a parent to complete sets all (sub)childs to complete. +Setting a parent to uncomplete does not change the childs. +Setting a child to uncomplete sets all parent to uncomplete. +Setting a child to complete does not change the parents. ********** VERSION 2.0.0 ************ Stable release 2.0.0! KO/Pi: Fixed problem in edit dialog recreation at startup. Made "toggle view*" menu items enabled context sensitive. Changed agenda size menu to items 1-10. Made it possible to change agenda size quickly by pressing mouse on timelabels in agenda view and move mouse up/down. Usebility enhancements in the KO/Pi menus. Birthday import now adds year to summary. What's Next view shows age in years for birthday. OM/Pi: diff --git a/korganizer/kdatenavigator.cpp b/korganizer/kdatenavigator.cpp index b420351..f31e50a 100644 --- a/korganizer/kdatenavigator.cpp +++ b/korganizer/kdatenavigator.cpp @@ -212,33 +212,33 @@ void KDateNavigator::updateDates() // month should begin on second line. Sunday doesn't have this problem. int nextLine = ( ( m_fstDayOfWkCalsys == 1) && ( KGlobal::locale()->weekStartsMonday() == 1 ) ) ? 7 : 0; // update the matrix dates int index = (KGlobal::locale()->weekStartsMonday() ? 1 : 0) - m_fstDayOfWkCalsys - nextLine; daymatrix->updateView(dayone.addDays(index)); //each updateDates is followed by an updateView -> repaint is issued there ! // daymatrix->repaint(); } void KDateNavigator::updateDayMatrix() { daymatrix->updateView(); - daymatrix->repaint(); + //daymatrix->repaint(); } void KDateNavigator::updateView() { setUpdatesEnabled( false ); int i; // kdDebug() << "updateView() -> daymatrix->updateView()" << endl; daymatrix->updateView(); // set the week numbers. for(i = 0; i < 6; i++) { QString weeknum; @@ -249,33 +249,33 @@ void KDateNavigator::updateView() //ET int dayOfYear = buttons[(i + 1) * 7 - 4]->date().dayOfYear(); int dayOfYear = KOGlobals::self()->calendarSystem()->dayOfYear((daymatrix->getDate((i+1)*7-4))); int add = 0; if ( ! KGlobal::locale()->weekStartsMonday() ) ++add; if (dayOfYear % 7 != 0) weeknum.setNum(dayOfYear / 7 + 1+add); else weeknum.setNum(dayOfYear / 7 +add); weeknos[i]->setText(weeknum); } setUpdatesEnabled( true ); // kdDebug() << "updateView() -> repaint()" << endl; repaint(); - daymatrix->repaint(); + // daymatrix->repaint(); } void KDateNavigator::updateConfig() { int day; for(int i=0; i<7; i++) { // take the first letter of the day name to be the abbreviation if (KGlobal::locale()->weekStartsMonday()) { day = i+1; } else { if (i==0) day = 7; else day = i; } QString dayName = KOGlobals::self()->calendarSystem()->weekDayName( day, true ); if ( KOPrefs::instance()->mCompactDialogs ) dayName = dayName.left( 1 ); diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp index 39355b4..ee9f39a 100644 --- a/korganizer/koagendaitem.cpp +++ b/korganizer/koagendaitem.cpp @@ -456,39 +456,38 @@ void KOAgendaItem::paintEvent ( QPaintEvent *e ) QPixmap* paintFrom ; if ( mSelected ) { paintFrom = paintPixSel(); } else { if ( mAllDay ) paintFrom = paintPixAllday(); else paintFrom = paintPix(); } bitBlt (this, rx, ry, paintFrom, x()+rx ,yPaintCoord+ry, rw, rh ,CopyROP); } void KOAgendaItem::computeText() { mDisplayedText = mIncidence->summary(); if ( (mIncidence->type() == "Todo") ) { - if ( static_cast<Todo*>(mIncidence)->dtDue().date() < QDate::currentDate() ) - mDisplayedText += i18n(" (") +KGlobal::locale()->formatDate((static_cast<Todo*>(mIncidence))->dtDue().date(), true)+")"; - else if ( !(mIncidence->doesFloat())) - mDisplayedText += i18n(" (") +KGlobal::locale()->formatTime((static_cast<Todo*>(mIncidence))->dtDue().time())+")"; - - - + if ( static_cast<Todo*>(mIncidence)->hasDueDate() ) { + if ( static_cast<Todo*>(mIncidence)->dtDue().date() < QDate::currentDate() ) + mDisplayedText += i18n(" (") +KGlobal::locale()->formatDate((static_cast<Todo*>(mIncidence))->dtDue().date(), true)+")"; + else if ( !(mIncidence->doesFloat())) + mDisplayedText += i18n(" (") +KGlobal::locale()->formatTime((static_cast<Todo*>(mIncidence))->dtDue().time())+")"; + } } else { if ( !(mIncidence->doesFloat()) && KOPrefs::instance()->mShowTimeInAgenda) mDisplayedText += ": " +KGlobal::locale()->formatTime((static_cast<Event*>(mIncidence))->dtStart().time()) + "-" + KGlobal::locale()->formatTime((static_cast<Event*>(mIncidence))->dtEnd().time()) ; if ( mAllDay ) { if ( mIncidence->dtStart().date().addDays(3) < mIncidence->dtEnd().date() ) { mDisplayedText += ": " +KGlobal::locale()->formatDate((static_cast<Event*>(mIncidence))->dtStart().date(), true) + " - " + KGlobal::locale()->formatDate((static_cast<Event*>(mIncidence))->dtEnd().date(), true) ; } } } if ( !mIncidence->location().isEmpty() ) { if ( mAllDay ) mDisplayedText += " ("; else diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp index fc00828..060b4c4 100644 --- a/korganizer/kodaymatrix.cpp +++ b/korganizer/kodaymatrix.cpp @@ -95,33 +95,39 @@ KODayMatrix::KODayMatrix(QWidget *parent, Calendar* calendar, QDate date, const days = new QDate[NUMDAYS]; daylbls = new QString[NUMDAYS]; events = new int[NUMDAYS]; mToolTip = new DynamicTip(this); // set default values used for drawing the matrix mDefaultBackColor = palette().active().base(); mDefaultTextColor = palette().active().foreground(); mDefaultTextColorShaded = getShadedColor(mDefaultTextColor); mHolidayColorShaded = getShadedColor(KOPrefs::instance()->mHolidayColor); mSelectedDaysColor = QColor("white"); mTodayMarginWidth = 2; mSelEnd = mSelStart = NOSELECTION; setAcceptDrops(true); //setFont( QFont("Arial", 10) ); - updateView(date); + + mUpdateTimer = new QTimer( this ); + connect (mUpdateTimer ,SIGNAL(timeout()), this, SLOT ( updateViewTimed() )); + mRepaintTimer = new QTimer( this ); + connect (mRepaintTimer ,SIGNAL(timeout()), this, SLOT ( repaintViewTimed() )); + mDayChanged = false; + updateView(); } QColor KODayMatrix::getShadedColor(QColor color) { QColor shaded; int h=0; int s=0; int v=0; color.hsv(&h,&s,&v); s = s/4; v = 192+v/4; shaded.setHsv(h,s,v); return shaded; } @@ -189,114 +195,146 @@ void KODayMatrix::recalculateToday() daylbls[i] = QString::number( KOGlobals::self()->calendarSystem()->day( days[i] )); // if today is in the currently displayed month, hilight today if (days[i].year() == QDate::currentDate().year() && days[i].month() == QDate::currentDate().month() && days[i].day() == QDate::currentDate().day()) { today = i; } } // qDebug(QString("Today is visible at %1.").arg(today)); } void KODayMatrix::updateView() { updateView(startdate); } - -void KODayMatrix::updateView(QDate actdate) +void KODayMatrix::repaintViewTimed() +{ + qDebug("KODayMatrix::repaintViewTimed "); + mRepaintTimer->stop(); + repaint(false); +} +void KODayMatrix::updateViewTimed() { - -// kdDebug() << "KODayMatrix::updateView() " << actdate.toString() << endl; - - //flag to indicate if the starting day of the matrix has changed by this call - bool daychanged = false; - // if a new startdate is to be set then apply Cornelius's calculation - // of the first day to be shown - if (actdate != startdate) { - // reset index of selection according to shift of starting date from startdate to actdate - if (mSelStart != NOSELECTION) { - int tmp = actdate.daysTo(startdate); - //kdDebug() << "Shift of Selection1: " << mSelStart << " - " << mSelEnd << " -> " << tmp << "(" << offset << ")" << endl; - // shift selection if new one would be visible at least partly ! - - if (mSelStart+tmp < NUMDAYS && mSelEnd+tmp >= 0) { - // nested if is required for next X display pushed from a different month - correction required - // otherwise, for month forward and backward, it must be avoided - if( mSelStart > NUMDAYS || mSelStart < 0 ) - mSelStart = mSelStart + tmp; - if( mSelEnd > NUMDAYS || mSelEnd < 0 ) - mSelEnd = mSelEnd + tmp; - } - } - startdate = actdate; - daychanged = true; - } + mUpdateTimer->stop(); + //QDate actdate = mPendingNewDate; - if (daychanged) { - recalculateToday(); - } + static int iii = 0; + qDebug("KODayMatrix::updateView(QDate actdate) %d", ++iii ); + + if (mDayChanged) { + recalculateToday(); + mDayChanged = false; + } for(int i = 0; i < NUMDAYS; i++) { - // if events are set for the day then remember to draw it bold - QPtrList<Event> eventlist = mCalendar->events(days[i]); - Event *event; - int numEvents = eventlist.count(); + // if events are set for the day then remember to draw it bold + QPtrList<Event> eventlist = mCalendar->events(days[i]); + Event *event; + int numEvents = eventlist.count(); - for(event=eventlist.first();event != 0;event=eventlist.next()) { - ushort recurType = event->recurrence()->doesRecur(); + for(event=eventlist.first();event != 0;event=eventlist.next()) { + ushort recurType = event->recurrence()->doesRecur(); - if ((recurType == Recurrence::rDaily && !KOPrefs::instance()->mDailyRecur) || - (recurType == Recurrence::rWeekly && !KOPrefs::instance()->mWeeklyRecur)) { - numEvents--; - } - } - events[i] = numEvents; + if ((recurType == Recurrence::rDaily && !KOPrefs::instance()->mDailyRecur) || + (recurType == Recurrence::rWeekly && !KOPrefs::instance()->mWeeklyRecur)) { + numEvents--; + } + } + events[i] = numEvents; - //if it is a holy day then draw it red. Sundays are consider holidays, too + //if it is a holy day then draw it red. Sundays are consider holidays, too #ifndef KORG_NOPLUGINS - QString holiStr = KOCore::self()->holiday(days[i]); + QString holiStr = KOCore::self()->holiday(days[i]); #else - QString holiStr = QString::null; + QString holiStr = QString::null; #endif - if ( (KOGlobals::self()->calendarSystem()->dayOfWeek(days[i]) == KOGlobals::self()->calendarSystem()->weekDayOfPray()) || - !holiStr.isEmpty()) { - if (holiStr.isNull()) holiStr = ""; - mHolidays[i] = holiStr; + if ( (KOGlobals::self()->calendarSystem()->dayOfWeek(days[i]) == KOGlobals::self()->calendarSystem()->weekDayOfPray()) || + !holiStr.isEmpty()) { + if (holiStr.isNull()) holiStr = ""; + mHolidays[i] = holiStr; + } else { + mHolidays[i] = QString::null; + } + } + repaint(false); + } +void KODayMatrix::updateView(QDate actdate) +{ + + //flag to indicate if the starting day of the matrix has changed by this call + //mDayChanged = false; + // if a new startdate is to be set then apply Cornelius's calculation + // of the first day to be shown + if (actdate != startdate) { + // reset index of selection according to shift of starting date from startdate to actdate + if (mSelStart != NOSELECTION) { + int tmp = actdate.daysTo(startdate); + //kdDebug() << "Shift of Selection1: " << mSelStart << " - " << mSelEnd << " -> " << tmp << "(" << offset << ")" << endl; + // shift selection if new one would be visible at least partly ! + + if (mSelStart+tmp < NUMDAYS && mSelEnd+tmp >= 0) { + // nested if is required for next X display pushed from a different month - correction required + // otherwise, for month forward and backward, it must be avoided + if( mSelStart > NUMDAYS || mSelStart < 0 ) + mSelStart = mSelStart + tmp; + if( mSelEnd > NUMDAYS || mSelEnd < 0 ) + mSelEnd = mSelEnd + tmp; + } + } + + startdate = actdate; + mDayChanged = true; + } + qDebug("restart Timer %d", mDayChanged ); + static int iii = 0; + if ( iii < 5 ) { + ++iii; + updateViewTimed(); } else { - mHolidays[i] = QString::null; + if ( !isVisible() ) { + mUpdateTimer->start( 2000 ); + } else { + if ( mDayChanged ) { + mUpdateTimer->start( 250 ); + } else { + mRepaintTimer->start( 250 ); + mUpdateTimer->start( 2000 ); + } + } } - } + } const QDate& KODayMatrix::getDate(int offset) { if (offset < 0 || offset > NUMDAYS-1) { - kdDebug() << "Wrong offset (" << offset << ") in KODayMatrix::getDate(int)" << endl; + qDebug("Wrong offset2 "); return days[0]; } return days[offset]; } QString KODayMatrix::getHolidayLabel(int offset) { if (offset < 0 || offset > NUMDAYS-1) { - kdDebug() << "Wrong offset (" << offset << ") in KODayMatrix::getHolidayLabel(int)" << endl; + qDebug("Wrong offset1 "); return 0; } return mHolidays[offset]; } int KODayMatrix::getDayIndexFrom(int x, int y) { return 7*(y/daysize.height()) + (KOGlobals::self()->reverseLayout() ? 6 - x/daysize.width() : x/daysize.width()); } // ---------------------------------------------------------------------------- // M O U S E E V E N T H A N D L I N G // ---------------------------------------------------------------------------- void KODayMatrix::mousePressEvent (QMouseEvent* e) diff --git a/korganizer/kodaymatrix.h b/korganizer/kodaymatrix.h index b4eb2a8..0e9640a 100644 --- a/korganizer/kodaymatrix.h +++ b/korganizer/kodaymatrix.h @@ -159,32 +159,34 @@ public: bool isTodayVisible() const { return today>=0; } ; /** If today is visible, then we can find out if today is * near the beginning or the end of the month. * This is dependent on today remaining the index * in the array of visible dates and going from * top left (0) to bottom right (41). */ bool isBeginningOfMonth() const { return today<=8; } ; bool isEndOfMonth() const { return today>=27; } ; public slots: /** Recalculates all the flags of the days in the matrix like holidays or events * on a day (Actually calls above method with the actual startdate). */ void updateView(); + void updateViewTimed(); + void repaintViewTimed(); /** * Calculate which square in the matrix should be * hilighted to indicate it's today. */ void recalculateToday(); /* void setStartDate(QDate); */ signals: /** emitted if the user selects a block of days with the mouse by dragging a rectangle * inside the matrix * @@ -206,32 +208,35 @@ protected: void mouseReleaseEvent (QMouseEvent* e); void mouseMoveEvent (QMouseEvent* e); void dragEnterEvent(QDragEnterEvent *); void dragMoveEvent(QDragMoveEvent *); void dragLeaveEvent(QDragLeaveEvent *); void dropEvent(QDropEvent *); void resizeEvent(QResizeEvent *); private: + QTimer* mUpdateTimer; + QTimer* mRepaintTimer; + bool mDayChanged; /** returns the index of the day located at the matrix's widget (x,y) position. * * @param x horizontal coordinate * @param y vertical coordinate */ int getDayIndexFrom(int x, int y); /** calculates a "shaded" color from the supplied color object. * (Copied from Cornelius's kdpdatebutton.cpp) * * @param color source based on which a shaded color should be calculated. */ QColor getShadedColor(QColor color); /** number of days to be displayed. For now there is no support for any other number then 42. |