X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1f780e48af479e7bf9a07eaaa1ab6b41f1ffb17b..94211100ea69f8ff83942386467a47889a9a9c9d:/wxPython/samples/ide/activegrid/tool/UICommon.py?ds=sidebyside diff --git a/wxPython/samples/ide/activegrid/tool/UICommon.py b/wxPython/samples/ide/activegrid/tool/UICommon.py index 0f83b65e91..6b81a9b8cf 100644 --- a/wxPython/samples/ide/activegrid/tool/UICommon.py +++ b/wxPython/samples/ide/activegrid/tool/UICommon.py @@ -56,6 +56,10 @@ def CreateDirectoryControl( parent, fileLabel, dirLabel, fileExtension, starting if nameControl.GetValue().find(' ') != -1: wx.MessageBox(_("Please provide a filename that does not contains spaces."), _("Spaces in Filename")) return False + if not os.path.exists(dirControl.GetValue()): + wx.MessageBox(_("That directory does not exist. Please choose an existing directory."), _("Provide a Valid Directory")) + return False + filePath = os.path.join(dirControl.GetValue(), MakeNameEndInExtension(nameControl.GetValue(), "." + fileExtension)) if os.path.exists(filePath): if allowOverwriteOnPrompt: @@ -88,6 +92,7 @@ def AddFilesToCurrentProject(paths, save=False): paths.remove(path) if paths: projectDocument.GetCommandProcessor().Submit(ProjectEditor.ProjectAddFilesCommand(projectDocument, paths)) + projectDocument.GetFirstView().DoSelectFiles([paths[0]]) if save: projectDocument.OnSaveDocument(projectDocument.GetFilename()) @@ -112,4 +117,4 @@ def PluralName(name): return name[0:-1] + 'ies' else: return name + 's' - + \ No newline at end of file