summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/lint-ui.py12
-rw-r--r--uui/uiconfig/ui/simplenameclash.ui1
-rw-r--r--writerperfect/uiconfig/ui/wpftencodingdialog.ui1
3 files changed, 13 insertions, 1 deletions
diff --git a/bin/lint-ui.py b/bin/lint-ui.py
index 4f13320a23f3..a4631e760b4c 100755
--- a/bin/lint-ui.py
+++ b/bin/lint-ui.py
@@ -76,6 +76,17 @@ 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'
+ for widget in element.findall('.//object'):
+ if not widget.attrib['class']:
+ continue
+ widget_type = widget.attrib['class']
+ has_defaults = widget.findall("./property[@name='has_default']")
+ if len(has_defaults) > 0 and has_defaults[0].text == "True":
+ 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)
+
def check_button_box_spacing(element):
spacing = element.findall("property[@name='spacing']")
lint_assert(len(spacing) > 0 and spacing[0].text == BUTTON_BOX_SPACING,
@@ -121,7 +132,6 @@ def check_check_buttons(root):
if len(radio_underlines) < 1:
lint_assert(False, "No use_underline in GtkCheckButton with id = '" + radio.attrib['id'] + "'", radio)
-
def check_frames(root):
frames = [element for element in root.findall('.//object') if element.attrib['class'] == 'GtkFrame']
for frame in frames:
diff --git a/uui/uiconfig/ui/simplenameclash.ui b/uui/uiconfig/ui/simplenameclash.ui
index 9c5f39213e0c..04d0bb16ef8f 100644
--- a/uui/uiconfig/ui/simplenameclash.ui
+++ b/uui/uiconfig/ui/simplenameclash.ui
@@ -56,6 +56,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="has_default">True</property>
+ <property name="can_default">True</property>
<property name="receives_default">True</property>
</object>
<packing>
diff --git a/writerperfect/uiconfig/ui/wpftencodingdialog.ui b/writerperfect/uiconfig/ui/wpftencodingdialog.ui
index 067cfb72bad3..d0aff9435ac2 100644
--- a/writerperfect/uiconfig/ui/wpftencodingdialog.ui
+++ b/writerperfect/uiconfig/ui/wpftencodingdialog.ui
@@ -28,6 +28,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="has_default">True</property>
+ <property name="can_default">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
<property name="yalign">0.62000000476837158</property>