-rw-r--r-- | korganizer/datenavigatorcontainer.cpp | 6 | ||||
-rw-r--r-- | korganizer/koagendaitem.cpp | 8 | ||||
-rw-r--r-- | korganizer/koagendaview.cpp | 1 | ||||
-rw-r--r-- | korganizer/komonthview.cpp | 26 | ||||
-rw-r--r-- | korganizer/komonthview.h | 3 | ||||
-rw-r--r-- | korganizer/koviewmanager.cpp | 1 |
6 files changed, 36 insertions, 9 deletions
diff --git a/korganizer/datenavigatorcontainer.cpp b/korganizer/datenavigatorcontainer.cpp index 548c364..d1caff3 100644 --- a/korganizer/datenavigatorcontainer.cpp +++ b/korganizer/datenavigatorcontainer.cpp | |||
@@ -37,32 +37,34 @@ | |||
37 | 37 | ||
38 | DateNavigatorContainer::DateNavigatorContainer( QWidget *parent, | 38 | DateNavigatorContainer::DateNavigatorContainer( QWidget *parent, |
39 | const char *name ) | 39 | const char *name ) |
40 | : QWidget( parent, name ), mCalendar( 0 ), | 40 | : QWidget( parent, name ), mCalendar( 0 ), |
41 | mHorizontalCount( 1 ), mVerticalCount( 1 ) | 41 | mHorizontalCount( 1 ), mVerticalCount( 1 ) |
42 | { | 42 | { |
43 | mExtraViews.setAutoDelete( true ); | 43 | mExtraViews.setAutoDelete( true ); |
44 | 44 | ||
45 | mNavigatorView = new KDateNavigator( this, name ); | 45 | mNavigatorView = new KDateNavigator( this, name ); |
46 | 46 | ||
47 | connectNavigatorView( mNavigatorView ); | 47 | connectNavigatorView( mNavigatorView ); |
48 | //setSizePolicy( QSizePolicy (QSizePolicy::Expanding,QSizePolicy::Expanding) ); | 48 | //setSizePolicy( QSizePolicy (QSizePolicy::Expanding,QSizePolicy::Expanding) ); |
49 | mLastDisplayedDN = 0; | 49 | mLastDisplayedDN = 0; |
50 | mUpdateTimer; | 50 | mUpdateTimer; |
51 | mUpdateTimer = new QTimer( this ); | 51 | mUpdateTimer = new QTimer( this ); |
52 | connect (mUpdateTimer ,SIGNAL(timeout()), this, SLOT ( checkUpdateDayMatrixDates() )); | 52 | connect (mUpdateTimer ,SIGNAL(timeout()), this, SLOT ( checkUpdateDayMatrixDates() )); |
53 | mFirstSelectedDate = QDate::currentDate(); | ||
54 | mSelectedDateCount = 1; | ||
53 | } | 55 | } |
54 | 56 | ||
55 | DateNavigatorContainer::~DateNavigatorContainer() | 57 | DateNavigatorContainer::~DateNavigatorContainer() |
56 | { | 58 | { |
57 | } | 59 | } |
58 | 60 | ||
59 | void DateNavigatorContainer::connectNavigatorView( KDateNavigator *v ) | 61 | void DateNavigatorContainer::connectNavigatorView( KDateNavigator *v ) |
60 | { | 62 | { |
61 | connect( v, SIGNAL( datesSelected( const KCal::DateList & ) ), | 63 | connect( v, SIGNAL( datesSelected( const KCal::DateList & ) ), |
62 | SIGNAL( datesSelected( const KCal::DateList & ) ) ); | 64 | SIGNAL( datesSelected( const KCal::DateList & ) ) ); |
63 | #if 0 | 65 | #if 0 |
64 | connect( v, SIGNAL( incidenceDropped( Incidence *, const QDate & ) ), | 66 | connect( v, SIGNAL( incidenceDropped( Incidence *, const QDate & ) ), |
65 | SIGNAL( incidenceDropped( Incidence *, const QDate & ) ) ); | 67 | SIGNAL( incidenceDropped( Incidence *, const QDate & ) ) ); |
66 | connect( v, SIGNAL( incidenceDroppedMove( Incidence *, const QDate & ) ), | 68 | connect( v, SIGNAL( incidenceDroppedMove( Incidence *, const QDate & ) ), |
67 | SIGNAL( incidenceDroppedMove( Incidence *, const QDate & ) ) ); | 69 | SIGNAL( incidenceDroppedMove( Incidence *, const QDate & ) ) ); |
68 | #endif | 70 | #endif |
@@ -127,41 +129,41 @@ void DateNavigatorContainer::slotMonthSelected( int month ) | |||
127 | setBaseDates(); | 129 | setBaseDates(); |
128 | updateDayMatrixDates(); | 130 | updateDayMatrixDates(); |
129 | emit monthSelected( month ); | 131 | emit monthSelected( month ); |
130 | } | 132 | } |
131 | } | 133 | } |
132 | void DateNavigatorContainer::setCalendar( Calendar *cal ) | 134 | void DateNavigatorContainer::setCalendar( Calendar *cal ) |
133 | { | 135 | { |
134 | mCalendar = cal; | 136 | mCalendar = cal; |
135 | mNavigatorView->setCalendar( cal ); | 137 | mNavigatorView->setCalendar( cal ); |
136 | for( uint i = 0; i < mLastDisplayedDN; ++i ) { | 138 | for( uint i = 0; i < mLastDisplayedDN; ++i ) { |
137 | KDateNavigator *n = mExtraViews.at( i ); | 139 | KDateNavigator *n = mExtraViews.at( i ); |
138 | n->setCalendar( cal ); | 140 | n->setCalendar( cal ); |
139 | } | 141 | } |
140 | } | 142 | } |
141 | void DateNavigatorContainer::checkUpdateDayMatrixDates() | 143 | void DateNavigatorContainer::checkUpdateDayMatrixDates() |
142 | { | 144 | { |
143 | qDebug("wid %d hei %d ", width(), height()); | 145 | //qDebug("KODNC: wid %d hei %d ", width(), height()); |
144 | mUpdateTimer->stop(); | 146 | mUpdateTimer->stop(); |
145 | //return; | 147 | //return; |
146 | if ( width() < 3 || height() < 3 ) | 148 | if ( width() < 3 || height() < 3 ) |
147 | return; | 149 | return; |
148 | static int lastWid = 0; | 150 | static int lastWid = 0; |
149 | static int lastHei = 0; | 151 | static int lastHei = 0; |
150 | if ( lastWid == width() && height() == lastHei ) { | 152 | if ( lastWid == width() && height() == lastHei ) { |
151 | qDebug("no layout computing needed. "); | 153 | qDebug("KODNC: No layout computing needed. "); |
152 | } else { | 154 | } else { |
153 | lastWid = width(); | 155 | lastWid = width(); |
154 | lastHei = height(); | 156 | lastHei = height(); |
155 | 157 | ||
156 | QSize minSize = mNavigatorView->yourSizeHint(); | 158 | QSize minSize = mNavigatorView->yourSizeHint(); |
157 | 159 | ||
158 | int verticalCount = size().height() / minSize.height(); | 160 | int verticalCount = size().height() / minSize.height(); |
159 | int horizontalCount = size().width() / minSize.width(); | 161 | int horizontalCount = size().width() / minSize.width(); |
160 | //qDebug(" wattdatt %d new %d %d ", size().width() ,e->size().width() , minSize.width() ); | 162 | //qDebug(" wattdatt %d new %d %d ", size().width() ,e->size().width() , minSize.width() ); |
161 | //qDebug("COUNT %d %d %d %d ", verticalCount, horizontalCount , mVerticalCount, mHorizontalCount ); | 163 | //qDebug("COUNT %d %d %d %d ", verticalCount, horizontalCount , mVerticalCount, mHorizontalCount ); |
162 | bool fontchange = false; | 164 | bool fontchange = false; |
163 | if ( horizontalCount == 1) | 165 | if ( horizontalCount == 1) |
164 | horizontalCount = size().width() / mNavigatorView->yourFullSizeHint().width(); | 166 | horizontalCount = size().width() / mNavigatorView->yourFullSizeHint().width(); |
165 | QFont fo; | 167 | QFont fo; |
166 | if ( horizontalCount != mHorizontalCount || | 168 | if ( horizontalCount != mHorizontalCount || |
167 | verticalCount != mVerticalCount ) { | 169 | verticalCount != mVerticalCount ) { |
diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp index 7e6fa48..82d1eab 100644 --- a/korganizer/koagendaitem.cpp +++ b/korganizer/koagendaitem.cpp | |||
@@ -491,41 +491,41 @@ void KOAgendaItem::paintEvent ( QPaintEvent *e ) | |||
491 | 491 | ||
492 | QPixmap* paintFrom ; | 492 | QPixmap* paintFrom ; |
493 | if ( mSelected ) { | 493 | if ( mSelected ) { |
494 | paintFrom = paintPixSel(); | 494 | paintFrom = paintPixSel(); |
495 | } else { | 495 | } else { |
496 | if ( mAllDay ) | 496 | if ( mAllDay ) |
497 | paintFrom = paintPixAllday(); | 497 | paintFrom = paintPixAllday(); |
498 | else | 498 | else |
499 | paintFrom = paintPix(); | 499 | paintFrom = paintPix(); |
500 | } | 500 | } |
501 | xx += rx; | 501 | xx += rx; |
502 | 502 | ||
503 | if ( xx < 0 ) { | 503 | if ( xx < 0 ) { |
504 | rw = rw + xx; | 504 | rw = rw + xx; |
505 | rx -= xx; | 505 | rx -= xx; |
506 | xx = 0; | 506 | xx = 0; |
507 | if ( rw < 0 ) { | 507 | if ( rw <= 1 ) { |
508 | qDebug("KOAgendaItem::Width1 < 0. Returning "); | 508 | qDebug("KOAgendaItem::Width1 <= 1 (%d). Returning. %s",rw,mDisplayedText.latin1()); |
509 | return; | 509 | return; |
510 | } | 510 | } |
511 | } | 511 | } |
512 | if ( paintFrom->width() < xx+rw ) { | 512 | if ( paintFrom->width() < xx+rw ) { |
513 | rw = paintFrom->width() - xx; | 513 | rw = paintFrom->width() - xx; |
514 | if ( rw < 0 ) { | 514 | if ( rw <= 1 ) { |
515 | qDebug("KOAgendaItem::Width2 < 0. Returning "); | 515 | qDebug("KOAgendaItem::Width2 <= 1 (%d). Returning.%s ",rw,mDisplayedText.latin1() ); |
516 | return; | 516 | return; |
517 | } | 517 | } |
518 | } | 518 | } |
519 | //qDebug("%d %d %d %d %d %d %d",rx, ry, paintFrom, xx ,yPaintCoord+ry, rw, rh); | 519 | //qDebug("%d %d %d %d %d %d %d",rx, ry, paintFrom, xx ,yPaintCoord+ry, rw, rh); |
520 | bitBlt (this, rx, ry, paintFrom, xx ,yPaintCoord+ry, rw, rh ,CopyROP); | 520 | bitBlt (this, rx, ry, paintFrom, xx ,yPaintCoord+ry, rw, rh ,CopyROP); |
521 | } | 521 | } |
522 | void KOAgendaItem::computeText() | 522 | void KOAgendaItem::computeText() |
523 | { | 523 | { |
524 | 524 | ||
525 | mDisplayedText = mIncidence->summary(); | 525 | mDisplayedText = mIncidence->summary(); |
526 | if ( (mIncidence->type() == "Todo") ) { | 526 | if ( (mIncidence->type() == "Todo") ) { |
527 | if ( static_cast<Todo*>(mIncidence)->hasDueDate() ) { | 527 | if ( static_cast<Todo*>(mIncidence)->hasDueDate() ) { |
528 | if ( static_cast<Todo*>(mIncidence)->dtDue().date() < QDate::currentDate() ) | 528 | if ( static_cast<Todo*>(mIncidence)->dtDue().date() < QDate::currentDate() ) |
529 | mDisplayedText += i18n(" (") +KGlobal::locale()->formatDate((static_cast<Todo*>(mIncidence))->dtDue().date(), true)+")"; | 529 | mDisplayedText += i18n(" (") +KGlobal::locale()->formatDate((static_cast<Todo*>(mIncidence))->dtDue().date(), true)+")"; |
530 | else if ( !(mIncidence->doesFloat())) | 530 | else if ( !(mIncidence->doesFloat())) |
531 | mDisplayedText += i18n(" (") +KGlobal::locale()->formatTime((static_cast<Todo*>(mIncidence))->dtDue().time())+")"; | 531 | mDisplayedText += i18n(" (") +KGlobal::locale()->formatTime((static_cast<Todo*>(mIncidence))->dtDue().time())+")"; |
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp index eb3a6cd..5508210 100644 --- a/korganizer/koagendaview.cpp +++ b/korganizer/koagendaview.cpp | |||
@@ -254,32 +254,33 @@ void TimeLabels::paintEvent(QPaintEvent*) | |||
254 | } | 254 | } |
255 | 255 | ||
256 | //////////////////////////////////////////////////////////////////////////// | 256 | //////////////////////////////////////////////////////////////////////////// |
257 | 257 | ||
258 | EventIndicator::EventIndicator(Location loc,QWidget *parent,const char *name) | 258 | EventIndicator::EventIndicator(Location loc,QWidget *parent,const char *name) |
259 | : QFrame(parent,name) | 259 | : QFrame(parent,name) |
260 | { | 260 | { |
261 | mColumns = 1; | 261 | mColumns = 1; |
262 | mTopBox = 0; | 262 | mTopBox = 0; |
263 | mLocation = loc; | 263 | mLocation = loc; |
264 | mTopLayout = 0; | 264 | mTopLayout = 0; |
265 | mPaintWidget = 0; | 265 | mPaintWidget = 0; |
266 | mXOffset = 0; | 266 | mXOffset = 0; |
267 | if (mLocation == Top) mPixmap = SmallIcon("1uparrow"); | 267 | if (mLocation == Top) mPixmap = SmallIcon("1uparrow"); |
268 | else mPixmap = SmallIcon("1downarrow"); | 268 | else mPixmap = SmallIcon("1downarrow"); |
269 | mEnabled.resize(mColumns); | 269 | mEnabled.resize(mColumns); |
270 | mEnabled.fill( false ); | ||
270 | setMinimumHeight(mPixmap.height()); | 271 | setMinimumHeight(mPixmap.height()); |
271 | } | 272 | } |
272 | 273 | ||
273 | EventIndicator::~EventIndicator() | 274 | EventIndicator::~EventIndicator() |
274 | { | 275 | { |
275 | } | 276 | } |
276 | 277 | ||
277 | void EventIndicator::drawContents(QPainter *p) | 278 | void EventIndicator::drawContents(QPainter *p) |
278 | { | 279 | { |
279 | 280 | ||
280 | // kdDebug() << "======== top: " << contentsRect().top() << " bottom " << // contentsRect().bottom() << " left " << contentsRect().left() << " right " << contentsRect().right() << endl; | 281 | // kdDebug() << "======== top: " << contentsRect().top() << " bottom " << // contentsRect().bottom() << " left " << contentsRect().left() << " right " << contentsRect().right() << endl; |
281 | KDGanttSplitterHandle* han = 0; | 282 | KDGanttSplitterHandle* han = 0; |
282 | if ( mPaintWidget ) | 283 | if ( mPaintWidget ) |
283 | han = mPaintWidget->firstHandle(); | 284 | han = mPaintWidget->firstHandle(); |
284 | if ( ! han ) { | 285 | if ( ! han ) { |
285 | int i; | 286 | int i; |
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index 9fd1f68..8ee5bc3 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp | |||
@@ -981,32 +981,37 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) | |||
981 | mWidthLongDayLabel = 0; | 981 | mWidthLongDayLabel = 0; |
982 | for (int i = 0; i < 7; i++) { | 982 | for (int i = 0; i < 7; i++) { |
983 | int width = fontmetric.width(KOGlobals::self()->calendarSystem()->weekDayName(i+1)); | 983 | int width = fontmetric.width(KOGlobals::self()->calendarSystem()->weekDayName(i+1)); |
984 | if ( width > mWidthLongDayLabel ) mWidthLongDayLabel = width; | 984 | if ( width > mWidthLongDayLabel ) mWidthLongDayLabel = width; |
985 | } | 985 | } |
986 | 986 | ||
987 | //mWeekLabels[mNumWeeks]->setText( i18n("W")); | 987 | //mWeekLabels[mNumWeeks]->setText( i18n("W")); |
988 | 988 | ||
989 | #if 0 | 989 | #if 0 |
990 | if ( mShowWeekView ) | 990 | if ( mShowWeekView ) |
991 | mWidStack->raiseWidget( mWeekView ); | 991 | mWidStack->raiseWidget( mWeekView ); |
992 | else | 992 | else |
993 | mWidStack->raiseWidget( mMonthView ); | 993 | mWidStack->raiseWidget( mMonthView ); |
994 | #endif | 994 | #endif |
995 | 995 | ||
996 | emit incidenceSelected( 0 ); | 996 | emit incidenceSelected( 0 ); |
997 | |||
998 | mComputeLayoutTimer = new QTimer( this ); | ||
999 | connect (mComputeLayoutTimer ,SIGNAL(timeout()), this, SLOT ( slotComputeLayout())); | ||
1000 | |||
1001 | |||
997 | #ifndef DESKTOP_VERSION | 1002 | #ifndef DESKTOP_VERSION |
998 | resize( QApplication::desktop()->size() ); | 1003 | resize( QApplication::desktop()->size() ); |
999 | #else | 1004 | #else |
1000 | resize(640, 480 ); | 1005 | resize(640, 480 ); |
1001 | updatePossible = true; | 1006 | updatePossible = true; |
1002 | #endif | 1007 | #endif |
1003 | computeLayout(); | 1008 | computeLayout(); |
1004 | 1009 | ||
1005 | if ( mShowWeekView ) | 1010 | if ( mShowWeekView ) |
1006 | mWidStack->raiseWidget( mWeekView ); | 1011 | mWidStack->raiseWidget( mWeekView ); |
1007 | else | 1012 | else |
1008 | mWidStack->raiseWidget( mMonthView ); | 1013 | mWidStack->raiseWidget( mMonthView ); |
1009 | } | 1014 | } |
1010 | 1015 | ||
1011 | KOMonthView::~KOMonthView() | 1016 | KOMonthView::~KOMonthView() |
1012 | { | 1017 | { |
@@ -1338,61 +1343,75 @@ void KOMonthView::updateView() | |||
1338 | int i; | 1343 | int i; |
1339 | for( i = 0; i < (*cells).count(); ++i ) { | 1344 | for( i = 0; i < (*cells).count(); ++i ) { |
1340 | (*cells)[i]->updateCell(); | 1345 | (*cells)[i]->updateCell(); |
1341 | } | 1346 | } |
1342 | 1347 | ||
1343 | //qDebug("KOMonthView::updateView() "); | 1348 | //qDebug("KOMonthView::updateView() "); |
1344 | processSelectionChange(); | 1349 | processSelectionChange(); |
1345 | // qDebug("---------------------------------------------------------------------+ "); | 1350 | // qDebug("---------------------------------------------------------------------+ "); |
1346 | (*cells)[0]->setFocus(); | 1351 | (*cells)[0]->setFocus(); |
1347 | #endif | 1352 | #endif |
1348 | 1353 | ||
1349 | //qDebug("update time %d ", ti.elapsed()); | 1354 | //qDebug("update time %d ", ti.elapsed()); |
1350 | } | 1355 | } |
1351 | 1356 | ||
1352 | void KOMonthView::resizeEvent(QResizeEvent * e) | 1357 | void KOMonthView::resizeEvent(QResizeEvent * e) |
1353 | { | 1358 | { |
1354 | //qDebug("KOMonthView::resizeEvent %d %d -- %d %d ", e->size().width(), e->size().height(), e->oldSize().width(), e->oldSize().height()); | 1359 | qDebug("KOMonthView::resizeEvent %d %d -- %d %d ", e->size().width(), e->size().height(), e->oldSize().width(), e->oldSize().height()); |
1360 | if ( isVisible() ) { | ||
1361 | qDebug("KOMonthView::isVisible "); | ||
1362 | slotComputeLayout(); | ||
1363 | } else | ||
1364 | mComputeLayoutTimer->start( 100 ); | ||
1365 | } | ||
1366 | |||
1367 | void KOMonthView::slotComputeLayout() | ||
1368 | { | ||
1369 | mComputeLayoutTimer->stop(); | ||
1370 | qDebug("KOMonthView::Post - resizeEvent %d %d ", width(), height() ); | ||
1355 | computeLayout(); | 1371 | computeLayout(); |
1356 | clPending = true; | 1372 | clPending = true; |
1357 | if ( mShowWeekView ) | 1373 | if ( mShowWeekView ) |
1358 | mCellsW[0]->setFocus(); | 1374 | mCellsW[0]->setFocus(); |
1359 | else | 1375 | else |
1360 | mCells[0]->setFocus(); | 1376 | mCells[0]->setFocus(); |
1377 | |||
1361 | } | 1378 | } |
1362 | void KOMonthView::computeLayoutWeek() | 1379 | void KOMonthView::computeLayoutWeek() |
1363 | { | 1380 | { |
1364 | static int lastWid = 0; | 1381 | static int lastWid = 0; |
1365 | static int lastHei = 0; | 1382 | static int lastHei = 0; |
1366 | int daysToShow; | 1383 | int daysToShow; |
1367 | bool combinedSatSun = false; | 1384 | bool combinedSatSun = false; |
1368 | if (mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ) { | 1385 | if (mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ) { |
1369 | daysToShow = 6; | 1386 | daysToShow = 6; |
1370 | combinedSatSun = true; | 1387 | combinedSatSun = true; |
1371 | } | 1388 | } |
1372 | int tWid = topLevelWidget()->size().width(); | 1389 | int tWid = topLevelWidget()->size().width(); |
1373 | int tHei = topLevelWidget()->size().height(); | 1390 | int tHei = topLevelWidget()->size().height(); |
1374 | 1391 | ||
1375 | int wid = width();//e | 1392 | int wid = width();//e |
1376 | int hei = height()-1-mNavigatorBar->height(); | 1393 | int hei = height()-1-mNavigatorBar->height(); |
1377 | 1394 | ||
1378 | if ( ((wid *3)/2) < tWid && (( hei *3) /2) < tHei ) | 1395 | if ( ((wid *3)/2) < tWid && (( hei *3) /2) < tHei ) |
1379 | return; | 1396 | return; |
1380 | 1397 | ||
1381 | if ( lastWid == width() && lastHei == height() ) | 1398 | if ( lastWid == width() && lastHei == height() ) { |
1399 | qDebug("KOListWeekView::No compute layout needed "); | ||
1382 | return; | 1400 | return; |
1401 | } | ||
1383 | lastWid = width(); | 1402 | lastWid = width(); |
1384 | lastHei = height(); | 1403 | lastHei = height(); |
1385 | 1404 | ||
1386 | 1405 | ||
1387 | if ( wid < hei ) | 1406 | if ( wid < hei ) |
1388 | daysToShow = 2; | 1407 | daysToShow = 2; |
1389 | else | 1408 | else |
1390 | daysToShow = 3; | 1409 | daysToShow = 3; |
1391 | mShowSatSunComp = true; | 1410 | mShowSatSunComp = true; |
1392 | combinedSatSun = true; | 1411 | combinedSatSun = true; |
1393 | 1412 | ||
1394 | //qDebug("KOMonthView::computeLayout() WWW ------------------------------------ "); | 1413 | //qDebug("KOMonthView::computeLayout() WWW ------------------------------------ "); |
1395 | QFontMetrics fm ( mWeekLabels[0]->font() ); | 1414 | QFontMetrics fm ( mWeekLabels[0]->font() ); |
1396 | int weeklabelwid = fm.width( "888" ); | 1415 | int weeklabelwid = fm.width( "888" ); |
1397 | wid -= weeklabelwid; | 1416 | wid -= weeklabelwid; |
1398 | 1417 | ||
@@ -1492,38 +1511,39 @@ void KOMonthView::computeLayout() | |||
1492 | int daysToShow = 7; | 1511 | int daysToShow = 7; |
1493 | bool combinedSatSun = false; | 1512 | bool combinedSatSun = false; |
1494 | if (mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ) { | 1513 | if (mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ) { |
1495 | daysToShow = 6; | 1514 | daysToShow = 6; |
1496 | combinedSatSun = true; | 1515 | combinedSatSun = true; |
1497 | } | 1516 | } |
1498 | int tWid = topLevelWidget()->size().width(); | 1517 | int tWid = topLevelWidget()->size().width(); |
1499 | int tHei = topLevelWidget()->size().height(); | 1518 | int tHei = topLevelWidget()->size().height(); |
1500 | 1519 | ||
1501 | int wid = width();//e | 1520 | int wid = width();//e |
1502 | int hei = height()-1-mNavigatorBar->height(); | 1521 | int hei = height()-1-mNavigatorBar->height(); |
1503 | 1522 | ||
1504 | if ( ((wid *3)/2) < tWid && (( hei *3) /2) < tHei ) { | 1523 | if ( ((wid *3)/2) < tWid && (( hei *3) /2) < tHei ) { |
1505 | return; | 1524 | return; |
1506 | } | 1525 | } |
1507 | if ( lastWid == width() && lastHei == height() ){ | 1526 | if ( lastWid == width() && lastHei == height() ){ |
1527 | qDebug("KOMonthview::No compute layout needed "); | ||
1508 | return; | 1528 | return; |
1509 | } | 1529 | } |
1510 | 1530 | ||
1511 | lastWid = width(); | 1531 | lastWid = width(); |
1512 | lastHei = height(); | 1532 | lastHei = height(); |
1513 | //qDebug("KOMonthView::computeLayout() MMM ------------------------------------ "); | 1533 | qDebug("KOMonthView::computeLayout() MMM ------------------- "); |
1514 | QFontMetrics fm ( mWeekLabels[0]->font() ); | 1534 | QFontMetrics fm ( mWeekLabels[0]->font() ); |
1515 | int weeklabelwid = fm.width( "888" ); | 1535 | int weeklabelwid = fm.width( "888" ); |
1516 | wid -= weeklabelwid; | 1536 | wid -= weeklabelwid; |
1517 | 1537 | ||
1518 | int colWid = wid / daysToShow; | 1538 | int colWid = wid / daysToShow; |
1519 | int lastCol = wid - ( colWid*6 ); | 1539 | int lastCol = wid - ( colWid*6 ); |
1520 | int dayLabelHei = mDayLabels[0]->sizeHint().height(); | 1540 | int dayLabelHei = mDayLabels[0]->sizeHint().height(); |
1521 | int cellHei = (hei - dayLabelHei) /6; | 1541 | int cellHei = (hei - dayLabelHei) /6; |
1522 | int colModulo = wid % daysToShow; | 1542 | int colModulo = wid % daysToShow; |
1523 | int rowModulo = (hei- dayLabelHei) % 6; | 1543 | int rowModulo = (hei- dayLabelHei) % 6; |
1524 | //qDebug("rowmod %d ", rowModulo); | 1544 | //qDebug("rowmod %d ", rowModulo); |
1525 | int i; | 1545 | int i; |
1526 | int x,y,w,h; | 1546 | int x,y,w,h; |
1527 | x= 0; | 1547 | x= 0; |
1528 | y= 0; | 1548 | y= 0; |
1529 | w = colWid; | 1549 | w = colWid; |
diff --git a/korganizer/komonthview.h b/korganizer/komonthview.h index a92421b..89912e0 100644 --- a/korganizer/komonthview.h +++ b/korganizer/komonthview.h | |||
@@ -14,32 +14,33 @@ | |||
14 | 14 | ||
15 | You should have received a copy of the GNU General Public License | 15 | You should have received a copy of the GNU General Public License |
16 | along with this program; if not, write to the Free Software | 16 | along with this program; if not, write to the Free Software |
17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
18 | */ | 18 | */ |
19 | 19 | ||
20 | #ifndef _KOMONTHVIEW_H | 20 | #ifndef _KOMONTHVIEW_H |
21 | #define _KOMONTHVIEW_H | 21 | #define _KOMONTHVIEW_H |
22 | 22 | ||
23 | #include <qlabel.h> | 23 | #include <qlabel.h> |
24 | #include <qframe.h> | 24 | #include <qframe.h> |
25 | #include <qdatetime.h> | 25 | #include <qdatetime.h> |
26 | #include <qlistbox.h> | 26 | #include <qlistbox.h> |
27 | #include <qpoint.h> | 27 | #include <qpoint.h> |
28 | #include <qwidgetstack.h> | 28 | #include <qwidgetstack.h> |
29 | #include <qlayout.h> | 29 | #include <qlayout.h> |
30 | #include <qtimer.h> | ||
30 | #include <qintdict.h> | 31 | #include <qintdict.h> |
31 | #include <qpushbutton.h> | 32 | #include <qpushbutton.h> |
32 | #include <qvaluelist.h> | 33 | #include <qvaluelist.h> |
33 | #include <qptrvector.h> | 34 | #include <qptrvector.h> |
34 | 35 | ||
35 | #include <libkcal/calendar.h> | 36 | #include <libkcal/calendar.h> |
36 | #include <libkcal/event.h> | 37 | #include <libkcal/event.h> |
37 | 38 | ||
38 | #include "koeventview.h" | 39 | #include "koeventview.h" |
39 | #include "navigatorbar.h" | 40 | #include "navigatorbar.h" |
40 | 41 | ||
41 | #ifdef DESKTOP_VERSION | 42 | #ifdef DESKTOP_VERSION |
42 | class QToolTipGroup; | 43 | class QToolTipGroup; |
43 | #endif | 44 | #endif |
44 | 45 | ||
45 | class KNOWhatsThis; | 46 | class KNOWhatsThis; |
@@ -238,46 +239,48 @@ class KOMonthView: public KOEventView | |||
238 | public slots: | 239 | public slots: |
239 | virtual void updateView(); | 240 | virtual void updateView(); |
240 | virtual void updateConfig(); | 241 | virtual void updateConfig(); |
241 | virtual void showDates(const QDate &start, const QDate &end); | 242 | virtual void showDates(const QDate &start, const QDate &end); |
242 | virtual void showEvents(QPtrList<Event> eventList); | 243 | virtual void showEvents(QPtrList<Event> eventList); |
243 | 244 | ||
244 | void changeEventDisplay(Event *, int); | 245 | void changeEventDisplay(Event *, int); |
245 | 246 | ||
246 | void clearSelection(); | 247 | void clearSelection(); |
247 | 248 | ||
248 | void showContextMenu( Incidence * ); | 249 | void showContextMenu( Incidence * ); |
249 | 250 | ||
250 | void setSelectedCell( MonthViewCell * ); | 251 | void setSelectedCell( MonthViewCell * ); |
251 | void switchView(); | 252 | void switchView(); |
252 | 253 | ||
253 | protected slots: | 254 | protected slots: |
255 | void slotComputeLayout(); | ||
254 | void selectInternalWeekNum ( int ); | 256 | void selectInternalWeekNum ( int ); |
255 | void processSelectionChange(); | 257 | void processSelectionChange(); |
256 | signals: | 258 | signals: |
257 | void nextMonth(); | 259 | void nextMonth(); |
258 | void prevMonth(); | 260 | void prevMonth(); |
259 | void selectWeekNum ( int ); | 261 | void selectWeekNum ( int ); |
260 | void selectMonth (); | 262 | void selectMonth (); |
261 | void showDaySignal( QDate ); | 263 | void showDaySignal( QDate ); |
262 | protected: | 264 | protected: |
263 | void resizeEvent(QResizeEvent *); | 265 | void resizeEvent(QResizeEvent *); |
264 | void viewChanged(); | 266 | void viewChanged(); |
265 | void updateDayLabels(); | 267 | void updateDayLabels(); |
266 | 268 | ||
267 | private: | 269 | private: |
270 | QTimer* mComputeLayoutTimer; | ||
268 | NavigatorBar* mNavigatorBar; | 271 | NavigatorBar* mNavigatorBar; |
269 | int currentWeek(); | 272 | int currentWeek(); |
270 | bool clPending; | 273 | bool clPending; |
271 | QWidgetStack * mWidStack; | 274 | QWidgetStack * mWidStack; |
272 | QWidget* mMonthView; | 275 | QWidget* mMonthView; |
273 | QWidget* mWeekView; | 276 | QWidget* mWeekView; |
274 | bool mShowWeekView; | 277 | bool mShowWeekView; |
275 | bool updatePossible; | 278 | bool updatePossible; |
276 | int mDaysPerWeek; | 279 | int mDaysPerWeek; |
277 | int mNumWeeks; | 280 | int mNumWeeks; |
278 | int mNumCells; | 281 | int mNumCells; |
279 | bool mWeekStartsMonday; | 282 | bool mWeekStartsMonday; |
280 | bool mShowSatSunComp; | 283 | bool mShowSatSunComp; |
281 | void computeLayout(); | 284 | void computeLayout(); |
282 | void computeLayoutWeek(); | 285 | void computeLayoutWeek(); |
283 | 286 | ||
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp index cc0ce9b..94d74f1 100644 --- a/korganizer/koviewmanager.cpp +++ b/korganizer/koviewmanager.cpp | |||
@@ -228,32 +228,33 @@ void KOViewManager::showView(KOrg::BaseView *view, bool fullScreen ) | |||
228 | if ( mAgendaView ) mAgendaView->deleteSelectedDateTime(); | 228 | if ( mAgendaView ) mAgendaView->deleteSelectedDateTime(); |
229 | //raiseCurrentView( full ); | 229 | //raiseCurrentView( full ); |
230 | mMainView->processIncidenceSelection( 0 ); | 230 | mMainView->processIncidenceSelection( 0 ); |
231 | //mMainView->updateView(); | 231 | //mMainView->updateView(); |
232 | raiseCurrentView( full, true ); | 232 | raiseCurrentView( full, true ); |
233 | mMainView->adaptNavigationUnits(); | 233 | mMainView->adaptNavigationUnits(); |
234 | } | 234 | } |
235 | 235 | ||
236 | void KOViewManager::raiseCurrentView( bool fullScreen, bool callUpdateView ) | 236 | void KOViewManager::raiseCurrentView( bool fullScreen, bool callUpdateView ) |
237 | { | 237 | { |
238 | mCurrentAgendaView = 0; | 238 | mCurrentAgendaView = 0; |
239 | if ( fullScreen ) { | 239 | if ( fullScreen ) { |
240 | mMainView->leftFrame()->hide(); | 240 | mMainView->leftFrame()->hide(); |
241 | } else { | 241 | } else { |
242 | mMainView->leftFrame()->show(); | 242 | mMainView->leftFrame()->show(); |
243 | } | 243 | } |
244 | //if ( mCurrentView == mMonthView ) qApp->processEvents(); | ||
244 | emit signalFullScreen( !fullScreen ); | 245 | emit signalFullScreen( !fullScreen ); |
245 | if ( callUpdateView ) | 246 | if ( callUpdateView ) |
246 | mMainView->updateView(); | 247 | mMainView->updateView(); |
247 | 248 | ||
248 | if ( globalFlagBlockAgenda == 5 ) { | 249 | if ( globalFlagBlockAgenda == 5 ) { |
249 | globalFlagBlockAgenda = 4; | 250 | globalFlagBlockAgenda = 4; |
250 | globalFlagBlockAgendaItemPaint = 1; | 251 | globalFlagBlockAgendaItemPaint = 1; |
251 | } | 252 | } |
252 | mMainView->viewStack()->raiseWidget(mCurrentView); | 253 | mMainView->viewStack()->raiseWidget(mCurrentView); |
253 | if ( globalFlagBlockAgenda == 4 ) { | 254 | if ( globalFlagBlockAgenda == 4 ) { |
254 | if ( mCurrentView == mAgendaView ) { | 255 | if ( mCurrentView == mAgendaView ) { |
255 | //globalFlagBlockAgenda =1 ; | 256 | //globalFlagBlockAgenda =1 ; |
256 | if ( KOPrefs::instance()->mSetTimeToDayStartAt ) | 257 | if ( KOPrefs::instance()->mSetTimeToDayStartAt ) |
257 | mAgendaView->setStartHour( KOPrefs::instance()->mDayBegins ); | 258 | mAgendaView->setStartHour( KOPrefs::instance()->mDayBegins ); |
258 | else if ( KOPrefs::instance()->mCenterOnCurrentTime ) | 259 | else if ( KOPrefs::instance()->mCenterOnCurrentTime ) |
259 | mAgendaView->setStartHour( QTime::currentTime ().hour() ); | 260 | mAgendaView->setStartHour( QTime::currentTime ().hour() ); |