Esempio n. 1
0
	def __init__(self):
		# #6140: Migrate to new table names as smoothly as possible.
		tableName = config.conf["braille"]["inputTable"]
		newTableName = brailleTables.RENAMED_TABLES.get(tableName)
		if newTableName:
			tableName = config.conf["braille"]["inputTable"] = newTableName
		try:
			self._table = brailleTables.getTable(tableName)
		except LookupError:
			log.error("Invalid table: %s" % tableName)
			self._table = brailleTables.getTable(FALLBACK_TABLE)
		#: A buffer of entered braille cells so that state set by previous cells can be maintained;
		#: e.g. capital and number signs.
		self.bufferBraille = []
		#: The text translated so far from the cells in L{bufferBraille}.
		self.bufferText = u""
		#: Indexes of cells which produced text.
		#: For example, this includes letters and numbers, but not number signs,
		#: since a number sign by itself doesn't produce text.
		#: This is used when erasing cells to determine when to backspace an actual character.
		self.cellsWithText = set()
		#: The cells in L{bufferBraille} that have not yet been translated
		#: or were translated but did not produce any text.
		#: This is used to show these cells to the user while they're entering braille.
		#: This is a string of Unicode braille.
		#: @type: unicode
		self.untranslatedBraille = ""
		#: The position in L{brailleBuffer} where untranslated braille begins.
		self.untranslatedStart = 0
		#: The user's cursor position within the untranslated braille.
		#: This enables the user to move within the untranslated braille.
		self.untranslatedCursorPos = 0
		#: The time at which uncontracted characters were sent to the system.
		self._uncontSentTime = None
		config.configProfileSwitched.register(self.handleConfigProfileSwitch)
Esempio n. 2
0
 def __init__(self):
     # #6140: Migrate to new table names as smoothly as possible.
     tableName = config.conf["braille"]["inputTable"]
     newTableName = brailleTables.RENAMED_TABLES.get(tableName)
     if newTableName:
         tableName = config.conf["braille"]["inputTable"] = newTableName
     try:
         self._table = brailleTables.getTable(tableName)
     except LookupError:
         log.error("Invalid table: %s" % tableName)
         self._table = brailleTables.getTable(FALLBACK_TABLE)
     #: A buffer of entered braille cells so that state set by previous cells can be maintained;
     #: e.g. capital and number signs.
     self.bufferBraille = []
     #: The text translated so far from the cells in L{bufferBraille}.
     self.bufferText = u""
     #: Indexes of cells which produced text.
     #: For example, this includes letters and numbers, but not number signs,
     #: since a number sign by itself doesn't produce text.
     #: This is used when erasing cells to determine when to backspace an actual character.
     self.cellsWithText = set()
     #: The cells in L{bufferBraille} that have not yet been translated
     #: or were translated but did not produce any text.
     #: This is used to show these cells to the user while they're entering braille.
     #: This is a string of Unicode braille.
     #: @type: unicode
     self.untranslatedBraille = ""
     #: The position in L{brailleBuffer} where untranslated braille begins.
     self.untranslatedStart = 0
     #: The user's cursor position within the untranslated braille.
     #: This enables the user to move within the untranslated braille.
     self.untranslatedCursorPos = 0
     #: The time at which uncontracted characters were sent to the system.
     self._uncontSentTime = None
     config.configProfileSwitched.register(self.handleConfigProfileSwitch)
Esempio n. 3
0
    def makeSettings(self, sizer):
        sizerHelper = gui.guiHelper.BoxSizerHelper(self, sizer=sizer)
        # Translators: the label of the edit field.
        self._brailleTextEdit = sizerHelper.addLabeledControl(
            _("&Input:"), wx.TextCtrl)

        inputTypeChoices = [
            # Translators: the label of an input type
            _("Braille &dots (e.g. 1345-1236-145-1)"),
            # Translators: the label of an input type
            _("Normal &text according to %s") % brailleTables.getTable(
                config.conf['braille']['inputTable']).displayName
        ]
        # Translators: the label of the radio box to choose the input type.
        self._inputTypeRadioBox = sizerHelper.addItem(
            wx.RadioBox(self, label=_("Input type"), choices=inputTypeChoices))

        self._regularSpaceChk = wx.CheckBox(
            self,
            # Translators: Label for a checkbox, wether to use a regular space or the Braille unicode space.
            label=_("Convert Unicode Braille &space to ASCII space"))
        self._regularSpaceChk.SetValue(False)
        sizerHelper.addItem(self._regularSpaceChk)
	def handlePostConfigProfileSwitch(self):
		table = config.conf["braille"]["inputTable"]
		if table != self._table.fileName:
			self._table = brailleTables.getTable(table)
Esempio n. 5
0
	def handleConfigProfileSwitch(self):
		table = config.conf["braille"]["inputTable"]
		if table != self._table.fileName:
			self._table = brailleTables.getTable(table)