feat(mining): migrate the Windows Defender antivirus-help dialog to reference design

Bring renderAntivirusHelpDialog onto the reference design and remove its hardcoded
English (the last Wave-1 modal):
- struct-form BeginOverlayDialog(OverlayDialogSpec{BlurFloat, cardWidth 560,
  idSuffix antivirus}) replacing the legacy positional overload
- the hardcoded "Windows Defender Blocked Miner" title and all 10 step/intro/bullet
  strings -> TR() (11 new av_* keys + reuse `close`; 8-lang translations, Windows
  env vars / xmrig.exe kept literal, menu names localized)
- 2 StyledButton -> TactileButton, drop the footer divider, dp-scale the button widths
- CJK subset rebuilt (glyphs 1741->1751; kept — new glyphs are used)

NOTE: this dialog is inside #ifdef _WIN32, so the Linux build compiles it out and
cannot verify it — needs a Windows build to compile-check. The edits mirror the
already-verified daemon-update-prompt / migrate-to-seed struct-overlay pattern and
leave the ShellExecuteA call untouched. i18n.cpp + the daemon prompt (cross-platform)
build + ctest + hygiene clean on Linux.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-14 16:38:07 -05:00
parent 28288d7197
commit abbdf3f4f7
11 changed files with 125 additions and 24 deletions

View File

@@ -3820,42 +3820,43 @@ void App::renderAntivirusHelpDialog()
#ifdef _WIN32
if (!pending_antivirus_dialog_) return;
if (!ui::material::BeginOverlayDialog("Windows Defender Blocked Miner", &pending_antivirus_dialog_, 560.0f, 0.94f)) {
ui::material::OverlayDialogSpec ov;
ov.title = TR("av_title"); ov.p_open = &pending_antivirus_dialog_;
ov.style = ui::material::OverlayStyle::BlurFloat;
ov.cardWidth = 560.0f; ov.idSuffix = "antivirus";
if (!ui::material::BeginOverlayDialog(ov)) {
return;
}
ImGui::TextWrapped(
"Mining software is often flagged as potentially unwanted. "
"Follow these steps to enable pool mining:");
const float dp = ui::Layout::dpiScale();
ImGui::TextWrapped("%s", TR("av_intro"));
ImGui::Dummy(ImVec2(0, ui::Layout::spacingSm()));
ui::material::Type().text(ui::material::TypeStyle::Subtitle2, "Step 1: Add Exclusion");
ImGui::BulletText("Open Windows Security > Virus & threat protection");
ImGui::BulletText("Click Manage settings > Exclusions > Add or remove");
ImGui::BulletText("Add folder: %%APPDATA%%\\ObsidianDragon\\");
ui::material::Type().text(ui::material::TypeStyle::Subtitle2, TR("av_step1"));
ImGui::BulletText("%s", TR("av_step1_b1"));
ImGui::BulletText("%s", TR("av_step1_b2"));
ImGui::BulletText("%s", TR("av_step1_b3"));
ImGui::Dummy(ImVec2(0, ui::Layout::spacingSm()));
ui::material::Type().text(ui::material::TypeStyle::Subtitle2, "Step 2: Restore from Quarantine (if needed)");
ImGui::BulletText("Windows Security > Protection history");
ImGui::BulletText("Find xmrig.exe and click Restore");
ui::material::Type().text(ui::material::TypeStyle::Subtitle2, TR("av_step2"));
ImGui::BulletText("%s", TR("av_step2_b1"));
ImGui::BulletText("%s", TR("av_step2_b2"));
ImGui::Dummy(ImVec2(0, ui::Layout::spacingSm()));
ui::material::Type().text(ui::material::TypeStyle::Subtitle2, "Step 3: Restart wallet and try again");
ui::material::Type().text(ui::material::TypeStyle::Subtitle2, TR("av_step3"));
ImGui::Dummy(ImVec2(0, ui::Layout::spacingMd()));
ImGui::Separator();
ImGui::Dummy(ImVec2(0, ui::Layout::spacingSm()));
float btnW = 160.0f;
if (ui::material::StyledButton("Open Windows Security", ImVec2(btnW, 0))) {
float btnW = 160.0f * dp;
if (ui::material::TactileButton(TR("av_open_security"), ImVec2(btnW, 0))) {
// Open Windows Security app to the exclusions page
ShellExecuteA(NULL, "open", "windowsdefender://threat", NULL, NULL, SW_SHOWNORMAL);
}
ImGui::SameLine();
if (ui::material::StyledButton("Close", ImVec2(100.0f, 0))) {
if (ui::material::TactileButton(TR("close"), ImVec2(100.0f * dp, 0))) {
pending_antivirus_dialog_ = false;
}
ui::material::EndOverlayDialog();
#endif
}