GNOME Bugzilla – Bug 621469
The chat-only-if-focused options aren't respected when another script is active
Last modified: 2010-09-20 10:54:44 UTC
When another script is active (e.g. gnome-terminal), the value of settings.chatMessageVerbosity is taken from the active script; not the script for the chat app. Because the default value of this setting is to speak all, we are in danger of presenting incoming messages that the user isn't interested in.
It seems that focus_tracking_presenter.py is in charge of loading app settings and only does so after a given script has been initialized and only if that script is being made the active script. This saddens me.
Created attachment 163534 [details] [review] proposed fix Hack to get the correct setting when some other script is the active one. Pylints to a 10 and seems to work.... (We need unborked settings.)
(In reply to comment #2) > Created an attachment (id=163534) [details] [review] > proposed fix > > Hack to get the correct setting when some other script is the active one. > Pylints to a 10 and seems to work.... > > (We need unborked settings.) We need to decoupling this logic. I think that if logic in getMessageVerbosity is valid for any script this should be added in settings class. In this way, any script can look for a setting this way. is it possible? is viable?
(In reply to comment #3) > We need to decoupling this logic. I think that if logic in getMessageVerbosity > is valid for any script this should be added in settings class. In this way, > any script can look for a setting this way. > > is it possible? is viable? Since we don't have a settings class (yet), I thought about placing it in script.py and making it more generic. In fact, that's where it started out when I was hacking on this problem. What I was hoping to do originally, is create a method to return all of the settings for a script/module even if that script were not the active script. In order to do so, that would require combining whatever's set in settings.py with whatever's been set in the module. And, to be honest, how to do that gracefully didn't jump out at me. So I came up with this quick hack. :-/ Mind giving me another hint as to how to do this properly? :-) Thanks Ale!
Talked to Ale about this in IRC. Will give the original plan (described in Comment 4) another, less-lazy try.
Created attachment 163653 [details] [review] move logic to script.py Take 2. :-) Ale, I hope this is what you had in mind. Please review. Thanks!
Review of attachment 163653 [details] [review]: Perfect. In this way there's a homogenous way to obtain this setting value anywhere in the code. Good work!
Comment on attachment 163653 [details] [review] move logic to script.py http://git.gnome.org/browse/orca/commit/?id=1e7bc3eea2add619f588e189ed73ec79f395bf0a
Thanks for the reviews Ale! Closing as FIXED.