当前位置: 首页>>代码示例>>Python>>正文


Python HobProgressBar.set_text方法代码示例

本文整理汇总了Python中bb.ui.crumbs.progressbar.HobProgressBar.set_text方法的典型用法代码示例。如果您正苦于以下问题:Python HobProgressBar.set_text方法的具体用法?Python HobProgressBar.set_text怎么用?Python HobProgressBar.set_text使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在bb.ui.crumbs.progressbar.HobProgressBar的用法示例。


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

示例1: ImageConfigurationPage

# 需要导入模块: from bb.ui.crumbs.progressbar import HobProgressBar [as 别名]
# 或者: from bb.ui.crumbs.progressbar.HobProgressBar import set_text [as 别名]
class ImageConfigurationPage (HobPage):

    __dummy_machine__ = "--select a machine--"
    __dummy_image__   = "--select a base image--"

    def __init__(self, builder):
        super(ImageConfigurationPage, self).__init__(builder, "Image configuration")

        self.image_combo_id = None
        # we use machine_combo_changed_by_manual to identify the machine is changed by code
        # or by manual. If by manual, all user's recipe selection and package selection are
        # cleared.
        self.machine_combo_changed_by_manual = True
        self.stopping = False
        self.create_visual_elements()

    def create_visual_elements(self):
        # create visual elements
        self.toolbar = gtk.Toolbar()
        self.toolbar.set_orientation(gtk.ORIENTATION_HORIZONTAL)
        self.toolbar.set_style(gtk.TOOLBAR_BOTH)

        template_button = self.append_toolbar_button(self.toolbar,
            "Templates",
            hic.ICON_TEMPLATES_DISPLAY_FILE,
            hic.ICON_TEMPLATES_HOVER_FILE,
            "Load a previously saved template",
            self.template_button_clicked_cb)
        my_images_button = self.append_toolbar_button(self.toolbar,
            "Images",
            hic.ICON_IMAGES_DISPLAY_FILE,
            hic.ICON_IMAGES_HOVER_FILE,
            "Open previously built images",
            self.my_images_button_clicked_cb)
        settings_button = self.append_toolbar_button(self.toolbar,
            "Settings",
            hic.ICON_SETTINGS_DISPLAY_FILE,
            hic.ICON_SETTINGS_HOVER_FILE,
            "View additional build settings",
            self.settings_button_clicked_cb)

        self.config_top_button = self.add_onto_top_bar(self.toolbar)

        self.gtable = gtk.Table(40, 40, True)
        self.create_config_machine()
        self.create_config_baseimg()
        self.config_build_button = self.create_config_build_button()

    def _remove_all_widget(self):
        children = self.gtable.get_children() or []
        for child in children:
            self.gtable.remove(child)
        children = self.box_group_area.get_children() or []
        for child in children:
            self.box_group_area.remove(child)
        children = self.get_children() or []
        for child in children:
            self.remove(child)

    def _pack_components(self, pack_config_build_button = False):
        self._remove_all_widget()
        self.pack_start(self.config_top_button, expand=False, fill=False)
        self.pack_start(self.group_align, expand=True, fill=True)

        self.box_group_area.pack_start(self.gtable, expand=True, fill=True)
        if pack_config_build_button:
            self.box_group_area.pack_end(self.config_build_button, expand=False, fill=False)
        else:
            box = gtk.HBox(False, 6)
            box.show()
            subbox = gtk.HBox(False, 0)
            subbox.set_size_request(205, 49)
            subbox.show()
            box.add(subbox)
            self.box_group_area.pack_end(box, False, False)

    def show_machine(self):
        self.progress_bar.reset()
        self._pack_components(pack_config_build_button = False)
        self.set_config_machine_layout(show_progress_bar = False)
        self.show_all()

    def update_progress_bar(self, title, fraction, status=None):
        if self.stopping == False:
            self.progress_bar.update(fraction)
            self.progress_bar.set_text(title)
            self.progress_bar.set_rcstyle(status)

    def show_info_populating(self):
        self._pack_components(pack_config_build_button = False)
        self.set_config_machine_layout(show_progress_bar = True)
        self.show_all()

    def show_info_populated(self):
        self.progress_bar.reset()
        self._pack_components(pack_config_build_button = False)
        self.set_config_machine_layout(show_progress_bar = False)
        self.set_config_baseimg_layout()
        self.show_all()

#.........这里部分代码省略.........
开发者ID:MentorEmbedded,项目名称:bitbake,代码行数:103,代码来源:imageconfigurationpage.py

示例2: ImageConfigurationPage

# 需要导入模块: from bb.ui.crumbs.progressbar import HobProgressBar [as 别名]
# 或者: from bb.ui.crumbs.progressbar.HobProgressBar import set_text [as 别名]
class ImageConfigurationPage (HobPage):

    __dummy_machine__ = "--select a machine--"
    __dummy_image__   = "--select an image recipe--"
    __custom_image__  = "Select from my image recipes"

    def __init__(self, builder):
        super(ImageConfigurationPage, self).__init__(builder, "Image configuration")

        self.image_combo_id = None
        # we use machine_combo_changed_by_manual to identify the machine is changed by code
        # or by manual. If by manual, all user's recipe selection and package selection are
        # cleared.
        self.machine_combo_changed_by_manual = True
        self.stopping = False
        self.warning_shift = 0
        self.custom_image_selected = None
        self.create_visual_elements()

    def create_visual_elements(self):
        # create visual elements
        self.toolbar = gtk.Toolbar()
        self.toolbar.set_orientation(gtk.ORIENTATION_HORIZONTAL)
        self.toolbar.set_style(gtk.TOOLBAR_BOTH)

        my_images_button = self.append_toolbar_button(self.toolbar,
            "Images",
            hic.ICON_IMAGES_DISPLAY_FILE,
            hic.ICON_IMAGES_HOVER_FILE,
            "Open previously built images",
            self.my_images_button_clicked_cb)
        settings_button = self.append_toolbar_button(self.toolbar,
            "Settings",
            hic.ICON_SETTINGS_DISPLAY_FILE,
            hic.ICON_SETTINGS_HOVER_FILE,
            "View additional build settings",
            self.settings_button_clicked_cb)

        self.config_top_button = self.add_onto_top_bar(self.toolbar)

        self.gtable = gtk.Table(40, 40, True)
        self.create_config_machine()
        self.create_config_baseimg()
        self.config_build_button = self.create_config_build_button()

    def _remove_all_widget(self):
        children = self.gtable.get_children() or []
        for child in children:
            self.gtable.remove(child)
        children = self.box_group_area.get_children() or []
        for child in children:
            self.box_group_area.remove(child)
        children = self.get_children() or []
        for child in children:
            self.remove(child)

    def _pack_components(self, pack_config_build_button = False):
        self._remove_all_widget()
        self.pack_start(self.config_top_button, expand=False, fill=False)
        self.pack_start(self.group_align, expand=True, fill=True)

        self.box_group_area.pack_start(self.gtable, expand=True, fill=True)
        if pack_config_build_button:
            self.box_group_area.pack_end(self.config_build_button, expand=False, fill=False)
        else:
            box = gtk.HBox(False, 6)
            box.show()
            subbox = gtk.HBox(False, 0)
            subbox.set_size_request(205, 49)
            subbox.show()
            box.add(subbox)
            self.box_group_area.pack_end(box, False, False)

    def show_machine(self):
        self.progress_bar.reset()
        self._pack_components(pack_config_build_button = False)
        self.set_config_machine_layout(show_progress_bar = False)
        self.show_all()

    def update_progress_bar(self, title, fraction, status=None):
        if self.stopping == False:
            self.progress_bar.update(fraction)
            self.progress_bar.set_text(title)
            self.progress_bar.set_rcstyle(status)

    def show_info_populating(self):
        self._pack_components(pack_config_build_button = False)
        self.set_config_machine_layout(show_progress_bar = True)
        self.show_all()

    def show_info_populated(self):
        self.progress_bar.reset()
        self._pack_components(pack_config_build_button = False)
        self.set_config_machine_layout(show_progress_bar = False)
        self.set_config_baseimg_layout()
        self.show_all()

    def show_baseimg_selected(self):
        self.progress_bar.reset()
        self._pack_components(pack_config_build_button = True)
#.........这里部分代码省略.........
开发者ID:Dagaweyne,项目名称:yocto-for-pandaboard,代码行数:103,代码来源:imageconfigurationpage.py


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