From 88bbc0ce562aa80d2b98c8b48d79a612b47ca852 Mon Sep 17 00:00:00 2001 From: Shane Wang Date: Mon, 27 Feb 2012 13:28:26 +0800 Subject: Hob: implement a self-defined notebook visual component for Hob In recipe selection page, package selection page, and build details page, etc, there is a notebook component which is not gtk.Notebook in the design video. We implement the visual component with a drawing area, and use it to replace the old notebook in recipe selection page and package selection page. The reasons why we do it are: 1) General speaking, gtk.Notebook doesn't look like the designer worked out. (see https://wiki.yoctoproject.org/wiki/File:Hob1.2-screencast2.mov) 2) And the designer version looks better, for example, there is an indicator to show how many recipes or packages are included, and how many issues happened when building? Very straightforward. But technically, gtk.Notebook can't implement that, as far as we know. 3) Moreover, there is an entry for "search recipes", and "search packages". How to make it horizontal to the tabs is a problem to us. Regarding those, we give up gtk.Notebook and use our own. (From Poky rev: e4ebac226cc5e4589bcecd8bada9fde462e925cc) (Bitbake rev: b0c2ca3f600694c6d37924006de3f9474b2a9a8e) Signed-off-by: Liming An Signed-off-by: Shane Wang Signed-off-by: Richard Purdie --- bitbake/lib/bb/ui/crumbs/recipeselectionpage.py | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) (limited to 'bitbake/lib/bb/ui/crumbs/recipeselectionpage.py') diff --git a/bitbake/lib/bb/ui/crumbs/recipeselectionpage.py b/bitbake/lib/bb/ui/crumbs/recipeselectionpage.py index d615ef1897..db873b611a 100755 --- a/bitbake/lib/bb/ui/crumbs/recipeselectionpage.py +++ b/bitbake/lib/bb/ui/crumbs/recipeselectionpage.py @@ -23,7 +23,7 @@ import gtk import glib from bb.ui.crumbs.hobcolor import HobColors -from bb.ui.crumbs.hobwidget import HobViewBar, HobViewTable +from bb.ui.crumbs.hobwidget import HobViewTable, HobNotebook from bb.ui.crumbs.hoblistmodel import RecipeListModel from bb.ui.crumbs.hobpages import HobPage @@ -124,13 +124,7 @@ class RecipeSelectionPage (HobPage): self.pack_start(self.group_align, expand=True, fill=True) # set visiable members - self.grid = gtk.Table(10, 1, True) - self.grid.set_col_spacings(3) - - # draw the left part of the window - # a notebook - self.ins = gtk.Notebook() - self.ins.set_show_tabs(False) + self.ins = HobNotebook() self.tables = [] # we need modify table when the dialog is shown # append the tabs in order for i in range(len(self.pages)): @@ -146,16 +140,13 @@ class RecipeSelectionPage (HobPage): self.ins.append_page(tab, label) self.tables.append(tab) - self.grid.attach(self.ins, 0, 1, 1, 10, gtk.FILL | gtk.EXPAND, gtk.FILL | gtk.EXPAND) - # a black bar associated with the notebook - self.topbar = HobViewBar(self.ins) - self.grid.attach(self.topbar, 0, 1, 0, 1, gtk.FILL | gtk.EXPAND, gtk.FILL | gtk.EXPAND) + self.ins.set_entry("Search recipes:") # set the search entry for each table for tab in self.tables: - tab.set_search_entry(0, self.topbar.search) + tab.set_search_entry(0, self.ins.search) # add all into the window - self.box_group_area.add(self.grid) + 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) -- cgit v1.2.3-54-g00ecf