
    ?gG                         d dl mZ d dlZd dlmZmZ d dlmZ d dlm	Z	 d dl
 d dlmZ  G d d	      Z G d
 de	      Z G d de      Zy)    )PathN)ManageSpicesPageDownloadSpicesPage)Spice_Harvester)SidePage)*)GLibc                   6    e Zd Z ed      ZdZdZd Zd Zd Z	y)ModulezManage your actionsactionsprefsc                 4    d | _         t        ||       | _        y N)windowActionsViewSidePagesidePage)selfcontent_boxs     ;/usr/share/cinnamon/cinnamon-settings/modules/cs_actions.py__init__zModule.__init__   s    +K>    c                 ~    | j                   s1t        d       | j                  j                  | j                         y y )NzLoading Actions module)loadedprintr   loadr   )r   s    r   on_module_selectedzModule.on_module_selected   s-    {{*+MMt{{+ r   c                     || _         y r   )r   )r   r   s     r   _setParentRefzModule._setParentRef   s	    r   N)
__name__
__module____qualname___commentnamecategoryr   r   r    r   r   r   r      s&    %&GDH?,
r   r   c                   (     e Zd ZdZ fdZd Z xZS )r   actionc                 d    d| _         t        d      }t        |   t        d      d|||       y )N r(   Actionsz
cs-actions)module)RemoveStringr"   superr   )r   r   r,   keywords	__class__s       r   r   zActionsViewSidePage.__init__!   s5    X;9|X$V 	 	5r   c                   	 || _         t        | j                  | j                         | _        t	               | _        | j                  | j
                         d| j
                  _        t        | | j                  | j                         }| j
                  j                  |dt        d             t        | | j                  | j                  | j                         }| j
                  j                  |dt        d             t        j                  d      rt        j                         D ]  }t        |      j!                  d      }|j#                         s/t$        j&                  j)                  t+        |             	 dd l}|j/                  | j                         	d		j0                  _        d		j0                  _        d
	j0                  _        d	j0                  _        | j
                  j                  	dt        d             d	fd	}| j                   j;                  d|        y  y y # t<        $ r}t?        |       Y d }~ y d }~ww xY w)NT	installedManagemoreDownloadznemo-action-layout-editorznemo/layout-editorr   P         editorLayoutc                 (    j                         syy )NT)quit)r   eventdatar9   s      r   on_window_deletez2ActionsViewSidePage.load.<locals>.on_window_deleteE   s    #);;='+ $1r   zdelete-eventr   ) r   r   collection_typespicesSettingsStackstack
add_widgetexpandManageActionsPage
add_titledr"   r   r	   find_program_in_pathget_system_data_dirsr   joinpathexistssyspathappendstrnemo_action_layout_editorNemoActionsOrganizerpropsmargin_start
margin_end
margin_topmargin_bottomconnect	Exceptionr   )
r   r   manage_extensions_pagedownload_actions_pagedirrM   rP   r?   er9   s
            @r   r   zActionsViewSidePage.load(   s   %d&:&:DKKH"_


# 

!24dkk!R

4k1X;O 249M9Mt{{\`\g\g h

3VQz]K$$%@A002 Cy))*>?;;=HHOOCI.!8!:!O!OPTP[P[!\46124/24/572

--fh(L, ++N<LM ) B& % !a!s   B+H44	I=II)r   r    r!   r@   r   r   __classcell__r0   s   @r   r   r      s    O5$r   r   c                        e Zd Z ej                          dgZdZ ed      Z ed      Z	 ed      Z
 ed      Z ed      Z fdZ xZS )	rF   z/.local/share/nemo/actionsr(   EnableDisablezInstalled actions	Uninstallz
Remove allc                 >    t         |   || j                  ||       y r   )r.   r   r@   )r   parentrA   r   r0   s       r   r   zManageActionsPage.__init__W   s    !5!5vvFr   )r   r    r!   r	   get_home_dirdirectoriesr@   r"   instance_button_textremove_button_textinstalled_page_titleuninstall_button_textrestore_button_textr   r]   r^   s   @r   rF   rF   N   sd    'd'')**DEFKOX;901kNL/G Gr   rF   )pathlibr   rL   ExtensionCorer   r   Spicesr   SettingsWidgetsr   xapp.GSettingsWidgetsgi.repositoryr	   r   r   rF   r&   r   r   <module>rr      sB     
 > " $ #  $.( .`
G( 
Gr   