1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-30 00:20:08 +00:00

Resurrect alternative UIs

The various alternative UIs have been updated to once again be functional
with the latest bitbake internals.  Each of the UIs still have much room for
functional improvement.

In particular, they have been updated to:
 - interact with the new process based server
 - handle the current set of events and notifications fired from the server
   and its associated subsystems

(Bitbake rev: b947e7aa405966262c0614cae02e7978ec637095)

Signed-off-by: Bob Foerster <robert@erafx.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
This commit is contained in:
Bob Foerster
2010-12-17 23:20:39 +08:00
committed by Richard Purdie
parent 25ac24e02e
commit 2e0ef25a50
7 changed files with 300 additions and 91 deletions
+28 -4
View File
@@ -24,19 +24,32 @@ import xmlrpclib
from bb.ui.crumbs.runningbuild import RunningBuildTreeView, RunningBuild
from bb.ui.crumbs.progress import ProgressBar
import Queue
def event_handle_idle_func (eventHandler, build, pbar):
# Consume as many messages as we can in the time available to us
event = eventHandler.getEvent()
while event:
build.handle_event (event, pbar)
event = eventHandler.getEvent()
build.handle_event (event, pbar)
return True
def scroll_tv_cb (model, path, iter, view):
view.scroll_to_cell (path)
# @todo hook these into the GUI so the user has feedback...
def running_build_failed_cb (running_build):
pass
def running_build_succeeded_cb (running_build):
pass
class MainWindow (gtk.Window):
def __init__ (self):
gtk.Window.__init__ (self, gtk.WINDOW_TOPLEVEL)
@@ -49,6 +62,7 @@ class MainWindow (gtk.Window):
self.set_default_size(640, 480)
scrolled_window.add (self.cur_build_tv)
def main (server, eventHandler):
gobject.threads_init()
gtk.gdk.threads_init()
@@ -61,9 +75,11 @@ def main (server, eventHandler):
running_build = RunningBuild ()
window.cur_build_tv.set_model (running_build.model)
running_build.model.connect("row-inserted", scroll_tv_cb, window.cur_build_tv)
running_build.connect ("build-succeeded", running_build_succeeded_cb)
running_build.connect ("build-failed", running_build_failed_cb)
try:
cmdline = server.runCommand(["getCmdLineAction"])
print(cmdline)
if not cmdline:
return 1
ret = server.runCommand(cmdline)
@@ -76,10 +92,18 @@ def main (server, eventHandler):
# Use a timeout function for probing the event queue to find out if we
# have a message waiting for us.
gobject.timeout_add (200,
gobject.timeout_add (100,
event_handle_idle_func,
eventHandler,
running_build,
pbar)
gtk.main()
try:
gtk.main()
except EnvironmentError as ioerror:
# ignore interrupted io
if ioerror.args[0] == 4:
pass
finally:
server.runCommand(["stateStop"])