summaryrefslogtreecommitdiffabout
path: root/korganizer/komonthview.cpp
Unidiff
Diffstat (limited to 'korganizer/komonthview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/komonthview.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp
index eea9a4d..4aeb20c 100644
--- a/korganizer/komonthview.cpp
+++ b/korganizer/komonthview.cpp
@@ -1080,65 +1080,69 @@ void MonthViewCell::defaultAction( QListBoxItem *item )
1080} 1080}
1081void MonthViewCell::showDay() 1081void MonthViewCell::showDay()
1082{ 1082{
1083 emit showDaySignal( date() ); 1083 emit showDaySignal( date() );
1084} 1084}
1085void MonthViewCell::newEvent() 1085void MonthViewCell::newEvent()
1086{ 1086{
1087 QDateTime dt( date(), QTime( KOPrefs::instance()->mStartTime, 0 ) ); 1087 QDateTime dt( date(), QTime( KOPrefs::instance()->mStartTime, 0 ) );
1088 emit newEventSignal( dt ); 1088 emit newEventSignal( dt );
1089} 1089}
1090void MonthViewCell::cellClicked( QListBoxItem *item ) 1090void MonthViewCell::cellClicked( QListBoxItem *item )
1091{ 1091{
1092 mMonthView->setSelectedCell( this ); 1092 mMonthView->setSelectedCell( this );
1093 if ( item == 0 ) { 1093 if ( item == 0 ) {
1094 QDateTime dt( date(), QTime( KOPrefs::instance()->mStartTime, 0 ) ); 1094 QDateTime dt( date(), QTime( KOPrefs::instance()->mStartTime, 0 ) );
1095 emit newEventSignal( dt ); 1095 emit newEventSignal( dt );
1096 return; 1096 return;
1097 } 1097 }
1098 1098
1099} 1099}
1100 1100
1101void MonthViewCell::contextMenu( QListBoxItem *item ) 1101void MonthViewCell::contextMenu( QListBoxItem *item )
1102{ 1102{
1103 mMonthView->setPopupCell( this ); 1103 mMonthView->setPopupCell( this );
1104 if ( !item ) { 1104 if ( !item ) {
1105 mMonthView->showContextMenu( 0 ); 1105 mMonthView->showContextMenu( 0 );
1106 return; 1106 return;
1107 } 1107 }
1108 //selection( item ); 1108 //selection( item );
1109 //qApp->processEvents(); 1109 //qApp->processEvents();
1110 MonthViewItem *eventItem = static_cast<MonthViewItem *>( item ); 1110 MonthViewItem *eventItem = static_cast<MonthViewItem *>( item );
1111 Incidence *incidence = eventItem->incidence(); 1111 Incidence *incidence = eventItem->incidence();
1112 if ( incidence ) mMonthView->showContextMenu( incidence ); 1112 if ( incidence ) {
1113 mMonthView->showContextMenu( incidence );
1114 selection( item );
1115 doHighLight( incidence );
1116 }
1113} 1117}
1114 1118
1115void MonthViewCell::selection( QListBoxItem *item ) 1119void MonthViewCell::selection( QListBoxItem *item )
1116{ 1120{
1117 if ( !item ) { 1121 if ( !item ) {
1118 emit highlightIncidence( 0 , this, 0 ); 1122 emit highlightIncidence( 0 , this, 0 );
1119 return; 1123 return;
1120 } 1124 }
1121 MonthViewItem * it = (static_cast<MonthViewItem *>( item )); 1125 MonthViewItem * it = (static_cast<MonthViewItem *>( item ));
1122 emit highlightIncidence( it->incidence(), this, it->multiDay() ); 1126 emit highlightIncidence( it->incidence(), this, it->multiDay() );
1123 mMonthView->setSelectedCell( this ); 1127 mMonthView->setSelectedCell( this );
1124} 1128}
1125 1129
1126void MonthViewCell::deHighLight() 1130void MonthViewCell::deHighLight()
1127{ 1131{
1128 MonthViewItem *mitem = (MonthViewItem*) firstItem (); 1132 MonthViewItem *mitem = (MonthViewItem*) firstItem ();
1129 while ( mitem ) { 1133 while ( mitem ) {
1130 if ( mitem->setHighlightedFalse() ) 1134 if ( mitem->setHighlightedFalse() )
1131 updateItem ( mitem ); 1135 updateItem ( mitem );
1132 mitem = (MonthViewItem *)mitem->next(); 1136 mitem = (MonthViewItem *)mitem->next();
1133 } 1137 }
1134} 1138}
1135// returns true if no inc found 1139// returns true if no inc found
1136bool MonthViewCell::doHighLight( Incidence * inc ) 1140bool MonthViewCell::doHighLight( Incidence * inc )
1137{ 1141{
1138 1142
1139 MonthViewItem *mitem = (MonthViewItem*) firstItem (); 1143 MonthViewItem *mitem = (MonthViewItem*) firstItem ();
1140 while ( mitem ) { 1144 while ( mitem ) {
1141 if ( mitem->incidence() == inc ) { 1145 if ( mitem->incidence() == inc ) {
1142 if ( mitem->setHighlighted( inc ) ) 1146 if ( mitem->setHighlighted( inc ) )
1143 updateItem ( mitem ); 1147 updateItem ( mitem );
1144 return false; 1148 return false;