summaryrefslogtreecommitdiffabout
path: root/korganizer/komonthview.cpp
Unidiff
Diffstat (limited to 'korganizer/komonthview.cpp') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/komonthview.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp
index b9ce4f4..ab9a4b6 100644
--- a/korganizer/komonthview.cpp
+++ b/korganizer/komonthview.cpp
@@ -916,49 +916,53 @@ void MonthViewCell::resizeEvent ( QResizeEvent * e )
916 mLabel->resize( mLabelBigSize ); 916 mLabel->resize( mLabelBigSize );
917 text += QString::number( KOGlobals::self()->calendarSystem()->day(mDate) ); 917 text += QString::number( KOGlobals::self()->calendarSystem()->day(mDate) );
918 } else { 918 } else {
919 mLabel->resize( mLabelSize ); 919 mLabel->resize( mLabelSize );
920 text += QString::number( KOGlobals::self()->calendarSystem()->day(mDate) ); 920 text += QString::number( KOGlobals::self()->calendarSystem()->day(mDate) );
921 } 921 }
922 mLabel->setText( text ); 922 mLabel->setText( text );
923 923
924 int size = height() - mLabel->height() - lineWidth()-1; 924 int size = height() - mLabel->height() - lineWidth()-1;
925 //qDebug("LW %d ", lineWidth()); 925 //qDebug("LW %d ", lineWidth());
926 if ( size > 0 ) 926 if ( size > 0 )
927 verticalScrollBar()->setMaximumHeight( size ); 927 verticalScrollBar()->setMaximumHeight( size );
928 size = width() - mLabel->width() -lineWidth()-1; 928 size = width() - mLabel->width() -lineWidth()-1;
929 if ( size > 0 ) 929 if ( size > 0 )
930 horizontalScrollBar()->setMaximumWidth( size ); 930 horizontalScrollBar()->setMaximumWidth( size );
931 mLabel->move( width()-lineWidth() - mLabel->width(), height()-lineWidth() - mLabel->height() ); 931 mLabel->move( width()-lineWidth() - mLabel->width(), height()-lineWidth() - mLabel->height() );
932 //mLabel->setMaximumWidth( width() - mItemList->lineWidth()*2); 932 //mLabel->setMaximumWidth( width() - mItemList->lineWidth()*2);
933 // mItemList->resize ( width(), height () ); 933 // mItemList->resize ( width(), height () );
934 if ( e ) 934 if ( e )
935 KNoScrollListBox::resizeEvent ( e ); 935 KNoScrollListBox::resizeEvent ( e );
936} 936}
937 937
938void MonthViewCell::defaultAction( QListBoxItem *item ) 938void MonthViewCell::defaultAction( QListBoxItem *item )
939{ 939{
940 if ( !item ) return; 940 if ( !item ) {
941 QDateTime dt( date(), QTime( KOPrefs::instance()->mStartTime, 0 ) );
942 emit newEventSignal( dt );
943 return;
944 }
941 945
942 MonthViewItem *eventItem = static_cast<MonthViewItem *>( item ); 946 MonthViewItem *eventItem = static_cast<MonthViewItem *>( item );
943 Incidence *incidence = eventItem->incidence(); 947 Incidence *incidence = eventItem->incidence();
944 if ( incidence ) mMonthView->defaultAction( incidence ); 948 if ( incidence ) mMonthView->defaultAction( incidence );
945} 949}
946void MonthViewCell::showDay() 950void MonthViewCell::showDay()
947{ 951{
948 emit showDaySignal( date() ); 952 emit showDaySignal( date() );
949} 953}
950void MonthViewCell::newEvent() 954void MonthViewCell::newEvent()
951{ 955{
952 QDateTime dt( date(), QTime( KOPrefs::instance()->mStartTime, 0 ) ); 956 QDateTime dt( date(), QTime( KOPrefs::instance()->mStartTime, 0 ) );
953 emit newEventSignal( dt ); 957 emit newEventSignal( dt );
954} 958}
955void MonthViewCell::cellClicked( QListBoxItem *item ) 959void MonthViewCell::cellClicked( QListBoxItem *item )
956{ 960{
957 static QListBoxItem * lastClicked = 0; 961 static QListBoxItem * lastClicked = 0;
958 if ( item == 0 ) { 962 if ( item == 0 ) {
959 QDateTime dt( date(), QTime( KOPrefs::instance()->mStartTime, 0 ) ); 963 QDateTime dt( date(), QTime( KOPrefs::instance()->mStartTime, 0 ) );
960 emit newEventSignal( dt ); 964 emit newEventSignal( dt );
961 return; 965 return;
962 } 966 }
963 /* 967 /*
964 if ( lastClicked ) 968 if ( lastClicked )
@@ -1350,48 +1354,49 @@ void KOMonthView::showDates(const QDate &start, const QDate &)
1350 int wno; 1354 int wno;
1351 // remember, according to ISO 8601, the first week of the year is the 1355 // remember, according to ISO 8601, the first week of the year is the
1352 // first week that contains a thursday. Thus we must subtract off 4, 1356 // first week that contains a thursday. Thus we must subtract off 4,
1353 // not just 1. 1357 // not just 1.
1354 int dayOfYear = date.dayOfYear(); 1358 int dayOfYear = date.dayOfYear();
1355 if (dayOfYear % 7 != 0) 1359 if (dayOfYear % 7 != 0)
1356 wno = dayOfYear / 7 + 1; 1360 wno = dayOfYear / 7 + 1;
1357 else 1361 else
1358 wno =dayOfYear / 7; 1362 wno =dayOfYear / 7;
1359 (*weekLabels)[i]->setWeekNum( wno ); 1363 (*weekLabels)[i]->setWeekNum( wno );
1360 date = date.addDays( 7 ); 1364 date = date.addDays( 7 );
1361 } 1365 }
1362 updateView(); 1366 updateView();
1363} 1367}
1364 1368
1365void KOMonthView::showEvents(QPtrList<Event>) 1369void KOMonthView::showEvents(QPtrList<Event>)
1366{ 1370{
1367 qDebug("KOMonthView::selectEvents is not implemented yet. "); 1371 qDebug("KOMonthView::selectEvents is not implemented yet. ");
1368} 1372}
1369 1373
1370void KOMonthView::changeEventDisplay(Event *, int) 1374void KOMonthView::changeEventDisplay(Event *, int)
1371{ 1375{
1372 // this should be re-written to be much more efficient, but this 1376 // this should be re-written to be much more efficient, but this
1373 // quick-and-dirty-hack gets the job done for right now. 1377 // quick-and-dirty-hack gets the job done for right now.
1378 qDebug("KOMonthView::changeEventDisplay ");
1374 updateView(); 1379 updateView();
1375} 1380}
1376 1381
1377void KOMonthView::updateView() 1382void KOMonthView::updateView()
1378{ 1383{
1379 1384
1380 if ( !updatePossible ) 1385 if ( !updatePossible )
1381 return; 1386 return;
1382 //qDebug("UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU "); 1387 //qDebug("UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU ");
1383 //QTime ti; 1388 //QTime ti;
1384 //ti.start(); 1389 //ti.start();
1385 clearSelection(); 1390 clearSelection();
1386 QPtrVector<MonthViewCell> *cells; 1391 QPtrVector<MonthViewCell> *cells;
1387 if ( mShowWeekView ) { 1392 if ( mShowWeekView ) {
1388 cells = &mCellsW; 1393 cells = &mCellsW;
1389 } else { 1394 } else {
1390 cells = &mCells; 1395 cells = &mCells;
1391 } 1396 }
1392#if 1 1397#if 1
1393 int i; 1398 int i;
1394 int timeSpan = (*cells).size()-1; 1399 int timeSpan = (*cells).size()-1;
1395 if ( KOPrefs::instance()->mMonthViewWeek ) 1400 if ( KOPrefs::instance()->mMonthViewWeek )
1396 timeSpan = 6; 1401 timeSpan = 6;
1397 for( i = 0; i < timeSpan + 1; ++i ) { 1402 for( i = 0; i < timeSpan + 1; ++i ) {