當前位置: 首頁>>代碼示例>>Python>>正文


Python HobNotebook.reset_entry方法代碼示例

本文整理匯總了Python中bb.ui.crumbs.hobwidget.HobNotebook.reset_entry方法的典型用法代碼示例。如果您正苦於以下問題:Python HobNotebook.reset_entry方法的具體用法?Python HobNotebook.reset_entry怎麽用?Python HobNotebook.reset_entry使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在bb.ui.crumbs.hobwidget.HobNotebook的用法示例。


在下文中一共展示了HobNotebook.reset_entry方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: RecipeSelectionPage

# 需要導入模塊: from bb.ui.crumbs.hobwidget import HobNotebook [as 別名]
# 或者: from bb.ui.crumbs.hobwidget.HobNotebook import reset_entry [as 別名]

#.........這裏部分代碼省略.........
            self.ins.get_nth_page(current_tab).top_bar.show()
            self.ins.get_nth_page(current_tab).scroll.hide()
        else:
            if self.ins.get_nth_page(current_tab).top_bar:
                self.ins.get_nth_page(current_tab).top_bar.hide()
            self.ins.get_nth_page(current_tab).scroll.show()
        if entry.get_text() == '':
            entry.set_icon_sensitive(gtk.ENTRY_ICON_SECONDARY, False)
        else:
            entry.set_icon_sensitive(gtk.ENTRY_ICON_SECONDARY, True)

    def button_click_cb(self, widget, event):
        path, col = widget.table_tree.get_cursor()
        tree_model = widget.table_tree.get_model()
        if path and col.get_title() != 'Included': # else activation is likely a removal
            properties = {'summary': '', 'name': '', 'version': '', 'revision': '', 'binb': '', 'group': '', 'license': '', 'homepage': '', 'bugtracker': '', 'description': ''}
            properties['summary'] = tree_model.get_value(tree_model.get_iter(path), RecipeListModel.COL_SUMMARY)
            properties['name'] = tree_model.get_value(tree_model.get_iter(path), RecipeListModel.COL_NAME)
            properties['version'] = tree_model.get_value(tree_model.get_iter(path), RecipeListModel.COL_VERSION)
            properties['revision'] = tree_model.get_value(tree_model.get_iter(path), RecipeListModel.COL_REVISION)
            properties['binb'] = tree_model.get_value(tree_model.get_iter(path), RecipeListModel.COL_BINB)
            properties['group'] = tree_model.get_value(tree_model.get_iter(path), RecipeListModel.COL_GROUP)
            properties['license'] = tree_model.get_value(tree_model.get_iter(path), RecipeListModel.COL_LIC)
            properties['homepage'] = tree_model.get_value(tree_model.get_iter(path), RecipeListModel.COL_HOMEPAGE)
            properties['bugtracker'] = tree_model.get_value(tree_model.get_iter(path), RecipeListModel.COL_BUGTRACKER)
            properties['description'] = tree_model.get_value(tree_model.get_iter(path), RecipeListModel.COL_DESC)
            self.builder.show_recipe_property_dialog(properties)

    def build_packages_clicked_cb(self, button):
        self.refresh_tables()
        self.builder.build_packages()

    def refresh_tables(self):
        self.ins.reset_entry(self.ins.search, 0)
        for tab in self.tables:
            index = self.tables.index(tab)
            filter = self.pages[index]['filter']
            tab.set_model(self.recipe_model.tree_model(filter, search_data="", initial=True))

    def back_button_clicked_cb(self, button):
        self.builder.recipe_model.set_selected_image(self.builder.configuration.initial_selected_image)
        self.builder.image_configuration_page.update_image_combo(self.builder.recipe_model, self.builder.configuration.initial_selected_image)
        self.builder.image_configuration_page.update_image_desc()
        self.builder.show_configuration()
        self.refresh_tables()

    def refresh_selection(self):
        self.builder.configuration.selected_image = self.recipe_model.get_selected_image()
        _, self.builder.configuration.selected_recipes = self.recipe_model.get_selected_recipes()

    def toggle_item_idle_cb(self, path, view_tree, cell, pagename):
        if not self.recipe_model.path_included(path):
            self.recipe_model.include_item(item_path=path, binb="User Selected", image_contents=False)
        else:
            self.pre_fadeout_checkout_include(view_tree, pagename)
            self.recipe_model.exclude_item(item_path=path)
            self.render_fadeout(view_tree, cell)

        self.refresh_selection()
        if not self.builder.customized:
            self.builder.customized = True
            self.builder.configuration.selected_image = self.recipe_model.__custom_image__
            self.builder.rcppkglist_populated()

        self.builder.window_sensitive(True)
開發者ID:alex1818,項目名稱:yocto-iot,代碼行數:69,代碼來源:recipeselectionpage.py

示例2: PackageSelectionPage

# 需要導入模塊: from bb.ui.crumbs.hobwidget import HobNotebook [as 別名]
# 或者: from bb.ui.crumbs.hobwidget.HobNotebook import reset_entry [as 別名]

#.........這裏部分代碼省略.........
            properties = {'binb': '' , 'name': '', 'size':'', 'recipe':'', 'files_list':''}
            properties['binb'] = tree_model.get_value(tree_model.get_iter(path), PackageListModel.COL_BINB)
            properties['name'] = tree_model.get_value(tree_model.get_iter(path), PackageListModel.COL_NAME)
            properties['size'] = tree_model.get_value(tree_model.get_iter(path), PackageListModel.COL_SIZE)
            properties['recipe'] = tree_model.get_value(tree_model.get_iter(path), PackageListModel.COL_RCP)
            properties['files_list'] = tree_model.get_value(tree_model.get_iter(path), PackageListModel.COL_FLIST)

            self.builder.show_recipe_property_dialog(properties)

    def open_log_clicked_cb(self, button, log_file):
        if log_file:
            log_file = "file:///" + log_file
            gtk.show_uri(screen=button.get_screen(), uri=log_file, timestamp=0)

    def show_page(self, log_file):
        children = self.button_box.get_children() or []
        for child in children:
            self.button_box.remove(child)
        # re-packed the buttons as request, add the 'open log' button if build success
        self.button_box.pack_end(self.build_image_button, expand=False, fill=False)
        if log_file:
            open_log_button = HobAltButton("Open log")
            open_log_button.connect("clicked", self.open_log_clicked_cb, log_file)
            open_log_button.set_tooltip_text("Open the build's log file")
            self.button_box.pack_end(open_log_button, expand=False, fill=False)
        self.button_box.pack_end(self.back_button, expand=False, fill=False)
        self.show_all()

    def build_image_clicked_cb(self, button):
        self.builder.parsing_warnings = []
        self.builder.build_image()

    def refresh_tables(self):
        self.ins.reset_entry(self.ins.search, 0)
        for tab in self.tables:
            index = self.tables.index(tab)
            filter = self.pages[index]['filter']
            tab.set_model(self.package_model.tree_model(filter, initial=True))

    def back_button_clicked_cb(self, button):
        if self.builder.previous_step ==  self.builder.IMAGE_GENERATED:
            self.builder.restore_initial_selected_packages()
            self.refresh_selection()
            self.builder.show_image_details()
        else:
            self.builder.show_configuration()
        self.refresh_tables()

    def refresh_selection(self):
        self.builder.configuration.selected_packages = self.package_model.get_selected_packages()
        self.builder.configuration.user_selected_packages = self.package_model.get_user_selected_packages()
        selected_packages_num = len(self.builder.configuration.selected_packages)
        selected_packages_size = self.package_model.get_packages_size()
        selected_packages_size_str = HobPage._size_to_string(selected_packages_size)

        if self.builder.configuration.image_packages == self.builder.configuration.selected_packages:
            image_total_size_str = self.builder.configuration.image_size
        else:
            image_overhead_factor = self.builder.configuration.image_overhead_factor
            image_rootfs_size = self.builder.configuration.image_rootfs_size / 1024 # image_rootfs_size is KB
            image_extra_size = self.builder.configuration.image_extra_size / 1024 # image_extra_size is KB
            base_size = image_overhead_factor * selected_packages_size
            image_total_size = max(base_size, image_rootfs_size) + image_extra_size
            if "zypper" in self.builder.configuration.selected_packages:
                image_total_size += (51200 * 1024)
            image_total_size_str = HobPage._size_to_string(image_total_size)
開發者ID:karfield,項目名稱:bitbake,代碼行數:70,代碼來源:packageselectionpage.py

示例3: PackageSelectionPage

# 需要導入模塊: from bb.ui.crumbs.hobwidget import HobNotebook [as 別名]
# 或者: from bb.ui.crumbs.hobwidget.HobNotebook import reset_entry [as 別名]

#.........這裏部分代碼省略.........

    def build_image_clicked_cb(self, button):
        selected_pkgs = self.package_model.get_selected_packages()
        show_missing_pkg_dialog = False
        lbl = "<b>Missing important packages</b>\n\nYour list of included "
        lbl = lbl + " packages is missing:\n\n"
        if not ('eglibc' in selected_pkgs or 'uclibc' in selected_pkgs):
            show_missing_pkg_dialog = True
            lbl = lbl + "-A C library (choose eglibc or uclibc)\n\n"
        if not ('bash' in selected_pkgs or 'busybox'  in selected_pkgs):
            show_missing_pkg_dialog = True
            lbl = lbl + "-A shell provider (choose bash or busybox)\n\n"
        if 'initscripts' not in selected_pkgs:
            show_missing_pkg_dialog = True
            lbl = lbl + "-Initialization scripts (choose initscripts)\n\n"

        if show_missing_pkg_dialog:
            dialog = CrumbsMessageDialog(None, lbl, gtk.STOCK_DIALOG_INFO)
            button = dialog.add_button("Build anyway", gtk.RESPONSE_OK)
            tooltip = "Build the image without changing the included packages"
            button.set_tooltip_text(tooltip)
            HobButton.style_button(button)
            button = dialog.add_button("Edit packages", gtk.RESPONSE_CANCEL)
            tooltip = "Change the list of included packages"
            button.set_tooltip_text(tooltip)
            HobButton.style_button(button)
            response = dialog.run()
            dialog.destroy()
            if response == gtk.RESPONSE_CANCEL:
                return
        self.builder.build_image()

    def refresh_tables(self):
        self.ins.reset_entry(self.ins.search, 0)
        for tab in self.tables:
            index = self.tables.index(tab)
            filter = self.pages[index]['filter']
            tab.set_model(self.package_model.tree_model(filter, initial=True))

    def back_button_clicked_cb(self, button):
        self.builder.restore_initial_selected_packages()
        self.refresh_selection()
        self.ins.search.set_text("")
        self.builder.recipe_model.set_selected_image(self.builder.configuration.initial_selected_image)
        self.builder.image_configuration_page.update_image_combo(self.builder.configuration.initial_selected_image)
        self.builder.image_configuration_page.update_image_desc()
        self.builder.show_configuration()
        self.refresh_tables()

    def refresh_selection(self):
        self.builder.configuration.selected_packages = self.package_model.get_selected_packages()
        self.builder.configuration.user_selected_packages = self.package_model.get_user_selected_packages()
        selected_packages_num = len(self.builder.configuration.selected_packages)
        selected_packages_size = self.package_model.get_packages_size()
        selected_packages_size_str = HobPage._size_to_string(selected_packages_size)

        self.label.set_label("Packages included: %s   Selected packages size: %s" %
                            (selected_packages_num, selected_packages_size_str))

    def toggle_item_idle_cb(self, path, view_tree, cell, pagename):
        if not self.package_model.path_included(path):
            self.package_model.include_item(item_path=path, binb="User Selected")
        else:
            self.pre_fadeout_checkout_include(view_tree)
            self.package_model.exclude_item(item_path=path)
            self.render_fadeout(view_tree, cell)
開發者ID:alex1818,項目名稱:yocto-iot,代碼行數:70,代碼來源:packageselectionpage.py


注:本文中的bb.ui.crumbs.hobwidget.HobNotebook.reset_entry方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。