diff --git a/external/solanaceae_tox b/external/solanaceae_tox index 3c25162..e28c250 160000 --- a/external/solanaceae_tox +++ b/external/solanaceae_tox @@ -1 +1 @@ -Subproject commit 3c25162ba1ffa03583059ef374590fdb1ede2203 +Subproject commit e28c2502d67027f9183a0abe19cd7c9260d54c1c diff --git a/src/start_screen.cpp b/src/start_screen.cpp index da1498e..5276e46 100644 --- a/src/start_screen.cpp +++ b/src/start_screen.cpp @@ -24,8 +24,20 @@ Screen* StartScreen::poll(bool&) { if (ImGui::BeginTabBar("view")) { if (ImGui::BeginTabItem("load profile")) { - ImGui::Text("TODO: profile path"); + if (ImGui::Button("select")) { + _fss.requestFile( + [](const auto& path) -> bool { return std::filesystem::is_regular_file(path); }, + [this](const auto& path) { + tox_profile_path = path.string(); + }, + [](){} + ); + } + ImGui::SameLine(); + ImGui::Text("profile: %s", tox_profile_path.c_str()); + ImGui::Text("TODO: profile password"); + ImGui::EndTabItem(); } if (ImGui::BeginTabItem("create profile")) { @@ -66,7 +78,7 @@ Screen* StartScreen::poll(bool&) { ImGui::Separator(); if (ImGui::Button("load", {60, 25})) { - auto new_screen = std::make_unique(_renderer, "tomato.tox", queued_plugin_paths); + auto new_screen = std::make_unique(_renderer, tox_profile_path, queued_plugin_paths); return new_screen.release(); } diff --git a/src/start_screen.hpp b/src/start_screen.hpp index e628e58..e198678 100644 --- a/src/start_screen.hpp +++ b/src/start_screen.hpp @@ -16,6 +16,7 @@ struct StartScreen final : public Screen { SDL_Renderer* _renderer; FileSelector _fss; + std::string tox_profile_path {"tomato.tox"}; std::vector queued_plugin_paths; StartScreen(void) = delete;