add toggle_emoticon
This commit is contained in:
parent
f817c12618
commit
bc396a9223
@ -66,6 +66,7 @@ KEY_FENRIR,KEY_F4=toggle_speech
|
||||
KEY_FENRIR,KEY_CTRL,KEY_P=toggle_punctuation_level
|
||||
KEY_FENRIR,KEY_RIGHTBRACE=toggle_auto_spell_check
|
||||
KEY_FENRIR,KEY_BACKSLASH=toggle_output
|
||||
#=toggle_emoticons
|
||||
key_FENRIR,KEY_KPENTER=toggle_auto_read
|
||||
KEY_FENRIR,KEY_Q=quit_fenrir
|
||||
KEY_FENRIR,KEY_T=time
|
||||
|
@ -66,6 +66,7 @@ KEY_FENRIR,KEY_F4=toggle_speech
|
||||
KEY_FENRIR,KEY_SHIFT,KEY_CTRL,KEY_P=toggle_punctuation_level
|
||||
KEY_FENRIR,KEY_RIGHTBRACE=toggle_auto_spell_check
|
||||
KEY_FENRIR,KEY_SHIFT,KEY_ENTER=toggle_output
|
||||
#=toggle_emoticons
|
||||
KEY_FENRIR,KEY_ENTER=toggle_auto_read
|
||||
KEY_FENRIR,KEY_Q=quit_fenrir
|
||||
KEY_FENRIR,KEY_T=time
|
||||
|
@ -66,6 +66,7 @@ KEY_FENRIR,KEY_F4=toggle_speech
|
||||
KEY_FENRIR,KEY_CTRL,KEY_P=toggle_punctuation_level
|
||||
KEY_FENRIR,KEY_RIGHTBRACE=toggle_auto_spell_check
|
||||
KEY_FENRIR,KEY_BACKSLASH=toggle_output
|
||||
#=toggle_emoticons
|
||||
key_FENRIR,KEY_KPENTER=toggle_auto_read
|
||||
KEY_FENRIR,KEY_Q=quit_fenrir
|
||||
KEY_FENRIR,KEY_T=time
|
||||
|
@ -100,6 +100,7 @@ debugLevel=3
|
||||
punctuationProfile=default
|
||||
punctuationLevel=some
|
||||
numberOfClipboards=10
|
||||
emoticons=True
|
||||
# define the current fenrir key
|
||||
fenrirKeys=KEY_KP0,KEY_META
|
||||
timeFormat=%H:%M:%P
|
||||
|
@ -100,6 +100,7 @@ debugLevel=1
|
||||
punctuationProfile=default
|
||||
punctuationLevel=Some
|
||||
numberOfClipboards=10
|
||||
emoticons=True
|
||||
# define the current fenrir key
|
||||
fenrirKeys=KEY_KP0,KEY_META
|
||||
timeFormat=%H:%M:%P
|
||||
|
@ -98,6 +98,7 @@ debugLevel=0
|
||||
punctuationProfile=default
|
||||
punctuationLevel=some
|
||||
numberOfClipboards=10
|
||||
emoticons=True
|
||||
# define the current fenrir key
|
||||
fenrirKeys=KEY_KP0,KEY_META
|
||||
timeFormat=%H:%M%P
|
||||
|
@ -51,6 +51,7 @@ debugLevel=0
|
||||
punctuationProfile=default
|
||||
punctuationLevel=some
|
||||
numberOfClipboards=10
|
||||
emoticons=True
|
||||
fenrirKeys=KEY_KP0
|
||||
timeFormat=%H:%M:%P
|
||||
dateFormat="%A, %B %d, %Y"
|
||||
|
26
src/fenrir/commands/commands/toggle_emoticons.py
Normal file
26
src/fenrir/commands/commands/toggle_emoticons.py
Normal 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
|
@ -40,6 +40,7 @@ class punctuationManager():
|
||||
def proceedPunctuation(self, text, ignorePunctuation=False):
|
||||
resultText = text
|
||||
resultText = self.useCustomDict(resultText, self.env['punctuation']['CUSTOMDICT'])
|
||||
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']:
|
||||
|
@ -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',
|
||||
|
Loading…
Reference in New Issue
Block a user