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


Python HobNotebook.set_entry方法代碼示例

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


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

示例1: PackageSelectionPage

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

#.........這裏部分代碼省略.........
        super(PackageSelectionPage, self).__init__(builder, "Packages")

        # set invisiable members
        self.recipe_model = self.builder.recipe_model
        self.package_model = self.builder.package_model

        # create visual elements
        self.create_visual_elements()

    def create_visual_elements(self):
        self.label = gtk.Label("Packages included: 0\nSelected packages size: 0 MB")
        self.eventbox = self.add_onto_top_bar(self.label, 73)
        self.pack_start(self.eventbox, expand=False, fill=False)
        self.pack_start(self.group_align, expand=True, fill=True)

        # set visiable members
        self.ins = HobNotebook()
        self.tables = [] # we need to modify table when the dialog is shown
        # append the tab
        for page in self.pages:
            columns = page['columns']
            tab = HobViewTable(columns)
            filter = page['filter']
            tab.set_model(self.package_model.tree_model(filter))
            tab.connect("toggled", self.table_toggled_cb, page['name'])
            tab.connect_group_selection(self.table_selected_cb)
            if page['name'] == "Included":
                tab.connect("button-release-event", self.button_click_cb)
                tab.connect("cell-fadeinout-stopped", self.after_fadeout_checkin_include)
            label = gtk.Label(page['name'])
            self.ins.append_page(tab, label)
            self.tables.append(tab)

        self.ins.set_entry("Search packages:")
        # set the search entry for each table
        for tab in self.tables:
            tab.set_search_entry(0, self.ins.search)

        # add all into the dialog
        self.box_group_area.pack_start(self.ins, expand=True, fill=True)

        button_box = gtk.HBox(False, 6)
        self.box_group_area.pack_start(button_box, expand=False, fill=False)

        self.build_image_button = HobButton('Build image')
        self.build_image_button.set_size_request(205, 49)
        self.build_image_button.set_tooltip_text("Build target image")
        self.build_image_button.set_flags(gtk.CAN_DEFAULT)
        self.build_image_button.grab_default()
        self.build_image_button.connect("clicked", self.build_image_clicked_cb)
        button_box.pack_end(self.build_image_button, expand=False, fill=False)

        self.back_button = HobAltButton("<< Back to image configuration")
        self.back_button.connect("clicked", self.back_button_clicked_cb)
        button_box.pack_start(self.back_button, expand=False, fill=False)

    def button_click_cb(self, widget, event):
        path, col = widget.table_tree.get_cursor()
        tree_model = widget.table_tree.get_model()
        if path: # else activation is likely a removal
            binb = tree_model.get_value(tree_model.get_iter(path), PackageListModel.COL_BINB)
            if binb:
                self.builder.show_binb_dialog(binb)

    def build_image_clicked_cb(self, button):
        self.builder.build_image()
開發者ID:sunfirefox,項目名稱:bitbake,代碼行數:70,代碼來源:packageselectionpage.py

示例2: PackageSelectionPage

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

#.........這裏部分代碼省略.........
        self.create_visual_elements()

    def included_clicked_cb(self, button):
        self.ins.set_current_page(self.INCLUDED)

    def create_visual_elements(self):
        self.label = gtk.Label("Packages included: 0\nSelected packages size: 0 MB")
        self.eventbox = self.add_onto_top_bar(self.label, 73)
        self.pack_start(self.eventbox, expand=False, fill=False)
        self.pack_start(self.group_align, expand=True, fill=True)

        # set visible members
        self.ins = HobNotebook()
        self.tables = [] # we need to modify table when the dialog is shown

        search_names = []
        search_tips = []
        # append the tab
        for page in self.pages:
            columns = page['columns']
            name = page['name']
            tab = HobViewTable(columns, name)
            search_names.append(page['search'])
            search_tips.append(page['searchtip'])
            filter = page['filter']
            sort_model = self.package_model.tree_model(filter, initial=True)
            tab.set_model(sort_model)
            tab.connect("toggled", self.table_toggled_cb, name)
            tab.connect("button-release-event", self.button_click_cb)
            tab.connect("cell-fadeinout-stopped", self.after_fadeout_checkin_include, filter)
            self.ins.append_page(tab, page['name'], page['tooltip'])
            self.tables.append(tab)

        self.ins.set_entry(search_names, search_tips)
        self.ins.search.connect("changed", self.search_entry_changed)

        # add all into the dialog
        self.box_group_area.pack_start(self.ins, expand=True, fill=True)

        self.button_box = gtk.HBox(False, 6)
        self.box_group_area.pack_start(self.button_box, expand=False, fill=False)

        self.build_image_button = HobButton('Build image')
        #self.build_image_button.set_size_request(205, 49)
        self.build_image_button.set_tooltip_text("Build target image")
        self.build_image_button.set_flags(gtk.CAN_DEFAULT)
        self.build_image_button.grab_default()
        self.build_image_button.connect("clicked", self.build_image_clicked_cb)
        self.button_box.pack_end(self.build_image_button, expand=False, fill=False)

        self.back_button = HobAltButton('Cancel')
        self.back_button.connect("clicked", self.back_button_clicked_cb)
        self.button_box.pack_end(self.back_button, expand=False, fill=False)

    def search_entry_changed(self, entry):
        text = entry.get_text()
        if self.ins.search_focus:
            self.ins.search_focus = False
        elif self.ins.page_changed:
            self.ins.page_change = False
            self.filter_search(entry)
        elif text not in self.ins.search_names:
            self.filter_search(entry)

    def filter_search(self, entry):
        text = entry.get_text()
開發者ID:karfield,項目名稱:bitbake,代碼行數:70,代碼來源:packageselectionpage.py

示例3: RecipeSelectionPage

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

#.........這裏部分代碼省略.........
    def __init__(self, builder = None):
        super(RecipeSelectionPage, self).__init__(builder, "Step 1 of 2: Edit recipes")

        # set invisible members
        self.recipe_model = self.builder.recipe_model

        # create visual elements
        self.create_visual_elements()

    def included_clicked_cb(self, button):
        self.ins.set_current_page(self.INCLUDED)

    def create_visual_elements(self):
        self.eventbox = self.add_onto_top_bar(None, 73)
        self.pack_start(self.eventbox, expand=False, fill=False)
        self.pack_start(self.group_align, expand=True, fill=True)

        # set visible members
        self.ins = HobNotebook()
        self.tables = [] # we need modify table when the dialog is shown
        # append the tabs in order
        for page in self.pages:
            columns = page['columns']
            tab = HobViewTable(columns)
            filter = page['filter']
            tab.set_model(self.recipe_model.tree_model(filter))
            tab.connect("toggled", self.table_toggled_cb, page['name'])
            if page['name'] == "Included recipes":
                tab.connect("button-release-event", self.button_click_cb)
                tab.connect("cell-fadeinout-stopped", self.after_fadeout_checkin_include)
            self.ins.append_page(tab, page['name'], page['tooltip'])
            self.tables.append(tab)

        self.ins.set_entry("Search recipes:")
        # set the search entry for each table
        for tab in self.tables:
            search_tip = "Enter a recipe's or task's name to find it"
            self.ins.search.set_tooltip_text(search_tip)
            self.ins.search.props.has_tooltip = True
            tab.set_search_entry(0, self.ins.search)

        # add all into the window
        self.box_group_area.pack_start(self.ins, expand=True, fill=True)

        button_box = gtk.HBox(False, 6)
        self.box_group_area.pack_end(button_box, expand=False, fill=False)

        self.build_packages_button = HobButton('Build packages')
        #self.build_packages_button.set_size_request(205, 49)
        self.build_packages_button.set_tooltip_text("Build selected recipes into packages")
        self.build_packages_button.set_flags(gtk.CAN_DEFAULT)
        self.build_packages_button.grab_default()
        self.build_packages_button.connect("clicked", self.build_packages_clicked_cb)
        button_box.pack_end(self.build_packages_button, expand=False, fill=False)

        self.back_button = HobAltButton('Cancel')
        self.back_button.connect("clicked", self.back_button_clicked_cb)
        button_box.pack_end(self.back_button, expand=False, fill=False)

    def button_click_cb(self, widget, event):
        path, col = widget.table_tree.get_cursor()
        tree_model = widget.table_tree.get_model()
        if path: # else activation is likely a removal
            binb = tree_model.get_value(tree_model.get_iter(path), RecipeListModel.COL_BINB)
            if binb:
                self.builder.show_binb_dialog(binb)
開發者ID:gosborne,項目名稱:yp,代碼行數:70,代碼來源:recipeselectionpage.py

示例4: PackageSelectionPage

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

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

        # set invisiable members
        self.recipe_model = self.builder.recipe_model
        self.package_model = self.builder.package_model

        # create visual elements
        self.create_visual_elements()

    def included_clicked_cb(self, button):
        self.ins.set_current_page(self.INCLUDED)

    def create_visual_elements(self):
        self.label = gtk.Label("Packages included: 0\nSelected packages size: 0 MB")
        self.eventbox = self.add_onto_top_bar(self.label, 73)
        self.pack_start(self.eventbox, expand=False, fill=False)
        self.pack_start(self.group_align, expand=True, fill=True)

        # set visible members
        self.ins = HobNotebook()
        self.tables = []  # we need to modify table when the dialog is shown
        # append the tab
        for page in self.pages:
            columns = page["columns"]
            tab = HobViewTable(columns)
            filter = page["filter"]
            tab.set_model(self.package_model.tree_model(filter))
            tab.connect("toggled", self.table_toggled_cb, page["name"])
            if page["name"] == "Included packages":
                tab.connect("button-release-event", self.button_click_cb)
                tab.connect("cell-fadeinout-stopped", self.after_fadeout_checkin_include)
            self.ins.append_page(tab, page["name"], page["tooltip"])
            self.tables.append(tab)

        self.ins.set_entry("Search packages:")
        # set the search entry for each table
        for tab in self.tables:
            search_tip = "Enter a package name to find it"
            self.ins.search.set_tooltip_text(search_tip)
            self.ins.search.props.has_tooltip = True
            tab.set_search_entry(0, self.ins.search)

        # add all into the dialog
        self.box_group_area.pack_start(self.ins, expand=True, fill=True)

        self.button_box = gtk.HBox(False, 6)
        self.box_group_area.pack_start(self.button_box, expand=False, fill=False)

        self.build_image_button = HobButton("Build image")
        # self.build_image_button.set_size_request(205, 49)
        self.build_image_button.set_tooltip_text("Build target image")
        self.build_image_button.set_flags(gtk.CAN_DEFAULT)
        self.build_image_button.grab_default()
        self.build_image_button.connect("clicked", self.build_image_clicked_cb)
        self.button_box.pack_end(self.build_image_button, expand=False, fill=False)

        self.back_button = HobAltButton("Cancel")
        self.back_button.connect("clicked", self.back_button_clicked_cb)
        self.button_box.pack_end(self.back_button, expand=False, fill=False)

    def button_click_cb(self, widget, event):
        path, col = widget.table_tree.get_cursor()
        tree_model = widget.table_tree.get_model()
        if path:  # else activation is likely a removal
            binb = tree_model.get_value(tree_model.get_iter(path), PackageListModel.COL_BINB)
            if binb:
                self.builder.show_binb_dialog(binb)
開發者ID:stefanbeller,項目名稱:bitbake,代碼行數:70,代碼來源:packageselectionpage.py

示例5: PackageSelectionPage

# 需要導入模塊: from bb.ui.crumbs.hobwidget import HobNotebook [as 別名]
# 或者: from bb.ui.crumbs.hobwidget.HobNotebook import set_entry [as 別名]
class PackageSelectionPage (HobPage):

    pages = [
        {
         'name'    : 'All packages',
         'filter'  : {},
         'columns' : [{
                       'col_name' : 'Name',
                       'col_id'   : PackageListModel.COL_NAME,
                       'col_style': 'text',
                       'col_min'  : 100,
                       'col_max'  : 400
                      }, {
                       'col_name' : 'size',
                       'col_id'   : PackageListModel.COL_SIZE,
                       'col_style': 'text',
                       'col_min'  : 100,
                       'col_max'  : 500
                      }, {
                       'col_name' : 'Included',
                       'col_id'   : PackageListModel.COL_INC,
                       'col_style': 'check toggle',
                       'col_min'  : 50,
                       'col_max'  : 50
                      }]
        }, {
         'name'    : 'Included',
         'filter'  : { PackageListModel.COL_INC : [True] },
         'columns' : [{
                       'col_name' : 'Name',
                       'col_id'   : PackageListModel.COL_NAME,
                       'col_style': 'text',
                       'col_min'  : 100,
                       'col_max'  : 300
                      }, {
                       'col_name' : 'Brought by',
                       'col_id'   : PackageListModel.COL_BINB,
                       'col_style': 'text',
                       'col_min'  : 100,
                       'col_max'  : 350
                      }, {
                       'col_name' : 'size',
                       'col_id'   : PackageListModel.COL_SIZE,
                       'col_style': 'text',
                       'col_min'  : 100,
                       'col_max'  : 300
                      }, {
                       'col_name' : 'Included',
                       'col_id'   : PackageListModel.COL_INC,
                       'col_style': 'check toggle',
                       'col_min'  : 50,
                       'col_max'  : 50
                     }]
        }
    ]

    def __init__(self, builder):
        super(PackageSelectionPage, self).__init__(builder, "Package Selection")

        # set invisiable members
        self.package_model = self.builder.package_model

        # create visual elements
        self.create_visual_elements()

    def create_visual_elements(self):
        self.label = gtk.Label("Packages included: 0\nSelected packages size: 0 MB")
        self.eventbox = self.add_onto_top_bar(self.label, 73)
        self.pack_start(self.eventbox, expand=False, fill=False)
        self.pack_start(self.group_align, expand=True, fill=True)

        # set visiable members
        self.ins = HobNotebook()
        self.tables = [] # we need to modify table when the dialog is shown
        # append the tab
        for page in self.pages:
            columns = page['columns']
            tab = HobViewTable(columns)
            filter = page['filter']
            tab.set_model(self.package_model.tree_model(filter))
            tab.connect("toggled", self.table_toggled_cb)
            if page['name'] == "Included":
                tab.connect("row-activated", self.tree_row_activated_cb)

            label = gtk.Label(page['name'])
            self.ins.append_page(tab, label)
            self.tables.append(tab)

        self.ins.set_entry("Search packages:")
        # set the search entry for each table
        for tab in self.tables:
            tab.set_search_entry(0, self.ins.search)

        # add all into the dialog
        self.box_group_area.pack_start(self.ins, expand=True, fill=True)

        button_box = gtk.HBox(False, 6)
        self.box_group_area.pack_start(button_box, expand=False, fill=False)

        self.build_image_button = gtk.Button()
#.........這裏部分代碼省略.........
開發者ID:izzetaykutkocak,項目名稱:poky-e100,代碼行數:103,代碼來源:packageselectionpage.py

示例6: RecipeSelectionPage

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

#.........這裏部分代碼省略.........
        # create visual elements
        self.create_visual_elements()

    def included_clicked_cb(self, button):
        self.ins.set_current_page(self.INCLUDED)

    def create_visual_elements(self):
        self.eventbox = self.add_onto_top_bar(None, 73)
        self.pack_start(self.eventbox, expand=False, fill=False)
        self.pack_start(self.group_align, expand=True, fill=True)

        # set visible members
        self.ins = HobNotebook()
        self.tables = [] # we need modify table when the dialog is shown

        search_names = []
        search_tips = []
        # append the tabs in order
        for page in self.pages:
            columns = page['columns']
            name = page['name']
            tab = HobViewTable(columns, name)
            search_names.append(page['search'])
            search_tips.append(page['searchtip'])
            filter = page['filter']
            sort_model = self.recipe_model.tree_model(filter, initial=True)
            tab.set_model(sort_model)
            tab.connect("toggled", self.table_toggled_cb, name)
            tab.connect("button-release-event", self.button_click_cb)
            tab.connect("cell-fadeinout-stopped", self.after_fadeout_checkin_include, filter)
            self.ins.append_page(tab, page['name'], page['tooltip'])
            self.tables.append(tab)

        self.ins.set_entry(search_names, search_tips)
        self.ins.search.connect("changed", self.search_entry_changed)

        # add all into the window
        self.box_group_area.pack_start(self.ins, expand=True, fill=True)

        button_box = gtk.HBox(False, 6)
        self.box_group_area.pack_end(button_box, expand=False, fill=False)

        self.build_packages_button = HobButton('Build packages')
        #self.build_packages_button.set_size_request(205, 49)
        self.build_packages_button.set_tooltip_text("Build selected recipes into packages")
        self.build_packages_button.set_flags(gtk.CAN_DEFAULT)
        self.build_packages_button.grab_default()
        self.build_packages_button.connect("clicked", self.build_packages_clicked_cb)
        button_box.pack_end(self.build_packages_button, expand=False, fill=False)

        self.back_button = HobAltButton('Cancel')
        self.back_button.connect("clicked", self.back_button_clicked_cb)
        button_box.pack_end(self.back_button, expand=False, fill=False)

    def search_entry_changed(self, entry):
        text = entry.get_text()
        if self.ins.search_focus:
            self.ins.search_focus = False
        elif self.ins.page_changed:
            self.ins.page_change = False
            self.filter_search(entry)
        elif text not in self.ins.search_names:
            self.filter_search(entry)

    def filter_search(self, entry):
        text = entry.get_text()
開發者ID:alex1818,項目名稱:yocto-iot,代碼行數:70,代碼來源:recipeselectionpage.py

示例7: RecipeSelectionPage

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

#.........這裏部分代碼省略.........
                       'col_min'  : 50,
                       'col_max'  : 50
                      }]
        }
    ]

    def __init__(self, builder = None):
        super(RecipeSelectionPage, self).__init__(builder, "Recipe Selection")

        # set invisiable members
        self.recipe_model = self.builder.recipe_model

        # create visual elements
        self.create_visual_elements()

    def create_visual_elements(self):
        self.label = gtk.Label("Recipes included: %s" % len(self.builder.configuration.selected_recipes))
        self.eventbox = self.add_onto_top_bar(self.label, 73)
        self.pack_start(self.eventbox, expand=False, fill=False)
        self.pack_start(self.group_align, expand=True, fill=True)

        # set visiable members
        self.ins = HobNotebook()
        self.tables = [] # we need modify table when the dialog is shown
        # append the tabs in order
        for page in self.pages:
            columns = page['columns']
            tab = HobViewTable(columns)
            filter = page['filter']
            tab.set_model(self.recipe_model.tree_model(filter))
            tab.connect("toggled", self.table_toggled_cb)
            if page['name'] == "Included":
                tab.connect("row-activated", self.tree_row_activated_cb)

            label = gtk.Label(page['name'])
            self.ins.append_page(tab, label)
            self.tables.append(tab)

        self.ins.set_entry("Search recipes:")
        # set the search entry for each table
        for tab in self.tables:
            tab.set_search_entry(0, self.ins.search)

        # add all into the window
        self.box_group_area.pack_start(self.ins, expand=True, fill=True)

        button_box = gtk.HBox(False, 6)
        self.box_group_area.pack_end(button_box, expand=False, fill=False)

        self.build_packages_button = gtk.Button()
        label = gtk.Label()
        mark = "<span %s>Build packages</span>" % self.span_tag('24px', 'bold')
        label.set_markup(mark)
        self.build_packages_button.set_image(label)
        self.build_packages_button.set_size_request(205, 49)
        self.build_packages_button.modify_bg(gtk.STATE_NORMAL, gtk.gdk.Color(HobColors.ORANGE))
        self.build_packages_button.modify_bg(gtk.STATE_PRELIGHT, gtk.gdk.Color(HobColors.ORANGE))
        self.build_packages_button.modify_bg(gtk.STATE_SELECTED, gtk.gdk.Color(HobColors.ORANGE))
        self.build_packages_button.set_tooltip_text("Build packages for customization")
        self.build_packages_button.set_flags(gtk.CAN_DEFAULT)
        self.build_packages_button.grab_default()
        self.build_packages_button.connect("clicked", self.build_packages_clicked_cb)
        button_box.pack_end(self.build_packages_button, expand=False, fill=False)

        self.back_button = gtk.LinkButton("Go back to Image Configuration screen", "<< Back to image configuration")
        self.back_button.connect("clicked", self.back_button_clicked_cb)
        button_box.pack_start(self.back_button, expand=False, fill=False)

    def tree_row_activated_cb(self, table, tree_model, path):
        binb = tree_model.get_value(tree_model.get_iter(path), RecipeListModel.COL_BINB)
        if binb:
            self.builder.show_binb_dialog(binb)

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

    def back_button_clicked_cb(self, button):
        self.builder.show_configuration()

    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()
        self.label.set_text("Recipes included: %s" % len(self.builder.configuration.selected_recipes))
        self.ins.show_indicator_icon("Included", len(self.builder.configuration.selected_recipes))

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

        self.refresh_selection()
        self.builder.window_sensitive(True)

    def table_toggled_cb(self, table, cell, view_path, toggled_columnid, view_tree):
        # Click to include a recipe
        self.builder.window_sensitive(False)
        view_model = view_tree.get_model()
        path = self.recipe_model.convert_vpath_to_path(view_model, view_path)
        glib.idle_add(self.toggle_item_idle_cb, path)
開發者ID:izzetaykutkocak,項目名稱:poky-e100,代碼行數:104,代碼來源:recipeselectionpage.py

示例8: PackageSelectionPage

# 需要導入模塊: from bb.ui.crumbs.hobwidget import HobNotebook [as 別名]
# 或者: from bb.ui.crumbs.hobwidget.HobNotebook import set_entry [as 別名]
class PackageSelectionPage (HobPage):

    pages = [
        {
         'name'      : 'All packages',
         'tooltip'   : 'All packages that have been built',
         'filter'    : {},
         'search'    : 'Search packages by name',
         'searchtip' : 'Enter a package name to find it',
         'columns'   : [{
                       'col_name' : 'Included',
                       'col_id'   : PackageListModel.COL_INC,
                       'col_style': 'check toggle',
                       'col_min'  : 50,
                       'col_max'  : 50
                      }, {
                       'col_name' : 'Package name',
                       'col_id'   : PackageListModel.COL_NAME,
                       'col_style': 'text',
                       'col_min'  : 100,
                       'col_max'  : 200,
                       'expand'   : 'True'
                      }, {
                       'col_name' : 'Size',
                       'col_id'   : PackageListModel.COL_SIZE,
                       'col_style': 'text',
                       'col_min'  : 80,
                       'col_max'  : 80,
                       'expand'   : 'True'
                      }, {
                       'col_name' : 'Brought in by',
                       'col_id'   : PackageListModel.COL_BINB,
                       'col_style': 'binb',
                       'col_min'  : 150,
                       'col_max'  : 170,
                       'expand'   : 'True'
                      }]
        }
    ]
    
    (INCLUDED,
     ALL) = range(2)

    def __init__(self, builder):
        super(PackageSelectionPage, self).__init__(builder, "Edit packages")

        # set invisible members
        self.recipe_model = self.builder.recipe_model
        self.package_model = self.builder.package_model

        # create visual elements
        self.create_visual_elements()

    def create_visual_elements(self):
        self.label = gtk.Label("Packages included: 0\nSelected packages size: 0 MB")
        self.eventbox = self.add_onto_top_bar(self.label, padding=15)
        self.pack_start(self.eventbox, expand=False, fill=False)
        self.pack_start(self.group_align, expand=True, fill=True)

        # set visible members
        self.ins = HobNotebook()
        self.tables = [] # we need to modify table when the dialog is shown

        search_names = []
        search_tips = []
        # append the tab
        page = self.pages[0]
        columns = page['columns']
        name = page['name']
        self.tab = HobViewTable(columns, name)
        search_names.append(page['search'])
        search_tips.append(page['searchtip'])
        self.ins.set_entry(search_names, search_tips)
        self.ins.search.connect("changed", self.search_entry_changed)
        filter = page['filter']
        sort_model = self.package_model.tree_model(filter, initial=True)
        self.tab.set_model(sort_model)
        self.tab.connect("toggled", self.table_toggled_cb, name)
        self.tab.connect("button-release-event", self.button_click_cb)
        self.tab.connect("cell-fadeinout-stopped", self.after_fadeout_checkin_include, filter)
        #self.tab.set_size_request(-1, 350)
        self.ins.append_page(self.tab, page['name'], page['tooltip'])
        self.tables.append(self.tab)

        # add all into the dialog
        self.box_group_area.pack_start(self.ins, expand=True, fill=True)

        self.button_box = gtk.HBox(False, 6)
        self.box_group_area.pack_start(self.button_box, expand=False, fill=False)

        self.build_image_button = HobButton('Build image')
        self.build_image_button.set_tooltip_text("Build your image")
        self.build_image_button.set_flags(gtk.CAN_DEFAULT)
        self.build_image_button.grab_default()
        self.build_image_button.connect("clicked", self.build_image_clicked_cb)
        self.button_box.pack_end(self.build_image_button, expand=False, fill=False)

        self.back_button = HobAltButton('Cancel')
        self.back_button.connect("clicked", self.back_button_clicked_cb)
        self.button_box.pack_end(self.back_button, expand=False, fill=False)
#.........這裏部分代碼省略.........
開發者ID:alex1818,項目名稱:yocto-iot,代碼行數:103,代碼來源:packageselectionpage.py


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