From 095ca335173657c38b3963fa4dc7957d8c970906 Mon Sep 17 00:00:00 2001 From: chrys Date: Mon, 5 Sep 2016 22:05:40 +0200 Subject: [PATCH] add toggle spellcheck --- config/keyboard/desktop.conf | 3 ++- config/keyboard/laptop.conf | 3 ++- config/keyboard/test.conf | 3 ++- .../{toggle_autoRead.py => toggle_auto_read.py} | 0 .../commands/toggle_auto_spell_check.py | 17 +++++++++++++++++ 5 files changed, 23 insertions(+), 3 deletions(-) rename src/fenrir-package/commands/commands/{toggle_autoRead.py => toggle_auto_read.py} (100%) create mode 100644 src/fenrir-package/commands/commands/toggle_auto_spell_check.py diff --git a/config/keyboard/desktop.conf b/config/keyboard/desktop.conf index aca358b7..602a228b 100644 --- a/config/keyboard/desktop.conf +++ b/config/keyboard/desktop.conf @@ -22,8 +22,9 @@ 1-FENRIR,1-KEY_F2=toggle_braille 1-FENRIR,1-KEY_F3=toggle_sound 1-FENRIR,1-KEY_F4=toggle_speech +#=toggle_auto_spell_check #=toggle_output -#=toggle_autoRead +#=toggle_auto_read 1-FENRIR,1-KEY_Q=quit_fenrir 1-FENRIR,1-KEY_T=time 1-FENRIR,1-KEY_D=date diff --git a/config/keyboard/laptop.conf b/config/keyboard/laptop.conf index 26a57dc1..623868b1 100644 --- a/config/keyboard/laptop.conf +++ b/config/keyboard/laptop.conf @@ -22,8 +22,9 @@ 1-KEY_CAPSLOCK,1-KEY_F2=toggle_braille 1-KEY_CAPSLOCK,1-KEY_F3=toggle_sound 1-KEY_CAPSLOCK,1-KEY_F4=toggle_speech +#=toggle_auto_spell_check #=toggle_output -#=toggle_autoRead +#=toggle_auto_read #=quit_fenrir #=time #=date diff --git a/config/keyboard/test.conf b/config/keyboard/test.conf index 52e9eb7a..6f34de67 100644 --- a/config/keyboard/test.conf +++ b/config/keyboard/test.conf @@ -22,8 +22,9 @@ 1-FENRIR,1-KEY_F2=toggle_braille #1-FENRIR,1-KEY_F3=toggle_sound 1-FENRIR,1-KEY_F4=toggle_speech +#=toggle_auto_spell_check #=toggle_output -#=toggle_autoRead +#=toggle_auto_read #=quit_fenrir 1-FENRIR,1-KEY_T=time 1-FENRIR,1-KEY_R=date diff --git a/src/fenrir-package/commands/commands/toggle_autoRead.py b/src/fenrir-package/commands/commands/toggle_auto_read.py similarity index 100% rename from src/fenrir-package/commands/commands/toggle_autoRead.py rename to src/fenrir-package/commands/commands/toggle_auto_read.py diff --git a/src/fenrir-package/commands/commands/toggle_auto_spell_check.py b/src/fenrir-package/commands/commands/toggle_auto_spell_check.py new file mode 100644 index 00000000..35ad8e79 --- /dev/null +++ b/src/fenrir-package/commands/commands/toggle_auto_spell_check.py @@ -0,0 +1,17 @@ +#!/bin/python + +class command(): + def __init__(self): + pass + def run(self, environment): + + environment = environment['runtime']['settingsManager'].setSetting(environment, 'general', 'autoSpellCheck', str(not environment['runtime']['settingsManager'].getSettingAsBool(environment, 'general', 'autoSpellCheck'))) + if environment['runtime']['settingsManager'].getSettingAsBool(environment, 'general', 'autoSpellCheck'): + environment['runtime']['outputManager'].presentText(environment, "auto spellcheck enabled", soundIcon='', interrupt=True) + else: + environment['runtime']['outputManager'].presentText(environment, "auto spellcheck disabled", soundIcon='', interrupt=True) + return environment + def setCallback(self, callback): + pass + def shutdown(self): + pass