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

Binary file not shown.

View File

@@ -55,6 +55,17 @@
"amount_label": "Betrag:", "amount_label": "Betrag:",
"appearance": "ERSCHEINUNGSBILD", "appearance": "ERSCHEINUNGSBILD",
"auto_shield": "Mining automatisch abschirmen", "auto_shield": "Mining automatisch abschirmen",
"av_intro": "Mining-Software wird oft als potenziell unerwünscht eingestuft. Führen Sie diese Schritte aus, um das Pool-Mining zu aktivieren:",
"av_open_security": "Windows-Sicherheit öffnen",
"av_step1": "Schritt 1: Ausnahme hinzufügen",
"av_step1_b1": "Öffnen Sie Windows-Sicherheit > Viren- & Bedrohungsschutz",
"av_step1_b2": "Klicken Sie auf Einstellungen verwalten > Ausschlüsse > Hinzufügen oder entfernen",
"av_step1_b3": "Ordner hinzufügen: %APPDATA%\\ObsidianDragon\\",
"av_step2": "Schritt 2: Aus Quarantäne wiederherstellen (falls nötig)",
"av_step2_b1": "Windows-Sicherheit > Schutzverlauf",
"av_step2_b2": "Suchen Sie xmrig.exe und klicken Sie auf Wiederherstellen",
"av_step3": "Schritt 3: Wallet neu starten und erneut versuchen",
"av_title": "Windows Defender hat den Miner blockiert",
"available": "Verfügbar", "available": "Verfügbar",
"backup_backing_up": "Sicherung läuft...", "backup_backing_up": "Sicherung läuft...",
"backup_create": "Sicherung erstellen", "backup_create": "Sicherung erstellen",

View File

@@ -55,6 +55,17 @@
"amount_label": "Cantidad:", "amount_label": "Cantidad:",
"appearance": "APARIENCIA", "appearance": "APARIENCIA",
"auto_shield": "Auto-proteger minería", "auto_shield": "Auto-proteger minería",
"av_intro": "El software de minería suele marcarse como potencialmente no deseado. Sigue estos pasos para habilitar la minería en pool:",
"av_open_security": "Abrir Seguridad de Windows",
"av_step1": "Paso 1: Agregar exclusión",
"av_step1_b1": "Abre Seguridad de Windows > Protección antivirus y contra amenazas",
"av_step1_b2": "Haz clic en Administrar configuración > Exclusiones > Agregar o quitar",
"av_step1_b3": "Agrega la carpeta: %APPDATA%\\ObsidianDragon\\",
"av_step2": "Paso 2: Restaurar desde cuarentena (si es necesario)",
"av_step2_b1": "Seguridad de Windows > Historial de protección",
"av_step2_b2": "Busca xmrig.exe y haz clic en Restaurar",
"av_step3": "Paso 3: Reinicia el monedero e inténtalo de nuevo",
"av_title": "Windows Defender bloqueó el minero",
"available": "Disponible", "available": "Disponible",
"backup_backing_up": "Respaldando...", "backup_backing_up": "Respaldando...",
"backup_create": "Crear Respaldo", "backup_create": "Crear Respaldo",

View File

@@ -55,6 +55,17 @@
"amount_label": "Montant :", "amount_label": "Montant :",
"appearance": "APPARENCE", "appearance": "APPARENCE",
"auto_shield": "Auto-blindage du minage", "auto_shield": "Auto-blindage du minage",
"av_intro": "Les logiciels de minage sont souvent signalés comme potentiellement indésirables. Suivez ces étapes pour activer le minage en pool :",
"av_open_security": "Ouvrir Sécurité Windows",
"av_step1": "Étape 1 : Ajouter une exclusion",
"av_step1_b1": "Ouvrez Sécurité Windows > Protection contre les virus et menaces",
"av_step1_b2": "Cliquez sur Gérer les paramètres > Exclusions > Ajouter ou supprimer",
"av_step1_b3": "Ajoutez le dossier : %APPDATA%\\ObsidianDragon\\",
"av_step2": "Étape 2 : Restaurer depuis la quarantaine (si nécessaire)",
"av_step2_b1": "Sécurité Windows > Historique de protection",
"av_step2_b2": "Trouvez xmrig.exe et cliquez sur Restaurer",
"av_step3": "Étape 3 : Redémarrez le portefeuille et réessayez",
"av_title": "Windows Defender a bloqué le mineur",
"available": "Disponible", "available": "Disponible",
"backup_backing_up": "Sauvegarde en cours...", "backup_backing_up": "Sauvegarde en cours...",
"backup_create": "Créer une sauvegarde", "backup_create": "Créer une sauvegarde",

View File

@@ -55,6 +55,17 @@
"amount_label": "金額:", "amount_label": "金額:",
"appearance": "外観", "appearance": "外観",
"auto_shield": "マイニング自動シールド", "auto_shield": "マイニング自動シールド",
"av_intro": "マイニングソフトウェアは、望ましくない可能性があるものとしてフラグが立てられることがよくあります。プールマイニングを有効にするには、次の手順に従ってください。",
"av_open_security": "Windows セキュリティを開く",
"av_step1": "ステップ1: 除外の追加",
"av_step1_b1": "Windows セキュリティ > ウイルスと脅威の防止 を開く",
"av_step1_b2": "設定の管理 > 除外 > 追加または削除 をクリック",
"av_step1_b3": "フォルダーを追加: %APPDATA%\\ObsidianDragon\\",
"av_step2": "ステップ2: 検疫から復元(必要な場合)",
"av_step2_b1": "Windows セキュリティ > 保護の履歴",
"av_step2_b2": "xmrig.exe を見つけて「復元」をクリック",
"av_step3": "ステップ3: ウォレットを再起動して再試行",
"av_title": "Windows Defender がマイナーをブロックしました",
"available": "利用可能", "available": "利用可能",
"backup_backing_up": "バックアップ中...", "backup_backing_up": "バックアップ中...",
"backup_create": "バックアップを作成", "backup_create": "バックアップを作成",

View File

@@ -55,6 +55,17 @@
"amount_label": "금액:", "amount_label": "금액:",
"appearance": "외관", "appearance": "외관",
"auto_shield": "채굴 자동 차폐", "auto_shield": "채굴 자동 차폐",
"av_intro": "채굴 소프트웨어는 종종 잠재적으로 원치 않는 항목으로 표시됩니다. 풀 채굴을 활성화하려면 다음 단계를 따르세요:",
"av_open_security": "Windows 보안 열기",
"av_step1": "1단계: 제외 추가",
"av_step1_b1": "Windows 보안 > 바이러스 및 위협 방지 열기",
"av_step1_b2": "설정 관리 > 제외 > 추가 또는 제거 클릭",
"av_step1_b3": "폴더 추가: %APPDATA%\\ObsidianDragon\\",
"av_step2": "2단계: 격리에서 복원(필요한 경우)",
"av_step2_b1": "Windows 보안 > 보호 기록",
"av_step2_b2": "xmrig.exe를 찾아 복원 클릭",
"av_step3": "3단계: 지갑을 다시 시작하고 다시 시도",
"av_title": "Windows Defender가 채굴기를 차단했습니다",
"available": "사용 가능", "available": "사용 가능",
"backup_backing_up": "백업 중...", "backup_backing_up": "백업 중...",
"backup_create": "백업 생성", "backup_create": "백업 생성",

View File

@@ -55,6 +55,17 @@
"amount_label": "Valor:", "amount_label": "Valor:",
"appearance": "APARÊNCIA", "appearance": "APARÊNCIA",
"auto_shield": "Auto-blindar mineração", "auto_shield": "Auto-blindar mineração",
"av_intro": "Softwares de mineração costumam ser sinalizados como potencialmente indesejados. Siga estes passos para habilitar a mineração em pool:",
"av_open_security": "Abrir Segurança do Windows",
"av_step1": "Passo 1: Adicionar exclusão",
"av_step1_b1": "Abra Segurança do Windows > Proteção contra vírus e ameaças",
"av_step1_b2": "Clique em Gerenciar configurações > Exclusões > Adicionar ou remover",
"av_step1_b3": "Adicione a pasta: %APPDATA%\\ObsidianDragon\\",
"av_step2": "Passo 2: Restaurar da quarentena (se necessário)",
"av_step2_b1": "Segurança do Windows > Histórico de proteção",
"av_step2_b2": "Encontre xmrig.exe e clique em Restaurar",
"av_step3": "Passo 3: Reinicie a carteira e tente novamente",
"av_title": "Windows Defender bloqueou o minerador",
"available": "Disponível", "available": "Disponível",
"backup_backing_up": "Fazendo backup...", "backup_backing_up": "Fazendo backup...",
"backup_create": "Criar Backup", "backup_create": "Criar Backup",

View File

@@ -55,6 +55,17 @@
"amount_label": "Сумма:", "amount_label": "Сумма:",
"appearance": "ВНЕШНИЙ ВИД", "appearance": "ВНЕШНИЙ ВИД",
"auto_shield": "Авто-экранирование майнинга", "auto_shield": "Авто-экранирование майнинга",
"av_intro": "Программы для майнинга часто помечаются как потенциально нежелательные. Выполните эти шаги, чтобы включить пул-майнинг:",
"av_open_security": "Открыть Безопасность Windows",
"av_step1": "Шаг 1: Добавить исключение",
"av_step1_b1": "Откройте Безопасность Windows > Защита от вирусов и угроз",
"av_step1_b2": "Нажмите Управление настройками > Исключения > Добавить или удалить",
"av_step1_b3": "Добавьте папку: %APPDATA%\\ObsidianDragon\\",
"av_step2": "Шаг 2: Восстановить из карантина (при необходимости)",
"av_step2_b1": "Безопасность Windows > Журнал защиты",
"av_step2_b2": "Найдите xmrig.exe и нажмите Восстановить",
"av_step3": "Шаг 3: Перезапустите кошелёк и попробуйте снова",
"av_title": "Windows Defender заблокировал майнер",
"available": "Доступно", "available": "Доступно",
"backup_backing_up": "Создание резервной копии...", "backup_backing_up": "Создание резервной копии...",
"backup_create": "Создать резервную копию", "backup_create": "Создать резервную копию",

View File

@@ -55,6 +55,17 @@
"amount_label": "金额:", "amount_label": "金额:",
"appearance": "外观", "appearance": "外观",
"auto_shield": "自动屏蔽挖矿", "auto_shield": "自动屏蔽挖矿",
"av_intro": "挖矿软件经常被标记为潜在有害程序。请按照以下步骤启用矿池挖矿:",
"av_open_security": "打开 Windows 安全中心",
"av_step1": "第 1 步:添加排除项",
"av_step1_b1": "打开 Windows 安全中心 > 病毒和威胁防护",
"av_step1_b2": "单击 管理设置 > 排除项 > 添加或删除",
"av_step1_b3": "添加文件夹:%APPDATA%\\ObsidianDragon\\",
"av_step2": "第 2 步:从隔离区还原(如果需要)",
"av_step2_b1": "Windows 安全中心 > 保护历史记录",
"av_step2_b2": "找到 xmrig.exe 并单击“还原”",
"av_step3": "第 3 步:重启钱包并重试",
"av_title": "Windows Defender 已阻止矿工程序",
"available": "可用", "available": "可用",
"backup_backing_up": "正在备份...", "backup_backing_up": "正在备份...",
"backup_create": "创建备份", "backup_create": "创建备份",

View File

@@ -3820,39 +3820,40 @@ void App::renderAntivirusHelpDialog()
#ifdef _WIN32 #ifdef _WIN32
if (!pending_antivirus_dialog_) return; 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; return;
} }
const float dp = ui::Layout::dpiScale();
ImGui::TextWrapped( ImGui::TextWrapped("%s", TR("av_intro"));
"Mining software is often flagged as potentially unwanted. "
"Follow these steps to enable pool mining:");
ImGui::Dummy(ImVec2(0, ui::Layout::spacingSm())); ImGui::Dummy(ImVec2(0, ui::Layout::spacingSm()));
ui::material::Type().text(ui::material::TypeStyle::Subtitle2, "Step 1: Add Exclusion"); ui::material::Type().text(ui::material::TypeStyle::Subtitle2, TR("av_step1"));
ImGui::BulletText("Open Windows Security > Virus & threat protection"); ImGui::BulletText("%s", TR("av_step1_b1"));
ImGui::BulletText("Click Manage settings > Exclusions > Add or remove"); ImGui::BulletText("%s", TR("av_step1_b2"));
ImGui::BulletText("Add folder: %%APPDATA%%\\ObsidianDragon\\"); ImGui::BulletText("%s", TR("av_step1_b3"));
ImGui::Dummy(ImVec2(0, ui::Layout::spacingSm())); ImGui::Dummy(ImVec2(0, ui::Layout::spacingSm()));
ui::material::Type().text(ui::material::TypeStyle::Subtitle2, "Step 2: Restore from Quarantine (if needed)"); ui::material::Type().text(ui::material::TypeStyle::Subtitle2, TR("av_step2"));
ImGui::BulletText("Windows Security > Protection history"); ImGui::BulletText("%s", TR("av_step2_b1"));
ImGui::BulletText("Find xmrig.exe and click Restore"); ImGui::BulletText("%s", TR("av_step2_b2"));
ImGui::Dummy(ImVec2(0, ui::Layout::spacingSm())); 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::Dummy(ImVec2(0, ui::Layout::spacingMd()));
ImGui::Separator();
ImGui::Dummy(ImVec2(0, ui::Layout::spacingSm()));
float btnW = 160.0f; float btnW = 160.0f * dp;
if (ui::material::StyledButton("Open Windows Security", ImVec2(btnW, 0))) { if (ui::material::TactileButton(TR("av_open_security"), ImVec2(btnW, 0))) {
// Open Windows Security app to the exclusions page // Open Windows Security app to the exclusions page
ShellExecuteA(NULL, "open", "windowsdefender://threat", NULL, NULL, SW_SHOWNORMAL); ShellExecuteA(NULL, "open", "windowsdefender://threat", NULL, NULL, SW_SHOWNORMAL);
} }
ImGui::SameLine(); 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; pending_antivirus_dialog_ = false;
} }

View File

@@ -1940,6 +1940,18 @@ void I18n::loadBuiltinEnglish()
strings_["explorer_txid"] = "TxID:"; strings_["explorer_txid"] = "TxID:";
strings_["explorer_prev_block"] = "Previous block"; strings_["explorer_prev_block"] = "Previous block";
strings_["explorer_next_block"] = "Next block"; strings_["explorer_next_block"] = "Next block";
// --- Antivirus (Windows Defender) help dialog (Windows-only) ---
strings_["av_title"] = "Windows Defender Blocked Miner";
strings_["av_intro"] = "Mining software is often flagged as potentially unwanted. Follow these steps to enable pool mining:";
strings_["av_step1"] = "Step 1: Add Exclusion";
strings_["av_step1_b1"] = "Open Windows Security > Virus & threat protection";
strings_["av_step1_b2"] = "Click Manage settings > Exclusions > Add or remove";
strings_["av_step1_b3"] = "Add folder: %APPDATA%\\ObsidianDragon\\";
strings_["av_step2"] = "Step 2: Restore from Quarantine (if needed)";
strings_["av_step2_b1"] = "Windows Security > Protection history";
strings_["av_step2_b2"] = "Find xmrig.exe and click Restore";
strings_["av_step3"] = "Step 3: Restart wallet and try again";
strings_["av_open_security"] = "Open Windows Security";
strings_["explorer_invalid_query"] = "Enter a block height or 64-character hash"; strings_["explorer_invalid_query"] = "Enter a block height or 64-character hash";
strings_["explorer_invalid_response"] = "Invalid response from daemon"; strings_["explorer_invalid_response"] = "Invalid response from daemon";
strings_["explorer_hash_not_found"] = "No block or transaction found for this hash"; strings_["explorer_hash_not_found"] = "No block or transaction found for this hash";