add toggle_emoticon

This commit is contained in:
root
2016-10-12 22:22:02 +02:00
parent f817c12618
commit bc396a9223
10 changed files with 36 additions and 1 deletions

View File

@ -0,0 +1,26 @@
#!/bin/python
# -*- coding: utf-8 -*-
# Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers.
from core import debug
class command():
def __init__(self):
pass
def initialize(self, environment):
self.env = environment
def shutdown(self):
pass
def getDescription(self):
return 'enables or disables announcement of emoticons insteed of chars'
def run(self):
self.env['runtime']['settingsManager'].setSetting('general', 'emoticons', str(not self.env['runtime']['settingsManager'].getSettingAsBool('general', 'emoticons')))
if self.env['runtime']['settingsManager'].getSettingAsBool('general', 'emoticons'):
self.env['runtime']['outputManager'].presentText("emoticons enabled", soundIcon='', interrupt=True)
else:
self.env['runtime']['outputManager'].presentText("emoticons disabled", soundIcon='', interrupt=True)
def setCallback(self, callback):
pass

View File

@ -40,7 +40,8 @@ class punctuationManager():
def proceedPunctuation(self, text, ignorePunctuation=False):
resultText = text
resultText = self.useCustomDict(resultText, self.env['punctuation']['CUSTOMDICT'])
resultText = self.useCustomDict(resultText, self.env['punctuation']['EMOJDICT'])
if self.env['runtime']['settingsManager'].getSetting('general', 'emoticons'):
resultText = self.useCustomDict(resultText, self.env['punctuation']['EMOJDICT'])
currPunctLevel = ''
if not ignorePunctuation and self.env['runtime']['settingsManager'].getSetting('general', 'punctuationLevel').lower() in self.env['punctuation']['LEVELDICT']:
currPunctLevel = self.env['punctuation']['LEVELDICT'][self.env['runtime']['settingsManager'].getSetting('general', 'punctuationLevel').lower()]

View File

@ -44,6 +44,7 @@ settings = {
'punctuationProfile':'default',
'punctuationLevel': 1,
'numberOfClipboards': 10,
'emoticons': True,
'fenrirKeys': ['KEY_KP0'],
'timeFormat': '%I:%M%P',
'dateFormat': '%A, %B %d, %Y',