summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorDongxiao Xu <dongxiao.xu@intel.com>2012-03-24 01:12:09 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-03-25 12:23:32 +0100
commitbc73876964578d324e5953480b68f7f22a94033c (patch)
treec03e748efd51ae074cd92985ddc13f94ca69ab00 /bitbake
parent9b4e1600ab6c890ad3387186842b22fe35909601 (diff)
downloadpoky-bc73876964578d324e5953480b68f7f22a94033c.tar.gz
Hob: runqemu and deployment functionality filter
Implement the filter for runqemu and deployment functionality. runqemu 1) suffix should be in the list of RUNNABLE_IMAGE_TYPES. 2) machine should match the pattern of RUNNABLE_MACHINE_PATTERNS. deployment: 1) suffix should be in the list of DEPLOYMENT_IMAGE_TYPES. (Bitbake rev: de4d09a8d100b81622300db5f46627c649812abd) Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rwxr-xr-xbitbake/lib/bb/ui/crumbs/builder.py3
-rw-r--r--bitbake/lib/bb/ui/crumbs/hobeventhandler.py4
-rwxr-xr-xbitbake/lib/bb/ui/crumbs/imagedetailspage.py44
3 files changed, 40 insertions, 11 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/builder.py b/bitbake/lib/bb/ui/crumbs/builder.py
index d3484977fc..2984490a76 100755
--- a/bitbake/lib/bb/ui/crumbs/builder.py
+++ b/bitbake/lib/bb/ui/crumbs/builder.py
@@ -135,6 +135,9 @@ class Parameters:
135 self.image_names = [] 135 self.image_names = []
136 self.image_addr = params["image_addr"] 136 self.image_addr = params["image_addr"]
137 self.image_types = params["image_types"].split() 137 self.image_types = params["image_types"].split()
138 self.runnable_image_types = params["runnable_image_types"].split()
139 self.runnable_machine_patterns = params["runnable_machine_patterns"].split()
140 self.deployable_image_types = params["deployable_image_types"].split()
138 141
139class Builder(gtk.Window): 142class Builder(gtk.Window):
140 143
diff --git a/bitbake/lib/bb/ui/crumbs/hobeventhandler.py b/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
index ec3e0ef1f2..4b8aabc4ec 100644
--- a/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
+++ b/bitbake/lib/bb/ui/crumbs/hobeventhandler.py
@@ -434,4 +434,8 @@ class HobHandler(gobject.GObject):
434 434
435 params["conf_version"] = self.server.runCommand(["getVariable", "CONF_VERSION"]) or "" 435 params["conf_version"] = self.server.runCommand(["getVariable", "CONF_VERSION"]) or ""
436 params["lconf_version"] = self.server.runCommand(["getVariable", "LCONF_VERSION"]) or "" 436 params["lconf_version"] = self.server.runCommand(["getVariable", "LCONF_VERSION"]) or ""
437
438 params["runnable_image_types"] = self.server.runCommand(["getVariable", "RUNNABLE_IMAGE_TYPES"]) or ""
439 params["runnable_machine_patterns"] = self.server.runCommand(["getVariable", "RUNNABLE_MACHINE_PATTERNS"]) or ""
440 params["deployable_image_types"] = self.server.runCommand(["getVariable", "DEPLOYABLE_IMAGE_TYPES"]) or ""
437 return params 441 return params
diff --git a/bitbake/lib/bb/ui/crumbs/imagedetailspage.py b/bitbake/lib/bb/ui/crumbs/imagedetailspage.py
index 07a6eb0b52..5a5ec3f76a 100755
--- a/bitbake/lib/bb/ui/crumbs/imagedetailspage.py
+++ b/bitbake/lib/bb/ui/crumbs/imagedetailspage.py
@@ -183,7 +183,6 @@ class ImageDetailsPage (HobPage):
183 self.image_store.set(self.image_store.append(), 0, image_name, 1, image_size, 2, False) 183 self.image_store.set(self.image_store.append(), 0, image_name, 1, image_size, 2, False)
184 image_table = HobViewTable(self.__columns__) 184 image_table = HobViewTable(self.__columns__)
185 image_table.set_model(self.image_store) 185 image_table.set_model(self.image_store)
186 image_table.toggle_default()
187 image_size = self._size_to_string(os.stat(os.path.join(image_addr, image_names[0])).st_size) 186 image_size = self._size_to_string(os.stat(os.path.join(image_addr, image_names[0])).st_size)
188 image_table.connect("toggled", self.toggled_cb) 187 image_table.connect("toggled", self.toggled_cb)
189 view_files_button = gtk.LinkButton("file://%s" % image_addr, "View files") 188 view_files_button = gtk.LinkButton("file://%s" % image_addr, "View files")
@@ -256,6 +255,29 @@ class ImageDetailsPage (HobPage):
256 model[path][columnid] = True 255 model[path][columnid] = True
257 self.refresh_package_detail_box(model[path][1]) 256 self.refresh_package_detail_box(model[path][1])
258 257
258 type_runnable = False
259 mach_runnable = False
260 image_name = model[path][0]
261 for t in self.builder.parameters.runnable_image_types:
262 if image_name.endswith(t):
263 type_runnable = True
264 break
265
266 for t in self.builder.parameters.runnable_machine_patterns:
267 if t in image_name:
268 mach_runnable = True
269 break
270
271 self.run_button.set_sensitive(type_runnable and mach_runnable)
272
273 deployable = False
274 for t in self.builder.parameters.deployable_image_types:
275 if image_name.endswith(t):
276 deployable = True
277 break
278
279 self.deploy_button.set_sensitive(deployable)
280
259 def create_bottom_buttons(self, buttonlist): 281 def create_bottom_buttons(self, buttonlist):
260 # Create the buttons at the bottom 282 # Create the buttons at the bottom
261 bottom_buttons = gtk.HBox(False, 6) 283 bottom_buttons = gtk.HBox(False, 6)
@@ -264,13 +286,13 @@ class ImageDetailsPage (HobPage):
264 # create button "Deploy image" 286 # create button "Deploy image"
265 name = "Deploy image" 287 name = "Deploy image"
266 if name in buttonlist: 288 if name in buttonlist:
267 deploy_button = HobButton('Deploy image') 289 self.deploy_button = HobButton('Deploy image')
268 deploy_button.set_size_request(205, 49) 290 self.deploy_button.set_size_request(205, 49)
269 deploy_button.set_tooltip_text("Deploy image to get your target board") 291 self.deploy_button.set_tooltip_text("Deploy image to get your target board")
270 deploy_button.set_flags(gtk.CAN_DEFAULT) 292 self.deploy_button.set_flags(gtk.CAN_DEFAULT)
271 deploy_button.grab_default() 293 self.deploy_button.grab_default()
272 deploy_button.connect("clicked", self.deploy_button_clicked_cb) 294 self.deploy_button.connect("clicked", self.deploy_button_clicked_cb)
273 bottom_buttons.pack_end(deploy_button, expand=False, fill=False) 295 bottom_buttons.pack_end(self.deploy_button, expand=False, fill=False)
274 created = True 296 created = True
275 297
276 name = "Run image" 298 name = "Run image"
@@ -281,9 +303,9 @@ class ImageDetailsPage (HobPage):
281 bottom_buttons.pack_end(label, expand=False, fill=False) 303 bottom_buttons.pack_end(label, expand=False, fill=False)
282 304
283 # create button "Run image" 305 # create button "Run image"
284 run_button = HobAltButton("Run image") 306 self.run_button = HobAltButton("Run image")
285 run_button.connect("clicked", self.run_button_clicked_cb) 307 self.run_button.connect("clicked", self.run_button_clicked_cb)
286 bottom_buttons.pack_end(run_button, expand=False, fill=False) 308 bottom_buttons.pack_end(self.run_button, expand=False, fill=False)
287 created = True 309 created = True
288 310
289 name = "Save as template" 311 name = "Save as template"