当前位置: 首页>>代码示例>>Python>>正文


Python EasyGConf.set方法代码示例

本文整理汇总了Python中easygconf.EasyGConf.set方法的典型用法代码示例。如果您正苦于以下问题:Python EasyGConf.set方法的具体用法?Python EasyGConf.set怎么用?Python EasyGConf.set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在easygconf.EasyGConf的用法示例。


在下文中一共展示了EasyGConf.set方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: mintMenuConfig

# 需要导入模块: from easygconf import EasyGConf [as 别名]
# 或者: from easygconf.EasyGConf import set [as 别名]
class mintMenuConfig( object ):
	
	def __init__( self ):

		self.path = os.path.abspath( os.path.dirname( sys.argv[0] ) )

		# Load glade file and extract widgets
		gladefile = os.path.join( self.path, "mintMenuConfig.glade" )
		wTree 	  = gtk.glade.XML( gladefile, "mainWindow" )
		self.mainWindow=wTree.get_widget("mainWindow")

		#i18n
		self.mainWindow.set_title(_("Menu preferences"))
		self.mainWindow.set_icon_from_file("/usr/lib/linuxmint/mintMenu/icon.svg")

		wTree.get_widget("startWithFavorites").set_label(_("Always start with favorites pane"))
		wTree.get_widget("showSidepane").set_label(_("Show sidepane"))
		wTree.get_widget("showButtonIcon").set_label(_("Show button icon"))
		wTree.get_widget("useCustomColors").set_label(_("Use custom colors"))
		wTree.get_widget("showRecentPlugin").set_label(_("Show recent documents"))

		wTree.get_widget("showAppComments").set_label(_("Show application comments"))
		wTree.get_widget("showCategoryIcons").set_label(_("Show category icons"))
		wTree.get_widget("hover").set_label(_("Hover"))
		wTree.get_widget("swapGeneric").set_label(_("Swap name and generic name"))

		wTree.get_widget("label11").set_text(_("Border width:"))
		wTree.get_widget("label2").set_text(_("pixels"))

		wTree.get_widget("label8").set_text(_("Opacity:"))
		wTree.get_widget("label9").set_text("%")

		wTree.get_widget("buttonTextLabel").set_text(_("Button text:"))
		wTree.get_widget("label1").set_text(_("Options"))
		wTree.get_widget("label23").set_text(_("Applications"))

		wTree.get_widget("colorsLabel").set_text(_("Colors"))
		wTree.get_widget("favLabel").set_text(_("Favorites"))
		wTree.get_widget("label3").set_text(_("Main button"))
		
		wTree.get_widget("backgroundColorLabel").set_text(_("Background:"))
		wTree.get_widget("headingColorLabel").set_text(_("Headings:"))
		wTree.get_widget("borderColorLabel").set_text(_("Borders:"))
		
		#wTree.get_widget("applicationsLabel").set_text(_("Applications"))
		#wTree.get_widget("favoritesLabel").set_text(_("Favorites"))
		wTree.get_widget("numberColumnsLabel").set_text(_("Number of columns:"))
		wTree.get_widget("iconSizeLabel").set_text(_("Icon size:"))
		wTree.get_widget("iconSizeLabel2").set_text(_("Icon size:"))
		wTree.get_widget("label44").set_text(_("Icon size:"))		
		wTree.get_widget("hoverLabel").set_text(_("Hover delay (ms):"))
		wTree.get_widget("label4").set_text(_("Button icon:"))
		wTree.get_widget("label5").set_text(_("Search command:"))

		wTree.get_widget("placesLabel").set_text(_("Places"))
		wTree.get_widget("allowscrollbarcheckbutton").set_label(_("Allow Scrollbar"))
		wTree.get_widget("placesHeightEntryLabel").set_text(_("Height:"))
		wTree.get_widget("defaultPlacesFrameLabel").set_text(_("Toggle Default Places:"))
		wTree.get_widget("computercheckbutton").set_label(_("Computer"))
		wTree.get_widget("homecheckbutton").set_label(_("Home Folder"))
		wTree.get_widget("networkcheckbutton").set_label(_("Network"))
		wTree.get_widget("desktopcheckbutton").set_label(_("Desktop"))
		wTree.get_widget("trashcheckbutton").set_label(_("Trash"))
		wTree.get_widget("customPlacesFrameLabel").set_text(_("Custom Places:"))

		wTree.get_widget("systemLabel").set_text(_("System"))
		wTree.get_widget("allowscrollbarcheckbutton1").set_label(_("Allow Scrollbar"))
		wTree.get_widget("systemHeightEntryLabel").set_text(_("Height:"))
		wTree.get_widget("defaultItemsFrameLabel").set_text(_("Toggle Default Items:"))
		wTree.get_widget("softwaremanagercheckbutton").set_label(_("Software Manager"))
		wTree.get_widget("packagemanagercheckbutton").set_label(_("Package Manager"))
		wTree.get_widget("controlcentercheckbutton").set_label(_("Control Center"))
		wTree.get_widget("terminalcheckbutton").set_label(_("Terminal"))
		wTree.get_widget("lockcheckbutton").set_label(_("Lock Screen"))
		wTree.get_widget("logoutcheckbutton").set_label(_("Log Out"))
		wTree.get_widget("quitcheckbutton").set_label(_("Quit"))

		self.editPlaceDialogTitle = (_("Edit Place"))
		self.newPlaceDialogTitle = (_("New Place"))
		self.folderChooserDialogTitle = (_("Select a folder"))

		wTree.get_widget("hotkey_label").set_text(_("Keyboard shortcut:"))

		self.startWithFavorites = wTree.get_widget( "startWithFavorites" )
		self.showSidepane = wTree.get_widget( "showSidepane" )
		self.showAppComments = wTree.get_widget( "showAppComments" )
		self.showCategoryIcons = wTree.get_widget( "showCategoryIcons" )
		self.showRecentPlugin = wTree.get_widget( "showRecentPlugin" )
		self.swapGeneric = wTree.get_widget("swapGeneric")
		self.hover = wTree.get_widget( "hover" )
		self.hoverDelay = wTree.get_widget( "hoverDelay" )
		self.bttniconSize = wTree.get_widget( "main_button_icon_size" )
		self.iconSize = wTree.get_widget( "iconSize" )
		self.favIconSize = wTree.get_widget( "favIconSize" )
		self.favCols = wTree.get_widget( "numFavCols" )
		self.borderWidth = wTree.get_widget( "borderWidth" )
		self.opacity = wTree.get_widget( "opacity" )
		self.useCustomColors = wTree.get_widget( "useCustomColors" )
		self.backgroundColor = wTree.get_widget( "backgroundColor" )
		self.borderColor = wTree.get_widget( "borderColor" )
#.........这里部分代码省略.........
开发者ID:intarstudents,项目名称:mintmenu,代码行数:103,代码来源:mintMenuConfig.py

示例2: MainWindow

# 需要导入模块: from easygconf import EasyGConf [as 别名]
# 或者: from easygconf.EasyGConf import set [as 别名]

#.........这里部分代码省略.........
		self.borderwidth = entry.get_value().get_int()
		self.SetupMintMenuBorder()

	def toggleUseCustomColor( self, client, connection_id, entry, args ):
		self.usecustomcolor = entry.get_value().get_bool()
		self.SetupMintMenuBorder()
		self.SetPaneColors( self.panesToColor )
		self.SetHeadingStyle( self.headingsToColor )


	def toggleCustomBorderColor( self, client, connection_id, entry, args ):
		self.custombordercolor = entry.get_value().get_string()
		self.SetupMintMenuBorder()

	def toggleCustomBackgroundColor( self, client, connection_id, entry, args ):
		self.customcolor = entry.get_value().get_string()
		self.SetPaneColors( self.panesToColor )

	def toggleCustomHeadingColor( self, client, connection_id, entry, args ):
		self.customheadingcolor = entry.get_value().get_string()
		self.SetHeadingStyle( self.headingsToColor )


	def getSetGconfEntries( self ):
		self.pluginlist          = self.gconf.get( "list-string", "plugins_list",['newpane','places', 'system_management', 'newpane', 'applications'] )
		self.dottedfile          = os.path.join( self.path, "dotted.png")
		
		self.usecustomcolor      = self.gconf.get( "bool", "use_custom_color", False )
		self.customcolor         = self.gconf.get( "color", "custom_color", "#EEEEEE" )
		self.customheadingcolor  = self.gconf.get( "color", "custom_heading_color", "#001155" )
		self.custombordercolor   = self.gconf.get( "color", "custom_border_color", "#001155" )
		
		self.borderwidth          = self.gconf.get( "int", "border_width", 1 )
		self.offset               = self.gconf.get( "int", "mintMenu_offset", 0 )
		self.pinmenu              = self.gconf.get( "bool", "pin_menu", False )
		self.enableTooltips       = self.gconf.get( "bool", "tooltips_enabled", True )
		self.globalEnableTooltips = self.gconf.get( "bool", "/apps/panel/global/tooltips_enabled", True )
		self.sidepanevisible      = self.gconf.get( "bool", "show_side_pane", False )
		self.startWithFavorites   = self.gconf.get( "bool", "start_with_favorites", False )


	def PinMenu(self, *args, **kargs):
		self.pinmenu = self.pinbutton.get_active()
		self.gconf.set("bool", "pin_menu", self.pinmenu)
		
		if self.pinmenu == True:
			self.sidepane.show()
		elif not self.sidepanevisible:
			self.sidepane.hide()


	def SetupMintMenuBorder( self ):
		if self.usecustomcolor:
			self.window.modify_bg( gtk.STATE_NORMAL, gtk.gdk.color_parse( self.custombordercolor ) )
		else:		
			self.window.modify_bg( gtk.STATE_NORMAL, self.window.rc_get_style().bg[ gtk.STATE_SELECTED ] )
		self.border.set_padding( self.borderwidth, self.borderwidth, self.borderwidth, self.borderwidth )
		self.SetPaneColors( [ self.sidepane ] )

		self.pinbutton.set_active( self.pinmenu )

		if self.sidepanevisible == False and self.pinmenu == False:
			self.sidepane.hide()
		else:
			self.sidepane.show()
开发者ID:dvictor,项目名称:mintmenu,代码行数:69,代码来源:mintMenu.py

示例3: pluginclass

# 需要导入模块: from easygconf import EasyGConf [as 别名]
# 或者: from easygconf.EasyGConf import set [as 别名]
class pluginclass( object ):
	TARGET_TYPE_TEXT = 80
	toButton = [ ( "text/uri-list", 0, TARGET_TYPE_TEXT ) ]
	TARGET_TYPE_FAV = 81
	toFav = [ ( "FAVORITES", gtk.TARGET_SAME_APP, TARGET_TYPE_FAV ), ( "text/plain", 0, 100 ), ( "text/uri-list", 0, 101 ) ]
	fromFav = [ ( "FAVORITES", gtk.TARGET_SAME_APP, TARGET_TYPE_FAV ) ]

	def __init__( self, mintMenuWin, toggleButton ):

		self.mintMenuWin = mintMenuWin
		
		self.mainMenus = [ ]

		self.toggleButton = toggleButton	
		# The Glade file for the plugin
		self.gladefile = os.path.join( os.path.dirname( __file__ ), "applications.glade" )

		# Read GLADE file
		self.wTree = gtk.glade.XML( self.gladefile, "mainWindow" )
		self.searchEntry = self.wTree.get_widget( "searchEntry" )
		self.searchButton = self.wTree.get_widget( "searchButton" )
		self.showAllAppsButton = self.wTree.get_widget( "showAllAppsButton" )
		self.showFavoritesButton = self.wTree.get_widget( "showFavoritesButton" )
		self.applicationsBox = self.wTree.get_widget( "applicationsBox" )
		self.categoriesBox = self.wTree.get_widget( "categoriesBox" )
		self.favoritesBox = self.wTree.get_widget( "favoritesBox" )
		self.applicationsScrolledWindow = self.wTree.get_widget( "applicationsScrolledWindow" )		

		#i18n
		self.wTree.get_widget("searchLabel").set_text("<span weight='bold'>" + _("Filter:") + "</span>")
		self.wTree.get_widget("searchLabel").set_use_markup(True)
		self.wTree.get_widget("label6").set_text("<span weight='bold'>" + _("Favorites") + "</span>")
		self.wTree.get_widget("label6").set_use_markup(True)
		self.wTree.get_widget("label7").set_text(_("All applications"))
		self.wTree.get_widget("label2").set_text("<span weight='bold'>" + _("All applications") + "</span>")
		self.wTree.get_widget("label2").set_use_markup(True)
		self.wTree.get_widget("label3").set_text(_("Favorites"))

		self.numApps = 0
		# These properties are NECESSARY to maintain consistency

		# Set 'window' property for the plugin (Must be the root widget)
		self.window = self.wTree.get_widget( "mainWindow" )

		# Set 'heading' property for plugin
		self.heading = _("Applications")

		# This should be the first item added to the window in glade
		self.content_holder = self.wTree.get_widget( "Applications" )

		# Items to get custom colors
		self.itemstocolor = [ self.wTree.get_widget( "viewport1" ), self.wTree.get_widget( "viewport2" ), self.wTree.get_widget( "viewport3" ), self.wTree.get_widget( "notebook2" ) ]

		# Unset all timers
		self.filterTimer = None
		self.menuChangedTimer = None
		# Hookup for text input
		self.content_holder.connect( "key-press-event", self.keyPress )

		self.favoritesBox.connect( "drag_data_received", self.ReceiveCallback )
		self.favoritesBox.drag_dest_set( gtk.DEST_DEFAULT_MOTION | gtk.DEST_DEFAULT_HIGHLIGHT | gtk.DEST_DEFAULT_DROP, self.toButton, gtk.gdk.ACTION_COPY )
		self.showFavoritesButton.connect( "drag_data_received", self.ReceiveCallback )
		self.showFavoritesButton.drag_dest_set( gtk.DEST_DEFAULT_MOTION | gtk.DEST_DEFAULT_HIGHLIGHT | gtk.DEST_DEFAULT_DROP, self.toButton, gtk.gdk.ACTION_COPY )

		self.searchButton.connect( "button_release_event", self.SearchWithButton )

		self.gconfHandlers = []
		# Gconf stuff		
		self.gconf = EasyGConf( "/apps/mintMenu/plugins/applications/" )
		self.GetGconfEntries()
		self.gconf.notifyAdd( "icon_size", self.changeIconSize )
		self.gconf.notifyAdd( "favicon_size", self.changeFavIconSize )
		self.gconf.notifyAdd( "height", self.changePluginSize )
		self.gconf.notifyAdd( "width", self.changePluginSize )
		self.gconf.notifyAdd( "categories_mouse_over", self.changeCategoriesMouseOver )
		self.gconf.notifyAdd( "swap_generic_name", self.changeSwapGenericName )
		self.gconf.notifyAdd( "show_category_icons", self.changeShowCategoryIcons )
		self.gconf.notifyAdd( "show_application_comments", self.changeShowApplicationComments )
		self.gconf.notifyAdd( "fav_cols", self.changeFavCols )
		
		self.gconf.bindGconfEntryToVar( "int", "category_hover_delay", self, "categoryhoverdelay" )
		self.gconf.bindGconfEntryToVar( "bool", "do_not_filter", self, "donotfilterapps" )
		self.gconf.bindGconfEntryToVar( "string", "search_command", self, "searchtool" )
		self.gconf.bindGconfEntryToVar( "int", "default_tab", self, "defaultTab" )

		self.currentFavCol = 0
		self.favorites = []

		self.content_holder.set_size_request( self.width, self.height )
		self.categoriesBox.set_size_request( self.width / 3, -1 )
		self.applicationsBox.set_size_request( self.width / 2, -1 )

		self.buildingButtonList = False
		self.stopBuildingButtonList = False

		self.categoryList = []
		self.applicationList = []
		self.menuFileMonitors = []
		
		self.rebuildLock = False
#.........这里部分代码省略.........
开发者ID:dvictor,项目名称:mintmenu,代码行数:103,代码来源:applications.py


注:本文中的easygconf.EasyGConf.set方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。