Mini Shell

Direktori : /lib/python3.6/site-packages/orca/__pycache__/
Upload File :
Current File : //lib/python3.6/site-packages/orca/__pycache__/orca_gtkbuilder.cpython-36.pyc

3

�2[h�@sJdZdZdZdZdZdZddlZddlmZd	d
l	m
Z
Gdd�d�ZdS)
z)Displays a GUI for the user to quit Orca.z$Id$z
$Revision$z$Date$z-Copyright (c) 2005-2009 Sun Microsystems Inc.ZLGPL�N)�Gtk�)�_c@s8eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�ZdS)
�GtkBuilderWrappera�
    Superclass for GtkBuilder based applications. Just derive from this
    and your subclass should create methods whose names correspond to
    the signal handlers defined in the GtkBuilder file. Any other attributes
    in your class will be safely ignored.

    This class will give you the ability to do:
        subclass_instance.GtkWindow.method(...)
        subclass_instance.widget_name...
    cCs�tj�|_|jjtj��|jj|�|jj|�|_x|jj	�D]}|j
|�}q@W|j�i}x t|j
�D]}t||�||<qjW|jj|�dS)N)rZBuilder�builderZset_translation_domain�gettext�
textdomainZ
add_from_file�
get_objectZ	gtkWindowZget_objects�localize_widget�
set_orca_icon�dir�	__class__�getattrZconnect_signals)�selfZfileNameZ
windowName�obj�successZinstance_attributes�	attribute�r�%/usr/lib/python3.6/orca_gtkbuilder.py�__init__-s
zGtkBuilderWrapper.__init__cCsztjj�}yJ|jddd�}|jddd�}|jddd�}|jddd�}|jddd�}Wn
dStjj|||||f�dS)	zvGet the icon in all sizes from the current theme and set them as
        default for all application windows.
        Zorca�r��� �0N)rZ	IconThemeZget_defaultZ	load_iconZWindowZset_default_icon_list)rZ
icon_themeZicon16Zicon22Zicon24Zicon32Zicon48rrrrBs
zGtkBuilderWrapper.set_orca_iconcCs(|jj|�}|dkr$td|d��|S)a(Return the requested widget. This routine has been introduced
        (and calls to it made by the Orca GtkBuilder sub-classes), to prevent
        "No class attribute" pychecker errors caused when using __getattr__.

        Arguments:
        - attribute: name of the widget to return.
        NzWidget [z] not found)rr	�AttributeError)rr�widgetrrr�
get_widgetWs	zGtkBuilderWrapper.get_widgetcCs2|jj|�}|dkr$td|d��||j|<|S)NzWidget [z] not found)rr	r�__dict__)rrrrrr�__getattr__fs

zGtkBuilderWrapper.__getattr__cCs�y|j�}|j�}Wnd}d}YnXt|tj�r:dSy&|j�}|r^t|�r^|jt|��WnRy|j	�}Wn
dS|r�t|�r�|r�|j
t|��n|jt|��YnX|r�|jd�dS)z�Force the localization of the label/title of GtkBuilder objects

        Arguments:
        - obj: the GtkBuilder object whose label or title should be localized
        FNT)
Zget_use_markupZget_use_underline�
isinstancerZFrameZ	get_title�lenZ	set_titlerZ	get_labelZ
set_markupZ	set_labelZset_use_underline)rrZ	useMarkupZuseUnderline�title�textrrrr
ns0

z!GtkBuilderWrapper.localize_widgetN)	�__name__�
__module__�__qualname__�__doc__rrrrr
rrrrr!s
r)r'Z__id__�__version__Z__date__Z
__copyright__Z__license__rZ
gi.repositoryrZ	orca_i18nrrrrrr�<module>s