Diffstat (limited to 'korganizer/koeditorgeneral.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | korganizer/koeditorgeneral.cpp | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/korganizer/koeditorgeneral.cpp b/korganizer/koeditorgeneral.cpp index 94e1f4c..b4fe965 100644 --- a/korganizer/koeditorgeneral.cpp +++ b/korganizer/koeditorgeneral.cpp @@ -283,6 +283,20 @@ void KOEditorGeneral::pickAlarmProgram() } +QString KOEditorGeneral::getFittingPath( const QString s ) +{ + int maxlen = 50; + if ( QApplication::desktop()->width() < 640 ) { + if ( QApplication::desktop()->width() < 320 ) + maxlen = 22; + else + maxlen = 35; + } + if ( s.length() > maxlen ) { + return "..."+s.right(maxlen -3); + } + return s; +} void KOEditorGeneral::enableAlarmEdit(bool enable) { @@ -297,12 +311,12 @@ void KOEditorGeneral::enableAlarmEdit(bool enable) } } if (mAlarmProgramButton->isOn()) - ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + mAlarmProgram ); + ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + getFittingPath(mAlarmProgram) ); if (!mAlarmSound.isEmpty() && mAlarmSoundButton->isOn()) - ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Sound.Al.: ") + mAlarmSound ); + ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Audio Al.: ") + getFittingPath(mAlarmSound) ); } else { - ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Alarm disabled")); + ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Alarm disabled for this item")); } mAlarmTimeEdit->setEnabled(enable); |