當前位置: 首頁>>代碼示例>>Python>>正文


Python ExtensionCore.ExtensionSidePage類代碼示例

本文整理匯總了Python中ExtensionCore.ExtensionSidePage的典型用法代碼示例。如果您正苦於以下問題:Python ExtensionSidePage類的具體用法?Python ExtensionSidePage怎麽用?Python ExtensionSidePage使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了ExtensionSidePage類的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

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
開發者ID:sabilyMalaysia,項目名稱:Cinnamon,代碼行數:31,代碼來源:cs_applets.py

示例2: __init__

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
開發者ID:sabilyMalaysia,項目名稱:Cinnamon,代碼行數:31,代碼來源:cs_extensions.py

示例3: add_remove_cinnamon_themes

 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
開發者ID:RavetcoFX,項目名稱:Cinnamon,代碼行數:13,代碼來源:cs_themes.py

示例4: __init__

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
開發者ID:sabilyMalaysia,項目名稱:Cinnamon,代碼行數:51,代碼來源:cs_desklets.py

示例5: __init__

 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"
開發者ID:sabilyMalaysia,項目名稱:Cinnamon,代碼行數:12,代碼來源:cs_themes.py

示例6: __init__

 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)
開發者ID:androot,項目名稱:Cinnamon,代碼行數:3,代碼來源:cs_desklets.py

示例7: __init__

 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)
開發者ID:3n4rch3,項目名稱:Cinnamon,代碼行數:3,代碼來源:cs_applets.py

示例8: __init__

 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)
開發者ID:3n4rch3,項目名稱:Cinnamon,代碼行數:3,代碼來源:cs_themes.py


注:本文中的ExtensionCore.ExtensionSidePage類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。