1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-14 14:24:10 +02:00

Small fixes

This commit is contained in:
Brian Fiete 2019-09-18 08:18:20 -07:00
parent 4a809f3364
commit 4f2472c276
5 changed files with 62 additions and 22 deletions

View file

@ -1694,6 +1694,22 @@ namespace IDE.ui
return null;
}
if (!gApp.mWorkspace.IsInitialized)
{
String projPath = scope .();
Path.GetDirectoryPath(filePath, projPath);
projPath.Concat(Path.DirectorySeparatorChar, "BeefSpace.toml");
gApp.OpenWorkspace(projPath);
for (let project in gApp.mWorkspace.mProjects)
{
if (Path.Equals(project.mProjectPath, filePath))
return project;
}
return null;
}
bool failed = false;
String projName = scope String();
Path.GetFileNameWithoutExtension(filePath, projName);
@ -1729,8 +1745,15 @@ namespace IDE.ui
fileDialog.Title = "Import Project";
fileDialog.Multiselect = false;
var initialDir = scope String(IDEApp.sApp.mWorkspace.mDir);
//initialDir.Replace('/', '\\');
var initialDir = scope String();
if (gApp.mWorkspace.mDir != null)
initialDir.Append(gApp.mWorkspace.mDir);
else
{
if (gApp.mInstallDir.Length > 0)
Path.GetDirectoryPath(.(gApp.mInstallDir, 0, gApp.mInstallDir.Length - 1), initialDir);
initialDir.Concat(Path.DirectorySeparatorChar, "Samples");
}
fileDialog.InitialDirectory = initialDir;
fileDialog.ValidateNames = true;