[Libreoffice-commits] core.git: bin/lint-ui.py cui/uiconfig dbaccess/uiconfig fpicker/uiconfig sc/uiconfig sfx2/uiconfig sw/uiconfig
Noel (via logerrit)
logerrit at kemper.freedesktop.org
Mon Oct 5 16:34:00 UTC 2020
bin/lint-ui.py | 13 ++++++++++---
cui/uiconfig/ui/certdialog.ui | 1 -
cui/uiconfig/ui/macroselectordialog.ui | 1 -
cui/uiconfig/ui/specialcharacters.ui | 1 -
cui/uiconfig/ui/tsaurldialog.ui | 2 --
dbaccess/uiconfig/ui/collectionviewdialog.ui | 3 ---
fpicker/uiconfig/ui/remotefilesdialog.ui | 1 -
sc/uiconfig/scalc/ui/analysisofvariancedialog.ui | 1 -
sc/uiconfig/scalc/ui/chisquaretestdialog.ui | 1 -
sc/uiconfig/scalc/ui/correlationdialog.ui | 1 -
sc/uiconfig/scalc/ui/covariancedialog.ui | 1 -
sc/uiconfig/scalc/ui/descriptivestatisticsdialog.ui | 1 -
sc/uiconfig/scalc/ui/exponentialsmoothingdialog.ui | 1 -
sc/uiconfig/scalc/ui/fourieranalysisdialog.ui | 1 -
sc/uiconfig/scalc/ui/movingaveragedialog.ui | 1 -
sc/uiconfig/scalc/ui/randomnumbergenerator.ui | 2 --
sc/uiconfig/scalc/ui/regressiondialog.ui | 1 -
sc/uiconfig/scalc/ui/samplingdialog.ui | 1 -
sc/uiconfig/scalc/ui/ttestdialog.ui | 1 -
sc/uiconfig/scalc/ui/ztestdialog.ui | 1 -
sfx2/uiconfig/ui/versioncommentdialog.ui | 1 -
sw/uiconfig/swriter/ui/bibliographyentry.ui | 1 -
sw/uiconfig/swriter/ui/indexentry.ui | 1 -
23 files changed, 10 insertions(+), 29 deletions(-)
New commits:
commit c9e3952e76a9c06d5a1d2f583829ce9eb5b9df64
Author: Noel <noelgrandin at gmail.com>
AuthorDate: Mon Oct 5 10:58:01 2020 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Mon Oct 5 18:33:18 2020 +0200
lint-ui: check that we only have one has_default==True
Change-Id: Ic61e14c3b98a85a5f05b448db9805ac296c041ec
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103953
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/bin/lint-ui.py b/bin/lint-ui.py
index 124e1bf58316..c3344c3a3b51 100755
--- a/bin/lint-ui.py
+++ b/bin/lint-ui.py
@@ -76,16 +76,23 @@ def check_top_level_widget(element):
# lint_assert(border_width.text == BORDER_WIDTH,
# "Top level 'border_width' property should be " + BORDER_WIDTH, border_width)
- # check that any widget which has 'has-default' also has 'can-default'
+ # check that
+ # (*) any widget which has 'has-default' also has 'can-default'
+ # (*) we have at most one has-default widget
+ # 'has-default' means that when ENTER is pressed, this widget is triggered, normally the OK button
+ has_default_count = 0
for widget in element.findall('.//object'):
if not widget.attrib['class']:
continue
- widget_type = widget.attrib['class']
+ child_widget_type = widget.attrib['class']
has_defaults = widget.findall("./property[@name='has_default']")
if len(has_defaults) > 0 and has_defaults[0].text == "True":
+ has_default_count += 1
can_defaults = widget.findall("./property[@name='can_default']")
lint_assert(len(can_defaults)>0 and can_defaults[0].text == "True",
- "has_default without can_default in " + widget_type + " with id = '" + widget.attrib['id'] + "'", widget)
+ "has_default without can_default in " + child_widget_type + " with id = '" + widget.attrib['id'] + "'", widget)
+ lint_assert(has_default_count <= 1,
+ "more than one child with has_default=='True' in top-level widget " + widget_type, element)
def check_button_box_spacing(element):
spacing = element.findall("property[@name='spacing']")
diff --git a/cui/uiconfig/ui/certdialog.ui b/cui/uiconfig/ui/certdialog.ui
index 39d84c5df216..0794e6278c4b 100644
--- a/cui/uiconfig/ui/certdialog.ui
+++ b/cui/uiconfig/ui/certdialog.ui
@@ -41,7 +41,6 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
- <property name="has_default">True</property>
<property name="receives_default">True</property>
<property name="use_underline">True</property>
<child internal-child="accessible">
diff --git a/cui/uiconfig/ui/macroselectordialog.ui b/cui/uiconfig/ui/macroselectordialog.ui
index ea485c283a37..d9757531fd3e 100644
--- a/cui/uiconfig/ui/macroselectordialog.ui
+++ b/cui/uiconfig/ui/macroselectordialog.ui
@@ -42,7 +42,6 @@
<property name="label" translatable="yes" context="macroselectordialog|add">Add</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
- <property name="has_default">True</property>
<property name="receives_default">True</property>
<property name="no_show_all">True</property>
</object>
diff --git a/cui/uiconfig/ui/specialcharacters.ui b/cui/uiconfig/ui/specialcharacters.ui
index 9e8e5323828c..684031a9fe53 100644
--- a/cui/uiconfig/ui/specialcharacters.ui
+++ b/cui/uiconfig/ui/specialcharacters.ui
@@ -24,7 +24,6 @@
<property name="label" translatable="yes" context="specialcharacters|insert">_Insert</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
- <property name="has_default">True</property>
<property name="receives_default">True</property>
<property name="use_underline">True</property>
</object>
diff --git a/cui/uiconfig/ui/tsaurldialog.ui b/cui/uiconfig/ui/tsaurldialog.ui
index 3d005f3faa22..6bcceb4bfeeb 100644
--- a/cui/uiconfig/ui/tsaurldialog.ui
+++ b/cui/uiconfig/ui/tsaurldialog.ui
@@ -51,7 +51,6 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
- <property name="has_default">True</property>
<property name="receives_default">True</property>
<property name="use_underline">True</property>
<property name="use_stock">True</property>
@@ -68,7 +67,6 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
- <property name="has_default">True</property>
<property name="receives_default">True</property>
<property name="use_underline">True</property>
</object>
diff --git a/dbaccess/uiconfig/ui/collectionviewdialog.ui b/dbaccess/uiconfig/ui/collectionviewdialog.ui
index 0ffb48584773..73302a721fe9 100644
--- a/dbaccess/uiconfig/ui/collectionviewdialog.ui
+++ b/dbaccess/uiconfig/ui/collectionviewdialog.ui
@@ -66,7 +66,6 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
- <property name="has_default">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
@@ -135,7 +134,6 @@
<property name="can_focus">True</property>
<property name="focus_on_click">False</property>
<property name="can_default">True</property>
- <property name="has_default">True</property>
<property name="receives_default">True</property>
<property name="tooltip_text" translatable="yes" context="collectionviewdialog|newFolderButton|tooltip_text">Create New Directory</property>
<property name="image">image1</property>
@@ -152,7 +150,6 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
- <property name="has_default">True</property>
<property name="receives_default">True</property>
<property name="tooltip_text" translatable="yes" context="collectionviewdialog|upButton|tooltip_text">Up One Level</property>
<property name="image">image2</property>
diff --git a/fpicker/uiconfig/ui/remotefilesdialog.ui b/fpicker/uiconfig/ui/remotefilesdialog.ui
index e721340710e6..c2c8ef330194 100644
--- a/fpicker/uiconfig/ui/remotefilesdialog.ui
+++ b/fpicker/uiconfig/ui/remotefilesdialog.ui
@@ -157,7 +157,6 @@
<property name="label">gtk-save</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
- <property name="has_default">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
diff --git a/sc/uiconfig/scalc/ui/analysisofvariancedialog.ui b/sc/uiconfig/scalc/ui/analysisofvariancedialog.ui
index ee263c911ad0..314dc2e78060 100644
--- a/sc/uiconfig/scalc/ui/analysisofvariancedialog.ui
+++ b/sc/uiconfig/scalc/ui/analysisofvariancedialog.ui
@@ -48,7 +48,6 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
- <property name="has_default">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
diff --git a/sc/uiconfig/scalc/ui/chisquaretestdialog.ui b/sc/uiconfig/scalc/ui/chisquaretestdialog.ui
index ea334c67fe6c..00091703893f 100644
--- a/sc/uiconfig/scalc/ui/chisquaretestdialog.ui
+++ b/sc/uiconfig/scalc/ui/chisquaretestdialog.ui
@@ -41,7 +41,6 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
- <property name="has_default">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
diff --git a/sc/uiconfig/scalc/ui/correlationdialog.ui b/sc/uiconfig/scalc/ui/correlationdialog.ui
index 83032f964929..0bb9e8a9dd8d 100644
--- a/sc/uiconfig/scalc/ui/correlationdialog.ui
+++ b/sc/uiconfig/scalc/ui/correlationdialog.ui
@@ -41,7 +41,6 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
- <property name="has_default">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
diff --git a/sc/uiconfig/scalc/ui/covariancedialog.ui b/sc/uiconfig/scalc/ui/covariancedialog.ui
index 28fc81770450..4bd5e8071fcd 100644
--- a/sc/uiconfig/scalc/ui/covariancedialog.ui
+++ b/sc/uiconfig/scalc/ui/covariancedialog.ui
@@ -41,7 +41,6 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
- <property name="has_default">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
diff --git a/sc/uiconfig/scalc/ui/descriptivestatisticsdialog.ui b/sc/uiconfig/scalc/ui/descriptivestatisticsdialog.ui
index 5f3975b57020..12e96f98b6a5 100644
--- a/sc/uiconfig/scalc/ui/descriptivestatisticsdialog.ui
+++ b/sc/uiconfig/scalc/ui/descriptivestatisticsdialog.ui
@@ -41,7 +41,6 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
- <property name="has_default">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
diff --git a/sc/uiconfig/scalc/ui/exponentialsmoothingdialog.ui b/sc/uiconfig/scalc/ui/exponentialsmoothingdialog.ui
index d10bac1fb7ad..1d2d82ba0547 100644
--- a/sc/uiconfig/scalc/ui/exponentialsmoothingdialog.ui
+++ b/sc/uiconfig/scalc/ui/exponentialsmoothingdialog.ui
@@ -47,7 +47,6 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
- <property name="has_default">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
diff --git a/sc/uiconfig/scalc/ui/fourieranalysisdialog.ui b/sc/uiconfig/scalc/ui/fourieranalysisdialog.ui
index 7401b7d6b388..4d6fc8dbe490 100644
--- a/sc/uiconfig/scalc/ui/fourieranalysisdialog.ui
+++ b/sc/uiconfig/scalc/ui/fourieranalysisdialog.ui
@@ -48,7 +48,6 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
- <property name="has_default">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
diff --git a/sc/uiconfig/scalc/ui/movingaveragedialog.ui b/sc/uiconfig/scalc/ui/movingaveragedialog.ui
index 9fddb83520bd..797a5fcacdd8 100644
--- a/sc/uiconfig/scalc/ui/movingaveragedialog.ui
+++ b/sc/uiconfig/scalc/ui/movingaveragedialog.ui
@@ -48,7 +48,6 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
- <property name="has_default">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
diff --git a/sc/uiconfig/scalc/ui/randomnumbergenerator.ui b/sc/uiconfig/scalc/ui/randomnumbergenerator.ui
index 098725594fee..f108a8baa05b 100644
--- a/sc/uiconfig/scalc/ui/randomnumbergenerator.ui
+++ b/sc/uiconfig/scalc/ui/randomnumbergenerator.ui
@@ -48,7 +48,6 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
- <property name="has_default">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
@@ -80,7 +79,6 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
- <property name="has_default">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
diff --git a/sc/uiconfig/scalc/ui/regressiondialog.ui b/sc/uiconfig/scalc/ui/regressiondialog.ui
index 474044b27549..4dc08afc4cd4 100644
--- a/sc/uiconfig/scalc/ui/regressiondialog.ui
+++ b/sc/uiconfig/scalc/ui/regressiondialog.ui
@@ -46,7 +46,6 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
- <property name="has_default">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
diff --git a/sc/uiconfig/scalc/ui/samplingdialog.ui b/sc/uiconfig/scalc/ui/samplingdialog.ui
index 1c81619cd41f..db1ce5b4e8e9 100644
--- a/sc/uiconfig/scalc/ui/samplingdialog.ui
+++ b/sc/uiconfig/scalc/ui/samplingdialog.ui
@@ -53,7 +53,6 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
- <property name="has_default">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
diff --git a/sc/uiconfig/scalc/ui/ttestdialog.ui b/sc/uiconfig/scalc/ui/ttestdialog.ui
index f00421866eb9..fcf4192ea555 100644
--- a/sc/uiconfig/scalc/ui/ttestdialog.ui
+++ b/sc/uiconfig/scalc/ui/ttestdialog.ui
@@ -39,7 +39,6 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
- <property name="has_default">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
diff --git a/sc/uiconfig/scalc/ui/ztestdialog.ui b/sc/uiconfig/scalc/ui/ztestdialog.ui
index d9009414c965..0106f1700de4 100644
--- a/sc/uiconfig/scalc/ui/ztestdialog.ui
+++ b/sc/uiconfig/scalc/ui/ztestdialog.ui
@@ -39,7 +39,6 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
- <property name="has_default">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
diff --git a/sfx2/uiconfig/ui/versioncommentdialog.ui b/sfx2/uiconfig/ui/versioncommentdialog.ui
index 2c74db6c5ec4..46ca82b19f2f 100644
--- a/sfx2/uiconfig/ui/versioncommentdialog.ui
+++ b/sfx2/uiconfig/ui/versioncommentdialog.ui
@@ -42,7 +42,6 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
- <property name="has_default">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
diff --git a/sw/uiconfig/swriter/ui/bibliographyentry.ui b/sw/uiconfig/swriter/ui/bibliographyentry.ui
index 165e8aa74f0c..88ec49871559 100644
--- a/sw/uiconfig/swriter/ui/bibliographyentry.ui
+++ b/sw/uiconfig/swriter/ui/bibliographyentry.ui
@@ -112,7 +112,6 @@
<property name="label" translatable="yes" context="bibliographyentry|modify">Apply</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
- <property name="has_default">True</property>
<property name="receives_default">True</property>
<property name="no_show_all">True</property>
</object>
diff --git a/sw/uiconfig/swriter/ui/indexentry.ui b/sw/uiconfig/swriter/ui/indexentry.ui
index 931792bf62e3..dd7d118f36ab 100644
--- a/sw/uiconfig/swriter/ui/indexentry.ui
+++ b/sw/uiconfig/swriter/ui/indexentry.ui
@@ -92,7 +92,6 @@
<property name="label" translatable="yes" context="indexentry|insert">Insert</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
- <property name="has_default">True</property>
<property name="receives_default">True</property>
<property name="no_show_all">True</property>
</object>
More information about the Libreoffice-commits
mailing list