make vmenu path configurable

This commit is contained in:
chrys 2019-02-12 20:04:46 +01:00
parent 20ff9e1296
commit 58208beb3a
10 changed files with 59 additions and 2 deletions

View File

@ -219,6 +219,9 @@ enabled=True
inactiveTimeoutSec=120 inactiveTimeoutSec=120
list= list=
[menu]
vmenuPath=
[time] [time]
enabled=False enabled=False
presentTime=True presentTime=True

View File

@ -229,6 +229,9 @@ enabled=True
inactiveTimeoutSec=120 inactiveTimeoutSec=120
list= list=
[menu]
vmenuPath=
[time] [time]
# automatic time anouncement # automatic time anouncement
enabled=False enabled=False

View File

@ -229,6 +229,9 @@ enabled=True
inactiveTimeoutSec=120 inactiveTimeoutSec=120
list= list=
[menu]
vmenuPath=
[time] [time]
# automatic time anouncement # automatic time anouncement
enabled=False enabled=False

View File

@ -229,6 +229,9 @@ enabled=True
inactiveTimeoutSec=120 inactiveTimeoutSec=120
list= list=
[menu]
vmenuPath=
[time] [time]
# automatic time anouncement # automatic time anouncement
enabled=False enabled=False

View File

@ -230,6 +230,9 @@ enabled=True
inactiveTimeoutSec=120 inactiveTimeoutSec=120
list= list=
[menu]
vmenuPath=
[time] [time]
# automatic time anouncement # automatic time anouncement
enabled=False enabled=False

View File

@ -175,6 +175,9 @@ enabled=True
inactiveTimeoutSec=120 inactiveTimeoutSec=120
list= list=
[menu]
vmenuPath=
[time] [time]
# automatic time anouncement # automatic time anouncement
enabled=False enabled=False

View File

@ -229,6 +229,9 @@ enabled=True
inactiveTimeoutSec=120 inactiveTimeoutSec=120
list= list=
[menu]
vmenuPath=
[time] [time]
# automatic time anouncement # automatic time anouncement
enabled=False enabled=False

View File

@ -0,0 +1,25 @@
#!/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
self.keyMakro = [[1, 'KEY_LEFTCTRL'], [1, 'KEY_G'], [0.05,'sleep'] ,[0, 'KEY_G'], [0, 'KEY_LEFTCTRL']]
def shutdown(self):
pass
def getDescription(self):
return 'No description found'
def run(self):
self.env['runtime']['inputManager'].sendKeys(self.keyMakro)
def setCallback(self, callback):
pass

View File

@ -99,6 +99,9 @@ settingsData = {
'leaveReviewOnCursorChange': True, 'leaveReviewOnCursorChange': True,
'leaveReviewOnScreenChange': True, 'leaveReviewOnScreenChange': True,
}, },
'menu':{
'vmenuPath': '',
},
'promote':{ 'promote':{
'enabled': True, 'enabled': True,
'inactiveTimeoutSec': 120, 'inactiveTimeoutSec': 120,

View File

@ -21,7 +21,15 @@ class vmenuManager():
self.lastSearchTime = time.time() self.lastSearchTime = time.time()
def initialize(self, environment): def initialize(self, environment):
self.env = environment self.env = environment
# use default path
self.defaultVMenuPath = fenrirPath+ "/commands/vmenu-profiles/" + self.env['runtime']['inputManager'].getShortcutType() self.defaultVMenuPath = fenrirPath+ "/commands/vmenu-profiles/" + self.env['runtime']['inputManager'].getShortcutType()
# if there is no user configuration
if self.env['runtime']['settingsManager'].getSetting('menu', 'vmenuPath') != '':
self.defaultVMenuPath = self.env['runtime']['settingsManager'].getSetting('menu', 'vmenuPath')
if not self.defaultVMenuPath.endswith('/'):
self.defaultVMenuPath += '/'
self.defaultVMenuPath += self.env['runtime']['inputManager'].getShortcutType()
self.createMenuTree() self.createMenuTree()
self.closeAfterAction = False self.closeAfterAction = False
def shutdown(self): def shutdown(self):
@ -37,9 +45,9 @@ class vmenuManager():
while True: while True:
entry = self.getCurrentEntry() entry = self.getCurrentEntry()
if entry.startswith(self.searchText): if entry.startswith(self.searchText):
return True return True
if not self.nextIndex(): if not self.nextIndex():
return False return False
if True: if True:
return False return False
def setCurrMenu(self, currMenu = ''): def setCurrMenu(self, currMenu = ''):