U
    9_                     @   sx   d dl mZ dd Zd dlT d dlZd dlZejejejd ddd	d
ddgZ	edZ
G dd
 d
ZG dd deZdS )    )Gtkc                 C   s   | S N )xr   r   5/usr/share/system-config-printer/troubleshoot/base.py<lambda>       r   )*N)Zdomain	localedirZ
debugprintZget_debuggingZset_debuggingQuestionMultichoiceTEXT_start_print_admin_toolzUTo start this tool, select System->Administration->Print Settings from the main menu.c                   @   sP   e Zd ZdddZdd Zdd Zdd	 Zd
d Zdd Zdd Z	dddZ
dS )r   Nc                    s   || _  r fdd| _d S )Nc                      s    S r   r   r   namer   r   r   ,   r   z#Question.__init__.<locals>.<lambda>)troubleshooter__str__)selfr   r   r   r   r   __init__)   s    zQuestion.__init__c                 C   s   dS )zXReturns True if this page should be displayed, or False
        if it should be skipped.Tr   r   r   r   r   display.   s    zQuestion.displayc                 C   s   d S r   r   )r   Zhandlerr   r   r   connect_signals3   s    zQuestion.connect_signalsc                 C   s   d S r   r   r   r   r   r   disconnect_signals6   s    zQuestion.disconnect_signalsc                 C   s   dS )NTr   r   r   r   r   can_click_forward9   s    zQuestion.can_click_forwardc                 C   s   i S r   r   r   r   r   r   collect_answer<   s    zQuestion.collect_answerc                 C   s   d S r   r   r   r   r   r   cancel_operation?   s    zQuestion.cancel_operation c                 C   sz   t  }|d |d |r.d| d }nd}||7 }t j|d}|dd |d |d ||ddd |S )	N   z"<span weight="bold" size="larger">z	</span>

r   )labelr   TF)	r   VBoxZset_border_widthset_spacingZLabelZset_alignmentZset_line_wrapZset_use_markup
pack_start)r   titletextZvboxsr   r   r   r   initial_vboxC   s    



zQuestion.initial_vbox)N)r   r   )__name__
__module____qualname__r   r   r   r   r   r   r   r$   r   r   r   r   r   (   s   
c                   @   s   e Zd ZdddZdd ZdS )r   Nc                 C   s   t | || | ||}t }|d ||ddd || _g | _d }	|D ]J\}
}|	rltj	
|	|
}	ntj	g |
}	||	ddd | j|	|f qP|||  d S )N   Fr   )r   r   r$   r   r   r   r    question_tagwidgetsZRadioButtonZnew_with_label_from_widgetZnew_with_labelappendZnew_page)r   r   r)   Zquestion_titleZquestion_textchoicesr   ZpageZchoice_vboxbuttonZchoicetagr   r   r   r   T   s    
zMultichoice.__init__c                 C   s*   | j D ]\}}| r| j|i  S qd S r   )r*   Z
get_activer)   )r   r-   Z
answer_tagr   r   r   r   i   s    zMultichoice.collect_answer)N)r%   r&   r'   r   r   r   r   r   r   r   S   s    
)Zgi.repositoryr   ZN_debugZconfiggettextinstallZPACKAGEr
   __all__r   r   r   r   r   r   r   <module>   s   +