Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Disallow screen curtain when recognizing
  • Loading branch information
LeonarddeR committed Aug 25, 2023
commit 43d9ad61a9a0f57398896d6efb4ad7f5b9c20638
20 changes: 13 additions & 7 deletions source/globalCommands.py
Original file line number Diff line number Diff line change
Expand Up @@ -1050,7 +1050,7 @@ def script_reviewMode_next(self,gesture):
braille.handler.setTether(TetherTo.REVIEW.value, auto=True)
speech.speakTextInfo(pos)
else:
# Translators: reported when there are no other available review modes for this object
# Translators: reported when there are no other available review modes for this object
ui.reviewMessage(_("No next review mode"))

@script(
Expand All @@ -1071,7 +1071,7 @@ def script_reviewMode_previous(self,gesture):
braille.handler.setTether(TetherTo.REVIEW.value, auto=True)
speech.speakTextInfo(pos)
else:
# Translators: reported when there are no other available review modes for this object
# Translators: reported when there are no other available review modes for this object
ui.reviewMessage(_("No previous review mode"))

@script(
Expand Down Expand Up @@ -2184,7 +2184,7 @@ def _reportFormattingHelper(self, info, browseable=False):
indentation,content=speech.splitTextIndentation(line.text)
if indentation:
textList.extend(speech.getIndentationSpeech(indentation, formatConfig))

info=info.copy()
info.expand(textInfos.UNIT_CHARACTER)
formatField=textInfos.FormatField()
Expand All @@ -2201,7 +2201,7 @@ def _reportFormattingHelper(self, info, browseable=False):
# Translators: Reported when trying to obtain formatting information (such as font name, indentation and so on) but there is no formatting information for the text under cursor.
ui.message(_("No formatting information"))
return

ui.message(" ".join(textList))
else:
if formatField:
Expand Down Expand Up @@ -3380,7 +3380,7 @@ def script_reportClipboardText(self,gesture):
# Translators: Presented when there is no text on the clipboard.
ui.message(_("There is no text on the clipboard"))
return
if len(text) < 1024:
if len(text) < 1024:
ui.message(text)
else:
# Translators: If the number of characters on the clipboard is greater than about 1000, it reports this message and gives number of characters on the clipboard.
Expand Down Expand Up @@ -3555,7 +3555,7 @@ def script_braille_reportFormatting(self, gesture):
category=SCRCAT_BRAILLE
)
def script_braille_previousLine(self, gesture):
if braille.handler.buffer.regions:
if braille.handler.buffer.regions:
braille.handler.buffer.regions[-1].previousLine(start=True)

@script(
Expand All @@ -3564,7 +3564,7 @@ def script_braille_previousLine(self, gesture):
category=SCRCAT_BRAILLE
)
def script_braille_nextLine(self, gesture):
if braille.handler.buffer.regions:
if braille.handler.buffer.regions:
braille.handler.buffer.regions[-1].nextLine()

@script(
Expand Down Expand Up @@ -4259,6 +4259,12 @@ def _enableScreenCurtain(doEnable: bool = True):
)
)
else:
from contentRecog.recogUi import RecogResultNVDAObject
if isinstance(api.getFocusObject(), RecogResultNVDAObject):
Comment thread
LeonarddeR marked this conversation as resolved.
Outdated
# Translators: Warning message when trying to enable the screen curtain when OCR is active.
warningMessage = _("Could not enable screen curtain when performing content recognition")
ui.message(warningMessage, speechPriority=speech.priorities.Spri.NOW)
return
_enableScreenCurtain()

@script(
Expand Down