author | zautrix <zautrix> | 2005-07-27 23:40:19 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-07-27 23:40:19 (UTC) |
commit | 27ffa2e08ebb38e71f613af3a214750442418e2c (patch) (unidiff) | |
tree | de2bb4c541ab8795ee3739526e82ca8f4e952c09 /korganizer | |
parent | 0e38cffd7ba745f237c659e1c48080fcb25b126c (diff) | |
download | kdepimpi-27ffa2e08ebb38e71f613af3a214750442418e2c.zip kdepimpi-27ffa2e08ebb38e71f613af3a214750442418e2c.tar.gz kdepimpi-27ffa2e08ebb38e71f613af3a214750442418e2c.tar.bz2 |
fixcxcx
-rw-r--r-- | korganizer/komonthview.cpp | 6 |
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 | |||
@@ -1064,97 +1064,101 @@ void MonthViewCell::resizeEvent ( QResizeEvent * e ) | |||
1064 | if ( e ) | 1064 | if ( e ) |
1065 | KNoScrollListBox::resizeEvent ( e ); | 1065 | KNoScrollListBox::resizeEvent ( e ); |
1066 | } | 1066 | } |
1067 | 1067 | ||
1068 | void MonthViewCell::defaultAction( QListBoxItem *item ) | 1068 | void MonthViewCell::defaultAction( QListBoxItem *item ) |
1069 | { | 1069 | { |
1070 | 1070 | ||
1071 | if ( !item ) { | 1071 | if ( !item ) { |
1072 | QDateTime dt( date(), QTime( KOPrefs::instance()->mStartTime, 0 ) ); | 1072 | QDateTime dt( date(), QTime( KOPrefs::instance()->mStartTime, 0 ) ); |
1073 | emit newEventSignal( dt ); | 1073 | emit newEventSignal( dt ); |
1074 | return; | 1074 | return; |
1075 | } | 1075 | } |
1076 | 1076 | ||
1077 | MonthViewItem *eventItem = static_cast<MonthViewItem *>( item ); | 1077 | MonthViewItem *eventItem = static_cast<MonthViewItem *>( item ); |
1078 | Incidence *incidence = eventItem->incidence(); | 1078 | Incidence *incidence = eventItem->incidence(); |
1079 | if ( incidence ) mMonthView->defaultAction( incidence ); | 1079 | if ( incidence ) mMonthView->defaultAction( incidence ); |
1080 | } | 1080 | } |
1081 | void MonthViewCell::showDay() | 1081 | void MonthViewCell::showDay() |
1082 | { | 1082 | { |
1083 | emit showDaySignal( date() ); | 1083 | emit showDaySignal( date() ); |
1084 | } | 1084 | } |
1085 | void MonthViewCell::newEvent() | 1085 | void 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 | } |
1090 | void MonthViewCell::cellClicked( QListBoxItem *item ) | 1090 | void 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 | ||
1101 | void MonthViewCell::contextMenu( QListBoxItem *item ) | 1101 | void 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 | ||
1115 | void MonthViewCell::selection( QListBoxItem *item ) | 1119 | void 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 | ||
1126 | void MonthViewCell::deHighLight() | 1130 | void 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 |
1136 | bool MonthViewCell::doHighLight( Incidence * inc ) | 1140 | bool 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; |
1145 | } | 1149 | } |
1146 | mitem = (MonthViewItem *)mitem->next(); | 1150 | mitem = (MonthViewItem *)mitem->next(); |
1147 | } | 1151 | } |
1148 | return true; | 1152 | return true; |
1149 | } | 1153 | } |
1150 | // ******************************************************************************* | 1154 | // ******************************************************************************* |
1151 | // ******************************************************************************* | 1155 | // ******************************************************************************* |
1152 | // ******************************************************************************* | 1156 | // ******************************************************************************* |
1153 | 1157 | ||
1154 | 1158 | ||
1155 | KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) | 1159 | KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) |
1156 | : KOEventView( calendar, parent, name ), | 1160 | : KOEventView( calendar, parent, name ), |
1157 | mDaysPerWeek( 7 ), mNumWeeks( 6 ), mNumCells( mDaysPerWeek * mNumWeeks ), | 1161 | mDaysPerWeek( 7 ), mNumWeeks( 6 ), mNumCells( mDaysPerWeek * mNumWeeks ), |
1158 | mWidthLongDayLabel( 0 ), mSelectedCell( 0 ) | 1162 | mWidthLongDayLabel( 0 ), mSelectedCell( 0 ) |
1159 | { | 1163 | { |
1160 | mFlagKeyPressed = false; | 1164 | mFlagKeyPressed = false; |