summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCristiana Voicu <cristiana.voicu@intel.com>2013-01-21 16:50:40 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-01-21 19:05:31 +0000
commit4c1ebc7ca73f4ee069dc471a395073ba9a8ce00e (patch)
treec391972b3709b3d551ab46ea677acdfc959de35e
parenteb9d31db70161415ad3bbe8e865aafccdebb5a8d (diff)
downloadpoky-4c1ebc7ca73f4ee069dc471a395073ba9a8ce00e.tar.gz
poky-4c1ebc7ca73f4ee069dc471a395073ba9a8ce00e.tar.bz2
poky-4c1ebc7ca73f4ee069dc471a395073ba9a8ce00e.zip
bitbake: hob: progress bar changed to busy cursor when you open log file
-the first implementation for this bug used a progress bar, that is shown during open file process; it revelead that the progress bar stops earlier -now I have implemented using gtk.show_uri() method, that shows itself a busy cursor when it opens a file; -deleted the code for the first implementation [YOCTO #2997] (Bitbake rev: 09d1c4c2db124104b9da460547b20a2c2ff07bb3) Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rwxr-xr-xbitbake/lib/bb/ui/crumbs/builddetailspage.py16
-rw-r--r--bitbake/lib/bb/ui/crumbs/hig/openinglogdialog.py68
-rw-r--r--bitbake/lib/bb/ui/crumbs/hobthreads.py51
-rwxr-xr-xbitbake/lib/bb/ui/crumbs/imagedetailspage.py16
-rwxr-xr-xbitbake/lib/bb/ui/crumbs/packageselectionpage.py16
5 files changed, 6 insertions, 161 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/builddetailspage.py b/bitbake/lib/bb/ui/crumbs/builddetailspage.py
index 64e758d7f4..171a7a68ed 100755
--- a/bitbake/lib/bb/ui/crumbs/builddetailspage.py
+++ b/bitbake/lib/bb/ui/crumbs/builddetailspage.py
@@ -30,8 +30,6 @@ from bb.ui.crumbs.runningbuild import RunningBuildTreeView
from bb.ui.crumbs.runningbuild import BuildFailureTreeView
from bb.ui.crumbs.hobpages import HobPage
from bb.ui.crumbs.hobcolor import HobColors
-from bb.ui.crumbs.hobthreads import OpeningLogThread
-from bb.ui.crumbs.hig.openinglogdialog import OpeningLogDialog
class BuildConfigurationTreeView(gtk.TreeView):
def __init__ (self):
@@ -431,18 +429,8 @@ class BuildDetailsPage (HobPage):
def open_log_button_clicked_cb(self, button, log_file):
if log_file:
- self.stop = False
- dialog = OpeningLogDialog(title = "Opening Log",
- parent = None,
- flags = gtk.DIALOG_MODAL
- | gtk.DIALOG_DESTROY_WITH_PARENT
- | gtk.DIALOG_NO_SEPARATOR)
- #create a thread to open log file
- background = OpeningLogThread(dialog, log_file, self)
- background.start()
- response = dialog.run()
- self.stop = True
- background.join()
+ log_file = "file:///" + log_file
+ gtk.show_uri(screen=button.get_screen(), uri=log_file, timestamp=0)
def failure_activate_file_bug_link_cb(self, button):
button.child.emit('activate-link', "http://bugzilla.yoctoproject.org")
diff --git a/bitbake/lib/bb/ui/crumbs/hig/openinglogdialog.py b/bitbake/lib/bb/ui/crumbs/hig/openinglogdialog.py
deleted file mode 100644
index f1733156a7..0000000000
--- a/bitbake/lib/bb/ui/crumbs/hig/openinglogdialog.py
+++ /dev/null
@@ -1,68 +0,0 @@
-#
-# BitBake Graphical GTK User Interface
-#
-# Copyright (C) 2011-2012 Intel Corporation
-#
-# Authored by Joshua Lock <josh@linux.intel.com>
-# Authored by Dongxiao Xu <dongxiao.xu@intel.com>
-# Authored by Shane Wang <shane.wang@intel.com>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2 as
-# published by the Free Software Foundation.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-import gtk
-import gobject
-from bb.ui.crumbs.hobwidget import HobAltButton
-from bb.ui.crumbs.progressbar import HobProgressBar
-from bb.ui.crumbs.hig.crumbsdialog import CrumbsDialog
-
-"""
-The following are convenience classes for implementing GNOME HIG compliant
-BitBake GUI's
-In summary: spacing = 12px, border-width = 6px
-"""
-
-class OpeningLogDialog (CrumbsDialog):
-
- def __init__(self, title, parent, flags, buttons=None):
- super(OpeningLogDialog, self).__init__(title, parent, flags, buttons)
-
- self.running = False
- # create visual elements on the dialog
- self.create_visual_elements()
-
- def start(self):
- if not self.running:
- self.running = True
- gobject.timeout_add(100, self.pulse)
-
- def pulse(self):
- self.progress_bar.pulse()
- return self.running
-
- def create_visual_elements(self):
- hbox = gtk.HBox(False, 12)
- self.user_label = gtk.Label("The log will open in a text editor")
- hbox.pack_start(self.user_label, expand=False, fill=False)
- self.vbox.pack_start(hbox, expand=False, fill=False)
-
- hbox = gtk.HBox(False, 12)
- # Progress bar
- self.progress_bar = HobProgressBar()
- hbox.pack_start(self.progress_bar)
- self.start()
- self.vbox.pack_start(hbox, expand=False, fill=False)
-
- button = self.add_button("Cancel", gtk.RESPONSE_CANCEL)
- HobAltButton.style_button(button)
- self.show_all()
diff --git a/bitbake/lib/bb/ui/crumbs/hobthreads.py b/bitbake/lib/bb/ui/crumbs/hobthreads.py
deleted file mode 100644
index 64ef91245a..0000000000
--- a/bitbake/lib/bb/ui/crumbs/hobthreads.py
+++ /dev/null
@@ -1,51 +0,0 @@
-#!/usr/bin/env python
-#
-# BitBake Graphical GTK User Interface
-#
-# Copyright (C) 2012 Intel Corporation
-#
-# Authored by Cristiana Voicu <cristiana.voicu@intel.com>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License version 2 as
-# published by the Free Software Foundation.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
-import threading
-import gtk
-import subprocess
-
-#
-# OpeningLogThread
-#
-class OpeningLogThread(threading.Thread):
- def __init__(self, dialog, log_file, parent):
- threading.Thread.__init__(self)
- self.dialog =dialog
- self.log_file = log_file
- self.parent = parent
-
- def run(self):
- p = subprocess.Popen(['xdg-open',self.log_file])
- retcode = p.poll()
- while (retcode == None):
- if self.parent.stop:
- try:
- p.terminate()
- except OSError, e:
- if e.errno == 3:
- pass # no such process
- else:
- raise
- retcode = p.poll()
-
- self.dialog.destroy()
-
diff --git a/bitbake/lib/bb/ui/crumbs/imagedetailspage.py b/bitbake/lib/bb/ui/crumbs/imagedetailspage.py
index 38fbaaaa33..1b60aa8ed5 100755
--- a/bitbake/lib/bb/ui/crumbs/imagedetailspage.py
+++ b/bitbake/lib/bb/ui/crumbs/imagedetailspage.py
@@ -27,8 +27,6 @@ from bb.ui.crumbs.hobwidget import hic, HobViewTable, HobAltButton, HobButton
from bb.ui.crumbs.hobpages import HobPage
import subprocess
from bb.ui.crumbs.hig.crumbsdialog import CrumbsDialog
-from bb.ui.crumbs.hobthreads import OpeningLogThread
-from bb.ui.crumbs.hig.openinglogdialog import OpeningLogDialog
#
# ImageDetailsPage
@@ -407,18 +405,8 @@ class ImageDetailsPage (HobPage):
def open_log_clicked_cb(self, button, log_file):
if log_file:
- self.stop = False
- dialog = OpeningLogDialog(title = "Opening Log",
- parent = None,
- flags = gtk.DIALOG_MODAL
- | gtk.DIALOG_DESTROY_WITH_PARENT
- | gtk.DIALOG_NO_SEPARATOR)
- #create a thread to open log file
- background = OpeningLogThread(dialog, log_file, self)
- background.start()
- response = dialog.run()
- self.stop = True
- background.join()
+ log_file = "file:///" + log_file
+ gtk.show_uri(screen=button.get_screen(), uri=log_file, timestamp=0)
def refresh_package_detail_box(self, image_size):
self.package_detail.update_line_widgets("Total image size: ", image_size)
diff --git a/bitbake/lib/bb/ui/crumbs/packageselectionpage.py b/bitbake/lib/bb/ui/crumbs/packageselectionpage.py
index 2da9277bf9..1868ebeddd 100755
--- a/bitbake/lib/bb/ui/crumbs/packageselectionpage.py
+++ b/bitbake/lib/bb/ui/crumbs/packageselectionpage.py
@@ -26,8 +26,6 @@ from bb.ui.crumbs.hobcolor import HobColors
from bb.ui.crumbs.hobwidget import HobViewTable, HobNotebook, HobAltButton, HobButton
from bb.ui.crumbs.hoblistmodel import PackageListModel
from bb.ui.crumbs.hobpages import HobPage
-from bb.ui.crumbs.hobthreads import OpeningLogThread
-from bb.ui.crumbs.hig.openinglogdialog import OpeningLogDialog
#
# PackageSelectionPage
@@ -169,18 +167,8 @@ class PackageSelectionPage (HobPage):
def open_log_clicked_cb(self, button, log_file):
if log_file:
- self.stop = False
- dialog = OpeningLogDialog(title = "Opening Log",
- parent = None,
- flags = gtk.DIALOG_MODAL
- | gtk.DIALOG_DESTROY_WITH_PARENT
- | gtk.DIALOG_NO_SEPARATOR)
- #create a thread to open log file
- background = OpeningLogThread(dialog, log_file, self)
- background.start()
- response = dialog.run()
- self.stop = True
- background.join()
+ log_file = "file:///" + log_file
+ gtk.show_uri(screen=button.get_screen(), uri=log_file, timestamp=0)
def show_page(self, log_file):
children = self.button_box.get_children() or []