Skip to content
Snippets Groups Projects
Commit a8354e11 authored by jimpp's avatar jimpp
Browse files

Fixed totally broken trayicon_notification_on_new_messages behaviour, change name to

trayicon_notification_on_events and do what's expected
parent b50d3b86
No related branches found
No related tags found
No related merge requests found
...@@ -560,7 +560,7 @@ class ChatControlBase(MessageControl): ...@@ -560,7 +560,7 @@ class ChatControlBase(MessageControl):
gc_message = False gc_message = False
if self.type_id == message_control.TYPE_GC: if self.type_id == message_control.TYPE_GC:
gc_message = True gc_message = True
if self.notify_on_new_messages() or \ if not gc_message or \
(gc_message and other_tags_for_text == ['marked']): (gc_message and other_tags_for_text == ['marked']):
# we want to have save this message in events list # we want to have save this message in events list
# other_tags_for_text == ['marked'] --> highlighted gc message # other_tags_for_text == ['marked'] --> highlighted gc message
...@@ -580,11 +580,11 @@ class ChatControlBase(MessageControl): ...@@ -580,11 +580,11 @@ class ChatControlBase(MessageControl):
gajim.interface.roster.draw_contact(self.contact.jid, gajim.interface.roster.draw_contact(self.contact.jid,
self.account) self.account)
self.parent_win.redraw_tab(self) self.parent_win.redraw_tab(self)
ctrl = gajim.interface.msg_win_mgr.get_control(full_jid, self.account) ctrl = gajim.interface.msg_win_mgr.get_control(full_jid, self.account)
if not self.parent_win.is_active(): if not self.parent_win.is_active():
self.parent_win.show_title(True, ctrl) # Enabled Urgent self.parent_win.show_title(True, ctrl) # Enabled Urgent hint
else: else:
self.parent_win.show_title(False, ctrl) # Disabled Urgent self.parent_win.show_title(False, ctrl) # Disabled Urgent hint
def toggle_emoticons(self): def toggle_emoticons(self):
'''hide show emoticons_button and make sure emoticons_menu is always there '''hide show emoticons_button and make sure emoticons_menu is always there
...@@ -899,9 +899,6 @@ class ChatControl(ChatControlBase): ...@@ -899,9 +899,6 @@ class ChatControl(ChatControlBase):
# restore previous conversation # restore previous conversation
self.restore_conversation() self.restore_conversation()
def notify_on_new_messages(self):
return gajim.config.get('trayicon_notification_on_new_messages')
def on_avatar_eventbox_enter_notify_event(self, widget, event): def on_avatar_eventbox_enter_notify_event(self, widget, event):
'''we enter the eventbox area so we under conditions add a timeout '''we enter the eventbox area so we under conditions add a timeout
to show a bigger avatar after 0.5 sec''' to show a bigger avatar after 0.5 sec'''
......
...@@ -165,7 +165,7 @@ class Config: ...@@ -165,7 +165,7 @@ class Config:
'roster_font': [opt_str, ''], 'roster_font': [opt_str, ''],
'use_kib_mib': [opt_bool, False, _('IEC standard says KiB = 1024 bytes, KB = 1000 bytes.')], 'use_kib_mib': [opt_bool, False, _('IEC standard says KiB = 1024 bytes, KB = 1000 bytes.')],
'notify_on_all_muc_messages': [opt_bool, False], 'notify_on_all_muc_messages': [opt_bool, False],
'trayicon_notification_on_new_messages': [opt_bool, True], 'trayicon_notification_on_events': [opt_bool, True, _('Notify of events in the system trayicon.')],
'last_save_dir': [opt_str, ''], 'last_save_dir': [opt_str, ''],
'last_send_dir': [opt_str, ''], 'last_send_dir': [opt_str, ''],
'last_emoticons_dir': [opt_str, ''], 'last_emoticons_dir': [opt_str, ''],
......
...@@ -2,4 +2,4 @@ docdir = '../' ...@@ -2,4 +2,4 @@ docdir = '../'
datadir = '../' datadir = '../'
version = '0.10.1.6' version = '0.10.1.7'
...@@ -151,6 +151,8 @@ class OptionsParser: ...@@ -151,6 +151,8 @@ class OptionsParser:
self.update_config_to_01015() self.update_config_to_01015()
if old < [0, 10, 1, 6] and new >= [0, 10, 1, 6]: if old < [0, 10, 1, 6] and new >= [0, 10, 1, 6]:
self.update_config_to_01016() self.update_config_to_01016()
if old < [0, 10, 1, 7] and new >= [0, 10, 1, 7]:
self.update_config_to_01017()
gajim.logger.init_vars() gajim.logger.init_vars()
gajim.config.set('version', new_version) gajim.config.set('version', new_version)
...@@ -336,5 +338,12 @@ class OptionsParser: ...@@ -336,5 +338,12 @@ class OptionsParser:
gajim.config.get_per('soundevents', 'muc_message_received', 'enabled'): gajim.config.get_per('soundevents', 'muc_message_received', 'enabled'):
gajim.config.set_per('soundevents',\ gajim.config.set_per('soundevents',\
'muc_message_received', 'enabled', False) 'muc_message_received', 'enabled', False)
gajim.config.set('version', '0.10.1.6') gajim.config.set('version', '0.10.1.6')
def update_config_to_01017(self):
'''trayicon_notification_on_new_messages ->
trayicon_notification_on_events '''
if self.old_values.has_key('trayicon_notification_on_new_messages'):
gajim.config.set('trayicon_notification_on_events',
self.old_values['trayicon_notification_on_new_messages'])
gajim.config.set('version', '0.10.1.7')
...@@ -54,14 +54,14 @@ def get_show_in_roster(event, account, contact): ...@@ -54,14 +54,14 @@ def get_show_in_roster(event, account, contact):
return True return True
def get_show_in_systray(event, account, contact): def get_show_in_systray(event, account, contact):
'''Return True if this event must be shown in roster, else False''' '''Return True if this event must be shown in systray, else False'''
num = get_advanced_notification(event, account, contact) num = get_advanced_notification(event, account, contact)
if num != None: if num != None:
if gajim.config.get_per('notifications', str(num), 'systray') == 'yes': if gajim.config.get_per('notifications', str(num), 'systray') == 'yes':
return True return True
if gajim.config.get_per('notifications', str(num), 'systray') == 'no': if gajim.config.get_per('notifications', str(num), 'systray') == 'no':
return False return False
return True return gajim.config.get('trayicon_notification_on_events')
def get_advanced_notification(event, account, contact): def get_advanced_notification(event, account, contact):
'''Returns the number of the first (top most) '''Returns the number of the first (top most)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment