%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/share/ibus-table/setup/__pycache__/
Upload File :
Create Path :
Current File : //usr/share/ibus-table/setup/__pycache__/main.cpython-312.pyc

�

��Xe�,�
���dZddlmZddlmZddlmZddlmZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZddlZddlZddlmZedd	�dd
lmZedd	�ddlmZej.d
�ej0d�edd�ddlmZedd�ddlmZedd�ddlmZedd�ddlmZddlmZmZm Z!dZ"	ddl#Z#dZ"ejJddzgejJze_%ddl&Z&ddl'Z'ddl(Z(ejRd�Z*ejV�ejX�ejZ�fZ.ej^d��Z0e0jcd d!d"e2d#d$d%�&�e0jcd'd(d)dd*�+�e0jg�Z4ed,�ed-�ed.�gZ5Gd/�d0ejl�Z7Gd1�d2ejl�Z8e9d3k(�r/e4jtrejv�Z<n�ejJj{e'j|�d4�Z?ej�j�e?d5d6d7d8ddd�9�ZBej�d:�ZDeBj�eD�e*j�ej��e*j�eB�e*j�d;�e
je
j�e
j��	ej�ej�d$�e!�ej����ej�ej�j�ej�j�ej�j�ed>��?�ZXeXj��eXj��ej�d@�e4j�Z]e]sdAej�vrej�dAZ]ej�dBd$e]�j�dCdD�Z]e]se0j��e7e]�E�Zbej��yy#e$f$rdZ"Y��HwxYw#ej�$r2e*j�d<�ej�ej�d=�Y��nwxYw)Fz 
The setup tool for ibus-table.
�)�Union)�Any)�Dict)�ListN)�require_version�Gioz2.0)r�GLib)r	zIBus Table Preferenceszibus-setup-table�Gdkz3.0)r
�Gtk)r�Pangoz1.0)r�IBus)r
)�N_�_�initFTz
/../enginez
ibus-tablezibus-table setup tool)�descriptionz-nz
--engine-name�store�engine_name�u"Set the name of the engine, for example “table:cangjie3” or just “cangjie3”. Default: "%(default)s". If this option is not used, the value of the environment variable IBUS_ENGINE_NAME is tried instead. If the variable IBUS_ENGINE_NAME is also not set or empty, this help is printed.)�action�type�dest�default�helpz-qz
--no-debug�
store_truezODo not write log file ~/.cache/ibus-table/setup-debug.log, default: %(default)s)rrrz
Initial statezDirect inputzTable inputc�	�eZdZdZdhdeddfd�Zdid�Zeejjfdedejddfd	��Zdedejfd
�Z
defd�Zededdfd
��Zededdfd��Zedej&ddfd��Zdej,deddfd�Zedej&ddfd��Zdej&ddfd�Zdej4deddfd�Zdej4deddfd�Zdej:ddfd�Zdej>ddfd�Z dej>ddfd�Z!dej>ddfd�Z"dej>ddfd�Z#dejHddfd �Z%dej>ddfd!�Z&dej>ddfd"�Z'dejHddfd#�Z(dej>ddfd$�Z)dej>ddfd%�Z*dej>ddfd&�Z+dej>ddfd'�Z,dejHddfd(�Z-dejHddfd)�Z.dejHddfd*�Z/dej&ddfd+�Z0dejHddfd,�Z1dej&ddfd-�Z2dej:ddfd.�Z3d/ejhd0ejjd1ejlddfd2�Z7d3ejpddfd4�Z9d5ejtd6ejvddfd7�Z<dej&ddfd8�Z=dej&ddfd9�Z>dej&ddfd:�Z?dej&ddfd;�Z@dej&ddfd<�ZAdid=�ZBdid>�ZCdej&ddfd?�ZDdej&ddfd@�ZEdej&ddfdA�ZF	djdBedCeddfdD�ZG	djdEedCeddfdF�ZH	djdGeIdCeddfdH�ZJ	djdIeIdCeddfdJ�ZK		dkdKeIdCeddfdL�ZL		dldMedCeddfdN�ZM		dmdOeIdCeddfdP�ZN		dndQedCeddfdR�ZO		dndQedCeddfdS�ZP		dndQedCeddfdT�ZQ		dmdQeIdCeddfdU�ZR		dndQedCeddfdV�ZS		dndQedCeddfdW�ZT		dndQedCeddfdX�ZU		dndQedCeddfdY�ZV		dndQedCeddfdZ�ZW		dndQedCeddfd[�ZX		dnd\edCeddfd]�ZY	djd^edCeddfd_�ZZ	djd`edCeddfda�Z[	djdbe\eefdCeddfdc�Z]	djddeIdCeddfde�Z^	djdfe\e_ee`efefdCeddfdg�Zay)o�SetupUIz*
    User interface of the setup tool
    r�returnNc�z�||_tjj|d|jzdzt	d�z��tjjtjjtj�dd��|jd�|jd�tj�}|jd	�tjj!t"j$j'�|tj(�tjjtjjtj�d
�|jdz�}tjj+|�s+t,j/d|�t1j2d
�tjj5|�j7dd�}t9j:||d��|_d|_d|_|j8j@jCd�}|rl|jEd�}|D]V}|jG�jId�rd|_dD])}|jG�jI|�s�#d|_�+�Xd|_%|j8j@jCd�}	|	r|	jM�dk(|_%|j8j@jCd�|_'tQjRdd|jz��|_*|jW�|jYd|jzdzt	d�z�|j[d|j\�|j[d|j^�tj`�|_1|jbjetjfjh�|jbjkd�|jm|jb�tjn�|_8|jpjsd�|jpjud�|jpjwd�|jpjyd�|jpj{d�|jbj}|jpddd�tj`�|_?|j~jetjfj��|j~jsd�|j~jud�|j~jyd�|j~j{d�|jbj�|j~ddd�tj�t	d���|_C|j�jyd�|j�j[d |j��|j~jm|j��tj��|_E|j�jyd�tj��|_G|j�j�t	d!��|j�jm|j��|j�j[d |j��|j~jm|j��tj��|_J|j�jyd�tj��|_K|j�j�t	d"��|j�jm|j��|j�j[d |j��|j~jm|j��d#}
d#}d#}tj��|_O|j�jsd�|j�jud�|j�j�|
�|j�j�|�|j�j�|�|j�j�d�|j�j�d�|j�jyd�|j�j{d�tj��|_U|j�j�t	d$��tj��|_V|j�jsd�|j�jud�|j�j�|
�|j�j�|�|j�j�|�|j�j�d�|j�j�d�|j�jyd�|j�j{d�tj��|_W|j�j�t	d%��tj`�|_X|j�jetjfjh�|j�jkd�d#}
|j�j�|
�|j�j�|
�|j�j�|
�|j�j�|
�tj��|_]|j�j�t	d&��|jpj�|j�|j��|jpj�|j�|j��|jpj�|j�|j��d'}tj��|__|j�j�t	d(��|j�j�t	d)��|j�j�d�tj��|_ctj�t�t��|_g|j�j�t	d*�dg�|j�j�t	d+�dg�|j�j�|j��tj��}|j�j}|d�|j�j�|d,d�t�|j��D]9\}}|j�d-d.|d
k(s�|j�j�|��;|j�j[d/|j��|d
z
}|j�j�|j�d|d
d
�|j�j�|j�d
|d
d
�tj��|_q|j�j�t	d0��|j�j�t	d1��|j�j�d�tj��|_rtj�t�t��|_t|j�j�t	d2�dg�|j�j�t	d3�d
g�|j�j�t	d4�d5g�|j�j�t	d6�d7g�|j�j�t	d8�d9g�|j�j�|j��tj��}|j�j}|d�|j�j�|d,d�t�|j��D]9\}}|j�d:d.|d
k(s�|j�j�|��;|j�j[d/|j��|j<rW|d
z
}|j�j�|j�d|d
d
�|j�j�|j�d
|d
d
�tj��|_v|j�j�t	d;��|j�j�t	d<��|j�j�d�tj��|_wtj�t�t��|_x|j�j�t	d=�dg�|j�j�t	d>�dg�|j�j�|j��tj��}|j�j}|d�|j�j�|d,d�t�|j��D]9\}}|j�d?d.|d
k(s�|j�j�|��;|j�j[d/|j��|j>rW|d
z
}|j�j�|j�d|d
d
�|j�j�|j�d
|d
d
�tj��|_z|j�j�t	d@��|j�j�t	dA��|j�j�d�tj��|_{tj�t�t��|_||j�j�t	d=�dg�|j�j�t	d>�dg�|j�j�|j��tj��}|j�j}|d�|j�j�|d,d�t�|j��D]9\}}|j�dBd.|d
k(s�|j�j�|��;|j�j[d/|j��|j>rW|d
z
}|j�j�|j�d|d
d
�|j�j�|j�d
|d
d
�tj��|_~|j�j�t	dC��|j�j�t	dD��|j�j�d�tj��|_tj�t�t��|_�|�jj�t	d=�dg�|�jj�t	d>�dg�|j�j�|�j�tj��}|j�j}|d�|j�j�|d,d�t�|�j�D]9\}}|j�dEd.|d
k(s�|j�j�|��;|j�j[d/|�j�|j>rW|d
z
}|j�j�|j�d|d
d
�|j�j�|j�d
|d
d
�tj��|_�|�jj�t	dF��|�jj�t	dG��|�jj�d�tj��|_�tj�t�t��|_�|�jj�t	d=�dg�|�jj�t	d>�dg�|�jj�|�j�tj��}|�jj}|d�|�jj�|d,d�t�|�j�D]:\}}|j�dHd.|d
k(s�|�jj�|��<|�jj[d/|�j
�|j>rY|d
z
}|j�j�|�jd|d
d
�|j�j�|�jd
|d
d
�tj��|_�|�jj�dIt	dJ�zdKz�|�j�jd�|�jj�d�|d
z
}|j�j�|�jd|d5d
�t�jt	dL���|_�|�jj�t	dM��|�jjyd�|�jj{d�|�jj�|j�dNd.�|�jj[d |�j�|d
z
}|j�j�|�jd|d5d
�tj��|_�|�jj�t	dO��|�jj�t	dP��|�jj�d�tj��|_�tj�t�t��|_�|�jj�t	dQ�t��tjfj��g�|�jj�t	dR�t��tjfjh�g�|�jj�t	dS�t��tjf�j�g�|�jj�|�j�tj��}|�jj}|d�|�jj�|d,d�t�|�j�D]:\}}|j�dTd.|d
k(s�|�jj�|��<|�jj[d/|�j �|d
z
}|j�j�|�jd|d
d
�|j�j�|�jd
|d
d
�tj��|_�|�j"j�t	dU��|�j"j�t	dV��|�j"j�d�t�j$�|_�|�j&jsd�|�j&jud�|�j&�j)dWdW�|�j&�j+dWdX�|�j&�j-|j�dYd.�|�j&j[dZ|�j.�|d
z
}|j�j�|�j"d|d
d
�|j�j�|�j&d
|d
d
�tj��|_]|j�j�dIt	d[�zdKz�|j��jd�|j�j�|
�|j�j�|
�|j�j�|
�|j�j�|
�|j�jyd�|j�j{d�|j�j�d�t�j0�|_�|�j2jud�|�j2jyd�|�j2j{d�t�j4�|_�tj�t�t��|_�|�j6j�|�j8�|j�d\d.}�t;|�D]-}|�j8j�|�t=||�f��/t�j>t	d]�tj��d�^�}|�jAd�|�j6�jC|�t�j>t	d&�tj��d
�^�}|�jAd
�|�j6�jC|�|�j6�jE�j[d/|�jF�|�j6j[d_|�jH�|�j2jm|�j6�|j�j}|j�ddd�|j�j}|�j2ddd�tj`�|_�|�jJjetjfj��|�jJjud�|j�jm|�jJ�tj��|_�tj��|_�|�jNj�t	d`��|�jLjm|�jN�|�jLj�t	da��|�jL�jQd�|�jLj[d |�jR�tj��|_�tj��|_�|�jVj�t	db��|�jTjm|�jV�|�jTj�t	dc��|�jT�jQd�|�jTj[d |�jX�tj��|_�tj��|_�|�j\j�t	dd��|�jZjm|�j\�|�jZj�t	de��|�jZ�jQd�|�jZj[d |�j^�|�jJjm|�jL�|�jJjm|�jT�|�jJjm|�jZ�df|_�df|_�d'|_�d|_�d|_�d|_�d|_�d|_�d|_�d|_�d|_�d'}t�jt	dg���|_�|�jvj�t	dh��|�jvjyd�|�jvj{d�|�jvj�|j�did.�|�jvj[d |�jx�tj��|_�t�j|�|_�tj��|_�|�j�j�t	dj��|�j��jd�|�j��j�dk�|�j��j�d�|�j��j��t��j��j��|�j~j}|�j�ddd�|�jzjm|�j~�|�jzj[d |�j��|d
z
}|j�j�|�jvd|d
d
�|j�j�|�jzd
|d
d
�tj��|_�|�j�j�t	dl��|�j�j�t	dm��|�j�j�d�tj��|_�tj�t�t��|_�|�j�j�t	dn�dg�|�j�j�t	do�dg�|�j�j�|�j��tj��}|�j�j}|d�|�j�j�|d,d�t�|�j��D]:\}}|j�dpd.|d
k(s�|�j�j�|��<|�j�j[d/|�j��|j>rY|d
z
}|j�j�|�j�d|d
d
�|j�j�|�j�d
|d
d
�t�jt	dq���|_�|�j�j�t	dr��|�j�jyd�|�j�j{d�|�j�j�|j�dsd.�|�j�j[d |�j��|d
z
}|j�j�|�j�d|d5d
�tj��|_�|�j�j�t	dt��|�j�j�t	du��|�j�j�d�tj��|_�tj�t�t��|_�|�j�j�t	dv�dg�|�j�j�t	dw�dg�|�j�j�|�j��tj��}|�j�j}|d�|�j�j�|d,d�t�|�j��D]:\}}|j�dxd.|d
k(s�|�j�j�|��<|�j�j[d/|�j��|jJre|jNrY|d
z
}|j�j�|�j�d|d
d
�|j�j�|�j�d
|d
d
�tj��|_�|�j�j�t	dy��|�j�j�t	dz��|�j�j�d�tj��|_�tj�t�t��|_�|�j�j�t	d{�dg�|�j�j�t	d|�d
g�|�j�j�|�j��tj��}|�j�j}|d�|�j�j�|d,d�t�|�j��D]:\}}|j�d}d.|d
k(s�|�j�j�|��<|�j�j[d/|�j��|d
z
}|j�j�|�j�d|d
d
�|j�j�|�j�d
|d
d
�t�jt	d~���|_�|�j�j�t	d��|�j�jyd�|�j�j{d�|�j�j�|j�d�d.�|�j�j[d |�j��|d
z
}|j�j�|�j�d|d5d
�tj��|_�|�j�j�t	d���|�j�j�t	d���|�j�j�d�t�j��|_�|�j��j�d
�|�j�j�|j�d�d.�|�j�j[d�|�j��|d
z
}|j�j�|�j�d|d
d
�|j�j�|�j�d
|d
d
�tj��|_�|�j�j�t	d���|�j�j�t	d���|�j�j�d�t�j��|_�|�j��j�d
�|�j�j�|j�d�d.�|�j�j[d�|�j��|d
z
}|j�j�|�j�d|d
d
�|j�j�|�j�d
|d
d
�t�jt	d����|_�|�j�j�t	d���|�j�jyd�|�j�j{d�|�j�j�|j�d�d.�|�j�j[d |�j��|d
z
}|j�j�|�j�d|d5d
�t�jt	d����|_�|�j�j�t	d���|�j�jyd�|�j�j{d�|�j�j�|j�d�d.�|�j�j[d |�j��tj��|_�t�j|�|_�tj��|_�|�j�j�|j�d�d.�|�j��jd�|�j��j�dk�|�j��j�d�|�j��j��t��j��j��|�j�j}|�j�ddd�|�j�jm|�j��|�j�j[d |�j��|d
z
}|j�j�|�j�d|d
d
�|j�j�|�j�d
|d
d
�tj��|_�|�j�j�t	d���|�j�j�t	d���|�j�j�d�t�j$�|_�|�j�jsd�|�j�jud�|�j��j)dWdW�|�j��j+d�d��|�j��j-|j�d�d.�|�j�j[dZ|�j��|d
z
}|j�j�|�j�d|d
d
�|j�j�|�j�d
|d
d
�|�j��|jp�j�d�|jTj[d/|�j��y)�Nu码 IBus Table � �Preferences��title�iconszibus-table.svg�IBusTablePreferencesTs�
            #IBusTablePreferences {
            }
            row { /* This is for listbox rows */
                border-style: groove;
                border-width: 0.05px;
            }
            �tablesz.dbzCannot open database %s�z-user.dbF)�filename�user_db�create_database�	languages�,�zh)r,�ja�ko�user_can_define_phrase�true�rulesz!org.freedesktop.ibus.engine.tablez&/org/freedesktop/ibus/engine/table/%s/)�schema�pathz
destroy-eventzdelete-eventr�About)�label�clickedzRestore all defaults�_Close�
�Settings�DetailszKey bindings���zRemember input modeu�Whether the last used input mode should be remembered or whether ibus-table should start in “Table mode” by default after a restart. There are two input modes: “Table input” means the input method is on. “Direct input” is almost the same as if the input method were off, i.e. not used at all, most characters just get passed to the application. But some conversion between fullwidth and halfwidth may still happen in direct input mode.�No�Yes�text�rememberinputmode�user�changedz
Chinese mode:u“Simplified Chinese” shows only characters 
used in simplified Chinese. “Traditional Chinese”
shows only characters used in traditional Chinese.
“Simplified Chinese before traditional” shows all
characters but puts the simplified characters higher
up in the candidate list. “Traditional Chinese before
simplified” puts the traditional characters higher up
in the candidate list. “All characters” just shows all
matches without any particular filtering on traditional
versus simplified Chinese.zSimplified ChinesezTraditional Chinesez%Simplified Chinese before traditional�z%Traditional Chinese before simplified�zAll Chinese characters��chinesemodezTable input letter width:zBWhether to use fullwidth or halfwidth
letters in table input mode.�Half�Full�tabdeffullwidthletterzTable input punctuation width:zFWhether to use fullwidth or halfwidth
punctuation in table input mode.�tabdeffullwidthpunctzDirect input letter width:zCWhether to use fullwidth or halfwidth
letters in direct input mode.�endeffullwidthletterzDirect input punctuation width:zGWhether to use fullwidth or halfwidth
punctuation in direct input mode.�endeffullwidthpunctz<b>zCandidate listz</b>zShow candidate listu�Whether candidate lists should be shown or hidden.
For Chinese input methods one usually wants the
candidate lists to be shown. But for some non-Chinese
input methods like the Russian “translit”, hiding the
candidate lists is better.�alwaysshowlookupzOrientation:zQWhether the lookup table showing the candidates
should be vertical or horizontal.�
Horizontal�VerticalzSystem default�lookuptableorientationz
Page size:z�The maximum number of candidates in
one page of the lookup table. You can switch
pages in the lookup table using the page up/down
keys or the arrow up/down keys.g�?g$@�lookuptablepagesizez
value-changedzCurrent key bindings:�keybindings�Command)r>z
row-activated�Editz.Edit the key bindings for the selected command�Set to default�1Set default key bindings for the selected commandzSet all to defaultz)Set default key bindings for all commandsrzDynamic adjustzHere you can choose whether the order of the candidates is dynamically adjusted according to how often the candidates are used.�
dynamicadjustzDelete all learned data�(zCompose:u�If this is set to “single char”, only single
character candidates will be shown. If it is
set to “Phrase” candidates consisting of
several characters may be shown.�PhrasezSingle Char�onecharzAuto selectu�If set to “Yes”, this does the following 4 things:
1) When typing “Return”, commit the 
   candidate + line-feed
2) When typing Tab, commit the candidate
3) When committing using a commit key, commit
   the candidate + " "
4) If typing the next character matches no candidates,
   commit the first candidate of the previous match.
   (Mostly needed for non-Chinese input methods like
   the Russian “translit”)�
autoselectzAuto commit mode:u�Committing with the commit keys or with the mouse
always commits to the application. This option is about
“automatic” commits which may happen when
one just continues typing input without committing
manually. From time to time, “automatic” commits will
happen then.
“Direct” means such “automatic” commits go directly
into the application, “Normal” means they get committed
to preedit.�Normal�Direct�
autocommitz%Action when typing invalid character:uDetermines what happens when a character which is not in the set of valid input characters for this table is typed: With “commit current candidate”, the currently selected candidate is inserted. With “commit typed keys”, the raw characters typed so far during the candidate selection process will be inserted instead. In all cases, the candidate selection ends when an invalid character is typed and the character in question is inserted immediately after the text that results from the options listed above.zCommit current candidatezCommit typed keys�commitinvalidmodez
Auto wildcardzWIf yes, a multi wildcard will be automatically
appended to the end of the input string.�autowildcardzSingle wildcard character:zhThe wildcard to match any single character.
Type RETURN or ENTER to confirm after changing the wildcard.�singlewildcardcharznotify::textzMulti wildcard character:zqThe wildcard used to match any number of characters.
Type RETURN or ENTER to confirm after changing the wildcard.�multiwildcardcharzUse dark themez7If yes, the color scheme for a dark theme will be used.�	darkthemezPlay sound file on errorz�Here you can choose whether a sound file is played if an error occurs. If the simpleaudio module for Python3 is not installed, this option does nothing.�
errorsound�errorsoundfilezDebug level:zzWhen greater than 0, debug information may be printed to the log file and debug information may also be shown graphically.gg�o@�
debuglevel)��_engine_namer�Window�__init__r�set_default_icon_from_file�osr3�join�ibus_table_location�data�set_name�	set_modal�CssProvider�load_from_data�StyleContext�add_provider_for_screenr
�Screen�get_default�#STYLE_PROVIDER_PRIORITY_APPLICATION�exists�LOGGER�error�sys�exit�basename�replace�tabsqlitedb�TabSqliteDb�_SetupUI__is_chinese�_SetupUI__is_cjk�ime_properties�get�split�strip�
startswith� _SetupUI__user_can_define_phrase�lower�_SetupUI__rulesrr9�
_gsettings�_fill_settings_dict�	set_title�connect�_on_destroy_event�_on_delete_event�Box�_main_container�set_orientation�Orientation�VERTICAL�set_spacing�add�Notebook�	_notebook�set_visible�
set_can_focus�set_scrollable�set_hexpand�set_vexpand�
pack_start�_dialog_action_area�
HORIZONTAL�pack_end�Button�
_about_button�_on_about_button_clicked�_restore_all_defaults_button�Label�"_restore_all_defaults_button_label�set_text�'_on_restore_all_defaults_button_clicked�
_close_button�_close_button_label�set_text_with_mnemonic�_on_close_clicked�Grid�
_options_grid�set_border_width�set_row_spacing�set_column_spacing�set_row_homogeneous�set_column_homogeneous�_options_label�_options_details_grid�_options_details_label�_keybindings_vbox�set_margin_start�set_margin_end�set_margin_top�set_margin_bottom�_keybindings_label�append_page�_remember_input_mode_label�set_tooltip_text�
set_xalign�ComboBox�_remember_input_mode_combobox�	ListStore�str�bool�_remember_input_mode_store�append�	set_model�CellRendererText�
add_attribute�	enumerate�_settings_dict�
set_active�(_on_remember_input_mode_combobox_changed�attach�_chinese_mode_label�_chinese_mode_combobox�int�_chinese_mode_store�!_on_chinese_mode_combobox_changed�#_table_full_width_letter_mode_label�&_table_full_width_letter_mode_combobox�#_table_full_width_letter_mode_store�1_on_table_full_width_letter_mode_combobox_changed�"_table_full_width_punct_mode_label�%_table_full_width_punct_mode_combobox�"_table_full_width_punct_mode_store�0_on_table_full_width_punct_mode_combobox_changed�$_direct_full_width_letter_mode_label�'_direct_full_width_letter_mode_combobox�$_direct_full_width_letter_mode_store�2_on_direct_full_width_letter_mode_combobox_changed�#_direct_full_width_punct_mode_label�&_direct_full_width_punct_mode_combobox�#_direct_full_width_punct_mode_store�1_on_direct_full_width_punct_mode_combobox_changed�%_candidate_list_section_heading_label�set_use_markup�CheckButton�_always_show_lookup_checkbutton�"_on_always_show_lookup_checkbutton�_lookup_table_orientation_label�"_lookup_table_orientation_combobox�_lookup_table_orientation_storer
�SYSTEM�-_on_lookup_table_orientation_combobox_changed�_page_size_label�
SpinButton�_page_size_adjustment�set_increments�	set_range�	set_value�&_on_page_size_adjustment_value_changed�ScrolledWindow�_keybindings_treeview_scroll�TreeView�_keybindings_treeview�_keybindings_treeview_model�sorted�repr�TreeViewColumn�set_sort_column_id�
append_column�
get_selection�%_on_keybindings_treeview_row_selected�&_on_keybindings_treeview_row_activated�_keybindings_action_area�_keybindings_edit_button�_keybindings_edit_button_label�
set_sensitive�#_on_keybindings_edit_button_clicked�_keybindings_default_button�!_keybindings_default_button_label�&_on_keybindings_default_button_clicked�_keybindings_all_default_button�%_keybindings_all_default_button_label�*_on_keybindings_all_default_button_clicked�_keybindings_selected_command�-_keybindings_edit_popover_selected_keybinding�3_keybindings_edit_popover_selected_keybinding_index�!_keybindings_edit_popover_listbox�_keybindings_edit_popover� _keybindings_edit_popover_scroll�$_keybindings_edit_popover_add_button�'_keybindings_edit_popover_remove_button�(_keybindings_edit_popover_default_button�#_keybindings_edit_popover_up_button�%_keybindings_edit_popover_down_button�_dynamic_adjust_checkbutton�_on_dynamic_adjust_checkbutton�_dynamic_adjust_forget_button�HBox�!_dynamic_adjust_forget_button_box�#_dynamic_adjust_forget_button_label�set_max_width_chars�
set_line_wrap�
set_ellipsizer�
EllipsizeMode�START� _on_dynamic_adjust_forget_button�_onechar_mode_label�_onechar_mode_combobox�_onechar_mode_store�!_on_onechar_mode_combobox_changed�_autoselect_mode_checkbutton�_on_autoselect_mode_checkbutton�_autocommit_mode_label�_autocommit_mode_combobox�_autocommit_mode_store�$_on_autocommit_mode_combobox_changed�_commit_invalid_mode_label�_commit_invalid_mode_combobox�_commit_invalid_mode_store�(_on_commit_invalid_mode_combobox_changed�_autowildcard_mode_checkbutton�!_on_autowildcard_mode_checkbutton�_single_wildcard_char_label�Entry�_single_wildcard_char_entry�set_max_length�_on_single_wildcard_char_entry�_multi_wildcard_char_label�_multi_wildcard_char_entry�_on_multi_wildcard_char_entry�_use_dark_theme_checkbutton�_on_use_dark_theme_checkbutton�_error_sound_checkbutton�_on_error_sound_checkbutton�_error_sound_file_button�_error_sound_file_button_box�_error_sound_file_button_label�_on_error_sound_file_button�_debug_level_label�_debug_level_adjustment�(_on_debug_level_adjustment_value_changed�show_all�set_current_page�_on_gsettings_value_changed)�selfr�style_provider�database_filename�user_database_filename�
languages_strr*�language�langr/�grid_border_width�grid_row_spacing�grid_column_spacing�margin�_options_grid_row�
renderer_text�index�item�user_keybindings�command�keybindings_treeview_column_0�keybindings_treeview_column_1�_options_details_grid_rows                       �#/usr/share/ibus-table/setup/main.pyrhzSetupUI.__init__{s2��'����
�
����#���� �"%�&��
���	�	 �
	�
�
�-�-��G�G�L�L�#�(�(�*�G�5E�
G�	H�	
�
�
�,�-����t�����*���%�%�
�	�	���0�0��J�J�"�"�$���3�3�	5�
�G�G�L�L��G�G�L�L�,�1�1�3�X�>�����%�'���w�w�~�~�/�0��L�L�2�4E�F��H�H�Q�K�!#���!1�!1�2C�!D�!L�!L��:�"��&�2�2�&�*�!�#���
"�����
��(�(�7�7�;�;�K�H�
��%�+�+�C�0�I�%�
-���>�>�#�.�.�t�4�(,�D�%�.�-�D��~�~�'�2�2�4�8�(,��
�-�
-�).��%�!%�!1�!1�!@�!@�!D�!D�$�"&��!�&�,�,�.�&�8�
�)��'�'�6�6�:�:�7�C����,�,�6�9�D�<M�<M�M�O���	
� � �"��������
 �"%�
&��
��
�	 �
	
���_�d�&<�&<�=����^�T�%:�%:�;�"�w�w�y������,�,�S�_�_�-E�-E�F����(�(��+�����%�%�&����������"�"�4�(����$�$�U�+����%�%�d�+����"�"�4�(����"�"�4�(����'�'�����d�A�F�#&�7�7�9�� �� � �0�0����1K�1K�L�� � �,�,�T�2�� � �.�.�u�5�� � �,�,�T�2�� � �,�,�U�3����%�%�d�&>�&>��d�A�N� �Z�Z�a��j�9������&�&�t�,����"�"�9�d�.K�.K�L�� � �$�$�T�%7�%7�8�,/�J�J�L��)��)�)�5�5�d�;�25�)�)�+��/��/�/�8�8�
�$�%�	'��)�)�-�-��3�3�	5��)�)�1�1��t�C�C�	E�� � �$�$�T�%F�%F�G� �Z�Z�\������&�&�t�,�#&�9�9�;�� �� � �7�7��(��D������t�7�7�8����"�"�9�d�.D�.D�E�� � �$�$�T�%7�%7�8����� �� �X�X�Z������&�&�t�,����(�(��/����+�+�,=�>����*�*�+;�<����-�-�.A�B����.�.�u�5����1�1�$�7����&�&�t�,����&�&�u�-�!�i�i�k���	
���$�$�Q�z�]�3�%(�X�X�Z��"��"�"�.�.�t�4��"�"�0�0��7��"�"�3�3�4E�F��"�"�2�2�3C�D��"�"�5�5�6I�J��"�"�6�6�u�=��"�"�9�9�$�?��"�"�.�.�t�4��"�"�.�.�u�5�&)�i�i�k��#�	
�#�#�,�,�Q�y�\�:�!$���������.�.�s���/G�/G�H����*�*�1�-������/�/��7����-�-�f�5����-�-�f�5����0�0��8�"%�)�)�+���	
���(�(��>�):�;����"�"�������	!�	
���"�"��&�&��'�'�	)�	
���"�"��"�"��#�#�	%���*-�)�)�+��'��'�'�0�0�

�#�$�	&�	
�'�'�8�8�
�A�
B�
	C�	
�'�'�2�2�1�5�-0�\�\�^��*�*-�-�-��T�*B��'��'�'�.�.�
�t�W�e��	��'�'�.�.�
�u�X�t��	��*�*�4�4��+�+�	-��,�,�.�
��*�*�5�5��4�	!��*�*�8�8��6�1�	&�$�T�%D�%D�E�	E�K�E�4��"�"�#6�7��?�4��7�J��2�2�=�=�e�D�	E�	
�*�*�2�2���9�9�	;�	�Q������!�!��+�+�Q�0A�1�a�	I����!�!��.�.��3D�a��	L�$'�9�9�;�� �� � �)�)�
�o��	 �	
� � �1�1�
�	+�	
,�	-�	
� � �+�+�A�.�&)�l�l�n��#�#&�=�=��c�#:�� �� � �'�'��#�
$�a�(�	*�	
� � �'�'��$�
%�q�)�	+�	
� � �'�'��6�
7��;�		=�
	
� � �'�'��6�
7��;�		=�
	
� � �'�'��'�
(�!�,�		.�
	
�#�#�-�-��$�$�	&��,�,�.�
��#�#�.�.��4�	!��#�#�1�1��6�1�	&�$�T�%=�%=�>�	>�K�E�4��"�"�=�1�&�9�T�!�W�D��+�+�6�6�u�=�	>�	
�#�#�+�+���2�2�	4������"�����%�%��(�(�!�->��1�
F����%�%��+�+�Q�0A�1�a�
I�47�9�9�;��0��0�0�9�9�
�)�*�	,�	
�0�0�A�A�
�-�
.�	/�
	
�0�0�;�;�A�>�69�l�l�n��3�36�=�=��d�3K��0��0�0�7�7��v�Y���	 �	
�0�0�7�7��v�Y���	�	
�3�3�=�=��4�4�	6��,�,�.�
��3�3�>�>��4�	!��3�3�A�A��6�1�	&�$�T�%M�%M�N�	N�K�E�4��"�"�#:�;�F�C�t�A�w�N��;�;�F�F�u�M�	N�	
�3�3�;�;���B�B�	D��=�=���"�����%�%��8�8��$�a��
,�
���%�%��;�;��$�a��
,�36�)�)�+��/��/�/�8�8�
�.�/�	1�	
�/�/�@�@�
�1�
2�	3�
	
�/�/�:�:�1�=�58�\�\�^��2�25�-�-���3��/��/�/�6�6��v�Y���	 �	
�/�/�6�6��v�Y���	�	
�2�2�<�<��3�3�	5��,�,�.�
��2�2�=�=��4�	!��2�2�@�@��6�1�	&�$��7�7�9�	�K�E�4��"�"�#9�:�6�B�d�1�g�M��:�:�E�E���	�
	
�2�2�:�:���A�A�	C��=�=���"�����%�%��7�7��$�a��
,�
���%�%��:�:��$�a��
,�58�I�I�K��1��1�1�:�:�
�*�+�	-�	
�1�1�B�B�
�.�
/�	0�
	
�1�1�<�<�Q�?�7:�|�|�~��4�47�M�M�#�t�4L��1��1�1�8�8��v�Y���	 �	
�1�1�8�8��v�Y���	�	
�4�4�>�>��5�5�	7��,�,�.�
��4�4�?�?��4�	!��4�4�B�B��6�1�	&�$��9�9�;�	O�K�E�4��"�"�#9�:�6�B�d�1�g�M��<�<�G�G��N�	O�	
�4�4�<�<���C�C�	E��=�=���"�����%�%��9�9��$�a��
,�
���%�%��<�<��$�a��
,�47�9�9�;��0��0�0�9�9�
�/�0�	2�	
�0�0�A�A�
�2�
3�	4�
	
�0�0�;�;�A�>�69�l�l�n��3�36�=�=���4��0��0�0�7�7��v�Y���	 �	
�0�0�7�7��v�Y���	�	
�3�3�=�=��4�4�	6��,�,�.�
��3�3�>�>��4�	!��3�3�A�A��6�1�	&�$��8�8�:�	�K�E�4��"�"�#8�9�&�A�T�!�W�L��;�;�F�F���	�
	
�3�3�;�;���B�B�	D��=�=���"�����%�%��8�8��$�a��
,�
���%�%��;�;��$�a��
,�69�Y�Y�[��2��2�2�;�;��A�&�'�'�&�0�	2��2�2�A�A�$�G��2�2�=�=�a�@��Q������!�!��6�6�
� �!�Q�	(�03����)�*�0,��,�	
�,�,�=�=�
�+�
,�		-�	
�,�,�8�8��?��,�,�8�8��?��,�,�7�7���� 2�3�F�;�	=��,�,�4�4��t�>�>�	@��Q������!�!��0�0�!�5F��1�	N�03�y�y�{��,��,�,�5�5�
�n��	�	
�,�,�=�=�
�2�
3�		4�	
�,�,�7�7��:�25�,�,�.��/�/2�}�}�S�#�/F��,��,�,�3�3�
�|�_�c�$�"2�"2�"=�"=�>�?�	A��,�,�3�3�
�z�]�C�� 0� 0� 9� 9�:�;�	=��,�,�3�3�
��
 �#�d�&6�&6�&=�&=�">�?�	A��/�/�9�9��0�0�	2��,�,�.�
��/�/�:�:��4�	!��/�/�=�=��6�1�	&�$�T�%I�%I�J�	J�K�E�4��#�#�$<�=�f�E���7���7�7�B�B�5�I�	J�	
�/�/�7�7���>�>�	@�	�Q������!�!��0�0�!�5F��1�	N����!�!��3�3�
� �!�Q�	(�!$�	�	����	
���&�&�q���7����.�.�
�0�
1�		2�	
���(�(��+�%(�^�^�%5��"��"�"�.�.�t�4��"�"�0�0��6��"�"�1�1�#�s�;��"�"�,�,�S�$�7��"�"�,�,���� 5�6�v�>�	@��"�"�*�*��T�H�H�	J��Q������!�!��!�!�1�&7��A�	?����!�!��&�&��+<�a��	D�#&�)�)�+������(�(��A�-�.�.��7�	9����.�.�t�4����0�0��8����.�.�v�6����.�.�v�6����1�1�&�9����+�+�E�2����+�+�E�2����*�*�1�-�,/�,>�,>�,@��)��)�)�7�7��>��)�)�5�5�e�<��)�)�5�5�d�;�%(�\�\�^��"�+.�=�=��c�+B��(��"�"�,�,�T�-M�-M�N��.�.�}�=�f�E���.�/�	<�G��,�,�3�3��$�/��8�9�:�
<�	<�),�(:�(:�
�i�L�� � �"��)�%�	&�8�8��;��"�"�0�0�1N�O�(+�(:�(:�
�n��� � �"��)�%�	&�8�8��;��"�"�0�0�1N�O��"�"�0�0�2�:�:��t�A�A�	C��"�"�*�*��T�H�H�	J��)�)�-�-�d�.H�.H�I����)�)��#�#�U�E�1�	6����)�)��-�-�t�T�1�	>�(+���	��%��%�%�5�5��O�O�&�&�	(��%�%�3�3�E�:����"�"��)�)�	+�(+�
�
���%�.1�i�i�k��+��+�+�4�4�
�f�I�	��%�%�)�)��/�/�	1��%�%�6�6�
�>�?�	A�	
�%�%�3�3�E�:��%�%�-�-��t�?�?�	A�+.�:�:�<��(�14�����.��.�.�7�7�
���	!��(�(�,�,��2�2�	4��(�(�9�9�
�A�B�	D�	
�(�(�6�6�u�=��(�(�0�0��t�B�B�	D�/2�z�z�|��,�58�Y�Y�[��2��2�2�;�;�
�"�#�	%��,�,�0�0��6�6�	8��,�,�=�=�
�9�:�	<�	
�,�,�:�:�4�@��,�,�4�4��t�F�F�	H��%�%�)�)�$�*G�*G�H��%�%�)�)�$�*J�*J�K��%�%�)�)�$�*N�*N�O�-/��*�=?��:�CE��@�15��.�)-��&�04��-�48��1�7;��4�8<��5�37��0�59��2�$&�!�+.�?�?��$�%�	,'��(�
	
�(�(�9�9�
��
�	�	
�(�(�4�4�U�;��(�(�4�4�U�;��(�(�3�3�����0��8�	:��(�(�0�0��t�:�:�	<�-0�Z�Z�\��*�14�����.�36�9�9�;��0��0�0�9�9�
�'�(�	*��0�0�?�?��E��0�0�D�D��	��0�0�>�>�u�E��0�0�>�>����%�%�	'��.�.�9�9��4�4�e�U�A�	G��*�*�.�.��2�2�	4��*�*�2�2��t�<�<�	>�!�Q�&�!��"�"�)�)��,�,�
�(�!�Q�	0�	
�"�"�)�)��.�.�
�(�!�Q�	0�$'�9�9�;�� �� � �)�)�
�j�M�	�	
� � �1�1�
�1�
2�		3�	
� � �+�+�A�.�&)�l�l�n��#�#&�=�=��c�#:�� �� � �'�'�
�x�[�%� �	"�� � �'�'�
�}�
�t�$�	&��#�#�-�-��$�$�	&��,�,�.�
��#�#�.�.��4�	!��#�#�1�1��6�1�	&�$�T�%=�%=�>�	>�K�E�4��"�"�9�-�f�5��a��@��+�+�6�6�u�=�	>�	
�#�#�+�+��t�=�=�	?��=�=�%��*�%��&�&�-�-��(�(��,�a��
4�
�&�&�-�-��+�+��,�a��
4�-0�O�O��M�"�-$��)�	
�)�)�:�:�
�	/�	
0�	
	1�	
�)�)�5�5�e�<��)�)�5�5�e�<��)�)�4�4�����-�f�5�	7��)�)�1�1��t�;�;�	=�!�Q�&�!��"�"�)�)��-�-�
�(�!�Q�	0�'*�i�i�k��#��#�#�,�,�
�!�"�	$�	
�#�#�4�4�
��
�		�	
�#�#�.�.�q�1�),�����&�&)�m�m�C��&=��#��#�#�*�*�
�x�[�%� �	"��#�#�*�*�
�x�[�$��	!��&�&�0�0��'�'�	)��,�,�.�
��&�&�1�1��4�	!��&�&�4�4��6�1�	&�$�T�%@�%@�A�	A�K�E�4��"�"�<�0��8�D��G�C��.�.�9�9�%�@�	A�	
�&�&�.�.��t�@�@�	B��(�(�T�\�\�%��*�%��&�&�-�-��+�+��,�a��
4�
�&�&�-�-��.�.��,�a��
4�+.�)�)�+��'��'�'�0�0�
�5�6�	8�	
�'�'�8�8�
�K�
L�		M�	
�'�'�2�2�1�5�-0�\�\�^��*�*-�-�-��S�*A��'��'�'�.�.�
�)�
*�A�.�	0��'�'�.�.�
�"�
#�Q�'�	)��*�*�4�4��+�+�	-��,�,�.�
��*�*�5�5��4�	!��*�*�8�8��6�1�	&�$�T�%D�%D�E�	E�K�E�4��"�"�#6�7��?�4��7�J��2�2�=�=�e�D�	E�	
�*�*�2�2��t�D�D�	F�!�Q�&�!��"�"�)�)��+�+�
�(�!�Q�	0�	
�"�"�)�)��.�.�
�(�!�Q�	0�/2�o�o��O�$�/&��+�	
�+�+�<�<�
�9�
:�		;�	
�+�+�7�7��>��+�+�7�7��>��+�+�6�6�����/��7�	9��+�+�3�3��t�=�=�	?�!�Q�&�!��"�"�)�)��/�/�
�(�!�Q�	0�,/�9�9�;��(��(�(�1�1�
�*�+�	-�	
�(�(�9�9�
�M�
N�		O�	
�(�(�3�3�A�6�+.�9�9�;��(��(�(�7�7��:��(�(�1�1���� 4�5�f�=�	?��(�(�0�0��D�?�?�	A�!�Q�&�!��"�"�)�)��,�,�
�(�!�Q�	0�	
�"�"�)�)��,�,�
�(�!�Q�	0�+.�)�)�+��'��'�'�0�0�
�)�*�	,�	
�'�'�8�8�
�M�
N�		O�	
�'�'�2�2�1�5�*-�)�)�+��'��'�'�6�6�q�9��'�'�0�0���� 3�4�V�<�	>��'�'�/�/��D�>�>�	@�!�Q�&�!��"�"�)�)��+�+�
�(�!�Q�	0�	
�"�"�)�)��+�+�
�(�!�Q�	0�,/�?�?��$�%�,'��(�	
�(�(�9�9�
�G�H�		J�
	
�(�(�4�4�U�;��(�(�4�4�U�;��(�(�3�3�����,�V�4�	6��(�(�0�0��t�:�:�	<�!�Q�&�!��"�"�)�)��,�,�
�(�!�Q�	0�),����.�/�)1��%�	
�%�%�6�6�
�,�
-�	.�
	
�%�%�1�1�%�8��%�%�1�1�%�8��%�%�0�0�����-�f�5�	7��%�%�-�-��t�7�7�	9�(+�
�
���%�,/�H�H�J��)�.1�i�i�k��+��+�+�4�4���� 0�1�&�9�	;��+�+�:�:�4�@��+�+�?�?��	��+�+�9�9�%�@��+�+�9�9����%�%�	'��)�)�4�4��/�/���q�	B��%�%�)�)��-�-�	/��%�%�-�-��t�7�7�	9�!�Q�&�!��"�"�)�)��)�)�1�.G��A�	O��"�"�)�)��)�)�1�.G��A�	O�#&�)�)�+������(�(�
�n��		�
	
���0�0�
�/�
0�	1�	
���*�*�1�-�'*�~�~�'7��$��$�$�0�0��6��$�$�2�2�4�8��$�$�3�3�C��=��$�$�.�.�s�E�:��$�$�.�.�����-�f�5�	7��$�$�,�,���9�9�	;�	"�Q�&�!��"�"�)�)��#�#�Q�(A�1�a�	I��"�"�)�)��(�(�!�-F��1�	N�	
�
�
�����'�'��*������	�4�+K�+K�L�c��i|_tj|jj	d��}|j
jjd�r%|j
jjd�}tj|jjd��}|�|}|||jd�|jd<tj|jj	d��}|j
jjd�r%|j
jjd�}tj|jjd��}|�|}|||jd�|jd<tj|j|j
�}tj|�}tj|jjd��}|si}tj||�|||jd�|jd<tj|jj	d��}|j
jjd	�r6|j
jjd	�j!�d
k(}tj|jjd��}	|	�|}	||	|j"d�|jd<tj|jj	d��}
t%dd
�D]}|d|dzzr�t'||
�}
ntj|jjd��}|�|
}t)|
�t)|�|j*d�|jd<tj|jj	d��}
|j
j-�}
tj|jjd��}|�|
}|
||j.d�|jd<tj|jj	d��}tj0|j
�}tj|jjd��}|�|}|||j2d�|jd<tj|jj	d��}tj|jj5d��}|||j6d�|jd<tj|jj	d��}tj|jj5d��}|||j8d�|jd<tj|jj	d��}tj|jj5d��}|||j:d�|jd<tj|jj	d��}|j
jjd�r6|j
jjd�j!�d
k(}tj|jjd��}|�|}|||j<d�|jd<tj|jj	d��}tj|jj5d��}|||j>d�|jd<tj|jj	d��}tj|jj5d��}|||j@d�|jd<tj|jj	d��}tj|jj5d��}|||jBd�|jd<tj|jj	d��}|j
jjd�r6|j
jjd�j!�d
k(}tj|jjd��} | �|} || |jDd�|jd<tj|jj	d��}!|j
jjd�r6|j
jjd�j!�d
k(}!tj|jjd��}"|"�|!}"|!|"|jFd�|jd<tj|jj	d��}#tj|jj5d��}$|#|$|jHd�|jd<tj|jj	d��}%tj|jj5d��}&|%|&|jJd�|jd<tj|jj	d��}'tj|jj5d��}(|'|(|jLd�|jd<tj|jj	d ��})|j
jjd!�r6|j
jjd!�j!�d
k(})tj|jjd ��}*|*�|)}*|)|*|jNd�|jd <tj|jj	d"��}+|j
jjd#�r6|j
jjd#�j!�d
k(}+tj|jjd"��},|,�|+},|+|,|jPd�|jd"<tj|jj	d$��}-tj|jj5d$��}.|-|.|jRd�|jd$<tj|jj	d%��}/|j
jjd&�r6|j
jjd&�j!�d
k(}/tj|jjd%��}0|0�|/}0|/|0|jTd�|jd%<y)'aFill a dictionary with the default and user settings for all
        settings keys.

        The default settings start with the defaults from the
        gsettings schema. Some of these generic default values may be
        overridden by more specific default settings coming from the
        specific database of this table input method. After this
        possible modification from the database we have the final default
        settings for this specific table input method.

        The user settings start with a copy of these final default settings,
        then they are possibly modified by user gsettings.

        Keeping a copy of the default settings in the settings dictionary
        makes it easy to revert some or all settings to the defaults.
        r`�single_wildcard_charN)rr@�set_functionra�multi_wildcard_charrQrL�always_show_lookupr0rPr&r8zcommit_candidate_%srOrE�	inputmoder?rbrV�dynamic_adjustrcrdrerH�def_full_width_letterrI�def_full_width_punctrJrKrYrZ�auto_selectr]�auto_commitr^r_�
auto_wildcard)+r��it_util�variant_to_valuer��get_default_valuer~r�r��get_user_value�set_single_wildcard_char�set_multi_wildcard_char�get_default_keybindings�copy�deepcopy�dict_update_existing_keys�set_keybindingsr��set_always_show_lookup�range�minr��
set_page_size�get_orientation�set_lookup_table_orientation�get_default_chinese_mode�set_chinese_mode�	get_value�set_input_mode�set_remember_input_mode�set_dark_theme�set_dynamic_adjust�set_error_sound�set_error_sound_file�set_debug_level� set_table_full_width_letter_mode�set_table_full_width_punct_mode�!set_direct_full_width_letter_mode� set_direct_full_width_punct_mode�set_onechar_mode�set_autoselect_mode�set_autocommit_mode�set_commit_invalid_mode�set_autowildcard_mode)1rL�default_single_wildcard_char�user_single_wildcard_char�default_multi_wildcard_char�user_multi_wildcard_char�default_keybindingsr[�user_keybindings_gsettings�default_always_show_lookup�user_always_show_lookup�default_page_sizerY�user_page_size� default_lookup_table_orientation�user_lookup_table_orientation�default_chinese_mode�user_chinese_mode�default_input_mode�user_input_mode�default_remember_input_mode�user_remember_input_mode�default_dark_theme�user_dark_theme�default_dynamic_adjust�user_dynamic_adjust�default_error_sound�user_error_sound�default_error_sound_file�user_error_sound_file�default_debug_level�user_debug_level�$default_table_full_width_letter_mode�!user_table_full_width_letter_mode�#default_table_full_width_punct_mode� user_table_full_width_punct_mode�%default_direct_full_width_letter_mode�"user_direct_full_width_letter_mode�$default_direct_full_width_punct_mode�!user_direct_full_width_punct_mode�default_onechar_mode�user_onechar_mode�default_autoselect_mode�user_autoselect_mode�default_autocommit_mode�user_autocommit_mode�default_commit_invalid_mode�user_commit_invalid_mode�default_autowildcard_mode�user_autowildcard_modes1                                                 r`r�zSetupUI._fill_settings_dict�s�
��"!���'.�'?�'?��O�O�-�-�.B�C�(E�$����*�*�.�.�/E�F�+/�+;�+;�+J�+J�+N�+N�&�,(�(�$+�$<�$<��O�O�*�*�+?�@�%B�!�$�,�(D�%�4�-� �9�9�5;����0�1�
'.�&>�&>��O�O�-�-�.A�B�'D�#����*�*�.�.�/D�E�*.�*:�*:�*I�*I�*M�*M�%�+'�'�#*�#;�#;��O�O�*�*�+>�?�$A� �#�+�'B�$�3�,� �8�8�4:����/�0�
&�=�=��O�O�T�-�-�/�� �=�=�)<�=��%,�%=�%=��O�O�*�*�=�9�&;�"�)�)+�&��)�)��8�	:�+�$� �0�0�.2����M�*�
&-�%=�%=��O�O�-�-�.@�A�&C�"����*�*�.�.�/C�D�� � �/�/�3�3�(�*�*/�%�'�V�<�
'�#*�":�":��O�O�*�*�+=�>�#@��"�*�&@�#�2�+� �7�7�39����.�/�
$�4�4��O�O�-�-�.C�D�F���1�b�\�	�E�&�'<���	�'J�K�$'��/@�$A�!��	�!�1�1��O�O�*�*�+@�A�C���!�.�N��,�-���'� �.�.�60����1�2�
,3�+C�+C��O�O�-�-�.F�G�,I�(�+/�+;�+;�+K�+K�+M�(�(/�(@�(@��O�O�*�*�+C�D�)F�%�(�0�,L�)�8�1� �=�=�9?����4�5�
 '�7�7��O�O�-�-�m�<� >��&�?�?���� ��#�4�4��O�O�*�*�=�9�;���$� 4��,�%� �1�1�.3����M�*�
%�5�5��O�O�-�-�k�:�<��!�2�2��O�O�%�%�k�2�4��*�#� �/�/�,1����K�(�
'.�&>�&>��O�O�-�-�.A�B�'D�#�#*�#;�#;��O�O�%�%�&9�:�$<� �3�,� �8�8�4:����/�0�
%�5�5��O�O�-�-�k�:�<��!�2�2��O�O�%�%�k�2�4��*�#� �/�/�,1����K�(�
")�!9�!9��O�O�-�-�o�>�"@�����*�*�.�.�/?�@�� � �/�/�3�3�$�&�&+�e�g��8�
#�&�6�6��O�O�*�*�?�;�=���&�"8��.�'� �3�3�05����O�,�
&�6�6��O�O�-�-�l�;�=��"�3�3��O�O�%�%�l�3�5��+�$� �0�0�-2����L�)�
$+�#;�#;��O�O�-�-�.>�?�$A� � '� 8� 8��O�O�%�%�&6�7�!9��0�)� �5�5�17����,�-�
&�6�6��O�O�-�-�l�;�=��"�3�3��O�O�%�%�l�3�5��+�$� �0�0�-2����L�)�
07�/G�/G��O�O�-�-�.E�F�0H�,����*�*�.�.�/F�G�� � �/�/�3�3�+�-�-2�U�W��?�
1�-4�,D�,D��O�O�*�*�+B�C�-E�)�,�4�4�
.�<�5� �A�A�8C����3�4�
�$�$����1�1�2H�I�
K�	,����*�*�.�.�/E�F�� � �/�/�3�3�*�,�,1�E�G�v�>�
0�,3�+C�+C��O�O�*�*�+A�B�,D�(�+�3�3�
-�;�4� �@�@�7B����2�3�
18�0H�0H��O�O�-�-�.D�E�1G�-�-4�-E�-E��O�O�%�%�&<�=�.?�*�=�6� �B�B�7D����2�3�
07�/G�/G��O�O�-�-�.C�D�0F�,�,3�,D�,D��O�O�%�%�&;�<�->�)�<�5� �A�A�6C����1�2�
 '�7�7��O�O�-�-�i�8� :��#�4�4��O�O�%�%�i�0�2��,�%� �1�1�*3����I�&�
#*�":�":��O�O�-�-�l�;�#=�����*�*�.�.�}�=�� � �/�/�3�3�!�#�#(�5�7�f�5�
$� '�7�7��O�O�*�*�<�8� :���'�#:� �/�(� �4�4�-6����L�)�
#*�":�":��O�O�-�-�l�;�#=�����*�*�.�.�}�=�� � �/�/�3�3�!�#�#(�5�7�f�5�
$� '�7�7��O�O�*�*�<�8� :���'�#:� �/�(� �4�4�-6����L�)�
'.�&>�&>��O�O�-�-�.A�B�'D�#�#*�#;�#;��O�O�%�%�&9�:�$<� �3�,� �8�8�4:����/�0�
%,�$<�$<��O�O�-�-�n�=�%?�!����*�*�.�.��?�� � �/�/�3�3�#�%�%*�U�W��7�
&�")�!9�!9��O�O�*�*�>�:�"<��!�)�%>�"�1�*� �6�6�/8����N�+ra�message�message_typec���tjtjj|tjj
|��}|j
�|j�y)z0Run a dialog to show an error or warning message��flagsr��buttons�message_formatN)r�
MessageDialog�DialogFlags�MODAL�ButtonsType�OK�run�destroy)r�r��dialogs   r`�__run_message_dialogzSetupUI.__run_message_dialog�sI��
�"�"��/�/�'�'�%��O�O�&�&�"�	$��
	�
�
�����rac��tjtd�|��}|jtd�tjj
�|jtd�tjj�|j�}tj�}|jdtj|�zdz�|jd�|jd�|jd�|jt j"j$�|j'd	�d
}|j)|�|j+|�|j-|�|j/|�|j1|�|j3�|j5�}|j7�tj8�r)tj:�tj8�r�)|S)u�
        Run a dialog to show a “Are you sure?” message.

        Returns Gtk.ResponseType.OK or Gtk.ResponseType.CANCEL (an enum)
        z
Are you sure?)r"�parent�_Cancel�_OKz&<span size="large" color="#ff0000"><b>z</b></span>TrWrr8)r�Dialogr�
add_button�ResponseType�CANCELr��get_content_arear�r��html�escaper�r r!�set_line_wrap_moder�WrapMode�	WORD_CHARr�r�r�r�r�r�rIr�r��events_pending�main_iteration)rLr��confirm_question�boxr5rV�responses       r`�_run_are_you_sure_dialogz SetupUI._run_are_you_sure_dialog�s����:�:��O�$����	�#�#�A�i�L�#�2B�2B�2I�2I�J��#�#�A�e�H�c�.>�.>�.A�.A�B��/�/�1���	�	���
���4��k�k�'�"�
#��
�	�	���T�"�
�!�!�"�%�
���D�!�
� � ����!9�!9�:�
�������
���v�&�
���V�$�
���V�$�
����'�������!�!�#�#�'�'�)��� � �"�� � �"���� �� � �"��rac��tj�jd�tjjk7rI|jt
d�tjj�tjd�yy)zU
        Check whether another instance of the setup tool is running already
        zorg.ibus.tablez0Another instance of this app is already running.r&FN)�dbus�
SessionBus�request_name�bus� REQUEST_NAME_REPLY_PRIMARY_OWNER�_SetupUI__run_message_dialogrr�MessageType�ERRORrzr{)rLs r`�check_instancezSetupUI.check_instances`��
�O�O��*�*�+;�<��8�8�<�<�
=��%�%��D�E����%�%�
'�
�H�H�Q�K�ra�_argsc�,�tj�y)zN
        The window has been deleted, probably by the window manager.
        N�r�	main_quit�r�s r`r�zSetupUI._on_delete_event�
��
	�
�
�rac�,�tj�y)z0
        The window has been destroyed.
        Nr�r�s r`r�zSetupUI._on_destroy_eventr�ra�_buttonc�,�tj�y)z0The button to close the dialog has been clicked.Nr��r�s r`r�zSetupUI._on_close_clicked#s
��	�
�
�ra�	_settings�keyc�
�tj|jj|��}tjd||�||jvr|j|d|d��ytjd�y)z�
        Called when a value in the settings has been changed.

        :param settings: The settings object
        :type settings: Gio.Settings object
        :param key: The key of the setting which has changed
        :type key: String
        z"Settings changed: key=%s value=%s
rdF��update_gsettingsNzUnknown key
)rnror�r�rx�infor�ry)rLr�r��values    r`rKz#SetupUI._on_gsettings_value_changed(st���(�(����)B�)B�3�)G�H�����9�3��F��$�%�%�%�4�D����$�^�4�U�FK�
M�����_�%�rac�,�tj�y)ui
        The “About” button has been clicked

        :param _button: The “About” button
        N)rn�
ItAboutDialogr�s r`r�z SetupUI._on_about_button_clicked<s��	���rac��|jjd�|jtd��}|tj
jk(r{tjd�|jD]V}|j|d|j|dd��|j|d|j|dd���Xntjd�|jjd�y	)
z.
        Restore all default settings
        Fz3Do you really want to restore all default settings?zRestoring all defaults.rdrTr�zRestore all defaults cancelled.N)
r�rr�rrr�r�rxr�r�)rLr�r�r�s    r`r�z/SetupUI._on_restore_all_defaults_button_clickedEs���
	
�)�)�7�7��>��0�0�
�C�D�	F��
�s�'�'�*�*�*��K�K�1�2��*�*�
,��8��#�#�C�(��8��'�'��,�Y�7�%)�+�9��#�#�C�(��8��'�'��,�Y�7�%*�,�	
,�
�K�K�9�:��)�)�7�7��=ra�widget�_property_specc�F�|j|j�d��y)zQ
        The character to be used as a single wildcard has been changed.
        Tr�N)rr�get_text�rLrrs   r`r:z&SetupUI._on_single_wildcard_char_entry]s#��
	
�%�%��O�O���	&�	6rac�F�|j|j�d��y)zP
        The character to be used as a multi wildcard has been changed.
        Tr�N)rsrrs   r`r=z%SetupUI._on_multi_wildcard_char_entryes#��
	
�$�$��O�O���	%�	6ra�_widgetc�Z�|j|jj�d��y)zE
        The page size of the lookup table has been changed.
        Tr�N)r|r�r��rLrs  r`r�z.SetupUI._on_page_size_adjustment_value_changedms,��
	
����&�&�0�0�2�T�	�	Krac��|j�}|�,|j�}||d}|j|d��yy)zg
        A change of the lookup table orientation has been requested
        with the combobox
        Nr&Tr�)�get_active_iter�	get_modelr~)rLr�	tree_iter�model�orientations     r`r�z5SetupUI._on_lookup_table_orientation_combobox_changedusR���*�*�,�	�� ��$�$�&�E��	�*�1�-�K��-�-��d�
.�
4�!rac��|j�}|�,|j�}||d}|j|d��yy)zb
        A change of the remember input mode has been requested
        with the combobox
        Nr&Tr�)rr
r�)rLrrr�remember_input_modes     r`r�z0SetupUI._on_remember_input_mode_combobox_changed�sS���*�*�,�	�� ��$�$�&�E�"'�	�"2�1�"5���(�(�#�d�
)�
<�!rac��|j�}|�,|j�}||d}|j|d��yy)z[
        A change of the Chinese mode has been requested
        with the combobox
        Nr&Tr�)rr
r�)rLrrr�chinese_modes     r`r�z)SetupUI._on_chinese_mode_combobox_changed�sR��
�*�*�,�	�� ��$�$�&�E� ��+�A�.�L��!�!��t�
"�
5�!rac��|j�}|�,|j�}||d}|j|d��yy)z[
        A change of the onechar mode has been requested
        with the combobox
        Nr&Tr�)rr
r��rLrrr�modes     r`r)z)SetupUI._on_onechar_mode_combobox_changed�sR��
�*�*�,�	�� ��$�$�&�E���#�A�&�D��!�!��t�
"�
-�!rac�F�|j|j�d��y)z4The checkbutton for autoselect mode has been clickedTr�N)r��
get_active�rLrs  r`r+z'SetupUI._on_autoselect_mode_checkbutton�s��� � ��!2�!2�!4�t� �Lrac��|j�}|�,|j�}||d}|j|d��yy)z^
        A change of the autocommit mode has been requested
        with the combobox
        Nr&Tr�)rr
r�rs     r`r/z,SetupUI._on_autocommit_mode_combobox_changed�sR���*�*�,�	�� ��$�$�&�E���#�A�&�D��$�$��t�
%�
-�!rac��|j�}|�,|j�}||d}|j|d��yy)zb
        A change of the commit invalid mode has been requested
        with the combobox
        Nr&Tr�)rr
r�)rLrrr�commit_invalid_modes     r`r3z0SetupUI._on_commit_invalid_mode_combobox_changed�sS��
�*�*�,�	�� ��$�$�&�E�"'�	�"2�1�"5���(�(�#�d�
)�
<�!rac�F�|j|j�d��y)z4The checkbutton for autocommit mode has been clickedTr�N)r�rrs  r`r5z)SetupUI._on_autowildcard_mode_checkbutton�s ��	
�"�"�6�#4�#4�#6��"�Nrac��|j�}|�,|j�}||d}|j|d��yy�uz
        A change of the letter width when in “Table input” mode has been
        requested with the combobox
        Nr&Tr�)rr
r�rs     r`r�z9SetupUI._on_table_full_width_letter_mode_combobox_changed��R���*�*�,�	�� ��$�$�&�E���#�A�&�D��1�1��t�
2�
-�!rac��|j�}|�,|j�}||d}|j|d��yyr )rr
r�rs     r`r�z8SetupUI._on_table_full_width_punct_mode_combobox_changed�sR���*�*�,�	�� ��$�$�&�E���#�A�&�D��0�0��t�
1�
-�!rac��|j�}|�,|j�}||d}|j|d��yy�u{
        A change of the letter width when in “Direct input” mode has been
        requested with the combobox
        Nr&Tr�)rr
r�rs     r`r�z:SetupUI._on_direct_full_width_letter_mode_combobox_changed�sR���*�*�,�	�� ��$�$�&�E���#�A�&�D��2�2��t�
3�
-�!rac��|j�}|�,|j�}||d}|j|d��yyr$)rr
r�rs     r`r�z9SetupUI._on_direct_full_width_punct_mode_combobox_changed�r!rac�F�|j|j�d��y)z7The checkbutton for always show lookup has been clickedTr�N)ryrrs  r`r�z*SetupUI._on_always_show_lookup_checkbutton�s ��	
�#�#�F�$5�$5�$7�$�#�Orac�F�|j|j�d��y)z3The checkbutton for the dark theme has been clickedTr�N)r�rrs  r`r?z&SetupUI._on_use_dark_theme_checkbuttons�����F�-�-�/�$��Grac�F�|j|j�d��y)z
        The checkbutton whether to dynamically adjust the candidates

        :param widget: The check button clicked
        Tr�N)r�rrs  r`rz&SetupUI._on_dynamic_adjust_checkbuttons ��	
���� 1� 1� 3�d��Krac��|jjd�|jtd��}|tj
jk(r|jj�|jjd�y)zL
        The button to select forget how often candidates were used
        FzSDo you really want to delete all data learned from typing and selecting candidates?TN)	rrr�rrr�r�r~�remove_all_phrases_from_user_db)rLrr�s   r`r%z(SetupUI._on_dynamic_adjust_forget_buttonsv��
	
�*�*�8�8��?��0�0�
�E�
F�G���s�'�'�*�*�*����<�<�>��*�*�8�8��>rac�F�|j|j�d��y)zy
        The checkbutton whether to play a sound file on error.

        :param widget: The check button clicked
        Tr�N)r�rrs  r`rAz#SetupUI._on_error_sound_checkbutton!s ��	
���V�.�.�0�4��Hrac��|jjd�d}tjt	d�|tj
j��}|jt	d�tjj�|jt	d�tjj�|jtjj|jdd��|j!�}|tjjk(r|j#�}|j%�tj&�r)tj(�tj&�r�)|r.|j*j-|�|j/|d	�
�|jjd	�y)zQ
        The button to select the .wav sound file to be played on error.
        FrzSelect .wav sound file:)r"r�rr�r�rdr@Tr�N)rBrr�FileChooserDialogr�FileChooserAction�OPENr�r�r�r��set_current_folderrjr3�dirnamer�r��get_filenamer�r�r�rDr�r�)rLrr'�chooserr�s     r`rEz#SetupUI._on_error_sound_file_button)s^��
	
�%�%�3�3�E�:����'�'��-�.���(�(�-�-�/��	���1�Y�<��)9�)9�)@�)@�A����1�U�8�S�%5�%5�%8�%8�9��"�"�2�7�7�?�?���� 0�1�&�9�$;�	<��;�;�=���s�'�'�*�*�*��+�+�-�H������ � �"���� �� � �"���/�/�8�8��
��%�%��4�
&�
1��%�%�3�3�D�9rac�Z�|j|jj�d��y)z/The value for the debug level has been changed.Tr�N)r�rGr�r
s  r`rHz0SetupUI._on_debug_level_adjustment_value_changedEs,��	
����(�(�2�2�4�!�	�	#ra�	_treeview�treepath�_treeviewcolumnc���|j}|j|�}||d}||jk7r)tj	d|zd|jzz�y|j�y)a;
        A row in the treeview listing the key bindings has been activated.

        :param treeview: The treeview listing the key bindings
        :param treepath: The path to the activated row
        :param treeviewcolumn: A column in the treeview listing the
                               key bindings
        rz!Unexpected error, command = "%s" z*self._keybindings_selected_command = "%s"
N)r��get_iterrrxry�)_create_and_show_keybindings_edit_popover)rLr5r6r7r�iteratorr\s       r`rz.SetupUI._on_keybindings_treeview_row_activatedLsv���0�0���>�>�(�+����/�!�$���d�8�8�8�
�L�L�3�g�=�?��4�4�5�5�
6�
��6�6�8ra�	selectionc�0�|j�\}}|rD||d|_|jjd�|jjd�yd|_|jjd�|jjd�y)zS
        A row in the treeview listing the key bindings has been selected.
        rTrFN)�get_selectedrr	rr)rLr<rr;s    r`rz-SetupUI._on_keybindings_treeview_row_selectedis���
&�2�2�4�����16�x���1C�D�.��,�,�:�:�4�@��)�)�7�7��=�24�D�.��,�,�:�:�5�A��)�)�7�7��>ra�_listbox�listbox_rowc���|r�|j�j�}|j�}|jdd}|j}|r�|r�|||vr�||_||_|jr|jjd�|jr|jj|dkD�|jr-|jj|t||�dz
k�yd|_d|_|jr|jjd	�|jr|jjd	�|jr|jjd	�yy)
a?
        Signal handler for selecting one of the key bindings
        for a certain command

        :param _listbox: The list box used to select a key binding
        :type _listbox: Gtk.ListBox object
        :param listbox_row: A row containing a key binding
        :type listbox_row: Gtk.ListBoxRow object
        rQr@Trr&Nrr;F)�	get_childr�	get_indexr�rrrrrrr�len)rLr?r@�
keybindingrYr[r\s       r`�)_on_keybindings_edit_listbox_row_selectedz1SetupUI._on_keybindings_edit_listbox_row_selectedys\��
�$�.�.�0�9�9�;�J��)�)�+�E�#�2�2�=�A�&�I���8�8�G��w��"2�7�";�;�EO��B���H��?�?��@�@�N�N����;�;��<�<�J�J���	�#��=�=��>�>�L�L���$4�W�$=� >�� B�B�D��=?��:�CE��@��7�7��8�8�F�F�u�M��3�3��4�4�B�B�5�I��5�5��6�6�D�D�U�K�6rac���tj|��}|j�}|j�|tj
jk(r�|j\}}tj|d|�}tj|�}|j}|jdd}	||	|vr6|	|j|�|j�|j|	�yyy)up
        Signal handler called when the “Add” button to add
        a key binding has been clicked.
        )r�rrQr@N)rn�ItKeyInputDialogr�r�rr�r��e�KeyEvent�keyevent_to_keybindingrr�r��&_fill_keybindings_edit_popover_listboxrx)
rLr��key_input_dialogr��keyval�stater�rEr\r[s
          r`�/_on_keybindings_edit_popover_add_button_clickedz7SetupUI._on_keybindings_edit_popover_add_button_clicked�s���#�3�3�4�@��#�'�'�)��� � �"��s�'�'�*�*�*�,�.�.�M�F�E��"�"�6�1�e�4�C� �7�7��<�J��8�8�G�#�2�2�=�A�&�I���!1�'�!:�:� ��)�0�0��<��;�;�=��$�$�%5�6�;�
+rac���|j}|j}|jdd}|rA|r>|||vr6||j|�|j	�|j|�yyyy)uv
        Signal handler called when the “Remove” button to remove
        a key binding has been clicked.
        rQr@N)rrr��removerLrx)rLr�rEr\r[s     r`�2_on_keybindings_edit_popover_remove_button_clickedz:SetupUI._on_keybindings_edit_popover_remove_button_clicked�s}���G�G�
��4�4���.�.�}�=�f�E���7��"2�7�";�;��W�%�,�,�Z�8��7�7�9�� � �!1�2�<�#�Jrac��|j}|j}|j}|jdd}d|cxkrt	||�ksyy||d|dz
|||gz|||dz
gz|||dzdz||<|j|d��|j
�|dz
|_||_|jr8|jj|jj|dz
��yy)us
        Signal handler called when the “up” button to move
        a key binding up has been clicked.
        rQr@rNr&Tr��
rrrr�rDrxrLr�
select_row�get_row_at_index�rLr�rYr\rEr[s      r`�._on_keybindings_edit_popover_up_button_clickedz6SetupUI._on_keybindings_edit_popover_up_button_clicked�s:���H�H���4�4���G�G�
��.�.�}�=�f�E���5�9�3�/��8�9�9�
�:�
��W�%�j�u�q�y�1���(��/�0�
1���(����3�4�
5��w�'���	�
�3�
4�	��!�
	
���-���E��3�3�5�CH�1�9��@�=G��:��1�1��2�2�=�=��6�6�G�G��A�I��
 �2rac��|j}|j}|j}|jdd}d|cxkrt	||�dz
ksyy||d||||dzgz|||gz|||dzdz||<|j|d��|j
�|dz|_||_|jr8|jj|jj|dz��yy)	uw
        Signal handler called when the “down” button to move
        a key binding down has been clicked.
        rQr@rr&NrBTr�rUrXs      r`�0_on_keybindings_edit_popover_down_button_clickedz8SetupUI._on_keybindings_edit_popover_down_button_clicked�s;���H�H���4�4���G�G�
��.�.�}�=�f�E���E�>�C� 0�� 9�:�Q�>�>�
�?�
��W�%�f�u�-���(����3�4�
5���(��/�0�
1��w�'���	�
�3�
4�	��!�
	
���-���E��3�3�5�CH�1�9��@�=G��:��1�1��2�2�=�=��6�6�G�G��A�I��
 �2rac���|jdd}|jdd}|j}|r=||vr8||j�||<|j�|j	|�yyy)u�
        Signal handler called when the “Default” button to set
        the keybindings to the default has been clicked.
        rQrr@N)r�rrurLrx�rLr�r�r[r\s     r`�3_on_keybindings_edit_popover_default_button_clickedz;SetupUI._on_keybindings_edit_popover_default_button_clicked�s���#�1�1�-�@��K���.�.�}�=�f�E���4�4���w�"5�5�(;�G�(D�(I�(I�(K��W�%��7�7�9�� � �!1�2�6�7rac�B�|j�tjd�y|jj�D]}|jj	|��tj�|_|jj|j�d|_	d|_
|jjd�|jjd�|jjt
jj�|jj!d�|jj#d|j$�|j&dd}||j(D]�}tj*�}|j-t/j0|��|j3d�|j5d	�d
}|j7|�|j9|�|j;|�|j=|�|jj?|d���|j@jCd�|jDjCd�|jFjCd�|jjI�y)zj
        Fill the edit listbox to with the key bindings of the currently
        selected command
        Nz-self._keybindings_edit_popover_scroll is Nonerr;Tzrow-selectedrQr@rr&F)%rrx�debug�get_childrenrRr�ListBoxrr�rrr�r��set_selection_mode�
SelectionMode�SINGLE�set_activate_on_single_clickr�rFr�rr�r�r�r�r�r�r�r�r�r��insertrrrrrI)rL�childr[rEr5rVs      r`rLz.SetupUI._fill_keybindings_edit_popover_listboxs"��
�0�0�8��L�L�H�I���:�:�G�G�I�	@�E��1�1�8�8��?�	@�14�����.��-�-�1�1��2�2�	4�=?��:�CE��@��.�.�:�:�4�@��.�.�:�:�4�@��.�.�A�A����$�$�	&��.�.�K�K��	��.�.�6�6��D�J�J�	L��.�.�}�=�f�E��*�4�+M�+M�N�
	E�J��I�I�K�E��N�N�4�;�;�z�2�3�� � ��&����Q���F��"�"�6�*�� � ��(�� � ��(��#�#�F�+��2�2�9�9�%��D�
	E�	
�4�4�B�B�5�I��0�0�>�>�u�E��2�2�@�@��G��.�.�7�7�9rac��tj�|_|j�tj	d�y|jj|j�|jjtjj�|jjd�|jjd�tj�}|jtjj�d}|j!|�|j#|�|j%|�|j'|�|j)|�tj*�}|j-t/d�|j0z�|j3d�|j5d�|j7tj8j:�|j=|ddd�tj>�|_ |j@jd�|j@jd�|j@jCd�|j@jEd�|j=|j@ddd�tj�}|jtjjF�|jId�|jK|�tjL�|_'tj*�}|j-d�|j3d�|jNjK|�|jNjQt/d	��|jNjSd
|jT�|jNjWd�tjL�|_,tj*�}|j-d�|j3d�|jXjK|�|jXjQt/d��|jXjSd
|jZ�|jXjWd�tjL�|_.tjL�|_/tj*�}|j-d
�|j3d�|j^jK|�|j^jQt/d��|j^jSd
|j`�tjL�|_1tj*�}|j-d�|j3d�|jbjK|�|jbjQt/d��|jbjSd
|jd�tj*�}	|	j-t/d��|	j3d�|j\jK|	�|j\jQt/d��|j\jSd
|jf�|j\jWd�|jK|jN�|jK|jX�|jK|j^�|jK|jb�|jK|j\�|jjK|�|ji�tjdk\r|jjm�|jjo�y)zT
        Create and show the popover to edit the key bindings for a command
        Nz&self._keybindings_edit_popover is NoneT�u&Edit key bindings for command “%s”Frz%<span size="xx-large"><b>+</b></span>zAdd a key bindingr6z%<span size="xx-large"><b>-</b></span>zRemove selected key bindingu'<span size="xx-large"><b>↑</b></span>zMove key binding upu'<span size="xx-large"><b>↓</b></span>zMove key binding downrTrU)rC�r)8r�Popoverrrxr`�set_relative_tor�set_position�PositionType�RIGHTr�r�r�r�r�r�r�r�r�r�r�r�r�rrr�r��
set_halign�Align�FILLr�r�r�set_kinetic_scrolling�set_overlay_scrollingr�r�r�r�rr�r�rPrrrSrrrYrr[r^rL�GTK_VERSION�popuprI)
rL�keybindings_edit_popover_vboxrV�keybindings_edit_popover_label�#keybindings_edit_popover_button_box�)keybindings_edit_popover_add_button_label�,keybindings_edit_popover_remove_button_label�(keybindings_edit_popover_up_button_label�*keybindings_edit_popover_down_button_label�-keybindings_edit_popover_default_button_labels
          r`r:z1SetupUI._create_and_show_keybindings_edit_popover3s!��*-�����&��)�)�1��L�L�A�B���&�&�6�6��)�)�	+��&�&�3�3�C�4D�4D�4J�4J�K��&�&�2�2�4�8��&�&�2�2�4�8�(+���	�%�%�5�5��O�O�$�$�	&���%�6�6�v�>�%�4�4�V�<�%�4�4�V�<�%�7�7��?�%�1�1�&�9�),����&�&�/�/�
�6�7�
�
/�
/�
0�	1�	'�5�5�d�;�&�2�2�4�8�&�1�1�#�)�)�.�.�A�%�0�0�*�E�5�!�	=�03�0B�0B�0D��-��-�-�9�9�$�?��-�-�9�9�$�?��-�-�C�C�E�J��-�-�C�C�D�I�%�0�0��1�1�4��q�	B�.1�g�g�i�+�+�;�;��O�O�&�&�	(�+�9�9�%�@�%�)�)�/�	1�47�J�J�L��1�47�I�I�K�1�1�:�:�3�	5�1�@�@��F��1�1�5�5�5�	7��1�1�B�B�
�!�"�	$�	
�1�1�9�9��t�K�K�	M��1�1�?�?��E�7:�z�z�|��4�7:�y�y�{�4�4�=�=�3�	5�4�C�C�D�I��4�4�8�8�8�	:��4�4�E�E�
�+�,�	.�	
�4�4�<�<��t�N�N�	P��4�4�B�B�5�I�8;�
�
���5�36�:�:�<��0�36�9�9�;�0�0�9�9�5�	7�0�?�?��E��0�0�4�4�4�	6��0�0�A�A�
�#�$�	&�	
�0�0�8�8��t�J�J�	L�58�Z�Z�\��2�58�Y�Y�[�2�2�;�;�5�	7�2�A�A�$�G��2�2�6�6�6�	8��2�2�C�C�
�%�&�	(�	
�2�2�:�:��t�L�L�	N�8;�	�	��5�5�>�>�
���	!�5�D�D�T�J��5�5�9�9�9�	;��5�5�F�F�
�A�B�	D�	
�5�5�=�=���D�D�	F�	
�5�5�C�C�D�I�+�/�/��5�5�	7�+�/�/��8�8�	:�+�/�/��4�4�	6�+�/�/��6�6�	8�+�/�/��9�9�	;��&�&�*�*�+H�I��3�3�5��*�$��*�*�0�0�2��&�&�/�/�1rac�$�|j�y)u�
        Signal handler called when the “edit” button to edit the
        key bindings for a command has been clicked.
        N)r:�rLr�s  r`rz+SetupUI._on_keybindings_edit_button_clicked�s��	
�6�6�8rac���|jdd}|jdd}|j}|r-||vr(||j�||<|j|�yyy)u�
        Signal handler called when the “Set to default” button to reset the
        key bindings for a command to the default has been clicked.
        rQrr@N)r�rrurxr]s     r`rz.SetupUI._on_keybindings_default_button_clicked�su��#�1�1�-�@��K���.�.�}�=�f�E���4�4���w�"5�5�(;�G�(D�(I�(I�(K��W�%�� � �!1�2�6�7rac� �|jjd�|jtd��}|tj
jk(r!|j|jdd�|jjd�y)u�
        Signal handler called when the “Set all to default” button to reset the
        all key bindings top their defaults has been clicked.
        FzNDo you really want to set the key bindings for all commands to their defaults?rQrTN)	rrr�rrr�r�rxr�)rLr�r�s   r`rz2SetupUI._on_keybindings_all_default_button_clicked�s��	
�,�,�:�:�5�A��0�0�
�2�
3�
4���s�'�'�*�*�*�� � ��!4�!4�]�!C�I�!N�O��,�,�:�:�4�@rarcr�c��tjd||�||jdd<|r:|jj	dt
jj|��y|jj|�y)a�Sets the single wildchard character.

        :param single_wildcard_char: The character to use as a single wildcard
        :param update_gsettings: Whether to write the change to Gsettings.
                                 Set this to False if this method is
                                 called because the Gsettings key changed
                                 to avoid endless loops when the Gsettings
                                 key is changed twice in a short time.
        �(%s, update_gsettings = %s)r`r@N)
rxr�r�r�r�r	�Variant�
new_stringr8r�)rLrcr�s   r`rrz SetupUI.set_single_wildcard_char�sv��	���)� �"2�	4�
!�	
���0�1�&�9���O�O�%�%�$����'�'�(<�=�
?�
�,�,�5�5�6J�Krarec��tjd||�||jdd<|r:|jj	dt
jj|��y|jj|�y)a�Sets the single wildchard character.

        :param multi_wildcard_char: The character to use as a single wildcard
        :param update_gsettings: Whether to write the change to Gsettings.
                                 Set this to False if this method is
                                 called because the Gsettings key changed
                                 to avoid endless loops when the Gsettings
                                 key is changed twice in a short time.
        r�rar@N)
rxr�r�r�r�r	r�r�r<r�)rLrer�s   r`rszSetupUI.set_multi_wildcard_char�st��	���)��!1�	3�<O����/�0��8���O�O�%�%�#����'�'�(;�<�
>�
�+�+�4�4�5H�Ira�	page_sizec�8�tjd||�t|�}d|cxkrdkrmny||jdd<|r:|jjdtjj|��y|jj|�yy)a	Sets the page size of the lookup table

        :param page_size: The page size of the lookup table
                          (1 <= page size <= 10)
        :param update_gsettings: Whether to write the change to Gsettings.
                                 Set this to False if this method is
                                 called because the Gsettings key changed
                                 to avoid endless loops when the Gsettings
                                 key is changed twice in a short time.
        r�r&r8rPr@N)
rxr�r�r�r�r�r	r��	new_int32r�)rLr�r�s   r`r|zSetupUI.set_page_size	s���	���)�9�6F�	H��	�N�	��	��R��AJ�D��� 5�6�v�>�����)�)�)��L�L�*�*�9�5�7��*�*�4�4�Y�?� rarc��tjd||�t|�}d|cxkrdkr�ny||jdd<|r:|jjdtjj|��yt|j�D])\}}||dk(s�|jj|��+yy)aSets the page size of the lookup table

        :param orientation: The orientation of the lookup table
                            (0 < =orientation <= 2)
        :param update_gsettings: Whether to write the change to Gsettings.
                                 Set this to False if this method is
                                 called because the Gsettings key changed
                                 to avoid endless loops when the Gsettings
                                 key is changed twice in a short time.
        r�rrBrOr@r&N)
rxr�r�r�r�r�r	r�r�r�r�r�r�)rLrr�rYrZs     r`r~z$SetupUI.set_lookup_table_orientation$	s���	���)�;�8H�	J��+�&���� �q� �DO�D��� 8�9�&�A�����)�)�,��L�L�*�*�;�7�9�$-��<�<�$>�#�K�E�4�"�d�1�g�-��?�?�J�J�!�#�#�!ra�
input_modec��tjd||�t|�}d|cxkrdkrRny||jdd<|r:|jjdtjj|��yyy)aJSets whether direct input or the current table is used.

        :param input_mode: Whether to use direct input.
                           0: Use direct input.
                           1: Use the current table.
        :param update_gsettings: Whether to write the change to Gsettings.
                                 Set this to False if this method is
                                 called because the Gsettings key changed
                                 to avoid endless loops when the Gsettings
                                 key is changed twice in a short time.
        r�rr&rgr@N)	rxr�r�r�r�r�r	r�r�)rLr�r�s   r`r�zSetupUI.set_input_modeA	sx��	���)�:�7G�	I���_�
��
��a��7A�D����,�V�4�����)�)���L�L�*�*�:�6�8� � rarc�f�tjd||�t|�}||jdd<|r:|jjdtjj|��yt|j�D])\}}||dk(s�|jj|��+y)aiSets whether the input mode (direct or table) is remembered

        :param remember_input_mode: Whether to remember the input mode.
                                    False: Do not remember
                                    True:  Remember.
        :param update_gsettings: Whether to write the change to Gsettings.
                                 Set this to False if this method is
                                 called because the Gsettings key changed
                                 to avoid endless loops when the Gsettings
                                 key is changed twice in a short time.
        r�r?r@r&N)
rxr�r�r�r�r�r	r��new_booleanr�r�r�r�)rLrr�rYrZs     r`r�zSetupUI.set_remember_input_modeY	s���	���)�+>�@P�	R�"�#6�7��;N����/�0��8���O�O�%�%�#����(�(�)<�=�
?� )��)H�)H�I�
I���t�&�$�q�'�1��6�6�A�A�%�H�
Irarc��tjd||�t|�}d|cxkrdkr�ny||jdd<|r:|jjdtjj|��yt|j�D])\}}||dk(s�|jj|��+yy)a�Sets the candidate filter mode used for Chinese

        0 means to show simplified Chinese only
        1 means to show traditional Chinese only
        2 means to show all characters but show simplified Chinese first
        3 means to show all characters but show traditional Chinese first
        4 means to show all characters

        :param chinese_mode: The Chinese filter mode (0 <= mode <= 4)
        :param update_gsettings: Whether to write the change to Gsettings.
                                 Set this to False if this method is
                                 called because the dconf key changed
                                 to avoid endless loops when the dconf
                                 key is changed twice in a short time.
        r�rrDrEr@r&N)
rxr�r�r�r�r�r	r�r�r�r�r�r�)rLrr�rYrZs     r`r�zSetupUI.set_chinese_modet	s���$	���)�<�9I�	K��<�(����!��!�9E�D���
�.�v�6�����)�)�!��L�L�*�*�<�8�:�$-�T�-E�-E�#F�F�K�E�4�#�t�A�w�.��3�3�>�>�u�E�F�"rarc�f�tjd||�t|�}||jdd<|r:|jjdtjj|��yt|j�D])\}}||dk(s�|jj|��+y)a�Sets whether only single characters should be matched in
        the database.

        :param mode: Whether only single characters should be matched.
                     True: Match only single characters.
                     False: Possibly match multiple characters at once.
        :param update_gsettings: Whether to write the change to Gsettings.
                                 Set this to False if this method is
                                 called because the Gsettings key changed
                                 to avoid endless loops when the Gsettings
                                 key is changed twice in a short time.
        r�rYr@r&N)
rxr�r�r�r�r�r	r�r�r�r(r'r��rLrr�rYrZs     r`r�zSetupUI.set_onechar_mode�	s���	���)�4�1A�	C��D�z��15����I�&�v�.���O�O�%�%�����(�(��.�
0� )��)A�)A�B�
B���t��4��7�?��/�/�:�:�5�A�
Brac��tjd||�t|�}||jdd<|r:|jjdtjj|��y|jj|�y)aSets whether the first candidate will be selected
        automatically during typing.

        :param mode: Whether to select the first candidate automatically.
        :param update_gsettings: Whether to write the change to Gsettings.
                                 Set this to False if this method is
                                 called because the Gsettings key changed
                                 to avoid endless loops when the Gsettings
                                 key is changed twice in a short time.
        r�rZr@N)rxr�r�r�r�r�r	r�r�r*r��rLrr�s   r`r�zSetupUI.set_autoselect_mode�	sw��	���)�4�1A�	C��D�z��48����L�)�&�1���O�O�%�%�����(�(��.�
0�
�-�-�8�8��>rac�f�tjd||�t|�}||jdd<|r:|jjdtjj|��yt|j�D])\}}||dk(s�|jj|��+y)u�Sets whether automatic commits go into the preëdit or into the
        application.

        :param mode: Whether automatic commits  go into the  preëdit
                     or into the application.
                     True: Into the application.
                     False: Into the preedit.
        :param update_gsettings: Whether to write the change to Gsettings.
                                 Set this to False if this method is
                                 called because the Gsettings key changed
                                 to avoid endless loops when the Gsettings
                                 key is changed twice in a short time.
        r�r]r@r&N)
rxr�r�r�r�r�r	r�r�r�r.r-r�r�s     r`r�zSetupUI.set_autocommit_mode�	s��� 	���)�4�1A�	C��D�z��48����L�)�&�1���O�O�%�%�����(�(��.�
0� )��)D�)D�E�
E���t��4��7�?��2�2�=�=�e�D�
Erac��tjd||�t|�}d|cxkrdkr�ny||jdd<|r:|jjdtjj|��yt|j�D])\}}||dk(s�|jj|��+yy)a�Sets the commit invalid mode

        This selects what is committed when a character which is not
        in the set of valid input characters for the current table is
        typed.

        0 means to commit the current candidate
        1 means to commit the raw characters typed so far

        :param mode:             The mode (0 <= mode <= 1)
        :param update_gsettings: Whether to write the change to Gsettings.
                                 Set this to False if this method is
                                 called because the dconf key changed
                                 to avoid endless loops when the dconf
                                 key is changed twice in a short time.

        r�rr&r^r@N)
rxr�r�r�r�r�r	r�r�r�r2r1r�r�s     r`r�zSetupUI.set_commit_invalid_mode�	s���(	���)�4�1A�	C��4�y����>��>�?C�D��� 3�4�V�<�����)�)�'��L�L�*�*�4�0�2�$-�T�-L�-L�#M�M�K�E�4��t�A�w���:�:�E�E�e�L�M�rac��tjd||�t|�}||jdd<|r:|jjdtjj|��y|jj|�y)aSets whether a wildcard should be automatically appended
        to the input.

        :param mode: Whether to append a wildcard automatically.
        :param update_gsettings: Whether to write the change to Gsettings.
                                 Set this to False if this method is
                                 called because the Gsettings key changed
                                 to avoid endless loops when the Gsettings
                                 key is changed twice in a short time.
        r�r_r@N)rxr�r�r�r�r�r	r�r�r4r�r�s   r`r�zSetupUI.set_autowildcard_mode
sw��	���)�4�1A�	C��D�z��6:����N�+�F�3���O�O�%�%�����(�(��.�
0�
�/�/�:�:�4�@rac�f�tjd||�t|�}||jdd<|r:|jjdtjj|��yt|j�D])\}}||dk(s�|jj|��+y)uSets whether full width letters should be used
        while in “Table input” mode

        :param mode: Whether to use full width letters
        :param update_gsettings: Whether to write the change to Gsettings.
                                 Set this to False if this method is
                                 called because the Gsettings key changed
                                 to avoid endless loops when the Gsettings
                                 key is changed twice in a short time.
        r�rHr@r&N)
rxr�r�r�r�r�r	r�r�r�r�r�r�r�s     r`r�z(SetupUI.set_table_full_width_letter_mode
s���	���)�4�1A�	C��D�z��?C����3�4�V�<���O�O�%�%�'����(�(��.�
0� )��<�<� >�
���t��4��7�?��?�?�J�J���
rac�f�tjd||�t|�}||jdd<|r:|jjdtjj|��yt|j�D])\}}||dk(s�|jj|��+y)uSets whether full width punctuation should be used
        while in “Table input” mode

        :param mode: Whether to use full width punctuation
        :param update_gsettings: Whether to write the change to Gsettings.
                                 Set this to False if this method is
                                 called because the Gsettings key changed
                                 to avoid endless loops when the Gsettings
                                 key is changed twice in a short time.
        r�rIr@r&N)
rxr�r�r�r�r�r	r�r�r�r�r�r�r�s     r`r�z'SetupUI.set_table_full_width_punct_mode<
s���	���)�4�1A�	C��D�z��>B����2�3�F�;���O�O�%�%�&����(�(��.�
0� )��;�;� =�
���t��4��7�?��>�>�I�I���
rac�f�tjd||�t|�}||jdd<|r:|jjdtjj|��yt|j�D])\}}||dk(s�|jj|��+y)uSets whether full width letters should be used
        while in “Direct input” mode

        :param mode: Whether to use full width letters
        :param update_gsettings: Whether to write the change to Gsettings.
                                 Set this to False if this method is
                                 called because the Gsettings key changed
                                 to avoid endless loops when the Gsettings
                                 key is changed twice in a short time.
        r�rJr@r&N)
rxr�r�r�r�r�r	r�r�r�r�r�r�r�s     r`r�z)SetupUI.set_direct_full_width_letter_modeY
s���	���)�4�1A�	C��D�z��>B����2�3�F�;���O�O�%�%�&����(�(��.�
0� )��=�=� ?�
���t��4��7�?��@�@�K�K���
rac�f�tjd||�t|�}||jdd<|r:|jjdtjj|��yt|j�D])\}}||dk(s�|jj|��+y)uSets whether full width punctuation should be used
        while in “Direct input” mode

        :param mode: Whether to use full width punctuation
        :param update_gsettings: Whether to write the change to Gsettings.
                                 Set this to False if this method is
                                 called because the Gsettings key changed
                                 to avoid endless loops when the Gsettings
                                 key is changed twice in a short time.
        r�rKr@r&N)
rxr�r�r�r�r�r	r�r�r�r�r�r�r�s     r`r�z(SetupUI.set_direct_full_width_punct_modev
s���	���)�4�1A�	C��D�z��=A����1�2�6�:���O�O�%�%�%����(�(��.�
0� )��<�<� >�
���t��4��7�?��?�?�J�J���
rac��tjd||�||jdd<|r:|jj	dt
jj|��y|jj|�y)a�Sets the whether the lookup table is shown.

        :param mode: Whether to show the lookup table
        :param update_gsettings: Whether to write the change to Gsettings.
                                 Set this to False if this method is
                                 called because the Gsettings key changed
                                 to avoid endless loops when the Gsettings
                                 key is changed twice in a short time.
        r�rLr@N)
rxr�r�r�r�r	r�r�r�r�r�s   r`ryzSetupUI.set_always_show_lookup�
so��	���)�4�1A�	C�:>����.�/��7���O�O�%�%�"����(�(��.�
0�
�0�0�;�;�D�Ara�use_dark_themec��tjd||�||jdd<|r:|jj	dt
jj|��y|jj|�y)a�Sets the whether to use the color scheme for dark theme.

        :param use_dark_theme: Whether to use the color scheme for dark theme
        :param update_gsettings: Whether to write the change to Gsettings.
                                 Set this to False if this method is
                                 called because the Gsettings key changed
                                 to avoid endless loops when the Gsettings
                                 key is changed twice in a short time.
        r�rbr@N)
rxr�r�r�r�r	r�r�r>r�)rLr�r�s   r`r�zSetupUI.set_dark_theme�
sn��	���)�>�;K�	M�3A����K�(��0���O�O�%�%�����(�(��8�
:�
�,�,�7�7��Grarhc��tjd||�||jdd<|r:|jj	dt
jj|��y|jj|�y)a"Sets the whether dynamically adjust the candidates according to
        how often they are used.

        :param dynamic_adjust: Whether to dynamically adjust the candidates
        :param update_gsettings: Whether to write the change to Gsettings.
                                 Set this to False if this method is
                                 called because the Gsettings key changed
                                 to avoid endless loops when the Gsettings
                                 key is changed twice in a short time.
        r�rVr@N)
rxr�r�r�r�r	r�r�rr�)rLrhr�s   r`r�zSetupUI.set_dynamic_adjust�
sn��	���)�>�;K�	M�7E����O�,�V�4���O�O�%�%�����(�(��8�
:�
�,�,�7�7��Gra�error_soundc��tjd||�||jdd<|r:|jj	dt
jj|��y|jj|�y)a�Sets the whether to play a sound on error.

        :param error_sound: Whether to play a sound on error
        :param update_gsettings: Whether to write the change to Gsettings.
                                 Set this to False if this method is
                                 called because the Gsettings key changed
                                 to avoid endless loops when the Gsettings
                                 key is changed twice in a short time.
        r�rcr@N)
rxr�r�r�r�r	r�r�r@r�)rLr�r�s   r`r�zSetupUI.set_error_sound�
sn��	���)�;�8H�	J�4?����L�)�&�1���O�O�%�%�����(�(��5�
7�
�)�)�4�4�[�Arar3c�t�tjd||�t|t�sy||jdd<|r:|j
j
dtjj|��n|jj|�tstjd�ytjj|�stjd|�ytj |tj"�stjd|�y	tjd|�t$j&j)|�j+�}tjd	�y#t,t.f$rtj1d
�Yytj1d�YyxYw)a�Sets the path of file containing the sound to play on error.

        :param path: Full path of the .wav file containing the error sound.
        :param update_gsettings: Whether to write the change to Gsettings.
                                 Set this to False if this method is
                                 called because the Gsettings key changed
                                 to avoid endless loops when the Gsettings
                                 key is changed twice in a short time.
        r�Nrdr@z<No error sound because python3-simpleaudio is not available.z#Error sound file %s does not exist.z!Error sound file %s not readable.z1Trying to initialize and play error sound from %sz!Error sound could be initialized.zMInitializing error sound object failed.File not found or no read permissions.z;Initializing error sound object failed for unknown reasons.)rxr��
isinstancer�r�r�r�r	r�r�rDr��IMPORT_SIMPLEAUDIO_SUCCESSFULrjr3�isfile�access�R_OK�simpleaudio�
WaveObject�from_wave_file�play�FileNotFoundError�PermissionError�	exception)rLr3r��dummys    r`r�zSetupUI.set_error_sound_file�
sV��	���)�4�1A�	C��$��$��8<����,�-�f�5���O�O�%�%� ����'�'��-�
/�
�/�/�8�8��>�,��K�K�N�
P��7�7�>�>�$�'����A�4�H��Y�Y�t�R�W�W�-����?��F�0��K�K�K���$�.�.�=�=�d�C�H�H�J���K�K� C�D��)�?�;�B��$�$�A�B�0��$�$�/�0�s� AE9�9$F7�F7�debug_levelc�8�tjd||�t|�}d|cxkrdkrmny||jdd<|r:|jjdtjj|��y|jj|�yy)a�Sets the debug level

        :param debug level: The debug level (0 <= level <= 255)
        :param update_gsettings: Whether to write the change to Gsettings.
                                 Set this to False if this method is
                                 called because the Gsettings key changed
                                 to avoid endless loops when the Gsettings
                                 key is changed twice in a short time.
        r�r�rer@N)
rxr�r�r�r�r�r	r�r�rG)rLr�r�s   r`r�zSetupUI.set_debug_level!s���	���)�;�8H�	J��+�&����"�s�"�8C�D����-�f�5�����)�)� ��L�L�*�*�;�7�9��,�,�6�6�{�C�#rarQc
�f�tjd||�t|t�syt	j
|�}|jdd}tj||�|j}|j�}|rP|D]7}|j|d�|k(s�|j|dt||���9|j|�}|r�P|r�tj tj"di��}t%|�D]u}tj"j'tj(d�||D�cgc]!}tj"j+|���#c}�}	|j-||	��w|j.jd|j1��yycc}w)	arSet current key bindings

        :param keybindings: The key bindings to use
                            Commands which do not already
                            exist in the current key bindings dictionary
                            will be ignored.
        :param update_gsettings: Whether to write the change to Gsettings.
                                 Set this to False if this method is
                                 called because the Gsettings key changed
                                 to avoid endless loops when the Gsettings
                                 key is changed twice in a short time.
        r�NrQr@rr&za{sv}�s)rxr�r��dictrurvr�rnrwr��get_iter_firstr�r�r��	iter_nextr	�VariantDictr�r��	new_array�VariantTyper��insert_valuer��end)
rLrQr�r[rr;r\�variant_dict�x�
variant_arrays
          r`rxzSetupUI.set_keybindings9s��� 	���)�;�8H�	J��+�t�,���m�m�K�0���.�.�}�=�f�E���)�)�*:�K�H��0�0���'�'�)���+�
E���?�?�8�Q�/�7�:��O�O�H�a�$(�)9�'�)B�$C�E�
E����x�0�H����+�+�D�L�L��"�,E�F�L�!�"2�3�
B�� $��� 6� 6��$�$�S�)�.�w�7�9���\�\�,�,�Q�/�9�!:�
��)�)�'�=�A�
B�
�O�O�%�%��� � �"�
$���
9s�&F.)r)rN)T)r&T)TT)rT)FT)b�__name__�
__module__�__qualname__�__doc__r�rhr��staticmethodrr��INFOr�r�r�r�r�rr�r�r�r�rr9rKr�r�r7r:r=r�r�r�r�r�r�r)r�r+r/r3r5r�r�r�r�r�r?rr%rArErHr��TreePathr�r�
TreeSelectionrrb�
ListBoxRowrFrPrSrYr[r^rLr:rrrrrrsr�r|r~r�r�r�r�r�r�r�r�r�r�r�r�ryr�r�r�rr�r�rrrx�rar`rrws����WM�C�WM��WM�r B8�H
�-0�O�O�,@�,@�
��
��/�/�
�EI�
��
�!��!��8H�8H�!�F�������������#��$������3�:�:��$����� �\�\��03��8<��(� �#�*�*� �� �� �>��:�:�>�*.�>�06��)�)�6�58�6�=A�6�6��)�)�6�58�6�=A�6�K��>�>�K�.2�K�4��,�,�4�+/�4�<��,�,�<�+/�<�
5����
5��
5�
-����
-��
-�M�c�o�o�M�$�M�-��,�,�-�+/�-�
<�s�|�|�
<�PT�
<�O��/�/�O�.2�O�
-��,�,�-�+/�-�-��,�,�-�+/�-�-��,�,�-�+/�-�-��,�,�-�+/�-�P��/�/�P�.2�P�
H�S�_�_�H��H�L�S�_�_�L��L�?��:�:�?�*.�?�&I�#�/�/�I�d�I�:��:�:�:�*.�:�8#��>�>�#�.2�#�9��|�|�9��l�l�9�!�/�/�	9�59�	9�:?� �.�.�?�37�?� 'L��K�K�'L�69�n�n�'L�IM�'L�R7��:�:�7�*.�7�(
3��:�:�
3�*.�
3� ��:�:� �*.� �8 ��:�:� �*.� �83��:�:�3�*.�3�&:�P2�B9��:�:�9�*.�9�3��:�:�3�*.�3�A��:�:�A�*.�A�*;?�L�7:�L�37�L�CG�L�4:>�J�58�J�26�J�BF�J�204�@�!$�@�(,�@�8<�@�6?C�#�25�#�7;�#�GK�#�<*+�04�8�#&�8�)-�8�9=�8�2=A�9=�I�59�I�26�I�BF�I�8./�26�F�'*�F�+/�F�;?�F�B',�26�B�#�B�+/�B�;?�B�:*/�59�?�"&�?�.2�?�>B�?�2*/�59�E�"&�E�.2�E�>B�E�<&'�26� M�"� M�+/� M�;?� M�F,1�7;�A�$(�A�04�A�@D�A�4�%)����#��/3��>�%)����#��/3��>�%)����#��/3��>�%)����#��/3��>�%)�B��B�#�B�/3�B�2$)�%)�H� �H�#�H�/3�H�4&*�H� �H�#�H�/3�H�6&*�B��B�#�B�/3�B�4&*�/0���S��/�/0�#�/0�/3�/0�f26�D�%(�D�*.�D�:>�D�6&*�+$��t�C��c��N�3�S�8�9�+$�#�+$�/3�+$rarc	�h�eZdZdZ			d
dej
dededdfd�Zdejddfd	�Z	y)�
HelpWindowz�
    A window to show help

    :param parent: The parent object
    :param title: Title of the help window
    :param contents: Contents of the help window
    Nr�r"�contentsrc��tjj||��|r3|j|�|j	|�|jd�|j
d�|jdd�tj�|_	|jjtjj�|jjd�|j|j�tj�|_|j j#|�tj$�|_|j&j)|j �|j&j+d�|j&j-d�|j&j/tj0j2�|j&j5tj6j8�tj:�|_|j<j?d�|j<jAd�|j<j|j&�|jjC|j<ddd�tjD�|_#tjH�|_%|jJjMtOd��|jFj|jJ�|jFjQd|jR�tjTd�	�|_+|jVjY|jFddd�|jjC|jVddd
�|j[�y)Nr!TFiXi�rr7r6)�spacing�).rrgrh�
set_parent�set_transient_forro�set_destroy_with_parent�set_default_sizer��vboxr�r�r�r�r��
TextBuffer�text_buffer�insert_at_cursor�TextView�	text_view�
set_buffer�set_editable�set_cursor_visible�set_justification�
Justification�LEFT�
set_wrap_moder��WORDr��scrolledwindowr�r�r�r��close_buttonr��close_button_labelr�rr��_on_close_button_clickedr�hboxr�rI)rLr�r"r�s    r`rhzHelpWindow.__init__ns���	�
�
���D���.���O�O�F�#��"�"�6�*�
�N�N�4� ��$�$�U�+����c�3�'��G�G�I��	��	�	�!�!�#�/�/�":�":�;��	�	���a� ���������>�>�+������)�)�(�3����������!�!�$�"2�"2�3����#�#�E�*����)�)�%�0����(�(��):�):�)?�)?�@����$�$�S�\�\�%6�%6�7�!�0�0�2������'�'��-����'�'��-���������/��	�	���T�0�0�$��a�@��J�J�L���"%�)�)�+������6�6�q��{�C������d�5�5�6����!�!�)�T�-J�-J�K��H�H�Q�'��	��	�	���4�,�,�e�U�A�>��	�	���T�Y�Y��u�a�8��
�
�rar�c�$�|j�y)zU
        Close the input method help window when the close button is clicked
        N)r�r�s  r`r�z#HelpWindow._on_close_button_clicked�s
��	
���ra)Nrr)
r�r�r�r�rrgr�rhr�r�r�rar`r�r�fsW���'+� �!#�&����&��&��&�)-�&�P��
�
��t�rar��__main__zsetup-debug.log�H��zUTF-8)�when�interval�backupCount�encoding�delay�utc�atTimezP%(asctime)s %(filename)s line %(lineno)d %(funcName)s %(levelname)s: %(message)sz********** STARTING **********z.IBUS-WARNING **: Using the fallback 'C' locale�Czibus is not running.r�r&�IBUS_ENGINE_NAMEz^table:rr)r)dr��typingrrrrrzrj�rer��signal�argparse�localeru�logging�logging.handlersr��dbus.service�gir�
gi.repositoryrr	�set_application_name�set_prgnamer
rrr
�i18nrrr�	i18n_initr�r��ImportErrorr3r~rlrn�	getLoggerrx�get_major_version�get_minor_version�get_micro_versionrv�ArgumentParser�PARSER�add_argumentr��
parse_args�_ARGS�UNUSED_OLD_TRANSLATIONSrgrr�r��no_debug�NullHandler�LOG_HANDLER_NULLrk�
cache_home�LOGFILE�handlers�TimedRotatingFileHandler�LOG_HANDLER_TIME_ROTATE�	Formatter�
LOG_FORMATTER�setFormatter�setLevel�DEBUG�
addHandlerr��SIGINT�SIG_DFL�	setlocale�LC_ALL�Errorr��get_addressr�r�r�r�r�r�r��DIALOGr�r�r{r�ENGINE_NAME�environ�subr}�
print_help�SETUP_UI�mainr�rar`�<module>r*sA��2�����
�	�	��
��
���������u������������2�3�����#�$���u�����u�������������)�)� %��*��$(�!�
�H�H�Q�K��$�%����0������	��	�	�<�	(��$�s�$�$�&�$�s�$�$�&�$�s�$�$�&�(��
!��	 �	 �'�
)������/��	�	��"�
�$�����,���!�	�#�	���������~���}����m+$�c�j�j�m+$�^W4����4�l�z���~�~�.�7�.�.�0���'�'�,�,�*��*�*�,�.?�A��")�"2�"2�"K�"K���������#L�#��*��)�)�
��
�	 �,�,�]�;�����
�
�&����1�2����4�5�
�F�M�M�&�-�-����0�-���������+��K��t����!�"��"�"��/�/�'�'����.�.��O�O�&�&��3�4�	6��
	�
�
�������������#�#�K��-����;��j�j�!3�4���"�&�&��R��5�=�=�c�3�G�K�������;�/�H��C�H�H�J�e��iZ	�~�*�$)�!�*��d[�<�<�-����I�J���������,�-�s$�P�#P.�P+�*P+�.=Q/�.Q/

Zerion Mini Shell 1.0