nvda-sonar-users team mailing list archive
-
nvda-sonar-users team
-
Mailing list archive
-
Message #00032
Re: Plugin Class Definition Code Question
-
To:
nvda-sonar-users@xxxxxxxxxxxxxxxxxxx
-
From:
James Teh <jamie@xxxxxxxxxxx>
-
Date:
Thu, 27 Dec 2012 08:53:37 +1000
-
In-reply-to:
<0C65E406-8D64-4703-878A-65A8EEDD41FC@gmail.com>
-
User-agent:
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:20.0) Gecko/20100101 Thunderbird/20.0a1
Hi GAvin,
Note that the list doesn't force replies to itself by default and I
can't override this. Nudging this back to the list.
On 27/12/2012 3:07 AM, Gavin Grundlingh wrote:
elif obj.role == controlTypes.ROLE_DIALOG:
...
for title, objClass in PLUGIN_WINDOW_CLASSES:
if name == "Samples Missing":
clsList.insert(0, objClass)
This code is incorrect. It will insert every class in
PLUGIN_WINDOW_CLASSES because you're not checking against title. Even if
it were correct, it isn't a good idea because it will allow the other
plugin classes to be used for dialogs, which they should never be. This
is why I made the code suggestion I did. That way, it applies only to
dialogs of the required name. You shouldn't add it to
PLUGIN_WINDOW_CLASSES either.
As to my Python functions question earlier, I'm busy going through the
Python 2.7.3 documentation now. Hopefully it'll help me with what I'm
trying to implement.
You should also file a feature request at:
http://bugs.launchpad.net/nvda-sonar
Jamie
--
James Teh
Email/MSN Messenger/Jabber: jamie@xxxxxxxxxxx
Web site: http://www.jantrid.net/
Twitter: jcsteh
References