本文整理汇总了Python中easygconf.EasyGConf.bindGconfEntryToVar方法的典型用法代码示例。如果您正苦于以下问题:Python EasyGConf.bindGconfEntryToVar方法的具体用法?Python EasyGConf.bindGconfEntryToVar怎么用?Python EasyGConf.bindGconfEntryToVar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类easygconf.EasyGConf
的用法示例。
在下文中一共展示了EasyGConf.bindGconfEntryToVar方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: pluginclass
# 需要导入模块: from easygconf import EasyGConf [as 别名]
# 或者: from easygconf.EasyGConf import bindGconfEntryToVar [as 别名]
class pluginclass( object ):
def __init__( self, mintMenuWin, toggleButton, de ):
self.mintMenuWin = mintMenuWin
self.toggleButton = toggleButton
self.de = de
# Read GLADE file
gladefile = os.path.join( os.path.dirname( __file__ ), "system_management.glade" )
wTree = gtk.glade.XML( gladefile, "mainWindow" )
self.systemBtnHolder = wTree.get_widget( "system_button_holder" )
self.editableBtnHolder = wTree.get_widget( "editable_button_holder" )
self.scrolledWindow = wTree.get_widget( "scrolledwindow2" )
# These properties are NECESSARY to maintain consistency
# Set 'window' property for the plugin (Must be the root widget)
self.window = wTree.get_widget( "mainWindow" )
# Set 'heading' property for plugin
self.heading = _("System")
# This should be the first item added to the window in glade
self.content_holder = wTree.get_widget( "System" )
# Items to get custom colors
self.itemstocolor = [ wTree.get_widget( "viewport2" ) ]
# Gconf stuff
self.gconf = EasyGConf( "/apps/mintMenu/plugins/system-management/" )
self.gconf.notifyAdd( "icon_size", self.RegenPlugin )
self.gconf.notifyAdd( "show_control_center", self.RegenPlugin )
self.gconf.notifyAdd( "show_lock_screen", self.RegenPlugin )
self.gconf.notifyAdd( "show_logout", self.RegenPlugin )
self.gconf.notifyAdd( "show_package_manager", self.RegenPlugin )
self.gconf.notifyAdd( "show_software_manager", self.RegenPlugin )
self.gconf.notifyAdd( "show_terminal", self.RegenPlugin )
self.gconf.notifyAdd( "show_quit", self.RegenPlugin )
self.gconf.notifyAdd( "allowScrollbar", self.RegenPlugin )
self.gconf.notifyAdd( "height", self.changePluginSize )
self.gconf.notifyAdd( "width", self.changePluginSize )
self.gconf.bindGconfEntryToVar( "bool", "sticky", self, "sticky" )
self.GetGconfEntries()
self.content_holder.set_size_request( self.width, self.height )
def destroy( self ):
self.gconf.notifyRemoveAll()
def wake (self) :
pass
def changePluginSize( self, client, connection_id, entry, args ):
self.allowScrollbar = self.gconf.get( "bool", "allowScrollbar", False)
if entry.get_key() == self.gconf.gconfDir+"width":
self.width = entry.get_value().get_int()
elif entry.get_key() == self.gconf.gconfDir+"height":
if (self.allowScrollbar == False):
self.height = -1
self.scrolledWindow.set_policy( gtk.POLICY_AUTOMATIC, gtk.POLICY_NEVER )
else:
self.scrolledWindow.set_policy( gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC )
self.height = entry.get_value().get_int()
self.content_holder.set_size_request( self.width, self.height )
def RegenPlugin( self, *args, **kargs ):
self.GetGconfEntries()
self.ClearAll()
self.do_standard_items()
def GetGconfEntries( self ):
self.width = self.gconf.get( "int", "width", 200 )
self.allowScrollbar = self.gconf.get( "bool", "allowScrollbar", False)
self.scrolledWindow.set_policy( gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC )
self.height = self.gconf.get( "int", "height", 180 )
self.content_holder.set_size_request( self.width, self.height )
if (self.allowScrollbar == False):
self.height = -1
self.scrolledWindow.set_policy( gtk.POLICY_AUTOMATIC, gtk.POLICY_NEVER )
self.content_holder.set_size_request( self.width, self.height )
self.iconsize = self.gconf.get( "int","icon_size", 16 )
# Check toggles
self.showSoftwareManager = self.gconf.get( "bool", "show_software_manager", True )
self.showPackageManager = self.gconf.get( "bool", "show_package_manager", True )
self.showControlCenter = self.gconf.get( "bool", "show_control_center", True )
self.showTerminal = self.gconf.get( "bool", "show_terminal", True )
self.showLockScreen = self.gconf.get( "bool", "show_lock_screen", True )
self.showLogout = self.gconf.get( "bool", "show_logout", True )
self.showQuit = self.gconf.get( "bool", "show_quit", True )
# Hide vertical dotted separator
self.hideseparator = self.gconf.get( "bool", "hide_separator", False )
#.........这里部分代码省略.........
示例2: pluginclass
# 需要导入模块: from easygconf import EasyGConf [as 别名]
# 或者: from easygconf.EasyGConf import bindGconfEntryToVar [as 别名]
class pluginclass( object ):
def __init__( self, mintMenuWin, toggleButton ):
self.mintMenuWin = mintMenuWin
self.toggleButton = toggleButton
# Read GLADE file
gladefile = os.path.join( os.path.dirname( __file__ ), "places.glade" )
wTree = gtk.glade.XML( gladefile, "mainWindow" )
self.placesBtnHolder = wTree.get_widget( "places_button_holder" )
self.editableBtnHolder = wTree.get_widget( "editable_button_holder" )
self.scrolledWindow=wTree.get_widget("scrolledwindow2")
# These properties are NECESSARY to maintain consistency
# Set 'window' property for the plugin (Must be the root widget)
self.window = wTree.get_widget( "mainWindow" )
# Set 'heading' property for plugin
self.heading = _("Places")
# This should be the first item added to the window in glade
self.content_holder = wTree.get_widget( "Places" )
# Items to get custom colors
self.itemstocolor = [ wTree.get_widget( "viewport2" ) ]
# Gconf stuff
self.gconf = EasyGConf( "/apps/mintMenu/plugins/places/" )
self.gconf.notifyAdd( "icon_size", self.RegenPlugin )
self.gconf.notifyAdd( "show_computer", self.RegenPlugin )
self.gconf.notifyAdd( "show_desktop", self.RegenPlugin )
self.gconf.notifyAdd( "show_home_folder", self.RegenPlugin )
self.gconf.notifyAdd( "show_network", self.RegenPlugin )
self.gconf.notifyAdd( "show_trash", self.RegenPlugin )
self.gconf.notifyAdd( "custom_names", self.RegenPlugin )
self.gconf.notifyAdd( "custom_paths", self.RegenPlugin )
self.gconf.notifyAdd( "allowScrollbar", self.RegenPlugin )
self.gconf.notifyAdd( "height", self.changePluginSize )
self.gconf.notifyAdd( "width", self.changePluginSize )
self.gconf.bindGconfEntryToVar( "bool", "sticky", self, "sticky" )
self.GetGconfEntries()
self.content_holder.set_size_request( self.width, self.height )
def wake (self) :
if ( self.showtrash == True ):
self.refreshTrash()
def destroy( self ):
self.gconf.notifyRemoveAll()
def changePluginSize( self, client, connection_id, entry, args ):
self.allowScrollbar = self.gconf.get( "bool", "allowScrollbar", False)
if entry.get_key() == self.gconf.gconfDir+"width":
self.width = entry.get_value().get_int()
elif entry.get_key() == self.gconf.gconfDir+"height":
if (self.allowScrollbar == False):
self.height = -1
self.scrolledWindow.set_policy( gtk.POLICY_AUTOMATIC, gtk.POLICY_NEVER )
else:
self.scrolledWindow.set_policy( gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC )
self.height = entry.get_value().get_int()
self.content_holder.set_size_request( self.width, self.height )
def RegenPlugin( self, *args, **kargs ):
self.GetGconfEntries()
self.ClearAll()
self.do_standard_places()
self.do_custom_places()
def GetGconfEntries( self ):
self.width = self.gconf.get( "int", "width", 200 )
self.allowScrollbar = self.gconf.get( "bool", "allowScrollbar", False)
self.scrolledWindow.set_policy( gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC )
self.height = self.gconf.get( "int", "height", 180 )
self.content_holder.set_size_request( self.width, self.height )
if (self.allowScrollbar == False):
self.height = -1
self.scrolledWindow.set_policy( gtk.POLICY_AUTOMATIC, gtk.POLICY_NEVER )
self.content_holder.set_size_request( self.width, self.height )
self.execapp = self.gconf.get( "string", "execute_app", "nautilus" )
self.iconsize = self.gconf.get( "int","icon_size", 2 )
# Check default items
self.showcomputer = self.gconf.get( "bool", "show_computer", True )
self.showhomefolder = self.gconf.get( "bool", "show_home_folder", True )
self.shownetwork = self.gconf.get( "bool", "show_network", True )
self.showdesktop = self.gconf.get( "bool", "show_desktop", True )
self.showtrash = self.gconf.get( "bool", "show_trash", True )
# Get paths for custom items
#.........这里部分代码省略.........
示例3: pluginclass
# 需要导入模块: from easygconf import EasyGConf [as 别名]
# 或者: from easygconf.EasyGConf import bindGconfEntryToVar [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
#.........这里部分代码省略.........