mirror of
https://github.com/antopilo/Nuake.git
synced 2026-09-21 20:08:40 +03:00
Added OpenFolderDialog + now project creation selects folder instead
This commit is contained in:
@@ -139,28 +139,26 @@ namespace Nuake
|
||||
ImGui::InputText("##Location", &location); ImGui::SameLine();
|
||||
if (ImGui::Button((ICON_FA_FOLDER + std::string("##folderOpen")).c_str()))
|
||||
{
|
||||
std::string folderPath = Nuake::FileDialog::SaveFile("Project File\0*.project");
|
||||
std::string folderPath = Nuake::FileDialog::OpenFolder();
|
||||
folderPath = Nuake::String::ReplaceSlash(folderPath);
|
||||
|
||||
|
||||
if (!folderPath.empty())
|
||||
{
|
||||
auto splits = Nuake::String::Split(folderPath, '/');
|
||||
projectFileName = splits[splits.size() - 1];
|
||||
if (!Nuake::String::EndsWith(projectFileName, ".project"))
|
||||
{
|
||||
projectFileName += ".project";
|
||||
}
|
||||
|
||||
|
||||
location = "";
|
||||
|
||||
for (int i = 0; i < splits.size() - 1; i++)
|
||||
for (int i = 0; i < splits.size(); i++)
|
||||
{
|
||||
location += splits[i] + "/";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
projectFileName = Nuake::String::RemoveWhiteSpace(projectTitle) + ".project";
|
||||
|
||||
finalLocation = location;
|
||||
static std::string projectParentPath = location;
|
||||
projectParentPath = location;
|
||||
|
||||
Reference in New Issue
Block a user