summaryrefslogtreecommitdiffabout
path: root/korganizer/koeditorgeneral.cpp
Unidiff
Diffstat (limited to 'korganizer/koeditorgeneral.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koeditorgeneral.cpp20
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
@@ -280,12 +280,26 @@ void KOEditorGeneral::pickAlarmProgram()
280 ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + mAlarmProgram ); 280 ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + mAlarmProgram );
281 if ( mAlarmSoundButton->isOn()) 281 if ( mAlarmSoundButton->isOn())
282 ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Sound.Al.: ") + mAlarmSound ); 282 ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Sound.Al.: ") + mAlarmSound );
283} 283}
284 284
285 285
286QString KOEditorGeneral::getFittingPath( const QString s )
287{
288 int maxlen = 50;
289 if ( QApplication::desktop()->width() < 640 ) {
290 if ( QApplication::desktop()->width() < 320 )
291 maxlen = 22;
292 else
293 maxlen = 35;
294 }
295 if ( s.length() > maxlen ) {
296 return "..."+s.right(maxlen -3);
297 }
298 return s;
299}
286 300
287void KOEditorGeneral::enableAlarmEdit(bool enable) 301void KOEditorGeneral::enableAlarmEdit(bool enable)
288{ 302{
289 if ( enable ) { 303 if ( enable ) {
290 if (!mAlarmProgramButton->isOn() && !mAlarmSoundButton->isOn()) { 304 if (!mAlarmProgramButton->isOn() && !mAlarmSoundButton->isOn()) {
291 mAlarmSoundButton->setOn( true ); 305 mAlarmSoundButton->setOn( true );
@@ -294,18 +308,18 @@ void KOEditorGeneral::enableAlarmEdit(bool enable)
294 else { 308 else {
295 if ( ! QFile::exists( mAlarmSound ) ) 309 if ( ! QFile::exists( mAlarmSound ) )
296 mAlarmSound = KOPrefs::instance()->mDefaultAlarmFile; 310 mAlarmSound = KOPrefs::instance()->mDefaultAlarmFile;
297 } 311 }
298 } 312 }
299 if (mAlarmProgramButton->isOn()) 313 if (mAlarmProgramButton->isOn())
300 ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + mAlarmProgram ); 314 ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + getFittingPath(mAlarmProgram) );
301 if (!mAlarmSound.isEmpty() && mAlarmSoundButton->isOn()) 315 if (!mAlarmSound.isEmpty() && mAlarmSoundButton->isOn())
302 ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Sound.Al.: ") + mAlarmSound ); 316 ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Audio Al.: ") + getFittingPath(mAlarmSound) );
303 } 317 }
304 else { 318 else {
305 ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Alarm disabled")); 319 ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Alarm disabled for this item"));
306 320
307 } 321 }
308 mAlarmTimeEdit->setEnabled(enable); 322 mAlarmTimeEdit->setEnabled(enable);
309 mAlarmSoundButton->setEnabled(enable); 323 mAlarmSoundButton->setEnabled(enable);
310 mAlarmProgramButton->setEnabled(enable); 324 mAlarmProgramButton->setEnabled(enable);
311 mAlarmIncrCombo->setEnabled(enable); 325 mAlarmIncrCombo->setEnabled(enable);