Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a script to oopen NVDA config directory #10493

Merged
merged 14 commits into from
Mar 27, 2020
20 changes: 15 additions & 5 deletions source/config/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# -*- coding: UTF-8 -*-
#config/__init__.py
#A part of NonVisual Desktop Access (NVDA)
#Copyright (C) 2006-2018 NV Access Limited, Aleksey Sadovoy, Peter Vágner, Rui Batista, Zahari Yurukov, Joseph Lee, Babbage B.V.
#This file is covered by the GNU General Public License.
#See the file COPYING for more details.
# A part of NonVisual Desktop Access (NVDA)
# Copyright (C) 2006-2019 NV Access Limited, Aleksey Sadovoy, Peter Vágner, Rui Batista, Zahari Yurukov,
# Joseph Lee, Babbage B.V., Łukasz Golonka
# This file is covered by the GNU General Public License.
# See the file COPYING for more details.

"""Manages NVDA configuration.
The heart of NVDA's configuration is Configuration Manager, which records current options, profile information and functions to load, save, and switch amongst configuration profiles.
Expand Down Expand Up @@ -315,6 +315,16 @@ def setStartOnLogonScreen(enable):
if execElevated(SLAVE_FILENAME, (u"config_setStartOnLogonScreen", u"%d" % enable), wait=True) != 0:
raise RuntimeError("Slave failed to set startOnLogonScreen")


def openConfigurationDirectory():
feerrenrut marked this conversation as resolved.
Show resolved Hide resolved
feerrenrut marked this conversation as resolved.
Show resolved Hide resolved
path = getUserDefaultConfigPath()
if not path:
raise ValueError("no user default config path")
initConfigPath(path)
import shellapi
import winUser
shellapi.ShellExecute(0, None, path, None, None, winUser.SW_SHOWNORMAL)

def getConfigDirs(subpath=None):
"""Retrieve all directories that should be used when searching for configuration.
IF C{subpath} is provided, it will be added to each directory returned.
Expand Down
10 changes: 10 additions & 0 deletions source/globalCommands.py
Original file line number Diff line number Diff line change
Expand Up @@ -1568,6 +1568,16 @@ def script_navigatorObject_devInfo(self,gesture):
script_navigatorObject_devInfo.__doc__ = _("Logs information about the current navigator object which is useful to developers and activates the log viewer so the information can be examined.")
script_navigatorObject_devInfo.category=SCRCAT_TOOLS

@script(
# Translators: Input help mode message for Open configuration directory command.
description=_("Opens NVDA configuration directory."),
feerrenrut marked this conversation as resolved.
Show resolved Hide resolved
category=SCRCAT_TOOLS
)
def script_openConfigurationDirectory(self, gesture):
if globalVars.appArgs.secure:
return
config.openConfigurationDirectory()

def script_toggleProgressBarOutput(self,gesture):
outputMode=config.conf["presentation"]["progressBarUpdates"]["progressBarOutputMode"]
if outputMode=="both":
Expand Down
3 changes: 3 additions & 0 deletions source/gui/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,9 @@ def __init__(self, frame):
# Translators: The label for the menu item to open NVDA Log Viewer.
item = menu_tools.Append(wx.ID_ANY, _("View log"))
self.Bind(wx.EVT_MENU, frame.onViewLogCommand, item)
# Translators: The label for the menu item to open NVDA configuration directory.
item = menu_tools.Append(wx.ID_ANY, _("Open &configuration directory"))
feerrenrut marked this conversation as resolved.
Show resolved Hide resolved
self.Bind(wx.EVT_MENU, lambda evt: config.openConfigurationDirectory(), item)
# Translators: The label for the menu item to toggle Speech Viewer.
item=self.menu_tools_toggleSpeechViewer = menu_tools.AppendCheckItem(wx.ID_ANY, _("Speech viewer"))
self.Bind(wx.EVT_MENU, frame.onToggleSpeechViewerCommand, item)
Expand Down
8 changes: 1 addition & 7 deletions source/nvda_slave.pyw
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,7 @@ def main():
config._setStartOnLogonScreen(enable)
elif action == "explore_userConfigPath":
import config
path=config.getUserDefaultConfigPath()
if not path:
raise ValueError("no user default config path")
config.initConfigPath(path)
import shellapi
import winUser
shellapi.ShellExecute(0,None,path,None,None,winUser.SW_SHOWNORMAL)
config.openConfigurationDirectory()
elif action == "addons_installAddonPackage":
try:
addonPath=args[0]
Expand Down
3 changes: 2 additions & 1 deletion user_docs/en/userGuide.t2t
Original file line number Diff line number Diff line change
Expand Up @@ -1921,7 +1921,8 @@ Portable versions of NVDA store all settings and add-ons in a directory called u

Installed versions of NVDA store all settings and add-ons in a special NVDA directory located in your Windows user profile.
This means that each user on the system can have their own NVDA settings.
To get to your settings directory for an installed version of NVDA, on the start menu you can go to programs -> NVDA -> explore user configuration directory.
If you wish to access you settings directory you can use appropriate option from the tools menu, or use [Input Gestures dialog #InputGestures] to add a custom gesture.
lukaszgo1 marked this conversation as resolved.
Show resolved Hide resolved
In addition for an installed version of NVDA, on the start menu you can go to programs -> NVDA -> explore user configuration directory.

Settings for NVDA when running on the logon or UAC screens are stored in the systemConfig directory in NVDA's installation directory.
Usually, this configuration should not be touched.
Expand Down