• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python dialogs.BasicDialog类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中stoqlib.gui.base.dialogs.BasicDialog的典型用法代码示例。如果您正苦于以下问题:Python BasicDialog类的具体用法?Python BasicDialog怎么用?Python BasicDialog使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了BasicDialog类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: __init__

    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)
开发者ID:leandrorchaves,项目名称:stoq,代码行数:7,代码来源:welcomedialog.py


示例2: __init__

    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()
开发者ID:marianaanselmo,项目名称:stoq,代码行数:32,代码来源:progressbardialog.py


示例3: __init__

 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()
开发者ID:hackedbellini,项目名称:stoq,代码行数:8,代码来源:paymentmethod.py


示例4: __init__

    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()
开发者ID:romaia,项目名称:stoq,代码行数:8,代码来源:importerdialog.py


示例5: __init__

    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()
开发者ID:LeonamSilva,项目名称:stoq,代码行数:9,代码来源:paymentflowhistorydialog.py


示例6: __init__

 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()
开发者ID:romaia,项目名称:stoq,代码行数:10,代码来源:pluginsdialog.py


示例7: confirm

    def confirm(self):
        BasicDialog.confirm(self)

        state = self.date_filter.get_state()
        if isinstance(state, DateQueryState):
            start, end = state.date, state.date
        else:
            start, end = state.start, state.end

        self.retval = date_range(start=start, end=end)
开发者ID:Guillon88,项目名称:stoq,代码行数:10,代码来源:daterangedialog.py


示例8: __init__

    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()
开发者ID:leandrorchaves,项目名称:stoq,代码行数:10,代码来源:deviceconstanteditor.py


示例9: __init__

    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()
开发者ID:rosalin,项目名称:stoq,代码行数:12,代码来源:lists.py


示例10: __init__

    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()
开发者ID:tmaxter,项目名称:stoq,代码行数:15,代码来源:sintegradialog.py


示例11: __init__

    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()
开发者ID:hackedbellini,项目名称:stoq,代码行数:15,代码来源:financialreportdialog.py


示例12: __init__

    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()
开发者ID:Guillon88,项目名称:stoq,代码行数:48,代码来源:searchdialog.py


示例13: __init__

    def __init__(self, store, model=None, visual_mode=False):
        if store is not None and isinstance(store, StoqlibStore):
            store.needs_retval = True
        self._confirm_disabled = False

        # FIXME:
        # BasicEditor should inheirt from BasicDialog and instantiate
        # the slave inside here, but it requires some major surgery
        BaseEditorSlave.__init__(self, store, model,
                                 visual_mode=visual_mode)

        self.main_dialog = BasicDialog(title=self.get_title(self.model),
                                       header_text=self.header,
                                       help_section=self.help_section,
                                       size=self.size)
        # Do not close the dialog if re return False on self.confirm
        self.main_dialog.enable_confirm_validation = True
        self.main_dialog.attach_slave("main", self)
        self.main_dialog.connect('confirm', self._on_main_dialog__confirm)
        self.main_dialog.connect('cancel', self._on_main_dialog__cancel)

        # This helps kiwis ui test, set the name of ourselves to
        # the classname of the slave, which is much more helpful than
        # just "BasicDialog"
        self.main_dialog.get_toplevel().set_name(self.__class__.__name__)

        if self.hide_footer or self.visual_mode:
            self.main_dialog.hide_footer()

        for name in self.confirm_widgets:
            self.set_confirm_widget(getattr(self, name))

        self.register_validate_function(self._validation_function)
        self.force_validation()
开发者ID:romaia,项目名称:stoq,代码行数:34,代码来源:baseeditor.py


示例14: __init__

    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)
开发者ID:tmaxter,项目名称:stoq,代码行数:46,代码来源:searchdialog.py


示例15: __init__

    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)
开发者ID:rg3915,项目名称:stoq,代码行数:42,代码来源:searchdialog.py


示例16: __init__

    def __init__(self, store, model=None, visual_mode=False):
        self._confirm_disabled = False

        # FIXME:
        # BasicEditor should inheirt from BasicDialog and instantiate
        # the slave inside here, but it requires some major surgery
        BaseEditorSlave.__init__(self, store, model,
                                 visual_mode=visual_mode)

        self.main_dialog = BasicDialog(title=self.get_title(self.model),
                                       header_text=self.header,
                                       help_section=self.help_section,
                                       size=self.size)
        # Do not close the dialog if re return False on self.confirm
        self.main_dialog.enable_confirm_validation = True
        self.main_dialog.attach_slave("main", self)
        self.main_dialog.connect('confirm', self._on_main_dialog__confirm)
        self.main_dialog.connect('cancel', self._on_main_dialog__cancel)

        dialog_toplevel = self.main_dialog.get_toplevel()
        dialog_toplevel.connect('response', self._on_toplevel__response)
        dialog_toplevel.connect('delete-event', self._on_toplevel__delete_event)

        # This helps kiwis ui test, set the name of ourselves to
        # the classname of the slave, which is much more helpful than
        # just "BasicDialog"
        self.main_dialog.get_toplevel().set_name(self.__class__.__name__)

        if self.hide_footer or self.visual_mode:
            self.main_dialog.hide_footer()

        for name in self.confirm_widgets:
            self.set_confirm_widget(getattr(self, name))

        self.register_validate_function(self._validation_function)
        self.force_validation()
        # We need to use self.model instead of model, since BaseEditorSlave
        # will create one if its None
        EditorCreateEvent.emit(self, self.model, store, visual_mode)

        if store is not None:
            # This needs to be the last thing done on __init__ since we don't want
            # to consider things like self.create_model as a change
            self._store_pending_count = store.get_pending_count()
开发者ID:Guillon88,项目名称:stoq,代码行数:44,代码来源:baseeditor.py


示例17: confirm

 def confirm(self, *args):
     self.store.confirm(True)
     BasicDialog.confirm(self, *args)
开发者ID:igorferreira,项目名称:stoq,代码行数:3,代码来源:formfieldeditor.py


示例18: cancel

 def cancel(self, *args):
     self.store.rollback(close=False)
     BasicDialog.confirm(self, *args)
开发者ID:Joaldino,项目名称:stoq,代码行数:3,代码来源:formfieldeditor.py


示例19: confirm

 def confirm(self, *args):
     self.store.confirm(True)
     BasicDialog.confirm(self, *args)
     info(_("Changes will be applied after all instances of Stoq are restarted."))
开发者ID:Joaldino,项目名称:stoq,代码行数:4,代码来源:formfieldeditor.py


示例20: __init__

 def __init__(self, store):
     self.store = store
     BasicDialog.__init__(self, size=FormFieldEditor.size,
                          title=FormFieldEditor.title)
     self._create_ui()
开发者ID:Joaldino,项目名称:stoq,代码行数:5,代码来源:formfieldeditor.py



注:本文中的stoqlib.gui.base.dialogs.BasicDialog类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python lists.ModelListSlave类代码示例发布时间:2022-05-27
下一篇:
Python dialogs.run_dialog函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap