From b31ed9dc1d3a8a93f924d10cd441cf756847cc5f Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Fri, 13 Apr 2018 16:02:37 +0100 Subject: look for radio buttons without underlines MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I0ed97515a03a5633628a492ec7797fc3ade8a3d8 Reviewed-on: https://gerrit.libreoffice.org/52846 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- bin/lint-ui.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'bin') diff --git a/bin/lint-ui.py b/bin/lint-ui.py index 34669c85690a..27447be36165 100755 --- a/bin/lint-ui.py +++ b/bin/lint-ui.py @@ -59,6 +59,14 @@ def check_message_box_spacing(element): lint_assert(spacing.text == MESSAGE_BOX_SPACING, "Button box 'spacing' should be " + MESSAGE_BOX_SPACING) +def check_radio_buttons(root): + radios = [element for element in root.findall('.//object') if element.attrib['class'] == 'GtkRadioButton'] + for radio in radios: + radio_underlines = radio.findall("./property[@name='use_underline']") + assert len(radio_underlines) <= 1 + if len(radio_underlines) < 1: + lint_assert(False, "No use_underline in GtkRadioButton with id = '" + radio.attrib['id'] + "'") + def check_frames(root): frames = [element for element in root.findall('.//object') if element.attrib['class'] == 'GtkFrame'] for frame in frames: @@ -120,6 +128,8 @@ def main(): check_frames(root) + check_radio_buttons(root) + check_title_labels(root) if __name__ == "__main__": -- cgit