diff options
author | Noel <noelgrandin@gmail.com> | 2020-10-01 16:26:59 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-10-02 10:17:40 +0200 |
commit | 2e3afaebd027d0280b871c3515c4999b7912692a (patch) | |
tree | ecf94f1826e43394a5c9c576fabb7c42d217df56 /bin | |
parent | 61d9d1cf56994146d514fd5bf8c3f3f6885449ea (diff) |
lint-ui.py check that GtkMenuButton has a label property
Change-Id: Ib1aa8ee050d2425387ddc1080f11f0ddfc2f9236
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103770
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/lint-ui.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/bin/lint-ui.py b/bin/lint-ui.py index 7148838c1833..9530cb9ac7a8 100755 --- a/bin/lint-ui.py +++ b/bin/lint-ui.py @@ -68,6 +68,15 @@ def check_radio_buttons(root): if len(radio_underlines) < 1: lint_assert(False, "No use_underline in GtkRadioButton with id = '" + radio.attrib['id'] + "'") +def check_menu_buttons(root): + buttons = [element for element in root.findall('.//object') if element.attrib['class'] == "GtkMenuButton"] + for button in buttons: + labels = button.findall("./property[@name='label']") + images = button.findall("./property[@name='image']") + assert(len(labels) <= 1) + if len(labels) < 1 and len(images) < 1: + lint_assert(False, "No label in GtkMenuButton with id = '" + button.attrib['id'] + "'") + def check_check_buttons(root): radios = [element for element in root.findall('.//object') if element.attrib['class'] == 'GtkCheckButton'] for radio in radios: @@ -145,6 +154,8 @@ def main(): check_radio_buttons(root) + check_menu_buttons(root) + check_check_buttons(root) check_title_labels(root) |