From 629fa3576cbd6a02e5c748c32b8fca0ffebadb0f Mon Sep 17 00:00:00 2001 From: chrys Date: Mon, 8 Aug 2016 11:15:47 +0200 Subject: [PATCH] add toggle_autoread, typo --- config/keyboard/desktop.conf | 9 +++++---- .../commands/commands/toggle_autoRead.py | 17 +++++++++++++++++ ...ggle_braille_enable.py => toggle_braille.py} | 0 ...toggle_output_enable.py => toggle_output.py} | 0 .../{toggle_sound_enable.py => toggle_sound.py} | 0 ...toggle_speech_enable.py => toggle_speech.py} | 0 6 files changed, 22 insertions(+), 4 deletions(-) create mode 100644 src/fenrir-package/commands/commands/toggle_autoRead.py rename src/fenrir-package/commands/commands/{toggle_braille_enable.py => toggle_braille.py} (100%) rename src/fenrir-package/commands/commands/{toggle_output_enable.py => toggle_output.py} (100%) rename src/fenrir-package/commands/commands/{toggle_sound_enable.py => toggle_sound.py} (100%) rename src/fenrir-package/commands/commands/{toggle_speech_enable.py => toggle_speech.py} (100%) diff --git a/config/keyboard/desktop.conf b/config/keyboard/desktop.conf index bfcb0fd2..17797911 100644 --- a/config/keyboard/desktop.conf +++ b/config/keyboard/desktop.conf @@ -10,7 +10,8 @@ 1-KEY_KP1=prev_char 1-KEY_KP3=next_char 1-KEY_KPDOT=exit_review -1-KEY_KP0,1-KEY_F2=toggle_braille_enable -1-KEY_KP0,1-KEY_F3=toggle_sound_enable -1-KEY_KP0,1-KEY_F4=toggle_speech_enable -#=toggle_output_enable +1-KEY_KP0,1-KEY_F2=toggle_braille +1-KEY_KP0,1-KEY_F3=toggle_sound +1-KEY_KP0,1-KEY_F4=toggle_speech +#=toggle_output +#=toggle_autoRead diff --git a/src/fenrir-package/commands/commands/toggle_autoRead.py b/src/fenrir-package/commands/commands/toggle_autoRead.py new file mode 100644 index 00000000..4c1611f0 --- /dev/null +++ b/src/fenrir-package/commands/commands/toggle_autoRead.py @@ -0,0 +1,17 @@ +#!/bin/python + +class command(): + def __init__(self): + pass + def run(self, environment): + + environment = environment['runtime']['settingsManager'].setSetting(environment, 'speech', 'autoReadIncomming', str(not environment['runtime']['settingsManager'].getSettingAsBool(environment, 'speech', 'autoReadIncomming'))) + if environment['runtime']['settingsManager'].getSettingAsBool(environment, 'speech', 'autoReadIncomming'): + environment['runtime']['outputManager'].presentText(environment, "autoread enabled",soundIconName='', interrupt=True) + else: + environment['runtime']['outputManager'].presentText(environment, "autoread disabled",soundIconName='', interrupt=True) + return environment + def setCallback(self, callback): + pass + def shutdown(self): + pass diff --git a/src/fenrir-package/commands/commands/toggle_braille_enable.py b/src/fenrir-package/commands/commands/toggle_braille.py similarity index 100% rename from src/fenrir-package/commands/commands/toggle_braille_enable.py rename to src/fenrir-package/commands/commands/toggle_braille.py diff --git a/src/fenrir-package/commands/commands/toggle_output_enable.py b/src/fenrir-package/commands/commands/toggle_output.py similarity index 100% rename from src/fenrir-package/commands/commands/toggle_output_enable.py rename to src/fenrir-package/commands/commands/toggle_output.py diff --git a/src/fenrir-package/commands/commands/toggle_sound_enable.py b/src/fenrir-package/commands/commands/toggle_sound.py similarity index 100% rename from src/fenrir-package/commands/commands/toggle_sound_enable.py rename to src/fenrir-package/commands/commands/toggle_sound.py diff --git a/src/fenrir-package/commands/commands/toggle_speech_enable.py b/src/fenrir-package/commands/commands/toggle_speech.py similarity index 100% rename from src/fenrir-package/commands/commands/toggle_speech_enable.py rename to src/fenrir-package/commands/commands/toggle_speech.py