]> git.saurik.com Git - wxWidgets.git/blobdiff - wxPython/samples/ide/activegrid/tool/UICommon.py
removed patch 1373127
[wxWidgets.git] / wxPython / samples / ide / activegrid / tool / UICommon.py
index 0f83b65e9159a427b09e4c06c1ac735b5cef54f8..98f863a9da49319c2a5a652808403189f03cb8aa 100644 (file)
@@ -14,6 +14,7 @@ import os
 import os.path
 import wx
 import ProjectEditor
+import activegrid.util as utillib
 _ = wx.GetTranslation
 
 def CreateDirectoryControl( parent, fileLabel, dirLabel, fileExtension, startingName="", startingDirectory=""):
@@ -56,6 +57,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 +93,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())
 
@@ -113,3 +119,10 @@ def PluralName(name):
     else:
         return name + 's'
            
+def GetPythonExecPath():
+    pythonExecPath = wx.ConfigBase_Get().Read("ActiveGridPythonLocation")
+    if not pythonExecPath:
+        pythonExecPath = utillib.pythonExecPath
+    return pythonExecPath
+    
+