示例#1
0
    def disableAttribute(self, attr):
        """ Disable attribute to be displayed in the dialog.

        It disables the given attribute to be displayed in the dialog, and it
        is removed from the cached .
        """
        config.setResourceAttrEnable(attr, False)
        config.setResourceAttrValues(attr, None)
        if attr in self.cache['attrs']:
            self.cache['attrs'].remove(attr)
示例#2
0
    def enableAttribute(self, attr, handler):
        """ Enable attribute to be displayed in the dialog.

        It enables the given attribute to be displayed in the dialog, and it
        is cached internally in order to be re-initialized when dialog is
        closed.
        """
        config.setResourceAttrEnable(attr, True)
        config.setResourceAttrValues(attr, handler)
        if attr not in self.cache['attrs']:
            self.cache['attrs'].append(attr)
示例#3
0
 def disableAllAttributes(self):
     """ Disable all attributes cached.
     """
     for attr in self.cache['attrs']:
         config.setResourceAttrEnable(attr, False)