summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--bin/kdepim/WhatsNew.txt4
-rw-r--r--korganizer/datenavigatorcontainer.cpp6
-rw-r--r--korganizer/kdatenavigator.cpp2
-rw-r--r--korganizer/kodaymatrix.cpp32
-rw-r--r--korganizer/kodaymatrix.h1
5 files changed, 37 insertions, 8 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt
index 6bc6be9..680f633 100644
--- a/bin/kdepim/WhatsNew.txt
+++ b/bin/kdepim/WhatsNew.txt
@@ -1,26 +1,30 @@
Info about the changes in new versions of KDE-Pim/Pi
+********** VERSION 2.0.24 ************
+
+Fixed again a lot of small bugs.
+
********** VERSION 2.0.23 ************
Fixed again a lot of small and strange bugs, e.g. the missing toolbar of KA/Pi after a new installation.
Fixed the (agenda) layout of KO/Pi on 5500er.
Some usebility enhancements (e.g. reselection the current item of the todo view after some changes).
********** VERSION 2.0.22 ************
KO/Pi:
Fix for creating events/todos via the abgenda context menu.
Added option to split toolbar to 3 toolbars.
(Toolbar moving s disabled for this option due to a bug in Qt somewhere).
Added option to show one small filter-view-toolbar.
Added a print option to the desktop version:
Now you can print out the view of the "Event Viewer".
That means you can print all data of one particular event/todo.
Added scaling options to printout of Event Viewer and What'sNext View.
Fixed some problems in the month view in "week start sunday" mode.
KA/Pi:
Added two more config options.
Fixed resizing problem of address request dialog when orientation was switched.
Cleaned up the menu structure.
Fixed some more problems.
diff --git a/korganizer/datenavigatorcontainer.cpp b/korganizer/datenavigatorcontainer.cpp
index 92abae6..e57daa4 100644
--- a/korganizer/datenavigatorcontainer.cpp
+++ b/korganizer/datenavigatorcontainer.cpp
@@ -402,38 +402,42 @@ void DateNavigatorContainer::setBaseDates()
QDate baseDate = mNavigatorView->baseDate();
bool doRepaint = true;
for( uint i = 0; i < mLastDisplayedDN; ++i ) {
KDateNavigator *n = mExtraViews.at( i );
baseDate = baseDate.addDays( baseDate.daysInMonth () - baseDate.day() +1 );
n->setBaseDate( baseDate, doRepaint );
}
}
void DateNavigatorContainer::setResizeEnabled()
{
mResizeEnabled = true;
//qDebug("DateNavigatorContainer::setResizeEnabled ");
checkUpdateDayMatrixDates();
}
void DateNavigatorContainer::resizeEvent( QResizeEvent * e )
{
//qDebug("DateNavigatorContainer::resizeEvent %d %d ", width(), height());
//qDebug("COUNT %d ", mExtraViews.count());
if ( ! mResizeEnabled ) {
//qDebug("NOT ResizeEnabled");
return;
}
else
- mUpdateTimer->start( 250 );
+#ifdef DESKTOP_VERSION
+ mUpdateTimer->start( 100 );
+#else
+ mUpdateTimer->start( 50 );
+#endif
//updateDayMatrixDates();
}
QSize DateNavigatorContainer::minimumSizeHint() const
{
return mNavigatorView->minimumSizeHint();
}
QSize DateNavigatorContainer::sizeHint() const
{
return mNavigatorView->yourSizeHint();
}
diff --git a/korganizer/kdatenavigator.cpp b/korganizer/kdatenavigator.cpp
index 1d09f40..5aa1c9b 100644
--- a/korganizer/kdatenavigator.cpp
+++ b/korganizer/kdatenavigator.cpp
@@ -69,49 +69,49 @@ KDateNavigator::KDateNavigator( QWidget *parent, const char *name )
connect( mNavigatorBar, SIGNAL( goPrevMonth() ), SIGNAL( goPrevMonth() ) );
connect( mNavigatorBar, SIGNAL( goNextMonth() ), SIGNAL( goNextMonth() ) );
connect( mNavigatorBar, SIGNAL( goNextYear() ), SIGNAL( goNextYear() ) );
connect( mNavigatorBar, SIGNAL( monthSelected( int ) ), SLOT( slotMonthSelected( int ) ) );
// get the day of the week on the first day
QDate dayone(m_MthYr.year(), m_MthYr.month(), 1);
m_fstDayOfWk = dayone.dayOfWeek();
int i;
// Set up the heading fields.
for( i = 0; i < 7; i++ ) {
headings[i] = new QLabel("",this);
//headings[i]->setFont(QFont("Arial", 10, QFont::Bold));
headings[i]->setAlignment(AlignCenter);
headings[i]->installEventFilter(this);
topLayout->addWidget(headings[i],1,i+1);
}
// Create the weeknumber labels
for( i = 0; i < 6; i++ ) {
weeknos[i] = new QLabel(this);
- weeknos[i]->setAlignment(AlignCenter);
+ weeknos[i]->setAlignment(AlignCenter );
//weeknos[i]->setFont(QFont("Arial", 10));
if(!m_bShowWeekNums) {
weeknos[i]->hide();
}
weeknos[i]->installEventFilter(this);
topLayout->addWidget(weeknos[i],i+2,0);
}
daymatrix = new KODayMatrix( this, "KDateNavigator::DayMatrix");
daymatrix->setFrameStyle(QFrame::Panel|QFrame::Sunken);
daymatrix->setLineWidth(1);
connect( daymatrix, SIGNAL( selected( const KCal::DateList & ) ),
SIGNAL( datesSelected( const KCal::DateList & ) ) );
connect( daymatrix, SIGNAL( eventDropped( Event * ) ),
SIGNAL( eventDropped( Event * ) ) );
topLayout->addMultiCellWidget(daymatrix,2,7,1,7);
// read settings from configuration file.
updateConfig();
enableRollover(FollowMonth);
diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp
index 8affe50..c7e1b45 100644
--- a/korganizer/kodaymatrix.cpp
+++ b/korganizer/kodaymatrix.cpp
@@ -88,57 +88,60 @@ void DynamicTip::maybeTip( const QPoint &pos )
// kdDebug() << "DynamicTip::maybeTip matrix cell index [" <<
// col << "][" << row << "] => " <<(col+row*7) << endl;
//show holiday names only
QString str = matrix->getHolidayLabel(col+row*7);
if (str.isEmpty()) return;
tip(rct, str);
}
// ============================================================================
// K O D A Y M A T R I X
// ============================================================================
const int KODayMatrix::NOSELECTION = -1000;
const int KODayMatrix::NUMDAYS = 42;
KODayMatrix::KODayMatrix( QWidget *parent, const char *name )
: QFrame( parent, name , Qt::WRepaintNoErase ), mCalendar( 0 )
#if 0
KODayMatrix::KODayMatrix(QWidget *parent, Calendar* calendar, QDate date, const char *name) :
QFrame(parent, name)
#endif
-{
+{
+ oldW = 0;
+ oldH = 0;
+ myPix.resize( 150, 120 );
mRedrawNeeded = true;
mKODaymatrixWhatsThis = new KODaymatrixWhatsThis(this);
mPendingUpdateBeforeRepaint = false;
mouseDown = false;
// initialize dynamic arrays
bDays.resize ( NUMDAYS );
- hDays.resize ( NUMDAYS );;
- eDays.resize ( NUMDAYS );;
+ hDays.resize ( NUMDAYS );
+ eDays.resize ( NUMDAYS );
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) );
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();
}
@@ -313,49 +316,53 @@ void KODayMatrix::clearSelection()
void KODayMatrix::recalculateToday()
{
today = -1;
for (int i=0; i<NUMDAYS; i++) {
//events[i] = 0;
days[i] = startdate.addDays(i);
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::repaintViewTimed()
-{
+{
+ mRedrawNeeded = true;
+ bDays.fill( false);
+ hDays.fill( false);
+ eDays.fill( false);
mRepaintTimer->stop();
repaint(false);
}
void KODayMatrix::updateViewTimed()
{
mUpdateTimer->stop();
if ( !mCalendar ) {
qDebug("NOT CAL ");
return;
}
//qDebug("KODayMatrix::updateViewTimed ");
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();
QString holiStr = "";
bDays.clearBit(i);
hDays.clearBit(i);
eDays.clearBit(i);
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)) {
@@ -662,53 +669,65 @@ void KODayMatrix::dropEvent(QDropEvent *e)
event->setDtEnd(end);
mCalendar->addEvent(event);
emit eventDropped(event);
} else {
// kdDebug() << "KODayMatrix::dropEvent(): Event from drop not decodable" << endl;
e->ignore();
}
#endif
}
// ----------------------------------------------------------------------------
// P A I N T E V E N T H A N D L I N G
// ----------------------------------------------------------------------------
void KODayMatrix::paintEvent(QPaintEvent * pevent)
{
if ( width() <= 0 || height() <= 0 )
return;
if ( mPendingUpdateBeforeRepaint ) {
updateViewTimed();
mPendingUpdateBeforeRepaint = false;
}
+#if 0
if ( myPix.width() != width() || myPix.height()!=height() ) {
myPix.resize(size() );
mRedrawNeeded = true;
}
-
+#endif
+ if ( oldW != width() || oldH !=height() )
+ mRedrawNeeded = true;
+
+ oldH = height() ;
+ oldW = width();
+ if ( myPix.width() < width() || myPix.height() < height() ) {
+ myPix.resize(size() );
+ mRedrawNeeded = true;
+
+ }
+
if ( mRedrawNeeded ) {
//qDebug("REDRAW ");
QPainter p(&myPix);
p.setFont(font());
int dheight = daysize.height();
int dwidth = daysize.width();
int row,col;
int selw, selh;
int xyOff = frameWidth();
int colModulo = (width()-2) % 7;
int rowModulo = (height()-2) % 6;
//qDebug("col %d row %d ",colModulo,rowModulo );
bool isRTL = KOGlobals::self()->reverseLayout();
// draw background and topleft frame
p.fillRect(0,0,width(),height(), mDefaultBackColor);
p.setPen(mDefaultTextColor);
p.drawRect(0, 0, width(), height());
int mSelStartT = mSelStart;
int mSelEndT = mSelEnd;
if ( mSelEndT >= NUMDAYS )
@@ -926,49 +945,50 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent)
if ( row >= 6 - rowModulo )
addRow = row - 5 + rowModulo;
}
//qDebug("add %d %d -- %d %d ", col, addCol, row, addRow);
++addCol;//++addCol;
if ( row == 0)
addRow = 1;
p.drawText(col*dwidth+addCol, row*dheight+addRow, dwidth, dheight,
Qt::AlignHCenter | Qt::AlignVCenter, daylbls[i]);
// reset color to actual color
if (!mHolidays[i].isNull()) {
p.setPen(actcol);
}
// reset bold font to plain font
if ( eDays.testBit(i)) {
QFont myFont = font();
myFont.setBold(false);
p.setFont(myFont);
}
}
} else {
//qDebug("NO redraw ");
}
- bitBlt (this, 0, 0, &myPix, 0 ,0,width(), height() ,CopyROP);
+
+ bitBlt (this, pevent->rect().topLeft(), &myPix , pevent->rect() ,CopyROP);
mRedrawNeeded = false;
}
// ----------------------------------------------------------------------------
// R E SI Z E E V E N T H A N D L I N G
// ----------------------------------------------------------------------------
void KODayMatrix::resizeEvent(QResizeEvent *)
{
QRect sz = frameRect();
daysize.setHeight(sz.height()*7 / NUMDAYS);
daysize.setWidth(sz.width() / 7);
}
QSize KODayMatrix::sizeHint() const
{
QFontMetrics fm ( font() );
int wid = fm.width( "30") *7+3;
int hei = fm.height() * 6+3;
//qDebug("KODayMatrix::sizeHint()********************* %d %d", wid , hei);
return QSize ( wid, hei );
}
diff --git a/korganizer/kodaymatrix.h b/korganizer/kodaymatrix.h
index 731117c..d725ead 100644
--- a/korganizer/kodaymatrix.h
+++ b/korganizer/kodaymatrix.h
@@ -206,48 +206,49 @@ signals:
*/
void eventDropped(Event *event);
protected:
void paintEvent(QPaintEvent *ev);
void mousePressEvent (QMouseEvent* e);
void mouseReleaseEvent (QMouseEvent* e);
void mouseMoveEvent (QMouseEvent* e);
void dragEnterEvent(QDragEnterEvent *);
void dragMoveEvent(QDragMoveEvent *);
void dragLeaveEvent(QDragLeaveEvent *);
void dropEvent(QDropEvent *);
void resizeEvent(QResizeEvent *);
private:
+ int oldW, oldH;
bool mRedrawNeeded;
KODaymatrixWhatsThis* mKODaymatrixWhatsThis;
bool mouseDown;
QBitArray bDays;
QBitArray hDays;
QBitArray eDays;
QPixmap myPix;
QTimer* mUpdateTimer;
QTimer* mRepaintTimer;
bool mDayChanged;
bool mPendingUpdateBeforeRepaint;
/** 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.
*/