summaryrefslogtreecommitdiffstats
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
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>
-rwxr-xr-xbin/lint-ui.py11
-rw-r--r--chart2/uiconfig/ui/tp_3D_SceneIllumination.ui2
-rw-r--r--cui/uiconfig/ui/additionsdialog.ui1
-rw-r--r--cui/uiconfig/ui/menuassignpage.ui2
-rw-r--r--sc/uiconfig/scalc/ui/scenariodialog.ui1
-rw-r--r--sd/uiconfig/sdraw/ui/copydlg.ui2
-rw-r--r--sd/uiconfig/simpress/ui/customanimationeffecttab.ui1
-rw-r--r--sw/uiconfig/swriter/ui/optredlinepage.ui4
-rw-r--r--sw/uiconfig/swriter/ui/watermarkdialog.ui1
9 files changed, 25 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)
diff --git a/chart2/uiconfig/ui/tp_3D_SceneIllumination.ui b/chart2/uiconfig/ui/tp_3D_SceneIllumination.ui
index 3f9564e7e33c..5c7091ff26ee 100644
--- a/chart2/uiconfig/ui/tp_3D_SceneIllumination.ui
+++ b/chart2/uiconfig/ui/tp_3D_SceneIllumination.ui
@@ -253,6 +253,7 @@
<property name="spacing">12</property>
<child>
<object class="GtkMenuButton" id="LB_LIGHTSOURCE">
+ <property name="label" translatable="no"></property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
@@ -342,6 +343,7 @@
<property name="spacing">12</property>
<child>
<object class="GtkMenuButton" id="LB_AMBIENTLIGHT">
+ <property name="label" translatable="no"></property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
diff --git a/cui/uiconfig/ui/additionsdialog.ui b/cui/uiconfig/ui/additionsdialog.ui
index 2d9ccc3fb318..3ce21025e5e8 100644
--- a/cui/uiconfig/ui/additionsdialog.ui
+++ b/cui/uiconfig/ui/additionsdialog.ui
@@ -194,6 +194,7 @@
</child>
<child>
<object class="GtkMenuButton" id="buttonGear">
+ <property name="label" translateable="no"></property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
diff --git a/cui/uiconfig/ui/menuassignpage.ui b/cui/uiconfig/ui/menuassignpage.ui
index 7081489cfe3c..c7ba93e5253b 100644
--- a/cui/uiconfig/ui/menuassignpage.ui
+++ b/cui/uiconfig/ui/menuassignpage.ui
@@ -498,6 +498,7 @@
</child>
<child>
<object class="GtkMenuButton" id="menugearbtn">
+ <property name="label" translatable="no"></property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="halign">end</property>
@@ -520,6 +521,7 @@
</child>
<child>
<object class="GtkMenuButton" id="toolbargearbtn">
+ <property name="label" translatable="no"></property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="halign">end</property>
diff --git a/sc/uiconfig/scalc/ui/scenariodialog.ui b/sc/uiconfig/scalc/ui/scenariodialog.ui
index 02f4e7d8ef4c..e2545950b4ab 100644
--- a/sc/uiconfig/scalc/ui/scenariodialog.ui
+++ b/sc/uiconfig/scalc/ui/scenariodialog.ui
@@ -302,6 +302,7 @@
</child>
<child>
<object class="GtkMenuButton" id="bordercolor">
+ <property name="label" translatable="no"></property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
diff --git a/sd/uiconfig/sdraw/ui/copydlg.ui b/sd/uiconfig/sdraw/ui/copydlg.ui
index ed202c2aa2e5..b7a710d423a6 100644
--- a/sd/uiconfig/sdraw/ui/copydlg.ui
+++ b/sd/uiconfig/sdraw/ui/copydlg.ui
@@ -489,6 +489,7 @@
</child>
<child>
<object class="GtkMenuButton" id="start">
+ <property name="label" translatable="no"></property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
@@ -511,6 +512,7 @@
</child>
<child>
<object class="GtkMenuButton" id="end">
+ <property name="label" translatable="no"></property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
diff --git a/sd/uiconfig/simpress/ui/customanimationeffecttab.ui b/sd/uiconfig/simpress/ui/customanimationeffecttab.ui
index 5ca9087e82c7..7d1c40a7f3d4 100644
--- a/sd/uiconfig/simpress/ui/customanimationeffecttab.ui
+++ b/sd/uiconfig/simpress/ui/customanimationeffecttab.ui
@@ -302,6 +302,7 @@
</child>
<child>
<object class="GtkMenuButton" id="dim_color_list">
+ <property name="label" translatable="no"></property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
diff --git a/sw/uiconfig/swriter/ui/optredlinepage.ui b/sw/uiconfig/swriter/ui/optredlinepage.ui
index 6ade86095201..599627738686 100644
--- a/sw/uiconfig/swriter/ui/optredlinepage.ui
+++ b/sw/uiconfig/swriter/ui/optredlinepage.ui
@@ -89,6 +89,7 @@
</child>
<child>
<object class="GtkMenuButton" id="insertcolor">
+ <property name="label" translatable="no"></property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="receives_default">False</property>
@@ -226,6 +227,7 @@
</child>
<child>
<object class="GtkMenuButton" id="deletedcolor">
+ <property name="label" translatable="no"></property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="receives_default">False</property>
@@ -363,6 +365,7 @@
</child>
<child>
<object class="GtkMenuButton" id="changedcolor">
+ <property name="label" translatable="no"></property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="receives_default">False</property>
@@ -456,6 +459,7 @@
<property name="column_spacing">12</property>
<child>
<object class="GtkMenuButton" id="markcolor">
+ <property name="label" translatable="no"></property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="receives_default">False</property>
diff --git a/sw/uiconfig/swriter/ui/watermarkdialog.ui b/sw/uiconfig/swriter/ui/watermarkdialog.ui
index 9b21aea7281f..34d858588219 100644
--- a/sw/uiconfig/swriter/ui/watermarkdialog.ui
+++ b/sw/uiconfig/swriter/ui/watermarkdialog.ui
@@ -210,6 +210,7 @@
</child>
<child>
<object class="GtkMenuButton" id="Color">
+ <property name="label" translatable="no"></property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>