Fix beep for event notification

This commit is contained in:
Jean-Marie Traissard 2006-06-19 14:58:41 +00:00
parent 2c534b32d6
commit e66a8a3430
1 changed files with 3 additions and 3 deletions

View File

@ -418,7 +418,8 @@ def play_sound(event):
if not gajim.config.get('sounds_on'): if not gajim.config.get('sounds_on'):
return return
path_to_soundfile = gajim.config.get_per('soundevents', event, 'path') path_to_soundfile = gajim.config.get_per('soundevents', event, 'path')
if path_to_soundfile == 'beep': player = gajim.config.get('soundplayer')
if player == 'beep':
print '\a' # make a speaker beep print '\a' # make a speaker beep
return return
if path_to_soundfile is None or not os.path.exists(path_to_soundfile): if path_to_soundfile is None or not os.path.exists(path_to_soundfile):
@ -430,9 +431,8 @@ def play_sound(event):
except: except:
pass pass
elif os.name == 'posix': elif os.name == 'posix':
if gajim.config.get('soundplayer') == '': if player == '':
return return
player = gajim.config.get('soundplayer')
# we add the path in "" so we have good parsing from shell # we add the path in "" so we have good parsing from shell
path_to_soundfile = path_to_soundfile.replace('"', '\\"') # escape " path_to_soundfile = path_to_soundfile.replace('"', '\\"') # escape "
command = player + ' "' + path_to_soundfile + '" &' command = player + ' "' + path_to_soundfile + '" &'