diff --git a/addon/globalPlugins/speechLogger/configUI.py b/addon/globalPlugins/speechLogger/configUI.py index d9798e2..ba808a7 100644 --- a/addon/globalPlugins/speechLogger/configUI.py +++ b/addon/globalPlugins/speechLogger/configUI.py @@ -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 @@ -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 + diff --git a/buildVars.py b/buildVars.py index 3584714..f21d70f 100644 --- a/buildVars.py +++ b/buildVars.py @@ -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 , James Scholes", # URL for the add-on documentation support