aboutsummaryrefslogtreecommitdiffstats
path: root/bitbake/lib/toaster/toastergui/templatetags
diff options
context:
space:
mode:
authorRavi Chintakunta <ravi.chintakunta@timesys.com>2014-02-05 22:54:46 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-02-17 15:38:53 +0000
commit877f87baa0e376ff5bf0c157490020c459b64eb0 (patch)
treed0f40db61971c9fc650d88aa32f52c5e262ea641 /bitbake/lib/toaster/toastergui/templatetags
parentf8f448e4e6c6dadd7c13a3a8fff88647ce7b02c5 (diff)
downloadopenembedded-core-contrib-877f87baa0e376ff5bf0c157490020c459b64eb0.tar.gz
bitbake: toaster: Select a radio button by default in Filter Dialog
If none of the filter options in the filter dialog are active, then select the first radio button. (Bitbake rev: 8aa63143cc446227c69f64688b314c65b74604d8) Signed-off-by: Ravi Chintakunta <ravi.chintakunta@timesys.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/toastergui/templatetags')
-rw-r--r--bitbake/lib/toaster/toastergui/templatetags/projecttags.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/bitbake/lib/toaster/toastergui/templatetags/projecttags.py b/bitbake/lib/toaster/toastergui/templatetags/projecttags.py
index 042d6927c5..7e2c8e98fa 100644
--- a/bitbake/lib/toaster/toastergui/templatetags/projecttags.py
+++ b/bitbake/lib/toaster/toastergui/templatetags/projecttags.py
@@ -114,3 +114,14 @@ def filtered_filesizeformat(value):
def filtered_packagespec(value):
"""Strip off empty version and revision"""
return re.sub(r'(--$)', '', value)
+
+@register.filter
+def check_filter_status(options, filter):
+ """Check if the active filter is among the available options, and return 'checked'
+ if filter is not active.
+ Used in FilterDialog to select the first radio button if the filter is not active.
+ """
+ for option in options:
+ if filter == option[1]:
+ return ""
+ return "checked"