summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/toaster/toastergui/tables.py46
1 files changed, 20 insertions, 26 deletions
diff --git a/bitbake/lib/toaster/toastergui/tables.py b/bitbake/lib/toaster/toastergui/tables.py
index 7fb3f8605e..2903a81696 100644
--- a/bitbake/lib/toaster/toastergui/tables.py
+++ b/bitbake/lib/toaster/toastergui/tables.py
@@ -773,38 +773,32 @@ class SelectPackagesTable(PackagesTable):
773 self.add_column(title="Add | Remove", 773 self.add_column(title="Add | Remove",
774 hideable=False, 774 hideable=False,
775 help_text="Use the add and remove buttons to modify " 775 help_text="Use the add and remove buttons to modify "
776 "the package content of you custom image", 776 "the package content of your custom image",
777 static_data_name="add_rm_pkg_btn", 777 static_data_name="add_rm_pkg_btn",
778 static_data_template='{% include "pkg_add_rm_btn.html" %}', 778 static_data_template='{% include "pkg_add_rm_btn.html" %}',
779 filter_name="in_current_image" 779 filter_name='in_current_image_filter')
780 )
781 780
782 def setup_filters(self, *args, **kwargs): 781 def setup_filters(self, *args, **kwargs):
783 project = Project.objects.get(pk=kwargs['pid']) 782 in_current_image_filter = TableFilter(
784 self.project_layers = ProjectLayer.objects.filter(project=project) 783 'in_current_image_filter',
784 'Filter by added packages'
785 )
785 786
787 in_image_action = TableFilterActionToggle(
788 'in_image',
789 'Packages in %s' % self.cust_recipe.name,
790 Q(pk__in=self.static_context_extra['current_packages'])
791 )
792
793 not_in_image_action = TableFilterActionToggle(
794 'not_in_image',
795 'Packages not added to %s' % self.cust_recipe.name,
796 ~Q(pk__in=self.static_context_extra['current_packages'])
797 )
786 798
787 self.add_filter(title="Filter by added packages", 799 in_current_image_filter.add_action(in_image_action)
788 name="in_current_image", 800 in_current_image_filter.add_action(not_in_image_action)
789 filter_actions=[ 801 self.add_filter(in_current_image_filter)
790 self.make_filter_action(
791 "in_image",
792 "Packages in %s" % self.cust_recipe.name,
793 self.filter_in_image),
794 self.make_filter_action(
795 "not_in_image",
796 "Packages not added to %s" %
797 self.cust_recipe.name,
798 self.filter_not_in_image)
799 ])
800
801 def filter_in_image(self):
802 return self.queryset.filter(
803 pk__in=self.static_context_extra['current_packages'])
804
805 def filter_not_in_image(self):
806 return self.queryset.exclude(
807 pk__in=self.static_context_extra['current_packages'])
808 802
809class ProjectsTable(ToasterTable): 803class ProjectsTable(ToasterTable):
810 """Table of projects in Toaster""" 804 """Table of projects in Toaster"""