Ejemplo n.º 1
0
 def __init__(self, name, icon, keywords, content_box, collection_type,
              module):
     self.RemoveString = _(
         "You can remove specific instances from the desktop via that desklet's context menu"
     )
     ExtensionSidePage.__init__(self, name, icon, keywords, content_box,
                                collection_type, module)
Ejemplo n.º 2
0
 def __init__(self, name, icon, keywords, content_box, collection_type,
              target, module):
     self.RemoveString = _(
         "You can remove specific instances in panel edit mode via the context menu."
     )
     ExtensionSidePage.__init__(self, name, icon, keywords, content_box,
                                collection_type, target, module)
Ejemplo n.º 3
0
class Module:
    def __init__(self, content_box):
        keywords = _("applet")
        self.name = "applets"
        # for i18n replacement in ExtensionCore.py
        noun = _("applet")
        pl_noun = _("applets")
        target = _("panel")
        self.comment = _("Manage Cinnamon applets")
        self.sidePage = ExtensionSidePage(_("Applets"), "cs-applets", keywords, content_box, "applet", noun, pl_noun, target, module=self)        
        self.sidePage.RemoveString = _("You can remove specific instances in panel edit mode via the context menu.")
        self.category = "prefs"

    def on_module_selected(self):
        if not self.loaded:
            print "Loading Applets module"
            self.sidePage.load()

    def _setParentRef(self, window, builder):
        self.sidePage.window = window
        self.sidePage.builder = builder

    def toSettingString(self, uuid, instanceId):
        return ("panel1:right:0:%s:%d") % (uuid, instanceId)

    def fromSettingString(self, string):
        panel, side, position, uuid, instanceId = string.split(":")
        return uuid

    def getAdditionalPage(self):
        return None
Ejemplo n.º 4
0
class Module:
    def __init__(self, content_box):
        keywords = _("extension, addon")
        self.name = "extensions"
        self.comment = _("Manage your Cinnamon extensions")
        # for i18n replacement in ExtensionCore.py
        noun = _("extension")
        pl_noun = _("extensions")
        # we do not translate Cinnamon
        target = "Cinnamon"
        self.sidePage = ExtensionSidePage(_("Extensions"), "cs-extensions", keywords, content_box, "extension", noun, pl_noun, target, module=self)
        self.sidePage.RemoveString = ""
        self.category = "prefs"

    def on_module_selected(self):
        if not self.loaded:
            print "Loading Desklets module"
            self.sidePage.load()

    def _setParentRef(self, window, builder):
        self.sidePage.window = window
        self.sidePage.builder = builder

    def toSettingString(self, uuid, instanceId):
        return uuid

    def fromSettingString(self, string):
        return string

    def getAdditionalPage(self):
        return None
Ejemplo n.º 5
0
 def add_remove_cinnamon_themes(self, widget):
     window = Gtk.Window()
     box = Gtk.VBox()
     window.add(box)
     window.set_title(_("Desktop themes"))
     window.set_default_size(720, 480)
     window.set_border_width(6)
     window.set_position(Gtk.WindowPosition.CENTER)
     page = ExtensionSidePage(self.name, self.icon, self.keywords, box, "theme", None)
     page.load(window=window)
     box.pack_start(page.vbox, True, True, 6)
     window.show_all()
     return True
Ejemplo n.º 6
0
 def add_remove_cinnamon_themes(self, widget):
     window = Gtk.Window()
     box = Gtk.VBox()
     window.add(box)
     window.set_title(_("Desktop themes"))
     window.set_default_size(720, 480)
     window.set_border_width(6)
     window.set_position(Gtk.WindowPosition.CENTER)
     page = ExtensionSidePage(self.name, self.icon, self.keywords, box, "theme", None)
     page.load(window=window)
     box.pack_start(page.vbox, True, True, 6)
     window.show_all()
     return True
Ejemplo n.º 7
0
class Module:
    def __init__(self, content_box):
        keywords = _("desklet, desktop, slideshow")
        self.name = "desklets"
        self.comment = _("Manage your Cinnamon desklets")
        # for i18n replacement in ExtensionCore.py
        noun = _("desklet")
        pl_noun = _("desklets")
        target = _("desktop")
        self.sidePage = ExtensionSidePage(_("Desklets"), "cs-desklets", keywords, content_box, "desklet", noun, pl_noun, target, module=self)
        self.sidePage.RemoveString = _("You can remove specific instances from the desktop via that desklet's context menu")
        self.category = "prefs"

    def on_module_selected(self):
        if not self.loaded:
            print "Loading Desklets module"
            self.sidePage.load()

    def _setParentRef(self, window, builder):
        self.sidePage.window = window
        self.sidePage.builder = builder

    def toSettingString(self, uuid, instanceId):
        return ("%s:%d:0:100") % (uuid, instanceId)

    def fromSettingString(self, string):
        uuid, instanceId, x, y = string.split(":")
        return uuid

    def getAdditionalPage(self):
        scrolled_window = Gtk.ScrolledWindow()
        scrolled_window.label = Gtk.Label.new(_("General Desklets Settings"))
        config_vbox = Gtk.VBox()
        scrolled_window.add_with_viewport(config_vbox)
        config_vbox.set_border_width(5)

        dec = [[0, _("No decoration")], [1, _("Border only")], [2, _("Border and header")]]
        dec_combo = GSettingsIntComboBox(_("Decoration of desklets"), "org.cinnamon", "desklet-decorations", None, dec)

        label = Gtk.Label.new()
        label.set_markup("<i><small>%s\n%s</small></i>" % (_("Note: Some desklets require the border/header to be always present"), _("Such requirements override the settings selected here")))

        desklet_snap = GSettingsCheckButton(_("Snap desklets to grid"), "org.cinnamon", "desklet-snap", None)
        desklet_snap_interval = GSettingsSpinButton(_("Width of desklet snap grid"), "org.cinnamon", "desklet-snap-interval", "org.cinnamon/desklet-snap", 0, 100, 1, 5, "")

        config_vbox.pack_start(dec_combo, False, False, 2)
        config_vbox.pack_start(label, False, False, 2)
        config_vbox.pack_start(desklet_snap, False, False, 2)
        config_vbox.pack_start(desklet_snap_interval, False, False, 2)

        return scrolled_window
Ejemplo n.º 8
0
 def __init__(self, content_box):
     keywords = _("applet")
     self.name = "applets"
     # for i18n replacement in ExtensionCore.py
     noun = _("applet")
     pl_noun = _("applets")
     target = _("panel")
     self.comment = _("Manage Cinnamon applets")
     self.sidePage = ExtensionSidePage(_("Applets"), "cs-applets", keywords, content_box, "applet", noun, pl_noun, target, module=self)        
     self.sidePage.RemoveString = _("You can remove specific instances in panel edit mode via the context menu.")
     self.category = "prefs"
Ejemplo n.º 9
0
 def __init__(self, content_box):
     keywords = _("desklet, desktop, slideshow")
     self.name = "desklets"
     self.comment = _("Manage your Cinnamon desklets")
     # for i18n replacement in ExtensionCore.py
     noun = _("desklet")
     pl_noun = _("desklets")
     target = _("desktop")
     self.sidePage = ExtensionSidePage(_("Desklets"), "cs-desklets", keywords, content_box, "desklet", noun, pl_noun, target, module=self)
     self.sidePage.RemoveString = _("You can remove specific instances from the desktop via that desklet's context menu")
     self.category = "prefs"
Ejemplo n.º 10
0
 def __init__(self, content_box):
     keywords = _("extension, addon")
     self.name = "extensions"
     self.comment = _("Manage your Cinnamon extensions")
     # for i18n replacement in ExtensionCore.py
     noun = _("extension")
     pl_noun = _("extensions")
     # we do not translate Cinnamon
     target = "Cinnamon"
     self.sidePage = ExtensionSidePage(_("Extensions"), "cs-extensions", keywords, content_box, "extension", noun, pl_noun, target, module=self)
     self.sidePage.RemoveString = ""
     self.category = "prefs"
Ejemplo n.º 11
0
 def __init__(self, content_box):
     keywords = _("themes, style")
     self.comment = _("Manage themes to change how your desktop looks")
     self.name = "themes"
     # for i18n replacement in ExtensionCore.py
     noun = _("theme")
     pl_noun = _("themes")
     # We do not translate Cinnamon
     target = "Cinnamon"
     self.sidePage = ExtensionSidePage(_("Themes"), "cs-themes", keywords, content_box, "theme", noun, pl_noun, target, module=self)        
     self.sidePage.removeString = ""        
     self.category = "appear"
Ejemplo n.º 12
0
 def __init__(self, name, icon, keywords, content_box, collection_type, noun, pl_noun, target, module):
     self.RemoveString = _("You can remove specific instances in panel edit mode via the context menu.")
     ExtensionSidePage.__init__(self, name, icon, keywords, content_box, collection_type, noun, pl_noun, target, module)
Ejemplo n.º 13
0
 def __init__(self, name, icon, keywords, content_box, collection_type,
              module):
     self.RemoveString = ""
     ExtensionSidePage.__init__(self, name, icon, keywords, content_box,
                                collection_type, module)
Ejemplo n.º 14
0
 def __init__(self, name, icon, keywords, content_box, collection_type, noun, pl_noun, target, module):
     self.RemoveString = ""
     ExtensionSidePage.__init__(self, name, icon, keywords, content_box, collection_type, noun, pl_noun, target, module)
Ejemplo n.º 15
0
 def __init__(self, name, icon, keywords, advanced, content_box,
              collection_type, noun, pl_noun, target):
     self.RemoveString = ""
     ExtensionSidePage.__init__(self, name, icon, keywords, advanced,
                                content_box, collection_type, noun, pl_noun,
                                target)
Ejemplo n.º 16
0
 def __init__(self, name, icon, keywords, advanced, content_box, collection_type, noun, pl_noun, target):
     self.RemoveString = _("You can remove specific instances from the desktop via that desklet's context menu")
     ExtensionSidePage.__init__(self, name, icon, keywords, advanced, content_box, collection_type, noun, pl_noun, target)
Ejemplo n.º 17
0
class Module:
    def __init__(self, content_box):
        keywords = _("themes, style")
        self.comment = _("Manage themes to change how your desktop looks")
        self.name = "themes"
        # for i18n replacement in ExtensionCore.py
        noun = _("theme")
        pl_noun = _("themes")
        # We do not translate Cinnamon
        target = "Cinnamon"
        self.sidePage = ExtensionSidePage(_("Themes"), "cs-themes", keywords, content_box, "theme", noun, pl_noun, target, module=self)        
        self.sidePage.removeString = ""        
        self.category = "appear"

    def on_module_selected(self):
        if not self.loaded:
            print "Loading Themes module"
            self.sidePage.load()

    def _setParentRef(self, window, builder):
        self.sidePage.window = window
        self.sidePage.builder = builder
    
    def toSettingString(self, uuid, instanceId):
        return uuid

    def fromSettingString(self, string):
        return string
        
    def _make_group(self, group_label, root, key, schema):
        self.size_groups = getattr(self, "size_groups", [SizeGroup.new(SizeGroupMode.HORIZONTAL) for x in range(2)])
        
        box = Gtk.HBox()
        label = Gtk.Label.new()
        label.set_markup(group_label)
        label.props.xalign = 0.0
        self.size_groups[0].add_widget(label)
        box.pack_start(label, False, False, 4)

        w = GSettingsComboBox("", root, key, None, schema)
        self.size_groups[1].add_widget(w)
        box.add(w)
        
        return box

    def getAdditionalPage(self):
        scrolledWindow = Gtk.ScrolledWindow()
        scrolledWindow.label = Gtk.Label.new(_("Other settings"))

        other_settings_box = Gtk.VBox()
        
        scrolledWindow.add_with_viewport(other_settings_box)
        
        other_settings_box.pack_start(self._make_group(_("Controls"), "org.cinnamon.desktop.interface", "gtk-theme", self._load_gtk_themes()), False, False, 2)
        other_settings_box.pack_start(self._make_group(_("Icons"), "org.cinnamon.desktop.interface", "icon-theme", self._load_icon_themes()), False, False, 2)
        other_settings_box.pack_start(self._make_group(_("Window borders"), "org.cinnamon.desktop.wm.preferences", "theme", self._load_window_themes()), False, False, 2)
        other_settings_box.pack_start(self._make_group(_("Mouse Pointer"), "org.cinnamon.desktop.interface", "cursor-theme", self._load_cursor_themes()), False, False, 2)
        other_settings_box.pack_start(self._make_group(_("Keybindings"), "org.cinnamon.desktop.interface", "gtk-key-theme", self._load_keybinding_themes()), False, False, 2)

        menusHaveIconsCB = GSettingsCheckButton(_("Show icons in menus"), "org.cinnamon.settings-daemon.plugins.xsettings", "menus-have-icons", None)
        other_settings_box.pack_start(menusHaveIconsCB, False, False, 2)

        buttonsHaveIconsCB = GSettingsCheckButton(_("Show icons on buttons"), "org.cinnamon.settings-daemon.plugins.xsettings", "buttons-have-icons", None)
        other_settings_box.pack_start(buttonsHaveIconsCB, False, False, 2)

        return scrolledWindow

    def _load_gtk_themes(self):
        """ Only shows themes that have variations for gtk+-3 and gtk+-2 """
        dirs = ("/usr/share/themes", os.path.join(os.path.expanduser("~"), ".themes"))
        valid = walk_directories(dirs, lambda d: os.path.exists(os.path.join(d, "gtk-2.0")) and os.path.exists(os.path.join(d, "gtk-3.0")))
        valid.sort(lambda a,b: cmp(a.lower(), b.lower()))
        res = []
        for i in valid:
            res.append((i, i))
        return res
    
    def _load_icon_themes(self):
        dirs = ("/usr/share/icons", os.path.join(os.path.expanduser("~"), ".icons"))
        valid = walk_directories(dirs, lambda d: os.path.isdir(d) and not os.path.exists(os.path.join(d, "cursors")) and os.path.exists(os.path.join(d, "index.theme")))
        valid.sort(lambda a,b: cmp(a.lower(), b.lower()))
        res = []
        for i in valid:
            res.append((i, i))
        return res
        
    def _load_keybinding_themes(self):
        dirs = ("/usr/share/themes", os.path.join(os.path.expanduser("~"), ".themes"))
        valid = walk_directories(dirs, lambda d: os.path.isfile(os.path.join(d, "gtk-3.0", "gtk-keys.css")) and os.path.isfile(os.path.join(d, "gtk-2.0-key", "gtkrc")))
        valid.sort(lambda a,b: cmp(a.lower(), b.lower()))
        res = []
        for i in valid:
            res.append((i, i))
        return res
        
    def _load_cursor_themes(self):
        dirs = ("/usr/share/icons", os.path.join(os.path.expanduser("~"), ".icons"))
        valid = walk_directories(dirs, lambda d: os.path.isdir(d) and os.path.exists(os.path.join(d, "cursors")))
        valid.sort(lambda a,b: cmp(a.lower(), b.lower()))
        res = []
        for i in valid:
            res.append((i, i))
        return res
        
    def _load_window_themes(self):
        dirs = ("/usr/share/themes", os.path.join(os.path.expanduser("~"), ".themes"))
        valid = walk_directories(dirs, lambda d: os.path.exists(os.path.join(d, "metacity-1")))
        valid.sort(lambda a,b: cmp(a.lower(), b.lower()))
        res = []
        for i in valid:
            res.append((i, i))
        return res