diff --git a/rtdata/languages/default b/rtdata/languages/default index 1a12e987e..1f44a7966 100644 --- a/rtdata/languages/default +++ b/rtdata/languages/default @@ -790,7 +790,7 @@ PREFERENCES_SINGLETABVERTAB;Single Editor Tab Mode, Vertical Tabs PREFERENCES_SINGLETAB;Single Editor Tab Mode PREFERENCES_SLIMUI;Slim interface PREFERENCES_SND_BATCHQUEUEDONE;Queue processing done -PREFERENCES_SND_HELP;Either enter filepath or nothing (for no sound). On Windows use "SystemDefault", "SystemAsterisk" etc. for system sounds. +PREFERENCES_SND_HELP;Either enter filepath or nothing (for no sound).\nOn Windows use "SystemDefault", "SystemAsterisk" etc. for system sounds.\nOn Linux use "complete", "window-attention" etc. for system sounds. PREFERENCES_SND_LNGEDITPROCDONE;Editor processing done PREFERENCES_SND_TRESHOLDSECS;after secs PREFERENCES_SQUAREDETAILWINDOW;Square detail window (faster) diff --git a/rtgui/options.cc b/rtgui/options.cc index 9220d1cb0..48b67fa69 100644 --- a/rtgui/options.cc +++ b/rtgui/options.cc @@ -348,12 +348,12 @@ void Options::setDefaults () { cutOverlayBrush = std::vector (4); cutOverlayBrush[3] = 0.667; // :-p -#if defined(__linux__) || defined(WIN32) sndEnable=true; -#else - sndEnable=false; -#endif sndLngEditProcDoneSecs=3.0; +#ifdef __linux__ + sndBatchQueueDone = "complete"; + sndLngEditProcDone = "window-attention"; +#endif // Reminder: 0 = SET mode, 1 = ADD mode int babehav[] = { diff --git a/rtgui/preferences.cc b/rtgui/preferences.cc index 9e6dd6081..7f81e446e 100644 --- a/rtgui/preferences.cc +++ b/rtgui/preferences.cc @@ -82,7 +82,10 @@ Preferences::Preferences (RTWindow *rtwindow):parent(rtwindow) { nb->append_page (*getFileBrowserPanel(), M("PREFERENCES_TAB_BROWSER")); nb->append_page (*getColorManagementPanel(),M("PREFERENCES_TAB_COLORMGR")); nb->append_page (*getBatchProcPanel(), M("PREFERENCES_BATCH_PROCESSING")); + // Sounds only on Windows and Linux +#if defined(WIN32) || defined(__linux__) nb->append_page (*getSoundPanel(), M("PREFERENCES_TAB_SOUND")); +#endif nb->set_current_page (0); fillPreferences (); @@ -1131,11 +1134,13 @@ void Preferences::storePreferences () { moptions.overwriteOutputFile = chOverwriteOutputFile->get_active (); moptions.UseIconNoText = ckbUseIconNoText->get_active(); - // Sounds + // Sounds only on Windows and Linux +#if defined(WIN32) || defined(__linux__) moptions.sndEnable = ckbSndEnable->get_active (); moptions.sndBatchQueueDone = txtSndBatchQueueDone->get_text (); moptions.sndLngEditProcDone = txtSndLngEditProcDone->get_text (); moptions.sndLngEditProcDoneSecs = spbSndLngEditProcDoneSecs->get_value (); +#endif } void Preferences::fillPreferences () { @@ -1276,15 +1281,13 @@ void Preferences::fillPreferences () { chOverwriteOutputFile->set_active (moptions.overwriteOutputFile); - // Sounds + // Sounds only on Windows and Linux +#if defined(WIN32) || defined(__linux__) ckbSndEnable->set_active (moptions.sndEnable); txtSndBatchQueueDone->set_text (moptions.sndBatchQueueDone); txtSndLngEditProcDone->set_text (moptions.sndLngEditProcDone); -#if defined(__linux__) || defined(__APPLE__) - txtSndBatchQueueDone->set_sensitive (false); - txtSndLngEditProcDone->set_sensitive (false); -#endif spbSndLngEditProcDoneSecs->set_value (moptions.sndLngEditProcDoneSecs); +#endif } /* @@ -1311,12 +1314,9 @@ void Preferences::autocielabToggled () { } */ void Preferences::sndEnableToggled () { -#ifdef WIN32 txtSndBatchQueueDone->set_sensitive(ckbSndEnable->get_active()); txtSndLngEditProcDone->set_sensitive(ckbSndEnable->get_active()); -#elif defined(__linux__) || defined(WIN32) spbSndLngEditProcDoneSecs->set_sensitive(ckbSndEnable->get_active()); -#endif } void Preferences::langAutoDetectToggled () { diff --git a/rtgui/soundman.cc b/rtgui/soundman.cc index 847e7fe9b..07ff9986d 100644 --- a/rtgui/soundman.cc +++ b/rtgui/soundman.cc @@ -49,10 +49,9 @@ void SoundManager::init() // param is either file name or name of the system event on Windows (e.g. "SystemAsterisk" or "SystemDefault"). void SoundManager::playSoundAsync(const Glib::ustring &sound) { - if (!options.sndEnable) return; + if (sound.empty() || !options.sndEnable) return; #ifdef WIN32 - if (sound.empty()) return; DWORD sndParam=SND_ASYNC | SND_NODEFAULT; if (sound.find('.')!=Glib::ustring::npos) { @@ -67,6 +66,6 @@ void SoundManager::playSoundAsync(const Glib::ustring &sound) PlaySoundW(wfilename, NULL, sndParam); g_free( wfilename ); #elif defined(__linux__) - ca_context_play(ca_gtk_context_get(), 0, CA_PROP_EVENT_ID, "complete", NULL); + ca_context_play(ca_gtk_context_get(), 0, CA_PROP_EVENT_ID, sound.c_str(), CA_PROP_MEDIA_FILENAME, sound.c_str(), NULL); #endif }