Diffstat (limited to 'korganizer/koeditorgeneral.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | korganizer/koeditorgeneral.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/korganizer/koeditorgeneral.cpp b/korganizer/koeditorgeneral.cpp index cf0d4ae..92fcd1c 100644 --- a/korganizer/koeditorgeneral.cpp +++ b/korganizer/koeditorgeneral.cpp | |||
@@ -341,97 +341,99 @@ void KOEditorGeneral::alarmDisable(bool disable) | |||
341 | mAlarmProgramButton->setEnabled(false); | 341 | mAlarmProgramButton->setEnabled(false); |
342 | mAlarmIncrCombo->setEnabled(false); | 342 | mAlarmIncrCombo->setEnabled(false); |
343 | } | 343 | } |
344 | } | 344 | } |
345 | 345 | ||
346 | void KOEditorGeneral::setCategories(const QString &str) | 346 | void KOEditorGeneral::setCategories(const QString &str) |
347 | { | 347 | { |
348 | mCategoriesLabel->setText(str); | 348 | mCategoriesLabel->setText(str); |
349 | } | 349 | } |
350 | 350 | ||
351 | void KOEditorGeneral::setDefaults(bool allDay) | 351 | void KOEditorGeneral::setDefaults(bool allDay) |
352 | { | 352 | { |
353 | #if 0 | 353 | #if 0 |
354 | mOwnerLabel->setText(i18n("Owner: ") + KOPrefs::instance()->fullName()); | 354 | mOwnerLabel->setText(i18n("Owner: ") + KOPrefs::instance()->fullName()); |
355 | #endif | 355 | #endif |
356 | 356 | ||
357 | mAlarmMessage = i18n("Edit new item"); | 357 | mAlarmMessage = i18n("Edit new item"); |
358 | enableAlarmEdit( !allDay ); | 358 | enableAlarmEdit( !allDay ); |
359 | 359 | ||
360 | // TODO: Implement a KPrefsComboItem to solve this in a clean way. | 360 | // TODO: Implement a KPrefsComboItem to solve this in a clean way. |
361 | int alarmTime; | 361 | int alarmTime; |
362 | int a[] = { 1,5,10,15,30,60,180, 1440 }; | 362 | int a[] = { 1,5,10,15,30,60,180, 1440 }; |
363 | int index = KOPrefs::instance()->mAlarmTime; | 363 | int index = KOPrefs::instance()->mAlarmTime; |
364 | if (index < 0 || index > 7) { | 364 | if (index < 0 || index > 7) { |
365 | alarmTime = 15; | 365 | alarmTime = 15; |
366 | } else { | 366 | } else { |
367 | alarmTime = a[index]; | 367 | alarmTime = a[index]; |
368 | } | 368 | } |
369 | mAlarmButton ->setChecked( false ); | 369 | mAlarmButton ->setChecked( false ); |
370 | mAlarmTimeEdit->setValue(alarmTime); | 370 | mAlarmTimeEdit->setValue(alarmTime); |
371 | mAlarmIncrCombo->setCurrentItem(0); | 371 | mAlarmIncrCombo->setCurrentItem(0); |
372 | enableAlarmEdit( false ); | 372 | enableAlarmEdit( false ); |
373 | //alarmDisable (false); | 373 | //alarmDisable (false); |
374 | mSecrecyCombo->setCurrentItem(Incidence::SecrecyPublic); | 374 | mSecrecyCombo->setCurrentItem(Incidence::SecrecyPublic); |
375 | mCancelBox->setChecked( false ); | 375 | mCancelBox->setChecked( false ); |
376 | mSummaryEdit->setEditText(""); | 376 | mSummaryEdit->setEditText(""); |
377 | mLocationEdit->setEditText(""); | 377 | mLocationEdit->setEditText(""); |
378 | mDescriptionEdit->setText(""); | 378 | mDescriptionEdit->setText(""); |
379 | mAlarmSound = KOPrefs::instance()->mDefaultAlarmFile; | 379 | mAlarmSound = KOPrefs::instance()->mDefaultAlarmFile; |
380 | setCategories(""); | 380 | setCategories(""); |
381 | } | 381 | } |
382 | void KOEditorGeneral::setSecrecy( int num ) | 382 | void KOEditorGeneral::setSecrecy( int num ) |
383 | { | 383 | { |
384 | mSecrecyCombo->setCurrentItem(num); | 384 | mSecrecyCombo->setCurrentItem(num); |
385 | } | 385 | } |
386 | void KOEditorGeneral::readIncidence(Incidence *event) | 386 | void KOEditorGeneral::readIncidence(Incidence *event) |
387 | { | 387 | { |
388 | 388 | ||
389 | mAlarmMessage = event->summary(); | 389 | mAlarmMessage = event->summary(); |
390 | if ( ! event->location().isEmpty() ) | ||
391 | mAlarmMessage += " ("+event->location()+")"; | ||
390 | mAlarmIncrCombo->setCurrentItem(0); | 392 | mAlarmIncrCombo->setCurrentItem(0); |
391 | mSummaryEdit->setEditText(event->summary()); | 393 | mSummaryEdit->setEditText(event->summary()); |
392 | mLocationEdit->setEditText(event->location()); | 394 | mLocationEdit->setEditText(event->location()); |
393 | mDescriptionEdit->setText(event->description()); | 395 | mDescriptionEdit->setText(event->description()); |
394 | 396 | ||
395 | #if 0 | 397 | #if 0 |
396 | // organizer information | 398 | // organizer information |
397 | mOwnerLabel->setText(i18n("Owner: ") + event->organizer()); | 399 | mOwnerLabel->setText(i18n("Owner: ") + event->organizer()); |
398 | #endif | 400 | #endif |
399 | 401 | ||
400 | enableAlarmEdit( event->isAlarmEnabled() ); | 402 | enableAlarmEdit( event->isAlarmEnabled() ); |
401 | //qDebug("KOEditorGeneral::readIncidence(Incidence *event) "); | 403 | //qDebug("KOEditorGeneral::readIncidence(Incidence *event) "); |
402 | if(!event->isAlarmEnabled()) { | 404 | if(!event->isAlarmEnabled()) { |
403 | // TODO: Implement a KPrefsComboItem to solve this in a clean way. | 405 | // TODO: Implement a KPrefsComboItem to solve this in a clean way. |
404 | int alarmTime; | 406 | int alarmTime; |
405 | int a[] = { 1,5,10,15,30,60,180, 1440 }; | 407 | int a[] = { 1,5,10,15,30,60,180, 1440 }; |
406 | int index = KOPrefs::instance()->mAlarmTime; | 408 | int index = KOPrefs::instance()->mAlarmTime; |
407 | if (index < 0 || index > 7) { | 409 | if (index < 0 || index > 7) { |
408 | alarmTime = 15; | 410 | alarmTime = 15; |
409 | } else { | 411 | } else { |
410 | alarmTime = a[index]; | 412 | alarmTime = a[index]; |
411 | } | 413 | } |
412 | mAlarmTimeEdit->setValue(alarmTime); | 414 | mAlarmTimeEdit->setValue(alarmTime); |
413 | } | 415 | } |
414 | mAlarmButton->setChecked( event->isAlarmEnabled() ); | 416 | mAlarmButton->setChecked( event->isAlarmEnabled() ); |
415 | mSecrecyCombo->setCurrentItem(event->secrecy()); | 417 | mSecrecyCombo->setCurrentItem(event->secrecy()); |
416 | mCancelBox->setChecked( event->cancelled() ); | 418 | mCancelBox->setChecked( event->cancelled() ); |
417 | mAlarmProgramButton->setOn(false); | 419 | mAlarmProgramButton->setOn(false); |
418 | mAlarmSoundButton->setOn(false); | 420 | mAlarmSoundButton->setOn(false); |
419 | 421 | ||
420 | // set up alarm stuff | 422 | // set up alarm stuff |
421 | QPtrList<Alarm> alarms = event->alarms(); | 423 | QPtrList<Alarm> alarms = event->alarms(); |
422 | Alarm* alarm; | 424 | Alarm* alarm; |
423 | mAlarmIncrCombo->setCurrentItem(0); | 425 | mAlarmIncrCombo->setCurrentItem(0); |
424 | for ( alarm = alarms.first(); alarm; alarm = alarms.next() ) { | 426 | for ( alarm = alarms.first(); alarm; alarm = alarms.next() ) { |
425 | int offset; | 427 | int offset; |
426 | if ( alarm->hasTime() ) { | 428 | if ( alarm->hasTime() ) { |
427 | QDateTime t = alarm->time(); | 429 | QDateTime t = alarm->time(); |
428 | offset = event->dtStart().secsTo( t ); | 430 | offset = event->dtStart().secsTo( t ); |
429 | } else { | 431 | } else { |
430 | offset = alarm->startOffset().asSeconds(); | 432 | offset = alarm->startOffset().asSeconds(); |
431 | } | 433 | } |
432 | if ( offset != 0 ) { | 434 | if ( offset != 0 ) { |
433 | offset = offset / -60; // make minutes | 435 | offset = offset / -60; // make minutes |
434 | if (offset % 60 == 0) { // divides evenly into hours? | 436 | if (offset % 60 == 0) { // divides evenly into hours? |
435 | offset = offset / 60; | 437 | offset = offset / 60; |
436 | mAlarmIncrCombo->setCurrentItem(1); | 438 | mAlarmIncrCombo->setCurrentItem(1); |
437 | if (offset % 24 == 0) { // divides evenly into days? | 439 | if (offset % 24 == 0) { // divides evenly into days? |