diff options
| author | bitflash <dev@bitflash.network> | 2026-08-19 10:00:29 -0300 |
|---|---|---|
| committer | bitflash <dev@bitflash.network> | 2026-08-19 10:00:29 -0300 |
| commit | 2bf8941be913c113e90a62094e6b69848a87ed38 (patch) | |
| tree | f3a0a59ff357f5c6d76e5d06befe4c7e9c274b83 /src/gui.cpp | |
| parent | d4c49085a10c0f7c3f5a1dcc72184938dca38fea (diff) | |
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.
Diffstat (limited to 'src/gui.cpp')
| -rw-r--r-- | src/gui.cpp | 30 |
1 files changed, 27 insertions, 3 deletions
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 @@ | |||
| 11 | #include <ctime> | 11 | #include <ctime> |
| 12 | #include <cstdio> | 12 | #include <cstdio> |
| 13 | #include <sstream> | 13 | #include <sstream> |
| 14 | #ifndef _WIN32 | 14 | #ifdef _WIN32 |
| 15 | #include <shellapi.h> // ShellExecuteA, to open the website in the browser | ||
| 16 | #else | ||
| 15 | #include <unistd.h> | 17 | #include <unistd.h> |
| 16 | #endif | 18 | #endif |
| 17 | #include <iomanip> | 19 | #include <iomanip> |
| @@ -1376,16 +1378,38 @@ static void DrawDiagnosticsDialog() | |||
| 1376 | ImGui::End(); | 1378 | ImGui::End(); |
| 1377 | } | 1379 | } |
| 1378 | 1380 | ||
| 1381 | static void OpenURL(const char* pszUrl) | ||
| 1382 | { | ||
| 1383 | #ifdef _WIN32 | ||
| 1384 | ShellExecuteA(NULL, "open", pszUrl, NULL, NULL, SW_SHOWNORMAL); | ||
| 1385 | #else | ||
| 1386 | std::string cmd = std::string("xdg-open '") + pszUrl + "' >/dev/null 2>&1 &"; | ||
| 1387 | int r = system(cmd.c_str()); | ||
| 1388 | (void)r; | ||
| 1389 | #endif | ||
| 1390 | } | ||
| 1391 | |||
| 1379 | static void DrawAboutDialog() | 1392 | static void DrawAboutDialog() |
| 1380 | { | 1393 | { |
| 1381 | if (!g_showAbout) return; | 1394 | if (!g_showAbout) return; |
| 1382 | ImGui::SetNextWindowSize(ImVec2(380.0f, 170.0f), ImGuiCond_Always); | 1395 | ImGui::SetNextWindowSize(ImVec2(380.0f, 205.0f), ImGuiCond_Always); |
| 1383 | ImGui::SetNextWindowPos(ImGui::GetMainViewport()->GetCenter(), | 1396 | ImGui::SetNextWindowPos(ImGui::GetMainViewport()->GetCenter(), |
| 1384 | ImGuiCond_Always, ImVec2(0.5f, 0.5f)); | 1397 | ImGuiCond_Always, ImVec2(0.5f, 0.5f)); |
| 1385 | if (ImGui::Begin("About Bitflash", &g_showAbout, | 1398 | if (ImGui::Begin("About Bitflash", &g_showAbout, |
| 1386 | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoCollapse)) | 1399 | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoCollapse)) |
| 1387 | { | 1400 | { |
| 1388 | ImGui::TextColored(ImVec4(1.0f, 0.6f, 0.0f, 1.0f), "Bitflash BTF v1.1.0"); | 1401 | ImGui::TextColored(ImVec4(1.0f, 0.6f, 0.0f, 1.0f), |
| 1402 | "Bitflash BTF v" BITFLASH_VERSION_STRING); | ||
| 1403 | ImGui::Spacing(); | ||
| 1404 | ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(0.40f, 0.70f, 1.0f, 1.0f)); | ||
| 1405 | ImGui::TextUnformatted("https://bitflash.network"); | ||
| 1406 | ImGui::PopStyleColor(); | ||
| 1407 | if (ImGui::IsItemHovered()) | ||
| 1408 | { | ||
| 1409 | ImGui::SetMouseCursor(ImGuiMouseCursor_Hand); | ||
| 1410 | if (ImGui::IsMouseClicked(0)) | ||
| 1411 | OpenURL("https://bitflash.network"); | ||
| 1412 | } | ||
| 1389 | ImGui::Spacing(); | 1413 | ImGui::Spacing(); |
| 1390 | ImGui::TextWrapped( | 1414 | ImGui::TextWrapped( |
| 1391 | "CPU-only cryptocurrency. RandomX proof of work. " | 1415 | "CPU-only cryptocurrency. RandomX proof of work. " |