aboutsummaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorElliot Smith <elliot.smith@intel.com>2016-01-15 13:01:00 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-01-15 16:30:00 +0000
commitf08730ab4de72999236ed5fc5df2286febd542e7 (patch)
tree39ca3e4fbbad03c145d675881980c8e655aaff52 /bitbake
parent112f3746cdaa09c1d7492954e82c2c7158ddae3d (diff)
downloadopenembedded-core-contrib-f08730ab4de72999236ed5fc5df2286febd542e7.tar.gz
bitbake: toastergui: set default visible and hideable columns
Incorrect columns were shown by default in the "all builds", "project builds" and "all projects" pages. Set the "hidden" property on columns in these tables to hide the correct columns. Add a set_column_hidden() method to ToasterTable so that the "hidden" property can be overridden for the machines column in the project builds page (it shares a superclass with all builds). Make the time column on all builds page hideable. [YOCTO #8738] (Bitbake rev: be3982c71703eaa51e7f3352e0cb5b3af11c9ead) Signed-off-by: Elliot Smith <elliot.smith@intel.com> Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/toaster/toastergui/tables.py23
-rw-r--r--bitbake/lib/toaster/toastergui/widgets.py18
2 files changed, 38 insertions, 3 deletions
diff --git a/bitbake/lib/toaster/toastergui/tables.py b/bitbake/lib/toaster/toastergui/tables.py
index b7d977ea03..14077e10ae 100644
--- a/bitbake/lib/toaster/toastergui/tables.py
+++ b/bitbake/lib/toaster/toastergui/tables.py
@@ -812,7 +812,7 @@ class ProjectsTable(ToasterTable):
last project build. If the project has no \
builds, this shows the date the project was \
created.',
- hideable=True,
+ hideable=False,
orderable=True,
static_data_name='updated',
static_data_template=last_activity_on_template)
@@ -836,7 +836,7 @@ class ProjectsTable(ToasterTable):
self.add_column(title='Number of builds',
help_text='The number of builds which have been run \
for the project',
- hideable=True,
+ hideable=False,
orderable=False,
static_data_name='number_of_builds',
static_data_template=number_of_builds_template)
@@ -869,6 +869,7 @@ class ProjectsTable(ToasterTable):
help_text='The number of warnings encountered during \
the last project build (if any)',
hideable=True,
+ hidden=True,
orderable=False,
static_data_name='warnings',
static_data_template=warnings_template)
@@ -877,6 +878,7 @@ class ProjectsTable(ToasterTable):
help_text='The root file system types produced by \
the last project build',
hideable=True,
+ hidden=True,
orderable=False,
static_data_name='image_files',
static_data_template=image_files_template)
@@ -1076,6 +1078,7 @@ class BuildsTable(ToasterTable):
self.add_column(title='Started on',
help_text='The date and time when the build started',
hideable=True,
+ hidden=True,
orderable=True,
filter_name='started_on_filter',
static_data_name='started_on',
@@ -1116,7 +1119,8 @@ class BuildsTable(ToasterTable):
self.add_column(title='Time',
help_text='How long the build took to finish',
- hideable=False,
+ hideable=True,
+ hidden=True,
orderable=False,
static_data_name='time',
static_data_template=time_template)
@@ -1328,6 +1332,19 @@ class ProjectBuildsTable(BuildsTable):
# set from the querystring
self.project_id = None
+ def setup_columns(self, *args, **kwargs):
+ """
+ Project builds table doesn't show the machines column by default
+ """
+
+ super(ProjectBuildsTable, self).setup_columns(*args, **kwargs)
+
+ # hide the machine column
+ self.set_column_hidden('Machine', True)
+
+ # allow the machine column to be hidden by the user
+ self.set_column_hideable('Machine', True)
+
def setup_queryset(self, *args, **kwargs):
"""
NOTE: self.project_id must be set before calling super(),
diff --git a/bitbake/lib/toaster/toastergui/widgets.py b/bitbake/lib/toaster/toastergui/widgets.py
index d9328d4cdc..d2ef5d3dba 100644
--- a/bitbake/lib/toaster/toastergui/widgets.py
+++ b/bitbake/lib/toaster/toastergui/widgets.py
@@ -168,6 +168,24 @@ class ToasterTable(TemplateView):
'computation': computation,
})
+ def set_column_hidden(self, title, hidden):
+ """
+ Set the hidden state of the column to the value of hidden
+ """
+ for col in self.columns:
+ if col['title'] == title:
+ col['hidden'] = hidden
+ break
+
+ def set_column_hideable(self, title, hideable):
+ """
+ Set the hideable state of the column to the value of hideable
+ """
+ for col in self.columns:
+ if col['title'] == title:
+ col['hideable'] = hideable
+ break
+
def render_static_data(self, template, row):
"""Utility function to render the static data template"""