add has attribute toggle

This commit is contained in:
chrys
2018-07-07 17:33:56 +02:00
parent ed98994241
commit 2d5609dd84
4 changed files with 29 additions and 0 deletions

View File

@ -0,0 +1,26 @@
#!/bin/python
# -*- coding: utf-8 -*-
# Fenrir TTY screen reader
# By Chrys, Storm Dragon, and contributers.
from fenrirscreenreader.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 the announcement of attributes')
def run(self):
self.env['runtime']['settingsManager'].setSetting('general', 'hasAttributes', str(not self.env['runtime']['settingsManager'].getSettingAsBool('general', 'hasAttributes')))
if self.env['runtime']['settingsManager'].getSettingAsBool('general', 'hasAttributes'):
self.env['runtime']['outputManager'].presentText(_("announcement of attributes enabled"), soundIcon='', interrupt=True)
else:
self.env['runtime']['outputManager'].presentText(_("announcement of attributes disabled"), soundIcon='', interrupt=True)
def setCallback(self, callback):
pass