detect sound player on first start as soon as gajim is started, not first time we open preferences window. Fixes #3566

This commit is contained in:
Yann Leboulanger 2008-07-11 06:29:40 +00:00
parent 3f838e5f3e
commit b933e6cef0
2 changed files with 12 additions and 8 deletions

View File

@ -284,14 +284,6 @@ class PreferencesWindow:
# sound player
player = gajim.config.get('soundplayer')
if player == '': # only on first time Gajim starts
commands = ('aplay', 'play', 'esdplay', 'artsplay')
for command in commands:
if helpers.is_in_path(command):
if command == 'aplay':
command += ' -q'
gajim.config.set('soundplayer', command)
break
# sounds treeview
self.sound_tree = self.xml.get_widget('sounds_treeview')

View File

@ -3122,6 +3122,18 @@ class Interface:
spell = gtkspell.Spell(tv, lang)
except:
dialogs.AspellDictError(lang)
if gajim.config.get('soundplayer') == '':
print 'first'
# only on first time Gajim starts
commands = ('aplay', 'play', 'esdplay', 'artsplay')
for command in commands:
if helpers.is_in_path(command):
if command == 'aplay':
command += ' -q'
gajim.config.set('soundplayer', command)
break
self.last_ftwindow_update = 0
gobject.timeout_add(100, self.autoconnect)