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 621469 - The chat-only-if-focused options aren't respected when another script is active
The chat-only-if-focused options aren't respected when another script is active
Status: RESOLVED FIXED
Product: orca
Classification: Applications
Component: general
2.31.x
Other All
: Normal normal
: 2.32.0
Assigned To: Joanmarie Diggs (IRC: joanie)
Orca Maintainers
chat
Depends on:
Blocks: 615489
 
 
Reported: 2010-06-13 17:14 UTC by Joanmarie Diggs (IRC: joanie)
Modified: 2010-09-20 10:54 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
proposed fix (2.34 KB, patch)
2010-06-13 20:13 UTC, Joanmarie Diggs (IRC: joanie)
none Details | Review
move logic to script.py (2.38 KB, patch)
2010-06-15 03:11 UTC, Joanmarie Diggs (IRC: joanie)
committed Details | Review

Description Joanmarie Diggs (IRC: joanie) 2010-06-13 17:14:32 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.
Comment 1 Joanmarie Diggs (IRC: joanie) 2010-06-13 18:02:00 UTC
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.
Comment 2 Joanmarie Diggs (IRC: joanie) 2010-06-13 20:13:51 UTC
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.)
Comment 3 Alejandro Leiva 2010-06-14 09:04:15 UTC
(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?
Comment 4 Joanmarie Diggs (IRC: joanie) 2010-06-14 13:16:30 UTC
(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!
Comment 5 Joanmarie Diggs (IRC: joanie) 2010-06-14 14:22:17 UTC
Talked to Ale about this in IRC. Will give the original plan (described in Comment 4) another, less-lazy try.
Comment 6 Joanmarie Diggs (IRC: joanie) 2010-06-15 03:11:39 UTC
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!
Comment 7 Alejandro Leiva 2010-06-15 07:27:49 UTC
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 8 Joanmarie Diggs (IRC: joanie) 2010-06-15 09:05:37 UTC
Comment on attachment 163653 [details] [review]
move logic to script.py

http://git.gnome.org/browse/orca/commit/?id=1e7bc3eea2add619f588e189ed73ec79f395bf0a
Comment 9 Joanmarie Diggs (IRC: joanie) 2010-06-15 09:06:41 UTC
Thanks for the reviews Ale! Closing as FIXED.