Ejemplo n.º 1
0
	def setDefaultMarkup(self, markupClass):
		self.defaultMarkup = markupClass
		defaultName = markups.get_available_markups()[0].name
		writeToSettings('defaultMarkup', markupClass.name, defaultName)
		for tab in self.iterateTabs():
			if not tab.fileName:
				tab.setDefaultMarkupClass(markupClass)
Ejemplo n.º 2
0
	def setDefaultMarkup(self, markup):
		self.defaultMarkup = markup
		defaultName = markups.get_available_markups()[0].name
		writeToSettings('defaultMarkup', markup.name, defaultName)
		for self.currentTab in self.iterateTabs():
			self.docTypeChanged()
		self.currentTab = self.currentWidget.widget(self.ind).tab
Ejemplo n.º 3
0
	def setDefaultMarkup(self, markup):
		self.defaultMarkup = markup
		defaultName = markups.get_available_markups()[0].name
		writeToSettings('defaultMarkup', markup.name, defaultName)
		oldind = self.ind
		for self.ind in range(len(self.previewBoxes)):
			self.docTypeChanged()
		self.ind = oldind
Ejemplo n.º 4
0
	def setDefaultMarkup(self, markup):
		self.defaultMarkup = markup
		defaultName = markups.get_available_markups()[0].name
		writeToSettings('defaultMarkup', markup.name, defaultName)
		oldind = self.ind
		for self.ind in range(len(self.previewBoxes)):
			self.docTypeChanged()
		self.ind = oldind
Ejemplo n.º 5
0
	def setDefaultMarkup(self, markupClass):
		self.defaultMarkup = markupClass
		defaultName = markups.get_available_markups()[0].name
		writeToSettings('defaultMarkup', markupClass.name, defaultName)
		for tab in self.iterateTabs():
			if not tab.fileName:
				tab.setMarkupClass(markupClass)
				tab.updatePreviewBox()
		self.docTypeChanged()
Ejemplo n.º 6
0
	def test_storingFonts(self):
		font = QFont()
		font.setFamily('my family')
		font.setPointSize(20)
		writeToSettings('testFont', font, None, self.settings)
		family = readFromSettings('testFont', str, self.settings)
		size = readFromSettings('testFontSize', int, self.settings)
		self.assertEqual(family, 'my family')
		self.assertEqual(size, 20)
		newFont = readFromSettings('testFont', QFont, self.settings, QFont())
		self.assertEqual(newFont.family(), family)
		self.assertEqual(newFont.pointSize(), size)
Ejemplo n.º 7
0
 def test_storingFonts(self):
     font = QFont()
     font.setFamily('my family')
     font.setPointSize(20)
     writeToSettings('testFont', font, None, self.settings)
     family = readFromSettings('testFont', str, self.settings)
     size = readFromSettings('testFontSize', int, self.settings)
     self.assertEqual(family, 'my family')
     self.assertEqual(size, 20)
     newFont = readFromSettings('testFont', QFont, self.settings, QFont())
     self.assertEqual(newFont.family(), family)
     self.assertEqual(newFont.pointSize(), size)
Ejemplo n.º 8
0
	def test_storingBooleans(self):
		writeToSettings('testBool', 1, None, self.settings)
		self.assertTrue(readFromSettings('testBool', bool, self.settings))
		writeToSettings('testBool', 'false', None, self.settings)
		self.assertFalse(readFromSettings('testBool', bool, self.settings))
		writeToSettings('testBool', 0, None, self.settings)
		self.assertFalse(readFromSettings('testBool', bool, self.settings))
Ejemplo n.º 9
0
 def test_storingBooleans(self):
     writeToSettings("testBool", 1, None, self.settings)
     self.assertTrue(readFromSettings("testBool", bool, self.settings))
     writeToSettings("testBool", "false", None, self.settings)
     self.assertFalse(readFromSettings("testBool", bool, self.settings))
     writeToSettings("testBool", 0, None, self.settings)
     self.assertFalse(readFromSettings("testBool", bool, self.settings))
Ejemplo n.º 10
0
 def test_storingBooleans(self):
     writeToSettings('testBool', 1, None, self.settings)
     self.assertTrue(readFromSettings('testBool', bool, self.settings))
     writeToSettings('testBool', 'false', None, self.settings)
     self.assertFalse(readFromSettings('testBool', bool, self.settings))
     writeToSettings('testBool', 0, None, self.settings)
     self.assertFalse(readFromSettings('testBool', bool, self.settings))