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


Python EasyGConf.notifyRemoveAll方法代码示例

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


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

示例1: pluginclass

# 需要导入模块: from easygconf import EasyGConf [as 别名]
# 或者: from easygconf.EasyGConf import notifyRemoveAll [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 )
#.........这里部分代码省略.........
开发者ID:stefano-k,项目名称:mintmenu,代码行数:103,代码来源:system_management.py

示例2: pluginclass

# 需要导入模块: from easygconf import EasyGConf [as 别名]
# 或者: from easygconf.EasyGConf import notifyRemoveAll [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
		
#.........这里部分代码省略.........
开发者ID:unamanic,项目名称:mintmenu,代码行数:103,代码来源:places.py

示例3: pluginclass

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

#.........这里部分代码省略.........

	def search_mint(self, widget):
		os.system("/usr/bin/mint-search-portal " + self.suggestion + " &")
		self.mintMenuWin.hide()		

	def search_apt(self, widget):
		os.system("/usr/bin/mint-search-apt " + self.suggestion + " &")
		self.mintMenuWin.hide()

	def show_apt(self, widget):
		os.system("/usr/bin/mint-show-apt " + self.suggestion + " &")
		self.mintMenuWin.hide()

	def install_apt(self, widget):
		os.system("/usr/bin/mint-make-cmd " + self.suggestion + " &")
		self.mintMenuWin.hide()

	def __del__( self ):
		print u"Applications plugin deleted"

	def wake (self) :
		pass

	def destroy( self ):
		self.content_holder.destroy()
		self.searchEntry.destroy()
		self.searchButton.destroy()
		self.showAllAppsButton.destroy()
		self.showFavoritesButton.destroy()
		self.applicationsBox.destroy()
		self.categoriesBox.destroy()
		self.favoritesBox.destroy()
		
		self.gconf.notifyRemoveAll()

		for mId in self.menuFileMonitors:
			filemonitor.removeMonitor( mId )
	
	def changePluginSize( self, client, connection_id, entry, args ):
		if entry.get_key() == self.gconf.gconfDir+"width":
			self.width = entry.get_value().get_int()
			self.categoriesBox.set_size_request( self.width / 3, -1 )
			self.applicationsBox.set_size_request( self.width / 2, -1 )

		elif entry.get_key() == self.gconf.gconfDir+"height":
			self.heigth = entry.get_value().get_int()
		self.content_holder.set_size_request( self.width, self.height )

	def changeSwapGenericName( self, client, connection_id, entry, args ):
		self.swapgeneric = entry.get_value().get_bool()
		
		for child in self.favoritesBox:
			if isinstance( child, FavApplicationLauncher):
				child.setSwapGeneric( self.swapgeneric )
	
	def changeShowCategoryIcons( self, client, connection_id, entry, args ):
		self.showcategoryicons = entry.get_value().get_bool()
		
		if self.showcategoryicons:
			categoryIconSize = self.iconSize
		else:
			categoryIconSize = 0
			
		for child in self.categoriesBox:
			child.setIconSize( categoryIconSize )
			
开发者ID:dvictor,项目名称:mintmenu,代码行数:69,代码来源:applications.py


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