Skip to content

Commit

Permalink
When updating a previously installed copy of NVDA, the desktop shortc…
Browse files Browse the repository at this point in the history
…ut key is no longer forced back to control+alt+n as it many have been manually changed by the user. The checkbox in the installer which asks if the shortcut should be created is also renamed to "Keep existing shortcut" in this situation to reflect this. Fixes #2572.
  • Loading branch information
michaelDCurran committed Aug 5, 2012
1 parent da27d40 commit 1ecf4d0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
11 changes: 8 additions & 3 deletions source/gui/installerGui.py
Expand Up @@ -96,9 +96,14 @@ def __init__(self, parent):
ctrl = self.startOnLogonCheckbox = wx.CheckBox(self, label=_("Use NVDA on the Windows &logon screen"))
ctrl.Value = config.getStartOnLogonScreen() if self.isUpdate else True
optionsSizer.Add(ctrl)
# Translators: The label of a checkbox option in the Install NVDA dialog.
ctrl = self.createDesktopShortcutCheckbox = wx.CheckBox(self, label=_("Create &desktop icon and shortcut key (control+alt+n)"))
ctrl.Value = installer.isDesktopShortcutInstalled() if self.isUpdate else True
shortcutIsPrevInstalled=installer.isDesktopShortcutInstalled()
if self.isUpdate and shortcutIsPrevInstalled:
# Translators: The label of a checkbox option in the Install NVDA dialog.
ctrl = self.createDesktopShortcutCheckbox = wx.CheckBox(self, label=_("&Keep existing desktop shortcut"))
else:
# Translators: The label of a checkbox option in the Install NVDA dialog.
ctrl = self.createDesktopShortcutCheckbox = wx.CheckBox(self, label=_("Create &desktop icon and shortcut key (control+alt+n)"))
ctrl.Value = shortcutIsPrevInstalled if self.isUpdate else True
optionsSizer.Add(ctrl)
# Translators: The label of a checkbox option in the Install NVDA dialog.
ctrl = self.copyPortableConfigCheckbox = wx.CheckBox(self, label=_("Copy &portable configuration to current user account"))
Expand Down
9 changes: 5 additions & 4 deletions source/installer.py
Expand Up @@ -39,11 +39,12 @@ def createShortcut(path,targetPath=None,arguments=None,iconLocation=None,working
path=os.path.join(specialPath,path)
if not os.path.isdir(os.path.dirname(path)):
os.makedirs(os.path.dirname(path))
shortcutExists=os.path.isfile(path)
short=wsh.CreateShortcut(path)
short.TargetPath=targetPath
if arguments:
short.arguments=arguments
if hotkey:
if not shortcutExists and hotkey:
short.Hotkey=hotkey
if iconLocation:
short.IconLocation=iconLocation
Expand Down Expand Up @@ -164,7 +165,7 @@ def isDesktopShortcutInstalled():
shortcutPath=os.path.join(specialPath,"nvda.lnk")
return os.path.isfile(shortcutPath)

def unregisterInstallation():
def unregisterInstallation(keepDesktopShortcut=False):
import nvda_service
try:
nvda_service.stopService()
Expand All @@ -176,7 +177,7 @@ def unregisterInstallation():
pass
wsh=_getWSH()
desktopPath=os.path.join(wsh.SpecialFolders("AllUsersDesktop"),"NVDA.lnk")
if os.path.isfile(desktopPath):
if not keepDesktopShortcut and os.path.isfile(desktopPath):
try:
os.remove(desktopPath)
except WindowsError:
Expand Down Expand Up @@ -254,7 +255,7 @@ def tryCopyFile(sourceFilePath,destFilePath):

def install(shouldCreateDesktopShortcut=True,shouldRunAtLogon=True):
prevInstallPath=getInstallPath(noDefault=True)
unregisterInstallation()
unregisterInstallation(keepDesktopShortcut=shouldCreateDesktopShortcut)
installDir=defaultInstallPath
startMenuFolder=defaultStartMenuFolder
# Remove all the main executables always.
Expand Down
1 change: 1 addition & 0 deletions user_docs/en/changes.t2t
Expand Up @@ -24,6 +24,7 @@
- In the NVDA Review Cursor preferences dialog, the Follow keyboard focus option has been renamed to Follow system focus for consistency with terminology used elsewhere in NVDA.
- When braille is tethered to review and the cursor is on an object which is not a text object (e.g. an editable text field), cursor routing keys will now activate the object. (#2386)
- The Save Settings On Exit option is now on by default for new configurations.
- When updating a previously installed copy of NVDA, the desktop shortcut key is no longer forced back to control+alt+n if it was manually changed to something different by the user. (#2572)


== Bug Fixes ==
Expand Down

0 comments on commit 1ecf4d0

Please sign in to comment.