author | zautrix <zautrix> | 2005-06-25 16:06:31 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-06-25 16:06:31 (UTC) |
commit | 3867528ada39bb50a18802c499fbc3f6fae26e8c (patch) (unidiff) | |
tree | 6b619b3bc6dea00e52648b4a394a61ab4ee8a072 /korganizer/koeditorgeneralevent.cpp | |
parent | 49d8fe456ce284a512227a7ca9d4d49688a39cd2 (diff) | |
download | kdepimpi-3867528ada39bb50a18802c499fbc3f6fae26e8c.zip kdepimpi-3867528ada39bb50a18802c499fbc3f6fae26e8c.tar.gz kdepimpi-3867528ada39bb50a18802c499fbc3f6fae26e8c.tar.bz2 |
fixxxxx
Diffstat (limited to 'korganizer/koeditorgeneralevent.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | korganizer/koeditorgeneralevent.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/korganizer/koeditorgeneralevent.cpp b/korganizer/koeditorgeneralevent.cpp index af97ee9..3dd7f5c 100644 --- a/korganizer/koeditorgeneralevent.cpp +++ b/korganizer/koeditorgeneralevent.cpp | |||
@@ -192,97 +192,97 @@ void KOEditorGeneralEvent::setDateTimes(QDateTime start, QDateTime end) | |||
192 | mCurrEndDateTime = end; | 192 | mCurrEndDateTime = end; |
193 | 193 | ||
194 | setDuration(); | 194 | setDuration(); |
195 | emitDateTimeStr(); | 195 | emitDateTimeStr(); |
196 | } | 196 | } |
197 | 197 | ||
198 | void KOEditorGeneralEvent::sTimeChanged(QTime ti) | 198 | void KOEditorGeneralEvent::sTimeChanged(QTime ti) |
199 | { | 199 | { |
200 | mStartTimeEdit->setTime( ti ); | 200 | mStartTimeEdit->setTime( ti ); |
201 | startTimeChanged ( ti); | 201 | startTimeChanged ( ti); |
202 | } | 202 | } |
203 | void KOEditorGeneralEvent::eTimeChanged(QTime ti ) | 203 | void KOEditorGeneralEvent::eTimeChanged(QTime ti ) |
204 | { | 204 | { |
205 | mEndTimeEdit->setTime( ti ); | 205 | mEndTimeEdit->setTime( ti ); |
206 | endTimeChanged( ti ); | 206 | endTimeChanged( ti ); |
207 | } | 207 | } |
208 | void KOEditorGeneralEvent::startTimeChanged(QTime newtime) | 208 | void KOEditorGeneralEvent::startTimeChanged(QTime newtime) |
209 | { | 209 | { |
210 | 210 | ||
211 | int secsep = mCurrStartDateTime.secsTo(mCurrEndDateTime); | 211 | int secsep = mCurrStartDateTime.secsTo(mCurrEndDateTime); |
212 | 212 | ||
213 | mCurrStartDateTime = QDateTime( mStartDateEdit->date(), QTime(newtime.hour(),newtime.minute(),0) ); | 213 | mCurrStartDateTime = QDateTime( mStartDateEdit->date(), QTime(newtime.hour(),newtime.minute(),0) ); |
214 | // adjust end time so that the event has the same duration as before. | 214 | // adjust end time so that the event has the same duration as before. |
215 | if( secsep > 0 ) | 215 | if( secsep > 0 ) |
216 | mCurrEndDateTime = mCurrStartDateTime.addSecs(secsep); | 216 | mCurrEndDateTime = mCurrStartDateTime.addSecs(secsep); |
217 | mEndTimeEdit->setTime(mCurrEndDateTime.time()); | 217 | mEndTimeEdit->setTime(mCurrEndDateTime.time()); |
218 | mEndDateEdit->setDate(mCurrEndDateTime.date()); | 218 | mEndDateEdit->setDate(mCurrEndDateTime.date()); |
219 | 219 | ||
220 | emit dateTimesChanged(mCurrStartDateTime,mCurrEndDateTime); | 220 | emit dateTimesChanged(mCurrStartDateTime,mCurrEndDateTime); |
221 | } | 221 | } |
222 | 222 | ||
223 | void KOEditorGeneralEvent::endTimeChanged(QTime newtime) | 223 | void KOEditorGeneralEvent::endTimeChanged(QTime newtime) |
224 | { | 224 | { |
225 | 225 | ||
226 | mCurrEndDateTime = QDateTime ( mEndDateEdit->date(), QTime(newtime.hour(),newtime.minute(),0)); | 226 | mCurrEndDateTime = QDateTime ( mEndDateEdit->date(), QTime(newtime.hour(),newtime.minute(),0)); |
227 | 227 | ||
228 | emit dateTimesChanged(mCurrStartDateTime,mCurrEndDateTime); | 228 | emit dateTimesChanged(mCurrStartDateTime,mCurrEndDateTime); |
229 | } | 229 | } |
230 | 230 | ||
231 | void KOEditorGeneralEvent::startDateChanged(QDate newdate) | 231 | void KOEditorGeneralEvent::startDateChanged(QDate newdate) |
232 | { | 232 | { |
233 | int daysep = mCurrStartDateTime.daysTo(mCurrEndDateTime); | 233 | int daysep = mCurrStartDateTime.daysTo(mCurrEndDateTime); |
234 | 234 | ||
235 | mCurrStartDateTime.setDate(newdate); | 235 | mCurrStartDateTime.setDate(newdate); |
236 | 236 | ||
237 | // adjust end date so that the event has the same duration as before | 237 | // adjust end date so that the event has the same duration as before |
238 | mCurrEndDateTime.setDate(mCurrStartDateTime.date().addDays(daysep)); | 238 | mCurrEndDateTime.setDate(mCurrStartDateTime.date().addDays(daysep)); |
239 | mEndDateEdit->setDate(mCurrEndDateTime.date()); | 239 | mEndDateEdit->setDate(mCurrEndDateTime.date()); |
240 | 240 | qDebug("KOEditorGeneralEvent::startDateChanged "); | |
241 | emit dateTimesChanged(mCurrStartDateTime,mCurrEndDateTime); | 241 | emit dateTimesChanged(mCurrStartDateTime,mCurrEndDateTime); |
242 | } | 242 | } |
243 | 243 | ||
244 | void KOEditorGeneralEvent::endDateChanged(QDate newdate) | 244 | void KOEditorGeneralEvent::endDateChanged(QDate newdate) |
245 | { | 245 | { |
246 | QDateTime newdt(newdate, mCurrEndDateTime.time()); | 246 | QDateTime newdt(newdate, mCurrEndDateTime.time()); |
247 | 247 | ||
248 | if(newdt < mCurrStartDateTime) { | 248 | if(newdt < mCurrStartDateTime) { |
249 | // oops, we can't let that happen. | 249 | // oops, we can't let that happen. |
250 | newdt = mCurrStartDateTime; | 250 | newdt = mCurrStartDateTime; |
251 | mEndDateEdit->setDate(newdt.date()); | 251 | mEndDateEdit->setDate(newdt.date()); |
252 | mEndTimeEdit->setTime(newdt.time()); | 252 | mEndTimeEdit->setTime(newdt.time()); |
253 | } | 253 | } |
254 | mCurrEndDateTime = newdt; | 254 | mCurrEndDateTime = newdt; |
255 | 255 | ||
256 | emit dateTimesChanged(mCurrStartDateTime,mCurrEndDateTime); | 256 | emit dateTimesChanged(mCurrStartDateTime,mCurrEndDateTime); |
257 | } | 257 | } |
258 | 258 | ||
259 | void KOEditorGeneralEvent::setDefaults(QDateTime from,QDateTime to,bool allDay) | 259 | void KOEditorGeneralEvent::setDefaults(QDateTime from,QDateTime to,bool allDay) |
260 | { | 260 | { |
261 | mSummaryEdit->load(KOLocationBox::SUMMARYEVENT); | 261 | mSummaryEdit->load(KOLocationBox::SUMMARYEVENT); |
262 | mLocationEdit->load(KOLocationBox::LOCATION); | 262 | mLocationEdit->load(KOLocationBox::LOCATION); |
263 | KOEditorGeneral::setDefaults(allDay); | 263 | KOEditorGeneral::setDefaults(allDay); |
264 | 264 | ||
265 | mNoTimeButton->setChecked(allDay); | 265 | mNoTimeButton->setChecked(allDay); |
266 | timeStuffDisable(allDay); | 266 | timeStuffDisable(allDay); |
267 | mFreeTimeCombo->setCurrentItem( 0 ); | 267 | mFreeTimeCombo->setCurrentItem( 0 ); |
268 | setDateTimes(from,to); | 268 | setDateTimes(from,to); |
269 | } | 269 | } |
270 | 270 | ||
271 | void KOEditorGeneralEvent::readEvent( Event *event, bool tmpl ) | 271 | void KOEditorGeneralEvent::readEvent( Event *event, bool tmpl ) |
272 | { | 272 | { |
273 | QString tmpStr; | 273 | QString tmpStr; |
274 | 274 | ||
275 | mTemplate = tmpl; | 275 | mTemplate = tmpl; |
276 | // the rest is for the events only | 276 | // the rest is for the events only |
277 | mNoTimeButton->setChecked(event->doesFloat()); | 277 | mNoTimeButton->setChecked(event->doesFloat()); |
278 | timeStuffDisable(event->doesFloat()); | 278 | timeStuffDisable(event->doesFloat()); |
279 | 279 | ||
280 | setDateTimes(event->dtStart(),event->dtEnd()); | 280 | setDateTimes(event->dtStart(),event->dtEnd()); |
281 | 281 | ||
282 | mTemplate = false; | 282 | mTemplate = false; |
283 | switch( event->transparency() ) { | 283 | switch( event->transparency() ) { |
284 | case Event::Transparent: | 284 | case Event::Transparent: |
285 | mFreeTimeCombo->setCurrentItem(1); | 285 | mFreeTimeCombo->setCurrentItem(1); |
286 | break; | 286 | break; |
287 | case Event::Opaque: | 287 | case Event::Opaque: |
288 | mFreeTimeCombo->setCurrentItem(0); | 288 | mFreeTimeCombo->setCurrentItem(0); |