From 359824bec125b803f5c64a786fdf303f7b87cdb7 Mon Sep 17 00:00:00 2001 From: Nikos Kouremenos Date: Wed, 23 Nov 2005 23:28:26 +0000 Subject: [PATCH] add ACE log_contact_status_changes and expose to UI in advanced tab in misc. this replaces the previous options and imo is good to expose to that place (used to have log-related stuff) --- src/common/config.py | 1 + src/common/connection.py | 6 ++++-- src/config.py | 19 +++++++++++-------- src/gtkgui.glade | 20 ++++++++++++++++++++ 4 files changed, 36 insertions(+), 10 deletions(-) diff --git a/src/common/config.py b/src/common/config.py index b6bd99553..76a6c0170 100644 --- a/src/common/config.py +++ b/src/common/config.py @@ -161,6 +161,7 @@ class Config: 'show_avatars_in_roster': [opt_bool, True], 'ask_avatars_on_startup': [opt_bool, True, _('If True, Gajim will ask for avatar each contact that did not have an avatar last time or has one cache that is too old.')], 'print_status_in_chats': [opt_bool, True, _('If False, you will no longer see status line in chats when a contact changes his or her status and/or his status message.')], + 'log_contact_status_changes': [opt_bool, True], } __options_per_key = { diff --git a/src/common/connection.py b/src/common/connection.py index c9c01a49e..7e648af4c 100644 --- a/src/common/connection.py +++ b/src/common/connection.py @@ -469,7 +469,8 @@ class Connection: self.dispatch('ERROR_ANSWER', ('', jid_stripped, errmsg, errcode)) if not ptype or ptype == 'unavailable': - gajim.logger.write('gcstatus', who, status, show) + if gajim.config.get('log_contact_status_changes'): + gajim.logger.write('gcstatus', who, status, show) self.dispatch('GC_NOTIFY', (jid_stripped, show, status, resource, prs.getRole(), prs.getAffiliation(), prs.getJid(), prs.getReason(), prs.getActor(), prs.getStatusCode(), @@ -517,7 +518,8 @@ class Connection: else: self.vcard_shas[jid_stripped] = avatar_sha if not ptype or ptype == 'unavailable': - gajim.logger.write('status', jid_stripped, status, show) + if gajim.config.get('log_contact_status_changes'): + gajim.logger.write('status', jid_stripped, status, show) self.dispatch('NOTIFY', (jid_stripped, show, status, resource, prio, keyID)) # END presenceCB diff --git a/src/config.py b/src/config.py index 69ecb4d61..021e444bf 100644 --- a/src/config.py +++ b/src/config.py @@ -399,6 +399,10 @@ class PreferencesWindow: self.xml.get_widget('custom_file_manager_entry').set_text( gajim.config.get('custom_file_manager')) + # log status changes of contacts + st = gajim.config.get('log_contact_status_changes') + self.xml.get_widget('log_show_changes_checkbutton').set_active(st) + # send os info st = gajim.config.get('send_os_info') self.xml.get_widget('send_os_info_checkbutton').set_active(st) @@ -892,13 +896,14 @@ class PreferencesWindow: gajim.config.set('custom_file_manager', widget.get_text().decode('utf-8')) gajim.interface.save_config() + def on_log_show_changes_checkbutton_toggled(self, widget): + self.on_checkbutton_toggled(widget, 'log_contact_status_changes') + def on_send_os_info_checkbutton_toggled(self, widget): - gajim.config.set('send_os_info', widget.get_active()) - gajim.interface.save_config() + self.on_checkbutton_toggled(widget, 'send_os_info') def on_check_for_new_version_checkbutton_toggled(self, widget): - gajim.config.set('check_for_new_version', widget.get_active()) - gajim.interface.save_config() + self.on_checkbutton_toggled(widget, 'check_for_new_version') def fill_msg_treeview(self): self.xml.get_widget('delete_msg_button').set_sensitive(False) @@ -960,10 +965,8 @@ class PreferencesWindow: model = self.sound_tree.get_model() model.clear() for sound in sounds: - val = gajim.config.get_per('soundevents', sound, - 'enabled') - path = gajim.config.get_per('soundevents', sound, - 'path') + val = gajim.config.get_per('soundevents', sound, 'enabled') + path = gajim.config.get_per('soundevents', sound, 'path') iter = model.append((sound, val, path)) def on_treeview_sounds_cursor_changed(self, widget, data = None): diff --git a/src/gtkgui.glade b/src/gtkgui.glade index 5ae6074c8..aeb08f879 100644 --- a/src/gtkgui.glade +++ b/src/gtkgui.glade @@ -6087,6 +6087,26 @@ Custom False 6 + + + True + True + _Log status changes of contacts + True + GTK_RELIEF_NORMAL + True + False + False + True + + + + 0 + False + False + + + True