
    eh	                         d Z ddlZddlZ ej                  dd       ddlmZmZ ddlmZ  ej                  e
      Z G d dej                        Zy)	z
 SimpleGladeApp.py
 Module that provides an object oriented abstraction to pygtk and gtkbuilder
 Copyright (C) 2009 Michael Vogt
 based on ideas from SimpleGladeBuilder by Sandino Flores Moreno
    NGtkz3.0)r   Gio)setup_uic                   ,    e Zd Zd ZddZd Zd Zd Zy)SimpleGtkbuilderAppc                     t         j                  j                  | dt        j                  j
                         t        | ||       | j                  d| j                         y )Nzcom.ubuntu.SoftwareProperties)application_idflagsactivate)	r   Application__init__r   ApplicationFlags
FLAGS_NONEr   connecton_activate)selfpathdomains      L/usr/lib/python3/dist-packages/softwareproperties/gtk/SimpleGtkbuilderApp.pyr   zSimpleGtkbuilderApp.__init__    sN      6U'*';';'F'F 	! 	HtV$Z!1!12    Nc                     | j                  | j                         | j                  j                         s| j                  j                          y y N)
add_windowwindow_main
is_visibleshow)r   datas     r   r   zSimpleGtkbuilderApp.on_activate&   s=    (()**,!!# -r   c                     	 t         j                  j                  | d       y# t        $ r | j	                          Y yw xY w)z
        Starts the main loop of processing events checking for Control-C.

        The default implementation checks wheter a Control-C is pressed,
        then calls on_keyboard_interrupt().

        Use this method for starting programs.
        N)r   r   runKeyboardInterrupton_keyboard_interruptr   s    r   r   zSimpleGtkbuilderApp.run,   s6    	)OOd+  	)&&(	)s    # ??c                      y)z
        This method is called by the default implementation of run()
        after a program is finished by pressing Control-C.
        N r"   s    r   r!   z)SimpleGtkbuilderApp.on_keyboard_interrupt:   s    
 	r   c                 B    t         j                  j                  |        y)a  
        Quit processing events.
        The default implementation calls Gtk.main_quit()

        Useful for applications that needs a non gtk main loop.
        For example, applications based on gstreamer needs to override
        this method with gst.main_quit()
        N)r   r   quitr"   s    r   r&   zSimpleGtkbuilderApp.quitA   s     	T"r   r   )__name__
__module____qualname__r   r   r   r!   r&   r$   r   r   r   r      s    3$)	#r   r   )__doc__logginggirequire_versiongi.repositoryr   r   softwareproperties.gtk.utilsr   	getLoggerr'   LOGr   r   r$   r   r   <module>r2      sL   *  	   5%   " 1Gh,##// ,#r   