Diffstat (limited to 'korganizer/koeditorgeneral.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | korganizer/koeditorgeneral.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/korganizer/koeditorgeneral.cpp b/korganizer/koeditorgeneral.cpp index 92e5a0f..21f220c 100644 --- a/korganizer/koeditorgeneral.cpp +++ b/korganizer/koeditorgeneral.cpp | |||
@@ -134,25 +134,24 @@ void KOEditorGeneral::initHeader(QWidget *parent,QBoxLayout *topLayout) | |||
134 | headerLayout->setColStretch( 1, str); | 134 | headerLayout->setColStretch( 1, str); |
135 | headerLayout->setColStretch( 2, 1); | 135 | headerLayout->setColStretch( 2, 1); |
136 | } | 136 | } |
137 | 137 | ||
138 | } | 138 | } |
139 | void KOEditorGeneral::setFocusOn( int i ) | 139 | void KOEditorGeneral::setFocusOn( int i ) |
140 | { | 140 | { |
141 | mNextFocus = i; | 141 | mNextFocus = i; |
142 | QTimer::singleShot( 0, this, SLOT ( slotSetFocusOn() )); | 142 | QTimer::singleShot( 0, this, SLOT ( slotSetFocusOn() )); |
143 | } | 143 | } |
144 | void KOEditorGeneral::slotSetFocusOn() | 144 | void KOEditorGeneral::slotSetFocusOn() |
145 | { | 145 | { |
146 | mNextFocus; | ||
147 | if ( mNextFocus == 1 ) { | 146 | if ( mNextFocus == 1 ) { |
148 | mDescriptionEdit->setFocus(); | 147 | mDescriptionEdit->setFocus(); |
149 | mDescriptionEdit->setCursorPosition( mDescriptionEdit->numLines (), 333); | 148 | mDescriptionEdit->setCursorPosition( mDescriptionEdit->numLines (), 333); |
150 | } | 149 | } |
151 | if ( mNextFocus == 2 ) { | 150 | if ( mNextFocus == 2 ) { |
152 | mSummaryEdit->setFocus(); | 151 | mSummaryEdit->setFocus(); |
153 | } | 152 | } |
154 | } | 153 | } |
155 | void KOEditorGeneral::editCategories() | 154 | void KOEditorGeneral::editCategories() |
156 | { | 155 | { |
157 | // qDebug("KOEditorGeneral::editCategories() "); | 156 | // qDebug("KOEditorGeneral::editCategories() "); |
158 | KPIM::CategorySelectDialog* csd = new KPIM::CategorySelectDialog( KOPrefs::instance(), 0 ); | 157 | KPIM::CategorySelectDialog* csd = new KPIM::CategorySelectDialog( KOPrefs::instance(), 0 ); |
@@ -346,25 +345,25 @@ void KOEditorGeneral::pickAlarmProgram() | |||
346 | mAlarmProgramButton->setOn(!oldState); | 345 | mAlarmProgramButton->setOn(!oldState); |
347 | mAlarmSoundButton->setOn(oldState); | 346 | mAlarmSoundButton->setOn(oldState); |
348 | } | 347 | } |
349 | 348 | ||
350 | if (mAlarmProgramButton->isOn()) | 349 | if (mAlarmProgramButton->isOn()) |
351 | ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + getFittingPath(mAlarmProgram) ); | 350 | ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + getFittingPath(mAlarmProgram) ); |
352 | if ( mAlarmSoundButton->isOn()) | 351 | if ( mAlarmSoundButton->isOn()) |
353 | ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Audio Al.: ") + getFittingPath(mAlarmSound) ); | 352 | ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Audio Al.: ") + getFittingPath(mAlarmSound) ); |
354 | 353 | ||
355 | } | 354 | } |
356 | 355 | ||
357 | 356 | ||
358 | QString KOEditorGeneral::getFittingPath( const QString s ) | 357 | QString KOEditorGeneral::getFittingPath( const QString & s ) |
359 | { | 358 | { |
360 | int maxlen = 50; | 359 | int maxlen = 50; |
361 | if ( QApplication::desktop()->width() < 640 ) { | 360 | if ( QApplication::desktop()->width() < 640 ) { |
362 | if ( QApplication::desktop()->width() < 320 ) | 361 | if ( QApplication::desktop()->width() < 320 ) |
363 | maxlen = 22; | 362 | maxlen = 22; |
364 | else | 363 | else |
365 | maxlen = 35; | 364 | maxlen = 35; |
366 | } | 365 | } |
367 | if ( s.length() > maxlen ) { | 366 | if ( s.length() > maxlen ) { |
368 | return "..."+s.right(maxlen -3); | 367 | return "..."+s.right(maxlen -3); |
369 | } | 368 | } |
370 | return s; | 369 | return s; |
@@ -611,14 +610,16 @@ void KOEditorGeneral::writeIncidence(Incidence *event) | |||
611 | alarm->setType(Alarm::Invalid); | 610 | alarm->setType(Alarm::Invalid); |
612 | //alarm->setAudioAlarm("default"); | 611 | //alarm->setAudioAlarm("default"); |
613 | // TODO: Deal with multiple alarms | 612 | // TODO: Deal with multiple alarms |
614 | break; // For now, stop after the first alarm | 613 | break; // For now, stop after the first alarm |
615 | } | 614 | } |
616 | } else { | 615 | } else { |
617 | Alarm* alarm = event->alarms().first(); | 616 | Alarm* alarm = event->alarms().first(); |
618 | if ( alarm ) { | 617 | if ( alarm ) { |
619 | alarm->setEnabled(false); | 618 | alarm->setEnabled(false); |
620 | alarm->setType(Alarm::Invalid); | 619 | alarm->setType(Alarm::Invalid); |
621 | } | 620 | } |
622 | } | 621 | } |
623 | event->setCalID( getCalendarID() ); | 622 | int id = getCalendarID(); |
623 | event->setCalID( id ); | ||
624 | event->setAlarmEnabled( KOPrefs::instance()->getCalendar( id )->isAlarmEnabled ); | ||
624 | } | 625 | } |