def setSectionSize(self, section): if self.isLinacSection: defaultSize = SettingsCloud.getParameter("linacSubsectionSize") else: defaultSize = SettingsCloud.getParameter("ringSubsectionSize") section.sizeEdit.setValue(defaultSize) self.updateSumOfSize(section)
def setSectionSize(self, section): if self.isLinacSection: defaultSize = SettingsCloud.getParameter("linacSubsectionSize") else: defaultSize = SettingsCloud.getParameter("ringSubsectionSize") section.sizeEdit.setValue(defaultSize) self.updateSumOfSize(section)
def setSectionColor(self, section): firstColor = SettingsCloud.getParameter("subsectionFirstColor") secondColor = SettingsCloud.getParameter("subsectionSecondColor") if subsectionContainerWidget.lastSectionColor == secondColor: section.colorLabel.setColor(firstColor) subsectionContainerWidget.lastSectionColor = firstColor else: section.colorLabel.setColor(secondColor) subsectionContainerWidget.lastSectionColor = secondColor
def setSectionColor(self, section): firstColor = SettingsCloud.getParameter("sectionFirstColor") secondColor = SettingsCloud.getParameter("sectionSecondColor") if SectionWidget.lastSectionColor == secondColor: section.setColor(firstColor) SectionWidget.lastSectionColor = firstColor else: section.setColor(secondColor) SectionWidget.lastSectionColor = secondColor
def setSectionColor(self, section): firstColor = SettingsCloud.getParameter("subsectionFirstColor") secondColor = SettingsCloud.getParameter("subsectionSecondColor") if subsectionContainerWidget.lastSectionColor == secondColor: section.colorLabel.setColor(firstColor) subsectionContainerWidget.lastSectionColor = firstColor else: section.colorLabel.setColor(secondColor) subsectionContainerWidget.lastSectionColor = secondColor
def setSectionColor(self, section): firstColor = SettingsCloud.getParameter("sectionFirstColor") secondColor = SettingsCloud.getParameter("sectionSecondColor") if SectionWidget.lastSectionColor == secondColor: section.setColor(firstColor) SectionWidget.lastSectionColor = firstColor else: section.setColor(secondColor) SectionWidget.lastSectionColor = secondColor
def testUpdateSettings(self): SettingsCloud.setParameter("size", "20") self.assertEqual(SettingsCloud.getParameter("size"), "20") SettingsCloud.setParameter("size", "153") self.assertEqual(SettingsCloud.getParameter("size"), "153")
def testClearSettings(self): self.assertEqual(SettingsCloud.getParameter("color"), None) SettingsCloud.setParameter("color", "green") self.assertEqual(SettingsCloud.getParameter("color"), "green") SettingsCloud.resetSettings() self.assertEqual(SettingsCloud.getParameter("color"), None)
def testSetGetValue(self): color = "red" SettingsCloud.setParameter("color", color) self.assertEqual(SettingsCloud.getParameter("color"), "red") self.assertEqual(SettingsCloud.getParameter("colour"), None)