summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-10-06 16:19:19 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-10-07 08:14:42 +0200
commit3d056824c687df567c05bf31554fa40ea2baef18 (patch)
tree45b9617119cc57542f441de6f4d9eaf20f5041ef /bin
parenta927e0964ba0442d53fffb22c577e54bcf183ed7 (diff)
Revert "lint-ui: check that we only have one has_default==True"
This reverts commit c9e3952e76a9c06d5a1d2f583829ce9eb5b9df64. Reason for revert: Some of the code manipulates visibility programmatically, and it is quite fine to has more than one has_default if only one of them is visible at a time. Change-Id: Ia4f565c7d21d232d3038c3489952782c8e2a7be5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103977 Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'bin')
-rwxr-xr-xbin/lint-ui.py13
1 files changed, 3 insertions, 10 deletions
diff --git a/bin/lint-ui.py b/bin/lint-ui.py
index c3344c3a3b51..124e1bf58316 100755
--- a/bin/lint-ui.py
+++ b/bin/lint-ui.py
@@ -76,23 +76,16 @@ def check_top_level_widget(element):
# lint_assert(border_width.text == BORDER_WIDTH,
# "Top level 'border_width' property should be " + BORDER_WIDTH, border_width)
- # check that
- # (*) any widget which has 'has-default' also has 'can-default'
- # (*) we have at most one has-default widget
- # 'has-default' means that when ENTER is pressed, this widget is triggered, normally the OK button
- has_default_count = 0
+ # check that any widget which has 'has-default' also has 'can-default'
for widget in element.findall('.//object'):
if not widget.attrib['class']:
continue
- child_widget_type = widget.attrib['class']
+ widget_type = widget.attrib['class']
has_defaults = widget.findall("./property[@name='has_default']")
if len(has_defaults) > 0 and has_defaults[0].text == "True":
- has_default_count += 1
can_defaults = widget.findall("./property[@name='can_default']")
lint_assert(len(can_defaults)>0 and can_defaults[0].text == "True",
- "has_default without can_default in " + child_widget_type + " with id = '" + widget.attrib['id'] + "'", widget)
- lint_assert(has_default_count <= 1,
- "more than one child with has_default=='True' in top-level widget " + widget_type, element)
+ "has_default without can_default in " + widget_type + " with id = '" + widget.attrib['id'] + "'", widget)
def check_button_box_spacing(element):
spacing = element.findall("property[@name='spacing']")