author | zautrix <zautrix> | 2005-03-25 00:08:08 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-03-25 00:08:08 (UTC) |
commit | 7c2e130ddd194f1c4b5365af6999a27c08232f4b (patch) (unidiff) | |
tree | 75665681327ee49d7650f4d840b5c8c772180fb4 /korganizer | |
parent | 5cf054b82738d65f9b0a34ccb51c993ee4a0189f (diff) | |
download | kdepimpi-7c2e130ddd194f1c4b5365af6999a27c08232f4b.zip kdepimpi-7c2e130ddd194f1c4b5365af6999a27c08232f4b.tar.gz kdepimpi-7c2e130ddd194f1c4b5365af6999a27c08232f4b.tar.bz2 |
fixes
-rw-r--r-- | korganizer/koagenda.cpp | 3 | ||||
-rw-r--r-- | korganizer/koeditorgeneral.cpp | 15 | ||||
-rw-r--r-- | korganizer/koeditorgeneral.h | 1 |
3 files changed, 15 insertions, 4 deletions
diff --git a/korganizer/koagenda.cpp b/korganizer/koagenda.cpp index 5420822..2820ca2 100644 --- a/korganizer/koagenda.cpp +++ b/korganizer/koagenda.cpp | |||
@@ -527,48 +527,51 @@ bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me) | |||
527 | dY = -dY; | 527 | dY = -dY; |
528 | //qDebug("%d %d %d ", dX, dY , blockmoveDist ); | 528 | //qDebug("%d %d %d ", dX, dY , blockmoveDist ); |
529 | if ( dX > blockmoveDist || dY > blockmoveDist ) { | 529 | if ( dX > blockmoveDist || dY > blockmoveDist ) { |
530 | blockMoving = false; | 530 | blockMoving = false; |
531 | } | 531 | } |
532 | } | 532 | } |
533 | if (object != viewport()) { | 533 | if (object != viewport()) { |
534 | KOAgendaItem *moveItem = (KOAgendaItem *)object; | 534 | KOAgendaItem *moveItem = (KOAgendaItem *)object; |
535 | if (!moveItem->incidence()->isReadOnly() ) { | 535 | if (!moveItem->incidence()->isReadOnly() ) { |
536 | if (!mActionItem) | 536 | if (!mActionItem) |
537 | setNoActionCursor(moveItem,viewportPos); | 537 | setNoActionCursor(moveItem,viewportPos); |
538 | else { | 538 | else { |
539 | if ( !blockMoving ) | 539 | if ( !blockMoving ) |
540 | performItemAction(viewportPos); | 540 | performItemAction(viewportPos); |
541 | } | 541 | } |
542 | } | 542 | } |
543 | } else { // ---------- viewport() | 543 | } else { // ---------- viewport() |
544 | if ( mActionType == SELECT ) { | 544 | if ( mActionType == SELECT ) { |
545 | performSelectAction( viewportPos ); | 545 | performSelectAction( viewportPos ); |
546 | } | 546 | } |
547 | } | 547 | } |
548 | break; | 548 | break; |
549 | 549 | ||
550 | case QEvent::MouseButtonDblClick: | 550 | case QEvent::MouseButtonDblClick: |
551 | blockMoving = false; | ||
552 | leftMouseDown = false; | ||
553 | rightMouseDown = false; | ||
551 | if (object == viewport()) { | 554 | if (object == viewport()) { |
552 | selectItem(0); | 555 | selectItem(0); |
553 | int x,y; | 556 | int x,y; |
554 | viewportToContents(viewportPos.x(),viewportPos.y(),x,y); | 557 | viewportToContents(viewportPos.x(),viewportPos.y(),x,y); |
555 | int gx,gy; | 558 | int gx,gy; |
556 | contentsToGrid(x,y,gx,gy); | 559 | contentsToGrid(x,y,gx,gy); |
557 | emit newEventSignal(gx,gy); | 560 | emit newEventSignal(gx,gy); |
558 | } else { | 561 | } else { |
559 | KOAgendaItem *doubleClickedItem = (KOAgendaItem *)object; | 562 | KOAgendaItem *doubleClickedItem = (KOAgendaItem *)object; |
560 | selectItem(doubleClickedItem); | 563 | selectItem(doubleClickedItem); |
561 | if ( KOPrefs::instance()->mEditOnDoubleClick ) | 564 | if ( KOPrefs::instance()->mEditOnDoubleClick ) |
562 | emit editIncidenceSignal(doubleClickedItem->incidence()); | 565 | emit editIncidenceSignal(doubleClickedItem->incidence()); |
563 | else | 566 | else |
564 | emit showIncidenceSignal(doubleClickedItem->incidence()); | 567 | emit showIncidenceSignal(doubleClickedItem->incidence()); |
565 | } | 568 | } |
566 | break; | 569 | break; |
567 | 570 | ||
568 | default: | 571 | default: |
569 | break; | 572 | break; |
570 | } | 573 | } |
571 | return true; | 574 | return true; |
572 | } | 575 | } |
573 | 576 | ||
574 | void KOAgenda::newItem( int item ) | 577 | void KOAgenda::newItem( int item ) |
diff --git a/korganizer/koeditorgeneral.cpp b/korganizer/koeditorgeneral.cpp index 496f125..4ee5292 100644 --- a/korganizer/koeditorgeneral.cpp +++ b/korganizer/koeditorgeneral.cpp | |||
@@ -204,217 +204,224 @@ void KOEditorGeneral::initAlarm(QWidget *parent,QBoxLayout *topLayout) | |||
204 | mAlarmSoundButton = new QPushButton(parent); | 204 | mAlarmSoundButton = new QPushButton(parent); |
205 | mAlarmSoundButton->setPixmap(SmallIcon("playsound")); | 205 | mAlarmSoundButton->setPixmap(SmallIcon("playsound")); |
206 | mAlarmSoundButton->setToggleButton(true); | 206 | mAlarmSoundButton->setToggleButton(true); |
207 | QToolTip::add(mAlarmSoundButton, i18n("No sound set")); | 207 | QToolTip::add(mAlarmSoundButton, i18n("No sound set")); |
208 | connect(mAlarmSoundButton, SIGNAL(clicked()), SLOT(pickAlarmSound())); | 208 | connect(mAlarmSoundButton, SIGNAL(clicked()), SLOT(pickAlarmSound())); |
209 | alarmLayout->addWidget(mAlarmSoundButton); | 209 | alarmLayout->addWidget(mAlarmSoundButton); |
210 | 210 | ||
211 | mAlarmProgramButton = new QPushButton(parent); | 211 | mAlarmProgramButton = new QPushButton(parent); |
212 | mAlarmProgramButton->setPixmap(SmallIcon("run")); | 212 | mAlarmProgramButton->setPixmap(SmallIcon("run")); |
213 | mAlarmProgramButton->setToggleButton(true); | 213 | mAlarmProgramButton->setToggleButton(true); |
214 | QToolTip::add(mAlarmProgramButton, i18n("No program set")); | 214 | QToolTip::add(mAlarmProgramButton, i18n("No program set")); |
215 | connect(mAlarmProgramButton, SIGNAL(clicked()), SLOT(pickAlarmProgram())); | 215 | connect(mAlarmProgramButton, SIGNAL(clicked()), SLOT(pickAlarmProgram())); |
216 | alarmLayout->addWidget(mAlarmProgramButton); | 216 | alarmLayout->addWidget(mAlarmProgramButton); |
217 | mAlarmSoundButton->setMaximumWidth( mAlarmSoundButton->sizeHint().width() + 4 ); | 217 | mAlarmSoundButton->setMaximumWidth( mAlarmSoundButton->sizeHint().width() + 4 ); |
218 | mAlarmProgramButton->setMaximumWidth(mAlarmProgramButton->sizeHint().width() + 4 ); | 218 | mAlarmProgramButton->setMaximumWidth(mAlarmProgramButton->sizeHint().width() + 4 ); |
219 | // if ( KOPrefs::instance()->mCompactDialogs ) { | 219 | // if ( KOPrefs::instance()->mCompactDialogs ) { |
220 | // mAlarmSoundButton->hide(); | 220 | // mAlarmSoundButton->hide(); |
221 | // mAlarmProgramButton->hide(); | 221 | // mAlarmProgramButton->hide(); |
222 | // } | 222 | // } |
223 | } | 223 | } |
224 | 224 | ||
225 | void KOEditorGeneral::pickAlarmSound() | 225 | void KOEditorGeneral::pickAlarmSound() |
226 | { | 226 | { |
227 | 227 | ||
228 | qDebug("KOEditorGeneral::pickAlarmSound() %d",mAlarmSoundButton->isOn() ); | ||
228 | //QString prefix = mAlarmSound; | 229 | //QString prefix = mAlarmSound; |
229 | if (!mAlarmSoundButton->isOn()) { | 230 | if (!mAlarmSoundButton->isOn()) { |
230 | //mAlarmSound = ""; | 231 | //mAlarmSound = ""; |
231 | QToolTip::remove(mAlarmSoundButton); | 232 | QToolTip::remove(mAlarmSoundButton); |
232 | QToolTip::add(mAlarmSoundButton, i18n("No sound set")); | 233 | QToolTip::add(mAlarmSoundButton, i18n("No sound set")); |
233 | mAlarmProgramButton->setOn(true); | 234 | mAlarmProgramButton->setOn(true); |
234 | mAlarmSoundButton->setOn(false); | 235 | mAlarmSoundButton->setOn(false); |
236 | pickAlarmProgram(); | ||
235 | } else { | 237 | } else { |
236 | QString fileName(KFileDialog::getOpenFileName(mAlarmSound, | 238 | QString fileName(KFileDialog::getOpenFileName(mAlarmSound, |
237 | i18n("*.wav|Wav Files"), 0)); | 239 | i18n("*.wav|Wav Files"), 0)); |
238 | if (!fileName.isEmpty()) { | 240 | if (!fileName.isEmpty()) { |
239 | mAlarmSound = fileName; | 241 | mAlarmSound = fileName; |
240 | QToolTip::remove(mAlarmSoundButton); | 242 | QToolTip::remove(mAlarmSoundButton); |
241 | QString dispStr = i18n("Playing '%1'").arg(fileName); | 243 | QString dispStr = i18n("Playing '%1'").arg(fileName); |
242 | QToolTip::add(mAlarmSoundButton, dispStr); | 244 | QToolTip::add(mAlarmSoundButton, dispStr); |
243 | mAlarmProgramButton->setOn(false); | 245 | mAlarmProgramButton->setOn(false); |
244 | mAlarmSoundButton->setOn(true); | 246 | mAlarmSoundButton->setOn(true); |
245 | } else { | 247 | } else { |
246 | mAlarmProgramButton->setOn(true); | 248 | mAlarmProgramButton->setOn(true); |
247 | mAlarmSoundButton->setOn(false); | 249 | mAlarmSoundButton->setOn(false); |
248 | 250 | ||
249 | } | 251 | } |
250 | } | 252 | } |
251 | 253 | ||
252 | if (mAlarmProgramButton->isOn()) | 254 | if (mAlarmProgramButton->isOn()) |
253 | ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + getFittingPath(mAlarmProgram) ); | 255 | ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + getFittingPath(mAlarmProgram) ); |
254 | if ( mAlarmSoundButton->isOn()) | 256 | if ( mAlarmSoundButton->isOn()) |
255 | ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Audio.Al.: ") + getFittingPath(mAlarmSound) ); | 257 | ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Audio Al.: ") + getFittingPath(mAlarmSound) ); |
256 | } | 258 | } |
257 | 259 | ||
258 | void KOEditorGeneral::pickAlarmProgram() | 260 | void KOEditorGeneral::pickAlarmProgram() |
259 | { | 261 | { |
260 | if (!mAlarmProgramButton->isOn()) { | 262 | if (!mAlarmProgramButton->isOn()) { |
261 | //mAlarmProgram = ""; | 263 | //mAlarmProgram = ""; |
262 | QToolTip::remove(mAlarmProgramButton); | 264 | QToolTip::remove(mAlarmProgramButton); |
263 | QToolTip::add(mAlarmProgramButton, i18n("No program set")); | 265 | QToolTip::add(mAlarmProgramButton, i18n("No program set")); |
264 | mAlarmProgramButton->setOn(false); | 266 | mAlarmProgramButton->setOn(false); |
265 | mAlarmSoundButton->setOn(true); | 267 | mAlarmSoundButton->setOn(true); |
268 | pickAlarmSound(); | ||
266 | } else { | 269 | } else { |
267 | QString fileName(KFileDialog::getOpenFileName(mAlarmProgram,i18n("Procedure Alarm.: ") , 0)); | 270 | QString fileName(KFileDialog::getOpenFileName(mAlarmProgram,i18n("Procedure Alarm: ") , 0)); |
268 | if (!fileName.isEmpty()) { | 271 | if (!fileName.isEmpty()) { |
269 | mAlarmProgram = fileName; | 272 | mAlarmProgram = fileName; |
270 | QToolTip::remove(mAlarmProgramButton); | 273 | QToolTip::remove(mAlarmProgramButton); |
271 | QString dispStr = i18n("Running '%1'").arg(fileName); | 274 | QString dispStr = i18n("Running '%1'").arg(fileName); |
272 | QToolTip::add(mAlarmProgramButton, dispStr); | 275 | QToolTip::add(mAlarmProgramButton, dispStr); |
273 | mAlarmSoundButton->setOn(false); | 276 | mAlarmSoundButton->setOn(false); |
274 | mAlarmProgramButton->setOn(true); | 277 | mAlarmProgramButton->setOn(true); |
275 | } else { | 278 | } else { |
276 | mAlarmProgramButton->setOn(false); | 279 | mAlarmProgramButton->setOn(false); |
277 | mAlarmSoundButton->setOn(true); | 280 | mAlarmSoundButton->setOn(true); |
278 | } | 281 | } |
279 | } | 282 | } |
280 | if (mAlarmProgramButton->isOn()) | 283 | if (mAlarmProgramButton->isOn()) |
281 | ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + getFittingPath(mAlarmProgram) ); | 284 | ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + getFittingPath(mAlarmProgram) ); |
282 | if ( mAlarmSoundButton->isOn()) | 285 | if ( mAlarmSoundButton->isOn()) |
283 | ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Sound.Al.: ") + getFittingPath(mAlarmSound) ); | 286 | ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Audio Al.: ") + getFittingPath(mAlarmSound) ); |
284 | } | 287 | } |
285 | 288 | ||
286 | 289 | ||
287 | QString KOEditorGeneral::getFittingPath( const QString s ) | 290 | QString KOEditorGeneral::getFittingPath( const QString s ) |
288 | { | 291 | { |
289 | int maxlen = 50; | 292 | int maxlen = 50; |
290 | if ( QApplication::desktop()->width() < 640 ) { | 293 | if ( QApplication::desktop()->width() < 640 ) { |
291 | if ( QApplication::desktop()->width() < 320 ) | 294 | if ( QApplication::desktop()->width() < 320 ) |
292 | maxlen = 22; | 295 | maxlen = 22; |
293 | else | 296 | else |
294 | maxlen = 35; | 297 | maxlen = 35; |
295 | } | 298 | } |
296 | if ( s.length() > maxlen ) { | 299 | if ( s.length() > maxlen ) { |
297 | return "..."+s.right(maxlen -3); | 300 | return "..."+s.right(maxlen -3); |
298 | } | 301 | } |
299 | return s; | 302 | return s; |
300 | } | 303 | } |
301 | 304 | ||
302 | void KOEditorGeneral::enableAlarmEdit(bool enable) | 305 | void KOEditorGeneral::enableAlarmEdit(bool enable) |
303 | { | 306 | { |
304 | if ( enable ) { | 307 | if ( enable ) { |
305 | if (!mAlarmProgramButton->isOn() && !mAlarmSoundButton->isOn()) { | 308 | if (!mAlarmProgramButton->isOn() && !mAlarmSoundButton->isOn()) { |
306 | mAlarmSoundButton->setOn( true ); | 309 | mAlarmSoundButton->setOn( true ); |
307 | if ( mAlarmSound.isEmpty() ) | 310 | if ( mAlarmSound.isEmpty() ) |
308 | mAlarmSound = KOPrefs::instance()->mDefaultAlarmFile; | 311 | mAlarmSound = KOPrefs::instance()->mDefaultAlarmFile; |
309 | else { | 312 | else { |
310 | if ( ! QFile::exists( mAlarmSound ) ) | 313 | if ( ! QFile::exists( mAlarmSound ) ) |
311 | mAlarmSound = KOPrefs::instance()->mDefaultAlarmFile; | 314 | mAlarmSound = KOPrefs::instance()->mDefaultAlarmFile; |
312 | } | 315 | } |
313 | } | 316 | } |
314 | if (mAlarmProgramButton->isOn()) | 317 | if (mAlarmProgramButton->isOn()) |
315 | ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + getFittingPath(mAlarmProgram) ); | 318 | ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + getFittingPath(mAlarmProgram) ); |
316 | if (!mAlarmSound.isEmpty() && mAlarmSoundButton->isOn()) | 319 | if (!mAlarmSound.isEmpty() && mAlarmSoundButton->isOn()) |
317 | ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Audio Al.: ") + getFittingPath(mAlarmSound) ); | 320 | ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Audio Al.: ") + getFittingPath(mAlarmSound) ); |
318 | } | 321 | } |
319 | else { | 322 | else { |
320 | ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Alarm disabled for this item")); | 323 | ((QWidget*)parent())->topLevelWidget()->setCaption(mAlarmMessage); |
324 | //((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Edit item: ") + mSummaryEdit->currentText()); | ||
325 | |||
321 | 326 | ||
322 | } | 327 | } |
323 | mAlarmTimeEdit->setEnabled(enable); | 328 | mAlarmTimeEdit->setEnabled(enable); |
324 | mAlarmSoundButton->setEnabled(enable); | 329 | mAlarmSoundButton->setEnabled(enable); |
325 | mAlarmProgramButton->setEnabled(enable); | 330 | mAlarmProgramButton->setEnabled(enable); |
326 | mAlarmIncrCombo->setEnabled(enable); | 331 | mAlarmIncrCombo->setEnabled(enable); |
327 | } | 332 | } |
328 | 333 | ||
329 | void KOEditorGeneral::disableAlarmEdit(bool disable) | 334 | void KOEditorGeneral::disableAlarmEdit(bool disable) |
330 | { | 335 | { |
331 | enableAlarmEdit( !disable ); | 336 | enableAlarmEdit( !disable ); |
332 | } | 337 | } |
333 | 338 | ||
334 | void KOEditorGeneral::enableAlarm( bool enable ) | 339 | void KOEditorGeneral::enableAlarm( bool enable ) |
335 | { | 340 | { |
336 | enableAlarmEdit( enable ); | 341 | enableAlarmEdit( enable ); |
337 | } | 342 | } |
338 | 343 | ||
339 | void KOEditorGeneral::alarmDisable(bool disable) | 344 | void KOEditorGeneral::alarmDisable(bool disable) |
340 | { | 345 | { |
341 | if (!disable) { | 346 | if (!disable) { |
342 | //mAlarmBell->setEnabled(true); | 347 | //mAlarmBell->setEnabled(true); |
343 | mAlarmButton->setEnabled(true); | 348 | mAlarmButton->setEnabled(true); |
344 | } else { | 349 | } else { |
345 | //mAlarmBell->setEnabled(false); | 350 | //mAlarmBell->setEnabled(false); |
346 | mAlarmButton->setEnabled(false); | 351 | mAlarmButton->setEnabled(false); |
347 | mAlarmButton->setChecked(false); | 352 | mAlarmButton->setChecked(false); |
348 | mAlarmTimeEdit->setEnabled(false); | 353 | mAlarmTimeEdit->setEnabled(false); |
349 | mAlarmSoundButton->setEnabled(false); | 354 | mAlarmSoundButton->setEnabled(false); |
350 | mAlarmProgramButton->setEnabled(false); | 355 | mAlarmProgramButton->setEnabled(false); |
351 | mAlarmIncrCombo->setEnabled(false); | 356 | mAlarmIncrCombo->setEnabled(false); |
352 | } | 357 | } |
353 | } | 358 | } |
354 | 359 | ||
355 | void KOEditorGeneral::setCategories(const QString &str) | 360 | void KOEditorGeneral::setCategories(const QString &str) |
356 | { | 361 | { |
357 | mCategoriesLabel->setText(str); | 362 | mCategoriesLabel->setText(str); |
358 | } | 363 | } |
359 | 364 | ||
360 | void KOEditorGeneral::setDefaults(bool allDay) | 365 | void KOEditorGeneral::setDefaults(bool allDay) |
361 | { | 366 | { |
362 | #if 0 | 367 | #if 0 |
363 | mOwnerLabel->setText(i18n("Owner: ") + KOPrefs::instance()->fullName()); | 368 | mOwnerLabel->setText(i18n("Owner: ") + KOPrefs::instance()->fullName()); |
364 | #endif | 369 | #endif |
365 | 370 | ||
371 | mAlarmMessage = i18n("Edit new item"); | ||
366 | enableAlarmEdit( !allDay ); | 372 | enableAlarmEdit( !allDay ); |
367 | 373 | ||
368 | // TODO: Implement a KPrefsComboItem to solve this in a clean way. | 374 | // TODO: Implement a KPrefsComboItem to solve this in a clean way. |
369 | int alarmTime; | 375 | int alarmTime; |
370 | int a[] = { 1,5,10,15,30,60,180, 1440 }; | 376 | int a[] = { 1,5,10,15,30,60,180, 1440 }; |
371 | int index = KOPrefs::instance()->mAlarmTime; | 377 | int index = KOPrefs::instance()->mAlarmTime; |
372 | if (index < 0 || index > 7) { | 378 | if (index < 0 || index > 7) { |
373 | alarmTime = 15; | 379 | alarmTime = 15; |
374 | } else { | 380 | } else { |
375 | alarmTime = a[index]; | 381 | alarmTime = a[index]; |
376 | } | 382 | } |
377 | mAlarmButton ->setChecked( false ); | 383 | mAlarmButton ->setChecked( false ); |
378 | mAlarmTimeEdit->setValue(alarmTime); | 384 | mAlarmTimeEdit->setValue(alarmTime); |
379 | mAlarmIncrCombo->setCurrentItem(0); | 385 | mAlarmIncrCombo->setCurrentItem(0); |
380 | enableAlarmEdit( false ); | 386 | enableAlarmEdit( false ); |
381 | //alarmDisable (false); | 387 | //alarmDisable (false); |
382 | mSecrecyCombo->setCurrentItem(Incidence::SecrecyPublic); | 388 | mSecrecyCombo->setCurrentItem(Incidence::SecrecyPublic); |
383 | mCancelBox->setChecked( false ); | 389 | mCancelBox->setChecked( false ); |
384 | mSummaryEdit->setEditText(""); | 390 | mSummaryEdit->setEditText(""); |
385 | mLocationEdit->setEditText(""); | 391 | mLocationEdit->setEditText(""); |
386 | mDescriptionEdit->setText(""); | 392 | mDescriptionEdit->setText(""); |
387 | mAlarmSound = KOPrefs::instance()->mDefaultAlarmFile; | 393 | mAlarmSound = KOPrefs::instance()->mDefaultAlarmFile; |
388 | setCategories(""); | 394 | setCategories(""); |
389 | } | 395 | } |
390 | void KOEditorGeneral::setSecrecy( int num ) | 396 | void KOEditorGeneral::setSecrecy( int num ) |
391 | { | 397 | { |
392 | mSecrecyCombo->setCurrentItem(num); | 398 | mSecrecyCombo->setCurrentItem(num); |
393 | } | 399 | } |
394 | void KOEditorGeneral::readIncidence(Incidence *event) | 400 | void KOEditorGeneral::readIncidence(Incidence *event) |
395 | { | 401 | { |
396 | 402 | ||
403 | mAlarmMessage = i18n("Edit") +" "+event->summary(); | ||
397 | mAlarmIncrCombo->setCurrentItem(0); | 404 | mAlarmIncrCombo->setCurrentItem(0); |
398 | mSummaryEdit->setEditText(event->summary()); | 405 | mSummaryEdit->setEditText(event->summary()); |
399 | mLocationEdit->setEditText(event->location()); | 406 | mLocationEdit->setEditText(event->location()); |
400 | mDescriptionEdit->setText(event->description()); | 407 | mDescriptionEdit->setText(event->description()); |
401 | 408 | ||
402 | #if 0 | 409 | #if 0 |
403 | // organizer information | 410 | // organizer information |
404 | mOwnerLabel->setText(i18n("Owner: ") + event->organizer()); | 411 | mOwnerLabel->setText(i18n("Owner: ") + event->organizer()); |
405 | #endif | 412 | #endif |
406 | 413 | ||
407 | enableAlarmEdit( event->isAlarmEnabled() ); | 414 | enableAlarmEdit( event->isAlarmEnabled() ); |
408 | //qDebug("KOEditorGeneral::readIncidence(Incidence *event) "); | 415 | //qDebug("KOEditorGeneral::readIncidence(Incidence *event) "); |
409 | if(!event->isAlarmEnabled()) { | 416 | if(!event->isAlarmEnabled()) { |
410 | // TODO: Implement a KPrefsComboItem to solve this in a clean way. | 417 | // TODO: Implement a KPrefsComboItem to solve this in a clean way. |
411 | int alarmTime; | 418 | int alarmTime; |
412 | int a[] = { 1,5,10,15,30,60,180, 1440 }; | 419 | int a[] = { 1,5,10,15,30,60,180, 1440 }; |
413 | int index = KOPrefs::instance()->mAlarmTime; | 420 | int index = KOPrefs::instance()->mAlarmTime; |
414 | if (index < 0 || index > 7) { | 421 | if (index < 0 || index > 7) { |
415 | alarmTime = 15; | 422 | alarmTime = 15; |
416 | } else { | 423 | } else { |
417 | alarmTime = a[index]; | 424 | alarmTime = a[index]; |
418 | } | 425 | } |
419 | mAlarmTimeEdit->setValue(alarmTime); | 426 | mAlarmTimeEdit->setValue(alarmTime); |
420 | } | 427 | } |
diff --git a/korganizer/koeditorgeneral.h b/korganizer/koeditorgeneral.h index de8edaf..f4728c7 100644 --- a/korganizer/koeditorgeneral.h +++ b/korganizer/koeditorgeneral.h | |||
@@ -87,27 +87,28 @@ class KOEditorGeneral : public QObject | |||
87 | void allAccepted(); | 87 | void allAccepted(); |
88 | 88 | ||
89 | protected: | 89 | protected: |
90 | //QLineEdit *mSummaryEdit; | 90 | //QLineEdit *mSummaryEdit; |
91 | //QLineEdit *mLocationEdit; | 91 | //QLineEdit *mLocationEdit; |
92 | KOLocationBox *mSummaryEdit; | 92 | KOLocationBox *mSummaryEdit; |
93 | KOLocationBox *mLocationEdit; | 93 | KOLocationBox *mLocationEdit; |
94 | QLabel *mAlarmBell; | 94 | QLabel *mAlarmBell; |
95 | QCheckBox *mAlarmButton; | 95 | QCheckBox *mAlarmButton; |
96 | QSpinBox *mAlarmTimeEdit; | 96 | QSpinBox *mAlarmTimeEdit; |
97 | QPushButton *mAlarmSoundButton; | 97 | QPushButton *mAlarmSoundButton; |
98 | QPushButton *mAlarmProgramButton; | 98 | QPushButton *mAlarmProgramButton; |
99 | QComboBox *mAlarmIncrCombo; | 99 | QComboBox *mAlarmIncrCombo; |
100 | KTextEdit *mDescriptionEdit; | 100 | KTextEdit *mDescriptionEdit; |
101 | QLabel *mOwnerLabel; | 101 | QLabel *mOwnerLabel; |
102 | QComboBox *mSecrecyCombo; | 102 | QComboBox *mSecrecyCombo; |
103 | QCheckBox *mCancelBox; | 103 | QCheckBox *mCancelBox; |
104 | QPushButton *mCategoriesButton; | 104 | QPushButton *mCategoriesButton; |
105 | QLabel *mCategoriesLabel; | 105 | QLabel *mCategoriesLabel; |
106 | 106 | ||
107 | private: | 107 | private: |
108 | QString getFittingPath( const QString ) ; | 108 | QString getFittingPath( const QString ) ; |
109 | QString mAlarmSound; | 109 | QString mAlarmSound; |
110 | QString mAlarmProgram; | 110 | QString mAlarmProgram; |
111 | QString mAlarmMessage; | ||
111 | }; | 112 | }; |
112 | 113 | ||
113 | #endif | 114 | #endif |