diff --git a/src/app_sweep.cpp b/src/app_sweep.cpp index 7a1c739..760ca69 100644 --- a/src/app_sweep.cpp +++ b/src/app_sweep.cpp @@ -28,6 +28,9 @@ #include "ui/windows/request_payment_dialog.h" #include "ui/windows/validate_address_dialog.h" #include "ui/windows/address_label_dialog.h" +#include "ui/windows/shield_dialog.h" +#include "ui/windows/address_transfer_dialog.h" +#include "ui/windows/key_export_dialog.h" #include "ui/pages/settings_page.h" #include "util/platform.h" #include "wallet/wallet_capabilities.h" @@ -347,6 +350,29 @@ void App::buildSweepCatalog() add("modal-antivirus", ui::NavPage::Mining, [](App& a) { a.pending_antivirus_dialog_ = true; }, [](App& a) { a.pending_antivirus_dialog_ = false; }); + // Wave-2 fund/secret dialogs (setup never fires the async RPC — no button is clicked). + add("modal-shield", ui::NavPage::Send, + [](App&) { ui::ShieldDialog::showShieldCoinbase(); }, + [](App&) { ui::ShieldDialog::hide(); }); + add("modal-merge", ui::NavPage::Send, + [](App&) { ui::ShieldDialog::showMerge(); }, + [](App&) { ui::ShieldDialog::hide(); }); + // z->t transfer so the (converted) deshielding DialogWarningHeader renders. + add("modal-transfer", ui::NavPage::Overview, + [](App& a) { + ui::AddressTransferInfo info; + info.fromAddr = kDemoZAddr; + info.toAddr = "t1DemoTransparentReceiveAddress00000"; + info.fromBalance = 12.5; info.toBalance = 3.0; + info.fromIsZ = true; info.toIsZ = false; + ui::AddressTransferDialog::show(&a, info); + }, + [](App&) { ui::AddressTransferDialog::close(); }); + // Distinct from the settings "modal-export-key" (App::renderExportKeyDialog) — this is the + // per-address KeyExportDialog opened from Overview address rows. + add("modal-key-export", ui::NavPage::Overview, + [](App&) { ui::KeyExportDialog::show(kDemoZAddr, ui::KeyExportDialog::KeyType::Private); }, + [](App&) { ui::KeyExportDialog::hide(); }); add("modal-about", ui::NavPage::Overview, [](App& a) { a.show_about_ = true; }, [](App& a) { a.show_about_ = false; }); add("modal-settings", ui::NavPage::Settings, diff --git a/src/ui/windows/key_export_dialog.cpp b/src/ui/windows/key_export_dialog.cpp index 706bf6b..0222aa5 100644 --- a/src/ui/windows/key_export_dialog.cpp +++ b/src/ui/windows/key_export_dialog.cpp @@ -58,6 +58,16 @@ bool KeyExportDialog::isOpen() return s_open; } +void KeyExportDialog::hide() +{ + s_open = false; + s_fetching = false; + s_key.clear(); + s_show_key = false; + s_error.clear(); + releaseQr(); +} + void KeyExportDialog::render(App* app) { if (!s_open) return; diff --git a/src/ui/windows/key_export_dialog.h b/src/ui/windows/key_export_dialog.h index 0f48748..639b951 100644 --- a/src/ui/windows/key_export_dialog.h +++ b/src/ui/windows/key_export_dialog.h @@ -44,6 +44,11 @@ public: */ static bool isOpen(); + /** + * @brief Close the dialog and clear the revealed key (used by the UI sweep teardown) + */ + static void hide(); + private: static bool s_open; static bool s_fetching; diff --git a/src/ui/windows/shield_dialog.cpp b/src/ui/windows/shield_dialog.cpp index 495d0e4..50a0699 100644 --- a/src/ui/windows/shield_dialog.cpp +++ b/src/ui/windows/shield_dialog.cpp @@ -61,6 +61,14 @@ void ShieldDialog::showMerge() show(Mode::MergeToAddress); } +void ShieldDialog::hide() +{ + s_open = false; + s_operation_pending = false; + s_status_message.clear(); + s_operation_id.clear(); +} + void ShieldDialog::render(App* app) { if (!s_open) return; diff --git a/src/ui/windows/shield_dialog.h b/src/ui/windows/shield_dialog.h index f6a4035..296c32c 100644 --- a/src/ui/windows/shield_dialog.h +++ b/src/ui/windows/shield_dialog.h @@ -41,6 +41,11 @@ public: * @brief Render the dialog (call each frame) */ static void render(App* app); + + /** + * @brief Close the dialog (used by the UI sweep teardown) + */ + static void hide(); }; } // namespace ui