ecere/gui/PathBox; ide/ProjectSettings: (#979) Refinement of #741 browsing fix
authorJerome St-Louis <jerome@ecere.com>
Wed, 7 Aug 2013 22:27:39 +0000 (18:27 -0400)
committerJerome St-Louis <jerome@ecere.com>
Wed, 7 Aug 2013 22:27:39 +0000 (18:27 -0400)
ecere/src/gui/controls/PathBox.ec
ide/src/ProjectSettings.ec

index 1f818a7..159361c 100644 (file)
@@ -199,11 +199,11 @@ public class PathBox : CommonControl
 
             browsePath[0] = '\0';
             strncpy(browsePath, browseDialog.filePath, MAX_LOCATION); browsePath[MAX_LOCATION-1] = '\0';
-            if(dirsBox && dirsBox.baseBrowsePath && dirsBox.baseBrowsePath[0])
+            if(dirsBox && dirsBox.baseBrowsePath && dirsBox.baseBrowsePath[0] && ((ebContents && ebContents[0]) || !backFilePath || !backFilePath[0]))
                PathCat(browsePath, dirsBox.baseBrowsePath);
             PathCat(browsePath, ebContents);
             browseDialog.filePath = (ebContents && ebContents[0]) ? browsePath : "";
-            if(pathBox.typeExpected == directory && browsePath[0] && FileExists(browsePath).isDirectory)
+            if(pathBox.typeExpected == directory && browsePath[0] && FileExists(browsePath).isDirectory && backFilePath && backFilePath[0])
                StripLastDirectory(browsePath, browsePath);
             while(browsePath[0] && !FileExists(browsePath).isDirectory)
                StripLastDirectory(browsePath, browsePath);
index ae07886..0b0269f 100644 (file)
@@ -1007,6 +1007,7 @@ private:
 
    editor = DirectoriesBox
    {
+      browseDialog = { };
       bool NotifyModified(DirectoriesBox dirsBox)
       {
          char * switchToDrop = ((DirsArrayOptionBox)dirsBox.id).switchToDrop;