After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 617420 - Need unbound keybinding for rotating through punctuation levels.
Need unbound keybinding for rotating through punctuation levels.
Status: RESOLVED FIXED
Product: orca
Classification: Applications
Component: general
2.30.x
Other All
: Normal enhancement
: 2.32.0
Assigned To: Mesar Hameed
Orca Maintainers
Depends on:
Blocks:
 
 
Reported: 2010-05-02 09:41 UTC by Mesar Hameed
Modified: 2010-09-20 10:52 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch that is supposed to implement the feature (2.50 KB, patch)
2010-05-07 14:10 UTC, rudolf.weeber
needs-work Details | Review
New patch (2.42 KB, patch)
2010-05-09 16:25 UTC, rudolf.weeber
none Details | Review
Third time lucky (3.71 KB, patch)
2010-05-09 20:20 UTC, Mesar Hameed
none Details | Review
Rev 4 (5.51 KB, patch)
2010-05-10 13:34 UTC, Mesar Hameed
accepted-commit_now Details | Review

Description Mesar Hameed 2010-05-02 09:41:32 UTC
As brought up by Steve, and others:

--cut--
Actually, I don't remember seeing a punctuation level in the
unbound list.  If it isn't really there, how hard would it be to
insert that.  I can see a number of times where I would like to rotor
through punctuation levels on the fly on many occasions.
--cut--

http://mail.gnome.org/archives/orca-list/2010-April/msg00477.html

Thanks Rudolf for looking into the matter.
Comment 1 rudolf.weeber 2010-05-07 14:08:15 UTC
Hi,

Attached is a patch. I hope, I did it right...

Regards, Rudolf
Comment 2 rudolf.weeber 2010-05-07 14:10:23 UTC
Created attachment 160506 [details] [review]
Patch that is supposed to implement the feature
Comment 3 Mesar Hameed 2010-05-07 16:34:29 UTC
Review of attachment 160506 [details] [review]:

Hi Rudolf,

Thanks for the patch, it is almost perfect, i have the following 
comments:

1. I would prefer if we used rotatePunctuationLevel, because toggle 
gives the feeling that it is either on or off.

2. merge the actual rotation in the same block of ifs as the deciding 
what to speak.

3. (recommendation) the messages should be:
"Punctuation level set to none."
"punctuation level set to some."
etc.

4. dont use actual constants, just refer to them as 
settings.PUNCTUATION_STYLE_NONE etc.

5. Indentation needs to be consistant.
Always use 4 spaces to indicate new level, or if it is overflow from 
previous line then use 2.
lines that are longer than 80 chars should be split and continue on the 
following line.

Hope this is ok.

Thanks again for your time.

-Jon
Comment 4 rudolf.weeber 2010-05-09 16:24:54 UTC
Hi, 
here's a new patch. I hope, I adressed 1,2,4, and 5. Personally, I prefer the messages as they are, because it tells what is happening. New users might not now, what a "punctuation level" is. However, I don't mind very much, so feel free to change. "Speaking of punctuations set to..." would also be an option.

Regards, Rudolf
Comment 5 rudolf.weeber 2010-05-09 16:25:58 UTC
Created attachment 160643 [details] [review]
New patch
Comment 6 Mesar Hameed 2010-05-09 20:20:28 UTC
Created attachment 160668 [details] [review]
Third time lucky

Hi Rudolf,

This is a slightly modified version of your patch.

When i tried to change the punctuation level on the fly, the changes didnt take effect.
It seems that for speech-dispatcher at least, that we had to call speech.shutdown() and then speech.init() to get it to behave as we wanted.

Please look over this patch, and see if it works on your system.

If so I will commit this on your behalf.

Thanks

-Jon
Comment 7 rudolf.weeber 2010-05-10 06:28:21 UTC
Hi Jon,

strange, that. With gnome-speech it seems to work without shutting down and restarting speech.

On the other hand, with gnome speech shutting down and restarting causes quite a delay and the re-initialization of espeeak seems to fail in some cases, so speech falls back to the second synthesizer (festival).

What do we do about it?

Regards, Rudolf
Comment 8 Mesar Hameed 2010-05-10 13:34:44 UTC
Created attachment 160719 [details] [review]
Rev 4

Thanks Rudolf, Joanie

Now we dont shutdown and start up the speech again, which is a far better solution.

As you said Rudolf, gnome-speech does it for us, and for speech-dispatcher, i looked at the init function to see how it deals with punctuation level.

Then thought maybe it is best to implement it in simular way to increaseRate/pitch. i.e. we have a function that does the needed processing in gnome-speech, and speech-dispatcher, and the speech module only has to call it.

The outside world has to call speech.updatePunctuationLevel and we are done.

Hopefully this should be ok for both Rudolf not falling back to festival, and Joanie not getting a traceback. (Also cycling between the levels is snappy too.)

Thanks again for the excellent feedback, please test.

-Jon
Comment 9 Joanmarie Diggs (IRC: joanie) 2010-05-10 15:13:52 UTC
Comment on attachment 160719 [details] [review]
Rev 4

Sweet! I love it. Assuming there are no other issues found, I say commit this puppy. Thanks!

While testing, I noticed something very minor that I think we might want to think about as a totally separate bug/RFE. Consider the following scenario:

I'm working on a major task where my normal punctuation level (some) isn't what I need. So I've upped it to most and resumed working. Then something occurs to me that requires a settings change so I get into the Orca Preferences dialog. That dialog is loading the current settings, including Punctuation Level of Most. If I save my preferences, I'm making the temporary/on-the-fly punctuation my permanent setting. To me, that is unexpected behavior. Personally, I think we really need to distinguish between temporary settings and permanent ones in Preferences. Again, not this bug. It would no doubt apply to other settings we have. But I noticed it while testing this patch so I'm mentioning it here. <smile>

Anyhoo... Awesome work on this RFE guys. Thanks again very much for doing it!
Comment 10 Mesar Hameed 2010-05-10 17:05:59 UTC
(In reply to comment #9)
I tried it on lucid (new install) and things were working well so went ahead and commited to master.


> While testing, I noticed something very minor that I think we might want to
> think about as a totally separate bug/RFE. Consider the following scenario:
> 
> I'm working on a major task where my normal punctuation level (some) isn't what
> I need. So I've upped it to most and resumed working. Then something occurs to
> me that requires a settings change so I get into the Orca Preferences dialog.
> That dialog is loading the current settings, including Punctuation Level of
> Most. If I save my preferences, I'm making the temporary/on-the-fly punctuation
> my permanent setting. To me, that is unexpected behavior. Personally, I think
> we really need to distinguish between temporary settings and permanent ones in
> Preferences. Again, not this bug. It would no doubt apply to other settings we
> have. But I noticed it while testing this patch so I'm mentioning it here.
> <smile>

Yes, the design i had in mind here:

https://bugzilla.gnome.org/show_bug.cgi?id=570650#c3

should allow for this, (just ignore the yaml talk, thats just how the things would be saved while we are offline).

I guess eventually i will get around to it :)