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


Python HobNotebook.set_current_page方法代碼示例

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


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

示例1: RecipeSelectionPage

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

#.........這裏部分代碼省略.........
         'tooltip' : 'All package groups in your configured layers',
         'filter'  : { RecipeListModel.COL_TYPE : ['packagegroup'] },
         'columns' : [{
                       'col_name' : 'Package group name',
                       'col_id'   : RecipeListModel.COL_NAME,
                       'col_style': 'text',
                       'col_min'  : 100,
                       'col_max'  : 400,
                       'expand'   : 'True'
                      }, {
                       'col_name' : 'Included',
                       'col_id'   : RecipeListModel.COL_INC,
                       'col_style': 'check toggle',
                       'col_min'  : 100,
                       'col_max'  : 100
                      }]
        }
    ]
    
    (INCLUDED,
     ALL,
     TASKS) = range(3)

    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)
開發者ID:gosborne,項目名稱:yp,代碼行數:70,代碼來源:recipeselectionpage.py

示例2: PackageSelectionPage

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

    pages = [
        {
            "name": "Included packages",
            "tooltip": "The packages currently included for your image",
            "filter": {PackageListModel.COL_INC: [True]},
            "columns": [
                {
                    "col_name": "Package name",
                    "col_id": PackageListModel.COL_NAME,
                    "col_style": "text",
                    "col_min": 100,
                    "col_max": 300,
                    "expand": "True",
                },
                {
                    "col_name": "Size",
                    "col_id": PackageListModel.COL_SIZE,
                    "col_style": "text",
                    "col_min": 100,
                    "col_max": 300,
                    "expand": "True",
                },
                {
                    "col_name": "Brought in by (+others)",
                    "col_id": PackageListModel.COL_BINB,
                    "col_style": "binb",
                    "col_min": 100,
                    "col_max": 350,
                    "expand": "True",
                },
                {
                    "col_name": "Included",
                    "col_id": PackageListModel.COL_INC,
                    "col_style": "check toggle",
                    "col_min": 100,
                    "col_max": 100,
                },
            ],
        },
        {
            "name": "All packages",
            "tooltip": "All packages that have been built",
            "filter": {},
            "columns": [
                {
                    "col_name": "Package name",
                    "col_id": PackageListModel.COL_NAME,
                    "col_style": "text",
                    "col_min": 100,
                    "col_max": 400,
                    "expand": "True",
                },
                {
                    "col_name": "Size",
                    "col_id": PackageListModel.COL_SIZE,
                    "col_style": "text",
                    "col_min": 100,
                    "col_max": 500,
                    "expand": "True",
                },
                {
                    "col_name": "Included",
                    "col_id": PackageListModel.COL_INC,
                    "col_style": "check toggle",
                    "col_min": 100,
                    "col_max": 100,
                },
            ],
        },
    ]

    (INCLUDED, ALL) = range(2)

    def __init__(self, builder):
        super(PackageSelectionPage, self).__init__(builder, "Edit 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 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"]
#.........這裏部分代碼省略.........
開發者ID:stefanbeller,項目名稱:bitbake,代碼行數:103,代碼來源:packageselectionpage.py

示例3: PackageSelectionPage

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

    pages = [
        {
         'name'      : 'Included packages',
         'tooltip'   : 'The packages currently included for your image',
         'filter'    : { PackageListModel.COL_INC : [True] },
         'search'    : 'Search packages by name',
         'searchtip' : 'Enter a package name to find it',
         'columns'   : [{
                       'col_name' : 'Package name',
                       'col_id'   : PackageListModel.COL_NAME,
                       'col_style': 'text',
                       'col_min'  : 100,
                       'col_max'  : 300,
                       'expand'   : 'True'
                      }, {
                       'col_name' : 'Size',
                       'col_id'   : PackageListModel.COL_SIZE,
                       'col_style': 'text',
                       'col_min'  : 100,
                       'col_max'  : 300,
                       'expand'   : 'True'
                      }, {
                       'col_name' : 'Recipe',
                       'col_id'   : PackageListModel.COL_RCP,
                       'col_style': 'text',
                       'col_min'  : 100,
                       'col_max'  : 250,
                       'expand'   : 'True'
                      }, {
                       'col_name' : 'Brought in by (+others)',
                       'col_id'   : PackageListModel.COL_BINB,
                       'col_style': 'binb',
                       'col_min'  : 100,
                       'col_max'  : 350,
                       'expand'   : 'True'
                      }, {
                       'col_name' : 'Included',
                       'col_id'   : PackageListModel.COL_INC,
                       'col_style': 'check toggle',
                       'col_min'  : 100,
                       'col_max'  : 100
                     }]
        }, {
         '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' : 'Package name',
                       'col_id'   : PackageListModel.COL_NAME,
                       'col_style': 'text',
                       'col_min'  : 100,
                       'col_max'  : 400,
                       'expand'   : 'True'
                      }, {
                       'col_name' : 'Size',
                       'col_id'   : PackageListModel.COL_SIZE,
                       'col_style': 'text',
                       'col_min'  : 100,
                       'col_max'  : 500,
                       'expand'   : 'True'
                      }, {
                       'col_name' : 'Recipe',
                       'col_id'   : PackageListModel.COL_RCP,
                       'col_style': 'text',
                       'col_min'  : 100,
                       'col_max'  : 250,
                       'expand'   : 'True'
                      }, {
                       'col_name' : 'Included',
                       'col_id'   : PackageListModel.COL_INC,
                       'col_style': 'check toggle',
                       'col_min'  : 100,
                       'col_max'  : 100
                      }]
        }
    ]
    
    (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 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)
#.........這裏部分代碼省略.........
開發者ID:karfield,項目名稱:bitbake,代碼行數:103,代碼來源:packageselectionpage.py

示例4: RecipeSelectionPage

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

#.........這裏部分代碼省略.........
         'search'    : 'Search package groups by name',
         'searchtip' : 'Enter a package group name to find it',
         'columns'   : [{
                       'col_name' : 'Package group name',
                       'col_id'   : RecipeListModel.COL_NAME,
                       'col_style': 'text',
                       'col_min'  : 100,
                       'col_max'  : 400,
                       'expand'   : 'True'
                      }, {
                       'col_name' : 'Included',
                       'col_id'   : RecipeListModel.COL_INC,
                       'col_style': 'check toggle',
                       'col_min'  : 100,
                       'col_max'  : 100
                      }]
        }
    ]
    
    (INCLUDED,
     ALL,
     TASKS) = range(3)

    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

        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
開發者ID:alex1818,項目名稱:yocto-iot,代碼行數:70,代碼來源:recipeselectionpage.py


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