8#include <filedialog/filedialog.h>
9#include <imgui/imgui.h>
10#include <imgui/imgui_internal.h>
33 ImGui::OpenPopup(
name);
34 show_request_ =
false;
37 ImGui::SetNextWindowSize(ImGui::GetMainViewport()->Size * 0.5f);
39 if(ImGui::BeginPopupModal(
name, &
show))
49auto deploy_panel::get_progress() const ->
float
51 if(deploy_jobs_.empty())
58 for(
const auto& kvp : deploy_jobs_)
60 if(kvp.second.is_ready())
66 return float(ready) / float(deploy_jobs_.size());
72 float progress = get_progress();
73 bool is_in_progress = progress < 0.99f;
74 return is_in_progress;
98 pm.save_project_settings(ctx);
101 if(
inspect(ctx, settings.standalone).edit_finished)
103 pm.save_project_settings(ctx);
106 if(
inspect(ctx, deploy_settings).edit_finished)
108 pm.save_deploy_settings();
114 ImGui::AlignedItem(0.5f,
115 ImGui::GetContentRegionAvail().
x,
119 if(ImGui::Button(
"Deploy", ImVec2(300.0f, 0.0f)))
129 auto sz = ImGui::GetContentRegionAvail().x * 0.6f;
130 ImGui::AlignedItem(0.5f,
131 ImGui::GetContentRegionAvail().
x,
135 ImGui::ProgressBar(get_progress(), ImVec2(sz, 0.0f));
138 for(
const auto& kvp : deploy_jobs_)
140 const auto&
name = kvp.first;
141 const auto& job = kvp.second;
143 auto text = fmt::format(
"{} - {}",
name.c_str(), (job.is_ready() ?
"Done." :
"In Progress..."));
144 auto sz = ImGui::CalcTextSize(text.c_str()).x;
145 ImGui::AlignedItem(0.5f,
146 ImGui::GetContentRegionAvail().
x,
150 ImGui::TextUnformatted(text.c_str());
deploy_panel(imgui_panels *parent)
auto is_deploying() const -> bool
void deploy_and_run(rtti::context &ctx, const deploy_settings ¶ms)
void on_frame_ui_render(rtti::context &ctx, const char *name)
std::vector< size_t > parent_
auto inspect(rtti::context &ctx, T &obj, const std::string &name={}) -> inspect_result
Convenience template function for inspecting objects of known type.
static auto deploy_project(rtti::context &ctx, const deploy_settings ¶ms) -> std::map< std::string, tpp::shared_future< void > >
static auto can_deploy_project(rtti::context &ctx, const deploy_settings ¶ms) -> bool
struct unravel::settings::app_settings app