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 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) (limited to 'src/gui.cpp') 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. " -- cgit v1.2.3