Esempio n. 1
0
	def __saveOptionsFromWindowToRegistry(self, window):
		logging.debug("SettingsEventHandler.__saveOptionsFromWindowToRegistry")

		hyphWordParts = window.getControl("hyphWordParts")
		hyphWordPartsProps = hyphWordParts.getModel()
		hyphWordPartsValue = hyphWordPartsProps.getPropertyValue("State") # 0 = unchecked, 1 = checked

		hyphUnknownWords = window.getControl("hyphUnknownWords")
		hyphUnknownWordsProps = hyphUnknownWords.getModel()
		hyphUnknownWordsValue = hyphUnknownWordsProps.getPropertyValue("State") # 0 = unchecked, 1 = checked

		rootView = PropertyManager.getRegistryProperties("/org.puimula.ooovoikko.Config/hyphenator")
		rootView.setHierarchicalPropertyValue("hyphWordParts", hyphWordPartsValue == 1)
		rootView.setHierarchicalPropertyValue("hyphUnknownWords", hyphUnknownWordsValue == 1)
		rootView.commitChanges()

		# dictionary variant
		variantValue = self.__getSelectedVariant(window)
		rootView = PropertyManager.getRegistryProperties("/org.puimula.ooovoikko.Config/dictionary")
		rootView.setHierarchicalPropertyValue("variant", variantValue)
		rootView.commitChanges()