%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/rhythmbox/plugins/alternative-toolbar/__pycache__/
Upload File :
Create Path :
Current File : //lib/rhythmbox/plugins/alternative-toolbar/__pycache__/alttoolbar_controller.cpython-312.pyc

�

 ]eFP���ddlmZddlmZddlmZddlmZGd�de�ZGd�dej�Z	Gd	�d
e	�Z
Gd�de
�ZGd
�de
�ZGd�de
�Z
Gd�de
�ZGd�de
�ZGd�de
�ZGd�de
�ZGd�de
�ZGd�de
�ZGd�de
�ZGd�d e
�ZGd!�d"e
�ZGd#�d$e
�Zy%)&�)�CoverLocale)�GObject)�Gio)�Gtkc��eZdZdZdZdZdZy)�AltControllerCategoryr���N)�__name__�
__module__�__qualname__�OTHER�LOCAL�ONLINE�PLAYLIST���G/usr/lib/rhythmbox/plugins/alternative-toolbar/alttoolbar_controller.pyrrs��
�E�
�E�
�F��Hrrc�d��eZdZdZ�fd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Z�xZS)�AltControllerBasez
    base controller
    c�|��||_|jj|_d|_tt|��y��)
        Initialises the object.
        N)�header�find�_pixbuf�superr�__init__��selfr�	__class__s  �rrzAltControllerBase.__init__%s2�������K�K�$�$��	����
���/�1rc�"�tjS)z<
           return the category type for the source
        )rr�r!s r�get_categoryzAltControllerBase.get_category0s��
%�*�*�*rc��y)zm
            return the toolbar visibility
              by default None which means user controlled
        Nrr$s r�toolbar_visibilityz$AltControllerBase.toolbar_visibility7���rc�\�|jjr|jjSy)zR
          return the source icon
        :param source:
        :return:
        N)�props�icon�r!�sources  r�	get_giconzAltControllerBase.get_gicon?s$���<�<����<�<�$�$�$�rc��y)zT
          returns bool if the given source is applicable to the controller
        Frr,s  r�valid_sourcezAltControllerBase.valid_sourceKs��
rc��y)�=
           update the button controls on the header
        Nrr,s  r�update_controlsz!AltControllerBase.update_controlsR���
	
rc�P�|j�D]}|j|��y)zI
          remove any controls that are contained in a container
        N)�get_children�remove)r!�	container�childs   r�remove_controlsz!AltControllerBase.remove_controlsYs*���+�+�-�	$�E����U�#�	$rc��y)z8
          hide controls for a given controller
        Nrr,s  r�
hide_controlszAltControllerBase.hide_controls`r4rc��y)z�
          find the GtkEntry field corresponding to the search entry
          returns 1. the GtkWidget containing the GtkEntry
                  2. the GtkEntry
          returns None if nothing found
        Nr)r!�toolbar_containers  r�get_search_entryz"AltControllerBase.get_search_entrygs��rc��y)zw
          return GtkWidget corresponding to the toolbar within the source
                 None if no toolbar
        Nrr,s  r�get_toolbarzAltControllerBase.get_toolbarqr(rc��y)zI
          move from toolbar the widget and add to the searchbar
        Nr)r!�toolbar�widget�	searchbars    r�moveto_searchbarz"AltControllerBase.moveto_searchbaryr4rc�8�|jj�y)zE
          set the centre library song-category button label
        N)r�set_library_labelsr$s rrHz$AltControllerBase.set_library_labels�s��
	
���&�&�(r)rr
r�__doc__rr%r'r.r0r3r:r<r?rArFrH�
__classcell__�r"s@rrr sD����	2�+��
��
�$�
���
�)rrc�J��eZdZdZdZ�fd�Zd�Zd�Zd�Zd�Z	d�Z
d�Z�xZS)	�AltGenericControllerz5
    generic controller for the headerbar (only)
    c�H��tt|�|�i|_i|_yr)rrMr�centre_controls�end_controlsr s  �rrzAltGenericController.__init__�s%���	�"�D�2�6�:�!�����rc�"�tjS�N�rrr$s rr%z!AltGenericController.get_category����$�*�*�*rc�|�|jj|td��\}}|r|jd�yy)NzView AllF)r�has_button_with_label�_�set_visible)r!r-�val�view_buttons    rr<z"AltGenericController.hide_controls�s=���;�;�<�<�V�=>�z�]�L���[���#�#�E�*�rc�X�|j|dd�}t|�t|�|S)N�RBSourceToolbar�by_name)r�print)r!r-rCs   rrAz AltGenericController.get_toolbar�s(���)�)�F�$5�y�A��
�g��
�f�
��rc��|�td�y|j|dd�}|std�y|j|dd�}t|�||fS)Nzno container to search)NN�
RBSearchEntryr]zno RBSearchEntry found�GtkEntry)r^r)r!r8�search�entrys    rr?z%AltGenericController.get_search_entry�sX�����*�+�����9�o�y�A����*�+���	�	�&�*�i�8��
�e���u�}�rc�j�|j|�|jd�|j|�y)NF)r7rX�add)r!rCrbrEs    rrFz%AltGenericController.moveto_searchbar�s(�����v�����E�"��
�
�f�rc���|jj|�\}}|s'td�|jjd�n7td�|j	d�|jjd�d|j_|j
|�}|s1td�|j|jj�y|j|�||jv�rktd�i}|j|jj�t|�|j|�\}}|sy|jjr%|jjj	d�tjj�|j_|j!�}t|�|d}	tj"�}
|
j%tj&j(�|
j+|jjddd�|
j-�tj.j1||	�|
j+|	ddd	�|j3|
�|jj5|	||
�
�|j7|||jj�|j9dd�|jjj;|�|jjj	d�tj<j�}d
}tj>jA|tjBjD�}
|j3|
�|jjj3|�|jjjG|d�|j-�|jId|jjJ�|jj|d<||d<||j_||j|<t|�ytd�t|j|�|j|d}|jjr%|jjj	d�||j_|j|jj�|j|d}||j_|jjj-�|jjj	|jM��|jjj3|�|jjjG|d�|jjj-�y)r2zno browser viewFzbrowser view foundTNz:no toolbar so nothing left to do - cleanup endbox and exitzfirst time aroundrr	�r9�
old_parent�
new_parenti,���z"preferences-system-search-symbolic�toggledrE�
search_buttonzsecond time around)'r�is_browser_viewr^�set_library_box_sensitiverX�current_search_buttonrAr:�end_boxr<rPr?rEr�	SearchBar�newr6�Box�set_orientation�Orientation�VERTICAL�
pack_start�show_all�	Containerr7re�register_moved_controlrF�set_size_request�
connect_entry�ToggleButton�Image�new_from_icon_name�IconSize�
SMALL_TOOLBAR�
reorder_child�connect�search_button_toggled�
get_active)r!r-rY�browser_buttonrC�controlsrbrc�children�first�boxrl�sym�images              rr3z$AltGenericController.update_controls�sc��
#�k�k�9�9�&�A���^���#�$��K�K�1�1�%�8��&�'��&�&�u�-��K�K�1�1�$�7�,0����)��"�"�6�*����N�O�� � ����!4�!4�5�����7�#���*�*�*�
�%�&��H�� � ����!4�!4�5��'�N� �1�1�'�:�M�F�E����{�{�$�$����%�%�1�1�%�8�%(�M�M�$5�$5�$7�D�K�K�!��*�*�,�H��(�O��Q�K�E��'�'�)�C������� 8� 8�9��N�N�4�;�;�0�0�%��q�A��L�L�N��M�M� � ���/��N�N�5�$��a�0��J�J�s�O�
�K�K�.�.�U�:@�:=�
/�
?�
�!�!�'�6�4�;�;�3H�3H�I��"�"�3��+��K�K�!�!�/�/��6��K�K�!�!�-�-�e�4��,�,�0�0�2�M�6�C��	�	�,�,�S�#�,�,�2L�2L�M�
����e�$��K�K���#�#�M�2��K�K���-�-�m�Q�?��"�"�$��!�!�)�T�[�[�-N�-N�O�$(�K�K�$9�$9�H�[�!�(5�H�_�%�0=�D�K�K�-�(0�D���f�%��(�O��&�'��$�#�#�F�+�,��&�&�v�.�{�;�F��{�{�$�$����%�%�1�1�%�8�$*�D�K�K�!�
� � ����!4�!4�5� �-�-�f�5�o�F�M�0=�D�K�K�-��K�K�!�!�*�*�,��K�K�!�!�-�-�m�.F�.F�.H�I��K�K���#�#�M�2��K�K���-�-�m�Q�?��K�K���(�(�*r)
rr
rrI�!_AltGenericController__gtype_namerr%r<rAr?rFr3rJrKs@rrMrM�s3����*�L��+�+����m+rrMc�,��eZdZdZdZ�fd�Zd�Z�xZS)�AltMusicLibraryControllerz"
    music library controller
    c�,��tt|�|�yr)rr�rr s  �rrz"AltMusicLibraryController.__init__3s���	�'��7��?rc�0�dt|�jvS)�
          override
        �
LibrarySource��typerr,s  rr0z&AltMusicLibraryController.valid_source9s��
�$�v�,�"7�"7�7�7r)rr
rrI�&_AltMusicLibraryController__gtype_namerr0rJrKs@rr�r�-s����/�L�@�8rr�c�>��eZdZdZdZ�fd�Zd�Zd�Zd�Zd�Z	�xZ
S)�AltSoundCloudControllerz 
    sound-cloud controller
    c�:��tt|�|�d|_yr)rr�r�_has_toolbarr s  �rrz AltSoundCloudController.__init__Gs���	�%�t�5�f�=� ��rc�0�dt|�jvS)r��
SoundCloudr�r,s  rr0z$AltSoundCloudController.valid_sourceOs��
�t�F�|�4�4�4�4rc�"�tjSrR�rrr$s rr%z$AltSoundCloudController.get_categoryV���$�+�+�+rc�j�|jr|jS|j|dd�}||_|S)N�box1�by_id�r�r�r!r-�
search_boxs   rrAz#AltSoundCloudController.get_toolbarYs7������$�$�$��Y�Y�v�v�w�7�
�&����rc��|j�}|j|�|j|�|jj	|||��y�zv
          override - here we want to actually remove the toolbar from the
          source so get the parent
        rgN)�
get_parentr7rerrz�r!rCrDrE�parent_grids     rrFz(AltSoundCloudController.moveto_searchbarbsL���(�(�*�����7�#��
�
�g�����*�*��6A�6?�	+�	Ar)rr
rrI�$_AltSoundCloudController__gtype_namerr0r%rArFrJrKs@rr�r�As)����-�L�!�5�,��Arr�c�D��eZdZdZdZ�fd�Zd�Zd�Zd�Zd�Z	d�Z
�xZS)�AltCoverArtBrowserControllerz$
    CoverArtBrowser controller
    c�:��tt|�|�d|_yr)rr�rr�r s  �rrz%AltCoverArtBrowserController.__init__ws���	�*�D�:�6�B� ��rc�0�dt|�jvS)r��CoverArtBrowserr�r,s  rr0z)AltCoverArtBrowserController.valid_sources��
!�D��L�$9�$9�9�9rc�"�tjSrRrSr$s rr%z)AltCoverArtBrowserController.get_category�rTrc�f�|js|j|dd�}||_|jS)NrCr�r�r�s   rrAz(AltCoverArtBrowserController.get_toolbar�s1��� � ����6�9�g�>�J� *�D��� � � rc���|j�}|j|�|j|�|j�|jj|||��yr�)r�r7rerxrrzr�s     rrFz-AltCoverArtBrowserController.moveto_searchbar�sX���(�(�*�����7�#��
�
�g���������*�*��6A�6?�	+�	Arc�V�|j|dd�}|j|dd�}||fS)zF
          override - use the GtkEntry in the coverartbrowser
        �entry_search_alignmentr�rar])r)r!rC�entrysearchrcs    rr?z-AltCoverArtBrowserController.get_search_entry�s4��
�i�i��)A�7�K���	�	�+�z�9�=���E�!�!r)rr
rrI�)_AltCoverArtBrowserController__gtype_namerr0r%rArFr?rJrKs@rr�r�qs.����2�L�!�:�+�!�
A�"rr�c�8��eZdZdZdZ�fd�Zd�Zd�Zd�Z�xZ	S)�AltCoverArtPlaySourceControllerz'
    CoverArtPlaySource controller
    c�:��tt|�|�d|_yr)rr�rr�r s  �rrz(AltCoverArtPlaySourceController.__init__�s���	�-�t�=�f�E� ��rc�0�dt|�jvS)r��CoverArtPlaySourcer�r,s  rr0z,AltCoverArtPlaySourceController.valid_source�s��
$�t�F�|�'<�'<�<�<rc�"�tjSrRrSr$s rr%z,AltCoverArtPlaySourceController.get_category�rTrc��|js|j|dd�|_td|j�|jS)N�RBButtonBarr]z############)r�rr^r,s  rrAz+AltCoverArtPlaySourceController.get_toolbar�s<��� � � $�	�	�&�-�� K�D��
�n�d�/�/�0�� � � r)
rr
rrI�,_AltCoverArtPlaySourceController__gtype_namerr0r%rArJrKs@rr�r��s#����5�L�!�=�+�!rr�c�2��eZdZdZdZ�fd�Zd�Zd�Z�xZS)�AltQueueControllerz#
    RB QueueSource controller
    c�b��tt|�|�tjd��|_y)rzaudio-x-queue-symbolic��nameN)rr�rr�
ThemedIcon�_giconr s  �rrzAltQueueController.__init__�s&���	� �$�0��8��n�n�*B�C��rc�0�dt|�jvS)N�RBPlayQueueSourcer�r,s  rr0zAltQueueController.valid_source�s��"�d�6�l�&;�&;�;�;rc��|jSrR�r�r,s  rr.zAltQueueController.get_gicon�����{�{�r)	rr
rrI�_AltQueueController__gtype_namerr0r.rJrKs@rr�r��s����(�L�D�<�rr�c�8��eZdZdZdZ�fd�Zd�Zd�Zd�Z�xZ	S)�AltErrorsControllerz$
    RB ErrorsSource controller
    c�t��tt|�|�tjd��|_ddg|_y)rzdialog-error-symbolicr��RBImportErrorsSource�RBMissingFilesSourceN)rr�rrr�r��
_source_typesr s  �rrzAltErrorsController.__init__�s6���	�!�4�1�&�9��n�n�*A�B���4�4�6��rc��tt|�j�|jD]}|t|�jvs�yy�NT�r^r�rr��r!r-�source_types   rr0z AltErrorsController.valid_source�s>��
�d�6�l�#�#�$��-�-�	�K��d�6�l�3�3�3��	rc�"�tjSrRrSr$s rr%z AltErrorsController.get_category�rTrc��|jSrRr�r,s  rr.zAltErrorsController.get_gicon�r�r)
rr
rrI� _AltErrorsController__gtype_namerr0r%r.rJrKs@rr�r��s#����)�L�	6��+�rr�c�D��eZdZdZdZ�fd�Zd�Zd�Zd�Zd�Z	d�Z
�xZS)�AltRadioControllerz#
    RB RadioSource controller
    c�b��tt|�|�tjd��|_y)rzaudio-radio-symbolicr�N)rr�rrr�r�r s  �rrzAltRadioController.__init__s&���	� �$�0��8��n�n�*@�A��rc�0�dt|�jvS)N�RBIRadioSourcer�r,s  rr0zAltRadioController.valid_sources���4��<�#8�#8�8�8rc��|jSrRr�r,s  rr.zAltRadioController.get_giconr�rc�"�tjSrRr�r$s rr%zAltRadioController.get_categoryr�rc�N�|jjtd���y)N�Stations��
song_label)rrHrWr$s rrHz%AltRadioController.set_library_labelss�����&�&�!�J�-�&�@rc��yr�rr$s rr'z%AltRadioController.toolbar_visibility���r)rr
rrI�_AltRadioController__gtype_namerr0r.r%rHr'rJrKs@rr�r��s/����(�L�B�9��,�A�rr�c�8��eZdZdZdZ�fd�Zd�Zd�Zd�Z�xZ	S)�AltLastFMControllerz$
    RB LastFMSource controller
    c���tt|�|�tjd��|_tjd��|_y)rzlibrefm-symbolicr�zlastfm-symbolicN)rr�rrr��_libre_gicon�
_lastfm_giconr s  �rrzAltLastFMController.__init__!s9���	�!�4�1�&�9��N�N�0B�C��� �^�^�1B�C��rc�0�dt|�jvS)N�RBAudioscrobblerProfilePager�r,s  rr0z AltLastFMController.valid_source*s��,��V��0E�0E�E�Erc���t�}|j|jj�|jj
t
d�k(r|jS|jS)NzLibre.fm)	r�
switch_locale�Locale�RBr*r�rWr�r��r!r-�cls   rr.zAltLastFMController.get_gicon-sM��
�]��
��������&��<�<����*�
�-��$�$�$��%�%�%rc�"�tjSrRr�r$s rr%z AltLastFMController.get_category7r�r)
rr
rrI� _AltLastFMController__gtype_namerr0r.r%rJrKs@rr�r�s%����)�L�D�F�&�,rr�c�8��eZdZdZdZ�fd�Zd�Zd�Zd�Z�xZ	S)�AltPlaylistControllerz
    playlist controller
    c�:��tt|�|�tjd��|_tjd��|_tjd��|_tjd��|_tjd��|_	y)rzaudio-x-playlist-symbolicr�z#audio-x-playlist-automatic-symboliczstarred-symbolicz(audio-x-playlist-recently-added-symbolicz)audio-x-playlist-recently-played-symbolicN)
rr�rrr��
_static_gicon�_auto_gicon�_toprated_gicon�_recentlyadded_gicon�_recentlyplayed_giconr s  �rrzAltPlaylistController.__init__As����	�#�T�3�F�;�
�N�N� ;�<�	
��
�N�N� E�F�	
�� #�~�~�3E�F����N�N� J�K�	
�!�
�N�N� K�L�	
�"rc�0�dt|�jvS)r��PlaylistSourcer�r,s  rr0z"AltPlaylistController.valid_sourceRs�� �4��<�#8�#8�8�8rc��t�}|j|jj�t	|j
j�|j
jtd�k(s|j
jdk(r|jS|j
jtd�k(s|j
jdk(r|jS|j
jtd�k(s|j
jdk(r|jSdt|�jvr|jS|jS)NzMy Top RatedzRecently AddedzRecently Played�StaticPlaylistSource)rr�r�r�r^r*r�rWr�r�rr�rr�r�r�s   rr.zAltPlaylistController.get_giconXs���
�]��
��������&�
�f�l�l��� ��<�<����.� 1�1��<�<�$�$��6��'�'�'��<�<����"2� 3�3��<�<�$�$�(8�8��,�,�,��<�<����"3� 4�4��<�<�$�$�(9�9��-�-�-�!�T�&�\�%:�%:�:��%�%�%��#�#�#rc�"�tjSrR)rrr$s rr%z"AltPlaylistController.get_categoryns��$�-�-�-r)
rr
rrI�"_AltPlaylistController__gtype_namerr0r.r%rJrKs@rr�r�;s$����+�L�M�"9�$�,.rr�c�,�eZdZdZdZd�Zd�Zd�Zd�Zy)�AltPodcastControllerz
    podcast controller
    c�0�dt|�jvS)r��RBPodcastMainSourcer�r,s  rr0z!AltPodcastController.valid_sourcexs��%��V��(=�(=�=�=rc�"�tjSrRrSr$s rr%z!AltPodcastController.get_category~rTrc��t�}|j|jj�|jjt
d���y)N�Podcastsr�)rr�r��
LOCALE_DOMAINrrHrW)r!r�s  rrHz'AltPodcastController.set_library_labels�s:��
�]��
������0�0�1����&�&�!�J�-�&�@rc��yr�rr$s rr'z'AltPodcastController.toolbar_visibility�r�rN)	rr
rrI�!_AltPodcastController__gtype_namer0r%rHr'rrrrrrs#���*�L�>�+�A�rrc�2��eZdZdZdZ�fd�Zd�Zd�Z�xZS)�AltStandardOnlineController�I
      standard controller where we dont need specific customisation
    c�>��tt|�|�gd�|_y)r)�MagnatuneSource�
RBGriloSource�RadioBrowserSourceN)rrrr�r s  �rrz$AltStandardOnlineController.__init__�s���	�)�4�9�&�A�4��rc��tt|�j�|jD]}|t|�jvs�yy�NTFr�r�s   rr0z(AltStandardOnlineController.valid_source��C��
�d�6�l�#�#�$��-�-�	�K��d�6�l�3�3�3��	�rc�"�tjSrRr�r$s rr%z(AltStandardOnlineController.get_category�r�r)	rr
rrI�(_AltStandardOnlineController__gtype_namerr0r%rJrKs@rrr�s����1�L�4��,rrc�2��eZdZdZdZ�fd�Zd�Zd�Z�xZS)�AltStandardLocalControllerrc�<��tt|�|�dg|_y)r�RBMtpSourceN)rrrr�r s  �rrz#AltStandardLocalController.__init__�s���	�(�$�8��@�+�_��rc��tt|�j�|jD]}|t|�jvs�yyrr�r�s   rr0z'AltStandardLocalController.valid_source�rrc�"�tjSrRrSr$s rr%z'AltStandardLocalController.get_category�rTr)	rr
rrI�'_AltStandardLocalController__gtype_namerr0r%rJrKs@rrr�s����0�L�-��+rrc� �eZdZdZdZd�Zd�Zy)�AltAndroidControllerz
    android controller
    c�0�dt|�jvS)r��RBAndroidSourcer�r,s  rr0z!AltAndroidController.valid_source�s��!�D��L�$9�$9�9�9rc�"�tjSrRrSr$s rr%z!AltAndroidController.get_category�rTrN)rr
rrI�!_AltAndroidController__gtype_namer0r%rrrr%r%�s���*�L�:�+rr%N)�alttoolbar_preferencesr�
gi.repositoryrrr�objectr�ObjectrrMr�r�r�r�r�r�r�r�r�rrrr%rrr�<module>r.s���&/�!����F��e)����e)�Pb+�,�b+�J8� 4�8�(-A�2�-A�`6"�#7�6"�r!�&:�!�@�-��*�.��<�-��<,�.�,�@4.�0�4.�n�/��4,�"6�,�:+�!5�+�6
+�/�
+r

Zerion Mini Shell 1.0