3
6ßL]K  ã               @   sH   d dl mZ d dlmZ d dlmZmZ d dlm	Z	 G dd„ deƒZdS )é    )ÚImageResource)Ú
TaskWindow)ÚInstanceÚProperty)Úunicode_strc               @   sL   e Zd ZdZedƒZeeeƒdd�Zeedd�Z	dd„ Z
d	d
„ Zdd„ ZdS )r   z: A TaskWindow for use with the Envisage Tasks plugin.
    z&envisage.ui.tasks.api.TasksApplicationÚ_icon)Z
depends_onT)Ú
allow_nonec             C   sB   | j s| jdkr| j S | jj}| jjr>tdƒ}||| jjf }|S )zp If the application has a name, add it to the title. Otherwise,
            behave like the base class.
        Nz%s - %s)Z_titleZactive_taskÚnameÚapplicationr   )ÚselfÚtitleÚform© r   úC/tmp/pip-install-5sebvq2j/envisage/envisage/ui/tasks/task_window.pyÚ
_get_title   s    zTaskWindow._get_titlec             C   s*   | j dk	r| j S | jdk	r"| jjS dS dS )zHIf we have an icon return it, else delegate to the application.
        N)r   r
   Úicon)r   r   r   r   Ú	_get_icon+   s
    

zTaskWindow._get_iconc             C   s
   || _ dS )z:Explicitly set the icon to use.  None is allowed.
        N)r   )r   r   r   r   r   Ú	_set_icon5   s    zTaskWindow._set_iconN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r
   r   r   r   r   r   r   r   r   r   r   r   r      s   
r   N)
Zpyface.image_resourcer   Zpyface.tasks.apir   ZPyfaceTaskWindowZ
traits.apir   r   Zenvisage._compatr   r   r   r   r   Ú<module>   s   