diff options
| author | Cristiana Voicu <cristiana.voicu@intel.com> | 2012-10-25 13:36:23 +0300 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-10-27 09:55:54 +0100 |
| commit | a9c563b1b5879ea597e00097ac7e399d531a0704 (patch) | |
| tree | b2c728bd5c233b449047eb8af3211376c6ff89cd /bitbake/lib/bb/ui/crumbs/hig.py | |
| parent | e281bb3e35ca7ffabaa6742c126fd6f6079c000f (diff) | |
| download | poky-a9c563b1b5879ea597e00097ac7e399d531a0704.tar.gz | |
bitbake: hob: add a progress indicator when you select 'view log'
- created a new file named "hobthreads.py", defining a thread
for opening the log file in a subprocess using subprocess module;
in the future I think we will add some other threads here, to
implement some other performance issues
- on "builddetailspage", "packageselectionpage" and "imagedetailspage"
I have changed the manner for opening the log file; it uses the thread
to open the file, and on main thread it creates a dialog to show a
progress bar, which pulses till the file is open
- this was added because when the log file is big, it takes time to
be opened; on the dialog you can use "Cancel" button to terminate the
process initiated to open the file
[YOCTO #2997]
(Bitbake rev: 165362a63f085991b6bab63ab90a0c7b9bf6b784)
Signed-off-by: Cristiana Voicu <cristiana.voicu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/ui/crumbs/hig.py')
| -rw-r--r-- | bitbake/lib/bb/ui/crumbs/hig.py | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/bitbake/lib/bb/ui/crumbs/hig.py b/bitbake/lib/bb/ui/crumbs/hig.py index 4f4fecb58a..d030beda22 100644 --- a/bitbake/lib/bb/ui/crumbs/hig.py +++ b/bitbake/lib/bb/ui/crumbs/hig.py | |||
| @@ -1855,6 +1855,9 @@ class ImageSelectionDialog (CrumbsDialog): | |||
| 1855 | break | 1855 | break |
| 1856 | iter = self.image_store.iter_next(iter) | 1856 | iter = self.image_store.iter_next(iter) |
| 1857 | 1857 | ||
| 1858 | # | ||
| 1859 | # ProxyDetailsDialog | ||
| 1860 | # | ||
| 1858 | class ProxyDetailsDialog (CrumbsDialog): | 1861 | class ProxyDetailsDialog (CrumbsDialog): |
| 1859 | 1862 | ||
| 1860 | def __init__(self, title, user, passwd, parent, flags, buttons=None): | 1863 | def __init__(self, title, user, passwd, parent, flags, buttons=None): |
| @@ -1914,3 +1917,42 @@ class ProxyDetailsDialog (CrumbsDialog): | |||
| 1914 | else: | 1917 | else: |
| 1915 | self.user = None | 1918 | self.user = None |
| 1916 | self.passwd = None | 1919 | self.passwd = None |
| 1920 | |||
| 1921 | |||
| 1922 | # | ||
| 1923 | # OpeningLogDialog | ||
| 1924 | # | ||
| 1925 | class OpeningLogDialog (CrumbsDialog): | ||
| 1926 | |||
| 1927 | def __init__(self, title, parent, flags, buttons=None): | ||
| 1928 | super(OpeningLogDialog, self).__init__(title, parent, flags, buttons) | ||
| 1929 | |||
| 1930 | self.running = False | ||
| 1931 | # create visual elements on the dialog | ||
| 1932 | self.create_visual_elements() | ||
| 1933 | |||
| 1934 | def start(self): | ||
| 1935 | if not self.running: | ||
| 1936 | self.running = True | ||
| 1937 | gobject.timeout_add(100, self.pulse) | ||
| 1938 | |||
| 1939 | def pulse(self): | ||
| 1940 | self.progress_bar.pulse() | ||
| 1941 | return self.running | ||
| 1942 | |||
| 1943 | def create_visual_elements(self): | ||
| 1944 | hbox = gtk.HBox(False, 12) | ||
| 1945 | self.user_label = gtk.Label("The log will open in a text editor") | ||
| 1946 | hbox.pack_start(self.user_label, expand=False, fill=False) | ||
| 1947 | self.vbox.pack_start(hbox, expand=False, fill=False) | ||
| 1948 | |||
| 1949 | hbox = gtk.HBox(False, 12) | ||
| 1950 | # Progress bar | ||
| 1951 | self.progress_bar = HobProgressBar() | ||
| 1952 | hbox.pack_start(self.progress_bar) | ||
| 1953 | self.start() | ||
| 1954 | self.vbox.pack_start(hbox, expand=False, fill=False) | ||
| 1955 | |||
| 1956 | button = self.add_button("Cancel", gtk.RESPONSE_CANCEL) | ||
| 1957 | HobAltButton.style_button(button) | ||
| 1958 | self.show_all() | ||
