Move log_for_this_contact checkbutton from vcard dialog to history dialog. So you can NOT
log some chatrooms. Fixes #2592.
This commit is contained in:
parent
758f7949ca
commit
8c2c43be0f
|
@ -87,6 +87,25 @@
|
|||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkCheckButton" id="log_history_checkbutton">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label" translatable="yes">_Log conversation history</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<property name="active">True</property>
|
||||
<property name="inconsistent">False</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkExpander" id="search_expander">
|
||||
<property name="visible">True</property>
|
||||
|
|
|
@ -432,25 +432,6 @@
|
|||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkCheckButton" id="log_history_checkbutton">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="label" translatable="yes">_Log conversation history</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="relief">GTK_RELIEF_NORMAL</property>
|
||||
<property name="focus_on_click">True</property>
|
||||
<property name="active">True</property>
|
||||
<property name="inconsistent">False</property>
|
||||
<property name="draw_indicator">True</property>
|
||||
</widget>
|
||||
<packing>
|
||||
<property name="padding">0</property>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
</packing>
|
||||
</child>
|
||||
|
||||
<child>
|
||||
<widget class="GtkExpander" id="expander5">
|
||||
<property name="visible">True</property>
|
||||
|
|
|
@ -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))
|
||||
|
||||
|
|
48
src/vcard.py
48
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:
|
|||
'</span></b>')
|
||||
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 ')\
|
||||
|
|
Loading…
Reference in New Issue