summaryrefslogtreecommitdiffabout
path: root/korganizer/koeditorgeneral.cpp
authorzautrix <zautrix>2005-04-03 04:33:19 (UTC)
committer zautrix <zautrix>2005-04-03 04:33:19 (UTC)
commitf6c8249db564c1276d4c7ed5ad88c6fbac361b8d (patch) (unidiff)
tree8e5b6e2d6f9a7bc00326f7c0115bf2af53ae9ce8 /korganizer/koeditorgeneral.cpp
parent40e5edc1ab153144f0e824ad2d3a0ab37357e408 (diff)
downloadkdepimpi-f6c8249db564c1276d4c7ed5ad88c6fbac361b8d.zip
kdepimpi-f6c8249db564c1276d4c7ed5ad88c6fbac361b8d.tar.gz
kdepimpi-f6c8249db564c1276d4c7ed5ad88c6fbac361b8d.tar.bz2
fixes
Diffstat (limited to 'korganizer/koeditorgeneral.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koeditorgeneral.cpp69
1 files changed, 33 insertions, 36 deletions
diff --git a/korganizer/koeditorgeneral.cpp b/korganizer/koeditorgeneral.cpp
index b14ca43..abc80d4 100644
--- a/korganizer/koeditorgeneral.cpp
+++ b/korganizer/koeditorgeneral.cpp
@@ -227,59 +227,56 @@ void KOEditorGeneral::pickAlarmSound()
227{ 227{
228 228
229 qDebug("KOEditorGeneral::pickAlarmSound() %d",mAlarmSoundButton->isOn() ); 229 qDebug("KOEditorGeneral::pickAlarmSound() %d",mAlarmSoundButton->isOn() );
230 //QString prefix = mAlarmSound; 230
231 if (!mAlarmSoundButton->isOn()) { 231 bool oldState = mAlarmSoundButton->isOn();
232
233 QString fileName(KFileDialog::getOpenFileName(mAlarmSound,
234 i18n("*.wav|Wav Files"), 0));
235 if (!fileName.isEmpty()) {
236 mAlarmSound = fileName;
237 QToolTip::remove(mAlarmSoundButton);
238 QString dispStr = i18n("Playing '%1'").arg(fileName);
239 QToolTip::add(mAlarmSoundButton, dispStr);
240 mAlarmProgramButton->setOn(false);
232 mAlarmSoundButton->setOn(true); 241 mAlarmSoundButton->setOn(true);
233 ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Audio Al.: ") + getFittingPath(mAlarmSound) ); 242 QToolTip::add(mAlarmProgramButton, i18n("No program set"));
234 } else { 243 } else {
235 QString fileName(KFileDialog::getOpenFileName(mAlarmSound, 244 mAlarmProgramButton->setOn(oldState);
236 i18n("*.wav|Wav Files"), 0)); 245 mAlarmSoundButton->setOn(!oldState);
237 if (!fileName.isEmpty()) { 246
238 mAlarmSound = fileName; 247
239 QToolTip::remove(mAlarmSoundButton);
240 QString dispStr = i18n("Playing '%1'").arg(fileName);
241 QToolTip::add(mAlarmSoundButton, dispStr);
242 mAlarmProgramButton->setOn(false);
243 mAlarmSoundButton->setOn(true);
244 } else {
245 mAlarmProgramButton->setOn(true);
246 mAlarmSoundButton->setOn(false);
247
248 }
249 } 248 }
250#if 0 249
251 if (mAlarmProgramButton->isOn()) 250 if (mAlarmProgramButton->isOn())
252 ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + getFittingPath(mAlarmProgram) ); 251 ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + getFittingPath(mAlarmProgram) );
253 if ( mAlarmSoundButton->isOn()) 252 if ( mAlarmSoundButton->isOn())
254 ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Audio Al.: ") + getFittingPath(mAlarmSound) ); 253 ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Audio Al.: ") + getFittingPath(mAlarmSound) );
255#endif 254
256} 255}
257 256
258void KOEditorGeneral::pickAlarmProgram() 257void KOEditorGeneral::pickAlarmProgram()
259{ 258{
260 if (!mAlarmProgramButton->isOn()) { 259 bool oldState = mAlarmProgramButton->isOn();
260
261 QString fileName(KFileDialog::getOpenFileName(mAlarmProgram,i18n("Procedure Alarm: ") , 0));
262 if (!fileName.isEmpty()) {
263 mAlarmProgram = fileName;
264 QToolTip::remove(mAlarmProgramButton);
265 QString dispStr = i18n("Running '%1'").arg(fileName);
266 QToolTip::add(mAlarmProgramButton, dispStr);
267 mAlarmSoundButton->setOn(false);
261 mAlarmProgramButton->setOn(true); 268 mAlarmProgramButton->setOn(true);
262 ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + getFittingPath(mAlarmProgram) ); 269 QToolTip::add(mAlarmSoundButton, i18n("No sound set"));
263 } else { 270 } else {
264 QString fileName(KFileDialog::getOpenFileName(mAlarmProgram,i18n("Procedure Alarm: ") , 0)); 271 mAlarmProgramButton->setOn(!oldState);
265 if (!fileName.isEmpty()) { 272 mAlarmSoundButton->setOn(oldState);
266 mAlarmProgram = fileName;
267 QToolTip::remove(mAlarmProgramButton);
268 QString dispStr = i18n("Running '%1'").arg(fileName);
269 QToolTip::add(mAlarmProgramButton, dispStr);
270 mAlarmSoundButton->setOn(false);
271 mAlarmProgramButton->setOn(true);
272 } else {
273 mAlarmProgramButton->setOn(false);
274 mAlarmSoundButton->setOn(true);
275 }
276 } 273 }
277#if 0 274
278 if (mAlarmProgramButton->isOn()) 275 if (mAlarmProgramButton->isOn())
279 ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + getFittingPath(mAlarmProgram) ); 276 ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Proc.Al.: ") + getFittingPath(mAlarmProgram) );
280 if ( mAlarmSoundButton->isOn()) 277 if ( mAlarmSoundButton->isOn())
281 ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Audio Al.: ") + getFittingPath(mAlarmSound) ); 278 ((QWidget*)parent())->topLevelWidget()->setCaption(i18n("Audio Al.: ") + getFittingPath(mAlarmSound) );
282#endif 279
283} 280}
284 281
285 282