
    ?gw                         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	m
Z
  G d d      Z G d d	e      Z G d
 de      Zy)    )ManageSpicesPageDownloadSpicesPage)Spice_Harvester)SidePage)*)GLibGtkc                   6    e Zd Z ed      ZdZdZd Zd Zd Z	y)ModulezManage your Cinnamon deskletsdeskletsprefsc                 4    d | _         t        ||       | _        y N)windowDeskletsViewSidePagesidePage)selfcontent_boxs     </usr/share/cinnamon/cinnamon-settings/modules/cs_desklets.py__init__zModule.__init__   s    ,[$?    c                 ~    | j                   s1t        d       | j                  j                  | j                         y y )NzLoading Desklets 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'    /0GDH@,
r   r   c                   (     e Zd ZdZ fdZd Z xZS )r   deskletc                 ~    t        d      | _        t        d      }t        t        |   t        d      d|||       y )NzRYou can remove specific instances from the desktop via that desklet's context menuzdesklet, desktop, slideshowDeskletszcs-desklets)module)r"   RemoveStringsuperr   r   )r   r   r+   keywords	__class__s       r   r   zDeskletsViewSidePage.__init__   s>    rs23"D21Z=-QY[fou2vr   c                 b   || _         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
                  j                  |dt        d             |j                  t        d            }d	t        d
      gdt        d      gdt        d      gg}t        j                  t        j                   j"                        }t%        t        d      dd|t&              }|j)                  |ddd	       t        j*                         }	|	j-                  dt        d      z         |	j/                         j1                  d       |j)                  |	ddd	       t        j*                         }
|
j-                  dt        d      z         |
j/                         j1                  d       |j)                  |
ddd	       |j3                  |       |j3                  t5        t        d      dd             |j7                  t9        t        d      dddd	ddd      dd       |j                  d      }|j3                  t5        t        d       dd!             y )"NT	installedManagemoreDownloadgeneralzGeneral SettingszGeneral Desklets Settingsr   zNo decoration   zBorder only   zBorder and header)orientationzDecoration of deskletszorg.cinnamonzdesklet-decorations)valtypeFz<i><small>%s</small></i>zBNote: Some desklets require the border/header to be always presentz	dim-labelz5Such requirements override the settings selected herezSnap desklets to gridzdesklet-snapzWidth of desklet snap gridzdesklet-snap-interval d      z'Lock desklets in their current positionzlock-desklets)r   r   collection_typespicesSettingsStackstack
add_widgetexpandManageDeskletsPage
add_titledr"   r   SettingsPageadd_sectionr	   BoxOrientationVERTICALGSettingsComboBoxint
pack_startLabel
set_markupget_style_context	add_classadd_rowGSettingsSwitchadd_reveal_rowGSettingsSpinButton)r   r   manage_extensions_pagedownload_desklets_pagepagesettingsdecwidget	combo_boxline1line2s              r   r   zDeskletsViewSidePage.load#   s   %d&:&:DKKH"_


# 

!3D$++t{{!S

4k1X;O!3D$:N:NPTP[P[]a]h]h!i

4fa
mL~

dIq1C/DE##A&A$BC1_%&Am,<(=1EXCY?Z[S__%=%=>%a(@&A>Shjmwz{	)UE15		3a8|6}}~!++K8%tQ/		3a8o6ppq!++K8%tQ/ +B)C^Ucde 3A6R4SUce|  A  CD  FI  KL  NO  !P  R`  bp  	q##B'+T)UWegvwxr   )r   r    r!   r=   r   r   __classcell__r/   s   @r   r   r      s    Ow&yr   r   c                        e Zd Zd ej                         z  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 )
rC   z!%s/.local/share/cinnamon/deskletsz/usr/share/cinnamon/deskletsr(   zInstalled deskletsAddRemove	Uninstallz
Remove allc                 F    t         t        |   || j                  ||       y r   )r-   rC   r   r=   )r   parentr>   r   r/   s       r   r   zManageDeskletsPage.__init__T   s      $09M9MvW]^r   )r   r    r!   r   get_home_dirdirectoriesr=   r"   installed_page_titleinstance_button_textremove_button_textuninstall_button_textrestore_button_textr   r^   r_   s   @r   rC   rC   K   sd    69J9J9J9LLNlmKO12U88kNL/_ _r   rC   N)ExtensionCorer   r   Spicesr   SettingsWidgetsr   xapp.GSettingsWidgetsgi.repositoryr   r	   r   r   rC   r&   r   r   <module>rr      s>    ? " $ # # "/y8 /yb
_) 
_r   