本文整理汇总了Python中stoqlib.gui.search.searchslave.SearchSlave.disable_search_entry方法的典型用法代码示例。如果您正苦于以下问题:Python SearchSlave.disable_search_entry方法的具体用法?Python SearchSlave.disable_search_entry怎么用?Python SearchSlave.disable_search_entry使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类stoqlib.gui.search.searchslave.SearchSlave
的用法示例。
在下文中一共展示了SearchSlave.disable_search_entry方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: SearchDialog
# 需要导入模块: from stoqlib.gui.search.searchslave import SearchSlave [as 别名]
# 或者: from stoqlib.gui.search.searchslave.SearchSlave import disable_search_entry [as 别名]
#.........这里部分代码省略.........
self.retval = retval
self.search.save_columns()
# FIXME: This should chain up so the "confirm" signal gets emitted
self.close()
def cancel(self, *args):
self.retval = []
self.search.save_columns()
# FIXME: This should chain up so the "cancel" signal gets emitted
self.close()
# FIXME: -> remove/use
# TODO: Check if we can remove
def set_searchbar_label(self, label):
search_filter = self.search.get_primary_filter()
search_filter.set_label(label)
def set_searchbar_search_string(self, string):
if string == self.get_searchbar_search_string():
return
search_filter = self.search.get_primary_filter()
search_filter.entry.set_text(string)
def get_searchbar_search_string(self):
search_filter = self.search.get_primary_filter()
return search_filter.get_state().text
def set_text_field_columns(self, columns):
"""See :class:`SearchSlave.set_text_field_columns`
"""
self.search.set_text_field_columns(columns)
def disable_search_entry(self):
"""See :class:`SearchSlave.disable_search_entry`
"""
self.search.disable_search_entry()
def add_filter(self, search_filter, position=SearchFilterPosition.BOTTOM,
columns=None, callback=None):
"""See :class:`SearchSlave.add_filter`
"""
self.search.add_filter(search_filter, position, columns, callback)
def row_activate(self, obj):
"""This is called when an item in the results list is double clicked.
:param obj: the item that was double clicked.
"""
if self.double_click_confirm:
# But only if its also confirmable with ok_button
if self.ok_button.props.sensitive:
self.confirm()
#
# Filters
#
def create_branch_filter(self, label=None):
from stoqlib.domain.person import Branch
branches = Branch.get_active_branches(self.store)
items = [(b.person.name, b.id) for b in branches]
# if not items:
# raise ValueError('You should have at least one branch at '
# 'this point')
items.insert(0, (_("Any"), None))
示例2: SearchDialog
# 需要导入模块: from stoqlib.gui.search.searchslave import SearchSlave [as 别名]
# 或者: from stoqlib.gui.search.searchslave.SearchSlave import disable_search_entry [as 别名]
#.........这里部分代码省略.........
SearchColumn('birth_date', search_column=self.birthday_search)
"""
if isinstance(state, DateQueryState):
if state.date:
return Individual.get_birthday_query(state.date)
elif isinstance(state, DateIntervalQueryState):
if state.start and state.end:
return Individual.get_birthday_query(state.start, state.end)
else:
raise AssertionError
# FIXME: -> remove/use
# TODO: Check if we can remove
def set_searchbar_label(self, label):
search_filter = self.search.get_primary_filter()
search_filter.set_label(label)
def set_searchbar_search_string(self, string):
if string == self.get_searchbar_search_string():
return
search_filter = self.search.get_primary_filter()
search_filter.entry.set_text(string)
def get_searchbar_search_string(self):
search_filter = self.search.get_primary_filter()
return search_filter.get_state().text
def set_text_field_columns(self, columns):
"""See :class:`SearchSlave.set_text_field_columns`
"""
self.search.set_text_field_columns(columns)
def disable_search_entry(self):
"""See :class:`SearchSlave.disable_search_entry`
"""
self.search.disable_search_entry()
def add_filter(self, search_filter, position=SearchFilterPosition.BOTTOM,
columns=None, callback=None):
"""See :class:`SearchSlave.add_filter`
"""
self.search.add_filter(search_filter, position, columns, callback)
def row_activate(self, obj):
"""This is called when an item in the results list is double clicked.
:param obj: the item that was double clicked.
"""
if self.double_click_confirm:
# But only if its also confirmable with ok_button
if self.ok_button.props.sensitive:
self.confirm()
def add_extension(self, extension):
"""Adds the extention to this search.
See :class:`stoqlib.gui.search.searchextention.SearchExtention for more
information
"""
extension.attach(self)
def add_columns(self, columns):
"""Add some columns to the default ones.
Note that this method must be called during the setup of this search,