commit/placeMarkers: norrumar: Specify the add-on summary in documentation of copy and restore dialog scripts. Use style without new directory button in Restore dialog.

  • From: commits-noreply@xxxxxxxxxxxxx
  • To: nvda-addons-commits@xxxxxxxxxxxxx
  • Date: Wed, 02 Nov 2016 06:14:40 -0000

1 new commit in placeMarkers:

https://bitbucket.org/nvdaaddonteam/placemarkers/commits/be68f39e0494/
Changeset:   be68f39e0494
Branch:      7.0
User:        norrumar
Date:        2016-11-02 06:14:27+00:00
Summary:     Specify the add-on summary in documentation of copy and restore 
dialog scripts. Use style without new directory button in Restore dialog.

Affected #:  1 file

diff --git a/addon/globalPlugins/placeMarkers.py 
b/addon/globalPlugins/placeMarkers.py
index e5bf105..c3b5da2 100755
--- a/addon/globalPlugins/placeMarkers.py
+++ b/addon/globalPlugins/placeMarkers.py
@@ -364,6 +364,17 @@ class CopyDialog(wx.Dialog):
        def onCancel(self, evt):
                self.Destroy()
 
+class PathSelectionWithoutNewDir(gui.guiHelper.PathSelectionHelper):
+
+       def __init__(self, parent, buttonText, browseForDirectoryTitle):
+               super(PathSelectionWithoutNewDir, self).__init__(parent, 
buttonText, browseForDirectoryTitle)
+
+       def onBrowseForDirectory(self, evt):
+               startPath = self.getDefaultBrowseForDirectoryPath()
+               with wx.DirDialog(self._parent, self._browseForDirectoryTitle, 
defaultPath=startPath, style=wx.DD_DIR_MUST_EXIST | wx.DD_DEFAULT_STYLE) as d:
+                       if d.ShowModal() == wx.ID_OK:
+                               self._textCtrl.Value = d.Path
+
 class RestoreDialog(wx.Dialog):
 
        def __init__(self, parent):
@@ -385,7 +396,7 @@ class RestoreDialog(wx.Dialog):
                browseText = _("Browse...")
                # Translators: The title of the dialog presented when browsing 
for the destination directory when restoring place markers.
                dirDialogTitle = _("Select directory to restore")
-               directoryEntryControl = 
groupHelper.addItem(gui.guiHelper.PathSelectionHelper(self, browseText, 
dirDialogTitle))
+               directoryEntryControl = 
groupHelper.addItem(PathSelectionWithoutNewDir(self, browseText, 
dirDialogTitle))
                self.restoreDirectoryEdit = directoryEntryControl.pathControl
                backupDirectory = os.path.join(_configPath, 
"placeMarkersBackup")
                if os.path.isdir(backupDirectory):
@@ -496,7 +507,7 @@ class GlobalPlugin(globalPluginHandler.GlobalPlugin):
 
        def script_activateCopyDialog(self, gesture):
                wx.CallAfter(self.onCopy, None)
-       script_activateCopyDialog.__doc__ = _("Activates the Copy dialog.")
+       script_activateCopyDialog.__doc__ = _("Activates the Copy dialog of 
%s." % _addonSummary)
 
        def onRestore(self, evt):
                gui.mainFrame.prePopup()
@@ -506,7 +517,7 @@ class GlobalPlugin(globalPluginHandler.GlobalPlugin):
 
        def script_activateRestoreDialog(self, gesture):
                wx.CallAfter(self.onRestore, None)
-       script_activateRestoreDialog.__doc__ = _("Activates the Restore 
dialog.")
+       script_activateRestoreDialog.__doc__ = _("Activates the Restore dialog 
of %s." % _addonSummary)
 
        def popupSpecificSearchDialog(self):
                if gui.isInMessageBox:

Repository URL: https://bitbucket.org/nvdaaddonteam/placemarkers/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.

Other related posts:

  • » commit/placeMarkers: norrumar: Specify the add-on summary in documentation of copy and restore dialog scripts. Use style without new directory button in Restore dialog. - commits-noreply