Skip to content

Add "report formatting for text under braille cell" command#7189

Merged
michaelDCurran merged 20 commits into
nvaccess:masterfrom
dkager:i7106
Mar 28, 2018
Merged

Add "report formatting for text under braille cell" command#7189
michaelDCurran merged 20 commits into
nvaccess:masterfrom
dkager:i7106

Conversation

@dkager

@dkager dkager commented May 19, 2017

Copy link
Copy Markdown
Contributor

Link to issue number:

Fixes #7106. Fixes #7869.

Summary of the issue:

This command is useful to obtain formatting information for text under a particular braille cell without first having to route the cursor there. It is an intuitive command to be tied to the Alva BC6 secondary routing keys. Displays without such keys can use a gesture that consists of the routing key with another braille display key.

Description of how this pull request fixes the issue:

Followed suggestions from @jcsteh in #7106 (comment)

Also incorporated PR #7990.

Testing performed:

Assigned the command to the Alva BC6 secondary routing keys. Then ran it on both Windows controls and text in various editors (Notepad, Word, Notepad++).

Known issues with pull request:

This command only makes sense when assigned to (secondary) cursor routing keys, because it reports formatting for text under a specific braille cell. However, this is not enforced in any way.

Change log entry:

In New Features:

Changes:

Bug Fixes:

@derekriemer

derekriemer commented May 19, 2017 via email

Copy link
Copy Markdown
Collaborator

@dkager

dkager commented May 19, 2017

Copy link
Copy Markdown
Contributor Author

@LeonarddeR suggested space+routing.

@LeonarddeR

Copy link
Copy Markdown
Collaborator

@LeonarddeR suggested space+routing.

Yup, but this won't work with displays without a braille keyboard, Baum Vario 340 for example, or whatever their newest device is called. Also, the 80 cell Braillant displays do not have braille input from what I recall.

@dkager

dkager commented May 19, 2017

Copy link
Copy Markdown
Contributor Author

Also, the 80 cell Braillant displays do not have braille input from what I recall.

... And on the BI 40 I turn it off to avoid bogus input. But I think for anything else, like C1+routing on the Brailliant, users have to decide and define it themselves.

@LeonarddeR

Copy link
Copy Markdown
Collaborator

I just walked through this code and all looks good to me.

@dkager

dkager commented Jul 19, 2017

Copy link
Copy Markdown
Contributor Author

Just expertly dealt with a conflict situation, if I say so myself. :)

@LeonarddeR LeonarddeR left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ugh, merge conflicts again.

Also, I think it would be good if you would change the papenmeier drivers in this pr as well. See script_upperRouting in both of them.

@derekriemer

Copy link
Copy Markdown
Collaborator

still merge conflicts

… drivers.

This removes their "route to and report formatting" behavior. Instead, it now only reports formatting without routing the cursor.
@dkager

dkager commented Sep 9, 2017

Copy link
Copy Markdown
Contributor Author

All fixed.

@LeonarddeR

Copy link
Copy Markdown
Collaborator

@michaelDCurran: Could it be that you forgot to incubate these?

Nevertheless, there are merge conflicts due to the new ALVA driver.

@michaelDCurran

michaelDCurran commented Feb 5, 2018 via email

Copy link
Copy Markdown
Member

@dkager dkager requested a review from LeonarddeR February 5, 2018 18:00
Comment thread source/globalCommands.py Outdated
script_sayAll.category=SCRCAT_SYSTEMCARET

def script_reportFormatting(self,gesture):
def _reportFormatting(self, info, browseable=False):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May be call this _reportFormattingHelper or _formatReportingHelper?

Comment thread user_docs/en/userGuide.t2t Outdated
| Move braille display to next line | t4 |
| Scroll braille display forward | t5 or etouch3 |
| Route to braille cell | routing |
| Reports formatting under braille cell | secondRouting |

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given the verbs above are toggle and route, I'd say this should be report instead of report.

Comment thread source/globalCommands.py Outdated
# 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
self._reportFormatting(info, False)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder whether reporting formatting info in a browsable message would make sense for routing with a braille display, e.g. after two or three presses?

@dkager

dkager commented Feb 6, 2018

Copy link
Copy Markdown
Contributor Author

@LeonarddeR One more round of review please.

@LeonarddeR LeonarddeR left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Woops, my bad, I overlooked an important thing. When you report formatting under a braille cell, the formatting information is also shown in braille, for the first press, and than the second press applies to the formatting message and not to the text you're trying to review. I guess it's better to revert the double press functionality.

@dkager

dkager commented Feb 10, 2018

Copy link
Copy Markdown
Contributor Author

Interesting.
I also realized that it doesn't make sense to assign this command to a non-routing key, but that we can't enforce that right now.

@LeonarddeR

Copy link
Copy Markdown
Collaborator

This is likely to conflict with #7990

@michaelDCurran

Copy link
Copy Markdown
Member

Above the info.expand in _reportFormattingHelper, please at the following line:

info=info.copy()

This ensures that we don't accidentally mutate the passed in TextInfo, which may have been the review cursor or something.
This will then superseed PR #7990 and therefore fix #7869

@dkager

dkager commented Feb 13, 2018

Copy link
Copy Markdown
Contributor Author

@michaelDCurran I believe the last commit is what you meant, but please double-check.

@dkager

dkager commented Feb 13, 2018

Copy link
Copy Markdown
Contributor Author

Updated #7189 (comment) with info from the other PR and better changelog entries.

michaelDCurran added a commit that referenced this pull request Mar 8, 2018
@michaelDCurran

Copy link
Copy Markdown
Member

When this was merged to next, it failed a test.

Traceback (most recent call last):
  File "C:\Users\mick\programming\git\nvda\tests\unit\test_braille.py", line 32, in setUp
    braille.handler.handleGainFocus(self.obj)
  File "C:\Users\mick\programming\git\nvda\source\braille.py", line 1746, in handleGainFocus
    self._doNewObject(itertools.chain(getFocusContextRegions(obj, oldFocusRegions=self.mainBuffer.regions), getFocusRegi
ons(obj)))
  File "C:\Users\mick\programming\git\nvda\source\braille.py", line 1751, in _doNewObject
    for region in regions:
  File "C:\Users\mick\programming\git\nvda\source\braille.py", line 1449, in getFocusContextRegions
    region.update()
  File "C:\Users\mick\programming\git\nvda\source\braille.py", line 600, in update
    super(NVDAObjectRegion, self).update()
  File "C:\Users\mick\programming\git\nvda\source\braille.py", line 382, in update
    mode |= louis.pass1Only
AttributeError: 'module' object has no attribute 'pass1Only' 

@LeonarddeR

Copy link
Copy Markdown
Collaborator

hmm, it looks like the merge went wrong in that case. Liblouis pass1only has been removed as part of #7839.

@michaelDCurran

michaelDCurran commented Mar 8, 2018 via email

Copy link
Copy Markdown
Member

@michaelDCurran

Copy link
Copy Markdown
Member

Sorry, when I tested locally I had not updated my liblouis submodule it seems. The error in the build was
simply a missing translator comment. I shall fix myself.

michaelDCurran added a commit that referenced this pull request Mar 8, 2018
@dkager

dkager commented Mar 9, 2018

Copy link
Copy Markdown
Contributor Author

Just to confirm: this PR does not depend on any liblouis features.

@michaelDCurran

michaelDCurran commented Mar 9, 2018 via email

Copy link
Copy Markdown
Member

@michaelDCurran michaelDCurran merged commit 9dd4836 into nvaccess:master Mar 28, 2018
@nvaccessAuto nvaccessAuto added this to the 2018.2 milestone Mar 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The font color retreived in word is different if pressed once than twice Add "report formatting under cursor routing key" command

5 participants