[elrodeo] add a sound option when receiving gmail notifications. fixes #2697

This commit is contained in:
Yann Leboulanger 2006-11-26 09:28:12 +00:00
parent 9673a70a0e
commit ef8553031b
3 changed files with 9 additions and 0 deletions

View File

@ -375,6 +375,7 @@ class Config:
'message_sent': [ True, '../data/sounds/sent.wav' ],
'muc_message_highlight': [ True, '../data/sounds/gc_message1.wav', _('Sound to play when a group chat message contains one of the words in muc_highlight_words, or when a group chat message contains your nickname.')],
'muc_message_received': [ False, '../data/sounds/gc_message2.wav', _('Sound to play when any MUC message arrives.') ],
'gmail_received': [ False, '../data/sounds/message1.wav' ],
}
themes_default = {

View File

@ -1071,6 +1071,13 @@ class PreferencesWindow:
'muc_message_highlight': _('Group Chat Message Highlight'),
'muc_message_received': _('Group Chat Message Received')
}
# In case of a GMail account we provide a sound notification option
for account in gajim.config.get_per('accounts'):
jid = gajim.get_jid_from_account(account)
if gajim.get_server_from_jid(jid) in gajim.gmail_domains:
sounds_dict['gmail_received'] = _('GMail Email Received')
break
for sound_event_config_name, sound_ui_name in sounds_dict.items():
enabled = gajim.config.get_per('soundevents',

View File

@ -1155,6 +1155,7 @@ class Interface:
{'from_address': gmessage['From']}
path = gtkgui_helpers.get_path_to_generic_or_avatar(img)
helpers.play_sound('gmail_received')
notify.popup(_('New E-mail'), jid, account, 'gmail',
path_to_image = path, title = title, text = text)