summaryrefslogtreecommitdiffabout
path: root/korganizer/koeditorgeneral.cpp
authorzautrix <zautrix>2005-01-22 10:18:16 (UTC)
committer zautrix <zautrix>2005-01-22 10:18:16 (UTC)
commit6946f6ab0ee6eeafee0c8ff5d33fffc0826c7452 (patch) (side-by-side diff)
tree006248579ca44ad2e0c1a67db55b1a8013180ed7 /korganizer/koeditorgeneral.cpp
parentb715b109b70b8cd24a2d9da1d4863c44d79fb2a4 (diff)
downloadkdepimpi-6946f6ab0ee6eeafee0c8ff5d33fffc0826c7452.zip
kdepimpi-6946f6ab0ee6eeafee0c8ff5d33fffc0826c7452.tar.gz
kdepimpi-6946f6ab0ee6eeafee0c8ff5d33fffc0826c7452.tar.bz2
some small fixes
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()
((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + mAlarmProgram );
if ( mAlarmSoundButton->isOn())
((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Sound.Al.: ") + 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 );
@@ -294,18 +308,18 @@ void KOEditorGeneral::enableAlarmEdit(bool enable)
else {
if ( ! QFile::exists( mAlarmSound ) )
mAlarmSound = KOPrefs::instance()->mDefaultAlarmFile;
}
}
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);
mAlarmSoundButton->setEnabled(enable);
mAlarmProgramButton->setEnabled(enable);
mAlarmIncrCombo->setEnabled(enable);