From 8c2c43be0fd200e98527a5dcb387d81906f6488f Mon Sep 17 00:00:00 2001 From: Jean-Marie Traissard Date: Sat, 31 Mar 2007 13:40:23 +0000 Subject: [PATCH] Move log_for_this_contact checkbutton from vcard dialog to history dialog. So you can NOT log some chatrooms. Fixes #2592. --- data/glade/history_window.glade | 19 +++++++++ data/glade/vcard_information_window.glade | 19 --------- src/history_window.py | 25 ++++++++++++ src/vcard.py | 48 ----------------------- 4 files changed, 44 insertions(+), 67 deletions(-) diff --git a/data/glade/history_window.glade b/data/glade/history_window.glade index bdf6bd9c1..b475f03b4 100644 --- a/data/glade/history_window.glade +++ b/data/glade/history_window.glade @@ -87,6 +87,25 @@ + + + True + True + _Log conversation history + True + GTK_RELIEF_NORMAL + True + True + False + True + + + 0 + False + False + + + True diff --git a/data/glade/vcard_information_window.glade b/data/glade/vcard_information_window.glade index ef505d44e..334ab9bc5 100644 --- a/data/glade/vcard_information_window.glade +++ b/data/glade/vcard_information_window.glade @@ -432,25 +432,6 @@ - - - True - True - _Log conversation history - True - GTK_RELIEF_NORMAL - True - True - False - True - - - 0 - False - False - - - True diff --git a/src/history_window.py b/src/history_window.py index 3ceb10594..19af94b73 100644 --- a/src/history_window.py +++ b/src/history_window.py @@ -126,6 +126,14 @@ class HistoryWindow: self.calendar.select_month(gtk_month, y) self.calendar.select_day(d) self.add_lines_for_date(y, m, d) + + log = True + if self.jid in gajim.config.get_per('accounts', self.account, + 'no_log_for').split(' '): + log = False + checkbutton = xml.get_widget('log_history_checkbutton') + checkbutton.set_active(log) + checkbutton.connect('toggled', self.on_log_history_checkbutton_toggled) self.window.show_all() @@ -391,3 +399,20 @@ class HistoryWindow: match_start_mark = self.history_buffer.create_mark('match_start', match_start_iter, True) self.history_textview.tv.scroll_to_mark(match_start_mark, 0, True) + + def on_log_history_checkbutton_toggled(self, widget): + # log conversation history? + oldlog = True + no_log_for = gajim.config.get_per('accounts', self.account, + 'no_log_for').split() + if self.jid in no_log_for: + oldlog = False + log = widget.get_active() + if not log and not self.jid in no_log_for: + no_log_for.append(self.jid) + if log and self.jid in no_log_for: + no_log_for.remove(self.jid) + if oldlog != log: + gajim.config.set_per('accounts', self.account, 'no_log_for', + ' '.join(no_log_for)) + diff --git a/src/vcard.py b/src/vcard.py index a479d382b..ccb22c5d4 100644 --- a/src/vcard.py +++ b/src/vcard.py @@ -105,22 +105,6 @@ class VcardWindow: if event.keyval == gtk.keysyms.Escape: self.window.destroy() - def on_log_history_checkbutton_toggled(self, widget): - #log conversation history? - oldlog = True - no_log_for = gajim.config.get_per('accounts', self.account, - 'no_log_for').split() - if self.contact.jid in no_log_for: - oldlog = False - log = widget.get_active() - if not log and not self.contact.jid in no_log_for: - no_log_for.append(self.contact.jid) - if log and self.contact.jid in no_log_for: - no_log_for.remove(self.contact.jid) - if oldlog != log: - gajim.config.set_per('accounts', self.account, 'no_log_for', - ' '.join(no_log_for)) - def on_PHOTO_eventbox_button_press_event(self, widget, event): '''If right-clicked, show popup''' if event.button == 3: # right click @@ -298,14 +282,6 @@ class VcardWindow: tooltips.set_tip(eb, _("You are waiting contact's answer about your subscription request")) - log = True - if self.contact.jid in gajim.config.get_per('accounts', self.account, - 'no_log_for').split(' '): - log = False - checkbutton = self.xml.get_widget('log_history_checkbutton') - checkbutton.set_active(log) - checkbutton.connect('toggled', self.on_log_history_checkbutton_toggled) - resources = '%s (%s)' % (self.contact.resource, unicode( self.contact.priority)) uf_resources = self.contact.resource + _(' resource with priority ')\ @@ -385,22 +361,6 @@ class ZeroconfVcardWindow: if event.keyval == gtk.keysyms.Escape: self.window.destroy() - def on_log_history_checkbutton_toggled(self, widget): - #log conversation history? - oldlog = True - no_log_for = gajim.config.get_per('accounts', self.account, - 'no_log_for').split() - if self.contact.jid in no_log_for: - oldlog = False - log = widget.get_active() - if not log and not self.contact.jid in no_log_for: - no_log_for.append(self.contact.jid) - if log and self.contact.jid in no_log_for: - no_log_for.remove(self.contact.jid) - if oldlog != log: - gajim.config.set_per('accounts', self.account, 'no_log_for', - ' '.join(no_log_for)) - def on_PHOTO_eventbox_button_press_event(self, widget, event): '''If right-clicked, show popup''' if event.button == 3: # right click @@ -469,14 +429,6 @@ class ZeroconfVcardWindow: '') self.xml.get_widget('local_jid_label').set_text(self.contact.jid) - log = True - if self.contact.jid in gajim.config.get_per('accounts', self.account, - 'no_log_for').split(' '): - log = False - checkbutton = self.xml.get_widget('log_history_checkbutton') - checkbutton.set_active(log) - checkbutton.connect('toggled', self.on_log_history_checkbutton_toggled) - resources = '%s (%s)' % (self.contact.resource, unicode( self.contact.priority)) uf_resources = self.contact.resource + _(' resource with priority ')\