24 from PyQt4
import QtCore, QtGui
25 from immutable_gradient_info_handler
import ImmutableGradientInfoHandler
30 ImmutableGradientInfoHandler.__init__(self, fileName)
33 group = self.gradients_.CreateGroup(self.GRADIENT_GROUP_NAME)
34 group.SetAttribute(self.NAME_ATTRIBUTE_NAME, name)
35 gfx_gradient = self.ConvertToGfxGradient(gradient)
37 gfx_gradient.GradientToInfo(group)
38 self.handle_.Export(self.FILE_NAME)
41 group_list = self.gradients_.GetGroups(self.GRADIENT_GROUP_NAME)
42 for group
in group_list:
43 if group.HasAttribute(self.NAME_ATTRIBUTE_NAME):
44 groupname = group.GetAttribute(self.NAME_ATTRIBUTE_NAME)
49 if groupToDel !=
None:
50 self.gradients_.Remove(groupToDel)
51 self.handle_.Export(self.FILE_NAME)
54 group_list = self.gradients_.GetGroups(self.GRADIENT_GROUP_NAME)
55 for group
in group_list:
56 if group.HasAttribute(self.NAME_ATTRIBUTE_NAME):
57 groupname = group.GetAttribute(self.NAME_ATTRIBUTE_NAME)
59 group.SetAttribute(self.NAME_ATTRIBUTE_NAME, new)
60 self.handle_.Export(self.FILE_NAME)