summaryrefslogtreecommitdiffstats
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)
downloadpoky-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):
812 last project build. If the project has no \ 812 last project build. If the project has no \
813 builds, this shows the date the project was \ 813 builds, this shows the date the project was \
814 created.', 814 created.',
815 hideable=True, 815 hideable=False,
816 orderable=True, 816 orderable=True,
817 static_data_name='updated', 817 static_data_name='updated',
818 static_data_template=last_activity_on_template) 818 static_data_template=last_activity_on_template)
@@ -836,7 +836,7 @@ class ProjectsTable(ToasterTable):
836 self.add_column(title='Number of builds', 836 self.add_column(title='Number of builds',
837 help_text='The number of builds which have been run \ 837 help_text='The number of builds which have been run \
838 for the project', 838 for the project',
839 hideable=True, 839 hideable=False,
840 orderable=False, 840 orderable=False,
841 static_data_name='number_of_builds', 841 static_data_name='number_of_builds',
842 static_data_template=number_of_builds_template) 842 static_data_template=number_of_builds_template)
@@ -869,6 +869,7 @@ class ProjectsTable(ToasterTable):
869 help_text='The number of warnings encountered during \ 869 help_text='The number of warnings encountered during \
870 the last project build (if any)', 870 the last project build (if any)',
871 hideable=True, 871 hideable=True,
872 hidden=True,
872 orderable=False, 873 orderable=False,
873 static_data_name='warnings', 874 static_data_name='warnings',
874 static_data_template=warnings_template) 875 static_data_template=warnings_template)
@@ -877,6 +878,7 @@ class ProjectsTable(ToasterTable):
877 help_text='The root file system types produced by \ 878 help_text='The root file system types produced by \
878 the last project build', 879 the last project build',
879 hideable=True, 880 hideable=True,
881 hidden=True,
880 orderable=False, 882 orderable=False,
881 static_data_name='image_files', 883 static_data_name='image_files',
882 static_data_template=image_files_template) 884 static_data_template=image_files_template)
@@ -1076,6 +1078,7 @@ class BuildsTable(ToasterTable):
1076 self.add_column(title='Started on', 1078 self.add_column(title='Started on',
1077 help_text='The date and time when the build started', 1079 help_text='The date and time when the build started',
1078 hideable=True, 1080 hideable=True,
1081 hidden=True,
1079 orderable=True, 1082 orderable=True,
1080 filter_name='started_on_filter', 1083 filter_name='started_on_filter',
1081 static_data_name='started_on', 1084 static_data_name='started_on',
@@ -1116,7 +1119,8 @@ class BuildsTable(ToasterTable):
1116 1119
1117 self.add_column(title='Time', 1120 self.add_column(title='Time',
1118 help_text='How long the build took to finish', 1121 help_text='How long the build took to finish',
1119 hideable=False, 1122 hideable=True,
1123 hidden=True,
1120 orderable=False, 1124 orderable=False,
1121 static_data_name='time', 1125 static_data_name='time',
1122 static_data_template=time_template) 1126 static_data_template=time_template)
@@ -1328,6 +1332,19 @@ class ProjectBuildsTable(BuildsTable):
1328 # set from the querystring 1332 # set from the querystring
1329 self.project_id = None 1333 self.project_id = None
1330 1334
1335 def setup_columns(self, *args, **kwargs):
1336 """
1337 Project builds table doesn't show the machines column by default
1338 """
1339
1340 super(ProjectBuildsTable, self).setup_columns(*args, **kwargs)
1341
1342 # hide the machine column
1343 self.set_column_hidden('Machine', True)
1344
1345 # allow the machine column to be hidden by the user
1346 self.set_column_hideable('Machine', True)
1347
1331 def setup_queryset(self, *args, **kwargs): 1348 def setup_queryset(self, *args, **kwargs):
1332 """ 1349 """
1333 NOTE: self.project_id must be set before calling super(), 1350 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):
168 'computation': computation, 168 'computation': computation,
169 }) 169 })
170 170
171 def set_column_hidden(self, title, hidden):
172 """
173 Set the hidden state of the column to the value of hidden
174 """
175 for col in self.columns:
176 if col['title'] == title:
177 col['hidden'] = hidden
178 break
179
180 def set_column_hideable(self, title, hideable):
181 """
182 Set the hideable state of the column to the value of hideable
183 """
184 for col in self.columns:
185 if col['title'] == title:
186 col['hideable'] = hideable
187 break
188
171 def render_static_data(self, template, row): 189 def render_static_data(self, template, row):
172 """Utility function to render the static data template""" 190 """Utility function to render the static data template"""
173 191