add soundicon for BarrierMode
This commit is contained in:
parent
98660d17ac
commit
c3f3aeb2e5
@ -13,6 +13,8 @@ ChangeTTY='ChangeTTY.wav'
|
||||
StartOfLine='StartOfLine.wav'
|
||||
# Is the last position of the Line
|
||||
EndOfLine='EndOfLine.wav'
|
||||
# barrier was detected
|
||||
BarrierFound='barrier.wav'
|
||||
# the Line is empty
|
||||
EmptyLine='EmptyLine.wav'
|
||||
# Is the first line on the screen.
|
||||
|
@ -13,6 +13,8 @@ ChangeTTY=''
|
||||
StartOfLine=''
|
||||
# Is the last position of the Line
|
||||
EndOfLine=''
|
||||
# barrier was detected
|
||||
BarrierFound=''
|
||||
# the Line is empty
|
||||
EmptyLine=''
|
||||
# Is the first line on the screen.
|
||||
|
@ -48,7 +48,7 @@ class command():
|
||||
# barrier
|
||||
sayLine = currLine
|
||||
if self.env['runtime']['settingsManager'].getSettingAsBool('focus', 'barrier'):
|
||||
sayLine = self.env['runtime']['textManager'].getBarrierText(sayLine, self.env['screen']['newCursor']['x'])
|
||||
sayLine = self.env['runtime']['barrierManager'].handleLineBarrier(sayLine, self.env['screen']['newCursor']['x'])
|
||||
# output
|
||||
self.env['runtime']['outputManager'].presentText(sayLine, interrupt=doInterrupt, flush=False)
|
||||
self.lastIdent = currIdent
|
||||
|
@ -27,13 +27,12 @@ class command():
|
||||
#if len(self.env['screen']['newDelta'].strip(' \n\t')) <= 1:
|
||||
xMove = abs(self.env['screen']['newCursor']['x'] - self.env['screen']['oldCursor']['x'])
|
||||
yMove = abs(self.env['screen']['newCursor']['y'] - self.env['screen']['oldCursor']['y'])
|
||||
|
||||
if (xMove >= 1) and xMove == len(self.env['screen']['newDelta']):
|
||||
# if len(self.env['screen']['newDelta'].strip(' \n\t0123456789')) <= 2:
|
||||
if not '\n' in self.env['screen']['newDelta']:
|
||||
return
|
||||
#if yMove == 1:
|
||||
# if len(self.env['screen']['newDelta'].strip(' \n\t0123456789')) <= 2:
|
||||
# return
|
||||
#print(xMove, yMove, len(self.env['screen']['newDelta']), len(self.env['screen']['newNegativeDelta']))
|
||||
self.env['runtime']['outputManager'].presentText(self.env['screen']['newDelta'], interrupt=False, flush=False)
|
||||
|
||||
def setCallback(self, callback):
|
||||
|
@ -158,18 +158,16 @@ class screenManager():
|
||||
newScreenText = self.env['screen']['newContentText'][cursorLineStartOffset:cursorLineEndOffset]
|
||||
#newScreenText = re.sub(' +',' ',newScreenText)
|
||||
diff = self.differ.compare(oldScreenText, newScreenText)
|
||||
#diff = difflib.ndiff(oldScreenText, newScreenText)
|
||||
diffList = list(diff)
|
||||
typing = True
|
||||
tempNewDelta = ''.join(x[2:] for x in diffList if x[0] == '+')
|
||||
if tempNewDelta.strip() != '':
|
||||
if tempNewDelta != ''.join(newScreenText[self.env['screen']['oldCursor']['x']:self.env['screen']['newCursor']['x']].rstrip()):
|
||||
diffList = ['+ ' + self.env['screen']['newContentText'].split('\n')[self.env['screen']['newCursor']['y']]]
|
||||
typing = True
|
||||
diffList = ['+ ' + self.env['screen']['newContentText'].split('\n')[self.env['screen']['newCursor']['y']] +'\n']
|
||||
typing = False
|
||||
else:
|
||||
diff = self.differ.compare(oldScreenText.split('\n'),\
|
||||
newScreenText.split('\n'))
|
||||
#diff = difflib.ndiff( oldScreenText.split('\n'),\
|
||||
# newScreenText.split('\n'))
|
||||
diffList = list(diff)
|
||||
|
||||
if not typing:
|
||||
|
@ -25,6 +25,7 @@ from fenrirscreenreader.core import textManager
|
||||
from fenrirscreenreader.core import tableManager
|
||||
from fenrirscreenreader.core import byteManager
|
||||
from fenrirscreenreader.core import attributeManager
|
||||
from fenrirscreenreader.core import barrierManager
|
||||
from fenrirscreenreader.core import environment
|
||||
from fenrirscreenreader.core.settingsData import settingsData
|
||||
from fenrirscreenreader.core import debug
|
||||
@ -326,7 +327,9 @@ class settingsManager():
|
||||
environment['runtime']['textManager'] = textManager.textManager()
|
||||
environment['runtime']['textManager'].initialize(environment)
|
||||
environment['runtime']['tableManager'] = tableManager.tableManager()
|
||||
environment['runtime']['tableManager'].initialize(environment)
|
||||
environment['runtime']['tableManager'].initialize(environment)
|
||||
environment['runtime']['barrierManager'] = barrierManager.barrierManager()
|
||||
environment['runtime']['barrierManager'].initialize(environment)
|
||||
|
||||
environment['runtime']['debug'].writeDebugOut('\/-------environment-------\/',debug.debugLevel.INFO, onAnyLevel=True)
|
||||
environment['runtime']['debug'].writeDebugOut(str(environment), debug.debugLevel.INFO, onAnyLevel=True)
|
||||
|
@ -15,27 +15,6 @@ class textManager():
|
||||
self.env = environment
|
||||
def shutdown(self):
|
||||
pass
|
||||
def hasBarrier(self, start, end):
|
||||
# check for corners here
|
||||
return True
|
||||
def getBarrierText(self, line, xCursor):
|
||||
offset = xCursor
|
||||
# is the cursor at the begin or end of an entry:
|
||||
if line[:offset + 1].count('│') > line[offset + 1:].count('│'):
|
||||
offset = xCursor - 1
|
||||
start = line[:offset + 1].rfind('│') + 1
|
||||
end = line[offset + 1:].find('│')
|
||||
if start == end:
|
||||
return line
|
||||
if start == -1:
|
||||
return line
|
||||
if end == -1:
|
||||
return line
|
||||
else:
|
||||
end += offset + 1
|
||||
if not self.hasBarrier(start, end):
|
||||
return line
|
||||
return line[start:end]
|
||||
|
||||
def replaceHeadLines(self, text):
|
||||
# fast len check for bigger typing echo
|
||||
|
Loading…
Reference in New Issue
Block a user