summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorNoel <noelgrandin@gmail.com>2020-10-01 16:26:59 +0200
committerCaolán McNamara <caolanm@redhat.com>2020-10-02 10:17:40 +0200
commit2e3afaebd027d0280b871c3515c4999b7912692a (patch)
treeecf94f1826e43394a5c9c576fabb7c42d217df56 /bin
parentuitest: sc: test chart legends move with arrow keys (diff)
downloadcore-2e3afaebd027d0280b871c3515c4999b7912692a.tar.gz
core-2e3afaebd027d0280b871c3515c4999b7912692a.zip
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-xbin/lint-ui.py11
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)