本文整理汇总了Python中stoqlib.gui.search.searchdialog.SearchDialog.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python SearchDialog.__init__方法的具体用法?Python SearchDialog.__init__怎么用?Python SearchDialog.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类stoqlib.gui.search.searchdialog.SearchDialog
的用法示例。
在下文中一共展示了SearchDialog.__init__方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from stoqlib.gui.search.searchdialog import SearchDialog [as 别名]
# 或者: from stoqlib.gui.search.searchdialog.SearchDialog import __init__ [as 别名]
def __init__(self, store, editor_class=None, interface=None,
search_spec=None, hide_footer=True,
title='', selection_mode=None,
hide_toolbar=False, double_click_confirm=False):
"""
Create a new SearchEditor object.
:param store:
:param table:
:param editor_class:
:param interface: The interface which we need to apply to the objects in
kiwi list to get adapter for the editor.
:param search_spec:
:param hide_footer:
:param title:
:param selection_mode:
:param hide_toolbar:
:param double_click_confirm: If double click a item in the list should
automatically confirm. Double click confirms takes precedence over
editor_class (ie, if double_click_confirmis is True, it will
confirm the dialog, instead of opening the editor).
"""
if selection_mode is None:
selection_mode = gtk.SELECTION_BROWSE
self.interface = interface
self._read_only = False
self._message_bar = None
SearchDialog.__init__(self, store, search_spec,
hide_footer=hide_footer, title=title,
selection_mode=selection_mode,
double_click_confirm=double_click_confirm)
self._setup_slaves()
if hide_toolbar:
self.accept_edit_data = False
self._toolbar.get_toplevel().hide()
else:
if not (self.has_new_button or self.has_edit_button):
raise ValueError("You must set hide_footer=False instead "
"of disable these two attributes.")
editor_class = editor_class or self.editor_class
if not editor_class:
raise ValueError('An editor_class argument is required')
if not issubclass(editor_class, BaseEditor):
raise TypeError("editor_class must be a BaseEditor subclass")
self.editor_class = editor_class
self.accept_edit_data = self.has_edit_button
if not self.has_new_button:
self.hide_new_button()
if not self.has_edit_button:
self.hide_edit_button()
self._selected = None
self.update_widgets()
self.set_edit_button_sensitive(False)
self.results.connect('selection-changed', self._on_selection_changed)
self._check_permissions()
示例2: __init__
# 需要导入模块: from stoqlib.gui.search.searchdialog import SearchDialog [as 别名]
# 或者: from stoqlib.gui.search.searchdialog.SearchDialog import __init__ [as 别名]
def __init__(self, store):
self._fields = self.get_fields(store)
SearchDialog.__init__(self, store, hide_footer=False)
self.set_ok_label(_('Save'))
self.ok_button.set_sensitive(True)
self.mass_editor = MassEditorWidget(store, self._fields, self.results)
self.search.vbox.pack_start(self.mass_editor, False, False, 0)
self.search.vbox.reorder_child(self.mass_editor, 1)
self.mass_editor.show_all()
示例3: __init__
# 需要导入模块: from stoqlib.gui.search.searchdialog import SearchDialog [as 别名]
# 或者: from stoqlib.gui.search.searchdialog.SearchDialog import __init__ [as 别名]
def __init__(self, store):
SearchDialog.__init__(self, store)
self._setup_widgets()
示例4: __init__
# 需要导入模块: from stoqlib.gui.search.searchdialog import SearchDialog [as 别名]
# 或者: from stoqlib.gui.search.searchdialog.SearchDialog import __init__ [as 别名]
def __init__(self, store):
SearchDialog.__init__(self, store)
self.results.connect('selection-changed', self._on_selection_changed)
self._setup_button_slave()
示例5: __init__
# 需要导入模块: from stoqlib.gui.search.searchdialog import SearchDialog [as 别名]
# 或者: from stoqlib.gui.search.searchdialog.SearchDialog import __init__ [as 别名]
def __init__(self, store, storable):
self._storable = storable
dialog_title = _("Stock of %s") % storable.product.description
SearchDialog.__init__(self, store, title=dialog_title)
self.search.refresh()
示例6: __init__
# 需要导入模块: from stoqlib.gui.search.searchdialog import SearchDialog [as 别名]
# 或者: from stoqlib.gui.search.searchdialog.SearchDialog import __init__ [as 别名]
def __init__(self, store, client=None):
"""
:param client: the client which salaries will be searched
"""
self.client = client
SearchDialog.__init__(self, store)
示例7: __init__
# 需要导入模块: from stoqlib.gui.search.searchdialog import SearchDialog [as 别名]
# 或者: from stoqlib.gui.search.searchdialog.SearchDialog import __init__ [as 别名]
def __init__(self, store):
SearchDialog.__init__(self, store, self.search_table,
title=self.title)
self.set_details_button_sensitive(False)
self.results.connect('selection-changed', self.on_selection_changed)