feat: Add request restart option to debug menu (#2636)

<!--
Please provide as much information as possible about what your PR aims
to do.
PRs with no description will most likely be closed until more
information is provided.
If you're planing on changing fundamental behaviour or add big new
features, please open a GitHub Issue first before starting to work on
it.
If it's not something big and you still want to contact us about it,
feel free to do so !
-->

### Problem description
<!-- Describe the bug that you fixed/feature request that you
implemented, or link to an existing issue describing it -->
Hopefully this will help us debug the bugs that appear once ImHex
restarts a little easier.

### Screenshots
<!-- If your change is visual, take a screenshot showing it. Ideally,
make before/after sceenshots -->
<img width="372" height="182" alt="image"
src="https://github.com/user-attachments/assets/1f27443e-9eaa-465a-b545-c2bbf0b56ca4"
/>
This commit is contained in:
Nemoumbra
2026-01-29 23:16:55 +03:00
committed by GitHub
parent 71c71c5bbf
commit 70fdbd4a48

View File

@@ -26,6 +26,7 @@
#include <hex/ui/imgui_imhex_extensions.h>
#include <toasts/toast_notification.hpp>
#include <popups/popup_question.hpp>
#include <csignal>
#include <fonts/tabler_icons.hpp>
@@ -107,7 +108,14 @@ namespace hex::plugin::builtin {
if (ImGui::BeginTabItem("ImHex")) {
if (ImGui::BeginChild("Scrolling", ImGui::GetContentRegionAvail())) {
ImGui::Checkbox("Show Debug Variables", &dbg::impl::getDebugWindowState());
if (ImGui::Button("Request a restart")) {
TaskManager::doLater([] {
ui::PopupQuestion::open("hex.builtin.view.settings.restart_question"_lang,
ImHexApi::System::restartImHex,
[]{}
);
});
}
ImGuiExt::Header("Information");
ImGuiExt::TextFormatted("Running Tasks: {0}", TaskManager::getRunningTaskCount());
ImGuiExt::TextFormatted("Running Background Tasks: {0}", TaskManager::getRunningBackgroundTaskCount());