2023-11-10 20:47:08 +01:00
|
|
|
#pragma once
|
|
|
|
|
2023-04-08 00:58:53 +02:00
|
|
|
#include <hex/ui/popup.hpp>
|
|
|
|
|
2023-11-21 14:38:01 +01:00
|
|
|
#include <hex/api/localization_manager.hpp>
|
2023-04-08 00:58:53 +02:00
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
namespace hex::plugin::builtin {
|
|
|
|
|
|
|
|
class PopupTasksWaiting : public Popup<PopupTasksWaiting> {
|
|
|
|
public:
|
|
|
|
PopupTasksWaiting()
|
|
|
|
: hex::Popup<PopupTasksWaiting>("hex.builtin.popup.waiting_for_tasks.title", false) { }
|
|
|
|
|
|
|
|
void drawContent() override {
|
|
|
|
ImGui::TextUnformatted("hex.builtin.popup.waiting_for_tasks.desc"_lang);
|
|
|
|
ImGui::Separator();
|
|
|
|
|
|
|
|
ImGui::SetCursorPosX((ImGui::GetWindowWidth() - ImGui::CalcTextSize("[-]").x) / 2);
|
2023-11-16 22:24:06 +01:00
|
|
|
ImGuiExt::TextSpinner("");
|
2023-04-08 00:58:53 +02:00
|
|
|
ImGui::NewLine();
|
|
|
|
ImGui::SetCursorPosX((ImGui::GetWindowWidth() - 150_scaled) / 2);
|
2023-12-23 21:09:41 +01:00
|
|
|
if (ImGui::ButtonEx("hex.ui.common.cancel"_lang, ImVec2(150, 0)) || ImGui::IsKeyDown(ImGuiKey_Escape))
|
2023-04-08 00:58:53 +02:00
|
|
|
ImGui::CloseCurrentPopup();
|
|
|
|
|
|
|
|
if (TaskManager::getRunningTaskCount() == 0 && TaskManager::getRunningBackgroundTaskCount() == 0) {
|
|
|
|
ImGui::CloseCurrentPopup();
|
|
|
|
ImHexApi::System::closeImHex();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
[[nodiscard]] ImGuiWindowFlags getFlags() const override {
|
|
|
|
return ImGuiWindowFlags_NoResize | ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoMove;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|