rename roster_filter_ to rfilter_. and special thanks to otradox for his patch. fix #5221

This commit is contained in:
Julien Pivotto 2011-04-18 12:04:47 +02:00
parent 3df60009ce
commit b36881782d
2 changed files with 25 additions and 25 deletions

View File

@ -219,14 +219,14 @@
</object>
</child>
<child>
<object class="GtkCheckMenuItem" id="show_roster_filter_menuitem">
<object class="GtkCheckMenuItem" id="show_rfilter_menuitem">
<property name="visible">True</property>
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="label" translatable="yes">Show Roster F_ilter</property>
<property name="use_underline">True</property>
<property name="active">False</property>
<accelerator key="I" signal="activate" modifiers="GDK_CONTROL_MASK"/>
<signal name="toggled" handler="on_show_roster_filter_menuitem_toggled"/>
<signal name="toggled" handler="on_show_rfilter_menuitem_toggled"/>
</object>
</child>
<child>
@ -343,15 +343,15 @@
<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkEntry" id="roster_filter_entry">
<object class="GtkEntry" id="rfilter_entry">
<property name="visible">False</property>
<property name="no_show_all">True</property>
<property name="editable">False</property>
<property name="can_focus">True</property>
<property name="primary_icon_stock">gtk-close</property>
<property name="primary_icon_activatable">True</property>
<signal name="changed" handler="on_roster_filter_entry_changed"/>
<signal name="icon_press" handler="on_roster_filter_entry_icon_press"/>
<signal name="changed" handler="on_rfilter_entry_changed"/>
<signal name="icon_press" handler="on_rfilter_entry_icon_press"/>
</object>
<packing>
<property name="expand">False</property>

View File

@ -1589,8 +1589,8 @@ class RosterWindow:
grp = delimiter.join(grp.split(delimiter)[:-1])
return False
if type_ == 'contact':
if self.roster_filter_enabled:
return self.roster_filter_string in model[titer][C_NAME].lower()
if self.rfilter_enabled:
return self.rfilter_string in model[titer][C_NAME].lower()
if gajim.config.get('showoffline'):
return True
bb_jid = None
@ -4167,29 +4167,29 @@ class RosterWindow:
if self.hpaned.get_child2() is not None:
self.show_roster_vbox(widget.get_active())
def on_roster_filter_entry_changed(self, widget):
def on_rfilter_entry_changed(self, widget):
""" When we update the content of the filter """
self.roster_filter_string = widget.get_text().lower()
if self.roster_filter_string == '':
self.roster_filter_enabled = False
self.rfilter_string = widget.get_text().lower()
if self.rfilter_string == '':
self.rfilter_enabled = False
else:
self.roster_filter_enabled = True
self.rfilter_enabled = True
self.refilter_shown_roster_items()
def on_roster_filter_entry_icon_press(self, widget, icon, event):
def on_rfilter_entry_icon_press(self, widget, icon, event):
""" Disable the roster filtering by clicking the icon in the textEntry """
self.xml.get_object('show_roster_filter_menuitem').set_active(False)
self.roster_filter_enabled = False
self.xml.get_object('show_rfilter_menuitem').set_active(False)
self.rfilter_enabled = False
self.refilter_shown_roster_items()
def on_show_roster_filter_menuitem_toggled(self, widget):
def on_show_rfilter_menuitem_toggled(self, widget):
""" Show the roster filter entry """
self.roster_filter_enabled = widget.get_active()
self.roster_filter_entry.set_visible(self.roster_filter_enabled)
self.roster_filter_entry.set_editable(self.roster_filter_enabled)
if self.roster_filter_enabled:
self.roster_filter_entry.set_text('')
self.roster_filter_entry.grab_focus()
self.rfilter_enabled = widget.get_active()
self.rfilter_entry.set_visible(self.rfilter_enabled)
self.rfilter_entry.set_editable(self.rfilter_enabled)
if self.rfilter_enabled:
self.rfilter_entry.set_text('')
self.rfilter_entry.grab_focus()
def on_roster_hpaned_notify(self, pane, gparamspec):
"""
@ -6372,9 +6372,9 @@ class RosterWindow:
gtk.keysyms.n, gtk.gdk.CONTROL_MASK, gtk.ACCEL_VISIBLE)
# Setting the search stuff
self.roster_filter_entry = self.xml.get_object('roster_filter_entry')
self.roster_filter_string = ''
self.roster_filter_enabled = False
self.rfilter_entry = self.xml.get_object('rfilter_entry')
self.rfilter_string = ''
self.rfilter_enabled = False
gajim.ged.register_event_handler('presence-received', ged.GUI1,
self._nec_presence_received)