summaryrefslogtreecommitdiffabout
path: root/korganizer/koeditorgeneral.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/koeditorgeneral.cpp') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/koeditorgeneral.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/korganizer/koeditorgeneral.cpp b/korganizer/koeditorgeneral.cpp
index b4fe965..f5eb52e 100644
--- a/korganizer/koeditorgeneral.cpp
+++ b/korganizer/koeditorgeneral.cpp
@@ -228,79 +228,79 @@ void KOEditorGeneral::pickAlarmSound()
if (!mAlarmSoundButton->isOn()) {
//mAlarmSound = "";
QToolTip::remove(mAlarmSoundButton);
QToolTip::add(mAlarmSoundButton, i18n("No sound set"));
mAlarmProgramButton->setOn(true);
mAlarmSoundButton->setOn(false);
} else {
QString fileName(KFileDialog::getOpenFileName(mAlarmSound,
i18n("*.wav|Wav Files"), 0));
if (!fileName.isEmpty()) {
mAlarmSound = fileName;
QToolTip::remove(mAlarmSoundButton);
QString dispStr = i18n("Playing '%1'").arg(fileName);
QToolTip::add(mAlarmSoundButton, dispStr);
mAlarmProgramButton->setOn(false);
mAlarmSoundButton->setOn(true);
} else {
mAlarmProgramButton->setOn(true);
mAlarmSoundButton->setOn(false);
}
}
if (mAlarmProgramButton->isOn())
- ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + mAlarmProgram );
+ ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + getFittingPath(mAlarmProgram) );
if ( mAlarmSoundButton->isOn())
- ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Audio.Al.: ") + mAlarmSound );
+ ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Audio.Al.: ") + getFittingPath(mAlarmSound) );
}
void KOEditorGeneral::pickAlarmProgram()
{
if (!mAlarmProgramButton->isOn()) {
//mAlarmProgram = "";
QToolTip::remove(mAlarmProgramButton);
QToolTip::add(mAlarmProgramButton, i18n("No program set"));
mAlarmProgramButton->setOn(false);
mAlarmSoundButton->setOn(true);
} else {
QString fileName(KFileDialog::getOpenFileName(mAlarmProgram,i18n("Procedure Alarm.: ") , 0));
if (!fileName.isEmpty()) {
mAlarmProgram = fileName;
QToolTip::remove(mAlarmProgramButton);
QString dispStr = i18n("Running '%1'").arg(fileName);
QToolTip::add(mAlarmProgramButton, dispStr);
mAlarmSoundButton->setOn(false);
mAlarmProgramButton->setOn(true);
} else {
mAlarmProgramButton->setOn(false);
mAlarmSoundButton->setOn(true);
}
}
if (mAlarmProgramButton->isOn())
- ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + mAlarmProgram );
+ ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + getFittingPath(mAlarmProgram) );
if ( mAlarmSoundButton->isOn())
- ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Sound.Al.: ") + mAlarmSound );
+ ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Sound.Al.: ") + getFittingPath(mAlarmSound) );
}
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)
{
if ( enable ) {
if (!mAlarmProgramButton->isOn() && !mAlarmSoundButton->isOn()) {
mAlarmSoundButton->setOn( true );
if ( mAlarmSound.isEmpty() )