summaryrefslogtreecommitdiffabout
path: root/korganizer/komonthview.cpp
Side-by-side diff
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 )
mLabel->resize( mLabelBigSize );
text += QString::number( KOGlobals::self()->calendarSystem()->day(mDate) );
} else {
mLabel->resize( mLabelSize );
text += QString::number( KOGlobals::self()->calendarSystem()->day(mDate) );
}
mLabel->setText( text );
int size = height() - mLabel->height() - lineWidth()-1;
//qDebug("LW %d ", lineWidth());
if ( size > 0 )
verticalScrollBar()->setMaximumHeight( size );
size = width() - mLabel->width() -lineWidth()-1;
if ( size > 0 )
horizontalScrollBar()->setMaximumWidth( size );
mLabel->move( width()-lineWidth() - mLabel->width(), height()-lineWidth() - mLabel->height() );
//mLabel->setMaximumWidth( width() - mItemList->lineWidth()*2);
// mItemList->resize ( width(), height () );
if ( e )
KNoScrollListBox::resizeEvent ( e );
}
void MonthViewCell::defaultAction( QListBoxItem *item )
{
- if ( !item ) return;
+ if ( !item ) {
+ QDateTime dt( date(), QTime( KOPrefs::instance()->mStartTime, 0 ) );
+ emit newEventSignal( dt );
+ return;
+ }
MonthViewItem *eventItem = static_cast<MonthViewItem *>( item );
Incidence *incidence = eventItem->incidence();
if ( incidence ) mMonthView->defaultAction( incidence );
}
void MonthViewCell::showDay()
{
emit showDaySignal( date() );
}
void MonthViewCell::newEvent()
{
QDateTime dt( date(), QTime( KOPrefs::instance()->mStartTime, 0 ) );
emit newEventSignal( dt );
}
void MonthViewCell::cellClicked( QListBoxItem *item )
{
static QListBoxItem * lastClicked = 0;
if ( item == 0 ) {
QDateTime dt( date(), QTime( KOPrefs::instance()->mStartTime, 0 ) );
emit newEventSignal( dt );
return;
}
/*
if ( lastClicked )
@@ -1350,48 +1354,49 @@ void KOMonthView::showDates(const QDate &start, const QDate &)
int wno;
// remember, according to ISO 8601, the first week of the year is the
// first week that contains a thursday. Thus we must subtract off 4,
// not just 1.
int dayOfYear = date.dayOfYear();
if (dayOfYear % 7 != 0)
wno = dayOfYear / 7 + 1;
else
wno =dayOfYear / 7;
(*weekLabels)[i]->setWeekNum( wno );
date = date.addDays( 7 );
}
updateView();
}
void KOMonthView::showEvents(QPtrList<Event>)
{
qDebug("KOMonthView::selectEvents is not implemented yet. ");
}
void KOMonthView::changeEventDisplay(Event *, int)
{
// this should be re-written to be much more efficient, but this
// quick-and-dirty-hack gets the job done for right now.
+ qDebug("KOMonthView::changeEventDisplay ");
updateView();
}
void KOMonthView::updateView()
{
if ( !updatePossible )
return;
//qDebug("UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU ");
//QTime ti;
//ti.start();
clearSelection();
QPtrVector<MonthViewCell> *cells;
if ( mShowWeekView ) {
cells = &mCellsW;
} else {
cells = &mCells;
}
#if 1
int i;
int timeSpan = (*cells).size()-1;
if ( KOPrefs::instance()->mMonthViewWeek )
timeSpan = 6;
for( i = 0; i < timeSpan + 1; ++i ) {