-rw-r--r-- | korganizer/koagendaview.cpp | 1 | ||||
-rw-r--r-- | korganizer/komonthview.cpp | 10 | ||||
-rw-r--r-- | korganizer/koviewmanager.cpp | 5 |
3 files changed, 8 insertions, 8 deletions
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp index c8cef44..d4ff77a 100644 --- a/korganizer/koagendaview.cpp +++ b/korganizer/koagendaview.cpp | |||
@@ -959,49 +959,48 @@ void KOAgendaView::updateEventDates(KOAgendaItem *item, int type) | |||
959 | } | 959 | } |
960 | startDt.setDate(startDate); | 960 | startDt.setDate(startDate); |
961 | 961 | ||
962 | if (item->incidence()->doesFloat()) { | 962 | if (item->incidence()->doesFloat()) { |
963 | endDt.setDate(startDate.addDays(item->cellWidth() - 1)); | 963 | endDt.setDate(startDate.addDays(item->cellWidth() - 1)); |
964 | } else { | 964 | } else { |
965 | if ( type == KOAgenda::RESIZETOP || type == KOAgenda::MOVE ) | 965 | if ( type == KOAgenda::RESIZETOP || type == KOAgenda::MOVE ) |
966 | startDt.setTime(mAgenda->gyToTime(item->cellYTop())); | 966 | startDt.setTime(mAgenda->gyToTime(item->cellYTop())); |
967 | if ( item->incidence()->type() == "Event" ) { | 967 | if ( item->incidence()->type() == "Event" ) { |
968 | if ( type == KOAgenda::MOVE ) { | 968 | if ( type == KOAgenda::MOVE ) { |
969 | endDt = startDt.addSecs(lenInSecs); | 969 | endDt = startDt.addSecs(lenInSecs); |
970 | 970 | ||
971 | } else if ( type == KOAgenda::RESIZEBOTTOM ) { | 971 | } else if ( type == KOAgenda::RESIZEBOTTOM ) { |
972 | if (item->lastMultiItem()) { | 972 | if (item->lastMultiItem()) { |
973 | endDt.setTime(mAgenda->gyToTime(item->lastMultiItem()->cellYBottom()+1)); | 973 | endDt.setTime(mAgenda->gyToTime(item->lastMultiItem()->cellYBottom()+1)); |
974 | endDt.setDate(startDate. | 974 | endDt.setDate(startDate. |
975 | addDays(item->lastMultiItem()->cellX() - item->cellX())); | 975 | addDays(item->lastMultiItem()->cellX() - item->cellX())); |
976 | } else { | 976 | } else { |
977 | endDt.setTime(mAgenda->gyToTime(item->cellYBottom()+1)); | 977 | endDt.setTime(mAgenda->gyToTime(item->cellYBottom()+1)); |
978 | endDt.setDate(startDate); | 978 | endDt.setDate(startDate); |
979 | } | 979 | } |
980 | } | 980 | } |
981 | } else { | 981 | } else { |
982 | // todo | 982 | // todo |
983 | qDebug("tooooodoooooo "); | ||
984 | if (item->lastMultiItem()) { | 983 | if (item->lastMultiItem()) { |
985 | endDt.setTime(mAgenda->gyToTime(item->lastMultiItem()->cellYBottom()+1)); | 984 | endDt.setTime(mAgenda->gyToTime(item->lastMultiItem()->cellYBottom()+1)); |
986 | endDt.setDate(startDate. | 985 | endDt.setDate(startDate. |
987 | addDays(item->lastMultiItem()->cellX() - item->cellX())); | 986 | addDays(item->lastMultiItem()->cellX() - item->cellX())); |
988 | } else { | 987 | } else { |
989 | //qDebug("tem->cellYBottom() %d",item->cellYBottom() ); | 988 | //qDebug("tem->cellYBottom() %d",item->cellYBottom() ); |
990 | if ( item->cellYBottom() > 0 ) | 989 | if ( item->cellYBottom() > 0 ) |
991 | endDt.setTime(mAgenda->gyToTime(item->cellYBottom()+1)); | 990 | endDt.setTime(mAgenda->gyToTime(item->cellYBottom()+1)); |
992 | else | 991 | else |
993 | endDt.setTime((static_cast<Todo*>(item->incidence()))->dtDue().time()); | 992 | endDt.setTime((static_cast<Todo*>(item->incidence()))->dtDue().time()); |
994 | endDt.setDate(startDate); | 993 | endDt.setDate(startDate); |
995 | } | 994 | } |
996 | } | 995 | } |
997 | } | 996 | } |
998 | if ( item->incidence()->type() == "Event" ) { | 997 | if ( item->incidence()->type() == "Event" ) { |
999 | item->incidence()->setDtStart(startDt); | 998 | item->incidence()->setDtStart(startDt); |
1000 | (static_cast<Event*>(item->incidence()))->setDtEnd(endDt); | 999 | (static_cast<Event*>(item->incidence()))->setDtEnd(endDt); |
1001 | } else if ( item->incidence()->type() == "Todo" ) { | 1000 | } else if ( item->incidence()->type() == "Todo" ) { |
1002 | (static_cast<Todo*>(item->incidence()))->setDtDue(endDt); | 1001 | (static_cast<Todo*>(item->incidence()))->setDtDue(endDt); |
1003 | } | 1002 | } |
1004 | //qDebug("KOAgendaView::updateEventDates stsart %s end %s ", startDt.toString().latin1(), endDt.toString().latin1() ); | 1003 | //qDebug("KOAgendaView::updateEventDates stsart %s end %s ", startDt.toString().latin1(), endDt.toString().latin1() ); |
1005 | item->incidence()->setRevision(item->incidence()->revision()+1); | 1004 | item->incidence()->setRevision(item->incidence()->revision()+1); |
1006 | item->setItemDate(startDt.date()); | 1005 | item->setItemDate(startDt.date()); |
1007 | //item->updateItem(); | 1006 | //item->updateItem(); |
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp index 6294b98..0ef5ae4 100644 --- a/korganizer/komonthview.cpp +++ b/korganizer/komonthview.cpp | |||
@@ -1138,80 +1138,84 @@ void KOMonthView::computeLayoutWeek() | |||
1138 | //qDebug("KOMonthView::computeLayout()------------------------------------ "); | 1138 | //qDebug("KOMonthView::computeLayout()------------------------------------ "); |
1139 | QFontMetrics fm ( mWeekLabels[0]->font() ); | 1139 | QFontMetrics fm ( mWeekLabels[0]->font() ); |
1140 | int weeklabelwid = fm.width( "888" ); | 1140 | int weeklabelwid = fm.width( "888" ); |
1141 | wid -= weeklabelwid; | 1141 | wid -= weeklabelwid; |
1142 | 1142 | ||
1143 | int colWid = wid / daysToShow; | 1143 | int colWid = wid / daysToShow; |
1144 | int lastCol = wid - ( colWid*6 ); | 1144 | int lastCol = wid - ( colWid*6 ); |
1145 | int dayLabelHei = mDayLabels[0]->sizeHint().height(); | 1145 | int dayLabelHei = mDayLabels[0]->sizeHint().height(); |
1146 | int cellHei = (hei - (5- daysToShow )*dayLabelHei) /(5- daysToShow ); | 1146 | int cellHei = (hei - (5- daysToShow )*dayLabelHei) /(5- daysToShow ); |
1147 | int colModulo = wid % daysToShow; | 1147 | int colModulo = wid % daysToShow; |
1148 | int rowModulo = (hei- (5- daysToShow )*dayLabelHei) % daysToShow-1; | 1148 | int rowModulo = (hei- (5- daysToShow )*dayLabelHei) % daysToShow-1; |
1149 | //qDebug("rowmod %d ", rowModulo); | 1149 | //qDebug("rowmod %d ", rowModulo); |
1150 | int i; | 1150 | int i; |
1151 | int x,y,w,h; | 1151 | int x,y,w,h; |
1152 | x= 0; | 1152 | x= 0; |
1153 | y= 0; | 1153 | y= 0; |
1154 | w = colWid; | 1154 | w = colWid; |
1155 | h = dayLabelHei ; | 1155 | h = dayLabelHei ; |
1156 | for ( i = 0; i < 7; i++) { | 1156 | for ( i = 0; i < 7; i++) { |
1157 | if ( i && !( i % daysToShow) && i < 6) { | 1157 | if ( i && !( i % daysToShow) && i < 6) { |
1158 | y += hei/(5-daysToShow); | 1158 | y += hei/(5-daysToShow); |
1159 | x = 0; | 1159 | x = 0; |
1160 | w = colWid; | 1160 | w = colWid; |
1161 | } | 1161 | } |
1162 | if ( i == daysToShow-colModulo ) | 1162 | if ( ((i) % daysToShow) >= daysToShow-colModulo ) { |
1163 | ++w; | 1163 | ++w; |
1164 | } | ||
1164 | if ( i >= 5 ) { | 1165 | if ( i >= 5 ) { |
1165 | mDayLabels[i]->setGeometry( x+weeklabelwid,y,w/2+1,h); | 1166 | mDayLabels[i]->setGeometry( x+weeklabelwid,y,w/2+w%2,h); |
1166 | x -= w/2 ; | 1167 | x -= (w/2 ); |
1167 | } | 1168 | } |
1168 | else | 1169 | else |
1169 | mDayLabels[i]->setGeometry( x+weeklabelwid,y,w,h); | 1170 | mDayLabels[i]->setGeometry( x+weeklabelwid,y,w,h); |
1170 | x += w; | 1171 | x += w; |
1171 | } | 1172 | } |
1172 | x= 0; | 1173 | x= 0; |
1173 | y= dayLabelHei; | 1174 | y= dayLabelHei; |
1174 | w = colWid; | 1175 | w = colWid; |
1175 | h = cellHei; | 1176 | h = cellHei; |
1176 | for ( i = 0; i < mCells.count(); ++i) { | 1177 | for ( i = 0; i < mCells.count(); ++i) { |
1177 | if ( i > 6 ) { | 1178 | if ( i > 6 ) { |
1178 | mCells[i]->hide(); | 1179 | mCells[i]->hide(); |
1179 | continue; | 1180 | continue; |
1180 | } | 1181 | } |
1181 | 1182 | ||
1182 | w = colWid; | 1183 | w = colWid; |
1183 | if ( ((i) % daysToShow) >= daysToShow-colModulo ) { | 1184 | if ( ((i) % daysToShow) >= daysToShow-colModulo ) { |
1184 | ++w; | 1185 | ++w; |
1185 | } | 1186 | } |
1186 | if ( i == (daysToShow-1-rowModulo)*7) | 1187 | if ( i == (daysToShow-1-rowModulo)*7) |
1187 | ++h; | 1188 | ++h; |
1188 | 1189 | ||
1189 | if ( i >= 5 ) { | 1190 | if ( i >= 5 ) { |
1190 | if ( i ==5 ) { | 1191 | if ( i ==5 ) { |
1191 | mCells[i]->setGeometry ( x+weeklabelwid,y,w,h/2 ); | 1192 | mCells[i]->setGeometry ( x+weeklabelwid,y,w,h/2 ); |
1192 | x -= w ;y += h/2; | 1193 | x -= w ;y += h/2; |
1193 | } else { | 1194 | } else { |
1195 | if ( ((i-1) % daysToShow) >= daysToShow-colModulo ) { | ||
1196 | ++w; | ||
1197 | } | ||
1194 | mCells[i]->setGeometry ( x+weeklabelwid,y,w,h-h/2 ); | 1198 | mCells[i]->setGeometry ( x+weeklabelwid,y,w,h-h/2 ); |
1195 | y -= h/2; | 1199 | y -= h/2; |
1196 | } | 1200 | } |
1197 | } else | 1201 | } else |
1198 | mCells[i]->setGeometry ( x+weeklabelwid,y,w,h ); | 1202 | mCells[i]->setGeometry ( x+weeklabelwid,y,w,h ); |
1199 | 1203 | ||
1200 | 1204 | ||
1201 | x += w; | 1205 | x += w; |
1202 | if ( x + w/2 > wid ) { | 1206 | if ( x + w/2 > wid ) { |
1203 | x = 0; | 1207 | x = 0; |
1204 | y += h+dayLabelHei ; | 1208 | y += h+dayLabelHei ; |
1205 | } | 1209 | } |
1206 | } | 1210 | } |
1207 | y= dayLabelHei; | 1211 | y= dayLabelHei; |
1208 | h = cellHei ; | 1212 | h = cellHei ; |
1209 | mWeekLabels[0]->setGeometry( 0,y,weeklabelwid,hei-dayLabelHei); | 1213 | mWeekLabels[0]->setGeometry( 0,y,weeklabelwid,hei-dayLabelHei); |
1210 | for ( i = 1; i < 6; i++) { | 1214 | for ( i = 1; i < 6; i++) { |
1211 | mWeekLabels[i]->hide(); | 1215 | mWeekLabels[i]->hide(); |
1212 | } | 1216 | } |
1213 | mWeekLabels[6]->setGeometry( 0,0,weeklabelwid,dayLabelHei); | 1217 | mWeekLabels[6]->setGeometry( 0,0,weeklabelwid,dayLabelHei); |
1214 | // qDebug("RRRRRRRRRRRRR %d %d old %d %d", e->size().width(),e->size().height() , e->oldSize().width(),e->oldSize().height()); | 1218 | // qDebug("RRRRRRRRRRRRR %d %d old %d %d", e->size().width(),e->size().height() , e->oldSize().width(),e->oldSize().height()); |
1215 | //qDebug("parent %d %d ", topLevelWidget()->size().width(), topLevelWidget()->size().height()); | 1219 | //qDebug("parent %d %d ", topLevelWidget()->size().width(), topLevelWidget()->size().height()); |
1216 | mShortDayLabels = mDayLabels[0]->width() < mWidthLongDayLabel ; | 1220 | mShortDayLabels = mDayLabels[0]->width() < mWidthLongDayLabel ; |
1217 | updateDayLabels(); | 1221 | updateDayLabels(); |
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp index 6afd203..8aa0697 100644 --- a/korganizer/koviewmanager.cpp +++ b/korganizer/koviewmanager.cpp | |||
@@ -101,53 +101,50 @@ void KOViewManager::readSettings(KConfig *config) | |||
101 | void KOViewManager::showDateView( int view, QDate date) | 101 | void KOViewManager::showDateView( int view, QDate date) |
102 | { | 102 | { |
103 | static int lastMode = 0; | 103 | static int lastMode = 0; |
104 | static int lastCount = 0; | 104 | static int lastCount = 0; |
105 | static bool lastNDMode = false; | 105 | static bool lastNDMode = false; |
106 | static QDate lastDate; | 106 | static QDate lastDate; |
107 | //qDebug("date %d %s", view, date.toString().latin1()); | 107 | //qDebug("date %d %s", view, date.toString().latin1()); |
108 | 108 | ||
109 | //qDebug("%d %d ", lastNDMode, mFlagShowNextxDays ); | 109 | //qDebug("%d %d ", lastNDMode, mFlagShowNextxDays ); |
110 | bool savemFlagShowNextxDays = mFlagShowNextxDays; | 110 | bool savemFlagShowNextxDays = mFlagShowNextxDays; |
111 | mFlagShowNextxDays = false; | 111 | mFlagShowNextxDays = false; |
112 | if ( view == 3 ) { | 112 | if ( view == 3 ) { |
113 | //mCurrentAgendaView = 1 ; | 113 | //mCurrentAgendaView = 1 ; |
114 | lastDate = mMainView->dateNavigator()->selectedDates().first(); | 114 | lastDate = mMainView->dateNavigator()->selectedDates().first(); |
115 | lastCount = mMainView->dateNavigator()->selectedDates().count(); | 115 | lastCount = mMainView->dateNavigator()->selectedDates().count(); |
116 | lastNDMode = savemFlagShowNextxDays; | 116 | lastNDMode = savemFlagShowNextxDays; |
117 | mMainView->showDay( date ); | 117 | mMainView->showDay( date ); |
118 | } else if (view == 4 ) { | 118 | } else if (view == 4 ) { |
119 | mCurrentAgendaView = 7 ; | 119 | mCurrentAgendaView = 7 ; |
120 | mMainView->dateNavigator()->selectDates( date, 7 ); | 120 | mMainView->dateNavigator()->selectDates( date, 7 ); |
121 | } else if (view == 5 ) { | 121 | } else if (view == 5 ) { |
122 | mCurrentAgendaView = 14 ; | 122 | mCurrentAgendaView = 14 ; |
123 | mMainView->dateNavigator()->selectDates( date, 14); | 123 | mMainView->dateNavigator()->selectDates( date, 14); |
124 | } else if (view == 6 ) { | 124 | } else if (view == 6 ) { |
125 | mMainView->dateNavigator()->blockSignals( true ); | 125 | mMainView->dateNavigator()->selectDates( date, 7 ); |
126 | showMonthView(); | 126 | showMonthView(); |
127 | mMainView->dateNavigator()->selectMonthByDate( date ); | ||
128 | mMainView->dateNavigator()->blockSignals( false ); | ||
129 | mMainView->dateNavigator()->selectDate( date ); | ||
130 | } else if (view == 7 ) { | 127 | } else if (view == 7 ) { |
131 | mMainView->dateNavigator()->selectDate( date ); | 128 | mMainView->dateNavigator()->selectDate( date ); |
132 | showJournalView(); | 129 | showJournalView(); |
133 | } else if (view == 8 ) { | 130 | } else if (view == 8 ) { |
134 | globalFlagBlockAgenda = 1; | 131 | globalFlagBlockAgenda = 1; |
135 | if ( mCurrentAgendaView != 3 ) | 132 | if ( mCurrentAgendaView != 3 ) |
136 | mCurrentAgendaView = -1; | 133 | mCurrentAgendaView = -1; |
137 | showAgendaView(KOPrefs::instance()->mFullViewMonth); | 134 | showAgendaView(KOPrefs::instance()->mFullViewMonth); |
138 | globalFlagBlockAgenda = 2; | 135 | globalFlagBlockAgenda = 2; |
139 | mMainView->dateNavigator()->selectDates( date , | 136 | mMainView->dateNavigator()->selectDates( date , |
140 | KOPrefs::instance()->mNextXDays ); | 137 | KOPrefs::instance()->mNextXDays ); |
141 | mFlagShowNextxDays = true; | 138 | mFlagShowNextxDays = true; |
142 | mCurrentAgendaView = 3 ; | 139 | mCurrentAgendaView = 3 ; |
143 | } if (view == 9) { // return behaviour, for getting back from mode == 3 (single day mode ) | 140 | } if (view == 9) { // return behaviour, for getting back from mode == 3 (single day mode ) |
144 | if ( lastMode ) { | 141 | if ( lastMode ) { |
145 | mCurrentAgendaView = lastCount ; | 142 | mCurrentAgendaView = lastCount ; |
146 | mMainView->dateNavigator()->selectDates( lastDate, lastCount); | 143 | mMainView->dateNavigator()->selectDates( lastDate, lastCount); |
147 | mFlagShowNextxDays = lastNDMode; | 144 | mFlagShowNextxDays = lastNDMode; |
148 | if ( mFlagShowNextxDays ) { | 145 | if ( mFlagShowNextxDays ) { |
149 | mCurrentAgendaView = 3 ; | 146 | mCurrentAgendaView = 3 ; |
150 | } | 147 | } |
151 | } else | 148 | } else |
152 | showWeekView(); | 149 | showWeekView(); |
153 | } else if (view == 10) { | 150 | } else if (view == 10) { |