Re: [orca-list] A question for a traceback error message prewenting related



Hy Joanie,

Thank you your answer, I think I understand with you wrote. Look detailed what can I doing for example the bug 651206 related fix: For example, the contraction error related fix I defined following setting in src/orca/settings.py file:
    "showcursorComputerBraille",
#Present the cursor positioned word withcomputer braille format
showcursorComputerBraille = True

In orca-setup.ui file I created a check box in braille page with I named showcursorComputerBrailleCheckButton, and use following general signal when the check button is toggled: checkButtonToggled

In orca_gui_prefs.py file the checkButtonToggled function I putted following code:
self.get_widget("showcursorComputerBrailleCheckButton").set_active( \
                prefs["showcursorComputerBraille"])

In _initGUIState(self) function I putted following code line, I think this is the matter this situation, I forgotted the try block defining, or an if statement defining:

self.get_widget("showcursorComputerBrailleCheckButton").set_active( \
                prefs["showcursorComputerBraille"])

This situation what the better method:
1. Doing a try block, and exexute the prewious line.
In exception part if happening the KeyError exception, simple execute the set_active method with False value.

2. Doing an if statement with ask the settings.showcursorComputerBraille setting, and depending the setting value simple execute the set_widget method with proper value?

For example, in braille verbosity level only have if statements:
if prefs["brailleVerbosityLevel"] == settings.VERBOSITY_LEVEL_BRIEF:
            self.get_widget("brailleBriefButton").set_active(True)
        else:
            self.get_widget("brailleVerboseButton").set_active(True)

If you tell me what method prefer this situation in Orca codes, I doing the final modifications and attaching the second two functions related with the hopefuly final patches.

Attila



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]