Skip to content

Commit 023d5d7

Browse files
authored
Merge ccaa4de into 5a0b42e
2 parents 5a0b42e + ccaa4de commit 023d5d7

5 files changed

Lines changed: 38 additions & 3 deletions

File tree

source/config/configSpec.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@
181181
reportLists = boolean(default=true)
182182
reportHeadings = boolean(default=true)
183183
reportBlockQuotes = boolean(default=true)
184+
reportGroupings = boolean(default=true)
184185
reportLandmarks = boolean(default=true)
185186
reportFrames = boolean(default=true)
186187
reportClickable = boolean(default=true)

source/globalCommands.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -623,6 +623,22 @@ def script_toggleReportHeadings(self,gesture):
623623
script_toggleReportHeadings.__doc__=_("Toggles on and off the reporting of headings")
624624
script_toggleReportHeadings.category=SCRCAT_DOCUMENTFORMATTING
625625

626+
@script(
627+
# Translators: Input help mode message for toggle report groupings command.
628+
description=_("Toggles on and off the reporting of groupings"),
629+
category=SCRCAT_DOCUMENTFORMATTING
630+
)
631+
def script_toggleReportGroupings(self,gesture):
632+
if config.conf["documentFormatting"]["reportGroupings"]:
633+
# Translators: The message announced when toggling the report block quotes document formatting setting.
634+
state = _("report gorupings off")
635+
config.conf["documentFormatting"]["reportGroupings"]=False
636+
else:
637+
# Translators: The message announced when toggling the report block quotes document formatting setting.
638+
state = _("report groupings on")
639+
config.conf["documentFormatting"]["reportGroupings"]=True
640+
ui.message(state)
641+
626642
def script_toggleReportBlockQuotes(self,gesture):
627643
if config.conf["documentFormatting"]["reportBlockQuotes"]:
628644
# Translators: The message announced when toggling the report block quotes document formatting setting.

source/gui/settingsDialogs.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1913,6 +1913,11 @@ def makeSettings(self, settingsSizer):
19131913
self.blockQuotesCheckBox=elementsGroup.addItem(wx.CheckBox(self,label=_("Block &quotes")))
19141914
self.blockQuotesCheckBox.SetValue(config.conf["documentFormatting"]["reportBlockQuotes"])
19151915

1916+
# Translators: This is the label for a checkbox in the
1917+
# document formatting settings panel.
1918+
self.groupingsCheckBox = elementsGroup.addItem(wx.CheckBox(self, label=_("&Groupings")))
1919+
self.groupingsCheckBox.SetValue(config.conf["documentFormatting"]["reportGroupings"])
1920+
19161921
# Translators: This is the label for a checkbox in the
19171922
# document formatting settings panel.
19181923
self.landmarksCheckBox=elementsGroup.addItem(wx.CheckBox(self,label=_("Lan&dmarks")))
@@ -1964,6 +1969,7 @@ def onSave(self):
19641969
config.conf["documentFormatting"]["reportHeadings"]=self.headingsCheckBox.IsChecked()
19651970
config.conf["documentFormatting"]["reportLists"]=self.listsCheckBox.IsChecked()
19661971
config.conf["documentFormatting"]["reportBlockQuotes"]=self.blockQuotesCheckBox.IsChecked()
1972+
config.conf["documentFormatting"]["reportGroupings"] = self.groupingsCheckBox.IsChecked()
19671973
config.conf["documentFormatting"]["reportLandmarks"]=self.landmarksCheckBox.IsChecked()
19681974
config.conf["documentFormatting"]["reportFrames"]=self.framesCheckBox.Value
19691975
config.conf["documentFormatting"]["reportClickable"]=self.clickableCheckBox.Value

source/speech/__init__.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1304,9 +1304,18 @@ def getControlFieldSpeech(attrs,ancestorAttrs,fieldType,formatConfig=None,extraD
13041304
),
13051305
levelText
13061306
))
1307-
elif nameText and reason==controlTypes.REASON_FOCUS and fieldType == "start_addedToControlFieldStack" and role in (controlTypes.ROLE_GROUPING, controlTypes.ROLE_PROPERTYPAGE):
1308-
# #3321, #709: Report the name of groupings (such as fieldsets) and tab pages for quicknav and focus jumps
1309-
return " ".join((nameText,roleText))
1307+
elif (
1308+
(nameText or descriptionText)
1309+
and reason==controlTypes.REASON_FOCUS
1310+
and fieldType == "start_addedToControlFieldStack"
1311+
and role in (controlTypes.ROLE_GROUPING, controlTypes.ROLE_PROPERTYPAGE)
1312+
):
1313+
# #10095, #3321, #709: Report the name and description of groupings (such as fieldsets) and tab pages
1314+
# for quicknav and focus jumps.
1315+
textChunks = [nameText, roleText]
1316+
if descriptionText:
1317+
textChunks.append(descriptionText)
1318+
return " ".join(textChunks)
13101319
elif fieldType in ("start_addedToControlFieldStack","start_relative") and role in (controlTypes.ROLE_TABLECELL,controlTypes.ROLE_TABLECOLUMNHEADER,controlTypes.ROLE_TABLEROWHEADER) and tableID:
13111320
# Table cell.
13121321
reportTableHeaders = formatConfig["reportTableHeaders"]

source/textInfos/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,13 @@ def getPresentationCategory(self, ancestors, formatConfig, reason=controlTypes.R
6262
table = None
6363
if not table or (not formatConfig["includeLayoutTables"] and table.get("table-layout", None)) or table.get('isHidden',False):
6464
return self.PRESCAT_LAYOUT
65+
name = self.get("name")
6566
landmark = self.get("landmark")
6667
if reason in (controlTypes.REASON_CARET, controlTypes.REASON_SAYALL, controlTypes.REASON_FOCUS) and (
6768
(role == controlTypes.ROLE_LINK and not formatConfig["reportLinks"])
6869
or (role == controlTypes.ROLE_HEADING and not formatConfig["reportHeadings"])
6970
or (role == controlTypes.ROLE_BLOCKQUOTE and not formatConfig["reportBlockQuotes"])
71+
or (role == controlTypes.ROLE_GROUPING and (not name or not formatConfig["reportGroupings"]))
7072
or (role in (controlTypes.ROLE_TABLE, controlTypes.ROLE_TABLECELL, controlTypes.ROLE_TABLEROWHEADER, controlTypes.ROLE_TABLECOLUMNHEADER) and not formatConfig["reportTables"])
7173
or (role in (controlTypes.ROLE_LIST, controlTypes.ROLE_LISTITEM) and controlTypes.STATE_READONLY in states and not formatConfig["reportLists"])
7274
or (role in (controlTypes.ROLE_FRAME, controlTypes.ROLE_INTERNALFRAME) and not formatConfig["reportFrames"])
@@ -125,6 +127,7 @@ def getPresentationCategory(self, ancestors, formatConfig, reason=controlTypes.R
125127
elif (
126128
role in (
127129
controlTypes.ROLE_BLOCKQUOTE,
130+
controlTypes.ROLE_GROUPING,
128131
controlTypes.ROLE_FRAME,
129132
controlTypes.ROLE_INTERNALFRAME,
130133
controlTypes.ROLE_TOOLBAR,

0 commit comments

Comments
 (0)