From 2bf8941be913c113e90a62094e6b69848a87ed38 Mon Sep 17 00:00:00 2001 From: bitflash Date: Wed, 19 Aug 2026 10:00:29 -0300 Subject: gui: show the real version in About, add the website link The About dialog had "v1.1.0" hardcoded and no home for the release version, so it drifted. Add a single BITFLASH_VERSION_STRING in headers_core.h (bumped at release, unrelated to the protocol nVersion fields) and show it in About -- now v1.2.20. Fill the empty line under the version with a clickable https://bitflash.network that opens in the browser (ShellExecute on Windows, xdg-open elsewhere), and grow the dialog to fit it. --- src/gui.cpp | 30 +++++++++++++++++++++++++++--- src/headers_core.h | 5 +++++ 2 files changed, 32 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/gui.cpp b/src/gui.cpp index 296d20c..2a7f350 100644 --- a/src/gui.cpp +++ b/src/gui.cpp @@ -11,7 +11,9 @@ #include #include #include -#ifndef _WIN32 +#ifdef _WIN32 +#include // ShellExecuteA, to open the website in the browser +#else #include #endif #include @@ -1376,16 +1378,38 @@ static void DrawDiagnosticsDialog() ImGui::End(); } +static void OpenURL(const char* pszUrl) +{ +#ifdef _WIN32 + ShellExecuteA(NULL, "open", pszUrl, NULL, NULL, SW_SHOWNORMAL); +#else + std::string cmd = std::string("xdg-open '") + pszUrl + "' >/dev/null 2>&1 &"; + int r = system(cmd.c_str()); + (void)r; +#endif +} + static void DrawAboutDialog() { if (!g_showAbout) return; - ImGui::SetNextWindowSize(ImVec2(380.0f, 170.0f), ImGuiCond_Always); + ImGui::SetNextWindowSize(ImVec2(380.0f, 205.0f), ImGuiCond_Always); ImGui::SetNextWindowPos(ImGui::GetMainViewport()->GetCenter(), ImGuiCond_Always, ImVec2(0.5f, 0.5f)); if (ImGui::Begin("About Bitflash", &g_showAbout, ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoCollapse)) { - ImGui::TextColored(ImVec4(1.0f, 0.6f, 0.0f, 1.0f), "Bitflash BTF v1.1.0"); + ImGui::TextColored(ImVec4(1.0f, 0.6f, 0.0f, 1.0f), + "Bitflash BTF v" BITFLASH_VERSION_STRING); + ImGui::Spacing(); + ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(0.40f, 0.70f, 1.0f, 1.0f)); + ImGui::TextUnformatted("https://bitflash.network"); + ImGui::PopStyleColor(); + if (ImGui::IsItemHovered()) + { + ImGui::SetMouseCursor(ImGuiMouseCursor_Hand); + if (ImGui::IsMouseClicked(0)) + OpenURL("https://bitflash.network"); + } ImGui::Spacing(); ImGui::TextWrapped( "CPU-only cryptocurrency. RandomX proof of work. " diff --git a/src/headers_core.h b/src/headers_core.h index 6c0c602..f890c2f 100644 --- a/src/headers_core.h +++ b/src/headers_core.h @@ -1,6 +1,11 @@ // Core node headers -- no GUI framework dependency. // Included by gui.cpp and all non-GUI source files. +// The one place the human-readable release version lives -- bump it at release. +// It is what the About dialog shows. Protocol and transaction versions elsewhere +// (nVersion fields) are unrelated and must not be changed for a release. +#define BITFLASH_VERSION_STRING "1.2.20" + #ifdef _MSC_VER #pragma warning(disable:4786) #endif -- cgit v1.2.3