本文整理汇总了Python中stoqlib.gui.base.dialogs.BasicDialog.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python BasicDialog.__init__方法的具体用法?Python BasicDialog.__init__怎么用?Python BasicDialog.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类stoqlib.gui.base.dialogs.BasicDialog
的用法示例。
在下文中一共展示了BasicDialog.__init__方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from stoqlib.gui.base.dialogs import BasicDialog [as 别名]
# 或者: from stoqlib.gui.base.dialogs.BasicDialog import __init__ [as 别名]
def __init__(self):
BasicDialog.__init__(self, title=self.title, size=self.size)
self.toplevel.set_deletable(False)
self._build_ui()
self._setup_buttons()
self.toplevel.connect('map-event', self._on_toplevel__map_event)
示例2: __init__
# 需要导入模块: from stoqlib.gui.base.dialogs import BasicDialog [as 别名]
# 或者: from stoqlib.gui.base.dialogs.BasicDialog import __init__ [as 别名]
def __init__(self, title=None, args=None, log_category=None,
start_msg=None, success_msg=None, failure_msg=None):
""":param title: The title of the window.
:param args: Default process and arguments to run.
:param log_category: Default process and arguments to run.
:param start_msg: Message that will appear on the progressbar before
the process is started.
:param success_msg: Message that will appear when process succeeds.
:param failure_msg: Message that will appear then the process fails.
"""
self.title = title or self.title
if not self.title:
raise ValueError('You must define a title for the window.')
self.args = args or self.args
if not self.args:
raise ValueError('You must define the process and arguments for '
'the process.')
self.log_category = log_category or self.log_category
if not self.log_category:
raise ValueError('You must define a log category to read the '
'output of the process from.')
self.start_msg = start_msg or self.start_msg
self.success_msg = success_msg or self.success_msg
self.failure_msg = failure_msg or self.failure_msg
BasicDialog.__init__(self, size=self.size, title=self.title)
self._build_ui()
self._execute()
示例3: __init__
# 需要导入模块: from stoqlib.gui.base.dialogs import BasicDialog [as 别名]
# 或者: from stoqlib.gui.base.dialogs.BasicDialog import __init__ [as 别名]
def __init__(self, store):
BasicDialog.__init__(self,
hide_footer=True, size=PaymentMethodsDialog.size,
title=PaymentMethodsDialog.title)
self._can_edit = False
self.store = store
self._setup_list()
self._setup_slaves()
示例4: __init__
# 需要导入模块: from stoqlib.gui.base.dialogs import BasicDialog [as 别名]
# 或者: from stoqlib.gui.base.dialogs.BasicDialog import __init__ [as 别名]
def __init__(self, format, filename):
BasicDialog.__init__(self, size=self.size, title=self.title)
self.format = format
self.filename = filename
self._build_ui()
self._execute()
示例5: __init__
# 需要导入模块: from stoqlib.gui.base.dialogs import BasicDialog [as 别名]
# 或者: from stoqlib.gui.base.dialogs.BasicDialog import __init__ [as 别名]
def __init__(self, store):
"""A dialog to print the PaymentFlowHistoryReport report.
:param store: a store
"""
self.store = store
BasicDialog.__init__(self, header_text='<b>%s</b>' % self.desc,
title=self.title)
self._setup_widgets()
示例6: __init__
# 需要导入模块: from stoqlib.gui.base.dialogs import BasicDialog [as 别名]
# 或者: from stoqlib.gui.base.dialogs.BasicDialog import __init__ [as 别名]
def __init__(self, store, printer):
self._constant_slave = None
self.store = store
self.printer = printer
BasicDialog.__init__(self, hide_footer=False, title='edit',
size=self.size)
self.main.set_border_width(6)
self._create_ui()
示例7: __init__
# 需要导入模块: from stoqlib.gui.base.dialogs import BasicDialog [as 别名]
# 或者: from stoqlib.gui.base.dialogs.BasicDialog import __init__ [as 别名]
def __init__(self, store):
header = _(u'Select the plugin you want to activate and click in '
'the apply button.')
BasicDialog.__init__(self, hide_footer=False,
size=PluginManagerDialog.size,
title=PluginManagerDialog.title,
header_text=header)
self.store = store
self._manager = get_plugin_manager()
self._setup_widgets()
示例8: __init__
# 需要导入模块: from stoqlib.gui.base.dialogs import BasicDialog [as 别名]
# 或者: from stoqlib.gui.base.dialogs.BasicDialog import __init__ [as 别名]
def __init__(self, store=None):
if self.list_slave_class is None:
fmt = "%s needs to set it's list_slave_class attribute"
raise TypeError(fmt % (self.__class__.__name__,))
self.list_slave = self.list_slave_class(self, store=store)
BasicDialog.__init__(self, title=self.title, size=self.size)
self.vbox = gtk.VBox()
self.vbox.pack_start(self.list_slave.listcontainer)
self.add(self.vbox)
self.vbox.show()
示例9: __init__
# 需要导入模块: from stoqlib.gui.base.dialogs import BasicDialog [as 别名]
# 或者: from stoqlib.gui.base.dialogs.BasicDialog import __init__ [as 别名]
def __init__(self, store):
BasicDialog.__init__(self, title=self.title)
self.justify_label(gtk.JUSTIFY_CENTER)
self.store = store
self.ok_button.set_label(_("Generate"))
self.date_filter = DateSearchFilter(_('Month:'))
self.date_filter.set_use_date_entries(False)
self.date_filter.clear_options()
self._populate_date_filter(self.date_filter)
self.date_filter.select()
self.add(self.date_filter)
self.date_filter.show()
示例10: __init__
# 需要导入模块: from stoqlib.gui.base.dialogs import BasicDialog [as 别名]
# 或者: from stoqlib.gui.base.dialogs.BasicDialog import __init__ [as 别名]
def __init__(self, store):
self.store = store
self.date_filter = DateSearchFilter(_('Year:'))
self.date_filter.clear_options()
self._populate_date_filter(self.date_filter)
self.date_filter.select()
self.date_filter.set_use_date_entries(False)
BasicDialog.__init__(self, title=self.title)
self.main_label.set_justify(Gtk.Justification.CENTER)
self.ok_button.set_label(_("Generate"))
self.add(self.date_filter)
self.date_filter.show()
示例11: __init__
# 需要导入模块: from stoqlib.gui.base.dialogs import BasicDialog [as 别名]
# 或者: from stoqlib.gui.base.dialogs.BasicDialog import __init__ [as 别名]
def __init__(self, store, search_spec=None, hide_footer=True,
title='', selection_mode=None, double_click_confirm=False,
initial_string=''):
"""
A base class for search dialog inheritance
:param store: a store
:param search_spec:
:param hide_footer:
:param title:
:param selection_mode:
:param double_click_confirm: If double click a item in the list should
automatically confirm
:param initial_string: the string that should be initially filtered
"""
self.store = store
self.search_spec = search_spec or self.search_spec
if not self.search_spec:
raise ValueError("%r needs a search table" % self)
self.selection_mode = self._setup_selection_mode(selection_mode)
self.summary_label = None
self.double_click_confirm = double_click_confirm
self.csv_button = None
self.initial_string = initial_string
BasicDialog.__init__(self, hide_footer=hide_footer,
main_label_text=self.main_label_text,
title=title or self.title,
size=self.size)
self.enable_window_controls()
self.disable_ok()
self.set_ok_label(_('Se_lect Items'))
self._setup_search()
self._setup_details_slave()
self._create_default_filters()
self.create_filters()
self.setup_widgets()
if self.search_label:
self.set_searchbar_label(self.search_label)
if self.initial_string:
search_filter = self.search.get_primary_filter()
search_filter.set_state(self.initial_string)
self.search.refresh()
search_filter.entry.grab_focus()
示例12: __init__
# 需要导入模块: from stoqlib.gui.base.dialogs import BasicDialog [as 别名]
# 或者: from stoqlib.gui.base.dialogs.BasicDialog import __init__ [as 别名]
def __init__(self, store, search_table=None, hide_footer=True,
title='', selection_mode=None, double_click_confirm=False):
"""
A base class for search dialog inheritance
:param store: a store
:param table:
:param search_table:
:param hide_footer:
:param title:
:param selection_mode:
:param double_click_confirm: If double click a item in the list should
automatically confirm
"""
self.store = store
self.search_table = search_table or self.search_table
if not self.search_table:
raise ValueError("%r needs a search table" % self)
self.selection_mode = self._setup_selection_mode(selection_mode)
self.summary_label = None
self.double_click_confirm = double_click_confirm
BasicDialog.__init__(self, hide_footer=hide_footer,
main_label_text=self.main_label_text,
title=title or self.title,
size=self.size)
self.executer = QueryExecuter(store)
# FIXME: Remove this limit, but we need to migrate all existing
# searches to use lazy lists first. That in turn require
# us to rewrite the queries in such a way that count(*)
# will work properly.
self.executer.set_limit(sysparam(self.store).MAX_SEARCH_RESULTS)
self.set_table(self.search_table)
self.enable_window_controls()
self.disable_ok()
self.set_ok_label(_('Se_lect Items'))
self._setup_search()
self._setup_details_slave()
self.create_filters()
self.setup_widgets()
if self.search_label:
self.set_searchbar_label(self.search_label)
示例13: __init__
# 需要导入模块: from stoqlib.gui.base.dialogs import BasicDialog [as 别名]
# 或者: from stoqlib.gui.base.dialogs.BasicDialog import __init__ [as 别名]
def __init__(
self, store, search_spec=None, hide_footer=True, title="", selection_mode=None, double_click_confirm=False
):
"""
A base class for search dialog inheritance
:param store: a store
:param table:
:param search_spec:
:param hide_footer:
:param title:
:param selection_mode:
:param double_click_confirm: If double click a item in the list should
automatically confirm
"""
self.store = store
self.search_spec = search_spec or self.search_spec
if not self.search_spec:
raise ValueError("%r needs a search table" % self)
self.selection_mode = self._setup_selection_mode(selection_mode)
self.summary_label = None
self.double_click_confirm = double_click_confirm
BasicDialog.__init__(
self,
hide_footer=hide_footer,
main_label_text=self.main_label_text,
title=title or self.title,
size=self.size,
)
self.enable_window_controls()
self.disable_ok()
self.set_ok_label(_("Se_lect Items"))
self._setup_search()
self._setup_details_slave()
self.create_filters()
self.setup_widgets()
if self.search_label:
self.set_searchbar_label(self.search_label)
示例14: __init__
# 需要导入模块: from stoqlib.gui.base.dialogs import BasicDialog [as 别名]
# 或者: from stoqlib.gui.base.dialogs.BasicDialog import __init__ [as 别名]
def __init__(self, title=None, header_text=None):
title = title or self.title
header_text = '<b>%s</b>' % header_text if header_text else ''
BasicDialog.__init__(self, title=title, header_text=header_text)
self._setup_widgets()
示例15: __init__
# 需要导入模块: from stoqlib.gui.base.dialogs import BasicDialog [as 别名]
# 或者: from stoqlib.gui.base.dialogs.BasicDialog import __init__ [as 别名]
def __init__(self, store):
self.store = store
BasicDialog.__init__(self, size=FormFieldEditor.size,
title=FormFieldEditor.title)
self._create_ui()