Skip to content

Commit

Permalink
my version of the class
Browse files Browse the repository at this point in the history
  • Loading branch information
Luke Davis authored and Luke Davis committed Sep 30, 2024
1 parent 156cf72 commit ae58dbd
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
22 changes: 20 additions & 2 deletions addon/globalPlugins/speechLogger/configUI.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ def onSeparatorChoiceChange(self, evt):
self.customSeparatorControl.Enable(False)


class SLPathSelectionHelper(guiHelper.PathSelectionHelper):
class SLPathSelectionHelper(object):
"""
Abstracts away details for creating a path selection helper. The path selection helper is a textCtrl with a
button in horizontal layout. The Button launches a directory explorer. To get the path selected by the user, use the
Expand All @@ -316,5 +316,23 @@ def __init__(self, parent: wx.Dialog, buttonText: str, browseForDirectoryTitle:
self._browseButton = wx.Button(parent, label=buttonText)
self._browseForDirectoryTitle = browseForDirectoryTitle
self._browseButton.Bind(wx.EVT_BUTTON, self.onBrowseForDirectory)
self._sizer = associateElements(self._textCtrl, self._browseButton)
self._sizer = guiHelper.associateElements(self._textCtrl, self._browseButton)
self._parent = parent

@property
def pathControl(self):
return self._textCtrl

@property
def sizer(self):
return self._sizer

def getDefaultBrowseForDirectoryPath(self):
return self._textCtrl.Value or "c:\\"

def onBrowseForDirectory(self, evt):
startPath = self.getDefaultBrowseForDirectoryPath()
with wx.DirDialog(self._parent, self._browseForDirectoryTitle, defaultPath=startPath) as d:
if d.ShowModal() == wx.ID_OK:
self._textCtrl.Value = d.Path

2 changes: 1 addition & 1 deletion buildVars.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def _(arg):
# Translators: Long description to be shown for this add-on on add-on information from add-ons manager
"addon_description": _("""Logs speech utterances to a file, after the user presses an initiating key. Can also log NVDA remote session speech from the NVDA Remote add-on, to the same or another file. Optionally includes speech from say-all."""),
# version
"addon_version": "24.2.509",
"addon_version": "24.2.510",
# Author(s)
"addon_author": "Luke Davis <XLTechie@newanswertech.com>, James Scholes",
# URL for the add-on documentation support
Expand Down

0 comments on commit ae58dbd

Please sign in to comment.