
    Eg-                     :    d dl mZmZmZ d dlmZ  G d de      Zy)    )GioGObjectCScreensaver)
BaseClientc                   t     e Zd ZdZdej
                  j                  deffiZdZ	dZ
 fdZd Zd Zd	 Z xZS )
SessionClientz
    This client is for connecting to the session manager's Presence
    interface - it is responsible for triggering activation of the
    screensaver when the session goes into an idle state.
    idle-changedNzorg.gnome.SessionManagerz"/org/gnome/SessionManager/Presencec                     t         t        |   t        j                  j
                  t        j                  | j                  | j                         d| _
        y )NF)superr   __init__r   BusTypeSESSIONr   SessionPresenceProxyGSM_SERVICEGSM_PRESENCE_PATHidle)self	__class__s    :/usr/share/cinnamon-screensaver/dbusdepot/sessionClient.pyr   zSessionClient.__init__   sC    mT+CKK,?,?,8,M,M,0,<,<,0,B,B	D
 	    c                 P    | j                   j                  d| j                         y )Nzstatus-changed)proxyconnecton_status_changed)r   s    r   on_client_setup_completez&SessionClient.on_client_setup_complete   s    

+T-C-CDr   c                 t    |dk(  }|| j                   k7  r$|| _         | j                  d| j                          y y )N   r	   )r   emit)r   r   statusnew_idles       r   r   zSessionClient.on_status_changed   s5    Q;tyy  DIIIndii0 !r   c                     t        d       y )NzDFailed to connect to session manager - idle detection will not work.)print)r   argss     r   
on_failurezSessionClient.on_failure%   s    TUr   )__name__
__module____qualname____doc__r   SignalFlagsRUN_LASTbool__gsignals__r   r   r   r   r   r$   __classcell__)r   s   @r   r   r      sN     	,,55tdXFL 3K<E1Vr   r   N)gi.repositoryr   r   r   dbusdepot.baseClientr   r    r   r   <module>r1      s    5 4 +VJ Vr   