From d54c7f9e117ba9ee71c717c88a135d95ae8900e6 Mon Sep 17 00:00:00 2001 From: DanS Date: Tue, 16 Jun 2026 02:01:40 -0500 Subject: [PATCH] fix(lite): "Open data folder" points to the actual lite wallet dir MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The lite SilentDragonXLite backend stores its wallet in its own directory (dirs::data_dir()/silentdragonxlite — %APPDATA%\silentdragonxlite on Windows, ~/.silentdragonxlite on Linux, ~/Library/Application Support/silentdragonxlite on macOS), NOT the full-node getDragonXDataDir() (…/Hush/DRAGONX). The newly added lite "Open data folder" button opened the wrong (full-node) directory. Add Platform::getLiteWalletDataDir() mirroring the backend's get_zcash_data_path for the "main" chain, and point the lite button at it. The full-node button is unchanged. Co-Authored-By: Claude Opus 4.8 --- src/ui/pages/settings_page.cpp | 6 ++++-- src/util/platform.cpp | 18 ++++++++++++++++++ src/util/platform.h | 9 +++++++++ 3 files changed, 31 insertions(+), 2 deletions(-) diff --git a/src/ui/pages/settings_page.cpp b/src/ui/pages/settings_page.cpp index 4a35145..6dee018 100644 --- a/src/ui/pages/settings_page.cpp +++ b/src/ui/pages/settings_page.cpp @@ -1652,11 +1652,13 @@ void RenderSettingsPage(App* app) { } } - // Open the wallet data folder in the OS file manager (always available in lite). + // Open the lite wallet data folder in the OS file manager (always available in + // lite). The lite backend stores its wallet in its OWN dir (silentdragonxlite), + // NOT the full-node getDragonXDataDir(). ImGui::Dummy(ImVec2(0, Layout::spacingSm())); ImGui::SetCursorScreenPos(ImVec2(leftX, ImGui::GetCursorScreenPos().y)); if (TactileButton(TR("settings_open_data_dir"), ImVec2(0, 0), S.resolveFont("button"))) { - util::Platform::openFolder(util::Platform::getDragonXDataDir()); + util::Platform::openFolder(util::Platform::getLiteWalletDataDir()); } if (ImGui::IsItemHovered()) ImGui::SetTooltip("%s", TR("tt_open_data_dir")); diff --git a/src/util/platform.cpp b/src/util/platform.cpp index a2f1cda..8b2e55b 100644 --- a/src/util/platform.cpp +++ b/src/util/platform.cpp @@ -219,6 +219,24 @@ std::string Platform::getDataDir() return getDragonXDataDir(); } +std::string Platform::getLiteWalletDataDir() +{ + // Mirror the SilentDragonXLite backend's get_zcash_data_path() for the "main" chain: + // Windows/macOS: dirs::data_dir()/silentdragonxlite (data_dir = %APPDATA%, ~/Library/App Support) + // Linux: ~/.silentdragonxlite +#ifdef _WIN32 + char path[MAX_PATH]; + if (SUCCEEDED(SHGetFolderPathA(nullptr, CSIDL_APPDATA, nullptr, 0, path))) { + return std::string(path) + "\\silentdragonxlite\\"; + } + return getHomeDir() + "\\AppData\\Roaming\\silentdragonxlite\\"; +#elif defined(__APPLE__) + return getHomeDir() + "/Library/Application Support/silentdragonxlite/"; +#else + return getHomeDir() + "/.silentdragonxlite/"; +#endif +} + std::string Platform::getConfigDir() { #ifdef _WIN32 diff --git a/src/util/platform.h b/src/util/platform.h index ba3f6c2..35ea134 100644 --- a/src/util/platform.h +++ b/src/util/platform.h @@ -61,6 +61,15 @@ public: * @return Path like ~/.hush/DRAGONX/ or %APPDATA%\Hush\DRAGONX\ */ static std::string getDataDir(); + + /** + * @brief Get the LITE wallet data directory (where the SilentDragonXLite backend stores + * silentdragonxlite-wallet.dat). Mirrors the backend's get_zcash_data_path() for the + * "main" chain: dirs::data_dir()/silentdragonxlite on Windows/macOS, ~/.silentdragonxlite + * on Linux. Distinct from getDragonXDataDir() (the full-node blocks/wallet dir). + * @return Path like ~/.silentdragonxlite/ or %APPDATA%\silentdragonxlite\ + */ + static std::string getLiteWalletDataDir(); /** * @brief Get the config directory for storing wallet exports/backups