summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
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)