add to char review

This commit is contained in:
chrys 2018-05-29 00:06:52 +02:00
parent 21bdcdb56e
commit 3bffb8b80c
11 changed files with 41 additions and 6 deletions

View File

@ -24,8 +24,8 @@ General (Easy for contribution)
[=================> ] 100%
######################## 100%
Imporove attribute handling
[W] improve attributes_curr_char (Easy for contribution)
[] add an attribute sound (Easy for contribution)
[X] improve attributes_curr_char (Easy for contribution)
[W] add an attribute sound (Easy for contribution)
[] beep on cursor/ review by char (capital wins) (Easy for contribution)
[] beep on review by word (once for multiple, capital wins) (Easy for contribution)
[] configurable (by char, by word, none) (Easy for contribution)
@ -79,8 +79,8 @@ Driver (screen, input):
[X] resize on colum / line change
[X] make shell command configurable (or detect it)
[X] stop emulation properly
[W] attributes
[W] unify hilgight tracking
[X] attributes
[X] unify hilgight tracking
[X] make pasteing text work again
https://docs.python.org/3.2/library/pty.html
http://sqizit.bartletts.id.au/2011/02/14/pseudo-terminals-in-python/

View File

@ -178,6 +178,8 @@ commandPath=
#fenrirFontSize = the fontsize
attributeFormatString=Background fenrirBGColor,Foreground fenrirFGColor,fenrirUnderline,fenrirBold,fenrirBlink, Font fenrirFont,Fontsize fenrirFontSize
autoPresentIndent=False
# play a sound when attributes are changeing
hasAttributes=True
# shell for PTY emulatiun (empty = default shell)
shell=

View File

@ -186,6 +186,8 @@ commandPath=
#fenrirFontSize = the fontsize
attributeFormatString=Background fenrirBGColor,Foreground fenrirFGColor,fenrirUnderline,fenrirBold,fenrirBlink, Font fenrirFont,Fontsize fenrirFontSize
autoPresentIndent=False
# play a sound when attributes are changeing
hasAttributes=True
# shell for PTY emulatiun (empty = default shell)
shell=

View File

@ -187,6 +187,8 @@ commandPath=
#fenrirFontSize = the fontsize
attributeFormatString=Background fenrirBGColor,Foreground fenrirFGColor,fenrirUnderline,fenrirBold,fenrirBlink, Font fenrirFont,Fontsize fenrirFontSize
autoPresentIndent=False
# play a sound when attributes are changeing
hasAttributes=True
# shell for PTY emulatiun (empty = default shell)
shell=

View File

@ -132,6 +132,8 @@ commandPath=
#fenrirFontSize = the fontsize
attributeFormatString=Background fenrirBGColor,Foreground fenrirFGColor,fenrirUnderline,fenrirBold,fenrirBlink, Font fenrirFont,Fontsize fenrirFontSize
autoPresentIndent=False
# play a sound when attributes are changeing
hasAttributes=True
# shell for PTY emulatiun (empty = default shell)
shell=

View File

@ -186,6 +186,8 @@ commandPath=
#fenrirFontSize = the fontsize
attributeFormatString=Background fenrirBGColor,Foreground fenrirFGColor,fenrirUnderline,fenrirBold,fenrirBlink, Font fenrirFont,Fontsize fenrirFontSize
autoPresentIndent=False
# play a sound when attributes are changeing
hasAttributes=True
# shell for PTY emulatiun (empty = default shell)
shell=

View File

@ -24,6 +24,13 @@ class command():
char_utils.getCurrentChar(self.env['screen']['newCursorReview']['x'], self.env['screen']['newCursorReview']['y'], self.env['screen']['newContentText'])
self.env['runtime']['outputManager'].presentText(currChar ,interrupt=True, ignorePunctuation=True, announceCapital=True, flush=False)
# is has attribute it enabled?
if self.env['runtime']['settingsManager'].getSettingAsBool('general', 'hasAttributes'):
cursorPos = self.env['screen']['newCursorReview']
if not self.env['runtime']['attributeManager'].hasAttributes(cursorPos):
return
self.env['runtime']['outputManager'].presentText('has attribute', soundIcon='HasAttributes', interrupt=False)
def setCallback(self, callback):
pass

View File

@ -28,6 +28,13 @@ class command():
self.env['runtime']['outputManager'].presentText(_('end of screen'), interrupt=True, soundIcon='EndOfScreen')
if lineBreak:
if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'lineBreak'):
self.env['runtime']['outputManager'].presentText(_('line break'), interrupt=False, soundIcon='EndOfLine')
self.env['runtime']['outputManager'].presentText(_('line break'), interrupt=False, soundIcon='EndOfLine')
# is has attribute it enabled?
if self.env['runtime']['settingsManager'].getSettingAsBool('general', 'hasAttributes'):
cursorPos = self.env['screen']['newCursorReview']
if not self.env['runtime']['attributeManager'].hasAttributes(cursorPos):
return
self.env['runtime']['outputManager'].presentText('has attribute', soundIcon='HasAttributes', interrupt=False)
def setCallback(self, callback):
pass

View File

@ -31,6 +31,13 @@ class command():
self.env['runtime']['outputManager'].presentText(_('end of screen'), interrupt=True, soundIcon='EndOfScreen')
if lineBreak:
if self.env['runtime']['settingsManager'].getSettingAsBool('review', 'lineBreak'):
self.env['runtime']['outputManager'].presentText(_('line break'), interrupt=False, soundIcon='EndOfLine')
self.env['runtime']['outputManager'].presentText(_('line break'), interrupt=False, soundIcon='EndOfLine')
# is has attribute it enabled?
if self.env['runtime']['settingsManager'].getSettingAsBool('general', 'hasAttributes'):
cursorPos = self.env['screen']['newCursorReview']
if not self.env['runtime']['attributeManager'].hasAttributes(cursorPos):
return
self.env['runtime']['outputManager'].presentText('has attribute', soundIcon='HasAttributes', interrupt=False)
def setCallback(self, callback):
pass

View File

@ -17,6 +17,9 @@ class command():
def getDescription(self):
return _('Reads attributes of current cursor position')
def run(self):
# is it enabled?
if not self.env['runtime']['settingsManager'].getSettingAsBool('general', 'hasAttributes'):
return
# is a vertical change?
if not (self.env['runtime']['cursorManager'].isCursorVerticalMove() or\
self.env['runtime']['cursorManager'].isCursorHorizontalMove()):

View File

@ -74,6 +74,7 @@ settingsData = {
'commandPath': '/usr/share/fenrir/commands',
'attributeFormatString': 'Background fenrirBGColor,Foreground fenrirFGColor,fenrirUnderline,fenrirBold,fenrirBlink, Font fenrirFont,Fontsize fenrirFontSize',
'autoPresentIndent': False,
'hasAttributes': True,
'shell': '',
},
'focus':{