%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/orca/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/orca/__pycache__/orca_gui_prefs.cpython-312.pyc

�

g
fuK���dZdZdZdZdZdZddlZejdd	�dd
lm	Z	ddl
Z
ddlmZddlmZdd
lm
Z
ddlmZddlmZddlZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlmZddlm Z dd lm!Z!dd!lm"Z"dd"lm#Z#dd#lm$Z$dd$l%m&Z&	ddl'Z'dd%l)m*Z*e're*sdZ'e+e,d&��\
Z-Z.Z/Z0Z1Z2Z3Z4Z5Z6e+e,d'��\Z7Z8Z9Z:e+e,d(��\Z;Z<e+e,d'��\Z=Z>Z?Z@e+e,d)��\ZAZBZCZDZEZFZGe+e,d*��\ZHZIZJZKZLZMZNZOZPZQZRZSZTZUZVZWGd+�d,ej��ZYy#e($rdZ'Y��wxYw)-z4Displays a GUI for the user to set Orca preferences.z$Id$z
$Revision$z$Date$z-Copyright (c) 2005-2009 Sun Microsystems Inc.�LGPL�N�Atspiz2.0)r)�Gdk)�GLib)�Gtk)�GObject)�Pango�)�acss)�debug)�
event_manager)�	guilabels)�messages)�orca)�orca_gtkbuilder)�orca_gui_profile)�
orca_state)�script_manager)�settings)�settings_manager)�input_event)�keybindings)�pronunciation_dict)�braille)�speech)�speechserver)�text_attribute_names)�AXObject)�	tablesdir�
����c��eZdZd�Zd�Zd�Zd�Zd{d�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d|d�Zd�Zd�Zd�Zd�Zd�Zd�Z d�Z!d �Z"d!�Z#d"�Z$d#�Z%d$�Z&d%�Z'd&�Z(d'�Z)d(�Z*d)�Z+d*�Z,d+�Z-d,�Z.d-�Z/d}d.�Z0d/�Z1d{d0�Z2d1�Z3d2�Z4d3�Z5d4�Z6d|d5�Z7d6�Z8d7�Z9d8�Z:d~d:�Z;	d~d;�Z<d<�Z=d{d=�Z>d>�Z?d?�Z@d@�ZAdA�ZBdB�ZCdC�ZDdD�ZEdE�ZFdF�ZGdG�ZHdH�ZIdI�ZJdJ�ZKdK�ZLdL�ZMdM�ZNdN�ZOdO�ZPdP�ZQdQ�ZRdR�ZSdS�ZTdT�ZUdU�ZVdV�ZWdW�ZXdX�ZYdY�ZZdZ�Z[d[�Z\d\�Z]d]�Z^d^�Z_d_�Z`d`�Zada�Zbdb�Zcdc�Zddd�Zede�Zfdf�Zgdg�Zhdh�Zidi�Zjdj�Zkdk�Zldl�Zmdm�Zndn�Zodo�Zpddp�Zqdq�Zrdr�Zsds�Ztdt�Zudu�Zvdv�Zwdw�Zxdx�Zydy�Zzdz�Z{y9)��OrcaSetupGUIc���tjj|||�||_ddg|_d|_d|_d|_d|_d|_	d|_
d|_d|_d|_
d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_d|_g|_d|_d|_d|_d|_ d|_!d|_"d|_#d|_$d|_%d|_&d|_'d|_(d|_)d|_*i|_+i|_,d|_-d|_.d|_/g|_0d|_1y)a
Initialize the Orca configuration GUI.

        Arguments:
        - fileName: name of the GtkBuilder file.
        - windowName: name of the component to get from the GtkBuilder file.
        - prefsDict: dictionary of preferences to use during initialization
        �Default�defaultNF)2r�GtkBuilderWrapper�__init__�	prefsDict�_defaultProfile�	bbindings�cellRendererText�defaultVoice�disableKeyGrabPref�getTextAttributesView�hyperlinkVoice�initializingSpeech�	kbindings�keyBindingsModel�keyBindView�
newBinding�pendingKeyBindings�planeCellRendererText�pronunciationModel�pronunciationView�screenHeight�screenWidth�speechFamiliesChoice�speechFamiliesChoices�speechFamiliesModel�speechLanguagesChoice�speechLanguagesChoices�speechLanguagesModel�speechFamilies�speechServersChoice�speechServersChoices�speechServersModel�speechSystemsChoice�speechSystemsChoices�speechSystemsModel�systemVoice�uppercaseVoice�window�workingFactories�	savedGain�
savedPitch�	savedRate�_isInitialSetup�selectedFamilyChoices�selectedLanguageChoices�
profilesCombo�profilesComboModel�startingProfileCombo�_capturedKey�script)�self�fileName�
windowNamer,s    �5/usr/lib/python3/dist-packages/orca/orca_gui_prefs.pyr+zOrcaSetupGUI.__init__as���	�)�)�2�2�4��:�N�"��� )�9�5������ $��� ���"&���%)��"�"���"&������ $���������"&���%)��"�"&���!%��� ������$(��!�%)��"�#'�� �%)��"�&*��#�$(��!� ���#'�� �$(��!�"&���#'�� �$(��!�"&������"������ $������������$���%'��"�')��$�!���"&���$(��!�������c��||_	tj�jd�}|tj
}	|tjj|_
	|tjj|_	|tjj|_|jd�|_|j j#�r:|j j#�D]}|j j%|��t'j(t*j,t*j,t*j,t*j,t*j,t*j,t*j,t*j,t*j.t*j.�
|_t'j2�|_t'j2�|_|j6j9dt:j<j>�t'j@d|j4tB��}|jEd	�|jGd
�|jItB�|j jK|�t'j@tLjN|j6tP��}|jEd	�|jSd�|jItP�|j jK|�t'j@d|j4tT��}|jGd
�|jEd	�|jItT�|j jK|�t'j@d
|j4tV��}|jGd
�|jEd	�|jItV�|j jK|�t'j@d|j4tX��}|jEd	�|jGd
�|jItX�|j jK|�t'j@d|j4tZ��}|jEd	�|jGd
�|jItZ�|j jK|�t'j@d|j4t\��}|jEd	�|jGd
�|jIt\�|j jK|�t'j2�}|j_d|j`|j0�|j_d|jb�|j_d|jd|j0tTtVtXtZtf�t'j@tLjh|tftj��}|jEd	�|jIt\�|j jK|�t'jl�}|j_d|jn|j0tp�t'j@tLjr|tptj��}|jEd	�|jItp�|j jK|�t'jl�}|j9dd
�t'j@d|tj��}|jGd
�|jEd	�|jItj�|j jK|�|ju�|jd�|_;|jy�|j{|jd��|_>|j{|jd��|_?|j{|jd��|_@|j{|jd��|_A|j��t�j�j�tj�j���|_G|jj��}|r^t'j�t�j�|jj����}|jd �j�||�|j��y!#t$ri}Y�	�AwxYw#t$rd|_
Y�	�5wxYw#t$rd|_Y�	�)wxYw#t$rd|_Y�	�wxYw)"z�Initialize the Orca configuration GUI. Read the users current
        set of preferences and set the GUI state to match. Setup speech
        support and populate the combo box lists on the Speech Tab pane
        accordingly.
        �voices�$@�@�I@�keyBindingsTreeview�	ellipsize�Handler)�textTFi|z
Mod.Mask 1z	Use Mod.1�Key1�ClickCount1�OldText1zediting-startedzediting-canceled�edited)rh�editable�toggled)�active�activatablerp�Modified)ro�orcaSetupWindow�
speechSystems�
speechServers�speechLanguagesrE)�label�notebookN)OrZr�
getManager�
getSettingr�
DEFAULT_VOICE�KeyErrorr�ACSS�GAINrP�
AVERAGE_PITCHrQ�RATErR�
get_widgetr7�get_columns�
remove_columnr�	TreeStorer�TYPE_STRING�TYPE_BOOLEANr6�CellRendererTextr:r/�set_propertyr	�
EllipsizeMode�END�TreeViewColumn�HANDLER�
set_resizable�set_visible�set_sort_column_id�
append_columnr�KB_HEADER_FUNCTION�DESCRIP�
set_min_width�	MOD_MASK1�	MOD_USED1�KEY1�CLICK_COUNT1�OLDTEXT1�connect�
editingKey�editingCanceledKey�	editedKey�TEXT1�KB_HEADER_KEY_BINDING�EDITABLE�CellRendererToggle�keyModifiedToggle�MODIF�KB_MODIFIED�_populateKeyBindingsrN�_setKeyEchoItems�
_initComboBoxrKrHrDrA�_initSpeechState�os�path�exists�getPrefsDirrS�getAppPreferencesGUI�Labelr�get_name�app�append_page�
_initGUIState)	r[rZrar0�column�rendererText�rendererToggle�appPagervs	         r^�initzOrcaSetupGUI.init�s������
	�%�0�0�2�=�=�h�G�F�!�(�"8�"8�9�L�	"�)�$�)�)�.�.�9�D�N�	"�*�4�9�9�+B�+B�C�D�O�	"�)�$�)�)�.�.�9�D�N� �?�?�+@�A������'�'�)��*�*�6�6�8�
7��� � �.�.�v�6�
7�!$�
�
�������������������������� � �� � �
!"���&)�%9�%9�%;��"� #� 4� 4� 6������*�*�;��8K�8K�8O�8O�P��#�#�I�$(�$>�$>�)0�2��	���T�"����5�!��!�!�'�*����&�&�v�.��#�#�I�$@�$@�$(�$9�$9�)0�2��	���T�"����S�!��!�!�'�*����&�&�v�.��#�#�L�$(�$>�$>�)2�4��	���5�!����T�"��!�!�)�,����&�&�v�.��#�#�K�$(�$>�$>�)2�4��	���5�!����T�"��!�!�)�,����&�&�v�.��#�#�F�$(�$>�$>�)-�/��	���T�"����5�!��!�!�$�'����&�&�v�.��#�#�M�$(�$>�$>�)5�7��	���T�"����5�!��!�!�,�/����&�&�v�.��#�#�J�$(�$>�$>�)1�3��	���T�"����5�!��!�!�(�+����&�&�v�.��+�+�-�����.�!�_�_�!�2�2�	4�	���/�!�4�4�	6����X�!�^�^�!�2�2�&�	�4��u�	N�
�#�#�I�$C�$C�$0�).�-5�7��
	���T�"��!�!�(�+����&�&�v�.��/�/�1�����y�#�5�5�#�4�4�$�	&��#�#�I�$9�$9�$2�+0�08�:��
	���T�"��!�!�%�(����&�&�v�.��/�/�1���#�#�M�5�9��#�#�J�$2�+3�5��	���5�!����T�"��!�!�(�+����&�&�v�.�	
�!�!�#��o�o�&7�8��������*�*�4�?�?�?�+K�L�	
���*�*�4�?�?�?�+K�L�	
���*�*�4�?�?�;L�+M�N�	
�!��*�*�4�?�?�;K�+L�M�	
� ����������/�:�:�<�H�H�J�K�K�	
���+�+�2�2�4����I�I�H�$5�$5�d�k�k�o�o�$F�G�E��O�O�J�'�3�3�G�U�C������}�	��L�	���	"�!�D�N�	"���	"�!�D�O�	"���	"�!�D�N�	"�sG�6e2�"f�#"f�"f2�2f�f�f�f�f/�.f/�2g�gc���|tk(r|j}|S|tk(r|j}|S|tk(r|j
}|S|tk(r|j}|S|j}|S)z�Return the ACSS value for the given voice type.

        Arguments:
        - voiceType: one of DEFAULT, UPPERCASE, HYPERLINK, SYSTEM

        Returns the voice dictionary for the given voice type.
        ��DEFAULTr0�	UPPERCASErM�	HYPERLINKr3�SYSTEMrL)r[�	voiceType�	voiceACSSs   r^�_getACSSForVoiceTypez!OrcaSetupGUI._getACSSForVoiceTypeks�������)�)�I����)�
#��+�+�I����)�
#��+�+�I����&�
 ��(�(�I����)�)�I��r_c�`�dt_|j|j�}|j	|j
�}|jj|jj��tj�j|j|j||�y)z7Write out the user's generic Orca preferences.
        N)
r�speechSystemOverride�getModelDictr;�getKeyBindingsModelDictr6r,�updaterZ�getPreferencesFromGUIrrx�saveSettings)r[�pronunciationDict�keyBindingsDicts   r^�writeUserPreferencesz!OrcaSetupGUI.writeUserPreferences�s���)-��%� �-�-�d�.E�.E�F���6�6�t�7L�7L�M�������d�k�k�?�?�A�B��#�#�%�2�2�4�;�;�&*�n�n�&7�&5�	7r_c�P�|tk(r
|j}n�|tk(r |j}||vrn|sy|j}n^|tk(r |j
}||vrE|sy|j}n5|tk(r |j}||vr|sy|j}n|j}||vr||Sy)a�Look for the value of the given key in the voice dictionary
           for the given voice type.

        Arguments:
        - voiceType: one of DEFAULT, UPPERCASE, HYPERLINK, SYSTEM
        - key: the key to look for in the voice dictionary.
        - useDefault: if True, and the key isn't found for the given voice
                      type, the look for it in the default voice dictionary
                      as well.

        Returns the value of the given key, or None if it's not set.
        Nr�)r[r��key�
useDefault�voices     r^�_getKeyValueForVoiceTypez%OrcaSetupGUI._getKeyValueForVoiceType�s�������%�%�E�
�)�
#��'�'�E��%��!���)�)��
�)�
#��'�'�E��%��!���)�)��
�&�
 ��$�$�E��%��!���)�)���%�%�E��%�<���:��r_c���d}|j|tjj�}|r9tj
j|vr|tj
j}|S)z�Gets the name of the voice family for the given voice type.

        Arguments:
        - voiceType: one of DEFAULT, UPPERCASE, HYPERLINK, SYSTEM

        Returns the name of the voice family for the given voice type,
        or None if not set.
        N)r�rr|�FAMILYr�VoiceFamily�NAME)r[r��
familyName�familys    r^�_getFamilyNameForVoiceTypez'OrcaSetupGUI._getFamilyNameForVoiceType�sW���
��.�.�y�$�)�)�:J�:J�K���l�.�.�3�3�v�=��� 8� 8� =� =�>�J��r_c�n�|j|tjjd�}|j	|�}|ru||t
jj<||t
jj<||t
jj<||t
jj<n�i|tjj<||tjjt
jj<||tjjt
jj<||tjjt
jj<||tjjt
jj<d|d<y)aESets the name of the voice family for the given voice type.

        Arguments:
        - voiceType: one of DEFAULT, UPPERCASE, HYPERLINK, SYSTEM
        - name: the name of the voice family to set.
        - language: the locale of the voice family to set.
        - dialect: the dialect of the voice family to set.
        FT�establishedN)r�rr|r�r�rr�r��LANG�DIALECT�VARIANT)r[r��name�language�dialect�variantr�r�s        r^�_setFamilyNameForVoiceTypez'OrcaSetupGUI._setFamilyNameForVoiceType�sE���.�.�y�/3�y�y�/?�/?�/4�6���-�-�i�8�	��48�F�<�+�+�0�0�1�4<�F�<�+�+�0�0�1�7>�F�<�+�+�3�3�4�7>�F�<�+�+�3�3�4�*,�I�d�i�i�&�&�'�IM�I�d�i�i�&�&�'��(@�(@�(E�(E�F�IQ�I�d�i�i�&�&�'��(@�(@�(E�(E�F�LS�I�d�i�i�&�&�'��(@�(@�(H�(H�I�LS�I�d�i�i�&�&�'��(@�(@�(H�(H�I�#'�	�-� r_c�V�|j|tjj�S)z�Gets the speaking rate value for the given voice type.

        Arguments:
        - voiceType: one of DEFAULT, UPPERCASE, HYPERLINK, SYSTEM

        Returns the rate value for the given voice type, or None if
        not set.
        )r�rr|r�r[r�s  r^�_getRateForVoiceTypez!OrcaSetupGUI._getRateForVoiceType�����,�,�Y��	�	���G�Gr_c�j�|j|�}||tjj<d|d<y)z�Sets the speaking rate value for the given voice type.

        Arguments:
        - voiceType: one of DEFAULT, UPPERCASE, HYPERLINK, SYSTEM
        - value: the rate value to set.
        Tr�N)r�rr|r�r[r��valuer�s    r^�_setRateForVoiceTypez!OrcaSetupGUI._setRateForVoiceType��0���-�-�i�8�	�$)�	�$�)�)�.�.�!�#'�	�-� r_c�V�|j|tjj�S)z�Gets the pitch value for the given voice type.

        Arguments:
        - voiceType: one of DEFAULT, UPPERCASE, HYPERLINK, SYSTEM

        Returns the pitch value for the given voice type, or None if
        not set.
        )r�rr|r~r�s  r^�_getPitchForVoiceTypez"OrcaSetupGUI._getPitchForVoiceTypes(���,�,�Y�-1�Y�Y�-D�-D�F�	Fr_c�j�|j|�}||tjj<d|d<y)z�Sets the pitch value for the given voice type.

        Arguments:
        - voiceType: one of DEFAULT, UPPERCASE, HYPERLINK, SYSTEM
        - value: the pitch value to set.
        Tr�N)r�rr|r~r�s    r^�_setPitchForVoiceTypez"OrcaSetupGUI._setPitchForVoiceType
s2���-�-�i�8�	�-2�	�$�)�)�)�)�*�#'�	�-� r_c�V�|j|tjj�S)z�Gets the volume (gain) value for the given voice type.

        Arguments:
        - voiceType: one of DEFAULT, UPPERCASE, HYPERLINK, SYSTEM

        Returns the volume (gain) value for the given voice type, or
        None if not set.
        )r�rr|r}r�s  r^�_getVolumeForVoiceTypez#OrcaSetupGUI._getVolumeForVoiceTyper�r_c�j�|j|�}||tjj<d|d<y)z�Sets the volume (gain) value for the given voice type.

        Arguments:
        - voiceType: one of DEFAULT, UPPERCASE, HYPERLINK, SYSTEM
        - value: the volume (gain) value to set.
        Tr�N)r�rr|r}r�s    r^�_setVolumeForVoiceTypez#OrcaSetupGUI._setVolumeForVoiceType&r�r_c�@�|j|�}|j|�|j|�}|�!|jd�j	|�n |jd�j	d�|j|�}|�!|jd�j	|�n |jd�j	d�|j
|�}|�!|jd�j	|�y|jd�j	d�y)z�Sets the family, rate, pitch and volume GUI components based
        on the given voice type.

        Arguments:
        - voiceType: one of DEFAULT, UPPERCASE, HYPERLINK, SYSTEM
        N�	rateScalerd�
pitchScalerc�volumeScalerb)r��_setSpeechFamiliesChoicer�r��	set_valuer�r�)r[r�r��rate�pitch�volumes      r^�_setVoiceSettingsForVoiceTypez*OrcaSetupGUI._setVoiceSettingsForVoiceType3s����4�4�Y�?�
��%�%�j�1��(�(��3�����O�O�K�(�2�2�4�8��O�O�K�(�2�2�4�8��*�*�9�5�����O�O�L�)�3�3�E�:��O�O�L�)�3�3�C�8��,�,�Y�7�����O�O�M�*�4�4�V�<��O�O�M�*�4�4�T�:r_c���t|j�dk(ryd}d}|jD�]D}|tjj}||k(s�'|tjj
}|tjj}|r	|dz|z}n|}d}	|jD]�}
|
|k(r�|jd�j|	�|j|	|_
d}|j�d}	|jD]a}|tjj}||k(r8|jd�j|	�|j|	|_
d}n|	dz
}	�cn|	dz
}	��n|s]d	|g}tjtj |d�|jd�jd�|jd|_
|r	|j"|j$<|s]d
|g}tjtj |d�|jd�jd�|jd|_
|r&	|j&|j$|jf<yy)z�Sets the active item in the families ("Person:") combo box
        to the given family name.

        Arguments:
        - familyName: the family name to use to set the active combo box item.
        rNF�-ruTrEr
�<PREFERENCES DIALOG: Could not find speech language match forz:PREFERENCES DIALOG: Could not find speech family match for)�lenrErr�r�r�r�rCr��
set_activerB�_setupFamiliesr@r?r�printTokens�
LEVEL_INFOrUrFrT)
r[r��languageSet�	familySetr�r��langr�r��i�languageChoice�familyChoice�tokenss
             r^r�z%OrcaSetupGUI._setSpeechFamiliesChoicePsp���t�"�"�#�q�(�����	��)�)�"	�F��,�2�2�7�7�8�D��z�!��l�6�6�;�;�<�� ��!9�!9�!A�!A�B���#�c�z�G�3�H�#�H���&*�&A�&A��N�%��1����(9�:�E�E�a�H�59�5P�5P�QR�5S��2�&*���+�+�-���,0�,F�,F�#�L�#/��0H�0H�0M�0M�#N�D�#�z�1� $���0@� A� L� L�Q� O�<@�<V�<V�WX�<Y�� 9�,0�	� %���F�A�#����F�A�)�,�E"	�H�T�V`�a�F����e�.�.���=��O�O�-�.�9�9�!�<�)-�)D�)D�Q�)G�D�&��EF�D�(�(��)A�)A�B��R�T^�_�F����e�.�.���=��O�O�,�-�8�8��;�(,�(B�(B�1�(E�D�%��23�
�&�&�t�'?�'?��.�.�(/�
0�r_c���|jd�}|jd�|jj�|j}d}g|_|jD]�}|tjj}|tjj}|r	|dz|z}n|}||k7r�P|tjj}|j
j|�|jj||f�|dz
}��|j|j�|dk(r^dt|�dg}	tjtj |	d�tj"tj$�d|_yd}
|j(|jf|j*vr%|j*|j(|jf}
|jd�j-|
�y)	aGets the list of voice variants for the current speech server and
        current language.
        If there are variants, get the information associated with
        each voice variant and add an entry for it to the variants
        GtkComboBox list.
        rENrr�r
z"No speech family was available for�.T)r��	set_modelrA�clearrBr@rErr�r�r�r��append�strrr�LEVEL_SEVERE�
printStack�LEVEL_FINESTr?rFrTr�)r[�combobox�currentLanguagerr�rr�r�r�r�
selectedIndexs           r^r�zOrcaSetupGUI._setupFamilies�s����?�?�#3�4�����4� �� � �&�&�(��4�4��
��%'��"��)�)�	�F��,�2�2�7�7�8�D��\�5�5�=�=�>�G���#�:��/�����?�*���,�2�2�7�7�8�D��&�&�-�-�f�5��$�$�+�+�Q��I�6�
��F�A�	�"	���4�3�3�4���6�:�C��<P�RU�V�F����e�0�0�&�$�?����U�/�/�0�(,�D�%���
��$�$�d�&@�&@�A��-�-�.� �6�6�t�7O�7O��.�.�8/�0�M�	
���(�)�4�4�]�Cr_c��t|j�dk(ryd}d}|jD]D}||k(r8|jd�j|�|j||_d}n|dz
}�F|s]d|g}tjt
j|d�|jd�jd�|jd|_|r||j|j<|j�y)z�Sets the active item in the languages ("Language:") combo box
        to the given language name.

        Arguments:
        - languageName: the language name to use to set the active combo box item.
        rNFruTr
r�)r�rCr�r�rBrrrrUrFr�)r[�languageName�valueSetrr�rs      r^�_setSpeechLanguagesChoicez&OrcaSetupGUI._setSpeechLanguagesChoice�s����t�*�*�+�q�0����
���3�3�	�H��<�'���� 1�2�=�=�a�@�-1�-H�-H��-K��*����
��F�A�
	��T�Vb�c�F����e�.�.���=��O�O�-�.�9�9�!�<�)-�)D�)D�Q�)G�D�&��EF�D�(�(��)A�)A�B����r_c�`�|jd�}|jd�|jj�|jj�|_g|_t|j�dk(rOtjtjd�tjtj�d|_yi}d}|jD]�}|tj j"}|tj j$}||f|vr�Dd|||f<|r	|dz|z}n|}|}|dk(rd}|jj'|�|jj'||f�|d	z
}��d}	|j|j(vr|j(|j}	|j|j�|jd�j+|	�|j,r|j|	|_|j/�|jd
�}
t0j2t0j4t0j6t0j8g}|j;|
|�|
j+t<�|
j?�}|jA|�y)z�Gets the list of voices for the current speech server.
        If there are families, get the information associated with
        each voice family and add an entry for it to the families
        GtkComboBox list.
        ruNrzNo speech voice was available.Tr��zdefault languager
�voiceTypesCombo)!r�rrDrrF�getVoiceFamiliesrErCr�r�printMessagerrrrBrr�r�r�r
rUr�r4r�r�SPEECH_VOICE_TYPE_DEFAULT�SPEECH_VOICE_TYPE_UPPERCASE�SPEECH_VOICE_TYPE_HYPERLINK�SPEECH_VOICE_TYPE_SYSTEM�populateComboBoxr��
get_activer�)
r[r�donerr�rr�r��msgr�comboBox�typesr�s
             r^�_setupVoiceszOrcaSetupGUI._setupVoices�s^���?�?�#4�5�����4� ��!�!�'�'�)�"�6�6�G�G�I���&(��#��t�"�"�#�q�(����u�1�1�3S�T����U�/�/�0�)-�D�&����
���)�)�	�F��,�2�2�7�7�8�D��\�5�5�=�=�>�G��W�~��%��!%�D��g�����#�:��/�����C��b�y�(���'�'�.�.�x�8��%�%�,�,�a��X�6�
��F�A�)	�4�
��#�#�t�'C�'C�C� �8�8��9Q�9Q�R�M����4�4�4�5����)�*�5�5�m�D��"�"�)-�)D�)D�]�)S�D�&������?�?�#4�5���4�4��6�6��6�6��3�3�5��	
���h��.����G�$��'�'�)�	��*�*�9�5r_c���t|j�dk(ry|stj�}d}d}|jD]E}||j�k(r+|j	d�j|�||_d}n|dz
}�G|s]d|g}tjtj|d�|j	d�jd�|jd|_|j�y)aSets the active item in the speech servers combo box to the
        given server.

        Arguments:
        - serversChoices: the list of available speech servers.
        - serverInfo: the speech server to use to set the active combo
        box item.
        rNFrtTr
z:PREFERENCES DIALOG: Could not find speech server match for)r�rGr�getInfor�r�rFrrrr()r[�
serverInforr�serverrs      r^�_setSpeechServersChoicez$OrcaSetupGUI._setSpeechServersChoice2s����t�(�(�)�Q�.��
����)�J���
���/�/�	�F��V�^�^�-�-�����0�;�;�A�>�+1��(����
��F�A�
	��R�T^�_�F����e�.�.���=��O�O�O�,�7�7��:�'+�'@�'@��'C�D�$����r_c�p�|jd�}|jd�|jj�|jj
j
�|_t|j�dk(r�tjtjd�tjtj�d|_g|_d|_g|_d|_|j|j�yd}|jD]7}|j'�d}|jj)||f�|dz
}�9|j|j�t*j,r"|j/t0j2dg�y|j/|j4d�y)aGets the list of speech servers for the current speech factory.
        If there are servers, get the information associated with each
        speech server and add an entry for it to the speechServers
        GtkComboBox list.  Set the current choice to be the first item.
        rtNr�Speech not available.r
r)�speechServerInfo)r�rrHrrI�SpeechServer�getSpeechServersrGr�rrrrrrFrCrBr@r?r*r
rr�r-r�DEFAULT_SYNTHESIZERr,)r[rrr,r�s     r^�_setupSpeechServersz OrcaSetupGUI._setupSpeechServersWsk���?�?�?�3�����4� ����%�%�'��(�(�5�5�F�F�H�	
�!��t�(�(�)�Q�.����u�1�1�3J�K����U�/�/�0�'+�D�$�*,�D�'�)-�D�&�)+�D�&�(,�D�%����t�6�6�7��
���/�/�	�F��>�>�#�A�&�D��#�#�*�*�A�t�9�5�
��F�A�	�
	���4�2�2�3��(�(��(�(�)�*G�*G��)S�T��(�(����8J�)K�Lr_c�"�|jd�}t|j�dk(rd|_yd}d}|jD]\}|j}|j|�r8|j
d�j|�|j||_d}n|dz
}�^|s]d|g}tjtj|d�|j
d�jd�|jd|_|j�y)	aSet the active item in the speech systems combo box to the
        given system name.

        Arguments:
        - factoryChoices: the list of available speech factories (systems).
        - systemName: the speech system name to use to set the active combo
        box item.
        �'rNFrsTr
z:PREFERENCES DIALOG: Could not find speech system match for)�stripr�rJrI�__name__�endswithr�r�rrrr4)r[�
systemNamerr�speechSystemr�rs       r^�_setSpeechSystemsChoicez$OrcaSetupGUI._setSpeechSystemsChoicezs�� �%�%�c�*�
��t�(�(�)�Q�.�'+�D�$����
�� �5�5�	�L��(�(�D��}�}�Z�(�����0�;�;�A�>�+/�+D�+D�Q�+G��(����
��F�A�	��R�T^�_�F����e�.�.���=��O�O�O�,�7�7��:�'+�'@�'@��'C�D�$�� � �"r_c��|jd�}|jd�|jj�g|_|D]C}	|j
j
�}t|�r|jj|��Eg|_
t|j�dk(r�tjtjd�tj tj�d|_g|_d|_g|_d|_g|_d|_|j|j�yd}|jD]Y}|jj|�|j
j1�}|jj||f�|dz
}�[|j|j�t2j4r |j7t2j4�y|j8dr|j7|j8d�yd|_y#t$r'tjtj�Y��wxYw)z�Sets up the speech systems combo box and sets the selection
        to the preferred speech system.

        Arguments:
        -factories: the list of known speech factories (working or not)
        rsNrr/r
�speechServerFactory)r�rrKrrOr1r2r�r
�	Exceptionr�printExceptionrrJrrrrIrGrFrCrBr@r?�getFactoryNamerr�r<r,)r[�	factoriesr�factory�serversr�workingFactoryr�s        r^�_setupSpeechSystemsz OrcaSetupGUI._setupSpeechSystems�s����?�?�?�3�����4� ����%�%�'� "��� �	9�G�
9�!�.�.�?�?�A���w�<��)�)�0�0��9��		9�%'��!��t�$�$�%��*����u�1�1�3J�K����U�/�/�0�'+�D�$�(*�D�%�'+�D�$�*,�D�'�)-�D�&�)+�D�&�(,�D�%����t�6�6�7��
��"�3�3�	�N��%�%�,�,�^�<�!�.�.�=�=�?�D��#�#�*�*�A�t�9�5�
��F�A�		�	���4�2�2�3��(�(��(�(��)F�)F�G�
�^�^�1�
2��(�(����8M�)N�O�'+�D�$��=�
9��$�$�U�%7�%7�8�
9�s�
AH*�*,I�Ic���|jd}tj|jtj
��|_tj|jtj��|_tj|jtj��|_
tj|jtj��|_tj�j�}t!|�dk(s|jjdd�s9g|_d|_g|_d|_g|_d|_g|_d|_y	t3j4�d|_|j;|�d|_y#t6$r;g|_d|_g|_d|_g|_d|_g|_d|_YywxYw)z2Initialize the various speech components.
        rar�enableSpeechTNF)r,rr|�getrrzr0�UPPERCASE_VOICErM�HYPERLINK_VOICEr3�SYSTEM_VOICErLrrx�getSpeechServerFactoriesr�rOrIrGrFrCrBr@r?rr�r?r4rF)r[rarBs   r^r�zOrcaSetupGUI._initSpeechState�s�������)��"�i�i��
�
�8�3I�3I�(J�K���"�i�i��
�
�8�3K�3K�(L�M���"�i�i��
�
�8�3K�3K�(L�M���"�i�i��
�
�8�3H�3H�(I�J���%�/�/�1�J�J�L�	��y�>�Q��d�n�n�&8�&8���&N�$&�D�!�'+�D�$�(*�D�%�'+�D�$�*,�D�'�)-�D�&�)+�D�&�(,�D�%��	��K�K�M�#'���� � ��+�"'�����		�$&�D�!�'+�D�$�(*�D�%�'+�D�$�*,�D�'�)-�D�&�)+�D�&�(,�D�%��		�s�2F&�&AG*�)G*c��|j�}|jd�|jjj	|�\}}|jjj	tj�jd��\}}	tdt|��D�]}
tdt|��D]�}tj||
|j�}tj|||
|j�}
|||tk(s�\|j|�}|j|t|�|j|t|�|j|t |
�|r4|j|�}|j|
�}|j#||�����|j|�y)a�Given a set of spoken text attributes, update the model used by the
        text attribute tree view.

        Arguments:
        - view: the text attribute tree view.
        - setAttributes: the list of spoken text attributes to update.
        - state: the state (True or False) that they all should be set to.
        - moveToTop: if True, move these attributes to the top of the list.
        N�allTextAttributesr)�	get_modelrrZ�	utilities�stringToKeysAndDictrrxry�ranger�r�getTextAttributeNamer��get_iterr��	IS_SPOKEN�VALUE�move_before)r[�view�
setAttributes�state�	moveToTop�model�attrList�attrDict�allAttrList�allAttrDictrr��localizedKey�localizedValue�thisIter�	otherIters                r^�_setSpokenTextAttributesz%OrcaSetupGUI._setSpokenTextAttributess|����� �����t���;�;� � �4�4�]�C�	��8�%)�[�[�%:�%:�%N�%N��'�'�)�4�4�5H�I�&K�"��k��q�#�h�-�(�	�A��a��[�!1�2�
��3�H�H��Q�K���� .��!5�!J�!J��X�a�[�)�4�;�;�"8���5��;�t�#4�4�$�~�~�d�3�H��O�O�H�d�L�A��O�O�H�i��?��O�O�H�e�^�D� �#(�>�>�$�#7��$)�N�N�1�$5�	��)�)�(�I�>��
�	�"	
���u�r_c�j�|j�}|jd�|jjj	|�\}}|jjj	tj�jd��\}}tdt|��D]x}	tdt|��D]^}
tj||	|j�}|||
tk(s�6|j|
�}|j|t|��x�z|j|�y)aFGiven a set of brailled text attributes, update the model used
        by the text attribute tree view.

        Arguments:
        - view: the text attribute tree view.
        - setAttributes: the list of brailled text attributes to update.
        - state: the state (True or False) that they all should be set to.
        NrOr)rPrrZrQrRrrxryrSr�rrTr�rUr��IS_BRAILLED)
r[rYrZr[r]r^r_r`rarr�rbrds
             r^�_setBrailledTextAttributesz'OrcaSetupGUI._setBrailledTextAttributes's����� �����t��
�K�K�!�!�5�5�m�D�	��8�%)�[�[�%:�%:�%N�%N� �+�+�-�8�8�9L�M�&O�"��k��q�#�h�-�(�	�A��a��[�!1�2�
��3�H�H��Q�K���� .���5��;�t�#4�4�$�~�~�d�3�H��O�O�H�k�5�A��

�	�	
���u�r_c�L�|jjj|�S)a�Converts the given Atk attribute name into the application's
        equivalent. This is necessary because an application or toolkit
        (e.g. Gecko) might invent entirely new names for the same text
        attributes.

        Arguments:
        - attribName: The name of the text attribute

        Returns the application's equivalent name if found or attribName
        otherwise.
        )rZrQ�getAppNameForAttribute)r[�
attributeNames  r^�_getAppNameForAttributez$OrcaSetupGUI._getAppNameForAttributeDs���{�{�$�$�;�;�M�J�Jr_c���|jj�}d}d}|jd�}td|�D]�}||t}tj|�}|j|�}||t}tj|�}	||tr||dz|	zdzz
}||ts�}||dz|	zdzz
}��||jd<||jd<y)aThe user has updated the text attribute list in some way. Update
        the "enabledSpokenTextAttributes" and "enabledBrailledTextAttributes"
        preference strings to reflect the current state of the corresponding
        text attribute lists.
        rNr�:z; �enabledSpokenTextAttributes�enabledBrailledTextAttributes)r2rP�iter_n_childrenrSr�r�getTextAttributeKeyrmrWrVrhr,)
r[r]�
spokenAttrStr�brailledAttrStr�noRowsr�rbr�rcr�s
          r^�_updateTextDictEntryz!OrcaSetupGUI._updateTextDictEntrySs����*�*�4�4�6���
����&�&�t�,���!�V�$�	<�D� ��;�t�,�L�&�:�:�<�H�C�
�.�.�s�3�C�"�4�[��/�N�(�<�<�^�L�E��T�{�9�%���s��U�!2�T�!9�9�
��T�{�;�'��3��9�u�#4�t�#;�;��	<�"9F����4�5�:I����6�7r_c��|jd�}|j|j��|j�|jd<y)N�contractionTableGrid�enableContractedBraille�r��
set_sensitiver#r,�r[�checkbox�grids   r^�contractedBrailleToggledz%OrcaSetupGUI.contractedBrailleToggledrs@�����5�6�����8�.�.�0�1�4<�4G�4G�4I����0�1r_c�n�|j�}|j�}||d|jd<y)Nr
�brailleContractionTable)rP�get_active_iterr,)r[rr]�myIters    r^�contractionTableComboChangedz)OrcaSetupGUI.contractionTableComboChangedws6���"�"�$���)�)�+��49�&�M�!�4D����0�1r_c��|jd�}|j|j��|j�|jd<y)N�flashMessageDurationGrid�flashIsPersistentr{r}s   r^�flashPersistenceToggledz$OrcaSetupGUI.flashPersistenceToggled|sC�����9�:�����x�2�2�4�4�5�.6�.A�.A�.C����*�+r_c��|j|�}|j|t||t�|j�y)agThe user has toggled the state of one of the text attribute
        checkboxes to be spoken. Update our model to reflect this, then
        update the "enabledSpokenTextAttributes" preference string.

        Arguments:
        - cell: the cell that changed.
        - path: the path of that cell.
        - model: the model that the cell is part of.
        N)rU�setrVrw�r[�cellr�r]rds     r^�textAttributeSpokenToggledz'OrcaSetupGUI.textAttributeSpokenToggled�s:���>�>�$�'��
�	�	�(�I�5��;�y�+A�'A�B��!�!�#r_c��|j|�}|j|t||t�|j�y)akThe user has toggled the state of one of the text attribute
        checkboxes to be brailled. Update our model to reflect this,
        then update the "enabledBrailledTextAttributes" preference string.

        Arguments:
        - cell: the cell that changed.
        - path: the path of that cell.
        - model: the model that the cell is part of.
        N)rUr�rhrwr�s     r^�textAttributeBrailledToggledz)OrcaSetupGUI.textAttributeBrailledToggled�s:���>�>�$�'��
�	�	�(�K�U�4�[��-E�)E�F��!�!�#r_c�t�|j|�}|j|t|�|j�y)a�The user has edited the value of one of the text attributes.
        Update our model to reflect this, then update the
        "enabledSpokenTextAttributes" and "enabledBrailledTextAttributes"
        preference strings.

        Arguments:
        - cell: the cell that changed.
        - path: the path of that cell.
        - new_text: the new text attribute value string.
        - model: the model that the cell is part of.
        N)rUr�rWrw�r[r�r��new_textr]rds      r^�textAttrValueEditedz OrcaSetupGUI.textAttrValueEdited�s.���>�>�$�'��
�	�	�(�E�8�,��!�!�#r_c�&�|jj�\}}|rrt|jj��}t	d|�D]?}|jj|�}||k(s�$|jj
|�yyy)z�Set the search column in the text attribute tree view
        depending upon which column the user currently has the cursor in.
        rN)r2�
get_cursorr�r�rS�
get_column�set_search_column�r[�widgetr��focusColumn�	noColumnsr�cols       r^�textAttrCursorChangedz"OrcaSetupGUI.textAttrCursorChanged�s���
#�8�8�C�C�E���{���D�6�6�B�B�D�E�I��1�i�(�
���0�0�;�;�A�>���#�%��.�.�@�@��C��	
�r_c�b
�|jd�|_|jj�r:|jj�D]}|jj|��t	j
tjtjtjtj�}|jjjtj�jd��\}}tdt!|��D]�}|j#�}t%j&|||j�}t%j&||||j�}|j)|t*|�|j)|t,d�|j)|t.d�|j)|t0|���|jj3|�t	j4t6j8�}|j;d�|j=d�t	j>�}	|jA|	d�|jC|	dt*�|jjE|d�t6jF}
t	j4|
�}t	jH�}	|jK|	d�|jC|	dt,�|	jMd	|jN|�|jjE|d
�|jQ�t6jR}t	j4|�}t	jH�}	|jK|	d�|jC|	dt.�|	jMd	|jT|�|jjE|d�|jQ�t	j4t6jV�}t	j>�}	|	jYdd�|jA|	d�|jC|	dt0�|	jMd
|jZ|�|jjE|d�|j]|jtj�jd�dd�|j_|jtj�jd�d�|jjMd|j`�y)aCreate the text attributes tree view. The view is the
        textAttributesTreeView GtkTreeView widget. The view will consist
        of a list containing three columns:
          IS_SPOKEN - a checkbox whose state indicates whether this text
                      attribute will be spoken or not.
          NAME      - the text attribute name.
          VALUE     - if set, (and this attributes is enabled for speaking),
                      then this attribute will be spoken unless it equals
                      this value.
        �textAttributesTreeViewrOrF�Trhrornr
r"rmrlr!rprq�cursor_changedN)1r�r2r�r�r�	ListStorerr�r�rZrQrRrrxryrSr�r
rrTr�r�rVrhrWrr�r�TEXT_ATTRIBUTE_NAMEr�r�r��pack_end�
add_attribute�
insert_column�PRESENTATION_SPEAKr��
pack_startr�r��clicked�PRESENTATION_MARK_IN_BRAILLEr��PRESENTATION_PRESENT_UNLESSr�r�rfrir�)r[r�r]r`rarrdrbrc�renderer�speakAttrColumnLabel�markAttrColumnLabels            r^�_createTextAttributesTreeViewz*OrcaSetupGUI._createTextAttributesTreeView�s'��&*�_�_�5M�%N��"��%�%�1�1�3��4�4�@�@�B�
A���*�*�8�8��@�
A��
�
�g�1�1�%�2�2�%�2�2�%�1�1�3��&*�[�[�%:�%:�%N�%N��'�'�)�4�4�5H�I�&K�"��k��q�#�k�*�+�		=�A��|�|�~�H�/�D�D��A�����-�L�1�F�F��K��N�+�T�[�[�:�N��O�O�H�d�L�9��O�O�H�i��7��O�O�H�k�5�9��O�O�H�e�^�<�		=�	
�"�"�,�,�U�3��#�#�I�$A�$A�B�����S�!����T�"��'�'�)������$�'����X�v�t�4��"�"�0�0���;� )�;�;���#�#�$8�9���)�)�+�����(�E�*����X�x��;������8�8��	 �	
�"�"�0�0���;�����(�D�D���#�#�$7�8���)�)�+�����(�E�*����X�x��=������:�:��	 �	
�"�"�0�0���;������#�#�I�$I�$I�J���'�'�)�����j�$�/�����$�'����X�v�u�5�����4�#;�#;�U�C��"�"�0�0���;�	
�%�%��&�&��'�'�)�4�4�5R�S��$�	�	
�'�'��&�&��'�'�)�4�4�5T�U��	�	
�"�"�*�*�+;�+/�+E�+E�	Gr_c�T�|j|�}|j|t|�y)aiThe user has edited the value of one of the actual strings in
        the pronunciation dictionary. Update our model to reflect this.

        Arguments:
        - cell: the cell that changed.
        - path: the path of that cell.
        - new_text: the new pronunciation dictionary actual string.
        - model: the model that the cell is part of.
        N)rUr��ACTUALr�s      r^�pronActualValueEditedz"OrcaSetupGUI.pronActualValueEdited&s"���>�>�$�'��
�	�	�(�F�H�-r_c�T�|j|�}|j|t|�y)asThe user has edited the value of one of the replacement strings
        in the pronunciation dictionary. Update our model to reflect this.

        Arguments:
        - cell: the cell that changed.
        - path: the path of that cell.
        - new_text: the new pronunciation dictionary replacement string.
        - model: the model that the cell is part of.
        N)rUr��REPLACEMENTr�s      r^�pronReplacementValueEditedz'OrcaSetupGUI.pronReplacementValueEdited4s"���>�>�$�'��
�	�	�(�K��2r_c�N�tj�jd|�y)zBCallback for the pronunciation tree's focus-{in,out}-event signal.�usePronunciationDictionaryN)rrx�
setSetting)r[r��event�	isFocuseds    r^�pronunciationFocusChangez%OrcaSetupGUI.pronunciationFocusChangeBs!��	�#�#�%�0�0�1M�S\�}�]r_c�&�|jj�\}}|rrt|jj��}t	d|�D]?}|jj|�}||k(s�$|jj
|�yyy)z�Set the search column in the pronunciation dictionary tree view
        depending upon which column the user currently has the cursor in.
        rN)r<r�r�r�rSr�r�r�s       r^�pronunciationCursorChangedz'OrcaSetupGUI.pronunciationCursorChangedGs���
#�4�4�?�?�A���{���D�2�2�>�>�@�A�I��1�i�(�
���,�,�7�7��:���#�%��*�*�<�<�Q�?��	
�r_c��|jd�|_|jj�r:|jj�D]}|jj|��t	j
tjtj�}|jjsB|jjd�d}tj�j|�}ntj}t!|j#��D]8}|j%�}	||\}}|j)|t*|t,|��:|jj/|�t	j0t2j4�}|j7d�|j9d�t	j:�}	|	j=dd�|j?|	d�|jA|	dt*�|	jCd|jD|�|jjG|d	�t	j0t2jH�}t	j:�}	|	j=dd�|j?|	d�|jA|	dt,�|	jCd|jJ|�|jjG|d�||_&|jjCd
|jN�|jjCd|jPd�|jjCd|jPd
�y#t&$r|}||}Y��AwxYw)a8Create the pronunciation dictionary tree view. The view is the
        pronunciationTreeView GtkTreeView widget. The view will consist
        of a list containing two columns:
          ACTUAL      - the actual text string (word).
          REPLACEMENT - the string that is used to pronounce that word.
        �pronunciationTreeView�
activeProfiler
r�Trmrhrlrr��focus_in_event�focus_out_eventFN))r�r<r�r�rr�rr�rZr�r,rIrrx�getPronunciationsr�sorted�keysr
r?r�r�r�rr�r�DICTIONARY_ACTUAL_STRINGr�r�r�r�r�r�r�r�r��DICTIONARY_REPLACEMENT_STRINGr�r;r�r�)
r[r�r]�_profile�pronDict�pronKeyrd�actual�replacementr�s
          r^�_createPronunciationTreeViewz)OrcaSetupGUI._createPronunciationTreeViewUs���"&���1H�!I����!�!�-�-�/��0�0�<�<�>�
=���&�&�4�4�V�<�
=��
�
�g�1�1�%�1�1�3���{�{����~�~�)�)�/�:�1�=�H�'�2�2�4�F�F�x�P�H�)�<�<�H��h�m�m�o�.�
	0�G��|�|�~�H�
0�&.�w�&7�#���
�I�I�h��f�!�;�
0�
	0�	
���(�(��/��#�#�I�$F�$F�G�����S�!����T�"��'�'�)�����j�$�/�����$�'����X�v�v�6�����4�#=�#=�u�E����,�,�V�Q�7��#�#�I�$K�$K�L���'�'�)�����j�$�/�����$�'����X�v�{�;�����4�#B�#B�E�J����,�,�V�Q�7�"'���
	
���&�&�'7�'+�'F�'F�	H�	
���&�&��d�;�;�T�	C����&�&��t�<�<�e�	E��W�
0�
!��&�w�/��

0�s�2M(�(M<�;M<c�3�|j}|d}|jd�j|�|jd�j|�|d}|jd�j|�|jd�j|�|dtj
k(r!|jd�jd	�n�|dtjk(r!|jd
�jd	�nW|dtjk(r!|jd�jd	�n |jd�jd	�|d
tjk(r!|jd�jd	�n |jd�jd	�|jd�j|d�|jd�j|d�|jd�j|d�|jd�j|d�|jd�j|jdtj��|jd�j|d�|jd�j|d�|jd�j|d�|jd�j|d�|jd �j|jd!tj��|jd"�j|jd#tj��|jd$�j|jd%tj��|jd&�j|jd'tj��|jd(�j|jd)tj��|jd*�j|jd+tj��|jd,�j|jd-tj ��|jd.�j|jd/tj"��|jd0tj$�}|jd1�j|�|jd2tj&�}|jd3�j|�|jd4tj(�}|jd5�j|�|jd6tj*�}|jd7�j|�|jd8tj,�}|jd9�j|�|jd:tj.�}|jd:�}t0j2t0j4t0j6g}|j9||�|tj4k(rt0j4}n4|tj6k(rt0j6}nt0j2}|j|j;|��|jd;�}t<j>}t<j@}	|j9||tBjD|	��|tBjF|	��|tBjH|	��|tBjJ|	��|tBjL|	��|tBjN|	��|tBjP|	��|tBjR|	��|tBjT|	��|tBjV|	��|tBjX|	��|tBjZ|	��|tBj\|	��|tBj^|	��|tBj`|	��|tBjb|	��g�tD}
|jd<}|tBjDk(rtD}
�n�|tBjFk(rtF}
�no|tBjHk(rtH}
�nT|tBjJk(rtJ}
�n9|tBjLk(rtL}
�n|tBjNk(rtN}
�n|tBjPk(rtP}
n�|tBjRk(rtR}
n�|tBjTk(rtT}
n�|tBjVk(rtV}
n�|tBjXk(rtX}
n�|tBjZk(rtZ}
ng|tBj\k(rt\}
nM|tBj^k(rt^}
n3|tBj`k(rt`}
n|tBjbk(rtb}
|j|
�|jd=�}|j9||tBjd|	��|tBjf|	��|tBjh|	��|tBjj|	��|tBjl|	��|tBjn|	��|tBjp|	��g�td}
|jd>}|tBjdk(rtd}
n�|tBjfk(rtf}
n�|tBjhk(rth}
ng|tBjjk(rtj}
nM|tBjlk(rtl}
n3|tBjnk(rtn}
n|tBjpk(rtp}
|j|
�|jd?�j|jd@tjr��|jdA�j|jdBtjt��|jdC�j|jdDtjv��|dE}|jdF�jy|�|jdG�}t0jzt0j|t0j~g}|j9||�|j|dG�|dH}|jdI�j|�|jdJ�j|dK�|dLtj�k(}|jdM�j|�|jdN�j|dO�t��"|jdQ�jdR��n{|jdQ�j|dS�|jdT�}t�j��}dP}|dUxst�j��}|�rt�j�t�t��}t�|j���}|D]N}||}|j�||g�}t�j�j�t�j�|�|k(s�M|}�P|j�}|j��|j�|d	�|j�|dVdW�|j�|�|r|j�|�n#|jdW�n|jdR�|dXtjk(r!|jdY�jd	�n |jdZ�jd	�|jd[�j|jd\tj���|d]}|tj�k(r!|jd^�jd	�n�|tj�k(r!|jd_�jd	�nT|tj�k(r!|jd`�jd	�n |jda�jd	�|db}|tj�k(r!|jdc�jd	�n�|tj�k(r!|jdd�jd	�nT|tj�k(r!|jde�jd	�n |jdf�jd	�|jdgtj��}|jdh�j|�|jditj��}|jdj�j|�|jdktj��}|jdl�j|�|dm}|jdn�jy|doz�|jdp�j|dq�|jdr�j|jdstj���|jdt�j|jdutj���|jdv�j|jdwtj���|jdx�j|jdytj���|jdz�j|d{�|jd|�j|d}�|jd~�j|d�|jd��j|d��|jd��j|d��|jd��j|d��|jd��j|d��|jd��j|d��|j��|d�} | tj�k(r!|jd��jd	�n�| tj�k(r!|jd��jd	�nT| tj�k(r!|jd��jd	�n |jd��jd	�|j��|jd��j|d��|d�tj�k(r!|jd��jd	�n |jd��jd	�|jd��}|j9|t0j�t0j�g�|j|d��|jd��j|jd�tj���|jd��j|jd�tj���|jd��j|jd�tj���|jd��j|jd�tj���|jd��j|jd�tj���|jd��j|jd�tj���|jd��j|jd�tj���|jd��j|jd�tj���|jd��|_m|jd��|_n|jd��|_o|j��|j�j�r!|jd��jdR�yPyP)�z}Adjust the settings of the various components on the
        configuration GUI depending upon the users preferences.
        rH�speechSupportCheckButton�speechOptionsGrid�onlySpeakDisplayedText�!onlySpeakDisplayedTextCheckButton�contextOptionsGrid�verbalizePunctuationStyle�
noneButtonT�
someButton�
mostButton�	allButton�speechVerbosityLevel�speechBriefButton�speechVerboseButton�"enableSpeechIndentationCheckButton�enableSpeechIndentation�speakBlankLinesCheckButton�speakBlankLines�'speakMultiCaseStringsAsWordsCheckButton�speakMultiCaseStringsAsWords�speakNumbersAsDigitsCheckButton�speakNumbersAsDigits�!enableTutorialMessagesCheckButton�enableTutorialMessages�enablePauseBreaksCheckButton�enablePauseBreaks�!enablePositionSpeakingCheckButton�enablePositionSpeaking�!enableMnemonicSpeakingCheckButton�enableMnemonicSpeaking�#speakMisspelledIndicatorCheckButton�speakMisspelledIndicator�speakDescriptionCheckButton�speakDescription�!speakContextBlockquoteCheckButton�speakContextBlockquote�speakContextLandmarkCheckButton�speakContextLandmark�&speakContextNonLandmarkFormCheckButton�speakContextNonLandmarkForm�speakContextListCheckButton�speakContextList�speakContextPanelCheckButton�speakContextPanel�speakContextTableCheckButton�speakContextTable�messagesAreDetailed�messagesAreDetailedCheckButton�
useColorNames�useColorNamesCheckButton�readFullRowInGUITable� readFullRowInGUITableCheckButton�readFullRowInDocumentTable�%readFullRowInDocumentTableCheckButton�readFullRowInSpreadSheet�#readFullRowInSpreadSheetCheckButton�capitalizationStyle�dateFormatCombo�presentDateFormat�timeFormatCombo�presentTimeFormat�"speakProgressBarUpdatesCheckButton�speakProgressBarUpdates�$brailleProgressBarUpdatesCheckButton�brailleProgressBarUpdates�!beepProgressBarUpdatesCheckButton�beepProgressBarUpdates�progressBarUpdateInterval�#progressBarUpdateIntervalSpinButton�progressBarVerbosity�enableMouseReview�enableMouseReviewCheckButton�enableBrailleCheckButton�
enableBraille�brailleRolenameStyle�abbrevRolenames�disableBrailleEOLCheckButton�disableBrailleEOLN�contractedBrailleCheckButtonFrz�contractionTableCombor�rhr�brailleVerbosityLevel�brailleBriefButton�brailleVerboseButton� enableBrailleWordWrapCheckButton�enableBrailleWordWrap�brailleSelectorIndicator�brailleSelection7Button�brailleSelection8Button�brailleSelectionBothButton�brailleSelectionNoneButton�brailleLinkIndicator�brailleLink7Button�brailleLink8Button�brailleLinkBothButton�brailleLinkNoneButton�enableFlashMessages�enableFlashMessagesCheckButtonr��flashIsPersistentCheckButton�flashIsDetailed�flashIsDetailedCheckButton�brailleFlashTime�brailleFlashTimeSpinButton���keyEchoCheckButton�
enableKeyEcho�enableAlphabeticKeysCheckButton�enableAlphabeticKeys�enableNumericKeysCheckButton�enableNumericKeys� enablePunctuationKeysCheckButton�enablePunctuationKeys�enableSpaceCheckButton�enableSpace�enableModifierKeysCheckButton�enableModifierKeys�enableFunctionKeysCheckButton�enableFunctionKeys�enableActionKeysCheckButton�enableActionKeys�enableNavigationKeysCheckButton�enableNavigationKeys� enableDiacriticalKeysCheckButton�enableDiacriticalKeys� enableEchoByCharacterCheckButton�enableEchoByCharacter�enableEchoByWordCheckButton�enableEchoByWord�enableEchoBySentenceCheckButton�enableEchoBySentence�textAttributesBrailleIndicator�textBraille7Button�textBraille8Button�textBrailleBothButton�textBrailleNoneButton�presentToolTipsCheckButton�presentToolTips�keyboardLayout�generalDesktopButton�generalLaptopButton�sayAllStyle�'rewindAndFastForwardInSayAllCheckButton�rewindAndFastForwardInSayAll�structNavInSayAllCheckButton�structNavInSayAll�"sayAllContextBlockquoteCheckButton�sayAllContextBlockquote� sayAllContextLandmarkCheckButton�sayAllContextLandmark�'sayAllContextNonLandmarkFormCheckButton�sayAllContextNonLandmarkForm�sayAllContextListCheckButton�sayAllContextList�sayAllContextPanelCheckButton�sayAllContextPanel�sayAllContextTableCheckButton�sayAllContextTable�availableProfilesComboBox1�availableProfilesComboBox2�model9�
profilesFrame)sr,r�r�r|r�PUNCTUATION_STYLE_NONE�PUNCTUATION_STYLE_SOME�PUNCTUATION_STYLE_MOST�VERBOSITY_LEVEL_BRIEFrIr�r�r�r�r�r�r�r�r�r�rrrrr�CAPITALIZATION_STYLE_NONE�CAPITALIZATION_STYLE_ICON�CAPITALIZATION_STYLE_SPELLr"�index�time�strftime�	localtimer�DATE_FORMAT_LOCALE�DATE_FORMAT_NUMBERS_DM�DATE_FORMAT_NUMBERS_MD�DATE_FORMAT_NUMBERS_DMY�DATE_FORMAT_NUMBERS_MDY�DATE_FORMAT_NUMBERS_YMD�DATE_FORMAT_FULL_DM�DATE_FORMAT_FULL_MD�DATE_FORMAT_FULL_DMY�DATE_FORMAT_FULL_MDY�DATE_FORMAT_FULL_YMD�DATE_FORMAT_ABBREVIATED_DM�DATE_FORMAT_ABBREVIATED_MD�DATE_FORMAT_ABBREVIATED_DMY�DATE_FORMAT_ABBREVIATED_MDY�DATE_FORMAT_ABBREVIATED_YMD�TIME_FORMAT_LOCALE�TIME_FORMAT_12_HM�TIME_FORMAT_12_HMS�TIME_FORMAT_24_HMS�TIME_FORMAT_24_HMS_WITH_WORDS�TIME_FORMAT_24_HM�TIME_FORMAT_24_HM_WITH_WORDSr
rrr��PROGRESS_BAR_ALL�PROGRESS_BAR_APPLICATION�PROGRESS_BAR_WINDOW�BRAILLE_ROLENAME_STYLE_SHORT�louisr�
listTables�getDefaultTablerr�rr�r�r
r�r��joinrr:rr�r�r�set_active_iterr#�BRAILLE_UNDERLINE_7�BRAILLE_UNDERLINE_8�BRAILLE_UNDERLINE_BOTHr.r�r1r9r;r=r?r�r��GENERAL_KEYBOARD_LAYOUT_DESKTOP�SAY_ALL_STYLE_LINE�SAY_ALL_STYLE_SENTENCEr\r^r`rbrdrfrhrjrVrXrW�_OrcaSetupGUI__initProfileComborZr�)!r[�prefs�enable�styler�optionsr��	combobox2�sdtime�ltime�	indexdate�
dateFormat�	combobox3�	indextime�
timeFormat�intervalr&�levelsr[�tablesCombo�	tableDict�selectedTableIter�
selectedTable�tablesModel�namesr��fname�itr��selectionIndicator�
linkIndicator�duration�brailleIndicators!                                 r^r�zOrcaSetupGUI._initGUIState�s(��
�����~�&�����2�3�>�>�v�F����+�,�:�:�6�B��/�0�����;�<�G�G��O����,�-�;�;��J�G��,�-�'�>�>�?��O�O�L�)�4�4�T�:�
�.�
/�'�>�>�?��O�O�L�)�4�4�T�:�
�.�
/�'�>�>�?��O�O�L�)�4�4�T�:��O�O�K�(�3�3�D�9��'�(�H�,J�,J�J��O�O�/�0�;�;�D�A��O�O�1�2�=�=�d�C����;�<�G�G��*�+�	-�	
���<�=�H�H��+�,�	.�	
���4�5�@�@��#�$�	&����A�B�M�M��0�1�	3����9�:�E�E��I�I�,�h�.K�.K�L�	N����;�<�G�G��*�+�	-����6�7�B�B��%�&�	(����;�<�G�G��*�+�	-����;�<�G�G��*�+�	-����=�>�I�I��I�I�0�(�2S�2S�T�	V����5�6�A�A��I�I�(�(�*C�*C�D�	F����;�<�G�G��I�I�.��0I�0I�J�	L����9�:�E�E��I�I�,�h�.K�.K�L�	N����@�A�L�L��I�I�3�X�5Y�5Y�Z�	\����5�6�A�A��I�I�(�(�*C�*C�D�	F����6�7�B�B��I�I�)�8�+E�+E�F�	H����6�7�B�B��I�I�)�8�+E�+E�F�	H����0�(�2N�2N�O�����8�9�D�D�V�L����?�H�,B�,B�C�����2�3�>�>�v�F����2�H�4R�4R�S�����:�;�F�F�v�N����7��9\�9\�]�����?�@�K�K�F�S����5�x�7X�7X�Y�����=�>�I�I�&�Q��	�	�/��1M�1M�N���?�?�#8�9���6�6��6�6��7�7�9��	
���h��0��H�6�6�6��7�7�E�
�h�9�9�
9��8�8�E��7�7�E����G�M�M�%�0�1��O�O�$5�6�	������������i��(�-�-�u�w�7��(�1�1�5�7�;��(�1�1�5�7�;��(�2�2�E�G�<��(�2�2�E�G�<��(�2�2�E�G�<��(�.�.���8��(�.�.���8��(�/�/���9��(�/�/���9��(�/�/���9��(�5�5�u�w�?��(�5�5�u�w�?��(�6�6���@��(�6�6���@��(�6�6���@��	
�&'�	��^�^�$7�8�
���4�4�4�*�I�
�8�:�:�
:�.�I�
�8�:�:�
:�.�I�
�8�;�;�
;�/�I�
�8�;�;�
;�/�I�
�8�;�;�
;�/�I�
�8�7�7�
7�+�I�
�8�7�7�
7�+�I�
�8�8�8�
8�,�I�
�8�8�8�
8�,�I�
�8�8�8�
8�,�I�
�8�>�>�
>�2�I�
�8�>�>�
>�2�I�
�8�?�?�
?�3�I�
�8�?�?�
?�3�I�
�8�?�?�
?�3�I����i�(��O�O�$5�6�	����i��(�-�-�u�w�7��(�,�,�e�g�6��(�-�-�u�w�7��(�-�-�u�w�7��(�8�8�%�'�B��(�,�,�e�g�6��(�7�7���A�
C�	D�'�	��^�^�$7�8�
���4�4�4�*�I�
�8�5�5�
5�)�I�
�8�6�6�
6�*�I�
�8�6�6�
6�*�I�
�8�A�A�
A�5�I�
�8�5�5�
5�)�I�
�8�@�@�
@�4�I����i�(����<�=�H�H��I�I�/��1Q�1Q�R�	T����>�?�J�J��I�I�1�8�3U�3U�V�	X����;�<�G�G��I�I�.��0O�0O�P�	R��4�5�����=�>�H�H��R��?�?�#9�:���,�,��4�4��/�/�1��	
���h��/����E�"8�9�:��*�+�����6�7�B�B�6�J�	
���2�3�>�>��o�.�	0��,�-�$�A�A�B�����)�*�5�5�e�<����6�7�B�B��%�&�	(��=��O�O�.�
0�0=�
�e�0D��O�O�:�;�F�F��/�0�
2�
�/�/�*A�B�K��*�*�,�I� $��!�";�<�7�$�4�4�6�
��!�m�m�C��5���y�~�~�/�0��!�/�D�%�d�O�E�$�+�+�T�5�M�:�B��w�w�|�|�G�$5�$5�u�=�)�*�,.�)�/��1�1���!�!�#��&�&�t�T�2��)�)�$���:��%�%�k�2�$��/�/�0A�B��*�*�1�-��)�)�%�0��(�)�X�-K�-K�K��O�O�0�1�<�<�T�B��O�O�2�3�>�>�t�D����:�;�F�F��I�I�-�x�/M�/M�N�	P�#�#=�>����!=�!=�=��O�O�5�6�A�A�$�G�
�8�#?�#?�
?��O�O�5�6�A�A�$�G�
�8�#B�#B�
B��O�O�8�9�D�D�T�J��O�O�8�9�D�D�T�J��4�5�
��H�8�8�8��O�O�0�1�<�<�T�B�
�h�:�:�
:��O�O�0�1�<�<�T�B�
�h�=�=�
=��O�O�3�4�?�?��E��O�O�3�4�?�?��E����0�(�2N�2N�O�����8�9�D�D�V�L����.��0J�0J�K�����6�7�B�B�6�J����,�h�.F�.F�G�����4�5�@�@��H��+�,�����4�5�?�?��4��P�	
���,�-�8�8��o�.�	0����9�:�E�E��	�	�"8�(�:W�:W�X�	Z����6�7�B�B��	�	�"5�x�7Q�7Q�R�	T����:�;�F�F��	�	�"9�8�;Y�;Y�Z�	\����0�1�<�<��	�	�-��1E�1E�F�	H����7�8�C�C��2�3�	5����7�8�C�C��2�3�	5����5�6�A�A��0�1�	3����9�:�E�E��4�5�	7����:�;�F�F��5�6�	8����:�;�F�F��5�6�	8����5�6�A�A��0�1�	3����9�:�E�E��4�5�	7�
	
�*�*�,� �!A�B���x�;�;�;��O�O�0�1�<�<�T�B�
��!=�!=�
=��O�O�0�1�<�<�T�B�
��!@�!@�
@��O�O�3�4�?�?��E��O�O�3�4�?�?��E�	
�)�)�+�	
���4�5�@�@��#�$�	&��!�"�h�&N�&N�N��O�O�2�3�>�>�t�D��O�O�1�2�=�=�d�C��?�?�=�1�����h��)E�)E�)2�)I�)I�)K�	L����E�-�0�1����A�B�M�M��I�I�4�h�6[�6[�\�	^����6�7�B�B��I�I�)�8�+E�+E�F�	H����<�=�H�H��I�I�/��1Q�1Q�R�	T����:�;�F�F��I�I�-�x�/M�/M�N�	P����A�B�M�M��I�I�4�h�6[�6[�\�	^����6�7�B�B��I�I�)�8�+E�+E�F�	H����7�8�C�C��I�I�*�H�,G�,G�H�	J����7�8�C�C��I�I�*�H�,G�,G�H�	J�
"�_�_�-I�J���$(�O�O�4P�$Q��!�"&�/�/�(�";������!��;�;�?�?��O�O�O�,�:�:�5�A�r_c��|j�}|jj�t|�s&|jj	|j
�n"|D]}|jj	|��|jjd�xs|j
}|jjd�xs|j
}|j|j|d�}|j|j|d�}|jj|�|jj|�y)z>Adding available profiles and setting active as the active oner��startingProfilerN)�#_OrcaSetupGUI__getAvailableProfilesrWrr�r
r-r,rI�getComboBoxIndexrVrXr�)r[�availableProfiles�profiler�r��activeProfileIter�startingProfileIters       r^�__initProfileCombozOrcaSetupGUI.__initProfileCombos��!�7�7�9�����%�%�'��$�%��#�#�*�*�4�+?�+?�@�,�
8���'�'�.�.�w�7�
8����*�*�?�;�S�t�?S�?S�
��.�.�,�,�->�?�W�4�CW�CW�� �1�1�$�2D�2D�2?��2B�D��"�3�3�D�4M�4M�2A�!�2D�F�����%�%�&7�8��!�!�,�,�-@�Ar_c�F�tj�j�S)zGet available user profiles.)rrxr�)r[s r^�__getAvailableProfilesz#OrcaSetupGUI.__getAvailableProfiles0s���*�*�,�>�>�@�@r_c��|jd�}dj|jd�}|j|j	||��y)N�orcaModifierComboBox�, �orcaModifierKeys)r�r�r,r�r�)r[r�	keystrings   r^�_updateOrcaModifierz OrcaSetupGUI._updateOrcaModifier4sD���?�?�#9�:���I�I�d�n�n�-?�@�A�	����D�1�1�(�I�F�Gr_c��tjt�}|D]}|j|g��|j	|�y)z�Populates the combobox with the items provided.

        Arguments:
        - combobox: the GtkComboBox to populate
        - items: the list of strings with which to populate it
        N)rr�rr
r)r[r�itemsr]�items     r^r"zOrcaSetupGUI.populateComboBox9s=���
�
�c�"���	!�D��L�L�$�� �	!����5�!r_c���|j�}|j�}tdt|��D].}|j	||�}||k(r|cS|j|�}�0y)ae For each of the entries in the given combo box, look for searchStr.
            Return the index of the entry if searchStr is found.

        Arguments:
        - combobox: the GtkComboBox to search.
        - searchStr: the string to search for.

        Returns the index of the first entry in combobox with searchStr, or
        0 if not found.
        r)rP�get_iter_firstrSr��	get_value�	iter_next)r[r�	searchStrr�r]�myiterrr�s        r^r�zOrcaSetupGUI.getComboBoxIndexFsj���"�"�$���%�%�'���q�#�e�*�%�	-�A��?�?�6�3�/�D��y� ����_�_�V�,�F�		-�r_c��|j�}|j�}|j|�}|j|d�}|j|d�}||gS)z6Get the list of values from the active combox
        rr
)r#rPrUr�)r[rror]�
activeIter�activeLabel�
activeNames       r^�getComboBoxListzOrcaSetupGUI.getComboBoxList\sY���$�$�&���"�"�$���^�^�F�+�
��o�o�j�!�4���_�_�Z��3�
��Z�(�(r_c�p�i}|j�}|r�|j|�}|rz|j|tt�\}}|s|sDg}|jt
|j|tttt���|||<|j|�}|r�z|j|�}|r��|S�N)r��
iter_childrenrIr�r�r
�listr�r�r�r�r�)	r[r]�modifiedOnly�	modelDict�node�childr��modifiedr�s	         r^r�z$OrcaSetupGUI.getKeyBindingsModelDictfs����	��#�#�%����'�'��-�E�� %�	�	�%��%� @�
��X��<��E��L�L��e�i�i�!�4��I�|�'M�"N�O�%*�I�c�N�����.����?�?�4�(�D���r_c��it_|j�}|�L|j|tt�\}}|r|rtj
||�|j
|�}|��Ltj}|S)z:Get the list of values from a list[str,str] model
        )rr�rIr�r��setPronunciationr�)r[r]�currentIterr�r�r�s      r^r�zOrcaSetupGUI.getModelDictwsu��13��-��*�*�,���%����;���D�J�C���u�"�3�3�C��?��/�/�+�6�K�	�%�
'�9�9�	��r_c��|jd�}tj�}|j|�|jd�}tjd�\}}|jd|||d�	tjj}|dk(rtj�}|j|�|j|jtj�j!d�dd�|j"j$rKt&j(t+j,|j"j$�z}|j/|�|j1�y#t$rd}Y��wxYw)	zlShow the Orca configuration GUI window. This assumes that
        the GUI has already been created.
        rr�
helpButton�F1r�rrpTN)r�r�
AccelGroup�add_accel_group�accelerator_parse�add_acceleratorr�lastInputEvent�	timestampr?�get_current_event_time�present_with_timerfr2rrxryrZr�r�PREFERENCES_APPLICATION_TITLErr��	set_title�show)r[rr�
accelGroupr��keyVal�modifierMask�ts�titles        r^�showGUIzOrcaSetupGUI.showGUI�sB��
�/�/�*;�<���^�^�%�
��'�'�
�3��_�_�\�2�
�!$�!6�!6�t�!<�����"�"�9�#-�#)�#/�#$�		&�	��*�*�4�4�B���7��+�+�-�B��)�)�"�-�
	
�%�%��*�*� �+�+�-�8�8�9V�W��d�	�
�;�;�?�?��;�;�h�>O�>O�PT�P[�P[�P_�P_�>`�`�E��%�%�e�,������%�	��B�	�s�6E+�+E9�8E9c���tj�}|j|d�	|j�d}|j	|dd�tjtt�}|j|�t|tj�r(|j�}|j|ddz
d�|S#t
$r|j	|dd�Y��wxYw)z�Initialize the given combo box to take a list of int/str pairs.

        Arguments:
        - combobox: the GtkComboBox to initialize.
        Trrhr
����)rr�r��	get_cellsr�r?r��intrr�
isinstance�ComboBoxText�size_request�set_fixed_size)r[rr��columnToDisplayr]�sizes      r^r�zOrcaSetupGUI._initComboBox�s����#�#�%�����D�$�'�	4�&�0�0�2�1�5�O��"�"�?�F�A�>��
�
�c�3�'�����5�!��h�� 0� 0�1��(�(�*�D�����Q��"��b�1�����	4��"�"�4���3�	4�s�&C�C �C c��|jd�j�}|jd�j|�|jd�j|�|jd�j|�|jd�j|�|jd�j|�|jd�j|�|jd�j|�|jd	�j|�|jd
�j|�y)z�[In]sensitize the checkboxes for the various types of key echo,
        depending upon whether the value of the key echo check button is set.
        r6r8r:r<r>r@rBrDrFrHN)r�r#r|�r[r�s  r^r�zOrcaSetupGUI._setKeyEchoItems�s���
���!5�6�A�A�C�����9�:�H�H��P����6�7�E�E�f�M����:�;�I�I�&�Q����0�1�?�?��G����7�8�F�F�v�N����7�8�F�F�v�N����5�6�D�D�V�L����9�:�H�H��P����:�;�I�I�
�	r_c��|jj||��	|jj|d��y#t$rYywxYw)aIf the text field is not None, presents the given text, optionally
        interrupting anything currently being spoken.

        Arguments:
        - text: the text to present
        - interrupt: if True, interrupt any speech currently being spoken
        )�	interruptr�)�	flashTimeN)rZ�speakMessage�displayBrailleMessager?)r[rhrs   r^�_presentMessagezOrcaSetupGUI._presentMessage�sI��	
��� � ��� �;�	��K�K�-�-�d�b�-�A���	��	�s�=�	A	�A	c��|j}|jd�}|j|t|�|j|td�|S)z�Create a new root node in the TreeStore model with the name of the
            application.

        Arguments:
        - appName: the name of the TreeStore Node (the same of the application)
        NF)r6r
r�r�r�)r[�appNamer]r�s    r^�_createNodezOrcaSetupGUI._createNode�sB���%�%�����d�#��
������1�
�����u�-��
r_c��|j}|D];}|j|j�dk(s�"|t|k(s�/|jcSy)a)Returns the Gtk.TreeIter of the TreeStore model
        that matches the application name passed as argument

        Arguments:
        - appName: a string with the name of the application of the node wanted
                    it's the same that the field DESCRIP of the model treeStore
        rN)r6�
iter_depth�iterr�)r[rr]�rows    r^�
_getIterOfzOrcaSetupGUI._getIterOf�sO���%�%���	 �C��!�!�#�(�(�+�q�0���\�W�,��x�x��	 �
r_c�r�d}|dk(rdtj�d�}|S|dk(rdtj�d�}|S)z�Given a numeric clickCount, returns a string for inclusion
        in the list of keybindings.

        Argument:
        - clickCount: the number of clicks associated with the keybinding.
        rr"z (�)�)r�CLICK_COUNT_DOUBLE�CLICK_COUNT_TRIPLE)r[�
clickCount�clickCountStrings   r^�_clickCountToStringz OrcaSetupGUI._clickCountToStringsT������?�!#�I�$@�$@�#A��C�� ���1�_�!#�I�$@�$@�#A��C���r_Nc���|j}|jsy|�|jtj�}|���|j|�}|jsd}nL|j|j�}|j}	tj|j�|	z|z}|j|t|�|j|t|jj�|j|t t#|j$��|j|t&t#|j��|j|t(|j�|j|t*t#|j��|�.|j|t,|�|j|t.|�|j|t0|�|j|t2d�|Sy)a�Appends a new row with the new keybinding data to the treeview

        Arguments:
        - handl:  the name of the handler associated to the keyBinding
        - kb:     the new keybinding.
        - parent: the parent node of the treeview, where to append the kb
        - modif:  whether to check the modified field or not.

        Returns a Gtk.TreeIter pointing at the new row.
        NT)r6�handlerrr�KB_GROUP_DEFAULTr
�keysymstringr�click_countr�getModifierNames�	modifiersr�r�r��descriptionr�r�
modifier_maskr�r�r�r�r�r�r�)
r[�handl�kb�parent�modifr]r�rhrr s
          r^�
_insertRowzOrcaSetupGUI._insertRowsn���%�%���z�z���>��_�_�Y�%?�%?�@�F����\�\�&�)�F��?�?���!�5�5�b�n�n�E�
�!����"�3�3�B�L�L�A�%�&�#�$��
�O�O�F�G�U�3��O�O�F�G�R�Z�Z�-C�-C�D��O�O�F�I�s�2�3C�3C�/D�E��O�O�F�I�s�2�<�<�/@�A��O�O�F�D�"�/�/�:��O�O�F�L�#�b�n�n�2E�F��������$�7������t�4��O�O�F�E�5�1��O�O�F�H�d�3��M�r_c���|j}|�|jtj�}|��|j	|�}|j|t|�|j|t|j�|j|tt|��|j|ttj|�|j|t|�|j|td�|Sy)a�Appends a new row with the new braille binding data to the treeview

        Arguments:
        - handl:       the name of the handler associated to the brailleBinding
        - com:         the BrlTTY command
        - inputEvHand: the inputEventHandler with the new brailleBinding
        - parent:      the parent node of the treeview, where to append the kb
        - modif:       whether to check the modified field or not.

        Returns a Gtk.TreeIter pointing at the new row.
        NF)r6rr�KB_GROUP_BRAILLEr
r�r�r�r$r�rr�r�command_namer�r�)r[r&�com�inputEvHandr(r)r]r�s        r^�_insertRowBraillezOrcaSetupGUI._insertRowBrailleGs����%�%���>��_�_�Y�%?�%?�@�F����\�\�&�)�F��O�O�F�G�U�3��O�O�F�G�[�-D�-D�E��O�O�F�D�#�c�(�3��O�O�F�E�7�+?�+?��+D�E��O�O�F�E�5�1��O�O�F�H�e�4��M�r_c���	|jj�tj�}t	j
�j
|jj|d��}tjdddd�}|j}|j�}|��|j|�}|�o|j|t�}tjd|�|_|j#|d��r|j%|t&d�|j)|�}|��o|j)|�}|���yy#t*$r&t-j.t,j0�YywxYw)z8 Mark as modified the user custom key bindings:
        F)�enabledOnlyNr$)�typeOfSearchT)rZ�setupInputEventHandlersr�KeyBindingsrrx�overrideKeyBindings�inputEventHandlers�
KeyBindingr6r�r�r�r�r�InputEventHandlerr�
hasKeyBindingr�r�r�r?rr@r)r[�keyBinds�keyBind�	treeModelr��	iterChild�descrips       r^�
_markModifiedzOrcaSetupGUI._markModifiedfsL��	5��K�K�/�/�1�"�.�.�0�H�'�2�2�4�H�H����.�.��e�I�M�H�!�,�,�T�4��t�D�G��-�-�I��-�-�/�F��$�%�3�3�F�;�	��+�'�1�1�)�W�E�G�#�5�5�d�G�D��O��-�-�g�;H�.�J�!�+�+�I�u�d�C� )� 3� 3�I� >�I� �+�#�,�,�V�4���$���	5�� � ��!3�!3�4�	5�s�DD8�"D8�8,E'�&E'c��|jjd�|jjd�|jj�|r!|jj�d|_tj|jj�}|j|�}|jtj�}|jtj�}|jtj�}|jtj �}|jtj"�}|jtj$�}	|jtj&�}
|jtj(�}|jtj*�}|jtj,�}
|jtj.�}|jtj0�}|jtj2�}|jtj4�}|j�s.t7j8�j;d�}|t<j>k(}tAjB�|_|jjE�|jjGd�}|jjI�}|jjK�jM|��}|jjO�jM|��}|jjQ�jM|��}|jjS�jM|��}|jjU�jM|��}|jjW�jM|��}|jjY�jM|��}|jj[�jM|��}|jj]�jM|��}|jj_�jM|��}|jja�jM|��} |jjc�jM|��}!|jdD�]�}"|jjg|"d�r�!|jji|"jj�}#|jg|"d�r|jm|#|"|��n|jg|"d�r|jm|#|"|��n�|jg|"d�r|jm|#|"|
��n�| jg|"d�r|jm|#|"|��n�|!jg|"d�r|jm|#|"|��ne|jg|"d�r|jm|#|"|��n>|jg|"d�r|jm|#|"|	��n|jg|"d�r|jm|#|"|
�n�|jg|"d�r|jm|#|"|�n�|jg|"d�r|jm|#|"|�n�|jg|"d�r|jm|#|"|�n|jg|"d�r|jm|#|"|�nY|jg|"d�s|jm|#|"|�n3|"jnr|jm|#|"|�n|jm|#|"|�|jjq|"����|jjs|�s|jju|�|jjs|�s|jju|�|jw�|jy�|jtjz�}$|jj}�|_?|j~j��D]4\}%}&|jji|&�}#|j�|#|%|&|$��6|jj|j�|jjd�|jj�t�t�j�j��|jj��i|_Hy)z�Fills the TreeView with the list of Orca keybindings

        Arguments:
        - clearModel: if True, initially clear out the key bindings model.
        NFrW)�
is_desktop�strictr$T)Ir7r�set_headers_visible�hider6rr5rr�rZr�rrr�KB_GROUP_UNBOUND�KB_GROUP_NOTIFICATIONS�KB_GROUP_FLAT_REVIEW�KB_GROUP_SPEECH_VERBOSITY�KB_GROUP_SYSTEM_INFORMATION�KB_GROUP_SLEEP_MODE�KB_GROUP_BOOKMARKS�KB_GROUP_OBJECT_NAVIGATION�KB_GROUP_TABLE_NAVIGATION�KB_GROUP_WHERE_AM_I�KB_GROUP_LEARN_MODE�KB_GROUP_MOUSE_REVIEW�KB_GROUP_ACTIONSrrxryrr�rr5r4�getKeyBindings�getDefaultKeyBindings�getNotificationPresenter�get_bindings�getSpeechAndVerbosityManager�getSystemInformationPresenter�getSleepModeManager�getBookmarks�getObjectNavigator�getTableNavigator�getLearnModePresenter�getMouseReviewer�getActionPresenter�getFlatReviewPresenter�getWhereAmIPresenter�keyBindingsr:�getInputEventHandlerKeyrr*r �add�iter_has_child�remover�r@r,�getBrailleBindingsr.r�r0r�r�r�SortType�	ASCENDINGr�r9)'r[�
clearModelr�iterApp�iterOrca�iterUnbound�iterNotificationPresenter�iterFlatReviewPresenter�iterSpeechAndVerbosity�iterSystemInfo�
iterSleepMode�
iterBookmarks�
iterObjectNav�iterTableNav�iterWhereAmIPresenter�
iterLearnMode�iterMouseReviewer�iterActionPresenter�layout�	isDesktop�allKeyBindings�defKeyBindings�
npKeyBindings�
svKeyBindings�sysKeyBindings�
smKeyBindings�
bmKeyBindings�
onKeyBindings�
tnKeyBindings�
lmKeyBindings�
mrKeyBindings�
acKeyBindings�
frKeyBindings�waiKeyBindingsr'r&�iterBBr.r/s'                                       r^r�z!OrcaSetupGUI._populateKeyBindings�sj��	
���"�"�4�(����,�,�U�3���������!�!�'�'�)�!�D�N��#�#�D�K�K�O�O�4���"�"�7�+���#�#�I�$>�$>�?���&�&�y�'A�'A�B��$(�$4�$4�Y�5U�5U�$V�!�"&�"2�"2�9�3Q�3Q�"R��!%�!1�!1�)�2U�2U�!V���)�)�)�*O�*O�P���(�(��)F�)F�G�
��(�(��)E�)E�F�
��(�(��)M�)M�N�
��'�'�	�(K�(K�L�� $� 0� 0��1N�1N� O���(�(��)F�)F�G�
� �,�,�Y�-L�-L�M��"�.�.�y�/I�/I�J���~�~�%�0�0�2�=�=�>N�O�F��(�"J�"J�J�I�(�4�4�6�D�N��K�K�/�/�1�!�[�[�7�7��>�N�!�[�[�>�>�@�N� �K�K�@�@�B�O�O�$�P�&�M� �K�K�D�D�F�S�S�$�T�&�M�!�[�[�F�F�H�U�U�$�V�&�N� �K�K�;�;�=�J�J�$�K�&�M� �K�K�4�4�6�C�C�$�D�&�M� �K�K�:�:�<�I�I�$�J�&�M� �K�K�9�9�;�H�H�$�I�&�M� �K�K�=�=�?�L�L�$�M�&�M� �K�K�8�8�:�G�G�$�H�&�M� �K�K�:�:�<�I�I�$�J�&�M� �K�K�>�>�@�M�M�$�N�&�M�!�[�[�=�=�?�L�L�$�M�&�N�%�0�0�!
+���~�~�3�3�B��A� �K�K�?�?��
�
�K�E�$�2�2�2�}�E�����r�3L�M�&�4�4�R��G�����r�=�A�&�4�4�R��G�����r�<�@�&�4�4�R��G�����r�3J�K�'�5�5�b�-�H�����r�3H�I�&�4�4�R��G�����r�3I�J�'�5�5�b�-�H�����r�>�B�&�4�4�R��G�����r�=�A�&�4�4�R��G�����r�=�A�&�4�4�R��G�����r�=�A�&�4�4�R��G�����r�3F�G�&�4�4�R��G�����r�3D�E�+�9�9�"�m�L�����r�7�;��������r�8�<�����r�;�?��N�N�&�&�r�*�C!
+�F�$�$�3�3�G�<��!�!�(�(��1��$�$�3�3�K�@��!�!�(�(��5�� � �"������!�!�)�"<�"<�=�����7�7�9��� $��� 4� 4� 6�	D��C���K�K�7�7��D�E��"�"�5�#�{�F�C�	D�	
���"�"�4�#8�#8�9����,�,�T�2����0�0��3�<�<�;Q�;Q�R�������#%��r_c��|jD]m}||jk(s|jj��-|jj	�}|D]"}||j
k(r�|j
��$�oy)z�Remove unwanted factories and drivers for the current active
        factory, when the user dismisses the Orca Preferences dialog.N)rOrIr1�shutdownActiveServersr2rF�shutdown)r[rErDr,s    r^�_cleanupSpeechServersz"OrcaSetupGUI._cleanupSpeechServers�st��#�3�3�	*�N�"�d�&>�&>�>��+�+�A�A�C�(�5�5�F�F�H��%�*�F�"�d�&>�&>�>����)�*�	*r_c��|j�}||jd<|jd�j|�y)a�Signal handler for the "toggled" signal for the
           speechSupportCheckButton GtkCheckButton widget. The user has
           [un]checked the 'Enable Speech' checkbox. Set the 'enableSpeech'
           preference to the new value. Set the rest of the speech pane items
           [in]sensensitive depending upon whether this checkbox is checked.

        Arguments:
        - widget: the component that generated the signal.
        rHr�N�r#r,r�r|�r[r�r�s   r^�speechSupportCheckedz!OrcaSetupGUI.speechSupportChecked	s8���"�"�$��)/����~�&����+�,�:�:�6�Br_c��|j�}||jd<|jd�j|�y)aSignal handler for the "toggled" signal for the GtkCheckButton
        onlySpeakDisplayedText. In addition to updating the preferences,
        set the sensitivity of the contextOptionsGrid.

        Arguments:
        - widget: the component that generated the signal.
        r�r�Nr�r�s   r^�onlySpeakDisplayedTextToggledz*OrcaSetupGUI.onlySpeakDisplayedTextToggled	s;���"�"�$��39����/�0����,�-�;�;��J�Gr_c��|jry|j�}|j||_|j	�y)a�Signal handler for the "changed" signal for the speechSystems
           GtkComboBox widget. The user has selected a different speech
           system. Clear the existing list of speech servers, and setup
           a new list of speech servers based on the new choice. Setup a
           new list of voices for the first speech server in the list.

        Arguments:
        - widget: the component that generated the signal.
        N)r4r#rJrIr4�r[r�rs   r^�speechSystemsChangedz!OrcaSetupGUI.speechSystemsChanged$	s=���"�"���)�)�+�
�#'�#<�#<�]�#K�� �� � �"r_c���|jry|j�}|j||_	|jt
jj=|jt
jj=|jt
jj=|jt
jj=|j�y#t$rY�wxYw)aVSignal handler for the "changed" signal for the speechServers
           GtkComboBox widget. The user has selected a different speech
           server. Clear the existing list of voices, and setup a new
           list of voices based on the new choice.

        Arguments:
        - widget: the component that generated the signal.
        N)
r4r#rGrFr0rr|r�rMr3rLr?r(r�s   r^�speechServersChangedz!OrcaSetupGUI.speechServersChanged6	s����"�"���)�)�+�
�#'�#<�#<�]�#K�� �	��!�!�$�)�)�"2�"2�3��#�#�D�I�I�$4�$4�5��#�#�D�I�I�$4�$4�5�� � ����!1�!1�2�	
������	��	�s�BC�	C$�#C$c�(�|jry|j�}	|j||_|j|jf|j
vr�|j
|j|jf}|j|}|tjj}|tjj}|tjj}|tjj}|jd�j�}	|j|	||||�|dk(s||j&|j<|j)�y#t$r&t!j"t j$�Y�]wxYw)a-Signal handler for the "value_changed" signal for the languages
           GtkComboBox widget. The user has selected a different voice
           language. Save the new voice language name based on the new choice.

        Arguments:
        - widget: the component that generated the signal.
        Nrr�)r4r#rCrBrFrTr@rr�r�r�r�r�r�r�r?rr@rrUr�)
r[r�rrr�r�r�r�r�r�s
          r^�speechLanguagesChangedz#OrcaSetupGUI.speechLanguagesChangedV	sf���"�"���)�)�+�
�	5�)-�)D�)D�]�)S�D�&��(�(�$�*D�*D�E��.�.�/��.�.�t�/G�/G��2�2�03�4���3�3�A�6���l�6�6�;�;�<��!�,�":�":�"?�"?�@�� ��!9�!9�!A�!A�B�� ��!9�!9�!A�!A�B�� �O�O�,=�>�I�I�K�	��/�/�	�4��7�T[�\���"�ER�D�(�(��)A�)A�B�������	5�� � ��!3�!3�4�	5�s�DE"�",F�Fc�h�|jry|j�}	|j|}|tjj
}|tjj}|tjj}|tjj}|jd�j�}|j|||||�|dk(s&||j|j |j"f<yy#t$r&tjtj�Y�ZwxYw)a(Signal handler for the "value_changed" signal for the families
           GtkComboBox widget. The user has selected a different voice
           family. Save the new voice family name based on the new choice.

        Arguments:
        - widget: the component that generated the signal.
        Nrr�)r4r#r@rr�r�r�r�r�r�r�r?rr@rrTrFrB)	r[r�rr�r�r�r�r�r�s	         r^�speechFamiliesChangedz"OrcaSetupGUI.speechFamiliesChanged{	s���"�"���)�)�+�
�		5��/�/�
�>�F��,�2�2�7�7�8�D��l�6�6�;�;�<�H��\�5�5�=�=�>�G��\�5�5�=�=�>�G����(9�:�E�E�G�I��+�+�I�t�X�w�PW�X���"�2?�
�&�&�t�'?�'?��.�.�(/�
0�#��
�	5�� � ��!3�!3�4�	5�s�B7D�,D1�0D1c�`�|jry|j�}|j|�y)aLSignal handler for the "changed" signal for the voiceTypes
           GtkComboBox widget. The user has selected a different voice
           type. Setup the new family, rate, pitch and volume component
           values based on the new choice.

        Arguments:
        - widget: the component that generated the signal.
        N)r4r#r�)r[r�r�s   r^�voiceTypesChangedzOrcaSetupGUI.voiceTypesChanged�	s,���"�"���%�%�'�	��*�*�9�5r_c��|j�}|jd�j�}|j||�t	j
�j
d�}||jtji�tjj<t	j
�jd|�y)a:Signal handler for the "value_changed" signal for the rateScale
           GtkScale widget. The user has changed the current rate value.
           Save the new rate value based on the currently selected voice
           type.

        Arguments:
        - widget: the component that generated the signal.
        rraN)r�r�r#r�rrxryrIrrzrr|rr�)r[r�r�r�ras     r^�rateValueChangedzOrcaSetupGUI.rateValueChanged�	s������!���O�O�$5�6�A�A�C�	��!�!�)�T�2�!�,�,�.�9�9�(�C��AE��
�
�8�)�)�2�.�t�y�y�~�~�>��#�#�%�0�0��6�Br_c��|j�}|jd�j�}|j||�t	j
�j
d�}||jtji�tjj<t	j
�jd|�y)a=Signal handler for the "value_changed" signal for the pitchScale
           GtkScale widget. The user has changed the current pitch value.
           Save the new pitch value based on the currently selected voice
           type.

        Arguments:
        - widget: the component that generated the signal.
        rraN)r�r�r#r�rrxryrIrrzrr|r~r�)r[r�r�r�ras     r^�pitchValueChangedzOrcaSetupGUI.pitchValueChanged�	s���� � �"���O�O�$5�6�A�A�C�	��"�"�9�e�4�!�,�,�.�9�9�(�C��JO��
�
�8�)�)�2�.�t�y�y�/F�/F�G��#�#�%�0�0��6�Br_c��|j�}|jd�j�}|j||�t	j
�j
d�}||jtji�tjj<t	j
�jd|�y)a?Signal handler for the "value_changed" signal for the voiceScale
           GtkScale widget. The user has changed the current volume value.
           Save the new volume value based on the currently selected voice
           type.

        Arguments:
        - widget: the component that generated the signal.
        rraN)r�r�r#r�rrxryrIrrzrr|r}r�)r[r�r�r�ras     r^�volumeValueChangedzOrcaSetupGUI.volumeValueChanged�	s����!�!�#���O�O�$5�6�A�A�C�	��#�#�I�v�6�!�,�,�.�9�9�(�C��AG��
�
�8�)�)�2�.�t�y�y�~�~�>��#�#�%�0�0��6�Br_c��tjj|�}|dd}|j�|j|<y)a	Signal handler for "toggled" signal for basic GtkCheckButton 
           widgets. The user has altered the state of the checkbox.
           Set the preference to the new value.

        Arguments:
        - widget: the component that generated the signal.
        Ni����)r�	Buildabler�r#r,)r[r��settingNames   r^�checkButtonToggledzOrcaSetupGUI.checkButtonToggled�	s;���m�m�,�,�V�4��!�$�3�'��&,�&7�&7�&9����{�#r_c�^�|j�|jd<|j�y)a�Signal handler for the "toggled" signal for the
           keyEchoCheckbutton GtkCheckButton widget. The user has
           [un]checked the 'Enable Key Echo' checkbox. Set the
           'enableKeyEcho' preference to the new value. [In]sensitize
           the checkboxes for the various types of key echo, depending
           upon whether this value is checked or unchecked.

        Arguments:
        - widget: the component that generated the signal.
        r7N)r#r,r��r[r�s  r^�keyEchoCheckedzOrcaSetupGUI.keyEchoChecked�	s'��+1�*;�*;�*=�����'����r_c���|j�r�|j�tjk(rtj
|jd<y|j�tjk(rtj|jd<y|j�tjk(rtj|jd<ytj|jd<yy)aVSignal handler for the "toggled" signal for the
           brailleSelectionNoneButton, brailleSelection7Button,
           brailleSelection8Button or brailleSelectionBothButton
           GtkRadioButton widgets. The user has toggled the braille
           selection indicator value. If this signal was generated
           as the result of a radio button getting selected (as
           opposed to a radio button losing the selection), set the
           'brailleSelectorIndicator' preference to the new value.

        Arguments:
        - widget: the component that generated the signal.
        r$N�r#�	get_labelr�
BRAILLE_DOT_7rr�r,�
BRAILLE_DOT_8r��BRAILLE_DOT_7_8r��BRAILLE_UNDERLINE_NONEr�s  r^�brailleSelectionChangedz$OrcaSetupGUI.brailleSelectionChanged�	s����������!�Y�%<�%<�<��0�0����9�:��!�!�#�y�'>�'>�>��0�0����9�:��!�!�#�y�'@�'@�@��3�3����9�:��3�3����9�:�r_c���|j�r�|j�tjk(rtj
|jd<y|j�tjk(rtj|jd<y|j�tjk(rtj|jd<ytj|jd<yy)a9Signal handler for the "toggled" signal for the
           brailleLinkNoneButton, brailleLink7Button,
           brailleLink8Button or brailleLinkBothButton
           GtkRadioButton widgets. The user has toggled the braille
           link indicator value. If this signal was generated
           as the result of a radio button getting selected (as
           opposed to a radio button losing the selection), set the
           'brailleLinkIndicator' preference to the new value.

        Arguments:
        - widget: the component that generated the signal.
        r)Nr�r�s  r^�brailleLinkChangedzOrcaSetupGUI.brailleLinkChanged
s����������!�Y�%<�%<�<��0�0����5�6��!�!�#�y�'>�'>�>��0�0����5�6��!�!�#�y�'@�'@�@��3�3����5�6��3�3����5�6�r_c���|j�r�|j�tjk(rtj
|jd<y|j�tjk(rtj|jd<y|j�tjk(rtj|jd<ytj|jd<yy)aCSignal handler for the "toggled" signal for the
           textBrailleNoneButton, textBraille7Button, textBraille8Button
           or textBrailleBothButton GtkRadioButton widgets. The user has
           toggled the text attributes braille indicator value. If this signal
           was generated as the result of a radio button getting selected
           (as opposed to a radio button losing the selection), set the
           'textAttributesBrailleIndicator' preference to the new value.

        Arguments:
        - widget: the component that generated the signal.
        rPNr�r�s  r^�brailleIndicatorChangedz$OrcaSetupGUI.brailleIndicatorChanged6
s����������!�Y�%<�%<�<��0�0����?�@��!�!�#�y�'>�'>�>��0�0����?�@��!�!�#�y�'@�'@�@��3�3����?�@��3�3����?�@�r_c���|j�r�|j�tjk(rtj|j
d<y|j�tjk(rtj|j
d<y|j�tjk(rtj|j
d<ytj|j
d<yy)a�Signal handler for the "toggled" signal for the noneButton,
           someButton or allButton GtkRadioButton widgets. The user has
           toggled the speech punctuation level value. If this signal
           was generated as the result of a radio button getting selected
           (as opposed to a radio button losing the selection), set the
           'verbalizePunctuationStyle' preference to the new value.

        Arguments:
        - widget: the component that generated the signal.
        r�N)	r#r�rrorr,rprq�PUNCTUATION_STYLE_ALLr�s  r^�punctuationLevelChangedz$OrcaSetupGUI.punctuationLevelChangedQ
s����������!�Y�%E�%E�E��3�3����:�;��!�!�#�y�'G�'G�G��3�3����:�;��!�!�#�y�'G�'G�G��3�3����:�;��2�2����:�;�r_c��|j�}|j�}||d}|jd�|jd<y)z�Signal handler for the changed signal for the orcaModifierComboBox
           Set the 'orcaModifierKeys' preference to the new value.

        Arguments:
        - widget: the component that generated the signal.
        rr�r�N)rPr��splitr,)r[r�r]r��orcaModifiers     r^�orcaModifierChangedz OrcaSetupGUI.orcaModifierChangedk
sH��� � �"���'�'�)���V�}�Q�'��-9�-?�-?��-E����)�*r_c�R�|j�}|j�}||d}|tjk(rtj|j
d<y|tjk(rtj|j
d<ytj|j
d<y)aSignal handler for the changed signal for the progressBarVerbosity
           GtkComboBox widget. Set the 'progressBarVerbosity' preference to
           the new value.

        Arguments:
        - widget: the component that generated the signal.
        rrN)rPr�rr�rr,r�r�)r[r�r]r�rs     r^�progressBarVerbosityChangedz(OrcaSetupGUI.progressBarVerbosityChangedx
s���� � �"���'�'�)��$�V�}�Q�/���9�#=�#=�=��)�)�
�N�N�1�2�
!�Y�%B�%B�
B��,�,�
�N�N�1�2��1�1�
�N�N�1�2r_c��|j�}|j�}||d}|tjk(rtj|j
d<nN|tjk(rtj|j
d<ntj|j
d<|jjj�y)Nrr)rPr�rrtrr,rursrZ�speechAndVerbosityManager�update_capitalization_style)r[r�r]r�rs     r^�capitalizationStyleChangedz'OrcaSetupGUI.capitalizationStyleChanged�
s���� � �"���'�'�)��#�F�m�A�.���)�"E�"E�E�4<�4V�4V�D�N�N�0�1�
 �I�$H�$H�
H�4<�4W�4W�D�N�N�0�1�4<�4V�4V�D�N�N�0�1����-�-�I�I�Kr_c��|j�}|j�}||d}|tjk(rtj
|jd<y|tjk(rtj|jd<yy)z�Signal handler for the "changed" signal for the sayAllStyle
           GtkComboBox widget. Set the 'sayAllStyle' preference to the
           new value.

        Arguments:
        - widget: the component that generated the signal.
        rrZN)	rPr�rr�r�SAYALL_STYLE_LINEr,r��SAYALL_STYLE_SENTENCE)r[r�r]r�rZs     r^�sayAllStyleChangedzOrcaSetupGUI.sayAllStyleChanged�
sw��� � �"���'�'�)���F�m�A�&���)�6�6�6�,4�,F�,F�D�N�N�=�)�
�I�<�<�
<�,4�,J�,J�D�N�N�=�)�=r_c��|j�}|tk(rtj}�n�|tk(rtj}�no|tk(rtj}�nT|t
k(rtj
}�n9|tk(rtj}�n|tk(rtj}�n|tk(rtj}n�|tk(rtj}n�|tk(rtj}n�|tk(rtj}n�|tk(rtj}n�|tk(rtj}ng|tk(rtj}nM|tk(rtj}n3|t k(rtj }n|t"k(rtj"}|j$d<y)z�Signal handler for the "changed" signal for the dateFormat
           GtkComboBox widget. Set the 'dateFormat' preference to the
           new value.

        Arguments:
        - widget: the component that generated the signal.
        r	N)r#rzrr{r|r}r~rr�r�r�r�r�r�r�r�r�r�r,)r[r�r�	newFormats    r^�dateFormatChangedzOrcaSetupGUI.dateFormatChanged�
sa��!�+�+�-���0�0� �3�3�I�
� 6�
6� �7�7�I�
� 6�
6� �7�7�I�
� 7�
7� �8�8�I�
� 7�
7� �8�8�I�
� 7�
7� �8�8�I�
� 3�
3� �4�4�I�
� 3�
3� �4�4�I�
� 4�
4� �5�5�I�
� 4�
4� �5�5�I�
� 4�
4� �5�5�I�
� :�
:� �;�;�I�
� :�
:� �;�;�I�
� ;�
;� �<�<�I�
� ;�
;� �<�<�I�
� ;�
;� �<�<�I�.7����*�+r_c��|j�}|tk(rtj}n�|tk(rtj}n�|tk(rtj}ng|t
k(rtj
}nM|tk(rtj}n3|tk(rtj}n|tk(rtj}|jd<y)z�Signal handler for the "changed" signal for the timeFormat
           GtkComboBox widget. Set the 'timeFormat' preference to the
           new value.

        Arguments:
        - widget: the component that generated the signal.
        rN)
r#r�rr�r�r�r�r�r�r,)r[r�r
r�s    r^�timeFormatChangedzOrcaSetupGUI.timeFormatChanged�
s���!�+�+�-���0�0� �3�3�I�
� 1�
1� �2�2�I�
� 2�
2� �3�3�I�
� 2�
2� �3�3�I�
� =�
=� �>�>�I�
� 1�
1� �2�2�I�
� <�
<�!�>�>�I�/8����*�+r_c���|j�r]|j�tjk(rtj|j
d<ytj|j
d<yy)a�Signal handler for the "toggled" signal for the speechBriefButton,
           or speechVerboseButton GtkRadioButton widgets. The user has
           toggled the speech verbosity level value. If this signal was
           generated as the result of a radio button getting selected
           (as opposed to a radio button losing the selection), set the
           'speechVerbosityLevel' preference to the new value.

        Arguments:
        - widget: the component that generated the signal.
        r�N�r#r�rrrrr,�VERBOSITY_LEVEL_VERBOSEr�s  r^�speechVerbosityChangedz#OrcaSetupGUI.speechVerbosityChanged�
s^���������!�Y�%D�%D�D��2�2����5�6��4�4����5�6�r_c�>�|j�|jd<y)z�Signal handler for the "value_changed" signal for the
           progressBarUpdateIntervalSpinButton GtkSpinButton widget.

        Arguments:
        - widget: the component that generated the signal.
        rN��get_value_as_intr,r�s  r^�%progressBarUpdateIntervalValueChangedz2OrcaSetupGUI.progressBarUpdateIntervalValueChangeds��7=�6M�6M�6O����2�3r_c�D�|j�dz|jd<y)Nr5r3r�r�s  r^�brailleFlashTimeValueChangedz)OrcaSetupGUI.brailleFlashTimeValueChangeds��-3�-D�-D�-F��-M����)�*r_c��|j�rtj|jd<ytj|jd<y)aJSignal handler for the "toggled" signal for the abbrevRolenames
           GtkCheckButton widget. The user has [un]checked the 'Abbreviated
           Rolenames' checkbox. Set the 'brailleRolenameStyle' preference
           to the new value.

        Arguments:
        - widget: the component that generated the signal.
        rN)r#rr�r,�BRAILLE_ROLENAME_STYLE_LONGr�s  r^�abbrevRolenamesCheckedz#OrcaSetupGUI.abbrevRolenamesCheckedsB�������5�5�
�N�N�1�2��4�4�
�N�N�1�2r_c���|j�r]|j�tjk(rtj|j
d<ytj|j
d<yy)a�Signal handler for the "toggled" signal for the brailleBriefButton,
           or brailleVerboseButton GtkRadioButton widgets. The user has
           toggled the braille verbosity level value. If this signal was
           generated as the result of a radio button getting selected
           (as opposed to a radio button losing the selection), set the
           'brailleVerbosityLevel' preference to the new value.

        Arguments:
        - widget: the component that generated the signal.
        rNr�r�s  r^�brailleVerbosityChangedz$OrcaSetupGUI.brailleVerbosityChanged#s^���������!�Y�%D�%D�D��2�2����6�7��4�4����6�7�r_c�"�||||||<y)z6When the user changes a checkbox field (boolean field)N�)r[r�r�r]r�s     r^r�zOrcaSetupGUI.keyModifiedToggle7s!�� %�T�{�3�/�/��d��C��r_c���|jtj�dt_tj�j�j�|jd|j�y)z5Starts user input of a Key for a selected key bindingTzkey-press-eventN)rr�KB_ENTER_NEW_KEYr�
capturingKeysrrx�getActiveScript�removeKeyGrabsr��kbKeyPressed)r[r�rmr�r=s     r^r�zOrcaSetupGUI.editingKey=sX��	
���X�6�6�7�#'�
� ��!�!�#�3�3�5�D�D�F����*�D�,=�,=�>�r_c��dt_g|_tj�j�j
d�y)z4Stops user input of a Key for a selected key bindingF�Done capturing keysN)rr�rYrrxr��refreshKeyGrabs)r[rms  r^r�zOrcaSetupGUI.editingCanceledKeyFs8��$)�
� �����!�!�#�3�3�5�E�E�F[�\�r_c�&�|j}tjj�}|j	|�}|d}tj
|d�}|j}tj}||vrdtjdg|_ygd�}	||	vry|tj�z}|jr|dvr||dg|_y|j\}
}}|tjz}
|
r |tjz}|||dzg|_y)	ztCalled when a new key event arrives and we are capturing keys.
        (used for key bindings redefinition)
        r�rrF)�Alt_L�Alt_R�	Control_L�	Control_R�Shift_L�Shift_R�Meta_L�Meta_R�Num_Lock�	Caps_Lock�
Shift_Lock��Return�Escaper
T)�hardware_keycoder�Keymap�get_default�get_entries_for_keycode�keyval_namer[rr�r�ORCA_MODIFIER_MASKrYr� accelerator_get_default_mod_mask)r[�keyPressedEvent�keycode�keymap�entries_for_keycode�entries�eventString�
eventState�orcaMods�modifierKeys�stringr#r�isOrcaModifiers              r^�_processKeyCapturedz OrcaSetupGUI._processKeyCapturedNs��"�2�2�����'�'�)��$�<�<�W�E��%�b�)���o�o�g�a�j�1��$�*�*�
��,�,���(�"�!#�[�%C�%C�Q� G�D���@���,�&���#�"F�"F�"H�H�
�� � ��1�1�!,�j�!� <�D���(,�(9�(9�%��	�:�"�[�%C�%C�C����+�8�8�8�J�!,�j�*�q�.� I�D��r_c��
���|j|�}|sy|jsy|j\���
�r�dvry�tjz}�dvrA|s?|j	d�|jtj�g|_d|_ytj�tj�d�
�|_tj��}|j�
�}|�z|z}|jj|�}|�K�
��fd�}	tt!|	|j"j$��}
|
r|
dj&j(}|rQtj*|z}t-d	t.j0z�}t3j4||j
|�ytj6|z}|j	|�|j|�y)
z�Special handler for the key_pressed events when editing the
        keybindings.  This lets us control what gets inserted into the
        entry.
        TFr�)�Delete�	BackSpacerNc���|j�k(xr.|j�k(xr|j�k(xr|jSr�)r r#r!r)�xr�keyNamer#s ���r^�matchz(OrcaSetupGUI.kbKeyPressed.<locals>.match�sE����~�~��0�B�Q�[�[�I�5M�B��
�
��3�B�89�	�	�Br_rr5)r
rYrr��set_textrr�
KB_DELETEDr8r8�defaultModifierMaskr"rr9rIr��filterr5rbrr$�KB_ALREADY_BOUNDr�r�doubleClickTimeoutr�timeout_add�KB_CAPTURED)r[rmr��keyProcessedr	�
modifierNamesr�	newStringr$r�matchesr%�delayrrr#s             @@@r^r�zOrcaSetupGUI.kbKeyPressedws�����/�/��6����� � ��)-�):�):�&���J��'�%9�9��"�[�%C�%C�C���-�-�n����b�!�� � ��!4�!4�5� "�D��"�D�O��%�0�0��1<�1P�1P�1:�15�1;�	=���
$�4�4�Y�?�
��3�3�J�?��!�G�+�.>�>�	��-�-�1�1�)�<����
B��6�%����)C�)C�D�E�G��%�a�j�0�0�<�<����+�+�k�9�C���x�:�:�:�;�E����U�D�$8�$8�#�>��	�&�&��2�C����i�(�� � ��%�r_c
�:�dt_g|_tj�j�j
d�|j|�}
	|j|
|	�}||k7}	|jj}
|jj}|jj}|tjj z}|dt"jj$zzr3|t&j(zr |dt"jj$zz}|j+|
|t-t&j.�|t-t1|��||
|	||t-|�t2|�
t5j6�|r9t8j:|z}|j|
t<�}||j>|<nt8j@}|r |jC|�d|j>|<y#t$rd}Y���wxYw#t$r
d}
d}d}Y��iwxYw)z]The user changed the key for a Keybinding: update the model of
        the treeview.
        Fr�rrr
N)"rr�rYrrxr�r��get_iter_from_stringr�r?r8r r#r!r�ModifierType�
MODIFIER_MASKr�	SHIFTLOCKrr�r�rrr�r�r�stopr�KB_CAPTURED_CONFIRMATIONr�r9�KB_DELETED_CONFIRMATIONr)r[r�r�r�r=�modMask�modUsedr�r!rhr��originalBindingr�r�modsr�messager$s                  r^r�zOrcaSetupGUI.editedKey�s���$)�
� �����!�!�#�3�3�5�E�E�F[�\��/�/��5��	!�'�1�1�&�$�?�O�$�x�/��	��_�_�1�1�F��?�?�,�,�D����4�4�J��c�&�&�4�4�4���1��*�*�4�4�4�5��k�4�4�4��Q�%�,�,�6�6�6�7�D��
�
�f��s�;�#B�#B�C��s�3�t�9�~��6��H�!�3�z�?��X�
	'�	���
���7�7�(�B�G�#�-�-�f�g�>�K�0;�D�#�#�H�-��6�6�G��� � ��)�79�D�#�#�O�4���K�	!� �O�	!���	��F��D��J�	�s%�G5�.AH�5H�H�H�Hc�>�|j�|jd<y)awSignal handler for the "toggled" signal for the
           presentToolTipsCheckButton GtkCheckButton widget.
           The user has [un]checked the 'Present ToolTips'
           checkbox. Set the 'presentToolTips'
           preference to the new value if the user can present tooltips.

        Arguments:
        - widget: the component that generated the signal.
        rVN)r#r,r�s  r^�presentToolTipsCheckedz#OrcaSetupGUI.presentToolTipsChecked�s��-3�,=�,=�,?����(�)r_c�R�|j�r�|j�tjk(r;tj
|jd<tj|jd<ytj|jd<tj|jd<yy)a(Signal handler for the "toggled" signal for the generalDesktopButton,
           or generalLaptopButton GtkRadioButton widgets. The user has
           toggled the keyboard layout value. If this signal was
           generated as the result of a radio button getting selected
           (as opposed to a radio button losing the selection), set the
           'keyboardLayout' preference to the new value. Also set the
           matching list of Orca modifier keys

        Arguments:
        - widget: the component that generated the signal.
        rWr�N)
r#r�r�KEYBOARD_LAYOUT_DESKTOPrr�r,�DESKTOP_MODIFIER_KEYS�GENERAL_KEYBOARD_LAYOUT_LAPTOP�LAPTOP_MODIFIER_KEYSr�s  r^�keyboardLayoutChangedz"OrcaSetupGUI.keyboardLayoutChanged�s����������!�Y�%F�%F�F��<�<����/�0��2�2����1�2��;�;����/�0��1�1����1�2�r_c�X�|jj�}|j�}|j|tdt
d�|j
|�}|jjd�}|jj�|jj||d�y)a�Signal handler for the "clicked" signal for the
        pronunciationAddButton GtkButton widget. The user has clicked
        the Add button on the Pronunciation pane. A new row will be 
        added to the end of the pronunciation dictionary list. Both the
        actual and replacement strings will initially be set to an empty
        string. Focus will be moved to that row.

        Arguments:
        - widget: the component that generated the signal.
        rrTN)
r<rPr
r�r�r��get_pathr��
grab_focus�
set_cursor)r[r�r]rdr�r�s      r^�pronunciationAddButtonClickedz*OrcaSetupGUI.pronunciationAddButtonClickeds����&�&�0�0�2���<�<�>��
�	�	�(�F�B��R�8��~�~�h�'���$�$�/�/��2�����)�)�+����)�)�$��T�:r_c�|�|jj�j�\}}|j|�y)aWSignal handler for the "clicked" signal for the
        pronunciationDeleteButton GtkButton widget. The user has clicked
        the Delete button on the Pronunciation pane. The row in the 
        pronunciation dictionary list with focus will be deleted.

        Arguments:
        - widget: the component that generated the signal.
        N)r<�
get_selection�get_selectedrf)r[r�r]�oldIters    r^� pronunciationDeleteButtonClickedz-OrcaSetupGUI.pronunciationDeleteButtonClickeds1���/�/�=�=�?�L�L�N���w�
���W�r_c���tj�jd�}|j|j|d�|j|j|d�|j
�y)a�Signal handler for the "clicked" signal for the
        textSelectAllButton GtkButton widget. The user has clicked
        the Speak all button.  Check all the text attributes and
        then update the "enabledSpokenTextAttributes" and
        "enabledBrailledTextAttributes" preference strings.

        Arguments:
        - widget: the component that generated the signal.
        rOTN�rrxryrfr2rirw�r[r��
attributess   r^�textSelectAllButtonClickedz'OrcaSetupGUI.textSelectAllButtonClicked)s`��&�0�0�2�=�=�>Q�R�
��%�%��&�&�
�D�	:��'�'��&�&�
�D�	:��!�!�#r_c���tj�jd�}|j|j|d�|j|j|d�|j
�y)a�Signal handler for the "clicked" signal for the
        textUnselectAllButton GtkButton widget. The user has clicked
        the Speak none button. Uncheck all the text attributes and
        then update the "enabledSpokenTextAttributes" and
        "enabledBrailledTextAttributes" preference strings.

        Arguments:
        - widget: the component that generated the signal.
        rOFNr?r@s   r^�textUnselectAllButtonClickedz)OrcaSetupGUI.textUnselectAllButtonClicked;s`��&�0�0�2�=�=�>Q�R�
��%�%��&�&�
�E�	;��'�'��&�&�
�E�	;��!�!�#r_c���tj�jd�}|j|j|d�|j|j|d�tj�jd�}|j|j|d�tj�jd�}|j|j|d�|j
�y)a�Signal handler for the "clicked" signal for the
        textResetButton GtkButton widget. The user has clicked
        the Reset button. Reset all the text attributes to their
        initial state and then update the "enabledSpokenTextAttributes"
        and "enabledBrailledTextAttributes" preference strings.

        Arguments:
        - widget: the component that generated the signal.
        rOFrpTrqNr?r@s   r^�textResetButtonClickedz#OrcaSetupGUI.textResetButtonClickedMs���&�0�0�2�=�=�>Q�R�
��%�%��&�&�
�E�	;��'�'��&�&�
�E�	;�&�0�0�2�=�=�>[�\�
��%�%��&�&�
�D�	:�
�'�'�)�4�4�5T�U�	��'�'��&�&�
�D�	:�	
�!�!�#r_c���|jj�}|j�\}}|D]%}|j|�}|j	|d��'|j�y)a�Signal handler for the "clicked" signal for the
        textMoveToTopButton GtkButton widget. The user has clicked
        the Move to top button. Move the selected rows in the text
        attribute view to the very top of the list and then update
        the "enabledSpokenTextAttributes" and "enabledBrailledTextAttributes"
        preference strings.

        Arguments:
        - widget: the component that generated the signal.
        N)r2r:�get_selected_rowsrU�
move_afterrw�r[r��
textSelectionr]�pathsr�rds       r^�textMoveToTopButtonClickedz'OrcaSetupGUI.textMoveToTopButtonClickedise���2�2�@�@�B�
�&�8�8�:�����	-�D��~�~�d�+�H����X�t�,�	-�	
�!�!�#r_c�.�|jj�}|j�\}}|D]S}|j|�}|j	�}|ds�*|jd|ddz
�}|j
||��U|j�y)a�Signal handler for the "clicked" signal for the
        textMoveUpOneButton GtkButton widget. The user has clicked
        the Move up one button. Move the selected rows in the text
        attribute view up one row in the list and then update the
        "enabledSpokenTextAttributes" and "enabledBrailledTextAttributes"
        preference strings.

        Arguments:
        - widget: the component that generated the signal.
        rNr
)r2r:rHrU�get_indices�iter_nth_child�swaprw)	r[r�rKr]rLr�rd�indicesres	         r^�textMoveUpOneButtonClickedz'OrcaSetupGUI.textMoveUpOneButtonClicked|s����2�2�@�@�B�
�&�8�8�:�����	0�D��~�~�d�+�H��&�&�(�G��q�z�!�0�0��w�q�z�!�|�D�	��
�
�8�Y�/�	0�	
�!�!�#r_c�N�|jj�}|j�\}}|jd�}|D]R}|j	|�}|j�}|d|dz
ks�0|j
|�}	|j||	��T|j�y)a�Signal handler for the "clicked" signal for the
        textMoveDownOneButton GtkButton widget. The user has clicked
        the Move down one button. Move the selected rows in the text
        attribute view down one row in the list and then update the
        "enabledSpokenTextAttributes" and "enabledBrailledTextAttributes"
        preference strings.

        Arguments:
        - widget: the component that generated the signal.
        Nrr
)	r2r:rHrrrUrOr�rQrw)
r[r�rKr]rLrvr�rdrRres
          r^�textMoveDownOneButtonClickedz)OrcaSetupGUI.textMoveDownOneButtonClicked�s����2�2�@�@�B�
�&�8�8�:�����&�&�t�,���	0�D��~�~�d�+�H��&�&�(�G��q�z�F�1�H�$�!�O�O�H�5�	��
�
�8�Y�/�	0�	
�!�!�#r_c���|jj�}|j�\}}|D]%}|j|�}|j	|d��'|j�y)a�Signal handler for the "clicked" signal for the
        textMoveToBottomButton GtkButton widget. The user has clicked
        the Move to bottom button. Move the selected rows in the text
        attribute view to the bottom of the list and then update the
        "enabledSpokenTextAttributes" and "enabledBrailledTextAttributes"
        preference strings.

        Arguments:
        - widget: the component that generated the signal.
        N)r2r:rHrUrXrwrJs       r^�textMoveToBottomButtonClickedz*OrcaSetupGUI.textMoveToBottomButtonClicked�se���2�2�@�@�B�
�&�8�8�:�����	.�D��~�~�d�+�H����h��-�	.�	
�!�!�#r_c�P�|jjjd��y)z�Signal handler for the "clicked" signal for the helpButton
           GtkButton widget. The user has clicked the Help button.

        Arguments:
        - widget: the component that generated the signal.
        �preferences)�pageN)rZ�learnModePresenter�	show_helpr�s  r^�helpButtonClickedzOrcaSetupGUI.helpButtonClicked�s��	
���&�&�0�0�m�0�Dr_c�x�tj�jd�}|jtj
�}|�v|j|tjj<|j|tjj<|j|tjj<yy)zRRestore the settings we saved away when opening the preferences
           dialog.raN)rrxryrIrrzrPrr|r}rQr~rRr)r[rar0s   r^�restoreSettingszOrcaSetupGUI.restoreSettings�s���"�,�,�.�9�9�(�C���z�z�(�"8�"8�9���#�+/�>�>�L������(�48�O�O�L����0�0�1�+/�>�>�L������(�$r_c
��|js|j�|jd�j�}||jd<|j
r#|j
j|jd<|jr'|jj�|jd<|j��tjtj|j�tjtj|j�tj tj|j"�tj$tj|j&�i|jd<yy)Nr�rHr>r0ra)rSr_r�r#r,rIr8rFr*r0rrzrr|rJrMrKr3rLrLrs  r^�saveBasicSettingszOrcaSetupGUI.saveBasicSettings�s���#�#�� � �"����!;�<�G�G�I��)/����~�&��#�#��(�(�1�1�
�N�N�0�1��#�#��(�(�0�0�2�
�N�N�-�.����(��&�&��	�	�$�2C�2C�(D��(�(�$�)�)�D�4G�4G�*H��(�(�$�)�)�D�4G�4G�*H��%�%�t�y�y��1A�1A�'B�	(�D�N�N�8�$�)r_c��d}tjtj|d�|j�|j	|j
�}|j	|j�}||jd<||jd<||jd<tj�j|�|j�tj|j�tj �|j#�|j%�|j'�d}tjtj|d�y)a^Signal handler for the "clicked" signal for the applyButton
           GtkButton widget. The user has clicked the Apply button.
           Write out the users preferences. If GNOME accessibility hadn't
           previously been enabled, warn the user that they will need to
           log out. Shut down any active speech servers that were started.
           Reload the users preferences to get the new speech, braille and
           key echo value to take effect. Do not dismiss the configuration
           window.

        Arguments:
        - widget: the component that generated the signal.
        z(PREFERENCES DIALOG: Apply button clickedTr�r�r�z8PREFERENCES DIALOG: Handling Apply button click completeN)rr�	LEVEL_ALLrar�rVrXr,rrx�setStartingProfiler�r�loadUserSettingsrZr�checkBrailleSettingr�r�r�)r[r�r%r�r�s     r^�applyButtonClickedzOrcaSetupGUI.applyButtonClicked�s��9��
���5�?�?�C��6���� ��,�,�T�-?�-?�@�
��.�.�t�/H�/H�I��$1����y�!�*7�����'�,;����(�)��#�#�%�8�8��I��!�!�#����d�k�k�*��#�#�%������!�!�#����!�H��
���5�?�?�C��6r_c��d}tjtj|d�|j|�|j	d�j�d}tjtj|d�y)a'Signal handler for the "clicked" signal for the cancelButton
           GtkButton widget. The user has clicked the Cancel button.
           Don't write out the preferences. Destroy the configuration window.

        Arguments:
        - widget: the component that generated the signal.
        z)PREFERENCES DIALOG: Cancel button clickedTrrz9PREFERENCES DIALOG: Handling Cancel button click completeN)rrrc�windowClosedr��destroy�r[r�r%s   r^�cancelButtonClickedz OrcaSetupGUI.cancelButtonClicked
s^��:��
���5�?�?�C��6����&�!����)�*�2�2�4�I��
���5�?�?�C��6r_c� �d}tjtj|d�|j|�|j	�|jd�j
�d}tjtj|d�y)aCSignal handler for the "clicked" signal for the okButton
           GtkButton widget. The user has clicked the OK button.
           Write out the users preferences. If GNOME accessibility hadn't
           previously been enabled, warn the user that they will need to
           log out. Shut down any active speech servers that were started.
           Reload the users preferences to get the new speech, braille and
           key echo value to take effect. Hide the configuration window.

        Arguments:
        - widget: the component that generated the signal.
        z%PREFERENCES DIALOG: OK button clickedTrrz5PREFERENCES DIALOG: Handling OK button click completeN)rrrcrgr�r�rjrks   r^�okButtonClickedzOrcaSetupGUI.okButtonClicked 
sj��6��
���5�?�?�C��6�����'��"�"�$����)�*�2�2�4�E��
���5�?�?�C��6r_c�8�d}tjtj|d�|j�tj
slt
j�jd�}|r|j|�t
j�jd�}|r|j|�|j�|j�tjd|j�d}tjtj|d�y)a!Signal handler for the "closed" signal for the orcaSetupWindow
           GtkWindow widget. This is effectively the same as pressing the
           cancel button, except the window is destroyed for us.

        Arguments:
        - widget: the component that generated the signal.
        z*PREFERENCES DIALOG: Window is being closedTr>r0r5z+PREFERENCES DIALOG: Window closure completeN)rrrc�
suspendEventsrr�rrxryr<r-r�r_rr�resumeEvents)r[r�r%rCr,s     r^rizOrcaSetupGUI.windowClosed7
s���;��
���5�?�?�C��6������,�,�&�1�1�3�>�>�?T�U�G���,�,�W�5�%�0�0�2�=�=�>P�Q�F���,�,�V�4��"�"�$��������D�$�"3�"3�4�;��
���5�?�?�C��6r_c��d}tjtj|d�|jj	d�|j
j	d�|jj	d�|jjd�|j
jd�|jjd�|jj�|j
j�|jj�dt_
d}tjtj|d�y)aeSignal handler for the "destroyed" signal for the orcaSetupWindow
           GtkWindow widget. Reset orca_state.orcaOS to None, so that the 
           GUI can be rebuilt from the GtkBuilder file the next time the user
           wants to display the configuration GUI.

        Arguments:
        - widget: the component that generated the signal.
        z-PREFERENCES DIALOG: Window is being destroyedTNFz/PREFERENCES DIALOG: Window destruction complete)rrrcr7rr2r<rDrEr�orcaOSrks   r^�windowDestroyedzOrcaSetupGUI.windowDestroyedV
s���>��
���5�?�?�C��6����"�"�4�(��"�"�,�,�T�2����(�(��.����,�,�U�3��"�"�6�6�u�=����2�2�5�9��������"�"�'�'�)����#�#�%� �
��?��
���5�?�?�C��6r_c��d}tjtj|d�tj�}|jd�|jd�|jd�|jd�y)Nz1PREFERENCES DIALOG: Re-registering floody events.T�object:state-changed:showing�object:children-changed:remove�object:selection-changed�&object:property-change:accessible-name)rrrcr
rx�registerListener�r[r%�managers   r^rqzOrcaSetupGUI.resumeEventsq
sg��A��
���5�?�?�C��6��*�*�,��� � �!?�@�� � �!A�B�� � �!;�<�� � �!I�Jr_c��d}tjtj|d�tj�}|jd�|jd�|jd�|jd�y)Nz0PREFERENCES DIALOG: Deregistering floody events.Trvrwrxry)rrrcr
rx�deregisterListenerr{s   r^rpzOrcaSetupGUI.suspendEvents{
sg��@��
���5�?�?�C��6��*�*�,���"�"�#A�B��"�"�#C�D��"�"�#=�>��"�"�#K�Lr_c�.�tj|�y)z$Show profile Dialog to add a new oneN)r�
showProfileUIr�s  r^�showProfileGUIzOrcaSetupGUI.showProfileGUI�
s��	�&�&�t�,r_c���	�|sy|jdd�j�}||g�	d�	�fd�	}�j�D�cgc]}|d��	}}t|t�r#|dk7r||vr|�j
dk7r|�y|��5tjdtj|��d�z}tjdtjjtjjtj j"�	�}|j%dtj&�d��|j)|�|j+tj,�|j/�}|tj0j2k(r|j5�|d
�y|j5�yycc}w)z~Creates a new profile based on the name profileToSaveLabel and
        updates the Preferences dialog combo boxes accordingly.N� �_c����|r6�jj��}�jj|���jd<��jd<�j��j
�y)Nr�r�)rWr
rVr�r,rar�)�
newProfiler�r�r[s  ��r^�saveActiveProfilez3OrcaSetupGUI.saveProfile.<locals>.saveActiveProfile�
sf����$(�$;�$;�$B�$B�7�$K�!��"�"�2�2�3D�E�(/�D�N�N�9�%�.5�D�N�N�?�+��"�"�$��%�%�'r_r
r�<b>�</b>��type�buttonsF�T)�replace�lowerr�r�rr-r�PROFILE_CONFLICT_MESSAGEr�markup_escape_textr�
MessageDialog�DialogFlags�MODAL�MessageType�INFO�ButtonsType�YES_NO�
set_markup�PROFILE_CONFLICT_LABEL�format_secondary_markupr��PROFILE_CONFLICT_TITLE�run�ResponseType�YESrj)
r[�profileToSaveLabel�
profileToSaver��pr�r+�dialog�responser�s
`        @r^�saveProfilezOrcaSetupGUI.saveProfile�
s}���"��*�2�2�3��<�B�B�D�
�%�}�5��	(�,0�+F�+F�+H�I�a�Q�q�T�I��I��m�S�)�!�R�'�!�):�:�!�T�%9�%9�!�%<�<����(�#�<�<��$�1�1�2D�E�F�d�K�L���*�*�4����-�-� �_�_�1�1� #��� 6� 6�8���!�!�C�	�(H�(H�'I��"N�O��.�.�w�7�� � ��!A�!A�B�!�:�:�<���s�/�/�3�3�3��N�N�$�%�e�,��N�N�$�)��Js�F=c�b�|j|j�}tjdt	j
|d��d�z}t
j|jtjjtjjtjj��}|jdtj �d��|j#|�|j%�tj&j(k(�r|j*j-d�}|r||k(r+|j.}|j0D]}|dd}||k7s�|}n|j*j-d�}|r||k(r|}t3j4�j7|d�|j9|�|j*j-d�}	|	r|	|k(rB||j*d<t3j4�j;|�|j=�|j?�y)	z�Remove profile button clicked handler

        If we removed the last profile, a default one will automatically get
        added back by the settings manager.
        r�rr�r�r�Nr�r
) r�rVr�PROFILE_REMOVE_MESSAGErr�rr�rNr�r�r�r�r�r�r��PROFILE_REMOVE_LABELr�r�r�r�r,rIr-rWrrx�
removeProfile�loadProfilerdr�rj)
r[r��
oldProfiler+r��newStartingProfiler�
rowProfiler�r�s
          r^�removeProfileButtonClickedz'OrcaSetupGUI.removeProfileButtonClicked�
s����)�)�$�*<�*<�=�
��2�2��$�)�)�*�Q�-�8�9��>�?���"�"�4�;�;����0E�0E�(+���(<�(<�+.�?�?�+A�+A�C��	���C�	� >� >�?�t�D�E��&�&�w�/��:�:�<�3�+�+�/�/�/�"&���!3�!3�4E�!F��%�);�z�)I�%)�%9�%9�"��2�2��C�!$�Q��J�!�Z�/�-7�*��	����+�+�O�<�J���z�!9�/�
��'�'�)�7�7�
�1�
�F����Z�(�#�n�n�0�0�1B�C�O�"�o��&C�4F����0�1� �+�+�-�@�@�AS�T��)�)�+����r_c� �|jrytjdtjjtj
jtjj��}|jdtj�d��|jtj�|j�}|tjj k(r!|j#�|j%�y|j#�y)z#Load profile button clicked handlerNr�r�r�)rSrr�r�r�r�r�r�r�r�r�PROFILE_LOAD_LABELr��PROFILE_LOAD_MESSAGEr�r�r�rj�loadSelectedProfile)r[r�r�r�s    r^�loadProfileButtonClickedz%OrcaSetupGUI.loadProfileButtonClicked�
s��������"�"�4����%�%��_�_�)�)����.�.�0��
	���C�	� <� <�=�T�B�C��&�&�y�'E�'E�F��:�:�<���s�'�'�+�+�+��N�N���$�$�&��N�N�r_c�\�|j|j�}|j|�y)zLoad selected profileN)r�rVr�)r[r�s  r^r�z OrcaSetupGUI.loadSelectedProfile�
s(���,�,�T�-?�-?�@�
�����'r_c��|j�||jd<tj�j	|d�tj�j|d�|_t
jd��|j�tj�|j�|j�|j�y)zLoad profiler�r
T)�skipReloadMessageN)rar,rrx�
setProfile�getGeneralSettingsrrer�rrfr�r�r�)r[r�s  r^r�zOrcaSetupGUI.loadProfile�
s���	
��� �*1�����'��#�#�%�0�0����<�)�4�4�6�I�I�'�RS�*�U�������5������#�#�%������!�!�#����!r_r�)F)r)NFr�)|r8�
__module__�__qualname__r+r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rr(r-r4r<rFr�rfrirmrwr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r"r�r�r�r�r�r�r�rrrrr*r0r@r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r
r�r�r-r3r8r=rBrDrFrMrSrUrWr]r_rargrlrnrirtrqrpr�r�r�r�r�r�r�r_r^r&r&_s���9�vM�^�,
7�(�T�$(�<
H�
(�F�
(�
H�
(�;�:B4�H3D�j�@G6�R#�J!M�F!#�F/,�b0(�f38�%�N�:
K�J�>J�
E�
D�

$�
$�$�"�fG�P.�3�^�
�JE�XwB�rB�,A�H�
"��,)��"�%�N�6�"
�� �$ � -�`.3��>5�6x%�t*�
C�H�#�$�@#�J@�>6� C�"C�"C�":�$
 �4�84�84�63�4F�2�,
L�K�"*8�X9�45�(P�N�5�"5�(���'�R6�p1�f@�2�2;�(�$�$$�$$�8$�&$�,$�.$�&E�:��."7�H7�$7�.7�>7�6K�M�-�
)%�X-�^�((�"r_r&)Z�__doc__�__id__�__version__�__date__�
__copyright__�__license__�gi�require_version�
gi.repositoryrr�rrrrr	rwrrrr
rrrrrrrrrrrrrrrr�	ax_objectrr��ImportError�
orca_platformrr�rSr�r�r�r�r�r�r�r�r�r�r�rVrhrWr�r�r�r�r�r�r�r�r�r�r�r�r�rzr{r|r}r~rr�r�r�r�r�r�r�r�r�r�r*r&r�r_r^�<module>r�s���(;�������?�
���	�����7�E�"��	����!����������������� ����"����%����E� ��b�	�?���'�9�i��|�X���x�(,�U�1�X��%��y�+�u��U�1�X�����+/�u�Q�x�.�'��)�Y��"&�e�A�h����&�(:�<N�� 1��>B�%��)�_�;��+�-C��1�3J��)�+?��+�-G��8��9�s6"�?�4�4�s6"��A���E��s�	E4�4E>�=E>

Zerion Mini Shell 1.0